diff --git a/CardListing/49a82727-1826-407b-b9e9-7d744474dc3b.json b/CardListing/49a82727-1826-407b-b9e9-7d744474dc3b.json new file mode 100644 index 0000000..bb226a8 --- /dev/null +++ b/CardListing/49a82727-1826-407b-b9e9-7d744474dc3b.json @@ -0,0 +1,69 @@ +{ + "data": { + "meta": { + "adoptsFrom": { + "name": "CardListing", + "module": "http://localhost:4201/catalog/catalog-app/listing/listing" + } + }, + "type": "card", + "attributes": { + "name": "Adventure Scenario Card Definition", + "images": [], + "summary": "AdventureScenario is a catalog component designed to define and represent adventure scenarios in a narrative or game setting. It include fields for key identifiers, titles, descriptions, and flexible tags for narrative style or visual hints. The component offers multiple visual formats—isolated, embedded, and fitted—to display scenario summaries with varying levels of detail and styling, facilitating both detailed presentation and compact inline summaries. Its primary purpose is to enable structured, styled, and versatile presentation of adventure scenarios for storytelling, game design, or scenario planning contexts.", + "cardInfo": { + "name": null, + "notes": null, + "summary": null, + "cardThumbnailURL": null + } + }, + "relationships": { + "specs.0": { + "links": { + "self": "../Spec/51be3d40-ab5e-445d-a230-28bfc5f1f25c" + } + }, + "skills": { + "links": { + "self": null + } + }, + "tags.0": { + "links": { + "self": "http://localhost:4201/catalog/Tag/51de249c-516a-4c4d-bd88-76e88274c483" + } + }, + "tags.1": { + "links": { + "self": "http://localhost:4201/catalog/Tag/c1fe433a-b3df-41f4-bdcf-d98686ee42d7" + } + }, + "license": { + "links": { + "self": "http://localhost:4201/catalog/License/4c5a023b-a72c-4f90-930b-da60a1de5b2d" + } + }, + "publisher": { + "links": { + "self": null + } + }, + "examples.0": { + "links": { + "self": "../adventure-00dd63cf-3bdf-431c-910d-1a99d423fd5c/adventure/AdventureScenario/example-scenario-undersea-kingdom" + } + }, + "categories.0": { + "links": { + "self": "http://localhost:4201/catalog/Category/adventure-outdoor-activities" + } + }, + "cardInfo.theme": { + "links": { + "self": null + } + } + } + } +} \ No newline at end of file diff --git a/Spec/51be3d40-ab5e-445d-a230-28bfc5f1f25c.json b/Spec/51be3d40-ab5e-445d-a230-28bfc5f1f25c.json new file mode 100644 index 0000000..3419717 --- /dev/null +++ b/Spec/51be3d40-ab5e-445d-a230-28bfc5f1f25c.json @@ -0,0 +1,40 @@ +{ + "data": { + "meta": { + "adoptsFrom": { + "name": "Spec", + "module": "https://cardstack.com/base/spec" + } + }, + "type": "card", + "attributes": { + "ref": { + "name": "AdventureScenario", + "module": "../adventure-00dd63cf-3bdf-431c-910d-1a99d423fd5c/adventure/adventure-scenario" + }, + "readMe": "# AdventureScenario Card Usage\n\n## Summary\nThe `AdventureScenario` card represents a scenario or episode within an adventure narrative. It contains information about the scenario, including a title, description, tags, and visual styling hints.\n\n## Import\n```javascript\nimport { AdventureScenario } from 'http://localhost:4201/richardtan/richy-workspace/adventure-00dd63cf-3bdf-431c-910d-1a99d423fd5c/adventure/adventure-scenario';\n```\n\n## Usage as a Field\nTo use the `AdventureScenario` card as a field within a consuming card or field, you can define it as follows:\n\n```javascript\nimport { CardDef, field, linksTo } from 'https://cardstack.com/base/card-api';\nimport { AdventureScenario } from 'http://localhost:4201/richardtan/richy-workspace/adventure-00dd63cf-3bdf-431c-910d-1a99d423fd5c/adventure/adventure-scenario';\n\nexport class MyCard extends CardDef {\n @field adventure = linksTo(AdventureScenario);\n}\n```\n\n## Template Usage\nTo display an `AdventureScenario` card within a consuming template, you can use the following:\n\n```handlebars\n{{#if @model.adventure}}\n <@fields.adventure @format=\"embedded\" />\n{{else}}\n
No adventure scenario selected
\n{{/if}}\n```\n\nThis will render the `AdventureScenario` card in its embedded format, or display a placeholder if no scenario is available.", + "cardInfo": { + "name": null, + "notes": null, + "summary": null, + "cardThumbnailURL": null + }, + "specType": "card", + "cardTitle": "Adventure Scenario", + "cardDescription": null, + "containedExamples": [] + }, + "relationships": { + "cardInfo.theme": { + "links": { + "self": null + } + }, + "linkedExamples": { + "links": { + "self": null + } + } + } + } +} \ No newline at end of file diff --git a/adventure-00dd63cf-3bdf-431c-910d-1a99d423fd5c/adventure/AdventureScenario/example-scenario-undersea-kingdom.json b/adventure-00dd63cf-3bdf-431c-910d-1a99d423fd5c/adventure/AdventureScenario/example-scenario-undersea-kingdom.json new file mode 100644 index 0000000..057f83e --- /dev/null +++ b/adventure-00dd63cf-3bdf-431c-910d-1a99d423fd5c/adventure/AdventureScenario/example-scenario-undersea-kingdom.json @@ -0,0 +1,31 @@ +{ + "data": { + "meta": { + "adoptsFrom": { + "name": "AdventureScenario", + "module": "../adventure-scenario" + } + }, + "type": "card", + "attributes": { + "key": "undersea-kingdom", + "tags": [], + "title": "The Sunken Kingdom", + "cardInfo": { + "notes": null, + "title": null, + "description": null, + "thumbnailURL": null + }, + "description": "An ancient realm beneath the waves stirs once more.", + "imageStyles": [] + }, + "relationships": { + "cardInfo.theme": { + "links": { + "self": null + } + } + } + } +} \ No newline at end of file diff --git a/adventure-00dd63cf-3bdf-431c-910d-1a99d423fd5c/adventure/adventure-scenario.gts b/adventure-00dd63cf-3bdf-431c-910d-1a99d423fd5c/adventure/adventure-scenario.gts new file mode 100644 index 0000000..e9416ca --- /dev/null +++ b/adventure-00dd63cf-3bdf-431c-910d-1a99d423fd5c/adventure/adventure-scenario.gts @@ -0,0 +1,393 @@ +import { + CardDef, + Component, + field, + contains, + containsMany, +} from 'https://cardstack.com/base/card-api'; +import StringField from 'https://cardstack.com/base/string'; +import BookOpenIcon from '@cardstack/boxel-icons/book-open'; + +export class AdventureScenario extends CardDef { + static displayName = 'Adventure Scenario'; + static icon = BookOpenIcon; + + @field key = contains(StringField); + @field title = contains(StringField); + @field description = contains(StringField); + + // Open-ended guidance + @field tags = containsMany(StringField); // narrative/style hints (free-form) + @field imageStyles = containsMany(StringField); // visual-only hints (e.g., "pixel-art") + + static isolated = class Isolated extends Component { + + }; + + // ⁷ Embedded format (compact row) + static embedded = class Embedded extends Component { + + }; + + static fitted = class Fitted extends Component { + + }; +}