@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
@@ -0,0 +1,17 @@
1
+ import { type ShellMotionAxis } from '@wildo-ai/saas-frontend-lib';
2
+ import type { FocalPlaneSettings } from './focal-plane-settings';
3
+ /** The easing every focal-plane motion shares: a quick start that settles softly (the prototype's curve). */
4
+ export declare const FOCAL_PLANE_EASING = "cubic-bezier(0.2, 0.9, 0.25, 1)";
5
+ /**
6
+ * The focal plane's axis for the core motion building blocks: everything moves straight along the camera's line of
7
+ * sight, never sideways and never angled.
8
+ *
9
+ * - A ghost is seen from the stage's vanishing point (its origin), at a depth the stylesheet's transform reads from
10
+ * `--fp-z`: at rest where the pane stood, one layer back and dimmed behind an expanded pane, a layer and a half back
11
+ * as a dismissed pane goes.
12
+ * - A pane whose content changes dips half a layer back and returns, fading a little; a column that folds dips less.
13
+ *
14
+ * `reducedMotion` gives a still axis (`durationMs: 0`), which turns every building block off.
15
+ */
16
+ export declare function createFocalPlaneDepthAxis(settings: FocalPlaneSettings, reducedMotion: boolean): ShellMotionAxis;
17
+ //# sourceMappingURL=focal-plane-depth-axis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"focal-plane-depth-axis.d.ts","sourceRoot":"","sources":["../../../../src/focal-plane/focal-plane-depth-axis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyF,KAAK,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE1J,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAGjE,6GAA6G;AAC7G,eAAO,MAAM,kBAAkB,oCAAoC,CAAC;AAEpE;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,kBAAkB,EAAE,aAAa,EAAE,OAAO,GAAG,eAAe,CA0C/G"}
@@ -0,0 +1,59 @@
1
+ import { ShellDialogArrival, ShellGhostPose, ShellMotionDip, ShellPaneArrival, ShellPaneResize } from '@wildo-ai/saas-frontend-lib';
2
+ import { vanishingOrigin } from './focal-plane-vanishing-point.js';
3
+ /** The easing every focal-plane motion shares: a quick start that settles softly (the prototype's curve). */
4
+ export const FOCAL_PLANE_EASING = 'cubic-bezier(0.2, 0.9, 0.25, 1)';
5
+ /**
6
+ * The focal plane's axis for the core motion building blocks: everything moves straight along the camera's line of
7
+ * sight, never sideways and never angled.
8
+ *
9
+ * - A ghost is seen from the stage's vanishing point (its origin), at a depth the stylesheet's transform reads from
10
+ * `--fp-z`: at rest where the pane stood, one layer back and dimmed behind an expanded pane, a layer and a half back
11
+ * as a dismissed pane goes.
12
+ * - A pane whose content changes dips half a layer back and returns, fading a little; a column that folds dips less.
13
+ *
14
+ * `reducedMotion` gives a still axis (`durationMs: 0`), which turns every building block off.
15
+ */
16
+ export function createFocalPlaneDepthAxis(settings, reducedMotion) {
17
+ const depth = (layers) => `perspective(${settings.cameraDistancePx}px) translate3d(0, 0, ${-settings.layerDepthPx * layers}px)`;
18
+ return {
19
+ durationMs: reducedMotion ? 0 : settings.motionMs,
20
+ easing: FOCAL_PLANE_EASING,
21
+ // The windows are glass: a hidden pane's picture is SEEN, stepped back, through the expanded one.
22
+ drawsHiddenPanePicture: true,
23
+ // Depth is the focal plane's whole motion: panes arrive from depth (its stylesheet), sizes change at once, dialogs
24
+ // rise (its stylesheet), and rows do not cascade.
25
+ paneArrival: ShellPaneArrival.STYLESHEET,
26
+ paneResize: ShellPaneResize.INSTANT,
27
+ dialogArrival: ShellDialogArrival.STYLESHEET,
28
+ cascadesRows: false,
29
+ ghostPose(pose, { rect, stage }) {
30
+ switch (pose) {
31
+ case ShellGhostPose.REST: {
32
+ const origin = vanishingOrigin(rect, stage);
33
+ return { '--fp-ox': `${origin.x}px`, '--fp-oy': `${origin.y}px`, '--fp-z': '0px' };
34
+ }
35
+ case ShellGhostPose.BEHIND:
36
+ return { '--fp-z': `${-settings.layerDepthPx}px`, '--fp-filter': `brightness(${1 - settings.recedeDim}) saturate(${1 - settings.recedeDim * 0.9})` };
37
+ case ShellGhostPose.DISCARDED:
38
+ return { '--fp-z': `${-settings.layerDepthPx * 1.5}px` };
39
+ default: {
40
+ const unknownPose = pose;
41
+ throw new Error(`The focal plane has no ghost pose '${String(unknownPose)}'.`);
42
+ }
43
+ }
44
+ },
45
+ dipPeak(dip) {
46
+ switch (dip) {
47
+ case ShellMotionDip.PANE_SWAP:
48
+ return { offset: 0.45, transform: depth(0.5), opacity: 0.55 };
49
+ case ShellMotionDip.COLUMN_RESIZE:
50
+ return { offset: 0.5, transform: depth(0.3) };
51
+ default: {
52
+ const unknownDip = dip;
53
+ throw new Error(`The focal plane has no dip '${String(unknownDip)}'.`);
54
+ }
55
+ }
56
+ },
57
+ };
58
+ }
59
+ //# sourceMappingURL=focal-plane-depth-axis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"focal-plane-depth-axis.js","sourceRoot":"","sources":["../../../../src/focal-plane/focal-plane-depth-axis.ts"],"names":[],"mappings":"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AC,YAAY,IAAI,EAAE,aAAa,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,SAAS,cAAc,CAAC,GAAG,QAAQ,CAAC,SAAS,GAAG,GAAG,GAAG,EAAE,CAAC;gBACvJ,KAAK,cAAc,CAAC,SAAS;oBAC3B,OAAO,EAAE,QAAQ,EAAE,GAAG,CAAC,QAAQ,CAAC,YAAY,GAAG,GAAG,IAAI,EAAE,CAAC;gBAC3D,OAAO,CAAC,CAAC,CAAC;oBACR,MAAM,WAAW,GAAU,IAAI,CAAC;oBAChC,MAAM,IAAI,KAAK,CAAC,sCAAsC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;gBACjF,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,CAAC,GAAG;YACT,QAAQ,GAAG,EAAE,CAAC;gBACZ,KAAK,cAAc,CAAC,SAAS;oBAC3B,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gBAChE,KAAK,cAAc,CAAC,aAAa;oBAC/B,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;gBAChD,OAAO,CAAC,CAAC,CAAC;oBACR,MAAM,UAAU,GAAU,GAAG,CAAC;oBAC9B,MAAM,IAAI,KAAK,CAAC,+BAA+B,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;gBACzE,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { ShellDialogArrival, ShellGhostPose, ShellMotionDip, ShellPaneArrival, ShellPaneResize, type ShellMotionAxis } from '@wildo-ai/saas-frontend-lib';\n\nimport type { FocalPlaneSettings } from './focal-plane-settings';\nimport { vanishingOrigin } from './focal-plane-vanishing-point';\n\n/** The easing every focal-plane motion shares: a quick start that settles softly (the prototype's curve). */\nexport const FOCAL_PLANE_EASING = 'cubic-bezier(0.2, 0.9, 0.25, 1)';\n\n/**\n * The focal plane's axis for the core motion building blocks: everything moves straight along the camera's line of\n * sight, never sideways and never angled.\n *\n * - A ghost is seen from the stage's vanishing point (its origin), at a depth the stylesheet's transform reads from\n * `--fp-z`: at rest where the pane stood, one layer back and dimmed behind an expanded pane, a layer and a half back\n * as a dismissed pane goes.\n * - A pane whose content changes dips half a layer back and returns, fading a little; a column that folds dips less.\n *\n * `reducedMotion` gives a still axis (`durationMs: 0`), which turns every building block off.\n */\nexport function createFocalPlaneDepthAxis(settings: FocalPlaneSettings, reducedMotion: boolean): ShellMotionAxis {\n const depth = (layers: number): string => `perspective(${settings.cameraDistancePx}px) translate3d(0, 0, ${-settings.layerDepthPx * layers}px)`;\n return {\n durationMs: reducedMotion ? 0 : settings.motionMs,\n easing: FOCAL_PLANE_EASING,\n // The windows are glass: a hidden pane's picture is SEEN, stepped back, through the expanded one.\n drawsHiddenPanePicture: true,\n // Depth is the focal plane's whole motion: panes arrive from depth (its stylesheet), sizes change at once, dialogs\n // rise (its stylesheet), and rows do not cascade.\n paneArrival: ShellPaneArrival.STYLESHEET,\n paneResize: ShellPaneResize.INSTANT,\n dialogArrival: ShellDialogArrival.STYLESHEET,\n cascadesRows: false,\n ghostPose(pose, { rect, stage }) {\n switch (pose) {\n case ShellGhostPose.REST: {\n const origin = vanishingOrigin(rect, stage);\n return { '--fp-ox': `${origin.x}px`, '--fp-oy': `${origin.y}px`, '--fp-z': '0px' };\n }\n case ShellGhostPose.BEHIND:\n return { '--fp-z': `${-settings.layerDepthPx}px`, '--fp-filter': `brightness(${1 - settings.recedeDim}) saturate(${1 - settings.recedeDim * 0.9})` };\n case ShellGhostPose.DISCARDED:\n return { '--fp-z': `${-settings.layerDepthPx * 1.5}px` };\n default: {\n const unknownPose: never = pose;\n throw new Error(`The focal plane has no ghost pose '${String(unknownPose)}'.`);\n }\n }\n },\n dipPeak(dip) {\n switch (dip) {\n case ShellMotionDip.PANE_SWAP:\n return { offset: 0.45, transform: depth(0.5), opacity: 0.55 };\n case ShellMotionDip.COLUMN_RESIZE:\n return { offset: 0.5, transform: depth(0.3) };\n default: {\n const unknownDip: never = dip;\n throw new Error(`The focal plane has no dip '${String(unknownDip)}'.`);\n }\n }\n },\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"focal-plane-shell-container.d.ts","sourceRoot":"","sources":["../../../../src/focal-plane/focal-plane-shell-container.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAG5E,OAAO,EAcL,KAAK,0CAA0C,EAChD,MAAM,6BAA6B,CAAC;AAOrC;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,EAAE,QAAQ,EAAE,EAAE,0CAA0C,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CASpH"}
1
+ {"version":3,"file":"focal-plane-shell-container.d.ts","sourceRoot":"","sources":["../../../../src/focal-plane/focal-plane-shell-container.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAGhE,OAAO,EAiBL,KAAK,0CAA0C,EAChD,MAAM,6BAA6B,CAAC;AAOrC;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,EAAE,QAAQ,EAAE,EAAE,0CAA0C,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CASpH"}
@@ -1,11 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect, useLayoutEffect, useRef, useState } from 'react';
2
+ import { useLayoutEffect, useMemo, useRef } from 'react';
3
3
  import { HorizontalPlacement, ShellRegion, SurfaceVariant, VerticalPlacement } from '@wildo-ai/presets-components-models';
