@krizaka/ui 3.67.0 → 3.68.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (267) hide show
  1. package/dist/app-header.d.ts +3 -3
  2. package/dist/app-shell.js +2 -2
  3. package/dist/app-shell.js.map +1 -1
  4. package/dist/chunk-PZ4FJOD5.js +44 -0
  5. package/dist/chunk-PZ4FJOD5.js.map +1 -0
  6. package/dist/{chunk-6BMKLAZ7.js → chunk-Z47KIPCT.js} +7 -2
  7. package/dist/{chunk-6BMKLAZ7.js.map → chunk-Z47KIPCT.js.map} +1 -1
  8. package/dist/copy-button.d.ts +29 -0
  9. package/dist/copy-button.js +56 -0
  10. package/dist/copy-button.js.map +1 -0
  11. package/dist/date-picker.js +2 -1
  12. package/dist/date-picker.js.map +1 -1
  13. package/dist/desktop-window.js.map +1 -1
  14. package/dist/file-upload.d.ts +2 -2
  15. package/dist/filter-bar.d.ts +3 -3
  16. package/dist/flock.js +2 -1
  17. package/dist/flock.js.map +1 -1
  18. package/dist/index.js +3 -3
  19. package/dist/kind-config-editor.js +106 -129
  20. package/dist/kind-config-editor.js.map +1 -1
  21. package/dist/map.d.ts +2 -2
  22. package/dist/map.js +3 -3
  23. package/dist/map.js.map +1 -1
  24. package/dist/money-input.d.ts +29 -0
  25. package/dist/money-input.js +78 -0
  26. package/dist/money-input.js.map +1 -0
  27. package/dist/native/map.d.ts +2 -2
  28. package/dist/native/map.js +3 -3
  29. package/dist/native/map.js.map +1 -1
  30. package/dist/nav-bar.d.ts +28 -4
  31. package/dist/nav-bar.js +31 -14
  32. package/dist/nav-bar.js.map +1 -1
  33. package/dist/promo-code-field.d.ts +38 -0
  34. package/dist/promo-code-field.js +94 -0
  35. package/dist/promo-code-field.js.map +1 -0
  36. package/dist/radio-group.js +1 -1
  37. package/dist/retro-tv.d.ts +39 -4
  38. package/dist/retro-tv.js +217 -40
  39. package/dist/retro-tv.js.map +1 -1
  40. package/dist/status-chip.js +1 -1
  41. package/dist/terminal-replay.js +1 -1
  42. package/package.json +46 -3
  43. package/registry/account-menu.json +1 -1
  44. package/registry/account-settings.json +1 -1
  45. package/registry/achievement.json +1 -1
  46. package/registry/action-bar.json +1 -1
  47. package/registry/activity-feed.json +1 -1
  48. package/registry/agenda.json +1 -1
  49. package/registry/alert.json +1 -1
  50. package/registry/analysis-report.json +1 -1
  51. package/registry/anatomy-plate.json +1 -1
  52. package/registry/app-frame.json +34 -34
  53. package/registry/app-header.json +1 -1
  54. package/registry/app-shell.json +3 -3
  55. package/registry/argument-card.json +1 -1
  56. package/registry/audio-player.json +1 -1
  57. package/registry/auth-layout.json +1 -1
  58. package/registry/avatar.json +1 -1
  59. package/registry/badge.json +1 -1
  60. package/registry/bird-plate.json +1 -1
  61. package/registry/button.json +1 -1
  62. package/registry/captcha.json +1 -1
  63. package/registry/card-grid.json +1 -1
  64. package/registry/card.json +1 -1
  65. package/registry/catalogue-page.json +1 -1
  66. package/registry/changelog-page.json +1 -1
  67. package/registry/chapter.json +1 -1
  68. package/registry/chat.json +1 -1
  69. package/registry/checkbox.json +1 -1
  70. package/registry/chip-link.json +1 -1
  71. package/registry/chip-row.json +1 -1
  72. package/registry/chip.json +1 -1
  73. package/registry/choice-grid.json +1 -1
  74. package/registry/code-block.json +1 -1
  75. package/registry/collection-switcher.json +1 -1
  76. package/registry/combobox.json +1 -1
  77. package/registry/command.json +1 -1
  78. package/registry/comparison-table.json +1 -1
  79. package/registry/component-page.json +1 -1
  80. package/registry/confirm-button.json +1 -1
  81. package/registry/contact-page.json +1 -1
  82. package/registry/continue-prompt.json +1 -1
  83. package/registry/copy-button.json +382 -0
  84. package/registry/countdown.json +1 -1
  85. package/registry/cover-hero.json +1 -1
  86. package/registry/cta-panel.json +1 -1
  87. package/registry/dashboard-layout.json +1 -1
  88. package/registry/data-table.json +1 -1
  89. package/registry/date-picker.json +3 -3
  90. package/registry/decision-list.json +1 -1
  91. package/registry/description-list.json +1 -1
  92. package/registry/desktop-window.json +1 -1
  93. package/registry/detail-layout.json +1 -1
  94. package/registry/dialog.json +1 -1
  95. package/registry/docs-article-page.json +1 -1
  96. package/registry/docs-hub-page.json +1 -1
  97. package/registry/docs-layout.json +1 -1
  98. package/registry/docs-nav.json +1 -1
  99. package/registry/document-viewer.json +1 -1
  100. package/registry/doodle.json +1 -1
  101. package/registry/drop-overlay.json +1 -1
  102. package/registry/dropdown-menu.json +1 -1
  103. package/registry/elephant.json +2 -2
  104. package/registry/embed-facade.json +1 -1
  105. package/registry/empty-state.json +1 -1
  106. package/registry/engine-flow.json +1 -1
  107. package/registry/entity-header.json +1 -1
  108. package/registry/environment-notice.json +1 -1
  109. package/registry/error-page.json +1 -1
  110. package/registry/examples/copy-button/default.d.ts +4 -0
  111. package/registry/examples/copy-button/default.js +11 -0
  112. package/registry/examples/copy-button/default.tsx +7 -0
  113. package/registry/examples/copy-button/icon-only.d.ts +4 -0
  114. package/registry/examples/copy-button/icon-only.js +11 -0
  115. package/registry/examples/copy-button/icon-only.tsx +7 -0
  116. package/registry/examples/money-input/currencies.d.ts +4 -0
  117. package/registry/examples/money-input/currencies.js +18 -0
  118. package/registry/examples/money-input/currencies.tsx +16 -0
  119. package/registry/examples/money-input/default.d.ts +4 -0
  120. package/registry/examples/money-input/default.js +18 -0
  121. package/registry/examples/money-input/default.tsx +16 -0
  122. package/registry/examples/promo-code-field/applied.d.ts +4 -0
  123. package/registry/examples/promo-code-field/applied.js +11 -0
  124. package/registry/examples/promo-code-field/applied.tsx +7 -0
  125. package/registry/examples/promo-code-field/default.d.ts +4 -0
  126. package/registry/examples/promo-code-field/default.js +19 -0
  127. package/registry/examples/promo-code-field/default.tsx +14 -0
  128. package/registry/examples/promo-code-field/expired.d.ts +4 -0
  129. package/registry/examples/promo-code-field/expired.js +11 -0
  130. package/registry/examples/promo-code-field/expired.tsx +7 -0
  131. package/registry/examples/retro-tv/playlist-channel.d.ts +4 -0
  132. package/registry/examples/retro-tv/playlist-channel.js +15 -0
  133. package/registry/examples/retro-tv/playlist-channel.tsx +10 -0
  134. package/registry/examples/retro-tv/playlist-crossfade.d.ts +4 -0
  135. package/registry/examples/retro-tv/playlist-crossfade.js +15 -0
  136. package/registry/examples/retro-tv/playlist-crossfade.tsx +10 -0
  137. package/registry/examples/retro-tv/playlist-slide.d.ts +4 -0
  138. package/registry/examples/retro-tv/playlist-slide.js +15 -0
  139. package/registry/examples/retro-tv/playlist-slide.tsx +10 -0
  140. package/registry/field.json +1 -1
  141. package/registry/file-upload.json +1 -1
  142. package/registry/filter-bar.json +1 -1
  143. package/registry/flock.json +2 -2
  144. package/registry/footnote.json +1 -1
  145. package/registry/force-update-screen.json +1 -1
  146. package/registry/form.json +1 -1
  147. package/registry/gallery-page.json +1 -1
  148. package/registry/genui.json +1 -1
  149. package/registry/glossary-term.json +1 -1
  150. package/registry/glossary.json +1 -1
  151. package/registry/glow-card.json +1 -1
  152. package/registry/goal-gauge.json +1 -1
  153. package/registry/grade-stamp.json +1 -1
  154. package/registry/how-it-works-page.json +1 -1
  155. package/registry/image-cropper.json +1 -1
  156. package/registry/index.json +108 -9
  157. package/registry/iso.json +1 -1
  158. package/registry/kanban.json +1 -1
  159. package/registry/kbd.json +1 -1
  160. package/registry/kind-config-editor.json +1 -1
  161. package/registry/kpi-explained.json +1 -1
  162. package/registry/landing-page.json +1 -1
  163. package/registry/landscape.json +1 -1
  164. package/registry/language-switch.json +1 -1
  165. package/registry/legal-page.json +1 -1
  166. package/registry/link-card.json +1 -1
  167. package/registry/list.json +1 -1
  168. package/registry/loader.json +1 -1
  169. package/registry/longform-page.json +1 -1
  170. package/registry/maintenance-screen.json +1 -1
  171. package/registry/map.json +95 -95
  172. package/registry/margin-layout.json +1 -1
  173. package/registry/markdown.json +1 -1
  174. package/registry/marketing-layout.json +1 -1
  175. package/registry/marquee.json +1 -1
  176. package/registry/mascot-quote.json +1 -1
  177. package/registry/mascot-state.json +1 -1
  178. package/registry/mascots.json +1 -1
  179. package/registry/match-dialog.json +1 -1
  180. package/registry/media-capture.json +1 -1
  181. package/registry/media-gallery.json +1 -1
  182. package/registry/media-grid.json +1 -1
  183. package/registry/meta-row.json +1 -1
  184. package/registry/meter.json +1 -1
  185. package/registry/money-input.json +236 -0
  186. package/registry/nav-bar.json +55 -41
  187. package/registry/next-actions.json +1 -1
  188. package/registry/notification-preferences.json +1 -1
  189. package/registry/number-ticker.json +1 -1
  190. package/registry/opening-hours.json +1 -1
  191. package/registry/page-header.json +1 -1
  192. package/registry/page-hero.json +1 -1
  193. package/registry/page-index.json +1 -1
  194. package/registry/page.json +1 -1
  195. package/registry/pagination.json +1 -1
  196. package/registry/photo-grid.json +1 -1
  197. package/registry/pointer-light.json +1 -1
  198. package/registry/popover.json +1 -1
  199. package/registry/pricing-page.json +1 -1
  200. package/registry/product-page.json +1 -1
  201. package/registry/profile-card.json +1 -1
  202. package/registry/progress.json +1 -1
  203. package/registry/promise-card.json +1 -1
  204. package/registry/promo-code-field.json +258 -0
  205. package/registry/qr-code.json +1 -1
  206. package/registry/quota-meter.json +1 -1
  207. package/registry/radio-group.json +1 -1
  208. package/registry/rail-nav.json +34 -34
  209. package/registry/recipes.json +1 -1
  210. package/registry/retro-tv.json +120 -8
  211. package/registry/reviews.json +1 -1
  212. package/registry/router.json +1 -1
  213. package/registry/scroll-stage.json +1 -1
  214. package/registry/search-field.json +1 -1
  215. package/registry/section-backdrop.json +1 -1
  216. package/registry/separator.json +1 -1
  217. package/registry/service-card.json +1 -1
  218. package/registry/settings-layout.json +1 -1
  219. package/registry/shop-composer.json +1 -1
  220. package/registry/shop.json +2 -2
  221. package/registry/showcase.json +1 -1
  222. package/registry/signature.json +1 -1
  223. package/registry/site-cahier.json +1 -1
  224. package/registry/site-footer.json +34 -34
  225. package/registry/sites.json +1 -1
  226. package/registry/skeleton.json +1 -1
  227. package/registry/skip-link.json +1 -1
  228. package/registry/slider.json +1 -1
  229. package/registry/slot-picker.json +1 -1
  230. package/registry/slot.json +1 -1
  231. package/registry/specimen-tag.json +1 -1
  232. package/registry/speed-lines.json +1 -1
  233. package/registry/spinner.json +1 -1
  234. package/registry/split-view.json +1 -1
  235. package/registry/stage-banner.json +1 -1
  236. package/registry/stat.json +1 -1
  237. package/registry/status-chip.json +1 -1
  238. package/registry/status-page.json +1 -1
  239. package/registry/step-progress.json +1 -1
  240. package/registry/step-showcase.json +1 -1
  241. package/registry/stepper.json +1 -1
  242. package/registry/sticky-action.json +1 -1
  243. package/registry/stuck.json +1 -1
  244. package/registry/swipe-deck.json +1 -1
  245. package/registry/switch.json +1 -1
  246. package/registry/tabs.json +1 -1
  247. package/registry/tag-input.json +1 -1
  248. package/registry/tag-selector.json +1 -1
  249. package/registry/taped-photo.json +1 -1
  250. package/registry/terminal-replay.json +1 -1
  251. package/registry/text-style.json +1 -1
  252. package/registry/theme.json +1 -1
  253. package/registry/toast.json +1 -1
  254. package/registry/toc.json +1 -1
  255. package/registry/tooltip.json +1 -1
  256. package/registry/tree-view.json +1 -1
  257. package/registry/update-prompt.json +1 -1
  258. package/registry/upload-queue.json +1 -1
  259. package/registry/usage.json +1 -1
  260. package/registry/verified-badge.json +1 -1
  261. package/registry/versus-card.json +1 -1
  262. package/registry/vertical-video.json +1 -1
  263. package/registry/video-player.json +1 -1
  264. package/registry/video-trimmer.json +1 -1
  265. package/registry/virtual.json +1 -1
  266. package/registry/wall.json +1 -1
  267. package/registry/waveform.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/app-shell/shortcuts.ts","../src/desktop-window/commands.ts","../src/desktop-window/desktop-window.tsx","../src/desktop-window/panes.ts"],"sourcesContent":["// Keyboard shortcuts for an application: a combination (`mod+k`, `shift+/`, `alt+arrowup`) or a sequence (`g d`: press G,\n// then D). `mod` is ⌘ on Apple devices and Ctrl elsewhere. Plain keys and sequences stay out of text fields; a combination\n// with `mod` works in an input (not in a rich-text editor, where ⌘B is bold). Nothing is decided here about the words.\nimport * as React from \"react\";\n\nimport { useLatest } from \"../media\";\n\nexport type ShortcutMap = Readonly<Record<string, ((event: KeyboardEvent) => void) | undefined>>;\n\nconst isApple = () => typeof navigator !== \"undefined\" && /Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent);\n\nconst ALIASES: Record<string, string> = { esc: \"escape\", return: \"enter\", space: \" \", spacebar: \" \", up: \"arrowup\", down: \"arrowdown\", left: \"arrowleft\", right: \"arrowright\", del: \"delete\", plus: \"+\" };\ntype Modifier = \"mod\" | \"ctrl\" | \"alt\" | \"shift\" | \"meta\";\n\ntype Combo = { key: string; mod: boolean; ctrl: boolean; alt: boolean; shift: boolean; meta: boolean };\n\n/** `\"mod+shift+k\"` → its parts. A lone `+` key is written `plus`. */\nexport function parseCombo(combo: string): Combo {\n const parts = combo.toLowerCase().split(\"+\").filter(Boolean);\n const key = ALIASES[parts.at(-1) ?? \"\"] ?? parts.at(-1) ?? \"\";\n const has = (name: Modifier) => parts.slice(0, -1).includes(name);\n return { key, mod: has(\"mod\"), ctrl: has(\"ctrl\"), alt: has(\"alt\"), shift: has(\"shift\"), meta: has(\"meta\") };\n}\n\n/** Whether a key event is this combination: its modifiers exactly (`mod` is ⌘ or Ctrl by platform), then its key. */\nexport function matchesCombo(event: Pick<KeyboardEvent, \"key\" | \"metaKey\" | \"ctrlKey\" | \"altKey\" | \"shiftKey\">, combo: string, apple = isApple()): boolean {\n const want = parseCombo(combo);\n const meta = want.meta || (want.mod && apple);\n const ctrl = want.ctrl || (want.mod && !apple);\n if (event.metaKey !== meta || event.ctrlKey !== ctrl || event.altKey !== want.alt) return false;\n // Shift is only checked when the binding names it: `?` and `/` need it on most layouts.\n if (want.shift && !event.shiftKey) return false;\n return event.key.toLowerCase() === want.key;\n}\n\n/** The keys of a shortcut to show on a keycap: `[\"⌘\", \"K\"]` on a Mac, `[\"Ctrl\", \"K\"]` elsewhere; a sequence `g d` is `[\"G\", \"D\"]`. */\nexport function formatShortcut(shortcut: string, apple = isApple()): string[] {\n if (shortcut.includes(\" \")) return shortcut.split(/\\s+/).map((key) => key.toUpperCase());\n const parts = shortcut.split(\"+\").filter(Boolean);\n const key = parts.at(-1) ?? \"\";\n const names: Record<string, [string, string]> = { mod: [\"⌘\", \"Ctrl\"], meta: [\"⌘\", \"Win\"], ctrl: [\"⌃\", \"Ctrl\"], alt: [\"⌥\", \"Alt\"], shift: [\"⇧\", \"Shift\"] };\n const shown = parts.slice(0, -1).map((part) => names[part.toLowerCase()]?.[apple ? 0 : 1] ?? part);\n const glyph: Record<string, string> = { escape: \"Esc\", enter: \"↵\", arrowup: \"↑\", arrowdown: \"↓\", arrowleft: \"←\", arrowright: \"→\", \" \": \"Space\" };\n const last = glyph[ALIASES[key.toLowerCase()] ?? key.toLowerCase()] ?? key.toUpperCase();\n return [...shown, last];\n}\n\n/**\n * The accelerator of a combination for a desktop app's native menu bar (Tauri's `MenuItem`, Electron's — ADR-002):\n * `mod+k` → `CmdOrCtrl+K`, `shift+mod+/` → `Shift+CmdOrCtrl+/`. The menu and the shell then answer the same keys, and the\n * menu shows them. A sequence (`g d`) has none: a menu item takes one chord.\n */\nexport function acceleratorOf(shortcut: string): string | undefined {\n if (shortcut.trim().includes(\" \")) return undefined;\n const parts = shortcut.split(\"+\").filter(Boolean);\n const names: Record<string, string> = { mod: \"CmdOrCtrl\", meta: \"Super\", ctrl: \"Ctrl\", alt: \"Alt\", shift: \"Shift\" };\n const raw = (parts.at(-1) ?? \"\").toLowerCase();\n const key = ALIASES[raw] ?? raw;\n const keys: Record<string, string> = { escape: \"Escape\", enter: \"Enter\", \" \": \"Space\", arrowup: \"Up\", arrowdown: \"Down\", arrowleft: \"Left\", arrowright: \"Right\", delete: \"Delete\", backspace: \"Backspace\", tab: \"Tab\", \"+\": \"Plus\" };\n const last = keys[key] ?? (key.length === 1 ? key.toUpperCase() : key.charAt(0).toUpperCase() + key.slice(1));\n return [...parts.slice(0, -1).map((part) => names[part.toLowerCase()] ?? part), last].join(\"+\");\n}\n\nconst noop = () => () => undefined;\n\n/** Whether the person is on an Apple device — `false` on the server and in the first client render (no mismatch), then right. */\nexport function useApple(): boolean {\n return React.useSyncExternalStore(noop, isApple, () => false);\n}\n\n/** The `aria-keyshortcuts` of a combination (`Control+K`, `Meta+K` on a Mac); a sequence has none (it is not a chord). */\nexport function ariaKeyShortcuts(shortcut: string, apple = isApple()): string | undefined {\n if (shortcut.includes(\" \")) return undefined;\n const parts = shortcut.split(\"+\").filter(Boolean);\n const names: Record<string, string> = { mod: apple ? \"Meta\" : \"Control\", meta: \"Meta\", ctrl: \"Control\", alt: \"Alt\", shift: \"Shift\" };\n const key = parts.at(-1) ?? \"\";\n return [...parts.slice(0, -1).map((part) => names[part.toLowerCase()] ?? part), key.length === 1 ? key.toUpperCase() : key.charAt(0).toUpperCase() + key.slice(1)].join(\"+\");\n}\n\n/** Whether a key press happens in something you type in. */\nfunction isEditable(target: EventTarget | null): { field: boolean; rich: boolean } {\n const element = target instanceof HTMLElement ? target : null;\n if (!element) return { field: false, rich: false };\n const rich = element.isContentEditable;\n return { field: rich || /^(input|textarea|select)$/i.test(element.tagName), rich };\n}\n\n/**\n * Binds shortcuts for as long as the component lives (`enabled` turns them off). Each key is a combination or a sequence,\n * each value runs when it is pressed; the handler may change on every render. A shortcut that fires is `preventDefault`ed.\n * A sequence waits `timeout` ms for its next key.\n */\nexport function useShortcuts(map: ShortcutMap, { enabled = true, timeout = 900 }: { enabled?: boolean; timeout?: number } = {}) {\n const latest = useLatest(map);\n const names = Object.keys(map).sort().join(\"\\n\");\n React.useEffect(() => {\n if (!enabled) return;\n const bindings = names.split(\"\\n\").filter(Boolean);\n let buffer: { key: string; at: number }[] = [];\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.defaultPrevented || event.isComposing || event.repeat || !event.key) return;\n const editing = isEditable(event.target);\n const chord = event.metaKey || event.ctrlKey || event.altKey;\n const now = Date.now();\n buffer = [...buffer.filter((entry) => now - entry.at <= timeout), { key: event.key.toLowerCase(), at: now }].slice(-4);\n for (const binding of bindings) {\n const handler = latest.current[binding];\n if (!handler) continue;\n const keys = binding.toLowerCase().split(/\\s+/).map((key) => ALIASES[key] ?? key);\n const fired =\n keys.length > 1\n ? !chord && !editing.field && buffer.length >= keys.length && keys.every((key, i) => buffer[buffer.length - keys.length + i]?.key === key)\n : matchesCombo(event, binding) && (chord ? !editing.rich : !editing.field);\n if (!fired) continue;\n event.preventDefault();\n buffer = [];\n handler(event);\n return;\n }\n };\n document.addEventListener(\"keydown\", onKeyDown);\n return () => document.removeEventListener(\"keydown\", onKeyDown);\n }, [enabled, names, latest, timeout]);\n}\n","// Pure: the commands of a desktop window, written once and read by three things — the native menu bar (through\n// `setNativeMenu` of @krizaka/app-desktop), the in-page shortcuts (`useShortcuts`, also the browser's), and the palette.\nimport { acceleratorOf } from \"../app-shell/shortcuts\";\n\nexport interface DesktopCommand {\n /** Sent back by the menu when chosen: lowercase letters, digits, `.` and `-` (`view.sidebar`). */\n id: string;\n /** The menu item's words, passed translated (`Hide sidebar`). */\n label: string;\n /** The menu it belongs to (`View`, `File`), passed translated: the product's menus sit between Edit and Window. */\n menu: string;\n /** A chord (`mod+b`): the menu shows it and the page answers it. A sequence (`g d`) is the page's only. */\n shortcut?: string;\n /** Runs the command. */\n run: () => void;\n /** A separator before it in its menu. */\n separated?: boolean;\n /** Dimmed in the menu while false (default true). */\n enabled?: boolean;\n}\n\n/** The shape `setNativeMenu` takes for its `menus` (structurally the same as `MenuSpec[\"menus\"]` of @krizaka/app-desktop). */\nexport interface DesktopMenu {\n title: string;\n items: { id: string; label: string; accelerator?: string; enabled?: boolean; separated?: boolean }[];\n}\n\nconst ID = /^[a-z0-9][a-z0-9.-]*$/;\n\nexport interface DesktopMenus {\n /** For `setNativeMenu(bridge, { labels, menus }, handlers)`. */\n menus: DesktopMenu[];\n /** For its `handlers`: the id of the chosen item → what it does. */\n handlers: Record<string, () => void>;\n /** For `useShortcuts`: the chords of the commands, answered in the page. */\n shortcuts: Record<string, () => void>;\n}\n\n/** Refuses an id the native side would refuse, or one already declared. */\nfunction checkId(out: DesktopMenus, id: string): void {\n if (!ID.test(id)) throw new Error(`desktopMenus: \"${id}\" is not a menu id (lowercase letters, digits, \".\" and \"-\").`);\n if (out.handlers[id]) throw new Error(`desktopMenus: \"${id}\" is declared twice.`);\n}\n\n/** Records the chord of a command for the page, refusing one given to two commands. */\nfunction addShortcut(out: DesktopMenus, shortcut: string, run: () => void): void {\n const key = shortcut.toLowerCase();\n if (out.shortcuts[key]) throw new Error(`desktopMenus: \"${shortcut}\" is the shortcut of two commands.`);\n out.shortcuts[key] = run;\n}\n\n/** The menu item of a command: its accelerator, and only the flags it sets. */\nfunction itemOf(command: DesktopCommand): DesktopMenu[\"items\"][number] {\n const accelerator = command.shortcut ? acceleratorOf(command.shortcut) : undefined;\n return {\n id: command.id,\n label: command.label,\n ...(accelerator ? { accelerator } : {}),\n ...(command.enabled === false ? { enabled: false } : {}),\n ...(command.separated ? { separated: true } : {}),\n };\n}\n\n/** Turns the commands into the menu bar's menus, its handlers and the page's shortcuts — one source for the three. Throws on a bad or repeated id, or a shortcut given twice. */\nexport function desktopMenus(commands: readonly DesktopCommand[]): DesktopMenus {\n const out: DesktopMenus = { menus: [], handlers: {}, shortcuts: {} };\n for (const command of commands) {\n checkId(out, command.id);\n out.handlers[command.id] = command.run;\n if (command.shortcut) addShortcut(out, command.shortcut, command.run);\n let menu = out.menus.find((m) => m.title === command.menu);\n if (!menu) out.menus.push((menu = { title: command.menu, items: [] }));\n menu.items.push(itemOf(command));\n }\n return out;\n}\n","// Client (the panes' sizes, the pointer, the shortcuts). The window of a Mac app (Tauri 2 on the system WebView, ADR-002):\n// a sidebar, the content and an inspector in a three-pane split — resizable by pointer and keyboard, collapsible — under a\n// toolbar that moves the window and clears the traffic lights, at the desktop's density with a native-feeling focus ring.\n// The commands (`desktopMenus`) are written once for the native menu bar, the page's shortcuts and the palette.\nimport { type ShortcutMap, useShortcuts } from \"@krizaka/ui/app-shell\";\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { type DesktopCommand, type DesktopMenus, desktopMenus } from \"./commands\";\nimport { clamp, dragged, keyed, paneMax } from \"./panes\";\n\nexport const desktopWindow = tv({\n slots: {\n root:\n \"kz-desktop-window flex h-[var(--kz-window-height,100dvh)] min-w-0 select-none overflow-hidden bg-surface-0 text-[13px] text-fg \" +\n // The macOS focus ring: a 3 px halo of the accent, over a 1 px accent edge, only for the keyboard.\n \"[&_:focus-visible]:outline-hidden [&_:focus-visible]:ring-[3px]! [&_:focus-visible]:ring-ring/50! [&_:focus-visible]:ring-offset-0!\",\n pane: \"relative flex min-h-0 shrink-0 flex-col overflow-hidden data-[collapsed]:hidden\",\n sidebar: \"border-e border-border-subtle bg-surface-1\",\n titlebar: \"h-[var(--kz-titlebar-inset,1.75rem)] shrink-0\",\n scroll: \"min-h-0 flex-1 overflow-y-auto\",\n middle: \"flex min-h-0 min-w-0 flex-1 flex-col\",\n inspector: \"border-s border-border-subtle bg-surface-1\",\n separator:\n \"group/sep relative z-10 -mx-[3px] w-[6px] shrink-0 cursor-col-resize touch-none data-[collapsed]:hidden \" +\n \"after:absolute after:inset-y-0 after:left-[2px] after:w-px after:bg-transparent hover:after:bg-border-strong data-[active]:after:bg-accent focus-visible:after:bg-accent\",\n content: \"min-h-0 min-w-0 flex-1 overflow-y-auto select-text\",\n toolbar:\n \"flex h-[var(--kz-toolbar-height,3rem)] shrink-0 items-center gap-2 border-b border-border-subtle bg-surface-0 px-3 \" +\n // With the sidebar folded the traffic lights sit over the toolbar: its first control starts after them.\n \"[[data-sidebar=closed]_&]:ps-[var(--kz-traffic-lights-inset,4.75rem)]\",\n toolbarTitle: \"min-w-0 flex-1 truncate text-[13px] font-semibold\",\n toolbarGroup: \"flex shrink-0 items-center gap-1\",\n toggle:\n \"inline-flex h-7 w-7 items-center justify-center rounded-md text-fg-secondary transition-colors hover:bg-surface-2 hover:text-fg cursor-default aria-pressed:text-fg-accent\",\n },\n});\nconst s = desktopWindow();\n\nexport interface DesktopWindowLabels {\n /** The sidebar's accessible name (`Library`). */\n sidebar: string;\n /** The inspector's accessible name (`Details`). */\n inspector: string;\n /** The separators' names (`Resize the sidebar`, `Resize the inspector`). */\n resizeSidebar: string;\n resizeInspector: string;\n /** The toolbar buttons that fold the panes (`Show or hide the sidebar`). */\n toggleSidebar: string;\n toggleInspector: string;\n}\n\nexport interface DesktopWindowProps {\n /** The sidebar's content: a list of places, a `Tree`. It scrolls by itself. */\n sidebar: React.ReactNode;\n /** The main content under the toolbar. */\n children: React.ReactNode;\n /** The inspector's content: the selected item's details. Without it, a two-pane window. */\n inspector?: React.ReactNode;\n /** The toolbar's title, centred in the drag region. */\n title?: React.ReactNode;\n /** After the sidebar's toggle, at the start of the toolbar (back, forward). */\n toolbarStart?: React.ReactNode;\n /** Before the inspector's toggle, at the end of the toolbar (actions, search). */\n toolbarEnd?: React.ReactNode;\n /** The words of the panes, the dividers and the toggles — passed translated. */\n labels: DesktopWindowLabels;\n /** The sidebar is open (controlled). Pair with `onSidebarOpenChange`: the menu bar's command toggles it too. */\n sidebarOpen?: boolean;\n /** The sidebar starts open (default true) when uncontrolled. */\n defaultSidebarOpen?: boolean;\n /** Called when the sidebar folds or unfolds (the toolbar, a divider, the shortcut). */\n onSidebarOpenChange?: (open: boolean) => void;\n /** The inspector is open (controlled). */\n inspectorOpen?: boolean;\n /** The inspector starts open (default true) when uncontrolled. */\n defaultInspectorOpen?: boolean;\n /** Called when the inspector folds or unfolds. */\n onInspectorOpenChange?: (open: boolean) => void;\n /** The sizes in px: the sidebar's, the inspector's. Persist them with `onSizesChange`. */\n defaultSizes?: { sidebar?: number; inspector?: number };\n /** Called with the sizes in px after a drag or a key: persist them. */\n onSizesChange?: (sizes: { sidebar: number; inspector: number }) => void;\n /** The least the content keeps when the window is narrow (default 360). */\n contentMin?: number;\n /** The keys that fold the panes (a chord, or `false` for none): ⌘B and ⌘I by default. Pass `false` when the menu bar's commands (`useDesktopCommands`) own them. */\n shortcuts?: { sidebar?: string | false; inspector?: string | false };\n /** Classes for the window (`[--kz-window-height:34rem]` to size it inside a page). */\n className?: string;\n}\n\nconst SIDEBAR: { min: number; max: number } = { min: 180, max: 360 };\nconst INSPECTOR: { min: number; max: number } = { min: 240, max: 480 };\n\nconst glyph = (d: string) => (\n <svg viewBox=\"0 0 24 24\" className=\"h-4 w-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n <path d={d} />\n </svg>\n);\n\nfunction useOpen(controlled: boolean | undefined, initial: boolean, onChange?: (open: boolean) => void) {\n const [own, setOwn] = React.useState(initial);\n const open = controlled ?? own;\n const set = React.useCallback(\n (next: boolean) => {\n if (controlled === undefined) setOwn(next);\n onChange?.(next);\n },\n [controlled, onChange],\n );\n return [open, set] as const;\n}\n\ntype Edge = \"sidebar\" | \"inspector\";\n\n/** The window of a Mac app: sidebar · content · inspector, a toolbar that moves the window, the desktop's density. */\nexport function DesktopWindow({\n sidebar, children, inspector, title, toolbarStart, toolbarEnd, labels, sidebarOpen, defaultSidebarOpen = true, onSidebarOpenChange, inspectorOpen, defaultInspectorOpen = true, onInspectorOpenChange, defaultSizes, onSizesChange, contentMin = 360, shortcuts, className,\n}: DesktopWindowProps) {\n const [sideOpen, setSideOpen] = useOpen(sidebarOpen, defaultSidebarOpen, onSidebarOpenChange);\n const [inspOpen, setInspOpen] = useOpen(inspectorOpen, defaultInspectorOpen, onInspectorOpenChange);\n const [sizes, setSizes] = React.useState({ sidebar: clamp(defaultSizes?.sidebar ?? 240, SIDEBAR.min, SIDEBAR.max), inspector: clamp(defaultSizes?.inspector ?? 300, INSPECTOR.min, INSPECTOR.max) });\n const [active, setActive] = React.useState<Edge | null>(null);\n const root = React.useRef<HTMLDivElement>(null);\n const [width, setWidth] = React.useState(0);\n const toggles = React.useRef<Record<Edge, HTMLButtonElement | null>>({ sidebar: null, inspector: null });\n const sidebarId = React.useId();\n const inspectorId = React.useId();\n const hasInspector = inspector != null;\n const sideShown = sideOpen;\n const inspShown = hasInspector && inspOpen;\n\n const keys = { sidebar: shortcuts?.sidebar === undefined ? \"mod+b\" : shortcuts.sidebar, inspector: shortcuts?.inspector === undefined ? \"mod+i\" : shortcuts.inspector };\n const map: Record<string, () => void> = {};\n if (keys.sidebar) map[keys.sidebar] = () => setSideOpen(!sideOpen);\n if (keys.inspector && hasInspector) map[keys.inspector] = () => setInspOpen(!inspOpen);\n useShortcuts(map as ShortcutMap);\n\n const commit = (edge: Edge, size: number) => {\n const next = { ...sizes, [edge]: size };\n setSizes(next);\n onSizesChange?.(next);\n };\n // The window's width, to keep the content its room: measured, and followed while the window is resized.\n React.useLayoutEffect(() => {\n const element = root.current;\n if (!element) return;\n const measure = () => setWidth(element.getBoundingClientRect().width);\n measure();\n if (typeof ResizeObserver === \"undefined\") return;\n const observer = new ResizeObserver(measure);\n observer.observe(element);\n return () => observer.disconnect();\n }, []);\n const ceiling = (edge: Edge) => {\n const other = edge === \"sidebar\" ? (inspShown ? sizes.inspector : 0) : sideShown ? sizes.sidebar : 0;\n const limits = edge === \"sidebar\" ? SIDEBAR : INSPECTOR;\n // The separators overlap the panes (negative margins): they take no width of their own.\n return paneMax(limits, width || Number.POSITIVE_INFINITY, other, contentMin, 0);\n };\n const direction = (): 1 | -1 => (root.current && getComputedStyle(root.current).direction === \"rtl\" ? -1 : 1);\n const sideOf = (edge: Edge): 1 | -1 => (edge === \"sidebar\" ? 1 : -1);\n const limitsOf = (edge: Edge) => (edge === \"sidebar\" ? SIDEBAR : INSPECTOR);\n\n const onPointerDown = (edge: Edge) => (event: React.PointerEvent<HTMLDivElement>) => {\n if (event.button !== 0) return;\n event.currentTarget.setPointerCapture(event.pointerId);\n const startX = event.clientX;\n const start = sizes[edge];\n const max = ceiling(edge);\n const dir = direction();\n setActive(edge);\n const target = event.currentTarget;\n const move = (e: PointerEvent) => commit(edge, dragged(start, e.clientX - startX, dir, sideOf(edge), limitsOf(edge), max));\n const stop = () => {\n setActive(null);\n target.removeEventListener(\"pointermove\", move);\n target.removeEventListener(\"pointerup\", stop);\n target.removeEventListener(\"pointercancel\", stop);\n };\n target.addEventListener(\"pointermove\", move);\n target.addEventListener(\"pointerup\", stop);\n target.addEventListener(\"pointercancel\", stop);\n };\n const onKeyDown = (edge: Edge) => (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === \"Enter\") {\n event.preventDefault();\n (edge === \"sidebar\" ? setSideOpen : setInspOpen)(false);\n // The separator goes with the pane: the focus goes to the button that brings it back.\n queueMicrotask(() => toggles.current[edge]?.focus());\n return;\n }\n const next = keyed(event.key, sizes[edge], direction(), sideOf(edge), limitsOf(edge), event.shiftKey, ceiling(edge));\n if (next === null) return;\n event.preventDefault();\n commit(edge, next);\n };\n\n const separator = (edge: Edge, controls: string, label: string) => (\n <div\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-label={label}\n aria-controls={controls}\n aria-valuemin={limitsOf(edge).min}\n aria-valuemax={ceiling(edge)}\n aria-valuenow={sizes[edge]}\n tabIndex={0}\n data-edge={edge}\n data-active={active === edge ? \"\" : undefined}\n className={s.separator()}\n onPointerDown={onPointerDown(edge)}\n onKeyDown={onKeyDown(edge)}\n onDoubleClick={() => (edge === \"sidebar\" ? setSideOpen(false) : setInspOpen(false))}\n />\n );\n const toggle = (edge: Edge, label: string, pressed: boolean, onClick: () => void, d: string) => (\n <button type=\"button\" ref={(el) => { toggles.current[edge] = el; }} className={s.toggle()} aria-label={label} aria-pressed={pressed} onClick={onClick}>\n {glyph(d)}\n </button>\n );\n\n return (\n <div ref={root} data-desktop=\"\" data-sidebar={sideShown ? \"open\" : \"closed\"} className={s.root({ className })}>\n <aside id={sidebarId} aria-label={labels.sidebar} data-collapsed={sideShown ? undefined : \"\"} className={s.pane({ className: s.sidebar() })} style={{ width: sizes.sidebar }}>\n <div aria-hidden data-tauri-drag-region=\"\" className={s.titlebar()} />\n <div className={s.scroll()}>{sidebar}</div>\n </aside>\n {sideShown && separator(\"sidebar\", sidebarId, labels.resizeSidebar)}\n <div className={s.middle()}>\n <header data-tauri-drag-region=\"\" className={s.toolbar()}>\n <div className={s.toolbarGroup()}>\n {toggle(\"sidebar\", labels.toggleSidebar, sideShown, () => setSideOpen(!sideOpen), \"M4 5h16v14H4zM9 5v14\")}\n {toolbarStart}\n </div>\n <div data-tauri-drag-region=\"\" className={s.toolbarTitle()}>\n {title}\n </div>\n <div className={s.toolbarGroup()}>\n {toolbarEnd}\n {hasInspector && toggle(\"inspector\", labels.toggleInspector, inspShown, () => setInspOpen(!inspOpen), \"M4 5h16v14H4zM15 5v14\")}\n </div>\n </header>\n <main id=\"content\" tabIndex={-1} className={s.content()}>\n {children}\n </main>\n </div>\n {inspShown && separator(\"inspector\", inspectorId, labels.resizeInspector)}\n {hasInspector && (\n <aside id={inspectorId} aria-label={labels.inspector} data-collapsed={inspShown ? undefined : \"\"} className={s.pane({ className: s.inspector() })} style={{ width: sizes.inspector }}>\n <div className={s.scroll()}>{inspector}</div>\n </aside>\n )}\n </div>\n );\n}\n\n/**\n * The window's commands as one source: registers their chords in the page (`useShortcuts`, the browser's too) and returns\n * the native menu bar's data — `menus` and `handlers` for `setNativeMenu(bridge, { labels, menus }, handlers)` of\n * `@krizaka/app-desktop` — so the menu shows the keys the page answers.\n */\nexport function useDesktopCommands(commands: readonly DesktopCommand[]): DesktopMenus {\n const menus = React.useMemo(() => desktopMenus(commands), [commands]);\n useShortcuts(menus.shortcuts as ShortcutMap);\n return menus;\n}\n","// Pure: the arithmetic of the resizable panes, so it is tested without a pointer.\n\nexport interface PaneLimits {\n min: number;\n max: number;\n}\n\nexport const clamp = (value: number, min: number, max: number) => Math.min(Math.max(value, min), Math.max(min, max));\n\n/**\n * The most a pane may take: its own maximum, and what leaves the content its minimum beside the other open pane and the\n * two separators. A window that is too small for both gives the content priority, down to the pane's own minimum.\n */\nexport function paneMax(limits: PaneLimits, windowWidth: number, otherOpenWidth: number, contentMin: number, separators: number): number {\n return Math.max(limits.min, Math.min(limits.max, windowWidth - otherOpenWidth - contentMin - separators));\n}\n\n/** The size after a drag of `delta` px along the reading direction (`direction` 1 in LTR, -1 in RTL; `side` 1 for the start pane, -1 for the end one). */\nexport function dragged(start: number, delta: number, direction: 1 | -1, side: 1 | -1, limits: PaneLimits, ceiling = limits.max): number {\n return clamp(start + delta * direction * side, limits.min, ceiling);\n}\n\n/** The size after an arrow key: the arrow that points away from the pane's edge grows it (→ for the start pane in LTR). `null` for another key. */\nexport function keyed(key: string, current: number, direction: 1 | -1, side: 1 | -1, limits: PaneLimits, shift: boolean, ceiling = limits.max): number | null {\n const step = shift ? 64 : 16;\n if (key === \"Home\") return limits.min;\n if (key === \"End\") return Math.max(limits.min, ceiling);\n if (key !== \"ArrowLeft\" && key !== \"ArrowRight\") return null;\n const toward = key === \"ArrowRight\" ? 1 : -1;\n return clamp(current + step * toward * direction * side, limits.min, ceiling);\n}\n"],"mappings":";;;AAGA,YAAY,WAAW;AAQvB,IAAM,UAAkC,EAAE,KAAK,UAAU,QAAQ,SAAS,OAAO,KAAK,UAAU,KAAK,IAAI,WAAW,MAAM,aAAa,MAAM,aAAa,OAAO,cAAc,KAAK,UAAU,MAAM,IAAI;AAyCjM,SAAS,cAAc,UAAsC;AAClE,MAAI,SAAS,KAAK,EAAE,SAAS,GAAG,EAAG,QAAO;AAC1C,QAAM,QAAQ,SAAS,MAAM,GAAG,EAAE,OAAO,OAAO;AAChD,QAAM,QAAgC,EAAE,KAAK,aAAa,MAAM,SAAS,MAAM,QAAQ,KAAK,OAAO,OAAO,QAAQ;AAClH,QAAM,OAAO,MAAM,GAAG,EAAE,KAAK,IAAI,YAAY;AAC7C,QAAM,MAAM,QAAQ,GAAG,KAAK;AAC5B,QAAM,OAA+B,EAAE,QAAQ,UAAU,OAAO,SAAS,KAAK,SAAS,SAAS,MAAM,WAAW,QAAQ,WAAW,QAAQ,YAAY,SAAS,QAAQ,UAAU,WAAW,aAAa,KAAK,OAAO,KAAK,OAAO;AACnO,QAAM,OAAO,KAAK,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names":["React"]}
