// 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 };