@spatial-elements/core 1.0.0-beta.5 → 1.0.0-beta.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 (96) hide show
  1. package/dist/catalog/CarouselDeviceCamera.d.ts +12 -0
  2. package/dist/catalog/CarouselDeviceCamera.d.ts.map +1 -0
  3. package/dist/catalog/CarouselDeviceCamera.js +44 -0
  4. package/dist/catalog/CarouselDeviceCamera.js.map +1 -0
  5. package/dist/catalog/CarouselGlassCompositor.d.ts +7 -2
  6. package/dist/catalog/CarouselGlassCompositor.d.ts.map +1 -1
  7. package/dist/catalog/CarouselGlassCompositor.js +85 -24
  8. package/dist/catalog/CarouselGlassCompositor.js.map +1 -1
  9. package/dist/catalog/CarouselGround.d.ts +21 -0
  10. package/dist/catalog/CarouselGround.d.ts.map +1 -0
  11. package/dist/catalog/CarouselGround.js +107 -0
  12. package/dist/catalog/CarouselGround.js.map +1 -0
  13. package/dist/catalog/CatalogDepthBlur.d.ts +26 -0
  14. package/dist/catalog/CatalogDepthBlur.d.ts.map +1 -0
  15. package/dist/catalog/CatalogDepthBlur.js +87 -0
  16. package/dist/catalog/CatalogDepthBlur.js.map +1 -0
  17. package/dist/catalog/CatalogModelOutline.d.ts +31 -0
  18. package/dist/catalog/CatalogModelOutline.d.ts.map +1 -0
  19. package/dist/catalog/CatalogModelOutline.js +127 -0
  20. package/dist/catalog/CatalogModelOutline.js.map +1 -0
  21. package/dist/catalog/CatalogSpatialElementLayer.d.ts +44 -2
  22. package/dist/catalog/CatalogSpatialElementLayer.d.ts.map +1 -1
  23. package/dist/catalog/CatalogSpatialElementLayer.js +293 -88
  24. package/dist/catalog/CatalogSpatialElementLayer.js.map +1 -1
  25. package/dist/catalog/CatalogTransition.d.ts.map +1 -1
  26. package/dist/catalog/CatalogTransition.js +62 -4
  27. package/dist/catalog/CatalogTransition.js.map +1 -1
  28. package/dist/catalog/SpatialGeometryCapture.d.ts +9 -0
  29. package/dist/catalog/SpatialGeometryCapture.d.ts.map +1 -1
  30. package/dist/catalog/SpatialGeometryCapture.js +11 -1
  31. package/dist/catalog/SpatialGeometryCapture.js.map +1 -1
  32. package/dist/catalog/cardModelFit.d.ts +7 -0
  33. package/dist/catalog/cardModelFit.d.ts.map +1 -0
  34. package/dist/catalog/cardModelFit.js +16 -0
  35. package/dist/catalog/cardModelFit.js.map +1 -0
  36. package/dist/catalog/cardProjection.d.ts +8 -0
  37. package/dist/catalog/cardProjection.d.ts.map +1 -0
  38. package/dist/catalog/cardProjection.js +51 -0
  39. package/dist/catalog/cardProjection.js.map +1 -0
  40. package/dist/catalog/carouselMotion.d.ts +35 -0
  41. package/dist/catalog/carouselMotion.d.ts.map +1 -1
  42. package/dist/catalog/carouselMotion.js +85 -4
  43. package/dist/catalog/carouselMotion.js.map +1 -1
  44. package/dist/catalog/carouselProximity.d.ts +11 -0
  45. package/dist/catalog/carouselProximity.d.ts.map +1 -0
  46. package/dist/catalog/carouselProximity.js +13 -0
  47. package/dist/catalog/carouselProximity.js.map +1 -0
  48. package/dist/catalog/carouselSupport.d.ts +4 -0
  49. package/dist/catalog/carouselSupport.d.ts.map +1 -0
  50. package/dist/catalog/carouselSupport.js +30 -0
  51. package/dist/catalog/carouselSupport.js.map +1 -0
  52. package/dist/catalog/catalogPose.d.ts +36 -6
  53. package/dist/catalog/catalogPose.d.ts.map +1 -1
  54. package/dist/catalog/catalogPose.js +79 -23
  55. package/dist/catalog/catalogPose.js.map +1 -1
  56. package/dist/catalog/deviceYaw.d.ts +21 -0
  57. package/dist/catalog/deviceYaw.d.ts.map +1 -0
  58. package/dist/catalog/deviceYaw.js +87 -0
  59. package/dist/catalog/deviceYaw.js.map +1 -0
  60. package/dist/catalog/listDeviceOrientation.d.ts +15 -0
  61. package/dist/catalog/listDeviceOrientation.d.ts.map +1 -0
  62. package/dist/catalog/listDeviceOrientation.js +245 -0
  63. package/dist/catalog/listDeviceOrientation.js.map +1 -0
  64. package/dist/stage/DeviceGeometryMotion.d.ts +13 -0
  65. package/dist/stage/DeviceGeometryMotion.d.ts.map +1 -0
  66. package/dist/stage/DeviceGeometryMotion.js +37 -0
  67. package/dist/stage/DeviceGeometryMotion.js.map +1 -0
  68. package/dist/stage/LiquidGlassPanel.d.ts +2 -0
  69. package/dist/stage/LiquidGlassPanel.d.ts.map +1 -1
  70. package/dist/stage/LiquidGlassPanel.js +8 -1
  71. package/dist/stage/LiquidGlassPanel.js.map +1 -1
  72. package/dist/stage/MinimapController.d.ts +1 -0
  73. package/dist/stage/MinimapController.d.ts.map +1 -1
  74. package/dist/stage/MinimapController.js +7 -0
  75. package/dist/stage/MinimapController.js.map +1 -1
  76. package/dist/stage/PanelPresentationController.d.ts.map +1 -1
  77. package/dist/stage/PanelPresentationController.js +19 -7
  78. package/dist/stage/PanelPresentationController.js.map +1 -1
  79. package/dist/stage/StageExperience.d.ts +56 -0
  80. package/dist/stage/StageExperience.d.ts.map +1 -1
  81. package/dist/stage/StageExperience.js +53 -17
  82. package/dist/stage/StageExperience.js.map +1 -1
  83. package/dist/stage/StageRenderPipeline.d.ts.map +1 -1
  84. package/dist/stage/StageRenderPipeline.js +14 -63
  85. package/dist/stage/StageRenderPipeline.js.map +1 -1
  86. package/dist/stage/interactionOutline.d.ts +14 -0
  87. package/dist/stage/interactionOutline.d.ts.map +1 -0
  88. package/dist/stage/interactionOutline.js +81 -0
  89. package/dist/stage/interactionOutline.js.map +1 -0
  90. package/dist/stage/panelContext.d.ts +2 -0
  91. package/dist/stage/panelContext.d.ts.map +1 -1
  92. package/dist/stage/panelContext.js.map +1 -1
  93. package/dist/stage/stageTypes.d.ts +1 -0
  94. package/dist/stage/stageTypes.d.ts.map +1 -1
  95. package/dist/stage/stageTypes.js.map +1 -1
  96. package/package.json +1 -1
