# スタンプカード · RenderPlan 2.1 `STAMP_CARDS` は PLAN_V2.1 の画面です。入力は `{ page, itemView? }`、`page` はカードの棚、`itemView` は開いたカードの器の中身を定義します。NIHO は同じ固定 renderer で描画し、カードの ID、会員の ID、task の ref、報告本文を設計図へ渡しません。 - [JSON Schema](https://niho.life/developer/docs/living-surfaces/plan-v2.1/stamp-cards.schema.json) - [生成 TypeScript 宣言](https://niho.life/developer/docs/living-surfaces/plan-v2.1/stamp-cards.d.ts) - [カタログ](https://niho.life/developer/docs/living-surfaces/plan-v2.1/catalog.json) - [公開 playground](https://niho.life/developer/docs/living-surfaces/plan-v2.1/playground) - [AI 向け全文](https://niho.life/developer/docs/living-surfaces/plan-v2.1/llms-full.txt) - [Studio CLI と MCP](https://niho.life/developer/docs/living-surfaces/plan-v2.1/studio-cli) ## Studio と同じテンプレート | JSON | 用途 | | --- | --- | | [標準に近い](https://niho.life/developer/docs/living-surfaces/plan-v2.1/example-stamp-cards-standard.json) | NIHO 標準の棚と券面を保ち、特典と押し方も同じ器で確認します。 | | [ポスター](https://niho.life/developer/docs/living-surfaces/plan-v2.1/example-stamp-cards-poster.json) | 進捗を左に大きく置く一覧と、紙のポスター風の券面です。 | | [写真](https://niho.life/developer/docs/living-surfaces/plan-v2.1/example-stamp-cards-photo.json) | 写真を追加する前でも使え、カードの絵文字と余白で写真のある雰囲気に整えます。 | | [線画](https://niho.life/developer/docs/living-surfaces/plan-v2.1/example-stamp-cards-line-art.json) | 追加素材なしで、線と番号を中心に静かにカードを並べます。 | テンプレートは追加素材なしでも parser と描画を通ります。`写真` は素材を登録する前にも使え、素材を指定する場合だけ Studio の素材名を参照します。色は `accent`・`swatch1`〜`swatch4` の名前で拠点テーマから引き、値を直接持ちません。 ## 棚・器・固定部品 - 棚は `cardShelf` または filter のない `Collection(cards)` をちょうど1つ持ち、全カードへ到達できる必要があります。 - 棚の題を固定する場合は `variant: "masthead"` と日英の `title` を書き、`item` は省きます。`kicker`・`subtitle`・`ornaments` も指定できます。 - `Collection(cards)` の `skin: "progressLead"` は押印数と目標を左に置き、カード名と次の特典を表示します。特典がないときは目標までの残り、達成済みのときは達成状態を表示します。 - 器の芯は券面、達成後の押印、特典の券、押し方と報告の行です。`partsPlacement` は `beforeFace` / `afterFace`、`itemView.rewardStyle` は `standard` / `ticket` から選べます。`ticket` は受け取れる特典を切符型で描きます。押印や受け取りの権限と操作は NIHO が扱います。 - `face.kind: "standard"` は NIHO 標準券面、`face.kind: "feature"` は `currentCard` と必須の `marks` を使います。 - `variant: "paperPoster"` は紙の地に拠点テーマの色で題を描き、押印数・目標・次の特典または達成状態を表示します。`subtitle` は号数や補足に、`ornaments` はロゴや角の飾りに使えます。10 マスなら `marks` の `columns: 5` と `size: "compact"` で、幅に合わせて折り返します。 - `Marks` は最大100マスです。`slots[].milestone` は `upcoming` / `available` / `delivered`、マスの詳細は日時・押し方・特典状態を NIHO の固定文で示します。 - `marks.motifInk: "paper"` は `fill: "motifs"` または `"seal"` の透過画像を用紙色の印影として描きます。元の画像色にする場合は `original` を指定します。 - `marks.tilt: "varied"` は印の角度を枠ごとに変えます。`motion: "press"` は新しく押された印を上から着地させ、動きを控える設定では静止画にします。`milestoneMark: "label"` は目標・特典・受取済みを GOAL・GIFT・✓ で示します。 - `overflowPresses`、`rewardPasses`、`pressActions`、`stampCelebration` は NIHO の固定部品で、設計図から書き込み能力を受け取りません。 ## データ | view | source | filter | fields | Fact.kind | Badge.kind | | --- | --- | --- | --- | --- | --- | | shelf | `cards` | `inProgress`・`completed` | `title`・`kicker`・`faceEmoji`・`description`・`count`・`goal`・`remaining`・`achievementTitle`・`marks`・`progress`・`nextMilestone` | `count`・`goal`・`remaining`・`achievementTitle` | `done` | | card | `currentCard` | — | `title`・`kicker`・`faceEmoji`・`description`・`count`・`goal`・`remaining`・`overflowCount`・`achievementTitle`・`nextMilestone`・`pendingCount`・`howToPress`・`marks`・`progress` | `count`・`goal`・`remaining`・`overflowCount`・`nextMilestone`・`achievementTitle`・`pendingCount`・`lastPressedAt`・`completedAt` | `done`・`reward`・`pending` | | card | `milestones` | `upcoming`・`available`・`delivered` | `rewardName`・`threshold`・`state`・`deliveredAt` | — | `reward`・`done` | 複数 filter は AND です。`cards` の `inProgress` と `completed` は同時に指定できません。段階の特典は最大3件です。 `cards` の `nextMilestone` は現在の押印数より先にある最初の特典です。会員の一覧は公開中の最新の特典設定と本人の有効な獲得履歴を参照し、Studio は合成データから同じ形式の表示を作ります。 ## 操作 設計図が頼める操作は、棚から器を開く `openCard` と器を閉じる `closeCard` だけです。本人押印、報告、特典の受取は NIHO の固定部品だけが行います。 Studio と公開 playground は `createStudioStampCardPlanAdapter` を使い、合成の状態だけを更新します。本人押印、報告、特典の実 API、実 ID、書き込み hook は渡しません。カードを開いて「合成の本人押印」を試せます。特典を受け取れる見本では、切符型の「スタッフに見せる」から合成の特典券を確認できます。 ## 表示の確認 Studio では 0個・途中・あと1つ・受取可能・受取済み・達成・達成後の押印・承認待ちと100マスを切り替え、320px・375px・PC、日本語・英語、動きを控える設定を確認します。1024px未満のホスト画面は従来どおり読み取り専用です。公開前の確認では、NIHO標準または公開中の版と公開後を並べます。 ## ローカル起動と対象検証 `./scripts/dev/with-node.sh npm -C contracts run build` の後に `./scripts/dev/with-node.sh npm -C apps/web run dev` を起動し、`http://localhost:3000/developer/docs/living-surfaces/plan-v2.1/playground` を開きます。契約は `./scripts/dev/with-node.sh node --test contracts/living-surface-plan-studio.test.ts contracts/living-surface-plan-developer-docs.test.ts`、UI は対象 Vitest、実ブラウザは Chromium・WebKit・Firefox で playground の合成操作を確認します。 # Studio CLI と MCP 拠点のオーナーは、Studio の「構成」で編集する設計図を手元の JSON として扱えます。拠点スクリプトと同じ CLI で、設計図の対象を `surface:stamp-cards`、`surface:home`、`surface:schedule` と指定します。 ## 設計図を取り出して変更案を送る 1. [Studio CLI をダウンロード](/api/public/developer/docs/studio/cli/host-script-sdk-v0.4/niho-studio-cli.tar.gz)して作業フォルダに展開します。`node niho-host-script-sdk/.niho/sdk/niho.mjs init --spot ` でリビングを指定し、`node .niho/sdk/niho.mjs login surface:stamp-cards` で同じリビングに OAuth 接続します。まだ下書きがない画面は、ホストの「デザイン → 会員の画面」で対象画面を開き、Studio で下書きを作成します。 2. `node .niho/sdk/niho.mjs pull surface:stamp-cards` で既存の下書きを取得します。対象リビングと画面、現在の版を確認してください。 3. `surfaces/stamp-cards/plan.json` を編集します。`node .niho/sdk/niho.mjs diff surface:stamp-cards` で取得時との違いを見て、`node .niho/sdk/niho.mjs check surface:stamp-cards` で設計図を検査します。 4. `node .niho/sdk/niho.mjs push surface:stamp-cards` で変更案を送ります。返されたリンクから差分と見本を確認し、オーナーが下書きに反映します。会員への公開は、対象 Studio の「公開前の確認」から行います。 同じ JSON を Studio の「構成」へ貼り付けて編集できます。スタンプカード 2.1 は `{ page, itemView? }`、ホームと予定 2.0 は `page` の値を使います。新しい画像は Studio の「素材」から登録し、設計図では素材名を参照します。 Studio 側で先に下書きが更新された場合は、手元の編集を別名で保存し、`pull surface:stamp-cards --force` で最新の下書きを取得します。保存したファイルとの差分を確認し、必要な編集を新しい下書きに移します。 ## MCP で頼む [NIHO MCP の接続](/developer)で、対象拠点の設計図を扱う権限を指定します。接続済みの AI に対象拠点と画面を伝え、下書きを取得して希望の変更を検査し、変更案のリンクを返すように頼めます。リンクを開いたオーナーは、CLI で送った案と同じ手順で確認して反映します。 # RenderPlan 2.1 リファレンス JSON Schema と TypeScript 宣言は `{ page, itemView? }` の入力を定義します。コンポーネント間の依存関係やペイロード全体の上限は実行時に検証されます。 ## 章 - [スタンプカード](https://niho.life/developer/docs/living-surfaces/plan-v2.1/stamp-cards) · PLAN_V2.1 の棚・券面・Marks・合成操作を、Studio と同じ4テンプレートで扱います。 - [Studio CLI と MCP](https://niho.life/developer/docs/living-surfaces/plan-v2.1/studio-cli) · ホストの下書きを手元に取り出し、変更案として Studio へ戻す手順。 ## 配布ファイル - [catalog.json](https://niho.life/developer/docs/living-surfaces/plan-v2.1/catalog.json) · スタンプカードの view、source、固定部品、Marks、上限を JSON で参照できます。 - [stamp-cards.schema.json](https://niho.life/developer/docs/living-surfaces/plan-v2.1/stamp-cards.schema.json) · STAMP_CARDS の PLAN_V2.1 入力 schema(JSON Schema draft 2020-12)です。 - [stamp-cards.d.ts](https://niho.life/developer/docs/living-surfaces/plan-v2.1/stamp-cards.d.ts) · STAMP_CARDS の PLAN_V2.1 の root、棚、器、Marks、操作の生成型です。 - [example-stamp-cards-standard.json](https://niho.life/developer/docs/living-surfaces/plan-v2.1/example-stamp-cards-standard.json) · NIHO 標準の棚と券面を保ち、特典と押し方も同じ器で確認します。 - [example-stamp-cards-poster.json](https://niho.life/developer/docs/living-surfaces/plan-v2.1/example-stamp-cards-poster.json) · 進捗を左に大きく置く一覧と、紙のポスター風の券面です。 - [example-stamp-cards-photo.json](https://niho.life/developer/docs/living-surfaces/plan-v2.1/example-stamp-cards-photo.json) · 写真を追加する前でも使え、カードの絵文字と余白で写真のある雰囲気に整えます。 - [example-stamp-cards-line-art.json](https://niho.life/developer/docs/living-surfaces/plan-v2.1/example-stamp-cards-line-art.json) · 追加素材なしで、線と番号を中心に静かにカードを並べます。 ## catalog.json ```json { "renderer": "PLAN_V2", "planVersion": "2.1", "mode": "plan", "surfaces": { "STAMP_CARDS": { "surface": "STAMP_CARDS", "dataSchema": "STAMP_CARDS_V1", "cardCore": [ "standardFace", "overflowPresses", "rewardPasses", "pressActions", "stampCelebration" ], "views": { "shelf": { "surface": "STAMP_CARDS", "dataSchema": "STAMP_CARDS_V1", "regions": [ { "name": "sections", "required": true, "maxSections": 12 } ], "sources": { "cards": { "filters": [ "inProgress", "completed" ], "exclusiveFilters": [ [ "inProgress", "completed" ] ], "sorts": [ "sortOrder" ], "fields": [ "title", "kicker", "faceEmoji", "description", "count", "goal", "remaining", "achievementTitle", "marks", "progress", "nextMilestone" ], "factKinds": [ "count", "goal", "remaining", "achievementTitle" ], "badgeKinds": [ "done" ], "progressValues": [ "progress" ], "boundActions": [ "openCard" ], "itemAction": "openCard", "maxLimit": 100, "allLimit": true } }, "actions": [ { "type": "openCard", "boundToItem": true } ], "modules": [ "cardShelf" ] }, "card": { "surface": "STAMP_CARDS", "dataSchema": "STAMP_CARD_V1", "regions": [ { "name": "before", "required": false, "maxSections": 4 }, { "name": "after", "required": false, "maxSections": 4 } ], "sources": { "currentCard": { "filters": [], "sorts": [ "current" ], "fields": [ "title", "kicker", "faceEmoji", "description", "count", "goal", "remaining", "overflowCount", "achievementTitle", "nextMilestone", "pendingCount", "howToPress", "marks", "progress" ], "factKinds": [ "count", "goal", "remaining", "overflowCount", "nextMilestone", "achievementTitle", "pendingCount", "lastPressedAt", "completedAt" ], "badgeKinds": [ "done", "reward", "pending" ], "progressValues": [ "progress" ], "boundActions": [], "itemAction": "", "maxLimit": 1 }, "milestones": { "filters": [ "upcoming", "available", "delivered" ], "sorts": [ "threshold" ], "fields": [ "rewardName", "threshold", "state", "deliveredAt" ], "factKinds": [], "badgeKinds": [ "reward", "done" ], "progressValues": [], "boundActions": [], "itemAction": "", "maxLimit": 3 } }, "actions": [ { "type": "closeCard", "boundToItem": false } ], "modules": [] } } } }, "components": { "sectionLayouts": [ "stack", "rail", "grid2", "grid3", "split" ], "featureVariants": [ "banner", "poster", "night", "window", "masthead" ], "collectionSkins": [ "plain", "media", "ticket", "placard", "slip" ], "marks": { "arrangements": [ "grid", "row", "wrap" ], "slots": [ "circle", "rounded", "square", "punch", "seal" ], "fills": [ "tone", "seal", "motifs", "emoji", "check" ], "empty": [ "number", "dashed", "faint", "blank" ], "milestoneMarks": [ "gift", "star", "flag", "label" ], "captions": [ "none", "date", "milestone", "both" ], "tilts": [ "none", "organic", "varied" ], "details": [ "popover", "none" ], "motions": [ "stamp", "press", "enter", "none" ], "sizes": [ "compact", "regular", "large" ] }, "tones": [ "accent", "swatch1", "swatch2", "swatch3", "swatch4" ], "ornaments": [ "lantern", "lanterns", "moon", "leaf", "wave", "star", "stars", "confetti", "blob", "cloud", "noren", "stamp-ring", "ribbon" ], "partsPlacements": [ "afterFace", "beforeFace" ] }, "limits": { "maxBytesExclusive": 32768, "sectionItems": { "min": 1, "max": 6 }, "splitItems": { "min": 2, "max": 4 }, "pageItems": 24, "ornamentsPerOwner": 3, "pageOrnaments": 16, "assets": 12, "featureFacts": 6, "featureBadges": 3, "collectionFields": { "min": 1, "max": 6 }, "queryFilters": 3, "textCodeUnits": { "display": 40, "title": 60, "body": 240, "caption": 120 }, "buttonLabelCodeUnits": 24, "mediaAltCodeUnits": 160, "badgeLabelCodeUnits": 12, "progressLabelCodeUnits": 60, "markerEmojiCodeUnits": 16, "issues": 20, "payloadSections": 12, "itemViewSections": 4, "marksMotifs": 12, "markSeriesTotal": 100 }, "mediaLimits": { "assets": 12, "sourceBytes": 4194304, "sourceEdge": 4096, "sourcePixels": 16777216, "displayEdge": 1080, "derivativeBytes": 327680, "totalDerivativeBytes": 1572864 } } ``` # JSON Schema・型宣言・作例 ## stamp-cards.schema.json ```json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://niho.life/schemas/living-surface/plan-v2.1/stamp-cards.json", "title": "PLAN_V2.1 STAMP_CARDS input", "description": "STAMP_CARDS の設計図({ page, itemView? })。全件導線、view 間の source、総量、filter の排他は parser でも検査します。", "type": "object", "additionalProperties": false, "properties": { "page": { "$ref": "#/$defs/page" }, "itemView": { "$ref": "#/$defs/itemView" } }, "required": [ "page" ], "$defs": { "look": { "type": "object", "additionalProperties": false, "properties": { "density": { "enum": [ "compact", "regular", "airy" ] }, "shape": { "enum": [ "sharp", "soft", "rounded", "leaf" ] }, "texture": { "enum": [ "none", "paper", "grain", "night" ] } } }, "localized.display": { "type": "object", "additionalProperties": false, "properties": { "ja": { "type": "string", "minLength": 1, "maxLength": 40, "pattern": "^(?=.*\\S)[^\\u0000-\\u001F\\u007F]*$" }, "en": { "type": "string", "minLength": 1, "maxLength": 40, "pattern": "^(?=.*\\S)[^\\u0000-\\u001F\\u007F]*$" } }, "required": [ "ja", "en" ] }, "localized.title": { "type": "object", "additionalProperties": false, "properties": { "ja": { "type": "string", "minLength": 1, "maxLength": 60, "pattern": "^(?=.*\\S)[^\\u0000-\\u001F\\u007F]*$" }, "en": { "type": "string", "minLength": 1, "maxLength": 60, "pattern": "^(?=.*\\S)[^\\u0000-\\u001F\\u007F]*$" } }, "required": [ "ja", "en" ] }, "localized.body": { "type": "object", "additionalProperties": false, "properties": { "ja": { "type": "string", "minLength": 1, "maxLength": 240, "pattern": "^(?=[\\s\\S]*\\S)[^\\u0000-\\u0009\\u000B-\\u001F\\u007F]*$" }, "en": { "type": "string", "minLength": 1, "maxLength": 240, "pattern": "^(?=[\\s\\S]*\\S)[^\\u0000-\\u0009\\u000B-\\u001F\\u007F]*$" } }, "required": [ "ja", "en" ] }, "localized.caption": { "type": "object", "additionalProperties": false, "properties": { "ja": { "type": "string", "minLength": 1, "maxLength": 120, "pattern": "^(?=[\\s\\S]*\\S)[^\\u0000-\\u0009\\u000B-\\u001F\\u007F]*$" }, "en": { "type": "string", "minLength": 1, "maxLength": 120, "pattern": "^(?=[\\s\\S]*\\S)[^\\u0000-\\u0009\\u000B-\\u001F\\u007F]*$" } }, "required": [ "ja", "en" ] }, "localized.button": { "type": "object", "additionalProperties": false, "properties": { "ja": { "type": "string", "minLength": 1, "maxLength": 24, "pattern": "^(?=.*\\S)[^\\u0000-\\u001F\\u007F]*$" }, "en": { "type": "string", "minLength": 1, "maxLength": 24, "pattern": "^(?=.*\\S)[^\\u0000-\\u001F\\u007F]*$" } }, "required": [ "ja", "en" ] }, "localized.alt": { "type": "object", "additionalProperties": false, "properties": { "ja": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^(?=.*\\S)[^\\u0000-\\u001F\\u007F]*$" }, "en": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^(?=.*\\S)[^\\u0000-\\u001F\\u007F]*$" } }, "required": [ "ja", "en" ] }, "localized.badge": { "type": "object", "additionalProperties": false, "properties": { "ja": { "type": "string", "minLength": 1, "maxLength": 12, "pattern": "^(?=.*\\S)[^\\u0000-\\u001F\\u007F]*$" }, "en": { "type": "string", "minLength": 1, "maxLength": 12, "pattern": "^(?=.*\\S)[^\\u0000-\\u001F\\u007F]*$" } }, "required": [ "ja", "en" ] }, "localized.progress": { "type": "object", "additionalProperties": false, "properties": { "ja": { "type": "string", "minLength": 1, "maxLength": 60, "pattern": "^(?=.*\\S)[^\\u0000-\\u001F\\u007F]*$" }, "en": { "type": "string", "minLength": 1, "maxLength": 60, "pattern": "^(?=.*\\S)[^\\u0000-\\u001F\\u007F]*$" } }, "required": [ "ja", "en" ] }, "text.display": { "type": "object", "additionalProperties": false, "properties": { "role": { "const": "display" }, "text": { "$ref": "#/$defs/localized.display" }, "vertical": { "type": "boolean" } }, "required": [ "role", "text" ] }, "text.title": { "type": "object", "additionalProperties": false, "properties": { "role": { "const": "title" }, "text": { "$ref": "#/$defs/localized.title" }, "vertical": { "type": "boolean" } }, "required": [ "role", "text" ] }, "text.body": { "type": "object", "additionalProperties": false, "properties": { "role": { "const": "body" }, "text": { "$ref": "#/$defs/localized.body" }, "vertical": { "const": false } }, "required": [ "role", "text" ] }, "text.caption": { "type": "object", "additionalProperties": false, "properties": { "role": { "const": "caption" }, "text": { "$ref": "#/$defs/localized.caption" }, "vertical": { "const": false } }, "required": [ "role", "text" ] }, "text.heading": { "oneOf": [ { "$ref": "#/$defs/text.display" }, { "$ref": "#/$defs/text.title" } ] }, "text.sub": { "oneOf": [ { "$ref": "#/$defs/text.body" }, { "$ref": "#/$defs/text.caption" } ] }, "text.kicker": { "$ref": "#/$defs/text.caption" }, "text.any": { "oneOf": [ { "$ref": "#/$defs/text.display" }, { "$ref": "#/$defs/text.title" }, { "$ref": "#/$defs/text.body" }, { "$ref": "#/$defs/text.caption" } ] }, "field.kicker": { "type": "object", "additionalProperties": false, "properties": { "field": { "const": "kicker" } }, "required": [ "field" ] }, "field.title": { "type": "object", "additionalProperties": false, "properties": { "field": { "enum": [ "title", "kicker" ] } }, "required": [ "field" ] }, "field.subtitle": { "type": "object", "additionalProperties": false, "properties": { "field": { "enum": [ "title", "description" ] } }, "required": [ "field" ] }, "assetName": { "type": "string", "pattern": "^[a-z][a-z0-9-]{0,31}$" }, "ornament": { "type": "object", "additionalProperties": false, "properties": { "catalog": { "enum": [ "lantern", "lanterns", "moon", "leaf", "wave", "star", "stars", "confetti", "blob", "cloud", "noren", "stamp-ring", "ribbon" ] }, "asset": { "$ref": "#/$defs/assetName" }, "anchor": { "enum": [ "topLeft", "top", "topRight", "left", "center", "right", "bottomLeft", "bottom", "bottomRight" ] }, "size": { "enum": [ "s", "m", "l" ] }, "offset": { "type": "object", "additionalProperties": false, "properties": { "x": { "enum": [ -2, -1, 0, 1, 2 ] }, "y": { "enum": [ -2, -1, 0, 1, 2 ] } }, "required": [ "x", "y" ] }, "rotate": { "enum": [ -15, -8, 0, 8, 15 ] }, "tone": { "enum": [ "accent", "swatch1", "swatch2", "swatch3", "swatch4" ] }, "motion": { "enum": [ "none", "enter", "sway", "stamp" ] } }, "required": [ "anchor" ], "oneOf": [ { "required": [ "catalog" ] }, { "required": [ "asset" ] } ] }, "ornaments": { "type": "array", "maxItems": 3, "items": { "$ref": "#/$defs/ornament" } }, "media": { "type": "object", "additionalProperties": false, "properties": { "asset": { "$ref": "#/$defs/assetName" }, "cover": { "const": false }, "ratio": { "enum": [ "1:1", "4:3", "3:2", "16:9", "3:4", "4:5" ] }, "veil": { "enum": [ "none", "soft", "strong" ] }, "mono": { "type": "boolean" }, "alt": { "$ref": "#/$defs/localized.alt" }, "decorative": { "type": "boolean" } }, "required": [ "ratio" ], "allOf": [ { "required": [ "asset" ] }, { "oneOf": [ { "required": [ "alt" ] }, { "required": [ "decorative" ], "properties": { "decorative": { "const": true } } } ] } ] }, "marks": { "type": "object", "additionalProperties": false, "properties": { "arrangement": { "enum": [ "grid", "row", "wrap" ] }, "columns": { "enum": [ "auto", 3, 4, 5, 6, 7, 8, 9, 10 ] }, "slot": { "enum": [ "circle", "rounded", "square", "punch", "seal" ] }, "fill": { "enum": [ "tone", "seal", "motifs", "emoji", "check" ] }, "motifs": { "type": "array", "minItems": 1, "maxItems": 12, "uniqueItems": true, "items": { "$ref": "#/$defs/assetName" } }, "motifInk": { "enum": [ "original", "paper" ] }, "empty": { "type": "array", "minItems": 1, "maxItems": 2, "uniqueItems": true, "items": { "enum": [ "number", "dashed", "faint", "blank" ] } }, "milestoneMark": { "enum": [ "gift", "star", "flag", "label" ] }, "caption": { "enum": [ "none", "date", "milestone", "both" ] }, "tilt": { "enum": [ "none", "organic", "varied" ] }, "detail": { "enum": [ "popover", "none" ] }, "motion": { "enum": [ "stamp", "press", "enter", "none" ] }, "size": { "enum": [ "compact", "regular", "large" ] } }, "allOf": [ { "if": { "properties": { "fill": { "const": "motifs" } }, "required": [ "fill" ] }, "then": { "required": [ "motifs" ] } }, { "if": { "required": [ "motifs" ] }, "then": { "properties": { "fill": { "const": "motifs" } }, "required": [ "fill" ] } }, { "if": { "required": [ "motifInk" ] }, "then": { "properties": { "fill": { "enum": [ "motifs", "seal" ] } }, "required": [ "fill" ] } } ] }, "action.openCard": { "type": "object", "additionalProperties": false, "properties": { "type": { "const": "openCard" } }, "required": [ "type" ] }, "action.closeCard": { "type": "object", "additionalProperties": false, "properties": { "type": { "const": "closeCard" } }, "required": [ "type" ] }, "button.openCard": { "type": "object", "additionalProperties": false, "properties": { "label": { "$ref": "#/$defs/localized.button" }, "kind": { "enum": [ "primary", "secondary", "text" ] }, "action": { "oneOf": [ { "$ref": "#/$defs/action.openCard" } ] } }, "required": [ "label", "action" ] }, "button.closeCard": { "type": "object", "additionalProperties": false, "properties": { "label": { "$ref": "#/$defs/localized.button" }, "kind": { "enum": [ "primary", "secondary", "text" ] }, "action": { "oneOf": [ { "$ref": "#/$defs/action.closeCard" } ] } }, "required": [ "label", "action" ] }, "badge.custom": { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "custom" }, "shape": { "enum": [ "pill", "stamp" ] }, "label": { "$ref": "#/$defs/localized.badge" } }, "required": [ "kind", "label" ] }, "query.cards": { "type": "object", "additionalProperties": false, "properties": { "source": { "const": "cards" }, "filter": { "type": "array", "maxItems": 3, "uniqueItems": true, "items": { "enum": [ "inProgress", "completed" ] } }, "sort": { "enum": [ "sortOrder" ] } }, "required": [ "source" ] }, "fact.cards": { "oneOf": [ { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "count" }, "format": { "enum": [ "number", "pad2", "fraction", "kanji" ] }, "size": { "enum": [ "regular", "big" ] }, "emphasis": { "enum": [ "display" ] } }, "required": [ "kind" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "goal" }, "format": { "enum": [ "number", "pad2", "kanji" ] }, "size": { "enum": [ "regular", "big" ] }, "emphasis": { "enum": [ "display" ] } }, "required": [ "kind" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "remaining" }, "format": { "enum": [ "number", "pad2", "kanji" ] }, "size": { "enum": [ "regular", "big" ] }, "emphasis": { "enum": [ "display" ] } }, "required": [ "kind" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "achievementTitle" }, "size": { "enum": [ "regular", "big" ] }, "emphasis": { "enum": [ "display" ] } }, "required": [ "kind" ] } ] }, "badge.cards": { "oneOf": [ { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "done" }, "shape": { "enum": [ "pill", "stamp" ] } }, "required": [ "kind" ] }, { "$ref": "#/$defs/badge.custom" } ] }, "progress.cards": { "type": "object", "additionalProperties": false, "properties": { "value": { "enum": [ "progress" ] }, "label": { "$ref": "#/$defs/localized.progress" }, "tone": { "enum": [ "accent", "swatch1", "swatch2", "swatch3", "swatch4" ] }, "shape": { "enum": [ "bar", "ring", "dots" ] } }, "required": [ "value", "label" ] }, "query.currentCard": { "type": "object", "additionalProperties": false, "properties": { "source": { "const": "currentCard" }, "filter": { "type": "array", "maxItems": 3, "uniqueItems": true, "items": false }, "sort": { "enum": [ "current" ] } }, "required": [ "source" ] }, "fact.currentCard": { "oneOf": [ { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "count" }, "format": { "enum": [ "number", "pad2", "fraction", "kanji" ] }, "size": { "enum": [ "regular", "big" ] }, "emphasis": { "enum": [ "display" ] } }, "required": [ "kind" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "goal" }, "format": { "enum": [ "number", "pad2", "kanji" ] }, "size": { "enum": [ "regular", "big" ] }, "emphasis": { "enum": [ "display" ] } }, "required": [ "kind" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "remaining" }, "format": { "enum": [ "number", "pad2", "kanji" ] }, "size": { "enum": [ "regular", "big" ] }, "emphasis": { "enum": [ "display" ] } }, "required": [ "kind" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "overflowCount" }, "format": { "enum": [ "number", "pad2", "kanji" ] }, "size": { "enum": [ "regular", "big" ] }, "emphasis": { "enum": [ "display" ] } }, "required": [ "kind" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "nextMilestone" }, "size": { "enum": [ "regular", "big" ] }, "emphasis": { "enum": [ "display" ] } }, "required": [ "kind" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "achievementTitle" }, "size": { "enum": [ "regular", "big" ] }, "emphasis": { "enum": [ "display" ] } }, "required": [ "kind" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "pendingCount" }, "format": { "enum": [ "number", "pad2", "kanji" ] }, "size": { "enum": [ "regular", "big" ] }, "emphasis": { "enum": [ "display" ] } }, "required": [ "kind" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "lastPressedAt" }, "format": { "enum": [ "md", "relative" ] }, "size": { "enum": [ "regular", "big" ] }, "emphasis": { "enum": [ "display" ] } }, "required": [ "kind" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "completedAt" }, "format": { "enum": [ "md", "relative" ] }, "size": { "enum": [ "regular", "big" ] }, "emphasis": { "enum": [ "display" ] } }, "required": [ "kind" ] } ] }, "badge.currentCard": { "oneOf": [ { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "done" }, "shape": { "enum": [ "pill", "stamp" ] } }, "required": [ "kind" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "reward" }, "shape": { "enum": [ "pill", "stamp" ] } }, "required": [ "kind" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "pending" }, "shape": { "enum": [ "pill", "stamp" ] } }, "required": [ "kind" ] }, { "$ref": "#/$defs/badge.custom" } ] }, "progress.currentCard": { "type": "object", "additionalProperties": false, "properties": { "value": { "enum": [ "progress" ] }, "label": { "$ref": "#/$defs/localized.progress" }, "tone": { "enum": [ "accent", "swatch1", "swatch2", "swatch3", "swatch4" ] }, "shape": { "enum": [ "bar", "ring", "dots" ] } }, "required": [ "value", "label" ] }, "query.milestones": { "type": "object", "additionalProperties": false, "properties": { "source": { "const": "milestones" }, "filter": { "type": "array", "maxItems": 3, "uniqueItems": true, "items": { "enum": [ "upcoming", "available", "delivered" ] } }, "sort": { "enum": [ "threshold" ] } }, "required": [ "source" ] }, "fact.milestones": { "not": {} }, "badge.milestones": { "oneOf": [ { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "reward" }, "shape": { "enum": [ "pill", "stamp" ] } }, "required": [ "kind" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "done" }, "shape": { "enum": [ "pill", "stamp" ] } }, "required": [ "kind" ] }, { "$ref": "#/$defs/badge.custom" } ] }, "feature.static": { "type": "object", "additionalProperties": false, "properties": { "type": { "const": "feature" }, "variant": { "enum": [ "banner", "poster", "night", "window", "masthead", "paperPoster" ] }, "kicker": { "$ref": "#/$defs/text.kicker" }, "title": { "$ref": "#/$defs/text.heading" }, "subtitle": { "$ref": "#/$defs/text.sub" }, "badges": { "type": "array", "maxItems": 3, "items": { "$ref": "#/$defs/badge.custom" } }, "media": { "$ref": "#/$defs/media" }, "ornaments": { "$ref": "#/$defs/ornaments" }, "tone": { "enum": [ "accent", "swatch1", "swatch2", "swatch3", "swatch4" ] }, "ground": { "enum": [ "fill", "soft", "surface" ] }, "align": { "enum": [ "start", "center" ] }, "motion": { "enum": [ "none", "enter", "sway", "stamp" ] } }, "required": [ "type", "variant" ], "allOf": [ { "if": { "properties": { "variant": { "const": "window" } }, "required": [ "variant" ] }, "then": { "required": [ "media" ] } } ] }, "feature.cards": { "type": "object", "additionalProperties": false, "properties": { "type": { "const": "feature" }, "variant": { "enum": [ "banner", "poster", "night", "window", "masthead", "paperPoster" ] }, "item": { "$ref": "#/$defs/query.cards" }, "empty": { "$ref": "#/$defs/text.any" }, "hideWhenEmpty": { "type": "boolean" }, "kicker": { "oneOf": [ { "$ref": "#/$defs/text.kicker" }, { "$ref": "#/$defs/field.kicker" } ] }, "title": { "oneOf": [ { "$ref": "#/$defs/text.heading" }, { "$ref": "#/$defs/field.title" } ] }, "subtitle": { "oneOf": [ { "$ref": "#/$defs/text.sub" }, { "$ref": "#/$defs/field.subtitle" } ] }, "facts": { "type": "array", "maxItems": 6, "items": { "$ref": "#/$defs/fact.cards" } }, "badges": { "type": "array", "maxItems": 3, "items": { "$ref": "#/$defs/badge.cards" } }, "progress": { "$ref": "#/$defs/progress.cards" }, "marks": { "$ref": "#/$defs/marks" }, "media": { "$ref": "#/$defs/media" }, "action": { "$ref": "#/$defs/button.openCard" }, "ornaments": { "$ref": "#/$defs/ornaments" }, "tone": { "enum": [ "accent", "swatch1", "swatch2", "swatch3", "swatch4" ] }, "ground": { "enum": [ "fill", "soft", "surface" ] }, "align": { "enum": [ "start", "center" ] }, "motion": { "enum": [ "none", "enter", "sway", "stamp" ] } }, "required": [ "type", "variant", "item" ], "allOf": [ { "oneOf": [ { "required": [ "empty" ] }, { "required": [ "hideWhenEmpty" ], "properties": { "hideWhenEmpty": { "const": true } } } ] }, { "if": { "properties": { "variant": { "const": "window" } }, "required": [ "variant" ] }, "then": { "required": [ "media" ] } } ] }, "feature.currentCard": { "type": "object", "additionalProperties": false, "properties": { "type": { "const": "feature" }, "variant": { "enum": [ "banner", "poster", "night", "window", "masthead", "paperPoster" ] }, "item": { "$ref": "#/$defs/query.currentCard" }, "empty": { "$ref": "#/$defs/text.any" }, "hideWhenEmpty": { "type": "boolean" }, "kicker": { "oneOf": [ { "$ref": "#/$defs/text.kicker" }, { "$ref": "#/$defs/field.kicker" } ] }, "title": { "oneOf": [ { "$ref": "#/$defs/text.heading" }, { "$ref": "#/$defs/field.title" } ] }, "subtitle": { "oneOf": [ { "$ref": "#/$defs/text.sub" }, { "$ref": "#/$defs/field.subtitle" } ] }, "facts": { "type": "array", "maxItems": 6, "items": { "$ref": "#/$defs/fact.currentCard" } }, "badges": { "type": "array", "maxItems": 3, "items": { "$ref": "#/$defs/badge.currentCard" } }, "progress": { "$ref": "#/$defs/progress.currentCard" }, "marks": { "$ref": "#/$defs/marks" }, "media": { "$ref": "#/$defs/media" }, "action": { "$ref": "#/$defs/button.closeCard" }, "ornaments": { "$ref": "#/$defs/ornaments" }, "tone": { "enum": [ "accent", "swatch1", "swatch2", "swatch3", "swatch4" ] }, "ground": { "enum": [ "fill", "soft", "surface" ] }, "align": { "enum": [ "start", "center" ] }, "motion": { "enum": [ "none", "enter", "sway", "stamp" ] } }, "required": [ "type", "variant", "item" ], "allOf": [ { "oneOf": [ { "required": [ "empty" ] }, { "required": [ "hideWhenEmpty" ], "properties": { "hideWhenEmpty": { "const": true } } } ] }, { "if": { "properties": { "variant": { "const": "window" } }, "required": [ "variant" ] }, "then": { "required": [ "media" ] } } ] }, "feature.milestones": { "type": "object", "additionalProperties": false, "properties": { "type": { "const": "feature" }, "variant": { "enum": [ "banner", "poster", "night", "window", "masthead", "paperPoster" ] }, "item": { "$ref": "#/$defs/query.milestones" }, "empty": { "$ref": "#/$defs/text.any" }, "hideWhenEmpty": { "type": "boolean" }, "kicker": { "$ref": "#/$defs/text.kicker" }, "title": { "$ref": "#/$defs/text.heading" }, "subtitle": { "$ref": "#/$defs/text.sub" }, "facts": { "type": "array", "maxItems": 6, "items": { "$ref": "#/$defs/fact.milestones" } }, "badges": { "type": "array", "maxItems": 3, "items": { "$ref": "#/$defs/badge.milestones" } }, "marks": { "$ref": "#/$defs/marks" }, "media": { "$ref": "#/$defs/media" }, "action": { "$ref": "#/$defs/button.closeCard" }, "ornaments": { "$ref": "#/$defs/ornaments" }, "tone": { "enum": [ "accent", "swatch1", "swatch2", "swatch3", "swatch4" ] }, "ground": { "enum": [ "fill", "soft", "surface" ] }, "align": { "enum": [ "start", "center" ] }, "motion": { "enum": [ "none", "enter", "sway", "stamp" ] } }, "required": [ "type", "variant", "item" ], "allOf": [ { "oneOf": [ { "required": [ "empty" ] }, { "required": [ "hideWhenEmpty" ], "properties": { "hideWhenEmpty": { "const": true } } } ] }, { "if": { "properties": { "variant": { "const": "window" } }, "required": [ "variant" ] }, "then": { "required": [ "media" ] } } ] }, "face": { "oneOf": [ { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "standard" } }, "required": [ "kind" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "feature" }, "variant": { "enum": [ "banner", "poster", "night", "window", "masthead", "paperPoster" ] }, "item": { "$ref": "#/$defs/query.currentCard" }, "kicker": { "oneOf": [ { "$ref": "#/$defs/text.kicker" }, { "$ref": "#/$defs/field.kicker" } ] }, "title": { "oneOf": [ { "$ref": "#/$defs/text.heading" }, { "$ref": "#/$defs/field.title" } ] }, "subtitle": { "oneOf": [ { "$ref": "#/$defs/text.sub" }, { "$ref": "#/$defs/field.subtitle" } ] }, "facts": { "type": "array", "maxItems": 6, "items": { "$ref": "#/$defs/fact.currentCard" } }, "badges": { "type": "array", "maxItems": 3, "items": { "$ref": "#/$defs/badge.currentCard" } }, "progress": { "$ref": "#/$defs/progress.currentCard" }, "marks": { "$ref": "#/$defs/marks" }, "media": { "$ref": "#/$defs/media" }, "action": { "$ref": "#/$defs/button.closeCard" }, "ornaments": { "$ref": "#/$defs/ornaments" }, "tone": { "enum": [ "accent", "swatch1", "swatch2", "swatch3", "swatch4" ] }, "ground": { "enum": [ "fill", "soft", "surface" ] }, "align": { "enum": [ "start", "center" ] }, "motion": { "enum": [ "none", "enter", "sway", "stamp" ] } }, "required": [ "kind", "variant", "item", "marks" ], "allOf": [ { "if": { "properties": { "variant": { "const": "window" } }, "required": [ "variant" ] }, "then": { "required": [ "media" ] } } ] } ] }, "collection.cards": { "type": "object", "additionalProperties": false, "properties": { "type": { "const": "collection" }, "query": { "$ref": "#/$defs/query.cards" }, "skin": { "enum": [ "plain", "media", "ticket", "placard", "slip", "progressLead" ] }, "layout": { "enum": [ "stack", "rail", "grid2", "grid3", "split" ] }, "fields": { "type": "array", "minItems": 1, "maxItems": 6, "uniqueItems": true, "items": { "enum": [ "title", "kicker", "faceEmoji", "description", "count", "goal", "remaining", "achievementTitle", "marks", "progress", "nextMilestone" ] } }, "limit": { "oneOf": [ { "type": "integer", "minimum": 1, "maximum": 100 }, { "const": "all" } ] }, "empty": { "$ref": "#/$defs/text.any" }, "hideWhenEmpty": { "type": "boolean" }, "mark": { "enum": [ "pill", "stamp", "none" ] }, "skipFeatured": { "type": "boolean" }, "vertical": { "type": "boolean" }, "numerals": { "enum": [ "arabic", "kanji" ] }, "motion": { "enum": [ "none", "enter" ] }, "tone": { "enum": [ "accent", "swatch1", "swatch2", "swatch3", "swatch4" ] } }, "required": [ "type", "query", "skin", "layout", "fields", "limit" ], "allOf": [ { "oneOf": [ { "required": [ "empty" ] }, { "required": [ "hideWhenEmpty" ], "properties": { "hideWhenEmpty": { "const": true } } } ] }, { "if": { "properties": { "vertical": { "const": true } }, "required": [ "vertical" ] }, "then": { "properties": { "layout": { "const": "rail" } } } }, { "if": { "properties": { "skin": { "const": "media" } }, "required": [ "skin" ] }, "then": { "properties": { "fields": { "contains": { "const": "faceEmoji" } } } } } ] }, "collection.milestones": { "type": "object", "additionalProperties": false, "properties": { "type": { "const": "collection" }, "query": { "$ref": "#/$defs/query.milestones" }, "skin": { "enum": [ "plain", "ticket", "placard", "slip" ] }, "layout": { "enum": [ "stack", "rail", "grid2", "grid3", "split" ] }, "fields": { "type": "array", "minItems": 1, "maxItems": 6, "uniqueItems": true, "items": { "enum": [ "rewardName", "threshold", "state", "deliveredAt" ] } }, "limit": { "type": "integer", "minimum": 1, "maximum": 3 }, "empty": { "$ref": "#/$defs/text.any" }, "hideWhenEmpty": { "type": "boolean" }, "mark": { "enum": [ "pill", "stamp", "none" ] }, "skipFeatured": { "type": "boolean" }, "vertical": { "type": "boolean" }, "numerals": { "enum": [ "arabic", "kanji" ] }, "motion": { "enum": [ "none", "enter" ] }, "tone": { "enum": [ "accent", "swatch1", "swatch2", "swatch3", "swatch4" ] } }, "required": [ "type", "query", "skin", "layout", "fields", "limit" ], "allOf": [ { "oneOf": [ { "required": [ "empty" ] }, { "required": [ "hideWhenEmpty" ], "properties": { "hideWhenEmpty": { "const": true } } } ] }, { "if": { "properties": { "vertical": { "const": true } }, "required": [ "vertical" ] }, "then": { "properties": { "layout": { "const": "rail" } } } } ] }, "module.cardShelf": { "type": "object", "additionalProperties": false, "properties": { "type": { "const": "module" }, "name": { "const": "cardShelf" } }, "required": [ "type", "name" ] }, "item.shelf": { "oneOf": [ { "$ref": "#/$defs/feature.static" }, { "$ref": "#/$defs/feature.cards" }, { "$ref": "#/$defs/collection.cards" }, { "$ref": "#/$defs/module.cardShelf" } ] }, "item.card": { "oneOf": [ { "$ref": "#/$defs/feature.currentCard" }, { "$ref": "#/$defs/feature.milestones" }, { "$ref": "#/$defs/collection.milestones" } ] }, "section.shelf": { "type": "object", "additionalProperties": false, "properties": { "title": { "$ref": "#/$defs/text.heading" }, "layout": { "enum": [ "stack", "rail", "grid2", "grid3", "split" ] }, "ornaments": { "$ref": "#/$defs/ornaments" }, "items": { "type": "array", "minItems": 1, "maxItems": 6, "items": { "$ref": "#/$defs/item.shelf" } } }, "required": [ "layout", "items" ], "allOf": [ { "if": { "properties": { "layout": { "const": "split" } }, "required": [ "layout" ] }, "then": { "properties": { "items": { "minItems": 2, "maxItems": 4 } } } }, { "if": { "properties": { "items": { "contains": { "$ref": "#/$defs/module.cardShelf" } } }, "required": [ "items" ] }, "then": { "properties": { "layout": { "const": "stack" }, "items": { "maxItems": 1 } } } } ] }, "section.card": { "type": "object", "additionalProperties": false, "properties": { "title": { "$ref": "#/$defs/text.heading" }, "layout": { "enum": [ "stack", "rail", "grid2", "grid3", "split" ] }, "ornaments": { "$ref": "#/$defs/ornaments" }, "items": { "type": "array", "minItems": 1, "maxItems": 6, "items": { "$ref": "#/$defs/item.card" } } }, "required": [ "title", "layout", "items" ], "allOf": [ { "if": { "properties": { "layout": { "const": "split" } }, "required": [ "layout" ] }, "then": { "properties": { "items": { "minItems": 2, "maxItems": 4 } } } } ] }, "page": { "type": "object", "additionalProperties": false, "properties": { "look": { "$ref": "#/$defs/look" }, "sections": { "type": "array", "minItems": 1, "maxItems": 12, "items": { "$ref": "#/$defs/section.shelf" } } }, "required": [ "sections" ] }, "itemView": { "type": "object", "additionalProperties": false, "properties": { "face": { "$ref": "#/$defs/face" }, "before": { "type": "array", "maxItems": 4, "items": { "$ref": "#/$defs/section.card" } }, "after": { "type": "array", "maxItems": 4, "items": { "$ref": "#/$defs/section.card" } }, "partsPlacement": { "enum": [ "afterFace", "beforeFace" ] }, "rewardStyle": { "enum": [ "standard", "ticket" ] } }, "required": [ "face" ] } } } ``` ## stamp-cards.d.ts ```ts // PLAN_V2.1 の STAMP_CARDS 設計図(入力の形)。root は { page, itemView? }。 // 全件導線、view 間の source、素材・部品・サイズの総量は parser が検査する。 export type LivingSurfacePlanLocalizedText = { readonly ja: string; readonly en: string }; export type LivingSurfacePlanLook = { readonly density?: "compact" | "regular" | "airy"; readonly shape?: "sharp" | "soft" | "rounded" | "leaf"; readonly texture?: "none" | "paper" | "grain" | "night" }; export type LivingSurfacePlanHeadingText = { readonly role: "display" | "title"; readonly text: LivingSurfacePlanLocalizedText; readonly vertical?: boolean }; export type LivingSurfacePlanSubText = { readonly role: "body" | "caption"; readonly text: LivingSurfacePlanLocalizedText; readonly vertical?: false }; export type LivingSurfacePlanKickerText = { readonly role: "caption"; readonly text: LivingSurfacePlanLocalizedText; readonly vertical?: false }; export type LivingSurfacePlanKicker = LivingSurfacePlanKickerText | { readonly field: "kicker" }; export type LivingSurfacePlanTitle = LivingSurfacePlanHeadingText | { readonly field: "title" | "kicker" }; export type LivingSurfacePlanSubtitle = LivingSurfacePlanSubText | { readonly field: "title" | "description" }; export type LivingSurfacePlanText = LivingSurfacePlanHeadingText | LivingSurfacePlanSubText; export type LivingSurfacePlanOrnament = ({ readonly catalog: "lantern" | "lanterns" | "moon" | "leaf" | "wave" | "star" | "stars" | "confetti" | "blob" | "cloud" | "noren" | "stamp-ring" | "ribbon"; readonly asset?: never } | { readonly asset: string; readonly catalog?: never }) & { readonly anchor: "topLeft" | "top" | "topRight" | "left" | "center" | "right" | "bottomLeft" | "bottom" | "bottomRight"; readonly size?: "s" | "m" | "l"; readonly offset?: { readonly x: -2 | -1 | 0 | 1 | 2; readonly y: -2 | -1 | 0 | 1 | 2 }; readonly rotate?: -15 | -8 | 0 | 8 | 15; readonly tone?: "accent" | "swatch1" | "swatch2" | "swatch3" | "swatch4"; readonly motion?: "none" | "enter" | "sway" | "stamp" }; export type LivingSurfacePlanMedia = { readonly ratio: "1:1" | "4:3" | "3:2" | "16:9" | "3:4" | "4:5"; readonly veil?: "none" | "soft" | "strong"; readonly mono?: boolean; readonly asset: string; readonly cover?: false } & ({ readonly alt: LivingSurfacePlanLocalizedText; readonly decorative?: false } | { readonly decorative: true; readonly alt?: never }); export type LivingSurfacePlanMarks = { readonly arrangement?: "grid" | "row" | "wrap"; readonly columns?: "auto" | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10; readonly slot?: "circle" | "rounded" | "square" | "punch" | "seal"; readonly fill?: "tone" | "seal" | "motifs" | "emoji" | "check"; readonly motifs?: readonly string[]; readonly motifInk?: "original" | "paper"; readonly empty?: readonly ("number" | "dashed" | "faint" | "blank")[]; readonly milestoneMark?: "gift" | "star" | "flag" | "label"; readonly caption?: "none" | "date" | "milestone" | "both"; readonly tilt?: "none" | "organic" | "varied"; readonly detail?: "popover" | "none"; readonly motion?: "stamp" | "press" | "enter" | "none"; readonly size?: "compact" | "regular" | "large" }; export type LivingSurfacePlanQueryCards = { readonly source: "cards"; readonly filter?: readonly ("inProgress" | "completed")[]; readonly sort?: "sortOrder" }; export type LivingSurfacePlanQueryCurrentCard = { readonly source: "currentCard"; readonly filter?: readonly never[]; readonly sort?: "current" }; export type LivingSurfacePlanQueryMilestones = { readonly source: "milestones"; readonly filter?: readonly ("upcoming" | "available" | "delivered")[]; readonly sort?: "threshold" }; export type LivingSurfacePlanFactEmphasis = "display"; export type LivingSurfacePlanFactCards = { readonly kind: "count"; readonly format?: "number" | "pad2" | "fraction" | "kanji"; readonly size?: "regular" | "big"; readonly emphasis?: LivingSurfacePlanFactEmphasis } | { readonly kind: "goal"; readonly format?: "number" | "pad2" | "kanji"; readonly size?: "regular" | "big"; readonly emphasis?: LivingSurfacePlanFactEmphasis } | { readonly kind: "remaining"; readonly format?: "number" | "pad2" | "kanji"; readonly size?: "regular" | "big"; readonly emphasis?: LivingSurfacePlanFactEmphasis } | { readonly kind: "achievementTitle"; readonly size?: "regular" | "big"; readonly emphasis?: LivingSurfacePlanFactEmphasis }; export type LivingSurfacePlanFactCurrentCard = { readonly kind: "count"; readonly format?: "number" | "pad2" | "fraction" | "kanji"; readonly size?: "regular" | "big"; readonly emphasis?: LivingSurfacePlanFactEmphasis } | { readonly kind: "goal"; readonly format?: "number" | "pad2" | "kanji"; readonly size?: "regular" | "big"; readonly emphasis?: LivingSurfacePlanFactEmphasis } | { readonly kind: "remaining"; readonly format?: "number" | "pad2" | "kanji"; readonly size?: "regular" | "big"; readonly emphasis?: LivingSurfacePlanFactEmphasis } | { readonly kind: "overflowCount"; readonly format?: "number" | "pad2" | "kanji"; readonly size?: "regular" | "big"; readonly emphasis?: LivingSurfacePlanFactEmphasis } | { readonly kind: "nextMilestone"; readonly size?: "regular" | "big"; readonly emphasis?: LivingSurfacePlanFactEmphasis } | { readonly kind: "achievementTitle"; readonly size?: "regular" | "big"; readonly emphasis?: LivingSurfacePlanFactEmphasis } | { readonly kind: "pendingCount"; readonly format?: "number" | "pad2" | "kanji"; readonly size?: "regular" | "big"; readonly emphasis?: LivingSurfacePlanFactEmphasis } | { readonly kind: "lastPressedAt"; readonly format?: "md" | "relative"; readonly size?: "regular" | "big"; readonly emphasis?: LivingSurfacePlanFactEmphasis } | { readonly kind: "completedAt"; readonly format?: "md" | "relative"; readonly size?: "regular" | "big"; readonly emphasis?: LivingSurfacePlanFactEmphasis }; export type LivingSurfacePlanCustomBadge = { readonly kind: "custom"; readonly shape?: "pill" | "stamp"; readonly label: LivingSurfacePlanLocalizedText }; export type LivingSurfacePlanCardBadge = { readonly kind: "done"; readonly shape?: "pill" | "stamp" } | LivingSurfacePlanCustomBadge; export type LivingSurfacePlanCurrentCardBadge = { readonly kind: "done" | "reward" | "pending"; readonly shape?: "pill" | "stamp" } | LivingSurfacePlanCustomBadge; export type LivingSurfacePlanMilestoneBadge = { readonly kind: "reward" | "done"; readonly shape?: "pill" | "stamp" } | LivingSurfacePlanCustomBadge; export type LivingSurfacePlanProgress = { readonly value: "progress"; readonly label: LivingSurfacePlanLocalizedText; readonly tone?: "accent" | "swatch1" | "swatch2" | "swatch3" | "swatch4"; readonly shape?: "bar" | "ring" | "dots" }; export type LivingSurfacePlanButton = { readonly label: LivingSurfacePlanLocalizedText; readonly kind?: "primary" | "secondary" | "text"; readonly action: Action }; export type LivingSurfacePlanEmptiness = { readonly empty: LivingSurfacePlanText; readonly hideWhenEmpty?: false } | { readonly hideWhenEmpty: true; readonly empty?: never }; export type LivingSurfacePlanStaticFeature = { readonly type: "feature"; readonly variant: "banner" | "poster" | "night" | "window" | "masthead" | "paperPoster"; readonly kicker?: LivingSurfacePlanKickerText; readonly title?: LivingSurfacePlanHeadingText; readonly subtitle?: LivingSurfacePlanSubText; readonly badges?: readonly LivingSurfacePlanCustomBadge[]; readonly media?: LivingSurfacePlanMedia; readonly ornaments?: readonly LivingSurfacePlanOrnament[]; readonly tone?: "accent" | "swatch1" | "swatch2" | "swatch3" | "swatch4"; readonly ground?: "fill" | "soft" | "surface"; readonly align?: "start" | "center"; readonly motion?: "none" | "enter" | "sway" | "stamp" }; export type LivingSurfacePlanFeatureCards = { readonly type: "feature"; readonly variant: "banner" | "poster" | "night" | "window" | "masthead" | "paperPoster"; readonly item: LivingSurfacePlanQueryCards; readonly kicker?: LivingSurfacePlanKicker; readonly title?: LivingSurfacePlanTitle; readonly subtitle?: LivingSurfacePlanSubtitle; readonly facts?: readonly LivingSurfacePlanFactCards[]; readonly badges?: readonly LivingSurfacePlanCardBadge[]; readonly progress?: LivingSurfacePlanProgress; readonly marks?: LivingSurfacePlanMarks; readonly media?: LivingSurfacePlanMedia; readonly action?: LivingSurfacePlanButton<{ readonly type: "openCard" }>; readonly ornaments?: readonly LivingSurfacePlanOrnament[]; readonly tone?: "accent" | "swatch1" | "swatch2" | "swatch3" | "swatch4"; readonly ground?: "fill" | "soft" | "surface"; readonly align?: "start" | "center"; readonly motion?: "none" | "enter" | "sway" | "stamp" } & LivingSurfacePlanEmptiness; export type LivingSurfacePlanFeatureCurrentCard = { readonly type: "feature"; readonly variant: "banner" | "poster" | "night" | "window" | "masthead" | "paperPoster"; readonly item: LivingSurfacePlanQueryCurrentCard; readonly kicker?: LivingSurfacePlanKicker; readonly title?: LivingSurfacePlanTitle; readonly subtitle?: LivingSurfacePlanSubtitle; readonly facts?: readonly LivingSurfacePlanFactCurrentCard[]; readonly badges?: readonly LivingSurfacePlanCurrentCardBadge[]; readonly progress?: LivingSurfacePlanProgress; readonly marks?: LivingSurfacePlanMarks; readonly media?: LivingSurfacePlanMedia; readonly action?: LivingSurfacePlanButton<{ readonly type: "closeCard" }>; readonly ornaments?: readonly LivingSurfacePlanOrnament[]; readonly tone?: "accent" | "swatch1" | "swatch2" | "swatch3" | "swatch4"; readonly ground?: "fill" | "soft" | "surface"; readonly align?: "start" | "center"; readonly motion?: "none" | "enter" | "sway" | "stamp" } & LivingSurfacePlanEmptiness; export type LivingSurfacePlanFeatureMilestones = { readonly type: "feature"; readonly variant: "banner" | "poster" | "night" | "window" | "masthead" | "paperPoster"; readonly item: LivingSurfacePlanQueryMilestones; readonly kicker?: LivingSurfacePlanKickerText; readonly title?: LivingSurfacePlanHeadingText; readonly subtitle?: LivingSurfacePlanSubText; readonly facts?: readonly never[]; readonly badges?: readonly LivingSurfacePlanMilestoneBadge[]; readonly progress?: never; readonly marks?: LivingSurfacePlanMarks; readonly media?: LivingSurfacePlanMedia; readonly action?: LivingSurfacePlanButton<{ readonly type: "closeCard" }>; readonly ornaments?: readonly LivingSurfacePlanOrnament[]; readonly tone?: "accent" | "swatch1" | "swatch2" | "swatch3" | "swatch4"; readonly ground?: "fill" | "soft" | "surface"; readonly align?: "start" | "center"; readonly motion?: "none" | "enter" | "sway" | "stamp" } & LivingSurfacePlanEmptiness; export type LivingSurfacePlanCollectionBase = { readonly type: "collection"; readonly query: Query; readonly skin: Skin; readonly layout: "stack" | "rail" | "grid2" | "grid3" | "split"; readonly fields: readonly Fields[]; readonly limit: Limit; readonly mark?: "pill" | "stamp" | "none"; readonly skipFeatured?: boolean; readonly vertical?: boolean; readonly numerals?: "arabic" | "kanji"; readonly motion?: "none" | "enter"; readonly tone?: "accent" | "swatch1" | "swatch2" | "swatch3" | "swatch4" } & LivingSurfacePlanEmptiness; export type LivingSurfacePlanCollectionCards = LivingSurfacePlanCollectionBase; export type LivingSurfacePlanCollectionMilestones = LivingSurfacePlanCollectionBase; export type LivingSurfacePlanShelfItem = LivingSurfacePlanStaticFeature | LivingSurfacePlanFeatureCards | LivingSurfacePlanCollectionCards | { readonly type: "module"; readonly name: "cardShelf" }; export type LivingSurfacePlanCardItem = LivingSurfacePlanFeatureCurrentCard | LivingSurfacePlanFeatureMilestones | LivingSurfacePlanCollectionMilestones; export type LivingSurfacePlanShelfSection = { readonly title?: LivingSurfacePlanHeadingText; readonly layout: "stack" | "rail" | "grid2" | "grid3" | "split"; readonly ornaments?: readonly LivingSurfacePlanOrnament[]; readonly items: readonly LivingSurfacePlanShelfItem[] }; export type LivingSurfacePlanCardSection = { readonly title: LivingSurfacePlanHeadingText; readonly layout: "stack" | "rail" | "grid2" | "grid3" | "split"; readonly ornaments?: readonly LivingSurfacePlanOrnament[]; readonly items: readonly LivingSurfacePlanCardItem[] }; export type LivingSurfacePlanFace = { readonly kind: "standard" } | (Omit & { readonly kind: "feature"; readonly marks: LivingSurfacePlanMarks }); export type LivingSurfacePlanPage = { readonly look?: LivingSurfacePlanLook; readonly sections: readonly LivingSurfacePlanShelfSection[] }; export type LivingSurfacePlanItemView = { readonly face: LivingSurfacePlanFace; readonly before?: readonly LivingSurfacePlanCardSection[]; readonly after?: readonly LivingSurfacePlanCardSection[]; readonly partsPlacement?: "afterFace" | "beforeFace"; readonly rewardStyle?: "standard" | "ticket" }; export type LivingSurfacePlanInput = { readonly page: LivingSurfacePlanPage; readonly itemView?: LivingSurfacePlanItemView }; ``` ## example-stamp-cards-standard.json ```json { "renderer": "PLAN_V2", "planVersion": "2.1", "surface": "STAMP_CARDS", "page": { "sections": [ { "layout": "stack", "items": [ { "type": "module", "name": "cardShelf" } ] } ] }, "itemView": { "face": { "kind": "standard" } } } ``` ## example-stamp-cards-poster.json ```json { "renderer": "PLAN_V2", "planVersion": "2.1", "surface": "STAMP_CARDS", "page": { "look": { "density": "regular", "shape": "sharp", "texture": "paper" }, "sections": [ { "layout": "stack", "items": [ { "type": "feature", "variant": "masthead", "title": { "role": "display", "text": { "ja": "スタンプカード", "en": "Stamp cards" } }, "ornaments": [ { "catalog": "blob", "anchor": "topRight", "size": "l", "offset": { "x": 2, "y": -2 } } ] } ] }, { "title": { "role": "title", "text": { "ja": "すべてのカード", "en": "All cards" } }, "layout": "stack", "items": [ { "type": "collection", "query": { "source": "cards" }, "skin": "progressLead", "layout": "stack", "fields": [ "title", "count", "goal", "nextMilestone", "remaining" ], "limit": "all", "hideWhenEmpty": true } ] } ] }, "itemView": { "face": { "kind": "feature", "variant": "paperPoster", "item": { "source": "currentCard" }, "kicker": { "field": "kicker" }, "title": { "field": "title" }, "subtitle": { "field": "description" }, "facts": [ { "kind": "count", "format": "fraction", "emphasis": "display" }, { "kind": "nextMilestone" }, { "kind": "pendingCount" } ], "badges": [ { "kind": "done", "shape": "stamp" }, { "kind": "pending" } ], "marks": { "arrangement": "grid", "columns": "auto", "slot": "seal", "fill": "emoji", "empty": [ "number", "dashed" ], "milestoneMark": "label", "caption": "both", "tilt": "varied", "detail": "popover", "motion": "press", "size": "regular" }, "ornaments": [ { "catalog": "blob", "anchor": "topRight", "size": "m", "offset": { "x": 2, "y": -2 } } ], "motion": "enter" }, "partsPlacement": "afterFace", "rewardStyle": "ticket" } } ``` ## example-stamp-cards-photo.json ```json { "renderer": "PLAN_V2", "planVersion": "2.1", "surface": "STAMP_CARDS", "page": { "look": { "density": "airy", "shape": "rounded", "texture": "grain" }, "sections": [ { "title": { "role": "title", "text": { "ja": "集めているカード", "en": "Cards in progress" } }, "layout": "grid2", "items": [ { "type": "collection", "query": { "source": "cards" }, "skin": "media", "layout": "grid2", "fields": [ "faceEmoji", "title", "description", "marks" ], "limit": "all", "hideWhenEmpty": true, "motion": "enter" } ] } ] }, "itemView": { "face": { "kind": "feature", "variant": "banner", "item": { "source": "currentCard" }, "kicker": { "field": "kicker" }, "title": { "field": "title" }, "subtitle": { "field": "description" }, "facts": [ { "kind": "count", "format": "fraction", "emphasis": "display" }, { "kind": "nextMilestone" } ], "badges": [ { "kind": "done" }, { "kind": "reward" } ], "marks": { "arrangement": "wrap", "columns": 5, "slot": "rounded", "fill": "emoji", "empty": [ "faint", "number" ], "milestoneMark": "star", "caption": "date", "tilt": "none", "detail": "popover", "motion": "enter", "size": "large" }, "ornaments": [ { "catalog": "blob", "anchor": "bottomRight", "size": "l", "tone": "swatch1" } ] }, "partsPlacement": "beforeFace" } } ``` ## example-stamp-cards-line-art.json ```json { "renderer": "PLAN_V2", "planVersion": "2.1", "surface": "STAMP_CARDS", "page": { "look": { "density": "compact", "shape": "soft", "texture": "none" }, "sections": [ { "layout": "stack", "items": [ { "type": "collection", "query": { "source": "cards" }, "skin": "plain", "layout": "stack", "fields": [ "title", "kicker", "count", "goal", "remaining", "marks" ], "limit": "all", "hideWhenEmpty": true } ] } ] }, "itemView": { "face": { "kind": "feature", "variant": "banner", "ground": "surface", "item": { "source": "currentCard" }, "kicker": { "field": "kicker" }, "title": { "field": "title" }, "subtitle": { "field": "description" }, "facts": [ { "kind": "count", "format": "fraction", "emphasis": "display" }, { "kind": "remaining" }, { "kind": "overflowCount" } ], "badges": [ { "kind": "done", "shape": "stamp" }, { "kind": "pending", "shape": "pill" } ], "marks": { "arrangement": "grid", "columns": "auto", "slot": "circle", "fill": "check", "empty": [ "number", "dashed" ], "milestoneMark": "flag", "caption": "both", "tilt": "none", "detail": "popover", "motion": "none", "size": "regular" }, "ornaments": [ { "catalog": "stamp-ring", "anchor": "bottomLeft", "size": "s" } ], "motion": "none" }, "after": [ { "title": { "role": "title", "text": { "ja": "特典の段階", "en": "Reward milestones" } }, "layout": "stack", "items": [ { "type": "collection", "query": { "source": "milestones" }, "skin": "slip", "layout": "stack", "fields": [ "rewardName", "threshold", "state", "deliveredAt" ], "limit": 3, "hideWhenEmpty": true } ] } ], "partsPlacement": "afterFace" } } ```