1
+ {"version":3,"sources":["../src/app-shell/shortcuts.ts","../src/desktop-window/commands.ts","../src/desktop-window/desktop-window.tsx","../src/desktop-window/panes.ts"],"sourcesContent":["// Keyboard shortcuts for an application: a combination (`mod+k`, `shift+/`, `alt+arrowup`) or a sequence (`g d`: press G,\n// then D). `mod` is ⌘ on Apple devices and Ctrl elsewhere. Plain keys and sequences stay out of text fields; a combination\n// with `mod` works in an input (not in a rich-text editor, where ⌘B is bold). Nothing is decided here about the words.\nimport * as React from \"react\";\n\nimport { useLatest } from \"../media\";\n\nexport type ShortcutMap = Readonly<Record<string, ((event: KeyboardEvent) => void) | undefined>>;\n\nconst isApple = () => typeof navigator !== \"undefined\" && /Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent);\n\nconst ALIASES: Record<string, string> = { esc: \"escape\", return: \"enter\", space: \" \", spacebar: \" \", up: \"arrowup\", down: \"arrowdown\", left: \"arrowleft\", right: \"arrowright\", del: \"delete\", plus: \"+\" };\ntype Modifier = \"mod\" | \"ctrl\" | \"alt\" | \"shift\" | \"meta\";\n\ntype Combo = { key: string; mod: boolean; ctrl: boolean; alt: boolean; shift: boolean; meta: boolean };\n\n/** `\"mod+shift+k\"` → its parts. A lone `+` key is written `plus`. */\nexport function parseCombo(combo: string): Combo {\n const parts = combo.toLowerCase().split(\"+\").filter(Boolean);\n const key = ALIASES[parts.at(-1) ?? \"\"] ?? parts.at(-1) ?? \"\";\n const has = (name: Modifier) => parts.slice(0, -1).includes(name);\n return { key, mod: has(\"mod\"), ctrl: has(\"ctrl\"), alt: has(\"alt\"), shift: has(\"shift\"), meta: has(\"meta\") };\n}\n\n/** Whether a key event is this combination: its modifiers exactly (`mod` is ⌘ or Ctrl by platform), then its key. */\nexport function matchesCombo(event: Pick<KeyboardEvent, \"key\" | \"metaKey\" | \"ctrlKey\" | \"altKey\" | \"shiftKey\">, combo: string, apple = isApple()): boolean {\n const want = parseCombo(combo);\n const meta = want.meta || (want.mod && apple);\n const ctrl = want.ctrl || (want.mod && !apple);\n if (event.metaKey !== meta || event.ctrlKey !== ctrl || event.altKey !== want.alt) return false;\n // Shift is only checked when the binding names it: `?` and `/` need it on most layouts.\n if (want.shift && !event.shiftKey) return false;\n return event.key.toLowerCase() === want.key;\n}\n\n/** The keys of a shortcut to show on a keycap: `[\"⌘\", \"K\"]` on a Mac, `[\"Ctrl\", \"K\"]` elsewhere; a sequence `g d` is `[\"G\", \"D\"]`. */\nexport function formatShortcut(shortcut: string, apple = isApple()): string[] {\n if (shortcut.includes(\" \")) return shortcut.split(/\\s+/).map((key) => key.toUpperCase());\n const parts = shortcut.split(\"+\").filter(Boolean);\n const key = parts.at(-1) ?? \"\";\n const names: Record<string, [string, string]> = { mod: [\"⌘\", \"Ctrl\"], meta: [\"⌘\", \"Win\"], ctrl: [\"⌃\", \"Ctrl\"], alt: [\"⌥\", \"Alt\"], shift: [\"⇧\", \"Shift\"] };\n const shown = parts.slice(0, -1).map((part) => names[part.toLowerCase()]?.[apple ? 0 : 1] ?? part);\n const glyph: Record<string, string> = { escape: \"Esc\", enter: \"↵\", arrowup: \"↑\", arrowdown: \"↓\", arrowleft: \"←\", arrowright: \"→\", \" \": \"Space\" };\n const last = glyph[ALIASES[key.toLowerCase()] ?? key.toLowerCase()] ?? key.toUpperCase();\n return [...shown, last];\n}\n\n/**\n * The accelerator of a combination for a desktop app's native menu bar (Tauri's `MenuItem`, Electron's — ADR-002):\n * `mod+k` → `CmdOrCtrl+K`, `shift+mod+/` → `Shift+CmdOrCtrl+/`. The menu and the shell then answer the same keys, and the\n * menu shows them. A sequence (`g d`) has none: a menu item takes one chord.\n */\nexport function acceleratorOf(shortcut: string): string | undefined {\n if (shortcut.trim().includes(\" \")) return undefined;\n const parts = shortcut.split(\"+\").filter(Boolean);\n const names: Record<string, string> = { mod: \"CmdOrCtrl\", meta: \"Super\", ctrl: \"Ctrl\", alt: \"Alt\", shift: \"Shift\" };\n const raw = (parts.at(-1) ?? \"\").toLowerCase();\n const key = ALIASES[raw] ?? raw;\n const keys: Record<string, string> = { escape: \"Escape\", enter: \"Enter\", \" \": \"Space\", arrowup: \"Up\", arrowdown: \"Down\", arrowleft: \"Left\", arrowright: \"Right\", delete: \"Delete\", backspace: \"Backspace\", tab: \"Tab\", \"+\": \"Plus\" };\n const last = keys[key] ?? (key.length === 1 ? key.toUpperCase() : key.charAt(0).toUpperCase() + key.slice(1));\n return [...parts.slice(0, -1).map((part) => names[part.toLowerCase()] ?? part), last].join(\"+\");\n}\n\nconst noop = () => () => undefined;\n\n/** Whether the person is on an Apple device — `false` on the server and in the first client render (no mismatch), then right. */\nexport function useApple(): boolean {\n return React.useSyncExternalStore(noop, isApple, () => false);\n}\n\n/** The `aria-keyshortcuts` of a combination (`Control+K`, `Meta+K` on a Mac); a sequence has none (it is not a chord). */\nexport function ariaKeyShortcuts(shortcut: string, apple = isApple()): string | undefined {\n if (shortcut.includes(\" \")) return undefined;\n const parts = shortcut.split(\"+\").filter(Boolean);\n const names: Record<string, string> = { mod: apple ? \"Meta\" : \"Control\", meta: \"Meta\", ctrl: \"Control\", alt: \"Alt\", shift: \"Shift\" };\n const key = parts.at(-1) ?? \"\";\n return [...parts.slice(0, -1).map((part) => names[part.toLowerCase()] ?? part), key.length === 1 ? key.toUpperCase() : key.charAt(0).toUpperCase() + key.slice(1)].join(\"+\");\n}\n\n/** Whether a key press happens in something you type in. */\nfunction isEditable(target: EventTarget | null): { field: boolean; rich: boolean } {\n const element = target instanceof HTMLElement ? target : null;\n if (!element) return { field: false, rich: false };\n const rich = element.isContentEditable;\n return { field: rich || /^(input|textarea|select)$/i.test(element.tagName), rich };\n}\n\n/**\n * Binds shortcuts for as long as the component lives (`enabled` turns them off). Each key is a combination or a sequence,\n * each value runs when it is pressed; the handler may change on every render. A shortcut that fires is `preventDefault`ed.\n * A sequence waits `timeout` ms for its next key.\n */\nexport function useShortcuts(map: ShortcutMap, { enabled = true, timeout = 900 }: { enabled?: boolean; timeout?: number } = {}) {\n const latest = useLatest(map);\n const names = Object.keys(map).sort((a, b) => a.localeCompare(b)).join(\"\\n\");\n React.useEffect(() => {\n if (!enabled) return;\n const bindings = names.split(\"\\n\").filter(Boolean);\n let buffer: { key: string; at: number }[] = [];\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.defaultPrevented || event.isComposing || event.repeat || !event.key) return;\n const editing = isEditable(event.target);\n const chord = event.metaKey || event.ctrlKey || event.altKey;\n const now = Date.now();\n buffer = [...buffer.filter((entry) => now - entry.at <= timeout), { key: event.key.toLowerCase(), at: now }].slice(-4);\n for (const binding of bindings) {\n const handler = latest.current[binding];\n if (!handler) continue;\n const keys = binding.toLowerCase().split(/\\s+/).map((key) => ALIASES[key] ?? key);\n const fired =\n keys.length > 1\n ? !chord && !editing.field && buffer.length >= keys.length && keys.every((key, i) => buffer[buffer.length - keys.length + i]?.key === key)\n : matchesCombo(event, binding) && (chord ? !editing.rich : !editing.field);\n if (!fired) continue;\n event.preventDefault();\n buffer = [];\n handler(event);\n return;\n }\n };\n document.addEventListener(\"keydown\", onKeyDown);\n return () => document.removeEventListener(\"keydown\", onKeyDown);\n }, [enabled, names, latest, timeout]);\n}\n","// Pure: the commands of a desktop window, written once and read by three things — the native menu bar (through\n// `setNativeMenu` of @krizaka/app-desktop), the in-page shortcuts (`useShortcuts`, also the browser's), and the palette.\nimport { acceleratorOf } from \"../app-shell/shortcuts\";\n\nexport interface DesktopCommand {\n /** Sent back by the menu when chosen: lowercase letters, digits, `.` and `-` (`view.sidebar`). */\n id: string;\n /** The menu item's words, passed translated (`Hide sidebar`). */\n label: string;\n /** The menu it belongs to (`View`, `File`), passed translated: the product's menus sit between Edit and Window. */\n menu: string;\n /** A chord (`mod+b`): the menu shows it and the page answers it. A sequence (`g d`) is the page's only. */\n shortcut?: string;\n /** Runs the command. */\n run: () => void;\n /** A separator before it in its menu. */\n separated?: boolean;\n /** Dimmed in the menu while false (default true). */\n enabled?: boolean;\n}\n\n/** The shape `setNativeMenu` takes for its `menus` (structurally the same as `MenuSpec[\"menus\"]` of @krizaka/app-desktop). */\nexport interface DesktopMenu {\n title: string;\n items: { id: string; label: string; accelerator?: string; enabled?: boolean; separated?: boolean }[];\n}\n\nconst ID = /^[a-z0-9][a-z0-9.-]*$/;\n\nexport interface DesktopMenus {\n /** For `setNativeMenu(bridge, { labels, menus }, handlers)`. */\n menus: DesktopMenu[];\n /** For its `handlers`: the id of the chosen item → what it does. */\n handlers: Record<string, () => void>;\n /** For `useShortcuts`: the chords of the commands, answered in the page. */\n shortcuts: Record<string, () => void>;\n}\n\n/** Refuses an id the native side would refuse, or one already declared. */\nfunction checkId(out: DesktopMenus, id: string): void {\n if (!ID.test(id)) throw new Error(`desktopMenus: \"${id}\" is not a menu id (lowercase letters, digits, \".\" and \"-\").`);\n if (out.handlers[id]) throw new Error(`desktopMenus: \"${id}\" is declared twice.`);\n}\n\n/** Records the chord of a command for the page, refusing one given to two commands. */\nfunction addShortcut(out: DesktopMenus, shortcut: string, run: () => void): void {\n const key = shortcut.toLowerCase();\n if (out.shortcuts[key]) throw new Error(`desktopMenus: \"${shortcut}\" is the shortcut of two commands.`);\n out.shortcuts[key] = run;\n}\n\n/** The menu item of a command: its accelerator, and only the flags it sets. */\nfunction itemOf(command: DesktopCommand): DesktopMenu[\"items\"][number] {\n const accelerator = command.shortcut ? acceleratorOf(command.shortcut) : undefined;\n return {\n id: command.id,\n label: command.label,\n ...(accelerator ? { accelerator } : {}),\n ...(command.enabled === false ? { enabled: false } : {}),\n ...(command.separated ? { separated: true } : {}),\n };\n}\n\n/** Turns the commands into the menu bar's menus, its handlers and the page's shortcuts — one source for the three. Throws on a bad or repeated id, or a shortcut given twice. */\nexport function desktopMenus(commands: readonly DesktopCommand[]): DesktopMenus {\n const out: DesktopMenus = { menus: [], handlers: {}, shortcuts: {} };\n for (const command of commands) {\n checkId(out, command.id);\n out.handlers[command.id] = command.run;\n if (command.shortcut) addShortcut(out, command.shortcut, command.run);\n let menu = out.menus.find((m) => m.title === command.menu);\n if (!menu) out.menus.push((menu = { title: command.menu, items: [] }));\n menu.items.push(itemOf(command));\n }\n return out;\n}\n","// Client (the panes' sizes, the pointer, the shortcuts). The window of a Mac app (Tauri 2 on the system WebView, ADR-002):\n// a sidebar, the content and an inspector in a three-pane split — resizable by pointer and keyboard, collapsible — under a\n// toolbar that moves the window and clears the traffic lights, at the desktop's density with a native-feeling focus ring.\n// The commands (`desktopMenus`) are written once for the native menu bar, the page's shortcuts and the palette.\nimport { type ShortcutMap, useShortcuts } from \"@krizaka/ui/app-shell\";\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { type DesktopCommand, type DesktopMenus, desktopMenus } from \"./commands\";\nimport { clamp, dragged, keyed, paneMax } from \"./panes\";\n\nexport const desktopWindow = tv({\n slots: {\n root:\n \"kz-desktop-window flex h-[var(--kz-window-height,100dvh)] min-w-0 select-none overflow-hidden bg-surface-0 text-[13px] text-fg \" +\n // The macOS focus ring: a 3 px halo of the accent, over a 1 px accent edge, only for the keyboard.\n \"[&_:focus-visible]:outline-hidden [&_:focus-visible]:ring-[3px]! [&_:focus-visible]:ring-ring/50! [&_:focus-visible]:ring-offset-0!\",\n pane: \"relative flex min-h-0 shrink-0 flex-col overflow-hidden data-[collapsed]:hidden\",\n sidebar: \"border-e border-border-subtle bg-surface-1\",\n titlebar: \"h-[var(--kz-titlebar-inset,1.75rem)] shrink-0\",\n scroll: \"min-h-0 flex-1 overflow-y-auto\",\n middle: \"flex min-h-0 min-w-0 flex-1 flex-col\",\n inspector: \"border-s border-border-subtle bg-surface-1\",\n separator:\n \"group/sep relative z-10 -mx-[3px] w-[6px] shrink-0 cursor-col-resize touch-none data-[collapsed]:hidden \" +\n \"after:absolute after:inset-y-0 after:left-[2px] after:w-px after:bg-transparent hover:after:bg-border-strong data-[active]:after:bg-accent focus-visible:after:bg-accent\",\n content: \"min-h-0 min-w-0 flex-1 overflow-y-auto select-text\",\n toolbar:\n \"flex h-[var(--kz-toolbar-height,3rem)] shrink-0 items-center gap-2 border-b border-border-subtle bg-surface-0 px-3 \" +\n // With the sidebar folded the traffic lights sit over the toolbar: its first control starts after them.\n \"[[data-sidebar=closed]_&]:ps-[var(--kz-traffic-lights-inset,4.75rem)]\",\n toolbarTitle: \"min-w-0 flex-1 truncate text-[13px] font-semibold\",\n toolbarGroup: \"flex shrink-0 items-center gap-1\",\n toggle:\n \"inline-flex h-7 w-7 items-center justify-center rounded-md text-fg-secondary transition-colors hover:bg-surface-2 hover:text-fg cursor-default aria-pressed:text-fg-accent\",\n },\n});\nconst s = desktopWindow();\n\nexport interface DesktopWindowLabels {\n /** The sidebar's accessible name (`Library`). */\n sidebar: string;\n /** The inspector's accessible name (`Details`). */\n inspector: string;\n /** The separators' names (`Resize the sidebar`, `Resize the inspector`). */\n resizeSidebar: string;\n resizeInspector: string;\n /** The toolbar buttons that fold the panes (`Show or hide the sidebar`). */\n toggleSidebar: string;\n toggleInspector: string;\n}\n\nexport interface DesktopWindowProps {\n /** The sidebar's content: a list of places, a `Tree`. It scrolls by itself. */\n sidebar: React.ReactNode;\n /** The main content under the toolbar. */\n children: React.ReactNode;\n /** The inspector's content: the selected item's details. Without it, a two-pane window. */\n inspector?: React.ReactNode;\n /** The toolbar's title, centred in the drag region. */\n title?: React.ReactNode;\n /** After the sidebar's toggle, at the start of the toolbar (back, forward). */\n toolbarStart?: React.ReactNode;\n /** Before the inspector's toggle, at the end of the toolbar (actions, search). */\n toolbarEnd?: React.ReactNode;\n /** The words of the panes, the dividers and the toggles — passed translated. */\n labels: DesktopWindowLabels;\n /** The sidebar is open (controlled). Pair with `onSidebarOpenChange`: the menu bar's command toggles it too. */\n sidebarOpen?: boolean;\n /** The sidebar starts open (default true) when uncontrolled. */\n defaultSidebarOpen?: boolean;\n /** Called when the sidebar folds or unfolds (the toolbar, a divider, the shortcut). */\n onSidebarOpenChange?: (open: boolean) => void;\n /** The inspector is open (controlled). */\n inspectorOpen?: boolean;\n /** The inspector starts open (default true) when uncontrolled. */\n defaultInspectorOpen?: boolean;\n /** Called when the inspector folds or unfolds. */\n onInspectorOpenChange?: (open: boolean) => void;\n /** The sizes in px: the sidebar's, the inspector's. Persist them with `onSizesChange`. */\n defaultSizes?: { sidebar?: number; inspector?: number };\n /** Called with the sizes in px after a drag or a key: persist them. */\n onSizesChange?: (sizes: { sidebar: number; inspector: number }) => void;\n /** The least the content keeps when the window is narrow (default 360). */\n contentMin?: number;\n /** The keys that fold the panes (a chord, or `false` for none): ⌘B and ⌘I by default. Pass `false` when the menu bar's commands (`useDesktopCommands`) own them. */\n shortcuts?: { sidebar?: string | false; inspector?: string | false };\n /** Classes for the window (`[--kz-window-height:34rem]` to size it inside a page). */\n className?: string;\n}\n\nconst SIDEBAR: { min: number; max: number } = { min: 180, max: 360 };\nconst INSPECTOR: { min: number; max: number } = { min: 240, max: 480 };\n\nconst glyph = (d: string) => (\n <svg viewBox=\"0 0 24 24\" className=\"h-4 w-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n <path d={d} />\n </svg>\n);\n\nfunction useOpen(controlled: boolean | undefined, initial: boolean, onChange?: (open: boolean) => void) {\n const [own, setOwn] = React.useState(initial);\n const open = controlled ?? own;\n const set = React.useCallback(\n (next: boolean) => {\n if (controlled === undefined) setOwn(next);\n onChange?.(next);\n },\n [controlled, onChange],\n );\n return [open, set] as const;\n}\n\ntype Edge = \"sidebar\" | \"inspector\";\n\n/** The window of a Mac app: sidebar · content · inspector, a toolbar that moves the window, the desktop's density. */\nexport function DesktopWindow({\n sidebar, children, inspector, title, toolbarStart, toolbarEnd, labels, sidebarOpen, defaultSidebarOpen = true, onSidebarOpenChange, inspectorOpen, defaultInspectorOpen = true, onInspectorOpenChange, defaultSizes, onSizesChange, contentMin = 360, shortcuts, className,\n}: DesktopWindowProps) {\n const [sideOpen, setSideOpen] = useOpen(sidebarOpen, defaultSidebarOpen, onSidebarOpenChange);\n const [inspOpen, setInspOpen] = useOpen(inspectorOpen, defaultInspectorOpen, onInspectorOpenChange);\n const [sizes, setSizes] = React.useState({ sidebar: clamp(defaultSizes?.sidebar ?? 240, SIDEBAR.min, SIDEBAR.max), inspector: clamp(defaultSizes?.inspector ?? 300, INSPECTOR.min, INSPECTOR.max) });\n const [active, setActive] = React.useState<Edge | null>(null);\n const root = React.useRef<HTMLDivElement>(null);\n const [width, setWidth] = React.useState(0);\n const toggles = React.useRef<Record<Edge, HTMLButtonElement | null>>({ sidebar: null, inspector: null });\n const sidebarId = React.useId();\n const inspectorId = React.useId();\n const hasInspector = inspector != null;\n const sideShown = sideOpen;\n const inspShown = hasInspector && inspOpen;\n\n const keys = { sidebar: shortcuts?.sidebar === undefined ? \"mod+b\" : shortcuts.sidebar, inspector: shortcuts?.inspector === undefined ? \"mod+i\" : shortcuts.inspector };\n const map: Record<string, () => void> = {};\n if (keys.sidebar) map[keys.sidebar] = () => setSideOpen(!sideOpen);\n if (keys.inspector && hasInspector) map[keys.inspector] = () => setInspOpen(!inspOpen);\n useShortcuts(map as ShortcutMap);\n\n const commit = (edge: Edge, size: number) => {\n const next = { ...sizes, [edge]: size };\n setSizes(next);\n onSizesChange?.(next);\n };\n // The window's width, to keep the content its room: measured, and followed while the window is resized.\n React.useLayoutEffect(() => {\n const element = root.current;\n if (!element) return;\n const measure = () => setWidth(element.getBoundingClientRect().width);\n measure();\n if (typeof ResizeObserver === \"undefined\") return;\n const observer = new ResizeObserver(measure);\n observer.observe(element);\n return () => observer.disconnect();\n }, []);\n const ceiling = (edge: Edge) => {\n const other = edge === \"sidebar\" ? (inspShown ? sizes.inspector : 0) : sideShown ? sizes.sidebar : 0;\n const limits = edge === \"sidebar\" ? SIDEBAR : INSPECTOR;\n // The separators overlap the panes (negative margins): they take no width of their own.\n return paneMax(limits, width || Number.POSITIVE_INFINITY, other, contentMin, 0);\n };\n const direction = (): 1 | -1 => (root.current && getComputedStyle(root.current).direction === \"rtl\" ? -1 : 1);\n const sideOf = (edge: Edge): 1 | -1 => (edge === \"sidebar\" ? 1 : -1);\n const limitsOf = (edge: Edge) => (edge === \"sidebar\" ? SIDEBAR : INSPECTOR);\n\n const onPointerDown = (edge: Edge) => (event: React.PointerEvent<HTMLDivElement>) => {\n if (event.button !== 0) return;\n event.currentTarget.setPointerCapture(event.pointerId);\n const startX = event.clientX;\n const start = sizes[edge];\n const max = ceiling(edge);\n const dir = direction();\n setActive(edge);\n const target = event.currentTarget;\n const move = (e: PointerEvent) => commit(edge, dragged(start, e.clientX - startX, dir, sideOf(edge), limitsOf(edge), max));\n const stop = () => {\n setActive(null);\n target.removeEventListener(\"pointermove\", move);\n target.removeEventListener(\"pointerup\", stop);\n target.removeEventListener(\"pointercancel\", stop);\n };\n target.addEventListener(\"pointermove\", move);\n target.addEventListener(\"pointerup\", stop);\n target.addEventListener(\"pointercancel\", stop);\n };\n const onKeyDown = (edge: Edge) => (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === \"Enter\") {\n event.preventDefault();\n (edge === \"sidebar\" ? setSideOpen : setInspOpen)(false);\n // The separator goes with the pane: the focus goes to the button that brings it back.\n queueMicrotask(() => toggles.current[edge]?.focus());\n return;\n }\n const next = keyed(event.key, sizes[edge], direction(), sideOf(edge), limitsOf(edge), event.shiftKey, ceiling(edge));\n if (next === null) return;\n event.preventDefault();\n commit(edge, next);\n };\n\n const separator = (edge: Edge, controls: string, label: string) => (\n <div\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-label={label}\n aria-controls={controls}\n aria-valuemin={limitsOf(edge).min}\n aria-valuemax={ceiling(edge)}\n aria-valuenow={sizes[edge]}\n tabIndex={0}\n data-edge={edge}\n data-active={active === edge ? \"\" : undefined}\n className={s.separator()}\n onPointerDown={onPointerDown(edge)}\n onKeyDown={onKeyDown(edge)}\n onDoubleClick={() => (edge === \"sidebar\" ? setSideOpen(false) : setInspOpen(false))}\n />\n );\n const toggle = (edge: Edge, label: string, pressed: boolean, onClick: () => void, d: string) => (\n <button type=\"button\" ref={(el) => { toggles.current[edge] = el; }} className={s.toggle()} aria-label={label} aria-pressed={pressed} onClick={onClick}>\n {glyph(d)}\n </button>\n );\n\n return (\n <div ref={root} data-desktop=\"\" data-sidebar={sideShown ? \"open\" : \"closed\"} className={s.root({ className })}>\n <aside id={sidebarId} aria-label={labels.sidebar} data-collapsed={sideShown ? undefined : \"\"} className={s.pane({ className: s.sidebar() })} style={{ width: sizes.sidebar }}>\n <div aria-hidden data-tauri-drag-region=\"\" className={s.titlebar()} />\n <div className={s.scroll()}>{sidebar}</div>\n </aside>\n {sideShown && separator(\"sidebar\", sidebarId, labels.resizeSidebar)}\n <div className={s.middle()}>\n <header data-tauri-drag-region=\"\" className={s.toolbar()}>\n <div className={s.toolbarGroup()}>\n {toggle(\"sidebar\", labels.toggleSidebar, sideShown, () => setSideOpen(!sideOpen), \"M4 5h16v14H4zM9 5v14\")}\n {toolbarStart}\n </div>\n <div data-tauri-drag-region=\"\" className={s.toolbarTitle()}>\n {title}\n </div>\n <div className={s.toolbarGroup()}>\n {toolbarEnd}\n {hasInspector && toggle(\"inspector\", labels.toggleInspector, inspShown, () => setInspOpen(!inspOpen), \"M4 5h16v14H4zM15 5v14\")}\n </div>\n </header>\n <main id=\"content\" tabIndex={-1} className={s.content()}>\n {children}\n </main>\n </div>\n {inspShown && separator(\"inspector\", inspectorId, labels.resizeInspector)}\n {hasInspector && (\n <aside id={inspectorId} aria-label={labels.inspector} data-collapsed={inspShown ? undefined : \"\"} className={s.pane({ className: s.inspector() })} style={{ width: sizes.inspector }}>\n <div className={s.scroll()}>{inspector}</div>\n </aside>\n )}\n </div>\n );\n}\n\n/**\n * The window's commands as one source: registers their chords in the page (`useShortcuts`, the browser's too) and returns\n * the native menu bar's data — `menus` and `handlers` for `setNativeMenu(bridge, { labels, menus }, handlers)` of\n * `@krizaka/app-desktop` — so the menu shows the keys the page answers.\n */\nexport function useDesktopCommands(commands: readonly DesktopCommand[]): DesktopMenus {\n const menus = React.useMemo(() => desktopMenus(commands), [commands]);\n useShortcuts(menus.shortcuts as ShortcutMap);\n return menus;\n}\n","// Pure: the arithmetic of the resizable panes, so it is tested without a pointer.\n\nexport interface PaneLimits {\n min: number;\n max: number;\n}\n\nexport const clamp = (value: number, min: number, max: number) => Math.min(Math.max(value, min), Math.max(min, max));\n\n/**\n * The most a pane may take: its own maximum, and what leaves the content its minimum beside the other open pane and the\n * two separators. A window that is too small for both gives the content priority, down to the pane's own minimum.\n */\nexport function paneMax(limits: PaneLimits, windowWidth: number, otherOpenWidth: number, contentMin: number, separators: number): number {\n return Math.max(limits.min, Math.min(limits.max, windowWidth - otherOpenWidth - contentMin - separators));\n}\n\n/** The size after a drag of `delta` px along the reading direction (`direction` 1 in LTR, -1 in RTL; `side` 1 for the start pane, -1 for the end one). */\nexport function dragged(start: number, delta: number, direction: 1 | -1, side: 1 | -1, limits: PaneLimits, ceiling = limits.max): number {\n return clamp(start + delta * direction * side, limits.min, ceiling);\n}\n\n/** The size after an arrow key: the arrow that points away from the pane's edge grows it (→ for the start pane in LTR). `null` for another key. */\nexport function keyed(key: string, current: number, direction: 1 | -1, side: 1 | -1, limits: PaneLimits, shift: boolean, ceiling = limits.max): number | null {\n const step = shift ? 64 : 16;\n if (key === \"Home\") return limits.min;\n if (key === \"End\") return Math.max(limits.min, ceiling);\n if (key !== \"ArrowLeft\" && key !== \"ArrowRight\") return null;\n const toward = key === \"ArrowRight\" ? 1 : -1;\n return clamp(current + step * toward * direction * side, limits.min, ceiling);\n}\n"],"mappings":";;;AAGA,YAAY,WAAW;AAQvB,IAAM,UAAkC,EAAE,KAAK,UAAU,QAAQ,SAAS,OAAO,KAAK,UAAU,KAAK,IAAI,WAAW,MAAM,aAAa,MAAM,aAAa,OAAO,cAAc,KAAK,UAAU,MAAM,IAAI;AAyCjM,SAAS,cAAc,UAAsC;AAClE,MAAI,SAAS,KAAK,EAAE,SAAS,GAAG,EAAG,QAAO;AAC1C,QAAM,QAAQ,SAAS,MAAM,GAAG,EAAE,OAA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AAC,WAAM,IAAI,aAAa,cAAY,OAAO,WAAW,kBAAgB,YAAY,SAAY,IAAI,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC,GAAG,OAAO,EAAE,OAAO,MAAM,UAAU,GACjL,8BAAC,SAAI,WAAW,EAAE,OAAO,GAAI,qBAAU,GACzC;AAAA,KAEJ;AAEJ;AAOO,SAAS,mBAAmB,UAAmD;AACpF,QAAM,QAAc,eAAQ,MAAM,aAAa,QAAQ,GAAG,CAAC,QAAQ,CAAC;AACpE,eAAa,MAAM,SAAwB;AAC3C,SAAO;AACT;","names":["React"]}
@@ -242,8 +242,8 @@ declare function useUploadQueue(options: UploadQueueOptions): {
242
242
  items: UploadItem[];
243
243
  add: (files: readonly File[]) => void;
244
244
  pause: (id: string) => void;
245
- resume: any;
246
- retry: any;
245
+ resume: (id: string) => void;
246
+ retry: (id: string) => void;
247
247
  cancel: (id: string) => void;
248
248
  remove: (id: string) => void;
249
249
  };
