From 26cd2bf3a1b9905c4af1504812baa0e1609cdb79 Mon Sep 17 00:00:00 2001 From: Boxel Submission Bot Date: Wed, 11 Mar 2026 23:35:31 +0800 Subject: [PATCH] add A Very Great Friend Card changes [boxel-content-hash:4287c5272de0] --- .../ce9287cf-d95e-44ad-8656-6c19fed7aafb.json | 84 +++++++++++++++++++ CatalogEntry/6.json | 20 +++++ .../0af9ca5b-69a4-4e24-b988-3e689de2f124.json | 22 +++++ .../1b0ec553-ef40-4a3a-988f-1234ee721799.json | 22 +++++ .../effb6f3b-a208-4ffd-8fcf-6af6916f625d.json | 22 +++++ friend-1.json | 22 +++++ friend.gts | 43 ++++++++++ 7 files changed, 235 insertions(+) create mode 100644 AppListing/ce9287cf-d95e-44ad-8656-6c19fed7aafb.json create mode 100644 CatalogEntry/6.json create mode 100644 Friend/0af9ca5b-69a4-4e24-b988-3e689de2f124.json create mode 100644 Friend/1b0ec553-ef40-4a3a-988f-1234ee721799.json create mode 100644 Friend/effb6f3b-a208-4ffd-8fcf-6af6916f625d.json create mode 100644 friend-1.json create mode 100644 friend.gts diff --git a/AppListing/ce9287cf-d95e-44ad-8656-6c19fed7aafb.json b/AppListing/ce9287cf-d95e-44ad-8656-6c19fed7aafb.json new file mode 100644 index 0000000..a8e4c24 --- /dev/null +++ b/AppListing/ce9287cf-d95e-44ad-8656-6c19fed7aafb.json @@ -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 + } + } + } + } +} \ No newline at end of file diff --git a/CatalogEntry/6.json b/CatalogEntry/6.json new file mode 100644 index 0000000..b2f42c1 --- /dev/null +++ b/CatalogEntry/6.json @@ -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" + } + } + } +} diff --git a/Friend/0af9ca5b-69a4-4e24-b988-3e689de2f124.json b/Friend/0af9ca5b-69a4-4e24-b988-3e689de2f124.json new file mode 100644 index 0000000..a127f60 --- /dev/null +++ b/Friend/0af9ca5b-69a4-4e24-b988-3e689de2f124.json @@ -0,0 +1,22 @@ +{ + "data": { + "type": "card", + "attributes": { + "firstName": null, + "thumbnailURL": null + }, + "relationships": { + "friend": { + "links": { + "self": null + } + } + }, + "meta": { + "adoptsFrom": { + "module": "../friend", + "name": "Friend" + } + } + } +} \ No newline at end of file diff --git a/Friend/1b0ec553-ef40-4a3a-988f-1234ee721799.json b/Friend/1b0ec553-ef40-4a3a-988f-1234ee721799.json new file mode 100644 index 0000000..9b0984a --- /dev/null +++ b/Friend/1b0ec553-ef40-4a3a-988f-1234ee721799.json @@ -0,0 +1,22 @@ +{ + "data": { + "type": "card", + "attributes": { + "firstName": "test", + "thumbnailURL": "" + }, + "relationships": { + "friend": { + "links": { + "self": null + } + } + }, + "meta": { + "adoptsFrom": { + "module": "../friend", + "name": "Friend" + } + } + } +} \ No newline at end of file diff --git a/Friend/effb6f3b-a208-4ffd-8fcf-6af6916f625d.json b/Friend/effb6f3b-a208-4ffd-8fcf-6af6916f625d.json new file mode 100644 index 0000000..a127f60 --- /dev/null +++ b/Friend/effb6f3b-a208-4ffd-8fcf-6af6916f625d.json @@ -0,0 +1,22 @@ +{ + "data": { + "type": "card", + "attributes": { + "firstName": null, + "thumbnailURL": null + }, + "relationships": { + "friend": { + "links": { + "self": null + } + } + }, + "meta": { + "adoptsFrom": { + "module": "../friend", + "name": "Friend" + } + } + } +} \ No newline at end of file diff --git a/friend-1.json b/friend-1.json new file mode 100644 index 0000000..58c26a5 --- /dev/null +++ b/friend-1.json @@ -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" + } + } + } +} diff --git a/friend.gts b/friend.gts new file mode 100644 index 0000000..1633bbb --- /dev/null +++ b/friend.gts @@ -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 { + + }; +}