// PLAN_V2.0 の HOME の設計図(入力の形)。contracts の livingSurfacePlanTypeDeclarations が定義と語彙から作る。 // 型で表せない検査(数の上限・文字数・limit の上限・skin が media のときの cover・skipFeatured の相手)は 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 LivingSurfacePlanText = LivingSurfacePlanHeadingText | LivingSurfacePlanSubText; export type LivingSurfacePlanOrnament = ({ readonly catalog: "lantern" | "lanterns" | "moon" | "leaf" | "wave" | "star" | "stars" | "confetti" | "blob" | "cloud" | "noren"; 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 LivingSurfacePlanMediaBase = { readonly ratio: "1:1" | "4:3" | "3:2" | "16:9" | "3:4" | "4:5"; readonly veil?: "none" | "soft" | "strong"; readonly mono?: boolean } & { readonly size?: "s" | "m" | "l" } & ({ readonly fit: "contain"; readonly focus?: never } | { readonly fit?: "cover"; readonly focus?: "center" | "top" | "bottom" | "left" | "right" }) & ({ readonly alt: LivingSurfacePlanLocalizedText; readonly decorative?: false } | { readonly decorative: true; readonly alt?: never }); export type LivingSurfacePlanMedia = LivingSurfacePlanMediaBase & { readonly asset: string; readonly cover?: false }; export type LivingSurfacePlanLogo = Pick & ({ readonly alt: LivingSurfacePlanLocalizedText; readonly decorative?: false } | { readonly decorative: true; readonly alt?: never }); export type LivingSurfacePlanMediaWithCover = LivingSurfacePlanMediaBase & ({ readonly asset: string; readonly cover?: false } | { readonly cover: true; readonly asset?: never }); export type LivingSurfacePlanAction = { readonly type: "openNotices" } | { readonly type: "openSurface"; readonly surface: "SCHEDULE" | "HELP_TASKS" | "STAMP_CARDS" }; export type LivingSurfacePlanButton = { readonly label: LivingSurfacePlanLocalizedText; readonly kind?: "primary" | "secondary" | "text"; readonly action: Action }; export type LivingSurfacePlanFeatureAction = { readonly action?: LivingSurfacePlanButton; readonly actionLayout?: never } | { readonly action: LivingSurfacePlanButton; readonly actionLayout: "inline" | "full" | "bottom" | "card" }; export type LivingSurfacePlanCustomBadge = { readonly kind: "custom"; readonly shape?: "pill" | "stamp"; readonly label: LivingSurfacePlanLocalizedText }; export type LivingSurfacePlanEmptiness = { readonly empty: LivingSurfacePlanText; readonly hideWhenEmpty?: false } | { readonly hideWhenEmpty: true; readonly empty?: never }; export type LivingSurfacePlanFeatureVariant = (({ readonly variant: "banner" | "poster" | "night" | "masthead" | "compact"; readonly media?: Media; readonly mediaPlacement?: never } | { readonly variant: "banner" | "poster" | "night" | "window" | "masthead" | "compact"; readonly media: Media; readonly mediaPlacement?: "top" | "start" | "end" | "over" }) & { readonly ground?: "fill" | "soft" | "surface" }) | { readonly variant: "hero" | "agenda" | "portrait"; readonly media?: Media; readonly mediaPlacement?: never; readonly ground?: never }; export type LivingSurfacePlanFeatureBase = { readonly type: "feature"; readonly kicker?: LivingSurfacePlanKickerText; readonly title?: LivingSurfacePlanHeadingText; readonly subtitle?: LivingSurfacePlanSubText; readonly ornaments?: readonly LivingSurfacePlanOrnament[]; readonly tone?: "accent" | "swatch1" | "swatch2" | "swatch3" | "swatch4"; readonly align?: "start" | "center"; readonly motion?: "none" | "enter" | "sway" | "stamp"; readonly logo?: LivingSurfacePlanLogo }; export type LivingSurfacePlanFeatureWithoutItem = LivingSurfacePlanFeatureBase & LivingSurfacePlanFeatureVariant & LivingSurfacePlanFeatureAction & { readonly item?: never; readonly empty?: never; readonly hideWhenEmpty?: false; readonly facts?: readonly []; readonly progress?: never; readonly badges?: readonly LivingSurfacePlanCustomBadge[] }; export type LivingSurfacePlanQueryUpcoming = { readonly source: "upcoming"; readonly filter?: readonly ("joined" | "open")[]; readonly sort?: "start" }; export type LivingSurfacePlanFactUpcoming = { readonly kind: "date"; readonly format?: "md" | "weekday" | "weekdayLatin" | "kanji" | "relative"; readonly size?: "regular" | "big" } | { readonly kind: "startTime"; readonly format?: "kanji"; readonly size?: "regular" | "big" } | { readonly kind: "daysUntil"; readonly format?: "kanji"; readonly size?: "regular" | "big" } | { readonly kind: "seatsLeft"; readonly format?: "kanji"; readonly size?: "regular" | "big" } | { readonly kind: "places"; readonly size?: "regular" | "big" } | { readonly kind: "fee"; readonly size?: "regular" | "big" } | { readonly kind: "instructor"; readonly size?: "regular" | "big" } | { readonly kind: "organizer"; readonly size?: "regular" | "big" }; export type LivingSurfacePlanBadgeUpcoming = { readonly kind: "joined" | "full" | "closed"; readonly shape?: "pill" | "stamp" } | LivingSurfacePlanCustomBadge; export type LivingSurfacePlanProgressUpcoming = { readonly value: "seatsTaken"; readonly label: LivingSurfacePlanLocalizedText; readonly tone?: "accent" | "swatch1" | "swatch2" | "swatch3" | "swatch4"; readonly shape?: "bar" | "ring" }; export type LivingSurfacePlanFeatureUpcoming = LivingSurfacePlanFeatureBase & LivingSurfacePlanFeatureVariant & LivingSurfacePlanEmptiness & LivingSurfacePlanFeatureAction<{ readonly type: "openBooking" } | { readonly type: "openNotices" } | { readonly type: "openSurface"; readonly surface: "SCHEDULE" | "HELP_TASKS" | "STAMP_CARDS" }> & { readonly item: LivingSurfacePlanQueryUpcoming; readonly facts?: readonly LivingSurfacePlanFactUpcoming[]; readonly badges?: readonly LivingSurfacePlanBadgeUpcoming[]; readonly progress?: LivingSurfacePlanProgressUpcoming }; export type LivingSurfacePlanCollectionUpcoming = { readonly type: "collection"; readonly query: LivingSurfacePlanQueryUpcoming; readonly skin: "plain" | "media" | "ticket" | "placard" | "slip"; readonly fields: readonly ("title" | "date" | "time" | "places" | "seats" | "cover" | "fee" | "instructor" | "organizer")[]; readonly limit: number; readonly mark?: "pill" | "stamp" | "none"; readonly skipFeatured?: boolean; readonly numerals?: "arabic" | "kanji"; readonly motion?: "none" | "enter"; readonly tone?: "accent" | "swatch1" | "swatch2" | "swatch3" | "swatch4" } & LivingSurfacePlanEmptiness & ({ readonly layout: "rail"; readonly vertical?: boolean } | { readonly layout: "stack" | "grid2" | "grid3" | "split" | "tiles"; readonly vertical?: false }); export type LivingSurfacePlanQueryNotices = { readonly source: "notices"; readonly filter?: readonly ("unread")[]; readonly sort?: "posted" }; export type LivingSurfacePlanFactNotices = { readonly kind: "postedAt"; readonly format?: "md" | "relative"; readonly size?: "regular" | "big" }; export type LivingSurfacePlanBadgeNotices = LivingSurfacePlanCustomBadge; export type LivingSurfacePlanFeatureNotices = LivingSurfacePlanFeatureBase & LivingSurfacePlanFeatureVariant & LivingSurfacePlanEmptiness & LivingSurfacePlanFeatureAction<{ readonly type: "openNotices" } | { readonly type: "openSurface"; readonly surface: "SCHEDULE" | "HELP_TASKS" | "STAMP_CARDS" }> & { readonly item: LivingSurfacePlanQueryNotices; readonly facts?: readonly LivingSurfacePlanFactNotices[]; readonly badges?: readonly LivingSurfacePlanBadgeNotices[]; readonly progress?: never }; export type LivingSurfacePlanCollectionNotices = { readonly type: "collection"; readonly query: LivingSurfacePlanQueryNotices; readonly skin: "plain" | "ticket" | "placard" | "slip"; readonly fields: readonly ("excerpt" | "postedAt" | "unread")[]; readonly limit: number; readonly mark?: "pill" | "stamp" | "none"; readonly skipFeatured?: boolean; readonly numerals?: "arabic" | "kanji"; readonly motion?: "none" | "enter"; readonly tone?: "accent" | "swatch1" | "swatch2" | "swatch3" | "swatch4" } & LivingSurfacePlanEmptiness & ({ readonly layout: "rail"; readonly vertical?: boolean } | { readonly layout: "stack" | "grid2" | "grid3" | "split" | "tiles"; readonly vertical?: false }); export type LivingSurfacePlanFeature = LivingSurfacePlanFeatureWithoutItem | LivingSurfacePlanFeatureUpcoming | LivingSurfacePlanFeatureNotices; export type LivingSurfacePlanCollection = LivingSurfacePlanCollectionUpcoming | LivingSurfacePlanCollectionNotices; export type LivingSurfacePlanModule = { readonly type: "module"; readonly name: "checkin" }; export type LivingSurfacePlanItem = LivingSurfacePlanFeature | LivingSurfacePlanCollection | LivingSurfacePlanModule; export type LivingSurfacePlanSection = { readonly layout: "stack" | "rail" | "grid2" | "grid3" | "split" | "tiles"; readonly ornaments?: readonly LivingSurfacePlanOrnament[]; readonly items: readonly LivingSurfacePlanItem[] } & ({ readonly title: LivingSurfacePlanHeadingText; readonly kicker?: LivingSurfacePlanKickerText; readonly action?: LivingSurfacePlanButton } | { readonly title?: never; readonly kicker?: never; readonly action?: never }); export type LivingSurfacePlanPage = { readonly look?: LivingSurfacePlanLook; readonly deduplicateCore?: readonly ("week" | "notice")[]; readonly beforeCore?: readonly LivingSurfacePlanSection[]; readonly afterCore?: readonly LivingSurfacePlanSection[]; };