@wildo-ai/presets-components-3d 1.1.6 → 1.1.7

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 (91) hide show
  1. package/dist/esm/focal-plane/focal-plane-settings.d.ts +35 -0
  2. package/dist/esm/focal-plane/focal-plane-settings.d.ts.map +1 -0
  3. package/dist/esm/focal-plane/focal-plane-settings.js +68 -0
  4. package/dist/esm/focal-plane/focal-plane-settings.js.map +1 -0
  5. package/dist/esm/focal-plane/focal-plane-shell-container.d.ts +13 -0
  6. package/dist/esm/focal-plane/focal-plane-shell-container.d.ts.map +1 -0
  7. package/dist/esm/focal-plane/focal-plane-shell-container.js +147 -0
  8. package/dist/esm/focal-plane/focal-plane-shell-container.js.map +1 -0
  9. package/dist/esm/focal-plane/focal-plane-stylesheet.d.ts +14 -0
  10. package/dist/esm/focal-plane/focal-plane-stylesheet.d.ts.map +1 -0
  11. package/dist/esm/focal-plane/focal-plane-stylesheet.js +236 -0
  12. package/dist/esm/focal-plane/focal-plane-stylesheet.js.map +1 -0
  13. package/dist/esm/focal-plane/use-pane-depth.d.ts +20 -0
  14. package/dist/esm/focal-plane/use-pane-depth.d.ts.map +1 -0
  15. package/dist/esm/focal-plane/use-pane-depth.js +162 -0
  16. package/dist/esm/focal-plane/use-pane-depth.js.map +1 -0
  17. package/dist/esm/focal-plane/use-shared-vanishing-point.d.ts +35 -0
  18. package/dist/esm/focal-plane/use-shared-vanishing-point.d.ts.map +1 -0
  19. package/dist/esm/focal-plane/use-shared-vanishing-point.js +86 -0
  20. package/dist/esm/focal-plane/use-shared-vanishing-point.js.map +1 -0
  21. package/dist/esm/frame/frame-3d-style.d.ts.map +1 -1
  22. package/dist/esm/frame/frame-3d-style.js.map +1 -1
  23. package/dist/esm/frame/frame-appearance.d.ts.map +1 -1
  24. package/dist/esm/frame/frame-appearance.js.map +1 -1
  25. package/dist/esm/frame/frame-canvas.d.ts.map +1 -1
  26. package/dist/esm/frame/frame-canvas.js +3 -3
  27. package/dist/esm/frame/frame-canvas.js.map +1 -1
  28. package/dist/esm/frame/frame-canvas.lazy.d.ts.map +1 -1
  29. package/dist/esm/frame/frame-canvas.lazy.js.map +1 -1
  30. package/dist/esm/frame/frame-color.d.ts.map +1 -1
  31. package/dist/esm/frame/frame-color.js.map +1 -1
  32. package/dist/esm/frame/frame-driver.d.ts.map +1 -1
  33. package/dist/esm/frame/frame-driver.js.map +1 -1
  34. package/dist/esm/frame/frame-renderer.d.ts.map +1 -1
  35. package/dist/esm/frame/frame-renderer.js.map +1 -1
  36. package/dist/esm/frame/frame-shaders.d.ts.map +1 -1
  37. package/dist/esm/frame/frame-shaders.js.map +1 -1
  38. package/dist/esm/frame/use-frame-appearance.d.ts.map +1 -1
  39. package/dist/esm/frame/use-frame-appearance.js.map +1 -1
  40. package/dist/esm/index.d.ts +1 -0
  41. package/dist/esm/index.d.ts.map +1 -1
  42. package/dist/esm/index.js +1 -0
  43. package/dist/esm/index.js.map +1 -1
  44. package/dist/esm/layout/header-first-shell-container.d.ts.map +1 -1
  45. package/dist/esm/layout/header-first-shell-container.js.map +1 -1
  46. package/dist/esm/layout/layout-3d-definition.d.ts +5 -6
  47. package/dist/esm/layout/layout-3d-definition.d.ts.map +1 -1
  48. package/dist/esm/layout/layout-3d-definition.js +13 -14
  49. package/dist/esm/layout/layout-3d-definition.js.map +1 -1
  50. package/dist/esm/layout/layout-3d-transition-choreography.d.ts.map +1 -1
  51. package/dist/esm/layout/layout-3d-transition-choreography.js.map +1 -1
  52. package/dist/esm/layout/layout-3d-vocabulary.d.ts +13 -8
  53. package/dist/esm/layout/layout-3d-vocabulary.d.ts.map +1 -1
  54. package/dist/esm/layout/layout-3d-vocabulary.js +12 -7
  55. package/dist/esm/layout/layout-3d-vocabulary.js.map +1 -1
  56. package/dist/esm/layout/shell-layout-placement.d.ts.map +1 -1
  57. package/dist/esm/layout/shell-layout-placement.js.map +1 -1
  58. package/dist/esm/layout-3d-main-container.d.ts +6 -0
  59. package/dist/esm/layout-3d-main-container.d.ts.map +1 -1
  60. package/dist/esm/layout-3d-main-container.js +8 -1
  61. package/dist/esm/layout-3d-main-container.js.map +1 -1
  62. package/dist/esm/register-3d-layout.d.ts.map +1 -1
  63. package/dist/esm/register-3d-layout.js.map +1 -1
  64. package/dist/esm/shell-region-measurement.d.ts.map +1 -1
  65. package/dist/esm/shell-region-measurement.js.map +1 -1
  66. package/dist/esm/tokens/design-token-resolution.d.ts.map +1 -1
  67. package/dist/esm/tokens/design-token-resolution.js.map +1 -1
  68. package/dist/esm/tokens/use-design-token-resolution.d.ts.map +1 -1
  69. package/dist/esm/tokens/use-design-token-resolution.js.map +1 -1
  70. package/dist/tsconfig.build.tsbuildinfo +1 -0
  71. package/package.json +3 -3
  72. package/dist/esm/spatial/spatial-camera.d.ts +0 -106
  73. package/dist/esm/spatial/spatial-camera.d.ts.map +0 -1
  74. package/dist/esm/spatial/spatial-camera.js +0 -151
  75. package/dist/esm/spatial/spatial-camera.js.map +0 -1
  76. package/dist/esm/spatial/spatial-environment.d.ts +0 -6
  77. package/dist/esm/spatial/spatial-environment.d.ts.map +0 -1
  78. package/dist/esm/spatial/spatial-environment.js +0 -166
  79. package/dist/esm/spatial/spatial-environment.js.map +0 -1
  80. package/dist/esm/spatial/spatial-environment.lazy.d.ts +0 -10
  81. package/dist/esm/spatial/spatial-environment.lazy.d.ts.map +0 -1
  82. package/dist/esm/spatial/spatial-environment.lazy.js +0 -13
  83. package/dist/esm/spatial/spatial-environment.lazy.js.map +0 -1
  84. package/dist/esm/spatial/spatial-shell-container.d.ts +0 -21
  85. package/dist/esm/spatial/spatial-shell-container.d.ts.map +0 -1
  86. package/dist/esm/spatial/spatial-shell-container.js +0 -231
  87. package/dist/esm/spatial/spatial-shell-container.js.map +0 -1
  88. package/dist/esm/spatial/spatial-stage-store.d.ts +0 -27
  89. package/dist/esm/spatial/spatial-stage-store.d.ts.map +0 -1
  90. package/dist/esm/spatial/spatial-stage-store.js +0 -33
  91. package/dist/esm/spatial/spatial-stage-store.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"frame-appearance.js","sourceRoot":"","sources":["../../../../src/frame/frame-appearance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,WAAW,EAAwB,MAAM,qCAAqC,CAAC;AAEzH,OAAO,EAAE,kBAAkB,EAAmD,MAAM,kBAAkB,CAAC;AACvG,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,cAAc,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAmB,MAAM,eAAe,CAAC;AAC9I,OAAO,EAAE,uBAAuB,EAA8B,MAAM,mCAAmC,CAAC;AA4ExG;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAE1C;;;;GAIG;AACH,MAAM,qBAAqB,GAAG,sBAAsB,GAAG,IAAI,CAAC;AAE5D,MAAM,aAAa,GAAgB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAChD,MAAM,eAAe,GAAG;IACtB,iBAAiB,CAAC,uBAAuB;IACzC,iBAAiB,CAAC,oBAAoB;IACtC,iBAAiB,CAAC,sBAAsB;IACxC,iBAAiB,CAAC,oBAAoB;IACtC,iBAAiB,CAAC,sBAAsB;CACzC,CAAC;AACF,MAAM,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;AAEhC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAA6B;IACjE,MAAM,OAAO,GAAG,CAAC,KAAwB,EAAqB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;IAC3G,MAAM,UAAU,GAAG,OAAO,CAAC,iBAAi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B,UAAU,EAAE,CAAC;QACb,QAAQ,EAAE,CAAC;QACX,eAAe,EAAE,CAAC;QAClB,eAAe,EAAE,CAAC;QAClB,YAAY,EAAE,CAAC;QACf,WAAW,EAAE,CAAC;KACf,CAAC;AACJ,CAAC","sourcesContent":["import { converter, parse } from 'culori';\nimport { DesignSystemToken, MaterialKind, ShellRegion, type MaterialProfile } from '@wildo-ai/presets-components-models';\n\nimport { Frame3DSurfaceKind, type Frame3DRegionStyle, type Frame3DThemeStyle } from './frame-3d-style';\nimport { BLACK, WHITE, composite, contrastRatio, encodeSrgb, gradientPoints, mix, pushUntil, quantize, type FrameColor } from './frame-color';\nimport { ResolvedDesignTokenKind, type DesignTokenResolution } from '../tokens/design-token-resolution';\n\nexport type { FrameColor } from './frame-color';\n\n/** How one region kind's slab is drawn, in frame units (CSS pixels, sRGB-encoded colours). */\nexport interface FrameSlabAppearance {\n /** False when the style draws nothing here, or a colour it needs did not resolve. */\n visible: boolean;\n /** The shaded side of the frost. */\n fillFrom: FrameColor;\n /** The lit side of the frost. */\n fillTo: FrameColor;\n fillAlpha: number;\n rim: FrameColor;\n rimAlpha: number;\n rimHoverAlpha: number;\n rimWidthPx: number;\n radiusPx: number;\n shadowOffsetXPx: number;\n shadowOffsetYPx: number;\n shadowBlurPx: number;\n shadowAlpha: number;\n}\n\n/** A cubic-Bézier easing, as its four control points. */\nexport type FrameEasing = readonly [number, number, number, number];\n\n/** A damped spring, as motion.dev's gesture `transition` declares one. */\nexport interface FrameSpring {\n stiffness: number;\n damping: number;\n mass: number;\n}\n\n/**\n * Everything the frame draws, as plain data. It is computed in the DOM tree from the theme and handed to the\n * canvas as props, so the canvas holds meshes only and reads no context (#1823).\n */\nexport interface FrameAppearance {\n /** The `--foreground` the bound was computed against. A change of it (a mode switch) is applied at once. */\n foreground: FrameColor;\n /** The in-scene background, shaded side then lit side. */\n background: { from: FrameColor; to: FrameColor } | null;\n /** The light direction in the FRAME's convention: degrees, 0 = from the right, 90 = from the top (y up). */\n lightAngleDeg: number;\n regions: Record<ShellRegion, FrameSlabAppearance>;\n /** A theme change cross-fades over this. 0 under reduced motion. */\n transitionSeconds: number;\n transitionEasing: FrameEasing;\n /** The rim's hover emphasis animates over this, when no spring is declared. */\n hoverSeconds: number;\n hoverEasing: FrameEasing;\n /** The theme's surface gesture spring: when declared, the rim's hover emphasis follows it instead. */\n hoverSpring: FrameSpring | null;\n /** False under reduced motion: the frame is static, so the rim does not respond to hover at all. */\n hoverResponse: boolean;\n /**\n * How long a shell CSS transition may run before the frame stops following it without a `transitionend`:\n * the slowest motion-duration token, with half again as margin. The shell's own transitions use those tokens.\n */\n transitionCeilingSeconds: number;\n}\n\nexport interface FrameAppearanceInputs {\n resolutions: ReadonlyMap<DesignSystemToken, DesignTokenResolution>;\n style: Frame3DThemeStyle;\n /** The theme's navigation material (`MaterialProfileRole.GLASS_NAVIGATION`), when it has one. */\n navigationMaterial: MaterialProfile | undefined;\n /** The theme's surface gesture `transition` (motion.dev), when its surface recipe declares one. */\n surfaceGestureTransition: Readonly<Record<string, string | number>> | undefined;\n isDark: boolean;\n prefersReducedMotion: boolean;\n /** Converts the material's device-pixel rim width into CSS pixels. */\n devicePixelRatio: number;\n}\n\n/**\n * The lowest contrast any colour the frame can put behind text may have against `--foreground`: WCAG 2.x's\n * AA minimum for normal text.\n * spec-cite: WCAG 2.2 SC 1.4.3 Contrast (Minimum) — https://www.w3.org/TR/WCAG22/#contrast-minimum\n */\nexport const FRAME_MINIMUM_CONTRAST = 4.5;\n\n/**\n * What the derivation actually aims for: the minimum plus a margin for a GPU that TRUNCATES rather than rounds\n * when it writes a blended value to the 8-bit framebuffer. The model already rounds every layer it writes\n * ({@link quantize}); truncation moves a channel by at most one more level, which the margin covers.\n */\nconst FRAME_CONTRAST_TARGET = FRAME_MINIMUM_CONTRAST + 0.05;\n\nconst LINEAR_EASING: FrameEasing = [0, 0, 1, 1];\nconst DURATION_TOKENS = [\n DesignSystemToken.MOTION_DURATION_INSTANT,\n DesignSystemToken.MOTION_DURATION_FAST,\n DesignSystemToken.MOTION_DURATION_NORMAL,\n DesignSystemToken.MOTION_DURATION_SLOW,\n DesignSystemToken.MOTION_DURATION_SLOWER,\n];\nconst toSrgb = converter('rgb');\n\n/**\n * Derive the frame's appearance from the active theme, or `null` when the foreground did not resolve — without\n * it no colour can be shown to be readable, and a frame that cannot be shown readable is not drawn.\n *\n * **The contrast bound** is part of the derivation, not a check after it. Every colour text can sit on is\n * composited the way the framebuffer blends — in sRGB-encoded space, each written layer rounded to 8 bits — and\n * must reach the target against `--foreground`:\n * - the background, at several points along its gradient;\n * - the background under a shadow (shadows combine by MAXIMUM in the renderer, never by stacking, so one\n * shadow at its full opacity is the darkest a point can be);\n * - the frost over either, along its own gradient;\n * - the rim at its HOVER opacity over the frost.\n *\n * A style value that would break it is WEAKENED — a colour moved toward the pole with the most contrast, a\n * shadow or rim made fainter — and the bound is never relaxed. A style is a preference; the bound is a guarantee.\n */\nexport function deriveFrameAppearance(inputs: FrameAppearanceInputs): FrameAppearance | null {\n const colorOf = (token: DesignSystemToken): FrameColor | null => tokenColor(inputs.resolutions.get(token));\n const foreground = colorOf(DesignSystemToken.FOREGROUND);\n if (!foreground) return null;\n // The pole is black or white, whichever contrasts more with the foreground; bounded colours move toward it.\n const pole = contrastRatio(foreground, BLACK) >= contrastRatio(foreground, WHITE) ? BLACK : WHITE;\n const readable = (color: FrameColor): boolean => contrastRatio(quantize(color), foreground) >= FRAME_CONTRAST_TARGET;\n\n const glass = inputs.navigationMaterial?.kind === MaterialKind.GLASS ? inputs.navigationMaterial : undefined;\n // A material's light angle is measured against the DOM's y-DOWN axis (the engine's edge response reads it\n // against image-space normals); the frame's is y-UP, so the vertical component flips sign.\n const lightAngleDeg = glass ? -glass.optics.lightAngleDeg : inputs.style.lightAngleDeg;\n\n // ── Background ── (nothing is drawn, not even a slab, when its base colour does not resolve: frost over an\n // unknown base cannot be bounded.)\n const base = colorOf(inputs.style.background.baseToken);\n const glowColor = colorOf(inputs.style.background.glowToken) ?? base;\n let background: { from: FrameColor; to: FrameColor } | null = null;\n if (base && glowColor) {\n const from = pushUntil(base, pole, readable);\n const to = pushUntil(mix(base, glowColor, clamp01(inputs.style.background.glow)), pole, (c) => gradientPoints(from, c).every(readable));\n background = { from, to };\n }\n const backgroundStops = background ? gradientPoints(background.from, background.to).map(quantize) : [];\n const light = colorOf(inputs.style.lightToken) ?? WHITE;\n\n const radiusPx = sizeOf(inputs.resolutions.get(DesignSystemToken.RADIUS)) ?? 0;\n const borderWidthPx = sizeOf(inputs.resolutions.get(DesignSystemToken.BORDER_WIDTH)) ?? 1;\n\n const tintOf = (style: Frame3DRegionStyle): FrameColor | null => (style.tintColor !== undefined ? cssColor(style.tintColor) : colorOf(style.tintToken));\n const drawn = (style: Frame3DRegionStyle): boolean => style.surface !== Frame3DSurfaceKind.NONE && tintOf(style) !== null && backgroundStops.length > 0;\n\n // ── Pass 1: shadows ── Each is black, made fainter until the background under it stays readable. A shadow\n // spreads beyond its own slab — under a NEIGHBOUR's slab too — and the renderer combines overlapping shadows by\n // their maximum, so every slab's frost must be readable over the background under the STRONGEST shadow of any\n // slab, not only under its own.\n const shadowAlphaOf = (style: Frame3DRegionStyle): number => {\n let alpha = clamp01(style.shadow.opacity);\n while (alpha > 0 && !backgroundStops.every((stop) => readable(composite(BLACK, alpha, stop)))) alpha = Math.max(0, alpha - 0.02);\n return alpha;\n };\n const shadowAlphas = new Map<ShellRegion, number>();\n for (const region of Object.values(ShellRegion)) {\n const style = inputs.style.regions[region];\n shadowAlphas.set(region, drawn(style) ? shadowAlphaOf(style) : 0);\n }\n const strongestShadow = Math.max(0, ...shadowAlphas.values());\n const underlays = [...backgroundStops, ...backgroundStops.map((stop) => quantize(composite(BLACK, strongestShadow, stop)))];\n\n // ── Pass 2: every slab's frost and rim, bounded over all of those underlays ──\n const slab = (region: ShellRegion, style: Frame3DRegionStyle): FrameSlabAppearance => {\n const tint = tintOf(style);\n if (!drawn(style) || !tint) return invisibleSlab();\n const shadowAlpha = shadowAlphas.get(region) ?? 0;\n\n // Frost: the lit side moves toward the theme's light colour; in dark mode by the style's dark-mode share.\n const fillAlpha = clamp01((glass ? glass.optics.tintOpacity : style.frost) * tintAlpha(style, inputs.resolutions));\n const litAmount = clamp01(style.gradient) * (inputs.isDark ? clamp01(inputs.style.darkModeLightStrength) : 1);\n const frostReadable = (fill: FrameColor): boolean => underlays.every((under) => readable(composite(fill, fillAlpha, under)));\n const fillFrom = pushUntil(tint, pole, frostReadable);\n const fillTo = pushUntil(mix(fillFrom, light, litAmount), pole, (c) => gradientPoints(fillFrom, c).every(frostReadable));\n const frostUnderlays = gradientPoints(fillFrom, fillTo).flatMap((fill) => underlays.map((under) => ({ fill, under })));\n\n // Rim: at its HOVER opacity, over every frost point — one layer with the frost, as the shader writes it —\n // made fainter (rest and hover together) until readable.\n const rim = colorOf(style.rim.token) ?? foreground;\n // A glass material states its rest highlight; the hover emphasis keeps the style's own hover-to-rest ratio.\n const styleRatio = style.rim.opacity > 0 ? style.rim.hoverOpacity / style.rim.opacity : 1;\n const rimRest = clamp01(glass ? glass.optics.edgeHighlightOpacity : style.rim.opacity);\n const rimHover = clamp01(glass ? glass.optics.edgeHighlightOpacity * styleRatio : style.rim.hoverOpacity);\n let rimScale = 1;\n const rimReadable = (scale: number): boolean => frostUnderlays.every(({ fill, under }) => readable(composite(rim, rimHover * scale, composite(fill, fillAlpha, under))));\n while (rimScale > 0 && !rimReadable(rimScale)) rimScale = Math.max(0, rimScale - 0.02);\n\n return {\n visible: true,\n fillFrom,\n fillTo,\n fillAlpha,\n rim,\n rimAlpha: rimRest * rimScale,\n rimHoverAlpha: rimHover * rimScale,\n rimWidthPx: glass ? glass.optics.rimWidthDevicePx / Math.max(1, inputs.devicePixelRatio) : borderWidthPx * Math.max(0, style.rim.widthScale),\n radiusPx: radiusPx * Math.max(0, style.radiusScale),\n shadowOffsetXPx: style.shadow.offsetXPx,\n shadowOffsetYPx: style.shadow.offsetYPx,\n shadowBlurPx: Math.max(0, style.shadow.blurPx),\n shadowAlpha,\n };\n };\n\n const regions = {} as Record<ShellRegion, FrameSlabAppearance>;\n for (const region of Object.values(ShellRegion)) regions[region] = slab(region, inputs.style.regions[region]);\n\n const reduced = inputs.prefersReducedMotion;\n const slowestSeconds = Math.max(0, ...DURATION_TOKENS.map((token) => secondsOf(inputs.resolutions.get(token))));\n return {\n foreground,\n background,\n lightAngleDeg,\n regions,\n transitionSeconds: reduced ? 0 : secondsOf(inputs.resolutions.get(DesignSystemToken.MOTION_DURATION_NORMAL)),\n transitionEasing: easingOf(inputs.resolutions.get(DesignSystemToken.MOTION_EASING_DEFAULT)),\n hoverSeconds: secondsOf(inputs.resolutions.get(DesignSystemToken.MOTION_DURATION_FAST)),\n hoverEasing: easingOf(inputs.resolutions.get(DesignSystemToken.MOTION_EASING_SPRING)),\n hoverSpring: springOf(inputs.surfaceGestureTransition),\n hoverResponse: !reduced,\n transitionCeilingSeconds: slowestSeconds > 0 ? slowestSeconds * 1.5 : 1.5,\n };\n}\n\n/**\n * A motion.dev gesture transition, when it is a spring. motion.dev's defaults fill what it omits: stiffness 100,\n * damping 10, mass 1. Anything that is not `type: 'spring'` (a tween) leaves the hover to the motion tokens.\n */\nfunction springOf(transition: Readonly<Record<string, string | number>> | undefined): FrameSpring | null {\n if (!transition || transition.type !== 'spring') return null;\n const number = (key: string, fallback: number): number => (typeof transition[key] === 'number' && Number.isFinite(transition[key]) ? (transition[key] as number) : fallback);\n const spring = { stiffness: number('stiffness', 100), damping: number('damping', 10), mass: number('mass', 1) };\n return spring.stiffness > 0 && spring.mass > 0 && spring.damping >= 0 ? spring : null;\n}\n\nfunction clamp01(value: number): number {\n return Math.min(1, Math.max(0, value));\n}\n\nfunction tokenColor(resolution: DesignTokenResolution | undefined): FrameColor | null {\n if (!resolution || !('resolved' in resolution) || resolution.resolved.kind !== ResolvedDesignTokenKind.COLOR) return null;\n const [r, g, b] = resolution.resolved.linearRgb;\n return [encodeSrgb(r), encodeSrgb(g), encodeSrgb(b)];\n}\n\n/** A token colour's own alpha multiplies the frost: a translucent token is a lighter tint, not an opaque one. */\nfunction tintAlpha(style: Frame3DRegionStyle, resolutions: ReadonlyMap<DesignSystemToken, DesignTokenResolution>): number {\n if (style.tintColor !== undefined) return parse(style.tintColor)?.alpha ?? 1;\n const resolution = resolutions.get(style.tintToken);\n return resolution && 'resolved' in resolution && resolution.resolved.kind === ResolvedDesignTokenKind.COLOR ? resolution.resolved.alpha : 1;\n}\n\nfunction cssColor(value: string): FrameColor | null {\n const parsed = parse(value);\n if (!parsed) return null;\n const rgb = toSrgb(parsed);\n return [clamp01(Number(rgb.r ?? 0)), clamp01(Number(rgb.g ?? 0)), clamp01(Number(rgb.b ?? 0))];\n}\n\nfunction sizeOf(resolution: DesignTokenResolution | undefined): number | null {\n return resolution && 'resolved' in resolution && resolution.resolved.kind === ResolvedDesignTokenKind.SIZE ? resolution.resolved.px : null;\n}\n\nfunction secondsOf(resolution: DesignTokenResolution | undefined): number {\n return resolution && 'resolved' in resolution && resolution.resolved.kind === ResolvedDesignTokenKind.DURATION ? Math.max(0, resolution.resolved.seconds) : 0;\n}\n\nfunction easingOf(resolution: DesignTokenResolution | undefined): FrameEasing {\n return resolution && 'resolved' in resolution && resolution.resolved.kind === ResolvedDesignTokenKind.EASING ? resolution.resolved.controlPoints : LINEAR_EASING;\n}\n\nfunction invisibleSlab(): FrameSlabAppearance {\n return {\n visible: false,\n fillFrom: BLACK,\n fillTo: BLACK,\n fillAlpha: 0,\n rim: BLACK,\n rimAlpha: 0,\n rimHoverAlpha: 0,\n rimWidthPx: 0,\n radiusPx: 0,\n shadowOffsetXPx: 0,\n shadowOffsetYPx: 0,\n shadowBlurPx: 0,\n shadowAlpha: 0,\n };\n}\n"]}
