@spatial-elements/core 1.0.0-beta.4 → 1.0.0-beta.5
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/README.md +1 -1
- package/dist/spatial-element/SpatialElementDockController.d.ts +1 -1
- package/dist/spatial-element/SpatialElementDockController.d.ts.map +1 -1
- package/dist/spatial-element/SpatialElementDockController.js +29 -2
- package/dist/spatial-element/SpatialElementDockController.js.map +1 -1
- package/dist/spatial-element/messages.d.ts +2 -0
- package/dist/spatial-element/messages.d.ts.map +1 -1
- package/dist/spatial-element/messages.js +1 -1
- package/dist/spatial-element/messages.js.map +1 -1
- package/dist/spatial-element/spatialTheme.d.ts.map +1 -1
- package/dist/spatial-element/spatialTheme.js +1 -0
- package/dist/spatial-element/spatialTheme.js.map +1 -1
- package/dist/spatial-element/types.d.ts +2 -0
- package/dist/spatial-element/types.d.ts.map +1 -1
- package/dist/spatial-element/types.js.map +1 -1
- package/dist/stage/MinimapController.d.ts +3 -1
- package/dist/stage/MinimapController.d.ts.map +1 -1
- package/dist/stage/MinimapController.js +23 -20
- package/dist/stage/MinimapController.js.map +1 -1
- package/dist/stage/PageBindingController.d.ts +4 -0
- package/dist/stage/PageBindingController.d.ts.map +1 -1
- package/dist/stage/PageBindingController.js +15 -4
- package/dist/stage/PageBindingController.js.map +1 -1
- package/dist/stage/PanelPresentationController.d.ts +1 -0
- package/dist/stage/PanelPresentationController.d.ts.map +1 -1
- package/dist/stage/PanelPresentationController.js +31 -7
- package/dist/stage/PanelPresentationController.js.map +1 -1
- package/dist/stage/SpatialElementInteractionController.d.ts +2 -0
- package/dist/stage/SpatialElementInteractionController.d.ts.map +1 -1
- package/dist/stage/SpatialElementInteractionController.js +23 -5
- package/dist/stage/SpatialElementInteractionController.js.map +1 -1
- package/dist/stage/StageExperience.d.ts +18 -1
- package/dist/stage/StageExperience.d.ts.map +1 -1
- package/dist/stage/StageExperience.js +101 -6
- package/dist/stage/StageExperience.js.map +1 -1
- package/dist/stage/StageFullscreenController.d.ts +17 -0
- package/dist/stage/StageFullscreenController.d.ts.map +1 -0
- package/dist/stage/StageFullscreenController.js +90 -0
- package/dist/stage/StageFullscreenController.js.map +1 -0
- package/dist/stage/StageRenderPipeline.d.ts +6 -0
- package/dist/stage/StageRenderPipeline.d.ts.map +1 -1
- package/dist/stage/StageRenderPipeline.js +40 -8
- package/dist/stage/StageRenderPipeline.js.map +1 -1
- package/dist/stage/VirtualScrollController.d.ts.map +1 -1
- package/dist/stage/VirtualScrollController.js +6 -0
- package/dist/stage/VirtualScrollController.js.map +1 -1
- package/dist/stage/minimap/MinimapProjection.d.ts +7 -0
- package/dist/stage/minimap/MinimapProjection.d.ts.map +1 -1
- package/dist/stage/minimap/MinimapProjection.js +14 -13
- package/dist/stage/minimap/MinimapProjection.js.map +1 -1
- package/dist/stage/panelContext.d.ts +7 -0
- package/dist/stage/panelContext.d.ts.map +1 -1
- package/dist/stage/panelContext.js.map +1 -1
- package/dist/stage/stageDom.d.ts +2 -0
- package/dist/stage/stageDom.d.ts.map +1 -1
- package/dist/stage/stageDom.js +4 -0
- package/dist/stage/stageDom.js.map +1 -1
- package/dist/stage/stageVisualTest.d.ts +2 -0
- package/dist/stage/stageVisualTest.d.ts.map +1 -1
- package/dist/stage/stageVisualTest.js.map +1 -1
- package/package.json +1 -1
|
@@ -82,30 +82,31 @@ export function getMinimapViewportRect(stageCamera, minimapCamera, target, stage
|
|
|
82
82
|
const maxY = Math.max(...projected.map((point) => point.y));
|
|
83
83
|
const centerX = (minX + maxX) * 0.5;
|
|
84
84
|
const centerY = (minY + maxY) * 0.5;
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
const rectWidth = maxX - minX;
|
|
86
|
+
const rectHeight = maxY - minY;
|
|
87
87
|
if (!Number.isFinite(rectWidth) ||
|
|
88
88
|
!Number.isFinite(rectHeight) ||
|
|
89
89
|
rectWidth <= 0 ||
|
|
90
90
|
rectHeight <= 0) {
|
|
91
91
|
return null;
|
|
92
92
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
rectWidth *= minScale;
|
|
96
|
-
rectHeight *= minScale;
|
|
97
|
-
const fitScale = Math.min(width / rectWidth, height / rectHeight, 1);
|
|
98
|
-
rectWidth *= fitScale;
|
|
99
|
-
rectHeight *= fitScale;
|
|
100
|
-
const maxCenterX = Math.max((width - rectWidth) * 0.5, 0);
|
|
101
|
-
const maxCenterY = Math.max((height - rectHeight) * 0.5, 0);
|
|
93
|
+
// Preserve the true footprint, including edges outside the minimap. Fitting
|
|
94
|
+
// it into the panel would falsely crop the model on wide/tall viewports.
|
|
102
95
|
return {
|
|
103
|
-
x:
|
|
104
|
-
y:
|
|
96
|
+
x: centerX,
|
|
97
|
+
y: centerY,
|
|
105
98
|
width: rectWidth,
|
|
106
99
|
height: rectHeight
|
|
107
100
|
};
|
|
108
101
|
}
|
|
102
|
+
/** Intersects the projected view with the panel without scaling or shifting it. */
|
|
103
|
+
export function clipMinimapViewportRect(rect, width, height) {
|
|
104
|
+
const left = THREE.MathUtils.clamp(width * 0.5 + rect.x - rect.width * 0.5, 0, width);
|
|
105
|
+
const right = THREE.MathUtils.clamp(width * 0.5 + rect.x + rect.width * 0.5, 0, width);
|
|
106
|
+
const top = THREE.MathUtils.clamp(height * 0.5 - rect.y - rect.height * 0.5, 0, height);
|
|
107
|
+
const bottom = THREE.MathUtils.clamp(height * 0.5 - rect.y + rect.height * 0.5, 0, height);
|
|
108
|
+
return { left, top, width: right - left, height: bottom - top };
|
|
109
|
+
}
|
|
109
110
|
/** Normalizes a CSS blur radius before it is passed to the WebGPU blur pipeline. */
|
|
110
111
|
export function getMinimapCssBlurRadius(blur) {
|
|
111
112
|
return Math.max(blur, 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MinimapProjection.js","sourceRoot":"","sources":["../../../src/stage/minimap/MinimapProjection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAGtC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,EAAE,SAAS;QAChB,MAAM,EAAE,UAAU;KAClB,CAAC;AACH,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,uBAAuB,CAAC,IAAY;IACnD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AAC1B,CAAC","sourcesContent":["import * as THREE from 'three/webgpu';\nimport type { Object3D } from 'three';\n\nexport { getProjectiveCssMatrix3d } from '../cssProjection.js';\nexport type { CssProjectionPoint, CssProjectionQuad } from '../cssProjection.js';\n\nexport interface MinimapDepthBound {\n\t/** Positive camera-space distance to the bound's center. */\n\tdistance: number;\n\t/** Camera-space radius that must remain inside the clipping range. */\n\tradius: number;\n}\n\n/**\n * Fits a compact clipping range around the panel and live minimap model.\n *\n * The regular panel camera spans thousands of world units. Reusing that range\n * for thumbnail geometry collapses closely layered element surfaces into the\n * same depth values, so a small pointer tilt can make their fragments alternate.\n */\nexport function getMinimapDepthRange(\n\tbounds: readonly MinimapDepthBound[],\n\tguard = 16,\n\tminimumNear = 0.01\n) {\n\tconst safeGuard = Math.max(Number.isFinite(guard) ? guard : 0, 0);\n\tconst safeMinimumNear = Math.max(Number.isFinite(minimumNear) ? minimumNear : 0.01, 0.000001);\n\tlet near = Number.POSITIVE_INFINITY;\n\tlet far = Number.NEGATIVE_INFINITY;\n\n\tbounds.forEach(({ distance, radius }) => {\n\t\tif (!Number.isFinite(distance) || distance <= 0) return;\n\t\tconst safeRadius = Math.max(Number.isFinite(radius) ? radius : 0, 0);\n\t\tnear = Math.min(near, distance - safeRadius);\n\t\tfar = Math.max(far, distance + safeRadius);\n\t});\n\n\tif (!Number.isFinite(near) || !Number.isFinite(far)) {\n\t\treturn { near: safeMinimumNear, far: safeMinimumNear + 1 };\n\t}\n\n\tnear = Math.max(near - safeGuard, safeMinimumNear);\n\tfar = Math.max(far + safeGuard, near + 0.01);\n\treturn { near, far };\n}\n\n/** Returns the FOV that makes panel-local world units match CSS pixels at a distance. */\nexport function getPanelLocalCameraFov(panelHeight: number, distance: number) {\n\treturn THREE.MathUtils.radToDeg(\n\t\t2 * Math.atan(Math.max(panelHeight, 1) / (Math.max(distance, 1) * 2))\n\t);\n}\n\n/** Rectangle, in panel-local pixels, occupied by the main camera's current view. */\nexport interface MinimapViewportRect {\n\tx: number;\n\ty: number;\n\twidth: number;\n\theight: number;\n}\n\n/**\n * Projects the main camera frustum onto the minimap model's target plane.\n *\n * The conversion intentionally passes through model-local coordinates. This keeps\n * panning and orbiting stable even though the minimap layer itself follows a tilted\n * panel in screen space.\n */\nexport function getMinimapViewportRect(\n\tstageCamera: THREE.PerspectiveCamera,\n\tminimapCamera: THREE.PerspectiveCamera,\n\ttarget: THREE.Vector3,\n\tstageModel: Object3D,\n\tminimapSourceRoot: Object3D,\n\tminimapSourceLayer: Object3D,\n\twidth: number,\n\theight: number\n): MinimapViewportRect | null {\n\tconst stageForward = new THREE.Vector3();\n\tstageCamera.getWorldDirection(stageForward);\n\tif (stageForward.lengthSq() < 0.0001) return null;\n\n\tconst targetPlane = new THREE.Plane().setFromNormalAndCoplanarPoint(stageForward, target);\n\tconst stageOrigin = stageCamera.getWorldPosition(new THREE.Vector3());\n\tconst stageRay = new THREE.Ray();\n\tconst hit = new THREE.Vector3();\n\tconst projected: THREE.Vector2[] = [];\n\tconst corners = [\n\t\tnew THREE.Vector3(-1, -1, 0.5),\n\t\tnew THREE.Vector3(1, -1, 0.5),\n\t\tnew THREE.Vector3(1, 1, 0.5),\n\t\tnew THREE.Vector3(-1, 1, 0.5)\n\t];\n\n\tstageCamera.updateMatrixWorld(true);\n\tstageModel.updateWorldMatrix(true, true);\n\tminimapSourceRoot.updateWorldMatrix(true, true);\n\tminimapSourceLayer.updateWorldMatrix(true, true);\n\tminimapCamera.updateMatrixWorld(true);\n\n\tcorners.forEach((corner) => {\n\t\tconst worldPoint = corner.clone().unproject(stageCamera);\n\t\tconst direction = worldPoint.sub(stageOrigin).normalize();\n\t\tstageRay.set(stageOrigin, direction);\n\t\tconst intersection = stageRay.intersectPlane(targetPlane, hit);\n\t\tif (!intersection) return;\n\n\t\tconst modelPoint = stageModel.worldToLocal(intersection.clone());\n\t\tconst minimapPoint = minimapSourceRoot.localToWorld(modelPoint);\n\t\t// The camera is panel-local, so remove the layer's shared screen transform.\n\t\tminimapSourceLayer.worldToLocal(minimapPoint);\n\t\tconst ndc = minimapPoint.project(minimapCamera);\n\t\tif (!Number.isFinite(ndc.x) || !Number.isFinite(ndc.y)) return;\n\t\tprojected.push(new THREE.Vector2(ndc.x * width * 0.5, ndc.y * height * 0.5));\n\t});\n\n\tif (projected.length < 4) return null;\n\tconst minX = Math.min(...projected.map((point) => point.x));\n\tconst maxX = Math.max(...projected.map((point) => point.x));\n\tconst minY = Math.min(...projected.map((point) => point.y));\n\tconst maxY = Math.max(...projected.map((point) => point.y));\n\tconst centerX = (minX + maxX) * 0.5;\n\tconst centerY = (minY + maxY) * 0.5;\n\tlet rectWidth = maxX - minX;\n\tlet rectHeight = maxY - minY;\n\tif (\n\t\t!Number.isFinite(rectWidth) ||\n\t\t!Number.isFinite(rectHeight) ||\n\t\trectWidth <= 0 ||\n\t\trectHeight <= 0\n\t) {\n\t\treturn null;\n\t}\n\n\tconst minSize = 8;\n\tconst minScale = Math.max(minSize / rectWidth, minSize / rectHeight, 1);\n\trectWidth *= minScale;\n\trectHeight *= minScale;\n\tconst fitScale = Math.min(width / rectWidth, height / rectHeight, 1);\n\trectWidth *= fitScale;\n\trectHeight *= fitScale;\n\tconst maxCenterX = Math.max((width - rectWidth) * 0.5, 0);\n\tconst maxCenterY = Math.max((height - rectHeight) * 0.5, 0);\n\n\treturn {\n\t\tx: THREE.MathUtils.clamp(centerX, -maxCenterX, maxCenterX),\n\t\ty: THREE.MathUtils.clamp(centerY, -maxCenterY, maxCenterY),\n\t\twidth: rectWidth,\n\t\theight: rectHeight\n\t};\n}\n\n/** Normalizes a CSS blur radius before it is passed to the WebGPU blur pipeline. */\nexport function getMinimapCssBlurRadius(blur: number) {\n\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AAI,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;IACxF,MAAM,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;IAC3F,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,EAAE,CAAC;AACjE,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,uBAAuB,CAAC,IAAY;IACnD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AAC1B,CAAC","sourcesContent":["import * as THREE from 'three/webgpu';\nimport type { Object3D } from 'three';\n\nexport { getProjectiveCssMatrix3d } from '../cssProjection.js';\nexport type { CssProjectionPoint, CssProjectionQuad } from '../cssProjection.js';\n\nexport interface MinimapDepthBound {\n\t/** Positive camera-space distance to the bound's center. */\n\tdistance: number;\n\t/** Camera-space radius that must remain inside the clipping range. */\n\tradius: number;\n}\n\n/**\n * Fits a compact clipping range around the panel and live minimap model.\n *\n * The regular panel camera spans thousands of world units. Reusing that range\n * for thumbnail geometry collapses closely layered element surfaces into the\n * same depth values, so a small pointer tilt can make their fragments alternate.\n */\nexport function getMinimapDepthRange(\n\tbounds: readonly MinimapDepthBound[],\n\tguard = 16,\n\tminimumNear = 0.01\n) {\n\tconst safeGuard = Math.max(Number.isFinite(guard) ? guard : 0, 0);\n\tconst safeMinimumNear = Math.max(Number.isFinite(minimumNear) ? minimumNear : 0.01, 0.000001);\n\tlet near = Number.POSITIVE_INFINITY;\n\tlet far = Number.NEGATIVE_INFINITY;\n\n\tbounds.forEach(({ distance, radius }) => {\n\t\tif (!Number.isFinite(distance) || distance <= 0) return;\n\t\tconst safeRadius = Math.max(Number.isFinite(radius) ? radius : 0, 0);\n\t\tnear = Math.min(near, distance - safeRadius);\n\t\tfar = Math.max(far, distance + safeRadius);\n\t});\n\n\tif (!Number.isFinite(near) || !Number.isFinite(far)) {\n\t\treturn { near: safeMinimumNear, far: safeMinimumNear + 1 };\n\t}\n\n\tnear = Math.max(near - safeGuard, safeMinimumNear);\n\tfar = Math.max(far + safeGuard, near + 0.01);\n\treturn { near, far };\n}\n\n/** Returns the FOV that makes panel-local world units match CSS pixels at a distance. */\nexport function getPanelLocalCameraFov(panelHeight: number, distance: number) {\n\treturn THREE.MathUtils.radToDeg(\n\t\t2 * Math.atan(Math.max(panelHeight, 1) / (Math.max(distance, 1) * 2))\n\t);\n}\n\n/** Rectangle, in panel-local pixels, occupied by the main camera's current view. */\nexport interface MinimapViewportRect {\n\tx: number;\n\ty: number;\n\twidth: number;\n\theight: number;\n}\n\n/**\n * Projects the main camera frustum onto the minimap model's target plane.\n *\n * The conversion intentionally passes through model-local coordinates. This keeps\n * panning and orbiting stable even though the minimap layer itself follows a tilted\n * panel in screen space.\n */\nexport function getMinimapViewportRect(\n\tstageCamera: THREE.PerspectiveCamera,\n\tminimapCamera: THREE.PerspectiveCamera,\n\ttarget: THREE.Vector3,\n\tstageModel: Object3D,\n\tminimapSourceRoot: Object3D,\n\tminimapSourceLayer: Object3D,\n\twidth: number,\n\theight: number\n): MinimapViewportRect | null {\n\tconst stageForward = new THREE.Vector3();\n\tstageCamera.getWorldDirection(stageForward);\n\tif (stageForward.lengthSq() < 0.0001) return null;\n\n\tconst targetPlane = new THREE.Plane().setFromNormalAndCoplanarPoint(stageForward, target);\n\tconst stageOrigin = stageCamera.getWorldPosition(new THREE.Vector3());\n\tconst stageRay = new THREE.Ray();\n\tconst hit = new THREE.Vector3();\n\tconst projected: THREE.Vector2[] = [];\n\tconst corners = [\n\t\tnew THREE.Vector3(-1, -1, 0.5),\n\t\tnew THREE.Vector3(1, -1, 0.5),\n\t\tnew THREE.Vector3(1, 1, 0.5),\n\t\tnew THREE.Vector3(-1, 1, 0.5)\n\t];\n\n\tstageCamera.updateMatrixWorld(true);\n\tstageModel.updateWorldMatrix(true, true);\n\tminimapSourceRoot.updateWorldMatrix(true, true);\n\tminimapSourceLayer.updateWorldMatrix(true, true);\n\tminimapCamera.updateMatrixWorld(true);\n\n\tcorners.forEach((corner) => {\n\t\tconst worldPoint = corner.clone().unproject(stageCamera);\n\t\tconst direction = worldPoint.sub(stageOrigin).normalize();\n\t\tstageRay.set(stageOrigin, direction);\n\t\tconst intersection = stageRay.intersectPlane(targetPlane, hit);\n\t\tif (!intersection) return;\n\n\t\tconst modelPoint = stageModel.worldToLocal(intersection.clone());\n\t\tconst minimapPoint = minimapSourceRoot.localToWorld(modelPoint);\n\t\t// The camera is panel-local, so remove the layer's shared screen transform.\n\t\tminimapSourceLayer.worldToLocal(minimapPoint);\n\t\tconst ndc = minimapPoint.project(minimapCamera);\n\t\tif (!Number.isFinite(ndc.x) || !Number.isFinite(ndc.y)) return;\n\t\tprojected.push(new THREE.Vector2(ndc.x * width * 0.5, ndc.y * height * 0.5));\n\t});\n\n\tif (projected.length < 4) return null;\n\tconst minX = Math.min(...projected.map((point) => point.x));\n\tconst maxX = Math.max(...projected.map((point) => point.x));\n\tconst minY = Math.min(...projected.map((point) => point.y));\n\tconst maxY = Math.max(...projected.map((point) => point.y));\n\tconst centerX = (minX + maxX) * 0.5;\n\tconst centerY = (minY + maxY) * 0.5;\n\tconst rectWidth = maxX - minX;\n\tconst rectHeight = maxY - minY;\n\tif (\n\t\t!Number.isFinite(rectWidth) ||\n\t\t!Number.isFinite(rectHeight) ||\n\t\trectWidth <= 0 ||\n\t\trectHeight <= 0\n\t) {\n\t\treturn null;\n\t}\n\n\t// Preserve the true footprint, including edges outside the minimap. Fitting\n\t// it into the panel would falsely crop the model on wide/tall viewports.\n\treturn {\n\t\tx: centerX,\n\t\ty: centerY,\n\t\twidth: rectWidth,\n\t\theight: rectHeight\n\t};\n}\n\n/** Intersects the projected view with the panel without scaling or shifting it. */\nexport function clipMinimapViewportRect(rect: MinimapViewportRect, width: number, height: number) {\n\tconst left = THREE.MathUtils.clamp(width * 0.5 + rect.x - rect.width * 0.5, 0, width);\n\tconst right = THREE.MathUtils.clamp(width * 0.5 + rect.x + rect.width * 0.5, 0, width);\n\tconst top = THREE.MathUtils.clamp(height * 0.5 - rect.y - rect.height * 0.5, 0, height);\n\tconst bottom = THREE.MathUtils.clamp(height * 0.5 - rect.y + rect.height * 0.5, 0, height);\n\treturn { left, top, width: right - left, height: bottom - top };\n}\n\n/** Normalizes a CSS blur radius before it is passed to the WebGPU blur pipeline. */\nexport function getMinimapCssBlurRadius(blur: number) {\n\treturn Math.max(blur, 0);\n}\n"]}
|
|
@@ -71,8 +71,15 @@ export interface StageViewportRegistration {
|
|
|
71
71
|
export interface StageContext {
|
|
72
72
|
prefetchSpatialElement?(stage: import('../spatial-element/spatialElementScene.js').SpatialElementScene): void;
|
|
73
73
|
registerPanel(panel: StagePanelRegistration): () => void;
|
|
74
|
+
/** Refresh appearance from registered getters without rebinding the page or its camera. */
|
|
75
|
+
updatePanelAppearance?(): void;
|
|
74
76
|
registerViewport(viewport: StageViewportRegistration): () => void;
|
|
75
77
|
/** Restores the element camera to its initial fitted pose. */
|
|
76
78
|
resetView(): void;
|
|
79
|
+
/** True for both native fullscreen and its viewport fallback. */
|
|
80
|
+
isFullscreen?(): boolean;
|
|
81
|
+
/** Current camera zoom focus, from the fitted detail view (0) to close-up (1). */
|
|
82
|
+
getZoomFocus?(): number;
|
|
83
|
+
setFullscreen?(fullscreen: boolean): void;
|
|
77
84
|
}
|
|
78
85
|
//# sourceMappingURL=panelContext.d.ts.map
|
|
@@ -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,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AAgB,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\tregisterViewport(viewport: StageViewportRegistration): () => void;\n\t/** Restores the element camera to its initial fitted pose. */\n\tresetView(): 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\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"]}
|
package/dist/stage/stageDom.d.ts
CHANGED
|
@@ -7,4 +7,6 @@ export declare function getStagePositionFromRect(rect: Pick<DOMRect, 'height' |
|
|
|
7
7
|
};
|
|
8
8
|
/** Returns whether a rectangle intersects the viewport plus an optional preload margin. */
|
|
9
9
|
export declare function isViewportRectVisible(rect: Pick<DOMRect, 'bottom' | 'left' | 'right' | 'top'>, viewportWidth: number, viewportHeight: number, margin?: number): boolean;
|
|
10
|
+
/** Resolves a sticky panel inside its document-space containing block. */
|
|
11
|
+
export declare function getStickyPanelTop(documentTop: number, height: number, boundaryBottom: number, inset: number, scrollY: number): number;
|
|
10
12
|
//# sourceMappingURL=stageDom.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stageDom.d.ts","sourceRoot":"","sources":["../../src/stage/stageDom.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,wBAAgB,eAAe,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,WAOzD;AAED,yFAAyF;AACzF,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,CAAC;;;EAKhG;AAED,2FAA2F;AAC3F,wBAAgB,qBAAqB,CACpC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC,EACxD,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,MAAM,EACtB,MAAM,SAAI,WASV"}
|
|
1
|
+
{"version":3,"file":"stageDom.d.ts","sourceRoot":"","sources":["../../src/stage/stageDom.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,wBAAgB,eAAe,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,WAOzD;AAED,yFAAyF;AACzF,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,CAAC;;;EAKhG;AAED,2FAA2F;AAC3F,wBAAgB,qBAAqB,CACpC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC,EACxD,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,MAAM,EACtB,MAAM,SAAI,WASV;AAED,0EAA0E;AAC1E,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,UAE5H"}
|
package/dist/stage/stageDom.js
CHANGED
|
@@ -19,4 +19,8 @@ export function isViewportRectVisible(rect, viewportWidth, viewportHeight, margi
|
|
|
19
19
|
rect.bottom >= -safeMargin &&
|
|
20
20
|
rect.top <= viewportHeight + safeMargin);
|
|
21
21
|
}
|
|
22
|
+
/** Resolves a sticky panel inside its document-space containing block. */
|
|
23
|
+
export function getStickyPanelTop(documentTop, height, boundaryBottom, inset, scrollY) {
|
|
24
|
+
return Math.min(Math.max(documentTop - scrollY, inset), boundaryBottom - scrollY - height);
|
|
25
|
+
}
|
|
22
26
|
//# sourceMappingURL=stageDom.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stageDom.js","sourceRoot":"","sources":["../../src/stage/stageDom.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,MAAM,UAAU,eAAe,CAAC,MAA0B;IACzD,IAAI,CAAC,CAAC,MAAM,YAAY,OAAO,CAAC;QAAE,OAAO,KAAK,CAAC;IAC/C,OAAO,OAAO,CACb,MAAM,CAAC,OAAO,CACb,sIAAsI,CACtI,CACD,CAAC;AACH,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,wBAAwB,CAAC,IAAwD;IAChG,OAAO;QACN,CAAC,EAAE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,GAAG,GAAG,GAAG,MAAM,CAAC,UAAU,GAAG,GAAG;QACzD,CAAC,EAAE,MAAM,CAAC,WAAW,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;KAC5D,CAAC;AACH,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,qBAAqB,CACpC,IAAwD,EACxD,aAAqB,EACrB,cAAsB,EACtB,MAAM,GAAG,CAAC;IAEV,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACrE,OAAO,CACN,IAAI,CAAC,KAAK,IAAI,CAAC,UAAU;QACzB,IAAI,CAAC,IAAI,IAAI,aAAa,GAAG,UAAU;QACvC,IAAI,CAAC,MAAM,IAAI,CAAC,UAAU;QAC1B,IAAI,CAAC,GAAG,IAAI,cAAc,GAAG,UAAU,CACvC,CAAC;AACH,CAAC","sourcesContent":["/** Returns true when a pointer event belongs to interactive stage UI instead of the model. */\nexport function isStageUiTarget(target: EventTarget | null) {\n\tif (!(target instanceof Element)) return false;\n\treturn Boolean(\n\t\ttarget.closest(\n\t\t\t'[data-stage-panel-content], [data-stage-panel-css-surface], [data-stage-panel-fallback], button, a, input, textarea, select, summary'\n\t\t)\n\t);\n}\n\n/** Converts a DOM rectangle center into the stage's centered, y-up coordinate system. */\nexport function getStagePositionFromRect(rect: Pick<DOMRect, 'height' | 'left' | 'top' | 'width'>) {\n\treturn {\n\t\tx: rect.left + rect.width * 0.5 - window.innerWidth * 0.5,\n\t\ty: window.innerHeight * 0.5 - (rect.top + rect.height * 0.5)\n\t};\n}\n\n/** Returns whether a rectangle intersects the viewport plus an optional preload margin. */\nexport function isViewportRectVisible(\n\trect: Pick<DOMRect, 'bottom' | 'left' | 'right' | 'top'>,\n\tviewportWidth: number,\n\tviewportHeight: number,\n\tmargin = 0\n) {\n\tconst safeMargin = Math.max(Number.isFinite(margin) ? margin : 0, 0);\n\treturn (\n\t\trect.right >= -safeMargin &&\n\t\trect.left <= viewportWidth + safeMargin &&\n\t\trect.bottom >= -safeMargin &&\n\t\trect.top <= viewportHeight + safeMargin\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"stageDom.js","sourceRoot":"","sources":["../../src/stage/stageDom.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,MAAM,UAAU,eAAe,CAAC,MAA0B;IACzD,IAAI,CAAC,CAAC,MAAM,YAAY,OAAO,CAAC;QAAE,OAAO,KAAK,CAAC;IAC/C,OAAO,OAAO,CACb,MAAM,CAAC,OAAO,CACb,sIAAsI,CACtI,CACD,CAAC;AACH,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,wBAAwB,CAAC,IAAwD;IAChG,OAAO;QACN,CAAC,EAAE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,GAAG,GAAG,GAAG,MAAM,CAAC,UAAU,GAAG,GAAG;QACzD,CAAC,EAAE,MAAM,CAAC,WAAW,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;KAC5D,CAAC;AACH,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,qBAAqB,CACpC,IAAwD,EACxD,aAAqB,EACrB,cAAsB,EACtB,MAAM,GAAG,CAAC;IAEV,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACrE,OAAO,CACN,IAAI,CAAC,KAAK,IAAI,CAAC,UAAU;QACzB,IAAI,CAAC,IAAI,IAAI,aAAa,GAAG,UAAU;QACvC,IAAI,CAAC,MAAM,IAAI,CAAC,UAAU;QAC1B,IAAI,CAAC,GAAG,IAAI,cAAc,GAAG,UAAU,CACvC,CAAC;AACH,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,iBAAiB,CAAC,WAAmB,EAAE,MAAc,EAAE,cAAsB,EAAE,KAAa,EAAE,OAAe;IAC5H,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,GAAG,OAAO,EAAE,KAAK,CAAC,EAAE,cAAc,GAAG,OAAO,GAAG,MAAM,CAAC,CAAC;AAC5F,CAAC","sourcesContent":["/** Returns true when a pointer event belongs to interactive stage UI instead of the model. */\nexport function isStageUiTarget(target: EventTarget | null) {\n\tif (!(target instanceof Element)) return false;\n\treturn Boolean(\n\t\ttarget.closest(\n\t\t\t'[data-stage-panel-content], [data-stage-panel-css-surface], [data-stage-panel-fallback], button, a, input, textarea, select, summary'\n\t\t)\n\t);\n}\n\n/** Converts a DOM rectangle center into the stage's centered, y-up coordinate system. */\nexport function getStagePositionFromRect(rect: Pick<DOMRect, 'height' | 'left' | 'top' | 'width'>) {\n\treturn {\n\t\tx: rect.left + rect.width * 0.5 - window.innerWidth * 0.5,\n\t\ty: window.innerHeight * 0.5 - (rect.top + rect.height * 0.5)\n\t};\n}\n\n/** Returns whether a rectangle intersects the viewport plus an optional preload margin. */\nexport function isViewportRectVisible(\n\trect: Pick<DOMRect, 'bottom' | 'left' | 'right' | 'top'>,\n\tviewportWidth: number,\n\tviewportHeight: number,\n\tmargin = 0\n) {\n\tconst safeMargin = Math.max(Number.isFinite(margin) ? margin : 0, 0);\n\treturn (\n\t\trect.right >= -safeMargin &&\n\t\trect.left <= viewportWidth + safeMargin &&\n\t\trect.bottom >= -safeMargin &&\n\t\trect.top <= viewportHeight + safeMargin\n\t);\n}\n\n/** Resolves a sticky panel inside its document-space containing block. */\nexport function getStickyPanelTop(documentTop: number, height: number, boundaryBottom: number, inset: number, scrollY: number) {\n\treturn Math.min(Math.max(documentTop - scrollY, inset), boundaryBottom - scrollY - height);\n}\n"]}
|
|
@@ -69,6 +69,8 @@ export interface StageVisualTestController {
|
|
|
69
69
|
getModelRect(): StageVisualTestRect | null;
|
|
70
70
|
/** Returns the projected 3D element bounds in viewport pixels. */
|
|
71
71
|
getMinimapModelRect(): StageVisualTestRect | null;
|
|
72
|
+
/** Returns the visible viewport mask in minimap-local pixels. */
|
|
73
|
+
getMinimapViewportRect(): StageVisualTestRect | null;
|
|
72
74
|
/** Returns canonical, displayed, and fully synchronized minimap orientations. */
|
|
73
75
|
getMinimapOrientation(): StageVisualTestMinimapOrientation | null;
|
|
74
76
|
/** Returns minimap overlay submissions for performance regression 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;CAClC;AAED,MAAM,MAAM,yBAAyB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAEzE,MAAM,WAAW,iCAAiC;IACjD,IAAI,EAAE,yBAAyB,CAAC;IAChC,OAAO,EAAE,yBAAyB,CAAC;IACnC,IAAI,EAAE,yBAAyB,CAAC;IAChC,MAAM,EAAE,yBAAyB,GAAG,IAAI,CAAC;IACzC,YAAY,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,gCAAgC,GAAG,UAAU,CACxD,eAAe,CA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Root":"","sources":["../../src/stage/stageVisualTest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stageVisualTest.js","sourceRoot":"","sources":["../../src/stage/stageVisualTest.ts"],"names":[],"mappings":"AA4GA,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\tcaptureHeroPresentation(): boolean;\n\tgetSpatialCapture(): ReturnType<StageExperience['getSpatialCapture']> | null;\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/** 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"]}
|