@wildo-ai/presets-components-3d 1.1.9 → 1.1.11

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 (45) hide show
  1. package/dist/esm/focal-plane/focal-plane-depth-axis.d.ts +17 -0
  2. package/dist/esm/focal-plane/focal-plane-depth-axis.d.ts.map +1 -0
  3. package/dist/esm/focal-plane/focal-plane-depth-axis.js +59 -0
  4. package/dist/esm/focal-plane/focal-plane-depth-axis.js.map +1 -0
  5. package/dist/esm/focal-plane/focal-plane-shell-container.d.ts.map +1 -1
  6. package/dist/esm/focal-plane/focal-plane-shell-container.js +10 -119
  7. package/dist/esm/focal-plane/focal-plane-shell-container.js.map +1 -1
  8. package/dist/esm/focal-plane/focal-plane-stylesheet.d.ts +2 -9
  9. package/dist/esm/focal-plane/focal-plane-stylesheet.d.ts.map +1 -1
  10. package/dist/esm/focal-plane/focal-plane-stylesheet.js +32 -80
  11. package/dist/esm/focal-plane/focal-plane-stylesheet.js.map +1 -1
  12. package/dist/esm/focal-plane/focal-plane-vanishing-point.d.ts +27 -0
  13. package/dist/esm/focal-plane/focal-plane-vanishing-point.d.ts.map +1 -0
  14. package/dist/esm/focal-plane/focal-plane-vanishing-point.js +21 -0
  15. package/dist/esm/focal-plane/focal-plane-vanishing-point.js.map +1 -0
  16. package/dist/esm/index.d.ts +0 -1
  17. package/dist/esm/index.d.ts.map +1 -1
  18. package/dist/esm/index.js +0 -1
  19. package/dist/esm/index.js.map +1 -1
  20. package/dist/esm/layout/layout-3d-definition.d.ts +5 -7
  21. package/dist/esm/layout/layout-3d-definition.d.ts.map +1 -1
  22. package/dist/esm/layout/layout-3d-definition.js +1 -1
  23. package/dist/esm/layout/layout-3d-definition.js.map +1 -1
  24. package/dist/esm/layout-3d-main-container.d.ts +13 -18
  25. package/dist/esm/layout-3d-main-container.d.ts.map +1 -1
  26. package/dist/esm/layout-3d-main-container.js +7 -15
  27. package/dist/esm/layout-3d-main-container.js.map +1 -1
  28. package/dist/esm/register-3d-layout.d.ts +8 -4
  29. package/dist/esm/register-3d-layout.d.ts.map +1 -1
  30. package/dist/esm/register-3d-layout.js +16 -36
  31. package/dist/esm/register-3d-layout.js.map +1 -1
  32. package/package.json +3 -3
  33. package/dist/esm/focal-plane/use-pane-depth.d.ts +0 -20
  34. package/dist/esm/focal-plane/use-pane-depth.d.ts.map +0 -1
  35. package/dist/esm/focal-plane/use-pane-depth.js +0 -162
  36. package/dist/esm/focal-plane/use-pane-depth.js.map +0 -1
  37. package/dist/esm/focal-plane/use-shared-vanishing-point.d.ts +0 -35
  38. package/dist/esm/focal-plane/use-shared-vanishing-point.d.ts.map +0 -1
  39. package/dist/esm/focal-plane/use-shared-vanishing-point.js +0 -86
  40. package/dist/esm/focal-plane/use-shared-vanishing-point.js.map +0 -1
  41. package/dist/esm/layout/shell-layout-placement.d.ts +0 -26
  42. package/dist/esm/layout/shell-layout-placement.d.ts.map +0 -1
  43. package/dist/esm/layout/shell-layout-placement.js +0 -18
  44. package/dist/esm/layout/shell-layout-placement.js.map +0 -1
  45. package/dist/tsconfig.build.tsbuildinfo +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"focal-plane-stylesheet.js","sourceRoot":"","sources":["../../../../src/focal-plane/focal-plane-stylesheet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,IAAI,GAAG,oBAAoB,CAAC;AAClC,MAAM,OAAO,GAAG,yBAAyB,WAAW,CAAC,OAAO,IAAI,CAAC;AACjE;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,OAAO,gDAAgD,OAAO,0BAA0B,CAAC;AACrI,0GAA0G;AAC1G,MAAM,KAAK,GAAG,CAAC,cAAc,CAAC,OAAO,EAAE,cAAc,CAAC,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,aAAa,CAAC,SAAS,EAAE,CAAC;YACpH,SAAS,GAAG,IAAI,aAAa,EAAE,CAAC;YAChC,SAAS,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;YACvC,GAAG,CAAC,kBAAkB,GAAG,CAAC,GAAG,GAAG,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC;QAClE,CAAC;aAAM,CAAC;YACN,MAAM,KAAK,GAAG,GAAG,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;YACzC,KAAK,CAAC,OAAO,CAAC,UAAU,GAAG,EAAE,CAAC;YAC9B,KAAK,CAAC,WAAW,GAAG,eAAe,CAAC;YACpC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC;IACD,OAAO,GAAG,EAAE;QACV,KAAK,IAAI,CAAC,CAAC;QACX,IAAI,KAAK,GAAG,CAAC;YAAE,OAAO;QACtB,IAAI,SAAS;YAAE,GAAG,CAAC,kBAAkB,GAAG,GAAG,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC;QACtG,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,EAAE,MAAM,EAAE,CAAC;QAC5D,SAAS,GAAG,IAAI,CAAC;IACnB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { ShellRegion } from '@wildo-ai/presets-components-models';\nimport { NavigationZone } from '@wildo-ai/saas-frontend-lib';\n\n/**\n * The focal plane's stylesheet (#2049), scoped to `[data-focal-plane]`, so it touches nothing outside the layout.\n *\n * ## One still camera, without a nested 3D context\n *\n * Every object carries its OWN `perspective(d) translate3d(0, 0, z)`, with its `transform-origin` set (per element, by\n * `useSharedVanishingPoint`) to the one vanishing point of the stage. That is the projection of a single still camera,\n * and it needs no `transform-style: preserve-3d` ancestor — which matters, because a nested 3D context disables\n * `backdrop-filter`, and the glass windows are made of it.\n *\n * ## What counts as an object\n *\n * - the shell panels this layout wraps (`[data-fp-object]`);\n * - each navigation pane inside the content region, by the engine's own markers: `[data-content-area]` (the static and\n * single-zone branches) and the resizable panel `[data-panel-id^=\"nav-\"]` (NOT its inner `[data-content-area]`, which\n * the panel's inline `overflow: hidden` would clip).\n *\n * Depth is a custom property (`--fp-z`); states set it, and the transform reads it, so rules compose instead of fighting\n * over `transform`.\n *\n * ## Why a constructable stylesheet\n *\n * It is installed through `document.adoptedStyleSheets`, which a content security policy without `'unsafe-inline'`\n * does not block, where a `<style>` element would be.\n */\nconst ROOT = '[data-focal-plane]';\nconst CONTENT = `[data-component-area=\"${ShellRegion.CONTENT}\"]`;\n/**\n * The navigation panes, by the engine's markers: the zone itself in the static and single-zone branches, the panel in\n * the resizable branch — never the zone INSIDE a panel, which would be moved twice.\n */\nexport const FOCAL_PLANE_PANE_SELECTOR = `${CONTENT} [data-content-area]:not([data-panel-id] *), ${CONTENT} [data-panel-id^=\"nav-\"]`;\n/** The zone names the navigation state focuses, and the markers each one is found by in either branch. */\nconst ZONES = [NavigationZone.PRIMARY, NavigationZone.SECONDARY, NavigationZone.COMPANION] as const;\nconst zoneMarker = (zone: (typeof ZONES)[number]): string => `:is([data-content-area=\"${zone}\"], [data-panel-id=\"nav-${zone}\"])`;\nconst VISIBLE_PANE = `:is(${FOCAL_PLANE_PANE_SELECTOR}):not([data-zone-hidden])`;\n/** Two panes or more are side by side (the other panes are siblings in both branches). */\nconst SPLIT = `${CONTENT}:has(${VISIBLE_PANE} ~ ${VISIBLE_PANE})`;\nconst PANES = `:is(${FOCAL_PLANE_PANE_SELECTOR})`;\nconst OBJECTS = `:is([data-fp-object], ${FOCAL_PLANE_PANE_SELECTOR})`;\n/**\n * The popups the focal plane moves, by the stable `data-slot` of their portalled content (Radix `data-state` on the\n * same element). Lifting popups carry the CSS variable Radix publishes as their trigger-relative origin.\n */\nconst POPUPS = {\n lift: [\n ['dropdown-menu-content', '--radix-dropdown-menu-content-transform-origin'],\n ['dropdown-menu-sub-content', '--radix-dropdown-menu-content-transform-origin'],\n ['context-menu-content', '--radix-context-menu-content-transform-origin'],\n ['context-menu-sub-content', '--radix-context-menu-content-transform-origin'],\n ['popover-content', '--radix-popover-content-transform-origin'],\n ['hover-card-content', '--radix-hover-card-content-transform-origin'],\n ['tooltip-content', '--radix-tooltip-content-transform-origin'],\n ['select-content', '--radix-select-content-transform-origin'],\n ['menubar-content', '--radix-menubar-content-transform-origin'],\n ['menubar-sub-content', '--radix-menubar-content-transform-origin'],\n ],\n rise: ['dialog-content', 'alert-dialog-content'],\n} as const;\n/**\n * A MODAL popup is open: a dialog, an alert dialog, a sheet or a drawer, by their content SLOT. Not by `role=\"dialog\"`:\n * a Radix popover's content carries that role too (date pickers, linked-record pickers, the notification centre), and\n * opening one must not step the form you are editing back. Not by `body[data-scroll-locked]` either, which dropdown\n * and context menus also set.\n */\nconst MODAL_SLOTS = ['dialog-content', 'alert-dialog-content', 'sheet-content', 'drawer-content'] as const;\nconst MODAL_OPEN = `:has([data-shell-overlay-layer] :is(${MODAL_SLOTS.map((slot) => `[data-slot=\"${slot}\"]`).join(', ')})[data-state=\"open\"])`;\n\n/** The modal content slots, exported for the tests that pin what counts as modal. */\nexport const FOCAL_PLANE_MODAL_SLOTS: readonly string[] = MODAL_SLOTS;\n\nexport const FOCAL_PLANE_CSS = `\n/* Positioned, never isolated: an isolated root would be one stacking context, and anything positioned outside the\n shell with a lower z-index (a consent prompt) would paint over the shell's own dialogs (#1830). */\n${ROOT} { position: relative; height: 100vh; width: 100vw; overflow: hidden; background: var(--background); }\n\n/* The ambient background: soft fields of the theme's own colours, drifting very slowly. */\n${ROOT} .fp-backdrop { position: absolute; inset: -20%; z-index: 0; pointer-events: none; }\n${ROOT} .fp-backdrop i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.8; }\n${ROOT} .fp-backdrop .fp-a { width: 58%; height: 62%; left: 6%; top: 4%; background: radial-gradient(closest-side, color-mix(in oklab, var(--primary) 38%, var(--background)), transparent); animation: fp-drift-a 48s ease-in-out infinite alternate; }\n${ROOT} .fp-backdrop .fp-b { width: 52%; height: 58%; right: 4%; top: 30%; background: radial-gradient(closest-side, color-mix(in oklab, var(--accent, var(--primary)) 30%, var(--background)), transparent); animation: fp-drift-b 61s ease-in-out infinite alternate; }\n${ROOT} .fp-backdrop .fp-c { width: 46%; height: 50%; left: 34%; bottom: 0; background: radial-gradient(closest-side, color-mix(in oklab, var(--primary) 22%, var(--foreground) 8%), transparent); animation: fp-drift-c 55s ease-in-out infinite alternate; }\n@keyframes fp-drift-a { to { transform: translate(9%, 7%) scale(1.08); } }\n@keyframes fp-drift-b { to { transform: translate(-8%, -6%) scale(0.94); } }\n@keyframes fp-drift-c { to { transform: translate(-6%, -9%) scale(1.1); } }\n\n/* The arrangement: floating windows with a margin and gaps, never edge to edge. */\n${ROOT} .fp-grid { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; gap: 12px; padding: 14px; }\n${ROOT} .fp-row { display: flex; gap: 12px; min-height: 0; min-width: 0; }\n${ROOT} .fp-middle { flex: 1; }\n${ROOT} .fp-column { flex: 1; display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; }\n${ROOT} .fp-content { flex: 1; min-height: 0; min-width: 0; position: relative; display: flex; flex-direction: column; }\n${ROOT} [data-fp-object]:empty { display: none; }\n${ROOT} [data-fp-object] { position: relative; display: flex; min-height: 0; min-width: 0; }\n${ROOT} [data-fp-object] > * { flex: 1; min-width: 0; min-height: 0; }\n\n/* Every object: seen through the one still camera, at its depth. */\n${ROOT} ${OBJECTS} {\n transform-origin: var(--fp-ox, 50%) var(--fp-oy, 50%);\n transform: perspective(var(--fp-distance)) translate3d(0, 0, var(--fp-z, 0px));\n filter: var(--fp-filter, none);\n transition: transform var(--fp-motion) var(--fp-ease), filter var(--fp-motion) var(--fp-ease), box-shadow var(--fp-motion) var(--fp-ease);\n}\n\n/* Glass: the theme's card colour, translucent, over the background blurred through it. */\n${ROOT} :is([data-fp-object=\"shell\"], ${FOCAL_PLANE_PANE_SELECTOR}) {\n background: color-mix(in oklab, var(--card, var(--background)) var(--fp-glass), transparent);\n -webkit-backdrop-filter: blur(26px) saturate(1.5);\n backdrop-filter: blur(26px) saturate(1.5);\n border: 1px solid color-mix(in oklab, var(--border) 55%, transparent);\n border-radius: 14px;\n box-shadow: 0 18px 44px -22px rgb(0 0 0 / 0.30), 0 1px 3px rgb(0 0 0 / 0.05);\n}\n${ROOT} ${CONTENT} { background: transparent; }\n${ROOT} ${CONTENT} :is([data-content-area=\"${NavigationZone.SECONDARY}\"], [data-content-area=\"${NavigationZone.COMPANION}\"]):not([data-panel-id] *) { margin-left: 12px; }\n\n/* Side by side, the pane you work in rests on the focal plane; every other pane steps back and dims. The focused\n zone comes from the navigation state, written on the root as data-fp-focus. Clicking a pane focuses it (the\n engine does that), which brings it forward. */\n${ZONES.map((zone) => `${ROOT}[data-fp-focus=\"${zone}\"] ${SPLIT} ${VISIBLE_PANE}:not(${zoneMarker(zone)})`).join(', ')} {\n --fp-z: calc(var(--fp-step) * -0.55);\n --fp-filter: brightness(calc(1 - var(--fp-dim) * 0.55)) saturate(calc(1 - var(--fp-dim) * 0.5)) blur(calc(var(--fp-recede-blur) * 0.55));\n}\n\n/* A side pane arrives from depth when it opens. */\n${ROOT} ${CONTENT} :is(${zoneMarker(NavigationZone.SECONDARY)}, ${zoneMarker(NavigationZone.COMPANION)}):is(${FOCAL_PLANE_PANE_SELECTOR}) {\n animation: fp-pane-arrive var(--fp-motion) var(--fp-ease);\n}\n@keyframes fp-pane-arrive {\n from { transform: perspective(var(--fp-distance)) translate3d(0, 0, calc(var(--fp-step) * -1.2)); opacity: 0; }\n}\n\n/* Ghosts: a discarded pane flying away, and the still image of the panes an expanded pane stands in front of. */\n${ROOT} .fp-ghosts { position: absolute; inset: 0; z-index: 0; pointer-events: none; }\n${ROOT} .fp-ghosts-front { z-index: 2; }\n${ROOT} .fp-ghost {\n position: absolute; box-sizing: border-box; overflow: hidden;\n transform-origin: var(--fp-ox) var(--fp-oy);\n transform: perspective(var(--fp-distance)) translate3d(0, 0, var(--fp-z, 0px));\n filter: var(--fp-filter, none);\n transition: transform var(--fp-motion) var(--fp-ease), filter var(--fp-motion) var(--fp-ease), opacity var(--fp-motion) var(--fp-ease);\n background: color-mix(in oklab, var(--card, var(--background)) var(--fp-glass), transparent);\n border: 1px solid color-mix(in oklab, var(--border) 55%, transparent);\n border-radius: 14px;\n box-shadow: 0 18px 44px -22px rgb(0 0 0 / 0.30);\n}\n\n/* The shell panel under the pointer rises toward the camera; its items zoom a little. */\n${ROOT} [data-fp-object=\"shell\"]:hover { --fp-z: var(--fp-hover-lift); }\n${ROOT} [data-fp-object=\"shell\"] :is(button, a):not(:disabled) { transition: transform 180ms var(--fp-ease); }\n${ROOT} [data-fp-object=\"shell\"] :is(button, a):not(:disabled):hover { transform: scale(1.045); }\n\n/* Behind a modal popup, everything steps back, dims and blurs lightly. A menu is not modal: it only lifts. */\n${ROOT}${MODAL_OPEN} ${OBJECTS} {\n --fp-z: calc(var(--fp-step) * -0.6);\n --fp-filter: brightness(calc(1 - var(--fp-dim) * 0.6)) saturate(0.9) blur(var(--fp-modal-blur));\n}\n\n/* Popups are objects too. Their recipe animations (tw-animate's enter/exit) are replaced by depth KEYFRAMES —\n keyframes, because the overlay library keeps a closing popup mounted only until its exit ANIMATION ends; a\n transition would be cut off. Each popup rests at its true size: depth shows while it travels.\n - A menu, popover or tooltip lifts off its trigger: the library publishes the trigger point as the transform\n origin, and perspective() grows the popup out of it.\n - A dialog (the command palette is one) rises from depth to the focal plane.\n - A sheet arrives from in front of the plane and leaves back into depth.\n Drawers and toasts keep their own motion: their libraries position and stack them with transforms. */\n${POPUPS.lift.map(([slot, origin]) => `${ROOT} [data-shell-overlay-layer] [data-slot=\"${slot}\"] { transform-origin: var(${origin}); }`).join('\\n')}\n${ROOT} [data-shell-overlay-layer] :is(${POPUPS.lift.map(([slot]) => `[data-slot=\"${slot}\"]`).join(', ')}):is([data-state=\"open\"], [data-state=\"delayed-open\"], [data-state=\"instant-open\"]) { animation: fp-lift-in calc(var(--fp-motion) * 0.6) var(--fp-ease) both; }\n${ROOT} [data-shell-overlay-layer] :is(${POPUPS.lift.map(([slot]) => `[data-slot=\"${slot}\"]`).join(', ')})[data-state=\"closed\"] { animation: fp-lift-out calc(var(--fp-motion) * 0.45) var(--fp-ease) both; }\n${ROOT} [data-shell-overlay-layer] :is(${POPUPS.rise.map((slot) => `[data-slot=\"${slot}\"]`).join(', ')})[data-state=\"open\"] { animation: fp-rise-in var(--fp-motion) var(--fp-ease) both; }\n${ROOT} [data-shell-overlay-layer] :is(${POPUPS.rise.map((slot) => `[data-slot=\"${slot}\"]`).join(', ')})[data-state=\"closed\"] { animation: fp-rise-out calc(var(--fp-motion) * 0.7) var(--fp-ease) both; }\n${ROOT} [data-shell-overlay-layer] [data-slot=\"sheet-content\"][data-state=\"open\"] { animation: fp-arrive-in var(--fp-motion) var(--fp-ease) both; }\n${ROOT} [data-shell-overlay-layer] [data-slot=\"sheet-content\"][data-state=\"closed\"] { animation: fp-arrive-out calc(var(--fp-motion) * 0.7) var(--fp-ease) both; }\n/* Popups are glass, a little more opaque than windows (they carry text you act on at once). Tooltips keep their own\n inverse colours. */\n${ROOT} [data-shell-overlay-layer] :is(${[...POPUPS.lift.filter(([slot]) => slot !== 'tooltip-content').map(([slot]) => slot), ...POPUPS.rise, 'sheet-content'].map((slot) => `[data-slot=\"${slot}\"]`).join(', ')}) {\n background: color-mix(in oklab, var(--popover, var(--card, var(--background))) calc(var(--fp-glass) + 26%), transparent);\n -webkit-backdrop-filter: blur(24px) saturate(1.5);\n backdrop-filter: blur(24px) saturate(1.5);\n border-color: color-mix(in oklab, var(--border) 60%, transparent);\n}\n@keyframes fp-lift-in { from { transform: perspective(var(--fp-distance)) translate3d(0, 0, calc(var(--fp-step) * -0.35)); opacity: 0; } to { transform: none; opacity: 1; } }\n@keyframes fp-lift-out { from { transform: none; opacity: 1; } to { transform: perspective(var(--fp-distance)) translate3d(0, 0, calc(var(--fp-step) * -0.35)); opacity: 0; } }\n@keyframes fp-rise-in { from { transform: perspective(var(--fp-distance)) translate3d(0, 0, calc(var(--fp-step) * -1.4)); opacity: 0; } to { transform: none; opacity: 1; } }\n@keyframes fp-rise-out { from { transform: none; opacity: 1; } to { transform: perspective(var(--fp-distance)) translate3d(0, 0, calc(var(--fp-step) * -1.4)); opacity: 0; } }\n@keyframes fp-arrive-in { from { transform: perspective(var(--fp-distance)) translate3d(0, 0, calc(var(--fp-step) * 0.9)); opacity: 0; } to { transform: none; opacity: 1; } }\n@keyframes fp-arrive-out { from { transform: none; opacity: 1; } to { transform: perspective(var(--fp-distance)) translate3d(0, 0, calc(var(--fp-step) * -0.5)); opacity: 0; } }\n\n/* The modal scrim: in the focal plane, stepping back and the light blur above ARE the scrim, so the engine's dark\n overlay (and its own backdrop blur) would double it into a heavy grey. Keep the overlay element (it still catches\n the outside click), just transparent. */\n${ROOT} [data-shell-overlay-layer] :is([data-slot=\"dialog-overlay\"], [data-slot=\"alert-dialog-overlay\"], [data-slot=\"sheet-overlay\"], [data-slot=\"drawer-overlay\"]) {\n background: transparent;\n -webkit-backdrop-filter: none;\n backdrop-filter: none;\n}\n\n@media (prefers-reduced-motion: reduce) {\n /* !important: the motion rules above are more specific (the drifting fields, the item zoom), and the reader's\n setting must win over every one of them. */\n ${ROOT} ${OBJECTS}, ${ROOT} .fp-ghost, ${ROOT} [data-fp-object=\"shell\"] :is(button, a), ${ROOT} [data-shell-overlay-layer] [data-slot] { transition-duration: 0ms !important; animation: none !important; }\n ${ROOT} .fp-backdrop i { animation: none !important; }\n}\n`;\n\nlet installed: CSSStyleSheet | null = null;\nlet users = 0;\n\n/**\n * Installs the stylesheet while at least one focal-plane layout is mounted, and removes it when the last one unmounts.\n * Returns the release function. Falls back to a `<style>` element where constructable stylesheets are missing.\n */\nexport function installFocalPlaneStylesheet(doc: Document = document): () => void {\n users += 1;\n if (users === 1) {\n if ('adoptedStyleSheets' in doc && typeof CSSStyleSheet !== 'undefined' && 'replaceSync' in CSSStyleSheet.prototype) {\n installed = new CSSStyleSheet();\n installed.replaceSync(FOCAL_PLANE_CSS);\n doc.adoptedStyleSheets = [...doc.adoptedStyleSheets, installed];\n } else {\n const style = doc.createElement('style');\n style.dataset.focalPlane = '';\n style.textContent = FOCAL_PLANE_CSS;\n doc.head.appendChild(style);\n }\n }\n return () => {\n users -= 1;\n if (users > 0) return;\n if (installed) doc.adoptedStyleSheets = doc.adoptedStyleSheets.filter((sheet) => sheet !== installed);\n doc.head.querySelector('style[data-focal-plane]')?.remove();\n installed = null;\n };\n}\n"]}
