@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,24 +1,16 @@
|
|
|
1
1
|
import { resolveCatalogIntent } from './catalogRecipes.js';
|
|
2
|
-
export function resolveCatalogJourney(from, to, type) {
|
|
3
|
-
const intent = resolveCatalogIntent(from, to, type);
|
|
2
|
+
export function resolveCatalogJourney(from, to, type, navigation) {
|
|
3
|
+
const intent = resolveCatalogIntent(from, to, type, navigation);
|
|
4
4
|
if (intent)
|
|
5
5
|
return { kind: 'spatialElement', intent };
|
|
6
|
-
|
|
6
|
+
const pages = navigation?.resolve(from, to);
|
|
7
|
+
if (!pages || pages.source.kind !== 'content' || pages.target.kind !== 'content')
|
|
7
8
|
return;
|
|
8
|
-
|
|
9
|
-
const source = pattern.exec(from.pathname), target = pattern.exec(to.pathname);
|
|
10
|
-
if (!source || !target)
|
|
9
|
+
if (pages.target.elements && !pages.source.elements.some(id => pages.target.kind === 'content' && pages.target.elements?.includes(id)))
|
|
11
10
|
return;
|
|
12
11
|
try {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return;
|
|
16
|
-
return {
|
|
17
|
-
kind: 'content-view',
|
|
18
|
-
brandId,
|
|
19
|
-
history: type === 'popstate',
|
|
20
|
-
section: to.hash ? decodeURIComponent(to.hash.slice(1)) : undefined
|
|
21
|
-
};
|
|
12
|
+
return { kind: 'content-view', brandId: pages.source.brandId, history: type === 'popstate',
|
|
13
|
+
section: to.hash ? decodeURIComponent(to.hash.slice(1)) : undefined };
|
|
22
14
|
}
|
|
23
15
|
catch {
|
|
24
16
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalogJourney.js","sourceRoot":"","sources":["../../src/catalog/catalogJourney.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"catalogJourney.js","sourceRoot":"","sources":["../../src/catalog/catalogJourney.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAgC,MAAM,qBAAqB,CAAC;AAiBzF,MAAM,UAAU,qBAAqB,CACpC,IAAS,EACT,EAAO,EACP,IAAY,EACZ,UAAsC;IAEtC,MAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;IAChE,IAAI,MAAM;QAAE,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,CAAC;IACtD,MAAM,KAAK,GAAG,UAAU,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC5C,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO;IACzF,IAAI,KAAK,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC;QAAE,OAAO;IAC/I,IAAI,CAAC;QACJ,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,KAAK,UAAU;YACzF,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAC,E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IAAI,KAAK,GAAG,CAAC;QAAE,OAAO,EAAE,CAAC;IAChE,OAAO;QACN,OAAO;QACP,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;KACrF,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC5C,CAAC","sourcesContent":["import type { CatalogNavigationRegistry } from './CatalogNavigationRegistry.js';\nimport type { CatalogEndpointAddress, CatalogIdentity } from './CatalogEndpointRegistry.js';\nimport { resolveCatalogIntent, type CatalogNavigationIntent } from './catalogRecipes.js';\n\n/** Optional enhancement on an ordinary anchor; URLs remain authoritative. */\nexport interface CatalogViewContext {\n\tspatialElementId?: string;\n\tsourceSection?: string;\n\ttargetSection?: string;\n\tsourceOccurrence?: string;\n\ttargetOccurrence?: string;\n\t/** Explicit detail endpoint contract; unknown fragment positions keep ordinary navigation. */\n\ttargetPresentation?: 'hero' | 'dock';\n}\n\nexport type CatalogJourney =\n\t| { kind: 'spatialElement'; intent: CatalogNavigationIntent }\n\t| { kind: 'content-view'; brandId: string; history: boolean; section?: string };\n\nexport function resolveCatalogJourney(\n\tfrom: URL,\n\tto: URL,\n\ttype: string,\n\tnavigation?: CatalogNavigationRegistry\n): CatalogJourney | undefined {\n\tconst intent = resolveCatalogIntent(from, to, type, navigation);\n\tif (intent) return { kind: 'spatialElement', intent };\n\tconst pages = navigation?.resolve(from, to);\n\tif (!pages || pages.source.kind !== 'content' || pages.target.kind !== 'content') return;\n\tif (pages.target.elements && !pages.source.elements.some(id => pages.target.kind === 'content' && pages.target.elements?.includes(id))) return;\n\ttry {\n\t\treturn { kind: 'content-view', brandId: pages.source.brandId, history: type === 'popstate',\n\t\t\tsection: to.hash ? decodeURIComponent(to.hash.slice(1)) : undefined };\n\t} catch { return; }\n}\n\nexport interface CatalogParticipantEndpoint extends CatalogEndpointAddress {\n\trole: 'geometry';\n\tsectionId?: string;\n\t/** Explicit authored order, never DOM registration order. */\n\torder: number;\n\teligible: boolean;\n\tprepared: boolean;\n\tselected?: boolean;\n\tfocused?: boolean;\n}\n\nexport interface CatalogParticipantPair {\n\tidentity: CatalogIdentity;\n\tsource: CatalogParticipantEndpoint;\n\ttarget: CatalogParticipantEndpoint;\n}\n\n/** Pure, frozen pairing. Ambiguous occurrences never borrow another element's panel. */\nexport function planCatalogParticipants(\n\tsources: readonly CatalogParticipantEndpoint[],\n\ttargets: readonly CatalogParticipantEndpoint[],\n\tcontext: CatalogViewContext = {},\n\tlimit = 5\n): CatalogParticipantPair[] {\n\tconst source = sources.filter(\n\t\t(p) =>\n\t\t\tp.eligible &&\n\t\t\tp.prepared &&\n\t\t\t(!context.sourceSection || p.sectionId === context.sourceSection) &&\n\t\t\t(!context.sourceOccurrence || p.occurrence === context.sourceOccurrence)\n\t);\n\tconst target = targets.filter(\n\t\t(p) =>\n\t\t\tp.eligible &&\n\t\t\tp.prepared &&\n\t\t\t(!context.targetSection || p.sectionId === context.targetSection) &&\n\t\t\t(!context.targetOccurrence || p.occurrence === context.targetOccurrence)\n\t);\n\tconst key = (p: CatalogIdentity) => JSON.stringify([p.brandId, p.spatialElementId]);\n\tconst pairs: CatalogParticipantPair[] = [];\n\tfor (const p of source) {\n\t\tif (source.filter((other) => key(other) === key(p)).length !== 1) continue;\n\t\tconst matches = target.filter((other) => key(other) === key(p));\n\t\tif (matches.length !== 1) continue;\n\t\tpairs.push({\n\t\t\tidentity: { brandId: p.brandId, spatialElementId: p.spatialElementId },\n\t\t\tsource: { ...p },\n\t\t\ttarget: { ...matches[0] }\n\t\t});\n\t}\n\tconst activated = pairs.filter((p) => p.source.selected || p.source.focused);\n\tconst primary = context.spatialElementId\n\t\t? pairs.find((p) => p.identity.spatialElementId === context.spatialElementId)\n\t\t: activated.length === 1\n\t\t\t? activated[0]\n\t\t\t: [...pairs].sort((a, b) => a.source.order - b.source.order)[0];\n\tif (!primary || !Number.isFinite(limit) || limit < 1) return [];\n\treturn [\n\t\tprimary,\n\t\t...pairs.filter((p) => p !== primary).sort((a, b) => a.source.order - b.source.order)\n\t].slice(0, Math.min(5, Math.floor(limit)));\n}\n"]}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import type { SpatialListItem
|
|
2
|
-
|
|
1
|
+
import type { SpatialListItem } from '../spatial-element/types.js';
|
|
2
|
+
import type { SpatialElementScene } from '../spatial-element/spatialElementScene.js';
|
|
3
|
+
/**
|
|
4
|
+
* Low-level adapter binding; scroll and transition progress live in separate controllers.
|
|
5
|
+
* SvelteKit page components derive this internally. Do not duplicate it in a BrandStageShell layout.
|
|
6
|
+
*/
|
|
3
7
|
export interface CatalogPage {
|
|
4
8
|
brandId: string;
|
|
5
9
|
/** `list` is retained as a legacy alias; content routes can contain several spatial sections. */
|
|
6
10
|
view: 'content' | 'list' | 'detail';
|
|
7
11
|
spatialElementId?: string;
|
|
8
|
-
spatialElementStage?:
|
|
12
|
+
spatialElementStage?: SpatialElementScene;
|
|
9
13
|
spatialElements: SpatialListItem[];
|
|
10
14
|
}
|
|
11
15
|
//# sourceMappingURL=catalogPage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalogPage.d.ts","sourceRoot":"","sources":["../../src/catalog/catalogPage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"catalogPage.d.ts","sourceRoot":"","sources":["../../src/catalog/catalogPage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAErF;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,iGAAiG;IACjG,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;IACpC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,eAAe,EAAE,eAAe,EAAE,CAAC;CACnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalogPage.js","sourceRoot":"","sources":["../../src/catalog/catalogPage.ts"],"names":[],"mappings":"","sourcesContent":["import type { SpatialListItem
|
|
1
|
+
{"version":3,"file":"catalogPage.js","sourceRoot":"","sources":["../../src/catalog/catalogPage.ts"],"names":[],"mappings":"","sourcesContent":["import type { SpatialListItem } from '../spatial-element/types.js';\nimport type { SpatialElementScene } from '../spatial-element/spatialElementScene.js';\n\n/**\n * Low-level adapter binding; scroll and transition progress live in separate controllers.\n * SvelteKit page components derive this internally. Do not duplicate it in a BrandStageShell layout.\n */\nexport interface CatalogPage {\n\tbrandId: string;\n\t/** `list` is retained as a legacy alias; content routes can contain several spatial sections. */\n\tview: 'content' | 'list' | 'detail';\n\tspatialElementId?: string;\n\tspatialElementStage?: SpatialElementScene;\n\tspatialElements: SpatialListItem[];\n}\n"]}
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
import { type CarouselLayoutInput, type LayoutRect } from '../spatial-element/responsiveLayout.js';
|
|
2
|
+
export interface CarouselFraming {
|
|
3
|
+
compact: boolean;
|
|
4
|
+
fit: LayoutRect;
|
|
5
|
+
summary: {
|
|
6
|
+
x: number;
|
|
7
|
+
width: number;
|
|
8
|
+
anchorY: number;
|
|
9
|
+
alignment: 'center' | 'end';
|
|
10
|
+
};
|
|
11
|
+
}
|
|
1
12
|
/** Section-local screen framing, independent of assets and camera ownership. */
|
|
2
13
|
export interface CatalogPose {
|
|
3
14
|
x: number;
|
|
@@ -8,7 +19,16 @@ export interface CatalogPose {
|
|
|
8
19
|
visible: boolean;
|
|
9
20
|
front: boolean;
|
|
10
21
|
panelOpacity: number;
|
|
22
|
+
/** CSS-pixel defocus; zero at the selected seat and continuous during dragging. */
|
|
23
|
+
blur?: number;
|
|
11
24
|
opacity: number;
|
|
25
|
+
/** Camera-space offsets from the shared section origin; no per-item perspective compensation. */
|
|
26
|
+
orbit?: {
|
|
27
|
+
x: number;
|
|
28
|
+
y: number;
|
|
29
|
+
pitch: number;
|
|
30
|
+
};
|
|
31
|
+
framing?: CarouselFraming;
|
|
12
32
|
}
|
|
13
33
|
export interface CatalogPoseProvider {
|
|
14
34
|
kind: 'carousel';
|
|
@@ -16,15 +36,43 @@ export interface CatalogPoseProvider {
|
|
|
16
36
|
}
|
|
17
37
|
/** Presentation controls, never asset scale, URL or renderer ownership. */
|
|
18
38
|
export interface CarouselPresentation {
|
|
19
|
-
/** Horizontal
|
|
39
|
+
/** Horizontal spacing multiplier, normalized around the default 0.48. */
|
|
20
40
|
radius?: number;
|
|
21
|
-
/**
|
|
41
|
+
/** Turntable depth control in CSS-world pixels (default 700). */
|
|
22
42
|
depth?: number;
|
|
23
43
|
}
|
|
44
|
+
/** Cached section metrics, shared by DOM hit targets, posters and GPU poses. */
|
|
45
|
+
export interface CarouselLayout {
|
|
46
|
+
width: number;
|
|
47
|
+
height: number;
|
|
48
|
+
left: number;
|
|
49
|
+
viewportWidth: number;
|
|
50
|
+
framing?: CarouselFraming;
|
|
51
|
+
}
|
|
52
|
+
/** Convert predictable viewport rules to the existing section-local scene clock. */
|
|
53
|
+
export declare function resolveCarouselPoseLayout(input: CarouselLayoutInput, ring: {
|
|
54
|
+
width: number;
|
|
55
|
+
left: number;
|
|
56
|
+
}): CarouselLayout;
|
|
57
|
+
export interface CarouselEmphasis {
|
|
58
|
+
advance: number;
|
|
59
|
+
panel: number;
|
|
60
|
+
}
|
|
61
|
+
export declare function carouselEmphasis(distance: number): CarouselEmphasis;
|
|
62
|
+
/** A gesture can only withdraw its initial presentation, never select passing seats. */
|
|
63
|
+
export declare class CarouselDragEmphasis {
|
|
64
|
+
private readonly phase;
|
|
65
|
+
private readonly initial;
|
|
66
|
+
private travel;
|
|
67
|
+
constructor(phase: number, initial: readonly CarouselEmphasis[]);
|
|
68
|
+
move(phase: number): CarouselEmphasis[];
|
|
69
|
+
}
|
|
24
70
|
export declare function carouselDistance(index: number, phase: number, count: number): number;
|
|
25
|
-
/**
|
|
26
|
-
export declare function carouselResident(index: number, phase: number, count: number): boolean;
|
|
27
|
-
/**
|
|
28
|
-
export declare function carouselPose(index: number, phase: number, count: number, presentation?: CarouselPresentation
|
|
71
|
+
/** Prepare only the viewport and a small margin, including fractional drag movement. */
|
|
72
|
+
export declare function carouselResident(index: number, phase: number, count: number, presentation?: CarouselPresentation, layout?: CarouselLayout): boolean;
|
|
73
|
+
/** A shared circular turntable, tilted toward the viewer, with a smooth foreground advance. */
|
|
74
|
+
export declare function carouselPose(index: number, phase: number, count: number, presentation?: CarouselPresentation, layout?: CarouselLayout, emphasis?: CarouselEmphasis,
|
|
75
|
+
/** Shared foreground focus: zero keeps the whole turntable sharp. */
|
|
76
|
+
focus?: number): CatalogPose;
|
|
29
77
|
export declare const CATALOG_POSE_CHANGED = "catalog-pose-changed";
|
|
30
78
|
//# sourceMappingURL=catalogPose.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalogPose.d.ts","sourceRoot":"","sources":["../../src/catalog/catalogPose.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,MAAM,WAAW,WAAW;IAC3B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,C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AACrE,KAAK,SAAI,GACP,WAAW,CAkBb;AAED,eAAO,MAAM,oBAAoB,yBAAyB,CAAC"}
|
|
@@ -1,33 +1,110 @@
|
|
|
1
|
+
import { resolveCarouselLayout, spatialLayoutTokens } from '../spatial-element/responsiveLayout.js';
|
|
2
|
+
/** Convert predictable viewport rules to the existing section-local scene clock. */
|
|
3
|
+
export function resolveCarouselPoseLayout(input, ring) {
|
|
4
|
+
const resolved = resolveCarouselLayout(input);
|
|
5
|
+
const compact = resolved.summary.placement === 'compact';
|
|
6
|
+
const titleHeight = compact ? spatialLayoutTokens.carousel.compactEyebrowHeight : 0;
|
|
7
|
+
const ringTop = resolved.mediaFit.y - titleHeight;
|
|
8
|
+
return {
|
|
9
|
+
width: ring.width, height: resolved.mediaFit.height + titleHeight,
|
|
10
|
+
left: ring.left, viewportWidth: resolved.base.layoutWidth,
|
|
11
|
+
framing: {
|
|
12
|
+
compact,
|
|
13
|
+
fit: { ...resolved.mediaFit, x: resolved.mediaFit.x - ring.left, y: titleHeight },
|
|
14
|
+
summary: { x: resolved.summary.x - ring.left, width: resolved.summary.width,
|
|
15
|
+
anchorY: compact ? titleHeight : resolved.summary.anchor.y - ringTop,
|
|
16
|
+
alignment: compact ? 'end' : 'center' }
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
const defaultLayout = { width: 1320, height: 560, left: 60, viewportWidth: 1440 };
|
|
21
|
+
export function carouselEmphasis(distance) {
|
|
22
|
+
return { advance: Math.max(0, 1 - distance * distance) ** 2,
|
|
23
|
+
panel: Math.max(0, 1 - Math.abs(distance)) ** 2 };
|
|
24
|
+
}
|
|
25
|
+
/** A gesture can only withdraw its initial presentation, never select passing seats. */
|
|
26
|
+
export class CarouselDragEmphasis {
|
|
27
|
+
phase;
|
|
28
|
+
initial;
|
|
29
|
+
travel = 0;
|
|
30
|
+
constructor(phase, initial) {
|
|
31
|
+
this.phase = phase;
|
|
32
|
+
this.initial = initial;
|
|
33
|
+
}
|
|
34
|
+
move(phase) {
|
|
35
|
+
this.travel = Math.max(this.travel, Math.abs(phase - this.phase));
|
|
36
|
+
const remaining = carouselEmphasis(this.travel);
|
|
37
|
+
return this.initial.map(value => ({
|
|
38
|
+
advance: value.advance * remaining.advance,
|
|
39
|
+
panel: value.panel * remaining.panel
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function framing(distance, presentation, layout, emphasis = carouselEmphasis(distance)) {
|
|
44
|
+
const compact = layout.framing?.compact ?? layout.viewportWidth < spatialLayoutTokens.layoutMinWidths.m;
|
|
45
|
+
const fit = layout.framing?.fit;
|
|
46
|
+
const frame = fit ? Math.min(fit.width, fit.height) : Math.min(layout.width, compact ? 360 : layout.height);
|
|
47
|
+
const spacing = Number.isFinite(presentation.radius)
|
|
48
|
+
? Math.max(0.2, Math.min(0.7, presentation.radius)) : 0.48;
|
|
49
|
+
const depth = Number.isFinite(presentation.depth)
|
|
50
|
+
? Math.max(0, Math.min(1200, presentation.depth)) : 700;
|
|
51
|
+
// A larger, shallower turntable: keep useful seat spacing by reducing the
|
|
52
|
+
// angle between products rather than packing the same angle onto a larger ring.
|
|
53
|
+
const radius = frame * (compact ? 2.2 : 3.4) * spacing / 0.48 * (0.75 + depth / 2800);
|
|
54
|
+
const step = 0.4;
|
|
55
|
+
const travel = Math.abs(distance);
|
|
56
|
+
// Only the front arc is presented. Never wrap a long catalog onto occupied seats.
|
|
57
|
+
const angle = Math.max(-1.35, Math.min(1.35, distance * step));
|
|
58
|
+
const pitch = 10 * Math.PI / 180;
|
|
59
|
+
const pull = frame * 1.25;
|
|
60
|
+
// Smooth at both the selected seat and the point where it rejoins the ring.
|
|
61
|
+
const advance = pull * emphasis.advance;
|
|
62
|
+
const recession = radius * (1 - Math.cos(angle)) + pull - advance;
|
|
63
|
+
const z = -recession * Math.cos(pitch);
|
|
64
|
+
// Selection changes depth only; every seat retains its horizontal position.
|
|
65
|
+
const orbit = {
|
|
66
|
+
x: radius * Math.sin(angle),
|
|
67
|
+
y: recession * Math.sin(pitch),
|
|
68
|
+
pitch
|
|
69
|
+
};
|
|
70
|
+
const scale = 2500 / (2500 - z);
|
|
71
|
+
const anchor = layout.left + (fit ? fit.x + fit.width / 2 : layout.width * (compact ? 0.5 : 0.31));
|
|
72
|
+
const center = layout.viewportWidth / 2 + (anchor - layout.viewportWidth / 2 + orbit.x) * scale;
|
|
73
|
+
const offset = center - anchor;
|
|
74
|
+
const extent = frame * 0.82 * scale * 0.6;
|
|
75
|
+
const seats = compact ? 1.49 : 3.24;
|
|
76
|
+
const arcOpacity = Math.max(0, Math.min(1, (seats - travel) / 0.38));
|
|
77
|
+
return { offset, scale, center, extent, orbit, z, angle, arcOpacity, seats };
|
|
78
|
+
}
|
|
1
79
|
export function carouselDistance(index, phase, count) {
|
|
2
80
|
return count > 1 ? index - phase : 0;
|
|
3
81
|
}
|
|
4
|
-
/**
|
|
5
|
-
export function carouselResident(index, phase, count) {
|
|
6
|
-
|
|
82
|
+
/** Prepare only the viewport and a small margin, including fractional drag movement. */
|
|
83
|
+
export function carouselResident(index, phase, count, presentation = {}, layout = defaultLayout) {
|
|
84
|
+
const distance = carouselDistance(index, phase, count);
|
|
85
|
+
const { seats } = framing(distance, presentation, layout);
|
|
86
|
+
// Include the neighbouring animation window before the front arc enters view.
|
|
87
|
+
return Math.abs(distance) < seats + 1;
|
|
7
88
|
}
|
|
8
|
-
/**
|
|
9
|
-
export function carouselPose(index, phase, count, presentation = {})
|
|
89
|
+
/** A shared circular turntable, tilted toward the viewer, with a smooth foreground advance. */
|
|
90
|
+
export function carouselPose(index, phase, count, presentation = {}, layout = defaultLayout, emphasis = carouselEmphasis(carouselDistance(index, phase, count)),
|
|
91
|
+
/** Shared foreground focus: zero keeps the whole turntable sharp. */
|
|
92
|
+
focus = 1) {
|
|
10
93
|
const distance = carouselDistance(index, phase, count);
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
const back = Math.min(1, (1 - Math.cos(angle)) / (1 - Math.cos(Math.PI / 6)));
|
|
14
|
-
const edge = Math.max(0, Math.min(1, (2.5 - Math.abs(distance)) * 2));
|
|
15
|
-
const radius = Number.isFinite(presentation.radius)
|
|
16
|
-
? Math.max(0.2, Math.min(0.7, presentation.radius))
|
|
17
|
-
: 0.48;
|
|
18
|
-
const depth = Number.isFinite(presentation.depth)
|
|
19
|
-
? Math.max(0, Math.min(1200, presentation.depth))
|
|
20
|
-
: 700;
|
|
94
|
+
const { offset, scale, center, extent, orbit, z, angle, arcOpacity } = framing(distance, presentation, layout, emphasis);
|
|
95
|
+
const edge = Math.max(0, Math.min(1, (center + extent) / 48, (layout.viewportWidth - center + extent) / 48)) * arcOpacity;
|
|
21
96
|
return {
|
|
22
|
-
x:
|
|
23
|
-
y: 0.
|
|
24
|
-
size: 0.82
|
|
25
|
-
depth:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
97
|
+
x: (layout.framing ? layout.framing.fit.x + layout.framing.fit.width / 2 : layout.width * 0.5) / Math.max(1, layout.width) + offset / Math.max(1, layout.width),
|
|
98
|
+
y: (layout.framing ? layout.framing.fit.y + layout.framing.fit.height / 2 : layout.height * 0.54) / Math.max(1, layout.height) - orbit.y * scale / Math.max(1, layout.height),
|
|
99
|
+
size: 0.82 * scale,
|
|
100
|
+
depth: z,
|
|
101
|
+
orbit,
|
|
102
|
+
...(layout.framing ? { framing: layout.framing } : {}),
|
|
103
|
+
yaw: angle,
|
|
104
|
+
visible: edge > 0,
|
|
29
105
|
front: Math.abs(distance) <= 0.5,
|
|
30
|
-
panelOpacity:
|
|
106
|
+
panelOpacity: emphasis.panel,
|
|
107
|
+
blur: Math.min(5, Math.max(0, Math.abs(distance) - 0.15) ** 1.4 * 2.2) * focus,
|
|
31
108
|
opacity: edge
|
|
32
109
|
};
|
|
33
110
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalogPose.js","sourceRoot":"","sources":["../../src/catalog/catalogPose.ts"],"names":[],"m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*/\nexport interface CatalogPose {\n\tx: number;\n\ty: number;\n\tsize: number;\n\tdepth: number;\n\tyaw: number;\n\tvisible: boolean;\n\tfront: boolean;\n\tpanelOpacity: number;\n\topacity: number;\n}\n\nexport interface CatalogPoseProvider {\n\tkind: 'carousel';\n\tread(): CatalogPose;\n}\n\n/** Presentation controls, never asset scale, URL or renderer ownership. */\nexport interface CarouselPresentation {\n\t/** Horizontal arc extent as a fraction of section width (default 0.48). */\n\tradius?: number;\n\t/** Maximum rearward travel in CSS-world pixels (default 700). */\n\tdepth?: number;\n}\n\nexport function carouselDistance(index: number, phase: number, count: number) {\n\treturn count > 1 ? index - phase : 0;\n}\n\n/** Five visible seats, plus one preparation seat on either side. No duplicated elements. */\nexport function carouselResident(index: number, phase: number, count: number) {\n\treturn Math.abs(carouselDistance(index, phase, count)) <= 3;\n}\n\n/** An ordered shallow arc of element/panel groups, independent of the asset's physical dimensions. */\nexport function carouselPose(\n\tindex: number,\n\tphase: number,\n\tcount: number,\n\tpresentation: CarouselPresentation = {}\n): CatalogPose {\n\tconst distance = carouselDistance(index, phase, count);\n\t// Fixed angular spacing: adding spatialElements extends the arc, never closes a turntable.\n\tconst angle = (distance * Math.PI) / 12;\n\tconst back = Math.min(1, (1 - Math.cos(angle)) / (1 - Math.cos(Math.PI / 6)));\n\tconst edge = Math.max(0, Math.min(1, (2.5 - Math.abs(distance)) * 2));\n\tconst radius = Number.isFinite(presentation.radius)\n\t\t? Math.max(0.2, Math.min(0.7, presentation.radius!))\n\t\t: 0.48;\n\tconst depth = Number.isFinite(presentation.depth)\n\t\t? Math.max(0, Math.min(1200, presentation.depth!))\n\t\t: 700;\n\treturn {\n\t\tx: 0.5 + (Math.sin(angle) * radius) / Math.sin(Math.PI / 6),\n\t\ty: 0.5 - back * 0.1,\n\t\tsize: 0.82 / (1 + Math.abs(distance) * 0.65),\n\t\tdepth: -back * depth,\n\t\t// Strong near-centre turn, smoothly bounded before distant seats become edge-on.\n\t\tyaw: -Math.atan(distance * Math.tan((28 * Math.PI) / 180)),\n\t\tvisible: Math.abs(distance) < 2.5,\n\t\tfront: Math.abs(distance) <= 0.5,\n\t\tpanelOpacity: Math.pow(Math.max(0, 1 - Math.abs(distance)), 2),\n\t\topacity: edge\n\t};\n}\n\nexport const CATALOG_POSE_CHANGED = 'catalog-pose-changed';\n"]}
|
|
1
|
+
{"version":3,"file":"catalogPose.js","sourceRoot":"","sources":["../../src/catalog/catalogPose.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAA6C,MAAM,wCAAwC,CAAC;AAgD/I,oFAAoF;AACpF,MAAM,UAAU,yBAAyB,CAAC,KAA0B,EAAE,IAAqC;IAC1G,MAAM,QAAQ,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,SAAS,KAAK,SAAS,CAAC;IACzD,MAAM,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC;IACpF,MAAM,OAAO,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC,GAAG,WAAW,CAAC;IAClD,OAAO;QACN,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,WAAW;QACjE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,aAAa,EAAE,QAAQ,CAAC,IAAI,CAAC,WAAW;QACzD,OAAO,EAAE;YACR,OAAO;YACP,GAAG,EAAE,EAAE,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,WAAW,EAAE;YACjF,OAAO,EAAE,EAAE,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,KA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E,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC;QAC7K,IAAI,EAAE,IAAI,GAAG,KAAK;QAClB,KAAK,EAAE,CAAC;QACR,KAAK;QACL,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACtD,GAAG,EAAE,KAAK;QACV,OAAO,EAAE,IAAI,GAAG,CAAC;QACjB,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,GAAG;QAChC,YAAY,EAAE,QAAQ,CAAC,KAAK;QAC5B,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,IAAI,GAAG,GAAG,GAAG,CAAC,GAAG,KAAK;QAC9E,OAAO,EAAE,IAAI;KACb,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,sBAAsB,CAAC","sourcesContent":["import { resolveCarouselLayout, spatialLayoutTokens, type CarouselLayoutInput, type LayoutRect } from '../spatial-element/responsiveLayout.js';\n\nexport interface CarouselFraming {\n\tcompact: boolean;\n\tfit: LayoutRect;\n\tsummary: { x: number; width: number; anchorY: number; alignment: 'center' | 'end' };\n}\n\n/** Section-local screen framing, independent of assets and camera ownership. */\nexport interface CatalogPose {\n\tx: number;\n\ty: number;\n\tsize: number;\n\tdepth: number;\n\tyaw: number;\n\tvisible: boolean;\n\tfront: boolean;\n\tpanelOpacity: number;\n\t/** CSS-pixel defocus; zero at the selected seat and continuous during dragging. */\n\tblur?: number;\n\topacity: number;\n\t/** Camera-space offsets from the shared section origin; no per-item perspective compensation. */\n\torbit?: { x: number; y: number; pitch: number };\n\tframing?: CarouselFraming;\n}\n\nexport interface CatalogPoseProvider {\n\tkind: 'carousel';\n\tread(): CatalogPose;\n}\n\n/** Presentation controls, never asset scale, URL or renderer ownership. */\nexport interface CarouselPresentation {\n\t/** Horizontal spacing multiplier, normalized around the default 0.48. */\n\tradius?: number;\n\t/** Turntable depth control in CSS-world pixels (default 700). */\n\tdepth?: number;\n}\n\n/** Cached section metrics, shared by DOM hit targets, posters and GPU poses. */\nexport interface CarouselLayout {\n\twidth: number;\n\theight: number;\n\tleft: number;\n\tviewportWidth: number;\n\tframing?: CarouselFraming;\n}\n\n/** Convert predictable viewport rules to the existing section-local scene clock. */\nexport function resolveCarouselPoseLayout(input: CarouselLayoutInput, ring: { width: number; left: number }): CarouselLayout {\n\tconst resolved = resolveCarouselLayout(input);\n\tconst compact = resolved.summary.placement === 'compact';\n\tconst titleHeight = compact ? spatialLayoutTokens.carousel.compactEyebrowHeight : 0;\n\tconst ringTop = resolved.mediaFit.y - titleHeight;\n\treturn {\n\t\twidth: ring.width, height: resolved.mediaFit.height + titleHeight,\n\t\tleft: ring.left, viewportWidth: resolved.base.layoutWidth,\n\t\tframing: {\n\t\t\tcompact,\n\t\t\tfit: { ...resolved.mediaFit, x: resolved.mediaFit.x - ring.left, y: titleHeight },\n\t\t\tsummary: { x: resolved.summary.x - ring.left, width: resolved.summary.width,\n\t\t\t\tanchorY: compact ? titleHeight : resolved.summary.anchor.y - ringTop,\n\t\t\t\talignment: compact ? 'end' : 'center' }\n\t\t}\n\t};\n}\n\nconst defaultLayout: CarouselLayout = { width: 1320, height: 560, left: 60, viewportWidth: 1440 };\n\nexport interface CarouselEmphasis { advance: number; panel: number }\n\nexport function carouselEmphasis(distance: number): CarouselEmphasis {\n\treturn { advance: Math.max(0, 1 - distance * distance) ** 2,\n\t\tpanel: Math.max(0, 1 - Math.abs(distance)) ** 2 };\n}\n\n/** A gesture can only withdraw its initial presentation, never select passing seats. */\nexport class CarouselDragEmphasis {\n\tprivate travel = 0;\n\tconstructor(private readonly phase: number, private readonly initial: readonly CarouselEmphasis[]) {}\n\tmove(phase: number): CarouselEmphasis[] {\n\t\tthis.travel = Math.max(this.travel, Math.abs(phase - this.phase));\n\t\tconst remaining = carouselEmphasis(this.travel);\n\t\treturn this.initial.map(value => ({\n\t\t\tadvance: value.advance * remaining.advance,\n\t\t\tpanel: value.panel * remaining.panel\n\t\t}));\n\t}\n}\n\nfunction framing(distance: number, presentation: CarouselPresentation, layout: CarouselLayout,\n\temphasis = carouselEmphasis(distance)) {\n\tconst compact = layout.framing?.compact ?? layout.viewportWidth < spatialLayoutTokens.layoutMinWidths.m;\n\tconst fit = layout.framing?.fit;\n\tconst frame = fit ? Math.min(fit.width, fit.height) : Math.min(layout.width, compact ? 360 : layout.height);\n\tconst spacing = Number.isFinite(presentation.radius)\n\t\t? Math.max(0.2, Math.min(0.7, presentation.radius!)) : 0.48;\n\tconst depth = Number.isFinite(presentation.depth)\n\t\t? Math.max(0, Math.min(1200, presentation.depth!)) : 700;\n\t// A larger, shallower turntable: keep useful seat spacing by reducing the\n\t// angle between products rather than packing the same angle onto a larger ring.\n\tconst radius = frame * (compact ? 2.2 : 3.4) * spacing / 0.48 * (0.75 + depth / 2800);\n\tconst step = 0.4;\n\tconst travel = Math.abs(distance);\n\t// Only the front arc is presented. Never wrap a long catalog onto occupied seats.\n\tconst angle = Math.max(-1.35, Math.min(1.35, distance * step));\n\tconst pitch = 10 * Math.PI / 180;\n\tconst pull = frame * 1.25;\n\t// Smooth at both the selected seat and the point where it rejoins the ring.\n\tconst advance = pull * emphasis.advance;\n\tconst recession = radius * (1 - Math.cos(angle)) + pull - advance;\n\tconst z = -recession * Math.cos(pitch);\n\t// Selection changes depth only; every seat retains its horizontal position.\n\tconst orbit = {\n\t\tx: radius * Math.sin(angle),\n\t\ty: recession * Math.sin(pitch),\n\t\tpitch\n\t};\n\tconst scale = 2500 / (2500 - z);\n\tconst anchor = layout.left + (fit ? fit.x + fit.width / 2 : layout.width * (compact ? 0.5 : 0.31));\n\tconst center = layout.viewportWidth / 2 + (anchor - layout.viewportWidth / 2 + orbit.x) * scale;\n\tconst offset = center - anchor;\n\tconst extent = frame * 0.82 * scale * 0.6;\n\tconst seats = compact ? 1.49 : 3.24;\n\tconst arcOpacity = Math.max(0, Math.min(1, (seats - travel) / 0.38));\n\treturn { offset, scale, center, extent, orbit, z, angle, arcOpacity, seats };\n}\n\nexport function carouselDistance(index: number, phase: number, count: number) {\n\treturn count > 1 ? index - phase : 0;\n}\n\n/** Prepare only the viewport and a small margin, including fractional drag movement. */\nexport function carouselResident(index: number, phase: number, count: number,\n\tpresentation: CarouselPresentation = {}, layout: CarouselLayout = defaultLayout) {\n\tconst distance = carouselDistance(index, phase, count);\n\tconst { seats } = framing(distance, presentation, layout);\n\t// Include the neighbouring animation window before the front arc enters view.\n\treturn Math.abs(distance) < seats + 1;\n}\n\n/** A shared circular turntable, tilted toward the viewer, with a smooth foreground advance. */\nexport function carouselPose(\n\tindex: number,\n\tphase: number,\n\tcount: number,\n\tpresentation: CarouselPresentation = {},\n\tlayout: CarouselLayout = defaultLayout,\n\temphasis = carouselEmphasis(carouselDistance(index, phase, count)),\n\t/** Shared foreground focus: zero keeps the whole turntable sharp. */\n\tfocus = 1\n): CatalogPose {\n\tconst distance = carouselDistance(index, phase, count);\n\tconst { offset, scale, center, extent, orbit, z, angle, arcOpacity } = framing(distance, presentation, layout, emphasis);\n\tconst edge = Math.max(0, Math.min(1, (center + extent) / 48, (layout.viewportWidth - center + extent) / 48)) * arcOpacity;\n\treturn {\n\t\tx: (layout.framing ? layout.framing.fit.x + layout.framing.fit.width / 2 : layout.width * 0.5) / Math.max(1, layout.width) + offset / Math.max(1, layout.width),\n\t\ty: (layout.framing ? layout.framing.fit.y + layout.framing.fit.height / 2 : layout.height * 0.54) / Math.max(1, layout.height) - orbit.y * scale / Math.max(1, layout.height),\n\t\tsize: 0.82 * scale,\n\t\tdepth: z,\n\t\torbit,\n\t\t...(layout.framing ? { framing: layout.framing } : {}),\n\t\tyaw: angle,\n\t\tvisible: edge > 0,\n\t\tfront: Math.abs(distance) <= 0.5,\n\t\tpanelOpacity: emphasis.panel,\n\t\tblur: Math.min(5, Math.max(0, Math.abs(distance) - 0.15) ** 1.4 * 2.2) * focus,\n\t\topacity: edge\n\t};\n}\n\nexport const CATALOG_POSE_CHANGED = 'catalog-pose-changed';\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CatalogNavigationRegistry } from './CatalogNavigationRegistry.js';
|
|
1
2
|
import type { CatalogIdentity, CatalogEndpointSlot, CatalogSharedRole } from './CatalogEndpointRegistry.js';
|
|
2
3
|
export type CatalogComposition = 'list' | 'carousel' | 'hero' | 'dock' | 'intermediate' | 'unavailable';
|
|
3
4
|
export interface CatalogNavigationIntent {
|
|
@@ -7,9 +8,9 @@ export interface CatalogNavigationIntent {
|
|
|
7
8
|
target: 'hero' | 'list' | 'section' | 'restored';
|
|
8
9
|
}
|
|
9
10
|
/** Route intent does not decide whether a restored DETAIL is actually showing its hero or dock. */
|
|
10
|
-
export declare function resolveCatalogIntent(from: URL, to: URL, type: string): CatalogNavigationIntent | undefined;
|
|
11
|
+
export declare function resolveCatalogIntent(from: URL, to: URL, type: string, navigation?: CatalogNavigationRegistry): CatalogNavigationIntent | undefined;
|
|
11
12
|
export interface CatalogRecipe {
|
|
12
|
-
id: 'list-to-hero' | 'hero-to-list' | 'list-to-dock' | 'dock-to-list' | 'carousel-to-hero' | 'hero-to-carousel' | 'carousel-to-dock' | 'dock-to-carousel' | 'list-to-carousel' | 'carousel-to-list';
|
|
13
|
+
id: 'list-to-hero' | 'hero-to-list' | 'list-to-dock' | 'dock-to-list' | 'carousel-to-hero' | 'hero-to-carousel' | 'carousel-to-dock' | 'dock-to-carousel' | 'list-to-carousel' | 'carousel-to-list' | 'list-to-list' | 'carousel-to-carousel';
|
|
13
14
|
identity: CatalogIdentity;
|
|
14
15
|
source: CatalogEndpointSlot;
|
|
15
16
|
targetGeometry: CatalogEndpointSlot;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalogRecipes.d.ts","sourceRoot":"","sources":["../../src/catalog/catalogRecipes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,MAAM,8BAA8B,CAAC;AAEtC,MAAM,MAAM,kBAAkB,GAC7B,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,cAAc,GAAG,aAAa,CAAC;AACxE,MAAM,WAAW,uBAAuB;IACvC,QAAQ,EAAE,eAAe,CAAC;IAC1B,SAAS,EAAE,gBAAgB,GAAG,gBAAgB,CAAC;IAC/C,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC;CACjD;AAED,mGAAmG;AACnG,wBAAgB,oBAAoB,CACnC,IAAI,EAAE,GAAG,EACT,EAAE,EAAE,GAAG,EACP,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"catalogRecipes.d.ts","sourceRoot":"","sources":["../../src/catalog/catalogRecipes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAChF,OAAO,KAAK,EACX,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,MAAM,8BAA8B,CAAC;AAEtC,MAAM,MAAM,kBAAkB,GAC7B,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,cAAc,GAAG,aAAa,CAAC;AACxE,MAAM,WAAW,uBAAuB;IACvC,QAAQ,EAAE,eAAe,CAAC;IAC1B,SAAS,EAAE,gBAAgB,GAAG,gBAAgB,CAAC;IAC/C,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC;CACjD;AAED,mGAAmG;AACnG,wBAAgB,oBAAoB,CACnC,IAAI,EAAE,GAAG,EACT,EAAE,EAAE,GAAG,EACP,IAAI,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,yBAAyB,GACpC,uBAAuB,GAAG,SAAS,CAcrC;AAED,MAAM,WAAW,aAAa;IAC7B,EAAE,EACC,cAAc,GACd,cAAc,GACd,cAAc,GACd,cAAc,GACd,kBAAkB,GAClB,kBAAkB,GAClB,kBAAkB,GAClB,kBAAkB,GAClB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,sBAAsB,CAAC;IAC1B,QAAQ,EAAE,eAAe,CAAC;IAC1B,MAAM,EAAE,mBAAmB,CAAC;IAC5B,cAAc,EAAE,mBAAmB,CAAC;IACpC,YAAY,EAAE,mBAAmB,CAAC;IAClC,KAAK,EAAE,SAAS,iBAAiB,EAAE,CAAC;CACpC;AAED,iGAAiG;AACjG,wBAAgB,mBAAmB,CAClC,MAAM,EAAE,uBAAuB,GAAG,SAAS,EAC3C,MAAM,EAAE,kBAAkB,EAC1B,MAAM,EAAE,kBAAkB,GACxB,aAAa,GAAG,SAAS,CAwD3B"}
|
|
@@ -1,34 +1,19 @@
|
|
|
1
1
|
/** Route intent does not decide whether a restored DETAIL is actually showing its hero or dock. */
|
|
2
|
-
export function resolveCatalogIntent(from, to, type) {
|
|
3
|
-
|
|
2
|
+
export function resolveCatalogIntent(from, to, type, navigation) {
|
|
3
|
+
const pages = navigation?.resolve(from, to);
|
|
4
|
+
if (!pages || pages.source.kind === pages.target.kind)
|
|
4
5
|
return;
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
try {
|
|
10
|
-
return {
|
|
11
|
-
brandId: decodeURIComponent(match[1]),
|
|
12
|
-
spatialElementId: match[3] ? decodeURIComponent(match[3]) : undefined
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
catch {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
const source = parse(from);
|
|
20
|
-
const target = parse(to);
|
|
21
|
-
if (!source ||
|
|
22
|
-
!target ||
|
|
23
|
-
source.brandId !== target.brandId ||
|
|
24
|
-
Boolean(source.spatialElementId) === Boolean(target.spatialElementId))
|
|
6
|
+
const { source, target } = pages;
|
|
7
|
+
const detail = source.kind === 'detail' ? source : target.kind === 'detail' ? target : undefined;
|
|
8
|
+
const content = source.kind === 'content' ? source : target.kind === 'content' ? target : undefined;
|
|
9
|
+
if (!detail || !content || (content.elements && !content.elements.includes(detail.spatialElementId)))
|
|
25
10
|
return;
|
|
26
11
|
const history = type === 'popstate';
|
|
27
12
|
return {
|
|
28
|
-
identity: { brandId:
|
|
29
|
-
direction: target.
|
|
13
|
+
identity: { brandId: detail.brandId, spatialElementId: detail.spatialElementId },
|
|
14
|
+
direction: target.kind === 'detail' ? 'list-to-detail' : 'detail-to-list',
|
|
30
15
|
history,
|
|
31
|
-
target: history ? 'restored' : to.hash ? 'section' : target.
|
|
16
|
+
target: history ? 'restored' : to.hash ? 'section' : target.kind === 'detail' ? 'hero' : 'list'
|
|
32
17
|
};
|
|
33
18
|
}
|
|
34
19
|
/** Only implemented edges are enabled. Parsing reverse/history intent does not enable motion. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalogRecipes.js","sourceRoot":"","sources":["../../src/catalog/catalogRecipes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"catalogRecipes.js","sourceRoot":"","sources":["../../src/catalog/catalogRecipes.ts"],"names":[],"mappings":"AAgBA,mGAAmG;AACnG,MAAM,UAAU,oBAAoB,CACnC,IAAS,EAC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atalogIdentity,\n\tCatalogEndpointSlot,\n\tCatalogSharedRole\n} from './CatalogEndpointRegistry.js';\n\nexport type CatalogComposition =\n\t'list' | 'carousel' | 'hero' | 'dock' | 'intermediate' | 'unavailable';\nexport interface CatalogNavigationIntent {\n\tidentity: CatalogIdentity;\n\tdirection: 'list-to-detail' | 'detail-to-list';\n\thistory: boolean;\n\ttarget: 'hero' | 'list' | 'section' | 'restored';\n}\n\n/** Route intent does not decide whether a restored DETAIL is actually showing its hero or dock. */\nexport function resolveCatalogIntent(\n\tfrom: URL,\n\tto: URL,\n\ttype: string,\n\tnavigation?: CatalogNavigationRegistry\n): CatalogNavigationIntent | undefined {\n\tconst pages = navigation?.resolve(from, to);\n\tif (!pages || pages.source.kind === pages.target.kind) return;\n\tconst { source, target } = pages;\n\tconst detail = source.kind === 'detail' ? source : target.kind === 'detail' ? target : undefined;\n\tconst content = source.kind === 'content' ? source : target.kind === 'content' ? target : undefined;\n\tif (!detail || !content || (content.elements && !content.elements.includes(detail.spatialElementId))) return;\n\tconst history = type === 'popstate';\n\treturn {\n\t\tidentity: { brandId: detail.brandId, spatialElementId: detail.spatialElementId },\n\t\tdirection: target.kind === 'detail' ? 'list-to-detail' : 'detail-to-list',\n\t\thistory,\n\t\ttarget: history ? 'restored' : to.hash ? 'section' : target.kind === 'detail' ? 'hero' : 'list'\n\t};\n}\n\nexport interface CatalogRecipe {\n\tid:\n\t\t| 'list-to-hero'\n\t\t| 'hero-to-list'\n\t\t| 'list-to-dock'\n\t\t| 'dock-to-list'\n\t\t| 'carousel-to-hero'\n\t\t| 'hero-to-carousel'\n\t\t| 'carousel-to-dock'\n\t\t| 'dock-to-carousel'\n\t\t| 'list-to-carousel'\n\t\t| 'carousel-to-list'\n\t\t| 'list-to-list'\n\t\t| 'carousel-to-carousel';\n\tidentity: CatalogIdentity;\n\tsource: CatalogEndpointSlot;\n\ttargetGeometry: CatalogEndpointSlot;\n\ttargetShared: CatalogEndpointSlot;\n\troles: readonly CatalogSharedRole[];\n}\n\n/** Only implemented edges are enabled. Parsing reverse/history intent does not enable motion. */\nexport function selectCatalogRecipe(\n\tintent: CatalogNavigationIntent | undefined,\n\tsource: CatalogComposition,\n\ttarget: CatalogComposition\n): CatalogRecipe | undefined {\n\tif (\n\t\tintent?.direction === 'list-to-detail' &&\n\t\tsource === 'carousel' &&\n\t\t(target === 'hero' || target === 'intermediate' || target === 'dock')\n\t)\n\t\treturn {\n\t\t\tid: target === 'dock' ? 'carousel-to-dock' : 'carousel-to-hero',\n\t\t\tidentity: intent.identity,\n\t\t\tsource: 'carousel.front',\n\t\t\ttargetGeometry: target === 'dock' ? 'detail.dock' : 'detail.hero',\n\t\t\ttargetShared: target === 'dock' ? 'detail.dock' : 'detail.summary',\n\t\t\troles: ['summary-surface', 'eyebrow', 'title', 'features', 'primary-action']\n\t\t};\n\tif (\n\t\tintent?.direction === 'detail-to-list' &&\n\t\ttarget === 'carousel' &&\n\t\t(source === 'hero' || source === 'intermediate' || source === 'dock')\n\t)\n\t\treturn {\n\t\t\tid: source === 'dock' ? 'dock-to-carousel' : 'hero-to-carousel',\n\t\t\tidentity: intent.identity,\n\t\t\tsource: source === 'dock' ? 'detail.dock' : 'detail.summary',\n\t\t\ttargetGeometry: 'carousel.front',\n\t\t\ttargetShared: 'carousel.front',\n\t\t\troles: ['summary-surface', 'eyebrow', 'title', 'features', 'primary-action']\n\t\t};\n\tif (\n\t\tintent &&\n\t\tintent.direction === 'detail-to-list' &&\n\t\t(source === 'hero' || source === 'intermediate' || source === 'dock') &&\n\t\ttarget === 'list'\n\t)\n\t\treturn {\n\t\t\tid: source === 'dock' ? 'dock-to-list' : 'hero-to-list',\n\t\t\tidentity: intent.identity,\n\t\t\tsource: source === 'dock' ? 'detail.dock' : 'detail.summary',\n\t\t\ttargetGeometry: 'catalog.card',\n\t\t\ttargetShared: 'catalog.card',\n\t\t\troles: ['summary-surface', 'eyebrow', 'title']\n\t\t};\n\tif (\n\t\t!intent ||\n\t\tintent.direction !== 'list-to-detail' ||\n\t\tsource !== 'list' ||\n\t\t(target !== 'hero' && target !== 'intermediate' && target !== 'dock')\n\t)\n\t\treturn;\n\treturn {\n\t\tid: target === 'dock' ? 'list-to-dock' : 'list-to-hero',\n\t\tidentity: intent.identity,\n\t\tsource: 'catalog.card',\n\t\ttargetGeometry: target === 'dock' ? 'detail.dock' : 'detail.hero',\n\t\ttargetShared: target === 'dock' ? 'detail.dock' : 'detail.summary',\n\t\troles: ['summary-surface', 'eyebrow', 'title']\n\t};\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Match the stable layout space used by detail endpoints, not mobile browser chrome. */
|
|
2
|
+
export interface CatalogTransitionViewport {
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
pixelRatio: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function readCatalogTransitionViewport(): CatalogTransitionViewport;
|
|
8
|
+
export declare function catalogTransitionViewportChanged(before: CatalogTransitionViewport, after: CatalogTransitionViewport): boolean;
|
|
9
|
+
//# sourceMappingURL=catalogTransitionViewport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalogTransitionViewport.d.ts","sourceRoot":"","sources":["../../src/catalog/catalogTransitionViewport.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,MAAM,WAAW,yBAAyB;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,6BAA6B,IAAI,yBAAyB,CAOzE;AAED,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,yBAAyB,EAAE,KAAK,EAAE,yBAAyB,WAGnH"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function readCatalogTransitionViewport() {
|
|
2
|
+
const probe = document.querySelector('[data-spatial-viewport-metrics]');
|
|
3
|
+
return {
|
|
4
|
+
width: window.innerWidth,
|
|
5
|
+
height: probe?.getBoundingClientRect().height || window.innerHeight,
|
|
6
|
+
pixelRatio: window.devicePixelRatio || 1
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export function catalogTransitionViewportChanged(before, after) {
|
|
10
|
+
return Math.abs(before.width - after.width) > 0.5 ||
|
|
11
|
+
Math.abs(before.height - after.height) > 0.5 || before.pixelRatio !== after.pixelRatio;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=catalogTransitionViewport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalogTransitionViewport.js","sourceRoot":"","sources":["../../src/catalog/catalogTransitionViewport.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,6BAA6B;IAC5C,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAc,iCAAiC,CAAC,CAAC;IACrF,OAAO;QACN,KAAK,EAAE,MAAM,CAAC,UAAU;QACxB,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,CAAC,MAAM,IAAI,MAAM,CAAC,WAAW;QACnE,UAAU,EAAE,MAAM,CAAC,gBAAgB,IAAI,CAAC;KACxC,CAAC;AACH,CAAC;AAED,MAAM,UAAU,gCAAgC,CAAC,MAAiC,EAAE,KAAgC;IACnH,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,GAAG;QAChD,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,GAAG,IAAI,MAAM,CAAC,UAAU,KAAK,KAAK,CAAC,UAAU,CAAC;AACzF,CAAC","sourcesContent":["/** Match the stable layout space used by detail endpoints, not mobile browser chrome. */\nexport interface CatalogTransitionViewport {\n\twidth: number;\n\theight: number;\n\tpixelRatio: number;\n}\n\nexport function readCatalogTransitionViewport(): CatalogTransitionViewport {\n\tconst probe = document.querySelector<HTMLElement>('[data-spatial-viewport-metrics]');\n\treturn {\n\t\twidth: window.innerWidth,\n\t\theight: probe?.getBoundingClientRect().height || window.innerHeight,\n\t\tpixelRatio: window.devicePixelRatio || 1\n\t};\n}\n\nexport function catalogTransitionViewportChanged(before: CatalogTransitionViewport, after: CatalogTransitionViewport) {\n\treturn Math.abs(before.width - after.width) > 0.5 ||\n\t\tMath.abs(before.height - after.height) > 0.5 || before.pixelRatio !== after.pixelRatio;\n}\n"]}
|
|
@@ -5,4 +5,6 @@ export declare function catalogViewLink(node: HTMLAnchorElement, context?: Catal
|
|
|
5
5
|
destroy(): void;
|
|
6
6
|
};
|
|
7
7
|
export declare function readCatalogViewContext(destination: URL): CatalogViewContext;
|
|
8
|
+
/** Read the originally activated anchor even after focus/ownership has changed. */
|
|
9
|
+
export declare function readCatalogLinkContext(link: HTMLAnchorElement | null | undefined, destination: URL): CatalogViewContext;
|
|
8
10
|
//# sourceMappingURL=catalogViewLink.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalogViewLink.d.ts","sourceRoot":"","sources":["../../src/catalog/catalogViewLink.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"catalogViewLink.d.ts","sourceRoot":"","sources":["../../src/catalog/catalogViewLink.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAG9D,sFAAsF;AACtF,wBAAgB,eAAe,CAAC,IAAI,EAAE,iBAAiB,EAAE,OAAO,GAAE,kBAAuB;oBACjE,kBAAkB;;EAazC;AAED,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,GAAG,GAAG,kBAAkB,CAG3E;AAED,mFAAmF;AACnF,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,iBAAiB,GAAG,IAAI,GAAG,SAAS,EAAE,WAAW,EAAE,GAAG,GAAG,kBAAkB,CAmBvH"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { focusCatalogLink } from './catalogActivationFocus.js';
|
|
1
2
|
/** Native anchor enhancement. No routing interception and no GPU state in the URL. */
|
|
2
3
|
export function catalogViewLink(node, context = {}) {
|
|
3
4
|
const update = (value) => {
|
|
4
5
|
node.dataset.catalogView = JSON.stringify(value);
|
|
5
6
|
};
|
|
6
|
-
const activate = () => node
|
|
7
|
+
const activate = (event) => focusCatalogLink(node, event);
|
|
7
8
|
update(context);
|
|
8
9
|
node.addEventListener('click', activate);
|
|
9
10
|
return {
|
|
@@ -16,19 +17,26 @@ export function catalogViewLink(node, context = {}) {
|
|
|
16
17
|
}
|
|
17
18
|
export function readCatalogViewContext(destination) {
|
|
18
19
|
const link = document.activeElement?.closest('a[data-catalog-view]');
|
|
20
|
+
return readCatalogLinkContext(link, destination);
|
|
21
|
+
}
|
|
22
|
+
/** Read the originally activated anchor even after focus/ownership has changed. */
|
|
23
|
+
export function readCatalogLinkContext(link, destination) {
|
|
19
24
|
if (!link || link.href !== destination.href)
|
|
20
25
|
return {};
|
|
21
26
|
try {
|
|
22
27
|
const parsed = JSON.parse(link.dataset.catalogView ?? '{}');
|
|
23
28
|
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed))
|
|
24
29
|
return {};
|
|
25
|
-
|
|
30
|
+
const context = Object.fromEntries([
|
|
26
31
|
'spatialElementId',
|
|
27
32
|
'sourceSection',
|
|
28
33
|
'targetSection',
|
|
29
34
|
'sourceOccurrence',
|
|
30
35
|
'targetOccurrence'
|
|
31
36
|
].flatMap((key) => (typeof parsed[key] === 'string' ? [[key, parsed[key]]] : [])));
|
|
37
|
+
if (parsed.targetPresentation === 'hero' || parsed.targetPresentation === 'dock')
|
|
38
|
+
context.targetPresentation = parsed.targetPresentation;
|
|
39
|
+
return context;
|
|
32
40
|
}
|
|
33
41
|
catch {
|
|
34
42
|
return {};
|