@spatial-elements/core 1.0.0-beta.12 → 1.0.0-beta.14
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.
- package/dist/catalog/CarouselSectionSurfaces.d.ts.map +1 -1
- package/dist/catalog/CarouselSectionSurfaces.js +8 -2
- package/dist/catalog/CarouselSectionSurfaces.js.map +1 -1
- package/dist/catalog/CatalogSpatialElementLayer.d.ts.map +1 -1
- package/dist/catalog/CatalogSpatialElementLayer.js +12 -4
- package/dist/catalog/CatalogSpatialElementLayer.js.map +1 -1
- package/dist/catalog/SourceDomMotion.d.ts.map +1 -1
- package/dist/catalog/SourceDomMotion.js +2 -3
- package/dist/catalog/SourceDomMotion.js.map +1 -1
- package/dist/catalog/carouselRenderClip.d.ts +4 -0
- package/dist/catalog/carouselRenderClip.d.ts.map +1 -0
- package/dist/catalog/carouselRenderClip.js +15 -0
- package/dist/catalog/carouselRenderClip.js.map +1 -0
- package/dist/spatial-element/SpatialElementPaneController.d.ts +4 -4
- package/dist/spatial-element/SpatialElementPaneController.d.ts.map +1 -1
- package/dist/spatial-element/SpatialElementPaneController.js +49 -23
- package/dist/spatial-element/SpatialElementPaneController.js.map +1 -1
- package/dist/spatial-element/responsiveLayout.d.ts.map +1 -1
- package/dist/spatial-element/responsiveLayout.js +4 -2
- package/dist/spatial-element/responsiveLayout.js.map +1 -1
- package/dist/stage/DetailWheelGesture.d.ts +11 -0
- package/dist/stage/DetailWheelGesture.d.ts.map +1 -0
- package/dist/stage/DetailWheelGesture.js +19 -0
- package/dist/stage/DetailWheelGesture.js.map +1 -0
- package/dist/stage/HeldSceneCapture.d.ts +15 -0
- package/dist/stage/HeldSceneCapture.d.ts.map +1 -0
- package/dist/stage/HeldSceneCapture.js +48 -0
- package/dist/stage/HeldSceneCapture.js.map +1 -0
- package/dist/stage/LiquidGlassPanel.d.ts +2 -0
- package/dist/stage/LiquidGlassPanel.d.ts.map +1 -1
- package/dist/stage/LiquidGlassPanel.js +24 -17
- package/dist/stage/LiquidGlassPanel.js.map +1 -1
- package/dist/stage/PanelPresentationController.d.ts +5 -0
- package/dist/stage/PanelPresentationController.d.ts.map +1 -1
- package/dist/stage/PanelPresentationController.js +76 -30
- package/dist/stage/PanelPresentationController.js.map +1 -1
- package/dist/stage/SpaceMouseAdapter.js +8 -6
- package/dist/stage/SpaceMouseAdapter.js.map +1 -1
- package/dist/stage/SpatialElementInteractionController.d.ts +44 -1
- package/dist/stage/SpatialElementInteractionController.d.ts.map +1 -1
- package/dist/stage/SpatialElementInteractionController.js +378 -39
- package/dist/stage/SpatialElementInteractionController.js.map +1 -1
- package/dist/stage/SpatialElementPresentationController.js +4 -4
- package/dist/stage/SpatialElementPresentationController.js.map +1 -1
- package/dist/stage/StageExperience.d.ts +8 -0
- package/dist/stage/StageExperience.d.ts.map +1 -1
- package/dist/stage/StageExperience.js +39 -21
- package/dist/stage/StageExperience.js.map +1 -1
- package/dist/stage/StageRenderPipeline.d.ts +4 -0
- package/dist/stage/StageRenderPipeline.d.ts.map +1 -1
- package/dist/stage/StageRenderPipeline.js +30 -8
- package/dist/stage/StageRenderPipeline.js.map +1 -1
- package/dist/stage/browserPinch.d.ts +5 -0
- package/dist/stage/browserPinch.d.ts.map +1 -0
- package/dist/stage/browserPinch.js +29 -0
- package/dist/stage/browserPinch.js.map +1 -0
- package/dist/stage/cssProjection.d.ts +3 -1
- package/dist/stage/cssProjection.d.ts.map +1 -1
- package/dist/stage/cssProjection.js +8 -3
- package/dist/stage/cssProjection.js.map +1 -1
- package/dist/stage/panelContext.d.ts +2 -1
- package/dist/stage/panelContext.d.ts.map +1 -1
- package/dist/stage/panelContext.js.map +1 -1
- package/dist/stage/panelFocusMath.d.ts +2 -0
- package/dist/stage/panelFocusMath.d.ts.map +1 -1
- package/dist/stage/panelFocusMath.js +8 -0
- package/dist/stage/panelFocusMath.js.map +1 -1
- package/dist/stage/rendererState.d.ts.map +1 -1
- package/dist/stage/rendererState.js +24 -9
- package/dist/stage/rendererState.js.map +1 -1
- package/dist/stage/stageVisualTest.d.ts +1 -0
- package/dist/stage/stageVisualTest.d.ts.map +1 -1
- package/dist/stage/stageVisualTest.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Suppress page magnification without disabling keyboard/browser-menu zoom.
|
|
2
|
+
* Detail gestures are handled separately by the lazily loaded 3D runtime.
|
|
3
|
+
*/
|
|
4
|
+
export declare function preventBrowserPinch(root: HTMLElement): () => void;
|
|
5
|
+
//# sourceMappingURL=browserPinch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browserPinch.d.ts","sourceRoot":"","sources":["../../src/stage/browserPinch.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,WAAW,cAqBpD"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** Suppress page magnification without disabling keyboard/browser-menu zoom.
|
|
2
|
+
* Detail gestures are handled separately by the lazily loaded 3D runtime.
|
|
3
|
+
*/
|
|
4
|
+
export function preventBrowserPinch(root) {
|
|
5
|
+
const belongs = (event) => event.target instanceof Node && root.contains(event.target);
|
|
6
|
+
const wheel = (event) => {
|
|
7
|
+
if (event.ctrlKey && belongs(event))
|
|
8
|
+
event.preventDefault();
|
|
9
|
+
};
|
|
10
|
+
const touch = (event) => {
|
|
11
|
+
if (event.touches.length > 1 && belongs(event))
|
|
12
|
+
event.preventDefault();
|
|
13
|
+
};
|
|
14
|
+
const gesture = (event) => { if (belongs(event))
|
|
15
|
+
event.preventDefault(); };
|
|
16
|
+
window.addEventListener('wheel', wheel, { capture: true, passive: false });
|
|
17
|
+
window.addEventListener('touchstart', touch, { capture: true, passive: false });
|
|
18
|
+
window.addEventListener('touchmove', touch, { capture: true, passive: false });
|
|
19
|
+
window.addEventListener('gesturestart', gesture, { capture: true, passive: false });
|
|
20
|
+
window.addEventListener('gesturechange', gesture, { capture: true, passive: false });
|
|
21
|
+
return () => {
|
|
22
|
+
window.removeEventListener('wheel', wheel, true);
|
|
23
|
+
window.removeEventListener('touchstart', touch, true);
|
|
24
|
+
window.removeEventListener('touchmove', touch, true);
|
|
25
|
+
window.removeEventListener('gesturestart', gesture, true);
|
|
26
|
+
window.removeEventListener('gesturechange', gesture, true);
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=browserPinch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browserPinch.js","sourceRoot":"","sources":["../../src/stage/browserPinch.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAiB;IACpD,MAAM,OAAO,GAAG,CAAC,KAAY,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,YAAY,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC9F,MAAM,KAAK,GAAG,CAAC,KAAiB,EAAE,EAAE;QACnC,IAAI,KAAK,CAAC,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC;YAAE,KAAK,CAAC,cAAc,EAAE,CAAC;IAC7D,CAAC,CAAC;IACF,MAAM,KAAK,GAAG,CAAC,KAAiB,EAAE,EAAE;QACnC,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC;YAAE,KAAK,CAAC,cAAc,EAAE,CAAC;IACxE,CAAC,CAAC;IACF,MAAM,OAAO,GAAG,CAAC,KAAY,EAAE,EAAE,GAAG,IAAI,OAAO,CAAC,KAAK,CAAC;QAAE,KAAK,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,CAAC;IAClF,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;IAC3E,MAAM,CAAC,gBAAgB,CAAC,YAAY,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;IAChF,MAAM,CAAC,gBAAgB,CAAC,WAAW,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;IAC/E,MAAM,CAAC,gBAAgB,CAAC,cAAc,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;IACpF,MAAM,CAAC,gBAAgB,CAAC,eAAe,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;IACrF,OAAO,GAAG,EAAE;QACX,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;QACjD,MAAM,CAAC,mBAAmB,CAAC,YAAY,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;QACtD,MAAM,CAAC,mBAAmB,CAAC,WAAW,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;QACrD,MAAM,CAAC,mBAAmB,CAAC,cAAc,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;QAC1D,MAAM,CAAC,mBAAmB,CAAC,eAAe,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IAC5D,CAAC,CAAC;AACH,CAAC","sourcesContent":["/** Suppress page magnification without disabling keyboard/browser-menu zoom.\n * Detail gestures are handled separately by the lazily loaded 3D runtime.\n */\nexport function preventBrowserPinch(root: HTMLElement) {\n\tconst belongs = (event: Event) => event.target instanceof Node && root.contains(event.target);\n\tconst wheel = (event: WheelEvent) => {\n\t\tif (event.ctrlKey && belongs(event)) event.preventDefault();\n\t};\n\tconst touch = (event: TouchEvent) => {\n\t\tif (event.touches.length > 1 && belongs(event)) event.preventDefault();\n\t};\n\tconst gesture = (event: Event) => { if (belongs(event)) event.preventDefault(); };\n\twindow.addEventListener('wheel', wheel, { capture: true, passive: false });\n\twindow.addEventListener('touchstart', touch, { capture: true, passive: false });\n\twindow.addEventListener('touchmove', touch, { capture: true, passive: false });\n\twindow.addEventListener('gesturestart', gesture, { capture: true, passive: false });\n\twindow.addEventListener('gesturechange', gesture, { capture: true, passive: false });\n\treturn () => {\n\t\twindow.removeEventListener('wheel', wheel, true);\n\t\twindow.removeEventListener('touchstart', touch, true);\n\t\twindow.removeEventListener('touchmove', touch, true);\n\t\twindow.removeEventListener('gesturestart', gesture, true);\n\t\twindow.removeEventListener('gesturechange', gesture, true);\n\t};\n}\n"]}
|
|
@@ -9,10 +9,12 @@ export type CssProjectionQuad = readonly [
|
|
|
9
9
|
CssProjectionPoint
|
|
10
10
|
];
|
|
11
11
|
/**
|
|
12
|
-
* Returns
|
|
12
|
+
* Returns matrix elements mapping a local rectangle onto a projected screen quad.
|
|
13
13
|
*
|
|
14
14
|
* Corners are ordered clockwise from the top-left. The resulting homography keeps
|
|
15
15
|
* a flat DOM surface in the exact same perspective projection as its WebGPU plane.
|
|
16
16
|
*/
|
|
17
|
+
export declare function getProjectiveCssMatrixElements(corners: CssProjectionQuad, width: number, height: number): number[] | null;
|
|
18
|
+
/** CSS serialization is only needed when writing the final DOM transform. */
|
|
17
19
|
export declare function getProjectiveCssMatrix3d(corners: CssProjectionQuad, width: number, height: number): string | null;
|
|
18
20
|
//# sourceMappingURL=cssProjection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cssProjection.d.ts","sourceRoot":"","sources":["../../src/stage/cssProjection.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IAClC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACV;AAED,MAAM,MAAM,iBAAiB,GAAG,SAAS;IACxC,kBAAkB;IAClB,kBAAkB;IAClB,kBAAkB;IAClB,kBAAkB;CAClB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,
|
|
1
|
+
{"version":3,"file":"cssProjection.d.ts","sourceRoot":"","sources":["../../src/stage/cssProjection.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IAClC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACV;AAED,MAAM,MAAM,iBAAiB,GAAG,SAAS;IACxC,kBAAkB;IAClB,kBAAkB;IAClB,kBAAkB;IAClB,kBAAkB;CAClB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC7C,OAAO,EAAE,iBAAiB,EAC1B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,mBA+Cd;AAED,6EAA6E;AAC7E,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,iBAGjG"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Returns
|
|
2
|
+
* Returns matrix elements mapping a local rectangle onto a projected screen quad.
|
|
3
3
|
*
|
|
4
4
|
* Corners are ordered clockwise from the top-left. The resulting homography keeps
|
|
5
5
|
* a flat DOM surface in the exact same perspective projection as its WebGPU plane.
|
|
6
6
|
*/
|
|
7
|
-
export function
|
|
7
|
+
export function getProjectiveCssMatrixElements(corners, width, height) {
|
|
8
8
|
const safeWidth = Math.max(width, 0.000001);
|
|
9
9
|
const safeHeight = Math.max(height, 0.000001);
|
|
10
10
|
const [topLeft, topRight, bottomRight, bottomLeft] = corners;
|
|
@@ -47,6 +47,11 @@ export function getProjectiveCssMatrix3d(corners, width, height) {
|
|
|
47
47
|
];
|
|
48
48
|
if (matrix.some((value) => !Number.isFinite(value)))
|
|
49
49
|
return null;
|
|
50
|
-
return
|
|
50
|
+
return matrix.map((value) => (Math.abs(value) < 1e-10 ? 0 : value));
|
|
51
|
+
}
|
|
52
|
+
/** CSS serialization is only needed when writing the final DOM transform. */
|
|
53
|
+
export function getProjectiveCssMatrix3d(corners, width, height) {
|
|
54
|
+
const matrix = getProjectiveCssMatrixElements(corners, width, height);
|
|
55
|
+
return matrix ? `matrix3d(${matrix.join(',')})` : null;
|
|
51
56
|
}
|
|
52
57
|
//# sourceMappingURL=cssProjection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cssProjection.js","sourceRoot":"","sources":["../../src/stage/cssProjection.ts"],"names":[],"mappings":"AAYA;;;;;GAKG;AACH,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"cssProjection.js","sourceRoot":"","sources":["../../src/stage/cssProjection.ts"],"names":[],"mappings":"AAYA;;;;;GAKG;AACH,MAAM,UAAU,8BAA8B,CAC7C,OAA0B,EAC1B,KAAa,EACb,MAAc;IAEd,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC5C,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC9C,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,CAAC,GAAG,OAAO,CAAC;IAC7D,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC;IAC3C,MAAM,OAAO,GAAG,UAAU,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC;IAC7C,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC;IACtE,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC;IAC3C,MAAM,OAAO,GAAG,UAAU,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC;IAC7C,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC;I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,CAAC,CAAC;QACT,OAAO,CAAC,CAAC;QACT,CAAC;QACD,CAAC;KACD,CAAC;IACF,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IAEjE,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AACrE,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,wBAAwB,CAAC,OAA0B,EAAE,KAAa,EAAE,MAAc;IACjG,MAAM,MAAM,GAAG,8BAA8B,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IACtE,OAAO,MAAM,CAAC,CAAC,CAAC,YAAY,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;AACxD,CAAC","sourcesContent":["export interface CssProjectionPoint {\n\tx: number;\n\ty: number;\n}\n\nexport type CssProjectionQuad = readonly [\n\tCssProjectionPoint,\n\tCssProjectionPoint,\n\tCssProjectionPoint,\n\tCssProjectionPoint\n];\n\n/**\n * Returns matrix elements mapping a local rectangle onto a projected screen quad.\n *\n * Corners are ordered clockwise from the top-left. The resulting homography keeps\n * a flat DOM surface in the exact same perspective projection as its WebGPU plane.\n */\nexport function getProjectiveCssMatrixElements(\n\tcorners: CssProjectionQuad,\n\twidth: number,\n\theight: number\n) {\n\tconst safeWidth = Math.max(width, 0.000001);\n\tconst safeHeight = Math.max(height, 0.000001);\n\tconst [topLeft, topRight, bottomRight, bottomLeft] = corners;\n\tconst deltaX1 = topRight.x - bottomRight.x;\n\tconst deltaX2 = bottomLeft.x - bottomRight.x;\n\tconst deltaX3 = topLeft.x - topRight.x + bottomRight.x - bottomLeft.x;\n\tconst deltaY1 = topRight.y - bottomRight.y;\n\tconst deltaY2 = bottomLeft.y - bottomRight.y;\n\tconst deltaY3 = topLeft.y - topRight.y + bottomRight.y - bottomLeft.y;\n\tlet projectiveX = 0;\n\tlet projectiveY = 0;\n\n\tif (Math.abs(deltaX3) > 0.000001 || Math.abs(deltaY3) > 0.000001) {\n\t\tconst determinant = deltaX1 * deltaY2 - deltaX2 * deltaY1;\n\t\tif (Math.abs(determinant) < 0.000001) return null;\n\n\t\tprojectiveX = (deltaX3 * deltaY2 - deltaX2 * deltaY3) / determinant;\n\t\tprojectiveY = (deltaX1 * deltaY3 - deltaX3 * deltaY1) / determinant;\n\t}\n\n\tconst scaleX = topRight.x - topLeft.x + projectiveX * topRight.x;\n\tconst shearX = bottomLeft.x - topLeft.x + projectiveY * bottomLeft.x;\n\tconst scaleY = topRight.y - topLeft.y + projectiveX * topRight.y;\n\tconst shearY = bottomLeft.y - topLeft.y + projectiveY * bottomLeft.y;\n\tconst matrix = [\n\t\tscaleX / safeWidth,\n\t\tscaleY / safeWidth,\n\t\t0,\n\t\tprojectiveX / safeWidth,\n\t\tshearX / safeHeight,\n\t\tshearY / safeHeight,\n\t\t0,\n\t\tprojectiveY / safeHeight,\n\t\t0,\n\t\t0,\n\t\t1,\n\t\t0,\n\t\ttopLeft.x,\n\t\ttopLeft.y,\n\t\t0,\n\t\t1\n\t];\n\tif (matrix.some((value) => !Number.isFinite(value))) return null;\n\n\treturn matrix.map((value) => (Math.abs(value) < 1e-10 ? 0 : value));\n}\n\n/** CSS serialization is only needed when writing the final DOM transform. */\nexport function getProjectiveCssMatrix3d(corners: CssProjectionQuad, width: number, height: number) {\n\tconst matrix = getProjectiveCssMatrixElements(corners, width, height);\n\treturn matrix ? `matrix3d(${matrix.join(',')})` : null;\n}\n"]}
|
|
@@ -15,9 +15,10 @@ export interface StagePanelPose {
|
|
|
15
15
|
}
|
|
16
16
|
export interface StagePanelShape {
|
|
17
17
|
radius: number;
|
|
18
|
+
squareBottom?: boolean;
|
|
18
19
|
contentInset?: number;
|
|
19
20
|
}
|
|
20
|
-
export type StagePanelTheme = Omit<LiquidGlassPanelOptions, 'width' | 'height' | 'position' | 'radius'> & {
|
|
21
|
+
export type StagePanelTheme = Omit<LiquidGlassPanelOptions, 'width' | 'height' | 'position' | 'radius' | 'squareBottom'> & {
|
|
21
22
|
/** Semantic surface style. Defaults to the WebGPU-backed `glass` mode. */
|
|
22
23
|
surface?: StagePanelSurface;
|
|
23
24
|
};
|
|
@@ -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,eAAO,MAAM,wBAAwB,uBAAuB,CAAC;AAE7D,MAAM,WAAW,cAAc;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACnC;AAED,MAAM,WAAW,eAAe;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,eAAe,GAAG,IAAI,CACjC,uBAAuB,EACvB,OAAO,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ,
|
|
1
|
+
{"version":3,"file":"panelContext.d.ts","sourceRoot":"","sources":["../../src/stage/panelContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAA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vF,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\t/** Selection is read without rebuilding the minimap model. */\n\tgetMinimapSelected?(): 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\tgetMinimapModelCenterY?: () => number | undefined;\n\tgetMinimapModelLeft?(): number | undefined;\n}\n\nexport interface StageViewportRegistration {\n\tgetElement(): HTMLElement | undefined;\n}\n\nexport interface StageContext {\n\t/** Detail-page ownership; stale route cleanup cannot reset a newer media selection. */\n\tregisterDetailMedia?(read: () => import('../spatial-element/types.js').SpatialElementMediaItem['kind']): () => void;\n\t/** Cached browser layout metrics; unavailable during SSR. */\n\tgetLayoutMetrics?(mode?: 'stable' | 'visible'): import('../spatial-element/responsiveLayout.js').ResponsiveLayoutInput | undefined;\n\t/** Reactive in framework adapters; false during SSR and until the GPU has painted. */\n\tisEnhanced?(): boolean;\n\t/** Local-driver integration is opt-in and may trigger a browser permission prompt. */\n\tsetSpaceMouseEnabled?(enabled: boolean): void;\n\tisSpaceMouseEnabled?(): boolean;\n\tisSpaceMouseDesktop?(): boolean;\n\tgetSpaceMouseState?(): import('./spaceMousePlatform.js').SpaceMouseState;\n\tgetSpaceMousePermission?(): import('./spaceMousePermission.js').SpaceMousePermission;\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\t/** Damped UI focus shared by panels and the document-scrolled detail pane. */\n\tgetZoomUiFocus?(): 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\tsquareBottom?: boolean;\n\tcontentInset?: number;\n}\n\nexport type StagePanelTheme = Omit<\n\tLiquidGlassPanelOptions,\n\t'width' | 'height' | 'position' | 'radius' | 'squareBottom'\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\t/** Selection is read without rebuilding the minimap model. */\n\tgetMinimapSelected?(): 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\tgetMinimapModelCenterY?: () => number | undefined;\n\tgetMinimapModelLeft?(): number | undefined;\n}\n\nexport interface StageViewportRegistration {\n\tgetElement(): HTMLElement | undefined;\n}\n\nexport interface StageContext {\n\t/** Detail-page ownership; stale route cleanup cannot reset a newer media selection. */\n\tregisterDetailMedia?(read: () => import('../spatial-element/types.js').SpatialElementMediaItem['kind']): () => void;\n\t/** Cached browser layout metrics; unavailable during SSR. */\n\tgetLayoutMetrics?(mode?: 'stable' | 'visible'): import('../spatial-element/responsiveLayout.js').ResponsiveLayoutInput | undefined;\n\t/** Reactive in framework adapters; false during SSR and until the GPU has painted. */\n\tisEnhanced?(): boolean;\n\t/** Local-driver integration is opt-in and may trigger a browser permission prompt. */\n\tsetSpaceMouseEnabled?(enabled: boolean): void;\n\tisSpaceMouseEnabled?(): boolean;\n\tisSpaceMouseDesktop?(): boolean;\n\tgetSpaceMouseState?(): import('./spaceMousePlatform.js').SpaceMouseState;\n\tgetSpaceMousePermission?(): import('./spaceMousePermission.js').SpaceMousePermission;\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\t/** Damped UI focus shared by panels and the document-scrolled detail pane. */\n\tgetZoomUiFocus?(): number;\n\tsetFullscreen?(fullscreen: boolean): void;\n}\n"]}
|
|
@@ -27,6 +27,8 @@ export declare function getPanelFocusDirection(options: Pick<Required<LiquidGlas
|
|
|
27
27
|
};
|
|
28
28
|
/** Shared, eased progress for panel motion, blur, opacity and corner controls. */
|
|
29
29
|
export declare function getPanelFocusProgress(focus: number): number;
|
|
30
|
+
/** Inverse of the shared curve, for a timeline that already owns eased progress. */
|
|
31
|
+
export declare function getPanelFocusFromProgress(progress: number): number;
|
|
30
32
|
/** Stacked detail content leaves as one row, without sideways perspective drift. */
|
|
31
33
|
export declare function getStackedDetailFocusOffset(focus: number, viewportHeight: number): {
|
|
32
34
|
x: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panelFocusMath.d.ts","sourceRoot":"","sources":["../../src/stage/panelFocusMath.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AASrE,yEAAyE;AACzE,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAIrE;AAED,wFAAwF;AACxF,wBAAgB,sBAAsB,CAAC,cAAc,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,UAEzE;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAC7C,QAAQ,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,EAClC,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,MAAM;;;EAiBtB;AAED,mFAAmF;AACnF,wBAAgB,mBAAmB,CAClC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,uBAAuB,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,UAAU,CAAC,EACjF,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,MAAM;;;;EAqBtB;AAED,oFAAoF;AACpF,wBAAgB,sBAAsB,CACrC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,uBAAuB,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,UAAU,CAAC,EACjF,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM;;;EAY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CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,UAAU,CAAC,EACjF,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM;;;EAYnB;AAED,kFAAkF;AAClF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,UAElD;AAED,oFAAoF;AACpF,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,UAIzD;AAED,oFAAoF;AACpF,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM;;;;EAEhF;AAED,kEAAkE;AAClE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,UAEjD;AAED,kEAAkE;AAClE,wBAAgB,iBAAiB,CAChC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,uBAAuB,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC,UAKpE"}
|
|
@@ -66,6 +66,14 @@ export function getPanelFocusDirection(options, normalizedX, normalizedY) {
|
|
|
66
66
|
export function getPanelFocusProgress(focus) {
|
|
67
67
|
return smoothstep(0.08, 0.96, focus);
|
|
68
68
|
}
|
|
69
|
+
/** Inverse of the shared curve, for a timeline that already owns eased progress. */
|
|
70
|
+
export function getPanelFocusFromProgress(progress) {
|
|
71
|
+
if (progress <= 0)
|
|
72
|
+
return 0;
|
|
73
|
+
if (progress >= 1)
|
|
74
|
+
return 1;
|
|
75
|
+
return 0.08 + 0.88 * (0.5 - Math.sin(Math.asin(1 - 2 * progress) / 3));
|
|
76
|
+
}
|
|
69
77
|
/** Stacked detail content leaves as one row, without sideways perspective drift. */
|
|
70
78
|
export function getStackedDetailFocusOffset(focus, viewportHeight) {
|
|
71
79
|
return { x: 0, y: -viewportHeight * 0.6 * getPanelFocusProgress(focus), z: 0 };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panelFocusMath.js","sourceRoot":"","sources":["../../src/stage/panelFocusMath.ts"],"names":[],"mappings":"AAAA,OAA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AC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;IACvE,MAAM,SAAS,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACxE,OAAO,oBAAoB,GAAG,SAAS,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;AACxE,CAAC","sourcesContent":["import * as ScalarMath from './scalarMath.js';\nimport type { LiquidGlassPanelOptions } from './LiquidGlassPanel.js';\nimport {\n\tPANEL_FOCUS_PERSPECTIVE_MAX_SCALE,\n\tPANEL_FOCUS_MAX_OFFSET,\n\tPANEL_FOCUS_MAX_ADVANCE,\n\tPANEL_FOCUS_MIN_OPACITY,\n\tPANEL_FOCUS_MAX_BLUR\n} from './stageConstants.js';\n\n/** Applies the cubic Hermite smoothstep curve with clamped endpoints. */\nexport function smoothstep(edge0: number, edge1: number, value: number) {\n\tif (edge0 === edge1) return value < edge0 ? 0 : 1;\n\tconst t = ScalarMath.clamp((value - edge0) / (edge1 - edge0), 0, 1);\n\treturn t * t * (3 - 2 * t);\n}\n\n/** Returns the perspective camera distance that maps viewport pixels to world units. */\nexport function getPerspectiveDistance(viewportHeight: number, fov: number) {\n\treturn (viewportHeight * 0.5) / Math.tan(ScalarMath.degToRad(fov * 0.5));\n}\n\n/**\n * Restores the outward screen-space drift that an off-axis panel would receive\n * from the shared perspective while leaving its hover projection panel-local.\n */\nexport function getPanelFocusPerspectiveOffset(\n\tposition: { x: number; y: number },\n\tadvance: number,\n\tcameraDistance: number\n) {\n\tconst safeCameraDistance = Math.max(Number.isFinite(cameraDistance) ? cameraDistance : 1, 1);\n\tconst safeAdvance = Math.max(Number.isFinite(advance) ? advance : 0, 0);\n\tif (safeAdvance <= 0) return { x: 0, y: 0 };\n\n\tconst projectionScale = ScalarMath.clamp(\n\t\tsafeCameraDistance / Math.max(safeCameraDistance - safeAdvance, 1),\n\t\t1,\n\t\tPANEL_FOCUS_PERSPECTIVE_MAX_SCALE\n\t);\n\tconst egressScale = projectionScale - 1;\n\n\treturn {\n\t\tx: position.x * egressScale,\n\t\ty: position.y * egressScale\n\t};\n}\n\n/** Computes the camera-facing travel used to clear panels during close-up zoom. */\nexport function getPanelFocusOffset(\n\toptions: Pick<Required<LiquidGlassPanelOptions>, 'width' | 'height' | 'position'>,\n\tfocus: number,\n\tviewportWidth: number,\n\tviewportHeight: number\n) {\n\tif (focus <= 0.001) return { x: 0, y: 0, z: 0 };\n\tconst edgeDistanceX = Math.max(viewportWidth * 0.5 - options.width * 0.5, 1);\n\tconst edgeDistanceY = Math.max(viewportHeight * 0.5 - options.height * 0.5, 1);\n\tconst normalizedX = options.position.x / edgeDistanceX;\n\tconst normalizedY = options.position.y / edgeDistanceY;\n\tconst direction = getPanelFocusDirection(options, normalizedX, normalizedY);\n\tconst horizontal = Math.abs(direction.x) > Math.abs(direction.y);\n\tconst axisSize = horizontal ? options.width : options.height;\n\tconst travel = ScalarMath.clamp(\n\t\taxisSize * (horizontal ? 0.16 : 0.42),\n\t\thorizontal ? 48 : 18,\n\t\tPANEL_FOCUS_MAX_OFFSET\n\t);\n\tconst easedFocus = getPanelFocusProgress(focus);\n\treturn {\n\t\tx: direction.x * travel * easedFocus,\n\t\ty: direction.y * travel * easedFocus,\n\t\tz: PANEL_FOCUS_MAX_ADVANCE * easedFocus\n\t};\n}\n\n/** Chooses the least disruptive edge toward which a focused panel should travel. */\nexport function getPanelFocusDirection(\n\toptions: Pick<Required<LiquidGlassPanelOptions>, 'width' | 'height' | 'position'>,\n\tnormalizedX: number,\n\tnormalizedY: number\n) {\n\tconst aspect = options.width / Math.max(options.height, 1);\n\tconst absX = Math.abs(normalizedX);\n\tconst absY = Math.abs(normalizedY);\n\tif (aspect >= 2.4 && absY > 0.12) return { x: 0, y: Math.sign(normalizedY) || 1 };\n\tif (absX > absY * 0.8) return { x: Math.sign(normalizedX) || 1, y: 0 };\n\tif (absY > absX * 0.8) return { x: 0, y: Math.sign(normalizedY) || 1 };\n\tif (normalizedX * normalizedX + normalizedY * normalizedY < 0.02)\n\t\treturn { x: 0, y: options.position.y >= 0 ? 1 : -1 };\n\tconst length = Math.hypot(normalizedX, normalizedY);\n\treturn { x: normalizedX / length, y: normalizedY / length };\n}\n\n/** Shared, eased progress for panel motion, blur, opacity and corner controls. */\nexport function getPanelFocusProgress(focus: number) {\n\treturn smoothstep(0.08, 0.96, focus);\n}\n\n/** Stacked detail content leaves as one row, without sideways perspective drift. */\nexport function getStackedDetailFocusOffset(focus: number, viewportHeight: number) {\n\treturn { x: 0, y: -viewportHeight * 0.6 * getPanelFocusProgress(focus), z: 0 };\n}\n\n/** Returns panel opacity at a normalized stage UI focus level. */\nexport function getPanelFocusOpacity(focus: number) {\n\treturn ScalarMath.lerp(1, PANEL_FOCUS_MIN_OPACITY, getPanelFocusProgress(focus));\n}\n\n/** Returns CSS content blur at a normalized stage focus level. */\nexport function getPanelFocusBlur(\n\tfocus: number,\n\toptions: Pick<Required<LiquidGlassPanelOptions>, 'width' | 'height'>\n) {\n\tconst shortSide = Math.max(Math.min(options.width, options.height), 1);\n\tconst sizeScale = ScalarMath.clamp(Math.sqrt(shortSide / 240), 0.34, 1);\n\treturn PANEL_FOCUS_MAX_BLUR * sizeScale * getPanelFocusProgress(focus);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"panelFocusMath.js","sourceRoot":"","sources":["../../src/stage/panelFocusMath.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EACN,iCAAiC,EACjC,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,MAAM,qBAAqB,CAAC;AAE7B,yEAAyE;AACzE,MAAM,UAAU,UAAU,CAAC,KAAa,EAAE,KAAa,EAAE,KAAa;IACrE,IAAI,KAAK,KAAK,KAAK;QAAE,OAAO,KAAK,GAAG,K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;IAEpE,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;IACvE,MAAM,SAAS,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACxE,OAAO,oBAAoB,GAAG,SAAS,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;AACxE,CAAC","sourcesContent":["import * as ScalarMath from './scalarMath.js';\nimport type { LiquidGlassPanelOptions } from './LiquidGlassPanel.js';\nimport {\n\tPANEL_FOCUS_PERSPECTIVE_MAX_SCALE,\n\tPANEL_FOCUS_MAX_OFFSET,\n\tPANEL_FOCUS_MAX_ADVANCE,\n\tPANEL_FOCUS_MIN_OPACITY,\n\tPANEL_FOCUS_MAX_BLUR\n} from './stageConstants.js';\n\n/** Applies the cubic Hermite smoothstep curve with clamped endpoints. */\nexport function smoothstep(edge0: number, edge1: number, value: number) {\n\tif (edge0 === edge1) return value < edge0 ? 0 : 1;\n\tconst t = ScalarMath.clamp((value - edge0) / (edge1 - edge0), 0, 1);\n\treturn t * t * (3 - 2 * t);\n}\n\n/** Returns the perspective camera distance that maps viewport pixels to world units. */\nexport function getPerspectiveDistance(viewportHeight: number, fov: number) {\n\treturn (viewportHeight * 0.5) / Math.tan(ScalarMath.degToRad(fov * 0.5));\n}\n\n/**\n * Restores the outward screen-space drift that an off-axis panel would receive\n * from the shared perspective while leaving its hover projection panel-local.\n */\nexport function getPanelFocusPerspectiveOffset(\n\tposition: { x: number; y: number },\n\tadvance: number,\n\tcameraDistance: number\n) {\n\tconst safeCameraDistance = Math.max(Number.isFinite(cameraDistance) ? cameraDistance : 1, 1);\n\tconst safeAdvance = Math.max(Number.isFinite(advance) ? advance : 0, 0);\n\tif (safeAdvance <= 0) return { x: 0, y: 0 };\n\n\tconst projectionScale = ScalarMath.clamp(\n\t\tsafeCameraDistance / Math.max(safeCameraDistance - safeAdvance, 1),\n\t\t1,\n\t\tPANEL_FOCUS_PERSPECTIVE_MAX_SCALE\n\t);\n\tconst egressScale = projectionScale - 1;\n\n\treturn {\n\t\tx: position.x * egressScale,\n\t\ty: position.y * egressScale\n\t};\n}\n\n/** Computes the camera-facing travel used to clear panels during close-up zoom. */\nexport function getPanelFocusOffset(\n\toptions: Pick<Required<LiquidGlassPanelOptions>, 'width' | 'height' | 'position'>,\n\tfocus: number,\n\tviewportWidth: number,\n\tviewportHeight: number\n) {\n\tif (focus <= 0.001) return { x: 0, y: 0, z: 0 };\n\tconst edgeDistanceX = Math.max(viewportWidth * 0.5 - options.width * 0.5, 1);\n\tconst edgeDistanceY = Math.max(viewportHeight * 0.5 - options.height * 0.5, 1);\n\tconst normalizedX = options.position.x / edgeDistanceX;\n\tconst normalizedY = options.position.y / edgeDistanceY;\n\tconst direction = getPanelFocusDirection(options, normalizedX, normalizedY);\n\tconst horizontal = Math.abs(direction.x) > Math.abs(direction.y);\n\tconst axisSize = horizontal ? options.width : options.height;\n\tconst travel = ScalarMath.clamp(\n\t\taxisSize * (horizontal ? 0.16 : 0.42),\n\t\thorizontal ? 48 : 18,\n\t\tPANEL_FOCUS_MAX_OFFSET\n\t);\n\tconst easedFocus = getPanelFocusProgress(focus);\n\treturn {\n\t\tx: direction.x * travel * easedFocus,\n\t\ty: direction.y * travel * easedFocus,\n\t\tz: PANEL_FOCUS_MAX_ADVANCE * easedFocus\n\t};\n}\n\n/** Chooses the least disruptive edge toward which a focused panel should travel. */\nexport function getPanelFocusDirection(\n\toptions: Pick<Required<LiquidGlassPanelOptions>, 'width' | 'height' | 'position'>,\n\tnormalizedX: number,\n\tnormalizedY: number\n) {\n\tconst aspect = options.width / Math.max(options.height, 1);\n\tconst absX = Math.abs(normalizedX);\n\tconst absY = Math.abs(normalizedY);\n\tif (aspect >= 2.4 && absY > 0.12) return { x: 0, y: Math.sign(normalizedY) || 1 };\n\tif (absX > absY * 0.8) return { x: Math.sign(normalizedX) || 1, y: 0 };\n\tif (absY > absX * 0.8) return { x: 0, y: Math.sign(normalizedY) || 1 };\n\tif (normalizedX * normalizedX + normalizedY * normalizedY < 0.02)\n\t\treturn { x: 0, y: options.position.y >= 0 ? 1 : -1 };\n\tconst length = Math.hypot(normalizedX, normalizedY);\n\treturn { x: normalizedX / length, y: normalizedY / length };\n}\n\n/** Shared, eased progress for panel motion, blur, opacity and corner controls. */\nexport function getPanelFocusProgress(focus: number) {\n\treturn smoothstep(0.08, 0.96, focus);\n}\n\n/** Inverse of the shared curve, for a timeline that already owns eased progress. */\nexport function getPanelFocusFromProgress(progress: number) {\n\tif (progress <= 0) return 0;\n\tif (progress >= 1) return 1;\n\treturn 0.08 + 0.88 * (0.5 - Math.sin(Math.asin(1 - 2 * progress) / 3));\n}\n\n/** Stacked detail content leaves as one row, without sideways perspective drift. */\nexport function getStackedDetailFocusOffset(focus: number, viewportHeight: number) {\n\treturn { x: 0, y: -viewportHeight * 0.6 * getPanelFocusProgress(focus), z: 0 };\n}\n\n/** Returns panel opacity at a normalized stage UI focus level. */\nexport function getPanelFocusOpacity(focus: number) {\n\treturn ScalarMath.lerp(1, PANEL_FOCUS_MIN_OPACITY, getPanelFocusProgress(focus));\n}\n\n/** Returns CSS content blur at a normalized stage focus level. */\nexport function getPanelFocusBlur(\n\tfocus: number,\n\toptions: Pick<Required<LiquidGlassPanelOptions>, 'width' | 'height'>\n) {\n\tconst shortSide = Math.max(Math.min(options.width, options.height), 1);\n\tconst sizeScale = ScalarMath.clamp(Math.sqrt(shortSide / 240), 0.34, 1);\n\treturn PANEL_FOCUS_MAX_BLUR * sizeScale * getPanelFocusProgress(focus);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rendererState.d.ts","sourceRoot":"","sources":["../../src/stage/rendererState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,OAAO,E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;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,CAS1F"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { Color, Vector4 } from 'three/webgpu';
|
|
2
|
+
// Nested passes need distinct snapshots, but each renderer can reuse that small
|
|
3
|
+
// stack after a pass returns instead of allocating three math objects per pass.
|
|
4
|
+
const statePools = new WeakMap();
|
|
2
5
|
/** A cached uniform attachment must be complete on WebGPU and its WebGL fallback. */
|
|
3
6
|
export function clearFullTarget(renderer) {
|
|
4
7
|
const scissorTest = renderer.getScissorTest();
|
|
@@ -14,23 +17,35 @@ export function clearFullTarget(renderer) {
|
|
|
14
17
|
}
|
|
15
18
|
/** A pass borrows renderer state; failures must not poison the next output band. */
|
|
16
19
|
export function withRendererState(renderer, draw) {
|
|
20
|
+
let pool = statePools.get(renderer);
|
|
21
|
+
if (!pool) {
|
|
22
|
+
pool = { depth: 0, frames: [] };
|
|
23
|
+
statePools.set(renderer, pool);
|
|
24
|
+
}
|
|
25
|
+
const snapshot = pool.frames[pool.depth] ??= { color: new Color(), viewport: new Vector4(), scissor: new Vector4() };
|
|
17
26
|
const canvas = renderer.getCanvasTarget();
|
|
18
27
|
const target = renderer.getRenderTarget();
|
|
19
|
-
const color = renderer.getClearColor(
|
|
28
|
+
const color = renderer.getClearColor(snapshot.color);
|
|
20
29
|
const alpha = renderer.getClearAlpha();
|
|
21
|
-
const viewport = renderer.getViewport(
|
|
22
|
-
const scissor = renderer.getScissor(
|
|
30
|
+
const viewport = renderer.getViewport(snapshot.viewport);
|
|
31
|
+
const scissor = renderer.getScissor(snapshot.scissor);
|
|
23
32
|
const scissorTest = renderer.getScissorTest();
|
|
33
|
+
pool.depth++;
|
|
24
34
|
try {
|
|
25
35
|
return draw();
|
|
26
36
|
}
|
|
27
37
|
finally {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
38
|
+
try {
|
|
39
|
+
renderer.setCanvasTarget(canvas);
|
|
40
|
+
renderer.setRenderTarget(target);
|
|
41
|
+
renderer.setClearColor(color, alpha);
|
|
42
|
+
renderer.setViewport(viewport);
|
|
43
|
+
renderer.setScissor(scissor);
|
|
44
|
+
renderer.setScissorTest(scissorTest);
|
|
45
|
+
}
|
|
46
|
+
finally {
|
|
47
|
+
pool.depth--;
|
|
48
|
+
}
|
|
34
49
|
}
|
|
35
50
|
}
|
|
36
51
|
/** Restore borrowed scene visibility even if a WebGPU pass throws. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rendererState.js","sourceRoot":"","sources":["../../src/stage/rendererState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAkB9C,qFAAqF;AACrF,MAAM,UAAU,eAAe,CAAC,QAA6E;IAC5G,MAAM,WAAW,GAAG,QAAQ,CAAC,cAAc,EAAE,CAAC;IAC9C,IAAI,WAAW;QAAE,QAAQ,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAChD,IAAI,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;IAAC,CAAC;YACjB,CAAC;QAAC,IAAI,WAAW;YAAE,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAAC,CAAC;AAC5D,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,iBAAiB,CAAI,QAA2B,EAAE,IAAa;IAC9E,MAAM,MAAM,GAAG,QAAQ,CAAC,eAAe,EAAE,CAAC;IAC1C,MAAM,MAAM,GAAG,QAAQ,CAAC,eAAe,EAAE,CAAC;IAC1C,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"rendererState.js","sourceRoot":"","sources":["../../src/stage/rendererState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AA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er,\n\t| 'getCanvasTarget'\n\t| 'setCanvasTarget'\n\t| 'getRenderTarget'\n\t| 'setRenderTarget'\n\t| 'getClearColor'\n\t| 'getClearAlpha'\n\t| 'setClearColor'\n\t| 'getViewport'\n\t| 'getScissor'\n\t| 'getScissorTest'\n\t| 'setScissorTest'\n> & { setViewport(value: Vector4): void; setScissor(value: Vector4): void };\n\n// Nested passes need distinct snapshots, but each renderer can reuse that small\n// stack after a pass returns instead of allocating three math objects per pass.\nconst statePools = new WeakMap<RendererStatePort, {\n\tdepth: number;\n\tframes: { color: Color; viewport: Vector4; scissor: Vector4 }[];\n}>();\n\n/** A cached uniform attachment must be complete on WebGPU and its WebGL fallback. */\nexport function clearFullTarget(renderer: Pick<WebGPURenderer, 'getScissorTest' | 'setScissorTest' | 'clear'>) {\n\tconst scissorTest = renderer.getScissorTest();\n\tif (scissorTest) renderer.setScissorTest(false);\n\ttry { renderer.clear(); }\n\tfinally { if (scissorTest) renderer.setScissorTest(true); }\n}\n\n/** A pass borrows renderer state; failures must not poison the next output band. */\nexport function withRendererState<T>(renderer: RendererStatePort, draw: () => T): T {\n\tlet pool = statePools.get(renderer);\n\tif (!pool) {\n\t\tpool = { depth: 0, frames: [] };\n\t\tstatePools.set(renderer, pool);\n\t}\n\tconst snapshot = pool.frames[pool.depth] ??= { color: new Color(), viewport: new Vector4(), scissor: new Vector4() };\n\tconst canvas = renderer.getCanvasTarget();\n\tconst target = renderer.getRenderTarget();\n\tconst color = renderer.getClearColor(snapshot.color);\n\tconst alpha = renderer.getClearAlpha();\n\tconst viewport = renderer.getViewport(snapshot.viewport);\n\tconst scissor = renderer.getScissor(snapshot.scissor);\n\tconst scissorTest = renderer.getScissorTest();\n\tpool.depth++;\n\ttry {\n\t\treturn draw();\n\t} finally {\n\t\ttry {\n\t\t\trenderer.setCanvasTarget(canvas);\n\t\t\trenderer.setRenderTarget(target);\n\t\t\trenderer.setClearColor(color, alpha);\n\t\t\trenderer.setViewport(viewport);\n\t\t\trenderer.setScissor(scissor);\n\t\t\trenderer.setScissorTest(scissorTest);\n\t\t} finally { pool.depth--; }\n\t}\n}\n\n/** Restore borrowed scene visibility even if a WebGPU pass throws. */\nexport function withVisibility<T>(nodes: readonly { visible: boolean }[], draw: () => T): T {\n\tconst visible = nodes.map((node) => node.visible);\n\ttry {\n\t\treturn draw();\n\t} finally {\n\t\tnodes.forEach((node, index) => {\n\t\t\tnode.visible = visible[index];\n\t\t});\n\t}\n}\n"]}
|
|
@@ -57,6 +57,7 @@ export interface StageVisualTestController {
|
|
|
57
57
|
getSpatialCapture(): ReturnType<StageExperience['getSpatialCapture']> | null;
|
|
58
58
|
/** Clip matrix of the bound detail owner, after the retained source is released. */
|
|
59
59
|
getDetailProjection(kind: 'hero' | 'dock'): number[] | null;
|
|
60
|
+
getOutlinePose(): ReturnType<StageExperience['getVisualTestOutlinePose']>;
|
|
60
61
|
releaseSpatialCapture(): void;
|
|
61
62
|
getCatalogOwnership(): ReturnType<import('../catalog/CatalogTransition.js').CatalogTransition['getOwnership']>;
|
|
62
63
|
/** Query-gated fixture registration for ambiguity/teardown tests. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stageVisualTest.d.ts","sourceRoot":"","sources":["../../src/stage/stageVisualTest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,MAAM,WAAW,mBAAmB;IACnC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iCAAiC;IACjD,oBAAoB,EAAE,MAAM,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,wBAAwB,EAAE,OAAO,CAAC;C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AC3D,+DAA+D;IAC/D,oBAAoB,IAAI,gCAAgC,CAAC;IACzD,wEAAwE;IACxE,kBAAkB,IAAI,8BAA8B,CAAC;IACrD,6FAA6F;IAC7F,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,mEAAmE;IACnE,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,4DAA4D;IAC5D,QAAQ,IAAI,mBAAmB,CAAC;CAChC;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,MAAM;QACf,iBAAiB,CAAC,EAAE,yBAAyB,CAAC;KAC9C;CACD;AAED,gGAAgG;AAChG,wBAAgB,qBAAqB,YAEpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stageVisualTest.js","sourceRoot":"","sources":["../../src/stage/stageVisualTest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stageVisualTest.js","sourceRoot":"","sources":["../../src/stage/stageVisualTest.ts"],"names":[],"mappings":"AAoHA,gGAAgG;AAChG,MAAM,UAAU,qBAAqB;IACpC,OAAO,IAAI,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,GAAG,CAAC;AAC9E,CAAC","sourcesContent":["import type { StageVisualTestView, StageZoomFocusState } from './stageTypes.js';\nimport type { StageExperience } from './StageExperience.js';\n\nexport interface StageVisualTestRect {\n\tx: number;\n\ty: number;\n\twidth: number;\n\theight: number;\n}\n\nexport interface StageVisualTestMinimapRenderStats {\n\toverlayCapturePasses: number;\n\tdepthNear: number;\n\tdepthFar: number;\n\tviewportRingInForeground: boolean;\n}\n\nexport type StageVisualTestQuaternion = [number, number, number, number];\n\nexport interface StageVisualTestMinimapOrientation {\n\trest: StageVisualTestQuaternion;\n\tdisplay: StageVisualTestQuaternion;\n\tlive: StageVisualTestQuaternion;\n\tdocked: StageVisualTestQuaternion | null;\n\tdockProgress: number;\n}\n\nexport type StageVisualTestRenderTargetStats = ReturnType<\n\tStageExperience['getVisualTestRenderTargetStats']\n>;\n\nexport interface StageVisualTestVisibilityStats {\n\tstageViewportVisible: boolean;\n\tvisiblePanels: number;\n\tvisibleMinimaps: number;\n\tstageModelRenderPasses: number;\n\tpanelBlurRenderPasses: number;\n\tpanelSceneRenderPasses: number;\n\tminimapSceneRenderPasses: number;\n}\n\n/** Browser-only controls exposed when a stage is opened with `?stage-test=1`. */\nexport interface StageVisualTestController {\n\tgetNavigationTimings(): { dataReady: number; captured: number; restoring: number; bound: number;\n\t\tearly?: { started: number; entered: number; captured: number; prepared: number; firstMotion: number;\n\t\t\tfirstSubmitted: number; motionEnded: number; holdStarted: number; held: number; committed: number;\n\t\t\trevealStarted: number; revealEnded: number; revealed: number } };\n\tcaptureHeroPresentation(): boolean;\n\tgetSpatialCapture(): ReturnType<StageExperience['getSpatialCapture']> | null;\n\t/** Clip matrix of the bound detail owner, after the retained source is released. */\n\tgetDetailProjection(kind: 'hero' | 'dock'): number[] | null;\n\tgetOutlinePose(): ReturnType<StageExperience['getVisualTestOutlinePose']>;\n\treleaseSpatialCapture(): void;\n\tgetCatalogOwnership(): ReturnType<\n\t\timport('../catalog/CatalogTransition.js').CatalogTransition['getOwnership']\n\t>;\n\t/** Query-gated fixture registration for ambiguity/teardown tests. */\n\tregisterCatalogEndpoint(\n\t\taddress: import('../catalog/CatalogEndpointRegistry.js').CatalogEndpointAddress,\n\t\telement: HTMLElement\n\t): () => void;\n\tgetCatalogEndpoints(): ReturnType<\n\t\timport('../catalog/CatalogEndpointRegistry.js').CatalogEndpointRegistry['getSnapshot']\n\t>;\n\tloseDevice(): void;\n\t/** Holds one destination after DOM commit to verify its pre-render visibility gate. */\n\tholdNextPageBinding(): void;\n\treleasePageBinding(): void;\n\tgetCatalogPresentation(): ReturnType<StageExperience['getCatalogPresentation']> | null;\n\t/** Resource ownership diagnostics for catalog navigation acceptance. */\n\tgetCarouselStats(): ReturnType<\n\t\timport('../catalog/CatalogSpatialElementLayer.js').CatalogSpatialElementLayer['getStats']\n\t> | null;\n\tgetCatalogStats(): ReturnType<StageExperience['assets']['getStats']> | null;\n\t/** Read-only current animation, queued-frame and preparation metadata; does not wait for idle. */\n\tgetRenderActivity(): ReturnType<StageExperience['getVisualTestRenderActivity']> | null;\n\t/** Applies a deterministic camera pose and waits until dependent render state settles. */\n\tsetView(view: StageVisualTestView, frames?: number): Promise<void>;\n\t/** Applies an equivalent zoom through the SpaceMouse camera/target dolly path. */\n\tsetSpaceMouseZoom(zoom: number): Promise<void>;\n\t/** Repeats SpaceMouse updates while frames render, leaving the synthetic gesture active. */\n\tdriveSpaceMouseZoom(zoom: number, frames?: number): Promise<void>;\n\t/** Ends a synthetic SpaceMouse gesture and lets dependent render state settle. */\n\tstopSpaceMouse(): Promise<void>;\n\t/** Returns the current rendered minimap bounds in viewport pixels. */\n\tgetMinimapRect(): StageVisualTestRect | null;\n\t/** Returns the current projected surface bounds for a registered panel frame. */\n\tgetPanelRect(frame: HTMLElement): StageVisualTestRect | null;\n\t/** Returns the projected main element bounds in viewport pixels. */\n\tgetModelRect(): StageVisualTestRect | null;\n\t/** Returns the projected 3D element bounds in viewport pixels. */\n\tgetMinimapModelRect(): StageVisualTestRect | null;\n\t/** Returns the visible viewport mask in minimap-local pixels. */\n\tgetMinimapViewportRect(): StageVisualTestRect | null;\n\t/** Returns canonical, displayed, and fully synchronized minimap orientations. */\n\tgetMinimapOrientation(): StageVisualTestMinimapOrientation | null;\n\t/** Returns minimap overlay submissions for performance regression tests. */\n\tgetMinimapRenderStats(): StageVisualTestMinimapRenderStats;\n\t/** Returns target allocation, resize, and warm-up counters. */\n\tgetRenderTargetStats(): StageVisualTestRenderTargetStats;\n\t/** Returns current culling state and submitted render-pass counters. */\n\tgetVisibilityStats(): StageVisualTestVisibilityStats;\n\t/** Restores the exact fitted camera pose without running the user-facing reset animation. */\n\treset(): Promise<void>;\n\t/** Advances the renderer by a fixed number of synthetic frames. */\n\tsettle(frames?: number): Promise<void>;\n\t/** Returns the latest zoom phases reported by the stage. */\n\tgetState(): StageZoomFocusState;\n}\n\ndeclare global {\n\tinterface Window {\n\t\t__stageVisualTest?: StageVisualTestController;\n\t}\n}\n\n/** Returns whether the current page explicitly requested deterministic visual-test controls. */\nexport function isStageVisualTestMode() {\n\treturn new URLSearchParams(window.location.search).get('stage-test') === '1';\n}\n"]}
|