4
- import { AppShellContentOutlet, AppShellLoadingState, AppShellOverlayPortalLayer, AppShellOverlaysOutlet, AppShellProviders, AppShellRegionOutlet, NON_CANONICAL_SHELL_SURFACE_POLICY_OVERRIDE, Surface, useAppShellFirstReady, useAppShellLayout, NavigationZone, useNavigationState, useUI, } from '@wildo-ai/saas-frontend-lib';
4
+ import { AppShellContentOutlet, AppShellLoadingState, AppShellOverlayPortalLayer, AppShellOverlaysOutlet, AppShellProviders, AppShellRegionOutlet, NON_CANONICAL_SHELL_SURFACE_POLICY_OVERRIDE, Surface, useAppShellFirstReady, useAppShellLayout, SHELL_GHOST_LAYER_ATTRIBUTE, SHELL_OBJECT_ATTRIBUTE, ShellGhostLayer, useNavigationState, useShellMotion, useUI, } from '@wildo-ai/saas-frontend-lib';
5
+ import { createFocalPlaneDepthAxis } from './focal-plane-depth-axis.js';
5
6
  import { focalPlaneCssVariables, useFocalPlaneSettings } from './focal-plane-settings.js';
6
7
  import { installFocalPlaneStylesheet } from './focal-plane-stylesheet.js';
