@spatial-elements/core 0.1.0-beta.2 → 1.0.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -13
- 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 +4 -2
- 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 +144 -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 +5 -3
- package/dist/catalog/CatalogTransition.d.ts.map +1 -1
- package/dist/catalog/CatalogTransition.js +207 -91
- 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 +12 -27
- 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 +20 -0
- package/dist/catalog/listDeviceOrientation.d.ts.map +1 -0
- package/dist/catalog/listDeviceOrientation.js +273 -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 +23 -11
- 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 +46 -0
- package/dist/spatial-element/messages.d.ts.map +1 -0
- package/dist/spatial-element/messages.js +46 -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 +51 -7
- 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 +62 -71
- 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/SpaceMouseAdapter.d.ts +10 -2
- package/dist/stage/SpaceMouseAdapter.d.ts.map +1 -1
- package/dist/stage/SpaceMouseAdapter.js +50 -8
- package/dist/stage/SpaceMouseAdapter.js.map +1 -1
- package/dist/stage/SpatialElementInteractionController.d.ts +24 -2
- package/dist/stage/SpatialElementInteractionController.d.ts.map +1 -1
- package/dist/stage/SpatialElementInteractionController.js +198 -45
- 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 +266 -11
- package/dist/stage/StageExperience.d.ts.map +1 -1
- package/dist/stage/StageExperience.js +673 -126
- 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 -120
- 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 +6 -11
- 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 +33 -2
- package/dist/stage/panelContext.d.ts.map +1 -1
- package/dist/stage/panelContext.js.map +1 -1
- package/dist/stage/panelFocusMath.d.ts +34 -0
- package/dist/stage/panelFocusMath.d.ts.map +1 -0
- package/dist/stage/panelFocusMath.js +79 -0
- package/dist/stage/panelFocusMath.js.map +1 -0
- package/dist/stage/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/scalarMath.d.ts +6 -0
- package/dist/stage/scalarMath.d.ts.map +1 -0
- package/dist/stage/scalarMath.js +6 -0
- package/dist/stage/scalarMath.js.map +1 -0
- package/dist/stage/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/spaceMousePermission.d.ts +11 -0
- package/dist/stage/spaceMousePermission.d.ts.map +1 -0
- package/dist/stage/spaceMousePermission.js +63 -0
- package/dist/stage/spaceMousePermission.js.map +1 -0
- package/dist/stage/spaceMousePlatform.d.ts +12 -0
- package/dist/stage/spaceMousePlatform.d.ts.map +1 -0
- package/dist/stage/spaceMousePlatform.js +13 -0
- package/dist/stage/spaceMousePlatform.js.map +1 -0
- package/dist/stage/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 +10 -10
- 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 +4 -33
- package/dist/stage/stageMath.d.ts.map +1 -1
- package/dist/stage/stageMath.js +39 -110
- package/dist/stage/stageMath.js.map +1 -1
- package/dist/stage/stageTypes.d.ts +32 -4
- 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/dist/stage/webgpuSupport.d.ts +3 -0
- package/dist/stage/webgpuSupport.d.ts.map +1 -0
- package/dist/stage/webgpuSupport.js +14 -0
- package/dist/stage/webgpuSupport.js.map +1 -0
- package/logo.svg +225 -0
- package/package.json +7 -5
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
const PIXELS_PER_ITEM = 220;
|
|
2
|
+
const DRAG_THRESHOLD = 8;
|
|
3
|
+
const MAX_VELOCITY = 0.025;
|
|
4
|
+
const INERTIA_TIME = 320;
|
|
5
|
+
/** Wheel adapter only: the carousel controller remains the sole owner of motion.
|
|
6
|
+
* Keep the last input time separate from the idle detection delay: that delay
|
|
7
|
+
* is not a physical hold and must not erase the release velocity.
|
|
8
|
+
*/
|
|
9
|
+
export class CarouselWheelInput {
|
|
10
|
+
x = 0;
|
|
11
|
+
idleMs = 110;
|
|
12
|
+
lastTime;
|
|
13
|
+
samples = 0;
|
|
14
|
+
move(delta, now) {
|
|
15
|
+
if (!Number.isFinite(delta) || !Number.isFinite(now))
|
|
16
|
+
return;
|
|
17
|
+
if (this.lastTime !== undefined) {
|
|
18
|
+
const interval = Math.max(0, now - this.lastTime);
|
|
19
|
+
// Sparse intentional samples extend the grace period; speed never ends a gesture.
|
|
20
|
+
this.idleMs = Math.max(110, Math.min(220, interval * 2.5));
|
|
21
|
+
}
|
|
22
|
+
this.lastTime = now;
|
|
23
|
+
this.samples++;
|
|
24
|
+
this.x -= delta;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/** Soft direction preference based on recent travel; never locks either axis. */
|
|
28
|
+
export class CarouselTouchDirection {
|
|
29
|
+
x;
|
|
30
|
+
y;
|
|
31
|
+
horizontal = 0;
|
|
32
|
+
vertical = 0;
|
|
33
|
+
lastX;
|
|
34
|
+
lastY;
|
|
35
|
+
constructor(x, y) {
|
|
36
|
+
this.x = x;
|
|
37
|
+
this.y = y;
|
|
38
|
+
this.lastX = x;
|
|
39
|
+
this.lastY = y;
|
|
40
|
+
}
|
|
41
|
+
move(x, y) {
|
|
42
|
+
const dx = x - this.lastX, dy = y - this.lastY;
|
|
43
|
+
this.lastX = x;
|
|
44
|
+
this.lastY = y;
|
|
45
|
+
const decay = Math.exp(-Math.hypot(dx, dy) / 36);
|
|
46
|
+
this.horizontal = this.horizontal * decay + Math.abs(dx);
|
|
47
|
+
this.vertical = this.vertical * decay + Math.abs(dy);
|
|
48
|
+
const weight = (minor, major) => {
|
|
49
|
+
const dominance = Math.max(0, Math.min(1, (major / Math.max(minor, 0.001) - 1.3) / 1.7));
|
|
50
|
+
return 1 - 0.88 * dominance;
|
|
51
|
+
};
|
|
52
|
+
this.x += dx * weight(this.horizontal, this.vertical);
|
|
53
|
+
this.y += dy * weight(this.vertical, this.horizontal);
|
|
54
|
+
return { x: this.x, y: this.y };
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/** Horizontal carousel motion, independent of the gesture's vertical scrolling. */
|
|
58
|
+
export class CarouselDrag {
|
|
59
|
+
startX;
|
|
60
|
+
startPhase;
|
|
61
|
+
active = false;
|
|
62
|
+
phase;
|
|
63
|
+
velocity = 0;
|
|
64
|
+
lastTime;
|
|
65
|
+
lastX;
|
|
66
|
+
constructor(startX, startPhase, now) {
|
|
67
|
+
this.startX = startX;
|
|
68
|
+
this.startPhase = startPhase;
|
|
69
|
+
this.phase = startPhase;
|
|
70
|
+
this.lastTime = now;
|
|
71
|
+
this.lastX = startX;
|
|
72
|
+
}
|
|
73
|
+
move(x, now, count) {
|
|
74
|
+
this.lastX = x;
|
|
75
|
+
const distance = this.startX - x;
|
|
76
|
+
if (!this.active && Math.abs(distance) < DRAG_THRESHOLD)
|
|
77
|
+
return;
|
|
78
|
+
this.active = true;
|
|
79
|
+
const raw = this.startPhase + distance / PIXELS_PER_ITEM;
|
|
80
|
+
const boundary = clampCarouselPhase(raw, count);
|
|
81
|
+
const excess = raw - boundary;
|
|
82
|
+
// Increasing resistance, with at most a third of a seat beyond either end.
|
|
83
|
+
const next = count < 2 ? 0 : boundary + 0.35 * excess / (0.7 + Math.abs(excess));
|
|
84
|
+
const elapsed = now - this.lastTime;
|
|
85
|
+
if (elapsed > 0) {
|
|
86
|
+
const speed = Math.max(-MAX_VELOCITY, Math.min(MAX_VELOCITY, (next - this.phase) / elapsed));
|
|
87
|
+
this.velocity += (speed - this.velocity) * (1 - Math.exp(-elapsed / 40));
|
|
88
|
+
}
|
|
89
|
+
this.phase = next;
|
|
90
|
+
this.lastTime = now;
|
|
91
|
+
}
|
|
92
|
+
release(now, count, x = this.lastX) {
|
|
93
|
+
// A coalesced final move may arrive only in the release event.
|
|
94
|
+
if (x !== this.lastX)
|
|
95
|
+
this.move(x, now, count);
|
|
96
|
+
// A held finger has no momentum, even if no move event arrived during the pause.
|
|
97
|
+
const outside = this.phase !== clampCarouselPhase(this.phase, count);
|
|
98
|
+
const velocity = outside || now - this.lastTime > 100 ? 0 : this.velocity;
|
|
99
|
+
return {
|
|
100
|
+
velocity,
|
|
101
|
+
target: Math.round(clampCarouselPhase(this.phase + velocity * INERTIA_TIME, count))
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
export function clampCarouselPhase(phase, count) {
|
|
106
|
+
return Math.max(0, Math.min(Math.max(0, count - 1), phase));
|
|
107
|
+
}
|
|
108
|
+
/** Snap the predicted stopping point into a critically damped trajectory.
|
|
109
|
+
* Preserve release speed, but raise damping for a close boundary so there is
|
|
110
|
+
* no overshoot or backwards correction. Progress also drives foreground reveal.
|
|
111
|
+
*/
|
|
112
|
+
export function sampleCarouselInertia(start, velocity, target, elapsed) {
|
|
113
|
+
const distance = target - start;
|
|
114
|
+
if (Math.abs(distance) < 0.000001)
|
|
115
|
+
return { phase: target, velocity: 0, progress: 1, finished: true };
|
|
116
|
+
const speed = velocity * distance > 0 ? velocity : 0;
|
|
117
|
+
const damping = Math.max(1 / INERTIA_TIME, Math.abs(speed / distance));
|
|
118
|
+
const coefficient = speed - damping * distance;
|
|
119
|
+
const time = Math.max(0, elapsed);
|
|
120
|
+
const decay = Math.exp(-damping * time);
|
|
121
|
+
const phase = target + (-distance + coefficient * time) * decay;
|
|
122
|
+
const remainingSpeed = (speed - damping * coefficient * time) * decay;
|
|
123
|
+
const finished = (Math.abs(phase - target) < 0.001 && Math.abs(remainingSpeed) < 0.00001) || time >= 3200;
|
|
124
|
+
return {
|
|
125
|
+
phase: finished ? target : phase,
|
|
126
|
+
velocity: finished ? 0 : remainingSpeed,
|
|
127
|
+
progress: finished ? 1 : Math.max(0, Math.min(1, (phase - start) / distance)),
|
|
128
|
+
finished
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
/** Analytic critical damping, independent of refresh rate and dropped frames. */
|
|
132
|
+
export function sampleCarouselSpring(start, velocity, target, elapsed) {
|
|
133
|
+
const damping = 0.012;
|
|
134
|
+
const offset = start - target;
|
|
135
|
+
const coefficient = velocity + damping * offset;
|
|
136
|
+
const decay = Math.exp(-damping * elapsed);
|
|
137
|
+
return {
|
|
138
|
+
phase: target + (offset + coefficient * elapsed) * decay,
|
|
139
|
+
velocity: (velocity - damping * coefficient * elapsed) * decay
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
/** Page scrolling for the model surface, which owns both single-finger axes. */
|
|
143
|
+
export class CarouselScrollDrag {
|
|
144
|
+
lastY;
|
|
145
|
+
position;
|
|
146
|
+
maximum;
|
|
147
|
+
lastTime;
|
|
148
|
+
active = false;
|
|
149
|
+
velocity = 0;
|
|
150
|
+
constructor(lastY, position, maximum, lastTime) {
|
|
151
|
+
this.lastY = lastY;
|
|
152
|
+
this.position = position;
|
|
153
|
+
this.maximum = maximum;
|
|
154
|
+
this.lastTime = lastTime;
|
|
155
|
+
}
|
|
156
|
+
move(y, now) {
|
|
157
|
+
const distance = this.lastY - y;
|
|
158
|
+
if (!this.active && Math.abs(distance) < 6)
|
|
159
|
+
return;
|
|
160
|
+
this.active = true;
|
|
161
|
+
const next = Math.max(0, Math.min(this.maximum, this.position + distance));
|
|
162
|
+
const elapsed = now - this.lastTime;
|
|
163
|
+
if (elapsed > 0) {
|
|
164
|
+
const speed = Math.max(-3, Math.min(3, (next - this.position) / elapsed));
|
|
165
|
+
this.velocity += (speed - this.velocity) * (1 - Math.exp(-elapsed / 40));
|
|
166
|
+
}
|
|
167
|
+
this.position = next;
|
|
168
|
+
this.lastY = y;
|
|
169
|
+
this.lastTime = now;
|
|
170
|
+
}
|
|
171
|
+
release(now, y = this.lastY) {
|
|
172
|
+
if (y !== this.lastY)
|
|
173
|
+
this.move(y, now);
|
|
174
|
+
return now - this.lastTime > 100 ? 0 : this.velocity;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
export function sampleCarouselScrollMomentum(start, velocity, elapsed, maximum) {
|
|
178
|
+
const decay = Math.exp(-elapsed / 240);
|
|
179
|
+
const position = Math.max(0, Math.min(maximum, start + velocity * 240 * (1 - decay)));
|
|
180
|
+
return {
|
|
181
|
+
position,
|
|
182
|
+
finished: position <= 0 || position >= maximum || Math.abs(velocity * decay) < 0.02 || elapsed >= 1600
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
//# sourceMappingURL=carouselMotion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carouselMotion.js","sourceRoot":"","sources":["../../src/catalog/carouselMotion.ts"],"names":[],"mappings":"AAAA,MAAM,eAAe,GAAG,GAAG,CAAC;AAC5B,MAAM,cAAc,GAAG,CAAC,CAAC;AACzB,MAAM,YAAY,GAAG,KAAK,CAAC;AAC3B,MAAM,YAAY,GAAG,GAAG,CAAC;AAEzB;;;GAGG;AACH,MAAM,OAAO,kBAAkB;IAC9B,CAAC,GAAG,CAAC,CAAC;IACN,MAAM,GAAG,GAAG,CAAC;IACb,QAAQ,CAAqB;IAC7B,OAAO,GAAG,CAAC,CAAC;IACZ,IAAI,CAAC,KAAa,EAAE,GAAW;QAC9B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC;YAAE,OAAO;QAC7D,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YACjC,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;YAClD,kFAAkF;YAClF,IAAI,CAAC,MAA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AC","sourcesContent":["const PIXELS_PER_ITEM = 220;\nconst DRAG_THRESHOLD = 8;\nconst MAX_VELOCITY = 0.025;\nconst INERTIA_TIME = 320;\n\n/** Wheel adapter only: the carousel controller remains the sole owner of motion.\n * Keep the last input time separate from the idle detection delay: that delay\n * is not a physical hold and must not erase the release velocity.\n */\nexport class CarouselWheelInput {\n\tx = 0;\n\tidleMs = 110;\n\tlastTime: number | undefined;\n\tsamples = 0;\n\tmove(delta: number, now: number) {\n\t\tif (!Number.isFinite(delta) || !Number.isFinite(now)) return;\n\t\tif (this.lastTime !== undefined) {\n\t\t\tconst interval = Math.max(0, now - this.lastTime);\n\t\t\t// Sparse intentional samples extend the grace period; speed never ends a gesture.\n\t\t\tthis.idleMs = Math.max(110, Math.min(220, interval * 2.5));\n\t\t}\n\t\tthis.lastTime = now;\n\t\tthis.samples++;\n\t\tthis.x -= delta;\n\t}\n}\n\n/** Soft direction preference based on recent travel; never locks either axis. */\nexport class CarouselTouchDirection {\n\tprivate horizontal = 0;\n\tprivate vertical = 0;\n\tprivate lastX: number;\n\tprivate lastY: number;\n\tconstructor(public x: number, public y: number) {\n\t\tthis.lastX = x;\n\t\tthis.lastY = y;\n\t}\n\tmove(x: number, y: number) {\n\t\tconst dx = x - this.lastX, dy = y - this.lastY;\n\t\tthis.lastX = x;\n\t\tthis.lastY = y;\n\t\tconst decay = Math.exp(-Math.hypot(dx, dy) / 36);\n\t\tthis.horizontal = this.horizontal * decay + Math.abs(dx);\n\t\tthis.vertical = this.vertical * decay + Math.abs(dy);\n\t\tconst weight = (minor: number, major: number) => {\n\t\t\tconst dominance = Math.max(0, Math.min(1, (major / Math.max(minor, 0.001) - 1.3) / 1.7));\n\t\t\treturn 1 - 0.88 * dominance;\n\t\t};\n\t\tthis.x += dx * weight(this.horizontal, this.vertical);\n\t\tthis.y += dy * weight(this.vertical, this.horizontal);\n\t\treturn { x: this.x, y: this.y };\n\t}\n}\n\n/** Horizontal carousel motion, independent of the gesture's vertical scrolling. */\nexport class CarouselDrag {\n\tactive = false;\n\tphase: number;\n\tprivate velocity = 0;\n\tprivate lastTime: number;\n\tprivate lastX: number;\n\n\tconstructor(\n\t\tprivate readonly startX: number,\n\t\tprivate readonly startPhase: number,\n\t\tnow: number\n\t) {\n\t\tthis.phase = startPhase;\n\t\tthis.lastTime = now;\n\t\tthis.lastX = startX;\n\t}\n\n\tmove(x: number, now: number, count: number) {\n\t\tthis.lastX = x;\n\t\tconst distance = this.startX - x;\n\t\tif (!this.active && Math.abs(distance) < DRAG_THRESHOLD) return;\n\t\tthis.active = true;\n\t\tconst raw = this.startPhase + distance / PIXELS_PER_ITEM;\n\t\tconst boundary = clampCarouselPhase(raw, count);\n\t\tconst excess = raw - boundary;\n\t\t// Increasing resistance, with at most a third of a seat beyond either end.\n\t\tconst next = count < 2 ? 0 : boundary + 0.35 * excess / (0.7 + Math.abs(excess));\n\t\tconst elapsed = now - this.lastTime;\n\t\tif (elapsed > 0) {\n\t\t\tconst speed = Math.max(-MAX_VELOCITY, Math.min(MAX_VELOCITY, (next - this.phase) / elapsed));\n\t\t\tthis.velocity += (speed - this.velocity) * (1 - Math.exp(-elapsed / 40));\n\t\t}\n\t\tthis.phase = next;\n\t\tthis.lastTime = now;\n\t}\n\n\trelease(now: number, count: number, x = this.lastX) {\n\t\t// A coalesced final move may arrive only in the release event.\n\t\tif (x !== this.lastX) this.move(x, now, count);\n\t\t// A held finger has no momentum, even if no move event arrived during the pause.\n\t\tconst outside = this.phase !== clampCarouselPhase(this.phase, count);\n\t\tconst velocity = outside || now - this.lastTime > 100 ? 0 : this.velocity;\n\t\treturn {\n\t\t\tvelocity,\n\t\t\ttarget: Math.round(clampCarouselPhase(this.phase + velocity * INERTIA_TIME, count))\n\t\t};\n\t}\n}\n\nexport function clampCarouselPhase(phase: number, count: number) {\n\treturn Math.max(0, Math.min(Math.max(0, count - 1), phase));\n}\n\n/** Snap the predicted stopping point into a critically damped trajectory.\n * Preserve release speed, but raise damping for a close boundary so there is\n * no overshoot or backwards correction. Progress also drives foreground reveal.\n */\nexport function sampleCarouselInertia(start: number, velocity: number, target: number, elapsed: number) {\n\tconst distance = target - start;\n\tif (Math.abs(distance) < 0.000001) return { phase: target, velocity: 0, progress: 1, finished: true };\n\tconst speed = velocity * distance > 0 ? velocity : 0;\n\tconst damping = Math.max(1 / INERTIA_TIME, Math.abs(speed / distance));\n\tconst coefficient = speed - damping * distance;\n\tconst time = Math.max(0, elapsed);\n\tconst decay = Math.exp(-damping * time);\n\tconst phase = target + (-distance + coefficient * time) * decay;\n\tconst remainingSpeed = (speed - damping * coefficient * time) * decay;\n\tconst finished = (Math.abs(phase - target) < 0.001 && Math.abs(remainingSpeed) < 0.00001) || time >= 3200;\n\treturn {\n\t\tphase: finished ? target : phase,\n\t\tvelocity: finished ? 0 : remainingSpeed,\n\t\tprogress: finished ? 1 : Math.max(0, Math.min(1, (phase - start) / distance)),\n\t\tfinished\n\t};\n}\n\n/** Analytic critical damping, independent of refresh rate and dropped frames. */\nexport function sampleCarouselSpring(start: number, velocity: number, target: number, elapsed: number) {\n\tconst damping = 0.012;\n\tconst offset = start - target;\n\tconst coefficient = velocity + damping * offset;\n\tconst decay = Math.exp(-damping * elapsed);\n\treturn {\n\t\tphase: target + (offset + coefficient * elapsed) * decay,\n\t\tvelocity: (velocity - damping * coefficient * elapsed) * decay\n\t};\n}\n\n/** Page scrolling for the model surface, which owns both single-finger axes. */\nexport class CarouselScrollDrag {\n\tactive = false;\n\tprivate velocity = 0;\n\tconstructor(\n\t\tprivate lastY: number,\n\t\tpublic position: number,\n\t\treadonly maximum: number,\n\t\tprivate lastTime: number\n\t) {}\n\n\tmove(y: number, now: number) {\n\t\tconst distance = this.lastY - y;\n\t\tif (!this.active && Math.abs(distance) < 6) return;\n\t\tthis.active = true;\n\t\tconst next = Math.max(0, Math.min(this.maximum, this.position + distance));\n\t\tconst elapsed = now - this.lastTime;\n\t\tif (elapsed > 0) {\n\t\t\tconst speed = Math.max(-3, Math.min(3, (next - this.position) / elapsed));\n\t\t\tthis.velocity += (speed - this.velocity) * (1 - Math.exp(-elapsed / 40));\n\t\t}\n\t\tthis.position = next;\n\t\tthis.lastY = y;\n\t\tthis.lastTime = now;\n\t}\n\n\trelease(now: number, y = this.lastY) {\n\t\tif (y !== this.lastY) this.move(y, now);\n\t\treturn now - this.lastTime > 100 ? 0 : this.velocity;\n\t}\n}\n\nexport function sampleCarouselScrollMomentum(start: number, velocity: number, elapsed: number, maximum: number) {\n\tconst decay = Math.exp(-elapsed / 240);\n\tconst position = Math.max(0, Math.min(maximum, start + velocity * 240 * (1 - decay)));\n\treturn {\n\t\tposition,\n\t\tfinished: position <= 0 || position >= maximum || Math.abs(velocity * decay) < 0.02 || elapsed >= 1600\n\t};\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carouselPanelProjection.d.ts","sourceRoot":"","sources":["../../src/catalog/carouselPanelProjection.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"carouselPanelProjection.d.ts","sourceRoot":"","sources":["../../src/catalog/carouselPanelProjection.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAQ7F,kFAAkF;AAClF,wBAAgB,mBAAmB,CAClC,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,iBAAiB,EAC1B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,QAGd;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,WAAW;;;;cA2D1D"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getProjectiveCssMatrix3d } from '../stage/cssProjection.js';
|
|
2
|
+
import { refineProjectedLayoutOffset } from './cardProjection.js';
|
|
2
3
|
const frames = new WeakMap();
|
|
3
4
|
/** The last submitted frame survives page teardown without retaining the page. */
|
|
4
5
|
export function recordCarouselPanel(panel, corners, width, height) {
|
|
@@ -9,21 +10,57 @@ export function captureCarouselElement(element) {
|
|
|
9
10
|
const frame = panel && frames.get(panel);
|
|
10
11
|
if (!panel || !frame)
|
|
11
12
|
return undefined;
|
|
12
|
-
if (element === panel)
|
|
13
|
-
return frame;
|
|
14
|
-
// Shared summary roles are direct children. Never guess a nested content transform.
|
|
15
|
-
if (element.offsetParent !== panel)
|
|
16
|
-
return undefined;
|
|
17
13
|
const projection = getProjectiveCssMatrix3d(frame.corners, frame.width, frame.height);
|
|
18
14
|
if (!projection)
|
|
19
15
|
return undefined;
|
|
20
|
-
const
|
|
21
|
-
|
|
16
|
+
const borderBox = (node) => {
|
|
17
|
+
const style = getComputedStyle(node);
|
|
18
|
+
const px = (name) => Number.parseFloat(style.getPropertyValue(name)) || 0;
|
|
19
|
+
return { width: px('width') + (style.boxSizing === 'border-box' ? 0 : px('padding-left') + px('padding-right') + px('border-left-width') + px('border-right-width')),
|
|
20
|
+
height: px('height') + (style.boxSizing === 'border-box' ? 0 : px('padding-top') + px('padding-bottom') + px('border-top-width') + px('border-bottom-width')) };
|
|
21
|
+
};
|
|
22
|
+
const chain = [];
|
|
23
|
+
for (let node = element; node !== panel;) {
|
|
24
|
+
chain.push(node);
|
|
25
|
+
const parent = node.offsetParent;
|
|
26
|
+
if (!(parent instanceof HTMLElement) || parent !== panel && !panel.contains(parent))
|
|
27
|
+
return undefined;
|
|
28
|
+
node = parent;
|
|
29
|
+
}
|
|
30
|
+
let matrix = new DOMMatrix(projection);
|
|
31
|
+
const panelSize = borderBox(panel);
|
|
32
|
+
const projectedPanel = [[0, 0], [panelSize.width, 0], [panelSize.width, panelSize.height], [0, panelSize.height]]
|
|
33
|
+
.map(([x, y]) => matrix.transformPoint(new DOMPoint(x, y)));
|
|
34
|
+
const panelRect = panel.getBoundingClientRect();
|
|
35
|
+
// Native document movement can precede the next submitted GPU frame. Keep the
|
|
36
|
+
// cached projective plane but rebase its translation to the current source DOM.
|
|
37
|
+
matrix = new DOMMatrix().translate(panelRect.left - Math.min(...projectedPanel.map(point => point.x / point.w)), panelRect.top - Math.min(...projectedPanel.map(point => point.y / point.w))).multiply(matrix);
|
|
38
|
+
// The persistent island/query wrappers can introduce positioned and scrolling
|
|
39
|
+
// ancestors. Resolve each actual local plane, retaining fractional CSS sizes.
|
|
40
|
+
for (const node of chain.reverse()) {
|
|
41
|
+
const style = getComputedStyle(node);
|
|
42
|
+
if ([style.translate, style.rotate, style.scale].some(value => value && value !== 'none'))
|
|
43
|
+
return undefined;
|
|
44
|
+
const [x, y, z = 0] = style.transformOrigin.split(' ').map(Number.parseFloat);
|
|
45
|
+
if (![x, y, z].every(Number.isFinite))
|
|
46
|
+
return undefined;
|
|
47
|
+
const local = new DOMMatrix().translate(x, y, z)
|
|
48
|
+
.multiply(new DOMMatrix(style.transform === 'none' ? undefined : style.transform)).translate(-x, -y, -z);
|
|
49
|
+
const size = borderBox(node);
|
|
50
|
+
const measured = node.getBoundingClientRect();
|
|
51
|
+
const localCorners = [[0, 0], [size.width, 0], [size.width, size.height], [0, size.height]]
|
|
52
|
+
.map(([cx, cy]) => local.transformPoint(new DOMPoint(cx, cy)));
|
|
53
|
+
const offset = refineProjectedLayoutOffset(matrix.toFloat64Array(), localCorners, { left: measured.left, top: measured.top }, { x: node.offsetLeft, y: node.offsetTop });
|
|
54
|
+
matrix = matrix.translate(offset.x, offset.y).multiply(local);
|
|
55
|
+
}
|
|
56
|
+
const { width, height } = borderBox(element);
|
|
57
|
+
if (!width || !height)
|
|
58
|
+
return undefined;
|
|
22
59
|
const corners = [
|
|
23
|
-
[
|
|
24
|
-
[
|
|
25
|
-
[
|
|
26
|
-
[
|
|
60
|
+
[0, 0],
|
|
61
|
+
[width, 0],
|
|
62
|
+
[width, height],
|
|
63
|
+
[0, height]
|
|
27
64
|
].map(([x, y]) => {
|
|
28
65
|
const point = matrix.transformPoint(new DOMPoint(x, y));
|
|
29
66
|
return { x: point.x / point.w, y: point.y / point.w };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carouselPanelProjection.js","sourceRoot":"","sources":["../../src/catalog/carouselPanelProjection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAA0B,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"carouselPanelProjection.js","sourceRoot":"","sources":["../../src/catalog/carouselPanelProjection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAA0B,MAAM,2BAA2B,CAAC;AAC7F,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAElE,MAAM,MAAM,GAAG,IAAI,OAAO,EAGvB,CAAC;AAEJ,kFAAkF;AAClF,MAAM,UAAU,mBAAmB,CAClC,KAAkB,EAClB,OAA0B,EAC1B,KAAa,EACb,MAAc;IAEd,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,OAAoB;IAC1D,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAc,0CAA0C,CAAC,CAAC;IACvF,MAAM,KAAK,GAAG,KAAK,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACzC,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAC;IACvC,MAAM,UAAU,GAAG,wBAAwB,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtF,IAAI,CAAC,UAAU;QAAE,OAAO,SAAS,CAAC;IAClC,MAAM,SAAS,GAAG,CAAC,IAAiB,EAAE,EAAE;QACvC,MAAM,KAAK,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;QACrC,MAAM,EAAE,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,gBAAg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CAAC;QACxF,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC/D,CAAC;IACD,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;IAC7C,IAAI,CAAC,KAAK,IAAI,CAAC,MAAM;QAAE,OAAO,SAAS,CAAC;IACxC,MAAM,OAAO,GAAG;QACf,CAAC,CAAC,EAAE,CAAC,CAAC;QACN,CAAC,KAAK,EAAE,CAAC,CAAC;QACV,CAAC,KAAK,EAAE,MAAM,CAAC;QACf,CAAC,CAAC,EAAE,MAAM,CAAC;KACX,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE;QAChB,MAAM,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACxD,OAAO,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC;IACvD,CAAC,CAAiC,CAAC;IACnC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AACnC,CAAC","sourcesContent":["import { getProjectiveCssMatrix3d, type CssProjectionQuad } from '../stage/cssProjection.js';\nimport { refineProjectedLayoutOffset } from './cardProjection.js';\n\nconst frames = new WeakMap<\n\tHTMLElement,\n\t{ corners: CssProjectionQuad; width: number; height: number }\n>();\n\n/** The last submitted frame survives page teardown without retaining the page. */\nexport function recordCarouselPanel(\n\tpanel: HTMLElement,\n\tcorners: CssProjectionQuad,\n\twidth: number,\n\theight: number\n) {\n\tframes.set(panel, { corners, width, height });\n}\n\nexport function captureCarouselElement(element: HTMLElement) {\n\tconst panel = element.closest<HTMLElement>('[data-carousel-spatial-element] .summary');\n\tconst frame = panel && frames.get(panel);\n\tif (!panel || !frame) return undefined;\n\tconst projection = getProjectiveCssMatrix3d(frame.corners, frame.width, frame.height);\n\tif (!projection) return undefined;\n\tconst borderBox = (node: HTMLElement) => {\n\t\tconst style = getComputedStyle(node);\n\t\tconst px = (name: string) => Number.parseFloat(style.getPropertyValue(name)) || 0;\n\t\treturn { width: px('width') + (style.boxSizing === 'border-box' ? 0 : px('padding-left') + px('padding-right') + px('border-left-width') + px('border-right-width')),\n\t\t\theight: px('height') + (style.boxSizing === 'border-box' ? 0 : px('padding-top') + px('padding-bottom') + px('border-top-width') + px('border-bottom-width')) };\n\t};\n\tconst chain: HTMLElement[] = [];\n\tfor (let node = element; node !== panel;) {\n\t\tchain.push(node);\n\t\tconst parent: Element | null = node.offsetParent;\n\t\tif (!(parent instanceof HTMLElement) || parent !== panel && !panel.contains(parent)) return undefined;\n\t\tnode = parent;\n\t}\n\tlet matrix = new DOMMatrix(projection);\n\tconst panelSize = borderBox(panel);\n\tconst projectedPanel = [[0, 0], [panelSize.width, 0], [panelSize.width, panelSize.height], [0, panelSize.height]]\n\t\t.map(([x, y]) => matrix.transformPoint(new DOMPoint(x, y)));\n\tconst panelRect = panel.getBoundingClientRect();\n\t// Native document movement can precede the next submitted GPU frame. Keep the\n\t// cached projective plane but rebase its translation to the current source DOM.\n\tmatrix = new DOMMatrix().translate(\n\t\tpanelRect.left - Math.min(...projectedPanel.map(point => point.x / point.w)),\n\t\tpanelRect.top - Math.min(...projectedPanel.map(point => point.y / point.w))\n\t).multiply(matrix);\n\t// The persistent island/query wrappers can introduce positioned and scrolling\n\t// ancestors. Resolve each actual local plane, retaining fractional CSS sizes.\n\tfor (const node of chain.reverse()) {\n\t\tconst style = getComputedStyle(node);\n\t\tif ([style.translate, style.rotate, style.scale].some(value => value && value !== 'none')) return undefined;\n\t\tconst [x, y, z = 0] = style.transformOrigin.split(' ').map(Number.parseFloat);\n\t\tif (![x, y, z].every(Number.isFinite)) return undefined;\n\t\tconst local = new DOMMatrix().translate(x, y, z)\n\t\t\t.multiply(new DOMMatrix(style.transform === 'none' ? undefined : style.transform)).translate(-x, -y, -z);\n\t\tconst size = borderBox(node);\n\t\tconst measured = node.getBoundingClientRect();\n\t\tconst localCorners = [[0, 0], [size.width, 0], [size.width, size.height], [0, size.height]]\n\t\t\t.map(([cx, cy]) => local.transformPoint(new DOMPoint(cx, cy)));\n\t\tconst offset = refineProjectedLayoutOffset(matrix.toFloat64Array(), localCorners,\n\t\t\t{ left: measured.left, top: measured.top }, { x: node.offsetLeft, y: node.offsetTop });\n\t\tmatrix = matrix.translate(offset.x, offset.y).multiply(local);\n\t}\n\tconst { width, height } = borderBox(element);\n\tif (!width || !height) return undefined;\n\tconst corners = [\n\t\t[0, 0],\n\t\t[width, 0],\n\t\t[width, height],\n\t\t[0, height]\n\t].map(([x, y]) => {\n\t\tconst point = matrix.transformPoint(new DOMPoint(x, y));\n\t\treturn { x: point.x / point.w, y: point.y / point.w };\n\t}) as unknown as CssProjectionQuad;\n\treturn { corners, width, height };\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Mouse approach is bounded and continuous outside the projected model bounds. */
|
|
2
|
+
export declare function carouselProximity(x: number, y: number, rect: {
|
|
3
|
+
left: number;
|
|
4
|
+
top: number;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
}): {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=carouselProximity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carouselProximity.d.ts","sourceRoot":"","sources":["../../src/catalog/carouselProximity.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EACrD,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE;;;EAWlE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Mouse approach is bounded and continuous outside the projected model bounds. */
|
|
2
|
+
export function carouselProximity(x, y, rect) {
|
|
3
|
+
const dx = x - rect.left - rect.width / 2, dy = y - rect.top - rect.height / 2;
|
|
4
|
+
const distance = Math.hypot(Math.max(0, Math.abs(dx) - rect.width / 2), Math.max(0, Math.abs(dy) - rect.height / 2));
|
|
5
|
+
const t = Math.min(1, distance / 150);
|
|
6
|
+
const influence = 1 - t * t * (3 - 2 * t);
|
|
7
|
+
const limit = 4 * Math.PI / 180;
|
|
8
|
+
return {
|
|
9
|
+
x: -Math.max(-1, Math.min(1, dy / Math.max(1, rect.height / 2))) * limit * influence || 0,
|
|
10
|
+
y: -Math.max(-1, Math.min(1, dx / Math.max(1, rect.width / 2))) * limit * influence || 0
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=carouselProximity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carouselProximity.js","sourceRoot":"","sources":["../../src/catalog/carouselProximity.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,MAAM,UAAU,iBAAiB,CAAC,CAAS,EAAE,CAAS,EACrD,IAAkE;IAClE,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IAC/E,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,EACrE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;IAC9C,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,GAAG,GAAG,CAAC,CAAC;IACtC,MAAM,SAAS,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1C,MAAM,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC;IAChC,OAAO;QACN,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,SAAS,IAAI,CAAC;QACzF,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,SAAS,IAAI,CAAC;KACxF,CAAC;AACH,CAAC","sourcesContent":["/** Mouse approach is bounded and continuous outside the projected model bounds. */\nexport function carouselProximity(x: number, y: number,\n\trect: { left: number; top: number; width: number; height: number }) {\n\tconst dx = x - rect.left - rect.width / 2, dy = y - rect.top - rect.height / 2;\n\tconst distance = Math.hypot(Math.max(0, Math.abs(dx) - rect.width / 2),\n\t\tMath.max(0, Math.abs(dy) - rect.height / 2));\n\tconst t = Math.min(1, distance / 150);\n\tconst influence = 1 - t * t * (3 - 2 * t);\n\tconst limit = 4 * Math.PI / 180;\n\treturn {\n\t\tx: -Math.max(-1, Math.min(1, dy / Math.max(1, rect.height / 2))) * limit * influence || 0,\n\t\ty: -Math.max(-1, Math.min(1, dx / Math.max(1, rect.width / 2))) * limit * influence || 0\n\t};\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as THREE from 'three/webgpu';
|
|
2
|
+
/** Cache a small support envelope from actual vertices, rather than empty box corners. */
|
|
3
|
+
export declare function carouselSupport(model: THREE.Object3D, orientation: THREE.Quaternion): THREE.Vector3[];
|
|
4
|
+
//# sourceMappingURL=carouselSupport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carouselSupport.d.ts","sourceRoot":"","sources":["../../src/catalog/carouselSupport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAGtC,0FAA0F;AAC1F,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,CAAC,UAAU,mBAqBnF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as THREE from 'three/webgpu';
|
|
2
|
+
import { isMesh } from '../stage/stageSceneUtils.js';
|
|
3
|
+
/** Cache a small support envelope from actual vertices, rather than empty box corners. */
|
|
4
|
+
export function carouselSupport(model, orientation) {
|
|
5
|
+
const directions = [new THREE.Vector3(0, 1, 0), ...Array.from({ length: 16 }, (_, i) => new THREE.Vector3(Math.cos(i * Math.PI / 8) * 0.14, 1, Math.sin(i * Math.PI / 8) * 0.14))];
|
|
6
|
+
const scores = directions.map(() => Infinity);
|
|
7
|
+
const points = directions.map(() => new THREE.Vector3());
|
|
8
|
+
const vertex = new THREE.Vector3(), rotated = new THREE.Vector3();
|
|
9
|
+
model.updateMatrixWorld(true);
|
|
10
|
+
model.traverseVisible(object => {
|
|
11
|
+
if (!isMesh(object))
|
|
12
|
+
return;
|
|
13
|
+
const positions = object.geometry.getAttribute('position');
|
|
14
|
+
if (!positions)
|
|
15
|
+
return;
|
|
16
|
+
for (let i = 0; i < positions.count; i++) {
|
|
17
|
+
object.getVertexPosition(i, vertex).applyMatrix4(object.matrixWorld);
|
|
18
|
+
rotated.copy(vertex).applyQuaternion(orientation);
|
|
19
|
+
for (let j = 0; j < directions.length; j++) {
|
|
20
|
+
const score = rotated.dot(directions[j]);
|
|
21
|
+
if (score < scores[j]) {
|
|
22
|
+
scores[j] = score;
|
|
23
|
+
points[j].copy(vertex);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
return points;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=carouselSupport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carouselSupport.js","sourceRoot":"","sources":["../../src/catalog/carouselSupport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAErD,0FAA0F;AAC1F,MAAM,UAAU,eAAe,CAAC,KAAqB,EAAE,WAA6B;IACnF,MAAM,UAAU,GAAG,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACtF,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IAC5F,MAAM,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC;IAC9C,MAAM,MAAM,GAAG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'three/webgpu';\nimport { isMesh } from '../stage/stageSceneUtils.js';\n\n/** Cache a small support envelope from actual vertices, rather than empty box corners. */\nexport function carouselSupport(model: THREE.Object3D, orientation: THREE.Quaternion) {\n\tconst directions = [new THREE.Vector3(0, 1, 0), ...Array.from({ length: 16 }, (_, i) =>\n\t\tnew THREE.Vector3(Math.cos(i * Math.PI / 8) * 0.14, 1, Math.sin(i * Math.PI / 8) * 0.14))];\n\tconst scores = directions.map(() => Infinity);\n\tconst points = directions.map(() => new THREE.Vector3());\n\tconst vertex = new THREE.Vector3(), rotated = new THREE.Vector3();\n\tmodel.updateMatrixWorld(true);\n\tmodel.traverseVisible(object => {\n\t\tif (!isMesh(object)) return;\n\t\tconst positions = object.geometry.getAttribute('position');\n\t\tif (!positions) return;\n\t\tfor (let i = 0; i < positions.count; i++) {\n\t\t\tobject.getVertexPosition(i, vertex).applyMatrix4(object.matrixWorld);\n\t\t\trotated.copy(vertex).applyQuaternion(orientation);\n\t\t\tfor (let j = 0; j < directions.length; j++) {\n\t\t\t\tconst score = rotated.dot(directions[j]);\n\t\t\t\tif (score < scores[j]) { scores[j] = score; points[j].copy(vertex); }\n\t\t\t}\n\t\t}\n\t});\n\treturn points;\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Keep native focus immediate while identifying only its activation-owned GPU work. */
|
|
2
|
+
export declare function focusCatalogLink(anchor: HTMLAnchorElement, event: MouseEvent): void;
|
|
3
|
+
/** Unrelated or reentrant focus changes retain their ordinary immediate invalidation. */
|
|
4
|
+
export declare function isCatalogActivationFocus(event: FocusEvent): boolean;
|
|
5
|
+
//# sourceMappingURL=catalogActivationFocus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalogActivationFocus.d.ts","sourceRoot":"","sources":["../../src/catalog/catalogActivationFocus.ts"],"names":[],"mappings":"AAwBA,wFAAwF;AACxF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,iBAAiB,EAAE,KAAK,EAAE,UAAU,GAAG,IAAI,CAMnF;AAED,yFAAyF;AACzF,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAKnE"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// The scope exists only while our own synchronous focus() dispatches its events.
|
|
2
|
+
// It neither classifies trusted input nor claims that a router accepted the click.
|
|
3
|
+
let activationFocus;
|
|
4
|
+
function ordinaryLinkActivation(anchor, event) {
|
|
5
|
+
if (event.defaultPrevented || event.button !== 0 || event.metaKey || event.ctrlKey ||
|
|
6
|
+
event.shiftKey || event.altKey || anchor.getAttribute('role') === 'button' ||
|
|
7
|
+
anchor.hasAttribute('download') || anchor.target || anchor.relList.contains('external') ||
|
|
8
|
+
anchor.closest('[data-sveltekit-keepfocus], [data-sveltekit-noscroll], [data-sveltekit-replacestate], [data-sveltekit-reload]'))
|
|
9
|
+
return false;
|
|
10
|
+
try {
|
|
11
|
+
const current = new URL(anchor.ownerDocument.URL);
|
|
12
|
+
const destination = new URL(anchor.href, anchor.ownerDocument.baseURI);
|
|
13
|
+
return destination.origin === current.origin && destination.pathname !== current.pathname &&
|
|
14
|
+
(destination.protocol === 'http:' || destination.protocol === 'https:');
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/** Keep native focus immediate while identifying only its activation-owned GPU work. */
|
|
21
|
+
export function focusCatalogLink(anchor, event) {
|
|
22
|
+
const preceding = activationFocus;
|
|
23
|
+
activationFocus = ordinaryLinkActivation(anchor, event)
|
|
24
|
+
? { anchor, previous: anchor.ownerDocument.activeElement } : undefined;
|
|
25
|
+
try {
|
|
26
|
+
anchor.focus({ preventScroll: true });
|
|
27
|
+
}
|
|
28
|
+
finally {
|
|
29
|
+
activationFocus = preceding;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/** Unrelated or reentrant focus changes retain their ordinary immediate invalidation. */
|
|
33
|
+
export function isCatalogActivationFocus(event) {
|
|
34
|
+
const scope = activationFocus;
|
|
35
|
+
return Boolean(scope && (event.type === 'focusin'
|
|
36
|
+
? event.target === scope.anchor
|
|
37
|
+
: event.type === 'focusout' && event.target === scope.previous && event.relatedTarget === scope.anchor));
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=catalogActivationFocus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalogActivationFocus.js","sourceRoot":"","sources":["../../src/catalog/catalogActivationFocus.ts"],"names":[],"mappings":"AAKA,iFAAiF;AACjF,mFAAmF;AACnF,IAAI,eAA4C,CAAC;AAEjD,SAAS,sBAAsB,CAAC,MAAyB,EAAE,KAAiB;IAC3E,IAAI,KAAK,CAAC,gBAAgB,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO;QACjF,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,QAAQ;QAC1E,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC;QACvF,MAAM,CAAC,OAAO,CAAC,+GAA+G,CAAC;QAAE,OAAO,KAAK,CAAC;IAC/I,IAAI,CAAC;QACJ,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QAClD,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACvE,OAAO,WAAW,CAAC,MAAM,KAAK,OAAO,CAAC,MAAM,IAAI,WAAW,CAAC,QAAQ,KAAK,OAAO,CAAC,QAAQ;YACxF,CAAC,WAAW,CAAC,QAAQ,KAAK,OAAO,IAAI,WAAW,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC;IAC1E,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,KAAK,CAAC;IACd,CAAC;AACF,CAAC;AAED,wFAAwF;AACxF,MAAM,UAAU,gBAAgB,CAAC,MAAyB,EAAE,KAAiB;IAC5E,MAAM,SAAS,GAAG,eAAe,CAAC;IAClC,eAAe,GAAG,sBAAsB,CAAC,MAAM,EAAE,KAAK,CAAC;QACtD,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,aAAa,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IACxE,IAAI,CAAC;QAAC,MAAM,CAAC,KAAK,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;IAAC,CAAC;YACtC,CAAC;QAAC,eAAe,GAAG,SAAS,CAAC;IAAC,CAAC;AACzC,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,wBAAwB,CAAC,KAAiB;IACzD,MAAM,KAAK,GAAG,eAAe,CAAC;IAC9B,OAAO,OAAO,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,SAAS;QAChD,CAAC,CAAC,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM;QAC/B,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,UAAU,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,aAAa,KAAK,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;AAC3G,CAAC","sourcesContent":["interface ActivationFocus {\n\tanchor: HTMLAnchorElement;\n\tprevious: Element | null;\n}\n\n// The scope exists only while our own synchronous focus() dispatches its events.\n// It neither classifies trusted input nor claims that a router accepted the click.\nlet activationFocus: ActivationFocus | undefined;\n\nfunction ordinaryLinkActivation(anchor: HTMLAnchorElement, event: MouseEvent): boolean {\n\tif (event.defaultPrevented || event.button !== 0 || event.metaKey || event.ctrlKey ||\n\t\tevent.shiftKey || event.altKey || anchor.getAttribute('role') === 'button' ||\n\t\tanchor.hasAttribute('download') || anchor.target || anchor.relList.contains('external') ||\n\t\tanchor.closest('[data-sveltekit-keepfocus], [data-sveltekit-noscroll], [data-sveltekit-replacestate], [data-sveltekit-reload]')) return false;\n\ttry {\n\t\tconst current = new URL(anchor.ownerDocument.URL);\n\t\tconst destination = new URL(anchor.href, anchor.ownerDocument.baseURI);\n\t\treturn destination.origin === current.origin && destination.pathname !== current.pathname &&\n\t\t\t(destination.protocol === 'http:' || destination.protocol === 'https:');\n\t} catch {\n\t\treturn false;\n\t}\n}\n\n/** Keep native focus immediate while identifying only its activation-owned GPU work. */\nexport function focusCatalogLink(anchor: HTMLAnchorElement, event: MouseEvent): void {\n\tconst preceding = activationFocus;\n\tactivationFocus = ordinaryLinkActivation(anchor, event)\n\t\t? { anchor, previous: anchor.ownerDocument.activeElement } : undefined;\n\ttry { anchor.focus({ preventScroll: true }); }\n\tfinally { activationFocus = preceding; }\n}\n\n/** Unrelated or reentrant focus changes retain their ordinary immediate invalidation. */\nexport function isCatalogActivationFocus(event: FocusEvent): boolean {\n\tconst scope = activationFocus;\n\treturn Boolean(scope && (event.type === 'focusin'\n\t\t? event.target === scope.anchor\n\t\t: event.type === 'focusout' && event.target === scope.previous && event.relatedTarget === scope.anchor));\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type SnapshotElement = HTMLElement | SVGElement;
|
|
2
|
+
export interface CatalogDomSnapshotElement {
|
|
3
|
+
source: SnapshotElement;
|
|
4
|
+
copy: SnapshotElement;
|
|
5
|
+
style: CSSStyleDeclaration;
|
|
6
|
+
}
|
|
7
|
+
/** Capture decorative DOM while it still belongs to the outgoing page.
|
|
8
|
+
* Read only rendered subtrees. Large navigation trees commonly contain several
|
|
9
|
+
* hidden versions; reading every computed property of those invisible nodes
|
|
10
|
+
* makes Chrome resolve their otherwise-lazy styles and can block navigation.
|
|
11
|
+
* A display:none placeholder preserves the original lack of a layout box.
|
|
12
|
+
*/
|
|
13
|
+
export declare function snapshotCatalogDom(source: HTMLElement): {
|
|
14
|
+
copy: HTMLElement;
|
|
15
|
+
elements: CatalogDomSnapshotElement[];
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=catalogDomSnapshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalogDomSnapshot.d.ts","sourceRoot":"","sources":["../../src/catalog/catalogDomSnapshot.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAAG,WAAW,GAAG,UAAU,CAAC;AAmBhD,MAAM,WAAW,yBAAyB;IACzC,MAAM,EAAE,eAAe,CAAC;IACxB,IAAI,EAAE,eAAe,CAAC;IACtB,KAAK,EAAE,mBAAmB,CAAC;CAC3B;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,WAAW;;;EAwBrD"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/** Freeze the displayed image, not an authored relative URL or responsive
|
|
2
|
+
* candidate which would be resolved again after the destination changes URL.
|
|
3
|
+
*/
|
|
4
|
+
function freezeImageSource(source, copy) {
|
|
5
|
+
if (source.tagName === 'IMG') {
|
|
6
|
+
const image = source;
|
|
7
|
+
const selected = image.currentSrc || image.src;
|
|
8
|
+
if (selected)
|
|
9
|
+
copy.setAttribute('src', selected);
|
|
10
|
+
copy.removeAttribute('srcset');
|
|
11
|
+
copy.removeAttribute('sizes');
|
|
12
|
+
}
|
|
13
|
+
else if (source.tagName === 'SOURCE' && source.parentElement?.tagName === 'PICTURE') {
|
|
14
|
+
// A picture source would otherwise override the frozen img currentSrc.
|
|
15
|
+
copy.removeAttribute('srcset');
|
|
16
|
+
copy.removeAttribute('sizes');
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/** Capture decorative DOM while it still belongs to the outgoing page.
|
|
20
|
+
* Read only rendered subtrees. Large navigation trees commonly contain several
|
|
21
|
+
* hidden versions; reading every computed property of those invisible nodes
|
|
22
|
+
* makes Chrome resolve their otherwise-lazy styles and can block navigation.
|
|
23
|
+
* A display:none placeholder preserves the original lack of a layout box.
|
|
24
|
+
*/
|
|
25
|
+
export function snapshotCatalogDom(source) {
|
|
26
|
+
const copy = source.cloneNode(true);
|
|
27
|
+
const elements = [];
|
|
28
|
+
const visit = (original, cloned) => {
|
|
29
|
+
const style = getComputedStyle(original);
|
|
30
|
+
elements.push({ source: original, copy: cloned, style });
|
|
31
|
+
freezeImageSource(original, cloned);
|
|
32
|
+
if (style.display === 'none') {
|
|
33
|
+
cloned.replaceChildren();
|
|
34
|
+
cloned.style.cssText = 'display:none!important;';
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
// Retain every computed property, including authored custom properties and
|
|
38
|
+
// SVG presentation. One parse on a detached clone avoids CSSOM write loops.
|
|
39
|
+
let css = '';
|
|
40
|
+
for (const property of style)
|
|
41
|
+
css += property + ':' + style.getPropertyValue(property) + ';';
|
|
42
|
+
cloned.style.cssText = css;
|
|
43
|
+
const children = original.children;
|
|
44
|
+
const copies = cloned.children;
|
|
45
|
+
for (let index = 0; index < children.length; index++)
|
|
46
|
+
visit(children[index], copies[index]);
|
|
47
|
+
};
|
|
48
|
+
visit(source, copy);
|
|
49
|
+
return { copy, elements };
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=catalogDomSnapshot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalogDomSnapshot.js","sourceRoot":"","sources":["../../src/catalog/catalogDomSnapshot.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,SAAS,iBAAiB,CAAC,MAAuB,EAAE,IAAqB;IACxE,IAAI,MAAM,CAAC,OAAO,KAAK,KAAK,EAAE,CAAC;QAC9B,MAAM,KAAK,GAAG,MAA0B,CAAC;QACzC,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,GAAG,CAAC;QAC/C,IAAI,QAAQ;YAAE,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,MAAM,CAAC,KAAK,CAAC,OAAO,GAAG,GAAG,CAAC;QAC3B,MAAM,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC;QACnC,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC;QAC/B,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE;YACnD,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAoB,EAAE,MAAM,CAAC,KAAK,CAAoB,CAAC,CAAC;IAC9E,CAAC,CAAC;IACF,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACpB,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AAC3B,CAAC","sourcesContent":["type SnapshotElement = HTMLElement | SVGElement;\n\n/** Freeze the displayed image, not an authored relative URL or responsive\n * candidate which would be resolved again after the destination changes URL.\n */\nfunction freezeImageSource(source: SnapshotElement, copy: SnapshotElement) {\n\tif (source.tagName === 'IMG') {\n\t\tconst image = source as HTMLImageElement;\n\t\tconst selected = image.currentSrc || image.src;\n\t\tif (selected) copy.setAttribute('src', selected);\n\t\tcopy.removeAttribute('srcset');\n\t\tcopy.removeAttribute('sizes');\n\t} else if (source.tagName === 'SOURCE' && source.parentElement?.tagName === 'PICTURE') {\n\t\t// A picture source would otherwise override the frozen img currentSrc.\n\t\tcopy.removeAttribute('srcset');\n\t\tcopy.removeAttribute('sizes');\n\t}\n}\n\nexport interface CatalogDomSnapshotElement {\n\tsource: SnapshotElement;\n\tcopy: SnapshotElement;\n\tstyle: CSSStyleDeclaration;\n}\n\n/** Capture decorative DOM while it still belongs to the outgoing page.\n * Read only rendered subtrees. Large navigation trees commonly contain several\n * hidden versions; reading every computed property of those invisible nodes\n * makes Chrome resolve their otherwise-lazy styles and can block navigation.\n * A display:none placeholder preserves the original lack of a layout box.\n */\nexport function snapshotCatalogDom(source: HTMLElement) {\n\tconst copy = source.cloneNode(true) as HTMLElement;\n\tconst elements: CatalogDomSnapshotElement[] = [];\n\tconst visit = (original: SnapshotElement, cloned: SnapshotElement) => {\n\t\tconst style = getComputedStyle(original);\n\t\telements.push({ source: original, copy: cloned, style });\n\t\tfreezeImageSource(original, cloned);\n\t\tif (style.display === 'none') {\n\t\t\tcloned.replaceChildren();\n\t\t\tcloned.style.cssText = 'display:none!important;';\n\t\t\treturn;\n\t\t}\n\t\t// Retain every computed property, including authored custom properties and\n\t\t// SVG presentation. One parse on a detached clone avoids CSSOM write loops.\n\t\tlet css = '';\n\t\tfor (const property of style) css += property + ':' + style.getPropertyValue(property) + ';';\n\t\tcloned.style.cssText = css;\n\t\tconst children = original.children;\n\t\tconst copies = cloned.children;\n\t\tfor (let index = 0; index < children.length; index++)\n\t\t\tvisit(children[index] as SnapshotElement, copies[index] as SnapshotElement);\n\t};\n\tvisit(source, copy);\n\treturn { copy, elements };\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CatalogNavigationRegistry } from './CatalogNavigationRegistry.js';
|
|
1
2
|
import type { CatalogEndpointAddress, CatalogIdentity } from './CatalogEndpointRegistry.js';
|
|
2
3
|
import { type CatalogNavigationIntent } from './catalogRecipes.js';
|
|
3
4
|
/** Optional enhancement on an ordinary anchor; URLs remain authoritative. */
|
|
@@ -7,6 +8,8 @@ export interface CatalogViewContext {
|
|
|
7
8
|
targetSection?: string;
|
|
8
9
|
sourceOccurrence?: string;
|
|
9
10
|
targetOccurrence?: string;
|
|
11
|
+
/** Explicit detail endpoint contract; unknown fragment positions keep ordinary navigation. */
|
|
12
|
+
targetPresentation?: 'hero' | 'dock';
|
|
10
13
|
}
|
|
11
14
|
export type CatalogJourney = {
|
|
12
15
|
kind: 'spatialElement';
|
|
@@ -17,7 +20,7 @@ export type CatalogJourney = {
|
|
|
17
20
|
history: boolean;
|
|
18
21
|
section?: string;
|
|
19
22
|
};
|
|
20
|
-
export declare function resolveCatalogJourney(from: URL, to: URL, type: string): CatalogJourney | undefined;
|
|
23
|
+
export declare function resolveCatalogJourney(from: URL, to: URL, type: string, navigation?: CatalogNavigationRegistry): CatalogJourney | undefined;
|
|
21
24
|
export interface CatalogParticipantEndpoint extends CatalogEndpointAddress {
|
|
22
25
|
role: 'geometry';
|
|
23
26
|
sectionId?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalogJourney.d.ts","sourceRoot":"","sources":["../../src/catalog/catalogJourney.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC5F,OAAO,EAAwB,KAAK,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAEzF,6EAA6E;AAC7E,MAAM,WAAW,kBAAkB;IAClC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"catalogJourney.d.ts","sourceRoot":"","sources":["../../src/catalog/catalogJourney.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAChF,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC5F,OAAO,EAAwB,KAAK,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAEzF,6EAA6E;AAC7E,MAAM,WAAW,kBAAkB;IAClC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,8FAA8F;IAC9F,kBAAkB,CAAC,EAAE,MAAM,GAAG,MAAM,CAA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