@@ -75,11 +75,11 @@ declare const filterBar: tailwind_variants.TVReturnType<{
75
75
  [key: string]: {
76
76
  [key: string]: tailwind_variants.ClassValue | {
77
77
  root?: tailwind_variants.ClassValue;
78
+ count?: tailwind_variants.ClassValue;
78
79
  controls?: tailwind_variants.ClassValue;
79
80
  active?: tailwind_variants.ClassValue;
80
81
  clear?: tailwind_variants.ClassValue;
81
82
  results?: tailwind_variants.ClassValue;
82
- count?: tailwind_variants.ClassValue;
83
83
  optionCount?: tailwind_variants.ClassValue;
84
84
  trigger?: tailwind_variants.ClassValue;
85
85
  };
@@ -88,11 +88,11 @@ declare const filterBar: tailwind_variants.TVReturnType<{
88
88
  [x: string]: {
89
89
  [x: string]: tailwind_variants.ClassValue | {
90
90
  root?: tailwind_variants.ClassValue;
91
+ count?: tailwind_variants.ClassValue;
91
92
  controls?: tailwind_variants.ClassValue;
92
93
  active?: tailwind_variants.ClassValue;
93
94
  clear?: tailwind_variants.ClassValue;
94
95
  results?: tailwind_variants.ClassValue;
95
- count?: tailwind_variants.ClassValue;
96
96
  optionCount?: tailwind_variants.ClassValue;
97
97
  trigger?: tailwind_variants.ClassValue;
98
98
  };
@@ -110,11 +110,11 @@ declare const filterBar: tailwind_variants.TVReturnType<{
110
110
  [key: string]: {
111
111
  [key: string]: tailwind_variants.ClassValue | {
112
112
  root?: tailwind_variants.ClassValue;
113
+ count?: tailwind_variants.ClassValue;
113
114
  controls?: tailwind_variants.ClassValue;
114
115
  active?: tailwind_variants.ClassValue;
115
116
  clear?: tailwind_variants.ClassValue;
116
117
  results?: tailwind_variants.ClassValue;
117
- count?: tailwind_variants.ClassValue;
118
118
  optionCount?: tailwind_variants.ClassValue;
119
119
  trigger?: tailwind_variants.ClassValue;
120
120
  };
package/dist/flock.js CHANGED
@@ -19,7 +19,8 @@ function neighbourOf(s, i) {
19
19
  const at = s.order.indexOf(i);
20
20
  const near = [s.order[at - 1], s.order[at + 1]].filter((n) => n !== void 0);
21
21
  if (!near.length) return null;
22
- return near.reduce((a, b) => Math.abs(s.birds[a].x - s.birds[i].x) <= Math.abs(s.birds[b].x - s.birds[i].x) ? a : b);
22
+ const gap = (n) => Math.abs(s.birds[n].x - s.birds[i].x);
23
+ return near.reduce((a, b) => gap(a) <= gap(b) ? a : b, near[0]);
23
24
  }
24
25
  var BOOK_MS = 4800;
25
26
  var LOG_MS = 3800;
package/dist/flock.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/flock/flock.tsx","../src/flock/scenes.tsx"],"sourcesContent":["\"use client\";\n\n// The flock, alive: birds standing on a stage, each at ease in character (Mascot `life`), and the moments between\n// them — two birds glance at each other, the pigeon carries its parcel across, a bird looks up when you come near or tap\n// it. Transform and opacity only: CSS for each bird's own life, a timer for the moments (no frame loop), and nothing at\n// all when the flock is off screen, the tab is hidden or the person asked for less motion.\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport type { MascotBird, MascotLook } from \"../mascots\";\nimport { Mascot } from \"../mascots\";\nimport { BEATS, neighbourOf, Prop, receive, type Shown, type Stage } from \"./scenes\";\n\nexport interface FlockBird {\n /** Which bird. */\n bird: MascotBird;\n /** Where its feet are, across the stage: 0 to 100 (% of the stage's width). */\n x: number;\n /** Where its feet are, down the stage: 0 to 100 (% of the stage's height). */\n y: number;\n /** How wide it is: % of the stage's width. */\n size: number;\n}\n\nexport interface FlockMoments {\n /** Two neighbours look at each other now and then. Default `true`. */\n glance?: boolean;\n /** The pigeon, when the flock has one, carries its parcel across to another bird and comes back. Default `true`. */\n courier?: boolean;\n /** A bird looks up when the pointer comes near, and jumps a little when tapped. Default `true`. */\n react?: boolean;\n /**\n * Scenes, true to each bird's promise: the owl reads a book, the flamingo and the lovebird talk with a speech mark, the\n * crane steps and bows, the beaver taps a log, the magpie takes a shiny point, the duck builds, the falcon scans — and the\n * pigeon hands its parcel over, which the receiver opens in its own way. One at a time, at random. Default `false`.\n */\n scenes?: boolean;\n}\n\nexport type FlockProps = Omit<React.ComponentProps<\"div\">, \"children\"> &\n FlockMoments & {\n /** The birds on the stage. */\n birds: readonly FlockBird[];\n /** The stage's shape, width over height (default 16 / 9). It keeps its ratio at any width, so the birds keep their places. */\n ratio?: number;\n /** The birds' colours: the host's accent (`brand`, default) or the Krizaka story's (`own`). */\n tone?: \"brand\" | \"own\";\n /** The source of chance (default `Math.random`): give it a fixed one in a test. */\n random?: () => number;\n /** How lively the moments are: 1 is calm (default), 2 doubles how often neighbours glance and the pigeon delivers. */\n tempo?: number;\n /** A bird the page points at (a product the reader is on): it looks up and jumps once each time it changes. */\n active?: MascotBird | null;\n /** The birds greet the reader once as the flock first comes into view: each jumps in turn, left to right. */\n greet?: boolean;\n };\n\n// @fixed: the rhythm of the moments — how long a glance lasts, how often one happens, how long a delivery takes. A\n// choreography's pace, not a business parameter.\nconst GLANCE_HOLD_MS = [1500, 2400] as const;\nconst GLANCE_EVERY_MS = [4200, 9000] as const;\nconst COURIER_FIRST_MS = 9000;\nconst COURIER_EVERY_MS = [26000, 38000] as const;\nconst FLIGHT_MS = 2600;\nconst HAND_OVER_MS = 1300;\nconst LOOK_BACK_MS = 1600;\n\nconst between = (random: () => number, [lo, hi]: readonly [number, number], tempo = 1) => (lo + random() * (hi - lo)) / tempo;\n// @fixed: the scenes' pace — the wait between two beats, and the rarer long pause.\nconst SCENE_EVERY_MS = [2600, 5200] as const;\nconst SCENE_PAUSE_MS = [8000, 12000] as const;\nconst GREET_STEP_MS = 110;\nconst POKE_MS = 700;\n\n/** `true` while the page may move: no reduced-motion request, the tab visible. */\nfunction useMayMove(): boolean {\n const [may, setMay] = React.useState(false);\n React.useEffect(() => {\n const query = window.matchMedia(\"(prefers-reduced-motion: reduce)\");\n // The page settles first: `html[data-motion=\"settling\"]` (MotionObserver) holds every loop until it is `ready`.\n const settled = () => document.documentElement.getAttribute(\"data-motion\") !== \"settling\";\n const update = () => setMay(!query.matches && document.visibilityState !== \"hidden\" && settled());\n update();\n query.addEventListener(\"change\", update);\n document.addEventListener(\"visibilitychange\", update);\n const watch = typeof MutationObserver === \"undefined\" ? null : new MutationObserver(update);\n watch?.observe(document.documentElement, { attributes: true, attributeFilter: [\"data-motion\"] });\n return () => {\n query.removeEventListener(\"change\", update);\n document.removeEventListener(\"visibilitychange\", update);\n watch?.disconnect();\n };\n }, []);\n return may;\n}\n\n/** `true` while the element is on screen. */\nfunction useOnScreen(ref: React.RefObject<Element | null>): boolean {\n const [on, setOn] = React.useState(false);\n React.useEffect(() => {\n const el = ref.current;\n if (!el || typeof IntersectionObserver === \"undefined\") return;\n const observer = new IntersectionObserver(([entry]) => setOn(Boolean(entry?.isIntersecting)), { threshold: 0.1 });\n observer.observe(el);\n return () => observer.disconnect();\n }, [ref]);\n return on;\n}\n\n/**\n * The flock on its stage, alive. Decorative (`aria-hidden`): put the words beside it. Each bird idles in character; every\n * few seconds two neighbours glance at each other; every half minute the pigeon carries its parcel to another bird and\n * returns; a bird looks up when you come near. All of it pauses off screen and in a hidden tab, and the flock is still\n * under `prefers-reduced-motion`.\n */\nexport function Flock({ birds, ratio = 16 / 9, tone = \"brand\", glance = true, courier = true, react = true, scenes = false, random = Math.random, tempo = 1, active = null, greet = false, className, style, ...props }: FlockProps) {\n const stage = React.useRef<HTMLDivElement>(null);\n const bodies = React.useRef<(HTMLDivElement | null)[]>([]);\n const may = useMayMove();\n const onScreen = useOnScreen(stage);\n const running = may && onScreen;\n const [looks, setLooks] = React.useState<Record<number, MascotLook>>({});\n const [flying, setFlying] = React.useState<{ index: number; bank: number } | null>(null);\n const [poked, setPoked] = React.useState<Record<number, boolean>>({});\n const [shown, setShown] = React.useState<Shown[]>([]);\n const [empty, setEmpty] = React.useState<Record<number, boolean>>({});\n // Birds a scene holds (a glance or a trip leaves them alone), and the scene or the trip in progress.\n const held = React.useRef(new Set<number>());\n const busy = React.useRef<\"scene\" | \"trip\" | null>(null);\n const ids = React.useRef(0);\n\n // Left to right: a bird's neighbours are the birds beside it on the stage.\n const order = React.useMemo(() => birds.map((_, i) => i).sort((a, b) => birds[a]!.x - birds[b]!.x), [birds]);\n const look = React.useCallback((index: number, to: MascotLook) => setLooks((l) => (l[index] === to ? l : { ...l, [index]: to })), []);\n const rest = React.useCallback((...indexes: number[]) => setLooks((l) => Object.fromEntries(Object.entries(l).filter(([k]) => !indexes.includes(Number(k))))), []);\n\n // What a scene can do, bound to one run of an effect: every timer and animation it starts ends with the run.\n const stageFor = React.useCallback((run: { timers: Set<ReturnType<typeof setTimeout>>; anims: Set<Animation> }): Stage => {\n const later = (fn: () => void, ms: number) => {\n const t = setTimeout(() => {\n run.timers.delete(t);\n fn();\n }, ms);\n run.timers.add(t);\n };\n const poke = (index: number, ms = POKE_MS) => {\n setPoked((p) => ({ ...p, [index]: true }));\n later(() => setPoked((p) => ({ ...p, [index]: false })), ms);\n };\n const show = (index: number, kind: Shown[\"kind\"], ms: number, side?: 1 | -1, mark?: string) => {\n const item: Shown = { id: ++ids.current, at: index, kind, ms, side, mark };\n setShown((all) => [...all, item]);\n later(() => setShown((all) => all.filter((x) => x.id !== item.id)), ms);\n };\n return {\n birds,\n order,\n random,\n look,\n rest,\n poke,\n show,\n say: (index, mark, ms) => show(index, \"say\", ms, undefined, mark),\n wait: (ms) => new Promise<void>((resolve) => later(resolve, ms)),\n move: async (index, keyframes, ms) => {\n const el = bodies.current[index];\n if (!el || typeof el.animate !== \"function\") return;\n const animation = el.animate(keyframes, { duration: ms });\n run.anims.add(animation);\n await animation.finished.catch(() => undefined);\n run.anims.delete(animation);\n },\n };\n }, [birds, order, random, look, rest]);\n\n // Glances: two neighbours turn towards each other, hold, and look away.\n React.useEffect(() => {\n if (!running || !glance || order.length < 2) return;\n let timer: ReturnType<typeof setTimeout> | undefined;\n let back: ReturnType<typeof setTimeout> | undefined;\n const next = () => {\n timer = setTimeout(() => {\n const at = Math.floor(random() * (order.length - 1));\n const [a, b] = [order[at]!, order[at + 1]!];\n if (held.current.has(a) || held.current.has(b)) return next();\n look(a, \"right\");\n look(b, \"left\");\n back = setTimeout(() => {\n rest(a, b);\n next();\n }, between(random, GLANCE_HOLD_MS));\n }, between(random, GLANCE_EVERY_MS, tempo));\n };\n next();\n return () => {\n clearTimeout(timer);\n clearTimeout(back);\n };\n }, [running, glance, order, random, tempo, look, rest]);\n\n // The delivery: the pigeon takes its parcel across to the farthest bird, hands it over, and flies back.\n React.useEffect(() => {\n const pigeon = birds.findIndex((b) => b.bird === \"pigeon\");\n if (!running || !courier || pigeon < 0 || birds.length < 2) return;\n let alive = true;\n const heldNow = held.current;\n let timer: ReturnType<typeof setTimeout> | undefined;\n let animation: Animation | undefined;\n const run = { timers: new Set<ReturnType<typeof setTimeout>>(), anims: new Set<Animation>() };\n // The farthest bird from the pigeon, so the parcel crosses the whole stage.\n const from = birds[pigeon]!;\n const target = birds.reduce((far, b, i) => (i !== pigeon && Math.abs(b.x - from.x) > Math.abs(birds[far]!.x - from.x) ? i : far), pigeon === 0 ? 1 : 0);\n const wait = (ms: number) => new Promise<void>((resolve) => (timer = setTimeout(resolve, ms)));\n const trip = async () => {\n // With scenes, the trip waits for the beat in progress and holds the stage while it lasts.\n while (alive && scenes && busy.current === \"scene\") await wait(400);\n if (!alive) return;\n busy.current = \"trip\";\n const el = bodies.current[pigeon];\n const box = stage.current?.getBoundingClientRect();\n if (!el || !box || typeof el.animate !== \"function\") return;\n const to = birds[target]!;\n const side = to.x > from.x ? 1 : -1;\n // It lands beside the receiver, not on it.\n const dx = ((to.x - from.x) / 100) * box.width - side * (to.size / 100) * box.width * 0.55;\n const lift = (from.size / 100) * box.width * 0.35;\n const fly = async (fromX: number, toX: number) => {\n setFlying({ index: pigeon, bank: Math.sign(toX - fromX) });\n animation = el.animate(\n [\n { transform: `translate(${fromX}px, 0)`, easing: \"ease-out\" },\n { transform: `translate(${(fromX + toX) / 2}px, ${-lift}px)`, easing: \"ease-in\", offset: 0.5 },\n { transform: `translate(${toX}px, 0)` },\n ],\n { duration: FLIGHT_MS, fill: \"forwards\" },\n );\n await animation.finished.catch(() => undefined);\n setFlying(null);\n };\n look(target, side > 0 ? \"left\" : \"right\");\n held.current.add(target);\n await fly(0, dx);\n if (!alive) return;\n // The hand-over: the receiver looks at the pigeon, the pigeon hops on the doorstep.\n setPoked((p) => ({ ...p, [pigeon]: true }));\n if (scenes) {\n // …and the parcel changes hands: the receiver takes it and reacts in character, the pigeon flies back light.\n setEmpty((e) => ({ ...e, [pigeon]: true }));\n const reaction = receive(stageFor(run), target, pigeon);\n await wait(HAND_OVER_MS);\n if (!alive) return;\n setPoked((p) => ({ ...p, [pigeon]: false }));\n await reaction;\n } else {\n await wait(HAND_OVER_MS);\n if (!alive) return;\n setPoked((p) => ({ ...p, [pigeon]: false }));\n }\n if (!alive) return;\n look(target, \"up\");\n await fly(dx, 0);\n animation?.cancel();\n setEmpty((e) => ({ ...e, [pigeon]: false }));\n rest(target);\n };\n const schedule = (ms: number) => {\n timer = setTimeout(async () => {\n await trip();\n busy.current = null;\n held.current.delete(target);\n if (alive) schedule(between(random, COURIER_EVERY_MS, tempo));\n }, ms);\n };\n schedule(COURIER_FIRST_MS / tempo);\n return () => {\n alive = false;\n clearTimeout(timer);\n animation?.cancel();\n run.timers.forEach(clearTimeout);\n run.anims.forEach((a) => a.cancel());\n if (scenes) {\n setShown([]);\n setEmpty({});\n heldNow.clear();\n busy.current = null;\n }\n setFlying(null);\n };\n }, [running, courier, birds, random, tempo, scenes, stageFor, look, rest]);\n\n // The scenes: one beat at a time, picked at random from what the flock holds — never the same bird twice in a row, never\n // at a regular beat (short waits, now and then a long pause) — so the minute is never the same twice.\n React.useEffect(() => {\n if (!running || !scenes || birds.length < 1) return;\n let alive = true;\n const heldNow = held.current;\n const run = { timers: new Set<ReturnType<typeof setTimeout>>(), anims: new Set<Animation>() };\n const st = stageFor(run);\n const beats = BEATS.flatMap((beat) => birds.flatMap((b, i) => (b.bird === beat.bird ? [{ beat, index: i }] : [])));\n if (!beats.length) return;\n let last = -1;\n const next = async () => {\n const long = random() < 0.2;\n await st.wait(between(random, long ? SCENE_PAUSE_MS : SCENE_EVERY_MS, tempo));\n while (alive && busy.current === \"trip\") await st.wait(600);\n if (!alive) return;\n const pool = beats.filter((x) => x.index !== last);\n const pick = (pool.length ? pool : beats)[Math.floor(random() * (pool.length ? pool.length : beats.length))]!;\n last = pick.index;\n busy.current = \"scene\";\n // The scene's birds are held, so no glance cuts across it.\n const near = neighbourOf(st, pick.index);\n held.current.add(pick.index);\n if (near !== null) held.current.add(near);\n await pick.beat.run(st, pick.index);\n held.current.delete(pick.index);\n if (near !== null) held.current.delete(near);\n if (busy.current === \"scene\") busy.current = null;\n if (alive) void next();\n };\n void next();\n return () => {\n alive = false;\n run.timers.forEach(clearTimeout);\n run.anims.forEach((a) => a.cancel());\n setShown([]);\n heldNow.clear();\n busy.current = null;\n };\n }, [running, scenes, birds, random, tempo, stageFor]);\n\n // The greeting: the first time the flock is on screen, each bird jumps in turn.\n const greeted = React.useRef(false);\n React.useEffect(() => {\n if (!running || !greet || greeted.current) return;\n greeted.current = true;\n const timers: ReturnType<typeof setTimeout>[] = [];\n order.forEach((index, n) => {\n timers.push(setTimeout(() => setPoked((p) => ({ ...p, [index]: true })), n * GREET_STEP_MS));\n timers.push(setTimeout(() => setPoked((p) => ({ ...p, [index]: false })), n * GREET_STEP_MS + POKE_MS));\n });\n return () => timers.forEach(clearTimeout);\n }, [running, greet, order]);\n\n // The bird the page points at looks up and jumps.\n React.useEffect(() => {\n const index = active ? birds.findIndex((b) => b.bird === active) : -1;\n if (!running || index < 0) return;\n const start = setTimeout(() => {\n look(index, \"up\");\n setPoked((p) => ({ ...p, [index]: true }));\n }, 0);\n const t = setTimeout(() => setPoked((p) => ({ ...p, [index]: false })), POKE_MS);\n return () => {\n clearTimeout(start);\n clearTimeout(t);\n setPoked((p) => ({ ...p, [index]: false }));\n rest(index);\n };\n }, [active, running, birds, look, rest]);\n\n // A bird looks up when you come near, and jumps when you tap it.\n const hover = (index: number, event: React.PointerEvent) => {\n if (!running || !react || event.pointerType !== \"mouse\") return;\n look(index, \"up\");\n };\n const leave = (index: number) => {\n if (!react) return;\n rest(index);\n };\n const tap = (index: number) => {\n if (!running || !react) return;\n look(index, \"up\");\n setPoked((p) => ({ ...p, [index]: true }));\n setTimeout(() => {\n setPoked((p) => ({ ...p, [index]: false }));\n rest(index);\n }, LOOK_BACK_MS);\n };\n\n return (\n <div\n ref={stage}\n aria-hidden\n data-flock=\"\"\n data-running={running ? \"\" : undefined}\n data-motion-scope=\"\"\n className={cn(\"relative w-full\", className)}\n style={{ aspectRatio: String(ratio), containerType: \"inline-size\", ...style }}\n {...props}\n >\n {birds.map((b, i) => (\n <div\n key={`${b.bird}-${i}`}\n ref={(el) => {\n bodies.current[i] = el;\n }}\n data-flock-bird={b.bird}\n className=\"absolute touch-manipulation\"\n style={{ left: `${b.x - b.size / 2}%`, width: `${b.size}%`, top: `calc(${b.y}% - ${b.size * 0.9}cqw)`, aspectRatio: \"1\", pointerEvents: react ? \"auto\" : \"none\" }}\n onPointerEnter={(event) => hover(i, event)}\n onPointerLeave={() => leave(i)}\n onPointerDown={() => tap(i)}\n >\n <Mascot\n bird={b.bird}\n tone={tone}\n life\n look={looks[i]}\n flying={flying?.index === i}\n bank={flying?.index === i ? flying.bank : 0}\n poked={poked[i]}\n carrying={!empty[i]}\n size={120}\n style={{ width: \"100%\", height: \"100%\", display: \"block\", overflow: \"visible\" }}\n />\n {shown\n .filter((x) => x.at === i)\n .map((x) => (\n <Prop key={x.id} shown={x} size={b.size} />\n ))}\n </div>\n ))}\n </div>\n );\n}\n","\"use client\";\n\n// The flock's scenes: what a bird does between the idle motions, each one true to the promise it carries — the owl reads\n// (a book, a leaf turned), the flamingo and the lovebird answer (a speech mark, a reply), the crane steps and bows, the\n// beaver carries a log and taps it, the magpie spots a shiny point and takes it, the duck builds, the falcon scans — and the\n// pigeon's parcel changes hands: the receiver reacts in its own way. A director picks one beat at a time from what the\n// flock holds, with chance in the waits and in the choice, so it never loops the same minute twice. Transform and opacity\n// only (Web Animations on a few small elements, timers between beats); nothing runs off screen or under reduced motion.\nimport * as React from \"react\";\n\nimport type { MascotBird, MascotLook } from \"../mascots\";\nimport { PARCEL } from \"../mascots/geometry\";\n\nexport type PropKind = \"say\" | \"book\" | \"log\" | \"glint\" | \"gift\";\n\n/** A small thing a bird shows for a while: a speech mark, a book, a log, a shiny point, a parcel. */\nexport interface Shown {\n id: number;\n /** Index of the bird it belongs to. */\n at: number;\n kind: PropKind;\n /** How long it stays (ms). */\n ms: number;\n /** The mark of a speech bubble. */\n mark?: string;\n /** Which side it comes from (1: right, -1: left). */\n side?: 1 | -1;\n}\n\n/** What a beat can do on the stage (built by `Flock`; every wait ends when the flock stops). */\nexport interface Stage {\n birds: readonly { bird: MascotBird; x: number; y: number; size: number }[];\n /** Indexes left to right. */\n order: readonly number[];\n random: () => number;\n look: (index: number, to: MascotLook) => void;\n rest: (...indexes: number[]) => void;\n poke: (index: number, ms?: number) => void;\n say: (index: number, mark: string, ms: number) => void;\n show: (index: number, kind: PropKind, ms: number, side?: 1 | -1) => void;\n /** Move a bird's body for a while (transform only). */\n move: (index: number, keyframes: Keyframe[], ms: number) => Promise<void>;\n wait: (ms: number) => Promise<void>;\n}\n\nconst side = (s: Stage, i: number, j: number): 1 | -1 => (s.birds[j]!.x >= s.birds[i]!.x ? 1 : -1);\nconst towards = (s: Stage, i: number, j: number): MascotLook => (side(s, i, j) > 0 ? \"right\" : \"left\");\n/** Where a bird is among its neighbours, left to right: the one beside it (the nearer one when there are two). */\nexport function neighbourOf(s: Stage, i: number): number | null {\n const at = s.order.indexOf(i);\n const near = [s.order[at - 1], s.order[at + 1]].filter((n): n is number => n !== undefined);\n if (!near.length) return null;\n return near.reduce((a, b) => (Math.abs(s.birds[a]!.x - s.birds[i]!.x) <= Math.abs(s.birds[b]!.x - s.birds[i]!.x) ? a : b));\n}\n\n// @fixed: the choreography's pace — how long each beat lasts. A rhythm to the eye, not a business parameter.\nconst BOOK_MS = 4800;\nconst LOG_MS = 3800;\nconst GLINT_MS = 3400;\nconst SAY_MS = 1500;\n\n/** The owl reads: it looks down at its book, a leaf turns, and it turns another. A neighbour glances over. */\nasync function read(s: Stage, i: number) {\n const j = neighbourOf(s, i);\n s.look(i, \"left\");\n s.show(i, \"book\", BOOK_MS);\n await s.wait(BOOK_MS * 0.45);\n if (j !== null && s.random() < 0.5) {\n s.look(j, towards(s, j, i));\n await s.wait(1100);\n s.rest(j);\n }\n await s.wait(BOOK_MS * 0.5);\n s.rest(i);\n}\n\n/** The flamingo or the lovebird speaks; its neighbour listens, then answers, and they both light up. */\nasync function chat(s: Stage, i: number) {\n const j = neighbourOf(s, i);\n s.look(i, j === null ? \"up\" : towards(s, i, j));\n s.say(i, \"…\", SAY_MS);\n await s.wait(SAY_MS * 0.6);\n if (j === null) {\n await s.wait(SAY_MS * 0.6);\n s.rest(i);\n return;\n }\n s.look(j, towards(s, j, i));\n await s.wait(SAY_MS * 0.7);\n s.say(j, s.random() < 0.5 ? \"!\" : \"?\", SAY_MS);\n s.poke(j);\n await s.wait(SAY_MS * 0.5);\n s.poke(i);\n await s.wait(SAY_MS * 0.7);\n s.rest(i, j);\n}\n\n/** The crane steps out of the line, bows to its neighbour, and steps back. */\nasync function bow(s: Stage, i: number) {\n const j = neighbourOf(s, i);\n const dir = j === null ? 1 : side(s, i, j);\n const step = `${(s.birds[i]!.size * 0.14 * dir).toFixed(2)}cqw`;\n const lean = `rotate(${dir * 11}deg)`;\n const at = (x: string, r: string) => `translateX(${x}) ${r}`;\n const run = s.move(\n i,\n [\n { transform: at(\"0cqw\", \"rotate(0deg)\"), easing: \"ease-in-out\" },\n { transform: at(step, \"rotate(0deg)\"), offset: 0.22, easing: \"ease-in-out\" },\n { transform: at(step, lean), offset: 0.42, easing: \"ease-in-out\" },\n { transform: at(step, lean), offset: 0.6, easing: \"ease-in-out\" },\n { transform: at(step, \"rotate(0deg)\"), offset: 0.74, easing: \"ease-in-out\" },\n { transform: at(\"0cqw\", \"rotate(0deg)\") },\n ],\n 3800,\n );\n if (j !== null) {\n await s.wait(1700);\n s.look(j, towards(s, j, i));\n await s.wait(1200);\n s.poke(j);\n await s.wait(500);\n s.rest(j);\n }\n await run;\n}\n\n/** The beaver brings a log, taps it into place three times, and takes it away. */\nasync function tap(s: Stage, i: number) {\n s.show(i, \"log\", LOG_MS, s.birds[i]!.x > 50 ? 1 : -1);\n await s.wait(LOG_MS * 0.3);\n for (let n = 0; n < 3; n++) {\n s.poke(i, 420);\n await s.wait(520);\n }\n await s.wait(LOG_MS * 0.3);\n}\n\n/** The magpie sees something shiny on the ground, looks, hops, and takes it. */\nasync function shine(s: Stage, i: number) {\n const dir: 1 | -1 = s.birds[i]!.x > 50 ? -1 : 1;\n const to: MascotLook = dir > 0 ? \"right\" : \"left\";\n s.show(i, \"glint\", GLINT_MS, dir);\n await s.wait(GLINT_MS * 0.28);\n s.look(i, to);\n await s.wait(GLINT_MS * 0.3);\n s.poke(i);\n await s.wait(GLINT_MS * 0.25);\n s.look(i, \"up\");\n await s.wait(GLINT_MS * 0.2);\n s.rest(i);\n}\n\n/** The duck builds: quick nods in a burst, like typing a block into place. */\nasync function build(s: Stage, i: number) {\n for (let n = 0; n < 4; n++) {\n s.poke(i, 300);\n await s.wait(380);\n }\n}\n\n/** The falcon watches: a slow scan, left then right, and a look up. */\nasync function scan(s: Stage, i: number) {\n for (const to of [\"left\", \"up\", \"right\"] as const) {\n s.look(i, to);\n await s.wait(1100);\n }\n s.rest(i);\n}\n\n/** The pigeon's parcel has just been handed over: the receiver reacts in its own way (about 2 s). */\nexport async function receive(s: Stage, i: number, from: number) {\n const bird = s.birds[i]!.bird;\n s.look(i, towards(s, i, from));\n s.show(i, \"gift\", 2400);\n await s.wait(350);\n if (bird === \"crane\") await bow(s, i);\n else if (bird === \"magpie\") {\n s.poke(i);\n await s.wait(700);\n s.show(i, \"glint\", GLINT_MS * 0.6, side(s, i, from));\n await s.wait(1200);\n } else if (bird === \"beaver\" || bird === \"duck\") {\n s.poke(i, 420);\n await s.wait(520);\n s.poke(i, 420);\n await s.wait(900);\n } else if (bird === \"owl\") {\n s.say(i, \"?\", SAY_MS);\n await s.wait(900);\n s.poke(i);\n await s.wait(700);\n } else {\n s.say(i, \"!\", SAY_MS);\n s.poke(i);\n await s.wait(1500);\n }\n}\n\nexport interface Beat {\n id: string;\n bird: MascotBird;\n run: (s: Stage, index: number) => Promise<void>;\n}\n\n/** What each bird of the flock can do on its own (the pigeon's trip is the flock's courier). */\nexport const BEATS: readonly Beat[] = [\n { id: \"read\", bird: \"owl\", run: read },\n { id: \"chat\", bird: \"flamingo\", run: chat },\n { id: \"chat\", bird: \"lovebird\", run: chat },\n { id: \"bow\", bird: \"crane\", run: bow },\n { id: \"tap\", bird: \"beaver\", run: tap },\n { id: \"shine\", bird: \"magpie\", run: shine },\n { id: \"build\", bird: \"duck\", run: build },\n { id: \"scan\", bird: \"falcon\", run: scan },\n];\n\n// ─── The small things a bird shows ───────────────────────────────────────────────────────────────\n\nconst PAPER = \"var(--kz-surface-1)\";\nconst INK = \"var(--kz-text-primary)\";\nconst LINE = \"var(--kz-border-strong, currentColor)\";\n\n/** One thing, in its own frame: it comes in, stays for `ms`, and goes (opacity and transform only). */\nfunction lifeFrames(from: string, to: string): Keyframe[] {\n return [\n { opacity: 0, transform: from, offset: 0 },\n { opacity: 1, transform: \"none\", offset: 0.14 },\n { opacity: 1, transform: \"none\", offset: 0.84 },\n { opacity: 0, transform: to, offset: 1 },\n ];\n}\n\nconst LEAF: Keyframe[] = [\n { transform: \"scaleX(1)\", offset: 0 },\n { transform: \"scaleX(1)\", offset: 0.25 },\n { transform: \"scaleX(-1)\", offset: 0.38 },\n { transform: \"scaleX(1)\", offset: 0.39 },\n { transform: \"scaleX(1)\", offset: 0.62 },\n { transform: \"scaleX(-1)\", offset: 0.75 },\n { transform: \"scaleX(-1)\", offset: 1 },\n];\n\nexport function Prop({ shown, size }: { shown: Shown; size: number }) {\n const ref = React.useRef<HTMLDivElement>(null);\n const leaf = React.useRef<HTMLDivElement>(null);\n const dir = shown.side ?? 1;\n React.useEffect(() => {\n const el = ref.current;\n if (!el || typeof el.animate !== \"function\") return;\n const from: Record<PropKind, [string, string]> = {\n say: [\"translateY(30%) scale(.5)\", \"translateY(-12%) scale(.9)\"],\n book: [\"translateY(40%) scale(.8)\", \"translateY(20%) scale(.9)\"],\n log: [`translateX(${190 * dir}%)`, `translateX(${190 * dir}%)`],\n glint: [\"scale(.2) rotate(-60deg)\", `translate(${-90 * dir}%, -170%) scale(.2) rotate(60deg)`],\n gift: [\"translateY(40%) scale(.3)\", \"translateY(-30%) scale(1.4)\"],\n };\n const [a, b] = from[shown.kind];\n const animations = [el.animate(lifeFrames(a, b), { duration: shown.ms, fill: \"both\", easing: \"ease-out\" })];\n if (shown.kind === \"book\" && leaf.current) animations.push(leaf.current.animate(LEAF, { duration: shown.ms, fill: \"both\", easing: \"ease-in-out\" }));\n if (shown.kind === \"glint\") animations.push(el.firstElementChild!.animate([{ transform: \"scale(1)\" }, { transform: \"scale(1.35)\" }, { transform: \"scale(1)\" }], { duration: 700, iterations: Math.ceil(shown.ms / 700), easing: \"ease-in-out\" }));\n return () => animations.forEach((x) => x.cancel());\n }, [shown, dir]);\n\n const unit = (n: number) => `calc(${size}cqw * ${n})`;\n const base: React.CSSProperties = { position: \"absolute\", pointerEvents: \"none\", opacity: 0 };\n\n if (shown.kind === \"say\")\n return (\n <div ref={ref} data-flock-prop=\"say\" style={{ ...base, left: \"58%\", top: \"-6%\", width: unit(0.34), height: unit(0.24), transformOrigin: \"20% 100%\" }}>\n <span\n style={{ position: \"absolute\", inset: 0, display: \"grid\", placeItems: \"center\", background: PAPER, border: `1.5px solid ${LINE}`, borderRadius: \"999px\", color: INK, font: `600 ${unit(0.17)}/1 var(--font-mono, ui-monospace, monospace)` }}\n >\n {shown.mark ?? \"…\"}\n </span>\n <span style={{ position: \"absolute\", left: \"14%\", bottom: \"-12%\", width: unit(0.07), height: unit(0.07), background: PAPER, borderRight: `1.5px solid ${LINE}`, borderBottom: `1.5px solid ${LINE}`, transform: \"rotate(45deg)\" }} />\n </div>\n );\n\n if (shown.kind === \"book\")\n return (\n <div ref={ref} data-flock-prop=\"book\" style={{ ...base, left: \"17%\", bottom: \"-2%\", width: \"66%\", height: unit(0.2), transformOrigin: \"50% 100%\" }}>\n {[0, 1].map((n) => (\n <span key={n} style={{ position: \"absolute\", top: 0, bottom: 0, [n ? \"right\" : \"left\"]: 0, width: \"50%\", background: `repeating-linear-gradient(${PAPER} 0 18%, ${LINE} 18% 24%)`, border: `1.5px solid ${LINE}`, borderRadius: n ? \"0 3px 3px 0\" : \"3px 0 0 3px\" }} />\n ))}\n <div ref={leaf} style={{ position: \"absolute\", top: 0, bottom: 0, left: \"50%\", width: \"50%\", transformOrigin: \"0 50%\", background: PAPER, border: `1.5px solid ${LINE}`, borderRadius: \"0 3px 3px 0\" }} />\n </div>\n );\n\n if (shown.kind === \"log\")\n return (\n <div ref={ref} data-flock-prop=\"log\" style={{ ...base, left: \"22%\", bottom: \"-3%\", width: \"56%\", height: unit(0.17), background: PARCEL[2], borderRadius: \"999px\", boxShadow: `inset -${unit(0.04)} 0 0 ${PARCEL[1]}` }}>\n <span style={{ position: \"absolute\", left: 0, top: 0, bottom: 0, aspectRatio: \"1\", borderRadius: \"50%\", background: `radial-gradient(${PARCEL[0]} 0 25%, ${PARCEL[1]} 26% 55%, ${PARCEL[2]} 56%)`, border: `1px solid ${PARCEL[2]}` }} />\n </div>\n );\n\n if (shown.kind === \"glint\")\n return (\n <div ref={ref} data-flock-prop=\"glint\" style={{ ...base, [dir > 0 ? \"left\" : \"right\"]: \"94%\", bottom: \"2%\", width: unit(0.2), height: unit(0.2) }}>\n <span style={{ position: \"absolute\", inset: 0, background: PARCEL[0], clipPath: \"polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%)\" }} />\n </div>\n );\n\n return (\n <div ref={ref} data-flock-prop=\"gift\" style={{ ...base, left: \"58%\", top: \"2%\", width: unit(0.26), height: unit(0.22), background: PARCEL[0], border: `1.5px solid ${PARCEL[2]}`, borderRadius: 2 }}>\n <span style={{ position: \"absolute\", left: \"44%\", top: 0, bottom: 0, width: \"12%\", background: PARCEL[2] }} />\n <span style={{ position: \"absolute\", top: \"42%\", left: 0, right: 0, height: \"16%\", background: PARCEL[2] }} />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAMA,YAAYA,YAAW;;;ACEvB,YAAY,WAAW;AAqQjB,SACE,KADF;AAhON,IAAM,OAAO,CAAC,GAAU,GAAW,MAAuB,EAAE,MAAM,CAAC,EAAG,KAAK,EAAE,MAAM,CAAC,EAAG,IAAI,IAAI;AAC/F,IAAM,UAAU,CAAC,GAAU,GAAW,MAA2B,KAAK,GAAG,GAAG,CAAC,IAAI,IAAI,UAAU;AAExF,SAAS,YAAY,GAAU,GAA0B;AAC9D,QAAM,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC5B,QAAM,OAAO,CAAC,EAAE,MAAM,KA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;AAAA,UAEC,KAAK,CAAC,OAAO;AACX,mBAAO,QAAQ,CAAC,IAAI;AAAA,UACtB;AAAA,UACA,mBAAiB,EAAE;AAAA,UACnB,WAAU;AAAA,UACV,OAAO,EAAE,MAAM,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,KAAK,OAAO,GAAG,EAAE,IAAI,KAAK,KAAK,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,QAAQ,aAAa,KAAK,eAAe,QAAQ,SAAS,OAAO;AAAA,UAChK,gBAAgB,CAAC,UAAU,MAAM,GAAG,KAAK;AAAA,UACzC,gBAAgB,MAAM,MAAM,CAAC;AAAA,UAC7B,eAAe,MAAME,KAAI,CAAC;AAAA,UAE1B;AAAA,4BAAAH;AAAA,cAAC;AAAA;AAAA,gBACC,MAAM,EAAE;AAAA,gBACR;AAAA,gBACA,MAAI;AAAA,gBACJ,MAAM,MAAM,CAAC;AAAA,gBACb,QAAQ,QAAQ,UAAU;AAAA,gBAC1B,MAAM,QAAQ,UAAU,IAAI,OAAO,OAAO;AAAA,gBAC1C,OAAO,MAAM,CAAC;AAAA,gBACd,UAAU,CAAC,MAAM,CAAC;AAAA,gBAClB,MAAM;AAAA,gBACN,OAAO,EAAE,OAAO,QAAQ,QAAQ,QAAQ,SAAS,SAAS,UAAU,UAAU;AAAA;AAAA,YAChF;AAAA,YACC,MACE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,EACxB,IAAI,CAAC,MACJ,gBAAAA,KAAC,QAAgB,OAAO,GAAG,MAAM,EAAE,QAAxB,EAAE,EAA4B,CAC1C;AAAA;AAAA;AAAA,QA3BE,GAAG,EAAE,IAAI,IAAI,CAAC;AAAA,MA4BrB,CACD;AAAA;AAAA,EACH;AAEJ;","names":["React","jsx","jsxs","side","tap"]}
1
+ {"version":3,"sources":["../src/flock/flock.tsx","../src/flock/scenes.tsx"],"sourcesContent":["\"use client\";\n\n// The flock, alive: birds standing on a stage, each at ease in character (Mascot `life`), and the moments between\n// them — two birds glance at each other, the pigeon carries its parcel across, a bird looks up when you come near or tap\n// it. Transform and opacity only: CSS for each bird's own life, a timer for the moments (no frame loop), and nothing at\n// all when the flock is off screen, the tab is hidden or the person asked for less motion.\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport type { MascotBird, MascotLook } from \"../mascots\";\nimport { Mascot } from \"../mascots\";\nimport { BEATS, neighbourOf, Prop, receive, type Shown, type Stage } from \"./scenes\";\n\nexport interface FlockBird {\n /** Which bird. */\n bird: MascotBird;\n /** Where its feet are, across the stage: 0 to 100 (% of the stage's width). */\n x: number;\n /** Where its feet are, down the stage: 0 to 100 (% of the stage's height). */\n y: number;\n /** How wide it is: % of the stage's width. */\n size: number;\n}\n\nexport interface FlockMoments {\n /** Two neighbours look at each other now and then. Default `true`. */\n glance?: boolean;\n /** The pigeon, when the flock has one, carries its parcel across to another bird and comes back. Default `true`. */\n courier?: boolean;\n /** A bird looks up when the pointer comes near, and jumps a little when tapped. Default `true`. */\n react?: boolean;\n /**\n * Scenes, true to each bird's promise: the owl reads a book, the flamingo and the lovebird talk with a speech mark, the\n * crane steps and bows, the beaver taps a log, the magpie takes a shiny point, the duck builds, the falcon scans — and the\n * pigeon hands its parcel over, which the receiver opens in its own way. One at a time, at random. Default `false`.\n */\n scenes?: boolean;\n}\n\nexport type FlockProps = Omit<React.ComponentProps<\"div\">, \"children\"> &\n FlockMoments & {\n /** The birds on the stage. */\n birds: readonly FlockBird[];\n /** The stage's shape, width over height (default 16 / 9). It keeps its ratio at any width, so the birds keep their places. */\n ratio?: number;\n /** The birds' colours: the host's accent (`brand`, default) or the Krizaka story's (`own`). */\n tone?: \"brand\" | \"own\";\n /** The source of chance (default `Math.random`): give it a fixed one in a test. */\n random?: () => number;\n /** How lively the moments are: 1 is calm (default), 2 doubles how often neighbours glance and the pigeon delivers. */\n tempo?: number;\n /** A bird the page points at (a product the reader is on): it looks up and jumps once each time it changes. */\n active?: MascotBird | null;\n /** The birds greet the reader once as the flock first comes into view: each jumps in turn, left to right. */\n greet?: boolean;\n };\n\n// @fixed: the rhythm of the moments — how long a glance lasts, how often one happens, how long a delivery takes. A\n// choreography's pace, not a business parameter.\nconst GLANCE_HOLD_MS = [1500, 2400] as const;\nconst GLANCE_EVERY_MS = [4200, 9000] as const;\nconst COURIER_FIRST_MS = 9000;\nconst COURIER_EVERY_MS = [26000, 38000] as const;\nconst FLIGHT_MS = 2600;\nconst HAND_OVER_MS = 1300;\nconst LOOK_BACK_MS = 1600;\n\nconst between = (random: () => number, [lo, hi]: readonly [number, number], tempo = 1) => (lo + random() * (hi - lo)) / tempo;\n// @fixed: the scenes' pace — the wait between two beats, and the rarer long pause.\nconst SCENE_EVERY_MS = [2600, 5200] as const;\nconst SCENE_PAUSE_MS = [8000, 12000] as const;\nconst GREET_STEP_MS = 110;\nconst POKE_MS = 700;\n\n/** `true` while the page may move: no reduced-motion request, the tab visible. */\nfunction useMayMove(): boolean {\n const [may, setMay] = React.useState(false);\n React.useEffect(() => {\n const query = window.matchMedia(\"(prefers-reduced-motion: reduce)\");\n // The page settles first: `html[data-motion=\"settling\"]` (MotionObserver) holds every loop until it is `ready`.\n const settled = () => document.documentElement.getAttribute(\"data-motion\") !== \"settling\";\n const update = () => setMay(!query.matches && document.visibilityState !== \"hidden\" && settled());\n update();\n query.addEventListener(\"change\", update);\n document.addEventListener(\"visibilitychange\", update);\n const watch = typeof MutationObserver === \"undefined\" ? null : new MutationObserver(update);\n watch?.observe(document.documentElement, { attributes: true, attributeFilter: [\"data-motion\"] });\n return () => {\n query.removeEventListener(\"change\", update);\n document.removeEventListener(\"visibilitychange\", update);\n watch?.disconnect();\n };\n }, []);\n return may;\n}\n\n/** `true` while the element is on screen. */\nfunction useOnScreen(ref: React.RefObject<Element | null>): boolean {\n const [on, setOn] = React.useState(false);\n React.useEffect(() => {\n const el = ref.current;\n if (!el || typeof IntersectionObserver === \"undefined\") return;\n const observer = new IntersectionObserver(([entry]) => setOn(Boolean(entry?.isIntersecting)), { threshold: 0.1 });\n observer.observe(el);\n return () => observer.disconnect();\n }, [ref]);\n return on;\n}\n\n/**\n * The flock on its stage, alive. Decorative (`aria-hidden`): put the words beside it. Each bird idles in character; every\n * few seconds two neighbours glance at each other; every half minute the pigeon carries its parcel to another bird and\n * returns; a bird looks up when you come near. All of it pauses off screen and in a hidden tab, and the flock is still\n * under `prefers-reduced-motion`.\n */\nexport function Flock({ birds, ratio = 16 / 9, tone = \"brand\", glance = true, courier = true, react = true, scenes = false, random = Math.random, tempo = 1, active = null, greet = false, className, style, ...props }: FlockProps) {\n const stage = React.useRef<HTMLDivElement>(null);\n const bodies = React.useRef<(HTMLDivElement | null)[]>([]);\n const may = useMayMove();\n const onScreen = useOnScreen(stage);\n const running = may && onScreen;\n const [looks, setLooks] = React.useState<Record<number, MascotLook>>({});\n const [flying, setFlying] = React.useState<{ index: number; bank: number } | null>(null);\n const [poked, setPoked] = React.useState<Record<number, boolean>>({});\n const [shown, setShown] = React.useState<Shown[]>([]);\n const [empty, setEmpty] = React.useState<Record<number, boolean>>({});\n // Birds a scene holds (a glance or a trip leaves them alone), and the scene or the trip in progress.\n const held = React.useRef(new Set<number>());\n const busy = React.useRef<\"scene\" | \"trip\" | null>(null);\n const ids = React.useRef(0);\n\n // Left to right: a bird's neighbours are the birds beside it on the stage.\n const order = React.useMemo(() => birds.map((_, i) => i).sort((a, b) => birds[a]!.x - birds[b]!.x), [birds]);\n const look = React.useCallback((index: number, to: MascotLook) => setLooks((l) => (l[index] === to ? l : { ...l, [index]: to })), []);\n const rest = React.useCallback((...indexes: number[]) => setLooks((l) => Object.fromEntries(Object.entries(l).filter(([k]) => !indexes.includes(Number(k))))), []);\n\n // What a scene can do, bound to one run of an effect: every timer and animation it starts ends with the run.\n const stageFor = React.useCallback((run: { timers: Set<ReturnType<typeof setTimeout>>; anims: Set<Animation> }): Stage => {\n const later = (fn: () => void, ms: number) => {\n const t = setTimeout(() => {\n run.timers.delete(t);\n fn();\n }, ms);\n run.timers.add(t);\n };\n const poke = (index: number, ms = POKE_MS) => {\n setPoked((p) => ({ ...p, [index]: true }));\n later(() => setPoked((p) => ({ ...p, [index]: false })), ms);\n };\n const show = (index: number, kind: Shown[\"kind\"], ms: number, side?: 1 | -1, mark?: string) => {\n const item: Shown = { id: ++ids.current, at: index, kind, ms, side, mark };\n setShown((all) => [...all, item]);\n later(() => setShown((all) => all.filter((x) => x.id !== item.id)), ms);\n };\n return {\n birds,\n order,\n random,\n look,\n rest,\n poke,\n show,\n say: (index, mark, ms) => show(index, \"say\", ms, undefined, mark),\n wait: (ms) => new Promise<void>((resolve) => later(resolve, ms)),\n move: async (index, keyframes, ms) => {\n const el = bodies.current[index];\n if (!el || typeof el.animate !== \"function\") return;\n const animation = el.animate(keyframes, { duration: ms });\n run.anims.add(animation);\n await animation.finished.catch(() => undefined);\n run.anims.delete(animation);\n },\n };\n }, [birds, order, random, look, rest]);\n\n // Glances: two neighbours turn towards each other, hold, and look away.\n React.useEffect(() => {\n if (!running || !glance || order.length < 2) return;\n let timer: ReturnType<typeof setTimeout> | undefined;\n let back: ReturnType<typeof setTimeout> | undefined;\n const next = () => {\n timer = setTimeout(() => {\n const at = Math.floor(random() * (order.length - 1));\n const [a, b] = [order[at]!, order[at + 1]!];\n if (held.current.has(a) || held.current.has(b)) return next();\n look(a, \"right\");\n look(b, \"left\");\n back = setTimeout(() => {\n rest(a, b);\n next();\n }, between(random, GLANCE_HOLD_MS));\n }, between(random, GLANCE_EVERY_MS, tempo));\n };\n next();\n return () => {\n clearTimeout(timer);\n clearTimeout(back);\n };\n }, [running, glance, order, random, tempo, look, rest]);\n\n // The delivery: the pigeon takes its parcel across to the farthest bird, hands it over, and flies back.\n React.useEffect(() => {\n const pigeon = birds.findIndex((b) => b.bird === \"pigeon\");\n if (!running || !courier || pigeon < 0 || birds.length < 2) return;\n let alive = true;\n const heldNow = held.current;\n let timer: ReturnType<typeof setTimeout> | undefined;\n let animation: Animation | undefined;\n const run = { timers: new Set<ReturnType<typeof setTimeout>>(), anims: new Set<Animation>() };\n // The farthest bird from the pigeon, so the parcel crosses the whole stage.\n const from = birds[pigeon]!;\n const target = birds.reduce((far, b, i) => (i !== pigeon && Math.abs(b.x - from.x) > Math.abs(birds[far]!.x - from.x) ? i : far), pigeon === 0 ? 1 : 0);\n const wait = (ms: number) => new Promise<void>((resolve) => (timer = setTimeout(resolve, ms)));\n const trip = async () => {\n // With scenes, the trip waits for the beat in progress and holds the stage while it lasts.\n while (alive && scenes && busy.current === \"scene\") await wait(400);\n if (!alive) return;\n busy.current = \"trip\";\n const el = bodies.current[pigeon];\n const box = stage.current?.getBoundingClientRect();\n if (!el || !box || typeof el.animate !== \"function\") return;\n const to = birds[target]!;\n const side = to.x > from.x ? 1 : -1;\n // It lands beside the receiver, not on it.\n const dx = ((to.x - from.x) / 100) * box.width - side * (to.size / 100) * box.width * 0.55;\n const lift = (from.size / 100) * box.width * 0.35;\n const fly = async (fromX: number, toX: number) => {\n setFlying({ index: pigeon, bank: Math.sign(toX - fromX) });\n animation = el.animate(\n [\n { transform: `translate(${fromX}px, 0)`, easing: \"ease-out\" },\n { transform: `translate(${(fromX + toX) / 2}px, ${-lift}px)`, easing: \"ease-in\", offset: 0.5 },\n { transform: `translate(${toX}px, 0)` },\n ],\n { duration: FLIGHT_MS, fill: \"forwards\" },\n );\n await animation.finished.catch(() => undefined);\n setFlying(null);\n };\n look(target, side > 0 ? \"left\" : \"right\");\n held.current.add(target);\n await fly(0, dx);\n if (!alive) return;\n // The hand-over: the receiver looks at the pigeon, the pigeon hops on the doorstep.\n setPoked((p) => ({ ...p, [pigeon]: true }));\n if (scenes) {\n // …and the parcel changes hands: the receiver takes it and reacts in character, the pigeon flies back light.\n setEmpty((e) => ({ ...e, [pigeon]: true }));\n const reaction = receive(stageFor(run), target, pigeon);\n await wait(HAND_OVER_MS);\n if (!alive) return;\n setPoked((p) => ({ ...p, [pigeon]: false }));\n await reaction;\n } else {\n await wait(HAND_OVER_MS);\n if (!alive) return;\n setPoked((p) => ({ ...p, [pigeon]: false }));\n }\n if (!alive) return;\n look(target, \"up\");\n await fly(dx, 0);\n animation?.cancel();\n setEmpty((e) => ({ ...e, [pigeon]: false }));\n rest(target);\n };\n const schedule = (ms: number) => {\n timer = setTimeout(async () => {\n await trip();\n busy.current = null;\n held.current.delete(target);\n if (alive) schedule(between(random, COURIER_EVERY_MS, tempo));\n }, ms);\n };\n schedule(COURIER_FIRST_MS / tempo);\n return () => {\n alive = false;\n clearTimeout(timer);\n animation?.cancel();\n run.timers.forEach(clearTimeout);\n run.anims.forEach((a) => a.cancel());\n if (scenes) {\n setShown([]);\n setEmpty({});\n heldNow.clear();\n busy.current = null;\n }\n setFlying(null);\n };\n }, [running, courier, birds, random, tempo, scenes, stageFor, look, rest]);\n\n // The scenes: one beat at a time, picked at random from what the flock holds — never the same bird twice in a row, never\n // at a regular beat (short waits, now and then a long pause) — so the minute is never the same twice.\n React.useEffect(() => {\n if (!running || !scenes || birds.length < 1) return;\n let alive = true;\n const heldNow = held.current;\n const run = { timers: new Set<ReturnType<typeof setTimeout>>(), anims: new Set<Animation>() };\n const st = stageFor(run);\n const beats = BEATS.flatMap((beat) => birds.flatMap((b, i) => (b.bird === beat.bird ? [{ beat, index: i }] : [])));\n if (!beats.length) return;\n let last = -1;\n const next = async () => {\n const long = random() < 0.2;\n await st.wait(between(random, long ? SCENE_PAUSE_MS : SCENE_EVERY_MS, tempo));\n while (alive && busy.current === \"trip\") await st.wait(600);\n if (!alive) return;\n const pool = beats.filter((x) => x.index !== last);\n const pick = (pool.length ? pool : beats)[Math.floor(random() * (pool.length ? pool.length : beats.length))]!;\n last = pick.index;\n busy.current = \"scene\";\n // The scene's birds are held, so no glance cuts across it.\n const near = neighbourOf(st, pick.index);\n held.current.add(pick.index);\n if (near !== null) held.current.add(near);\n await pick.beat.run(st, pick.index);\n held.current.delete(pick.index);\n if (near !== null) held.current.delete(near);\n if (busy.current === \"scene\") busy.current = null;\n if (alive) void next();\n };\n void next();\n return () => {\n alive = false;\n run.timers.forEach(clearTimeout);\n run.anims.forEach((a) => a.cancel());\n setShown([]);\n heldNow.clear();\n busy.current = null;\n };\n }, [running, scenes, birds, random, tempo, stageFor]);\n\n // The greeting: the first time the flock is on screen, each bird jumps in turn.\n const greeted = React.useRef(false);\n React.useEffect(() => {\n if (!running || !greet || greeted.current) return;\n greeted.current = true;\n const timers: ReturnType<typeof setTimeout>[] = [];\n order.forEach((index, n) => {\n timers.push(setTimeout(() => setPoked((p) => ({ ...p, [index]: true })), n * GREET_STEP_MS));\n timers.push(setTimeout(() => setPoked((p) => ({ ...p, [index]: false })), n * GREET_STEP_MS + POKE_MS));\n });\n return () => timers.forEach(clearTimeout);\n }, [running, greet, order]);\n\n // The bird the page points at looks up and jumps.\n React.useEffect(() => {\n const index = active ? birds.findIndex((b) => b.bird === active) : -1;\n if (!running || index < 0) return;\n const start = setTimeout(() => {\n look(index, \"up\");\n setPoked((p) => ({ ...p, [index]: true }));\n }, 0);\n const t = setTimeout(() => setPoked((p) => ({ ...p, [index]: false })), POKE_MS);\n return () => {\n clearTimeout(start);\n clearTimeout(t);\n setPoked((p) => ({ ...p, [index]: false }));\n rest(index);\n };\n }, [active, running, birds, look, rest]);\n\n // A bird looks up when you come near, and jumps when you tap it.\n const hover = (index: number, event: React.PointerEvent) => {\n if (!running || !react || event.pointerType !== \"mouse\") return;\n look(index, \"up\");\n };\n const leave = (index: number) => {\n if (!react) return;\n rest(index);\n };\n const tap = (index: number) => {\n if (!running || !react) return;\n look(index, \"up\");\n setPoked((p) => ({ ...p, [index]: true }));\n setTimeout(() => {\n setPoked((p) => ({ ...p, [index]: false }));\n rest(index);\n }, LOOK_BACK_MS);\n };\n\n return (\n <div\n ref={stage}\n aria-hidden\n data-flock=\"\"\n data-running={running ? \"\" : undefined}\n data-motion-scope=\"\"\n className={cn(\"relative w-full\", className)}\n style={{ aspectRatio: String(ratio), containerType: \"inline-size\", ...style }}\n {...props}\n >\n {birds.map((b, i) => (\n <div\n key={`${b.bird}-${i}`}\n ref={(el) => {\n bodies.current[i] = el;\n }}\n data-flock-bird={b.bird}\n className=\"absolute touch-manipulation\"\n style={{ left: `${b.x - b.size / 2}%`, width: `${b.size}%`, top: `calc(${b.y}% - ${b.size * 0.9}cqw)`, aspectRatio: \"1\", pointerEvents: react ? \"auto\" : \"none\" }}\n onPointerEnter={(event) => hover(i, event)}\n onPointerLeave={() => leave(i)}\n onPointerDown={() => tap(i)}\n >\n <Mascot\n bird={b.bird}\n tone={tone}\n life\n look={looks[i]}\n flying={flying?.index === i}\n bank={flying?.index === i ? flying.bank : 0}\n poked={poked[i]}\n carrying={!empty[i]}\n size={120}\n style={{ width: \"100%\", height: \"100%\", display: \"block\", overflow: \"visible\" }}\n />\n {shown\n .filter((x) => x.at === i)\n .map((x) => (\n <Prop key={x.id} shown={x} size={b.size} />\n ))}\n </div>\n ))}\n </div>\n );\n}\n","\"use client\";\n\n// The flock's scenes: what a bird does between the idle motions, each one true to the promise it carries — the owl reads\n// (a book, a leaf turned), the flamingo and the lovebird answer (a speech mark, a reply), the crane steps and bows, the\n// beaver carries a log and taps it, the magpie spots a shiny point and takes it, the duck builds, the falcon scans — and the\n// pigeon's parcel changes hands: the receiver reacts in its own way. A director picks one beat at a time from what the\n// flock holds, with chance in the waits and in the choice, so it never loops the same minute twice. Transform and opacity\n// only (Web Animations on a few small elements, timers between beats); nothing runs off screen or under reduced motion.\nimport * as React from \"react\";\n\nimport type { MascotBird, MascotLook } from \"../mascots\";\nimport { PARCEL } from \"../mascots/geometry\";\n\nexport type PropKind = \"say\" | \"book\" | \"log\" | \"glint\" | \"gift\";\n\n/** A small thing a bird shows for a while: a speech mark, a book, a log, a shiny point, a parcel. */\nexport interface Shown {\n id: number;\n /** Index of the bird it belongs to. */\n at: number;\n kind: PropKind;\n /** How long it stays (ms). */\n ms: number;\n /** The mark of a speech bubble. */\n mark?: string;\n /** Which side it comes from (1: right, -1: left). */\n side?: 1 | -1;\n}\n\n/** What a beat can do on the stage (built by `Flock`; every wait ends when the flock stops). */\nexport interface Stage {\n birds: readonly { bird: MascotBird; x: number; y: number; size: number }[];\n /** Indexes left to right. */\n order: readonly number[];\n random: () => number;\n look: (index: number, to: MascotLook) => void;\n rest: (...indexes: number[]) => void;\n poke: (index: number, ms?: number) => void;\n say: (index: number, mark: string, ms: number) => void;\n show: (index: number, kind: PropKind, ms: number, side?: 1 | -1) => void;\n /** Move a bird's body for a while (transform only). */\n move: (index: number, keyframes: Keyframe[], ms: number) => Promise<void>;\n wait: (ms: number) => Promise<void>;\n}\n\nconst side = (s: Stage, i: number, j: number): 1 | -1 => (s.birds[j]!.x >= s.birds[i]!.x ? 1 : -1);\nconst towards = (s: Stage, i: number, j: number): MascotLook => (side(s, i, j) > 0 ? \"right\" : \"left\");\n/** Where a bird is among its neighbours, left to right: the one beside it (the nearer one when there are two). */\nexport function neighbourOf(s: Stage, i: number): number | null {\n const at = s.order.indexOf(i);\n const near = [s.order[at - 1], s.order[at + 1]].filter((n): n is number => n !== undefined);\n if (!near.length) return null;\n const gap = (n: number) => Math.abs(s.birds[n]!.x - s.birds[i]!.x);\n return near.reduce((a, b) => (gap(a) <= gap(b) ? a : b), near[0]!);\n}\n\n// @fixed: the choreography's pace — how long each beat lasts. A rhythm to the eye, not a business parameter.\nconst BOOK_MS = 4800;\nconst LOG_MS = 3800;\nconst GLINT_MS = 3400;\nconst SAY_MS = 1500;\n\n/** The owl reads: it looks down at its book, a leaf turns, and it turns another. A neighbour glances over. */\nasync function read(s: Stage, i: number) {\n const j = neighbourOf(s, i);\n s.look(i, \"left\");\n s.show(i, \"book\", BOOK_MS);\n await s.wait(BOOK_MS * 0.45);\n if (j !== null && s.random() < 0.5) {\n s.look(j, towards(s, j, i));\n await s.wait(1100);\n s.rest(j);\n }\n await s.wait(BOOK_MS * 0.5);\n s.rest(i);\n}\n\n/** The flamingo or the lovebird speaks; its neighbour listens, then answers, and they both light up. */\nasync function chat(s: Stage, i: number) {\n const j = neighbourOf(s, i);\n s.look(i, j === null ? \"up\" : towards(s, i, j));\n s.say(i, \"…\", SAY_MS);\n await s.wait(SAY_MS * 0.6);\n if (j === null) {\n await s.wait(SAY_MS * 0.6);\n s.rest(i);\n return;\n }\n s.look(j, towards(s, j, i));\n await s.wait(SAY_MS * 0.7);\n s.say(j, s.random() < 0.5 ? \"!\" : \"?\", SAY_MS);\n s.poke(j);\n await s.wait(SAY_MS * 0.5);\n s.poke(i);\n await s.wait(SAY_MS * 0.7);\n s.rest(i, j);\n}\n\n/** The crane steps out of the line, bows to its neighbour, and steps back. */\nasync function bow(s: Stage, i: number) {\n const j = neighbourOf(s, i);\n const dir = j === null ? 1 : side(s, i, j);\n const step = `${(s.birds[i]!.size * 0.14 * dir).toFixed(2)}cqw`;\n const lean = `rotate(${dir * 11}deg)`;\n const at = (x: string, r: string) => `translateX(${x}) ${r}`;\n const run = s.move(\n i,\n [\n { transform: at(\"0cqw\", \"rotate(0deg)\"), easing: \"ease-in-out\" },\n { transform: at(step, \"rotate(0deg)\"), offset: 0.22, easing: \"ease-in-out\" },\n { transform: at(step, lean), offset: 0.42, easing: \"ease-in-out\" },\n { transform: at(step, lean), offset: 0.6, easing: \"ease-in-out\" },\n { transform: at(step, \"rotate(0deg)\"), offset: 0.74, easing: \"ease-in-out\" },\n { transform: at(\"0cqw\", \"rotate(0deg)\") },\n ],\n 3800,\n );\n if (j !== null) {\n await s.wait(1700);\n s.look(j, towards(s, j, i));\n await s.wait(1200);\n s.poke(j);\n await s.wait(500);\n s.rest(j);\n }\n await run;\n}\n\n/** The beaver brings a log, taps it into place three times, and takes it away. */\nasync function tap(s: Stage, i: number) {\n s.show(i, \"log\", LOG_MS, s.birds[i]!.x > 50 ? 1 : -1);\n await s.wait(LOG_MS * 0.3);\n for (let n = 0; n < 3; n++) {\n s.poke(i, 420);\n await s.wait(520);\n }\n await s.wait(LOG_MS * 0.3);\n}\n\n/** The magpie sees something shiny on the ground, looks, hops, and takes it. */\nasync function shine(s: Stage, i: number) {\n const dir: 1 | -1 = s.birds[i]!.x > 50 ? -1 : 1;\n const to: MascotLook = dir > 0 ? \"right\" : \"left\";\n s.show(i, \"glint\", GLINT_MS, dir);\n await s.wait(GLINT_MS * 0.28);\n s.look(i, to);\n await s.wait(GLINT_MS * 0.3);\n s.poke(i);\n await s.wait(GLINT_MS * 0.25);\n s.look(i, \"up\");\n await s.wait(GLINT_MS * 0.2);\n s.rest(i);\n}\n\n/** The duck builds: quick nods in a burst, like typing a block into place. */\nasync function build(s: Stage, i: number) {\n for (let n = 0; n < 4; n++) {\n s.poke(i, 300);\n await s.wait(380);\n }\n}\n\n/** The falcon watches: a slow scan, left then right, and a look up. */\nasync function scan(s: Stage, i: number) {\n for (const to of [\"left\", \"up\", \"right\"] as const) {\n s.look(i, to);\n await s.wait(1100);\n }\n s.rest(i);\n}\n\n/** The pigeon's parcel has just been handed over: the receiver reacts in its own way (about 2 s). */\nexport async function receive(s: Stage, i: number, from: number) {\n const bird = s.birds[i]!.bird;\n s.look(i, towards(s, i, from));\n s.show(i, \"gift\", 2400);\n await s.wait(350);\n if (bird === \"crane\") await bow(s, i);\n else if (bird === \"magpie\") {\n s.poke(i);\n await s.wait(700);\n s.show(i, \"glint\", GLINT_MS * 0.6, side(s, i, from));\n await s.wait(1200);\n } else if (bird === \"beaver\" || bird === \"duck\") {\n s.poke(i, 420);\n await s.wait(520);\n s.poke(i, 420);\n await s.wait(900);\n } else if (bird === \"owl\") {\n s.say(i, \"?\", SAY_MS);\n await s.wait(900);\n s.poke(i);\n await s.wait(700);\n } else {\n s.say(i, \"!\", SAY_MS);\n s.poke(i);\n await s.wait(1500);\n }\n}\n\nexport interface Beat {\n id: string;\n bird: MascotBird;\n run: (s: Stage, index: number) => Promise<void>;\n}\n\n/** What each bird of the flock can do on its own (the pigeon's trip is the flock's courier). */\nexport const BEATS: readonly Beat[] = [\n { id: \"read\", bird: \"owl\", run: read },\n { id: \"chat\", bird: \"flamingo\", run: chat },\n { id: \"chat\", bird: \"lovebird\", run: chat },\n { id: \"bow\", bird: \"crane\", run: bow },\n { id: \"tap\", bird: \"beaver\", run: tap },\n { id: \"shine\", bird: \"magpie\", run: shine },\n { id: \"build\", bird: \"duck\", run: build },\n { id: \"scan\", bird: \"falcon\", run: scan },\n];\n\n// ─── The small things a bird shows ───────────────────────────────────────────────────────────────\n\nconst PAPER = \"var(--kz-surface-1)\";\nconst INK = \"var(--kz-text-primary)\";\nconst LINE = \"var(--kz-border-strong, currentColor)\";\n\n/** One thing, in its own frame: it comes in, stays for `ms`, and goes (opacity and transform only). */\nfunction lifeFrames(from: string, to: string): Keyframe[] {\n return [\n { opacity: 0, transform: from, offset: 0 },\n { opacity: 1, transform: \"none\", offset: 0.14 },\n { opacity: 1, transform: \"none\", offset: 0.84 },\n { opacity: 0, transform: to, offset: 1 },\n ];\n}\n\nconst LEAF: Keyframe[] = [\n { transform: \"scaleX(1)\", offset: 0 },\n { transform: \"scaleX(1)\", offset: 0.25 },\n { transform: \"scaleX(-1)\", offset: 0.38 },\n { transform: \"scaleX(1)\", offset: 0.39 },\n { transform: \"scaleX(1)\", offset: 0.62 },\n { transform: \"scaleX(-1)\", offset: 0.75 },\n { transform: \"scaleX(-1)\", offset: 1 },\n];\n\nexport function Prop({ shown, size }: { shown: Shown; size: number }) {\n const ref = React.useRef<HTMLDivElement>(null);\n const leaf = React.useRef<HTMLDivElement>(null);\n const dir = shown.side ?? 1;\n React.useEffect(() => {\n const el = ref.current;\n if (!el || typeof el.animate !== \"function\") return;\n const from: Record<PropKind, [string, string]> = {\n say: [\"translateY(30%) scale(.5)\", \"translateY(-12%) scale(.9)\"],\n book: [\"translateY(40%) scale(.8)\", \"translateY(20%) scale(.9)\"],\n log: [`translateX(${190 * dir}%)`, `translateX(${190 * dir}%)`],\n glint: [\"scale(.2) rotate(-60deg)\", `translate(${-90 * dir}%, -170%) scale(.2) rotate(60deg)`],\n gift: [\"translateY(40%) scale(.3)\", \"translateY(-30%) scale(1.4)\"],\n };\n const [a, b] = from[shown.kind];\n const animations = [el.animate(lifeFrames(a, b), { duration: shown.ms, fill: \"both\", easing: \"ease-out\" })];\n if (shown.kind === \"book\" && leaf.current) animations.push(leaf.current.animate(LEAF, { duration: shown.ms, fill: \"both\", easing: \"ease-in-out\" }));\n if (shown.kind === \"glint\") animations.push(el.firstElementChild!.animate([{ transform: \"scale(1)\" }, { transform: \"scale(1.35)\" }, { transform: \"scale(1)\" }], { duration: 700, iterations: Math.ceil(shown.ms / 700), easing: \"ease-in-out\" }));\n return () => animations.forEach((x) => x.cancel());\n }, [shown, dir]);\n\n const unit = (n: number) => `calc(${size}cqw * ${n})`;\n const base: React.CSSProperties = { position: \"absolute\", pointerEvents: \"none\", opacity: 0 };\n\n if (shown.kind === \"say\")\n return (\n <div ref={ref} data-flock-prop=\"say\" style={{ ...base, left: \"58%\", top: \"-6%\", width: unit(0.34), height: unit(0.24), transformOrigin: \"20% 100%\" }}>\n <span\n style={{ position: \"absolute\", inset: 0, display: \"grid\", placeItems: \"center\", background: PAPER, border: `1.5px solid ${LINE}`, borderRadius: \"999px\", color: INK, font: `600 ${unit(0.17)}/1 var(--font-mono, ui-monospace, monospace)` }}\n >\n {shown.mark ?? \"…\"}\n </span>\n <span style={{ position: \"absolute\", left: \"14%\", bottom: \"-12%\", width: unit(0.07), height: unit(0.07), background: PAPER, borderRight: `1.5px solid ${LINE}`, borderBottom: `1.5px solid ${LINE}`, transform: \"rotate(45deg)\" }} />\n </div>\n );\n\n if (shown.kind === \"book\")\n return (\n <div ref={ref} data-flock-prop=\"book\" style={{ ...base, left: \"17%\", bottom: \"-2%\", width: \"66%\", height: unit(0.2), transformOrigin: \"50% 100%\" }}>\n {[0, 1].map((n) => (\n <span key={n} style={{ position: \"absolute\", top: 0, bottom: 0, [n ? \"right\" : \"left\"]: 0, width: \"50%\", background: `repeating-linear-gradient(${PAPER} 0 18%, ${LINE} 18% 24%)`, border: `1.5px solid ${LINE}`, borderRadius: n ? \"0 3px 3px 0\" : \"3px 0 0 3px\" }} />\n ))}\n <div ref={leaf} style={{ position: \"absolute\", top: 0, bottom: 0, left: \"50%\", width: \"50%\", transformOrigin: \"0 50%\", background: PAPER, border: `1.5px solid ${LINE}`, borderRadius: \"0 3px 3px 0\" }} />\n </div>\n );\n\n if (shown.kind === \"log\")\n return (\n <div ref={ref} data-flock-prop=\"log\" style={{ ...base, left: \"22%\", bottom: \"-3%\", width: \"56%\", height: unit(0.17), background: PARCEL[2], borderRadius: \"999px\", boxShadow: `inset -${unit(0.04)} 0 0 ${PARCEL[1]}` }}>\n <span style={{ position: \"absolute\", left: 0, top: 0, bottom: 0, aspectRatio: \"1\", borderRadius: \"50%\", background: `radial-gradient(${PARCEL[0]} 0 25%, ${PARCEL[1]} 26% 55%, ${PARCEL[2]} 56%)`, border: `1px solid ${PARCEL[2]}` }} />\n </div>\n );\n\n if (shown.kind === \"glint\")\n return (\n <div ref={ref} data-flock-prop=\"glint\" style={{ ...base, [dir > 0 ? \"left\" : \"right\"]: \"94%\", bottom: \"2%\", width: unit(0.2), height: unit(0.2) }}>\n <span style={{ position: \"absolute\", inset: 0, background: PARCEL[0], clipPath: \"polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%)\" }} />\n </div>\n );\n\n return (\n <div ref={ref} data-flock-prop=\"gift\" style={{ ...base, left: \"58%\", top: \"2%\", width: unit(0.26), height: unit(0.22), background: PARCEL[0], border: `1.5px solid ${PARCEL[2]}`, borderRadius: 2 }}>\n <span style={{ position: \"absolute\", left: \"44%\", top: 0, bottom: 0, width: \"12%\", background: PARCEL[2] }} />\n <span style={{ position: \"absolute\", top: \"42%\", left: 0, right: 0, height: \"16%\", background: PARCEL[2] }} />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAMA,YAAYA,YAAW;;;ACEvB,YAAY,WAAW;AAsQjB,SACE,KADF;AAjON,IAAM,OAAO,CAAC,GAAU,GAAW,MAAuB,EAAE,MAAM,CAAC,EAAG,KAA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AAA;AAAA,QA3BE,GAAG,EAAE,IAAI,IAAI,CAAC;AAAA,MA4BrB,CACD;AAAA;AAAA,EACH;AAEJ;","names":["React","jsx","jsxs","side","tap"]}
package/dist/index.js CHANGED
@@ -1,4 +1,7 @@
1
1
  "use client";
2
+ import {
3
+ cx
4
+ } from "./chunk-6ISW63JI.js";
2
5
  import {
3
6
  MotionObserver,
4
7
  RotatingWord
@@ -18,9 +21,6 @@ import {
18
21
  neutral,
19
22
  useIds
20
23
  } from "./chunk-B2HS5EAH.js";
21
- import {
22
- cx
23
- } from "./chunk-6ISW63JI.js";
24
24
 
25
25
  // src/marks/wu-sama-geometry.ts
26
26
  import { marks } from "@krizaka/tokens/native";