Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions AppListing/ce9287cf-d95e-44ad-8656-6c19fed7aafb.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"data": {
"meta": {
"adoptsFrom": {
"name": "AppListing",
"module": "https://realms-staging.stack.cards/catalog/catalog-app/listing/listing"
}
},
"type": "card",
"attributes": {
"name": "A Very Great Friend Card",
"images": [],
"summary": "The Friend catalog listing defines a card type representing a friend entity. Its primary purpose is to model a person's contact information, including their first name, an optional link to another Friend, and related metadata such as a description and thumbnail URL. The card provides fields for capturing and displaying a friend's name and associated imagery, facilitating the organization and presentation of friend records within a Cardstack-based application.",
"cardInfo": {
"name": null,
"notes": null,
"summary": null,
"cardThumbnailURL": null
}
},
"relationships": {
"skills": {
"links": {
"self": null
}
},
"tags.0": {
"links": {
"self": "https://realms-staging.stack.cards/catalog/Tag/140feda8-625b-4a24-9ddb-6f4da891aef2"
}
},
"tags.1": {
"links": {
"self": "https://realms-staging.stack.cards/catalog/Tag/4d0f9ae2-048e-4ce0-b263-7006602ce6a4"
}
},
"license": {
"links": {
"self": "https://realms-staging.stack.cards/catalog/License/4c5a023b-a72c-4f90-930b-da60a1de5b2d"
}
},
"specs.0": {
"links": {
"self": "../CatalogEntry/6"
}
},
"publisher": {
"links": {
"self": null
}
},
"categories": {
"links": {
"self": null
}
},
"examples.0": {
"links": {
"self": "../Friend/0af9ca5b-69a4-4e24-b988-3e689de2f124"
}
},
"examples.1": {
"links": {
"self": "../Friend/1b0ec553-ef40-4a3a-988f-1234ee721799"
}
},
"examples.2": {
"links": {
"self": "../Friend/effb6f3b-a208-4ffd-8fcf-6af6916f625d"
}
},
"examples.3": {
"links": {
"self": "../friend-1"
}
},
"cardInfo.theme": {
"links": {
"self": null
}
}
}
}
}
20 changes: 20 additions & 0 deletions CatalogEntry/6.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"data": {
"type": "card",
"attributes": {
"title": "Friend from /friend",
"description": "Spec for Friend from /friend",
"specType": "card",
"ref": {
"module": "../friend",
"name": "Friend"
}
},
"meta": {
"adoptsFrom": {
"module": "https://cardstack.com/base/spec",
"name": "Spec"
}
}
}
}
22 changes: 22 additions & 0 deletions Friend/0af9ca5b-69a4-4e24-b988-3e689de2f124.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"data": {
"type": "card",
"attributes": {
"firstName": null,
"thumbnailURL": null
},
"relationships": {
"friend": {
"links": {
"self": null
}
}
},
"meta": {
"adoptsFrom": {
"module": "../friend",
"name": "Friend"
}
}
}
}
22 changes: 22 additions & 0 deletions Friend/1b0ec553-ef40-4a3a-988f-1234ee721799.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"data": {
"type": "card",
"attributes": {
"firstName": "test",
"thumbnailURL": ""
},
"relationships": {
"friend": {
"links": {
"self": null
}
}
},
"meta": {
"adoptsFrom": {
"module": "../friend",
"name": "Friend"
}
}
}
}
22 changes: 22 additions & 0 deletions Friend/effb6f3b-a208-4ffd-8fcf-6af6916f625d.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"data": {
"type": "card",
"attributes": {
"firstName": null,
"thumbnailURL": null
},
"relationships": {
"friend": {
"links": {
"self": null
}
}
},
"meta": {
"adoptsFrom": {
"module": "../friend",
"name": "Friend"
}
}
}
}
22 changes: 22 additions & 0 deletions friend-1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"data": {
"type": "card",
"attributes": {
"firstName": "Mango Mango",
"cardThumbnailURL": "./green-mango.png"
},
"relationships": {
"friend": {
"links": {
"self": null
}
}
},
"meta": {
"adoptsFrom": {
"module": "./friend",
"name": "Friend"
}
}
}
}
43 changes: 43 additions & 0 deletions friend.gts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import {
contains,
linksTo,
field,
CardDef,
Component,
} from 'https://cardstack.com/base/card-api';
import NumberField from 'https://cardstack.com/base/number';
import StringField from 'https://cardstack.com/base/string';
import { GridContainer } from '@cardstack/boxel-ui/components';
import UserPlus from '@cardstack/boxel-icons/user-plus';

export class Friend extends CardDef {
static displayName = 'Friend';
static icon = UserPlus;
@field firstName = contains(StringField);
@field friend = linksTo(() => Friend);
@field test = contains(NumberField, {
computeVia: function () {
// make sure we don't blow up when '/' appears
return 10 / 2;
},
});
@field cardTitle = contains(StringField, {
computeVia: function (this: Friend) {
return this.firstName;
},
});
@field cardDescription = contains(StringField, {
computeVia: function (this: Friend) {
return `Friend`;
},
});
@field cardThumbnailURL = contains(StringField);

static embedded = class Embedded extends Component<typeof this> {
<template>
<GridContainer>
<@fields.firstName />
</GridContainer>
</template>
};
}
Loading