1
+ {"version":3,"file":"focal-plane-stylesheet.js","sourceRoot":"","sources":["../../../../src/focal-plane/focal-plane-stylesheet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,EACL,4BAA4B,EAC5B,cAAc,EACd,4BAA4B,EAC5B,yBAAyB,EACzB,mBAAmB,EACnB,uBAAuB,EACvB,oBAAoB,EACpB,cAAc,EACd,mBAAmB,GACpB,MAAM,6BAA6B,CAAC;AAErC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,IAAI,GAAG,oBAAoB,CAAC;AAClC,MAAM,OAAO,GAAG,mBAAmB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;AACzD,0GAA0G;AAC1G,MAAM,KAAK,GAAG,CAAC,cAAc,CAAC,OAAO,EAAE,cAAc,CAAC,SAAS,EAAE,cAAc,CAAC,SAAS,CAAU,CAAC;AACpG,MAAM,UAAU,GAAG,CAAC,IAA4B,EAAU,EAAE,CAAC,2BAA2B,IAAI,2BAA2B,IAAI,KAAK,CAAC;AACjI,MAAM,YAAY,GAAG,OAAO,mBAAmB,2BAA2B,CAAC;AAC3E,0FAA0F;AAC1F,MAAM,KAAK,GAAG,GAAG,OAAO,QAAQ,YAAY,MAAM,YAAY,GAAG,CAA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AC,eAAe,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;EAgBzN,IAAI;;;;;;;;;IASF,IAAI,IAAI,OAAO,KAAK,IAAI,wBAAwB,IAAI,wCAAwC,IAAI;IAChG,IAAI;;CAEP,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CAAC,MAAgB,QAAQ;IAClE,OAAO,4BAA4B,CAAC,aAAa,EAAE,eAAe,EAAE,GAAG,CAAC,CAAC;AAC3E,CAAC","sourcesContent":["import { ShellRegion } from '@wildo-ai/presets-components-models';\nimport {\n installShellLayoutStylesheet,\n NavigationZone,\n SHELL_ANCHORED_POPUP_ORIGINS,\n SHELL_CENTRED_POPUP_SLOTS,\n SHELL_PANE_SELECTOR,\n SHELL_POPUP_OPEN_STATES,\n shellModalOpenClause,\n ShellPopupSlot,\n shellRegionSelector,\n} from '@wildo-ai/saas-frontend-lib';\n\n/**\n * The focal plane's stylesheet (#2049), scoped to `[data-focal-plane]`, so it touches nothing outside the layout.\n *\n * ## One still camera, without a nested 3D context\n *\n * Every object carries its OWN `perspective(d) translate3d(0, 0, z)`, with its `transform-origin` set (per element, by\n * `writeVanishingOrigin`, called by the core stage measurement) to the one vanishing point of the stage. That is the projection of a single still camera,\n * and it needs no `transform-style: preserve-3d` ancestor — which matters, because a nested 3D context disables\n * `backdrop-filter`, and the glass windows are made of it.\n *\n * ## What counts as an object\n *\n * - the shell panels this layout wraps (`[data-shell-object]`, the core's wrapper marker);\n * - each navigation pane inside the content region, by the engine's own markers: `[data-content-area]` (the static and\n * single-zone branches) and the resizable panel `[data-panel-id^=\"nav-\"]` (NOT its inner `[data-content-area]`, which\n * the panel's inline `overflow: hidden` would clip).\n *\n * Depth is a custom property (`--fp-z`); states set it, and the transform reads it, so rules compose instead of fighting\n * over `transform`.\n *\n * ## Why a constructable stylesheet\n *\n * It is installed through `document.adoptedStyleSheets`, which a content security policy without `'unsafe-inline'`\n * does not block, where a `<style>` element would be.\n */\nconst ROOT = '[data-focal-plane]';\nconst CONTENT = shellRegionSelector(ShellRegion.CONTENT);\n/** The zone names the navigation state focuses, and the markers each one is found by in either branch. */\nconst ZONES = [NavigationZone.PRIMARY, NavigationZone.SECONDARY, NavigationZone.COMPANION] as const;\nconst zoneMarker = (zone: (typeof ZONES)[number]): string => `:is([data-content-area=\"${zone}\"], [data-panel-id=\"nav-${zone}\"])`;\nconst VISIBLE_PANE = `:is(${SHELL_PANE_SELECTOR}):not([data-zone-hidden])`;\n/** Two panes or more are side by side (the other panes are siblings in both branches). */\nconst SPLIT = `${CONTENT}:has(${VISIBLE_PANE} ~ ${VISIBLE_PANE})`;\nconst PANES = `:is(${SHELL_PANE_SELECTOR})`;\nconst OBJECTS = `:is([data-shell-object], ${SHELL_PANE_SELECTOR})`;\n/**\n * The popups the focal plane moves, by the core's `ShellPopupSlot` vocabulary: anchored popups LIFT from the origin\n * Radix publishes for their trigger (`SHELL_ANCHORED_POPUP_ORIGINS`), centred dialogs RISE (`SHELL_CENTRED_POPUP_SLOTS`).\n */\nconst POPUPS = {\n lift: Object.entries(SHELL_ANCHORED_POPUP_ORIGINS) as ReadonlyArray<[ShellPopupSlot, string]>,\n rise: SHELL_CENTRED_POPUP_SLOTS,\n};\n/** A modal popup is open: the core's slot-keyed clause (`shellModalOpenClause`), never `role=\"dialog\"`. */\nconst MODAL_OPEN = shellModalOpenClause();\n\n\nexport const FOCAL_PLANE_CSS = `\n/* Positioned, never isolated: an isolated root would be one stacking context, and anything positioned outside the\n shell with a lower z-index (a consent prompt) would paint over the shell's own dialogs (#1830). */\n${ROOT} { position: relative; height: 100vh; width: 100vw; overflow: hidden; background: var(--background); }\n\n/* The ambient background: soft fields of the theme's own colours, drifting very slowly. */\n${ROOT} .fp-backdrop { position: absolute; inset: -20%; z-index: 0; pointer-events: none; }\n${ROOT} .fp-backdrop i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.8; }\n${ROOT} .fp-backdrop .fp-a { width: 58%; height: 62%; left: 6%; top: 4%; background: radial-gradient(closest-side, color-mix(in oklab, var(--primary) 38%, var(--background)), transparent); animation: fp-drift-a 48s ease-in-out infinite alternate; }\n${ROOT} .fp-backdrop .fp-b { width: 52%; height: 58%; right: 4%; top: 30%; background: radial-gradient(closest-side, color-mix(in oklab, var(--accent, var(--primary)) 30%, var(--background)), transparent); animation: fp-drift-b 61s ease-in-out infinite alternate; }\n${ROOT} .fp-backdrop .fp-c { width: 46%; height: 50%; left: 34%; bottom: 0; background: radial-gradient(closest-side, color-mix(in oklab, var(--primary) 22%, var(--foreground) 8%), transparent); animation: fp-drift-c 55s ease-in-out infinite alternate; }\n@keyframes fp-drift-a { to { transform: translate(9%, 7%) scale(1.08); } }\n@keyframes fp-drift-b { to { transform: translate(-8%, -6%) scale(0.94); } }\n@keyframes fp-drift-c { to { transform: translate(-6%, -9%) scale(1.1); } }\n\n/* The arrangement: floating windows with a margin and gaps, never edge to edge. */\n${ROOT} .fp-grid { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; gap: 12px; padding: 14px; }\n${ROOT} .fp-row { display: flex; gap: 12px; min-height: 0; min-width: 0; }\n${ROOT} .fp-middle { flex: 1; }\n${ROOT} .fp-column { flex: 1; display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; }\n${ROOT} .fp-content { flex: 1; min-height: 0; min-width: 0; position: relative; display: flex; flex-direction: column; }\n${ROOT} [data-shell-object]:empty { display: none; }\n${ROOT} [data-shell-object] { position: relative; display: flex; min-height: 0; min-width: 0; }\n${ROOT} [data-shell-object] > * { flex: 1; min-width: 0; min-height: 0; }\n\n/* Every object: seen through the one still camera, at its depth. */\n${ROOT} ${OBJECTS} {\n transform-origin: var(--fp-ox, 50%) var(--fp-oy, 50%);\n transform: perspective(var(--fp-distance)) translate3d(0, 0, var(--fp-z, 0px));\n filter: var(--fp-filter, none);\n transition: transform var(--fp-motion) var(--fp-ease), filter var(--fp-motion) var(--fp-ease), box-shadow var(--fp-motion) var(--fp-ease);\n}\n\n/* Glass: the theme's card colour, translucent, over the background blurred through it. */\n${ROOT} :is([data-shell-object], ${SHELL_PANE_SELECTOR}) {\n background: color-mix(in oklab, var(--card, var(--background)) var(--fp-glass), transparent);\n -webkit-backdrop-filter: blur(26px) saturate(1.5);\n backdrop-filter: blur(26px) saturate(1.5);\n border: 1px solid color-mix(in oklab, var(--border) 55%, transparent);\n border-radius: 14px;\n box-shadow: 0 18px 44px -22px rgb(0 0 0 / 0.30), 0 1px 3px rgb(0 0 0 / 0.05);\n}\n${ROOT} ${CONTENT} { background: transparent; }\n${ROOT} ${CONTENT} :is([data-content-area=\"${NavigationZone.SECONDARY}\"], [data-content-area=\"${NavigationZone.COMPANION}\"]):not([data-panel-id] *) { margin-left: 12px; }\n\n/* Side by side, the pane you work in rests on the focal plane; every other pane steps back and dims. The focused\n zone comes from the navigation state, written on the root as data-fp-focus. Clicking a pane focuses it (the\n engine does that), which brings it forward. */\n${ZONES.map((zone) => `${ROOT}[data-fp-focus=\"${zone}\"] ${SPLIT} ${VISIBLE_PANE}:not(${zoneMarker(zone)})`).join(', ')} {\n --fp-z: calc(var(--fp-step) * -0.55);\n --fp-filter: brightness(calc(1 - var(--fp-dim) * 0.55)) saturate(calc(1 - var(--fp-dim) * 0.5)) blur(calc(var(--fp-recede-blur) * 0.55));\n}\n\n/* A side pane arrives from depth when it opens. */\n${ROOT} ${CONTENT} :is(${zoneMarker(NavigationZone.SECONDARY)}, ${zoneMarker(NavigationZone.COMPANION)}):is(${SHELL_PANE_SELECTOR}) {\n animation: fp-pane-arrive var(--fp-motion) var(--fp-ease);\n}\n@keyframes fp-pane-arrive {\n from { transform: perspective(var(--fp-distance)) translate3d(0, 0, calc(var(--fp-step) * -1.2)); opacity: 0; }\n}\n\n/* Ghosts: a discarded pane flying away, and the still image of the panes an expanded pane stands in front of. */\n${ROOT} [data-shell-ghost-layer] { position: absolute; inset: 0; z-index: 0; pointer-events: none; }\n${ROOT} [data-shell-ghost-layer=\"front\"] { z-index: 2; }\n${ROOT} [data-shell-ghost] {\n position: absolute; box-sizing: border-box; overflow: hidden;\n transform-origin: var(--fp-ox) var(--fp-oy);\n transform: perspective(var(--fp-distance)) translate3d(0, 0, var(--fp-z, 0px));\n filter: var(--fp-filter, none);\n transition: transform var(--fp-motion) var(--fp-ease), filter var(--fp-motion) var(--fp-ease), opacity var(--fp-motion) var(--fp-ease);\n background: color-mix(in oklab, var(--card, var(--background)) var(--fp-glass), transparent);\n border: 1px solid color-mix(in oklab, var(--border) 55%, transparent);\n border-radius: 14px;\n box-shadow: 0 18px 44px -22px rgb(0 0 0 / 0.30);\n}\n\n/* The shell panel under the pointer rises toward the camera; its items zoom a little. */\n${ROOT} [data-shell-object]:hover { --fp-z: var(--fp-hover-lift); }\n${ROOT} [data-shell-object] :is(button, a):not(:disabled) { transition: transform 180ms var(--fp-ease); }\n${ROOT} [data-shell-object] :is(button, a):not(:disabled):hover { transform: scale(1.045); }\n\n/* Behind a modal popup, everything steps back, dims and blurs lightly. A menu is not modal: it only lifts. */\n${ROOT}${MODAL_OPEN} ${OBJECTS} {\n --fp-z: calc(var(--fp-step) * -0.6);\n --fp-filter: brightness(calc(1 - var(--fp-dim) * 0.6)) saturate(0.9) blur(var(--fp-modal-blur));\n}\n\n/* Popups are objects too. Their recipe animations (tw-animate's enter/exit) are replaced by depth KEYFRAMES —\n keyframes, because the overlay library keeps a closing popup mounted only until its exit ANIMATION ends; a\n transition would be cut off. Each popup rests at its true size: depth shows while it travels.\n - A menu, popover or tooltip lifts off its trigger: the library publishes the trigger point as the transform\n origin, and perspective() grows the popup out of it.\n - A dialog (the command palette is one) rises from depth to the focal plane.\n - A sheet arrives from in front of the plane and leaves back into depth.\n Drawers and toasts keep their own motion: their libraries position and stack them with transforms. */\n${POPUPS.lift.map(([slot, origin]) => `${ROOT} [data-shell-overlay-layer] [data-slot=\"${slot}\"] { transform-origin: var(${origin}); }`).join('\\n')}\n${ROOT} [data-shell-overlay-layer] :is(${POPUPS.lift.map(([slot]) => `[data-slot=\"${slot}\"]`).join(', ')}):is(${SHELL_POPUP_OPEN_STATES.map((state) => `[data-state=\"${state}\"]`).join(', ')}) { animation: fp-lift-in calc(var(--fp-motion) * 0.6) var(--fp-ease) both; }\n${ROOT} [data-shell-overlay-layer] :is(${POPUPS.lift.map(([slot]) => `[data-slot=\"${slot}\"]`).join(', ')})[data-state=\"closed\"] { animation: fp-lift-out calc(var(--fp-motion) * 0.45) var(--fp-ease) both; }\n${ROOT} [data-shell-overlay-layer] :is(${POPUPS.rise.map((slot) => `[data-slot=\"${slot}\"]`).join(', ')})[data-state=\"open\"] { animation: fp-rise-in var(--fp-motion) var(--fp-ease) both; }\n${ROOT} [data-shell-overlay-layer] :is(${POPUPS.rise.map((slot) => `[data-slot=\"${slot}\"]`).join(', ')})[data-state=\"closed\"] { animation: fp-rise-out calc(var(--fp-motion) * 0.7) var(--fp-ease) both; }\n${ROOT} [data-shell-overlay-layer] [data-slot=\"${ShellPopupSlot.SHEET}\"][data-state=\"open\"] { animation: fp-arrive-in var(--fp-motion) var(--fp-ease) both; }\n${ROOT} [data-shell-overlay-layer] [data-slot=\"${ShellPopupSlot.SHEET}\"][data-state=\"closed\"] { animation: fp-arrive-out calc(var(--fp-motion) * 0.7) var(--fp-ease) both; }\n/* Popups are glass, a little more opaque than windows (they carry text you act on at once). Tooltips keep their own\n inverse colours. */\n${ROOT} [data-shell-overlay-layer] :is(${[...POPUPS.lift.filter(([slot]) => slot !== ShellPopupSlot.TOOLTIP).map(([slot]) => slot), ...POPUPS.rise, ShellPopupSlot.SHEET].map((slot) => `[data-slot=\"${slot}\"]`).join(', ')}) {\n background: color-mix(in oklab, var(--popover, var(--card, var(--background))) calc(var(--fp-glass) + 26%), transparent);\n -webkit-backdrop-filter: blur(24px) saturate(1.5);\n backdrop-filter: blur(24px) saturate(1.5);\n border-color: color-mix(in oklab, var(--border) 60%, transparent);\n}\n@keyframes fp-lift-in { from { transform: perspective(var(--fp-distance)) translate3d(0, 0, calc(var(--fp-step) * -0.35)); opacity: 0; } to { transform: none; opacity: 1; } }\n@keyframes fp-lift-out { from { transform: none; opacity: 1; } to { transform: perspective(var(--fp-distance)) translate3d(0, 0, calc(var(--fp-step) * -0.35)); opacity: 0; } }\n@keyframes fp-rise-in { from { transform: perspective(var(--fp-distance)) translate3d(0, 0, calc(var(--fp-step) * -1.4)); opacity: 0; } to { transform: none; opacity: 1; } }\n@keyframes fp-rise-out { from { transform: none; opacity: 1; } to { transform: perspective(var(--fp-distance)) translate3d(0, 0, calc(var(--fp-step) * -1.4)); opacity: 0; } }\n@keyframes fp-arrive-in { from { transform: perspective(var(--fp-distance)) translate3d(0, 0, calc(var(--fp-step) * 0.9)); opacity: 0; } to { transform: none; opacity: 1; } }\n@keyframes fp-arrive-out { from { transform: none; opacity: 1; } to { transform: perspective(var(--fp-distance)) translate3d(0, 0, calc(var(--fp-step) * -0.5)); opacity: 0; } }\n\n/* The modal scrim: in the focal plane, stepping back and the light blur above ARE the scrim, so the engine's dark\n overlay (and its own backdrop blur) would double it into a heavy grey. Keep the overlay element (it still catches\n the outside click), just transparent. */\n${ROOT} [data-shell-overlay-layer] :is([data-slot=\"dialog-overlay\"], [data-slot=\"alert-dialog-overlay\"], [data-slot=\"sheet-overlay\"], [data-slot=\"drawer-overlay\"]) {\n background: transparent;\n -webkit-backdrop-filter: none;\n backdrop-filter: none;\n}\n\n@media (prefers-reduced-motion: reduce) {\n /* !important: the motion rules above are more specific (the drifting fields, the item zoom), and the reader's\n setting must win over every one of them. */\n ${ROOT} ${OBJECTS}, ${ROOT} [data-shell-ghost], ${ROOT} [data-shell-object] :is(button, a), ${ROOT} [data-shell-overlay-layer] [data-slot] { transition-duration: 0ms !important; animation: none !important; }\n ${ROOT} .fp-backdrop i { animation: none !important; }\n}\n`;\n\n/**\n * Installs the stylesheet while at least one focal-plane layout is mounted, and removes it when the last one unmounts\n * (`installShellLayoutStylesheet`: a constructable stylesheet, with a `<style>` fallback). Returns the release function.\n */\nexport function installFocalPlaneStylesheet(doc: Document = document): () => void {\n return installShellLayoutStylesheet('focal-plane', FOCAL_PLANE_CSS, doc);\n}\n"]}
@@ -0,0 +1,27 @@
1
+ /** Where the vanishing point sits in the stage: centred, a little above the middle (the eye line of the prototype). */
2
+ export declare const VANISHING_POINT: {
3
+ x: number;
4
+ y: number;
5
+ };
6
+ /**
7
+ * Keeps an object's `transform-origin` on the stage's ONE vanishing point, so objects that each carry their own
8
+ * `perspective()` are seen through a single still camera (see `focal-plane-stylesheet.ts`). Passed to the core's stage
9
+ * measurement (`useShellMotion`'s `onObjectMeasured`), which calls it for every object whenever one can have moved.
10
+ *
11
+ * The origin is written as two custom properties on the object (`--fp-ox`, `--fp-oy`): the vanishing point minus the
12
+ * object's offset in the stage, an offset read from the layout (transforms ignored), so an object stepped back right
13
+ * now is still seen from the right point. React leaves custom properties written this way alone.
14
+ */
15
+ export declare function writeVanishingOrigin(element: HTMLElement, offset: {
16
+ left: number;
17
+ top: number;
18
+ }, stage: HTMLElement): void;
19
+ /** The vanishing point in the coordinates of a box whose top-left sits at `offset` in the stage. */
20
+ export declare function vanishingOrigin(offset: {
21
+ left: number;
22
+ top: number;
23
+ }, stage: HTMLElement): {
24
+ x: number;
25
+ y: number;
26
+ };
27
+ //# sourceMappingURL=focal-plane-vanishing-point.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"focal-plane-vanishing-point.d.ts","sourceRoot":"","sources":["../../../../src/focal-plane/focal-plane-vanishing-point.ts"],"names":[],"mappings":"AAAA,uHAAuH;AACvH,eAAO,MAAM,eAAe;;;CAAsB,CAAC;AAEnD;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI,CAI1H;AAED,oGAAoG;AACpG,wBAAgB,eAAe,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EAAE,KAAK,EAAE,WAAW,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAEnH"}
@@ -0,0 +1,21 @@
1
+ /** Where the vanishing point sits in the stage: centred, a little above the middle (the eye line of the prototype). */
2
+ export const VANISHING_POINT = { x: 0.5, y: 0.42 };
3
+ /**
4
+ * Keeps an object's `transform-origin` on the stage's ONE vanishing point, so objects that each carry their own
5
+ * `perspective()` are seen through a single still camera (see `focal-plane-stylesheet.ts`). Passed to the core's stage
6
+ * measurement (`useShellMotion`'s `onObjectMeasured`), which calls it for every object whenever one can have moved.
7
+ *
8
+ * The origin is written as two custom properties on the object (`--fp-ox`, `--fp-oy`): the vanishing point minus the
9
+ * object's offset in the stage, an offset read from the layout (transforms ignored), so an object stepped back right
10
+ * now is still seen from the right point. React leaves custom properties written this way alone.
11
+ */
12
+ export function writeVanishingOrigin(element, offset, stage) {
13
+ const { x, y } = vanishingOrigin(offset, stage);
14
+ element.style.setProperty('--fp-ox', `${x.toFixed(1)}px`);
15
+ element.style.setProperty('--fp-oy', `${y.toFixed(1)}px`);
16
+ }
17
+ /** The vanishing point in the coordinates of a box whose top-left sits at `offset` in the stage. */
18
+ export function vanishingOrigin(offset, stage) {
19
+ return { x: stage.clientWidth * VANISHING_POINT.x - offset.left, y: stage.clientHeight * VANISHING_POINT.y - offset.top };
20
+ }
21
+ //# sourceMappingURL=focal-plane-vanishing-point.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"focal-plane-vanishing-point.js","sourceRoot":"","sources":["../../../../src/focal-plane/focal-plane-vanishing-point.ts"],"names":[],"mappings":"AAAA,uHAAuH;AACvH,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC;AAEnD;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAoB,EAAE,MAAqC,EAAE,KAAkB;IAClH,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,eAAe,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAChD,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAC1D,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAC5D,CAAC;AAED,oGAAoG;AACpG,MAAM,UAAU,eAAe,CAAC,MAAqC,EAAE,KAAkB;IACvF,OAAO,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,eAAe,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC,YAAY,GAAG,eAAe,CAAC,CAAC,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC;AAC5H,CAAC","sourcesContent":["/** Where the vanishing point sits in the stage: centred, a little above the middle (the eye line of the prototype). */\nexport const VANISHING_POINT = { x: 0.5, y: 0.42 };\n\n/**\n * Keeps an object's `transform-origin` on the stage's ONE vanishing point, so objects that each carry their own\n * `perspective()` are seen through a single still camera (see `focal-plane-stylesheet.ts`). Passed to the core's stage\n * measurement (`useShellMotion`'s `onObjectMeasured`), which calls it for every object whenever one can have moved.\n *\n * The origin is written as two custom properties on the object (`--fp-ox`, `--fp-oy`): the vanishing point minus the\n * object's offset in the stage, an offset read from the layout (transforms ignored), so an object stepped back right\n * now is still seen from the right point. React leaves custom properties written this way alone.\n */\nexport function writeVanishingOrigin(element: HTMLElement, offset: { left: number; top: number }, stage: HTMLElement): void {\n const { x, y } = vanishingOrigin(offset, stage);\n element.style.setProperty('--fp-ox', `${x.toFixed(1)}px`);\n element.style.setProperty('--fp-oy', `${y.toFixed(1)}px`);\n}\n\n/** The vanishing point in the coordinates of a box whose top-left sits at `offset` in the stage. */\nexport function vanishingOrigin(offset: { left: number; top: number }, stage: HTMLElement): { x: number; y: number } {\n return { x: stage.clientWidth * VANISHING_POINT.x - offset.left, y: stage.clientHeight * VANISHING_POINT.y - offset.top };\n}\n"]}
@@ -6,7 +6,6 @@ export * from './frame/frame-appearance';
6
6
  export * from './frame/use-frame-appearance';
7
7
  export * from './tokens/design-token-resolution';
8
8
  export * from './tokens/use-design-token-resolution';
9
- export * from './layout/shell-layout-placement';
10
9
  export * from './layout/layout-3d-vocabulary';
11
10
  export * from './layout/layout-3d-definition';
12
11
  export * from './layout/layout-3d-transition-choreography';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,sCAAsC,CAAC;AACrD,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4CAA4C,CAAC;AAC3D,cAAc,uCAAuC,CAAC;AACtD,cAAc,oCAAoC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,sCAAsC,CAAC;AACrD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4CAA4C,CAAC;AAC3D,cAAc,uCAAuC,CAAC;AACtD,cAAc,oCAAoC,CAAC"}
package/dist/esm/index.js CHANGED
@@ -6,7 +6,6 @@ export * from './frame/frame-appearance.js';
6
6
  export * from './frame/use-frame-appearance.js';
7
7
  export * from './tokens/design-token-resolution.js';
8
8
  export * from './tokens/use-design-token-resolution.js';
9
- export * from './layout/shell-layout-placement.js';
10
9
  export * from './layout/layout-3d-vocabulary.js';
11
10
  export * from './layout/layout-3d-definition.js';
12
11
  export * from './layout/layout-3d-transition-choreography.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,sCAAsC,CAAC;AACrD,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4CAA4C,CAAC;AAC3D,cAAc,uCAAuC,CAAC;AACtD,cAAc,oCAAoC,CAAC","sourcesContent":["export * from './register-3d-layout';\nexport * from './layout-3d-main-container';\nexport * from './shell-region-measurement';\nexport * from './frame/frame-3d-style';\nexport * from './frame/frame-appearance';\nexport * from './frame/use-frame-appearance';\nexport * from './tokens/design-token-resolution';\nexport * from './tokens/use-design-token-resolution';\nexport * from './layout/shell-layout-placement';\nexport * from './layout/layout-3d-vocabulary';\nexport * from './layout/layout-3d-definition';\nexport * from './layout/layout-3d-transition-choreography';\nexport * from './layout/header-first-shell-container';\nexport * from './focal-plane/focal-plane-settings';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,sCAAsC,CAAC;AACrD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4CAA4C,CAAC;AAC3D,cAAc,uCAAuC,CAAC;AACtD,cAAc,oCAAoC,CAAC","sourcesContent":["export * from './register-3d-layout';\nexport * from './layout-3d-main-container';\nexport * from './shell-region-measurement';\nexport * from './frame/frame-3d-style';\nexport * from './frame/frame-appearance';\nexport * from './frame/use-frame-appearance';\nexport * from './tokens/design-token-resolution';\nexport * from './tokens/use-design-token-resolution';\nexport * from './layout/layout-3d-vocabulary';\nexport * from './layout/layout-3d-definition';\nexport * from './layout/layout-3d-transition-choreography';\nexport * from './layout/header-first-shell-container';\nexport * from './focal-plane/focal-plane-settings';\n"]}
@@ -1,16 +1,14 @@
1
1
  import { ShellAppearance } from '@wildo-ai/presets-components-models';
2
+ import { type ShellLayoutDefinition } from '@wildo-ai/saas-frontend-lib';
2
3
  import { type Frame3DStyleCatalog } from '../frame/frame-3d-style';
3
- import { type ShellLayoutPlacement } from './shell-layout-placement';
4
4
  import { Layout3DCamera, Layout3DId, Layout3DRestPose, type Layout3DTransitions } from './layout-3d-vocabulary';
5
5
  /** @wildo_source:part:start presets.3d.layout-contract facet:layer:frontend facet:family:layout-3d facet:audience:app-developer */
6
6
  /**
7
- * A 3D layout: where the regions go (`placement`, 3D-free), and what the frame draws around them (`scene`,
8
- * `transitions`), under `constraints`.
7
+ * A 3D layout: a shell layout (`ShellLayoutDefinition` from `@wildo-ai/saas-frontend-lib` — its `id` and its
8
+ * 3D-free `placement`), plus what the frame draws around the regions (`scene`, `transitions`), under `constraints`.
9
+ * The `id` is a {@link Layout3DId} for a built-in layout; an application's own layout names itself.
9
10
  */
10
- export interface Layout3DDefinition {
11
- /** A {@link Layout3DId} for a built-in layout; an application's own layout names itself. */
12
- id: string;
13
- placement: ShellLayoutPlacement;
11
+ export interface Layout3DDefinition extends ShellLayoutDefinition {
14
12
  scene: {
15
13
  camera: Layout3DCamera;
16
14
  /** The frame styles, per theme, with a fallback for any theme id the catalog does not name. */
@@ -1 +1 @@
1
- {"version":3,"file":"layout-3d-definition.d.ts","sourceRoot":"","sources":["../../../../src/layout/layout-3d-definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAEtE,OAAO,EAAmD,KAAK,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAGpH,OAAO,EAA4B,KAAK,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAE/F,OAAO,EAEL,cAAc,EACd,UAAU,EAEV,gBAAgB,EAEhB,KAAK,mBAAmB,EACzB,MAAM,wBAAwB,CAAC;AAEhC,mIAAmI;AACnI;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,4FAA4F;IAC5F,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,oBAAoB,CAAC;IAChC,KAAK,EAAE;QACL,MAAM,EAAE,cAAc,CAAC;QACvB,+FAA+F;QAC/F,WAAW,EAAE,mBAAmB,CAAC;KAClC,CAAC;IACF,qGAAqG;IACrG,WAAW,EAAE,mBAAmB,CAAC;IACjC,WAAW,EAAE;QACX,uHAAuH;QACvH,uBAAuB,EAAE,eAAe,GAAG,IAAI,CAAC;QAChD,QAAQ,EAAE,gBAAgB,CAAC;KAC5B,CAAC;CACH;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,kBAW/B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,kBAWpC,CAAC;AACF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAAE,kBAWnC,CAAC;AACF,wDAAwD;AAExD,iHAAiH;AACjH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,UAAU,EAAE,kBAAkB,CAItE,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI,CAkCxE"}
1
+ {"version":3,"file":"layout-3d-definition.d.ts","sourceRoot":"","sources":["../../../../src/layout/layout-3d-definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAA4B,KAAK,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEnG,OAAO,EAAmD,KAAK,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAIpH,OAAO,EAEL,cAAc,EACd,UAAU,EAEV,gBAAgB,EAEhB,KAAK,mBAAmB,EACzB,MAAM,wBAAwB,CAAC;AAEhC,mIAAmI;AACnI;;;;GAIG;AACH,MAAM,WAAW,kBAAmB,SAAQ,qBAAqB;IAC/D,KAAK,EAAE;QACL,MAAM,EAAE,cAAc,CAAC;QACvB,+FAA+F;QAC/F,WAAW,EAAE,mBAAmB,CAAC;KAClC,CAAC;IACF,qGAAqG;IACrG,WAAW,EAAE,mBAAmB,CAAC;IACjC,WAAW,EAAE;QACX,uHAAuH;QACvH,uBAAuB,EAAE,eAAe,GAAG,IAAI,CAAC;QAChD,QAAQ,EAAE,gBAAgB,CAAC;KAC5B,CAAC;CACH;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,kBAW/B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,kBAWpC,CAAC;AACF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAAE,kBAWnC,CAAC;AACF,wDAAwD;AAExD,iHAAiH;AACjH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,UAAU,EAAE,kBAAkB,CAItE,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI,CAkCxE"}
@@ -1,8 +1,8 @@
1
1
  import { ShellAppearance } from '@wildo-ai/presets-components-models';
2
+ import { ShellLayoutPlacementKind } from '@wildo-ai/saas-frontend-lib';
2
3
  import { HEADER_FIRST_FRAME_STYLES, INHERIT_FRAME_STYLES } from '../frame/frame-3d-style.js';
3
4
  import { HeaderFirstShellContainer } from './header-first-shell-container.js';
4
5
  import { FocalPlaneShellContainer } from '../focal-plane/focal-plane-shell-container.js';
5
- import { ShellLayoutPlacementKind } from './shell-layout-placement.js';
6
6
  import { crossFadesAppearance, frameChoreography, rimsFocusedZone } from './layout-3d-transition-choreography.js';
7
7
  import { Layout3DAppearanceTransition, Layout3DCamera, Layout3DId, Layout3DFrameChoreography, Layout3DRestPose, Layout3DZoneFocusTransition, } from './layout-3d-vocabulary.js';
8
8
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"layout-3d-definition.js","sourceRoot":"","sources":["../../../../src/layout/layout-3d-definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAEtE,OAAO,EAAE,yBAAyB,EAAE,oBAAoB,EAA4B,MAAM,yBAAyB,CAAC;AACpH,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,4CAA4C,CAAC;AACtF,OAAO,EAAE,wBAAwB,EAA6B,MAAM,0BAA0B,CAAC;AAC/F,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC/G,OAAO,EACL,4BAA4B,EAC5B,cAAc,EACd,UAAU,EACV,yBAAyB,EACzB,gBAAgB,EAChB,2BAA2B,GAE5B,MAAM,wBAAwB,CAAC;AAyBhC;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAuB;IACnD,EAAE,EAAE,UAAU,CAAC,OAAO;IACtB,SAAS,EAAE,EAAE,IAAI,EAAE,wBAAwB,CAAC,OAAO,EAAE;IACrD,KAAK,EAAE,E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CAAC;IACjD,iBAAiB,CAAC,MAAM,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;IACpD,eAAe,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IAC9C,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC;IACzC,QAAQ,IAAI,EAAE,CAAC;QACb,oEAAoE;QACpE,KAAK,gBAAgB,CAAC,IAAI;YACxB,MAAM;QACR,OAAO,CAAC,CAAC,CAAC;YACR,MAAM,WAAW,GAAU,IAAI,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,cAAc,MAAM,CAAC,EAAE,qBAAqB,MAAM,CAAC,WAAW,CAAC,0EAA0E,CAAC,CAAC;QAC7J,CAAC;IACH,CAAC;IACD,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,KAAK,wBAAwB,CAAC,OAAO,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,KAAK,wBAAwB,CAAC,QAAQ,EAAE,CAAC;QAC9H,MAAM,IAAI,KAAK,CAAC,cAAc,MAAM,CAAC,EAAE,8BAA8B,MAAM,CAAE,MAAM,CAAC,SAA+B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjI,CAAC;AACH,CAAC","sourcesContent":["import { ShellAppearance } from '@wildo-ai/presets-components-models';\n\nimport { HEADER_FIRST_FRAME_STYLES, INHERIT_FRAME_STYLES, type Frame3DStyleCatalog } from '../frame/frame-3d-style';\nimport { HeaderFirstShellContainer } from './header-first-shell-container';\nimport { FocalPlaneShellContainer } from '../focal-plane/focal-plane-shell-container';\nimport { ShellLayoutPlacementKind, type ShellLayoutPlacement } from './shell-layout-placement';\nimport { crossFadesAppearance, frameChoreography, rimsFocusedZone } from './layout-3d-transition-choreography';\nimport {\n Layout3DAppearanceTransition,\n Layout3DCamera,\n Layout3DId,\n Layout3DFrameChoreography,\n Layout3DRestPose,\n Layout3DZoneFocusTransition,\n type Layout3DTransitions,\n} from './layout-3d-vocabulary';\n\n/** @wildo_source:part:start presets.3d.layout-contract facet:layer:frontend facet:family:layout-3d facet:audience:app-developer */\n/**\n * A 3D layout: where the regions go (`placement`, 3D-free), and what the frame draws around them (`scene`,\n * `transitions`), under `constraints`.\n */\nexport interface Layout3DDefinition {\n /** A {@link Layout3DId} for a built-in layout; an application's own layout names itself. */\n id: string;\n placement: ShellLayoutPlacement;\n scene: {\n camera: Layout3DCamera;\n /** The frame styles, per theme, with a fallback for any theme id the catalog does not name. */\n frameStyles: Frame3DStyleCatalog;\n };\n /** What the frame plays on an appearance change, a navigation, a sidebar resize and a zone focus. */\n transitions: Layout3DTransitions;\n constraints: {\n /** The shell appearance the layout is designed for; any other is reported once (a console warning), never switched. */\n requiredShellAppearance: ShellAppearance | null;\n restPose: Layout3DRestPose;\n };\n}\n\n/**\n * The 2D disposal, unchanged, with the frame under it. On navigation the content slab lifts and settles; when\n * the sidebar collapses or expands, the light swings across and back.\n */\nexport const INHERIT_LAYOUT_3D: Layout3DDefinition = {\n id: Layout3DId.INHERIT,\n placement: { kind: ShellLayoutPlacementKind.INHERIT },\n scene: { camera: Layout3DCamera.FLAT_ORTHOGRAPHIC, frameStyles: INHERIT_FRAME_STYLES },\n transitions: {\n appearance: Layout3DAppearanceTransition.CROSS_FADE,\n navigation: Layout3DFrameChoreography.ELEVATION_SETTLE,\n sidebarResize: Layout3DFrameChoreography.LIGHT_SWEEP,\n zoneFocus: Layout3DZoneFocusTransition.RIM,\n },\n constraints: { requiredShellAppearance: ShellAppearance.CONTINUOUS, restPose: Layout3DRestPose.FLAT },\n};\n\n/**\n * The header-first disposal, with the frame lit from the header down. On navigation the light swings from the header\n * and returns; when the sidebar collapses or expands, the content slab lifts and settles.\n */\nexport const HEADER_FIRST_LAYOUT_3D: Layout3DDefinition = {\n id: Layout3DId.HEADER_FIRST,\n placement: { kind: ShellLayoutPlacementKind.COMPOSED, container: HeaderFirstShellContainer },\n scene: { camera: Layout3DCamera.FLAT_ORTHOGRAPHIC, frameStyles: HEADER_FIRST_FRAME_STYLES },\n transitions: {\n appearance: Layout3DAppearanceTransition.CROSS_FADE,\n navigation: Layout3DFrameChoreography.LIGHT_SWEEP,\n sidebarResize: Layout3DFrameChoreography.ELEVATION_SETTLE,\n zoneFocus: Layout3DZoneFocusTransition.RIM,\n },\n constraints: { requiredShellAppearance: ShellAppearance.CONTINUOUS, restPose: Layout3DRestPose.FLAT },\n};\n/**\n * The focal plane (#2049): the shell regions, each navigation pane and each popup are glass objects in depth under one\n * still camera. Whatever you work with rests on the focal plane; the rest steps back. No WebGL frame: the depth is in\n * the HTML objects themselves, so the frame styles and frame transitions below are not drawn.\n */\nexport const FOCAL_PLANE_LAYOUT_3D: Layout3DDefinition = {\n id: Layout3DId.FOCAL_PLANE,\n placement: { kind: ShellLayoutPlacementKind.COMPOSED, container: FocalPlaneShellContainer },\n scene: { camera: Layout3DCamera.STILL_PERSPECTIVE, frameStyles: INHERIT_FRAME_STYLES },\n transitions: {\n appearance: Layout3DAppearanceTransition.CROSS_FADE,\n navigation: Layout3DFrameChoreography.NONE,\n sidebarResize: Layout3DFrameChoreography.NONE,\n zoneFocus: Layout3DZoneFocusTransition.NONE,\n },\n constraints: { requiredShellAppearance: ShellAppearance.CONTINUOUS, restPose: Layout3DRestPose.FLAT },\n};\n/** @wildo_source:part:end presets.3d.layout-contract */\n\n/** Every built-in layout, keyed by its id: total over {@link Layout3DId}, so a new member must ship a layout. */\nexport const BUILT_IN_LAYOUTS_3D: Record<Layout3DId, Layout3DDefinition> = {\n [Layout3DId.INHERIT]: INHERIT_LAYOUT_3D,\n [Layout3DId.HEADER_FIRST]: HEADER_FIRST_LAYOUT_3D,\n [Layout3DId.FOCAL_PLANE]: FOCAL_PLANE_LAYOUT_3D,\n};\n\n/**\n * Refuses a layout the renderer cannot draw as declared: a camera, a transition or a rest pose it does not\n * implement. Exhaustive switches, so a member added to one of those vocabularies fails to compile here until the\n * renderer supports it — and a value that reaches it at runtime anyway (an application's own layout, built without\n * the types) is refused instead of being silently drawn as something else.\n */\nexport function assertSupportedLayout3D(layout: Layout3DDefinition): void {\n const camera = layout.scene.camera;\n switch (camera) {\n case Layout3DCamera.FLAT_ORTHOGRAPHIC:\n break;\n case Layout3DCamera.STILL_PERSPECTIVE:\n // The captured flat container stages nothing in depth; only a composed placement that does can use this camera.\n if (layout.placement.kind !== ShellLayoutPlacementKind.COMPOSED) {\n throw new Error(`3D layout '${layout.id}': the still-perspective camera needs a composed placement that stages the shell in depth.`);\n }\n break;\n default: {\n const unsupported: never = camera;\n throw new Error(`3D layout '${layout.id}': the frame has no camera '${String(unsupported)}'.`);\n }\n }\n // Each throws on a member the frame does not play (a value built without the types).\n crossFadesAppearance(layout.transitions.appearance);\n frameChoreography(layout.transitions.navigation);\n frameChoreography(layout.transitions.sidebarResize);\n rimsFocusedZone(layout.transitions.zoneFocus);\n const pose = layout.constraints.restPose;\n switch (pose) {\n // FLAT is what the container renders: the placement, untransformed.\n case Layout3DRestPose.FLAT:\n break;\n default: {\n const unsupported: never = pose;\n throw new Error(`3D layout '${layout.id}': the rest pose '${String(unsupported)}' is not supported (only FLAT exists: no region is transformed at rest).`);\n }\n }\n if (layout.placement.kind !== ShellLayoutPlacementKind.INHERIT && layout.placement.kind !== ShellLayoutPlacementKind.COMPOSED) {\n throw new Error(`3D layout '${layout.id}': unknown placement kind '${String((layout.placement as { kind: unknown }).kind)}'.`);\n }\n}\n"]}
1
+ {"version":3,"file":"layout-3d-definition.js","sourceRoot":"","sources":["../../../../src/layout/layout-3d-definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAA8B,MAAM,6BAA6B,CAAC;AAEnG,OAAO,EAAE,yBAAyB,EAAE,oBAAoB,EAA4B,MAAM,yBAAyB,CAAC;AACpH,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,4CAA4C,CA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AC,EAAE,4FAA4F,CAAC,CAAC;YACvI,CAAC;YACD,MAAM;QACR,OAAO,CAAC,CAAC,CAAC;YACR,MAAM,WAAW,GAAU,MAAM,CAAC;YAClC,MAAM,IAAI,KAAK,CAAC,cAAc,MAAM,CAAC,EAAE,+BAA+B,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACjG,CAAC;IACH,CAAC;IACD,qFAAqF;IACrF,oBAAoB,CAAC,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IACpD,iBAAiB,CAAC,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IACjD,iBAAiB,CAAC,MAAM,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;IACpD,eAAe,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IAC9C,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC;IACzC,QAAQ,IAAI,EAAE,CAAC;QACb,oEAAoE;QACpE,KAAK,gBAAgB,CAAC,IAAI;YACxB,MAAM;QACR,OAAO,CAAC,CAAC,CAAC;YACR,MAAM,WAAW,GAAU,IAAI,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,cAAc,MAAM,CAAC,EAAE,qBAAqB,MAAM,CAAC,WAAW,CAAC,0EAA0E,CAAC,CAAC;QAC7J,CAAC;IACH,CAAC;IACD,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,KAAK,wBAAwB,CAAC,OAAO,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,KAAK,wBAAwB,CAAC,QAAQ,EAAE,CAAC;QAC9H,MAAM,IAAI,KAAK,CAAC,cAAc,MAAM,CAAC,EAAE,8BAA8B,MAAM,CAAE,MAAM,CAAC,SAA+B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjI,CAAC;AACH,CAAC","sourcesContent":["import { ShellAppearance } from '@wildo-ai/presets-components-models';\nimport { ShellLayoutPlacementKind, type ShellLayoutDefinition } from '@wildo-ai/saas-frontend-lib';\n\nimport { HEADER_FIRST_FRAME_STYLES, INHERIT_FRAME_STYLES, type Frame3DStyleCatalog } from '../frame/frame-3d-style';\nimport { HeaderFirstShellContainer } from './header-first-shell-container';\nimport { FocalPlaneShellContainer } from '../focal-plane/focal-plane-shell-container';\nimport { crossFadesAppearance, frameChoreography, rimsFocusedZone } from './layout-3d-transition-choreography';\nimport {\n Layout3DAppearanceTransition,\n Layout3DCamera,\n Layout3DId,\n Layout3DFrameChoreography,\n Layout3DRestPose,\n Layout3DZoneFocusTransition,\n type Layout3DTransitions,\n} from './layout-3d-vocabulary';\n\n/** @wildo_source:part:start presets.3d.layout-contract facet:layer:frontend facet:family:layout-3d facet:audience:app-developer */\n/**\n * A 3D layout: a shell layout (`ShellLayoutDefinition` from `@wildo-ai/saas-frontend-lib` — its `id` and its\n * 3D-free `placement`), plus what the frame draws around the regions (`scene`, `transitions`), under `constraints`.\n * The `id` is a {@link Layout3DId} for a built-in layout; an application's own layout names itself.\n */\nexport interface Layout3DDefinition extends ShellLayoutDefinition {\n scene: {\n camera: Layout3DCamera;\n /** The frame styles, per theme, with a fallback for any theme id the catalog does not name. */\n frameStyles: Frame3DStyleCatalog;\n };\n /** What the frame plays on an appearance change, a navigation, a sidebar resize and a zone focus. */\n transitions: Layout3DTransitions;\n constraints: {\n /** The shell appearance the layout is designed for; any other is reported once (a console warning), never switched. */\n requiredShellAppearance: ShellAppearance | null;\n restPose: Layout3DRestPose;\n };\n}\n\n/**\n * The 2D disposal, unchanged, with the frame under it. On navigation the content slab lifts and settles; when\n * the sidebar collapses or expands, the light swings across and back.\n */\nexport const INHERIT_LAYOUT_3D: Layout3DDefinition = {\n id: Layout3DId.INHERIT,\n placement: { kind: ShellLayoutPlacementKind.INHERIT },\n scene: { camera: Layout3DCamera.FLAT_ORTHOGRAPHIC, frameStyles: INHERIT_FRAME_STYLES },\n transitions: {\n appearance: Layout3DAppearanceTransition.CROSS_FADE,\n navigation: Layout3DFrameChoreography.ELEVATION_SETTLE,\n sidebarResize: Layout3DFrameChoreography.LIGHT_SWEEP,\n zoneFocus: Layout3DZoneFocusTransition.RIM,\n },\n constraints: { requiredShellAppearance: ShellAppearance.CONTINUOUS, restPose: Layout3DRestPose.FLAT },\n};\n\n/**\n * The header-first disposal, with the frame lit from the header down. On navigation the light swings from the header\n * and returns; when the sidebar collapses or expands, the content slab lifts and settles.\n */\nexport const HEADER_FIRST_LAYOUT_3D: Layout3DDefinition = {\n id: Layout3DId.HEADER_FIRST,\n placement: { kind: ShellLayoutPlacementKind.COMPOSED, container: HeaderFirstShellContainer },\n scene: { camera: Layout3DCamera.FLAT_ORTHOGRAPHIC, frameStyles: HEADER_FIRST_FRAME_STYLES },\n transitions: {\n appearance: Layout3DAppearanceTransition.CROSS_FADE,\n navigation: Layout3DFrameChoreography.LIGHT_SWEEP,\n sidebarResize: Layout3DFrameChoreography.ELEVATION_SETTLE,\n zoneFocus: Layout3DZoneFocusTransition.RIM,\n },\n constraints: { requiredShellAppearance: ShellAppearance.CONTINUOUS, restPose: Layout3DRestPose.FLAT },\n};\n/**\n * The focal plane (#2049): the shell regions, each navigation pane and each popup are glass objects in depth under one\n * still camera. Whatever you work with rests on the focal plane; the rest steps back. No WebGL frame: the depth is in\n * the HTML objects themselves, so the frame styles and frame transitions below are not drawn.\n */\nexport const FOCAL_PLANE_LAYOUT_3D: Layout3DDefinition = {\n id: Layout3DId.FOCAL_PLANE,\n placement: { kind: ShellLayoutPlacementKind.COMPOSED, container: FocalPlaneShellContainer },\n scene: { camera: Layout3DCamera.STILL_PERSPECTIVE, frameStyles: INHERIT_FRAME_STYLES },\n transitions: {\n appearance: Layout3DAppearanceTransition.CROSS_FADE,\n navigation: Layout3DFrameChoreography.NONE,\n sidebarResize: Layout3DFrameChoreography.NONE,\n zoneFocus: Layout3DZoneFocusTransition.NONE,\n },\n constraints: { requiredShellAppearance: ShellAppearance.CONTINUOUS, restPose: Layout3DRestPose.FLAT },\n};\n/** @wildo_source:part:end presets.3d.layout-contract */\n\n/** Every built-in layout, keyed by its id: total over {@link Layout3DId}, so a new member must ship a layout. */\nexport const BUILT_IN_LAYOUTS_3D: Record<Layout3DId, Layout3DDefinition> = {\n [Layout3DId.INHERIT]: INHERIT_LAYOUT_3D,\n [Layout3DId.HEADER_FIRST]: HEADER_FIRST_LAYOUT_3D,\n [Layout3DId.FOCAL_PLANE]: FOCAL_PLANE_LAYOUT_3D,\n};\n\n/**\n * Refuses a layout the renderer cannot draw as declared: a camera, a transition or a rest pose it does not\n * implement. Exhaustive switches, so a member added to one of those vocabularies fails to compile here until the\n * renderer supports it — and a value that reaches it at runtime anyway (an application's own layout, built without\n * the types) is refused instead of being silently drawn as something else.\n */\nexport function assertSupportedLayout3D(layout: Layout3DDefinition): void {\n const camera = layout.scene.camera;\n switch (camera) {\n case Layout3DCamera.FLAT_ORTHOGRAPHIC:\n break;\n case Layout3DCamera.STILL_PERSPECTIVE:\n // The captured flat container stages nothing in depth; only a composed placement that does can use this camera.\n if (layout.placement.kind !== ShellLayoutPlacementKind.COMPOSED) {\n throw new Error(`3D layout '${layout.id}': the still-perspective camera needs a composed placement that stages the shell in depth.`);\n }\n break;\n default: {\n const unsupported: never = camera;\n throw new Error(`3D layout '${layout.id}': the frame has no camera '${String(unsupported)}'.`);\n }\n }\n // Each throws on a member the frame does not play (a value built without the types).\n crossFadesAppearance(layout.transitions.appearance);\n frameChoreography(layout.transitions.navigation);\n frameChoreography(layout.transitions.sidebarResize);\n rimsFocusedZone(layout.transitions.zoneFocus);\n const pose = layout.constraints.restPose;\n switch (pose) {\n // FLAT is what the container renders: the placement, untransformed.\n case Layout3DRestPose.FLAT:\n break;\n default: {\n const unsupported: never = pose;\n throw new Error(`3D layout '${layout.id}': the rest pose '${String(unsupported)}' is not supported (only FLAT exists: no region is transformed at rest).`);\n }\n }\n if (layout.placement.kind !== ShellLayoutPlacementKind.INHERIT && layout.placement.kind !== ShellLayoutPlacementKind.COMPOSED) {\n throw new Error(`3D layout '${layout.id}': unknown placement kind '${String((layout.placement as { kind: unknown }).kind)}'.`);\n }\n}\n"]}
@@ -1,14 +1,8 @@
1
1
  import React from 'react';
2
- import { type AppLayoutPreset_MainContainer_DefaultProps } from '@wildo-ai/saas-frontend-lib';
2
+ import { type AppLayoutPreset_MainContainer_DefaultProps, type ShellLayoutMainContainer } from '@wildo-ai/saas-frontend-lib';
3
3
  import type { Frame3DStyleOverrides } from './frame/frame-3d-style';
4
4
  import { type FocalPlaneSettings } from './focal-plane/focal-plane-settings';
5
5
  import { type Layout3DDefinition } from './layout/layout-3d-definition';
6
- /**
7
- * The brand a 3D main container carries. `Symbol.for`, not `Symbol`: the component registry lives on
8
- * `globalThis` and survives a hot reload, while a reloaded module would mint a new `Symbol` and fail to
9
- * recognise the container it registered last time — and then capture it as "the 2D shell".
10
- */
11
- declare const LAYOUT_3D_MAIN_CONTAINER_BRAND: unique symbol;
12
6
  type MainContainerComponent = React.ComponentType<AppLayoutPreset_MainContainer_DefaultProps>;
13
7
  /** @wildo_source:part:start presets.3d.register-layout facet:layer:frontend facet:family:layout-3d facet:audience:app-developer */
14
8
  /** What a 3D main container draws: the layout, and the application's frame-style overrides. */
@@ -27,20 +21,21 @@ export interface Layout3DOptions {
27
21
  focalPlane?: Partial<FocalPlaneSettings>;
28
22
  }
29
23
  /** @wildo_source:part:end presets.3d.register-layout */
30
- /** A 3D main container: the component, the 2D container it captured, and the layout it draws. */
31
- export type Layout3DMainContainer = MainContainerComponent & {
32
- readonly [LAYOUT_3D_MAIN_CONTAINER_BRAND]: true;
33
- /**
34
- * The 2D main container captured at registration: rendered unchanged by an INHERIT placement, and kept by every
35
- * layout so a re-registration wraps IT rather than a 3D container.
36
- */
37
- readonly captured: MainContainerComponent;
38
- /** The layout this container draws. */
39
- readonly layout: Layout3DDefinition;
24
+ /**
25
+ * A 3D main container: a shell layout main container (`ShellLayoutMainContainer` from `@wildo-ai/saas-frontend-lib`
26
+ * — the component, the container it captured, the layout it draws) whose layout is a 3D one, plus the application's
27
+ * frame-style overrides. It carries the core brand, so the one-layout rule and the re-registration capture treat it
28
+ * exactly as they treat a 2D layout's container.
29
+ */
30
+ export type Layout3DMainContainer = ShellLayoutMainContainer<Layout3DDefinition> & {
40
31
  /** The application's frame-style overrides, when it registered any. */
41
32
  readonly frameStyles: Frame3DStyleOverrides | undefined;
42
33
  };
43
- /** Whether a registered main container is a 3D one — and so carries the 2D container it wraps. */
34
+ /**
35
+ * Whether a registered main container is a 3D one — and so carries the 2D container it wraps. Decided by the family
36
+ * the container was branded for (`ShellLayoutFamily.LAYOUT_3D`): a 2D layout's container is a layout container, not
37
+ * a 3D one, whatever its layout id.
38
+ */
44
39
  export declare function isLayout3DMainContainer(component: unknown): component is Layout3DMainContainer;
45
40
  /**
46
41
  * Build the 3D main container: a captured 2D container, and a layout that either renders it (INHERIT) or arranges
@@ -1 +1 @@
1
- {"version":3,"file":"layout-3d-main-container.d.ts","sourceRoot":"","sources":["../../../src/layout-3d-main-container.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAEzC,OAAO,EAA6B,KAAK,0CAA0C,EAAE,MAAM,6BAA6B,CAAC;AAGzH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAwD,KAAK,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACnI,OAAO,EAA8C,KAAK,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAMpH;;;;GAIG;AACH,QAAA,MAAM,8BAA8B,eAA+D,CAAC;AAEpG,KAAK,sBAAsB,GAAG,KAAK,CAAC,aAAa,CAAC,0CAA0C,CAAC,CAAC;AAE9F,mIAAmI;AACnI,+FAA+F;AAC/F,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,uEAAuE;IACvE,WAAW,CAAC,EAAE,qBAAqB,CAAC;IACpC;;;OAGG;IACH,UAAU,CAAC,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EAAE,qBAAqB,CAAC;IACpC;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAC1C;AACD,wDAAwD;AAExD;;;;;GAKG;AACH,MAAM,MAAM,qBAAqB,GAAG,wBAAwB,CAAC,kBAAkB,CAAC,GAAG;IACjF,uEAAuE;IACvE,QAAQ,CAAC,WAAW,EAAE,qBAAqB,GAAG,SAAS,CAAC;CACzD,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,OAAO,GAAG,SAAS,IAAI,qBAAqB,CAE9F;AAaD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,sBAAsB,EAAE,OAAO,GAAE,eAAoB,GAAG,qBAAqB,CA+C5H"}
@@ -1,22 +1,19 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect } from 'react';
3
- import { useNavigationState, useUI } from '@wildo-ai/saas-frontend-lib';
3
+ import { brandShellLayoutMainContainer, isShellLayoutMainContainer, resolveShellLayoutPlacement, ShellLayoutFamily, useNavigationState, useUI, } from '@wildo-ai/saas-frontend-lib';
4
4
  import { FrameCanvasDoor } from './frame/frame-canvas.lazy.js';
5
5
  import { FocalPlaneSettingsContext, resolveFocalPlaneSettings } from './focal-plane/focal-plane-settings.js';
6
6
  import { assertSupportedLayout3D, INHERIT_LAYOUT_3D } from './layout/layout-3d-definition.js';
7
7
  import { crossFadesAppearance } from './layout/layout-3d-transition-choreography.js';
8
8
  import { Layout3DCamera } from './layout/layout-3d-vocabulary.js';
9
- import { ShellLayoutPlacementKind } from './layout/shell-layout-placement.js';
10
9
  import { useFrameAppearance } from './frame/use-frame-appearance.js';
11
10
  /**
12
- * The brand a 3D main container carries. `Symbol.for`, not `Symbol`: the component registry lives on
13
- * `globalThis` and survives a hot reload, while a reloaded module would mint a new `Symbol` and fail to
14
- * recognise the container it registered last time — and then capture it as "the 2D shell".
11
+ * Whether a registered main container is a 3D one — and so carries the 2D container it wraps. Decided by the family
12
+ * the container was branded for (`ShellLayoutFamily.LAYOUT_3D`): a 2D layout's container is a layout container, not
13
+ * a 3D one, whatever its layout id.
15
14
  */
16
- const LAYOUT_3D_MAIN_CONTAINER_BRAND = Symbol.for('@wildo-ai/presets-components-3d/main-container');
17
- /** Whether a registered main container is a 3D one — and so carries the 2D container it wraps. */
18
15
  export function isLayout3DMainContainer(component) {
19
- return typeof component === 'function' && component[LAYOUT_3D_MAIN_CONTAINER_BRAND] === true;
16
+ return isShellLayoutMainContainer(component) && component.layoutFamily === ShellLayoutFamily.LAYOUT_3D && 'frameStyles' in component;
20
17
  }
21
18
  let appearanceMismatchWarned = false;
22
19
  /**
@@ -73,7 +70,7 @@ export function create3DMainContainer(captured, options = {}) {
73
70
  const crossFadeAppearance = crossFadesAppearance(layout.transitions.appearance);
74
71
  // Chosen ONCE, outside the component: the element at index 1 keeps one type for the application's life, so it
75
72
  // never remounts.
76
- const Placement = layout.placement.kind === ShellLayoutPlacementKind.INHERIT ? captured : layout.placement.container;
73
+ const Placement = resolveShellLayoutPlacement(captured, layout);
77
74
  function Layout3DMainContainer(props) {
78
75
  const { shellAppearance } = useUI();
79
76
  const required = layout.constraints.requiredShellAppearance;
@@ -94,12 +91,7 @@ export function create3DMainContainer(captured, options = {}) {
94
91
  }, [shellAppearance, required]);
95
92
  return (_jsxs(_Fragment, { children: [layout.scene.camera === Layout3DCamera.FLAT_ORTHOGRAPHIC && _jsx(FrameSlot, { layout: layout, frameStyles: frameStyles, crossFadeAppearance: crossFadeAppearance }), _jsx(FocalPlaneSettingsContext.Provider, { value: focalPlane, children: _jsx(Placement, { ...props }) })] }));
96
93
  }
97
- return Object.assign(Layout3DMainContainer, {
98
- [LAYOUT_3D_MAIN_CONTAINER_BRAND]: true,
99
- captured,
100
- layout,
101
- frameStyles,
102
- });
94
+ return brandShellLayoutMainContainer(Layout3DMainContainer, captured, layout, ShellLayoutFamily.LAYOUT_3D, { frameStyles });
103
95
  }
104
96
  /**
105
97
  * Index 0 of a 3D main container: reads what the frame follows — the theme (`useFrameAppearance`) and the navigation
@@ -1 +1 @@
1
- {"version":3,"file":"layout-3d-main-container.js","sourceRoot":"","sources":["../../../src/layout-3d-main-container.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAmD,MAAM,6BAA6B,CAAC;AAEzH,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,OAAO,EAAE,yBAAyB,EAAE,yBAAyB,EAA2B,MAAM,oCAAoC,CAAC;AACnI,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAA2B,MAAM,+BAA+B,CAAC;AACpH,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAElE;;;;GAIG;AACH,MAAM,8BAA8B,GAAG,MAAM,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;AAoCpG,kGAAkG;AAClG,MAAM,UAAU,uBAAuB,CAAC,SAAkB;IACxD,OAAO,OAAO,SAAS,KAAK,UAAU,IAAK,SAA4C,CAAC,8BAA8B,CAAC,KAAK,IAAI,CAAC;AACnI,CAAC;AAED,IAAI,wBAAwB,GAAG,KAAK,CAAC;AAErC;;;;;;GAMG;AACH,MAAM,mCAAmC,GAAG,IAAI,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,UAAU,qBAAqB,CAAC,QAAgC,EAAE,UAA2B,EAAE;IACnG,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,I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AAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9D,CAAC,CAAC,CAAC;IACH,MAAM,mBAAmB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACzI,OAAO,CACL,KAAC,eAAe,IACd,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,EAC3B,mBAAmB,EAAE,mBAAmB,EACxC,oBAAoB,EAAE,MAAM,CAAC,WAAW,CAAC,UAAU,EACnD,uBAAuB,EAAE,MAAM,CAAC,WAAW,CAAC,aAAa,EACzD,mBAAmB,EAAE,MAAM,CAAC,WAAW,CAAC,SAAS,EACjD,mBAAmB,EAAE,mBAAmB,EACxC,WAAW,EAAE,UAAU,CAAC,WAAW,GACnC,CACH,CAAC;AACJ,CAAC","sourcesContent":["import React, { useEffect } from 'react';\n\nimport { useNavigationState, useUI, type AppLayoutPreset_MainContainer_DefaultProps } from '@wildo-ai/saas-frontend-lib';\n\nimport { FrameCanvasDoor } from './frame/frame-canvas.lazy';\nimport type { Frame3DStyleOverrides } from './frame/frame-3d-style';\nimport { FocalPlaneSettingsContext, resolveFocalPlaneSettings, type FocalPlaneSettings } from './focal-plane/focal-plane-settings';\nimport { assertSupportedLayout3D, INHERIT_LAYOUT_3D, type Layout3DDefinition } from './layout/layout-3d-definition';\nimport { crossFadesAppearance } from './layout/layout-3d-transition-choreography';\nimport { Layout3DCamera } from './layout/layout-3d-vocabulary';\nimport { ShellLayoutPlacementKind } from './layout/shell-layout-placement';\nimport { useFrameAppearance } from './frame/use-frame-appearance';\n\n/**\n * The brand a 3D main container carries. `Symbol.for`, not `Symbol`: the component registry lives on\n * `globalThis` and survives a hot reload, while a reloaded module would mint a new `Symbol` and fail to\n * recognise the container it registered last time — and then capture it as \"the 2D shell\".\n */\nconst LAYOUT_3D_MAIN_CONTAINER_BRAND = Symbol.for('@wildo-ai/presets-components-3d/main-container');\n\ntype MainContainerComponent = React.ComponentType<AppLayoutPreset_MainContainer_DefaultProps>;\n\n/** @wildo_source:part:start presets.3d.register-layout facet:layer:frontend facet:family:layout-3d facet:audience:app-developer */\n/** What a 3D main container draws: the layout, and the application's frame-style overrides. */\nexport interface Layout3DOptions {\n /**\n * The layout: its disposal, its scene and its transitions. Defaults to {@link INHERIT_LAYOUT_3D}, the 2D disposal\n * with the frame under it. An application uses ONE layout for its whole life.\n */\n layout?: Layout3DDefinition;\n /** Frame-style overrides layered over the layout's built-in styles. */\n frameStyles?: Frame3DStyleOverrides;\n /**\n * Overrides of the focal plane's numbers (camera distance, layer depth, motion, dims, blurs, window opacity), for\n * {@link FOCAL_PLANE_LAYOUT_3D}; each is checked at registration. Omitted, the defaults.\n */\n focalPlane?: Partial<FocalPlaneSettings>;\n}\n/** @wildo_source:part:end presets.3d.register-layout */\n\n/** A 3D main container: the component, the 2D container it captured, and the layout it draws. */\nexport type Layout3DMainContainer = MainContainerComponent & {\n readonly [LAYOUT_3D_MAIN_CONTAINER_BRAND]: true;\n /**\n * The 2D main container captured at registration: rendered unchanged by an INHERIT placement, and kept by every\n * layout so a re-registration wraps IT rather than a 3D container.\n */\n readonly captured: MainContainerComponent;\n /** The layout this container draws. */\n readonly layout: Layout3DDefinition;\n /** The application's frame-style overrides, when it registered any. */\n readonly frameStyles: Frame3DStyleOverrides | undefined;\n};\n\n/** Whether a registered main container is a 3D one — and so carries the 2D container it wraps. */\nexport function isLayout3DMainContainer(component: unknown): component is Layout3DMainContainer {\n return typeof component === 'function' && (component as Partial<Layout3DMainContainer>)[LAYOUT_3D_MAIN_CONTAINER_BRAND] === true;\n}\n\nlet appearanceMismatchWarned = false;\n\n/**\n * How long a shell appearance other than the one the layout requires must persist before it is reported. The UI\n * context starts from the DEFAULT theme and resolves the application's own theme a moment later, so the first value\n * this container sees is routinely SEPARATED even in a CONTINUOUS application — measured on Wonder Todos, whose\n * shell renders `bg-transparent` while the first-render value read SEPARATED. Only a value that survives\n * bootstrap is the application's.\n */\nconst APPEARANCE_MISMATCH_REPORT_DELAY_MS = 5000;\n\n/**\n * Build the 3D main container: a captured 2D container, and a layout that either renders it (INHERIT) or arranges\n * the regions with a container of its own (COMPOSED).\n *\n * It renders exactly two children, at FIXED positions:\n *\n * - **index 0, the frame slot** ({@link FrameSlot}): the decorative canvas behind its lazy door (`FrameCanvasDoor`),\n * whose `LazyDoorErrorBoundary` contains any failure of it. The theme and the navigation state are read in the\n * slot, in the DOM tree, and passed to the canvas as props: a theme, mode, breakpoint or navigation change\n * re-renders index 0 and never touches index 1.\n * It is `position: fixed` with NO z-index, `aria-hidden` and `pointer-events: none`.\n * - **index 1, the placement**: the captured 2D container, unchanged, for an INHERIT layout; the layout's own\n * container, composed from the same shell building blocks, otherwise. Either way every region, provider,\n * context, portal and latch is the application's own.\n *\n * Why no wrapper, and no `isolate` (the #1821 text proposed `<div class=\"isolate\">` with the canvas at\n * `-z-10`): `isolate` would make the whole shell ONE stacking context, so anything positioned OUTSIDE it\n * with a lower z-index — the consent prompt (`z-50`) — would paint over the shell's own dialogs\n * (`--z-overlay`, 300). #1830 measured that exact reordering and chose `relative` for the 2D shell root\n * for that reason. Instead, a positioned element with no z-index paints at the z-index:0 level in TREE\n * order, which puts the canvas after the theme's background layer (`UIContext`'s `isolate` wrapper,\n * earlier in the tree) and before the shell root (`relative`, the next sibling) — frame above the theme\n * background, shell above the frame — while every z-index inside the shell keeps its global order.\n *\n * The precondition this places on the placement: its ROOT must be positioned (the 2D default and the\n * header-first container are `relative`, #1830), or its in-flow content paints at a lower level than the frame and\n * under it. The frame never takes a click either way — it handles no pointer events at all.\n *\n * Why fixed positions: a canvas failure empties only index 0. The placement never moves and keeps one component\n * type for the application's life, so it never remounts — a remount there would unmount every navigation zone and\n * lose its state.\n */\nexport function create3DMainContainer(captured: MainContainerComponent, options: Layout3DOptions = {}): Layout3DMainContainer {\n const layout = options.layout ?? INHERIT_LAYOUT_3D;\n const frameStyles = options.frameStyles;\n // Checked here, at registration, like the layout itself. Only the still-perspective camera reads them: settings a\n // layout would silently ignore are refused instead.\n if (options.focalPlane !== undefined && layout.scene.camera !== Layout3DCamera.STILL_PERSPECTIVE) {\n throw new Error(`register3DLayout(): 'focalPlane' tunes the focal-plane layout, and the layout '${layout.id}' is not seen through its still camera.`);\n }\n const focalPlane = resolveFocalPlaneSettings(options.focalPlane);\n // A camera, transition kind or rest pose the renderer does not implement is refused here, at registration.\n assertSupportedLayout3D(layout);\n const crossFadeAppearance = crossFadesAppearance(layout.transitions.appearance);\n // Chosen ONCE, outside the component: the element at index 1 keeps one type for the application's life, so it\n // never remounts.\n const Placement: MainContainerComponent = layout.placement.kind === ShellLayoutPlacementKind.INHERIT ? captured : layout.placement.container;\n function Layout3DMainContainer(props: AppLayoutPreset_MainContainer_DefaultProps): React.JSX.Element {\n const { shellAppearance } = useUI();\n const required = layout.constraints.requiredShellAppearance;\n\n useEffect(() => {\n // The frame is visible only where regions paint nothing. A layout states the shell appearance it is designed\n // for; any other is the application's choice to correct, so it is said once and nothing switches.\n if (required === null || shellAppearance === required || appearanceMismatchWarned) return undefined;\n const report = setTimeout(() => {\n // Checked again here: several containers (or a remount) may have armed a timer before the first fired.\n if (appearanceMismatchWarned) return;\n appearanceMismatchWarned = true;\n console.warn(\n `[presets-components-3d] the 3D layout '${layout.id}' is designed for a '${String(required)}' shell, and this theme's `\n + `shell appearance is '${String(shellAppearance)}': opaque regions will cover the frame drawn under them.`,\n );\n }, APPEARANCE_MISMATCH_REPORT_DELAY_MS);\n return () => clearTimeout(report);\n }, [shellAppearance, required]);\n\n return (\n <>\n {/* The flat frame belongs to the flat camera; a still-perspective placement stages its own depth. */}\n {layout.scene.camera === Layout3DCamera.FLAT_ORTHOGRAPHIC && <FrameSlot layout={layout} frameStyles={frameStyles} crossFadeAppearance={crossFadeAppearance} />}\n <FocalPlaneSettingsContext.Provider value={focalPlane}>\n <Placement {...props} />\n </FocalPlaneSettingsContext.Provider>\n </>\n );\n }\n\n return Object.assign(Layout3DMainContainer, {\n [LAYOUT_3D_MAIN_CONTAINER_BRAND]: true as const,\n captured,\n layout,\n frameStyles,\n });\n}\n\n/**\n * Index 0 of a 3D main container: reads what the frame follows — the theme (`useFrameAppearance`) and the navigation\n * state (#1826) — and hands it to the canvas. Its own component, so a navigation, which changes the navigation state\n * many times a second during some flows, re-renders this slot and never the placement beside it.\n *\n * The navigation signature is every structural zone's top entry (`getTopEntry`, so a tabbed zone reports its visible\n * tab), identified by its URL PATH:\n * - not by its id, which is minted again on every push or replace, so a route sync that re-lands the SAME place would\n * read as a navigation nobody made (the id stands in only for an entry without a URL);\n * - not by its query string, which carries VIEW state on the same content (`?section=`, `?dataMode=`, which the\n * engine updates in place as \"same id, same content\"): switching a board's section tab or a list's mode is not\n * going somewhere, and does not play.\n * The route sync hooks mirror router navigations into those stacks, so a sidebar link and a record opened beside a\n * list both change it; the overlay zone is not a place and does not. While no zone holds anything yet, the signature\n * is empty, which the frame never records (see `FrameDriver.setNavigation`).\n */\nfunction FrameSlot({\n layout,\n frameStyles,\n crossFadeAppearance,\n}: {\n layout: Layout3DDefinition;\n frameStyles: Frame3DStyleOverrides | undefined;\n crossFadeAppearance: boolean;\n}): React.JSX.Element {\n const appearance = useFrameAppearance(layout.scene.frameStyles, frameStyles);\n const navigation = useNavigationState();\n const zones = Object.keys(navigation.state.zones) as Array<keyof typeof navigation.state.zones>;\n const places = zones.map((zone) => {\n const top = navigation.getTopEntry(zone);\n return top ? (top.urlPath?.split(/[?#]/)[0] ?? top.id) : '';\n });\n const navigationSignature = places.some((place) => place !== '') ? zones.map((zone, index) => `${zone}:${places[index]}`).join('|') : '';\n return (\n <FrameCanvasDoor\n appearance={appearance}\n camera={layout.scene.camera}\n crossFadeAppearance={crossFadeAppearance}\n navigationTransition={layout.transitions.navigation}\n sidebarResizeTransition={layout.transitions.sidebarResize}\n zoneFocusTransition={layout.transitions.zoneFocus}\n navigationSignature={navigationSignature}\n focusedZone={navigation.focusedZone}\n />\n );\n}\n"]}
1
+ {"version":3,"file":"layout-3d-main-container.js","sourceRoot":"","sources":["../../../src/layout-3d-main-container.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,EAC1B,2BAA2B,EAC3B,iBAAiB,EACjB,kBAAkB,EAClB,KAAK,GAGN,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,OAAO,EAAE,yBAAyB,EAAE,yBAAyB,EAA2B,MAAM,oCAAoC,CAAC;AACnI,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAA2B,MAAM,+BAA+B,CAAC;AACpH,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAiClE;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,SAAkB;IACxD,OAAO,0BAA0B,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,YAAY,KAAK,iBAAiB,CAAC,SAAS,IAAI,aAAa,IAAI,SAAS,CAAC;AACvI,CAAC;AAED,IAAI,wBAAwB,GAAG,KAAK,CAAC;AAErC;;;;;;GAMG;AACH,MAAM,mCAAmC,GAAG,IAAI,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,UAAU,qBAAqB,CAAC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GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9D,CAAC,CAAC,CAAC;IACH,MAAM,mBAAmB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACzI,OAAO,CACL,KAAC,eAAe,IACd,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,EAC3B,mBAAmB,EAAE,mBAAmB,EACxC,oBAAoB,EAAE,MAAM,CAAC,WAAW,CAAC,UAAU,EACnD,uBAAuB,EAAE,MAAM,CAAC,WAAW,CAAC,aAAa,EACzD,mBAAmB,EAAE,MAAM,CAAC,WAAW,CAAC,SAAS,EACjD,mBAAmB,EAAE,mBAAmB,EACxC,WAAW,EAAE,UAAU,CAAC,WAAW,GACnC,CACH,CAAC;AACJ,CAAC","sourcesContent":["import React, { useEffect } from 'react';\n\nimport {\n brandShellLayoutMainContainer,\n isShellLayoutMainContainer,\n resolveShellLayoutPlacement,\n ShellLayoutFamily,\n useNavigationState,\n useUI,\n type AppLayoutPreset_MainContainer_DefaultProps,\n type ShellLayoutMainContainer,\n} from '@wildo-ai/saas-frontend-lib';\n\nimport { FrameCanvasDoor } from './frame/frame-canvas.lazy';\nimport type { Frame3DStyleOverrides } from './frame/frame-3d-style';\nimport { FocalPlaneSettingsContext, resolveFocalPlaneSettings, type FocalPlaneSettings } from './focal-plane/focal-plane-settings';\nimport { assertSupportedLayout3D, INHERIT_LAYOUT_3D, type Layout3DDefinition } from './layout/layout-3d-definition';\nimport { crossFadesAppearance } from './layout/layout-3d-transition-choreography';\nimport { Layout3DCamera } from './layout/layout-3d-vocabulary';\nimport { useFrameAppearance } from './frame/use-frame-appearance';\n\ntype MainContainerComponent = React.ComponentType<AppLayoutPreset_MainContainer_DefaultProps>;\n\n/** @wildo_source:part:start presets.3d.register-layout facet:layer:frontend facet:family:layout-3d facet:audience:app-developer */\n/** What a 3D main container draws: the layout, and the application's frame-style overrides. */\nexport interface Layout3DOptions {\n /**\n * The layout: its disposal, its scene and its transitions. Defaults to {@link INHERIT_LAYOUT_3D}, the 2D disposal\n * with the frame under it. An application uses ONE layout for its whole life.\n */\n layout?: Layout3DDefinition;\n /** Frame-style overrides layered over the layout's built-in styles. */\n frameStyles?: Frame3DStyleOverrides;\n /**\n * Overrides of the focal plane's numbers (camera distance, layer depth, motion, dims, blurs, window opacity), for\n * {@link FOCAL_PLANE_LAYOUT_3D}; each is checked at registration. Omitted, the defaults.\n */\n focalPlane?: Partial<FocalPlaneSettings>;\n}\n/** @wildo_source:part:end presets.3d.register-layout */\n\n/**\n * A 3D main container: a shell layout main container (`ShellLayoutMainContainer` from `@wildo-ai/saas-frontend-lib`\n * — the component, the container it captured, the layout it draws) whose layout is a 3D one, plus the application's\n * frame-style overrides. It carries the core brand, so the one-layout rule and the re-registration capture treat it\n * exactly as they treat a 2D layout's container.\n */\nexport type Layout3DMainContainer = ShellLayoutMainContainer<Layout3DDefinition> & {\n /** The application's frame-style overrides, when it registered any. */\n readonly frameStyles: Frame3DStyleOverrides | undefined;\n};\n\n/**\n * Whether a registered main container is a 3D one — and so carries the 2D container it wraps. Decided by the family\n * the container was branded for (`ShellLayoutFamily.LAYOUT_3D`): a 2D layout's container is a layout container, not\n * a 3D one, whatever its layout id.\n */\nexport function isLayout3DMainContainer(component: unknown): component is Layout3DMainContainer {\n return isShellLayoutMainContainer(component) && component.layoutFamily === ShellLayoutFamily.LAYOUT_3D && 'frameStyles' in component;\n}\n\nlet appearanceMismatchWarned = false;\n\n/**\n * How long a shell appearance other than the one the layout requires must persist before it is reported. The UI\n * context starts from the DEFAULT theme and resolves the application's own theme a moment later, so the first value\n * this container sees is routinely SEPARATED even in a CONTINUOUS application — measured on Wonder Todos, whose\n * shell renders `bg-transparent` while the first-render value read SEPARATED. Only a value that survives\n * bootstrap is the application's.\n */\nconst APPEARANCE_MISMATCH_REPORT_DELAY_MS = 5000;\n\n/**\n * Build the 3D main container: a captured 2D container, and a layout that either renders it (INHERIT) or arranges\n * the regions with a container of its own (COMPOSED).\n *\n * It renders exactly two children, at FIXED positions:\n *\n * - **index 0, the frame slot** ({@link FrameSlot}): the decorative canvas behind its lazy door (`FrameCanvasDoor`),\n * whose `LazyDoorErrorBoundary` contains any failure of it. The theme and the navigation state are read in the\n * slot, in the DOM tree, and passed to the canvas as props: a theme, mode, breakpoint or navigation change\n * re-renders index 0 and never touches index 1.\n * It is `position: fixed` with NO z-index, `aria-hidden` and `pointer-events: none`.\n * - **index 1, the placement**: the captured 2D container, unchanged, for an INHERIT layout; the layout's own\n * container, composed from the same shell building blocks, otherwise. Either way every region, provider,\n * context, portal and latch is the application's own.\n *\n * Why no wrapper, and no `isolate` (the #1821 text proposed `<div class=\"isolate\">` with the canvas at\n * `-z-10`): `isolate` would make the whole shell ONE stacking context, so anything positioned OUTSIDE it\n * with a lower z-index — the consent prompt (`z-50`) — would paint over the shell's own dialogs\n * (`--z-overlay`, 300). #1830 measured that exact reordering and chose `relative` for the 2D shell root\n * for that reason. Instead, a positioned element with no z-index paints at the z-index:0 level in TREE\n * order, which puts the canvas after the theme's background layer (`UIContext`'s `isolate` wrapper,\n * earlier in the tree) and before the shell root (`relative`, the next sibling) — frame above the theme\n * background, shell above the frame — while every z-index inside the shell keeps its global order.\n *\n * The precondition this places on the placement: its ROOT must be positioned (the 2D default and the\n * header-first container are `relative`, #1830), or its in-flow content paints at a lower level than the frame and\n * under it. The frame never takes a click either way — it handles no pointer events at all.\n *\n * Why fixed positions: a canvas failure empties only index 0. The placement never moves and keeps one component\n * type for the application's life, so it never remounts — a remount there would unmount every navigation zone and\n * lose its state.\n */\nexport function create3DMainContainer(captured: MainContainerComponent, options: Layout3DOptions = {}): Layout3DMainContainer {\n const layout = options.layout ?? INHERIT_LAYOUT_3D;\n const frameStyles = options.frameStyles;\n // Checked here, at registration, like the layout itself. Only the still-perspective camera reads them: settings a\n // layout would silently ignore are refused instead.\n if (options.focalPlane !== undefined && layout.scene.camera !== Layout3DCamera.STILL_PERSPECTIVE) {\n throw new Error(`register3DLayout(): 'focalPlane' tunes the focal-plane layout, and the layout '${layout.id}' is not seen through its still camera.`);\n }\n const focalPlane = resolveFocalPlaneSettings(options.focalPlane);\n // A camera, transition kind or rest pose the renderer does not implement is refused here, at registration.\n assertSupportedLayout3D(layout);\n const crossFadeAppearance = crossFadesAppearance(layout.transitions.appearance);\n // Chosen ONCE, outside the component: the element at index 1 keeps one type for the application's life, so it\n // never remounts.\n const Placement = resolveShellLayoutPlacement(captured, layout);\n function Layout3DMainContainer(props: AppLayoutPreset_MainContainer_DefaultProps): React.JSX.Element {\n const { shellAppearance } = useUI();\n const required = layout.constraints.requiredShellAppearance;\n\n useEffect(() => {\n // The frame is visible only where regions paint nothing. A layout states the shell appearance it is designed\n // for; any other is the application's choice to correct, so it is said once and nothing switches.\n if (required === null || shellAppearance === required || appearanceMismatchWarned) return undefined;\n const report = setTimeout(() => {\n // Checked again here: several containers (or a remount) may have armed a timer before the first fired.\n if (appearanceMismatchWarned) return;\n appearanceMismatchWarned = true;\n console.warn(\n `[presets-components-3d] the 3D layout '${layout.id}' is designed for a '${String(required)}' shell, and this theme's `\n + `shell appearance is '${String(shellAppearance)}': opaque regions will cover the frame drawn under them.`,\n );\n }, APPEARANCE_MISMATCH_REPORT_DELAY_MS);\n return () => clearTimeout(report);\n }, [shellAppearance, required]);\n\n return (\n <>\n {/* The flat frame belongs to the flat camera; a still-perspective placement stages its own depth. */}\n {layout.scene.camera === Layout3DCamera.FLAT_ORTHOGRAPHIC && <FrameSlot layout={layout} frameStyles={frameStyles} crossFadeAppearance={crossFadeAppearance} />}\n <FocalPlaneSettingsContext.Provider value={focalPlane}>\n <Placement {...props} />\n </FocalPlaneSettingsContext.Provider>\n </>\n );\n }\n\n return brandShellLayoutMainContainer(Layout3DMainContainer, captured, layout, ShellLayoutFamily.LAYOUT_3D, { frameStyles });\n}\n\n/**\n * Index 0 of a 3D main container: reads what the frame follows — the theme (`useFrameAppearance`) and the navigation\n * state (#1826) — and hands it to the canvas. Its own component, so a navigation, which changes the navigation state\n * many times a second during some flows, re-renders this slot and never the placement beside it.\n *\n * The navigation signature is every structural zone's top entry (`getTopEntry`, so a tabbed zone reports its visible\n * tab), identified by its URL PATH:\n * - not by its id, which is minted again on every push or replace, so a route sync that re-lands the SAME place would\n * read as a navigation nobody made (the id stands in only for an entry without a URL);\n * - not by its query string, which carries VIEW state on the same content (`?section=`, `?dataMode=`, which the\n * engine updates in place as \"same id, same content\"): switching a board's section tab or a list's mode is not\n * going somewhere, and does not play.\n * The route sync hooks mirror router navigations into those stacks, so a sidebar link and a record opened beside a\n * list both change it; the overlay zone is not a place and does not. While no zone holds anything yet, the signature\n * is empty, which the frame never records (see `FrameDriver.setNavigation`).\n */\nfunction FrameSlot({\n layout,\n frameStyles,\n crossFadeAppearance,\n}: {\n layout: Layout3DDefinition;\n frameStyles: Frame3DStyleOverrides | undefined;\n crossFadeAppearance: boolean;\n}): React.JSX.Element {\n const appearance = useFrameAppearance(layout.scene.frameStyles, frameStyles);\n const navigation = useNavigationState();\n const zones = Object.keys(navigation.state.zones) as Array<keyof typeof navigation.state.zones>;\n const places = zones.map((zone) => {\n const top = navigation.getTopEntry(zone);\n return top ? (top.urlPath?.split(/[?#]/)[0] ?? top.id) : '';\n });\n const navigationSignature = places.some((place) => place !== '') ? zones.map((zone, index) => `${zone}:${places[index]}`).join('|') : '';\n return (\n <FrameCanvasDoor\n appearance={appearance}\n camera={layout.scene.camera}\n crossFadeAppearance={crossFadeAppearance}\n navigationTransition={layout.transitions.navigation}\n sidebarResizeTransition={layout.transitions.sidebarResize}\n zoneFocusTransition={layout.transitions.zoneFocus}\n navigationSignature={navigationSignature}\n focusedZone={navigation.focusedZone}\n />\n );\n}\n"]}
@@ -30,10 +30,14 @@ import { type Layout3DOptions } from './layout-3d-main-container';
30
30
  * `options.layout` selects the layout (`INHERIT_LAYOUT_3D` by default); `options.frameStyles` layers an
31
31
  * application's frame styles over the layout's own (per theme id, or for all themes).
32
32
  *
33
- * - **One layout per application.** A registration that finds a 3D container of a DIFFERENT layout already
34
- * registered refuses: an application is not 3D in two ways, and a silent replacement would hide which one it
35
- * is. The same layout again is idempotent. (A layout changed in code during a hot reload needs a full page
36
- * reload, because the registry outlives the hot reload.)
33
+ * - **One layout per application, 2D or 3D.** A registration that finds a layout container of a DIFFERENT layout
34
+ * already registered refuses — including a 2D layout registered with `registerShellLayout`: an application is
35
+ * laid out one way, and a silent replacement would hide which one it is. The same layout again is idempotent. (A
36
+ * layout changed in code during a hot reload needs a full page reload, because the registry outlives the hot
37
+ * reload.)
38
+ *
39
+ * It is `registerShellLayout` from `@wildo-ai/saas-frontend-lib` — the registration every layout family shares —
40
+ * with the 3D built-ins guarded and a container that adds the frame and the focal-plane settings.
37
41
  */
38
42
  export declare function register3DLayout(options?: Layout3DOptions): FrontendComponentRegistration;
39
43
  /** @wildo_source:part:end presets.3d.register-layout */
@@ -1 +1 @@
1
- {"version":3,"file":"register-3d-layout.d.ts","sourceRoot":"","sources":["../../../src/register-3d-layout.ts"],"names":[],"mappings":"AACA,OAAO,EAA4B,KAAK,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAE3G,OAAO,EAAkD,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAIlH,mIAAmI;AACnI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,eAAoB,GAAG,6BAA6B,CAiC7F;AACD,wDAAwD"}
1
+ {"version":3,"file":"register-3d-layout.d.ts","sourceRoot":"","sources":["../../../src/register-3d-layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0C,KAAK,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAEzH,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAGzF,mIAAmI;AACnI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,eAAoB,GAAG,6BAA6B,CAO7F;AACD,wDAAwD"}
@@ -1,8 +1,6 @@
1
- import { CorePresetNames, FrontendComponentType } from '@wildo-ai/presets-components-models';
2
- import { ComponentRegistryService } from '@wildo-ai/saas-frontend-lib';
3
- import { create3DMainContainer, isLayout3DMainContainer } from './layout-3d-main-container.js';
1
+ import { registerShellLayout, ShellLayoutFamily } from '@wildo-ai/saas-frontend-lib';
2
+ import { create3DMainContainer } from './layout-3d-main-container.js';
4
3
  import { BUILT_IN_LAYOUTS_3D, INHERIT_LAYOUT_3D } from './layout/layout-3d-definition.js';
5
- import { Layout3DId } from './layout/layout-3d-vocabulary.js';
6
4
  /** @wildo_source:part:start presets.3d.register-layout facet:layer:frontend facet:family:layout-3d facet:audience:app-developer */
7
5
  /**
8
6
  * Make an application's signed-in shell 3D: the shell's regions — unchanged HTML, with all their contexts —
@@ -33,40 +31,22 @@ import { Layout3DId } from './layout/layout-3d-vocabulary.js';
33
31
  * `options.layout` selects the layout (`INHERIT_LAYOUT_3D` by default); `options.frameStyles` layers an
34
32
  * application's frame styles over the layout's own (per theme id, or for all themes).
35
33
  *
36
- * - **One layout per application.** A registration that finds a 3D container of a DIFFERENT layout already
37
- * registered refuses: an application is not 3D in two ways, and a silent replacement would hide which one it
38
- * is. The same layout again is idempotent. (A layout changed in code during a hot reload needs a full page
39
- * reload, because the registry outlives the hot reload.)
34
+ * - **One layout per application, 2D or 3D.** A registration that finds a layout container of a DIFFERENT layout
35
+ * already registered refuses — including a 2D layout registered with `registerShellLayout`: an application is
36
+ * laid out one way, and a silent replacement would hide which one it is. The same layout again is idempotent. (A
37
+ * layout changed in code during a hot reload needs a full page reload, because the registry outlives the hot
38
+ * reload.)
39
+ *
40
+ * It is `registerShellLayout` from `@wildo-ai/saas-frontend-lib` — the registration every layout family shares —
41
+ * with the 3D built-ins guarded and a container that adds the frame and the focal-plane settings.
40
42
  */
41
43
  export function register3DLayout(options = {}) {
42
- let capturedIsConfigurable = false;
43
- return {
44
- componentRef: FrontendComponentType.APP_LAYOUTS_MAIN_CONTAINER,
45
- preset: CorePresetNames.DEFAULT,
46
- get isConfigurable() {
47
- return capturedIsConfigurable;
48
- },
49
- loadComponent: async () => {
50
- const current = ComponentRegistryService.resolve(FrontendComponentType.APP_LAYOUTS_MAIN_CONTAINER, CorePresetNames.DEFAULT);
51
- if (!current) {
52
- throw new Error('register3DLayout(): no Default APP_LAYOUTS_MAIN_CONTAINER is registered to capture. Call it from the engine module\'s '
53
- + '`componentRegistrations`, which run after the framework presets — not from a module evaluated before them.');
54
- }
55
- const layout = options.layout ?? INHERIT_LAYOUT_3D;
56
- // An application's own layout may not borrow a built-in id: the one-layout check compares ids, and a borrowed
57
- // one would make two different layouts look like the same.
58
- if (Object.values(Layout3DId).includes(layout.id) && BUILT_IN_LAYOUTS_3D[layout.id] !== layout) {
59
- throw new Error(`register3DLayout(): the layout id '${layout.id}' belongs to a built-in layout; give the application's own layout an id of its own.`);
60
- }
61
- if (isLayout3DMainContainer(current) && current.layout.id !== layout.id) {
62
- throw new Error(`register3DLayout(): this application already registered the 3D layout '${current.layout.id}' and now asks for '${layout.id}'. `
63
- + 'An application uses one layout: remove the other registration — or, if you just changed the layout in code, '
64
- + 'reload the page (the component registry outlives a hot reload).');
65
- }
66
- capturedIsConfigurable = ComponentRegistryService.getMetadata(FrontendComponentType.APP_LAYOUTS_MAIN_CONTAINER, CorePresetNames.DEFAULT)?.isConfigurable ?? false;
67
- return create3DMainContainer(isLayout3DMainContainer(current) ? current.captured : current, options);
68
- },
69
- };
44
+ return registerShellLayout(options.layout ?? INHERIT_LAYOUT_3D, {
45
+ callerName: 'register3DLayout()',
46
+ family: ShellLayoutFamily.LAYOUT_3D,
47
+ builtInLayouts: BUILT_IN_LAYOUTS_3D,
48
+ createContainer: (captured, layout) => create3DMainContainer(captured, { ...options, layout }),
49
+ });
70
50
  }
71
51
  /** @wildo_source:part:end presets.3d.register-layout */
72
52
  //# sourceMappingURL=register-3d-layout.js.map