# クイックスタート RenderPlan は、NIHO の予定タブ(`SCHEDULE`)とホームタブ(`HOME`)の表示を定義する JSON 形式です。NIHO が構成を検証し、拠点のテーマと閲覧者に応じたデータを使って描画します。 ## 最初の構成を作成する 1. [構成例](https://niho.life/developer/docs/living-surfaces/plan-v2.0/examples)から対象タブに合う JSON を選びます。配布ファイルの `renderer` は `PLAN_V2`、`planVersion` は `2.0` です。 `page` が構成本体です。 2. [プレビュー](https://niho.life/developer/docs/living-surfaces/plan-v2.0/playground)で JSON を編集し、**検証して描画**を実行します。エラーの場合は、JSON Pointer とコードを確認して修正します。 3. Studio の構成エディターに `page` の JSON を入力し、拠点データでプレビューします。JSON Schema と TypeScript 宣言は `page` を対象としています。 既存の下書きを手元で編集するには、[Studio CLI と MCP](/developer/docs/living-surfaces/plan-v2.1/studio-cli) を使います。予定は `surface:schedule`、ホームは `surface:home` を選びます。 ## 開発者リファレンス - [コンポーネント](https://niho.life/developer/docs/living-surfaces/plan-v2.0/components) - [データバインディング](https://niho.life/developer/docs/living-surfaces/plan-v2.0/data) - [アクション](https://niho.life/developer/docs/living-surfaces/plan-v2.0/actions) - [テーマと装飾](https://niho.life/developer/docs/living-surfaces/plan-v2.0/theme) - [バリデーションと上限](https://niho.life/developer/docs/living-surfaces/plan-v2.0/limits) - [リファレンス全文](https://niho.life/developer/docs/living-surfaces/plan-v2.0/llms-full.txt) # コンポーネントリファレンス 構成ファイルの階層は Page → Section → Feature / Collection / Module です。予定の Page に `hideDefaultBookingButton: true` を置くと、本文の `startBooking` ボタンが使える場合だけ共通の「+予約」を省きます。Section の `items` では `type` でコンポーネントを識別します。 | 対象タブ | Page の領域 | 標準モジュール | | --- | --- | --- | | SCHEDULE | `sections`(必須・最大 12 区画) | `calendar` | | HOME | `beforeCore`(任意・最大 4 区画)、`afterCore`(任意・最大 4 区画) | `checkin` | HOME の標準コンテンツは `beforeCore` と `afterCore` の間に描画されます。どちらか一方に Section を指定します。 HOME の Page に `deduplicateCore: ["week", "notice"]` を指定すると、`beforeCore` に実際に出た重複項目を標準のプレビューから省きます。予定は名前と日時が見え、予定一覧へ進めるときに適用します。お知らせは本文の抜粋と全件への操作がある既読分に適用します。週間カレンダー、未読、投稿、チェックインは標準の表示を使います。 短い名前と補足を並べるには `variant: "compact"` の Feature に `title` と任意の `subtitle` を指定します。画像を付けたときの既定は先頭側の小さい画像です。画像がない場合は文を全幅で表示します。名前を繰り返すだけの写真には `decorative: true`、写真で伝える情報がある場合は `alt` を指定します。並べ方は Section の `stack`、`grid2`、`grid3`、`rail` から選べます。1区画は最大6項目です。 - `hero` は `logo`・コピーと `media` を別に持つ見せ場です。写真がある場合は広い幅で写真と文を左右に、狭い幅で写真と文を上下に置きます。 - `agenda` は日時を題名より先に置く開催カードです。`item` と `facts` に表示したい情報を指定します。講師や参加費が登録されていない場合はその項目を出しません。 - `portrait` は小さな丸い写真の下に名前と補足を置きます。`tiles` は容器の幅に合わせて小さなカードを複数列に並べます。 - `hero`・`agenda`・`portrait` は写真位置を型が決め、地にはテーマの面を使います。`mediaPlacement` と `ground` は指定しません。 - Feature の `actionLayout` は `action` と一緒に指定します。`inline` は内容幅、`full` は本文幅、`bottom` は本文幅で下端、`card` は下端のボタンとカード全体を同じ操作にします。予約の可否と遷移先は NIHO の操作が決めます。 | コンポーネント | プロパティ | 動作 | | --- | --- | --- | | Section | `title`・`kicker`・`action`・`layout`・`ornaments`・`items` | layout は `stack`・`rail`・`grid2`・`grid3`・`split`・`tiles`。Module を使う場合は `stack` の Section に 1 つだけ置きます。各 Module は Page に 1 回までです。 | | Feature | `type`・`variant`・`item`・`empty`・`hideWhenEmpty`・`kicker`・`title`・`subtitle`・`facts`・`badges`・`progress`・`media`・`mediaPlacement`・`logo`・`action`・`actionLayout`・`ornaments`・`tone`・`ground`・`align`・`motion` | variant は `banner`・`poster`・`night`・`window`・`masthead`・`compact`・`hero`・`agenda`・`portrait`。`item` を指定すると、クエリの先頭の 1 件を参照します。イベント名を見出しにするには `title` を省き、小見出しは `kicker`(role は `caption`)に指定します。`window` には Media が必要です。 | | Collection | `type`・`query`・`skin`・`layout`・`fields`・`limit`・`empty`・`hideWhenEmpty`・`mark`・`skipFeatured`・`vertical`・`numerals`・`motion`・`tone` | skin は `plain`・`media`・`ticket`・`placard`・`slip`。`media` には `fields` に `cover` が必要です。`skipFeatured` は同じ source の Feature を参照します。縦書きは `rail` レイアウトの日本語表示に適用されます。 | | Text | `role`・`text`・`vertical` | role は `display`・`title`・`body`・`caption`。固定文の `text` には `ja` と `en` が必要です。縦書きは `display` と `title` に適用できます。 | | Fact | `kind`, `format`, `size` | kind と format は参照先の source に依存します。[データバインディング](https://niho.life/developer/docs/living-surfaces/plan-v2.0/data)を参照してください。 | | Badge | `kind`・`shape`・`label` | shape は `pill`・`stamp`。`custom` には `label` が必要です。状態を示す kind は source に依存します。 | | Progress | `value`・`label`・`tone`・`shape` | shape は `bar`・`ring`。`label` は必須、value は source に依存します。 | | Media | `asset`・`cover`・`ratio`・`veil`・`fit`・`focus`・`size`・`mono`・`alt`・`decorative` | ratio は `1:1`・`4:3`・`3:2`・`16:9`・`3:4`・`4:5`、veil は `none`・`soft`・`strong`。画像には代替テキストを指定するか、装飾画像として指定します。 | | Button | `label`・`kind`・`action` | kind は `primary`・`secondary`・`text`。[アクション](https://niho.life/developer/docs/living-surfaces/plan-v2.0/actions)を参照してください。 | | Module | `type`・`name`・`view`・`days`・`compact`・`controls`・`marker` | `calendar` は `view`, `days`(週表示のみ), `compact`, `controls`, `marker` を設定できます。`checkin` は `name` を指定します。 | | Ornament | `catalog`・`asset`・`anchor`・`size`・`offset`・`rotate`・`tone`・`motion` | [テーマと装飾](https://niho.life/developer/docs/living-surfaces/plan-v2.0/theme)を参照してください。 | クエリを指定した Feature と Collection は、`empty` と `hideWhenEmpty: true` のいずれか一方が必須です。素材名は `^[a-z][a-z0-9-]{0,31}$` に従い、Studio に登録した名前を指定します。 ## 型定義 - `SCHEDULE` · [JSON Schema](https://niho.life/developer/docs/living-surfaces/plan-v2.0/schedule.schema.json) · [TypeScript](https://niho.life/developer/docs/living-surfaces/plan-v2.0/schedule.d.ts) - `HOME` · [JSON Schema](https://niho.life/developer/docs/living-surfaces/plan-v2.0/home.schema.json) · [TypeScript](https://niho.life/developer/docs/living-surfaces/plan-v2.0/home.d.ts) [インタラクティブプレビュー](https://niho.life/developer/docs/living-surfaces/plan-v2.0/playground)で各構成例を実行できます。 # データバインディング Feature の `item` と Collection の `query` に `source` を指定します。`filter` の値はすべて適用され、`sort` を省くと source の既定順になります。Collection の `fields` は表示するフィールドを指定します。 ## SCHEDULE(dataSchema `SCHEDULE_V1`) | source | filter | sort | fields | Fact.kind(format) | Badge.kind | Progress.value | Feature の action | 項目の既定操作 | limit 上限 | | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---: | | `events` | `upcoming`・`joined`・`open` | `start` | `title`・`date`・`time`・`places`・`fee`・`seats`・`cover`・`instructor`・`organizer` | `date (md / weekday / weekdayLatin / kanji / relative)`・`startTime (kanji)`・`daysUntil (kanji)`・`seatsLeft (kanji)`・`fee`・`places`・`instructor`・`organizer` | `joined`・`full`・`closed` | `seatsTaken` | `openBooking` | `openBooking` | 12 | | `bookings` | `mine` | `start` | `date`・`time`・`places`・`headCount`・`exclusive` | `date (md / weekday / weekdayLatin / kanji / relative)`・`startTime (kanji)`・`daysUntil (kanji)`・`places`・`headCount (kanji)` | — | — | `openBooking` | `openBooking` | 12 | ## HOME(dataSchema `HOME_V1`) | source | filter | sort | fields | Fact.kind(format) | Badge.kind | Progress.value | Feature の action | 項目の既定操作 | limit 上限 | | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---: | | `upcoming` | `joined`・`open` | `start` | `title`・`date`・`time`・`places`・`seats`・`cover`・`fee`・`instructor`・`organizer` | `date (md / weekday / weekdayLatin / kanji / relative)`・`startTime (kanji)`・`daysUntil (kanji)`・`seatsLeft (kanji)`・`places`・`fee`・`instructor`・`organizer` | `joined`・`full`・`closed` | `seatsTaken` | `openBooking` | `openBooking` | 12 | | `notices` | `unread` | `posted` | `excerpt`・`postedAt`・`unread` | `postedAt (md / relative)` | — | — | — | `openNotices` | 5 | SCHEDULE の `events` では `upcoming` が今後のイベント、`joined` が参加済み、`open` が受付中です。`bookings.mine` は自分の予約、HOME の `notices.unread` は未読のお知らせに絞り込みます。 # アクション Button は画面定義にある action だけを持てます。項目に結び付く操作は renderer がその項目の ref を補います。URL や任意の値を action に入れることはできません。 ## SCHEDULE | action.type | 対象 | 移動先の選択肢 | | --- | --- | --- | | `openBooking` | 項目の ref が必要 | — | | `startBooking` | 項目の ref は不要 | — | | `openSurface` | 項目の ref は不要 | `HOME`・`SCHEDULE`・`HELP_TASKS` | ## HOME | action.type | 対象 | 移動先の選択肢 | | --- | --- | --- | | `openBooking` | 項目の ref が必要 | — | | `openNotices` | 項目の ref は不要 | — | | `openSurface` | 項目の ref は不要 | `SCHEDULE`・`HELP_TASKS`・`STAMP_CARDS` | 最終的な予約・参加・支払い・チェックインの操作は NIHO の画面が扱います。 # テーマと装飾 ## Page の look - density: `compact`・`regular`・`airy` - shape: `sharp`・`soft`・`rounded`・`leaf` - texture: `none`・`paper`・`grain`・`night` 色と書体は拠点のテーマ設定から継承します。 | テーマ設定 | 値 | | --- | --- | | `landingGround` | `LIGHT`・`DARK_WARM` | | `landingAccent` | `LEAF`・`CORAL`・`TERRACOTTA`・`SAND`・`SUMI` | | `landingFont` | `MARU`・`KAKU`・`MINCHO`・`KYOKASHO`・`MODERN`・`CLASSIC` | 構成内の `tone` はテーマのトークンを参照します。未設定の `swatch1`〜`swatch4` は `accent` で描画されます。 ## 装飾カタログ `lantern`・`lanterns`・`moon`・`leaf`・`wave`・`star`・`stars`・`confetti`・`blob`・`cloud`・`noren` 配置は anchor `topLeft`・`top`・`topRight`・`left`・`center`・`right`・`bottomLeft`・`bottom`・`bottomRight`、size `s`・`m`・`l`、offset の各軸 `-2`・`-1`・`0`・`1`・`2`、rotate `-15`・`-8`・`0`・`8`・`15` 度、tone `accent`・`swatch1`・`swatch2`・`swatch3`・`swatch4`、motion `none`・`enter`・`sway`・`stamp` から選びます。飾りは読み上げ対象にしません。 ## 表示プロパティ - presentation tone: `accent`・`swatch1`・`swatch2`・`swatch3`・`swatch4` - Feature の ground: `fill`・`soft`・`surface`、align: `start`・`center` - Collection の mark: `pill`・`stamp`・`none`、motion: `none`・`enter`、numerals: `arabic`・`kanji` - Fact size: `regular`・`big` # バリデーションと上限 プレビューの検証結果には、JSON Pointer、エラーコード、修正に必要なメッセージが表示されます。たとえば `/page/sections/0/items/1/fields/2` は 1 つ目の Section にある 2 つ目のコンポーネントの 3 つ目のフィールドです。 | コード | 修正箇所 | | --- | --- | | `INVALID_JSON` | JSON の構文を確認します。 | | `NOT_JSON` | ルートが JSON オブジェクトであることを確認します。 | | `TOO_LARGE` | ページ全体の UTF-8 サイズを確認します。 | | `UNKNOWN_KEY` | 該当コンポーネントのプロパティ名を確認します。 | | `MISSING_KEY` | 型定義を参照し、必須のプロパティを追加します。 | | `INVALID_VALUE` | 型、列挙値、入力範囲を確認します。 | | `NOT_ALLOWED` | 対象タブ、source、コンポーネントで利用できる値を確認します。 | | `LIMIT` | 下表と、タブや source ごとの上限を確認します。 | | `A11Y` | 言語別の文言と画像の代替テキストを確認します。 | | `EXCLUSIVE` | 排他的なプロパティのうち一方を選びます。 | | `REQUIRES_ITEM` | Feature の item と参照先のクエリを確認します。 | | `DUPLICATE` | 繰り返し指定された値や標準モジュールを確認します。 | | `UNKNOWN_PROFILE` | renderer、planVersion、surface の組み合わせを確認します。 | JSON Schema と型宣言をエディターの入力補助に使えます。Page 全体の項目数や正規化後のサイズなどは実行時に検証されます。 | 項目 | 上限 | | --- | ---: | | `plan.maxBytesExclusive` | 32768 | | `plan.sectionItems.min` | 1 | | `plan.sectionItems.max` | 6 | | `plan.splitItems.min` | 2 | | `plan.splitItems.max` | 4 | | `plan.pageItems` | 24 | | `plan.ornamentsPerOwner` | 3 | | `plan.pageOrnaments` | 16 | | `plan.assets` | 12 | | `plan.featureFacts` | 6 | | `plan.featureBadges` | 3 | | `plan.collectionFields.min` | 1 | | `plan.collectionFields.max` | 6 | | `plan.queryFilters` | 3 | | `plan.textCodeUnits.display` | 40 | | `plan.textCodeUnits.title` | 60 | | `plan.textCodeUnits.body` | 240 | | `plan.textCodeUnits.caption` | 120 | | `plan.buttonLabelCodeUnits` | 24 | | `plan.mediaAltCodeUnits` | 160 | | `plan.badgeLabelCodeUnits` | 12 | | `plan.progressLabelCodeUnits` | 60 | | `plan.markerEmojiCodeUnits` | 16 | | `plan.issues` | 20 | | `media.assets` | 12 | | `media.sourceBytes` | 4194304 | | `media.sourceEdge` | 4096 | | `media.sourcePixels` | 16777216 | | `media.displayEdge` | 1080 | | `media.derivativeBytes` | 327680 | | `media.totalDerivativeBytes` | 1572864 | # 構成例 JSON ファイルをダウンロードするか、プレビューで構成を編集できます。素材を参照する例にはプレビュー用のサンプル画像が表示されます。 | 構成 | 用途 | 実行 | | --- | --- | --- | | [予定のポスター · JSON](https://niho.life/developer/docs/living-surfaces/plan-v2.0/example-schedule-poster.json) | 次のイベントを、カバー画像・日時・詳細ボタン付きで表示します。 | [プレビュー](https://niho.life/developer/docs/living-surfaces/plan-v2.0/playground?example=schedule-poster) | | [注目イベントと一覧 · JSON](https://niho.life/developer/docs/living-surfaces/plan-v2.0/example-schedule-feature-list.json) | 先頭のイベントを Feature に表示し、残りを横スクロールの Collection に表示します。 | [プレビュー](https://niho.life/developer/docs/living-surfaces/plan-v2.0/playground?example=schedule-feature-list) | | [夜の予定 · JSON](https://niho.life/developer/docs/living-surfaces/plan-v2.0/example-schedule-night.json) | 夜間向けの背景とテーマを使い、イベントの開催日と空席を表示します。 | [プレビュー](https://niho.life/developer/docs/living-surfaces/plan-v2.0/playground?example=schedule-night) | | [写真の窓 · JSON](https://niho.life/developer/docs/living-surfaces/plan-v2.0/example-schedule-photo-window.json) | 拠点の写真を横長の窓として見せます。代替テキストも指定します。 | [プレビュー](https://niho.life/developer/docs/living-surfaces/plan-v2.0/playground?example=schedule-photo-window) | | [ホーム · JSON](https://niho.life/developer/docs/living-surfaces/plan-v2.0/example-home.json) | 標準のホームコンテンツの前にウェルカムメッセージとチェックイン、後にお知らせを配置します。 | [プレビュー](https://niho.life/developer/docs/living-surfaces/plan-v2.0/playground?example=home) | | [人と部屋の案内 · JSON](https://niho.life/developer/docs/living-surfaces/plan-v2.0/example-home-compact-features.json) | 同じコンパクトな Feature で、担当者は横に、部屋の名前と設備はグリッドに並べます。写真は項目ごとに選べます。 | [プレビュー](https://niho.life/developer/docs/living-surfaces/plan-v2.0/playground?example=home-compact-features) | | [訪問案内と次の催し · JSON](https://niho.life/developer/docs/living-surfaces/plan-v2.0/example-home-visit-guide.json) | ロゴと写真を持つ見せ場、日時を先に読める開催カード、小さな写真と補足を持つ紹介を組み合わせます。 | [プレビュー](https://niho.life/developer/docs/living-surfaces/plan-v2.0/playground?example=home-visit-guide) | # RenderPlan 2.0 リファレンス JSON Schema と TypeScript 宣言は `page` の入力を定義します。コンポーネント間の依存関係やペイロード全体の上限は実行時に検証されます。 ## 章 - [クイックスタート](https://niho.life/developer/docs/living-surfaces/plan-v2.0/overview) · JSON 構成を作成し、プレビューで検証する手順。 - [コンポーネント](https://niho.life/developer/docs/living-surfaces/plan-v2.0/components) · 構成の階層、プロパティ、型定義。 - [データバインディング](https://niho.life/developer/docs/living-surfaces/plan-v2.0/data) · 画面ごとに使える source・filter・fields。 - [アクション](https://niho.life/developer/docs/living-surfaces/plan-v2.0/actions) · 画面定義が許す操作と項目 ref の扱い。 - [テーマと装飾](https://niho.life/developer/docs/living-surfaces/plan-v2.0/theme) · テーマ設定、デザイントークン、装飾カタログ。 - [バリデーションと上限](https://niho.life/developer/docs/living-surfaces/plan-v2.0/limits) · エラーの読み方、サイズ・個数・文字数の上限。 - [構成例](https://niho.life/developer/docs/living-surfaces/plan-v2.0/examples) · 予定タブとホームタブの JSON とプレビュー。 ## 配布ファイル - [catalog.json](https://niho.life/developer/docs/living-surfaces/plan-v2.0/catalog.json) · タブ定義、コンポーネント、テーマ、装飾、上限を JSON で参照できます。 - [schedule.schema.json](https://niho.life/developer/docs/living-surfaces/plan-v2.0/schedule.schema.json) · SCHEDULE の PLAN_V2.0 設計図入力 schema(JSON Schema draft 2020-12)です。 - [schedule.d.ts](https://niho.life/developer/docs/living-surfaces/plan-v2.0/schedule.d.ts) · SCHEDULE の PLAN_V2.0 のプロパティとアクションの型宣言です。 - [home.schema.json](https://niho.life/developer/docs/living-surfaces/plan-v2.0/home.schema.json) · HOME の PLAN_V2.0 設計図入力 schema(JSON Schema draft 2020-12)です。 - [home.d.ts](https://niho.life/developer/docs/living-surfaces/plan-v2.0/home.d.ts) · HOME の PLAN_V2.0 のプロパティとアクションの型宣言です。 - [example-schedule-poster.json](https://niho.life/developer/docs/living-surfaces/plan-v2.0/example-schedule-poster.json) · 次のイベントを、カバー画像・日時・詳細ボタン付きで表示します。 - [example-schedule-feature-list.json](https://niho.life/developer/docs/living-surfaces/plan-v2.0/example-schedule-feature-list.json) · 先頭のイベントを Feature に表示し、残りを横スクロールの Collection に表示します。 - [example-schedule-night.json](https://niho.life/developer/docs/living-surfaces/plan-v2.0/example-schedule-night.json) · 夜間向けの背景とテーマを使い、イベントの開催日と空席を表示します。 - [example-schedule-photo-window.json](https://niho.life/developer/docs/living-surfaces/plan-v2.0/example-schedule-photo-window.json) · 拠点の写真を横長の窓として見せます。代替テキストも指定します。 - [example-home.json](https://niho.life/developer/docs/living-surfaces/plan-v2.0/example-home.json) · 標準のホームコンテンツの前にウェルカムメッセージとチェックイン、後にお知らせを配置します。 - [example-home-compact-features.json](https://niho.life/developer/docs/living-surfaces/plan-v2.0/example-home-compact-features.json) · 同じコンパクトな Feature で、担当者は横に、部屋の名前と設備はグリッドに並べます。写真は項目ごとに選べます。 - [example-home-visit-guide.json](https://niho.life/developer/docs/living-surfaces/plan-v2.0/example-home-visit-guide.json) · ロゴと写真を持つ見せ場、日時を先に読める開催カード、小さな写真と補足を持つ紹介を組み合わせます。 ## catalog.json ```json { "renderer": "PLAN_V2", "planVersion": "2.0", "mode": "plan", "surfaces": { "SCHEDULE": { "surface": "SCHEDULE", "dataSchema": "SCHEDULE_V1", "regions": [ { "name": "sections", "required": true, "maxSections": 12 } ], "sources": { "events": { "filters": [ "upcoming", "joined", "open" ], "sorts": [ "start" ], "fields": [ "title", "date", "time", "places", "fee", "seats", "cover", "instructor", "organizer" ], "factKinds": [ "date", "startTime", "daysUntil", "seatsLeft", "fee", "places", "instructor", "organizer" ], "badgeKinds": [ "joined", "full", "closed" ], "progressValues": [ "seatsTaken" ], "boundActions": [ "openBooking" ], "itemAction": "openBooking", "maxLimit": 12 }, "bookings": { "filters": [ "mine" ], "sorts": [ "start" ], "fields": [ "date", "time", "places", "headCount", "exclusive" ], "factKinds": [ "date", "startTime", "daysUntil", "places", "headCount" ], "badgeKinds": [], "progressValues": [], "boundActions": [ "openBooking" ], "itemAction": "openBooking", "maxLimit": 12 } }, "actions": [ { "type": "openBooking", "boundToItem": true }, { "type": "startBooking", "boundToItem": false }, { "type": "openSurface", "boundToItem": false, "surfaces": [ "HOME", "SCHEDULE", "HELP_TASKS" ] } ], "modules": [ "calendar" ] }, "HOME": { "surface": "HOME", "dataSchema": "HOME_V1", "regions": [ { "name": "beforeCore", "required": false, "maxSections": 4 }, { "name": "afterCore", "required": false, "maxSections": 4 } ], "sources": { "upcoming": { "filters": [ "joined", "open" ], "sorts": [ "start" ], "fields": [ "title", "date", "time", "places", "seats", "cover", "fee", "instructor", "organizer" ], "factKinds": [ "date", "startTime", "daysUntil", "seatsLeft", "places", "fee", "instructor", "organizer" ], "badgeKinds": [ "joined", "full", "closed" ], "progressValues": [ "seatsTaken" ], "boundActions": [ "openBooking" ], "itemAction": "openBooking", "maxLimit": 12 }, "notices": { "filters": [ "unread" ], "sorts": [ "posted" ], "fields": [ "excerpt", "postedAt", "unread" ], "factKinds": [ "postedAt" ], "badgeKinds": [], "progressValues": [], "boundActions": [], "itemAction": "openNotices", "maxLimit": 5 } }, "actions": [ { "type": "openBooking", "boundToItem": true }, { "type": "openNotices", "boundToItem": false }, { "type": "openSurface", "boundToItem": false, "surfaces": [ "SCHEDULE", "HELP_TASKS", "STAMP_CARDS" ] } ], "modules": [ "checkin" ], "deduplicateCore": [ "week", "notice" ] } }, "components": { "assetNamePattern": "^[a-z][a-z0-9-]{0,31}$", "sectionLayouts": [ "stack", "rail", "grid2", "grid3", "split" ], "featureVariants": [ "banner", "poster", "night", "window", "masthead" ], "featureGrounds": [ "fill", "soft", "surface" ], "featureAligns": [ "start", "center" ], "collectionSkins": [ "plain", "media", "ticket", "placard", "slip" ], "collectionMarks": [ "pill", "stamp", "none" ], "collectionNumerals": [ "arabic", "kanji" ], "collectionMotions": [ "none", "enter" ], "textRoles": [ "display", "title", "body", "caption" ], "factKinds": [ "date", "startTime", "daysUntil", "seatsLeft", "fee", "places", "headCount", "postedAt", "instructor", "organizer" ], "factFormats": [ "md", "weekday", "weekdayLatin", "kanji", "relative" ], "factFormatsByKind": { "date": [ "md", "weekday", "weekdayLatin", "kanji", "relative" ], "postedAt": [ "md", "relative" ], "daysUntil": [ "kanji" ], "seatsLeft": [ "kanji" ], "startTime": [ "kanji" ], "headCount": [ "kanji" ], "fee": [], "instructor": [], "organizer": [], "places": [] }, "factSizes": [ "regular", "big" ], "badgeKindsBySurface": { "SCHEDULE": { "events": [ "joined", "full", "closed", "custom" ], "bookings": [ "custom" ] }, "HOME": { "upcoming": [ "joined", "full", "closed", "custom" ], "notices": [ "custom" ] } }, "badgeShapes": [ "pill", "stamp" ], "progressShapes": [ "bar", "ring" ], "mediaRatios": [ "1:1", "4:3", "3:2", "16:9", "3:4", "4:5" ], "mediaVeils": [ "none", "soft", "strong" ], "buttonKinds": [ "primary", "secondary", "text" ], "calendarViews": [ "day", "week", "month" ], "calendarDays": [ 5, 7 ], "markerFills": [ "solid", "soft", "plain" ], "markerEmojiPattern": "^\\p{Extended_Pictographic}\\uFE0F?(?:\\u200D\\p{Extended_Pictographic}\\uFE0F?){0,3}$", "modulesBySurface": { "SCHEDULE": [ "calendar" ], "HOME": [ "checkin" ] } }, "look": { "density": [ "compact", "regular", "airy" ], "shape": [ "sharp", "soft", "rounded", "leaf" ], "texture": [ "none", "paper", "grain", "night" ], "tones": [ "accent", "swatch1", "swatch2", "swatch3", "swatch4" ] }, "theme": { "landingGround": [ "LIGHT", "DARK_WARM" ], "landingAccent": [ "LEAF", "CORAL", "TERRACOTTA", "SAND", "SUMI" ], "landingFont": [ "MARU", "KAKU", "MINCHO", "KYOKASHO", "MODERN", "CLASSIC" ] }, "ornaments": { "catalog": [ "lantern", "lanterns", "moon", "leaf", "wave", "star", "stars", "confetti", "blob", "cloud", "noren" ], "anchors": [ "topLeft", "top", "topRight", "left", "center", "right", "bottomLeft", "bottom", "bottomRight" ], "sizes": [ "s", "m", "l" ], "offsetSteps": [ -2, -1, 0, 1, 2 ], "rotations": [ -15, -8, 0, 8, 15 ], "tones": [ "accent", "swatch1", "swatch2", "swatch3", "swatch4" ], "motions": [ "none", "enter", "sway", "stamp" ] }, "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 }, "mediaLimits": { "assets": 12, "sourceBytes": 4194304, "sourceEdge": 4096, "sourcePixels": 16777216, "displayEdge": 1080, "derivativeBytes": 327680, "totalDerivativeBytes": 1572864 } } ``` # JSON Schema・型宣言・作例 ## schedule.schema.json ```json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://niho.life/schemas/living-surface/plan-v2.0/schedule.json", "title": "PLAN_V2.0 SCHEDULE page", "description": "画面の設計図(入力の形)。page 全体の数の上限・skipFeatured の相手・UTF-16 での文字数は parser だけが検査する。", "type": "object", "additionalProperties": false, "properties": { "look": { "$ref": "#/$defs/look" }, "hideDefaultBookingButton": { "type": "boolean", "description": "true にすると、本文の予約ボタンが使えるときだけ、共通の+予約を表示しない。" }, "sections": { "type": "array", "minItems": 1, "maxItems": 12, "items": { "$ref": "#/$defs/section" } } }, "required": [ "sections" ], "$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" } ] }, "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" ] }, "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" ] }, "fit": { "enum": [ "cover", "contain" ] }, "focus": { "enum": [ "center", "top", "bottom", "left", "right" ] }, "size": { "enum": [ "s", "m", "l" ] }, "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 } } } ] }, { "if": { "properties": { "fit": { "const": "contain" } }, "required": [ "fit" ] }, "then": { "not": { "required": [ "focus" ] } } } ] }, "logo": { "type": "object", "additionalProperties": false, "properties": { "asset": { "$ref": "#/$defs/assetName" }, "ratio": { "enum": [ "1:1", "4:3", "3:2", "16:9", "3:4", "4:5" ] }, "alt": { "$ref": "#/$defs/localized.alt" }, "decorative": { "type": "boolean" } }, "required": [ "asset", "ratio" ], "oneOf": [ { "required": [ "alt" ] }, { "required": [ "decorative" ], "properties": { "decorative": { "const": true } } } ] }, "media.cover": { "type": "object", "additionalProperties": false, "properties": { "asset": { "$ref": "#/$defs/assetName" }, "cover": { "type": "boolean" }, "ratio": { "enum": [ "1:1", "4:3", "3:2", "16:9", "3:4", "4:5" ] }, "veil": { "enum": [ "none", "soft", "strong" ] }, "fit": { "enum": [ "cover", "contain" ] }, "focus": { "enum": [ "center", "top", "bottom", "left", "right" ] }, "size": { "enum": [ "s", "m", "l" ] }, "mono": { "type": "boolean" }, "alt": { "$ref": "#/$defs/localized.alt" }, "decorative": { "type": "boolean" } }, "required": [ "ratio" ], "allOf": [ { "oneOf": [ { "required": [ "asset" ] }, { "required": [ "cover" ], "properties": { "cover": { "const": true } } } ] }, { "oneOf": [ { "required": [ "alt" ] }, { "required": [ "decorative" ], "properties": { "decorative": { "const": true } } } ] }, { "if": { "properties": { "fit": { "const": "contain" } }, "required": [ "fit" ] }, "then": { "not": { "required": [ "focus" ] } } } ] }, "action.openBooking": { "type": "object", "additionalProperties": false, "properties": { "type": { "const": "openBooking" } }, "required": [ "type" ] }, "action.startBooking": { "type": "object", "additionalProperties": false, "properties": { "type": { "const": "startBooking" } }, "required": [ "type" ] }, "action.openSurface": { "type": "object", "additionalProperties": false, "properties": { "type": { "const": "openSurface" }, "surface": { "enum": [ "HOME", "SCHEDULE", "HELP_TASKS" ] } }, "required": [ "type", "surface" ] }, "button": { "type": "object", "additionalProperties": false, "properties": { "label": { "$ref": "#/$defs/localized.button" }, "kind": { "enum": [ "primary", "secondary", "text" ] }, "action": { "oneOf": [ { "$ref": "#/$defs/action.startBooking" }, { "$ref": "#/$defs/action.openSurface" } ] } }, "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" ] }, "feature.withoutItem": { "type": "object", "additionalProperties": false, "properties": { "type": { "const": "feature" }, "variant": { "enum": [ "banner", "poster", "night", "window", "masthead", "compact", "hero", "agenda", "portrait" ] }, "hideWhenEmpty": { "const": false }, "kicker": { "$ref": "#/$defs/text.kicker" }, "title": { "$ref": "#/$defs/text.heading" }, "subtitle": { "$ref": "#/$defs/text.sub" }, "facts": { "type": "array", "maxItems": 0 }, "badges": { "type": "array", "maxItems": 3, "items": { "$ref": "#/$defs/badge.custom" } }, "media": { "$ref": "#/$defs/media" }, "mediaPlacement": { "enum": [ "top", "start", "end", "over" ] }, "logo": { "$ref": "#/$defs/logo" }, "action": { "$ref": "#/$defs/button" }, "actionLayout": { "enum": [ "inline", "full", "bottom", "card" ] }, "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" ], "dependentRequired": { "mediaPlacement": [ "media" ], "actionLayout": [ "action" ] }, "allOf": [ { "if": { "properties": { "variant": { "const": "window" } }, "required": [ "variant" ] }, "then": { "required": [ "media" ] } }, { "if": { "properties": { "variant": { "const": "hero" } }, "required": [ "variant" ] }, "then": { "not": { "anyOf": [ { "required": [ "mediaPlacement" ] }, { "required": [ "ground" ] } ] } } }, { "if": { "properties": { "variant": { "const": "agenda" } }, "required": [ "variant" ] }, "then": { "not": { "anyOf": [ { "required": [ "mediaPlacement" ] }, { "required": [ "ground" ] } ] } } }, { "if": { "properties": { "variant": { "const": "portrait" } }, "required": [ "variant" ] }, "then": { "not": { "anyOf": [ { "required": [ "mediaPlacement" ] }, { "required": [ "ground" ] } ] } } } ] }, "query.events": { "type": "object", "additionalProperties": false, "properties": { "source": { "const": "events" }, "filter": { "type": "array", "maxItems": 3, "uniqueItems": true, "items": { "enum": [ "upcoming", "joined", "open" ] } }, "sort": { "enum": [ "start" ] } }, "required": [ "source" ] }, "fact.events": { "oneOf": [ { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "date" }, "format": { "enum": [ "md", "weekday", "weekdayLatin", "kanji", "relative" ] }, "size": { "enum": [ "regular", "big" ] } }, "required": [ "kind" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "startTime" }, "format": { "enum": [ "kanji" ] }, "size": { "enum": [ "regular", "big" ] } }, "required": [ "kind" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "daysUntil" }, "format": { "enum": [ "kanji" ] }, "size": { "enum": [ "regular", "big" ] } }, "required": [ "kind" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "seatsLeft" }, "format": { "enum": [ "kanji" ] }, "size": { "enum": [ "regular", "big" ] } }, "required": [ "kind" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "fee" }, "size": { "enum": [ "regular", "big" ] } }, "required": [ "kind" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "places" }, "size": { "enum": [ "regular", "big" ] } }, "required": [ "kind" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "instructor" }, "size": { "enum": [ "regular", "big" ] } }, "required": [ "kind" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "organizer" }, "size": { "enum": [ "regular", "big" ] } }, "required": [ "kind" ] } ] }, "badge.events": { "oneOf": [ { "type": "object", "additionalProperties": false, "properties": { "kind": { "enum": [ "joined", "full", "closed" ] }, "shape": { "enum": [ "pill", "stamp" ] } }, "required": [ "kind" ] }, { "$ref": "#/$defs/badge.custom" } ] }, "progress.events": { "type": "object", "additionalProperties": false, "properties": { "value": { "enum": [ "seatsTaken" ] }, "label": { "$ref": "#/$defs/localized.progress" }, "tone": { "enum": [ "accent", "swatch1", "swatch2", "swatch3", "swatch4" ] }, "shape": { "enum": [ "bar", "ring" ] } }, "required": [ "value", "label" ] }, "button.events": { "type": "object", "additionalProperties": false, "properties": { "label": { "$ref": "#/$defs/localized.button" }, "kind": { "enum": [ "primary", "secondary", "text" ] }, "action": { "oneOf": [ { "$ref": "#/$defs/action.openBooking" }, { "$ref": "#/$defs/action.startBooking" }, { "$ref": "#/$defs/action.openSurface" } ] } }, "required": [ "label", "action" ] }, "feature.events": { "type": "object", "additionalProperties": false, "properties": { "type": { "const": "feature" }, "variant": { "enum": [ "banner", "poster", "night", "window", "masthead", "compact", "hero", "agenda", "portrait" ] }, "item": { "$ref": "#/$defs/query.events" }, "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.events" } }, "badges": { "type": "array", "maxItems": 3, "items": { "$ref": "#/$defs/badge.events" } }, "progress": { "$ref": "#/$defs/progress.events" }, "media": { "$ref": "#/$defs/media.cover" }, "mediaPlacement": { "enum": [ "top", "start", "end", "over" ] }, "logo": { "$ref": "#/$defs/logo" }, "action": { "$ref": "#/$defs/button.events" }, "actionLayout": { "enum": [ "inline", "full", "bottom", "card" ] }, "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" ], "dependentRequired": { "mediaPlacement": [ "media" ], "actionLayout": [ "action" ] }, "allOf": [ { "if": { "properties": { "variant": { "const": "window" } }, "required": [ "variant" ] }, "then": { "required": [ "media" ] } }, { "if": { "properties": { "variant": { "const": "hero" } }, "required": [ "variant" ] }, "then": { "not": { "anyOf": [ { "required": [ "mediaPlacement" ] }, { "required": [ "ground" ] } ] } } }, { "if": { "properties": { "variant": { "const": "agenda" } }, "required": [ "variant" ] }, "then": { "not": { "anyOf": [ { "required": [ "mediaPlacement" ] }, { "required": [ "ground" ] } ] } } }, { "if": { "properties": { "variant": { "const": "portrait" } }, "required": [ "variant" ] }, "then": { "not": { "anyOf": [ { "required": [ "mediaPlacement" ] }, { "required": [ "ground" ] } ] } } }, { "oneOf": [ { "required": [ "empty" ] }, { "required": [ "hideWhenEmpty" ], "properties": { "hideWhenEmpty": { "const": true } } } ] } ] }, "collection.events": { "type": "object", "additionalProperties": false, "properties": { "type": { "const": "collection" }, "query": { "$ref": "#/$defs/query.events" }, "skin": { "enum": [ "plain", "media", "ticket", "placard", "slip" ] }, "layout": { "enum": [ "stack", "rail", "grid2", "grid3", "split", "tiles" ] }, "fields": { "type": "array", "minItems": 1, "maxItems": 6, "uniqueItems": true, "items": { "enum": [ "title", "date", "time", "places", "fee", "seats", "cover", "instructor", "organizer" ] } }, "limit": { "type": "integer", "minimum": 1, "maximum": 12 }, "empty": { "$ref": "#/$defs/text.any" }, "hideWhenEmpty": { "type": "boolean" }, "mark": { "enum": [ "pill", "stamp", "none" ] }, "skipFeatured": { "type": "boolean", "description": "同じ page に source が events の item を持つ feature があるときだけ。" }, "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": "cover" } } } } } ] }, "query.bookings": { "type": "object", "additionalProperties": false, "properties": { "source": { "const": "bookings" }, "filter": { "type": "array", "maxItems": 3, "uniqueItems": true, "items": { "enum": [ "mine" ] } }, "sort": { "enum": [ "start" ] } }, "required": [ "source" ] }, "fact.bookings": { "oneOf": [ { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "date" }, "format": { "enum": [ "md", "weekday", "weekdayLatin", "kanji", "relative" ] }, "size": { "enum": [ "regular", "big" ] } }, "required": [ "kind" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "startTime" }, "format": { "enum": [ "kanji" ] }, "size": { "enum": [ "regular", "big" ] } }, "required": [ "kind" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "daysUntil" }, "format": { "enum": [ "kanji" ] }, "size": { "enum": [ "regular", "big" ] } }, "required": [ "kind" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "places" }, "size": { "enum": [ "regular", "big" ] } }, "required": [ "kind" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "headCount" }, "format": { "enum": [ "kanji" ] }, "size": { "enum": [ "regular", "big" ] } }, "required": [ "kind" ] } ] }, "badge.bookings": { "$ref": "#/$defs/badge.custom" }, "button.bookings": { "type": "object", "additionalProperties": false, "properties": { "label": { "$ref": "#/$defs/localized.button" }, "kind": { "enum": [ "primary", "secondary", "text" ] }, "action": { "oneOf": [ { "$ref": "#/$defs/action.openBooking" }, { "$ref": "#/$defs/action.startBooking" }, { "$ref": "#/$defs/action.openSurface" } ] } }, "required": [ "label", "action" ] }, "feature.bookings": { "type": "object", "additionalProperties": false, "properties": { "type": { "const": "feature" }, "variant": { "enum": [ "banner", "poster", "night", "window", "masthead", "compact", "hero", "agenda", "portrait" ] }, "item": { "$ref": "#/$defs/query.bookings" }, "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.bookings" } }, "badges": { "type": "array", "maxItems": 3, "items": { "$ref": "#/$defs/badge.bookings" } }, "media": { "$ref": "#/$defs/media" }, "mediaPlacement": { "enum": [ "top", "start", "end", "over" ] }, "logo": { "$ref": "#/$defs/logo" }, "action": { "$ref": "#/$defs/button.bookings" }, "actionLayout": { "enum": [ "inline", "full", "bottom", "card" ] }, "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" ], "dependentRequired": { "mediaPlacement": [ "media" ], "actionLayout": [ "action" ] }, "allOf": [ { "if": { "properties": { "variant": { "const": "window" } }, "required": [ "variant" ] }, "then": { "required": [ "media" ] } }, { "if": { "properties": { "variant": { "const": "hero" } }, "required": [ "variant" ] }, "then": { "not": { "anyOf": [ { "required": [ "mediaPlacement" ] }, { "required": [ "ground" ] } ] } } }, { "if": { "properties": { "variant": { "const": "agenda" } }, "required": [ "variant" ] }, "then": { "not": { "anyOf": [ { "required": [ "mediaPlacement" ] }, { "required": [ "ground" ] } ] } } }, { "if": { "properties": { "variant": { "const": "portrait" } }, "required": [ "variant" ] }, "then": { "not": { "anyOf": [ { "required": [ "mediaPlacement" ] }, { "required": [ "ground" ] } ] } } }, { "oneOf": [ { "required": [ "empty" ] }, { "required": [ "hideWhenEmpty" ], "properties": { "hideWhenEmpty": { "const": true } } } ] } ] }, "collection.bookings": { "type": "object", "additionalProperties": false, "properties": { "type": { "const": "collection" }, "query": { "$ref": "#/$defs/query.bookings" }, "skin": { "enum": [ "plain", "ticket", "placard", "slip" ] }, "layout": { "enum": [ "stack", "rail", "grid2", "grid3", "split", "tiles" ] }, "fields": { "type": "array", "minItems": 1, "maxItems": 6, "uniqueItems": true, "items": { "enum": [ "date", "time", "places", "headCount", "exclusive" ] } }, "limit": { "type": "integer", "minimum": 1, "maximum": 12 }, "empty": { "$ref": "#/$defs/text.any" }, "hideWhenEmpty": { "type": "boolean" }, "mark": { "enum": [ "pill", "stamp", "none" ] }, "skipFeatured": { "type": "boolean", "description": "同じ page に source が bookings の item を持つ feature があるときだけ。" }, "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" } } } } ] }, "feature": { "oneOf": [ { "$ref": "#/$defs/feature.withoutItem" }, { "$ref": "#/$defs/feature.events" }, { "$ref": "#/$defs/feature.bookings" } ] }, "collection": { "oneOf": [ { "$ref": "#/$defs/collection.events" }, { "$ref": "#/$defs/collection.bookings" } ] }, "module.calendar": { "type": "object", "additionalProperties": false, "properties": { "type": { "const": "module" }, "name": { "const": "calendar" }, "view": { "enum": [ "day", "week", "month" ] }, "days": { "enum": [ 5, 7 ] }, "compact": { "type": "boolean" }, "controls": { "type": "boolean" }, "marker": { "type": "object", "additionalProperties": false, "properties": { "tone": { "enum": [ "accent", "swatch1", "swatch2", "swatch3", "swatch4" ] }, "fill": { "enum": [ "solid", "soft", "plain" ] }, "emoji": { "type": "string", "maxLength": 16, "pattern": "^\\p{Extended_Pictographic}\\uFE0F?(?:\\u200D\\p{Extended_Pictographic}\\uFE0F?){0,3}$" } } } }, "required": [ "type", "name", "view" ], "if": { "required": [ "days" ] }, "then": { "properties": { "view": { "const": "week" } } } }, "module": { "oneOf": [ { "$ref": "#/$defs/module.calendar" } ] }, "item": { "oneOf": [ { "$ref": "#/$defs/feature" }, { "$ref": "#/$defs/collection" }, { "$ref": "#/$defs/module" } ] }, "section": { "type": "object", "additionalProperties": false, "properties": { "title": { "$ref": "#/$defs/text.heading" }, "kicker": { "$ref": "#/$defs/text.kicker" }, "action": { "$ref": "#/$defs/button" }, "layout": { "enum": [ "stack", "rail", "grid2", "grid3", "split", "tiles" ] }, "ornaments": { "$ref": "#/$defs/ornaments" }, "items": { "type": "array", "minItems": 1, "maxItems": 6, "items": { "$ref": "#/$defs/item" } } }, "required": [ "layout", "items" ], "dependentRequired": { "kicker": [ "title" ], "action": [ "title" ] }, "allOf": [ { "if": { "properties": { "layout": { "const": "split" } }, "required": [ "layout" ] }, "then": { "properties": { "items": { "minItems": 2, "maxItems": 4 } } } }, { "if": { "properties": { "items": { "contains": { "$ref": "#/$defs/module" } } }, "required": [ "items" ] }, "then": { "properties": { "layout": { "const": "stack" }, "items": { "maxItems": 1 } } } } ] } } } ``` ## home.schema.json ```json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://niho.life/schemas/living-surface/plan-v2.0/home.json", "title": "PLAN_V2.0 HOME page", "description": "画面の設計図(入力の形)。page 全体の数の上限・skipFeatured の相手・UTF-16 での文字数は parser だけが検査する。", "type": "object", "additionalProperties": false, "properties": { "look": { "$ref": "#/$defs/look" }, "deduplicateCore": { "type": "array", "maxItems": 2, "items": { "enum": [ "week", "notice" ] }, "description": "beforeCore で実際に描く同じ項目を、標準の今週の予定のリストまたは既読のお知らせから控除する。週間カレンダーは維持する。空は省略に正規化する。" }, "beforeCore": { "type": "array", "minItems": 0, "maxItems": 4, "items": { "$ref": "#/$defs/section" } }, "afterCore": { "type": "array", "minItems": 0, "maxItems": 4, "items": { "$ref": "#/$defs/section" } } }, "anyOf": [ { "required": [ "beforeCore" ], "properties": { "beforeCore": { "minItems": 1 } } }, { "required": [ "afterCore" ], "properties": { "afterCore": { "minItems": 1 } } } ], "$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" } ] }, "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" ] }, "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" ] }, "fit": { "enum": [ "cover", "contain" ] }, "focus": { "enum": [ "center", "top", "bottom", "left", "right" ] }, "size": { "enum": [ "s", "m", "l" ] }, "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 } } } ] }, { "if": { "properties": { "fit": { "const": "contain" } }, "required": [ "fit" ] }, "then": { "not": { "required": [ "focus" ] } } } ] }, "logo": { "type": "object", "additionalProperties": false, "properties": { "asset": { "$ref": "#/$defs/assetName" }, "ratio": { "enum": [ "1:1", "4:3", "3:2", "16:9", "3:4", "4:5" ] }, "alt": { "$ref": "#/$defs/localized.alt" }, "decorative": { "type": "boolean" } }, "required": [ "asset", "ratio" ], "oneOf": [ { "required": [ "alt" ] }, { "required": [ "decorative" ], "properties": { "decorative": { "const": true } } } ] }, "media.cover": { "type": "object", "additionalProperties": false, "properties": { "asset": { "$ref": "#/$defs/assetName" }, "cover": { "type": "boolean" }, "ratio": { "enum": [ "1:1", "4:3", "3:2", "16:9", "3:4", "4:5" ] }, "veil": { "enum": [ "none", "soft", "strong" ] }, "fit": { "enum": [ "cover", "contain" ] }, "focus": { "enum": [ "center", "top", "bottom", "left", "right" ] }, "size": { "enum": [ "s", "m", "l" ] }, "mono": { "type": "boolean" }, "alt": { "$ref": "#/$defs/localized.alt" }, "decorative": { "type": "boolean" } }, "required": [ "ratio" ], "allOf": [ { "oneOf": [ { "required": [ "asset" ] }, { "required": [ "cover" ], "properties": { "cover": { "const": true } } } ] }, { "oneOf": [ { "required": [ "alt" ] }, { "required": [ "decorative" ], "properties": { "decorative": { "const": true } } } ] }, { "if": { "properties": { "fit": { "const": "contain" } }, "required": [ "fit" ] }, "then": { "not": { "required": [ "focus" ] } } } ] }, "action.openBooking": { "type": "object", "additionalProperties": false, "properties": { "type": { "const": "openBooking" } }, "required": [ "type" ] }, "action.openNotices": { "type": "object", "additionalProperties": false, "properties": { "type": { "const": "openNotices" } }, "required": [ "type" ] }, "action.openSurface": { "type": "object", "additionalProperties": false, "properties": { "type": { "const": "openSurface" }, "surface": { "enum": [ "SCHEDULE", "HELP_TASKS", "STAMP_CARDS" ] } }, "required": [ "type", "surface" ] }, "button": { "type": "object", "additionalProperties": false, "properties": { "label": { "$ref": "#/$defs/localized.button" }, "kind": { "enum": [ "primary", "secondary", "text" ] }, "action": { "oneOf": [ { "$ref": "#/$defs/action.openNotices" }, { "$ref": "#/$defs/action.openSurface" } ] } }, "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" ] }, "feature.withoutItem": { "type": "object", "additionalProperties": false, "properties": { "type": { "const": "feature" }, "variant": { "enum": [ "banner", "poster", "night", "window", "masthead", "compact", "hero", "agenda", "portrait" ] }, "hideWhenEmpty": { "const": false }, "kicker": { "$ref": "#/$defs/text.kicker" }, "title": { "$ref": "#/$defs/text.heading" }, "subtitle": { "$ref": "#/$defs/text.sub" }, "facts": { "type": "array", "maxItems": 0 }, "badges": { "type": "array", "maxItems": 3, "items": { "$ref": "#/$defs/badge.custom" } }, "media": { "$ref": "#/$defs/media" }, "mediaPlacement": { "enum": [ "top", "start", "end", "over" ] }, "logo": { "$ref": "#/$defs/logo" }, "action": { "$ref": "#/$defs/button" }, "actionLayout": { "enum": [ "inline", "full", "bottom", "card" ] }, "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" ], "dependentRequired": { "mediaPlacement": [ "media" ], "actionLayout": [ "action" ] }, "allOf": [ { "if": { "properties": { "variant": { "const": "window" } }, "required": [ "variant" ] }, "then": { "required": [ "media" ] } }, { "if": { "properties": { "variant": { "const": "hero" } }, "required": [ "variant" ] }, "then": { "not": { "anyOf": [ { "required": [ "mediaPlacement" ] }, { "required": [ "ground" ] } ] } } }, { "if": { "properties": { "variant": { "const": "agenda" } }, "required": [ "variant" ] }, "then": { "not": { "anyOf": [ { "required": [ "mediaPlacement" ] }, { "required": [ "ground" ] } ] } } }, { "if": { "properties": { "variant": { "const": "portrait" } }, "required": [ "variant" ] }, "then": { "not": { "anyOf": [ { "required": [ "mediaPlacement" ] }, { "required": [ "ground" ] } ] } } } ] }, "query.upcoming": { "type": "object", "additionalProperties": false, "properties": { "source": { "const": "upcoming" }, "filter": { "type": "array", "maxItems": 3, "uniqueItems": true, "items": { "enum": [ "joined", "open" ] } }, "sort": { "enum": [ "start" ] } }, "required": [ "source" ] }, "fact.upcoming": { "oneOf": [ { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "date" }, "format": { "enum": [ "md", "weekday", "weekdayLatin", "kanji", "relative" ] }, "size": { "enum": [ "regular", "big" ] } }, "required": [ "kind" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "startTime" }, "format": { "enum": [ "kanji" ] }, "size": { "enum": [ "regular", "big" ] } }, "required": [ "kind" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "daysUntil" }, "format": { "enum": [ "kanji" ] }, "size": { "enum": [ "regular", "big" ] } }, "required": [ "kind" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "seatsLeft" }, "format": { "enum": [ "kanji" ] }, "size": { "enum": [ "regular", "big" ] } }, "required": [ "kind" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "places" }, "size": { "enum": [ "regular", "big" ] } }, "required": [ "kind" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "fee" }, "size": { "enum": [ "regular", "big" ] } }, "required": [ "kind" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "instructor" }, "size": { "enum": [ "regular", "big" ] } }, "required": [ "kind" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "organizer" }, "size": { "enum": [ "regular", "big" ] } }, "required": [ "kind" ] } ] }, "badge.upcoming": { "oneOf": [ { "type": "object", "additionalProperties": false, "properties": { "kind": { "enum": [ "joined", "full", "closed" ] }, "shape": { "enum": [ "pill", "stamp" ] } }, "required": [ "kind" ] }, { "$ref": "#/$defs/badge.custom" } ] }, "progress.upcoming": { "type": "object", "additionalProperties": false, "properties": { "value": { "enum": [ "seatsTaken" ] }, "label": { "$ref": "#/$defs/localized.progress" }, "tone": { "enum": [ "accent", "swatch1", "swatch2", "swatch3", "swatch4" ] }, "shape": { "enum": [ "bar", "ring" ] } }, "required": [ "value", "label" ] }, "button.upcoming": { "type": "object", "additionalProperties": false, "properties": { "label": { "$ref": "#/$defs/localized.button" }, "kind": { "enum": [ "primary", "secondary", "text" ] }, "action": { "oneOf": [ { "$ref": "#/$defs/action.openBooking" }, { "$ref": "#/$defs/action.openNotices" }, { "$ref": "#/$defs/action.openSurface" } ] } }, "required": [ "label", "action" ] }, "feature.upcoming": { "type": "object", "additionalProperties": false, "properties": { "type": { "const": "feature" }, "variant": { "enum": [ "banner", "poster", "night", "window", "masthead", "compact", "hero", "agenda", "portrait" ] }, "item": { "$ref": "#/$defs/query.upcoming" }, "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.upcoming" } }, "badges": { "type": "array", "maxItems": 3, "items": { "$ref": "#/$defs/badge.upcoming" } }, "progress": { "$ref": "#/$defs/progress.upcoming" }, "media": { "$ref": "#/$defs/media.cover" }, "mediaPlacement": { "enum": [ "top", "start", "end", "over" ] }, "logo": { "$ref": "#/$defs/logo" }, "action": { "$ref": "#/$defs/button.upcoming" }, "actionLayout": { "enum": [ "inline", "full", "bottom", "card" ] }, "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" ], "dependentRequired": { "mediaPlacement": [ "media" ], "actionLayout": [ "action" ] }, "allOf": [ { "if": { "properties": { "variant": { "const": "window" } }, "required": [ "variant" ] }, "then": { "required": [ "media" ] } }, { "if": { "properties": { "variant": { "const": "hero" } }, "required": [ "variant" ] }, "then": { "not": { "anyOf": [ { "required": [ "mediaPlacement" ] }, { "required": [ "ground" ] } ] } } }, { "if": { "properties": { "variant": { "const": "agenda" } }, "required": [ "variant" ] }, "then": { "not": { "anyOf": [ { "required": [ "mediaPlacement" ] }, { "required": [ "ground" ] } ] } } }, { "if": { "properties": { "variant": { "const": "portrait" } }, "required": [ "variant" ] }, "then": { "not": { "anyOf": [ { "required": [ "mediaPlacement" ] }, { "required": [ "ground" ] } ] } } }, { "oneOf": [ { "required": [ "empty" ] }, { "required": [ "hideWhenEmpty" ], "properties": { "hideWhenEmpty": { "const": true } } } ] } ] }, "collection.upcoming": { "type": "object", "additionalProperties": false, "properties": { "type": { "const": "collection" }, "query": { "$ref": "#/$defs/query.upcoming" }, "skin": { "enum": [ "plain", "media", "ticket", "placard", "slip" ] }, "layout": { "enum": [ "stack", "rail", "grid2", "grid3", "split", "tiles" ] }, "fields": { "type": "array", "minItems": 1, "maxItems": 6, "uniqueItems": true, "items": { "enum": [ "title", "date", "time", "places", "seats", "cover", "fee", "instructor", "organizer" ] } }, "limit": { "type": "integer", "minimum": 1, "maximum": 12 }, "empty": { "$ref": "#/$defs/text.any" }, "hideWhenEmpty": { "type": "boolean" }, "mark": { "enum": [ "pill", "stamp", "none" ] }, "skipFeatured": { "type": "boolean", "description": "同じ page に source が upcoming の item を持つ feature があるときだけ。" }, "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": "cover" } } } } } ] }, "query.notices": { "type": "object", "additionalProperties": false, "properties": { "source": { "const": "notices" }, "filter": { "type": "array", "maxItems": 3, "uniqueItems": true, "items": { "enum": [ "unread" ] } }, "sort": { "enum": [ "posted" ] } }, "required": [ "source" ] }, "fact.notices": { "oneOf": [ { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "postedAt" }, "format": { "enum": [ "md", "relative" ] }, "size": { "enum": [ "regular", "big" ] } }, "required": [ "kind" ] } ] }, "badge.notices": { "$ref": "#/$defs/badge.custom" }, "button.notices": { "type": "object", "additionalProperties": false, "properties": { "label": { "$ref": "#/$defs/localized.button" }, "kind": { "enum": [ "primary", "secondary", "text" ] }, "action": { "oneOf": [ { "$ref": "#/$defs/action.openNotices" }, { "$ref": "#/$defs/action.openSurface" } ] } }, "required": [ "label", "action" ] }, "feature.notices": { "type": "object", "additionalProperties": false, "properties": { "type": { "const": "feature" }, "variant": { "enum": [ "banner", "poster", "night", "window", "masthead", "compact", "hero", "agenda", "portrait" ] }, "item": { "$ref": "#/$defs/query.notices" }, "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.notices" } }, "badges": { "type": "array", "maxItems": 3, "items": { "$ref": "#/$defs/badge.notices" } }, "media": { "$ref": "#/$defs/media" }, "mediaPlacement": { "enum": [ "top", "start", "end", "over" ] }, "logo": { "$ref": "#/$defs/logo" }, "action": { "$ref": "#/$defs/button.notices" }, "actionLayout": { "enum": [ "inline", "full", "bottom", "card" ] }, "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" ], "dependentRequired": { "mediaPlacement": [ "media" ], "actionLayout": [ "action" ] }, "allOf": [ { "if": { "properties": { "variant": { "const": "window" } }, "required": [ "variant" ] }, "then": { "required": [ "media" ] } }, { "if": { "properties": { "variant": { "const": "hero" } }, "required": [ "variant" ] }, "then": { "not": { "anyOf": [ { "required": [ "mediaPlacement" ] }, { "required": [ "ground" ] } ] } } }, { "if": { "properties": { "variant": { "const": "agenda" } }, "required": [ "variant" ] }, "then": { "not": { "anyOf": [ { "required": [ "mediaPlacement" ] }, { "required": [ "ground" ] } ] } } }, { "if": { "properties": { "variant": { "const": "portrait" } }, "required": [ "variant" ] }, "then": { "not": { "anyOf": [ { "required": [ "mediaPlacement" ] }, { "required": [ "ground" ] } ] } } }, { "oneOf": [ { "required": [ "empty" ] }, { "required": [ "hideWhenEmpty" ], "properties": { "hideWhenEmpty": { "const": true } } } ] } ] }, "collection.notices": { "type": "object", "additionalProperties": false, "properties": { "type": { "const": "collection" }, "query": { "$ref": "#/$defs/query.notices" }, "skin": { "enum": [ "plain", "ticket", "placard", "slip" ] }, "layout": { "enum": [ "stack", "rail", "grid2", "grid3", "split", "tiles" ] }, "fields": { "type": "array", "minItems": 1, "maxItems": 6, "uniqueItems": true, "items": { "enum": [ "excerpt", "postedAt", "unread" ] } }, "limit": { "type": "integer", "minimum": 1, "maximum": 5 }, "empty": { "$ref": "#/$defs/text.any" }, "hideWhenEmpty": { "type": "boolean" }, "mark": { "enum": [ "pill", "stamp", "none" ] }, "skipFeatured": { "type": "boolean", "description": "同じ page に source が notices の item を持つ feature があるときだけ。" }, "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" } } } } ] }, "feature": { "oneOf": [ { "$ref": "#/$defs/feature.withoutItem" }, { "$ref": "#/$defs/feature.upcoming" }, { "$ref": "#/$defs/feature.notices" } ] }, "collection": { "oneOf": [ { "$ref": "#/$defs/collection.upcoming" }, { "$ref": "#/$defs/collection.notices" } ] }, "module.checkin": { "type": "object", "additionalProperties": false, "properties": { "type": { "const": "module" }, "name": { "const": "checkin" } }, "required": [ "type", "name" ] }, "module": { "oneOf": [ { "$ref": "#/$defs/module.checkin" } ] }, "item": { "oneOf": [ { "$ref": "#/$defs/feature" }, { "$ref": "#/$defs/collection" }, { "$ref": "#/$defs/module" } ] }, "section": { "type": "object", "additionalProperties": false, "properties": { "title": { "$ref": "#/$defs/text.heading" }, "kicker": { "$ref": "#/$defs/text.kicker" }, "action": { "$ref": "#/$defs/button" }, "layout": { "enum": [ "stack", "rail", "grid2", "grid3", "split", "tiles" ] }, "ornaments": { "$ref": "#/$defs/ornaments" }, "items": { "type": "array", "minItems": 1, "maxItems": 6, "items": { "$ref": "#/$defs/item" } } }, "required": [ "layout", "items" ], "dependentRequired": { "kicker": [ "title" ], "action": [ "title" ] }, "allOf": [ { "if": { "properties": { "layout": { "const": "split" } }, "required": [ "layout" ] }, "then": { "properties": { "items": { "minItems": 2, "maxItems": 4 } } } }, { "if": { "properties": { "items": { "contains": { "$ref": "#/$defs/module" } } }, "required": [ "items" ] }, "then": { "properties": { "layout": { "const": "stack" }, "items": { "maxItems": 1 } } } } ] } } } ``` ## schedule.d.ts ```ts // PLAN_V2.0 の SCHEDULE の設計図(入力の形)。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: "startBooking" } | { readonly type: "openSurface"; readonly surface: "HOME" | "SCHEDULE" | "HELP_TASKS" }; 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 LivingSurfacePlanQueryEvents = { readonly source: "events"; readonly filter?: readonly ("upcoming" | "joined" | "open")[]; readonly sort?: "start" }; export type LivingSurfacePlanFactEvents = { 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: "fee"; readonly size?: "regular" | "big" } | { readonly kind: "places"; readonly size?: "regular" | "big" } | { readonly kind: "instructor"; readonly size?: "regular" | "big" } | { readonly kind: "organizer"; readonly size?: "regular" | "big" }; export type LivingSurfacePlanBadgeEvents = { readonly kind: "joined" | "full" | "closed"; readonly shape?: "pill" | "stamp" } | LivingSurfacePlanCustomBadge; export type LivingSurfacePlanProgressEvents = { readonly value: "seatsTaken"; readonly label: LivingSurfacePlanLocalizedText; readonly tone?: "accent" | "swatch1" | "swatch2" | "swatch3" | "swatch4"; readonly shape?: "bar" | "ring" }; export type LivingSurfacePlanFeatureEvents = LivingSurfacePlanFeatureBase & LivingSurfacePlanFeatureVariant & LivingSurfacePlanEmptiness & LivingSurfacePlanFeatureAction<{ readonly type: "openBooking" } | { readonly type: "startBooking" } | { readonly type: "openSurface"; readonly surface: "HOME" | "SCHEDULE" | "HELP_TASKS" }> & { readonly item: LivingSurfacePlanQueryEvents; readonly facts?: readonly LivingSurfacePlanFactEvents[]; readonly badges?: readonly LivingSurfacePlanBadgeEvents[]; readonly progress?: LivingSurfacePlanProgressEvents }; export type LivingSurfacePlanCollectionEvents = { readonly type: "collection"; readonly query: LivingSurfacePlanQueryEvents; readonly skin: "plain" | "media" | "ticket" | "placard" | "slip"; readonly fields: readonly ("title" | "date" | "time" | "places" | "fee" | "seats" | "cover" | "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 LivingSurfacePlanQueryBookings = { readonly source: "bookings"; readonly filter?: readonly ("mine")[]; readonly sort?: "start" }; export type LivingSurfacePlanFactBookings = { 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: "places"; readonly size?: "regular" | "big" } | { readonly kind: "headCount"; readonly format?: "kanji"; readonly size?: "regular" | "big" }; export type LivingSurfacePlanBadgeBookings = LivingSurfacePlanCustomBadge; export type LivingSurfacePlanFeatureBookings = LivingSurfacePlanFeatureBase & LivingSurfacePlanFeatureVariant & LivingSurfacePlanEmptiness & LivingSurfacePlanFeatureAction<{ readonly type: "openBooking" } | { readonly type: "startBooking" } | { readonly type: "openSurface"; readonly surface: "HOME" | "SCHEDULE" | "HELP_TASKS" }> & { readonly item: LivingSurfacePlanQueryBookings; readonly facts?: readonly LivingSurfacePlanFactBookings[]; readonly badges?: readonly LivingSurfacePlanBadgeBookings[]; readonly progress?: never }; export type LivingSurfacePlanCollectionBookings = { readonly type: "collection"; readonly query: LivingSurfacePlanQueryBookings; readonly skin: "plain" | "ticket" | "placard" | "slip"; readonly fields: readonly ("date" | "time" | "places" | "headCount" | "exclusive")[]; 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 | LivingSurfacePlanFeatureEvents | LivingSurfacePlanFeatureBookings; export type LivingSurfacePlanCollection = LivingSurfacePlanCollectionEvents | LivingSurfacePlanCollectionBookings; export type LivingSurfacePlanModule = ({ readonly type: "module"; readonly name: "calendar"; readonly compact?: boolean; readonly controls?: boolean; readonly marker?: { readonly tone?: "accent" | "swatch1" | "swatch2" | "swatch3" | "swatch4"; readonly fill?: "solid" | "soft" | "plain"; readonly emoji?: string } } & ({ readonly view: "week"; readonly days?: 5 | 7 } | { readonly view: "day" | "month"; readonly days?: never })); 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 hideDefaultBookingButton?: boolean; readonly sections: readonly LivingSurfacePlanSection[]; }; ``` ## home.d.ts ```ts // 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[]; }; ``` ## example-schedule-poster.json ```json { "renderer": "PLAN_V2", "planVersion": "2.0", "surface": "SCHEDULE", "page": { "look": { "density": "airy", "shape": "soft", "texture": "paper" }, "sections": [ { "layout": "stack", "items": [ { "type": "feature", "variant": "poster", "item": { "source": "events", "filter": [ "upcoming" ] }, "hideWhenEmpty": true, "kicker": { "role": "caption", "text": { "ja": "次のまつり", "en": "Next festival" } }, "facts": [ { "kind": "date", "format": "weekday" }, { "kind": "startTime" } ], "badges": [ { "kind": "custom", "label": { "ja": "注目", "en": "Featured" } } ], "progress": { "value": "seatsTaken", "label": { "ja": "予約済みの席", "en": "Reserved seats" }, "shape": "bar" }, "media": { "cover": true, "ratio": "3:4", "alt": { "ja": "まつりの写真", "en": "Festival photo" } }, "action": { "label": { "ja": "予定を見る", "en": "View event" }, "action": { "type": "openBooking" } } } ] } ] } } ``` ## example-schedule-feature-list.json ```json { "renderer": "PLAN_V2", "planVersion": "2.0", "surface": "SCHEDULE", "page": { "sections": [ { "layout": "stack", "items": [ { "type": "feature", "variant": "banner", "item": { "source": "events", "filter": [ "upcoming" ] }, "hideWhenEmpty": true, "kicker": { "role": "caption", "text": { "ja": "次のイベント", "en": "Next event" } }, "facts": [ { "kind": "date" }, { "kind": "seatsLeft" } ] } ] }, { "layout": "rail", "items": [ { "type": "collection", "query": { "source": "events", "filter": [ "upcoming" ] }, "skin": "ticket", "layout": "rail", "fields": [ "title", "date", "time" ], "limit": 6, "hideWhenEmpty": true, "skipFeatured": true } ] }, { "layout": "stack", "items": [ { "type": "module", "name": "calendar", "view": "week", "days": 5, "controls": true } ] } ] } } ``` ## example-schedule-night.json ```json { "renderer": "PLAN_V2", "planVersion": "2.0", "surface": "SCHEDULE", "page": { "look": { "texture": "night" }, "sections": [ { "layout": "stack", "items": [ { "type": "feature", "variant": "night", "item": { "source": "events", "filter": [ "upcoming", "open" ] }, "kicker": { "role": "caption", "text": { "ja": "夜のイベント", "en": "Evening event" } }, "empty": { "role": "body", "text": { "ja": "次の予定を準備しています", "en": "The next event is being prepared" } }, "facts": [ { "kind": "daysUntil", "format": "kanji" }, { "kind": "seatsLeft" } ], "badges": [ { "kind": "joined", "shape": "stamp" } ], "media": { "asset": "night-sky", "ratio": "4:5", "veil": "strong", "alt": { "ja": "夜空", "en": "Night sky" } }, "action": { "label": { "ja": "予約する", "en": "Book" }, "action": { "type": "openBooking" } }, "ornaments": [ { "catalog": "stars", "anchor": "top", "motion": "stamp" } ] } ] } ] } } ``` ## example-schedule-photo-window.json ```json { "renderer": "PLAN_V2", "planVersion": "2.0", "surface": "SCHEDULE", "page": { "sections": [ { "layout": "stack", "items": [ { "type": "feature", "variant": "window", "media": { "asset": "community-room", "ratio": "16:9", "veil": "soft", "alt": { "ja": "みんなで集まる部屋", "en": "A room for gathering" } } } ] } ] } } ``` ## example-home.json ```json { "renderer": "PLAN_V2", "planVersion": "2.0", "surface": "HOME", "page": { "beforeCore": [ { "layout": "stack", "items": [ { "type": "feature", "variant": "masthead", "title": { "role": "display", "text": { "ja": "まちの集会所", "en": "The Meeting House" } }, "action": { "label": { "ja": "予定を見る", "en": "View schedule" }, "action": { "type": "openSurface", "surface": "SCHEDULE" } } } ] }, { "layout": "stack", "items": [ { "type": "module", "name": "checkin" } ] } ], "afterCore": [ { "title": { "role": "title", "text": { "ja": "お知らせ", "en": "Notices" } }, "layout": "stack", "items": [ { "type": "collection", "query": { "source": "notices", "filter": [ "unread" ] }, "skin": "plain", "layout": "stack", "fields": [ "excerpt", "postedAt", "unread" ], "limit": 3, "hideWhenEmpty": true } ] } ] } } ``` ## example-home-compact-features.json ```json { "renderer": "PLAN_V2", "planVersion": "2.0", "surface": "HOME", "page": { "beforeCore": [ { "title": { "role": "title", "text": { "ja": "サポート担当", "en": "Support team" } }, "layout": "rail", "items": [ { "type": "feature", "variant": "compact", "title": { "role": "title", "text": { "ja": "サポート担当 A", "en": "Support lead A" } }, "subtitle": { "role": "body", "text": { "ja": "はじめての方向けの案内", "en": "Help for first-time visitors" } }, "media": { "asset": "staff-a", "ratio": "1:1", "decorative": true } }, { "type": "feature", "variant": "compact", "title": { "role": "title", "text": { "ja": "サポート担当 B", "en": "Support lead B" } }, "subtitle": { "role": "body", "text": { "ja": "備品と設備の相談", "en": "Equipment and room setup" } } } ] }, { "title": { "role": "title", "text": { "ja": "部屋のご案内", "en": "Our rooms" } }, "layout": "grid2", "items": [ { "type": "feature", "variant": "compact", "title": { "role": "title", "text": { "ja": "窓の部屋", "en": "The window room" } }, "subtitle": { "role": "body", "text": { "ja": "6名・テーブルと椅子", "en": "Seats six, with a table and chairs" } }, "media": { "asset": "window-room", "ratio": "1:1", "fit": "contain", "alt": { "ja": "窓側に並ぶテーブルと椅子", "en": "Table and chairs arranged by the window" } } }, { "type": "feature", "variant": "compact", "title": { "role": "title", "text": { "ja": "奥の部屋", "en": "The back room" } }, "subtitle": { "role": "body", "text": { "ja": "4名・ホワイトボード", "en": "Seats four, with a whiteboard" } } } ] } ] } } ``` ## example-home-visit-guide.json ```json { "renderer": "PLAN_V2", "planVersion": "2.0", "surface": "HOME", "page": { "beforeCore": [ { "layout": "stack", "items": [ { "type": "feature", "variant": "hero", "logo": { "asset": "studio-logo", "ratio": "3:2", "alt": { "ja": "まちの工房", "en": "The neighborhood workshop" } }, "media": { "asset": "studio-entrance", "ratio": "4:3", "alt": { "ja": "工房の入口", "en": "The workshop entrance" } }, "kicker": { "role": "caption", "text": { "ja": "初めての方へ", "en": "First visit" } }, "title": { "role": "display", "text": { "ja": "自分の手でものを作る", "en": "Make something by hand" } } } ] }, { "title": { "role": "title", "text": { "ja": "次の催し", "en": "Up next" } }, "layout": "stack", "items": [ { "type": "feature", "variant": "agenda", "item": { "source": "upcoming" }, "empty": { "role": "body", "text": { "ja": "次の催しは準備中です。", "en": "The next event is being planned." } }, "media": { "cover": true, "ratio": "3:2", "fit": "contain", "decorative": true }, "facts": [ { "kind": "daysUntil", "size": "big" }, { "kind": "date" }, { "kind": "startTime" }, { "kind": "instructor" }, { "kind": "fee" } ], "action": { "label": { "ja": "催しの詳細を見る", "en": "View details" }, "kind": "primary", "action": { "type": "openBooking" } }, "actionLayout": "card" } ] }, { "title": { "role": "title", "text": { "ja": "工房の担当", "en": "Workshop team" } }, "layout": "tiles", "items": [ { "type": "feature", "variant": "portrait", "media": { "asset": "staff-a", "ratio": "1:1", "decorative": true }, "title": { "role": "title", "text": { "ja": "担当 A", "en": "Staff A" } }, "subtitle": { "role": "caption", "text": { "ja": "木工の案内", "en": "Woodworking guide" } } }, { "type": "feature", "variant": "portrait", "title": { "role": "title", "text": { "ja": "担当 B", "en": "Staff B" } }, "subtitle": { "role": "caption", "text": { "ja": "道具の相談", "en": "Help choosing tools" } } } ] } ] } } ```