@spatial-elements/core 1.0.0-beta.10 → 1.0.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/catalog/CatalogEndpointRegistry.d.ts +2 -2
- package/dist/catalog/CatalogEndpointRegistry.d.ts.map +1 -1
- package/dist/catalog/CatalogEndpointRegistry.js.map +1 -1
- package/dist/catalog/CatalogModelOutline.d.ts.map +1 -1
- package/dist/catalog/CatalogModelOutline.js +4 -3
- package/dist/catalog/CatalogModelOutline.js.map +1 -1
- package/dist/catalog/CatalogTransition.d.ts +1 -1
- package/dist/catalog/CatalogTransition.js +1 -1
- package/dist/catalog/CatalogTransition.js.map +1 -1
- package/dist/catalog/catalogRecipes.js +2 -2
- package/dist/catalog/catalogRecipes.js.map +1 -1
- package/dist/catalog/listDeviceOrientation.d.ts +3 -0
- package/dist/catalog/listDeviceOrientation.d.ts.map +1 -1
- package/dist/catalog/listDeviceOrientation.js +15 -4
- package/dist/catalog/listDeviceOrientation.js.map +1 -1
- package/dist/spatial-element/SpatialElementDockController.d.ts +1 -1
- package/dist/spatial-element/SpatialElementPaneController.js +1 -1
- package/dist/spatial-element/SpatialElementPaneController.js.map +1 -1
- package/dist/spatial-element/messages.d.ts +12 -0
- package/dist/spatial-element/messages.d.ts.map +1 -1
- package/dist/spatial-element/messages.js +12 -0
- package/dist/spatial-element/messages.js.map +1 -1
- package/dist/stage/LiquidGlassPanel.d.ts.map +1 -1
- package/dist/stage/LiquidGlassPanel.js +5 -2
- package/dist/stage/LiquidGlassPanel.js.map +1 -1
- package/dist/stage/MinimapController.d.ts.map +1 -1
- package/dist/stage/MinimapController.js +5 -5
- package/dist/stage/MinimapController.js.map +1 -1
- package/dist/stage/SpaceMouseAdapter.d.ts +10 -2
- package/dist/stage/SpaceMouseAdapter.d.ts.map +1 -1
- package/dist/stage/SpaceMouseAdapter.js +50 -8
- package/dist/stage/SpaceMouseAdapter.js.map +1 -1
- package/dist/stage/SpatialElementInteractionController.d.ts +5 -1
- package/dist/stage/SpatialElementInteractionController.d.ts.map +1 -1
- package/dist/stage/SpatialElementInteractionController.js +64 -32
- package/dist/stage/SpatialElementInteractionController.js.map +1 -1
- package/dist/stage/StageExperience.d.ts +3 -1
- package/dist/stage/StageExperience.d.ts.map +1 -1
- package/dist/stage/StageExperience.js +23 -7
- package/dist/stage/StageExperience.js.map +1 -1
- package/dist/stage/StageRenderPipeline.js +1 -2
- package/dist/stage/StageRenderPipeline.js.map +1 -1
- package/dist/stage/minimap/MinimapState.d.ts +3 -3
- package/dist/stage/minimap/MinimapState.d.ts.map +1 -1
- package/dist/stage/minimap/MinimapState.js.map +1 -1
- package/dist/stage/panelContext.d.ts +6 -0
- package/dist/stage/panelContext.d.ts.map +1 -1
- package/dist/stage/panelContext.js.map +1 -1
- package/dist/stage/panelFocusMath.d.ts +34 -0
- package/dist/stage/panelFocusMath.d.ts.map +1 -0
- package/dist/stage/panelFocusMath.js +79 -0
- package/dist/stage/panelFocusMath.js.map +1 -0
- package/dist/stage/scalarMath.d.ts +6 -0
- package/dist/stage/scalarMath.d.ts.map +1 -0
- package/dist/stage/scalarMath.js +6 -0
- package/dist/stage/scalarMath.js.map +1 -0
- package/dist/stage/spaceMousePermission.d.ts +11 -0
- package/dist/stage/spaceMousePermission.d.ts.map +1 -0
- package/dist/stage/spaceMousePermission.js +63 -0
- package/dist/stage/spaceMousePermission.js.map +1 -0
- package/dist/stage/spaceMousePlatform.d.ts +12 -0
- package/dist/stage/spaceMousePlatform.d.ts.map +1 -0
- package/dist/stage/spaceMousePlatform.js +13 -0
- package/dist/stage/spaceMousePlatform.js.map +1 -0
- package/dist/stage/stageConstants.d.ts.map +1 -1
- package/dist/stage/stageConstants.js +4 -4
- package/dist/stage/stageConstants.js.map +1 -1
- package/dist/stage/stageMath.d.ts +1 -29
- package/dist/stage/stageMath.d.ts.map +1 -1
- package/dist/stage/stageMath.js +24 -97
- package/dist/stage/stageMath.js.map +1 -1
- package/dist/stage/stageTypes.d.ts +2 -1
- package/dist/stage/stageTypes.d.ts.map +1 -1
- package/dist/stage/stageTypes.js.map +1 -1
- package/dist/stage/webgpuSupport.d.ts +3 -0
- package/dist/stage/webgpuSupport.d.ts.map +1 -0
- package/dist/stage/webgpuSupport.js +14 -0
- package/dist/stage/webgpuSupport.js.map +1 -0
- package/logo.svg +90 -53
- package/package.json +1 -1
|
@@ -74,10 +74,10 @@ export interface StageMinimapState {
|
|
|
74
74
|
blurGuard: number;
|
|
75
75
|
captureExtentWidth: number;
|
|
76
76
|
captureExtentHeight: number;
|
|
77
|
-
overlayRing: THREE.Mesh<THREE.BufferGeometry, THREE.
|
|
77
|
+
overlayRing: THREE.Mesh<THREE.BufferGeometry, THREE.MeshBasicNodeMaterial>;
|
|
78
78
|
/** Stable depth variants avoid material recompilation on each zoom boundary. */
|
|
79
|
-
ringRestMaterial: THREE.
|
|
80
|
-
ringForegroundMaterial: THREE.
|
|
79
|
+
ringRestMaterial: THREE.MeshBasicNodeMaterial;
|
|
80
|
+
ringForegroundMaterial: THREE.MeshBasicNodeMaterial;
|
|
81
81
|
overlayProgress: number;
|
|
82
82
|
overlayGeometryWidth: number;
|
|
83
83
|
overlayGeometryHeight: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MinimapState.d.ts","sourceRoot":"","sources":["../../../src/stage/minimap/MinimapState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5D,MAAM,MAAM,2BAA2B,GAAG,QAAQ,CAAC,IAAI,CAAC,mBAAmB,EAAE,YAAY,C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oBAAoB,EAAE,OAAO,CAAC;IAC9B,mFAAmF;IACnF,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,6EAA6E;IAC7E,eAAe,EAAE,OAAO,CAAC;IACzB,OAAO,EAAE,2BAA2B,CAAC;CACrC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MinimapState.js","sourceRoot":"","sources":["../../../src/stage/minimap/MinimapState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC","sourcesContent":["import * as THREE from 'three/webgpu';\nimport type { Object3D } from 'three';\nimport type { MinimapMaterialOpacityState } from './MinimapModel.js';\nimport type { MinimapBlurPipeline } from '../MinimapBlurPipeline.js';\nimport type { StageMinimapOptions } from '../stageTypes.js';\n\nexport type ResolvedStageMinimapOptions = Required<Omit<StageMinimapOptions, 'dockedView'>>;\n\nexport type { MinimapMaterialOpacityState } from './MinimapModel.js';\n\n/**\n * Owns all resources and animated values for one panel-backed element minimap.\n *\n * The live display model stays separate from the isolated blur capture so pointer\n * interaction cannot change the pixels used by the overlay.\n */\nexport interface StageMinimapState {\n\tpanelIndex: number;\n\tscreenCamera: THREE.PerspectiveCamera;\n\tcamera: THREE.PerspectiveCamera;\n\tcaptureCamera: THREE.PerspectiveCamera;\n\tmodel: Object3D;\n\tsourceRoot: Object3D;\n\tdisplayModel: Object3D;\n\t/** Canonical element root within the minimap's centering/orientation hierarchy. */\n\tspatialElementRoot: Object3D;\n\t/** Per-mesh bound points expressed in the centered display model's local coordinates. */\n\tmodelBoundsPoints: THREE.Vector3[];\n\t/** Camera-relative element pose captured from the fitted initial stage view. */\n\trestQuaternion: THREE.Quaternion;\n\t/** Optional camera-relative element pose authored for the docked presentation. */\n\tdockedQuaternion?: THREE.Quaternion;\n\tdisplayMaterials: MinimapMaterialOpacityState[];\n\tdisplayOpacity: number;\n\tlayer: THREE.Group;\n\tmodelRadius: number;\n\tbaseWidth: number;\n\tbaseHeight: number;\n\tbaseRadius: number;\n\tcurrentWidth: number;\n\tcurrentHeight: number;\n\tsourceScene: THREE.Scene;\n\tcaptureLayer: THREE.Group;\n\tcontextTarget: THREE.RenderTarget;\n\tdisplayTarget: THREE.RenderTarget;\n\tpanelTarget: THREE.RenderTarget;\n\tblurPipeline: MinimapBlurPipeline;\n\tdisplayMaterial: THREE.NodeMaterial;\n\tdisplayQuad: THREE.QuadMesh;\n\toverlayComposite: THREE.Mesh<THREE.BufferGeometry, THREE.NodeMaterial>;\n\t/** Live source used to composite the glass result over the active stage capture. */\n\tstageCaptureTexture: { value: THREE.Texture };\n\t/** Matching preallocated blur capture used by frosted minimap surfaces. */\n\tstageBlurTexture: { value: THREE.Texture };\n\toverlayVisibility: { value: number };\n\toverlayPanelSize: { value: THREE.Vector2 };\n\toverlayViewportCenter: { value: THREE.Vector2 };\n\toverlayViewportHalfSize: { value: THREE.Vector2 };\n\toverlayViewportRadii: { value: THREE.Vector4 };\n\tcaptureUvScale: { value: THREE.Vector2 };\n\tblurGuard: number;\n\tcaptureExtentWidth: number;\n\tcaptureExtentHeight: number;\n\toverlayRing: THREE.Mesh<THREE.BufferGeometry, THREE.
|
|
1
|
+
{"version":3,"file":"MinimapState.js","sourceRoot":"","sources":["../../../src/stage/minimap/MinimapState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC","sourcesContent":["import * as THREE from 'three/webgpu';\nimport type { Object3D } from 'three';\nimport type { MinimapMaterialOpacityState } from './MinimapModel.js';\nimport type { MinimapBlurPipeline } from '../MinimapBlurPipeline.js';\nimport type { StageMinimapOptions } from '../stageTypes.js';\n\nexport type ResolvedStageMinimapOptions = Required<Omit<StageMinimapOptions, 'dockedView'>>;\n\nexport type { MinimapMaterialOpacityState } from './MinimapModel.js';\n\n/**\n * Owns all resources and animated values for one panel-backed element minimap.\n *\n * The live display model stays separate from the isolated blur capture so pointer\n * interaction cannot change the pixels used by the overlay.\n */\nexport interface StageMinimapState {\n\tpanelIndex: number;\n\tscreenCamera: THREE.PerspectiveCamera;\n\tcamera: THREE.PerspectiveCamera;\n\tcaptureCamera: THREE.PerspectiveCamera;\n\tmodel: Object3D;\n\tsourceRoot: Object3D;\n\tdisplayModel: Object3D;\n\t/** Canonical element root within the minimap's centering/orientation hierarchy. */\n\tspatialElementRoot: Object3D;\n\t/** Per-mesh bound points expressed in the centered display model's local coordinates. */\n\tmodelBoundsPoints: THREE.Vector3[];\n\t/** Camera-relative element pose captured from the fitted initial stage view. */\n\trestQuaternion: THREE.Quaternion;\n\t/** Optional camera-relative element pose authored for the docked presentation. */\n\tdockedQuaternion?: THREE.Quaternion;\n\tdisplayMaterials: MinimapMaterialOpacityState[];\n\tdisplayOpacity: number;\n\tlayer: THREE.Group;\n\tmodelRadius: number;\n\tbaseWidth: number;\n\tbaseHeight: number;\n\tbaseRadius: number;\n\tcurrentWidth: number;\n\tcurrentHeight: number;\n\tsourceScene: THREE.Scene;\n\tcaptureLayer: THREE.Group;\n\tcontextTarget: THREE.RenderTarget;\n\tdisplayTarget: THREE.RenderTarget;\n\tpanelTarget: THREE.RenderTarget;\n\tblurPipeline: MinimapBlurPipeline;\n\tdisplayMaterial: THREE.NodeMaterial;\n\tdisplayQuad: THREE.QuadMesh;\n\toverlayComposite: THREE.Mesh<THREE.BufferGeometry, THREE.NodeMaterial>;\n\t/** Live source used to composite the glass result over the active stage capture. */\n\tstageCaptureTexture: { value: THREE.Texture };\n\t/** Matching preallocated blur capture used by frosted minimap surfaces. */\n\tstageBlurTexture: { value: THREE.Texture };\n\toverlayVisibility: { value: number };\n\toverlayPanelSize: { value: THREE.Vector2 };\n\toverlayViewportCenter: { value: THREE.Vector2 };\n\toverlayViewportHalfSize: { value: THREE.Vector2 };\n\toverlayViewportRadii: { value: THREE.Vector4 };\n\tcaptureUvScale: { value: THREE.Vector2 };\n\tblurGuard: number;\n\tcaptureExtentWidth: number;\n\tcaptureExtentHeight: number;\n\toverlayRing: THREE.Mesh<THREE.BufferGeometry, THREE.MeshBasicNodeMaterial>;\n\t/** Stable depth variants avoid material recompilation on each zoom boundary. */\n\tringRestMaterial: THREE.MeshBasicNodeMaterial;\n\tringForegroundMaterial: THREE.MeshBasicNodeMaterial;\n\toverlayProgress: number;\n\toverlayGeometryWidth: number;\n\toverlayGeometryHeight: number;\n\toverlayGeometryDirty: boolean;\n\t/** Reusable numeric snapshot used to invalidate the expensive overlay captures. */\n\toverlayCaptureState: number[];\n\toverlayCaptureDirty: boolean;\n\toverlayCaptureValid: boolean;\n\tpanelCaptureState: number[];\n\tpanelCaptureDirty: boolean;\n\tpanelCaptureValid: boolean;\n\tpointerReveal: number;\n\t/** Whether the panel-backed minimap intersects the viewport preload area. */\n\tviewportVisible: boolean;\n\toptions: ResolvedStageMinimapOptions;\n}\n"]}
|
|
@@ -78,6 +78,12 @@ export interface StageContext {
|
|
|
78
78
|
getLayoutMetrics?(mode?: 'stable' | 'visible'): import('../spatial-element/responsiveLayout.js').ResponsiveLayoutInput | undefined;
|
|
79
79
|
/** Reactive in framework adapters; false during SSR and until the GPU has painted. */
|
|
80
80
|
isEnhanced?(): boolean;
|
|
81
|
+
/** Local-driver integration is opt-in and may trigger a browser permission prompt. */
|
|
82
|
+
setSpaceMouseEnabled?(enabled: boolean): void;
|
|
83
|
+
isSpaceMouseEnabled?(): boolean;
|
|
84
|
+
isSpaceMouseDesktop?(): boolean;
|
|
85
|
+
getSpaceMouseState?(): import('./spaceMousePlatform.js').SpaceMouseState;
|
|
86
|
+
getSpaceMousePermission?(): import('./spaceMousePermission.js').SpaceMousePermission;
|
|
81
87
|
prefetchSpatialElement?(stage: import('../spatial-element/spatialElementScene.js').SpatialElementScene): void;
|
|
82
88
|
registerPanel(panel: StagePanelRegistration): () => void;
|
|
83
89
|
/** Refresh appearance from registered getters without rebinding the page or its camera. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panelContext.d.ts","sourceRoot":"","sources":["../../src/stage/panelContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,KAAK,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEjF,eAAO,MAAM,iBAAiB,eAAkB,CAAC;AAEjD,uFAAuF;AACvF,eAAO,MAAM,wBAAwB,uBAAuB,CAAC;AAE7D,+FAA+F;AAC/F,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,CAC1C,GAAG;IACH,0EAA0E;IAC1E,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC5B,CAAC;AAIF,MAAM,WAAW,wBAAwB;IACxC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4FAA4F;IAC5F,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kFAAkF;IAClF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,yEAAyE;IACzE,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,uFAAuF;IACvF,UAAU,CAAC,EAAE,sB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AO,GAAG,IAAI,CAAC;IAC9C,mBAAmB,CAAC,IAAI,OAAO,CAAC;IAChC,mBAAmB,CAAC,IAAI,OAAO,CAAC;IAChC,kBAAkB,CAAC,IAAI,OAAO,yBAAyB,EAAE,eAAe,CAAC;IACzE,uBAAuB,CAAC,IAAI,OAAO,2BAA2B,EAAE,oBAAoB,CAAC;IACrF,sBAAsB,CAAC,CAAC,KAAK,EAAE,OAAO,2CAA2C,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAC9G,aAAa,CAAC,KAAK,EAAE,sBAAsB,GAAG,MAAM,IAAI,CAAC;IACzD,2FAA2F;IAC3F,qBAAqB,CAAC,IAAI,IAAI,CAAC;IAC/B,gBAAgB,CAAC,QAAQ,EAAE,yBAAyB,GAAG,MAAM,IAAI,CAAC;IAClE,8DAA8D;IAC9D,SAAS,IAAI,IAAI,CAAC;IAClB,iEAAiE;IACjE,YAAY,CAAC,IAAI,OAAO,CAAC;IACzB,kFAAkF;IAClF,YAAY,CAAC,IAAI,MAAM,CAAC;IACxB,8EAA8E;IAC9E,cAAc,CAAC,IAAI,MAAM,CAAC;IAC1B,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\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\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\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\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\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"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { LiquidGlassPanelOptions } from './LiquidGlassPanel.js';
|
|
2
|
+
/** Applies the cubic Hermite smoothstep curve with clamped endpoints. */
|
|
3
|
+
export declare function smoothstep(edge0: number, edge1: number, value: number): number;
|
|
4
|
+
/** Returns the perspective camera distance that maps viewport pixels to world units. */
|
|
5
|
+
export declare function getPerspectiveDistance(viewportHeight: number, fov: number): number;
|
|
6
|
+
/**
|
|
7
|
+
* Restores the outward screen-space drift that an off-axis panel would receive
|
|
8
|
+
* from the shared perspective while leaving its hover projection panel-local.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getPanelFocusPerspectiveOffset(position: {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
}, advance: number, cameraDistance: number): {
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
};
|
|
17
|
+
/** Computes the camera-facing travel used to clear panels during close-up zoom. */
|
|
18
|
+
export declare function getPanelFocusOffset(options: Pick<Required<LiquidGlassPanelOptions>, 'width' | 'height' | 'position'>, focus: number, viewportWidth: number, viewportHeight: number): {
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
z: number;
|
|
22
|
+
};
|
|
23
|
+
/** Chooses the least disruptive edge toward which a focused panel should travel. */
|
|
24
|
+
export declare function getPanelFocusDirection(options: Pick<Required<LiquidGlassPanelOptions>, 'width' | 'height' | 'position'>, normalizedX: number, normalizedY: number): {
|
|
25
|
+
x: number;
|
|
26
|
+
y: number;
|
|
27
|
+
};
|
|
28
|
+
/** Shared, eased progress for panel motion, blur, opacity and corner controls. */
|
|
29
|
+
export declare function getPanelFocusProgress(focus: number): number;
|
|
30
|
+
/** Returns panel opacity at a normalized stage UI focus level. */
|
|
31
|
+
export declare function getPanelFocusOpacity(focus: number): number;
|
|
32
|
+
/** Returns CSS content blur at a normalized stage focus level. */
|
|
33
|
+
export declare function getPanelFocusBlur(focus: number, options: Pick<Required<LiquidGlassPanelOptions>, 'width' | 'height'>): number;
|
|
34
|
+
//# sourceMappingURL=panelFocusMath.d.ts.map
|
|
@@ -0,0 +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;;;EAYnB;AAED,kFAAkF;AAClF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,UAElD;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"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as ScalarMath from './scalarMath.js';
|
|
2
|
+
import { PANEL_FOCUS_PERSPECTIVE_MAX_SCALE, PANEL_FOCUS_MAX_OFFSET, PANEL_FOCUS_MAX_ADVANCE, PANEL_FOCUS_MIN_OPACITY, PANEL_FOCUS_MAX_BLUR } from './stageConstants.js';
|
|
3
|
+
/** Applies the cubic Hermite smoothstep curve with clamped endpoints. */
|
|
4
|
+
export function smoothstep(edge0, edge1, value) {
|
|
5
|
+
if (edge0 === edge1)
|
|
6
|
+
return value < edge0 ? 0 : 1;
|
|
7
|
+
const t = ScalarMath.clamp((value - edge0) / (edge1 - edge0), 0, 1);
|
|
8
|
+
return t * t * (3 - 2 * t);
|
|
9
|
+
}
|
|
10
|
+
/** Returns the perspective camera distance that maps viewport pixels to world units. */
|
|
11
|
+
export function getPerspectiveDistance(viewportHeight, fov) {
|
|
12
|
+
return (viewportHeight * 0.5) / Math.tan(ScalarMath.degToRad(fov * 0.5));
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Restores the outward screen-space drift that an off-axis panel would receive
|
|
16
|
+
* from the shared perspective while leaving its hover projection panel-local.
|
|
17
|
+
*/
|
|
18
|
+
export function getPanelFocusPerspectiveOffset(position, advance, cameraDistance) {
|
|
19
|
+
const safeCameraDistance = Math.max(Number.isFinite(cameraDistance) ? cameraDistance : 1, 1);
|
|
20
|
+
const safeAdvance = Math.max(Number.isFinite(advance) ? advance : 0, 0);
|
|
21
|
+
if (safeAdvance <= 0)
|
|
22
|
+
return { x: 0, y: 0 };
|
|
23
|
+
const projectionScale = ScalarMath.clamp(safeCameraDistance / Math.max(safeCameraDistance - safeAdvance, 1), 1, PANEL_FOCUS_PERSPECTIVE_MAX_SCALE);
|
|
24
|
+
const egressScale = projectionScale - 1;
|
|
25
|
+
return {
|
|
26
|
+
x: position.x * egressScale,
|
|
27
|
+
y: position.y * egressScale
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/** Computes the camera-facing travel used to clear panels during close-up zoom. */
|
|
31
|
+
export function getPanelFocusOffset(options, focus, viewportWidth, viewportHeight) {
|
|
32
|
+
if (focus <= 0.001)
|
|
33
|
+
return { x: 0, y: 0, z: 0 };
|
|
34
|
+
const edgeDistanceX = Math.max(viewportWidth * 0.5 - options.width * 0.5, 1);
|
|
35
|
+
const edgeDistanceY = Math.max(viewportHeight * 0.5 - options.height * 0.5, 1);
|
|
36
|
+
const normalizedX = options.position.x / edgeDistanceX;
|
|
37
|
+
const normalizedY = options.position.y / edgeDistanceY;
|
|
38
|
+
const direction = getPanelFocusDirection(options, normalizedX, normalizedY);
|
|
39
|
+
const horizontal = Math.abs(direction.x) > Math.abs(direction.y);
|
|
40
|
+
const axisSize = horizontal ? options.width : options.height;
|
|
41
|
+
const travel = ScalarMath.clamp(axisSize * (horizontal ? 0.16 : 0.42), horizontal ? 48 : 18, PANEL_FOCUS_MAX_OFFSET);
|
|
42
|
+
const easedFocus = getPanelFocusProgress(focus);
|
|
43
|
+
return {
|
|
44
|
+
x: direction.x * travel * easedFocus,
|
|
45
|
+
y: direction.y * travel * easedFocus,
|
|
46
|
+
z: PANEL_FOCUS_MAX_ADVANCE * easedFocus
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/** Chooses the least disruptive edge toward which a focused panel should travel. */
|
|
50
|
+
export function getPanelFocusDirection(options, normalizedX, normalizedY) {
|
|
51
|
+
const aspect = options.width / Math.max(options.height, 1);
|
|
52
|
+
const absX = Math.abs(normalizedX);
|
|
53
|
+
const absY = Math.abs(normalizedY);
|
|
54
|
+
if (aspect >= 2.4 && absY > 0.12)
|
|
55
|
+
return { x: 0, y: Math.sign(normalizedY) || 1 };
|
|
56
|
+
if (absX > absY * 0.8)
|
|
57
|
+
return { x: Math.sign(normalizedX) || 1, y: 0 };
|
|
58
|
+
if (absY > absX * 0.8)
|
|
59
|
+
return { x: 0, y: Math.sign(normalizedY) || 1 };
|
|
60
|
+
if (normalizedX * normalizedX + normalizedY * normalizedY < 0.02)
|
|
61
|
+
return { x: 0, y: options.position.y >= 0 ? 1 : -1 };
|
|
62
|
+
const length = Math.hypot(normalizedX, normalizedY);
|
|
63
|
+
return { x: normalizedX / length, y: normalizedY / length };
|
|
64
|
+
}
|
|
65
|
+
/** Shared, eased progress for panel motion, blur, opacity and corner controls. */
|
|
66
|
+
export function getPanelFocusProgress(focus) {
|
|
67
|
+
return smoothstep(0.08, 0.96, focus);
|
|
68
|
+
}
|
|
69
|
+
/** Returns panel opacity at a normalized stage UI focus level. */
|
|
70
|
+
export function getPanelFocusOpacity(focus) {
|
|
71
|
+
return ScalarMath.lerp(1, PANEL_FOCUS_MIN_OPACITY, getPanelFocusProgress(focus));
|
|
72
|
+
}
|
|
73
|
+
/** Returns CSS content blur at a normalized stage focus level. */
|
|
74
|
+
export function getPanelFocusBlur(focus, options) {
|
|
75
|
+
const shortSide = Math.max(Math.min(options.width, options.height), 1);
|
|
76
|
+
const sizeScale = ScalarMath.clamp(Math.sqrt(shortSide / 240), 0.34, 1);
|
|
77
|
+
return PANEL_FOCUS_MAX_BLUR * sizeScale * getPanelFocusProgress(focus);
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=panelFocusMath.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAClD,MAAM,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACpE,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AAC5B,CAAC;AAED,wFAAwF;AACxF,MAAM,UAAU,sBAAsB,CAAC,cAAsB,EAAE,GAAW;IACzE,OAAO,CAAC,cAAc,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC;AAC1E,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,8BAA8B,CAC7C,QAAkC,EAClC,OAAe,EACf,cAAsB;IAEtB,MAAM,kBAAkB,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAA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AAM,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/** 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"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Scalar helpers shared by native layout and the optional renderer. */
|
|
2
|
+
export declare const clamp: (value: number, min: number, max: number) => number;
|
|
3
|
+
export declare const lerp: (start: number, end: number, progress: number) => number;
|
|
4
|
+
export declare const degToRad: (degrees: number) => number;
|
|
5
|
+
export declare const radToDeg: (radians: number) => number;
|
|
6
|
+
//# sourceMappingURL=scalarMath.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scalarMath.d.ts","sourceRoot":"","sources":["../../src/stage/scalarMath.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,eAAO,MAAM,KAAK,GAAI,OAAO,MAAM,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,WACzB,CAAC;AACrC,eAAO,MAAM,IAAI,GAAI,OAAO,MAAM,EAAE,KAAK,MAAM,EAAE,UAAU,MAAM,WACzB,CAAC;AACzC,eAAO,MAAM,QAAQ,GAAI,SAAS,MAAM,WAA8B,CAAC;AACvE,eAAO,MAAM,QAAQ,GAAI,SAAS,MAAM,WAA8B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Scalar helpers shared by native layout and the optional renderer. */
|
|
2
|
+
export const clamp = (value, min, max) => Math.max(min, Math.min(max, value));
|
|
3
|
+
export const lerp = (start, end, progress) => (1 - progress) * start + progress * end;
|
|
4
|
+
export const degToRad = (degrees) => (degrees * Math.PI) / 180;
|
|
5
|
+
export const radToDeg = (radians) => (radians * 180) / Math.PI;
|
|
6
|
+
//# sourceMappingURL=scalarMath.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scalarMath.js","sourceRoot":"","sources":["../../src/stage/scalarMath.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW,EAAE,EAAE,CAChE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;AACrC,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,KAAa,EAAE,GAAW,EAAE,QAAgB,EAAE,EAAE,CACpE,CAAC,CAAC,GAAG,QAAQ,CAAC,GAAG,KAAK,GAAG,QAAQ,GAAG,GAAG,CAAC;AACzC,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,CAAC,OAAO,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC;AACvE,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,CAAC,OAAO,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC","sourcesContent":["/** Scalar helpers shared by native layout and the optional renderer. */\nexport const clamp = (value: number, min: number, max: number) =>\n\tMath.max(min, Math.min(max, value));\nexport const lerp = (start: number, end: number, progress: number) =>\n\t(1 - progress) * start + progress * end;\nexport const degToRad = (degrees: number) => (degrees * Math.PI) / 180;\nexport const radToDeg = (radians: number) => (radians * 180) / Math.PI;\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type SpaceMousePermission = PermissionState | 'unknown';
|
|
2
|
+
type PermissionQuery = Pick<Permissions, 'query'>;
|
|
3
|
+
/** Query only permissions covering localhost; a LAN-only grant is insufficient. */
|
|
4
|
+
export declare function querySpaceMousePermission(permissions?: PermissionQuery | undefined): Promise<PermissionStatus | undefined>;
|
|
5
|
+
/** Store successful use, never a guessed browser permission or device identifier. */
|
|
6
|
+
export declare function rememberSpaceMouseConnection(): void;
|
|
7
|
+
export declare function shouldReconnectSpaceMouse(permission: SpaceMousePermission): boolean;
|
|
8
|
+
/** Observe permission without contacting the local driver or enumerating devices. */
|
|
9
|
+
export declare function observeSpaceMousePermission(onChange: (state: SpaceMousePermission) => void, permissions?: PermissionQuery | undefined): () => void;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=spaceMousePermission.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spaceMousePermission.d.ts","sourceRoot":"","sources":["../../src/stage/spaceMousePermission.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,GAAG,eAAe,GAAG,SAAS,CAAC;AAE/D,KAAK,eAAe,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AAGlD,mFAAmF;AACnF,wBAAsB,yBAAyB,CAC9C,WAAW,GAAE,eAAe,GAAG,SAA6C,GAC1E,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CASvC;AAED,qFAAqF;AACrF,wBAAgB,4BAA4B,SAE3C;AAED,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,oBAAoB,GAAG,OAAO,CAMnF;AAED,qFAAqF;AACrF,wBAAgB,2BAA2B,CAC1C,QAAQ,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,EAC/C,WAAW,GAAE,eAAe,GAAG,SAA6C,cAkB5E"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
const connectionKey = 'spatial-elements-spacemouse-connected';
|
|
2
|
+
/** Query only permissions covering localhost; a LAN-only grant is insufficient. */
|
|
3
|
+
export async function querySpaceMousePermission(permissions = globalThis.navigator?.permissions) {
|
|
4
|
+
if (!permissions)
|
|
5
|
+
return;
|
|
6
|
+
for (const name of ['loopback-network', 'local-network-access']) {
|
|
7
|
+
try {
|
|
8
|
+
return await permissions.query({ name: name });
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
// Some browsers expose only the older combined permission, or neither name.
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
/** Store successful use, never a guessed browser permission or device identifier. */
|
|
16
|
+
export function rememberSpaceMouseConnection() {
|
|
17
|
+
try {
|
|
18
|
+
globalThis.localStorage?.setItem(connectionKey, 'true');
|
|
19
|
+
}
|
|
20
|
+
catch { /* Storage may be blocked. */ }
|
|
21
|
+
}
|
|
22
|
+
export function shouldReconnectSpaceMouse(permission) {
|
|
23
|
+
if (permission === 'granted')
|
|
24
|
+
return true;
|
|
25
|
+
if (permission === 'denied')
|
|
26
|
+
return false;
|
|
27
|
+
// A working driver connection need not change the query from `prompt` (e.g. localhost).
|
|
28
|
+
// Remember successful use so reloads reconnect, while first visits still require a click.
|
|
29
|
+
try {
|
|
30
|
+
return globalThis.localStorage?.getItem(connectionKey) === 'true';
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/** Observe permission without contacting the local driver or enumerating devices. */
|
|
37
|
+
export function observeSpaceMousePermission(onChange, permissions = globalThis.navigator?.permissions) {
|
|
38
|
+
let disposed = false;
|
|
39
|
+
let status;
|
|
40
|
+
const notify = () => { if (!disposed && status)
|
|
41
|
+
onChange(status.state); };
|
|
42
|
+
void (async () => {
|
|
43
|
+
try {
|
|
44
|
+
const result = await querySpaceMousePermission(permissions);
|
|
45
|
+
if (disposed)
|
|
46
|
+
return;
|
|
47
|
+
status = result;
|
|
48
|
+
if (status) {
|
|
49
|
+
status.addEventListener('change', notify);
|
|
50
|
+
notify();
|
|
51
|
+
}
|
|
52
|
+
else
|
|
53
|
+
onChange('unknown');
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
// An unreadable permission can use a previously successful connection as a hint.
|
|
57
|
+
if (!disposed)
|
|
58
|
+
onChange('unknown');
|
|
59
|
+
}
|
|
60
|
+
})();
|
|
61
|
+
return () => { disposed = true; status?.removeEventListener('change', notify); };
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=spaceMousePermission.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spaceMousePermission.js","sourceRoot":"","sources":["../../src/stage/spaceMousePermission.ts"],"names":[],"mappings":"AAGA,MAAM,aAAa,GAAG,uCAAuC,CAAC;AAE9D,mFAAmF;AACnF,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC9C,cAA2C,UAAU,CAAC,SAAS,EAAE,WAAW;IAE5E,IAAI,CAAC,WAAW;QAAE,OAAO;IACzB,KAAK,MAAM,IAAI,IAAI,CAAC,kBAAkB,EAAE,sBAAsB,CAAC,EAAE,CAAC;QACjE,IAAI,CAAC;YACJ,OAAO,MAAM,WAAW,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,IAAsB,EAAE,CAAC,CAAC;QAClE,CAAC;QAAC,MAAM,CAAC;YACR,4EAA4E;QAC7E,CAAC;IACF,CAAC;AACF,CAAC;AAED,qFAAqF;AACrF,MAAM,UAAU,4BAA4B;IAC3C,IAAI,CAAC;QAAC,UAAU,C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AAS,CAAC,CAAC;QACpC,CAAC;IACF,CAAC,CAAC,EAAE,CAAC;IACL,OAAO,GAAG,EAAE,GAAG,QAAQ,GAAG,IAAI,CAAC,CAAC,MAAM,EAAE,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAClF,CAAC","sourcesContent":["export type SpaceMousePermission = PermissionState | 'unknown';\n\ntype PermissionQuery = Pick<Permissions, 'query'>;\nconst connectionKey = 'spatial-elements-spacemouse-connected';\n\n/** Query only permissions covering localhost; a LAN-only grant is insufficient. */\nexport async function querySpaceMousePermission(\n\tpermissions: PermissionQuery | undefined = globalThis.navigator?.permissions\n): Promise<PermissionStatus | undefined> {\n\tif (!permissions) return;\n\tfor (const name of ['loopback-network', 'local-network-access']) {\n\t\ttry {\n\t\t\treturn await permissions.query({ name: name as PermissionName });\n\t\t} catch {\n\t\t\t// Some browsers expose only the older combined permission, or neither name.\n\t\t}\n\t}\n}\n\n/** Store successful use, never a guessed browser permission or device identifier. */\nexport function rememberSpaceMouseConnection() {\n\ttry { globalThis.localStorage?.setItem(connectionKey, 'true'); } catch { /* Storage may be blocked. */ }\n}\n\nexport function shouldReconnectSpaceMouse(permission: SpaceMousePermission): boolean {\n\tif (permission === 'granted') return true;\n\tif (permission === 'denied') return false;\n\t// A working driver connection need not change the query from `prompt` (e.g. localhost).\n\t// Remember successful use so reloads reconnect, while first visits still require a click.\n\ttry { return globalThis.localStorage?.getItem(connectionKey) === 'true'; } catch { return false; }\n}\n\n/** Observe permission without contacting the local driver or enumerating devices. */\nexport function observeSpaceMousePermission(\n\tonChange: (state: SpaceMousePermission) => void,\n\tpermissions: PermissionQuery | undefined = globalThis.navigator?.permissions\n) {\n\tlet disposed = false;\n\tlet status: PermissionStatus | undefined;\n\tconst notify = () => { if (!disposed && status) onChange(status.state); };\n\tvoid (async () => {\n\t\ttry {\n\t\t\tconst result = await querySpaceMousePermission(permissions);\n\t\t\tif (disposed) return;\n\t\t\tstatus = result;\n\t\t\tif (status) { status.addEventListener('change', notify); notify(); }\n\t\t\telse onChange('unknown');\n\t\t} catch {\n\t\t\t// An unreadable permission can use a previously successful connection as a hint.\n\t\t\tif (!disposed) onChange('unknown');\n\t\t}\n\t})();\n\treturn () => { disposed = true; status?.removeEventListener('change', notify); };\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** A platform hint, never hardware detection. Touch-capable desktops remain eligible. */
|
|
2
|
+
export declare function isSpaceMouseDesktop(navigator?: {
|
|
3
|
+
userAgent: string;
|
|
4
|
+
platform?: string;
|
|
5
|
+
maxTouchPoints?: number;
|
|
6
|
+
userAgentData?: {
|
|
7
|
+
platform: string;
|
|
8
|
+
mobile?: boolean;
|
|
9
|
+
};
|
|
10
|
+
}): boolean;
|
|
11
|
+
export type SpaceMouseState = 'idle' | 'connecting' | 'connected' | 'permission-required' | 'unavailable';
|
|
12
|
+
//# sourceMappingURL=spaceMousePlatform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spaceMousePlatform.d.ts","sourceRoot":"","sources":["../../src/stage/spaceMousePlatform.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,wBAAgB,mBAAmB,CAAC,SAAS,CAAC,EAAE;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CACvD,GAAG,OAAO,CAQV;AAED,MAAM,MAAM,eAAe,GACxB,MAAM,GACN,YAAY,GACZ,WAAW,GACX,qBAAqB,GACrB,aAAa,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** A platform hint, never hardware detection. Touch-capable desktops remain eligible. */
|
|
2
|
+
export function isSpaceMouseDesktop(navigator) {
|
|
3
|
+
if (!navigator)
|
|
4
|
+
return false;
|
|
5
|
+
if (navigator.userAgentData?.mobile || /Android|iPhone|iPad|iPod/i.test(navigator.userAgent))
|
|
6
|
+
return false;
|
|
7
|
+
const platform = navigator.userAgentData?.platform || navigator.platform || navigator.userAgent;
|
|
8
|
+
// iPadOS can present a desktop Mac user agent.
|
|
9
|
+
if (/Mac/i.test(platform) && (navigator.maxTouchPoints ?? 0) > 1)
|
|
10
|
+
return false;
|
|
11
|
+
return /Win|Mac|Linux/i.test(platform);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=spaceMousePlatform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spaceMousePlatform.js","sourceRoot":"","sources":["../../src/stage/spaceMousePlatform.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,MAAM,UAAU,mBAAmB,CAAC,SAKnC;IACA,IAAI,CAAC,SAAS;QAAE,OAAO,KAAK,CAAC;IAC7B,IAAI,SAAS,CAAC,aAAa,EAAE,MAAM,IAAI,2BAA2B,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC;QAC3F,OAAO,KAAK,CAAC;IACd,MAAM,QAAQ,GAAG,SAAS,CAAC,aAAa,EAAE,QAAQ,IAAI,SAAS,CAAC,QAAQ,IAAI,SAAS,CAAC,SAAS,CAAC;IAChG,+CAA+C;IAC/C,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,IAAI,CAAC,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IAC/E,OAAO,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACxC,CAAC","sourcesContent":["/** A platform hint, never hardware detection. Touch-capable desktops remain eligible. */\nexport function isSpaceMouseDesktop(navigator?: {\n\tuserAgent: string;\n\tplatform?: string;\n\tmaxTouchPoints?: number;\n\tuserAgentData?: { platform: string; mobile?: boolean };\n}): boolean {\n\tif (!navigator) return false;\n\tif (navigator.userAgentData?.mobile || /Android|iPhone|iPad|iPod/i.test(navigator.userAgent))\n\t\treturn false;\n\tconst platform = navigator.userAgentData?.platform || navigator.platform || navigator.userAgent;\n\t// iPadOS can present a desktop Mac user agent.\n\tif (/Mac/i.test(platform) && (navigator.maxTouchPoints ?? 0) > 1) return false;\n\treturn /Win|Mac|Linux/i.test(platform);\n}\n\nexport type SpaceMouseState =\n\t| 'idle'\n\t| 'connecting'\n\t| 'connected'\n\t| 'permission-required'\n\t| 'unavailable';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stageConstants.d.ts","sourceRoot":"","sources":["../../src/stage/stageConstants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stageConstants.d.ts","sourceRoot":"","sources":["../../src/stage/stageConstants.ts"],"names":[],"mappings":"AAKA,0FAA0F;AAC1F,eAAO,MAAM,kBAAkB;;;;CAID,CAAC;AAE/B,2FAA2F;AAC3F,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;GAgBU,CAAC;AAEtC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,eAAO,MAAM,eAAe,IAAI,CAAC;AACjC,6DAA6D;AAC7D,eAAO,MAAM,sBAAsB,QAA0B,CAAC;AAC9D,eAAO,MAAM,sBAAsB,IAAI,CAAC;AACxC,eAAO,MAAM,qBAAqB,KAAK,CAAC;AACxC,6FAA6F;AAC7F,eAAO,MAAM,6BAA6B,OAAO,CAAC;AAClD,eAAO,MAAM,oCAAoC,OAAO,CAAC;AACzD,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAC9C,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAC9C,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAC1C,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAC3C,4EAA4E;AAC5E,eAAO,MAAM,iCAAiC,OAAO,CAAC;AACtD,eAAO,MAAM,uBAAuB,IAAI,CAAC;AACzC,eAAO,MAAM,oBAAoB,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* as ScalarMath from './scalarMath.js';
|
|
2
2
|
/** Default environment presentation used when a route supplies no background settings. */
|
|
3
3
|
export const DEFAULT_BACKGROUND = {
|
|
4
4
|
blurriness: 0.2,
|
|
@@ -26,7 +26,7 @@ export const DEFAULT_PANELS = [
|
|
|
26
26
|
export const PANEL_CAMERA_FOV = 36;
|
|
27
27
|
export const PANEL_CONTENT_Z = 0;
|
|
28
28
|
/** Shared maximum tilt for every panel at a pointer edge. */
|
|
29
|
-
export const PANEL_POINTER_MAX_TILT =
|
|
29
|
+
export const PANEL_POINTER_MAX_TILT = ScalarMath.degToRad(10);
|
|
30
30
|
export const PANEL_POINTER_MAX_LIFT = 8;
|
|
31
31
|
export const PANEL_POINTER_DAMPING = 12;
|
|
32
32
|
/** Pointer approach distance derived from the short side with a capped aspect correction. */
|
|
@@ -70,8 +70,8 @@ export const ZOOM_FOCUS_NOTIFY_EPSILON = 0.000001;
|
|
|
70
70
|
/** Responsive spatial-element-fit margin that lets authored silhouettes fill the viewport. */
|
|
71
71
|
export const SPATIAL_ELEMENT_CAMERA_FIT_MARGIN = 1;
|
|
72
72
|
/** Existing default view expressed as orbit angles for backwards-compatible framing. */
|
|
73
|
-
export const DEFAULT_CAMERA_AZIMUTH =
|
|
74
|
-
export const DEFAULT_CAMERA_ELEVATION =
|
|
73
|
+
export const DEFAULT_CAMERA_AZIMUTH = ScalarMath.radToDeg(Math.atan2(0.45, 1));
|
|
74
|
+
export const DEFAULT_CAMERA_ELEVATION = ScalarMath.radToDeg(Math.asin(0.28 / Math.hypot(0.45, 0.28, 1)));
|
|
75
75
|
export const DEFAULT_HDR = '';
|
|
76
76
|
export const DEFAULT_GLB = '';
|
|
77
77
|
/** Default element hover outline, tuned to remain visible on light and dark scenes. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stageConstants.js","sourceRoot":"","sources":["../../src/stage/stageConstants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"stage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F,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC;AACvC,2FAA2F;AAC3F,MAAM,CAAC,MAAM,yBAAyB,GAAG,QAAQ,CAAC;AAClD,8FAA8F;AAC9F,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC;AACnD,wFAAwF;AACxF,MAAM,CAAC,MAAM,sBAAsB,GAAG,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAC/E,MAAM,CAAC,MAAM,wBAAwB,GAAG,UAAU,CAAC,QAAQ,CAC1D,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAC3C,CAAC;AACF,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,CAAC;AAC9B,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,CAAC;AAE9B,uFAAuF;AACvF,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACxC,YAAY,EAAE,SAAS;IACvB,cAAc,EAAE,IAAI;IACpB,gBAAgB,EAAE,CAAC;IACnB,WAAW,EAAE,CAAC;IACd,oBAAoB,EAAE,CAAC;CACS,CAAC","sourcesContent":["import * as ScalarMath from './scalarMath.js';\n\nimport type { LiquidGlassPanelOptions } from './LiquidGlassPanel.js';\nimport type { BackgroundSettings, StageInteractionTheme } from './stageTypes.js';\n\n/** Default environment presentation used when a route supplies no background settings. */\nexport const DEFAULT_BACKGROUND = {\n\tblurriness: 0.2,\n\ttint: '#b6deff',\n\ttintIntensity: 0.3\n} satisfies BackgroundSettings;\n\n/** Fallback panel used by the imperative API when no declarative panels are registered. */\nexport const DEFAULT_PANELS = [\n\t{\n\t\twidth: 360,\n\t\theight: 230,\n\t\tradius: 42,\n\t\tposition: { x: 0, y: 42 },\n\t\tbackdropBlur: 3,\n\t\trefraction: 12,\n\t\ttint: '#ffffff',\n\t\ttintOpacity: 0.28,\n\t\tbezel: 18,\n\t\tthickness: 0.35,\n\t\tspecularOpacity: 0.18,\n\t\tshadowIntensity: 0.28,\n\t\topacity: 1\n\t}\n] satisfies LiquidGlassPanelOptions[];\n\nexport const PANEL_CAMERA_FOV = 36;\nexport const PANEL_CONTENT_Z = 0;\n/** Shared maximum tilt for every panel at a pointer edge. */\nexport const PANEL_POINTER_MAX_TILT = ScalarMath.degToRad(10);\nexport const PANEL_POINTER_MAX_LIFT = 8;\nexport const PANEL_POINTER_DAMPING = 12;\n/** Pointer approach distance derived from the short side with a capped aspect correction. */\nexport const PANEL_POINTER_PROXIMITY_SCALE = 0.15;\nexport const PANEL_POINTER_PROXIMITY_ASPECT_LIMIT = 1.65;\nexport const PANEL_POINTER_PROXIMITY_MIN = 12;\nexport const PANEL_POINTER_PROXIMITY_MAX = 32;\nexport const PANEL_FOCUS_MAX_OFFSET = 190;\nexport const PANEL_FOCUS_MAX_ADVANCE = 360;\n/** Caps restored shared-perspective egress on unusually short viewports. */\nexport const PANEL_FOCUS_PERSPECTIVE_MAX_SCALE = 1.65;\nexport const PANEL_FOCUS_MIN_OPACITY = 0;\nexport const PANEL_FOCUS_MAX_BLUR = 7;\n/** Exponential damping applied to mouse-wheel dolly input. */\nexport const WHEEL_ZOOM_DAMPING = 8.5;\n/** Exponential damping used while scrolling a close-up back toward the overview. */\nexport const ZOOM_RESET_DAMPING = 8.5;\n/** Duration range for an explicit return to the fitted element view. */\nexport const VIEW_RESET_MIN_DURATION = 0.3;\nexport const VIEW_RESET_MAX_DURATION = 0.8;\nexport const MINIMAP_DEFAULT_EXPANDED_HEIGHT = 230;\n/** Viewport inset used only while the minimap is expanded by camera zoom. */\nexport const MINIMAP_FOCUSED_VIEWPORT_INSET = 10;\nexport const MINIMAP_PANEL_Z = 8;\nexport const MINIMAP_POINTER_MODEL_LIFT = 24;\n/** Default model scale at full minimap hover, independent of its dock presentation scale. */\nexport const MINIMAP_DEFAULT_HOVER_MODEL_SCALE = 1.16;\nexport const MINIMAP_OVERLAY_Z = 0.4;\nexport const MINIMAP_VIEWPORT_BORDER_THICKNESS = 3;\nexport const MINIMAP_MIN_BLUR_GUARD = 56;\nexport const MINIMAP_DEFAULT_OVERLAY_BLUR = 10;\nexport const MINIMAP_OVERLAY_REVEAL_DAMPING = 10;\nexport const MINIMAP_DEFAULT_CONTEXT_OPACITY = 0;\nexport const MINIMAP_DEFAULT_CONTEXT_COLOR = '#000000';\nexport const MINIMAP_MODEL_RENDER_ORDER = 14;\nexport const MINIMAP_DEFAULT_MODEL_SCALE = 1;\n/** Fraction of the minimap's short side reserved for the element bounding sphere. */\nexport const MINIMAP_MODEL_FILL = 0.96;\n/** Suppresses only floating-point noise while keeping DOM focus on the camera timeline. */\nexport const ZOOM_FOCUS_NOTIFY_EPSILON = 0.000001;\n/** Responsive spatial-element-fit margin that lets authored silhouettes fill the viewport. */\nexport const SPATIAL_ELEMENT_CAMERA_FIT_MARGIN = 1;\n/** Existing default view expressed as orbit angles for backwards-compatible framing. */\nexport const DEFAULT_CAMERA_AZIMUTH = ScalarMath.radToDeg(Math.atan2(0.45, 1));\nexport const DEFAULT_CAMERA_ELEVATION = ScalarMath.radToDeg(\n\tMath.asin(0.28 / Math.hypot(0.45, 0.28, 1))\n);\nexport const DEFAULT_HDR = '';\nexport const DEFAULT_GLB = '';\n\n/** Default element hover outline, tuned to remain visible on light and dark scenes. */\nexport const DEFAULT_INTERACTION_THEME = {\n\toutlineColor: '#7db7ff',\n\toutlineOpacity: 0.96,\n\toutlineThickness: 3,\n\toutlineGlow: 0,\n\toutlineGlowThickness: 8\n} satisfies StageInteractionTheme;\n"]}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
+
export { smoothstep, getPerspectiveDistance, getPanelFocusPerspectiveOffset, getPanelFocusOffset, getPanelFocusDirection, getPanelFocusProgress, getPanelFocusOpacity, getPanelFocusBlur } from './panelFocusMath.js';
|
|
1
2
|
import * as THREE from 'three/webgpu';
|
|
2
3
|
import type { LiquidGlassPanelOptions } from './LiquidGlassPanel.js';
|
|
3
4
|
/** Resolves declarative orbit angles to a normalized direction from element to camera. */
|
|
4
5
|
export declare function getCameraOrbitDirection(azimuth?: number, elevation?: number): THREE.Vector3;
|
|
5
6
|
/** Resolves orbit angles to the world-space orientation of a camera looking at the element. */
|
|
6
7
|
export declare function getCameraOrbitQuaternion(azimuth?: number, elevation?: number): THREE.Quaternion;
|
|
7
|
-
/** Applies the cubic Hermite smoothstep curve with clamped endpoints. */
|
|
8
|
-
export declare function smoothstep(edge0: number, edge1: number, value: number): number;
|
|
9
8
|
/** Lets close-up resets travel longer while keeping small corrections responsive. */
|
|
10
9
|
export declare function getViewResetDuration(focus: number): number;
|
|
11
10
|
/** Provides a zero-velocity start and finish for the fitted-view return. */
|
|
@@ -87,8 +86,6 @@ export declare function getCameraZoomFocus(distance: number, currentFov: number,
|
|
|
87
86
|
* target together and only reduce the distance to the element itself.
|
|
88
87
|
*/
|
|
89
88
|
export declare function getCameraZoomReferenceDistance(viewTargetDistance: number, spatialElementCenterDistance: number): number;
|
|
90
|
-
/** Returns the perspective camera distance that maps viewport pixels to world units. */
|
|
91
|
-
export declare function getPerspectiveDistance(viewportHeight: number, fov: number): number;
|
|
92
89
|
/**
|
|
93
90
|
* Places an untransformed panel around its stage-space center and aligns its
|
|
94
91
|
* top-left corner to the device pixel grid for crisp native DOM text.
|
|
@@ -116,17 +113,6 @@ export declare function getPerspectiveAnchoredPanelPosition(targetX: number, tar
|
|
|
116
113
|
x: number;
|
|
117
114
|
y: number;
|
|
118
115
|
};
|
|
119
|
-
/**
|
|
120
|
-
* Restores the outward screen-space drift that an off-axis panel would receive
|
|
121
|
-
* from the shared perspective while leaving its hover projection panel-local.
|
|
122
|
-
*/
|
|
123
|
-
export declare function getPanelFocusPerspectiveOffset(position: {
|
|
124
|
-
x: number;
|
|
125
|
-
y: number;
|
|
126
|
-
}, advance: number, cameraDistance: number): {
|
|
127
|
-
x: number;
|
|
128
|
-
y: number;
|
|
129
|
-
};
|
|
130
116
|
/**
|
|
131
117
|
* Builds a local projection root for a panel rendered by the shared stage camera.
|
|
132
118
|
*
|
|
@@ -150,20 +136,6 @@ export declare function getCameraFitDistance(bounds: THREE.Box3, viewDirection:
|
|
|
150
136
|
}): number;
|
|
151
137
|
/** Returns the eight corners of an axis-aligned bounding box. */
|
|
152
138
|
export declare function getBoxCorners(bounds: THREE.Box3): THREE.Vector3[];
|
|
153
|
-
/** Computes the camera-facing travel used to clear panels during close-up zoom. */
|
|
154
|
-
export declare function getPanelFocusOffset(options: Pick<Required<LiquidGlassPanelOptions>, 'width' | 'height' | 'position'>, focus: number, viewportWidth: number, viewportHeight: number): {
|
|
155
|
-
x: number;
|
|
156
|
-
y: number;
|
|
157
|
-
z: number;
|
|
158
|
-
};
|
|
159
|
-
/** Chooses the least disruptive edge toward which a focused panel should travel. */
|
|
160
|
-
export declare function getPanelFocusDirection(options: Pick<Required<LiquidGlassPanelOptions>, 'width' | 'height' | 'position'>, normalizedX: number, normalizedY: number): THREE.Vector2;
|
|
161
|
-
/** Shared, eased progress for panel motion, blur, opacity and corner controls. */
|
|
162
|
-
export declare function getPanelFocusProgress(focus: number): number;
|
|
163
|
-
/** Returns panel opacity at a normalized stage UI focus level. */
|
|
164
|
-
export declare function getPanelFocusOpacity(focus: number): number;
|
|
165
|
-
/** Returns CSS content blur at a normalized stage focus level. */
|
|
166
|
-
export declare function getPanelFocusBlur(focus: number, options: Pick<Required<LiquidGlassPanelOptions>, 'width' | 'height'>): number;
|
|
167
139
|
/**
|
|
168
140
|
* Reduces only the rotation axis amplified by an elongated panel.
|
|
169
141
|
* Square panels keep the full response on both axes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stageMath.d.ts","sourceRoot":"","sources":["../../src/stage/stageMath.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stageMath.d.ts","sourceRoot":"","sources":["../../src/stage/stageMath.ts"],"names":[],"mappings":"AACA,OAAO,EAA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