@@ -0,0 +1,81 @@
1
+ import * as THREE from 'three/webgpu';
2
+ import { Fn, float, If, max as tslMax, min as tslMin, uniform, uv, vec2 } from 'three/tsl';
3
+ import { getMeshMaterials } from './stageSceneUtils.js';
4
+ export function isOutlineMesh(mesh, theme) {
5
+ if (theme.excludeMesh?.(mesh) || mesh.userData.stagePick === false || mesh.userData.stageOutline === false)
6
+ return false;
7
+ const materials = getMeshMaterials(mesh).map(material => material.name).filter(Boolean).join(' ');
8
+ return !/(shadow|ground|floor|plane|helper|collision|collider|reflection)/i.test(`${mesh.name} ${materials}`);
9
+ }
10
+ export function createOutlineUniforms() {
11
+ return {
12
+ color: uniform(new THREE.Color()),
13
+ strength: uniform(0), glow: uniform(0), opacityScale: uniform(1),
14
+ texel: uniform(new THREE.Vector2()), glowTexel: uniform(new THREE.Vector2())
15
+ };
16
+ }
17
+ /** Shared silhouette and outer halo for detail and catalog geometry. */
18
+ export function createOutlineOpacity(mask, controls, unconditional = false) {
19
+ const calculate = () => {
20
+ const texel = controls.texel;
21
+ const glowTexel = controls.glowTexel;
22
+ const sampleMaskRing = (sampleTexel, scale = 1) => {
23
+ const centerUv = uv();
24
+ const sampleX = sampleTexel.x.mul(scale);
25
+ const sampleY = sampleTexel.y.mul(scale);
26
+ const left = mask.sample(centerUv.sub(vec2(sampleX, 0))).r;
27
+ const right = mask.sample(centerUv.add(vec2(sampleX, 0))).r;
28
+ const up = mask.sample(centerUv.add(vec2(0, sampleY))).r;
29
+ const down = mask.sample(centerUv.sub(vec2(0, sampleY))).r;
30
+ const upLeft = mask.sample(centerUv.add(vec2(0, sampleY)).sub(vec2(sampleX, 0))).r;
31
+ const upRight = mask.sample(centerUv.add(vec2(sampleX, sampleY))).r;
32
+ const downLeft = mask.sample(centerUv.sub(vec2(sampleX, sampleY))).r;
33
+ const downRight = mask.sample(centerUv.add(vec2(sampleX, 0)).sub(vec2(0, sampleY))).r;
34
+ return {
35
+ average: left
36
+ .add(right)
37
+ .add(up)
38
+ .add(down)
39
+ .add(upLeft)
40
+ .add(upRight)
41
+ .add(downLeft)
42
+ .add(downRight)
43
+ .div(8),
44
+ max: tslMax(tslMax(tslMax(left, right), tslMax(up, down)), tslMax(tslMax(upLeft, upRight), tslMax(downLeft, downRight))),
45
+ min: tslMin(tslMin(tslMin(left, right), tslMin(up, down)), tslMin(tslMin(upLeft, upRight), tslMin(downLeft, downRight)))
46
+ };
47
+ };
48
+ const edgeNeighbor = sampleMaskRing(texel);
49
+ const glowNearNeighbor = sampleMaskRing(glowTexel, 0.45);
50
+ const glowMidNeighbor = sampleMaskRing(glowTexel, 0.7);
51
+ const glowFarNeighbor = sampleMaskRing(glowTexel);
52
+ const center = mask.sample(uv()).r;
53
+ const outside = center.oneMinus();
54
+ const edgeGradient = edgeNeighbor.max.sub(center).max(0);
55
+ const core = edgeGradient.mul(controls.strength);
56
+ // Average neighbouring coverage, rather than dilating a solid band. Keep the
57
+ // halo outside the spatialElement so it cannot be mistaken for painted geometry.
58
+ const glowNear = glowNearNeighbor.average
59
+ .mul(outside)
60
+ .mul(controls.glow.mul(0.6));
61
+ const glowMid = glowMidNeighbor.average
62
+ .mul(outside)
63
+ .mul(controls.glow.mul(0.3));
64
+ const glowFar = glowFarNeighbor.average
65
+ .mul(outside)
66
+ .mul(controls.glow.mul(0.1));
67
+ const opacity = tslMin(core.add(glowNear).add(glowMid).add(glowFar), 1).mul(controls.opacityScale);
68
+ return opacity;
69
+ };
70
+ if (unconditional)
71
+ return calculate();
72
+ return Fn(() => {
73
+ const opacity = float(0).toVar();
74
+ // A fully covered pixel has zero outer halo. Skip all 32 neighbour taps there.
75
+ If(mask.sample(uv()).r.lessThan(1), () => {
76
+ opacity.assign(calculate());
77
+ });
78
+ return opacity;
79
+ })();
80
+ }
81
+ //# sourceMappingURL=interactionOutline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interactionOutline.js","sourceRoot":"","sources":["../../src/stage/interactionOutline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,IAAI,MAAM,EAAE,GAAG,IAAI,MAAM,EAAE,OAA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AAE;QACd,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;QACjC,+EAA+E;QAC/E,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE;YACxC,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC;IAChB,CAAC,CAAC,EAAE,CAAC;AACN,CAAC","sourcesContent":["import * as THREE from 'three/webgpu';\nimport { Fn, float, If, max as tslMax, min as tslMin, uniform, uv, vec2 } from 'three/tsl';\nimport { getMeshMaterials } from './stageSceneUtils.js';\nimport type { StageInteractionTheme } from './stageTypes.js';\n\nexport function isOutlineMesh(mesh: THREE.Mesh, theme: StageInteractionTheme) {\n\tif (theme.excludeMesh?.(mesh) || mesh.userData.stagePick === false || mesh.userData.stageOutline === false) return false;\n\tconst materials = getMeshMaterials(mesh).map(material => material.name).filter(Boolean).join(' ');\n\treturn !/(shadow|ground|floor|plane|helper|collision|collider|reflection)/i.test(`${mesh.name} ${materials}`);\n}\n\nexport function createOutlineUniforms() {\n\treturn {\n\t\tcolor: uniform(new THREE.Color()),\n\t\tstrength: uniform(0), glow: uniform(0), opacityScale: uniform(1),\n\t\ttexel: uniform(new THREE.Vector2()), glowTexel: uniform(new THREE.Vector2())\n\t};\n}\n\n/** Shared silhouette and outer halo for detail and catalog geometry. */\nexport function createOutlineOpacity(mask: THREE.TextureNode, controls: ReturnType<typeof createOutlineUniforms>, unconditional = false) {\n\tconst calculate = () => {\n\t\tconst texel = controls.texel;\n\t\tconst glowTexel = controls.glowTexel;\n\t\tconst sampleMaskRing = (sampleTexel: typeof texel, scale = 1) => {\n\t\t\tconst centerUv = uv();\n\t\t\tconst sampleX = sampleTexel.x.mul(scale);\n\t\t\tconst sampleY = sampleTexel.y.mul(scale);\n\t\t\tconst left = mask.sample(centerUv.sub(vec2(sampleX, 0))).r;\n\t\t\tconst right = mask.sample(centerUv.add(vec2(sampleX, 0))).r;\n\t\t\tconst up = mask.sample(centerUv.add(vec2(0, sampleY))).r;\n\t\t\tconst down = mask.sample(centerUv.sub(vec2(0, sampleY))).r;\n\t\t\tconst upLeft = mask.sample(centerUv.add(vec2(0, sampleY)).sub(vec2(sampleX, 0))).r;\n\t\t\tconst upRight = mask.sample(centerUv.add(vec2(sampleX, sampleY))).r;\n\t\t\tconst downLeft = mask.sample(centerUv.sub(vec2(sampleX, sampleY))).r;\n\t\t\tconst downRight = mask.sample(centerUv.add(vec2(sampleX, 0)).sub(vec2(0, sampleY))).r;\n\n\t\t\treturn {\n\t\t\t\taverage: left\n\t\t\t\t\t.add(right)\n\t\t\t\t\t.add(up)\n\t\t\t\t\t.add(down)\n\t\t\t\t\t.add(upLeft)\n\t\t\t\t\t.add(upRight)\n\t\t\t\t\t.add(downLeft)\n\t\t\t\t\t.add(downRight)\n\t\t\t\t\t.div(8),\n\t\t\t\tmax: tslMax(\n\t\t\t\t\ttslMax(tslMax(left, right), tslMax(up, down)),\n\t\t\t\t\ttslMax(tslMax(upLeft, upRight), tslMax(downLeft, downRight))\n\t\t\t\t),\n\t\t\t\tmin: tslMin(\n\t\t\t\t\ttslMin(tslMin(left, right), tslMin(up, down)),\n\t\t\t\t\ttslMin(tslMin(upLeft, upRight), tslMin(downLeft, downRight))\n\t\t\t\t)\n\t\t\t};\n\t\t};\n\t\tconst edgeNeighbor = sampleMaskRing(texel);\n\t\tconst glowNearNeighbor = sampleMaskRing(glowTexel, 0.45);\n\t\tconst glowMidNeighbor = sampleMaskRing(glowTexel, 0.7);\n\t\tconst glowFarNeighbor = sampleMaskRing(glowTexel);\n\t\tconst center = mask.sample(uv()).r;\n\t\tconst outside = center.oneMinus();\n\t\tconst edgeGradient = edgeNeighbor.max.sub(center).max(0);\n\t\tconst core = edgeGradient.mul(controls.strength);\n\t\t// Average neighbouring coverage, rather than dilating a solid band. Keep the\n\t\t// halo outside the spatialElement so it cannot be mistaken for painted geometry.\n\t\tconst glowNear = glowNearNeighbor.average\n\t\t\t.mul(outside)\n\t\t\t.mul(controls.glow.mul(0.6));\n\t\tconst glowMid = glowMidNeighbor.average\n\t\t\t.mul(outside)\n\t\t\t.mul(controls.glow.mul(0.3));\n\t\tconst glowFar = glowFarNeighbor.average\n\t\t\t.mul(outside)\n\t\t\t.mul(controls.glow.mul(0.1));\n\t\tconst opacity = tslMin(core.add(glowNear).add(glowMid).add(glowFar), 1).mul(\n\t\t\tcontrols.opacityScale\n\t\t);\n\n\t\treturn opacity;\n\t};\n\tif (unconditional) return calculate();\n\treturn Fn(() => {\n\t\tconst opacity = float(0).toVar();\n\t\t// A fully covered pixel has zero outer halo. Skip all 32 neighbour taps there.\n\t\tIf(mask.sample(uv()).r.lessThan(1), () => {\n\t\t\topacity.assign(calculate());\n\t\t});\n\t\treturn opacity;\n\t})();\n}\n"]}
@@ -69,6 +69,8 @@ export interface StageViewportRegistration {
69
69
  getElement(): HTMLElement | undefined;
70
70
  }