1
+ {"version":3,"file":"frame-appearance.js","sourceRoot":"","sources":["../../../src/frame/frame-appearance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,QA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\nimport { DesignSystemToken, MaterialKind, ShellRegion, type MaterialProfile } from '@wildo-ai/presets-components-models';\n\nimport { Frame3DSurfaceKind, type Frame3DRegionStyle, type Frame3DThemeStyle } from './frame-3d-style';\nimport { BLACK, WHITE, composite, contrastRatio, encodeSrgb, gradientPoints, mix, pushUntil, quantize, type FrameColor } from './frame-color';\nimport { ResolvedDesignTokenKind, type DesignTokenResolution } from '../tokens/design-token-resolution';\n\nexport type { FrameColor } from './frame-color';\n\n/** How one region kind's slab is drawn, in frame units (CSS pixels, sRGB-encoded colours). */\nexport interface FrameSlabAppearance {\n /** False when the style draws nothing here, or a colour it needs did not resolve. */\n visible: boolean;\n /** The shaded side of the frost. */\n fillFrom: FrameColor;\n /** The lit side of the frost. */\n fillTo: FrameColor;\n fillAlpha: number;\n rim: FrameColor;\n rimAlpha: number;\n rimHoverAlpha: number;\n rimWidthPx: number;\n radiusPx: number;\n shadowOffsetXPx: number;\n shadowOffsetYPx: number;\n shadowBlurPx: number;\n shadowAlpha: number;\n}\n\n/** A cubic-Bézier easing, as its four control points. */\nexport type FrameEasing = readonly [number, number, number, number];\n\n/** A damped spring, as motion.dev's gesture `transition` declares one. */\nexport interface FrameSpring {\n stiffness: number;\n damping: number;\n mass: number;\n}\n\n/**\n * Everything the frame draws, as plain data. It is computed in the DOM tree from the theme and handed to the\n * canvas as props, so the canvas holds meshes only and reads no context (#1823).\n */\nexport interface FrameAppearance {\n /** The `--foreground` the bound was computed against. A change of it (a mode switch) is applied at once. */\n foreground: FrameColor;\n /** The in-scene background, shaded side then lit side. */\n background: { from: FrameColor; to: FrameColor } | null;\n /** The light direction in the FRAME's convention: degrees, 0 = from the right, 90 = from the top (y up). */\n lightAngleDeg: number;\n regions: Record<ShellRegion, FrameSlabAppearance>;\n /** A theme change cross-fades over this. 0 under reduced motion. */\n transitionSeconds: number;\n transitionEasing: FrameEasing;\n /** The rim's hover emphasis animates over this, when no spring is declared. */\n hoverSeconds: number;\n hoverEasing: FrameEasing;\n /** The theme's surface gesture spring: when declared, the rim's hover emphasis follows it instead. */\n hoverSpring: FrameSpring | null;\n /** False under reduced motion: the frame is static, so the rim does not respond to hover at all. */\n hoverResponse: boolean;\n /**\n * How long a shell CSS transition may run before the frame stops following it without a `transitionend`:\n * the slowest motion-duration token, with half again as margin. The shell's own transitions use those tokens.\n */\n transitionCeilingSeconds: number;\n}\n\nexport interface FrameAppearanceInputs {\n resolutions: ReadonlyMap<DesignSystemToken, DesignTokenResolution>;\n style: Frame3DThemeStyle;\n /** The theme's navigation material (`MaterialProfileRole.GLASS_NAVIGATION`), when it has one. */\n navigationMaterial: MaterialProfile | undefined;\n /** The theme's surface gesture `transition` (motion.dev), when its surface recipe declares one. */\n surfaceGestureTransition: Readonly<Record<string, string | number>> | undefined;\n isDark: boolean;\n prefersReducedMotion: boolean;\n /** Converts the material's device-pixel rim width into CSS pixels. */\n devicePixelRatio: number;\n}\n\n/**\n * The lowest contrast any colour the frame can put behind text may have against `--foreground`: WCAG 2.x's\n * AA minimum for normal text.\n * spec-cite: WCAG 2.2 SC 1.4.3 Contrast (Minimum) — https://www.w3.org/TR/WCAG22/#contrast-minimum\n */\nexport const FRAME_MINIMUM_CONTRAST = 4.5;\n\n/**\n * What the derivation actually aims for: the minimum plus a margin for a GPU that TRUNCATES rather than rounds\n * when it writes a blended value to the 8-bit framebuffer. The model already rounds every layer it writes\n * ({@link quantize}); truncation moves a channel by at most one more level, which the margin covers.\n */\nconst FRAME_CONTRAST_TARGET = FRAME_MINIMUM_CONTRAST + 0.05;\n\nconst LINEAR_EASING: FrameEasing = [0, 0, 1, 1];\nconst DURATION_TOKENS = [\n DesignSystemToken.MOTION_DURATION_INSTANT,\n DesignSystemToken.MOTION_DURATION_FAST,\n DesignSystemToken.MOTION_DURATION_NORMAL,\n DesignSystemToken.MOTION_DURATION_SLOW,\n DesignSystemToken.MOTION_DURATION_SLOWER,\n];\nconst toSrgb = converter('rgb');\n\n/**\n * Derive the frame's appearance from the active theme, or `null` when the foreground did not resolve — without\n * it no colour can be shown to be readable, and a frame that cannot be shown readable is not drawn.\n *\n * **The contrast bound** is part of the derivation, not a check after it. Every colour text can sit on is\n * composited the way the framebuffer blends — in sRGB-encoded space, each written layer rounded to 8 bits — and\n * must reach the target against `--foreground`:\n * - the background, at several points along its gradient;\n * - the background under a shadow (shadows combine by MAXIMUM in the renderer, never by stacking, so one\n * shadow at its full opacity is the darkest a point can be);\n * - the frost over either, along its own gradient;\n * - the rim at its HOVER opacity over the frost.\n *\n * A style value that would break it is WEAKENED — a colour moved toward the pole with the most contrast, a\n * shadow or rim made fainter — and the bound is never relaxed. A style is a preference; the bound is a guarantee.\n */\nexport function deriveFrameAppearance(inputs: FrameAppearanceInputs): FrameAppearance | null {\n const colorOf = (token: DesignSystemToken): FrameColor | null => tokenColor(inputs.resolutions.get(token));\n const foreground = colorOf(DesignSystemToken.FOREGROUND);\n if (!foreground) return null;\n // The pole is black or white, whichever contrasts more with the foreground; bounded colours move toward it.\n const pole = contrastRatio(foreground, BLACK) >= contrastRatio(foreground, WHITE) ? BLACK : WHITE;\n const readable = (color: FrameColor): boolean => contrastRatio(quantize(color), foreground) >= FRAME_CONTRAST_TARGET;\n\n const glass = inputs.navigationMaterial?.kind === MaterialKind.GLASS ? inputs.navigationMaterial : undefined;\n // A material's light angle is measured against the DOM's y-DOWN axis (the engine's edge response reads it\n // against image-space normals); the frame's is y-UP, so the vertical component flips sign.\n const lightAngleDeg = glass ? -glass.optics.lightAngleDeg : inputs.style.lightAngleDeg;\n\n // ── Background ── (nothing is drawn, not even a slab, when its base colour does not resolve: frost over an\n // unknown base cannot be bounded.)\n const base = colorOf(inputs.style.background.baseToken);\n const glowColor = colorOf(inputs.style.background.glowToken) ?? base;\n let background: { from: FrameColor; to: FrameColor } | null = null;\n if (base && glowColor) {\n const from = pushUntil(base, pole, readable);\n const to = pushUntil(mix(base, glowColor, clamp01(inputs.style.background.glow)), pole, (c) => gradientPoints(from, c).every(readable));\n background = { from, to };\n }\n const backgroundStops = background ? gradientPoints(background.from, background.to).map(quantize) : [];\n const light = colorOf(inputs.style.lightToken) ?? WHITE;\n\n const radiusPx = sizeOf(inputs.resolutions.get(DesignSystemToken.RADIUS)) ?? 0;\n const borderWidthPx = sizeOf(inputs.resolutions.get(DesignSystemToken.BORDER_WIDTH)) ?? 1;\n\n const tintOf = (style: Frame3DRegionStyle): FrameColor | null => (style.tintColor !== undefined ? cssColor(style.tintColor) : colorOf(style.tintToken));\n const drawn = (style: Frame3DRegionStyle): boolean => style.surface !== Frame3DSurfaceKind.NONE && tintOf(style) !== null && backgroundStops.length > 0;\n\n // ── Pass 1: shadows ── Each is black, made fainter until the background under it stays readable. A shadow\n // spreads beyond its own slab — under a NEIGHBOUR's slab too — and the renderer combines overlapping shadows by\n // their maximum, so every slab's frost must be readable over the background under the STRONGEST shadow of any\n // slab, not only under its own.\n const shadowAlphaOf = (style: Frame3DRegionStyle): number => {\n let alpha = clamp01(style.shadow.opacity);\n while (alpha > 0 && !backgroundStops.every((stop) => readable(composite(BLACK, alpha, stop)))) alpha = Math.max(0, alpha - 0.02);\n return alpha;\n };\n const shadowAlphas = new Map<ShellRegion, number>();\n for (const region of Object.values(ShellRegion)) {\n const style = inputs.style.regions[region];\n shadowAlphas.set(region, drawn(style) ? shadowAlphaOf(style) : 0);\n }\n const strongestShadow = Math.max(0, ...shadowAlphas.values());\n const underlays = [...backgroundStops, ...backgroundStops.map((stop) => quantize(composite(BLACK, strongestShadow, stop)))];\n\n // ── Pass 2: every slab's frost and rim, bounded over all of those underlays ──\n const slab = (region: ShellRegion, style: Frame3DRegionStyle): FrameSlabAppearance => {\n const tint = tintOf(style);\n if (!drawn(style) || !tint) return invisibleSlab();\n const shadowAlpha = shadowAlphas.get(region) ?? 0;\n\n // Frost: the lit side moves toward the theme's light colour; in dark mode by the style's dark-mode share.\n const fillAlpha = clamp01((glass ? glass.optics.tintOpacity : style.frost) * tintAlpha(style, inputs.resolutions));\n const litAmount = clamp01(style.gradient) * (inputs.isDark ? clamp01(inputs.style.darkModeLightStrength) : 1);\n const frostReadable = (fill: FrameColor): boolean => underlays.every((under) => readable(composite(fill, fillAlpha, under)));\n const fillFrom = pushUntil(tint, pole, frostReadable);\n const fillTo = pushUntil(mix(fillFrom, light, litAmount), pole, (c) => gradientPoints(fillFrom, c).every(frostReadable));\n const frostUnderlays = gradientPoints(fillFrom, fillTo).flatMap((fill) => underlays.map((under) => ({ fill, under })));\n\n // Rim: at its HOVER opacity, over every frost point — one layer with the frost, as the shader writes it —\n // made fainter (rest and hover together) until readable.\n const rim = colorOf(style.rim.token) ?? foreground;\n // A glass material states its rest highlight; the hover emphasis keeps the style's own hover-to-rest ratio.\n const styleRatio = style.rim.opacity > 0 ? style.rim.hoverOpacity / style.rim.opacity : 1;\n const rimRest = clamp01(glass ? glass.optics.edgeHighlightOpacity : style.rim.opacity);\n const rimHover = clamp01(glass ? glass.optics.edgeHighlightOpacity * styleRatio : style.rim.hoverOpacity);\n let rimScale = 1;\n const rimReadable = (scale: number): boolean => frostUnderlays.every(({ fill, under }) => readable(composite(rim, rimHover * scale, composite(fill, fillAlpha, under))));\n while (rimScale > 0 && !rimReadable(rimScale)) rimScale = Math.max(0, rimScale - 0.02);\n\n return {\n visible: true,\n fillFrom,\n fillTo,\n fillAlpha,\n rim,\n rimAlpha: rimRest * rimScale,\n rimHoverAlpha: rimHover * rimScale,\n rimWidthPx: glass ? glass.optics.rimWidthDevicePx / Math.max(1, inputs.devicePixelRatio) : borderWidthPx * Math.max(0, style.rim.widthScale),\n radiusPx: radiusPx * Math.max(0, style.radiusScale),\n shadowOffsetXPx: style.shadow.offsetXPx,\n shadowOffsetYPx: style.shadow.offsetYPx,\n shadowBlurPx: Math.max(0, style.shadow.blurPx),\n shadowAlpha,\n };\n };\n\n const regions = {} as Record<ShellRegion, FrameSlabAppearance>;\n for (const region of Object.values(ShellRegion)) regions[region] = slab(region, inputs.style.regions[region]);\n\n const reduced = inputs.prefersReducedMotion;\n const slowestSeconds = Math.max(0, ...DURATION_TOKENS.map((token) => secondsOf(inputs.resolutions.get(token))));\n return {\n foreground,\n background,\n lightAngleDeg,\n regions,\n transitionSeconds: reduced ? 0 : secondsOf(inputs.resolutions.get(DesignSystemToken.MOTION_DURATION_NORMAL)),\n transitionEasing: easingOf(inputs.resolutions.get(DesignSystemToken.MOTION_EASING_DEFAULT)),\n hoverSeconds: secondsOf(inputs.resolutions.get(DesignSystemToken.MOTION_DURATION_FAST)),\n hoverEasing: easingOf(inputs.resolutions.get(DesignSystemToken.MOTION_EASING_SPRING)),\n hoverSpring: springOf(inputs.surfaceGestureTransition),\n hoverResponse: !reduced,\n transitionCeilingSeconds: slowestSeconds > 0 ? slowestSeconds * 1.5 : 1.5,\n };\n}\n\n/**\n * A motion.dev gesture transition, when it is a spring. motion.dev's defaults fill what it omits: stiffness 100,\n * damping 10, mass 1. Anything that is not `type: 'spring'` (a tween) leaves the hover to the motion tokens.\n */\nfunction springOf(transition: Readonly<Record<string, string | number>> | undefined): FrameSpring | null {\n if (!transition || transition.type !== 'spring') return null;\n const number = (key: string, fallback: number): number => (typeof transition[key] === 'number' && Number.isFinite(transition[key]) ? (transition[key] as number) : fallback);\n const spring = { stiffness: number('stiffness', 100), damping: number('damping', 10), mass: number('mass', 1) };\n return spring.stiffness > 0 && spring.mass > 0 && spring.damping >= 0 ? spring : null;\n}\n\nfunction clamp01(value: number): number {\n return Math.min(1, Math.max(0, value));\n}\n\nfunction tokenColor(resolution: DesignTokenResolution | undefined): FrameColor | null {\n if (!resolution || !('resolved' in resolution) || resolution.resolved.kind !== ResolvedDesignTokenKind.COLOR) return null;\n const [r, g, b] = resolution.resolved.linearRgb;\n return [encodeSrgb(r), encodeSrgb(g), encodeSrgb(b)];\n}\n\n/** A token colour's own alpha multiplies the frost: a translucent token is a lighter tint, not an opaque one. */\nfunction tintAlpha(style: Frame3DRegionStyle, resolutions: ReadonlyMap<DesignSystemToken, DesignTokenResolution>): number {\n if (style.tintColor !== undefined) return parse(style.tintColor)?.alpha ?? 1;\n const resolution = resolutions.get(style.tintToken);\n return resolution && 'resolved' in resolution && resolution.resolved.kind === ResolvedDesignTokenKind.COLOR ? resolution.resolved.alpha : 1;\n}\n\nfunction cssColor(value: string): FrameColor | null {\n const parsed = parse(value);\n if (!parsed) return null;\n const rgb = toSrgb(parsed);\n return [clamp01(Number(rgb.r ?? 0)), clamp01(Number(rgb.g ?? 0)), clamp01(Number(rgb.b ?? 0))];\n}\n\nfunction sizeOf(resolution: DesignTokenResolution | undefined): number | null {\n return resolution && 'resolved' in resolution && resolution.resolved.kind === ResolvedDesignTokenKind.SIZE ? resolution.resolved.px : null;\n}\n\nfunction secondsOf(resolution: DesignTokenResolution | undefined): number {\n return resolution && 'resolved' in resolution && resolution.resolved.kind === ResolvedDesignTokenKind.DURATION ? Math.max(0, resolution.resolved.seconds) : 0;\n}\n\nfunction easingOf(resolution: DesignTokenResolution | undefined): FrameEasing {\n return resolution && 'resolved' in resolution && resolution.resolved.kind === ResolvedDesignTokenKind.EASING ? resolution.resolved.controlPoints : LINEAR_EASING;\n}\n\nfunction invisibleSlab(): FrameSlabAppearance {\n return {\n visible: false,\n fillFrom: BLACK,\n fillTo: BLACK,\n fillAlpha: 0,\n rim: BLACK,\n rimAlpha: 0,\n rimHoverAlpha: 0,\n rimWidthPx: 0,\n radiusPx: 0,\n shadowOffsetXPx: 0,\n shadowOffsetYPx: 0,\n shadowBlurPx: 0,\n shadowAlpha: 0,\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"frame-canvas.d.ts","sourceRoot":"","sources":["../../../../src/frame/frame-canvas.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkC,MAAM,OAAO,CAAC;AACvD,OAAO,EAAoB,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAI3F,OAAO,EAAiB,KAAK,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,o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: one scene unit is one CSS pixel, so a slab lies exactly on its region's box.
37
37
  return { orthographic: true, camera: { position: [0, 0, 10], zoom: 1 } };
38
- case Layout3DCamera.SPATIAL_PERSPECTIVE:
39
- // The spatial layout draws its own environment through its own camera (`spatial/`); the frame is never mounted.
40
- throw new Error('The 3D frame does not draw a spatial layout: its placement renders the spatial environment itself.');
38
+ case Layout3DCamera.STILL_PERSPECTIVE:
39
+ // A still-perspective layout carries its depth in its own HTML objects; the frame is never mounted for it.
40
+ throw new Error('The 3D frame does not draw a still-perspective layout: its placement stages the objects itself.');
41
41
  default: {
42
42
  const unsupported = camera;
43
43
  throw new Error(`The 3D frame has no camera '${String(unsupported)}'.`);
@@ -1 +1 @@
1
- {"version":3,"file":"frame-canvas.js","sourceRoot":"","sources":["../../../../src/frame/frame-canvas.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAuC,MAAM,oBAAoB,CAAC;AAG3F,OAAO,EAAE,iBAAiB,EAAoB,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,aAAa,EAA+B,MAAM,kBAAkB,CAAC;AAE9E,OAAO,EAAE,cAAc,EAAoE,MAAM,gCAAgC,CAAC;AAElI;;;;GAIG;AACH,MAAM,iBAAiB,GAAG,GAA8B,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC;AAE7F;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,OAAO;IAClB,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE;IAClE,MAAM,EAAE,iBAAiB;IACzB,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE;CACO,CAAC;AAqB1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AC;QACnC,SAAS,CAAC,OAAO,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IAC/C,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjB,iGAAiG;IACjG,eAAe,CAAC,GAAG,EAAE;QACnB,aAAa,CAAC,OAAO,GAAG,mBAAmB,CAAC;QAC5C,SAAS,CAAC,OAAO,EAAE,aAAa,CAAC,mBAAmB,CAAC,CAAC;IACxD,CAAC,EAAE,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAC1B,eAAe,CAAC,GAAG,EAAE;QACnB,cAAc,CAAC,OAAO,GAAG,WAAW,CAAC;QACrC,SAAS,CAAC,OAAO,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC;IACjD,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAElB,iHAAiH;IACjH,kDAAkD;IAClD,eAAe,CAAC,GAAG,EAAE;QACnB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAC9B,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IAEnC,OAAO,gBAAO,GAAG,EAAE,QAAQ,GAAI,CAAC;AAClC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,MAAmB,EAAE,OAA+B;IAClF,MAAM,SAAS,GAAG,6BAA6B,OAAO,EAAE,CAAC;IACzD,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC5F,CAAC","sourcesContent":["import React, { useLayoutEffect, useRef } from 'react';\nimport { Canvas, useThree, type CanvasProps, type EventManager } from '@react-three/fiber';\nimport { Group } from 'three';\n\nimport { createFrameDriver, type FrameDriver } from './frame-driver';\nimport { FrameRenderer, type FrameTransitionTrigger } from './frame-renderer';\nimport type { FrameAppearance } from './frame-appearance';\nimport { Layout3DCamera, type Layout3DFrameChoreography, type Layout3DZoneFocusTransition } from '../layout/layout-3d-vocabulary';\n\n/**\n * The frame receives no pointer events and handles none. fiber's wrapper would otherwise set\n * `pointer-events: auto` inline and attach its listeners, making a full-viewport canvas a hit target wherever\n * the shell root does not cover it. Hover is read from the DOCUMENT instead (see {@link FrameScene}).\n */\nconst NO_POINTER_EVENTS = (): EventManager<HTMLElement> => ({ enabled: false, priority: 0 });\n\n/**\n * Every `<Canvas>` setting the frame depends on, in one place so a test pins them.\n *\n * - `flat`: no tone mapping. The shaders write sRGB-encoded colours as given; tone mapping would move every\n * colour after the contrast bound was checked.\n * - `frameloop: 'never'`: fiber renders nothing on its own. The scene renders when a region moved, when the\n * appearance changed, and per animation frame only while something animates — so an idle shell costs zero frames.\n * - `powerPreference: 'low-power'`: a decorative frame must not wake a discrete GPU.\n */\nexport const FRAME_CANVAS_SETTINGS = {\n flat: true,\n frameloop: 'never',\n gl: { alpha: true, antialias: true, powerPreference: 'low-power' },\n events: NO_POINTER_EVENTS,\n style: { pointerEvents: 'none' },\n} satisfies Omit<CanvasProps, 'children'>;\n\nexport interface FrameCanvasProps {\n /** Computed in the DOM tree (`useFrameAppearance`); the canvas reads no context of its own. */\n appearance: FrameAppearance | null;\n /** The layout's camera. */\n camera: Layout3DCamera;\n /** Whether the layout's transitions cross-fade an appearance change (`crossFadesAppearance`). */\n crossFadeAppearance: boolean;\n /** What the layout plays on a navigation (#1826). */\n navigationTransition: Layout3DFrameChoreography;\n /** What the layout plays when the sidebar collapses, expands or is resized (#1826). */\n sidebarResizeTransition: Layout3DFrameChoreography;\n /** What the layout shows for the focused zone (#1826). */\n zoneFocusTransition: Layout3DZoneFocusTransition;\n /** The content's identity, from the navigation state: a change plays the navigation transition. */\n navigationSignature: string;\n /** The navigation state's focused zone, or null. */\n focusedZone: string | null;\n}\n\n/**\n * The `<Canvas>` camera for a layout's camera. Exhaustive over {@link Layout3DCamera}: a camera added for #1826\n * fails to compile here until the frame can draw through it.\n */\nexport function canvasCameraSettings(camera: Layout3DCamera): Pick<CanvasProps, 'orthographic' | 'camera'> {\n switch (camera) {\n case Layout3DCamera.FLAT_ORTHOGRAPHIC:\n // Orthographic with zoom 1: one scene unit is one CSS pixel, so a slab lies exactly on its region's box.\n return { orthographic: true, camera: { position: [0, 0, 10], zoom: 1 } };\n case Layout3DCamera.SPATIAL_PERSPECTIVE:\n // The spatial layout draws its own environment through its own camera (`spatial/`); the frame is never mounted.\n throw new Error('The 3D frame does not draw a spatial layout: its placement renders the spatial environment itself.');\n default: {\n const unsupported: never = camera;\n throw new Error(`The 3D frame has no camera '${String(unsupported)}'.`);\n }\n }\n}\n\n/**\n * The 3D frame (#1823): an in-scene background derived from the theme tokens, and a frosted slab under every\n * shell region, aligned to the region's box. Everything inside the regions stays the 2D shell's HTML; this\n * canvas draws only what is behind them, and holds meshes only.\n */\nexport default function FrameCanvas({ camera, ...scene }: FrameCanvasProps): React.JSX.Element {\n return (\n <div aria-hidden=\"true\" data-frame-3d=\"frame\" className=\"fixed inset-0 pointer-events-none\">\n <Canvas {...FRAME_CANVAS_SETTINGS} {...canvasCameraSettings(camera)}>\n <FrameScene {...scene} />\n </Canvas>\n </div>\n );\n}\n\n/**\n * The scene host: creates the renderer and the scheduling driver (`createFrameDriver`, which decides WHEN to draw)\n * and forwards the appearance prop to it. Everything about timing lives in the driver, where it is unit-tested.\n */\nfunction FrameScene({\n appearance,\n crossFadeAppearance,\n navigationTransition,\n sidebarResizeTransition,\n zoneFocusTransition,\n navigationSignature,\n focusedZone,\n}: Omit<FrameCanvasProps, 'camera'>): React.JSX.Element {\n const groupRef = useRef<Group>(null);\n const gl = useThree((state) => state.gl);\n const scene = useThree((state) => state.scene);\n const camera = useThree((state) => state.camera);\n const get = useThree((state) => state.get);\n const size = useThree((state) => state.size);\n const dpr = useThree((state) => state.viewport.dpr);\n const driverRef = useRef<FrameDriver | null>(null);\n // The latest inputs, so a driver re-created for a new renderer or camera starts from them (not from nothing): its\n // first navigation signature only records, so a re-creation never plays a navigation that did not happen.\n const appearanceRef = useRef(appearance);\n const navigationRef = useRef(navigationSignature);\n const focusedZoneRef = useRef(focusedZone);\n\n useLayoutEffect(() => {\n const group = groupRef.current;\n if (!group) return undefined;\n const renderer = new FrameRenderer(group, { navigation: navigationTransition, sidebarResize: sidebarResizeTransition, zoneFocus: zoneFocusTransition });\n const driver = createFrameDriver(\n {\n renderer,\n renderScene: () => gl.render(scene, camera),\n // The canvas' own size from fiber's store: the number the camera frustum was fitted to.\n viewport: () => ({ width: get().size.width, height: get().size.height }),\n canvas: gl.domElement,\n document,\n requestFrame: (callback) => requestAnimationFrame(callback),\n cancelFrame: (handle) => cancelAnimationFrame(handle),\n now: () => performance.now(),\n createResizeObserver: (callback) => new ResizeObserver(callback),\n createMutationObserver: (callback) => new MutationObserver(callback),\n crossFadeAppearance,\n onTransitionStarted: (trigger) => countTransition(gl.domElement, trigger),\n },\n appearanceRef.current,\n );\n driver.setNavigation(navigationRef.current);\n driver.setFocusedZone(focusedZoneRef.current);\n driverRef.current = driver;\n return () => {\n driver.dispose();\n renderer.dispose();\n driverRef.current = null;\n };\n }, [gl, scene, camera, get, crossFadeAppearance, navigationTransition, sidebarResizeTransition, zoneFocusTransition]);\n\n // The appearance changed (theme, mode, reduced motion). Declared AFTER the scene effect, so the driver exists.\n useLayoutEffect(() => {\n if (appearanceRef.current === appearance) return;\n appearanceRef.current = appearance;\n driverRef.current?.setAppearance(appearance);\n }, [appearance]);\n\n // The content or the focused zone changed (#1826). After the scene effect, so the driver exists.\n useLayoutEffect(() => {\n navigationRef.current = navigationSignature;\n driverRef.current?.setNavigation(navigationSignature);\n }, [navigationSignature]);\n useLayoutEffect(() => {\n focusedZoneRef.current = focusedZone;\n driverRef.current?.setFocusedZone(focusedZone);\n }, [focusedZone]);\n\n // The canvas resized, or its pixel ratio changed: fiber has re-fitted the camera and cleared the drawing buffer,\n // so redraw even if every region is where it was.\n useLayoutEffect(() => {\n driverRef.current?.redraw();\n }, [size.width, size.height, dpr]);\n\n return <group ref={groupRef} />;\n}\n\n/**\n * Counts each started transition on the canvas element, as `data-frame-3d-transitions-<trigger>`. The frame's only\n * observable surface for WHICH choreography ran: a live probe (`scripts/presets-3d-live-probe`) reads it, because\n * counting draws cannot tell a choreography from a hover or a re-layout. Writes a number, nothing else.\n */\nexport function countTransition(canvas: HTMLElement, trigger: FrameTransitionTrigger): void {\n const attribute = `data-frame-3d-transitions-${trigger}`;\n canvas.setAttribute(attribute, String(Number(canvas.getAttribute(attribute) ?? '0') + 1));\n}\n"]}
1
+ {"version":3,"file":"frame-canvas.js","sourceRoot":"","sources":["../../../src/frame/frame-canvas.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAuC,MAAM,oBAAoB,CAAC;AAG3F,OAAO,EAAE,iBAAiB,EAAoB,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,aAAa,EAA+B,MAAM,kBAAkB,CAAC;AAE9E,OAAO,EAAE,cAAc,EAAoE,MAAM,gCAAgC,CAAC;AAElI;;;;GAIG;AACH,MAAM,iBAAiB,GAAG,GAA8B,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC;AAE7F;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,OAAO;IAClB,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE;IAClE,MAAM,EAAE,iBAAiB;IACzB,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE;CACO,CAAC;AAqB1C;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAsB;IACzD,QAAQ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AAC;IAC/C,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjB,iGAAiG;IACjG,eAAe,CAAC,GAAG,EAAE;QACnB,aAAa,CAAC,OAAO,GAAG,mBAAmB,CAAC;QAC5C,SAAS,CAAC,OAAO,EAAE,aAAa,CAAC,mBAAmB,CAAC,CAAC;IACxD,CAAC,EAAE,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAC1B,eAAe,CAAC,GAAG,EAAE;QACnB,cAAc,CAAC,OAAO,GAAG,WAAW,CAAC;QACrC,SAAS,CAAC,OAAO,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC;IACjD,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAElB,iHAAiH;IACjH,kDAAkD;IAClD,eAAe,CAAC,GAAG,EAAE;QACnB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAC9B,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IAEnC,OAAO,gBAAO,GAAG,EAAE,QAAQ,GAAI,CAAC;AAClC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,MAAmB,EAAE,OAA+B;IAClF,MAAM,SAAS,GAAG,6BAA6B,OAAO,EAAE,CAAC;IACzD,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC5F,CAAC","sourcesContent":["import React, { useLayoutEffect, useRef } from 'react';\nimport { Canvas, useThree, type CanvasProps, type EventManager } from '@react-three/fiber';\nimport { Group } from 'three';\n\nimport { createFrameDriver, type FrameDriver } from './frame-driver';\nimport { FrameRenderer, type FrameTransitionTrigger } from './frame-renderer';\nimport type { FrameAppearance } from './frame-appearance';\nimport { Layout3DCamera, type Layout3DFrameChoreography, type Layout3DZoneFocusTransition } from '../layout/layout-3d-vocabulary';\n\n/**\n * The frame receives no pointer events and handles none. fiber's wrapper would otherwise set\n * `pointer-events: auto` inline and attach its listeners, making a full-viewport canvas a hit target wherever\n * the shell root does not cover it. Hover is read from the DOCUMENT instead (see {@link FrameScene}).\n */\nconst NO_POINTER_EVENTS = (): EventManager<HTMLElement> => ({ enabled: false, priority: 0 });\n\n/**\n * Every `<Canvas>` setting the frame depends on, in one place so a test pins them.\n *\n * - `flat`: no tone mapping. The shaders write sRGB-encoded colours as given; tone mapping would move every\n * colour after the contrast bound was checked.\n * - `frameloop: 'never'`: fiber renders nothing on its own. The scene renders when a region moved, when the\n * appearance changed, and per animation frame only while something animates — so an idle shell costs zero frames.\n * - `powerPreference: 'low-power'`: a decorative frame must not wake a discrete GPU.\n */\nexport const FRAME_CANVAS_SETTINGS = {\n flat: true,\n frameloop: 'never',\n gl: { alpha: true, antialias: true, powerPreference: 'low-power' },\n events: NO_POINTER_EVENTS,\n style: { pointerEvents: 'none' },\n} satisfies Omit<CanvasProps, 'children'>;\n\nexport interface FrameCanvasProps {\n /** Computed in the DOM tree (`useFrameAppearance`); the canvas reads no context of its own. */\n appearance: FrameAppearance | null;\n /** The layout's camera. */\n camera: Layout3DCamera;\n /** Whether the layout's transitions cross-fade an appearance change (`crossFadesAppearance`). */\n crossFadeAppearance: boolean;\n /** What the layout plays on a navigation (#1826). */\n navigationTransition: Layout3DFrameChoreography;\n /** What the layout plays when the sidebar collapses, expands or is resized (#1826). */\n sidebarResizeTransition: Layout3DFrameChoreography;\n /** What the layout shows for the focused zone (#1826). */\n zoneFocusTransition: Layout3DZoneFocusTransition;\n /** The content's identity, from the navigation state: a change plays the navigation transition. */\n navigationSignature: string;\n /** The navigation state's focused zone, or null. */\n focusedZone: string | null;\n}\n\n/**\n * The `<Canvas>` camera for a layout's camera. Exhaustive over {@link Layout3DCamera}: a camera added for #1826\n * fails to compile here until the frame can draw through it.\n */\nexport function canvasCameraSettings(camera: Layout3DCamera): Pick<CanvasProps, 'orthographic' | 'camera'> {\n switch (camera) {\n case Layout3DCamera.FLAT_ORTHOGRAPHIC:\n // Orthographic with zoom 1: one scene unit is one CSS pixel, so a slab lies exactly on its region's box.\n return { orthographic: true, camera: { position: [0, 0, 10], zoom: 1 } };\n case Layout3DCamera.STILL_PERSPECTIVE:\n // A still-perspective layout carries its depth in its own HTML objects; the frame is never mounted for it.\n throw new Error('The 3D frame does not draw a still-perspective layout: its placement stages the objects itself.');\n default: {\n const unsupported: never = camera;\n throw new Error(`The 3D frame has no camera '${String(unsupported)}'.`);\n }\n }\n}\n\n/**\n * The 3D frame (#1823): an in-scene background derived from the theme tokens, and a frosted slab under every\n * shell region, aligned to the region's box. Everything inside the regions stays the 2D shell's HTML; this\n * canvas draws only what is behind them, and holds meshes only.\n */\nexport default function FrameCanvas({ camera, ...scene }: FrameCanvasProps): React.JSX.Element {\n return (\n <div aria-hidden=\"true\" data-frame-3d=\"frame\" className=\"fixed inset-0 pointer-events-none\">\n <Canvas {...FRAME_CANVAS_SETTINGS} {...canvasCameraSettings(camera)}>\n <FrameScene {...scene} />\n </Canvas>\n </div>\n );\n}\n\n/**\n * The scene host: creates the renderer and the scheduling driver (`createFrameDriver`, which decides WHEN to draw)\n * and forwards the appearance prop to it. Everything about timing lives in the driver, where it is unit-tested.\n */\nfunction FrameScene({\n appearance,\n crossFadeAppearance,\n navigationTransition,\n sidebarResizeTransition,\n zoneFocusTransition,\n navigationSignature,\n focusedZone,\n}: Omit<FrameCanvasProps, 'camera'>): React.JSX.Element {\n const groupRef = useRef<Group>(null);\n const gl = useThree((state) => state.gl);\n const scene = useThree((state) => state.scene);\n const camera = useThree((state) => state.camera);\n const get = useThree((state) => state.get);\n const size = useThree((state) => state.size);\n const dpr = useThree((state) => state.viewport.dpr);\n const driverRef = useRef<FrameDriver | null>(null);\n // The latest inputs, so a driver re-created for a new renderer or camera starts from them (not from nothing): its\n // first navigation signature only records, so a re-creation never plays a navigation that did not happen.\n const appearanceRef = useRef(appearance);\n const navigationRef = useRef(navigationSignature);\n const focusedZoneRef = useRef(focusedZone);\n\n useLayoutEffect(() => {\n const group = groupRef.current;\n if (!group) return undefined;\n const renderer = new FrameRenderer(group, { navigation: navigationTransition, sidebarResize: sidebarResizeTransition, zoneFocus: zoneFocusTransition });\n const driver = createFrameDriver(\n {\n renderer,\n renderScene: () => gl.render(scene, camera),\n // The canvas' own size from fiber's store: the number the camera frustum was fitted to.\n viewport: () => ({ width: get().size.width, height: get().size.height }),\n canvas: gl.domElement,\n document,\n requestFrame: (callback) => requestAnimationFrame(callback),\n cancelFrame: (handle) => cancelAnimationFrame(handle),\n now: () => performance.now(),\n createResizeObserver: (callback) => new ResizeObserver(callback),\n createMutationObserver: (callback) => new MutationObserver(callback),\n crossFadeAppearance,\n onTransitionStarted: (trigger) => countTransition(gl.domElement, trigger),\n },\n appearanceRef.current,\n );\n driver.setNavigation(navigationRef.current);\n driver.setFocusedZone(focusedZoneRef.current);\n driverRef.current = driver;\n return () => {\n driver.dispose();\n renderer.dispose();\n driverRef.current = null;\n };\n }, [gl, scene, camera, get, crossFadeAppearance, navigationTransition, sidebarResizeTransition, zoneFocusTransition]);\n\n // The appearance changed (theme, mode, reduced motion). Declared AFTER the scene effect, so the driver exists.\n useLayoutEffect(() => {\n if (appearanceRef.current === appearance) return;\n appearanceRef.current = appearance;\n driverRef.current?.setAppearance(appearance);\n }, [appearance]);\n\n // The content or the focused zone changed (#1826). After the scene effect, so the driver exists.\n useLayoutEffect(() => {\n navigationRef.current = navigationSignature;\n driverRef.current?.setNavigation(navigationSignature);\n }, [navigationSignature]);\n useLayoutEffect(() => {\n focusedZoneRef.current = focusedZone;\n driverRef.current?.setFocusedZone(focusedZone);\n }, [focusedZone]);\n\n // The canvas resized, or its pixel ratio changed: fiber has re-fitted the camera and cleared the drawing buffer,\n // so redraw even if every region is where it was.\n useLayoutEffect(() => {\n driverRef.current?.redraw();\n }, [size.width, size.height, dpr]);\n\n return <group ref={groupRef} />;\n}\n\n/**\n * Counts each started transition on the canvas element, as `data-frame-3d-transitions-<trigger>`. The frame's only\n * observable surface for WHICH choreography ran: a live probe (`scripts/presets-3d-live-probe`) reads it, because\n * counting draws cannot tell a choreography from a hover or a re-layout. Writes a number, nothing else.\n */\nexport function countTransition(canvas: HTMLElement, trigger: FrameTransitionTrigger): void {\n const attribute = `data-frame-3d-transitions-${trigger}`;\n canvas.setAttribute(attribute, String(Number(canvas.getAttribute(attribute) ?? '0') + 1));\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"frame-canvas.lazy.d.ts","sourceRoot":"","sources":["../../../../src/frame/frame-canvas.lazy.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyB,MAAM,OAAO,CAAC;AAI9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAUvD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,eAAe,8CAQ1B,CAAC"}
1
+ {"version":3,"file":"frame-canvas.lazy.d.ts","sourceRoot":"","sources":["../../../src/frame/frame-canvas.lazy.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyB,MAAM,OAAO,CAAC;AAI9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAUvD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,eAAe,8CAQ1B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"frame-canvas.lazy.js","sourceRoot":"","sources":["../../../../src/frame/frame-canvas.lazy.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAIpE;;;;;GAKG;AACH,MAAM,eAAe,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC;AAE7D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,eAAe,CAAC,KAAuB;IACxF,OAAO,CACL,KAAC,qBAAqB,IAAC,QAAQ,EAAC,6BAA6B,EAAC,QAAQ,EAAE,IAAI,YAC1E,KAAC,QAAQ,IAAC,QAAQ,EAAE,IAAI,YACtB,KAAC,eAAe,OAAK,KAAK,GAAI,GACrB,GACW,CACzB,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import React, { Suspense, lazy } from 'react';\n\nimport { LazyDoorErrorBoundary } from '@wildo-ai/saas-frontend-lib';\n\nimport type { FrameCanvasProps } from './frame-canvas';\n\n/**\n * The lazy door of the 3D frame: three.js and @react-three/fiber load only when a 3D main container actually\n * mounts, so an application that declares this library but has not reached its shell (the sign-in screens, a\n * public page) downloads none of it. `check:lazy-boundaries` keeps it a door: the module behind it may be\n * imported statically only here (and from tests).\n */\nconst LazyFrameCanvas = lazy(() => import('./frame-canvas'));\n\n/**\n * The boundary contains every THROWN failure of the decorative frame — a chunk that did not arrive, a WebGL\n * context the browser refused to create (fiber rethrows that during render) — to the frame's own slot. It is\n * failure containment, not a fallback mode: the 2D shell beside it never depended on the frame, so the\n * application keeps every region and simply shows no frame. There is deliberately no retry: a browser that\n * refused WebGL once refuses it again, and a retry loop is how a decoration becomes a CPU cost.\n *\n * A context LOST after creation is not an error and no boundary sees it: it is a `webglcontextlost` event,\n * which the canvas handles itself (it stops drawing, and redraws on `webglcontextrestored`).\n *\n * The boundary logs the failure itself (with the door name), so no `onError` is passed: a second line would\n * report the same failure twice.\n *\n * Memoised: its props are primitives and the appearance value, and the navigation context the frame slot reads\n * changes far more often than they do (the content area's width, on every frame of a sidebar animation), so an\n * unchanged frame never re-renders the canvas.\n */\nexport const FrameCanvasDoor = React.memo(function FrameCanvasDoor(props: FrameCanvasProps): React.JSX.Element {\n return (\n <LazyDoorErrorBoundary doorName=\"presets-components-3d/frame\" fallback={null}>\n <Suspense fallback={null}>\n <LazyFrameCanvas {...props} />\n </Suspense>\n </LazyDoorErrorBoundary>\n );\n});\n"]}
1
+ {"version":3,"file":"frame-canvas.lazy.js","sourceRoot":"","sources":["../../../src/frame/frame-canvas.lazy.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAIpE;;;;;GAKG;AACH,MAAM,eAAe,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC;AAE7D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,eAAe,CAAC,KAAuB;IACxF,OAAO,CACL,KAAC,qBAAqB,IAAC,QAAQ,EAAC,6BAA6B,EAAC,QAAQ,EAAE,IAAI,YAC1E,KAAC,QAAQ,IAAC,QAAQ,EAAE,IAAI,YACtB,KAAC,eAAe,OAAK,KAAK,GAAI,GACrB,GACW,CACzB,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import React, { Suspense, lazy } from 'react';\n\nimport { LazyDoorErrorBoundary } from '@wildo-ai/saas-frontend-lib';\n\nimport type { FrameCanvasProps } from './frame-canvas';\n\n/**\n * The lazy door of the 3D frame: three.js and @react-three/fiber load only when a 3D main container actually\n * mounts, so an application that declares this library but has not reached its shell (the sign-in screens, a\n * public page) downloads none of it. `check:lazy-boundaries` keeps it a door: the module behind it may be\n * imported statically only here (and from tests).\n */\nconst LazyFrameCanvas = lazy(() => import('./frame-canvas'));\n\n/**\n * The boundary contains every THROWN failure of the decorative frame — a chunk that did not arrive, a WebGL\n * context the browser refused to create (fiber rethrows that during render) — to the frame's own slot. It is\n * failure containment, not a fallback mode: the 2D shell beside it never depended on the frame, so the\n * application keeps every region and simply shows no frame. There is deliberately no retry: a browser that\n * refused WebGL once refuses it again, and a retry loop is how a decoration becomes a CPU cost.\n *\n * A context LOST after creation is not an error and no boundary sees it: it is a `webglcontextlost` event,\n * which the canvas handles itself (it stops drawing, and redraws on `webglcontextrestored`).\n *\n * The boundary logs the failure itself (with the door name), so no `onError` is passed: a second line would\n * report the same failure twice.\n *\n * Memoised: its props are primitives and the appearance value, and the navigation context the frame slot reads\n * changes far more often than they do (the content area's width, on every frame of a sidebar animation), so an\n * unchanged frame never re-renders the canvas.\n */\nexport const FrameCanvasDoor = React.memo(function FrameCanvasDoor(props: FrameCanvasProps): React.JSX.Element {\n return (\n <LazyDoorErrorBoundary doorName=\"presets-components-3d/frame\" fallback={null}>\n <Suspense fallback={null}>\n <LazyFrameCanvas {...props} />\n </Suspense>\n </LazyDoorErrorBoundary>\n );\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"frame-color.d.ts","sourceRoot":"","sources":["../../../../src/frame/frame-color.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,2GAA2G;AAC3G,MAAM,MAAM,UAAU,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE3D,eAAO,MAAM,KAAK,EAAE,UAAsB,CAAC;AAC3C,eAAO,MAAM,KAAK,EAAE,UAAsB,CAAC;AAM3C,sKAAsK;AACtK,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAG3D;AAED,iKAAiK;AACjK,wBAAgB,aAAa,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,GAAG,MAAM,CAIlE;AAED,uGAAuG;AACvG,wBAAgB,SAAS,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,UAAU,CAExF;AAED,wBAAgB,GAAG,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,GAAG,UAAU,CAEvE;AAED,iDAAiD;AACjD,wBAAgB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WAAW,CAAC,CAAC;QACvD,IAAI,EAAE,CAAC,SAAS,CAAC;YAAE,OAAO,SAAS,CAAC;IACtC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,OAAe;IACxC,OAAO,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,IAAI,GAAG,CAAC;AACnF,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,OAAe;IACxC,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;IAC5C,OAAO,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC;AACrE,CAAC;AAED,wGAAwG;AACxG,MAAM,UAAU,QAAQ,CAAC,KAAiB;IACxC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAA0B,CAAC;AACxG,CAAC","sourcesContent":["/**\n * The frame's colour arithmetic (#1823). INTERNAL to the package: the root barrel does not export it. It is the\n * model of what the shaders write, and the appearance derivation and its tests share it; it is not an API.\n */\n\n/** A colour as the frame draws it: sRGB-ENCODED channels in 0–1, exactly what lands in the framebuffer. */\nexport type FrameColor = readonly [number, number, number];\n\nexport const BLACK: FrameColor = [0, 0, 0];\nexport const WHITE: FrameColor = [1, 1, 1];\n\n/** The gradient is checked at these points, not only its ends: a lerp's luminance can dip below both ends. */\nconst GRADIENT_SAMPLES = [0, 0.25, 0.5, 0.75, 1];\nconst BOUND_STEPS = 40;\n\n/** WCAG relative luminance of an sRGB-encoded colour. spec-cite: WCAG 2.2 — \"relative luminance\" definition — https://www.w3.org/TR/WCAG22/#dfn-relative-luminance */\nexport function relativeLuminance(color: FrameColor): number {\n const [r, g, b] = color.map(decodeSrgb);\n return 0.2126 * r! + 0.7152 * g! + 0.0722 * b!;\n}\n\n/** WCAG contrast ratio between two sRGB-encoded colours. spec-cite: WCAG 2.2 — \"contrast ratio\" definition — https://www.w3.org/TR/WCAG22/#dfn-contrast-ratio */\nexport function contrastRatio(a: FrameColor, b: FrameColor): number {\n const la = relativeLuminance(a);\n const lb = relativeLuminance(b);\n return (Math.max(la, lb) + 0.05) / (Math.min(la, lb) + 0.05);\n}\n\n/** `top` at `alpha` over an opaque `bottom`, blended in sRGB-encoded space as the framebuffer does. */\nexport function composite(top: FrameColor, alpha: number, bottom: FrameColor): FrameColor {\n return [0, 1, 2].map((i) => top[i]! * alpha + bottom[i]! * (1 - alpha)) as unknown as FrameColor;\n}\n\nexport function mix(a: FrameColor, b: FrameColor, t: number): FrameColor {\n return [0, 1, 2].map((i) => a[i]! + (b[i]! - a[i]!) * t) as unknown as FrameColor;\n}\n\n/** The points of a gradient the bound checks. */\nexport function gradientPoints(from: FrameColor, to: FrameColor): FrameColor[] {\n return GRADIENT_SAMPLES.map((t) => mix(from, to, t));\n}\n\n/** Move `color` toward `pole` in small steps until `ok` holds; the pole itself if nothing short of it does. */\nexport function pushUntil(color: FrameColor, pole: FrameColor, ok: (c: FrameColor) => boolean): FrameColor {\n for (let step = 0; step <= BOUND_STEPS; step += 1) {\n const candidate = mix(color, pole, step / BOUND_STEPS);\n if (ok(candidate)) return candidate;\n }\n return pole;\n}\n\nexport function decodeSrgb(channel: number): number {\n return channel <= 0.04045 ? channel / 12.92 : ((channel + 0.055) / 1.055) ** 2.4;\n}\n\nexport function encodeSrgb(channel: number): number {\n const c = Math.min(1, Math.max(0, channel));\n return c <= 0.0031308 ? c * 12.92 : 1.055 * c ** (1 / 2.4) - 0.055;\n}\n\n/** The colour as the 8-bit framebuffer stores it: each channel rounded to the nearest of 256 levels. */\nexport function quantize(color: FrameColor): FrameColor {\n return color.map((c) => Math.round(Math.min(1, Math.max(0, c)) * 255) / 255) as unknown as FrameColor;\n}\n"]}
1
+ {"version":3,"file":"frame-color.js","sourceRoot":"","sources":["../../../src/frame/frame-color.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,MAAM,CAAC,MAAM,KAAK,GAAe,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAC3C,MAAM,CAAC,MAAM,KAAK,GAAe,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAE3C,8GAA8G;AAC9G,MAAM,gBAAgB,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACjD,MAAM,WAAW,GAAG,EAAE,CAAC;AAEvB,sKAAsK;AACtK,MAAM,UAAU,iBAAiB,CAAC,KAAiB;IACjD,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACxC,OAAO,MAAM,GAAG,CAAE,GAAG,MAAM,GAAG,CAAE,GAAG,MAAM,GAAG,CAAE,CAAC;AACjD,CAAC;AAED,iKAAiK;AACjK,MAAM,UAAU,aAAa,CAAC,CAAa,EAAE,CAAa;IACxD,MAAM,EAAE,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAChC,MAAM,EAAE,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAChC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,IAAI,CA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e;IACxC,OAAO,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,IAAI,GAAG,CAAC;AACnF,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,OAAe;IACxC,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;IAC5C,OAAO,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC;AACrE,CAAC;AAED,wGAAwG;AACxG,MAAM,UAAU,QAAQ,CAAC,KAAiB;IACxC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAA0B,CAAC;AACxG,CAAC","sourcesContent":["/**\n * The frame's colour arithmetic (#1823). INTERNAL to the package: the root barrel does not export it. It is the\n * model of what the shaders write, and the appearance derivation and its tests share it; it is not an API.\n */\n\n/** A colour as the frame draws it: sRGB-ENCODED channels in 0–1, exactly what lands in the framebuffer. */\nexport type FrameColor = readonly [number, number, number];\n\nexport const BLACK: FrameColor = [0, 0, 0];\nexport const WHITE: FrameColor = [1, 1, 1];\n\n/** The gradient is checked at these points, not only its ends: a lerp's luminance can dip below both ends. */\nconst GRADIENT_SAMPLES = [0, 0.25, 0.5, 0.75, 1];\nconst BOUND_STEPS = 40;\n\n/** WCAG relative luminance of an sRGB-encoded colour. spec-cite: WCAG 2.2 — \"relative luminance\" definition — https://www.w3.org/TR/WCAG22/#dfn-relative-luminance */\nexport function relativeLuminance(color: FrameColor): number {\n const [r, g, b] = color.map(decodeSrgb);\n return 0.2126 * r! + 0.7152 * g! + 0.0722 * b!;\n}\n\n/** WCAG contrast ratio between two sRGB-encoded colours. spec-cite: WCAG 2.2 — \"contrast ratio\" definition — https://www.w3.org/TR/WCAG22/#dfn-contrast-ratio */\nexport function contrastRatio(a: FrameColor, b: FrameColor): number {\n const la = relativeLuminance(a);\n const lb = relativeLuminance(b);\n return (Math.max(la, lb) + 0.05) / (Math.min(la, lb) + 0.05);\n}\n\n/** `top` at `alpha` over an opaque `bottom`, blended in sRGB-encoded space as the framebuffer does. */\nexport function composite(top: FrameColor, alpha: number, bottom: FrameColor): FrameColor {\n return [0, 1, 2].map((i) => top[i]! * alpha + bottom[i]! * (1 - alpha)) as unknown as FrameColor;\n}\n\nexport function mix(a: FrameColor, b: FrameColor, t: number): FrameColor {\n return [0, 1, 2].map((i) => a[i]! + (b[i]! - a[i]!) * t) as unknown as FrameColor;\n}\n\n/** The points of a gradient the bound checks. */\nexport function gradientPoints(from: FrameColor, to: FrameColor): FrameColor[] {\n return GRADIENT_SAMPLES.map((t) => mix(from, to, t));\n}\n\n/** Move `color` toward `pole` in small steps until `ok` holds; the pole itself if nothing short of it does. */\nexport function pushUntil(color: FrameColor, pole: FrameColor, ok: (c: FrameColor) => boolean): FrameColor {\n for (let step = 0; step <= BOUND_STEPS; step += 1) {\n const candidate = mix(color, pole, step / BOUND_STEPS);\n if (ok(candidate)) return candidate;\n }\n return pole;\n}\n\nexport function decodeSrgb(channel: number): number {\n return channel <= 0.04045 ? channel / 12.92 : ((channel + 0.055) / 1.055) ** 2.4;\n}\n\nexport function encodeSrgb(channel: number): number {\n const c = Math.min(1, Math.max(0, channel));\n return c <= 0.0031308 ? c * 12.92 : 1.055 * c ** (1 / 2.4) - 0.055;\n}\n\n/** The colour as the 8-bit framebuffer stores it: each channel rounded to the nearest of 256 levels. */\nexport function quantize(color: FrameColor): FrameColor {\n return color.map((c) => Math.round(Math.min(1, Math.max(0, c)) * 255) / 255) as unknown as FrameColor;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"frame-driver.d.ts","sourceRoot":"","sources":["../../../../src/frame/frame-driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAG1D,OAAO,EAAqB,sBAAsB,EAAuB,KAAK,aAAa,EAAE,KAAK,aAAa,EAAqB,MAAM,kBAAkB,CAAC;AAG7J,iHAAiH;AACjH,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,IAAI,CAAC,aAAa,EAAE,eAAe,GAAG,WAAW,GAAG,YAAY,GAAG,UAAU,GAAG,YAAY,GAAG,OAAO,GAAG,kBAAkB,GAAG,MAAM,CAAC,CAAC;IAChJ,sDAAsD;IACtD,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,sEAAsE;IACtE,QAAQ,EAAE,MAAM,aAAa,CAAC;IAC9B,mDAAmD;IACnD,MAAM,EAAE,WAAW,CAAC;IACpB,QAAQ,EAAE,QAAQ,CAAC;IACnB,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,MAAM,CAAC;IAC/C,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,GAAG,EAAE,MAAM,MAAM,CAAC;IAClB,oBAAoB,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC,cAAc,EAAE,SAAS,GAAG,WAAW,GAAG,YAAY,CAAC,CAAC;IAC7G,sBAAsB,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,YAAY,CAAC,CAAC;IACnG,+GAA+G;IAC/G,mBAAmB,EAAE,OAAO,CAAC;IAC7B;;;OAGG;IACH,mBAAmB,CAAC,EAAE,CAAC,OAAO,EAAE,sBAAsB,KAAK,IAAI,CAAC;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,CAAC;IACF,+GAA+G;IAC/G,4DAA4D;IAC5D,MAAM,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC;IACxC,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,gHAAgH;AAChH,MAAM,mBAAmB,GAAG,IAAI,OAAO,EAAkB,CAAC;AAC1D,IAAI,sBAAsB,GAAG,CAAC,CAAC;AAC/B,SAAS,kBAAkB,CAAC,MAA0B;IACpD,IAAI,CAAC,MAAM;QAAE,OAAO,CAAC,CAAC,CAAC;IACvB,IAAI,EAAE,GAAG,mBAAmB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACzC,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;QAAC,EAAE,GAAG,sBAAsB,EAAE,CAAC;QAAC,mBAAmB,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAAC,CAAC;IAC7F,OAAO,EAAE,CAAC;AACZ,CAAC","sourcesContent":["import type { FrameAppearance } from './frame-appearance';\nimport { ShellRegion } from '@wildo-ai/presets-components-models';\n\nimport { FramePulseOutcome, FrameTransitionTrigger, type FrameRegionBox, type FrameRenderer, type FrameViewport, type FrameZoneBox } from './frame-renderer';\nimport { findNavigationZoneElements, findShellRegionElements, measureNavigationZones, measureShellRegions } from '../shell-region-measurement';\n\n/** What the driver needs from its host. Injected, so the scheduling is tested with fake clocks and observers. */\nexport interface FrameDriverHost {\n renderer: Pick<FrameRenderer, 'setAppearance' | 'setLayout' | 'setHovered' | 'setZones' | 'rimmedZone' | 'pulse' | 'hasPendingMotion' | 'tick'>;\n /** Renders the scene as the renderer last left it. */\n renderScene: () => void;\n /** The canvas' size in CSS pixels, as the camera was fitted to it. */\n viewport: () => FrameViewport;\n /** The canvas element, for context-loss events. */\n canvas: EventTarget;\n document: Document;\n requestFrame: (callback: () => void) => number;\n cancelFrame: (handle: number) => void;\n now: () => number;\n createResizeObserver: (callback: () => void) => Pick<ResizeObserver, 'observe' | 'unobserve' | 'disconnect'>;\n createMutationObserver: (callback: () => void) => Pick<MutationObserver, 'observe' | 'disconnect'>;\n /** Whether an appearance change after the first cross-fades (the layout's transitions) or is shown at once. */\n crossFadeAppearance: boolean;\n /**\n * A transition of the frame started (#1826). The canvas counts them on its element, so a live probe can tell that a\n * choreography ran — draws alone cannot, since a hover or a re-layout draws too.\n */\n onTransitionStarted?: (trigger: FrameTransitionTrigger) => void;\n}\n\n/** The canvas-facing surface of a running driver. */\nexport interface FrameDriver {\n /** A new appearance: shown at once the first time, cross-faded afterwards. */\n setAppearance(appearance: FrameAppearance | null): void;\n /** The canvas resized or its pixel ratio changed: the drawing buffer was cleared, so redraw regardless. */\n redraw(): void;\n /**\n * The content's identity: the structural zones' top entries, as the navigation state reports them (#1826). The\n * first value only records; every later CHANGE plays the layout's navigation choreography. An EMPTY signature (no\n * zone holds anything yet: the route sync has not landed) is not a place and is never recorded, so the first\n * landing after the canvas mounted is not played as a navigation.\n */\n setNavigation(signature: string): void;\n /** The navigation state's focused zone (a `data-content-area` value), or null. */\n setFocusedZone(zone: string | null): void;\n dispose(): void;\n}\n\n/**\n * The frame's scheduler (#1823): decides WHEN the renderer draws, and nothing about what it draws.\n *\n * - **At rest**, it draws synchronously inside the callback of whatever changed a region's box (ResizeObserver,\n * a region mounting or leaving), so a slab never lags its region by a frame — and draws NOTHING when every box\n * is where it was.\n * - **While something moves** — a CSS transition in the shell, a cross-fade, a hover emphasis — it runs one loop\n * per animation frame. The loop still renders only when a box moved or the renderer has motion pending. A\n * `transitionstart` anywhere in the document (a button's hover colour) keeps the loop ALIVE, so a moving\n * sidebar is followed frame by frame, but a frame where nothing in the scene changed costs no draw.\n * - **A navigation or a zone focus** (#1826) is an input from the DOM tree (`setNavigation`, `setFocusedZone`); a\n * **sidebar resize** is read off the measurement itself (its width changed while it stayed on screen). Each starts\n * the renderer's choreography and the same loop, which stops the frame the choreography settles. The zone\n * containers are observed like the regions, so a split resized by dragging its divider keeps the rim on the zone.\n * - **After a context loss**, it draws nothing until the context is restored.\n */\nexport function createFrameDriver(host: FrameDriverHost, initialAppearance: FrameAppearance | null): FrameDriver {\n const { renderer, document } = host;\n let contextLost = false;\n let hadAppearance = false;\n let appearance: FrameAppearance | null = null;\n const observed = new Set<HTMLElement>();\n const observedZones = new Set<HTMLElement>();\n const resizeObserver = host.createResizeObserver(() => draw(false));\n let navigationSignature: string | null = null;\n let focusedZone: string | null = null;\n /** The sidebar's width at the last measurement, or null when it was not on screen. */\n let sidebarWidth: number | null = null;\n const started = (trigger: FrameTransitionTrigger): void => host.onTransitionStarted?.(trigger);\n\n const observeOnly = (present: Set<HTMLElement>, into: Set<HTMLElement>): void => {\n for (const element of present) if (!into.has(element)) { resizeObserver.observe(element); into.add(element); }\n for (const element of into) if (!present.has(element)) { resizeObserver.unobserve(element); into.delete(element); }\n };\n\n const measure = (): boolean => {\n // Every marked region and zone is OBSERVED, whatever its box: one collapsed to nothing must redraw the moment it reappears.\n observeOnly(new Set(findShellRegionElements(document)), observed);\n observeOnly(new Set(findNavigationZoneElements(document)), observedZones);\n const boxes: FrameRegionBox[] = measureShellRegions(document).map(({ element, region, left, top, width, height, glass }) => ({ element, region, left, top, width, height, glass }));\n const zones = measureNavigationZones(document);\n const focused = zones.find((zone) => zone.zone === focusedZone)?.element ?? null;\n const zoneBoxes: FrameZoneBox[] = zones.map(({ element, left, top, width, height }) => ({ element, left, top, width, height }));\n const moved = renderer.setLayout(boxes, host.viewport());\n // A sidebar resize: its width changed while it stayed on screen. A sidebar that appears (labels ready, an\n // organization switch) or leaves is not one. Every frame of its animation extends the same pulse.\n const sidebar = boxes.find((box) => box.region === ShellRegion.SIDEBAR);\n const width = sidebar ? sidebar.width : null;\n const resizing = width !== null && sidebarWidth !== null && width !== sidebarWidth;\n sidebarWidth = width;\n // Reported when a pulse STARTS, never per frame: a ResizeObserver measure between two animation frames sees an\n // unchanged width, so any \"was it resizing last time\" flag would re-arm and count every frame of the animation.\n if (resizing && renderer.pulse(FrameTransitionTrigger.SIDEBAR_RESIZE) === FramePulseOutcome.STARTED) started(FrameTransitionTrigger.SIDEBAR_RESIZE);\n const rimmedBefore = renderer.rimmedZone();\n const zonesChanged = renderer.setZones(zoneBoxes, focused);\n const rimmedAfter = renderer.rimmedZone();\n if (rimmedAfter !== null && rimmedAfter !== rimmedBefore) started(FrameTransitionTrigger.ZONE_FOCUS);\n return zonesChanged || moved || resizing;\n };\n\n const renderFrame = (): void => {\n renderer.tick(host.now());\n host.renderScene();\n };\n\n // A running CSS transition, per (property, element); the deadline stops following one whose end never arrives.\n const runningTransitions = new Map<string, number>();\n let loopHandle = 0;\n const kick = (): void => {\n if (!loopHandle) loopHandle = host.requestFrame(loop);\n };\n const loop = (): void => {\n loopHandle = 0;\n if (contextLost) return;\n const now = host.now();\n for (const [key, deadline] of runningTransitions) if (now > deadline) runningTransitions.delete(key);\n const moved = measure();\n if (moved || renderer.hasPendingMotion()) renderFrame();\n if (renderer.hasPendingMotion() || runningTransitions.size > 0) kick();\n };\n\n function draw(force: boolean): void {\n if (contextLost) return;\n const moved = measure();\n if (!moved && !force && !renderer.hasPendingMotion()) return;\n renderFrame();\n if (renderer.hasPendingMotion()) kick();\n }\n\n // Regions render nothing until their labels are ready and remount on an organization switch: re-query, at most\n // once per animation frame, whenever the DOM gains or loses nodes.\n let mutationHandle = 0;\n const mutationObserver = host.createMutationObserver(() => {\n if (mutationHandle) return;\n mutationHandle = host.requestFrame(() => { mutationHandle = 0; draw(false); });\n });\n mutationObserver.observe(document.body, { childList: true, subtree: true });\n\n const transitionKey = (event: Event): string => `${(event as TransitionEvent).propertyName}#${transitionTargetId(event.target)}`;\n const onTransitionStart = (event: Event): void => {\n const ceilingMs = (appearance?.transitionCeilingSeconds ?? 1.5) * 1000;\n runningTransitions.set(transitionKey(event), host.now() + ceilingMs);\n kick();\n };\n const onTransitionEnd = (event: Event): void => {\n runningTransitions.delete(transitionKey(event));\n draw(false);\n };\n document.addEventListener('transitionstart', onTransitionStart, true);\n document.addEventListener('transitionend', onTransitionEnd, true);\n document.addEventListener('transitioncancel', onTransitionEnd, true);\n\n // Hover: read from the document (the canvas takes no pointer events), resolved to the region under the pointer.\n const onPointerOver = (event: Event): void => {\n const target = event.target instanceof Element ? event.target.closest<HTMLElement>('[data-component-area]') : null;\n if (renderer.setHovered(target && observed.has(target) ? target : null)) kick();\n };\n const onPointerOut = (event: Event): void => {\n if ((event as PointerEvent).relatedTarget !== null) return;\n if (renderer.setHovered(null)) kick();\n };\n document.addEventListener('pointerover', onPointerOver, { passive: true });\n document.addEventListener('pointerout', onPointerOut, { passive: true });\n\n const onContextLost = (event: Event): void => { event.preventDefault(); contextLost = true; };\n const onContextRestored = (): void => { contextLost = false; draw(true); };\n host.canvas.addEventListener('webglcontextlost', onContextLost);\n host.canvas.addEventListener('webglcontextrestored', onContextRestored);\n\n const driver: FrameDriver = {\n setAppearance(next) {\n appearance = next ?? appearance;\n renderer.setAppearance(next, { animate: hadAppearance && host.crossFadeAppearance });\n hadAppearance = hadAppearance || next !== null;\n draw(true);\n },\n redraw() {\n draw(true);\n },\n setNavigation(signature) {\n if (signature === '') return;\n const previous = navigationSignature;\n navigationSignature = signature;\n if (previous === null || previous === signature) return;\n const outcome = renderer.pulse(FrameTransitionTrigger.NAVIGATION);\n if (outcome === FramePulseOutcome.STARTED) started(FrameTransitionTrigger.NAVIGATION);\n if (outcome !== FramePulseOutcome.NOT_PLAYED) kick();\n },\n setFocusedZone(zone) {\n if (zone === focusedZone) return;\n focusedZone = zone;\n draw(false);\n },\n dispose() {\n resizeObserver.disconnect();\n mutationObserver.disconnect();\n host.cancelFrame(mutationHandle);\n host.cancelFrame(loopHandle);\n document.removeEventListener('transitionstart', onTransitionStart, true);\n document.removeEventListener('transitionend', onTransitionEnd, true);\n document.removeEventListener('transitioncancel', onTransitionEnd, true);\n document.removeEventListener('pointerover', onPointerOver);\n document.removeEventListener('pointerout', onPointerOut);\n host.canvas.removeEventListener('webglcontextlost', onContextLost);\n host.canvas.removeEventListener('webglcontextrestored', onContextRestored);\n },\n };\n // The current appearance, applied at once: a driver re-created by its host (a new renderer, a new camera) must\n // not wait for the NEXT appearance change to show anything.\n driver.setAppearance(initialAppearance);\n return driver;\n}\n\n/** A stable identity per transitioning element, so two elements animating the same property are two entries. */\nconst transitionTargetIds = new WeakMap<object, number>();\nlet nextTransitionTargetId = 0;\nfunction transitionTargetId(target: EventTarget | null): number {\n if (!target) return -1;\n let id = transitionTargetIds.get(target);\n if (id === undefined) { id = nextTransitionTargetId++; transitionTargetIds.set(target, id); }\n return id;\n}\n"]}
1
+ {"version":3,"file":"frame-driver.js","sourceRoot":"","sources":["../../../src/frame/frame-driver.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAElE,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAkF,MAAM,kBAAkB,CAAC;AAC7J,OAAO,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AA4C/I;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAqB,EAAE,iBAAyC;IAChG,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IACpC,IAAI,WAAW,GAAG,KAAK,CAAC;IACxB,IAAI,aAAa,GAAG,KAAK,CAAC;IAC1B,IAAI,UAAU,GAA2B,IAAI,CAAC;IAC9C,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAe,CAAC;IACxC,MAAM,aAAa,GAAG,IAAI,GAAG,EAAe,CAAC;IAC7C,MAAM,cAAc,GAAG,IAAI,CAAC,oBAAoB,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACpE,IAAI,mBAAmB,GAAkB,IAAI,CAAC;IAC9C,IAAI,WAAW,GAAkB,IAAI,CAAC;IACtC,sFAAsF;IACtF,IAAI,YAAY,GAAkB,IAAI,CAAC;IACvC,MAAM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,CAAC","sourcesContent":["import type { FrameAppearance } from './frame-appearance';\nimport { ShellRegion } from '@wildo-ai/presets-components-models';\n\nimport { FramePulseOutcome, FrameTransitionTrigger, type FrameRegionBox, type FrameRenderer, type FrameViewport, type FrameZoneBox } from './frame-renderer';\nimport { findNavigationZoneElements, findShellRegionElements, measureNavigationZones, measureShellRegions } from '../shell-region-measurement';\n\n/** What the driver needs from its host. Injected, so the scheduling is tested with fake clocks and observers. */\nexport interface FrameDriverHost {\n renderer: Pick<FrameRenderer, 'setAppearance' | 'setLayout' | 'setHovered' | 'setZones' | 'rimmedZone' | 'pulse' | 'hasPendingMotion' | 'tick'>;\n /** Renders the scene as the renderer last left it. */\n renderScene: () => void;\n /** The canvas' size in CSS pixels, as the camera was fitted to it. */\n viewport: () => FrameViewport;\n /** The canvas element, for context-loss events. */\n canvas: EventTarget;\n document: Document;\n requestFrame: (callback: () => void) => number;\n cancelFrame: (handle: number) => void;\n now: () => number;\n createResizeObserver: (callback: () => void) => Pick<ResizeObserver, 'observe' | 'unobserve' | 'disconnect'>;\n createMutationObserver: (callback: () => void) => Pick<MutationObserver, 'observe' | 'disconnect'>;\n /** Whether an appearance change after the first cross-fades (the layout's transitions) or is shown at once. */\n crossFadeAppearance: boolean;\n /**\n * A transition of the frame started (#1826). The canvas counts them on its element, so a live probe can tell that a\n * choreography ran — draws alone cannot, since a hover or a re-layout draws too.\n */\n onTransitionStarted?: (trigger: FrameTransitionTrigger) => void;\n}\n\n/** The canvas-facing surface of a running driver. */\nexport interface FrameDriver {\n /** A new appearance: shown at once the first time, cross-faded afterwards. */\n setAppearance(appearance: FrameAppearance | null): void;\n /** The canvas resized or its pixel ratio changed: the drawing buffer was cleared, so redraw regardless. */\n redraw(): void;\n /**\n * The content's identity: the structural zones' top entries, as the navigation state reports them (#1826). The\n * first value only records; every later CHANGE plays the layout's navigation choreography. An EMPTY signature (no\n * zone holds anything yet: the route sync has not landed) is not a place and is never recorded, so the first\n * landing after the canvas mounted is not played as a navigation.\n */\n setNavigation(signature: string): void;\n /** The navigation state's focused zone (a `data-content-area` value), or null. */\n setFocusedZone(zone: string | null): void;\n dispose(): void;\n}\n\n/**\n * The frame's scheduler (#1823): decides WHEN the renderer draws, and nothing about what it draws.\n *\n * - **At rest**, it draws synchronously inside the callback of whatever changed a region's box (ResizeObserver,\n * a region mounting or leaving), so a slab never lags its region by a frame — and draws NOTHING when every box\n * is where it was.\n * - **While something moves** — a CSS transition in the shell, a cross-fade, a hover emphasis — it runs one loop\n * per animation frame. The loop still renders only when a box moved or the renderer has motion pending. A\n * `transitionstart` anywhere in the document (a button's hover colour) keeps the loop ALIVE, so a moving\n * sidebar is followed frame by frame, but a frame where nothing in the scene changed costs no draw.\n * - **A navigation or a zone focus** (#1826) is an input from the DOM tree (`setNavigation`, `setFocusedZone`); a\n * **sidebar resize** is read off the measurement itself (its width changed while it stayed on screen). Each starts\n * the renderer's choreography and the same loop, which stops the frame the choreography settles. The zone\n * containers are observed like the regions, so a split resized by dragging its divider keeps the rim on the zone.\n * - **After a context loss**, it draws nothing until the context is restored.\n */\nexport function createFrameDriver(host: FrameDriverHost, initialAppearance: FrameAppearance | null): FrameDriver {\n const { renderer, document } = host;\n let contextLost = false;\n let hadAppearance = false;\n let appearance: FrameAppearance | null = null;\n const observed = new Set<HTMLElement>();\n const observedZones = new Set<HTMLElement>();\n const resizeObserver = host.createResizeObserver(() => draw(false));\n let navigationSignature: string | null = null;\n let focusedZone: string | null = null;\n /** The sidebar's width at the last measurement, or null when it was not on screen. */\n let sidebarWidth: number | null = null;\n const started = (trigger: FrameTransitionTrigger): void => host.onTransitionStarted?.(trigger);\n\n const observeOnly = (present: Set<HTMLElement>, into: Set<HTMLElement>): void => {\n for (const element of present) if (!into.has(element)) { resizeObserver.observe(element); into.add(element); }\n for (const element of into) if (!present.has(element)) { resizeObserver.unobserve(element); into.delete(element); }\n };\n\n const measure = (): boolean => {\n // Every marked region and zone is OBSERVED, whatever its box: one collapsed to nothing must redraw the moment it reappears.\n observeOnly(new Set(findShellRegionElements(document)), observed);\n observeOnly(new Set(findNavigationZoneElements(document)), observedZones);\n const boxes: FrameRegionBox[] = measureShellRegions(document).map(({ element, region, left, top, width, height, glass }) => ({ element, region, left, top, width, height, glass }));\n const zones = measureNavigationZones(document);\n const focused = zones.find((zone) => zone.zone === focusedZone)?.element ?? null;\n const zoneBoxes: FrameZoneBox[] = zones.map(({ element, left, top, width, height }) => ({ element, left, top, width, height }));\n const moved = renderer.setLayout(boxes, host.viewport());\n // A sidebar resize: its width changed while it stayed on screen. A sidebar that appears (labels ready, an\n // organization switch) or leaves is not one. Every frame of its animation extends the same pulse.\n const sidebar = boxes.find((box) => box.region === ShellRegion.SIDEBAR);\n const width = sidebar ? sidebar.width : null;\n const resizing = width !== null && sidebarWidth !== null && width !== sidebarWidth;\n sidebarWidth = width;\n // Reported when a pulse STARTS, never per frame: a ResizeObserver measure between two animation frames sees an\n // unchanged width, so any \"was it resizing last time\" flag would re-arm and count every frame of the animation.\n if (resizing && renderer.pulse(FrameTransitionTrigger.SIDEBAR_RESIZE) === FramePulseOutcome.STARTED) started(FrameTransitionTrigger.SIDEBAR_RESIZE);\n const rimmedBefore = renderer.rimmedZone();\n const zonesChanged = renderer.setZones(zoneBoxes, focused);\n const rimmedAfter = renderer.rimmedZone();\n if (rimmedAfter !== null && rimmedAfter !== rimmedBefore) started(FrameTransitionTrigger.ZONE_FOCUS);\n return zonesChanged || moved || resizing;\n };\n\n const renderFrame = (): void => {\n renderer.tick(host.now());\n host.renderScene();\n };\n\n // A running CSS transition, per (property, element); the deadline stops following one whose end never arrives.\n const runningTransitions = new Map<string, number>();\n let loopHandle = 0;\n const kick = (): void => {\n if (!loopHandle) loopHandle = host.requestFrame(loop);\n };\n const loop = (): void => {\n loopHandle = 0;\n if (contextLost) return;\n const now = host.now();\n for (const [key, deadline] of runningTransitions) if (now > deadline) runningTransitions.delete(key);\n const moved = measure();\n if (moved || renderer.hasPendingMotion()) renderFrame();\n if (renderer.hasPendingMotion() || runningTransitions.size > 0) kick();\n };\n\n function draw(force: boolean): void {\n if (contextLost) return;\n const moved = measure();\n if (!moved && !force && !renderer.hasPendingMotion()) return;\n renderFrame();\n if (renderer.hasPendingMotion()) kick();\n }\n\n // Regions render nothing until their labels are ready and remount on an organization switch: re-query, at most\n // once per animation frame, whenever the DOM gains or loses nodes.\n let mutationHandle = 0;\n const mutationObserver = host.createMutationObserver(() => {\n if (mutationHandle) return;\n mutationHandle = host.requestFrame(() => { mutationHandle = 0; draw(false); });\n });\n mutationObserver.observe(document.body, { childList: true, subtree: true });\n\n const transitionKey = (event: Event): string => `${(event as TransitionEvent).propertyName}#${transitionTargetId(event.target)}`;\n const onTransitionStart = (event: Event): void => {\n const ceilingMs = (appearance?.transitionCeilingSeconds ?? 1.5) * 1000;\n runningTransitions.set(transitionKey(event), host.now() + ceilingMs);\n kick();\n };\n const onTransitionEnd = (event: Event): void => {\n runningTransitions.delete(transitionKey(event));\n draw(false);\n };\n document.addEventListener('transitionstart', onTransitionStart, true);\n document.addEventListener('transitionend', onTransitionEnd, true);\n document.addEventListener('transitioncancel', onTransitionEnd, true);\n\n // Hover: read from the document (the canvas takes no pointer events), resolved to the region under the pointer.\n const onPointerOver = (event: Event): void => {\n const target = event.target instanceof Element ? event.target.closest<HTMLElement>('[data-component-area]') : null;\n if (renderer.setHovered(target && observed.has(target) ? target : null)) kick();\n };\n const onPointerOut = (event: Event): void => {\n if ((event as PointerEvent).relatedTarget !== null) return;\n if (renderer.setHovered(null)) kick();\n };\n document.addEventListener('pointerover', onPointerOver, { passive: true });\n document.addEventListener('pointerout', onPointerOut, { passive: true });\n\n const onContextLost = (event: Event): void => { event.preventDefault(); contextLost = true; };\n const onContextRestored = (): void => { contextLost = false; draw(true); };\n host.canvas.addEventListener('webglcontextlost', onContextLost);\n host.canvas.addEventListener('webglcontextrestored', onContextRestored);\n\n const driver: FrameDriver = {\n setAppearance(next) {\n appearance = next ?? appearance;\n renderer.setAppearance(next, { animate: hadAppearance && host.crossFadeAppearance });\n hadAppearance = hadAppearance || next !== null;\n draw(true);\n },\n redraw() {\n draw(true);\n },\n setNavigation(signature) {\n if (signature === '') return;\n const previous = navigationSignature;\n navigationSignature = signature;\n if (previous === null || previous === signature) return;\n const outcome = renderer.pulse(FrameTransitionTrigger.NAVIGATION);\n if (outcome === FramePulseOutcome.STARTED) started(FrameTransitionTrigger.NAVIGATION);\n if (outcome !== FramePulseOutcome.NOT_PLAYED) kick();\n },\n setFocusedZone(zone) {\n if (zone === focusedZone) return;\n focusedZone = zone;\n draw(false);\n },\n dispose() {\n resizeObserver.disconnect();\n mutationObserver.disconnect();\n host.cancelFrame(mutationHandle);\n host.cancelFrame(loopHandle);\n document.removeEventListener('transitionstart', onTransitionStart, true);\n document.removeEventListener('transitionend', onTransitionEnd, true);\n document.removeEventListener('transitioncancel', onTransitionEnd, true);\n document.removeEventListener('pointerover', onPointerOver);\n document.removeEventListener('pointerout', onPointerOut);\n host.canvas.removeEventListener('webglcontextlost', onContextLost);\n host.canvas.removeEventListener('webglcontextrestored', onContextRestored);\n },\n };\n // The current appearance, applied at once: a driver re-created by its host (a new renderer, a new camera) must\n // not wait for the NEXT appearance change to show anything.\n driver.setAppearance(initialAppearance);\n return driver;\n}\n\n/** A stable identity per transitioning element, so two elements animating the same property are two entries. */\nconst transitionTargetIds = new WeakMap<object, number>();\nlet nextTransitionTargetId = 0;\nfunction transitionTargetId(target: EventTarget | null): number {\n if (!target) return -1;\n let id = transitionTargetIds.get(target);\n if (id === undefined) { id = nextTransitionTargetId++; transitionTargetIds.set(target, id); }\n return id;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"frame-renderer.d.ts","sourceRoot":"","sources":["../../../../src/frame/frame-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,EAAsE,MAAM,OAAO,CAAC;AAClH,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAGlE,OAAO,KAAK,EAAE,eAAe,EAAE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