@spatial-elements/core 0.1.0-beta.1 → 1.0.0-beta.10
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 +17 -9
- package/dist/catalog/CarouselDeviceCamera.d.ts +20 -0
- package/dist/catalog/CarouselDeviceCamera.d.ts.map +1 -0
- package/dist/catalog/CarouselDeviceCamera.js +58 -0
- package/dist/catalog/CarouselDeviceCamera.js.map +1 -0
- package/dist/catalog/CarouselGlassCompositor.d.ts +14 -3
- package/dist/catalog/CarouselGlassCompositor.d.ts.map +1 -1
- package/dist/catalog/CarouselGlassCompositor.js +164 -28
- package/dist/catalog/CarouselGlassCompositor.js.map +1 -1
- package/dist/catalog/CarouselGround.d.ts +43 -0
- package/dist/catalog/CarouselGround.d.ts.map +1 -0
- package/dist/catalog/CarouselGround.js +270 -0
- package/dist/catalog/CarouselGround.js.map +1 -0
- package/dist/catalog/CarouselSectionSurfaces.d.ts +10 -0
- package/dist/catalog/CarouselSectionSurfaces.d.ts.map +1 -0
- package/dist/catalog/CarouselSectionSurfaces.js +55 -0
- package/dist/catalog/CarouselSectionSurfaces.js.map +1 -0
- package/dist/catalog/CatalogDepthBlur.d.ts +45 -0
- package/dist/catalog/CatalogDepthBlur.d.ts.map +1 -0
- package/dist/catalog/CatalogDepthBlur.js +190 -0
- package/dist/catalog/CatalogDepthBlur.js.map +1 -0
- package/dist/catalog/CatalogEndpointRegistry.d.ts +2 -0
- package/dist/catalog/CatalogEndpointRegistry.d.ts.map +1 -1
- package/dist/catalog/CatalogEndpointRegistry.js +2 -0
- package/dist/catalog/CatalogEndpointRegistry.js.map +1 -1
- package/dist/catalog/CatalogGeometryFade.d.ts +5 -1
- package/dist/catalog/CatalogGeometryFade.d.ts.map +1 -1
- package/dist/catalog/CatalogGeometryFade.js +45 -9
- package/dist/catalog/CatalogGeometryFade.js.map +1 -1
- package/dist/catalog/CatalogModelOutline.d.ts +33 -0
- package/dist/catalog/CatalogModelOutline.d.ts.map +1 -0
- package/dist/catalog/CatalogModelOutline.js +143 -0
- package/dist/catalog/CatalogModelOutline.js.map +1 -0
- package/dist/catalog/CatalogNavigationRegistry.d.ts +44 -0
- package/dist/catalog/CatalogNavigationRegistry.d.ts.map +1 -0
- package/dist/catalog/CatalogNavigationRegistry.js +66 -0
- package/dist/catalog/CatalogNavigationRegistry.js.map +1 -0
- package/dist/catalog/CatalogPreparation.d.ts +3 -3
- package/dist/catalog/CatalogPreparation.d.ts.map +1 -1
- package/dist/catalog/CatalogPreparation.js +10 -7
- package/dist/catalog/CatalogPreparation.js.map +1 -1
- package/dist/catalog/CatalogSpatialElementLayer.d.ts +175 -5
- package/dist/catalog/CatalogSpatialElementLayer.d.ts.map +1 -1
- package/dist/catalog/CatalogSpatialElementLayer.js +739 -121
- package/dist/catalog/CatalogSpatialElementLayer.js.map +1 -1
- package/dist/catalog/CatalogTransition.d.ts +4 -2
- package/dist/catalog/CatalogTransition.d.ts.map +1 -1
- package/dist/catalog/CatalogTransition.js +206 -90
- package/dist/catalog/CatalogTransition.js.map +1 -1
- package/dist/catalog/CatalogWarmOutputContext.d.ts +39 -0
- package/dist/catalog/CatalogWarmOutputContext.d.ts.map +1 -0
- package/dist/catalog/CatalogWarmOutputContext.js +159 -0
- package/dist/catalog/CatalogWarmOutputContext.js.map +1 -0
- package/dist/catalog/EarlyNavigationCoordinator.d.ts +35 -0
- package/dist/catalog/EarlyNavigationCoordinator.d.ts.map +1 -0
- package/dist/catalog/EarlyNavigationCoordinator.js +103 -0
- package/dist/catalog/EarlyNavigationCoordinator.js.map +1 -0
- package/dist/catalog/NavigationFeedback.d.ts +12 -0
- package/dist/catalog/NavigationFeedback.d.ts.map +1 -0
- package/dist/catalog/NavigationFeedback.js +40 -0
- package/dist/catalog/NavigationFeedback.js.map +1 -0
- package/dist/catalog/PreparationGate.d.ts +4 -0
- package/dist/catalog/PreparationGate.d.ts.map +1 -1
- package/dist/catalog/PreparationGate.js +1 -0
- package/dist/catalog/PreparationGate.js.map +1 -1
- package/dist/catalog/SourceDomClipping.d.ts +8 -0
- package/dist/catalog/SourceDomClipping.d.ts.map +1 -0
- package/dist/catalog/SourceDomClipping.js +74 -0
- package/dist/catalog/SourceDomClipping.js.map +1 -0
- package/dist/catalog/SourceDomMotion.d.ts +28 -0
- package/dist/catalog/SourceDomMotion.d.ts.map +1 -0
- package/dist/catalog/SourceDomMotion.js +111 -0
- package/dist/catalog/SourceDomMotion.js.map +1 -0
- package/dist/catalog/SpatialGeometryCapture.d.ts +9 -0
- package/dist/catalog/SpatialGeometryCapture.d.ts.map +1 -1
- package/dist/catalog/SpatialGeometryCapture.js +11 -1
- package/dist/catalog/SpatialGeometryCapture.js.map +1 -1
- package/dist/catalog/SpatialPageRegistry.d.ts +18 -0
- package/dist/catalog/SpatialPageRegistry.d.ts.map +1 -0
- package/dist/catalog/SpatialPageRegistry.js +21 -0
- package/dist/catalog/SpatialPageRegistry.js.map +1 -0
- package/dist/catalog/StagedCatalogTransition.d.ts +74 -0
- package/dist/catalog/StagedCatalogTransition.d.ts.map +1 -0
- package/dist/catalog/StagedCatalogTransition.js +270 -0
- package/dist/catalog/StagedCatalogTransition.js.map +1 -0
- package/dist/catalog/cardModelFit.d.ts +7 -0
- package/dist/catalog/cardModelFit.d.ts.map +1 -0
- package/dist/catalog/cardModelFit.js +16 -0
- package/dist/catalog/cardModelFit.js.map +1 -0
- package/dist/catalog/cardProjection.d.ts +39 -0
- package/dist/catalog/cardProjection.d.ts.map +1 -0
- package/dist/catalog/cardProjection.js +110 -0
- package/dist/catalog/cardProjection.js.map +1 -0
- package/dist/catalog/carouselMotion.d.ts +74 -0
- package/dist/catalog/carouselMotion.d.ts.map +1 -0
- package/dist/catalog/carouselMotion.js +185 -0
- package/dist/catalog/carouselMotion.js.map +1 -0
- package/dist/catalog/carouselPanelProjection.d.ts.map +1 -1
- package/dist/catalog/carouselPanelProjection.js +48 -11
- package/dist/catalog/carouselPanelProjection.js.map +1 -1
- package/dist/catalog/carouselProximity.d.ts +11 -0
- package/dist/catalog/carouselProximity.d.ts.map +1 -0
- package/dist/catalog/carouselProximity.js +13 -0
- package/dist/catalog/carouselProximity.js.map +1 -0
- package/dist/catalog/carouselSupport.d.ts +4 -0
- package/dist/catalog/carouselSupport.d.ts.map +1 -0
- package/dist/catalog/carouselSupport.js +30 -0
- package/dist/catalog/carouselSupport.js.map +1 -0
- package/dist/catalog/catalogActivationFocus.d.ts +5 -0
- package/dist/catalog/catalogActivationFocus.d.ts.map +1 -0
- package/dist/catalog/catalogActivationFocus.js +39 -0
- package/dist/catalog/catalogActivationFocus.js.map +1 -0
- package/dist/catalog/catalogDomSnapshot.d.ts +18 -0
- package/dist/catalog/catalogDomSnapshot.d.ts.map +1 -0
- package/dist/catalog/catalogDomSnapshot.js +51 -0
- package/dist/catalog/catalogDomSnapshot.js.map +1 -0
- package/dist/catalog/catalogJourney.d.ts +4 -1
- package/dist/catalog/catalogJourney.d.ts.map +1 -1
- package/dist/catalog/catalogJourney.js +7 -15
- package/dist/catalog/catalogJourney.js.map +1 -1
- package/dist/catalog/catalogPage.d.ts +7 -3
- package/dist/catalog/catalogPage.d.ts.map +1 -1
- package/dist/catalog/catalogPage.js.map +1 -1
- package/dist/catalog/catalogPose.d.ts +54 -6
- package/dist/catalog/catalogPose.d.ts.map +1 -1
- package/dist/catalog/catalogPose.js +100 -23
- package/dist/catalog/catalogPose.js.map +1 -1
- package/dist/catalog/catalogRecipes.d.ts +3 -2
- package/dist/catalog/catalogRecipes.d.ts.map +1 -1
- package/dist/catalog/catalogRecipes.js +10 -25
- package/dist/catalog/catalogRecipes.js.map +1 -1
- package/dist/catalog/catalogTransitionViewport.d.ts +9 -0
- package/dist/catalog/catalogTransitionViewport.d.ts.map +1 -0
- package/dist/catalog/catalogTransitionViewport.js +13 -0
- package/dist/catalog/catalogTransitionViewport.js.map +1 -0
- package/dist/catalog/catalogViewLink.d.ts +2 -0
- package/dist/catalog/catalogViewLink.d.ts.map +1 -1
- package/dist/catalog/catalogViewLink.js +10 -2
- package/dist/catalog/catalogViewLink.js.map +1 -1
- package/dist/catalog/deviceYaw.d.ts +21 -0
- package/dist/catalog/deviceYaw.d.ts.map +1 -0
- package/dist/catalog/deviceYaw.js +87 -0
- package/dist/catalog/deviceYaw.js.map +1 -0
- package/dist/catalog/listDeviceOrientation.d.ts +17 -0
- package/dist/catalog/listDeviceOrientation.d.ts.map +1 -0
- package/dist/catalog/listDeviceOrientation.js +262 -0
- package/dist/catalog/listDeviceOrientation.js.map +1 -0
- package/dist/catalog/spatialElementAssets.d.ts +5 -5
- package/dist/catalog/spatialElementAssets.d.ts.map +1 -1
- package/dist/catalog/spatialElementAssets.js.map +1 -1
- package/dist/catalog/spatialElementLodPair.d.ts +2 -1
- package/dist/catalog/spatialElementLodPair.d.ts.map +1 -1
- package/dist/catalog/spatialElementLodPair.js.map +1 -1
- package/dist/catalog/stagedDetailGeometry.d.ts +37 -0
- package/dist/catalog/stagedDetailGeometry.d.ts.map +1 -0
- package/dist/catalog/stagedDetailGeometry.js +55 -0
- package/dist/catalog/stagedDetailGeometry.js.map +1 -0
- package/dist/catalog/stagedDockGeometry.d.ts +66 -0
- package/dist/catalog/stagedDockGeometry.d.ts.map +1 -0
- package/dist/catalog/stagedDockGeometry.js +66 -0
- package/dist/catalog/stagedDockGeometry.js.map +1 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/spatial-element/ResponsiveViewportMetrics.d.ts +18 -0
- package/dist/spatial-element/ResponsiveViewportMetrics.d.ts.map +1 -0
- package/dist/spatial-element/ResponsiveViewportMetrics.js +68 -0
- package/dist/spatial-element/ResponsiveViewportMetrics.js.map +1 -0
- package/dist/spatial-element/SectionSurfaceRegistry.d.ts +2 -0
- package/dist/spatial-element/SectionSurfaceRegistry.d.ts.map +1 -0
- package/dist/spatial-element/SectionSurfaceRegistry.js +2 -0
- package/dist/spatial-element/SectionSurfaceRegistry.js.map +1 -0
- package/dist/spatial-element/SpatialElementDockController.d.ts +22 -10
- package/dist/spatial-element/SpatialElementDockController.d.ts.map +1 -1
- package/dist/spatial-element/SpatialElementDockController.js +228 -96
- package/dist/spatial-element/SpatialElementDockController.js.map +1 -1
- package/dist/spatial-element/SpatialElementPaneController.d.ts +67 -0
- package/dist/spatial-element/SpatialElementPaneController.d.ts.map +1 -0
- package/dist/spatial-element/SpatialElementPaneController.js +246 -0
- package/dist/spatial-element/SpatialElementPaneController.js.map +1 -0
- package/dist/spatial-element/activeDetailSection.d.ts +8 -0
- package/dist/spatial-element/activeDetailSection.d.ts.map +1 -0
- package/dist/spatial-element/activeDetailSection.js +19 -0
- package/dist/spatial-element/activeDetailSection.js.map +1 -0
- package/dist/spatial-element/layoutTokens.json +228 -0
- package/dist/spatial-element/messages.d.ts +34 -0
- package/dist/spatial-element/messages.d.ts.map +1 -0
- package/dist/spatial-element/messages.js +34 -0
- package/dist/spatial-element/messages.js.map +1 -0
- package/dist/spatial-element/responsiveLayout.d.ts +1353 -0
- package/dist/spatial-element/responsiveLayout.d.ts.map +1 -0
- package/dist/spatial-element/responsiveLayout.js +210 -0
- package/dist/spatial-element/responsiveLayout.js.map +1 -0
- package/dist/spatial-element/sectionBackground.d.ts +3 -0
- package/dist/spatial-element/sectionBackground.d.ts.map +1 -0
- package/dist/spatial-element/sectionBackground.js +2 -0
- package/dist/spatial-element/sectionBackground.js.map +1 -0
- package/dist/spatial-element/spatialElement.d.ts +17 -12
- package/dist/spatial-element/spatialElement.d.ts.map +1 -1
- package/dist/spatial-element/spatialElement.js +33 -6
- package/dist/spatial-element/spatialElement.js.map +1 -1
- package/dist/spatial-element/spatialElementDock.d.ts +15 -0
- package/dist/spatial-element/spatialElementDock.d.ts.map +1 -1
- package/dist/spatial-element/spatialElementDock.js +22 -0
- package/dist/spatial-element/spatialElementDock.js.map +1 -1
- package/dist/spatial-element/spatialElementGeometry.d.ts +22 -0
- package/dist/spatial-element/spatialElementGeometry.d.ts.map +1 -0
- package/dist/spatial-element/spatialElementGeometry.js +40 -0
- package/dist/spatial-element/spatialElementGeometry.js.map +1 -0
- package/dist/spatial-element/spatialElementMedia.d.ts +16 -0
- package/dist/spatial-element/spatialElementMedia.d.ts.map +1 -0
- package/dist/spatial-element/spatialElementMedia.js +29 -0
- package/dist/spatial-element/spatialElementMedia.js.map +1 -0
- package/dist/spatial-element/spatialElementScene.d.ts +16 -0
- package/dist/spatial-element/spatialElementScene.d.ts.map +1 -0
- package/dist/spatial-element/spatialElementScene.js +22 -0
- package/dist/spatial-element/spatialElementScene.js.map +1 -0
- package/dist/spatial-element/spatialElementSectionRegistry.d.ts +6 -25
- package/dist/spatial-element/spatialElementSectionRegistry.d.ts.map +1 -1
- package/dist/spatial-element/spatialElementSectionRegistry.js +6 -63
- package/dist/spatial-element/spatialElementSectionRegistry.js.map +1 -1
- package/dist/spatial-element/spatialTheme.d.ts +27 -0
- package/dist/spatial-element/spatialTheme.d.ts.map +1 -0
- package/dist/spatial-element/spatialTheme.js +83 -0
- package/dist/spatial-element/spatialTheme.js.map +1 -0
- package/dist/spatial-element/types.d.ts +117 -36
- package/dist/spatial-element/types.d.ts.map +1 -1
- package/dist/spatial-element/types.js.map +1 -1
- package/dist/stage/BackgroundLayerOutput.d.ts +76 -0
- package/dist/stage/BackgroundLayerOutput.d.ts.map +1 -0
- package/dist/stage/BackgroundLayerOutput.js +333 -0
- package/dist/stage/BackgroundLayerOutput.js.map +1 -0
- package/dist/stage/DeviceGeometryMotion.d.ts +13 -0
- package/dist/stage/DeviceGeometryMotion.d.ts.map +1 -0
- package/dist/stage/DeviceGeometryMotion.js +37 -0
- package/dist/stage/DeviceGeometryMotion.js.map +1 -0
- package/dist/stage/LiquidGlassPanel.d.ts +7 -0
- package/dist/stage/LiquidGlassPanel.d.ts.map +1 -1
- package/dist/stage/LiquidGlassPanel.js +46 -5
- package/dist/stage/LiquidGlassPanel.js.map +1 -1
- package/dist/stage/MinimapController.d.ts +4 -1
- package/dist/stage/MinimapController.d.ts.map +1 -1
- package/dist/stage/MinimapController.js +57 -66
- package/dist/stage/MinimapController.js.map +1 -1
- package/dist/stage/ModelPointerPreview.d.ts +22 -0
- package/dist/stage/ModelPointerPreview.d.ts.map +1 -0
- package/dist/stage/ModelPointerPreview.js +71 -0
- package/dist/stage/ModelPointerPreview.js.map +1 -0
- package/dist/stage/PageBindingController.d.ts +10 -0
- package/dist/stage/PageBindingController.d.ts.map +1 -1
- package/dist/stage/PageBindingController.js +45 -5
- package/dist/stage/PageBindingController.js.map +1 -1
- package/dist/stage/PanelPresentationController.d.ts +21 -1
- package/dist/stage/PanelPresentationController.d.ts.map +1 -1
- package/dist/stage/PanelPresentationController.js +190 -31
- package/dist/stage/PanelPresentationController.js.map +1 -1
- package/dist/stage/SpatialElementInteractionController.d.ts +19 -1
- package/dist/stage/SpatialElementInteractionController.d.ts.map +1 -1
- package/dist/stage/SpatialElementInteractionController.js +134 -13
- package/dist/stage/SpatialElementInteractionController.js.map +1 -1
- package/dist/stage/SpatialElementPresentationController.d.ts +14 -2
- package/dist/stage/SpatialElementPresentationController.d.ts.map +1 -1
- package/dist/stage/SpatialElementPresentationController.js +47 -2
- package/dist/stage/SpatialElementPresentationController.js.map +1 -1
- package/dist/stage/SpatialElementRefinement.d.ts +34 -1
- package/dist/stage/SpatialElementRefinement.d.ts.map +1 -1
- package/dist/stage/SpatialElementRefinement.js +175 -37
- package/dist/stage/SpatialElementRefinement.js.map +1 -1
- package/dist/stage/StageExperience.d.ts +263 -10
- package/dist/stage/StageExperience.d.ts.map +1 -1
- package/dist/stage/StageExperience.js +655 -124
- 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/StagePanelRuntime.d.ts +2 -1
- package/dist/stage/StagePanelRuntime.d.ts.map +1 -1
- package/dist/stage/StagePanelRuntime.js.map +1 -1
- package/dist/stage/StageRenderPipeline.d.ts +90 -2
- package/dist/stage/StageRenderPipeline.d.ts.map +1 -1
- package/dist/stage/StageRenderPipeline.js +494 -119
- package/dist/stage/StageRenderPipeline.js.map +1 -1
- package/dist/stage/VirtualScrollController.d.ts +7 -0
- package/dist/stage/VirtualScrollController.d.ts.map +1 -1
- package/dist/stage/VirtualScrollController.js +63 -6
- package/dist/stage/VirtualScrollController.js.map +1 -1
- package/dist/stage/inertLease.d.ts +2 -0
- package/dist/stage/inertLease.d.ts.map +1 -0
- package/dist/stage/inertLease.js +18 -0
- package/dist/stage/inertLease.js.map +1 -0
- package/dist/stage/interactionGuidance.d.ts +22 -0
- package/dist/stage/interactionGuidance.d.ts.map +1 -0
- package/dist/stage/interactionGuidance.js +53 -0
- package/dist/stage/interactionGuidance.js.map +1 -0
- package/dist/stage/interactionOutline.d.ts +14 -0
- package/dist/stage/interactionOutline.d.ts.map +1 -0
- package/dist/stage/interactionOutline.js +59 -0
- package/dist/stage/interactionOutline.js.map +1 -0
- package/dist/stage/minimap/MinimapGeometry.d.ts.map +1 -1
- package/dist/stage/minimap/MinimapGeometry.js +29 -0
- package/dist/stage/minimap/MinimapGeometry.js.map +1 -1
- package/dist/stage/minimap/MinimapModel.d.ts +2 -1
- package/dist/stage/minimap/MinimapModel.d.ts.map +1 -1
- package/dist/stage/minimap/MinimapModel.js +34 -4
- package/dist/stage/minimap/MinimapModel.js.map +1 -1
- package/dist/stage/minimap/MinimapModelGeometry.d.ts +21 -0
- package/dist/stage/minimap/MinimapModelGeometry.d.ts.map +1 -0
- package/dist/stage/minimap/MinimapModelGeometry.js +68 -0
- package/dist/stage/minimap/MinimapModelGeometry.js.map +1 -0
- 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/minimap/MinimapState.d.ts +3 -8
- package/dist/stage/minimap/MinimapState.d.ts.map +1 -1
- package/dist/stage/minimap/MinimapState.js.map +1 -1
- package/dist/stage/mouseHover.d.ts +9 -0
- package/dist/stage/mouseHover.d.ts.map +1 -0
- package/dist/stage/mouseHover.js +55 -0
- package/dist/stage/mouseHover.js.map +1 -0
- package/dist/stage/panelContext.d.ts +27 -2
- package/dist/stage/panelContext.d.ts.map +1 -1
- package/dist/stage/panelContext.js.map +1 -1
- package/dist/stage/renderSettings.d.ts +10 -0
- package/dist/stage/renderSettings.d.ts.map +1 -0
- package/dist/stage/renderSettings.js +27 -0
- package/dist/stage/renderSettings.js.map +1 -0
- package/dist/stage/renderTargetInventory.d.ts +1 -1
- package/dist/stage/renderTargetInventory.js +1 -1
- package/dist/stage/renderTargetInventory.js.map +1 -1
- package/dist/stage/rendererState.d.ts +2 -0
- package/dist/stage/rendererState.d.ts.map +1 -1
- package/dist/stage/rendererState.js +13 -0
- package/dist/stage/rendererState.js.map +1 -1
- package/dist/stage/sceneEndpointEligibility.d.ts +20 -0
- package/dist/stage/sceneEndpointEligibility.d.ts.map +1 -0
- package/dist/stage/sceneEndpointEligibility.js +363 -0
- package/dist/stage/sceneEndpointEligibility.js.map +1 -0
- package/dist/stage/scrollFrame.d.ts +2 -0
- package/dist/stage/scrollFrame.d.ts.map +1 -1
- package/dist/stage/scrollFrame.js +18 -5
- package/dist/stage/scrollFrame.js.map +1 -1
- package/dist/stage/spatialElementFrame.d.ts.map +1 -1
- package/dist/stage/spatialElementFrame.js +5 -1
- package/dist/stage/spatialElementFrame.js.map +1 -1
- package/dist/stage/stageConstants.d.ts +3 -3
- package/dist/stage/stageConstants.d.ts.map +1 -1
- package/dist/stage/stageConstants.js +6 -6
- package/dist/stage/stageConstants.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 +10 -1
- package/dist/stage/stageDom.js.map +1 -1
- package/dist/stage/stageMath.d.ts +9 -10
- package/dist/stage/stageMath.d.ts.map +1 -1
- package/dist/stage/stageMath.js +23 -21
- package/dist/stage/stageMath.js.map +1 -1
- package/dist/stage/stageTypes.d.ts +30 -3
- package/dist/stage/stageTypes.d.ts.map +1 -1
- package/dist/stage/stageTypes.js.map +1 -1
- package/dist/stage/stageVisualTest.d.ts +24 -1
- package/dist/stage/stageVisualTest.d.ts.map +1 -1
- package/dist/stage/stageVisualTest.js.map +1 -1
- package/logo.svg +188 -0
- package/package.json +7 -5
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { describeRenderTargets } from './renderTargetInventory.js';
|
|
2
|
+
import { DeviceGeometryMotion } from './DeviceGeometryMotion.js';
|
|
3
|
+
import { isDeviceOrientationPaused, getListDeviceYaw, getListDevicePitch, getListDeviceRoll, retainListDeviceOrientation, subscribeListDeviceYaw, pauseDeviceOrientationForScroll, holdDeviceOrientationForTransition } from '../catalog/listDeviceOrientation.js';
|
|
2
4
|
import { StageRenderPipeline } from './StageRenderPipeline.js';
|
|
3
5
|
import { PanelPresentationController } from './PanelPresentationController.js';
|
|
4
6
|
import { MinimapController } from './MinimapController.js';
|
|
@@ -21,14 +23,17 @@ import { CSS3DRenderer } from 'three/addons/renderers/CSS3DRenderer.js';
|
|
|
21
23
|
import { uniform } from 'three/tsl';
|
|
22
24
|
import { LiquidGlassPanel, resolveLiquidGlassPanelOptions } from './LiquidGlassPanel.js';
|
|
23
25
|
import { STAGE_PANEL_LAYOUT_EVENT, STAGE_PANEL_VISUAL_EVENT } from './panelContext.js';
|
|
24
|
-
import { DEFAULT_INTERACTION_THEME, DEFAULT_PANELS, PANEL_CAMERA_FOV, PANEL_CONTENT_Z,
|
|
26
|
+
import { DEFAULT_BACKGROUND, DEFAULT_INTERACTION_THEME, DEFAULT_PANELS, PANEL_CAMERA_FOV, PANEL_CONTENT_Z, ZOOM_FOCUS_NOTIFY_EPSILON } from './stageConstants.js';
|
|
25
27
|
import { getStagePositionFromRect, isViewportRectVisible } from './stageDom.js';
|
|
26
|
-
import { STAGE_SCROLL_PRIORITY, getStageVisualScrollPosition, subscribeStageScrollFrame } from './scrollFrame.js';
|
|
27
|
-
import {
|
|
28
|
+
import { STAGE_SCROLL_PRIORITY, getStageVisualScrollPosition, hasPendingStageScrollFrame, subscribeStageScrollFrame } from './scrollFrame.js';
|
|
29
|
+
import { getCameraOrbitDirection, getBoxCorners, getPanelFocusOpacity, getPerspectiveDistance, getSequencedMinimapFocus, getStageUiFocus, getZoomFocusDistanceRange, hasPanelGeometryChanged } from './stageMath.js';
|
|
28
30
|
import {} from './SpaceMouseAdapter.js';
|
|
29
31
|
import { disposeMinimapModelMaterials } from './minimap/MinimapModel.js';
|
|
30
32
|
import {} from './minimap/MinimapProjection.js';
|
|
31
33
|
import { disposeMaterialOnly, getMeshBounds, getMeshMaterials, isMesh } from './stageSceneUtils.js';
|
|
34
|
+
import { isOutlineMesh } from './interactionOutline.js';
|
|
35
|
+
import { resolveDetailLayout, resolveZoomLayout } from '../spatial-element/responsiveLayout.js';
|
|
36
|
+
import { detailCameraFit, detailCameraFitDistance } from '../catalog/stagedDetailGeometry.js';
|
|
32
37
|
const SCROLL_SETTLE_DELAY = 120;
|
|
33
38
|
const VIEWPORT_CULL_MARGIN = 96;
|
|
34
39
|
/** Shared spatial state for both WebGPU glass and DOM-backed panel surfaces. */
|
|
@@ -58,6 +63,7 @@ export class StageExperience {
|
|
|
58
63
|
}
|
|
59
64
|
pipeline;
|
|
60
65
|
backgroundSettings;
|
|
66
|
+
appliedEnvironment;
|
|
61
67
|
pageBackground = '#ffffff';
|
|
62
68
|
hdr;
|
|
63
69
|
glb;
|
|
@@ -103,7 +109,64 @@ export class StageExperience {
|
|
|
103
109
|
catalogLayer;
|
|
104
110
|
catalogHandoff = false;
|
|
105
111
|
catalogMotionComplete = false;
|
|
112
|
+
stagedDetailTarget;
|
|
113
|
+
stagedAwaitingFirstFrame = false;
|
|
114
|
+
stagedSceneCacheOwner;
|
|
115
|
+
stagedRevealPreparing;
|
|
116
|
+
releaseStagedSensorHold;
|
|
117
|
+
/** Use only already submitted source resources during the pre-route movement. */
|
|
118
|
+
beginStagedDetailMotion(source, fit, targetOptions) {
|
|
119
|
+
if (!this.catalogLayer || this.spatialCapture || this.catalogHandoff)
|
|
120
|
+
return false;
|
|
121
|
+
if (this.pipeline.backgroundOutputHeld || !this.catalogLayer.isStagedDetailReady(source.spatialElementId, source.occurrence, this.renderer, this.pipeline.ensureCatalogWarmOutputContext()))
|
|
122
|
+
return false;
|
|
123
|
+
const target = this.catalogLayer.getStagedDetailTarget(source.spatialElementId, source.occurrence, fit, { width: window.innerWidth, height: window.innerHeight }, targetOptions, this.renderer.coordinateSystem);
|
|
124
|
+
if (!target || !this.catalogLayer.capture(source.spatialElementId, source.occurrence))
|
|
125
|
+
return false;
|
|
126
|
+
this.stagedDetailTarget = target;
|
|
127
|
+
// Progress zero preserves the currently displayed source. The transition's
|
|
128
|
+
// clock submits the first changed pose; an intervening Stage RAF would draw
|
|
129
|
+
// that same source again and delay the first visible acknowledgement.
|
|
130
|
+
this.stagedAwaitingFirstFrame = true;
|
|
131
|
+
cancelAnimationFrame(this.renderRequestId);
|
|
132
|
+
this.renderRequestId = 0;
|
|
133
|
+
this.catalogLayer.freezeStagedSource();
|
|
134
|
+
this.releaseStagedSensorHold = holdDeviceOrientationForTransition();
|
|
135
|
+
this.deviceMotion.update(0, 0, 0, 1);
|
|
136
|
+
this.catalogHandoff = true;
|
|
137
|
+
this.catalogMotionComplete = false;
|
|
138
|
+
this.preparationGate.setPaused(true);
|
|
139
|
+
this.detailPreparationGate.setPaused(true);
|
|
140
|
+
this.setStagedDetailProgress(0);
|
|
141
|
+
return true;
|
|
142
|
+
}
|
|
143
|
+
setStagedDetailProgress(progress) {
|
|
144
|
+
if (!this.stagedDetailTarget)
|
|
145
|
+
return;
|
|
146
|
+
this.catalogLayer?.setHandoffTarget({ ...this.stagedDetailTarget, progress, environmentIntensity: 0.5 });
|
|
147
|
+
this.requestRender();
|
|
148
|
+
}
|
|
149
|
+
setStagedDetailPanel(card, corners, width, height) {
|
|
150
|
+
return this.catalogLayer?.setStagedPanel(card, corners, width, height) ?? false;
|
|
151
|
+
}
|
|
152
|
+
setStagedPanelOpacity(opacity) { this.catalogLayer?.setStagedPanelOpacity(opacity); }
|
|
153
|
+
/** Called only after the final moving frame: route teardown may now replace its source. */
|
|
154
|
+
holdStagedDetail(spatialElementId, kind = 'hero') {
|
|
155
|
+
if (!this.stagedDetailTarget)
|
|
156
|
+
return false;
|
|
157
|
+
this.setStagedDetailProgress(1);
|
|
158
|
+
this.flushCatalogFrame();
|
|
159
|
+
const held = this.adoptCatalogPresentation({ spatialElementId, kind }, true);
|
|
160
|
+
this.stagedDetailTarget = undefined;
|
|
161
|
+
return held;
|
|
162
|
+
}
|
|
163
|
+
deferredZoomPreparation = false;
|
|
164
|
+
deferredScrollWarmup;
|
|
165
|
+
zoomPreparationFrame = 0;
|
|
106
166
|
catalogLayerAnimating = false;
|
|
167
|
+
stagedPreparationIdle = 0;
|
|
168
|
+
stagedPreparationFallback = false;
|
|
169
|
+
stagedPreparationAbort = new AbortController();
|
|
107
170
|
catalogPresentation = { ...RESTING_CATALOG_PRESENTATION };
|
|
108
171
|
pageModelReady = false;
|
|
109
172
|
preparationGate = new PreparationGate();
|
|
@@ -177,9 +240,18 @@ export class StageExperience {
|
|
|
177
240
|
get minimaps() {
|
|
178
241
|
return this.minimapController.views;
|
|
179
242
|
}
|
|
180
|
-
resize = () => this.
|
|
243
|
+
resize = () => this.requestRender();
|
|
244
|
+
rendererSize = new THREE.Vector2();
|
|
245
|
+
deviceMotion = new DeviceGeometryMotion();
|
|
246
|
+
deviceOrientationEnabled;
|
|
247
|
+
releaseDeviceOrientation;
|
|
248
|
+
unsubscribeDeviceOrientation;
|
|
181
249
|
render = () => {
|
|
182
250
|
this.renderRequestId = 0;
|
|
251
|
+
// The shared callback will draw after updating DOM/dock positions. Avoid
|
|
252
|
+
// submitting an older camera/scroll frame immediately before that draw.
|
|
253
|
+
if (this.stopScrollFrames && hasPendingStageScrollFrame())
|
|
254
|
+
return;
|
|
183
255
|
this.renderFrame();
|
|
184
256
|
};
|
|
185
257
|
visibilityChange = () => {
|
|
@@ -187,9 +259,15 @@ export class StageExperience {
|
|
|
187
259
|
this.requestRender();
|
|
188
260
|
};
|
|
189
261
|
pointerMove = (event) => this.handlePointerMove(event);
|
|
190
|
-
pointerLeave = () =>
|
|
262
|
+
pointerLeave = (event) => {
|
|
263
|
+
if (event.type === 'blur' || event.pointerType === 'mouse') {
|
|
264
|
+
this.handlePointerLeave();
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
pointerContact = (event) => this.interaction.handlePointerContact(event);
|
|
191
268
|
pointerDown = (event) => this.handlePointerDown(event);
|
|
192
269
|
pointerUp = (event) => this.handlePointerUp(event);
|
|
270
|
+
touchStart = (event) => this.interaction.handleTouchStart(event);
|
|
193
271
|
wheel = (event) => this.handleWheel(event);
|
|
194
272
|
scroll = (frame) => this.handleScrollFrame(frame);
|
|
195
273
|
finishScroll = () => {
|
|
@@ -244,11 +322,46 @@ export class StageExperience {
|
|
|
244
322
|
animationActive = false;
|
|
245
323
|
scrollActive = false;
|
|
246
324
|
scrollEndTimer = 0;
|
|
247
|
-
|
|
325
|
+
// Input events must not reset the frame clock: high-rate wheel/SpaceMouse
|
|
326
|
+
// events can arrive just before RAF and otherwise starve the damping delta.
|
|
327
|
+
lastFrameTime = performance.now();
|
|
248
328
|
layoutDirty = true;
|
|
249
329
|
panelMeasurementsDirty = true;
|
|
250
330
|
viewportMeasurementDirty = true;
|
|
251
331
|
stageViewportVisible = true;
|
|
332
|
+
readLayoutMetrics;
|
|
333
|
+
detailMedia = 'minimap';
|
|
334
|
+
get detailMediaActive() { return this.detailMedia === 'minimap'; }
|
|
335
|
+
/** Changing media keeps the model/cache/camera but stops its interaction and sensor clock. */
|
|
336
|
+
setDetailMedia(media) {
|
|
337
|
+
if (this.detailMedia === media)
|
|
338
|
+
return;
|
|
339
|
+
this.detailMedia = media;
|
|
340
|
+
this.interaction.releasePage();
|
|
341
|
+
if (!this.detailMediaActive) {
|
|
342
|
+
this.releaseDeviceOrientation?.();
|
|
343
|
+
this.releaseDeviceOrientation = undefined;
|
|
344
|
+
}
|
|
345
|
+
this.requestRender();
|
|
346
|
+
}
|
|
347
|
+
readDetailInteractionLayout() {
|
|
348
|
+
const input = this.catalog ? this.readLayoutMetrics?.('stable') : undefined;
|
|
349
|
+
if (!input)
|
|
350
|
+
return;
|
|
351
|
+
const layout = resolveDetailLayout(input);
|
|
352
|
+
const split = layout.composition === 'split';
|
|
353
|
+
return { media: this.detailMedia, split,
|
|
354
|
+
paneHidden: split && (this.fullscreen || this.panelUiFocus >= 0.99),
|
|
355
|
+
paneLeft: layout.base.pane.x };
|
|
356
|
+
}
|
|
357
|
+
fullscreen = false;
|
|
358
|
+
setFullscreen(fullscreen) {
|
|
359
|
+
if (this.fullscreen === fullscreen)
|
|
360
|
+
return;
|
|
361
|
+
this.fullscreen = fullscreen;
|
|
362
|
+
this.interaction.setFullscreen(fullscreen);
|
|
363
|
+
this.resizeRenderer();
|
|
364
|
+
}
|
|
252
365
|
get visiblePanelCount() {
|
|
253
366
|
return this.panels.visiblePanels;
|
|
254
367
|
}
|
|
@@ -302,30 +415,37 @@ export class StageExperience {
|
|
|
302
415
|
*/
|
|
303
416
|
constructor(container, options = {}) {
|
|
304
417
|
this.container = container;
|
|
418
|
+
this.readLayoutMetrics = options.readLayoutMetrics;
|
|
419
|
+
this.detailMedia = options.detailMedia ?? 'minimap';
|
|
305
420
|
if (options.dracoDecoderPath)
|
|
306
421
|
this.assets.setDracoDecoderPath(options.dracoDecoderPath);
|
|
422
|
+
this.deviceOrientationEnabled = options.deviceOrientation ?? false;
|
|
423
|
+
if (this.deviceOrientationEnabled)
|
|
424
|
+
this.unsubscribeDeviceOrientation = subscribeListDeviceYaw(() => {
|
|
425
|
+
if (this.releaseDeviceOrientation && !this.scrollActive)
|
|
426
|
+
this.requestRender();
|
|
427
|
+
});
|
|
307
428
|
this.interaction = new SpatialElementInteractionController({
|
|
308
429
|
camera: this.camera,
|
|
309
430
|
canvas: this.backgroundCanvas,
|
|
310
431
|
container,
|
|
311
432
|
cssRoot: this.cssRenderer.domElement,
|
|
312
433
|
requestRender: () => this.requestRender(),
|
|
313
|
-
markActivity: () => {
|
|
314
|
-
this.lastInteractionTime = performance.now();
|
|
315
|
-
},
|
|
316
434
|
updateProjection: () => this.updateStageCameraProjection(),
|
|
317
435
|
readGeometry: () => ({
|
|
318
436
|
poseOwner: this.catalogHandoff || this.spatialCapture
|
|
319
437
|
? 'transition'
|
|
320
|
-
: this.catalog && !this.viewportTarget
|
|
438
|
+
: !this.detailMediaActive || (this.catalog && !this.viewportTarget)
|
|
321
439
|
? 'none'
|
|
322
440
|
: 'page',
|
|
323
|
-
visible: this.stageViewportVisible,
|
|
441
|
+
visible: this.stageViewportVisible && this.detailMediaActive,
|
|
442
|
+
detail: this.readDetailInteractionLayout(),
|
|
324
443
|
viewport: this.viewportFrame,
|
|
325
444
|
bounds: this.modelBounds
|
|
326
445
|
})
|
|
327
446
|
});
|
|
328
447
|
this.minimapController = new MinimapController({
|
|
448
|
+
sensorRotation: () => this.deviceMotion.rotation,
|
|
329
449
|
renderer: this.renderer,
|
|
330
450
|
camera: this.camera,
|
|
331
451
|
panelCamera: this.panelCamera,
|
|
@@ -339,12 +459,13 @@ export class StageExperience {
|
|
|
339
459
|
restCamera: this.initialCameraWorldQuaternion,
|
|
340
460
|
restModel: this.initialModelWorldQuaternion,
|
|
341
461
|
hasControls: Boolean(this.controls),
|
|
342
|
-
|
|
462
|
+
center: this.initialControlsTarget
|
|
343
463
|
}),
|
|
344
464
|
frame: () => ({
|
|
345
465
|
hovering: this.modelHover,
|
|
346
466
|
interacting: this.modelInteractionActive,
|
|
347
|
-
scrolling: this.scrollActive
|
|
467
|
+
scrolling: this.scrollActive,
|
|
468
|
+
fullscreen: this.fullscreen
|
|
348
469
|
}),
|
|
349
470
|
environment: () => this.environmentTarget,
|
|
350
471
|
capture: () => this.pipeline.activeRenderTargets,
|
|
@@ -354,6 +475,10 @@ export class StageExperience {
|
|
|
354
475
|
includeMesh: (mesh) => this.isSpatialElementMesh(mesh)
|
|
355
476
|
});
|
|
356
477
|
this.panels = new PanelPresentationController({
|
|
478
|
+
zoomLayout: () => {
|
|
479
|
+
const input = this.catalog ? this.readLayoutMetrics?.('visible') : undefined;
|
|
480
|
+
return input ? resolveZoomLayout(input) : undefined;
|
|
481
|
+
},
|
|
357
482
|
camera: this.panelCamera,
|
|
358
483
|
contentScene: this.panelContentScene,
|
|
359
484
|
flatLayer: this.flatPanelLayer,
|
|
@@ -365,6 +490,7 @@ export class StageExperience {
|
|
|
365
490
|
presentation: this.catalogPresentation,
|
|
366
491
|
minimapFocus: this.minimapFocus,
|
|
367
492
|
uiFocus: this.panelUiFocus,
|
|
493
|
+
fullscreen: this.fullscreen,
|
|
368
494
|
pointer: this.pointer
|
|
369
495
|
}),
|
|
370
496
|
visible: (index) => this.isPanelTargetVisible(index),
|
|
@@ -401,6 +527,7 @@ export class StageExperience {
|
|
|
401
527
|
: DEFAULT_PANELS;
|
|
402
528
|
this.pipeline = new StageRenderPipeline({
|
|
403
529
|
pageBackground: (this.pageBackground = options.pageBackground ?? '#ffffff'),
|
|
530
|
+
renderSettings: options.renderSettings,
|
|
404
531
|
renderer: this.renderer,
|
|
405
532
|
container: this.container,
|
|
406
533
|
backgroundCanvas: this.backgroundCanvas,
|
|
@@ -427,6 +554,7 @@ export class StageExperience {
|
|
|
427
554
|
catalogHandoff: this.catalogHandoff,
|
|
428
555
|
catalogMotionComplete: this.catalogMotionComplete,
|
|
429
556
|
stageViewportVisible: this.stageViewportVisible,
|
|
557
|
+
detailMediaActive: this.detailMediaActive,
|
|
430
558
|
modelHover: this.modelHover,
|
|
431
559
|
modelInteractionActive: this.modelInteractionActive,
|
|
432
560
|
catalog: this.catalog,
|
|
@@ -467,6 +595,7 @@ export class StageExperience {
|
|
|
467
595
|
this.renderer.dispose();
|
|
468
596
|
return;
|
|
469
597
|
}
|
|
598
|
+
this.pipeline.initializeBackgroundOutput();
|
|
470
599
|
this.backgroundCanvas.className = 'stage-webgpu-background';
|
|
471
600
|
this.container.appendChild(this.backgroundCanvas);
|
|
472
601
|
this.configureCssRenderer();
|
|
@@ -491,6 +620,9 @@ export class StageExperience {
|
|
|
491
620
|
this.pipeline.createSceneCapture();
|
|
492
621
|
this.createPanels();
|
|
493
622
|
this.resizeRenderer();
|
|
623
|
+
// Reparenting must preserve the already visible HTML in the same task;
|
|
624
|
+
// shader compilation below can yield for more than one browser frame.
|
|
625
|
+
this.renderPanelContents();
|
|
494
626
|
this.pipeline.warmRenderTargetSets();
|
|
495
627
|
await this.pipeline.prepareZoomEffects();
|
|
496
628
|
if (this.disposed)
|
|
@@ -501,16 +633,19 @@ export class StageExperience {
|
|
|
501
633
|
this.currentScrollY = scrollPosition.scrollY;
|
|
502
634
|
this.lastScrollY = this.currentScrollY;
|
|
503
635
|
window.addEventListener('resize', this.resize);
|
|
636
|
+
window.visualViewport?.addEventListener('resize', this.resize);
|
|
504
637
|
this.stopScrollFrames = subscribeStageScrollFrame(this.scroll, STAGE_SCROLL_PRIORITY.stage);
|
|
505
638
|
window.addEventListener(STAGE_PANEL_LAYOUT_EVENT, this.requestPanelSync);
|
|
506
639
|
window.addEventListener(STAGE_PANEL_VISUAL_EVENT, this.requestPanelVisualSync);
|
|
507
640
|
window.addEventListener('pointermove', this.pointerMove);
|
|
641
|
+
window.addEventListener('pointerdown', this.pointerContact, { capture: true, passive: true });
|
|
508
642
|
window.addEventListener('pointerup', this.pointerUp);
|
|
509
643
|
window.addEventListener('pointercancel', this.pointerUp);
|
|
510
644
|
window.addEventListener('pointerleave', this.pointerLeave);
|
|
511
645
|
window.addEventListener('blur', this.pointerLeave);
|
|
512
646
|
document.addEventListener('visibilitychange', this.visibilityChange);
|
|
513
647
|
this.backgroundCanvas.addEventListener('pointerdown', this.pointerDown, { capture: true });
|
|
648
|
+
this.backgroundCanvas.addEventListener('touchstart', this.touchStart, { passive: false });
|
|
514
649
|
this.backgroundCanvas.addEventListener('wheel', this.wheel, {
|
|
515
650
|
capture: true,
|
|
516
651
|
passive: false
|
|
@@ -524,14 +659,27 @@ export class StageExperience {
|
|
|
524
659
|
if (this.disposed)
|
|
525
660
|
return;
|
|
526
661
|
this.disposed = true;
|
|
662
|
+
this.stagedPreparationAbort.abort();
|
|
663
|
+
if (this.stagedPreparationIdle) {
|
|
664
|
+
if (this.stagedPreparationFallback)
|
|
665
|
+
clearTimeout(this.stagedPreparationIdle);
|
|
666
|
+
else
|
|
667
|
+
window.cancelIdleCallback(this.stagedPreparationIdle);
|
|
668
|
+
}
|
|
669
|
+
this.releaseDeviceOrientation?.();
|
|
670
|
+
this.unsubscribeDeviceOrientation?.();
|
|
671
|
+
this.releaseStagedSensorHold?.();
|
|
672
|
+
this.releaseStagedSensorHold = undefined;
|
|
527
673
|
this.releaseSpatialCapture();
|
|
528
674
|
this.container.removeAttribute('data-stage-scroll-rendering');
|
|
529
675
|
window.removeEventListener('resize', this.resize);
|
|
676
|
+
window.visualViewport?.removeEventListener('resize', this.resize);
|
|
530
677
|
this.stopScrollFrames?.();
|
|
531
678
|
this.stopScrollFrames = undefined;
|
|
532
679
|
window.removeEventListener(STAGE_PANEL_LAYOUT_EVENT, this.requestPanelSync);
|
|
533
680
|
window.removeEventListener(STAGE_PANEL_VISUAL_EVENT, this.requestPanelVisualSync);
|
|
534
681
|
window.removeEventListener('pointermove', this.pointerMove);
|
|
682
|
+
window.removeEventListener('pointerdown', this.pointerContact, { capture: true });
|
|
535
683
|
window.removeEventListener('pointerup', this.pointerUp);
|
|
536
684
|
window.removeEventListener('pointercancel', this.pointerUp);
|
|
537
685
|
window.removeEventListener('pointerleave', this.pointerLeave);
|
|
@@ -541,6 +689,7 @@ export class StageExperience {
|
|
|
541
689
|
capture: true
|
|
542
690
|
});
|
|
543
691
|
this.backgroundCanvas.removeEventListener('wheel', this.wheel, { capture: true });
|
|
692
|
+
this.backgroundCanvas.removeEventListener('touchstart', this.touchStart);
|
|
544
693
|
if (this.renderRequestId)
|
|
545
694
|
cancelAnimationFrame(this.renderRequestId);
|
|
546
695
|
this.renderRequestId = 0;
|
|
@@ -572,6 +721,10 @@ export class StageExperience {
|
|
|
572
721
|
}
|
|
573
722
|
/** Page DOM is a replaceable binding, not the owner of the device or element cache. */
|
|
574
723
|
releasePage() {
|
|
724
|
+
cancelAnimationFrame(this.zoomPreparationFrame);
|
|
725
|
+
this.zoomPreparationFrame = 0;
|
|
726
|
+
this.deferredZoomPreparation = false;
|
|
727
|
+
this.deferredScrollWarmup = undefined;
|
|
575
728
|
this.pageBinding.invalidate();
|
|
576
729
|
this.pageModelReady = false;
|
|
577
730
|
this.presentation.cancelRequests();
|
|
@@ -601,6 +754,12 @@ export class StageExperience {
|
|
|
601
754
|
element);
|
|
602
755
|
}
|
|
603
756
|
capturePanelSurface(element) {
|
|
757
|
+
if (element.closest('[data-carousel-spatial-element]')) {
|
|
758
|
+
const bounds = element.matches('.summary') ? element :
|
|
759
|
+
(element.closest('[data-spatial-presentation-root]') ?? element);
|
|
760
|
+
const surface = bounds.querySelector('.spatial-summary-surface');
|
|
761
|
+
return captureCssSurface(bounds, surface ?? bounds, surface ? undefined : '::before');
|
|
762
|
+
}
|
|
604
763
|
if (element.hasAttribute('data-catalog-dock-surface')) {
|
|
605
764
|
const header = element.closest('[data-spatial-element-sticky-header]');
|
|
606
765
|
if (header)
|
|
@@ -674,9 +833,82 @@ export class StageExperience {
|
|
|
674
833
|
return;
|
|
675
834
|
return { width, height, corners: corners };
|
|
676
835
|
}
|
|
836
|
+
/** Updates appearance in place. Model leases, camera, interaction and page navigation stay intact. */
|
|
837
|
+
updateAppearance(options) {
|
|
838
|
+
if (this.disposed)
|
|
839
|
+
return;
|
|
840
|
+
this.pageBackground = options.pageBackground ?? '#ffffff';
|
|
841
|
+
this.pipeline.setPageBackground(this.pageBackground);
|
|
842
|
+
this.catalogLayer?.setPageBackground(this.pageBackground);
|
|
843
|
+
this.backgroundSettings = { ...DEFAULT_BACKGROUND, ...options.background };
|
|
844
|
+
if (this.appliedEnvironment) {
|
|
845
|
+
this.backgroundScene.background = this.backgroundSettings.blurriness <= 0
|
|
846
|
+
? this.appliedEnvironment.source : this.appliedEnvironment.target.texture;
|
|
847
|
+
}
|
|
848
|
+
this.backgroundScene.backgroundBlurriness = this.backgroundSettings.blurriness;
|
|
849
|
+
if (this.tintMaterial) {
|
|
850
|
+
this.tintMaterial.color.set(this.backgroundSettings.tint);
|
|
851
|
+
this.tintMaterial.opacity = this.backgroundSettings.tintIntensity;
|
|
852
|
+
}
|
|
853
|
+
const previousExcludeMesh = this.interactionTheme.excludeMesh;
|
|
854
|
+
Object.assign(this.interactionTheme, DEFAULT_INTERACTION_THEME, { excludeMesh: undefined }, options.interactionTheme);
|
|
855
|
+
this.pipeline.updateInteractionTheme();
|
|
856
|
+
if (previousExcludeMesh !== this.interactionTheme.excludeMesh && this.model) {
|
|
857
|
+
const pickModel = this.refinementState === 'high' && this.highPose ? this.highPose : this.model;
|
|
858
|
+
this.collectModelPickTargets(pickModel);
|
|
859
|
+
if (pickModel === this.model)
|
|
860
|
+
this.pipeline.createModelOutline(this.model);
|
|
861
|
+
else {
|
|
862
|
+
const outline = this.model.clone(false);
|
|
863
|
+
outline.add(pickModel.clone(true));
|
|
864
|
+
this.pipeline.createModelOutline(outline);
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
const changed = [];
|
|
868
|
+
let surfaceChanged = false;
|
|
869
|
+
for (const next of options.panels ?? []) {
|
|
870
|
+
const index = this.panelTargets.findIndex((target) => target.frame === next.frame);
|
|
871
|
+
const target = this.panelTargets[index];
|
|
872
|
+
if (!target)
|
|
873
|
+
continue; // Navigation owns newly registered panels.
|
|
874
|
+
const appearance = (panel) => JSON.stringify([
|
|
875
|
+
panel.options, panel.minimap, panel.surface, panel.contentInset, panel.nativeContent
|
|
876
|
+
]);
|
|
877
|
+
if (appearance(target) === appearance(next))
|
|
878
|
+
continue;
|
|
879
|
+
surfaceChanged ||= target.surface !== next.surface || target.nativeContent !== next.nativeContent;
|
|
880
|
+
Object.assign(target, next);
|
|
881
|
+
changed.push(index);
|
|
882
|
+
}
|
|
883
|
+
if (changed.length) {
|
|
884
|
+
this.fallbackPanelOptions = this.panelTargets
|
|
885
|
+
.filter((target) => target.surface === 'glass' || target.minimap).map((target) => target.options);
|
|
886
|
+
this.pipeline.syncPanelBlurCaptures();
|
|
887
|
+
if (surfaceChanged) {
|
|
888
|
+
// Surface/DOM ownership changes move the entire live root, never its children or scene.
|
|
889
|
+
this.minimapController.dispose();
|
|
890
|
+
this.panels.release();
|
|
891
|
+
this.createPanels();
|
|
892
|
+
}
|
|
893
|
+
else
|
|
894
|
+
for (const index of changed) {
|
|
895
|
+
const target = this.panelTargets[index];
|
|
896
|
+
const measured = this.getMeasuredPanelOptions(target, true);
|
|
897
|
+
if (this.panelRuntimes[index]?.glass)
|
|
898
|
+
this.replacePanel(index, measured);
|
|
899
|
+
else if (this.panelRuntimes[index])
|
|
900
|
+
this.panelRuntimes[index].options = resolveLiquidGlassPanelOptions(measured);
|
|
901
|
+
this.createMinimap(index, target.minimap);
|
|
902
|
+
}
|
|
903
|
+
this.panelMeasurementsDirty = this.layoutDirty = true;
|
|
904
|
+
}
|
|
905
|
+
this.requestRender();
|
|
906
|
+
}
|
|
677
907
|
async updatePage(options) {
|
|
678
908
|
if (this.disposed)
|
|
679
909
|
return;
|
|
910
|
+
if ('renderSettings' in options)
|
|
911
|
+
this.pipeline.setRenderSettings(options.renderSettings);
|
|
680
912
|
this.pageBackground = options.pageBackground ?? '#ffffff';
|
|
681
913
|
this.pipeline.setPageBackground(this.pageBackground);
|
|
682
914
|
this.catalogLayer?.setPageBackground(this.pageBackground);
|
|
@@ -733,8 +965,14 @@ export class StageExperience {
|
|
|
733
965
|
this.createPanels();
|
|
734
966
|
this.observePanelTargets();
|
|
735
967
|
this.resizeRenderer();
|
|
968
|
+
// Navigation needs the visible full-quality frame, not future scroll/zoom variants.
|
|
969
|
+
// Direct/zoomed entries keep eager warming; ordinary handoffs warm after their final paint.
|
|
970
|
+
this.deferredZoomPreparation = this.catalogPresentation.active && this.panelUiFocus === 0;
|
|
971
|
+
if (!this.deferredZoomPreparation)
|
|
972
|
+
this.pipeline.warmRenderTargetSets();
|
|
736
973
|
this.renderFrame(true);
|
|
737
|
-
|
|
974
|
+
if (!this.deferredZoomPreparation)
|
|
975
|
+
await this.pipeline.prepareZoomEffects();
|
|
738
976
|
if (this.disposed || !this.pageBinding.isCurrent(generation))
|
|
739
977
|
return;
|
|
740
978
|
// A submitted Low/panel frame is not yet GPU-ready. Drain the required binding work
|
|
@@ -747,14 +985,118 @@ export class StageExperience {
|
|
|
747
985
|
void this.initializeSpaceMouse();
|
|
748
986
|
}
|
|
749
987
|
setCatalogSpatialElements(brandId, items) {
|
|
750
|
-
this.catalogLayer ??= new CatalogSpatialElementLayer(this.assets, () => this.requestRender());
|
|
988
|
+
this.catalogLayer ??= new CatalogSpatialElementLayer(this.assets, () => this.requestRender(), () => this.interactionTheme);
|
|
751
989
|
this.catalogLayer.setPageBackground(this.pageBackground);
|
|
752
990
|
this.catalogLayer.setExitOpacity(this.returnSpatialElement
|
|
753
991
|
? this.catalogPresentation.enterOpacity
|
|
754
992
|
: this.catalogPresentation.exitOpacity, this.catalogPresentation.active);
|
|
755
993
|
return this.catalogLayer.setSpatialElements(brandId, items);
|
|
756
994
|
}
|
|
995
|
+
/** Finish required DETAIL GPU preparation before its first visible reveal frame.
|
|
996
|
+
* Binding happens with enterOpacity=0, which intentionally skips minimaps and
|
|
997
|
+
* panel blur passes. Borrow fractional/end-point alpha to prepare both real
|
|
998
|
+
* material owners, restore all presentation state synchronously, then fence.
|
|
999
|
+
*/
|
|
1000
|
+
async prepareStagedReveal(signal) {
|
|
1001
|
+
if (this.disposed || signal?.aborted || !this.catalogPresentation.active)
|
|
1002
|
+
return false;
|
|
1003
|
+
const generation = this.pageBinding.token;
|
|
1004
|
+
const owner = {};
|
|
1005
|
+
const pageBackground = this.pageBackground;
|
|
1006
|
+
this.presentation.invalidateSceneEndpoints();
|
|
1007
|
+
this.stagedSceneCacheOwner = this.stagedRevealPreparing = owner;
|
|
1008
|
+
const presentation = this.catalogPresentation;
|
|
1009
|
+
const backgroundReveal = this.catalogBackgroundReveal.value;
|
|
1010
|
+
let prepared = true;
|
|
1011
|
+
let succeeded = false;
|
|
1012
|
+
let ticket;
|
|
1013
|
+
let scrollWarmup;
|
|
1014
|
+
this.deferredScrollWarmup = undefined;
|
|
1015
|
+
try {
|
|
1016
|
+
try {
|
|
1017
|
+
// List/Card does not necessarily flush after binding. Adopt only already-ready
|
|
1018
|
+
// asynchronous High; this starts no loading and advances neither p nor q.
|
|
1019
|
+
if (this.pageModelReady && this.catalogHandoff && this.catalogMotionComplete && !this.catalogDockTarget &&
|
|
1020
|
+
this.catalogMode !== 'synchronous' && this.pagePreparation?.highState === 'ready')
|
|
1021
|
+
this.adoptPreparedHigh();
|
|
1022
|
+
// Programmatic dock restoration may still own the temporary scroll targets.
|
|
1023
|
+
// The reveal uses full quality; do not let its settle timer select cold targets.
|
|
1024
|
+
this.pipeline.setScrollRenderQuality(false);
|
|
1025
|
+
this.syncPanelLayouts();
|
|
1026
|
+
for (const opacity of [0.5, 1]) {
|
|
1027
|
+
this.catalogPresentation = {
|
|
1028
|
+
...presentation, enterOpacity: opacity, sharedOpacity: opacity
|
|
1029
|
+
};
|
|
1030
|
+
this.catalogBackgroundReveal.value = opacity;
|
|
1031
|
+
this.updatePanelPointerInteraction(0);
|
|
1032
|
+
if (!this.pipeline.warmRevealFrame()) {
|
|
1033
|
+
prepared = false;
|
|
1034
|
+
break;
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
if (prepared && this.deferredZoomPreparation && !this.catalogDockTarget && !this.refinement) {
|
|
1038
|
+
const model = this.model, low = this.presentation.assetInstance, high = this.highInstance, environment = this.scene.environment, background = this.backgroundScene.background;
|
|
1039
|
+
scrollWarmup = this.pipeline.captureDeferredScrollWarmup(() => !this.disposed && !signal?.aborted && this.pageBinding.isCurrent(generation) && this.pageModelReady && this.detailMediaActive &&
|
|
1040
|
+
this.model === model && this.presentation.assetInstance === low && this.highInstance === high && !this.refinement &&
|
|
1041
|
+
this.scene.environment === environment && this.backgroundScene.background === background && this.pageBackground === pageBackground);
|
|
1042
|
+
}
|
|
1043
|
+
// Shader/target warm-up is finished. Only now capture final endpoint pixels.
|
|
1044
|
+
if (prepared && this.catalogHandoff && this.catalogMotionComplete && !this.catalogDockTarget &&
|
|
1045
|
+
this.renderer.backend.isWebGPUBackend) {
|
|
1046
|
+
try {
|
|
1047
|
+
ticket = this.pipeline.withSceneCapture(() => {
|
|
1048
|
+
const target = this.renderer.getRenderTarget();
|
|
1049
|
+
const width = target.width, height = target.height;
|
|
1050
|
+
return this.presentation.prepareSceneEndpoints(this.renderer, this.scene, this.camera, this.pagePreparation?.environment.value?.target.texture, (p) => {
|
|
1051
|
+
const previous = this.catalogBackgroundReveal.value;
|
|
1052
|
+
this.catalogBackgroundReveal.value = p;
|
|
1053
|
+
try {
|
|
1054
|
+
this.pipeline.renderStageContents();
|
|
1055
|
+
}
|
|
1056
|
+
finally {
|
|
1057
|
+
this.catalogBackgroundReveal.value = previous;
|
|
1058
|
+
}
|
|
1059
|
+
}, () => !this.disposed && !signal?.aborted && this.stagedSceneCacheOwner === owner && this.pageBinding.isCurrent(generation) &&
|
|
1060
|
+
this.catalogPresentation.active && !this.catalogDockTarget && this.detailMediaActive &&
|
|
1061
|
+
this.pageBackground === pageBackground && this.pipeline.isSceneCaptureCurrent(target, width, height), [this.backgroundScene, this.tintScene], [this.tintCamera]);
|
|
1062
|
+
});
|
|
1063
|
+
}
|
|
1064
|
+
catch (error) {
|
|
1065
|
+
console.warn('Optional staged scene endpoint preparation failed; retaining live rendering', error);
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
finally {
|
|
1070
|
+
this.catalogPresentation = presentation;
|
|
1071
|
+
this.catalogBackgroundReveal.value = backgroundReveal;
|
|
1072
|
+
this.updatePanelPointerInteraction(0);
|
|
1073
|
+
}
|
|
1074
|
+
if (!prepared)
|
|
1075
|
+
return false;
|
|
1076
|
+
const device = this.renderer.backend.device;
|
|
1077
|
+
await device?.queue.onSubmittedWorkDone();
|
|
1078
|
+
if (this.disposed || signal?.aborted || !this.pageBinding.isCurrent(generation) || this.stagedSceneCacheOwner !== owner)
|
|
1079
|
+
return false;
|
|
1080
|
+
// A live Low/High write during the fence invalidates its ticket even with the same page generation.
|
|
1081
|
+
ticket?.commit();
|
|
1082
|
+
this.deferredScrollWarmup = scrollWarmup;
|
|
1083
|
+
succeeded = true;
|
|
1084
|
+
return true;
|
|
1085
|
+
}
|
|
1086
|
+
finally {
|
|
1087
|
+
if (this.stagedRevealPreparing === owner)
|
|
1088
|
+
this.stagedRevealPreparing = undefined;
|
|
1089
|
+
if (!succeeded)
|
|
1090
|
+
ticket?.cancel();
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
757
1093
|
setCatalogTransitionPresentation(state) {
|
|
1094
|
+
if (!state.active) {
|
|
1095
|
+
this.stagedSceneCacheOwner = undefined;
|
|
1096
|
+
this.presentation.invalidateSceneEndpoints();
|
|
1097
|
+
}
|
|
1098
|
+
if (!state.active)
|
|
1099
|
+
this.scheduleZoomPreparation();
|
|
758
1100
|
this.catalogPresentation = normalizeCatalogPresentation(state);
|
|
759
1101
|
for (const entry of this.exitingMinimaps) {
|
|
760
1102
|
this.setMinimapDisplayModelOpacity(entry.minimap, entry.opacity * state.exitOpacity);
|
|
@@ -779,6 +1121,58 @@ export class StageExperience {
|
|
|
779
1121
|
this.backgroundCanvas.style.opacity = String(state.active ? state.exitOpacity : 0);
|
|
780
1122
|
this.requestRender();
|
|
781
1123
|
}
|
|
1124
|
+
scheduleZoomPreparation() {
|
|
1125
|
+
if (!this.deferredZoomPreparation || this.zoomPreparationFrame || this.disposed)
|
|
1126
|
+
return;
|
|
1127
|
+
const generation = this.pageBinding.token;
|
|
1128
|
+
// A nested RAF lets the final transition frame paint before optional work starts.
|
|
1129
|
+
this.zoomPreparationFrame = requestAnimationFrame(() => {
|
|
1130
|
+
this.zoomPreparationFrame = requestAnimationFrame(() => {
|
|
1131
|
+
this.zoomPreparationFrame = 0;
|
|
1132
|
+
if (this.disposed || !this.pageBinding.isCurrent(generation) || this.catalogPresentation.active)
|
|
1133
|
+
return;
|
|
1134
|
+
this.deferredZoomPreparation = false;
|
|
1135
|
+
const scrollWarmup = this.deferredScrollWarmup;
|
|
1136
|
+
this.deferredScrollWarmup = undefined;
|
|
1137
|
+
void (async () => {
|
|
1138
|
+
if (!scrollWarmup || !this.pipeline.warmInactiveScrollTargetSet(scrollWarmup))
|
|
1139
|
+
this.pipeline.warmRenderTargetSets();
|
|
1140
|
+
await this.pipeline.prepareZoomEffects();
|
|
1141
|
+
if (!this.disposed && this.pageBinding.isCurrent(generation))
|
|
1142
|
+
this.requestRender();
|
|
1143
|
+
})().catch(error => {
|
|
1144
|
+
// Rendering still prepares effects on demand if optional warming fails.
|
|
1145
|
+
if (!this.disposed && this.pageBinding.isCurrent(generation))
|
|
1146
|
+
console.warn('Optional zoom preparation failed', error);
|
|
1147
|
+
});
|
|
1148
|
+
});
|
|
1149
|
+
});
|
|
1150
|
+
}
|
|
1151
|
+
scheduleStagedPreparation() {
|
|
1152
|
+
if (this.disposed || this.stagedPreparationIdle || this.catalogHandoff || this.scrollActive ||
|
|
1153
|
+
this.catalogPresentation.active || this.pipeline.backgroundOutputHeld ||
|
|
1154
|
+
!this.catalogLayer?.needsStagedPreparation(this.renderer, this.pipeline.ensureCatalogWarmOutputContext()))
|
|
1155
|
+
return;
|
|
1156
|
+
const prepare = () => {
|
|
1157
|
+
this.stagedPreparationIdle = 0;
|
|
1158
|
+
if (this.disposed || this.catalogHandoff || this.scrollActive || this.catalogPresentation.active || this.pipeline.backgroundOutputHeld)
|
|
1159
|
+
return;
|
|
1160
|
+
void this.preparationGate.run(() => {
|
|
1161
|
+
if (this.disposed || this.catalogHandoff || this.scrollActive || this.catalogPresentation.active || this.pipeline.backgroundOutputHeld)
|
|
1162
|
+
return;
|
|
1163
|
+
return this.catalogLayer?.prepareStagedNavigation(this.renderer, this.pipeline.ensureCatalogWarmOutputContext());
|
|
1164
|
+
}, this.stagedPreparationAbort.signal).catch(() => {
|
|
1165
|
+
// Early navigation remains unavailable; ordinary routing still works.
|
|
1166
|
+
}).finally(() => {
|
|
1167
|
+
// Models can finish their first render while another actor's GPU work
|
|
1168
|
+
// is pending. Recheck once idle instead of waiting for a new input frame.
|
|
1169
|
+
this.scheduleStagedPreparation();
|
|
1170
|
+
});
|
|
1171
|
+
};
|
|
1172
|
+
this.stagedPreparationFallback = !window.requestIdleCallback;
|
|
1173
|
+
this.stagedPreparationIdle = window.requestIdleCallback
|
|
1174
|
+
? window.requestIdleCallback(prepare, { timeout: 1000 }) : window.setTimeout(prepare, 50);
|
|
1175
|
+
}
|
|
782
1176
|
/** Reports actual applied GPU alpha for browser verification without layout or style reads. */
|
|
783
1177
|
getCatalogPresentation() {
|
|
784
1178
|
const triangles = (root) => {
|
|
@@ -810,6 +1204,7 @@ export class StageExperience {
|
|
|
810
1204
|
backgroundPrepared: this.catalogBackgroundPrepared,
|
|
811
1205
|
handoffPoint: this.getCatalogGeometryPoint(),
|
|
812
1206
|
representations: {
|
|
1207
|
+
sceneEndpointCache: this.presentation.getSceneEndpointStats(),
|
|
813
1208
|
retainedBlendTargets: this.returnBlend?.targetCount ?? 0,
|
|
814
1209
|
state: this.refinementState,
|
|
815
1210
|
hero: this.model ? (this.refinementState === 'high' ? 'high' : 'low') : null,
|
|
@@ -855,6 +1250,8 @@ export class StageExperience {
|
|
|
855
1250
|
device.destroy();
|
|
856
1251
|
}
|
|
857
1252
|
getPanelTransitionOpacity(panel) {
|
|
1253
|
+
if (panel?.content?.element.closest('[data-catalog-shell-continuous]'))
|
|
1254
|
+
return 1;
|
|
858
1255
|
return getCatalogTransitionOpacity(this.catalogPresentation, panel?.transitionGroup);
|
|
859
1256
|
}
|
|
860
1257
|
captureCatalogGeometry(spatialElementId) {
|
|
@@ -948,7 +1345,7 @@ export class StageExperience {
|
|
|
948
1345
|
return this.spatialCapture?.getPoint() ?? this.catalogLayer?.getHandoffPoint() ?? null;
|
|
949
1346
|
}
|
|
950
1347
|
/** Lease the last submitted element frame before another page binding can release it. */
|
|
951
|
-
adoptCatalogPresentation(destination) {
|
|
1348
|
+
adoptCatalogPresentation(destination, restoreSourceOnCancel = false) {
|
|
952
1349
|
const { spatialElementId } = destination;
|
|
953
1350
|
const reverse = destination.kind === 'content';
|
|
954
1351
|
if (!this.spatialCapture) {
|
|
@@ -988,7 +1385,10 @@ export class StageExperience {
|
|
|
988
1385
|
highPose?.removeFromParent();
|
|
989
1386
|
transferredHigh?.overrides.forEach(disposeMaterialOnly);
|
|
990
1387
|
high?.dispose();
|
|
991
|
-
|
|
1388
|
+
if (restoreSourceOnCancel && !this.disposed && this.pageBinding.token === generation)
|
|
1389
|
+
moving.restore();
|
|
1390
|
+
else
|
|
1391
|
+
moving.release();
|
|
992
1392
|
}
|
|
993
1393
|
});
|
|
994
1394
|
}
|
|
@@ -1033,6 +1433,7 @@ export class StageExperience {
|
|
|
1033
1433
|
this.pageModelReady = false;
|
|
1034
1434
|
this.spatialCapture = new SpatialGeometryCapture(model, projection, {
|
|
1035
1435
|
environment: this.scene.environment,
|
|
1436
|
+
outlineTheme: this.modelHover ? this.interactionTheme : undefined,
|
|
1036
1437
|
environmentIntensity: this.scene.environmentIntensity,
|
|
1037
1438
|
lights: this.scene.children.filter((child) => child instanceof THREE.Light),
|
|
1038
1439
|
high: highPose,
|
|
@@ -1080,17 +1481,21 @@ export class StageExperience {
|
|
|
1080
1481
|
this.outgoingBackground = true;
|
|
1081
1482
|
return true;
|
|
1082
1483
|
}
|
|
1083
|
-
getDockProjection() {
|
|
1484
|
+
getDockProjection(allowViewportClipping = false) {
|
|
1084
1485
|
const candidates = [...this.minimaps.values()].filter((minimap) => minimap.viewportVisible);
|
|
1085
1486
|
if (candidates.length !== 1)
|
|
1086
1487
|
return;
|
|
1087
1488
|
const minimap = candidates[0];
|
|
1088
1489
|
const rect = this.getProjectedMinimapModelRect(minimap);
|
|
1089
|
-
if (!rect
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1490
|
+
if (!rect)
|
|
1491
|
+
return;
|
|
1492
|
+
// Canonical dock fits can extend above the viewport (XS/S centers an 80px
|
|
1493
|
+
// fit in a 76px header). A known destination may be partially clipped;
|
|
1494
|
+
// reverse capture retains its stricter, wholly visible source requirement.
|
|
1495
|
+
if (allowViewportClipping
|
|
1496
|
+
? rect.width <= 0 || rect.height <= 0 || rect.x >= innerWidth || rect.y >= innerHeight ||
|
|
1497
|
+
rect.x + rect.width <= 0 || rect.y + rect.height <= 0
|
|
1498
|
+
: rect.x < 0 || rect.y < 0 || rect.x + rect.width > innerWidth || rect.y + rect.height > innerHeight)
|
|
1094
1499
|
return;
|
|
1095
1500
|
return {
|
|
1096
1501
|
...captureSpatialElementProjection(minimap.spatialElementRoot, minimap.screenCamera),
|
|
@@ -1139,9 +1544,18 @@ export class StageExperience {
|
|
|
1139
1544
|
}
|
|
1140
1545
|
prepareCatalogDestination(dock) {
|
|
1141
1546
|
this.catalogDockTarget = dock;
|
|
1547
|
+
if (dock) {
|
|
1548
|
+
// Scroll restoration can dock the DOM after updatePage's submitted frame.
|
|
1549
|
+
// Its layout event invalidates the cache, but the next Stage RAF need not
|
|
1550
|
+
// have run before this binding handshake. Resolve the live destination
|
|
1551
|
+
// and its visibility/projection together, without drawing a GPU frame or
|
|
1552
|
+
// advancing hover animation while the retained source is held onscreen.
|
|
1553
|
+
this.syncPanelLayouts(true);
|
|
1554
|
+
this.updatePanelPointerInteraction(0);
|
|
1555
|
+
}
|
|
1142
1556
|
if (this.adoptedForward) {
|
|
1143
1557
|
this.returnProjection = dock
|
|
1144
|
-
? this.getDockProjection()
|
|
1558
|
+
? this.getDockProjection(true)
|
|
1145
1559
|
: this.model
|
|
1146
1560
|
? {
|
|
1147
1561
|
...captureSpatialElementProjection(this.model, this.camera),
|
|
@@ -1150,7 +1564,7 @@ export class StageExperience {
|
|
|
1150
1564
|
: undefined;
|
|
1151
1565
|
return Boolean(this.returnProjection);
|
|
1152
1566
|
}
|
|
1153
|
-
return !dock || Boolean(this.getDockProjection());
|
|
1567
|
+
return !dock || Boolean(this.getDockProjection(true));
|
|
1154
1568
|
}
|
|
1155
1569
|
prepareReturnDestination() {
|
|
1156
1570
|
if (!this.returnSpatialElement || !this.spatialCapture)
|
|
@@ -1284,14 +1698,31 @@ export class StageExperience {
|
|
|
1284
1698
|
}
|
|
1285
1699
|
/** Commit GPU and DOM motion in the same browser frame, not on consecutive RAFs. */
|
|
1286
1700
|
flushCatalogFrame() {
|
|
1701
|
+
this.stagedAwaitingFirstFrame = false;
|
|
1287
1702
|
cancelAnimationFrame(this.renderRequestId);
|
|
1288
1703
|
this.renderRequestId = 0;
|
|
1289
1704
|
this.renderFrame(true);
|
|
1705
|
+
// A synchronous render callback (for example adopting newly prepared High)
|
|
1706
|
+
// can invalidate while this forced frame is running. Its own RAF would run
|
|
1707
|
+
// before the next external-clock pose and draw this pose again. Keep the
|
|
1708
|
+
// dirty flag, but let that next external flush consume it. Invalidations
|
|
1709
|
+
// outside this flush remain schedulable, including during held page binding.
|
|
1710
|
+
if (this.catalogPresentation.active) {
|
|
1711
|
+
cancelAnimationFrame(this.renderRequestId);
|
|
1712
|
+
this.renderRequestId = 0;
|
|
1713
|
+
}
|
|
1290
1714
|
// After the transition's external clock stops, optional refinement resumes its own RAF.
|
|
1291
|
-
if (
|
|
1715
|
+
else if (this.animationActive || this.renderInvalidated)
|
|
1292
1716
|
this.scheduleRender();
|
|
1293
1717
|
}
|
|
1294
1718
|
finishCatalogGeometry() {
|
|
1719
|
+
this.stagedSceneCacheOwner = undefined;
|
|
1720
|
+
this.presentation.invalidateSceneEndpoints();
|
|
1721
|
+
this.stagedAwaitingFirstFrame = false;
|
|
1722
|
+
this.stagedDetailTarget = undefined;
|
|
1723
|
+
this.releaseStagedSensorHold?.();
|
|
1724
|
+
this.releaseStagedSensorHold = undefined;
|
|
1725
|
+
this.catalogLayer?.finishStagedPanel();
|
|
1295
1726
|
this.releaseSpatialCapture();
|
|
1296
1727
|
this.adoptedForward = false;
|
|
1297
1728
|
this.returnSpatialElement = undefined;
|
|
@@ -1368,7 +1799,7 @@ export class StageExperience {
|
|
|
1368
1799
|
this.panelUiFocus = getStageUiFocus(this.panelFocus);
|
|
1369
1800
|
this.minimapFocus = getSequencedMinimapFocus(this.panelFocus, this.panelUiFocus);
|
|
1370
1801
|
this.layoutDirty = true;
|
|
1371
|
-
this.
|
|
1802
|
+
this.lastFrameTime = performance.now();
|
|
1372
1803
|
this.requestRender();
|
|
1373
1804
|
}
|
|
1374
1805
|
/** Applies the camera/target dolly produced by a real SpaceMouse zoom transaction. */
|
|
@@ -1406,6 +1837,26 @@ export class StageExperience {
|
|
|
1406
1837
|
stopVisualTestSpaceMouseMotion() {
|
|
1407
1838
|
this.setSpaceMouseMoving(false);
|
|
1408
1839
|
}
|
|
1840
|
+
/** Projects a registered panel surface for frame-by-frame DOM/GPU alignment checks. */
|
|
1841
|
+
getVisualTestPanelRect(frame) {
|
|
1842
|
+
const index = this.panelTargets.findIndex((target) => target.frame === frame);
|
|
1843
|
+
const panel = this.panelRuntimes[index];
|
|
1844
|
+
if (!panel || !panel.group.visible)
|
|
1845
|
+
return null;
|
|
1846
|
+
panel.group.updateWorldMatrix(true, false);
|
|
1847
|
+
this.panelCamera.updateMatrixWorld(true);
|
|
1848
|
+
const { width, height } = panel.options;
|
|
1849
|
+
const points = [
|
|
1850
|
+
new THREE.Vector3(-width / 2, height / 2, 0),
|
|
1851
|
+
new THREE.Vector3(width / 2, height / 2, 0),
|
|
1852
|
+
new THREE.Vector3(width / 2, -height / 2, 0),
|
|
1853
|
+
new THREE.Vector3(-width / 2, -height / 2, 0)
|
|
1854
|
+
].map((corner) => panel.group.localToWorld(corner).project(this.panelCamera));
|
|
1855
|
+
const xs = points.map((point) => (point.x + 1) * window.innerWidth / 2);
|
|
1856
|
+
const ys = points.map((point) => (1 - point.y) * window.innerHeight / 2);
|
|
1857
|
+
const x = Math.min(...xs), y = Math.min(...ys);
|
|
1858
|
+
return { x, y, width: Math.max(...xs) - x, height: Math.max(...ys) - y };
|
|
1859
|
+
}
|
|
1409
1860
|
/** Returns the live rendered minimap bounds rather than its hidden DOM fallback bounds. */
|
|
1410
1861
|
getVisualTestMinimapRect() {
|
|
1411
1862
|
const minimap = this.minimaps.values().next().value;
|
|
@@ -1434,6 +1885,14 @@ export class StageExperience {
|
|
|
1434
1885
|
height: Math.max(...yCoordinates) - top
|
|
1435
1886
|
};
|
|
1436
1887
|
}
|
|
1888
|
+
/** Returns the bound renderer's projection for query-gated handoff regressions. */
|
|
1889
|
+
getVisualTestDetailProjection(kind) {
|
|
1890
|
+
// Forward ownership releases SpatialGeometryCapture at progress one. Read
|
|
1891
|
+
// its actual successor instead of expecting a final retained-capture frame.
|
|
1892
|
+
if (kind === 'dock')
|
|
1893
|
+
return this.getDockProjection(true)?.clip.toArray() ?? null;
|
|
1894
|
+
return this.model ? captureSpatialElementProjection(this.model, this.camera).clip.toArray() : null;
|
|
1895
|
+
}
|
|
1437
1896
|
/** Returns the main element's projected bounds for query-gated layout regressions. */
|
|
1438
1897
|
getVisualTestModelRect() {
|
|
1439
1898
|
if (!this.model || this.modelBounds.isEmpty())
|
|
@@ -1456,6 +1915,15 @@ export class StageExperience {
|
|
|
1456
1915
|
const minimap = this.minimaps.values().next().value;
|
|
1457
1916
|
return minimap ? this.getProjectedMinimapModelRect(minimap) : null;
|
|
1458
1917
|
}
|
|
1918
|
+
/** Returns the visible viewport mask in minimap-local pixels. */
|
|
1919
|
+
getVisualTestMinimapViewportRect() {
|
|
1920
|
+
const minimap = this.minimaps.values().next().value;
|
|
1921
|
+
if (!minimap)
|
|
1922
|
+
return null;
|
|
1923
|
+
const center = minimap.overlayViewportCenter.value;
|
|
1924
|
+
const halfSize = minimap.overlayViewportHalfSize.value;
|
|
1925
|
+
return { x: center.x - halfSize.x, y: center.y - halfSize.y, width: halfSize.x * 2, height: halfSize.y * 2 };
|
|
1926
|
+
}
|
|
1459
1927
|
/** Returns minimap orientation endpoints for query-gated browser regressions. */
|
|
1460
1928
|
getVisualTestMinimapOrientation() {
|
|
1461
1929
|
const minimap = this.minimaps.values().next().value;
|
|
@@ -1490,7 +1958,25 @@ export class StageExperience {
|
|
|
1490
1958
|
}
|
|
1491
1959
|
/** Returns Low-band and glass-compositor counters without scheduling rendering. */
|
|
1492
1960
|
getCarouselStats() {
|
|
1493
|
-
return this.catalogLayer?.getStats() ?? null;
|
|
1961
|
+
return this.catalogLayer?.getStats(this.renderer, this.pipeline.peekCatalogWarmOutputContext()) ?? null;
|
|
1962
|
+
}
|
|
1963
|
+
/** Query-gated snapshot: no new frame state, DOM measurements, scheduling or settling. */
|
|
1964
|
+
getVisualTestRenderActivity() {
|
|
1965
|
+
const preparation = this.preparation?.current;
|
|
1966
|
+
const assets = this.assets.getStats();
|
|
1967
|
+
return { at: performance.now(), lastFrameAt: this.lastFrameTime,
|
|
1968
|
+
animationActive: this.animationActive, catalogAnimating: this.catalogLayerAnimating,
|
|
1969
|
+
renderInvalidated: this.renderInvalidated, pendingRenderFrame: this.renderRequestId !== 0,
|
|
1970
|
+
pendingScrollFrame: hasPendingStageScrollFrame(), scrollActive: this.scrollActive,
|
|
1971
|
+
stagedAwaitingFirstFrame: this.stagedAwaitingFirstFrame,
|
|
1972
|
+
transitionActive: this.catalogPresentation.active,
|
|
1973
|
+
preparation: { stagedIdlePending: this.stagedPreparationIdle !== 0,
|
|
1974
|
+
zoomFramePending: this.zoomPreparationFrame !== 0, zoomDeferred: this.deferredZoomPreparation,
|
|
1975
|
+
gate: this.preparationGate.getActivity(), detailGate: this.detailPreparationGate.getActivity(),
|
|
1976
|
+
background: preparation?.backgroundState ?? null, high: preparation?.highState ?? null,
|
|
1977
|
+
assetLoads: assets.pendingLoads, activeInstances: assets.activeInstances },
|
|
1978
|
+
catalog: this.catalogLayer?.getRenderActivity() ?? null,
|
|
1979
|
+
panels: this.panels.getRenderActivity() };
|
|
1494
1980
|
}
|
|
1495
1981
|
/** Returns render-target lifecycle counters for query-gated performance tests. */
|
|
1496
1982
|
getVisualTestRenderTargetStats() {
|
|
@@ -1516,10 +2002,14 @@ export class StageExperience {
|
|
|
1516
2002
|
});
|
|
1517
2003
|
return {
|
|
1518
2004
|
...inventory,
|
|
2005
|
+
pixelRatio: this.pipeline.getFullPixelRatio(),
|
|
2006
|
+
renderSettings: this.pipeline.getRenderSettings(),
|
|
1519
2007
|
canvases: this.pipeline.getCanvasOutputs(),
|
|
1520
2008
|
creations: this.pipeline.renderTargetSetCreations,
|
|
1521
2009
|
resizes: this.pipeline.renderTargetSetResizes,
|
|
1522
2010
|
warmups: this.pipeline.renderTargetSetWarmups,
|
|
2011
|
+
inactiveScrollWarmups: this.pipeline.deferredScrollWarmups,
|
|
2012
|
+
backgroundOutput: this.pipeline.getBackgroundOutputStats(),
|
|
1523
2013
|
activeScale: this.pipeline.activeRenderTargets?.scale ?? 0
|
|
1524
2014
|
};
|
|
1525
2015
|
}
|
|
@@ -1549,7 +2039,7 @@ export class StageExperience {
|
|
|
1549
2039
|
advanceVisualTestFrames(frames = 12) {
|
|
1550
2040
|
const frameCount = THREE.MathUtils.clamp(Math.floor(frames), 1, 120);
|
|
1551
2041
|
for (let index = 0; index < frameCount; index += 1) {
|
|
1552
|
-
this.
|
|
2042
|
+
this.lastFrameTime = performance.now() - 1000 / 60;
|
|
1553
2043
|
this.renderFrame(true);
|
|
1554
2044
|
}
|
|
1555
2045
|
}
|
|
@@ -1582,7 +2072,7 @@ export class StageExperience {
|
|
|
1582
2072
|
this.scheduleRender();
|
|
1583
2073
|
}
|
|
1584
2074
|
scheduleRender() {
|
|
1585
|
-
if (this.disposed || document.hidden || this.renderRequestId)
|
|
2075
|
+
if (this.disposed || document.hidden || this.renderRequestId || this.stagedAwaitingFirstFrame)
|
|
1586
2076
|
return;
|
|
1587
2077
|
this.renderRequestId = requestAnimationFrame(this.render);
|
|
1588
2078
|
}
|
|
@@ -1619,6 +2109,9 @@ export class StageExperience {
|
|
|
1619
2109
|
element.style.pointerEvents = 'none';
|
|
1620
2110
|
}
|
|
1621
2111
|
async loadEnvironment() {
|
|
2112
|
+
// A content page without any spatial elements has no environment to load.
|
|
2113
|
+
if (!this.hdr)
|
|
2114
|
+
return;
|
|
1622
2115
|
const token = this.pageBinding.token;
|
|
1623
2116
|
const lease = this.environments.acquire(this.hdr);
|
|
1624
2117
|
try {
|
|
@@ -1632,6 +2125,7 @@ export class StageExperience {
|
|
|
1632
2125
|
}
|
|
1633
2126
|
}
|
|
1634
2127
|
applyEnvironment(environment) {
|
|
2128
|
+
this.appliedEnvironment = environment;
|
|
1635
2129
|
this.presentation.retainEnvironment(this.environments, environment);
|
|
1636
2130
|
this.environmentTarget = environment.target;
|
|
1637
2131
|
const texture = environment.target.texture;
|
|
@@ -1806,23 +2300,20 @@ export class StageExperience {
|
|
|
1806
2300
|
if (this.referenceBounds)
|
|
1807
2301
|
bounds.copy(this.referenceBounds);
|
|
1808
2302
|
this.modelBounds.copy(bounds);
|
|
1809
|
-
const sphere = bounds.getBoundingSphere(new THREE.Sphere());
|
|
1810
|
-
const radius = Math.max(sphere.radius, 1);
|
|
1811
|
-
this.modelRadius = radius;
|
|
1812
|
-
const orbitDirection = getCameraOrbitDirection(this.cameraSettings.azimuth, this.cameraSettings.elevation);
|
|
1813
2303
|
this.updateViewportFrame();
|
|
1814
2304
|
this.camera.aspect = window.innerWidth / window.innerHeight;
|
|
1815
2305
|
this.camera.updateProjectionMatrix();
|
|
1816
|
-
const
|
|
1817
|
-
const
|
|
2306
|
+
const fit = detailCameraFit(bounds, this.camera, this.cameraSettings, { width: window.innerWidth, height: window.innerHeight }, { width: this.viewportLayoutSize.x, height: this.viewportLayoutSize.y });
|
|
2307
|
+
const { radius, center, distance: maxDistance } = fit;
|
|
2308
|
+
this.modelRadius = radius;
|
|
1818
2309
|
this.rememberFittedViewportMetrics();
|
|
1819
|
-
this.camera.position.copy(
|
|
1820
|
-
this.camera.near =
|
|
1821
|
-
this.camera.far =
|
|
2310
|
+
this.camera.position.copy(center).addScaledVector(fit.direction, maxDistance);
|
|
2311
|
+
this.camera.near = fit.near;
|
|
2312
|
+
this.camera.far = fit.far;
|
|
1822
2313
|
this.camera.updateProjectionMatrix();
|
|
1823
2314
|
const focusRange = getZoomFocusDistanceRange(maxDistance, radius);
|
|
1824
2315
|
this.interaction.setFocusRange(focusRange.restDistance, focusRange.closeDistance);
|
|
1825
|
-
this.controls?.target.copy(
|
|
2316
|
+
this.controls?.target.copy(center);
|
|
1826
2317
|
if (this.controls) {
|
|
1827
2318
|
this.controls.minDistance = this.focusCloseDistance * 0.64;
|
|
1828
2319
|
this.controls.maxDistance = maxDistance;
|
|
@@ -1856,18 +2347,7 @@ export class StageExperience {
|
|
|
1856
2347
|
this.interaction.setPickTargets(model, (mesh) => this.isInteractionMesh(mesh));
|
|
1857
2348
|
}
|
|
1858
2349
|
isInteractionMesh(mesh) {
|
|
1859
|
-
|
|
1860
|
-
return false;
|
|
1861
|
-
if (this.interactionTheme.excludeMesh?.(mesh))
|
|
1862
|
-
return false;
|
|
1863
|
-
if (mesh.userData.stagePick === false || mesh.userData.stageOutline === false)
|
|
1864
|
-
return false;
|
|
1865
|
-
const materialNames = getMeshMaterials(mesh)
|
|
1866
|
-
.map((material) => material.name)
|
|
1867
|
-
.filter(Boolean)
|
|
1868
|
-
.join(' ');
|
|
1869
|
-
const label = `${mesh.name} ${materialNames}`.toLowerCase();
|
|
1870
|
-
return !/(shadow|ground|floor|plane|helper|collision|collider|reflection)/i.test(label);
|
|
2350
|
+
return this.isSpatialElementMesh(mesh) && isOutlineMesh(mesh, this.interactionTheme);
|
|
1871
2351
|
}
|
|
1872
2352
|
createPanels() {
|
|
1873
2353
|
if (!this.pipeline.activeRenderTargets &&
|
|
@@ -1911,11 +2391,17 @@ export class StageExperience {
|
|
|
1911
2391
|
options: panel.options,
|
|
1912
2392
|
pointerLift: 0,
|
|
1913
2393
|
pointerReactive: target.pointerReactive ?? true,
|
|
2394
|
+
focusReactive: target.focusReactive ?? true,
|
|
1914
2395
|
projectionRoot,
|
|
1915
2396
|
surface: target.surface
|
|
1916
2397
|
});
|
|
1917
2398
|
this.panelScene.add(projectionRoot ?? panel.group);
|
|
1918
|
-
|
|
2399
|
+
if (target.nativeContent) {
|
|
2400
|
+
// Draw floating glass above regular panels; its content stays in the top layer.
|
|
2401
|
+
panel.group.renderOrder = 100;
|
|
2402
|
+
}
|
|
2403
|
+
else
|
|
2404
|
+
this.attachPanelContent(target.content, index, target.contentInset);
|
|
1919
2405
|
}
|
|
1920
2406
|
else {
|
|
1921
2407
|
const options = resolveLiquidGlassPanelOptions(measuredOptions);
|
|
@@ -1930,18 +2416,21 @@ export class StageExperience {
|
|
|
1930
2416
|
options,
|
|
1931
2417
|
pointerLift: 0,
|
|
1932
2418
|
pointerReactive: target.pointerReactive ?? true,
|
|
2419
|
+
focusReactive: target.focusReactive ?? true,
|
|
1933
2420
|
projectionRoot,
|
|
1934
2421
|
surface: target.surface
|
|
1935
2422
|
});
|
|
1936
2423
|
if (projectionRoot)
|
|
1937
2424
|
this.panelScene.add(projectionRoot);
|
|
1938
|
-
|
|
2425
|
+
if (!target.nativeContent)
|
|
2426
|
+
this.attachPanelSurface(target.surfaceElement, index, Boolean(target.minimap));
|
|
1939
2427
|
}
|
|
1940
2428
|
this.createMinimap(index, target.minimap);
|
|
1941
2429
|
const panel = this.panelRuntimes[index];
|
|
1942
2430
|
const group = target.frame.dataset.catalogTransitionGroup;
|
|
1943
2431
|
panel.transitionGroup = group === 'enter' || group === 'shared' ? group : undefined;
|
|
1944
|
-
panel.glass?.setVisibilityAlpha(this.getPanelTransitionOpacity(panel) * (target.getSurfaceOpacity?.() ?? 1)
|
|
2432
|
+
panel.glass?.setVisibilityAlpha(this.getPanelTransitionOpacity(panel) * (target.getSurfaceOpacity?.() ?? 1) *
|
|
2433
|
+
(target.getVisible?.() === false ? 0 : 1));
|
|
1945
2434
|
const minimap = this.minimaps.get(index);
|
|
1946
2435
|
if (minimap) {
|
|
1947
2436
|
this.updateMinimapOverlayVisibility(minimap);
|
|
@@ -1967,55 +2456,78 @@ export class StageExperience {
|
|
|
1967
2456
|
return;
|
|
1968
2457
|
this.layoutDirty = false;
|
|
1969
2458
|
const measurePanels = force || this.panelMeasurementsDirty;
|
|
1970
|
-
this.panelTargets.forEach((target, index) =>
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
currentRuntime.options.position.y = options.position.y;
|
|
1993
|
-
if (currentRuntime.projectionRoot) {
|
|
1994
|
-
currentRuntime.group.position.set(0, 0, 0);
|
|
1995
|
-
this.setPanelProjectionTransform(currentRuntime.projectionRoot, options.position.x, options.position.y, 0);
|
|
1996
|
-
}
|
|
1997
|
-
else {
|
|
1998
|
-
currentRuntime.group.position.set(options.position.x, options.position.y, 0);
|
|
2459
|
+
this.panelTargets.forEach((target, index) => this.syncPanelLayout(target, index, measurePanels));
|
|
2460
|
+
this.panelMeasurementsDirty = false;
|
|
2461
|
+
}
|
|
2462
|
+
syncPanelLayout(target, index, measurePanels) {
|
|
2463
|
+
const runtime = this.panelRuntimes[index];
|
|
2464
|
+
if (!runtime)
|
|
2465
|
+
return;
|
|
2466
|
+
// Preserve the last popup mesh while closed instead of resizing it to a 1px box.
|
|
2467
|
+
if (target.nativeContent && target.getVisible?.() === false)
|
|
2468
|
+
return;
|
|
2469
|
+
const options = this.getMeasuredPanelOptions(target, measurePanels);
|
|
2470
|
+
const geometryChanged = hasPanelGeometryChanged(runtime.options, options);
|
|
2471
|
+
if (geometryChanged && runtime.glass && target.minimap) {
|
|
2472
|
+
this.replacePanel(index, options);
|
|
2473
|
+
}
|
|
2474
|
+
else {
|
|
2475
|
+
if (geometryChanged) {
|
|
2476
|
+
const radius = options.radius ?? runtime.options.radius;
|
|
2477
|
+
runtime.glass?.setVisualSize(options.width, options.height, radius);
|
|
2478
|
+
runtime.options.width = options.width;
|
|
2479
|
+
runtime.options.height = options.height;
|
|
2480
|
+
runtime.options.radius = radius;
|
|
1999
2481
|
}
|
|
2482
|
+
}
|
|
2483
|
+
const currentRuntime = this.panelRuntimes[index];
|
|
2484
|
+
if (!currentRuntime)
|
|
2485
|
+
return;
|
|
2486
|
+
currentRuntime.options.position.x = options.position.x;
|
|
2487
|
+
currentRuntime.options.position.y = options.position.y;
|
|
2488
|
+
if (currentRuntime.projectionRoot) {
|
|
2489
|
+
currentRuntime.group.position.set(0, 0, 0);
|
|
2490
|
+
this.setPanelProjectionTransform(currentRuntime.projectionRoot, options.position.x, options.position.y, 0);
|
|
2491
|
+
}
|
|
2492
|
+
else {
|
|
2493
|
+
currentRuntime.group.position.set(options.position.x, options.position.y, 0);
|
|
2494
|
+
}
|
|
2495
|
+
// Intrinsic DOM sizing and native popover layout remain owned by the adapter.
|
|
2496
|
+
if (!target.nativeContent) {
|
|
2000
2497
|
if (currentRuntime.surface === 'glass') {
|
|
2001
2498
|
this.updateContentElement(target.content, currentRuntime, target.contentInset);
|
|
2002
2499
|
}
|
|
2003
2500
|
else {
|
|
2004
2501
|
this.updateSurfaceElement(target.surfaceElement, currentRuntime, currentRuntime.options.width, currentRuntime.options.height, Boolean(target.minimap));
|
|
2005
2502
|
}
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
else {
|
|
2012
|
-
currentRuntime.content.position.set(currentRuntime.options.position.x, currentRuntime.options.position.y, PANEL_CONTENT_Z);
|
|
2013
|
-
}
|
|
2503
|
+
}
|
|
2504
|
+
if (currentRuntime.content) {
|
|
2505
|
+
if (currentRuntime.contentProjectionRoot) {
|
|
2506
|
+
currentRuntime.content.position.set(0, 0, 0);
|
|
2507
|
+
this.setPanelProjectionTransform(currentRuntime.contentProjectionRoot, currentRuntime.options.position.x, currentRuntime.options.position.y, PANEL_CONTENT_Z);
|
|
2014
2508
|
}
|
|
2015
|
-
|
|
2016
|
-
|
|
2509
|
+
else {
|
|
2510
|
+
currentRuntime.content.position.set(currentRuntime.options.position.x, currentRuntime.options.position.y, PANEL_CONTENT_Z);
|
|
2511
|
+
}
|
|
2512
|
+
}
|
|
2513
|
+
if (geometryChanged && target.minimap)
|
|
2514
|
+
this.createMinimap(index, target.minimap);
|
|
2515
|
+
}
|
|
2516
|
+
/** Commit anchor DOM positions and dependent native surfaces in one render transaction. */
|
|
2517
|
+
renderPanelContents() {
|
|
2518
|
+
this.cssRenderer.render(this.panelContentScene, this.panelCamera);
|
|
2519
|
+
this.renderFlatPanelSurfaces();
|
|
2520
|
+
this.panelTargets.forEach((target, index) => {
|
|
2521
|
+
if (!target.nativeContent || target.getVisible?.() === false)
|
|
2522
|
+
return;
|
|
2523
|
+
target.updateNativeLayout?.();
|
|
2524
|
+
// Only an actively positioned native popover needs a fresh DOM measurement.
|
|
2525
|
+
// Pane summaries use the same resize/scroll-invalidated cache as other panels.
|
|
2526
|
+
this.syncPanelLayout(target, index, Boolean(target.updateNativeLayout));
|
|
2527
|
+
const runtime = this.panelRuntimes[index];
|
|
2528
|
+
if (runtime)
|
|
2529
|
+
runtime.group.visible = this.isPanelTargetVisible(index);
|
|
2017
2530
|
});
|
|
2018
|
-
this.panelMeasurementsDirty = false;
|
|
2019
2531
|
}
|
|
2020
2532
|
replacePanel(index, options) {
|
|
2021
2533
|
if (!this.pipeline.activeRenderTargets)
|
|
@@ -2043,7 +2555,7 @@ export class StageExperience {
|
|
|
2043
2555
|
getMeasuredPanelOptions(target, forceMeasurement = false) {
|
|
2044
2556
|
let cachedRect = this.pageBinding.getPanelRect(target.frame);
|
|
2045
2557
|
if (!cachedRect || forceMeasurement) {
|
|
2046
|
-
cachedRect = this.
|
|
2558
|
+
cachedRect = this.pageBinding.measurePanel(target, this.currentScrollX, this.currentScrollY);
|
|
2047
2559
|
this.pageBinding.setPanelRect(target.frame, cachedRect);
|
|
2048
2560
|
}
|
|
2049
2561
|
const rect = this.resolveStageRect(cachedRect);
|
|
@@ -2066,14 +2578,22 @@ export class StageExperience {
|
|
|
2066
2578
|
const target = this.panelTargets[index];
|
|
2067
2579
|
if (!target)
|
|
2068
2580
|
return true;
|
|
2581
|
+
if (!this.detailMediaActive && target.frame.closest('[data-spatial-model-controls]'))
|
|
2582
|
+
return false;
|
|
2583
|
+
if (target.getVisible?.() === false)
|
|
2584
|
+
return false;
|
|
2585
|
+
if (this.fullscreen)
|
|
2586
|
+
return Boolean(target.minimap || target.focusReactive === 'top-right' ||
|
|
2587
|
+
target.content.hasAttribute('data-stage-fullscreen-visible'));
|
|
2069
2588
|
const cachedRect = this.pageBinding.getPanelRect(target.frame);
|
|
2070
2589
|
if (!cachedRect)
|
|
2071
2590
|
return true;
|
|
2072
2591
|
return isViewportRectVisible(this.resolveStageRect(cachedRect), window.innerWidth, window.innerHeight, VIEWPORT_CULL_MARGIN);
|
|
2073
2592
|
}
|
|
2074
|
-
resizeRenderer() {
|
|
2593
|
+
resizeRenderer(invalidate = true) {
|
|
2075
2594
|
const width = window.innerWidth;
|
|
2076
2595
|
const height = window.innerHeight;
|
|
2596
|
+
this.rendererSize.set(width, height);
|
|
2077
2597
|
this.panelMeasurementsDirty = true;
|
|
2078
2598
|
this.viewportMeasurementDirty = true;
|
|
2079
2599
|
this.pipeline.resizeRenderTargets();
|
|
@@ -2094,7 +2614,8 @@ export class StageExperience {
|
|
|
2094
2614
|
this.nativePanelLayer.style.height = `${height}px`;
|
|
2095
2615
|
this.layoutDirty = true;
|
|
2096
2616
|
this.syncPanelLayouts(true);
|
|
2097
|
-
|
|
2617
|
+
if (invalidate)
|
|
2618
|
+
this.requestRender();
|
|
2098
2619
|
}
|
|
2099
2620
|
/**
|
|
2100
2621
|
* Forces WebGPU to allocate and bind both quality levels before input starts.
|
|
@@ -2106,7 +2627,7 @@ export class StageExperience {
|
|
|
2106
2627
|
const width = window.innerWidth;
|
|
2107
2628
|
const height = window.innerHeight;
|
|
2108
2629
|
const element = this.viewportTarget?.element;
|
|
2109
|
-
if (!element) {
|
|
2630
|
+
if (!element || this.fullscreen) {
|
|
2110
2631
|
this.stageViewportVisible = true;
|
|
2111
2632
|
this.viewportFrame.set(0, 0, width, height);
|
|
2112
2633
|
this.viewportLayoutSize.set(width, height);
|
|
@@ -2133,19 +2654,8 @@ export class StageExperience {
|
|
|
2133
2654
|
const frameHeight = Math.max(bottom - top, 1);
|
|
2134
2655
|
this.viewportFrame.set(left, top, frameWidth, frameHeight);
|
|
2135
2656
|
}
|
|
2136
|
-
getViewportScale() {
|
|
2137
|
-
const width = Math.max(window.innerWidth, 1);
|
|
2138
|
-
const height = Math.max(window.innerHeight, 1);
|
|
2139
|
-
const maximumPadding = Math.max(Math.min(this.viewportLayoutSize.x, this.viewportLayoutSize.y) * 0.5 - 1, 0);
|
|
2140
|
-
const padding = THREE.MathUtils.clamp(this.cameraSettings.fitPadding ?? 0, 0, maximumPadding);
|
|
2141
|
-
return {
|
|
2142
|
-
x: THREE.MathUtils.clamp((this.viewportLayoutSize.x - padding * 2) / width, 0.08, 1),
|
|
2143
|
-
y: THREE.MathUtils.clamp((this.viewportLayoutSize.y - padding * 2) / height, 0.08, 1)
|
|
2144
|
-
};
|
|
2145
|
-
}
|
|
2146
2657
|
getSpatialElementCameraFitDistance(bounds, viewDirection) {
|
|
2147
|
-
|
|
2148
|
-
return (getCameraFitDistance(bounds, viewDirection, this.camera, SPATIAL_ELEMENT_CAMERA_FIT_MARGIN, this.getViewportScale()) / fitScale);
|
|
2658
|
+
return detailCameraFitDistance(bounds, viewDirection, this.camera, this.cameraSettings, { width: window.innerWidth, height: window.innerHeight }, { width: this.viewportLayoutSize.x, height: this.viewportLayoutSize.y });
|
|
2149
2659
|
}
|
|
2150
2660
|
rememberFittedViewportMetrics() {
|
|
2151
2661
|
this.fittedViewportMetrics.set(window.innerWidth, window.innerHeight, this.viewportLayoutSize.x, this.viewportLayoutSize.y);
|
|
@@ -2226,6 +2736,7 @@ export class StageExperience {
|
|
|
2226
2736
|
handleScrollFrame(frame) {
|
|
2227
2737
|
if (this.disposed)
|
|
2228
2738
|
return;
|
|
2739
|
+
pauseDeviceOrientationForScroll();
|
|
2229
2740
|
this.currentScrollX = frame.scrollX;
|
|
2230
2741
|
this.currentScrollY = frame.scrollY;
|
|
2231
2742
|
if (this.renderRequestId)
|
|
@@ -2308,8 +2819,20 @@ export class StageExperience {
|
|
|
2308
2819
|
return this.panels.renderFlatPanelSurfaces();
|
|
2309
2820
|
}
|
|
2310
2821
|
renderFrame(force = false) {
|
|
2822
|
+
if (this.disposed)
|
|
2823
|
+
return;
|
|
2824
|
+
if (!force && this.stagedAwaitingFirstFrame)
|
|
2825
|
+
return;
|
|
2826
|
+
if (!this.disposed && (this.rendererSize.x !== window.innerWidth || this.rendererSize.y !== window.innerHeight))
|
|
2827
|
+
this.resizeRenderer(false);
|
|
2311
2828
|
const renderTargets = this.pipeline.activeRenderTargets;
|
|
2312
2829
|
const listOnly = this.catalog && !this.viewportTarget;
|
|
2830
|
+
if (this.deviceOrientationEnabled && this.detailMediaActive && !listOnly && this.model && !this.releaseDeviceOrientation)
|
|
2831
|
+
this.releaseDeviceOrientation = retainListDeviceOrientation(this.container, () => { });
|
|
2832
|
+
else if ((listOnly || !this.detailMediaActive) && this.releaseDeviceOrientation) {
|
|
2833
|
+
this.releaseDeviceOrientation();
|
|
2834
|
+
this.releaseDeviceOrientation = undefined;
|
|
2835
|
+
}
|
|
2313
2836
|
if (this.disposed || (!listOnly && (!renderTargets || !this.pipeline.stageDisplayQuad)))
|
|
2314
2837
|
return;
|
|
2315
2838
|
if (!force && document.hidden)
|
|
@@ -2320,9 +2843,9 @@ export class StageExperience {
|
|
|
2320
2843
|
this.renderer.setCanvasTarget(this.backgroundCanvasTarget);
|
|
2321
2844
|
this.renderer.setClearColor(0xffffff, 1);
|
|
2322
2845
|
const now = performance.now();
|
|
2323
|
-
const delta = Math.min((now - this.
|
|
2846
|
+
const delta = Math.min((now - this.lastFrameTime) / 1000, 0.05);
|
|
2324
2847
|
this.advancePreparedPage(now);
|
|
2325
|
-
this.
|
|
2848
|
+
this.lastFrameTime = now;
|
|
2326
2849
|
this.backgroundCanvas.style.visibility = '';
|
|
2327
2850
|
this.catalogLayerAnimating =
|
|
2328
2851
|
this.catalogLayer?.update(this.renderer, this.scene.environment, now) ?? false;
|
|
@@ -2336,9 +2859,9 @@ export class StageExperience {
|
|
|
2336
2859
|
this.syncPanelLayouts();
|
|
2337
2860
|
const panelsAnimating = this.updatePanelPointerInteraction(delta);
|
|
2338
2861
|
const domAnimating = this.updatePanelDomRenderModes();
|
|
2862
|
+
this.renderPanelContents();
|
|
2339
2863
|
this.pipeline.renderFrame(true, false);
|
|
2340
|
-
this.
|
|
2341
|
-
this.renderFlatPanelSurfaces();
|
|
2864
|
+
this.scheduleStagedPreparation();
|
|
2342
2865
|
this.animationActive = this.catalogLayerAnimating || panelsAnimating || domAnimating;
|
|
2343
2866
|
if (!force && (this.animationActive || this.renderInvalidated))
|
|
2344
2867
|
this.scheduleRender();
|
|
@@ -2347,11 +2870,17 @@ export class StageExperience {
|
|
|
2347
2870
|
if (!renderTargets)
|
|
2348
2871
|
return;
|
|
2349
2872
|
const { controls: controlsAnimating, wheel: wheelZoomAnimating } = this.interaction.advance(now, delta);
|
|
2873
|
+
let deviceAnimating = false;
|
|
2874
|
+
if (this.deviceOrientationEnabled && this.detailMediaActive && this.model?.parent === this.scene && !this.catalogHandoff && !this.spatialCapture) {
|
|
2875
|
+
if (!isDeviceOrientationPaused())
|
|
2876
|
+
deviceAnimating = this.deviceMotion.update(getListDeviceYaw(), getListDevicePitch(), getListDeviceRoll(), delta);
|
|
2877
|
+
this.deviceMotion.apply(this.model, this.camera, this.initialControlsTarget);
|
|
2878
|
+
}
|
|
2350
2879
|
// The damped camera distance is the single animation clock for geometry and
|
|
2351
2880
|
// every close-up UI phase. Phase remapping remains, temporal lag does not.
|
|
2352
|
-
this.panelFocus = this.getZoomFocusFactor();
|
|
2353
|
-
this.panelUiFocus = getStageUiFocus(this.panelFocus);
|
|
2354
|
-
this.minimapFocus = getSequencedMinimapFocus(this.panelFocus, this.panelUiFocus);
|
|
2881
|
+
this.panelFocus = this.detailMediaActive ? this.getZoomFocusFactor() : 0;
|
|
2882
|
+
this.panelUiFocus = this.fullscreen ? 1 : getStageUiFocus(this.panelFocus);
|
|
2883
|
+
this.minimapFocus = this.fullscreen ? 1 : getSequencedMinimapFocus(this.panelFocus, this.panelUiFocus);
|
|
2355
2884
|
this.updateStageCameraProjection();
|
|
2356
2885
|
this.reportZoomFocus({
|
|
2357
2886
|
focus: this.panelFocus,
|
|
@@ -2362,13 +2891,14 @@ export class StageExperience {
|
|
|
2362
2891
|
this.syncPanelLayouts();
|
|
2363
2892
|
const panelsAnimating = this.updatePanelPointerInteraction(delta);
|
|
2364
2893
|
const panelDomModeAnimating = this.updatePanelDomRenderModes();
|
|
2894
|
+
this.renderPanelContents();
|
|
2365
2895
|
this.pipeline.renderFrame(false, !this.scrollActive && !this.catalogHandoff);
|
|
2366
|
-
this.
|
|
2367
|
-
this.renderFlatPanelSurfaces();
|
|
2896
|
+
this.scheduleStagedPreparation();
|
|
2368
2897
|
this.animationActive =
|
|
2369
|
-
|
|
2898
|
+
deviceAnimating ||
|
|
2899
|
+
(this.detailMediaActive && this.presentation.readiness.animating) ||
|
|
2370
2900
|
this.catalogLayerAnimating ||
|
|
2371
|
-
(this.stageViewportVisible &&
|
|
2901
|
+
(this.detailMediaActive && this.stageViewportVisible &&
|
|
2372
2902
|
(!this.catalogHandoff || this.catalogMotionComplete) &&
|
|
2373
2903
|
Boolean(this.refinement)) ||
|
|
2374
2904
|
this.spaceMouseMoving ||
|
|
@@ -2385,13 +2915,14 @@ export class StageExperience {
|
|
|
2385
2915
|
/** Draws only spatial UI into the transparent canvas above the page DOM. */
|
|
2386
2916
|
/** Renders every glass surface below the DOM while preserving minimap screen projection. */
|
|
2387
2917
|
renderStage() {
|
|
2388
|
-
if (this.stageViewportVisible &&
|
|
2918
|
+
if (this.detailMediaActive && this.stageViewportVisible &&
|
|
2389
2919
|
(!this.catalogHandoff || this.catalogMotionComplete) &&
|
|
2390
2920
|
this.pageModelReady &&
|
|
2391
2921
|
this.presentation.renderRefinement(this.renderer, this.scene, this.pagePreparation?.environment.value?.target.texture, () => this.pipeline.renderStageContents(), (model, outline) => {
|
|
2392
2922
|
this.collectModelPickTargets(model);
|
|
2393
2923
|
this.pipeline.createModelOutline(outline);
|
|
2394
|
-
}, window.matchMedia('(prefers-reduced-motion: reduce)').matches
|
|
2924
|
+
}, window.matchMedia('(prefers-reduced-motion: reduce)').matches, { backgroundReveal: this.catalogBackgroundReveal.value,
|
|
2925
|
+
advanceClock: !(this.stagedRevealPreparing && this.stagedRevealPreparing === this.stagedSceneCacheOwner) }))
|
|
2395
2926
|
return;
|
|
2396
2927
|
this.pipeline.renderStageContents();
|
|
2397
2928
|
}
|