71
71
  export interface StageContext {
72
+ /** Reactive in framework adapters; false during SSR and until the GPU has painted. */
73
+ isEnhanced?(): boolean;
72
74
  prefetchSpatialElement?(stage: import('../spatial-element/spatialElementScene.js').SpatialElementScene): void;
73
75
  registerPanel(panel: StagePanelRegistration): () => void;
74
76
  /** Refresh appearance from registered getters without rebinding the page or its camera. */
@@ -1 +1 @@
1
- {"version":3,"file":"panelContext.d.ts","sourceRoot":"","sources":["../../src/stage/panelContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,KAAK,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEjF,eAAO,MAAM,iBAAiB,eAAkB,CAAC;AAEjD,uFAAuF;AACvF,eAAO,MAAM,wBAAwB,uBAAuB,CAAC;AAE7D,+FAA+F;AAC/F,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AsB,GAAG,MAAM,IAAI,CAAC;IACzD,2FAA2F;IAC3F,qBAAqB,CAAC,IAAI,IAAI,CAAC;IAC/B,gBAAgB,CAAC,QAAQ,EAAE,yBAAyB,GAAG,MAAM,IAAI,CAAC;IAClE,8DAA8D;IAC9D,SAAS,IAAI,IAAI,CAAC;IAClB,iEAAiE;IACjE,YAAY,CAAC,IAAI,OAAO,CAAC;IACzB,kFAAkF;IAClF,YAAY,CAAC,IAAI,MAAM,CAAC;IACxB,aAAa,CAAC,CAAC,UAAU,EAAE,OAAO,GAAG,IAAI,CAAC;CAC1C"}
@@ -1 +1 @@
1
- {"version":3,"file":"panelContext.js","sourceRoot":"","sources":["../../src/stage/panelContext.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;AAEjD,uFAAuF;AACvF,MAAM,CAAC,MAAM,wBAAwB,GAAG,oBAAoB,CAAC;AAE7D,+FAA+F;AAC/F,MAAM,CAAC,MAAM,wBAAwB,GAAG,oBAAoB,CAAC","sourcesContent":["\nimport type { LiquidGlassPanelOptions } from './LiquidGlassPanel.js';\nimport type { StageMinimapDockedView, StagePanelSurface } from './stageTypes.js';\n\nexport const STAGE_CONTEXT_KEY = Symbol('stage');\n\n/** Notifies an active stage that externally positioned panel frames changed layout. */\nexport const STAGE_PANEL_LAYOUT_EVENT = 'stage:panel-layout';\n\n/** Notifies an active stage that an external panel visual changed without affecting layout. */\nexport const STAGE_PANEL_VISUAL_EVENT = 'stage:panel-visual';\n\nexport interface StagePanelPose {\n\twidth: number;\n\theight: number;\n\tposition: { x: number; y: number };\n}\n\nexport interface StagePanelShape {\n\tradius: number;\n\tcontentInset?: number;\n}\n\nexport type StagePanelTheme = Omit<\n\tLiquidGlassPanelOptions,\n\t'width' | 'height' | 'position' | 'radius'\n> & {\n\t/** Semantic surface style. Defaults to the WebGPU-backed `glass` mode. */\n\tsurface?: StagePanelSurface;\n};\n\n\n\nexport interface StagePanelMinimapOptions {\n\texpandedHeight?: number;\n\tinset?: number;\n\t/** Additional unbounded scale applied to the fitted model. Values below 0.2 are clamped. */\n\tmodelScale?: number;\n\t/** Model multiplier at full pointer hover. Use 1 to disable hover enlargement. */\n\thoverModelScale?: number;\n\t/** Hover multiplier used once the minimap is expanded by camera zoom. */\n\texpandedHoverModelScale?: number;\n\t/** Optional spatial-element-specific presentation used while the minimap is docked. */\n\tdockedView?: StageMinimapDockedView;\n\toverlayColor?: string | number;\n\toverlayOpacity?: number;\n\t/** Gaussian blur radius in CSS pixels. */\n\toverlayBlur?: number;\n\tcontextColor?: string | number;\n\tcontextOpacity?: number;\n\tviewportColor?: string | number;\n}\n\nexport interface StagePanelRegistration {\n\tgetContentInset(): number;\n\tgetElement(): HTMLElement | undefined;\n\tgetFrameElement(): HTMLElement | undefined;\n\tgetSurfaceElement(): HTMLElement | undefined;\n\tgetPointerReactive(): boolean | 'lift';\n\tgetFocusReactive?(): boolean | 'top-right';\n\t/** Neighbouring panel frame that shares a corner control's exit path. */\n\tgetFocusAnchor?(): HTMLElement | undefined;\n\tgetNativeContent?(): boolean;\n\t/** Runs synchronously before the native panel surface is measured and drawn. */\n\tupdateNativeLayout?(): void;\n\tgetVisible?(): boolean;\n\tgetMinimapOptions(): StagePanelMinimapOptions | undefined;\n\tgetOptions(): LiquidGlassPanelOptions;\n\tgetSurface(): StagePanelSurface;\n\t/** Returns the opacity of the panel surface without affecting panel content. */\n\tgetSurfaceOpacity(): number;\n\t/** Returns a transient presentation scale applied to a rendered minimap model. */\n\tgetMinimapModelScale(): number;\n\t/** Returns the animated transition from the regular to the docked minimap view. */\n\tgetMinimapDockProgress(): number;\n\t/** Returns the viewport-space top edge used to anchor the rendered model. */\n\tgetMinimapModelTop(): number | undefined;\n}\n\nexport interface StageViewportRegistration {\n\tgetElement(): HTMLElement | undefined;\n}\n\nexport interface StageContext {\n\tprefetchSpatialElement?(stage: import('../spatial-element/spatialElementScene.js').SpatialElementScene): void;\n\tregisterPanel(panel: StagePanelRegistration): () => void;\n\t/** Refresh appearance from registered getters without rebinding the page or its camera. */\n\tupdatePanelAppearance?(): void;\n\tregisterViewport(viewport: StageViewportRegistration): () => void;\n\t/** Restores the element camera to its initial fitted pose. */\n\tresetView(): void;\n\t/** True for both native fullscreen and its viewport fallback. */\n\tisFullscreen?(): boolean;\n\t/** Current camera zoom focus, from the fitted detail view (0) to close-up (1). */\n\tgetZoomFocus?(): number;\n\tsetFullscreen?(fullscreen: boolean): void;\n}\n"]}
1
+ {"version":3,"file":"panelContext.js","sourceRoot":"","sources":["../../src/stage/panelContext.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;AAEjD,uFAAuF;AACvF,MAAM,CAAC,MAAM,wBAAwB,GAAG,oBAAoB,CAAC;AAE7D,+FAA+F;AAC/F,MAAM,CAAC,MAAM,wBAAwB,GAAG,oBAAoB,CAAC","sourcesContent":["\nimport type { LiquidGlassPanelOptions } from './LiquidGlassPanel.js';\nimport type { StageMinimapDockedView, StagePanelSurface } from './stageTypes.js';\n\nexport const STAGE_CONTEXT_KEY = Symbol('stage');\n\n/** Notifies an active stage that externally positioned panel frames changed layout. */\nexport const STAGE_PANEL_LAYOUT_EVENT = 'stage:panel-layout';\n\n/** Notifies an active stage that an external panel visual changed without affecting layout. */\nexport const STAGE_PANEL_VISUAL_EVENT = 'stage:panel-visual';\n\nexport interface StagePanelPose {\n\twidth: number;\n\theight: number;\n\tposition: { x: number; y: number };\n}\n\nexport interface StagePanelShape {\n\tradius: number;\n\tcontentInset?: number;\n}\n\nexport type StagePanelTheme = Omit<\n\tLiquidGlassPanelOptions,\n\t'width' | 'height' | 'position' | 'radius'\n> & {\n\t/** Semantic surface style. Defaults to the WebGPU-backed `glass` mode. */\n\tsurface?: StagePanelSurface;\n};\n\n\n\nexport interface StagePanelMinimapOptions {\n\texpandedHeight?: number;\n\tinset?: number;\n\t/** Additional unbounded scale applied to the fitted model. Values below 0.2 are clamped. */\n\tmodelScale?: number;\n\t/** Model multiplier at full pointer hover. Use 1 to disable hover enlargement. */\n\thoverModelScale?: number;\n\t/** Hover multiplier used once the minimap is expanded by camera zoom. */\n\texpandedHoverModelScale?: number;\n\t/** Optional spatial-element-specific presentation used while the minimap is docked. */\n\tdockedView?: StageMinimapDockedView;\n\toverlayColor?: string | number;\n\toverlayOpacity?: number;\n\t/** Gaussian blur radius in CSS pixels. */\n\toverlayBlur?: number;\n\tcontextColor?: string | number;\n\tcontextOpacity?: number;\n\tviewportColor?: string | number;\n}\n\nexport interface StagePanelRegistration {\n\tgetContentInset(): number;\n\tgetElement(): HTMLElement | undefined;\n\tgetFrameElement(): HTMLElement | undefined;\n\tgetSurfaceElement(): HTMLElement | undefined;\n\tgetPointerReactive(): boolean | 'lift';\n\tgetFocusReactive?(): boolean | 'top-right';\n\t/** Neighbouring panel frame that shares a corner control's exit path. */\n\tgetFocusAnchor?(): HTMLElement | undefined;\n\tgetNativeContent?(): boolean;\n\t/** Runs synchronously before the native panel surface is measured and drawn. */\n\tupdateNativeLayout?(): void;\n\tgetVisible?(): boolean;\n\tgetMinimapOptions(): StagePanelMinimapOptions | undefined;\n\tgetOptions(): LiquidGlassPanelOptions;\n\tgetSurface(): StagePanelSurface;\n\t/** Returns the opacity of the panel surface without affecting panel content. */\n\tgetSurfaceOpacity(): number;\n\t/** Returns a transient presentation scale applied to a rendered minimap model. */\n\tgetMinimapModelScale(): number;\n\t/** Returns the animated transition from the regular to the docked minimap view. */\n\tgetMinimapDockProgress(): number;\n\t/** Returns the viewport-space top edge used to anchor the rendered model. */\n\tgetMinimapModelTop(): number | undefined;\n}\n\nexport interface StageViewportRegistration {\n\tgetElement(): HTMLElement | undefined;\n}\n\nexport interface StageContext {\n\t/** Reactive in framework adapters; false during SSR and until the GPU has painted. */\n\tisEnhanced?(): boolean;\n\tprefetchSpatialElement?(stage: import('../spatial-element/spatialElementScene.js').SpatialElementScene): void;\n\tregisterPanel(panel: StagePanelRegistration): () => void;\n\t/** Refresh appearance from registered getters without rebinding the page or its camera. */\n\tupdatePanelAppearance?(): void;\n\tregisterViewport(viewport: StageViewportRegistration): () => void;\n\t/** Restores the element camera to its initial fitted pose. */\n\tresetView(): void;\n\t/** True for both native fullscreen and its viewport fallback. */\n\tisFullscreen?(): boolean;\n\t/** Current camera zoom focus, from the fitted detail view (0) to close-up (1). */\n\tgetZoomFocus?(): number;\n\tsetFullscreen?(fullscreen: boolean): void;\n}\n"]}
@@ -168,6 +168,7 @@ export interface StageRenderSettings {
168
168
  }
169
169
  /** Construction options for a {@link StageExperience}. */
170
170
  export interface StageExperienceOptions {
171
+ deviceOrientation?: boolean;
171
172
  /** Stage-wide output quality; native DOM content remains at the device pixel ratio. */
172
173
  renderSettings?: StageRenderSettings;
173
174
  /** Directory containing Draco decoder files, including trailing slash. */
@@ -1 +1 @@
1
- {"version":3,"file":"stageTypes.d.ts","sourceRoot":"","sources":["../../src/stage/stageTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,KAAK,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAErE,8EAA8E;AAC9E,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;AAE9D,sEAAsE;AACtE,MAAM,WAAW,kBAAkB;IAClC,qFAAqF;IACrF,UAAU,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,IAAI,EAAE,mBAAmB,CAAC;IAC1B,4EAA4E;IAC5E,aAAa,EAAE,MAAM,CAAC;CACtB;AAED,iFAAiF;AACjF,MAAM,WAAW,kBAAkB;IAClC,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM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,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,gBAAgB,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAClD,MAAM,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC5B,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAC/B,wEAAwE;IACxE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oEAAoE;IACpE,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;CACzD;AAED,kEAAkE;AAClE,MAAM,WAAW,qBAAqB;IACrC,YAAY,EAAE,mBAAmB,CAAC;IAClC,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,uFAAuF;IACvF,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC;CACtC"}
@@ -1 +1 @@
1
- {"version":3,"file":"stageTypes.js","sourceRoot":"","sources":["../../src/stage/stageTypes.ts"],"names":[],"mappings":"","sourcesContent":["import type { SpatialElementLodPair } from '../catalog/spatialElementLodPair.js';\nimport type { ColorRepresentation, Mesh } from 'three';\nimport type { LiquidGlassPanelOptions } from './LiquidGlassPanel.js';\n\n/** Selects the rendering backend and visual complexity of a panel surface. */\nexport type StagePanelSurface = 'solid' | 'frosted' | 'glass';\n\n/** Controls how the HDR environment is presented behind the stage. */\nexport interface BackgroundSettings {\n\t/** Three.js background blur amount in the range supported by the active renderer. */\n\tblurriness: number;\n\t/** Color mixed over the HDR background. */\n\ttint: ColorRepresentation;\n\t/** Strength of the background tint, where zero leaves the HDR unchanged. */\n\ttintIntensity: number;\n}\n\n/** Axis rotations, in radians, applied to a loaded model before it is fitted. */\nexport interface StageModelRotation {\n\tx?: number;\n\ty?: number;\n\tz?: number;\n}\n\n/** Controls the fitted camera's initial orbit around the element. */\nexport interface StageCameraSettings {\n\t/** Horizontal viewing angle in degrees. Positive values view from the right. */\n\tazimuth?: number;\n\t/** Vertical viewing angle in degrees. Positive values view from above. */\n\televation?: number;\n\t/** Empty space in CSS pixels reserved on every side of the automatic element fit. */\n\tfitPadding?: number;\n\t/** Presentation multiplier applied after fitting. Values above one make the element larger. */\n\tfitScale?: number;\n}\n\n/** Supported blend modes for declarative stage material replacements. */\nexport type StageMaterialBlending = 'normal' | 'additive';\n\n/** Serializable subset used to replace an asset mesh with a physical material. */\nexport interface StagePhysicalMaterialSettings {\n\ttype: 'physical';\n\tcolor?: ColorRepresentation;\n\topacity?: number;\n\ttransparent?: boolean;\n\tmetalness?: number;\n\troughness?: number;\n\tiridescence?: number;\n\tclearcoat?: number;\n\tblending?: StageMaterialBlending;\n}\n\nexport type StageMaterialSettings = StagePhysicalMaterialSettings;\n\n/** Controls the authored model pose and which meshes represent the actual element. */\nexport interface StageModelSettings {\n\t/** Optional rotation applied on top of the GLB scene's authored root rotation. */\n\trotation?: StageModelRotation;\n\t/**\n\t * Exact, case-sensitive mesh names that remain visible on the main stage but do\n\t * not participate in element bounds, picking, outlining, or element minimaps.\n\t */\n\texcludeMeshes?: readonly string[];\n\t/** Physical material replacements keyed by exact, case-sensitive mesh name. */\n\tmaterialOverrides?: Readonly<Record<string, StageMaterialSettings>>;\n}\n\n/** Controls the minimap model presentation while its panel is docked. */\nexport interface StageMinimapDockedView {\n\t/** Model multiplier used only while the minimap is docked. */\n\tscale?: number;\n\t/** Horizontal viewing angle in degrees. Positive values view from the right. */\n\tazimuth?: number;\n\t/** Vertical viewing angle in degrees. Positive values view from above. */\n\televation?: number;\n}\n\n/** Configures the optional element minimap rendered on top of a panel. */\nexport interface StageMinimapOptions {\n\t/** Panel height, in CSS pixels, at maximum stage zoom. */\n\texpandedHeight?: number;\n\t/** Space, in CSS pixels, reserved around the minimap model. */\n\tinset?: number;\n\t/** Additional unbounded scale applied to the fitted minimap model. Values below 0.2 are clamped. */\n\tmodelScale?: number;\n\t/** Model multiplier at full pointer hover. Use 1 to disable hover enlargement. */\n\thoverModelScale?: number;\n\t/** Hover multiplier used once the minimap is expanded by camera zoom. */\n\texpandedHoverModelScale?: number;\n\t/** Optional spatial-element-specific presentation used while the minimap is docked. */\n\tdockedView?: StageMinimapDockedView;\n\t/** Color drawn over the blurred area outside the viewport cutout. */\n\toverlayColor?: ColorRepresentation;\n\t/** Overlay alpha using the same zero-to-one convention as CSS/Figma. */\n\toverlayOpacity?: number;\n\t/** Gaussian blur radius in CSS pixels. */\n\toverlayBlur?: number;\n\t/** Color behind the minimap capture when no stage background is rendered. */\n\tcontextColor?: ColorRepresentation;\n\t/** Alpha of the minimap capture background. */\n\tcontextOpacity?: number;\n\t/** Color of the rectangle describing the main camera viewport. */\n\tviewportColor?: ColorRepresentation;\n}\n\n/** Connects one DOM panel declaration to its WebGPU and CSS3D representations. */\nexport interface StagePanelTarget {\n\t/** Accessible DOM content displayed above the WebGPU panel. */\n\tcontent: HTMLElement;\n\t/** Inner content padding in CSS pixels. */\n\tcontentInset: number;\n\t/** DOM element whose layout determines the panel position and dimensions. */\n\tframe: HTMLElement;\n\t/** Complete DOM surface used by solid and frosted CSS3D panels. */\n\tsurfaceElement: HTMLElement;\n\t/** Enables the panel's minimap rendering mode. */\n\tminimap?: StageMinimapOptions;\n\t/** true: proximity lift and tilt; 'lift': mouse hover raises 2px without tilt; false: still. */\n\tpointerReactive?: boolean | 'lift';\n\t/** true fades/moves with close-up; false keeps its pose; 'top-right' travels to the corner. */\n\tfocusReactive?: boolean | 'top-right';\n\t/** Optional neighbouring panel frame moved with the corner control during UI clearance. */\n\tgetFocusAnchor?: () => HTMLElement | undefined;\n\t/** Keep accessible content in its DOM owner (for example, a native popover). */\n\tnativeContent?: boolean;\n\t/** Position native content after its anchors move, before measuring and drawing its surface. */\n\tupdateNativeLayout?: () => void;\n\t/** Whether an optional panel is currently open. */\n\tgetVisible?: () => boolean;\n\t/** Shared geometry, tint, blur, and shadow configuration. */\n\toptions: LiquidGlassPanelOptions;\n\t/** Visual surface backend. All variants share the same CSS3D transform pipeline. */\n\tsurface: StagePanelSurface;\n\t/** Reads the current opacity of the visual surface independently of its content. */\n\tgetSurfaceOpacity?: () => number;\n\t/** Reads a transient scale applied only to the rendered minimap model. */\n\tgetMinimapModelScale?: () => number;\n\t/** Reads the animated transition from the regular to the docked minimap view. */\n\tgetMinimapDockProgress?: () => number;\n\t/** Reads the viewport-space top edge used to anchor the rendered model. */\n\tgetMinimapModelTop?: () => number | undefined;\n}\n\n/** Identifies the DOM region used to frame the main element camera. */\nexport interface StageViewportTarget {\n\telement: HTMLElement;\n}\n\n/** Describes the independently animated phases of a close-up zoom. */\nexport interface StageZoomFocusState {\n\t/** Camera-derived close-up amount, from the fitted view to maximum zoom. */\n\tfocus: number;\n\t/** Progress used to fade and move ordinary page content and panels. */\n\tuiFocus: number;\n\t/** Exact opacity applied to ordinary panels and non-stage DOM content. */\n\tuiOpacity: number;\n\t/** Delayed progress used to expand and morph the minimap. */\n\tminimapFocus: number;\n}\n\n/** A deterministic camera pose used by browser-level visual regression tests. */\nexport interface StageVisualTestView {\n\t/** Normalized camera distance, where zero is the fitted view and one is maximum zoom. */\n\tzoom?: number;\n\t/** Horizontal orbit offset from the initial pose, in degrees. */\n\tazimuth?: number;\n\t/** Vertical orbit offset from the initial pose, in degrees. */\n\tpolar?: number;\n\t/** Orbit-target offset expressed as a fraction of the fitted model radius. */\n\ttargetOffset?: Partial<{ x: number; y: number; z: number }>;\n}\n\n/** Bounds WebGPU rasterization cost independently of native DOM text resolution. */\nexport interface StageRenderSettings {\n\t/** Maximum physical pixels per CSS pixel. Defaults to 1. */\n\tmaxPixelRatio?: number;\n\t/** Maximum pixels per full-size canvas/capture. Defaults to 2,073,600; null disables this limit. */\n\tmaxPixels?: number | null;\n}\n\n/** Construction options for a {@link StageExperience}. */\nexport interface StageExperienceOptions {\n\t/** Stage-wide output quality; native DOM content remains at the device pixel ratio. */\n\trenderSettings?: StageRenderSettings;\n\t/** Directory containing Draco decoder files, including trailing slash. */\n\tdracoDecoderPath?: string;\n\t/** Opaque page surface, independent of the HDR environment. */\n\tpageBackground?: string;\n\t/** Reveals semantic content when the device can no longer render. */\n\tonDeviceLost?: () => void;\n\tlodPair?: SpatialElementLodPair;\n\t/** Catalog pages register their own presentations, including an intentionally empty list. */\n\tcatalog?: boolean;\n\t/** A restored dock uses Low only; optional detail preparation resumes when the hero returns. */\n\tdeferDetailPreparation?: boolean;\n\theroIsPresented?: () => boolean;\n\tbackground?: BackgroundSettings;\n\thdr?: string;\n\tglb?: string;\n\tmodel?: StageModelSettings;\n\tcamera?: StageCameraSettings;\n\tinteractionTheme?: Partial<StageInteractionTheme>;\n\tpanels?: StagePanelTarget[];\n\tviewport?: StageViewportTarget;\n\t/** Enables optional 3DxWare/SpaceMouse navigation. Defaults to true. */\n\tenableSpaceMouse?: boolean;\n\t/** Receives the normalized, sequenced phases of a close-up zoom. */\n\tonZoomFocusChange?: (state: StageZoomFocusState) => void;\n}\n\n/** Visual and filtering options for element hover interaction. */\nexport interface StageInteractionTheme {\n\toutlineColor: ColorRepresentation;\n\toutlineOpacity: number;\n\toutlineThickness: number;\n\toutlineGlow: number;\n\toutlineGlowThickness: number;\n\t/** Returns true for model meshes that must not participate in picking or outlining. */\n\texcludeMesh?: (mesh: Mesh) => boolean;\n}\n"]}
1
+ {"version":3,"file":"stageTypes.js","sourceRoot":"","sources":["../../src/stage/stageTypes.ts"],"names":[],"mappings":"","sourcesContent":["import type { SpatialElementLodPair } from '../catalog/spatialElementLodPair.js';\nimport type { ColorRepresentation, Mesh } from 'three';\nimport type { LiquidGlassPanelOptions } from './LiquidGlassPanel.js';\n\n/** Selects the rendering backend and visual complexity of a panel surface. */\nexport type StagePanelSurface = 'solid' | 'frosted' | 'glass';\n\n/** Controls how the HDR environment is presented behind the stage. */\nexport interface BackgroundSettings {\n\t/** Three.js background blur amount in the range supported by the active renderer. */\n\tblurriness: number;\n\t/** Color mixed over the HDR background. */\n\ttint: ColorRepresentation;\n\t/** Strength of the background tint, where zero leaves the HDR unchanged. */\n\ttintIntensity: number;\n}\n\n/** Axis rotations, in radians, applied to a loaded model before it is fitted. */\nexport interface StageModelRotation {\n\tx?: number;\n\ty?: number;\n\tz?: number;\n}\n\n/** Controls the fitted camera's initial orbit around the element. */\nexport interface StageCameraSettings {\n\t/** Horizontal viewing angle in degrees. Positive values view from the right. */\n\tazimuth?: number;\n\t/** Vertical viewing angle in degrees. Positive values view from above. */\n\televation?: number;\n\t/** Empty space in CSS pixels reserved on every side of the automatic element fit. */\n\tfitPadding?: number;\n\t/** Presentation multiplier applied after fitting. Values above one make the element larger. */\n\tfitScale?: number;\n}\n\n/** Supported blend modes for declarative stage material replacements. */\nexport type StageMaterialBlending = 'normal' | 'additive';\n\n/** Serializable subset used to replace an asset mesh with a physical material. */\nexport interface StagePhysicalMaterialSettings {\n\ttype: 'physical';\n\tcolor?: ColorRepresentation;\n\topacity?: number;\n\ttransparent?: boolean;\n\tmetalness?: number;\n\troughness?: number;\n\tiridescence?: number;\n\tclearcoat?: number;\n\tblending?: StageMaterialBlending;\n}\n\nexport type StageMaterialSettings = StagePhysicalMaterialSettings;\n\n/** Controls the authored model pose and which meshes represent the actual element. */\nexport interface StageModelSettings {\n\t/** Optional rotation applied on top of the GLB scene's authored root rotation. */\n\trotation?: StageModelRotation;\n\t/**\n\t * Exact, case-sensitive mesh names that remain visible on the main stage but do\n\t * not participate in element bounds, picking, outlining, or element minimaps.\n\t */\n\texcludeMeshes?: readonly string[];\n\t/** Physical material replacements keyed by exact, case-sensitive mesh name. */\n\tmaterialOverrides?: Readonly<Record<string, StageMaterialSettings>>;\n}\n\n/** Controls the minimap model presentation while its panel is docked. */\nexport interface StageMinimapDockedView {\n\t/** Model multiplier used only while the minimap is docked. */\n\tscale?: number;\n\t/** Horizontal viewing angle in degrees. Positive values view from the right. */\n\tazimuth?: number;\n\t/** Vertical viewing angle in degrees. Positive values view from above. */\n\televation?: number;\n}\n\n/** Configures the optional element minimap rendered on top of a panel. */\nexport interface StageMinimapOptions {\n\t/** Panel height, in CSS pixels, at maximum stage zoom. */\n\texpandedHeight?: number;\n\t/** Space, in CSS pixels, reserved around the minimap model. */\n\tinset?: number;\n\t/** Additional unbounded scale applied to the fitted minimap model. Values below 0.2 are clamped. */\n\tmodelScale?: number;\n\t/** Model multiplier at full pointer hover. Use 1 to disable hover enlargement. */\n\thoverModelScale?: number;\n\t/** Hover multiplier used once the minimap is expanded by camera zoom. */\n\texpandedHoverModelScale?: number;\n\t/** Optional spatial-element-specific presentation used while the minimap is docked. */\n\tdockedView?: StageMinimapDockedView;\n\t/** Color drawn over the blurred area outside the viewport cutout. */\n\toverlayColor?: ColorRepresentation;\n\t/** Overlay alpha using the same zero-to-one convention as CSS/Figma. */\n\toverlayOpacity?: number;\n\t/** Gaussian blur radius in CSS pixels. */\n\toverlayBlur?: number;\n\t/** Color behind the minimap capture when no stage background is rendered. */\n\tcontextColor?: ColorRepresentation;\n\t/** Alpha of the minimap capture background. */\n\tcontextOpacity?: number;\n\t/** Color of the rectangle describing the main camera viewport. */\n\tviewportColor?: ColorRepresentation;\n}\n\n/** Connects one DOM panel declaration to its WebGPU and CSS3D representations. */\nexport interface StagePanelTarget {\n\t/** Accessible DOM content displayed above the WebGPU panel. */\n\tcontent: HTMLElement;\n\t/** Inner content padding in CSS pixels. */\n\tcontentInset: number;\n\t/** DOM element whose layout determines the panel position and dimensions. */\n\tframe: HTMLElement;\n\t/** Complete DOM surface used by solid and frosted CSS3D panels. */\n\tsurfaceElement: HTMLElement;\n\t/** Enables the panel's minimap rendering mode. */\n\tminimap?: StageMinimapOptions;\n\t/** true: proximity lift and tilt; 'lift': mouse hover raises 2px without tilt; false: still. */\n\tpointerReactive?: boolean | 'lift';\n\t/** true fades/moves with close-up; false keeps its pose; 'top-right' travels to the corner. */\n\tfocusReactive?: boolean | 'top-right';\n\t/** Optional neighbouring panel frame moved with the corner control during UI clearance. */\n\tgetFocusAnchor?: () => HTMLElement | undefined;\n\t/** Keep accessible content in its DOM owner (for example, a native popover). */\n\tnativeContent?: boolean;\n\t/** Position native content after its anchors move, before measuring and drawing its surface. */\n\tupdateNativeLayout?: () => void;\n\t/** Whether an optional panel is currently open. */\n\tgetVisible?: () => boolean;\n\t/** Shared geometry, tint, blur, and shadow configuration. */\n\toptions: LiquidGlassPanelOptions;\n\t/** Visual surface backend. All variants share the same CSS3D transform pipeline. */\n\tsurface: StagePanelSurface;\n\t/** Reads the current opacity of the visual surface independently of its content. */\n\tgetSurfaceOpacity?: () => number;\n\t/** Reads a transient scale applied only to the rendered minimap model. */\n\tgetMinimapModelScale?: () => number;\n\t/** Reads the animated transition from the regular to the docked minimap view. */\n\tgetMinimapDockProgress?: () => number;\n\t/** Reads the viewport-space top edge used to anchor the rendered model. */\n\tgetMinimapModelTop?: () => number | undefined;\n}\n\n/** Identifies the DOM region used to frame the main element camera. */\nexport interface StageViewportTarget {\n\telement: HTMLElement;\n}\n\n/** Describes the independently animated phases of a close-up zoom. */\nexport interface StageZoomFocusState {\n\t/** Camera-derived close-up amount, from the fitted view to maximum zoom. */\n\tfocus: number;\n\t/** Progress used to fade and move ordinary page content and panels. */\n\tuiFocus: number;\n\t/** Exact opacity applied to ordinary panels and non-stage DOM content. */\n\tuiOpacity: number;\n\t/** Delayed progress used to expand and morph the minimap. */\n\tminimapFocus: number;\n}\n\n/** A deterministic camera pose used by browser-level visual regression tests. */\nexport interface StageVisualTestView {\n\t/** Normalized camera distance, where zero is the fitted view and one is maximum zoom. */\n\tzoom?: number;\n\t/** Horizontal orbit offset from the initial pose, in degrees. */\n\tazimuth?: number;\n\t/** Vertical orbit offset from the initial pose, in degrees. */\n\tpolar?: number;\n\t/** Orbit-target offset expressed as a fraction of the fitted model radius. */\n\ttargetOffset?: Partial<{ x: number; y: number; z: number }>;\n}\n\n/** Bounds WebGPU rasterization cost independently of native DOM text resolution. */\nexport interface StageRenderSettings {\n\t/** Maximum physical pixels per CSS pixel. Defaults to 1. */\n\tmaxPixelRatio?: number;\n\t/** Maximum pixels per full-size canvas/capture. Defaults to 2,073,600; null disables this limit. */\n\tmaxPixels?: number | null;\n}\n\n/** Construction options for a {@link StageExperience}. */\nexport interface StageExperienceOptions {\n\tdeviceOrientation?: boolean;\n\t/** Stage-wide output quality; native DOM content remains at the device pixel ratio. */\n\trenderSettings?: StageRenderSettings;\n\t/** Directory containing Draco decoder files, including trailing slash. */\n\tdracoDecoderPath?: string;\n\t/** Opaque page surface, independent of the HDR environment. */\n\tpageBackground?: string;\n\t/** Reveals semantic content when the device can no longer render. */\n\tonDeviceLost?: () => void;\n\tlodPair?: SpatialElementLodPair;\n\t/** Catalog pages register their own presentations, including an intentionally empty list. */\n\tcatalog?: boolean;\n\t/** A restored dock uses Low only; optional detail preparation resumes when the hero returns. */\n\tdeferDetailPreparation?: boolean;\n\theroIsPresented?: () => boolean;\n\tbackground?: BackgroundSettings;\n\thdr?: string;\n\tglb?: string;\n\tmodel?: StageModelSettings;\n\tcamera?: StageCameraSettings;\n\tinteractionTheme?: Partial<StageInteractionTheme>;\n\tpanels?: StagePanelTarget[];\n\tviewport?: StageViewportTarget;\n\t/** Enables optional 3DxWare/SpaceMouse navigation. Defaults to true. */\n\tenableSpaceMouse?: boolean;\n\t/** Receives the normalized, sequenced phases of a close-up zoom. */\n\tonZoomFocusChange?: (state: StageZoomFocusState) => void;\n}\n\n/** Visual and filtering options for element hover interaction. */\nexport interface StageInteractionTheme {\n\toutlineColor: ColorRepresentation;\n\toutlineOpacity: number;\n\toutlineThickness: number;\n\toutlineGlow: number;\n\toutlineGlowThickness: number;\n\t/** Returns true for model meshes that must not participate in picking or outlining. */\n\texcludeMesh?: (mesh: Mesh) => boolean;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spatial-elements/core",
3
- "version": "1.0.0-beta.5",
3
+ "version": "1.0.0-beta.7",
4
4
  "description": "Framework-independent rendering and catalog runtime for Spatial Elements.",
5
5
  "license": "MPL-2.0",
6
6
  "type": "module",