7
- import { usePaneDepth } from './use-pane-depth.js';
8
- import { useSharedVanishingPoint } from './use-shared-vanishing-point.js';
8
+ import { writeVanishingOrigin } from './focal-plane-vanishing-point.js';
9
9
  /**
10
10
  * The focal plane's placement (#2049). The regions are the application's own, rendered by the standard outlets with
11
11
  * every context; this container arranges them as floating glass windows over an ambient background, and marks each
@@ -28,120 +28,11 @@ function FocalPlaneStage({ children }) {
28
28
  const settings = useFocalPlaneSettings();
29
29
  const navigation = useNavigationState();
30
30
  useLayoutEffect(() => installFocalPlaneStylesheet(), []);
31
- useSharedVanishingPoint(rootRef);
32
- const { dip } = usePaneDepth(rootRef, settings, prefersReducedMotion);
33
- const front = useFrontPane(rootRef, navigation.focusedZone);
34
- useColumnDip(rootRef, settings, prefersReducedMotion);
35
- usePlaceChanges(navigation, (zone, how) => {
36
- if (how === PlaceChange.CHANGED)
37
- dip(zone);
38
- front.bringForward(zone);
39
- });
40
- const shell = (content) => _jsx("div", { "data-fp-object": "shell", children: content });
41
- return (_jsx(Surface, { asChild: true, emitPolicyVars: false, variant: SurfaceVariant.SHELL, policyOverride: NON_CANONICAL_SHELL_SURFACE_POLICY_OVERRIDE, children: _jsxs("div", { ref: rootRef, "data-focal-plane": "", "data-fp-focus": front.zone, style: focalPlaneCssVariables(settings, prefersReducedMotion), children: [_jsx("div", { className: "fp-ghosts", "aria-hidden": "true" }), _jsxs("div", { className: "fp-backdrop", "aria-hidden": "true", children: [_jsx("i", { className: "fp-a" }), _jsx("i", { className: "fp-b" }), _jsx("i", { className: "fp-c" })] }), _jsxs("div", { className: "fp-grid", children: [shell(_jsx(AppShellRegionOutlet, { region: ShellRegion.STATUS_BAR, placement: VerticalPlacement.TOP })), shell(_jsx(AppShellRegionOutlet, { region: ShellRegion.MENUBAR })), _jsxs("div", { className: "fp-row fp-middle", children: [shell(_jsx(AppShellRegionOutlet, { region: ShellRegion.ACTIVITY_BAR })), shell(_jsx(AppShellRegionOutlet, { region: ShellRegion.SIDEBAR, placement: HorizontalPlacement.START })), shell(_jsx(AppShellRegionOutlet, { region: ShellRegion.UTILITY_PANEL, placement: HorizontalPlacement.START })), _jsxs("div", { className: "fp-column", children: [shell(_jsx(AppShellRegionOutlet, { region: ShellRegion.TOOLBAR })), _jsx("div", { className: "fp-content", children: _jsx(AppShellContentOutlet, { className: "flex-1 relative min-w-0 min-h-0", children: children }) })] }), shell(_jsx(AppShellRegionOutlet, { region: ShellRegion.UTILITY_PANEL, placement: HorizontalPlacement.END })), shell(_jsx(AppShellRegionOutlet, { region: ShellRegion.SIDEBAR, placement: HorizontalPlacement.END }))] }), shell(_jsx(AppShellRegionOutlet, { region: ShellRegion.STATUS_BAR, placement: VerticalPlacement.BOTTOM }))] }), _jsx("div", { className: "fp-ghosts fp-ghosts-front", "aria-hidden": "true" }), _jsx(AppShellOverlaysOutlet, {}), _jsx(AppShellOverlayPortalLayer, {})] }) }));
42
- }
43
- /**
44
- * Which pane is in front: the one you last pressed in or moved keyboard focus into, or the one that last opened or
45
- * changed place. Kept by the layout rather than read from the navigation state's `focusedZone` alone, because that
46
- * follows only interaction: opening a record beside the list leaves the LIST focused (the click happened there), and
47
- * the prototype this layout follows brings the new pane forward. The engine's focus state is never written.
48
- */
49
- function useFrontPane(rootRef, focusedZone) {
50
- const [zone, setZone] = useState(focusedZone);
51
- useEffect(() => setZone(focusedZone), [focusedZone]);
52
- useEffect(() => {
53
- const root = rootRef.current;
54
- if (!root)
55
- return undefined;
56
- const fromEvent = (event) => {
57
- const target = event.target instanceof Element ? event.target : null;
58
- const pane = target?.closest(`[data-component-area="${ShellRegion.CONTENT}"] :is([data-content-area], [data-panel-id^="nav-"])`);
59
- const name = pane?.dataset.contentArea ?? pane?.dataset.panelId?.replace(/^nav-/, '');
60
- if (name)
61
- setZone(name);
62
- };
63
- root.addEventListener('pointerdown', fromEvent, true);
64
- root.addEventListener('focusin', fromEvent, true);
65
- return () => {
66
- root.removeEventListener('pointerdown', fromEvent, true);
67
- root.removeEventListener('focusin', fromEvent, true);
68
- };
69
- }, [rootRef]);
70
- return { zone, bringForward: setZone };
71
- }
72
- const STRUCTURAL_ZONES = new Set([NavigationZone.PRIMARY, NavigationZone.SECONDARY, NavigationZone.COMPANION]);
73
- /** How a navigation zone's place moved between two renders. */
74
- var PlaceChange;
75
- (function (PlaceChange) {
76
- /** The zone held nothing and now holds a place: a pane opened. */
77
- PlaceChange["APPEARED"] = "appeared";
78
- /** The zone showed one place and now shows another, in the same pane. */
79
- PlaceChange["CHANGED"] = "changed";
80
- })(PlaceChange || (PlaceChange = {}));
81
- /**
82
- * A zone that APPEARS (it held nothing, now it holds a place) or CHANGES place (the same zone now shows another URL
83
- * path) is reported: a change dips back and returns, and either way the pane comes forward. The arrival itself is the
84
- * stylesheet's (a side pane arrives from depth when it mounts).
85
- */
86
- function usePlaceChanges(navigation, onPlace) {
87
- // The structural zones only: the overlay zone is a dialog, not a pane, and must never become the "front pane".
88
- const zones = Object.keys(navigation.state.zones).filter((zone) => STRUCTURAL_ZONES.has(String(zone)));
89
- const places = zones.map((zone) => {
90
- const top = navigation.getTopEntry(zone);
91
- return top ? (top.urlPath?.split(/[?#]/)[0] ?? top.id) : '';
92
- });
93
- const signature = zones.map((zone, index) => `${String(zone)}:${places[index]}`).join('|');
94
- const previous = useRef(null);
95
- useEffect(() => {
96
- const current = new Map(zones.map((zone, index) => [String(zone), places[index] ?? '']));
97
- const before = previous.current;
98
- previous.current = current;
99
- if (!before)
100
- return;
101
- for (const [zone, place] of current) {
102
- const was = before.get(zone) ?? '';
103
- if (place === '' || was === place)
104
- continue;
105
- onPlace(zone, was === '' ? PlaceChange.APPEARED : PlaceChange.CHANGED);
106
- }
107
- // `signature` is the whole dependency: the zones and places are derived from the same render.
108
- }, [signature]);
109
- }
110
- /**
111
- * A side column (the sidebar folding to its rail or unfolding) dips back and returns while the panes re-arrange. The
112
- * width animates over many frames, so the dip plays once per settled change of more than a few pixels, not per frame.
113
- * The dip runs on this layout's OWN wrapper, through the Web Animations API, so nothing is written on a region.
114
- */
115
- function useColumnDip(rootRef, settings, reducedMotion) {
116
- useEffect(() => {
117
- const root = rootRef.current;
118
- if (!root || reducedMotion || typeof ResizeObserver === 'undefined')
119
- return undefined;
120
- const columns = [...root.querySelectorAll('[data-fp-object="shell"]')].filter((wrapper) => wrapper.querySelector(`:scope > [data-component-area="${ShellRegion.SIDEBAR}"], :scope > [data-component-area="${ShellRegion.UTILITY_PANEL}"]`));
121
- const settled = new Map();
122
- const lastDip = new Map();
123
- const observer = new ResizeObserver((entries) => {
124
- for (const entry of entries) {
125
- const wrapper = entry.target;
126
- const width = wrapper.offsetWidth;
127
- const previous = settled.get(wrapper);
128
- if (previous === undefined || width === 0) {
129
- settled.set(wrapper, width);
130
- continue;
131
- }
132
- if (Math.abs(width - previous) <= 24)
133
- continue;
134
- settled.set(wrapper, width);
135
- const now = performance.now();
136
- if (now - (lastDip.get(wrapper) ?? 0) < settings.motionMs)
137
- continue;
138
- lastDip.set(wrapper, now);
139
- wrapper.animate([{ offset: 0.5, transform: `perspective(${settings.cameraDistancePx}px) translate3d(0, 0, ${-settings.layerDepthPx * 0.3}px)` }], { duration: settings.motionMs, easing: 'cubic-bezier(0.2, 0.9, 0.25, 1)' });
140
- }
141
- });
142
- for (const column of columns)
143
- observer.observe(column);
144
- return () => observer.disconnect();
145
- }, [rootRef, settings, reducedMotion]);
31
+ const axis = useMemo(() => createFocalPlaneDepthAxis(settings, prefersReducedMotion), [settings, prefersReducedMotion]);
32
+ // The core motion building blocks: the pane in front, place changes, ghosts and dips, seen along the depth axis. Each
33
+ // object's measurement also sets its origin on the one vanishing point.
34
+ const { frontZone } = useShellMotion(rootRef, { axis, navigation, onObjectMeasured: writeVanishingOrigin });
35
+ const shell = (content) => _jsx("div", { [SHELL_OBJECT_ATTRIBUTE]: 'region', children: content });
36
+ return (_jsx(Surface, { asChild: true, emitPolicyVars: false, variant: SurfaceVariant.SHELL, policyOverride: NON_CANONICAL_SHELL_SURFACE_POLICY_OVERRIDE, children: _jsxs("div", { ref: rootRef, "data-focal-plane": "", "data-fp-focus": frontZone, style: focalPlaneCssVariables(settings, prefersReducedMotion), children: [_jsx("div", { [SHELL_GHOST_LAYER_ATTRIBUTE]: ShellGhostLayer.BACK, "aria-hidden": "true" }), _jsxs("div", { className: "fp-backdrop", "aria-hidden": "true", children: [_jsx("i", { className: "fp-a" }), _jsx("i", { className: "fp-b" }), _jsx("i", { className: "fp-c" })] }), _jsxs("div", { className: "fp-grid", children: [shell(_jsx(AppShellRegionOutlet, { region: ShellRegion.STATUS_BAR, placement: VerticalPlacement.TOP })), shell(_jsx(AppShellRegionOutlet, { region: ShellRegion.MENUBAR })), _jsxs("div", { className: "fp-row fp-middle", children: [shell(_jsx(AppShellRegionOutlet, { region: ShellRegion.ACTIVITY_BAR })), shell(_jsx(AppShellRegionOutlet, { region: ShellRegion.SIDEBAR, placement: HorizontalPlacement.START })), shell(_jsx(AppShellRegionOutlet, { region: ShellRegion.UTILITY_PANEL, placement: HorizontalPlacement.START })), _jsxs("div", { className: "fp-column", children: [shell(_jsx(AppShellRegionOutlet, { region: ShellRegion.TOOLBAR })), _jsx("div", { className: "fp-content", children: _jsx(AppShellContentOutlet, { className: "flex-1 relative min-w-0 min-h-0", children: children }) })] }), shell(_jsx(AppShellRegionOutlet, { region: ShellRegion.UTILITY_PANEL, placement: HorizontalPlacement.END })), shell(_jsx(AppShellRegionOutlet, { region: ShellRegion.SIDEBAR, placement: HorizontalPlacement.END }))] }), shell(_jsx(AppShellRegionOutlet, { region: ShellRegion.STATUS_BAR, placement: VerticalPlacement.BOTTOM }))] }), _jsx("div", { [SHELL_GHOST_LAYER_ATTRIBUTE]: ShellGhostLayer.FRONT, "aria-hidden": "true" }), _jsx(AppShellOverlaysOutlet, {}), _jsx(AppShellOverlayPortalLayer, {})] }) }));
146
37
  }
147
38
  //# sourceMappingURL=focal-plane-shell-container.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"focal-plane-shell-container.js","sourceRoot":"","sources":["../../../../src/focal-plane/focal-plane-shell-container.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5E,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAC1H,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,0BAA0B,EAC1B,sBAAsB,EACtB,iBAAiB,EACjB,oBAAoB,EACpB,2CAA2C,EAC3C,OAAO,EACP,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,KAAK,GAEN,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAA2B,MAAM,wBAAwB,CAAC;AAChH,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE;;;;;;;;GAQG;AACH,MAAM,UAAU,wBAAwB,CAAC,EAAE,QAAQ,EAA8C;IAC/F,MAAM,UAAU,GAAG,iBAAiB,EAAE,CAA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,KAAK,CAAC,CAAC;gBAC5B,MAAM,GAAG,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;gBAC9B,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,QAAQ,CAAC,QAAQ;oBAAE,SAAS;gBACpE,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;gBAC1B,OAAO,CAAC,OAAO,CACb,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,eAAe,QAAQ,CAAC,gBAAgB,yBAAyB,CAAC,QAAQ,CAAC,YAAY,GAAG,GAAG,KAAK,EAAE,CAAC,EAChI,EAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,iCAAiC,EAAE,CAC3E,CAAC;YACJ,CAAC;QACH,CAAC,CAAC,CAAC;QACH,KAAK,MAAM,MAAM,IAAI,OAAO;YAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACvD,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;IACrC,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC;AACzC,CAAC","sourcesContent":["import React, { useEffect, useLayoutEffect, useRef, useState } from 'react';\n\nimport { HorizontalPlacement, ShellRegion, SurfaceVariant, VerticalPlacement } from '@wildo-ai/presets-components-models';\nimport {\n AppShellContentOutlet,\n AppShellLoadingState,\n AppShellOverlayPortalLayer,\n AppShellOverlaysOutlet,\n AppShellProviders,\n AppShellRegionOutlet,\n NON_CANONICAL_SHELL_SURFACE_POLICY_OVERRIDE,\n Surface,\n useAppShellFirstReady,\n useAppShellLayout,\n NavigationZone,\n useNavigationState,\n useUI,\n type AppLayoutPreset_MainContainer_DefaultProps,\n} from '@wildo-ai/saas-frontend-lib';\n\nimport { focalPlaneCssVariables, useFocalPlaneSettings, type FocalPlaneSettings } from './focal-plane-settings';\nimport { installFocalPlaneStylesheet } from './focal-plane-stylesheet';\nimport { usePaneDepth } from './use-pane-depth';\nimport { useSharedVanishingPoint } from './use-shared-vanishing-point';\n\n/**\n * The focal plane's placement (#2049). The regions are the application's own, rendered by the standard outlets with\n * every context; this container arranges them as floating glass windows over an ambient background, and marks each\n * as an object the still camera sees in depth. The navigation panes inside the content region are objects too, found\n * by the engine's own markers (see `focal-plane-stylesheet.ts`).\n *\n * Overlays render in `AppShellOverlayPortalLayer`, outside every transformed object: a dialog inside a transformed pane\n * would be confined to it, and a menu placed in the wrong coordinates.\n */\nexport function FocalPlaneShellContainer({ children }: AppLayoutPreset_MainContainer_DefaultProps): React.JSX.Element {\n const layoutInfo = useAppShellLayout();\n const hasLayoutBeenReady = useAppShellFirstReady(layoutInfo.isLayoutReady);\n if (!layoutInfo.isLayoutReady && !hasLayoutBeenReady) return <AppShellLoadingState />;\n return (\n <AppShellProviders layout={layoutInfo}>\n <FocalPlaneStage>{children}</FocalPlaneStage>\n </AppShellProviders>\n );\n}\n\nfunction FocalPlaneStage({ children }: { children: React.ReactNode }): React.JSX.Element {\n const { prefersReducedMotion } = useUI();\n const rootRef = useRef<HTMLDivElement>(null);\n const settings = useFocalPlaneSettings();\n const navigation = useNavigationState();\n useLayoutEffect(() => installFocalPlaneStylesheet(), []);\n useSharedVanishingPoint(rootRef);\n const { dip } = usePaneDepth(rootRef, settings, prefersReducedMotion);\n const front = useFrontPane(rootRef, navigation.focusedZone);\n useColumnDip(rootRef, settings, prefersReducedMotion);\n usePlaceChanges(navigation, (zone, how) => {\n if (how === PlaceChange.CHANGED) dip(zone);\n front.bringForward(zone);\n });\n const shell = (content: React.ReactNode): React.JSX.Element => <div data-fp-object=\"shell\">{content}</div>;\n\n return (\n <Surface asChild emitPolicyVars={false} variant={SurfaceVariant.SHELL} policyOverride={NON_CANONICAL_SHELL_SURFACE_POLICY_OVERRIDE}>\n <div\n ref={rootRef}\n data-focal-plane=\"\"\n data-fp-focus={front.zone}\n style={focalPlaneCssVariables(settings, prefersReducedMotion) as React.CSSProperties}\n >\n <div className=\"fp-ghosts\" aria-hidden=\"true\" />\n <div className=\"fp-backdrop\" aria-hidden=\"true\">\n <i className=\"fp-a\" />\n <i className=\"fp-b\" />\n <i className=\"fp-c\" />\n </div>\n <div className=\"fp-grid\">\n {shell(<AppShellRegionOutlet region={ShellRegion.STATUS_BAR} placement={VerticalPlacement.TOP} />)}\n {shell(<AppShellRegionOutlet region={ShellRegion.MENUBAR} />)}\n <div className=\"fp-row fp-middle\">\n {shell(<AppShellRegionOutlet region={ShellRegion.ACTIVITY_BAR} />)}\n {shell(<AppShellRegionOutlet region={ShellRegion.SIDEBAR} placement={HorizontalPlacement.START} />)}\n {shell(<AppShellRegionOutlet region={ShellRegion.UTILITY_PANEL} placement={HorizontalPlacement.START} />)}\n <div className=\"fp-column\">\n {shell(<AppShellRegionOutlet region={ShellRegion.TOOLBAR} />)}\n <div className=\"fp-content\">\n <AppShellContentOutlet className=\"flex-1 relative min-w-0 min-h-0\">{children}</AppShellContentOutlet>\n </div>\n </div>\n {shell(<AppShellRegionOutlet region={ShellRegion.UTILITY_PANEL} placement={HorizontalPlacement.END} />)}\n {shell(<AppShellRegionOutlet region={ShellRegion.SIDEBAR} placement={HorizontalPlacement.END} />)}\n </div>\n {shell(<AppShellRegionOutlet region={ShellRegion.STATUS_BAR} placement={VerticalPlacement.BOTTOM} />)}\n </div>\n <div className=\"fp-ghosts fp-ghosts-front\" aria-hidden=\"true\" />\n <AppShellOverlaysOutlet />\n <AppShellOverlayPortalLayer />\n </div>\n </Surface>\n );\n}\n\n/**\n * Which pane is in front: the one you last pressed in or moved keyboard focus into, or the one that last opened or\n * changed place. Kept by the layout rather than read from the navigation state's `focusedZone` alone, because that\n * follows only interaction: opening a record beside the list leaves the LIST focused (the click happened there), and\n * the prototype this layout follows brings the new pane forward. The engine's focus state is never written.\n */\nfunction useFrontPane(rootRef: React.RefObject<HTMLElement | null>, focusedZone: string): { zone: string; bringForward: (zone: string) => void } {\n const [zone, setZone] = useState<string>(focusedZone);\n useEffect(() => setZone(focusedZone), [focusedZone]);\n useEffect(() => {\n const root = rootRef.current;\n if (!root) return undefined;\n const fromEvent = (event: Event): void => {\n const target = event.target instanceof Element ? event.target : null;\n const pane = target?.closest<HTMLElement>(`[data-component-area=\"${ShellRegion.CONTENT}\"] :is([data-content-area], [data-panel-id^=\"nav-\"])`);\n const name = pane?.dataset.contentArea ?? pane?.dataset.panelId?.replace(/^nav-/, '');\n if (name) setZone(name);\n };\n root.addEventListener('pointerdown', fromEvent, true);\n root.addEventListener('focusin', fromEvent, true);\n return () => {\n root.removeEventListener('pointerdown', fromEvent, true);\n root.removeEventListener('focusin', fromEvent, true);\n };\n }, [rootRef]);\n return { zone, bringForward: setZone };\n}\n\nconst STRUCTURAL_ZONES: ReadonlySet<string> = new Set([NavigationZone.PRIMARY, NavigationZone.SECONDARY, NavigationZone.COMPANION]);\n\n/** How a navigation zone's place moved between two renders. */\nenum PlaceChange {\n /** The zone held nothing and now holds a place: a pane opened. */\n APPEARED = 'appeared',\n /** The zone showed one place and now shows another, in the same pane. */\n CHANGED = 'changed',\n}\n\n/**\n * A zone that APPEARS (it held nothing, now it holds a place) or CHANGES place (the same zone now shows another URL\n * path) is reported: a change dips back and returns, and either way the pane comes forward. The arrival itself is the\n * stylesheet's (a side pane arrives from depth when it mounts).\n */\nfunction usePlaceChanges(navigation: ReturnType<typeof useNavigationState>, onPlace: (zone: string, how: PlaceChange) => void): void {\n // The structural zones only: the overlay zone is a dialog, not a pane, and must never become the \"front pane\".\n const zones = (Object.keys(navigation.state.zones) as Array<keyof typeof navigation.state.zones>).filter((zone) => STRUCTURAL_ZONES.has(String(zone)));\n const places = zones.map((zone) => {\n const top = navigation.getTopEntry(zone);\n return top ? (top.urlPath?.split(/[?#]/)[0] ?? top.id) : '';\n });\n const signature = zones.map((zone, index) => `${String(zone)}:${places[index]}`).join('|');\n const previous = useRef<Map<string, string> | null>(null);\n useEffect(() => {\n const current = new Map(zones.map((zone, index) => [String(zone), places[index] ?? '']));\n const before = previous.current;\n previous.current = current;\n if (!before) return;\n for (const [zone, place] of current) {\n const was = before.get(zone) ?? '';\n if (place === '' || was === place) continue;\n onPlace(zone, was === '' ? PlaceChange.APPEARED : PlaceChange.CHANGED);\n }\n // `signature` is the whole dependency: the zones and places are derived from the same render.\n }, [signature]);\n}\n\n/**\n * A side column (the sidebar folding to its rail or unfolding) dips back and returns while the panes re-arrange. The\n * width animates over many frames, so the dip plays once per settled change of more than a few pixels, not per frame.\n * The dip runs on this layout's OWN wrapper, through the Web Animations API, so nothing is written on a region.\n */\nfunction useColumnDip(rootRef: React.RefObject<HTMLElement | null>, settings: FocalPlaneSettings, reducedMotion: boolean): void {\n useEffect(() => {\n const root = rootRef.current;\n if (!root || reducedMotion || typeof ResizeObserver === 'undefined') return undefined;\n const columns = [...root.querySelectorAll<HTMLElement>('[data-fp-object=\"shell\"]')].filter((wrapper) =>\n wrapper.querySelector(`:scope > [data-component-area=\"${ShellRegion.SIDEBAR}\"], :scope > [data-component-area=\"${ShellRegion.UTILITY_PANEL}\"]`));\n const settled = new Map<HTMLElement, number>();\n const lastDip = new Map<HTMLElement, number>();\n const observer = new ResizeObserver((entries) => {\n for (const entry of entries) {\n const wrapper = entry.target as HTMLElement;\n const width = wrapper.offsetWidth;\n const previous = settled.get(wrapper);\n if (previous === undefined || width === 0) { settled.set(wrapper, width); continue; }\n if (Math.abs(width - previous) <= 24) continue;\n settled.set(wrapper, width);\n const now = performance.now();\n if (now - (lastDip.get(wrapper) ?? 0) < settings.motionMs) continue;\n lastDip.set(wrapper, now);\n wrapper.animate(\n [{ offset: 0.5, transform: `perspective(${settings.cameraDistancePx}px) translate3d(0, 0, ${-settings.layerDepthPx * 0.3}px)` }],\n { duration: settings.motionMs, easing: 'cubic-bezier(0.2, 0.9, 0.25, 1)' },\n );\n }\n });\n for (const column of columns) observer.observe(column);\n return () => observer.disconnect();\n }, [rootRef, settings, reducedMotion]);\n}\n"]}
1
+ {"version":3,"file":"focal-plane-shell-container.js","sourceRoot":"","sources":["../../../../src/focal-plane/focal-plane-shell-container.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAC1H,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,0BAA0B,EAC1B,sBAAsB,EACtB,iBAAiB,EACjB,oBAAoB,EACpB,2CAA2C,EAC3C,OAAO,EACP,qBAAqB,EACrB,iBAAiB,EACjB,2BAA2B,EAC3B,sBAAsB,EACtB,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,KAAK,GAEN,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACvF,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE;;;;;;;;GAQG;AACH,MAAM,UAAU,wBAAwB,CAAC,EAAE,QAAQ,EAA8C;IAC/F,MAAM,UAAU,GAAG,iBAAiB,EAAE,CAAC;IACvC,MAAM,kBAAkB,GAAG,qBAAqB,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IAC3E,IAAI,CAAC,UAAU,CAAC,aAAa,IAAI,CAAC,kBAAkB;QAAE,OAAO,KAAC,oBAAoB,KAAG,CAAC;IACtF,OAAO,CACL,KAAC,iBAAiB,IAAC,MAAM,EAAE,UAAU,YACnC,KAAC,eAAe,cAAE,QAAQ,GAAmB,GAC3B,CACrB,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,EAAE,QAAQ,EAAiC;IAClE,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AAC,0BAA0B,KAAG,IAC1B,GACE,CACX,CAAC;AACJ,CAAC","sourcesContent":["import React, { useLayoutEffect, useMemo, useRef } from 'react';\n\nimport { HorizontalPlacement, ShellRegion, SurfaceVariant, VerticalPlacement } from '@wildo-ai/presets-components-models';\nimport {\n AppShellContentOutlet,\n AppShellLoadingState,\n AppShellOverlayPortalLayer,\n AppShellOverlaysOutlet,\n AppShellProviders,\n AppShellRegionOutlet,\n NON_CANONICAL_SHELL_SURFACE_POLICY_OVERRIDE,\n Surface,\n useAppShellFirstReady,\n useAppShellLayout,\n SHELL_GHOST_LAYER_ATTRIBUTE,\n SHELL_OBJECT_ATTRIBUTE,\n ShellGhostLayer,\n useNavigationState,\n useShellMotion,\n useUI,\n type AppLayoutPreset_MainContainer_DefaultProps,\n} from '@wildo-ai/saas-frontend-lib';\n\nimport { createFocalPlaneDepthAxis } from './focal-plane-depth-axis';\nimport { focalPlaneCssVariables, useFocalPlaneSettings } from './focal-plane-settings';\nimport { installFocalPlaneStylesheet } from './focal-plane-stylesheet';\nimport { writeVanishingOrigin } from './focal-plane-vanishing-point';\n\n/**\n * The focal plane's placement (#2049). The regions are the application's own, rendered by the standard outlets with\n * every context; this container arranges them as floating glass windows over an ambient background, and marks each\n * as an object the still camera sees in depth. The navigation panes inside the content region are objects too, found\n * by the engine's own markers (see `focal-plane-stylesheet.ts`).\n *\n * Overlays render in `AppShellOverlayPortalLayer`, outside every transformed object: a dialog inside a transformed pane\n * would be confined to it, and a menu placed in the wrong coordinates.\n */\nexport function FocalPlaneShellContainer({ children }: AppLayoutPreset_MainContainer_DefaultProps): React.JSX.Element {\n const layoutInfo = useAppShellLayout();\n const hasLayoutBeenReady = useAppShellFirstReady(layoutInfo.isLayoutReady);\n if (!layoutInfo.isLayoutReady && !hasLayoutBeenReady) return <AppShellLoadingState />;\n return (\n <AppShellProviders layout={layoutInfo}>\n <FocalPlaneStage>{children}</FocalPlaneStage>\n </AppShellProviders>\n );\n}\n\nfunction FocalPlaneStage({ children }: { children: React.ReactNode }): React.JSX.Element {\n const { prefersReducedMotion } = useUI();\n const rootRef = useRef<HTMLDivElement>(null);\n const settings = useFocalPlaneSettings();\n const navigation = useNavigationState();\n useLayoutEffect(() => installFocalPlaneStylesheet(), []);\n const axis = useMemo(() => createFocalPlaneDepthAxis(settings, prefersReducedMotion), [settings, prefersReducedMotion]);\n // The core motion building blocks: the pane in front, place changes, ghosts and dips, seen along the depth axis. Each\n // object's measurement also sets its origin on the one vanishing point.\n const { frontZone } = useShellMotion(rootRef, { axis, navigation, onObjectMeasured: writeVanishingOrigin });\n const shell = (content: React.ReactNode): React.JSX.Element => <div {...{ [SHELL_OBJECT_ATTRIBUTE]: 'region' }}>{content}</div>;\n\n return (\n <Surface asChild emitPolicyVars={false} variant={SurfaceVariant.SHELL} policyOverride={NON_CANONICAL_SHELL_SURFACE_POLICY_OVERRIDE}>\n <div\n ref={rootRef}\n data-focal-plane=\"\"\n data-fp-focus={frontZone}\n style={focalPlaneCssVariables(settings, prefersReducedMotion) as React.CSSProperties}\n >\n <div {...{ [SHELL_GHOST_LAYER_ATTRIBUTE]: ShellGhostLayer.BACK }} aria-hidden=\"true\" />\n <div className=\"fp-backdrop\" aria-hidden=\"true\">\n <i className=\"fp-a\" />\n <i className=\"fp-b\" />\n <i className=\"fp-c\" />\n </div>\n <div className=\"fp-grid\">\n {shell(<AppShellRegionOutlet region={ShellRegion.STATUS_BAR} placement={VerticalPlacement.TOP} />)}\n {shell(<AppShellRegionOutlet region={ShellRegion.MENUBAR} />)}\n <div className=\"fp-row fp-middle\">\n {shell(<AppShellRegionOutlet region={ShellRegion.ACTIVITY_BAR} />)}\n {shell(<AppShellRegionOutlet region={ShellRegion.SIDEBAR} placement={HorizontalPlacement.START} />)}\n {shell(<AppShellRegionOutlet region={ShellRegion.UTILITY_PANEL} placement={HorizontalPlacement.START} />)}\n <div className=\"fp-column\">\n {shell(<AppShellRegionOutlet region={ShellRegion.TOOLBAR} />)}\n <div className=\"fp-content\">\n <AppShellContentOutlet className=\"flex-1 relative min-w-0 min-h-0\">{children}</AppShellContentOutlet>\n </div>\n </div>\n {shell(<AppShellRegionOutlet region={ShellRegion.UTILITY_PANEL} placement={HorizontalPlacement.END} />)}\n {shell(<AppShellRegionOutlet region={ShellRegion.SIDEBAR} placement={HorizontalPlacement.END} />)}\n </div>\n {shell(<AppShellRegionOutlet region={ShellRegion.STATUS_BAR} placement={VerticalPlacement.BOTTOM} />)}\n </div>\n <div {...{ [SHELL_GHOST_LAYER_ATTRIBUTE]: ShellGhostLayer.FRONT }} aria-hidden=\"true\" />\n <AppShellOverlaysOutlet />\n <AppShellOverlayPortalLayer />\n </div>\n </Surface>\n );\n}\n"]}
@@ -1,14 +1,7 @@
1
- /**
2
- * The navigation panes, by the engine's markers: the zone itself in the static and single-zone branches, the panel in
3
- * the resizable branch — never the zone INSIDE a panel, which would be moved twice.
4
- */
5
- export declare const FOCAL_PLANE_PANE_SELECTOR = "[data-component-area=\"content\"] [data-content-area]:not([data-panel-id] *), [data-component-area=\"content\"] [data-panel-id^=\"nav-\"]";
6
- /** The modal content slots, exported for the tests that pin what counts as modal. */
7
- export declare const FOCAL_PLANE_MODAL_SLOTS: readonly string[];
8
1
  export declare const FOCAL_PLANE_CSS: string;
9
2
  /**
10
- * Installs the stylesheet while at least one focal-plane layout is mounted, and removes it when the last one unmounts.
11
- * Returns the release function. Falls back to a `<style>` element where constructable stylesheets are missing.
3
+ * Installs the stylesheet while at least one focal-plane layout is mounted, and removes it when the last one unmounts
4
+ * (`installShellLayoutStylesheet`: a constructable stylesheet, with a `<style>` fallback). Returns the release function.
12
5
  */
13
6
  export declare function installFocalPlaneStylesheet(doc?: Document): () => void;
14
7
  //# sourceMappingURL=focal-plane-stylesheet.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"focal-plane-stylesheet.d.ts","sourceRoot":"","sources":["../../../../src/focal-plane/focal-plane-stylesheet.ts"],"names":[],"mappings":"AA8BA;;;GAGG;AACH,eAAO,MAAM,yBAAyB,8IAA8F,CAAC;AAqCrI,qFAAqF;AACrF,eAAO,MAAM,uBAAuB,EAAE,SAAS,MAAM,EAAgB,CAAC;AAEtE,eAAO,MAAM,eAAe,QAoI3B,CAAC;AAKF;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,GAAG,GAAE,QAAmB,GAAG,MAAM,IAAI,CAqBhF"}
1
+ {"version":3,"file":"focal-plane-stylesheet.d.ts","sourceRoot":"","sources":["../../../../src/focal-plane/focal-plane-stylesheet.ts"],"names":[],"mappings":"AA4DA,eAAO,MAAM,eAAe,QAoI3B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,GAAG,GAAE,QAAmB,GAAG,MAAM,IAAI,CAEhF"}
@@ -1,18 +1,18 @@
1
1
  import { ShellRegion } from '@wildo-ai/presets-components-models';
2
- import { NavigationZone } from '@wildo-ai/saas-frontend-lib';
2
+ import { installShellLayoutStylesheet, NavigationZone, SHELL_ANCHORED_POPUP_ORIGINS, SHELL_CENTRED_POPUP_SLOTS, SHELL_PANE_SELECTOR, SHELL_POPUP_OPEN_STATES, shellModalOpenClause, ShellPopupSlot, shellRegionSelector, } from '@wildo-ai/saas-frontend-lib';
3
3
  /**
4
4
  * The focal plane's stylesheet (#2049), scoped to `[data-focal-plane]`, so it touches nothing outside the layout.
5
5
  *
6
6
  * ## One still camera, without a nested 3D context
7
7
  *
8
8
  * Every object carries its OWN `perspective(d) translate3d(0, 0, z)`, with its `transform-origin` set (per element, by
9
- * `useSharedVanishingPoint`) to the one vanishing point of the stage. That is the projection of a single still camera,
9
+ * `writeVanishingOrigin`, called by the core stage measurement) to the one vanishing point of the stage. That is the projection of a single still camera,
10
10
  * and it needs no `transform-style: preserve-3d` ancestor — which matters, because a nested 3D context disables
11
11
  * `backdrop-filter`, and the glass windows are made of it.
12
12
  *
13
13
  * ## What counts as an object
14
14
  *
15
- * - the shell panels this layout wraps (`[data-fp-object]`);
15
+ * - the shell panels this layout wraps (`[data-shell-object]`, the core's wrapper marker);
16
16
  * - each navigation pane inside the content region, by the engine's own markers: `[data-content-area]` (the static and
17
17
  * single-zone branches) and the resizable panel `[data-panel-id^="nav-"]` (NOT its inner `[data-content-area]`, which
18
18
  * the panel's inline `overflow: hidden` would clip).
@@ -26,49 +26,25 @@ import { NavigationZone } from '@wildo-ai/saas-frontend-lib';
26
26
  * does not block, where a `<style>` element would be.
27
27
  */
28
28
  const ROOT = '[data-focal-plane]';
29
- const CONTENT = `[data-component-area="${ShellRegion.CONTENT}"]`;
30
- /**
31
- * The navigation panes, by the engine's markers: the zone itself in the static and single-zone branches, the panel in
32
- * the resizable branch — never the zone INSIDE a panel, which would be moved twice.
33
- */
34
- export const FOCAL_PLANE_PANE_SELECTOR = `${CONTENT} [data-content-area]:not([data-panel-id] *), ${CONTENT} [data-panel-id^="nav-"]`;
29
+ const CONTENT = shellRegionSelector(ShellRegion.CONTENT);
35
30
  /** The zone names the navigation state focuses, and the markers each one is found by in either branch. */
36
31
  const ZONES = [NavigationZone.PRIMARY, NavigationZone.SECONDARY, NavigationZone.COMPANION];
37
32
  const zoneMarker = (zone) => `:is([data-content-area="${zone}"], [data-panel-id="nav-${zone}"])`;
38
- const VISIBLE_PANE = `:is(${FOCAL_PLANE_PANE_SELECTOR}):not([data-zone-hidden])`;
33
+ const VISIBLE_PANE = `:is(${SHELL_PANE_SELECTOR}):not([data-zone-hidden])`;
39
34
  /** Two panes or more are side by side (the other panes are siblings in both branches). */
40
35
  const SPLIT = `${CONTENT}:has(${VISIBLE_PANE} ~ ${VISIBLE_PANE})`;
41
- const PANES = `:is(${FOCAL_PLANE_PANE_SELECTOR})`;
42
- const OBJECTS = `:is([data-fp-object], ${FOCAL_PLANE_PANE_SELECTOR})`;
36
+ const PANES = `:is(${SHELL_PANE_SELECTOR})`;
37
+ const OBJECTS = `:is([data-shell-object], ${SHELL_PANE_SELECTOR})`;
43
38
  /**
44
- * The popups the focal plane moves, by the stable `data-slot` of their portalled content (Radix `data-state` on the
45
- * same element). Lifting popups carry the CSS variable Radix publishes as their trigger-relative origin.
39
+ * The popups the focal plane moves, by the core's `ShellPopupSlot` vocabulary: anchored popups LIFT from the origin
40
+ * Radix publishes for their trigger (`SHELL_ANCHORED_POPUP_ORIGINS`), centred dialogs RISE (`SHELL_CENTRED_POPUP_SLOTS`).
46
41
  */
47
42
  const POPUPS = {
48
- lift: [
49
- ['dropdown-menu-content', '--radix-dropdown-menu-content-transform-origin'],
50
- ['dropdown-menu-sub-content', '--radix-dropdown-menu-content-transform-origin'],
51
- ['context-menu-content', '--radix-context-menu-content-transform-origin'],
52
- ['context-menu-sub-content', '--radix-context-menu-content-transform-origin'],
53
- ['popover-content', '--radix-popover-content-transform-origin'],
54
- ['hover-card-content', '--radix-hover-card-content-transform-origin'],
55
- ['tooltip-content', '--radix-tooltip-content-transform-origin'],
56
- ['select-content', '--radix-select-content-transform-origin'],
57
- ['menubar-content', '--radix-menubar-content-transform-origin'],
58
- ['menubar-sub-content', '--radix-menubar-content-transform-origin'],
59
- ],
60
- rise: ['dialog-content', 'alert-dialog-content'],
43
+ lift: Object.entries(SHELL_ANCHORED_POPUP_ORIGINS),
44
+ rise: SHELL_CENTRED_POPUP_SLOTS,
61
45
  };
62
- /**
63
- * A MODAL popup is open: a dialog, an alert dialog, a sheet or a drawer, by their content SLOT. Not by `role="dialog"`:
64
- * a Radix popover's content carries that role too (date pickers, linked-record pickers, the notification centre), and
65
- * opening one must not step the form you are editing back. Not by `body[data-scroll-locked]` either, which dropdown
66
- * and context menus also set.
67
- */
68
- const MODAL_SLOTS = ['dialog-content', 'alert-dialog-content', 'sheet-content', 'drawer-content'];
69
- const MODAL_OPEN = `:has([data-shell-overlay-layer] :is(${MODAL_SLOTS.map((slot) => `[data-slot="${slot}"]`).join(', ')})[data-state="open"])`;
70
- /** The modal content slots, exported for the tests that pin what counts as modal. */
71
- export const FOCAL_PLANE_MODAL_SLOTS = MODAL_SLOTS;
46
+ /** A modal popup is open: the core's slot-keyed clause (`shellModalOpenClause`), never `role="dialog"`. */
47
+ const MODAL_OPEN = shellModalOpenClause();
72
48
  export const FOCAL_PLANE_CSS = `
73
49
  /* Positioned, never isolated: an isolated root would be one stacking context, and anything positioned outside the
74
50
  shell with a lower z-index (a consent prompt) would paint over the shell's own dialogs (#1830). */
@@ -90,9 +66,9 @@ ${ROOT} .fp-row { display: flex; gap: 12px; min-height: 0; min-width: 0; }
90
66
  ${ROOT} .fp-middle { flex: 1; }
91
67
  ${ROOT} .fp-column { flex: 1; display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; }
92
68
  ${ROOT} .fp-content { flex: 1; min-height: 0; min-width: 0; position: relative; display: flex; flex-direction: column; }
93
- ${ROOT} [data-fp-object]:empty { display: none; }
94
- ${ROOT} [data-fp-object] { position: relative; display: flex; min-height: 0; min-width: 0; }
95
- ${ROOT} [data-fp-object] > * { flex: 1; min-width: 0; min-height: 0; }
69
+ ${ROOT} [data-shell-object]:empty { display: none; }
70
+ ${ROOT} [data-shell-object] { position: relative; display: flex; min-height: 0; min-width: 0; }
71
+ ${ROOT} [data-shell-object] > * { flex: 1; min-width: 0; min-height: 0; }
96
72
 
97
73
  /* Every object: seen through the one still camera, at its depth. */
98
74
  ${ROOT} ${OBJECTS} {
@@ -103,7 +79,7 @@ ${ROOT} ${OBJECTS} {
103
79
  }
104
80
 
105
81
  /* Glass: the theme's card colour, translucent, over the background blurred through it. */
106
- ${ROOT} :is([data-fp-object="shell"], ${FOCAL_PLANE_PANE_SELECTOR}) {
82
+ ${ROOT} :is([data-shell-object], ${SHELL_PANE_SELECTOR}) {
107
83
  background: color-mix(in oklab, var(--card, var(--background)) var(--fp-glass), transparent);
108
84
  -webkit-backdrop-filter: blur(26px) saturate(1.5);
109
85
  backdrop-filter: blur(26px) saturate(1.5);
@@ -123,7 +99,7 @@ ${ZONES.map((zone) => `${ROOT}[data-fp-focus="${zone}"] ${SPLIT} ${VISIBLE_PANE}
123
99
  }
124
100
 
125
101
  /* A side pane arrives from depth when it opens. */
126
- ${ROOT} ${CONTENT} :is(${zoneMarker(NavigationZone.SECONDARY)}, ${zoneMarker(NavigationZone.COMPANION)}):is(${FOCAL_PLANE_PANE_SELECTOR}) {
102
+ ${ROOT} ${CONTENT} :is(${zoneMarker(NavigationZone.SECONDARY)}, ${zoneMarker(NavigationZone.COMPANION)}):is(${SHELL_PANE_SELECTOR}) {
127
103
  animation: fp-pane-arrive var(--fp-motion) var(--fp-ease);
128
104
  }
129
105
  @keyframes fp-pane-arrive {
@@ -131,9 +107,9 @@ ${ROOT} ${CONTENT} :is(${zoneMarker(NavigationZone.SECONDARY)}, ${zoneMarker(Nav
131
107
  }
132
108
 
133
109
  /* Ghosts: a discarded pane flying away, and the still image of the panes an expanded pane stands in front of. */
134
- ${ROOT} .fp-ghosts { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
135
- ${ROOT} .fp-ghosts-front { z-index: 2; }
136
- ${ROOT} .fp-ghost {
110
+ ${ROOT} [data-shell-ghost-layer] { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
111
+ ${ROOT} [data-shell-ghost-layer="front"] { z-index: 2; }
112
+ ${ROOT} [data-shell-ghost] {
137
113
  position: absolute; box-sizing: border-box; overflow: hidden;
138
114
  transform-origin: var(--fp-ox) var(--fp-oy);
139
115
  transform: perspective(var(--fp-distance)) translate3d(0, 0, var(--fp-z, 0px));
@@ -146,9 +122,9 @@ ${ROOT} .fp-ghost {
146
122
  }
147
123
 
148
124
  /* The shell panel under the pointer rises toward the camera; its items zoom a little. */
149
- ${ROOT} [data-fp-object="shell"]:hover { --fp-z: var(--fp-hover-lift); }
150
- ${ROOT} [data-fp-object="shell"] :is(button, a):not(:disabled) { transition: transform 180ms var(--fp-ease); }
151
- ${ROOT} [data-fp-object="shell"] :is(button, a):not(:disabled):hover { transform: scale(1.045); }
125
+ ${ROOT} [data-shell-object]:hover { --fp-z: var(--fp-hover-lift); }
126
+ ${ROOT} [data-shell-object] :is(button, a):not(:disabled) { transition: transform 180ms var(--fp-ease); }
127
+ ${ROOT} [data-shell-object] :is(button, a):not(:disabled):hover { transform: scale(1.045); }
152
128
 
153
129
  /* Behind a modal popup, everything steps back, dims and blurs lightly. A menu is not modal: it only lifts. */
154
130
  ${ROOT}${MODAL_OPEN} ${OBJECTS} {
@@ -165,15 +141,15 @@ ${ROOT}${MODAL_OPEN} ${OBJECTS} {
165
141
  - A sheet arrives from in front of the plane and leaves back into depth.
166
142
  Drawers and toasts keep their own motion: their libraries position and stack them with transforms. */
167
143
  ${POPUPS.lift.map(([slot, origin]) => `${ROOT} [data-shell-overlay-layer] [data-slot="${slot}"] { transform-origin: var(${origin}); }`).join('\n')}
168
- ${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; }
144
+ ${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; }
169
145
  ${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; }
170
146
  ${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; }
171
147
  ${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; }
172
- ${ROOT} [data-shell-overlay-layer] [data-slot="sheet-content"][data-state="open"] { animation: fp-arrive-in var(--fp-motion) var(--fp-ease) both; }
173
- ${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; }
148
+ ${ROOT} [data-shell-overlay-layer] [data-slot="${ShellPopupSlot.SHEET}"][data-state="open"] { animation: fp-arrive-in var(--fp-motion) var(--fp-ease) both; }
149
+ ${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; }
174
150
  /* Popups are glass, a little more opaque than windows (they carry text you act on at once). Tooltips keep their own
175
151
  inverse colours. */
176
- ${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(', ')}) {
152
+ ${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(', ')}) {
177
153
  background: color-mix(in oklab, var(--popover, var(--card, var(--background))) calc(var(--fp-glass) + 26%), transparent);
178
154
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
179
155
  backdrop-filter: blur(24px) saturate(1.5);
@@ -198,39 +174,15 @@ ${ROOT} [data-shell-overlay-layer] :is([data-slot="dialog-overlay"], [data-slot=
198
174
  @media (prefers-reduced-motion: reduce) {
199
175
  /* !important: the motion rules above are more specific (the drifting fields, the item zoom), and the reader's
200
176
  setting must win over every one of them. */
201
- ${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; }
177
+ ${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; }
202
178
  ${ROOT} .fp-backdrop i { animation: none !important; }
203
179
  }
204
180
  `;
205
- let installed = null;
206
- let users = 0;
207
181
  /**
208
- * Installs the stylesheet while at least one focal-plane layout is mounted, and removes it when the last one unmounts.
209
- * Returns the release function. Falls back to a `<style>` element where constructable stylesheets are missing.
182
+ * Installs the stylesheet while at least one focal-plane layout is mounted, and removes it when the last one unmounts
183
+ * (`installShellLayoutStylesheet`: a constructable stylesheet, with a `<style>` fallback). Returns the release function.
210
184
  */
211
185
  export function installFocalPlaneStylesheet(doc = document) {
212
- users += 1;
213
- if (users === 1) {
214
- if ('adoptedStyleSheets' in doc && typeof CSSStyleSheet !== 'undefined' && 'replaceSync' in CSSStyleSheet.prototype) {
215
- installed = new CSSStyleSheet();
216
- installed.replaceSync(FOCAL_PLANE_CSS);
217
- doc.adoptedStyleSheets = [...doc.adoptedStyleSheets, installed];
218
- }
219
- else {
220
- const style = doc.createElement('style');
221
- style.dataset.focalPlane = '';
222
- style.textContent = FOCAL_PLANE_CSS;
223
- doc.head.appendChild(style);
224
- }
225
- }
226
- return () => {
227
- users -= 1;
228
- if (users > 0)
229
- return;
230
- if (installed)
231
- doc.adoptedStyleSheets = doc.adoptedStyleSheets.filter((sheet) => sheet !== installed);
232
- doc.head.querySelector('style[data-focal-plane]')?.remove();
233
- installed = null;
234
- };
186
+ return installShellLayoutStylesheet('focal-plane', FOCAL_PLANE_CSS, doc);
235
187
  }
236
188
  //# sourceMappingURL=focal-plane-stylesheet.js.map