@spatial-elements/core 0.1.0-beta.1
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/LICENSE +373 -0
- package/README.md +17 -0
- package/dist/catalog/CarouselGlassCompositor.d.ts +24 -0
- package/dist/catalog/CarouselGlassCompositor.d.ts.map +1 -0
- package/dist/catalog/CarouselGlassCompositor.js +132 -0
- package/dist/catalog/CarouselGlassCompositor.js.map +1 -0
- package/dist/catalog/CatalogEndpointRegistry.d.ts +59 -0
- package/dist/catalog/CatalogEndpointRegistry.d.ts.map +1 -0
- package/dist/catalog/CatalogEndpointRegistry.js +187 -0
- package/dist/catalog/CatalogEndpointRegistry.js.map +1 -0
- package/dist/catalog/CatalogGeometryFade.d.ts +12 -0
- package/dist/catalog/CatalogGeometryFade.d.ts.map +1 -0
- package/dist/catalog/CatalogGeometryFade.js +67 -0
- package/dist/catalog/CatalogGeometryFade.js.map +1 -0
- package/dist/catalog/CatalogPreparation.d.ts +40 -0
- package/dist/catalog/CatalogPreparation.d.ts.map +1 -0
- package/dist/catalog/CatalogPreparation.js +141 -0
- package/dist/catalog/CatalogPreparation.js.map +1 -0
- package/dist/catalog/CatalogSections.d.ts +36 -0
- package/dist/catalog/CatalogSections.d.ts.map +1 -0
- package/dist/catalog/CatalogSections.js +51 -0
- package/dist/catalog/CatalogSections.js.map +1 -0
- package/dist/catalog/CatalogSpatialElementLayer.d.ts +149 -0
- package/dist/catalog/CatalogSpatialElementLayer.d.ts.map +1 -0
- package/dist/catalog/CatalogSpatialElementLayer.js +920 -0
- package/dist/catalog/CatalogSpatialElementLayer.js.map +1 -0
- package/dist/catalog/CatalogTransition.d.ts +93 -0
- package/dist/catalog/CatalogTransition.d.ts.map +1 -0
- package/dist/catalog/CatalogTransition.js +1299 -0
- package/dist/catalog/CatalogTransition.js.map +1 -0
- package/dist/catalog/EnvironmentCache.d.ts +30 -0
- package/dist/catalog/EnvironmentCache.d.ts.map +1 -0
- package/dist/catalog/EnvironmentCache.js +128 -0
- package/dist/catalog/EnvironmentCache.js.map +1 -0
- package/dist/catalog/PreparationGate.d.ts +10 -0
- package/dist/catalog/PreparationGate.d.ts.map +1 -0
- package/dist/catalog/PreparationGate.js +66 -0
- package/dist/catalog/PreparationGate.js.map +1 -0
- package/dist/catalog/PresentationLease.d.ts +16 -0
- package/dist/catalog/PresentationLease.d.ts.map +1 -0
- package/dist/catalog/PresentationLease.js +33 -0
- package/dist/catalog/PresentationLease.js.map +1 -0
- package/dist/catalog/SpatialGeometryCapture.d.ts +63 -0
- package/dist/catalog/SpatialGeometryCapture.d.ts.map +1 -0
- package/dist/catalog/SpatialGeometryCapture.js +158 -0
- package/dist/catalog/SpatialGeometryCapture.js.map +1 -0
- package/dist/catalog/assets/SpatialElementAssetManager.d.ts +92 -0
- package/dist/catalog/assets/SpatialElementAssetManager.d.ts.map +1 -0
- package/dist/catalog/assets/SpatialElementAssetManager.js +305 -0
- package/dist/catalog/assets/SpatialElementAssetManager.js.map +1 -0
- package/dist/catalog/assets/assetCosts.d.ts +4 -0
- package/dist/catalog/assets/assetCosts.d.ts.map +1 -0
- package/dist/catalog/assets/assetCosts.js +33 -0
- package/dist/catalog/assets/assetCosts.js.map +1 -0
- package/dist/catalog/assets/spatialElementAssetResources.d.ts +25 -0
- package/dist/catalog/assets/spatialElementAssetResources.d.ts.map +1 -0
- package/dist/catalog/assets/spatialElementAssetResources.js +100 -0
- package/dist/catalog/assets/spatialElementAssetResources.js.map +1 -0
- package/dist/catalog/carouselPanelProjection.d.ts +9 -0
- package/dist/catalog/carouselPanelProjection.d.ts.map +1 -0
- package/dist/catalog/carouselPanelProjection.js +33 -0
- package/dist/catalog/carouselPanelProjection.js.map +1 -0
- package/dist/catalog/carouselSelection.d.ts +7 -0
- package/dist/catalog/carouselSelection.d.ts.map +1 -0
- package/dist/catalog/carouselSelection.js +15 -0
- package/dist/catalog/carouselSelection.js.map +1 -0
- package/dist/catalog/catalogAction.d.ts +4 -0
- package/dist/catalog/catalogAction.d.ts.map +1 -0
- package/dist/catalog/catalogAction.js +9 -0
- package/dist/catalog/catalogAction.js.map +1 -0
- package/dist/catalog/catalogGeometryRequest.d.ts +13 -0
- package/dist/catalog/catalogGeometryRequest.d.ts.map +1 -0
- package/dist/catalog/catalogGeometryRequest.js +8 -0
- package/dist/catalog/catalogGeometryRequest.js.map +1 -0
- package/dist/catalog/catalogItems.d.ts +10 -0
- package/dist/catalog/catalogItems.d.ts.map +1 -0
- package/dist/catalog/catalogItems.js +23 -0
- package/dist/catalog/catalogItems.js.map +1 -0
- package/dist/catalog/catalogJourney.d.ts +38 -0
- package/dist/catalog/catalogJourney.d.ts.map +1 -0
- package/dist/catalog/catalogJourney.js +64 -0
- package/dist/catalog/catalogJourney.js.map +1 -0
- package/dist/catalog/catalogPage.d.ts +11 -0
- package/dist/catalog/catalogPage.d.ts.map +1 -0
- package/dist/catalog/catalogPage.js +2 -0
- package/dist/catalog/catalogPage.js.map +1 -0
- package/dist/catalog/catalogPose.d.ts +30 -0
- package/dist/catalog/catalogPose.d.ts.map +1 -0
- package/dist/catalog/catalogPose.js +35 -0
- package/dist/catalog/catalogPose.js.map +1 -0
- package/dist/catalog/catalogPresentation.d.ts +24 -0
- package/dist/catalog/catalogPresentation.d.ts.map +1 -0
- package/dist/catalog/catalogPresentation.js +56 -0
- package/dist/catalog/catalogPresentation.js.map +1 -0
- package/dist/catalog/catalogRecipes.d.ts +21 -0
- package/dist/catalog/catalogRecipes.d.ts.map +1 -0
- package/dist/catalog/catalogRecipes.js +84 -0
- package/dist/catalog/catalogRecipes.js.map +1 -0
- package/dist/catalog/catalogSurfaceCapture.d.ts +11 -0
- package/dist/catalog/catalogSurfaceCapture.d.ts.map +1 -0
- package/dist/catalog/catalogSurfaceCapture.js +11 -0
- package/dist/catalog/catalogSurfaceCapture.js.map +1 -0
- package/dist/catalog/catalogViewLink.d.ts +8 -0
- package/dist/catalog/catalogViewLink.d.ts.map +1 -0
- package/dist/catalog/catalogViewLink.js +37 -0
- package/dist/catalog/catalogViewLink.js.map +1 -0
- package/dist/catalog/rebasePresentation.d.ts +3 -0
- package/dist/catalog/rebasePresentation.d.ts.map +1 -0
- package/dist/catalog/rebasePresentation.js +26 -0
- package/dist/catalog/rebasePresentation.js.map +1 -0
- package/dist/catalog/spatialElementAssets.d.ts +158 -0
- package/dist/catalog/spatialElementAssets.d.ts.map +1 -0
- package/dist/catalog/spatialElementAssets.js +92 -0
- package/dist/catalog/spatialElementAssets.js.map +1 -0
- package/dist/catalog/spatialElementLodPair.d.ts +17 -0
- package/dist/catalog/spatialElementLodPair.d.ts.map +1 -0
- package/dist/catalog/spatialElementLodPair.js +5 -0
- package/dist/catalog/spatialElementLodPair.js.map +1 -0
- package/dist/catalog/transitionTiming.d.ts +15 -0
- package/dist/catalog/transitionTiming.d.ts.map +1 -0
- package/dist/catalog/transitionTiming.js +22 -0
- package/dist/catalog/transitionTiming.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/spatial-element/SpatialElementDockController.d.ts +101 -0
- package/dist/spatial-element/SpatialElementDockController.d.ts.map +1 -0
- package/dist/spatial-element/SpatialElementDockController.js +627 -0
- package/dist/spatial-element/SpatialElementDockController.js.map +1 -0
- package/dist/spatial-element/spatialElement.d.ts +28 -0
- package/dist/spatial-element/spatialElement.d.ts.map +1 -0
- package/dist/spatial-element/spatialElement.js +45 -0
- package/dist/spatial-element/spatialElement.js.map +1 -0
- package/dist/spatial-element/spatialElementDock.d.ts +43 -0
- package/dist/spatial-element/spatialElementDock.d.ts.map +1 -0
- package/dist/spatial-element/spatialElementDock.js +126 -0
- package/dist/spatial-element/spatialElementDock.js.map +1 -0
- package/dist/spatial-element/spatialElementSectionRegistry.d.ts +29 -0
- package/dist/spatial-element/spatialElementSectionRegistry.d.ts.map +1 -0
- package/dist/spatial-element/spatialElementSectionRegistry.js +67 -0
- package/dist/spatial-element/spatialElementSectionRegistry.js.map +1 -0
- package/dist/spatial-element/types.d.ts +165 -0
- package/dist/spatial-element/types.d.ts.map +1 -0
- package/dist/spatial-element/types.js +2 -0
- package/dist/spatial-element/types.js.map +1 -0
- package/dist/stage/LiquidGlassPanel.d.ts +55 -0
- package/dist/stage/LiquidGlassPanel.d.ts.map +1 -0
- package/dist/stage/LiquidGlassPanel.js +447 -0
- package/dist/stage/LiquidGlassPanel.js.map +1 -0
- package/dist/stage/MinimapBlurPipeline.d.ts +34 -0
- package/dist/stage/MinimapBlurPipeline.d.ts.map +1 -0
- package/dist/stage/MinimapBlurPipeline.js +147 -0
- package/dist/stage/MinimapBlurPipeline.js.map +1 -0
- package/dist/stage/MinimapController.d.ts +113 -0
- package/dist/stage/MinimapController.d.ts.map +1 -0
- package/dist/stage/MinimapController.js +803 -0
- package/dist/stage/MinimapController.js.map +1 -0
- package/dist/stage/OrbitControlsInterop.d.ts +8 -0
- package/dist/stage/OrbitControlsInterop.d.ts.map +1 -0
- package/dist/stage/OrbitControlsInterop.js +19 -0
- package/dist/stage/OrbitControlsInterop.js.map +1 -0
- package/dist/stage/PageBindingController.d.ts +41 -0
- package/dist/stage/PageBindingController.d.ts.map +1 -0
- package/dist/stage/PageBindingController.js +92 -0
- package/dist/stage/PageBindingController.js.map +1 -0
- package/dist/stage/PanelPresentationController.d.ts +92 -0
- package/dist/stage/PanelPresentationController.d.ts.map +1 -0
- package/dist/stage/PanelPresentationController.js +569 -0
- package/dist/stage/PanelPresentationController.js.map +1 -0
- package/dist/stage/PresentationReadiness.d.ts +30 -0
- package/dist/stage/PresentationReadiness.d.ts.map +1 -0
- package/dist/stage/PresentationReadiness.js +94 -0
- package/dist/stage/PresentationReadiness.js.map +1 -0
- package/dist/stage/SpaceMouseAdapter.d.ts +76 -0
- package/dist/stage/SpaceMouseAdapter.d.ts.map +1 -0
- package/dist/stage/SpaceMouseAdapter.js +197 -0
- package/dist/stage/SpaceMouseAdapter.js.map +1 -0
- package/dist/stage/SpatialElementInteractionController.d.ts +126 -0
- package/dist/stage/SpatialElementInteractionController.d.ts.map +1 -0
- package/dist/stage/SpatialElementInteractionController.js +581 -0
- package/dist/stage/SpatialElementInteractionController.js.map +1 -0
- package/dist/stage/SpatialElementPresentationController.d.ts +82 -0
- package/dist/stage/SpatialElementPresentationController.d.ts.map +1 -0
- package/dist/stage/SpatialElementPresentationController.js +372 -0
- package/dist/stage/SpatialElementPresentationController.js.map +1 -0
- package/dist/stage/SpatialElementRefinement.d.ts +26 -0
- package/dist/stage/SpatialElementRefinement.d.ts.map +1 -0
- package/dist/stage/SpatialElementRefinement.js +105 -0
- package/dist/stage/SpatialElementRefinement.js.map +1 -0
- package/dist/stage/StageExperience.d.ts +536 -0
- package/dist/stage/StageExperience.d.ts.map +1 -0
- package/dist/stage/StageExperience.js +2399 -0
- package/dist/stage/StageExperience.js.map +1 -0
- package/dist/stage/StagePanelLayout.d.ts +15 -0
- package/dist/stage/StagePanelLayout.d.ts.map +1 -0
- package/dist/stage/StagePanelLayout.js +20 -0
- package/dist/stage/StagePanelLayout.js.map +1 -0
- package/dist/stage/StagePanelRuntime.d.ts +20 -0
- package/dist/stage/StagePanelRuntime.d.ts.map +1 -0
- package/dist/stage/StagePanelRuntime.js +2 -0
- package/dist/stage/StagePanelRuntime.js.map +1 -0
- package/dist/stage/StageRenderPipeline.d.ts +179 -0
- package/dist/stage/StageRenderPipeline.d.ts.map +1 -0
- package/dist/stage/StageRenderPipeline.js +901 -0
- package/dist/stage/StageRenderPipeline.js.map +1 -0
- package/dist/stage/VirtualScrollController.d.ts +64 -0
- package/dist/stage/VirtualScrollController.d.ts.map +1 -0
- package/dist/stage/VirtualScrollController.js +329 -0
- package/dist/stage/VirtualScrollController.js.map +1 -0
- package/dist/stage/cssProjection.d.ts +18 -0
- package/dist/stage/cssProjection.d.ts.map +1 -0
- package/dist/stage/cssProjection.js +52 -0
- package/dist/stage/cssProjection.js.map +1 -0
- package/dist/stage/damping.d.ts +3 -0
- package/dist/stage/damping.d.ts.map +1 -0
- package/dist/stage/damping.js +8 -0
- package/dist/stage/damping.js.map +1 -0
- package/dist/stage/minimap/MinimapGeometry.d.ts +31 -0
- package/dist/stage/minimap/MinimapGeometry.d.ts.map +1 -0
- package/dist/stage/minimap/MinimapGeometry.js +163 -0
- package/dist/stage/minimap/MinimapGeometry.js.map +1 -0
- package/dist/stage/minimap/MinimapModel.d.ts +16 -0
- package/dist/stage/minimap/MinimapModel.d.ts.map +1 -0
- package/dist/stage/minimap/MinimapModel.js +51 -0
- package/dist/stage/minimap/MinimapModel.js.map +1 -0
- package/dist/stage/minimap/MinimapProjection.d.ts +41 -0
- package/dist/stage/minimap/MinimapProjection.d.ts.map +1 -0
- package/dist/stage/minimap/MinimapProjection.js +113 -0
- package/dist/stage/minimap/MinimapProjection.js.map +1 -0
- package/dist/stage/minimap/MinimapState.d.ts +102 -0
- package/dist/stage/minimap/MinimapState.d.ts.map +1 -0
- package/dist/stage/minimap/MinimapState.js +2 -0
- package/dist/stage/minimap/MinimapState.js.map +1 -0
- package/dist/stage/minimapMeasurement.d.ts +5 -0
- package/dist/stage/minimapMeasurement.d.ts.map +1 -0
- package/dist/stage/minimapMeasurement.js +11 -0
- package/dist/stage/minimapMeasurement.js.map +1 -0
- package/dist/stage/panelContext.d.ts +71 -0
- package/dist/stage/panelContext.d.ts.map +1 -0
- package/dist/stage/panelContext.js +6 -0
- package/dist/stage/panelContext.js.map +1 -0
- package/dist/stage/panelShadow.d.ts +20 -0
- package/dist/stage/panelShadow.d.ts.map +1 -0
- package/dist/stage/panelShadow.js +22 -0
- package/dist/stage/panelShadow.js.map +1 -0
- package/dist/stage/renderMeasurement.d.ts +3 -0
- package/dist/stage/renderMeasurement.d.ts.map +1 -0
- package/dist/stage/renderMeasurement.js +19 -0
- package/dist/stage/renderMeasurement.js.map +1 -0
- package/dist/stage/renderTargetInventory.d.ts +17 -0
- package/dist/stage/renderTargetInventory.d.ts.map +1 -0
- package/dist/stage/renderTargetInventory.js +27 -0
- package/dist/stage/renderTargetInventory.js.map +1 -0
- package/dist/stage/rendererState.d.ts +14 -0
- package/dist/stage/rendererState.d.ts.map +1 -0
- package/dist/stage/rendererState.js +35 -0
- package/dist/stage/rendererState.js.map +1 -0
- package/dist/stage/resolveStageProfile.d.ts +44 -0
- package/dist/stage/resolveStageProfile.d.ts.map +1 -0
- package/dist/stage/resolveStageProfile.js +30 -0
- package/dist/stage/resolveStageProfile.js.map +1 -0
- package/dist/stage/scrollAnimation.d.ts +10 -0
- package/dist/stage/scrollAnimation.d.ts.map +1 -0
- package/dist/stage/scrollAnimation.js +11 -0
- package/dist/stage/scrollAnimation.js.map +1 -0
- package/dist/stage/scrollFrame.d.ts +43 -0
- package/dist/stage/scrollFrame.d.ts.map +1 -0
- package/dist/stage/scrollFrame.js +232 -0
- package/dist/stage/scrollFrame.js.map +1 -0
- package/dist/stage/spatialElementFrame.d.ts +6 -0
- package/dist/stage/spatialElementFrame.d.ts.map +1 -0
- package/dist/stage/spatialElementFrame.js +22 -0
- package/dist/stage/spatialElementFrame.js.map +1 -0
- package/dist/stage/stageConstants.d.ts +85 -0
- package/dist/stage/stageConstants.d.ts.map +1 -0
- package/dist/stage/stageConstants.js +85 -0
- package/dist/stage/stageConstants.js.map +1 -0
- package/dist/stage/stageDom.d.ts +10 -0
- package/dist/stage/stageDom.d.ts.map +1 -0
- package/dist/stage/stageDom.js +22 -0
- package/dist/stage/stageDom.js.map +1 -0
- package/dist/stage/stageMath.d.ts +187 -0
- package/dist/stage/stageMath.d.ts.map +1 -0
- package/dist/stage/stageMath.js +344 -0
- package/dist/stage/stageMath.js.map +1 -0
- package/dist/stage/stageSceneUtils.d.ts +42 -0
- package/dist/stage/stageSceneUtils.d.ts.map +1 -0
- package/dist/stage/stageSceneUtils.js +154 -0
- package/dist/stage/stageSceneUtils.js.map +1 -0
- package/dist/stage/stageTypes.d.ts +189 -0
- package/dist/stage/stageTypes.d.ts.map +1 -0
- package/dist/stage/stageTypes.js +2 -0
- package/dist/stage/stageTypes.js.map +1 -0
- package/dist/stage/stageVisualTest.d.ts +92 -0
- package/dist/stage/stageVisualTest.d.ts.map +1 -0
- package/dist/stage/stageVisualTest.js +5 -0
- package/dist/stage/stageVisualTest.js.map +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** Section-local screen framing, independent of assets and camera ownership. */
|
|
2
|
+
export interface CatalogPose {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
size: number;
|
|
6
|
+
depth: number;
|
|
7
|
+
yaw: number;
|
|
8
|
+
visible: boolean;
|
|
9
|
+
front: boolean;
|
|
10
|
+
panelOpacity: number;
|
|
11
|
+
opacity: number;
|
|
12
|
+
}
|
|
13
|
+
export interface CatalogPoseProvider {
|
|
14
|
+
kind: 'carousel';
|
|
15
|
+
read(): CatalogPose;
|
|
16
|
+
}
|
|
17
|
+
/** Presentation controls, never asset scale, URL or renderer ownership. */
|
|
18
|
+
export interface CarouselPresentation {
|
|
19
|
+
/** Horizontal arc extent as a fraction of section width (default 0.48). */
|
|
20
|
+
radius?: number;
|
|
21
|
+
/** Maximum rearward travel in CSS-world pixels (default 700). */
|
|
22
|
+
depth?: number;
|
|
23
|
+
}
|
|
24
|
+
export declare function carouselDistance(index: number, phase: number, count: number): number;
|
|
25
|
+
/** Five visible seats, plus one preparation seat on either side. No duplicated elements. */
|
|
26
|
+
export declare function carouselResident(index: number, phase: number, count: number): boolean;
|
|
27
|
+
/** An ordered shallow arc of element/panel groups, independent of the asset's physical dimensions. */
|
|
28
|
+
export declare function carouselPose(index: number, phase: number, count: number, presentation?: CarouselPresentation): CatalogPose;
|
|
29
|
+
export declare const CATALOG_POSE_CHANGED = "catalog-pose-changed";
|
|
30
|
+
//# sourceMappingURL=catalogPose.d.ts.map
|
|
@@ -0,0 +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,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IACnC,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,IAAI,WAAW,CAAC;CACpB;AAED,2EAA2E;AAC3E,MAAM,WAAW,oBAAoB;IACpC,2EAA2E;IAC3E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iEAAiE;IACjE,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAE3E;AAED,4FAA4F;AAC5F,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,WAE3E;AAED,sGAAsG;AACtG,wBAAgB,YAAY,CAC3B,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,YAAY,GAAE,oBAAyB,GACrC,WAAW,CAwBb;AAED,eAAO,MAAM,oBAAoB,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export function carouselDistance(index, phase, count) {
|
|
2
|
+
return count > 1 ? index - phase : 0;
|
|
3
|
+
}
|
|
4
|
+
/** Five visible seats, plus one preparation seat on either side. No duplicated elements. */
|
|
5
|
+
export function carouselResident(index, phase, count) {
|
|
6
|
+
return Math.abs(carouselDistance(index, phase, count)) <= 3;
|
|
7
|
+
}
|
|
8
|
+
/** An ordered shallow arc of element/panel groups, independent of the asset's physical dimensions. */
|
|
9
|
+
export function carouselPose(index, phase, count, presentation = {}) {
|
|
10
|
+
const distance = carouselDistance(index, phase, count);
|
|
11
|
+
// Fixed angular spacing: adding spatialElements extends the arc, never closes a turntable.
|
|
12
|
+
const angle = (distance * Math.PI) / 12;
|
|
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;
|
|
21
|
+
return {
|
|
22
|
+
x: 0.5 + (Math.sin(angle) * radius) / Math.sin(Math.PI / 6),
|
|
23
|
+
y: 0.5 - back * 0.1,
|
|
24
|
+
size: 0.82 / (1 + Math.abs(distance) * 0.65),
|
|
25
|
+
depth: -back * depth,
|
|
26
|
+
// Strong near-centre turn, smoothly bounded before distant seats become edge-on.
|
|
27
|
+
yaw: -Math.atan(distance * Math.tan((28 * Math.PI) / 180)),
|
|
28
|
+
visible: Math.abs(distance) < 2.5,
|
|
29
|
+
front: Math.abs(distance) <= 0.5,
|
|
30
|
+
panelOpacity: Math.pow(Math.max(0, 1 - Math.abs(distance)), 2),
|
|
31
|
+
opacity: edge
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export const CATALOG_POSE_CHANGED = 'catalog-pose-changed';
|
|
35
|
+
//# sourceMappingURL=catalogPose.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalogPose.js","sourceRoot":"","sources":["../../src/catalog/catalogPose.ts"],"names":[],"mappings":"AA0BA,MAAM,UAAU,gBAAgB,CAAC,KAAa,EAAE,KAAa,EAAE,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MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC;QAChD,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,YAAY,CAAC,KAAM,CAAC,CAAC;QAClD,CAAC,CAAC,GAAG,CAAC;IACP,OAAO;QACN,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QAC3D,CAAC,EAAE,GAAG,GAAG,IAAI,GAAG,GAAG;QACnB,IAAI,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;QAC5C,KAAK,EAAE,CAAC,IAAI,GAAG,KAAK;QACpB,iFAAiF;QACjF,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC;QAC1D,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,GAAG;QACjC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,GAAG;QAChC,YAAY,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC;QAC9D,OAAO,EAAE,IAAI;KACb,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,sBAAsB,CAAC","sourcesContent":["/** 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\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"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Material, Object3D } from 'three';
|
|
2
|
+
export interface CatalogTransitionPresentation {
|
|
3
|
+
active: boolean;
|
|
4
|
+
enterOpacity: number;
|
|
5
|
+
exitOpacity: number;
|
|
6
|
+
sharedOpacity: number;
|
|
7
|
+
/** Independent environment reveal; older callers default to the content channel. */
|
|
8
|
+
backgroundOpacity?: number;
|
|
9
|
+
/** SpatialElement-only LOD blend; independent of the environment channel. */
|
|
10
|
+
geometryOpacity?: number;
|
|
11
|
+
}
|
|
12
|
+
export type CatalogTransitionGroup = 'enter' | 'shared';
|
|
13
|
+
export declare const RESTING_CATALOG_PRESENTATION: Readonly<CatalogTransitionPresentation>;
|
|
14
|
+
export declare function normalizeCatalogPresentation(state: CatalogTransitionPresentation): CatalogTransitionPresentation;
|
|
15
|
+
export declare function getCatalogTransitionOpacity(state: CatalogTransitionPresentation, group?: string): number;
|
|
16
|
+
/** Capture authored alpha once so presentation updates never compound material opacity. */
|
|
17
|
+
export declare function captureCatalogMaterialOpacity(model: Object3D): {
|
|
18
|
+
material: Material<import("three").MaterialEventMap>;
|
|
19
|
+
opacity: number;
|
|
20
|
+
transparent: boolean;
|
|
21
|
+
depthWrite: boolean;
|
|
22
|
+
}[];
|
|
23
|
+
export declare function applyCatalogMaterialOpacity(states: ReturnType<typeof captureCatalogMaterialOpacity>, opacity: number): void;
|
|
24
|
+
//# sourceMappingURL=catalogPresentation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalogPresentation.d.ts","sourceRoot":"","sources":["../../src/catalog/catalogPresentation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEhD,MAAM,WAAW,6BAA6B;IAC7C,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,oFAAoF;IACpF,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,6EAA6E;IAC7E,eAAe,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,MAAM,sBAAsB,GAAG,OAAO,GAAG,QAAQ,CAAC;AAExD,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,6BAA6B,CAKhF,CAAC;AAEF,wBAAgB,4BAA4B,CAC3C,KAAK,EAAE,6BAA6B,GAClC,6BAA6B,CAe/B;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,6BAA6B,EAAE,KAAK,CAAC,EAAE,MAAM,UAG/F;AAED,2FAA2F;AAC3F,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,QAAQ;;;;;IAa5D;AAED,wBAAgB,2BAA2B,CAC1C,MAAM,EAAE,UAAU,CAAC,OAAO,6BAA6B,CAAC,EACxD,OAAO,EAAE,MAAM,QAWf"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export const RESTING_CATALOG_PRESENTATION = {
|
|
2
|
+
active: false,
|
|
3
|
+
enterOpacity: 1,
|
|
4
|
+
exitOpacity: 1,
|
|
5
|
+
sharedOpacity: 1
|
|
6
|
+
};
|
|
7
|
+
export function normalizeCatalogPresentation(state) {
|
|
8
|
+
if (!state.active)
|
|
9
|
+
return { ...RESTING_CATALOG_PRESENTATION };
|
|
10
|
+
const opacity = (value) => (Number.isFinite(value) ? Math.min(1, Math.max(0, value)) : 0);
|
|
11
|
+
return {
|
|
12
|
+
active: true,
|
|
13
|
+
enterOpacity: opacity(state.enterOpacity),
|
|
14
|
+
exitOpacity: opacity(state.exitOpacity),
|
|
15
|
+
sharedOpacity: opacity(state.sharedOpacity),
|
|
16
|
+
...(state.backgroundOpacity === undefined
|
|
17
|
+
? {}
|
|
18
|
+
: { backgroundOpacity: opacity(state.backgroundOpacity) }),
|
|
19
|
+
...(state.geometryOpacity === undefined
|
|
20
|
+
? {}
|
|
21
|
+
: { geometryOpacity: opacity(state.geometryOpacity) })
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export function getCatalogTransitionOpacity(state, group) {
|
|
25
|
+
if (!state.active)
|
|
26
|
+
return 1;
|
|
27
|
+
return group === 'enter' ? state.enterOpacity : group === 'shared' ? state.sharedOpacity : 1;
|
|
28
|
+
}
|
|
29
|
+
/** Capture authored alpha once so presentation updates never compound material opacity. */
|
|
30
|
+
export function captureCatalogMaterialOpacity(model) {
|
|
31
|
+
const materials = new Set();
|
|
32
|
+
model.traverse((object) => {
|
|
33
|
+
const material = object.material;
|
|
34
|
+
if (material)
|
|
35
|
+
for (const item of Array.isArray(material) ? material : [material])
|
|
36
|
+
materials.add(item);
|
|
37
|
+
});
|
|
38
|
+
return [...materials].map((material) => ({
|
|
39
|
+
material,
|
|
40
|
+
opacity: material.opacity,
|
|
41
|
+
transparent: material.transparent,
|
|
42
|
+
depthWrite: material.depthWrite
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
export function applyCatalogMaterialOpacity(states, opacity) {
|
|
46
|
+
for (const state of states) {
|
|
47
|
+
const transparent = state.transparent || opacity < 1;
|
|
48
|
+
if (state.material.transparent !== transparent) {
|
|
49
|
+
state.material.transparent = transparent;
|
|
50
|
+
state.material.needsUpdate = true;
|
|
51
|
+
}
|
|
52
|
+
state.material.opacity = state.opacity * opacity;
|
|
53
|
+
state.material.depthWrite = state.depthWrite && opacity === 1;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=catalogPresentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalogPresentation.js","sourceRoot":"","sources":["../../src/catalog/catalogPresentation.ts"],"names":[],"mappings":"AAeA,MAAM,CAA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AAK,CAAC,QAAQ,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,IAAI,OAAO,KAAK,CAAC,CAAC;IAC/D,CAAC;AACF,CAAC","sourcesContent":["import type { Material, Object3D } from 'three';\n\nexport interface CatalogTransitionPresentation {\n\tactive: boolean;\n\tenterOpacity: number;\n\texitOpacity: number;\n\tsharedOpacity: number;\n\t/** Independent environment reveal; older callers default to the content channel. */\n\tbackgroundOpacity?: number;\n\t/** SpatialElement-only LOD blend; independent of the environment channel. */\n\tgeometryOpacity?: number;\n}\n\nexport type CatalogTransitionGroup = 'enter' | 'shared';\n\nexport const RESTING_CATALOG_PRESENTATION: Readonly<CatalogTransitionPresentation> = {\n\tactive: false,\n\tenterOpacity: 1,\n\texitOpacity: 1,\n\tsharedOpacity: 1\n};\n\nexport function normalizeCatalogPresentation(\n\tstate: CatalogTransitionPresentation\n): CatalogTransitionPresentation {\n\tif (!state.active) return { ...RESTING_CATALOG_PRESENTATION };\n\tconst opacity = (value: number) => (Number.isFinite(value) ? Math.min(1, Math.max(0, value)) : 0);\n\treturn {\n\t\tactive: true,\n\t\tenterOpacity: opacity(state.enterOpacity),\n\t\texitOpacity: opacity(state.exitOpacity),\n\t\tsharedOpacity: opacity(state.sharedOpacity),\n\t\t...(state.backgroundOpacity === undefined\n\t\t\t? {}\n\t\t\t: { backgroundOpacity: opacity(state.backgroundOpacity) }),\n\t\t...(state.geometryOpacity === undefined\n\t\t\t? {}\n\t\t\t: { geometryOpacity: opacity(state.geometryOpacity) })\n\t};\n}\n\nexport function getCatalogTransitionOpacity(state: CatalogTransitionPresentation, group?: string) {\n\tif (!state.active) return 1;\n\treturn group === 'enter' ? state.enterOpacity : group === 'shared' ? state.sharedOpacity : 1;\n}\n\n/** Capture authored alpha once so presentation updates never compound material opacity. */\nexport function captureCatalogMaterialOpacity(model: Object3D) {\n\tconst materials = new Set<Material>();\n\tmodel.traverse((object) => {\n\t\tconst material = (object as Object3D & { material?: Material | Material[] }).material;\n\t\tif (material)\n\t\t\tfor (const item of Array.isArray(material) ? material : [material]) materials.add(item);\n\t});\n\treturn [...materials].map((material) => ({\n\t\tmaterial,\n\t\topacity: material.opacity,\n\t\ttransparent: material.transparent,\n\t\tdepthWrite: material.depthWrite\n\t}));\n}\n\nexport function applyCatalogMaterialOpacity(\n\tstates: ReturnType<typeof captureCatalogMaterialOpacity>,\n\topacity: number\n) {\n\tfor (const state of states) {\n\t\tconst transparent = state.transparent || opacity < 1;\n\t\tif (state.material.transparent !== transparent) {\n\t\t\tstate.material.transparent = transparent;\n\t\t\tstate.material.needsUpdate = true;\n\t\t}\n\t\tstate.material.opacity = state.opacity * opacity;\n\t\tstate.material.depthWrite = state.depthWrite && opacity === 1;\n\t}\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { CatalogIdentity, CatalogEndpointSlot, CatalogSharedRole } from './CatalogEndpointRegistry.js';
|
|
2
|
+
export type CatalogComposition = 'list' | 'carousel' | 'hero' | 'dock' | 'intermediate' | 'unavailable';
|
|
3
|
+
export interface CatalogNavigationIntent {
|
|
4
|
+
identity: CatalogIdentity;
|
|
5
|
+
direction: 'list-to-detail' | 'detail-to-list';
|
|
6
|
+
history: boolean;
|
|
7
|
+
target: 'hero' | 'list' | 'section' | 'restored';
|
|
8
|
+
}
|
|
9
|
+
/** 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 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
|
+
identity: CatalogIdentity;
|
|
14
|
+
source: CatalogEndpointSlot;
|
|
15
|
+
targetGeometry: CatalogEndpointSlot;
|
|
16
|
+
targetShared: CatalogEndpointSlot;
|
|
17
|
+
roles: readonly CatalogSharedRole[];
|
|
18
|
+
}
|
|
19
|
+
/** Only implemented edges are enabled. Parsing reverse/history intent does not enable motion. */
|
|
20
|
+
export declare function selectCatalogRecipe(intent: CatalogNavigationIntent | undefined, source: CatalogComposition, target: CatalogComposition): CatalogRecipe | undefined;
|
|
21
|
+
//# sourceMappingURL=catalogRecipes.d.ts.map
|
|
@@ -0,0 +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,GACV,uBAAuB,GAAG,SAAS,CAgCrC;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,CAAC;IACtB,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"}
|
|
@@ -0,0 +1,84 @@
|
|
|
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
|
+
if (from.origin !== to.origin)
|
|
4
|
+
return;
|
|
5
|
+
const parse = (url) => {
|
|
6
|
+
const match = /^\/([^/]+)\/(categories\/(?:list|carousel|mixed)|(?:elements|products)\/([^/]+))\/?$/.exec(url.pathname);
|
|
7
|
+
if (!match)
|
|
8
|
+
return;
|
|
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))
|
|
25
|
+
return;
|
|
26
|
+
const history = type === 'popstate';
|
|
27
|
+
return {
|
|
28
|
+
identity: { brandId: target.brandId, spatialElementId: (source.spatialElementId ?? target.spatialElementId) },
|
|
29
|
+
direction: target.spatialElementId ? 'list-to-detail' : 'detail-to-list',
|
|
30
|
+
history,
|
|
31
|
+
target: history ? 'restored' : to.hash ? 'section' : target.spatialElementId ? 'hero' : 'list'
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/** Only implemented edges are enabled. Parsing reverse/history intent does not enable motion. */
|
|
35
|
+
export function selectCatalogRecipe(intent, source, target) {
|
|
36
|
+
if (intent?.direction === 'list-to-detail' &&
|
|
37
|
+
source === 'carousel' &&
|
|
38
|
+
(target === 'hero' || target === 'intermediate' || target === 'dock'))
|
|
39
|
+
return {
|
|
40
|
+
id: target === 'dock' ? 'carousel-to-dock' : 'carousel-to-hero',
|
|
41
|
+
identity: intent.identity,
|
|
42
|
+
source: 'carousel.front',
|
|
43
|
+
targetGeometry: target === 'dock' ? 'detail.dock' : 'detail.hero',
|
|
44
|
+
targetShared: target === 'dock' ? 'detail.dock' : 'detail.summary',
|
|
45
|
+
roles: ['summary-surface', 'eyebrow', 'title', 'features', 'primary-action']
|
|
46
|
+
};
|
|
47
|
+
if (intent?.direction === 'detail-to-list' &&
|
|
48
|
+
target === 'carousel' &&
|
|
49
|
+
(source === 'hero' || source === 'intermediate' || source === 'dock'))
|
|
50
|
+
return {
|
|
51
|
+
id: source === 'dock' ? 'dock-to-carousel' : 'hero-to-carousel',
|
|
52
|
+
identity: intent.identity,
|
|
53
|
+
source: source === 'dock' ? 'detail.dock' : 'detail.summary',
|
|
54
|
+
targetGeometry: 'carousel.front',
|
|
55
|
+
targetShared: 'carousel.front',
|
|
56
|
+
roles: ['summary-surface', 'eyebrow', 'title', 'features', 'primary-action']
|
|
57
|
+
};
|
|
58
|
+
if (intent &&
|
|
59
|
+
intent.direction === 'detail-to-list' &&
|
|
60
|
+
(source === 'hero' || source === 'intermediate' || source === 'dock') &&
|
|
61
|
+
target === 'list')
|
|
62
|
+
return {
|
|
63
|
+
id: source === 'dock' ? 'dock-to-list' : 'hero-to-list',
|
|
64
|
+
identity: intent.identity,
|
|
65
|
+
source: source === 'dock' ? 'detail.dock' : 'detail.summary',
|
|
66
|
+
targetGeometry: 'catalog.card',
|
|
67
|
+
targetShared: 'catalog.card',
|
|
68
|
+
roles: ['summary-surface', 'eyebrow', 'title']
|
|
69
|
+
};
|
|
70
|
+
if (!intent ||
|
|
71
|
+
intent.direction !== 'list-to-detail' ||
|
|
72
|
+
source !== 'list' ||
|
|
73
|
+
(target !== 'hero' && target !== 'intermediate' && target !== 'dock'))
|
|
74
|
+
return;
|
|
75
|
+
return {
|
|
76
|
+
id: target === 'dock' ? 'list-to-dock' : 'list-to-hero',
|
|
77
|
+
identity: intent.identity,
|
|
78
|
+
source: 'catalog.card',
|
|
79
|
+
targetGeometry: target === 'dock' ? 'detail.dock' : 'detail.hero',
|
|
80
|
+
targetShared: target === 'dock' ? 'detail.dock' : 'detail.summary',
|
|
81
|
+
roles: ['summary-surface', 'eyebrow', 'title']
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=catalogRecipes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalogRecipes.js","sourceRoot":"","sources":["../../src/catalog/catalogRecipes.ts"],"names":[],"mappings":"AAeA,mGAAmG;AACnG,MAAM,UAAU,oBAAoB,CACnC,IAAS,EACT,EAAO,EACP,IAAY;IAEZ,IAAI,IAAI,CAAC,MAAM,KAAK,EAAE,CAAC,MAAM;QAAE,OAAO;IACtC,MAAM,KAAK,GAAG,CAAC,GAAQ,EAAE,EAAE;QAC1B,MAAM,KAAK,GAAG,sFAAsF,CAAC,IAAI,CACxG,GAAG,CAAC,QAAQ,CACZ,CAAC;QACF,IAAI,CAAC,KAAK;YAAE,OAAO;QACnB,IAAI,CAAC;YACJ,OAAO;gBACN,OAAO,EAAE,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBACrC,gBAAgB,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;aACrE,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACR,OAAO;QACR,CAAC;IACF,CAAC,CAAC;IACF,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;IAC3B,MAAM,MAAM,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC;IACzB,IAC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,KAAK,gBAAgB;QACrC,MAAM,KAAK,MAAM;QACjB,CAAC,MAAM,KAAK,MAAM,IAAI,MAAM,KAAK,cAAc,IAAI,MAAM,KAAK,MAAM,CAAC;QAErE,OAAO;IACR,OAAO;QACN,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc;QACvD,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,MAAM,EAAE,cAAc;QACtB,cAAc,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa;QACjE,YAAY,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,gBAAgB;QAClE,KAAK,EAAE,CAAC,iBAAiB,EAAE,SAAS,EAAE,OAAO,CAAC;KAC9C,CAAC;AACH,CAAC","sourcesContent":["import type {\n\tCatalogIdentity,\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): CatalogNavigationIntent | undefined {\n\tif (from.origin !== to.origin) return;\n\tconst parse = (url: URL) => {\n\t\tconst match = /^\\/([^/]+)\\/(categories\\/(?:list|carousel|mixed)|(?:elements|products)\\/([^/]+))\\/?$/.exec(\n\t\t\turl.pathname\n\t\t);\n\t\tif (!match) return;\n\t\ttry {\n\t\t\treturn {\n\t\t\t\tbrandId: decodeURIComponent(match[1]),\n\t\t\t\tspatialElementId: match[3] ? decodeURIComponent(match[3]) : undefined\n\t\t\t};\n\t\t} catch {\n\t\t\treturn;\n\t\t}\n\t};\n\tconst source = parse(from);\n\tconst target = parse(to);\n\tif (\n\t\t!source ||\n\t\t!target ||\n\t\tsource.brandId !== target.brandId ||\n\t\tBoolean(source.spatialElementId) === Boolean(target.spatialElementId)\n\t)\n\t\treturn;\n\tconst history = type === 'popstate';\n\treturn {\n\t\tidentity: { brandId: target.brandId, spatialElementId: (source.spatialElementId ?? target.spatialElementId)! },\n\t\tdirection: target.spatialElementId ? 'list-to-detail' : 'detail-to-list',\n\t\thistory,\n\t\ttarget: history ? 'restored' : to.hash ? 'section' : target.spatialElementId ? '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\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,11 @@
|
|
|
1
|
+
/** Measured presentation and paint are independent of the endpoint's layout registration. */
|
|
2
|
+
export interface CatalogSurfaceCapture {
|
|
3
|
+
corners?: import('../stage/cssProjection.js').CssProjectionQuad;
|
|
4
|
+
bounds: HTMLElement;
|
|
5
|
+
background: string;
|
|
6
|
+
border: string;
|
|
7
|
+
borderRadius: string;
|
|
8
|
+
boxShadow: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function captureCssSurface(bounds: HTMLElement, paint?: HTMLElement, pseudo?: string): CatalogSurfaceCapture;
|
|
11
|
+
//# sourceMappingURL=catalogSurfaceCapture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalogSurfaceCapture.d.ts","sourceRoot":"","sources":["../../src/catalog/catalogSurfaceCapture.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,MAAM,WAAW,qBAAqB;IACrC,OAAO,CAAC,EAAE,OAAO,2BAA2B,EAAE,iBAAiB,CAAC;IAChE,MAAM,EAAE,WAAW,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,iBAAiB,CAChC,MAAM,EAAE,WAAW,EACnB,KAAK,GAAE,WAAoB,EAC3B,MAAM,CAAC,EAAE,MAAM,GACb,qBAAqB,CASvB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function captureCssSurface(bounds, paint = bounds, pseudo) {
|
|
2
|
+
const style = getComputedStyle(paint, pseudo);
|
|
3
|
+
return {
|
|
4
|
+
bounds,
|
|
5
|
+
background: style.background,
|
|
6
|
+
border: style.border,
|
|
7
|
+
borderRadius: getComputedStyle(bounds).borderRadius,
|
|
8
|
+
boxShadow: style.boxShadow
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=catalogSurfaceCapture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalogSurfaceCapture.js","sourceRoot":"","sources":["../../src/catalog/catalogSurfaceCapture.ts"],"names":[],"mappings":"AAUA,MAAM,UAAU,iBAAiB,CAChC,MAAmB,EACnB,QAAqB,MAAM,EAC3B,MAAe;IAEf,MAAM,KAAK,GAAG,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC9C,OAAO;QACN,MAAM;QACN,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,YAAY,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC,YAAY;QACnD,SAAS,EAAE,KAAK,CAAC,SAAS;KAC1B,CAAC;AACH,CAAC","sourcesContent":["/** Measured presentation and paint are independent of the endpoint's layout registration. */\nexport interface CatalogSurfaceCapture {\n\tcorners?: import('../stage/cssProjection.js').CssProjectionQuad;\n\tbounds: HTMLElement;\n\tbackground: string;\n\tborder: string;\n\tborderRadius: string;\n\tboxShadow: string;\n}\n\nexport function captureCssSurface(\n\tbounds: HTMLElement,\n\tpaint: HTMLElement = bounds,\n\tpseudo?: string\n): CatalogSurfaceCapture {\n\tconst style = getComputedStyle(paint, pseudo);\n\treturn {\n\t\tbounds,\n\t\tbackground: style.background,\n\t\tborder: style.border,\n\t\tborderRadius: getComputedStyle(bounds).borderRadius,\n\t\tboxShadow: style.boxShadow\n\t};\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CatalogViewContext } from './catalogJourney.js';
|
|
2
|
+
/** Native anchor enhancement. No routing interception and no GPU state in the URL. */
|
|
3
|
+
export declare function catalogViewLink(node: HTMLAnchorElement, context?: CatalogViewContext): {
|
|
4
|
+
update: (value: CatalogViewContext) => void;
|
|
5
|
+
destroy(): void;
|
|
6
|
+
};
|
|
7
|
+
export declare function readCatalogViewContext(destination: URL): CatalogViewContext;
|
|
8
|
+
//# sourceMappingURL=catalogViewLink.d.ts.map
|
|
@@ -0,0 +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;AAE9D,sFAAsF;AACtF,wBAAgB,eAAe,CAAC,IAAI,EAAE,iBAAiB,EAAE,OAAO,GAAE,kBAAuB;oBACjE,kBAAkB;;EAazC;AAED,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,GAAG,GAAG,kBAAkB,CAkB3E"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** Native anchor enhancement. No routing interception and no GPU state in the URL. */
|
|
2
|
+
export function catalogViewLink(node, context = {}) {
|
|
3
|
+
const update = (value) => {
|
|
4
|
+
node.dataset.catalogView = JSON.stringify(value);
|
|
5
|
+
};
|
|
6
|
+
const activate = () => node.focus({ preventScroll: true });
|
|
7
|
+
update(context);
|
|
8
|
+
node.addEventListener('click', activate);
|
|
9
|
+
return {
|
|
10
|
+
update,
|
|
11
|
+
destroy() {
|
|
12
|
+
node.removeEventListener('click', activate);
|
|
13
|
+
delete node.dataset.catalogView;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export function readCatalogViewContext(destination) {
|
|
18
|
+
const link = document.activeElement?.closest('a[data-catalog-view]');
|
|
19
|
+
if (!link || link.href !== destination.href)
|
|
20
|
+
return {};
|
|
21
|
+
try {
|
|
22
|
+
const parsed = JSON.parse(link.dataset.catalogView ?? '{}');
|
|
23
|
+
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed))
|
|
24
|
+
return {};
|
|
25
|
+
return Object.fromEntries([
|
|
26
|
+
'spatialElementId',
|
|
27
|
+
'sourceSection',
|
|
28
|
+
'targetSection',
|
|
29
|
+
'sourceOccurrence',
|
|
30
|
+
'targetOccurrence'
|
|
31
|
+
].flatMap((key) => (typeof parsed[key] === 'string' ? [[key, parsed[key]]] : [])));
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return {};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=catalogViewLink.js.map
|
|
@@ -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,eAAe;YACf,eAAe;YACf,kBAAkB;YAClB,kBAAkB;SAClB,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CACjF,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,EAAE,CAAC;IACX,CAAC;AACF,CAAC","sourcesContent":["import type { CatalogViewContext } from './catalogJourney.js';\n\n/** Native anchor enhancement. No routing interception and no GPU state in the URL. */\nexport function catalogViewLink(node: HTMLAnchorElement, context: CatalogViewContext = {}) {\n\tconst update = (value: CatalogViewContext) => {\n\t\tnode.dataset.catalogView = JSON.stringify(value);\n\t};\n\tconst activate = () => node.focus({ preventScroll: true });\n\tupdate(context);\n\tnode.addEventListener('click', activate);\n\treturn {\n\t\tupdate,\n\t\tdestroy() {\n\t\t\tnode.removeEventListener('click', activate);\n\t\t\tdelete node.dataset.catalogView;\n\t\t}\n\t};\n}\n\nexport function readCatalogViewContext(destination: URL): CatalogViewContext {\n\tconst link = document.activeElement?.closest<HTMLAnchorElement>('a[data-catalog-view]');\n\tif (!link || link.href !== destination.href) return {};\n\ttry {\n\t\tconst parsed = JSON.parse(link.dataset.catalogView ?? '{}');\n\t\tif (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) return {};\n\t\treturn Object.fromEntries(\n\t\t\t[\n\t\t\t\t'spatialElementId',\n\t\t\t\t'sourceSection',\n\t\t\t\t'targetSection',\n\t\t\t\t'sourceOccurrence',\n\t\t\t\t'targetOccurrence'\n\t\t\t].flatMap((key) => (typeof parsed[key] === 'string' ? [[key, parsed[key]]] : []))\n\t\t);\n\t} catch {\n\t\treturn {};\n\t}\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rebasePresentation.d.ts","sourceRoot":"","sources":["../../src/catalog/rebasePresentation.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAuBpF"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** Retain a composite's actual CSS transforms while giving its successor a new motion origin. */
|
|
2
|
+
export function rebasePresentation(layers, from, role) {
|
|
3
|
+
const host = document.createElement('div');
|
|
4
|
+
host.dataset.catalogActorRole = role;
|
|
5
|
+
Object.assign(host.style, {
|
|
6
|
+
position: 'fixed',
|
|
7
|
+
left: `${from.left}px`,
|
|
8
|
+
top: `${from.top}px`,
|
|
9
|
+
width: `${from.width}px`,
|
|
10
|
+
height: `${from.height}px`,
|
|
11
|
+
transformOrigin: 'top left',
|
|
12
|
+
pointerEvents: 'none',
|
|
13
|
+
zIndex: role === 'summary-surface' ? '20' : '22',
|
|
14
|
+
willChange: 'transform, opacity'
|
|
15
|
+
});
|
|
16
|
+
for (const layer of layers) {
|
|
17
|
+
layer.style.left = `${Number.parseFloat(layer.style.left) - from.left}px`;
|
|
18
|
+
layer.style.top = `${Number.parseFloat(layer.style.top) - from.top}px`;
|
|
19
|
+
layer.style.position = 'absolute';
|
|
20
|
+
delete layer.dataset.catalogActorRole;
|
|
21
|
+
delete layer.dataset.catalogActorVariant;
|
|
22
|
+
host.appendChild(layer);
|
|
23
|
+
}
|
|
24
|
+
return host;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=rebasePresentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rebasePresentation.js","sourceRoot":"","sources":["../../src/catalog/rebasePresentation.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,MAAM,UAAU,kBAAkB,CAAC,MAAqB,EAAE,IAAa,EAAE,IAAY;IACpF,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC3C,IAAI,CAAC,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IACrC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE;QACzB,QAAQ,EAAE,OAAO;QACjB,IAAI,EAAE,GAAG,IAAI,CAAC,IAAI,IAAI;QACtB,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI;QACpB,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,IAAI;QACxB,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,IAAI;QAC1B,eAAe,EAAE,UAAU;QAC3B,aAAa,EAAE,MAAM;QACrB,MAAM,EAAE,IAAI,KAAK,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI;QAChD,UAAU,EAAE,oBAAoB;KAChC,CAAC,CAAC;IACH,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC5B,KAAK,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,IAAI,CAAC;QAC1E,KAAK,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;QACvE,KAAK,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU,CAAC;QAClC,OAAO,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC;QACtC,OAAO,KAAK,CAAC,OAAO,CAAC,mBAAmB,CAAC;QACzC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC","sourcesContent":["/** Retain a composite's actual CSS transforms while giving its successor a new motion origin. */\nexport function rebasePresentation(layers: HTMLElement[], from: DOMRect, role: string) {\n\tconst host = document.createElement('div');\n\thost.dataset.catalogActorRole = role;\n\tObject.assign(host.style, {\n\t\tposition: 'fixed',\n\t\tleft: `${from.left}px`,\n\t\ttop: `${from.top}px`,\n\t\twidth: `${from.width}px`,\n\t\theight: `${from.height}px`,\n\t\ttransformOrigin: 'top left',\n\t\tpointerEvents: 'none',\n\t\tzIndex: role === 'summary-surface' ? '20' : '22',\n\t\twillChange: 'transform, opacity'\n\t});\n\tfor (const layer of layers) {\n\t\tlayer.style.left = `${Number.parseFloat(layer.style.left) - from.left}px`;\n\t\tlayer.style.top = `${Number.parseFloat(layer.style.top) - from.top}px`;\n\t\tlayer.style.position = 'absolute';\n\t\tdelete layer.dataset.catalogActorRole;\n\t\tdelete layer.dataset.catalogActorVariant;\n\t\thost.appendChild(layer);\n\t}\n\treturn host;\n}\n"]}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { type SpatialElementLodPair } from './spatialElementLodPair.js';
|
|
2
|
+
import type { SpatialStageConfig } from '../spatial-element/types.js';
|
|
3
|
+
export type SpatialElementLod = 'low' | 'high';
|
|
4
|
+
export type SpatialElementVector3 = readonly [number, number, number];
|
|
5
|
+
/** Column-major matrix, acting on homogeneous column vectors. */
|
|
6
|
+
export type SpatialElementMatrix4 = readonly [
|
|
7
|
+
number,
|
|
8
|
+
number,
|
|
9
|
+
number,
|
|
10
|
+
number,
|
|
11
|
+
number,
|
|
12
|
+
number,
|
|
13
|
+
number,
|
|
14
|
+
number,
|
|
15
|
+
number,
|
|
16
|
+
number,
|
|
17
|
+
number,
|
|
18
|
+
number,
|
|
19
|
+
number,
|
|
20
|
+
number,
|
|
21
|
+
number,
|
|
22
|
+
number
|
|
23
|
+
];
|
|
24
|
+
export interface SpatialElementAssetRequirements {
|
|
25
|
+
decoders: readonly ('draco' | 'meshopt' | 'ktx2')[];
|
|
26
|
+
extensions: readonly string[];
|
|
27
|
+
}
|
|
28
|
+
export interface SpatialElementAssetLocation {
|
|
29
|
+
url: string;
|
|
30
|
+
format: 'glb' | 'gltf';
|
|
31
|
+
}
|
|
32
|
+
/** Immutable resource request; identity is independent of element and presentation role. */
|
|
33
|
+
export interface SpatialElementAssetResource extends SpatialElementAssetLocation {
|
|
34
|
+
revision: string;
|
|
35
|
+
requirements?: SpatialElementAssetRequirements;
|
|
36
|
+
}
|
|
37
|
+
export interface SpatialElementAssetCosts {
|
|
38
|
+
transferBytes: number;
|
|
39
|
+
triangleCount: number;
|
|
40
|
+
primitiveCount: number;
|
|
41
|
+
materialCount: number;
|
|
42
|
+
decodedGeometryBytes: number;
|
|
43
|
+
estimatedTextureBytes: number;
|
|
44
|
+
/** Documents assumptions used for decoded and estimated memory. */
|
|
45
|
+
method: string;
|
|
46
|
+
}
|
|
47
|
+
export interface SpatialElementProfileReference {
|
|
48
|
+
id: string;
|
|
49
|
+
revision: string;
|
|
50
|
+
}
|
|
51
|
+
export interface SpatialElementPoster {
|
|
52
|
+
src: string;
|
|
53
|
+
alt: string;
|
|
54
|
+
width: number;
|
|
55
|
+
height: number;
|
|
56
|
+
}
|
|
57
|
+
export interface SpatialElementAssetRepresentation {
|
|
58
|
+
representationId: string;
|
|
59
|
+
lod: SpatialElementLod;
|
|
60
|
+
assetRevision: string;
|
|
61
|
+
canonicalRevision: string;
|
|
62
|
+
resource: SpatialElementAssetLocation;
|
|
63
|
+
requirements: SpatialElementAssetRequirements;
|
|
64
|
+
assetToCanonical: SpatialElementMatrix4;
|
|
65
|
+
/** Null selects the entire authored scene; named roots must resolve uniquely. */
|
|
66
|
+
spatialElementRoot: string | null;
|
|
67
|
+
excludedMeshes: readonly string[];
|
|
68
|
+
/** Semantic material roles mapped to representation-specific material names. */
|
|
69
|
+
materialBindings: Readonly<Record<string, string>>;
|
|
70
|
+
costs: SpatialElementAssetCosts;
|
|
71
|
+
}
|
|
72
|
+
/** Verified contract: right-handed, +Y up, +Z front, meters, shared origin/pivot. */
|
|
73
|
+
export interface VerifiedSpatialElementAssetManifest {
|
|
74
|
+
physicalReference?: {
|
|
75
|
+
dimensionsMeters: SpatialElementVector3;
|
|
76
|
+
scope: string;
|
|
77
|
+
provenance: string;
|
|
78
|
+
measuredReferenceExtentsMeters: SpatialElementVector3;
|
|
79
|
+
relativeDeviation: SpatialElementVector3;
|
|
80
|
+
maximumRelativeDeviation: number;
|
|
81
|
+
};
|
|
82
|
+
schemaVersion: 1;
|
|
83
|
+
status: 'verified';
|
|
84
|
+
brandId: string;
|
|
85
|
+
spatialElementId: string;
|
|
86
|
+
canonicalRevision: string;
|
|
87
|
+
canonicalBounds: {
|
|
88
|
+
min: SpatialElementVector3;
|
|
89
|
+
max: SpatialElementVector3;
|
|
90
|
+
};
|
|
91
|
+
referencePose: SpatialElementProfileReference;
|
|
92
|
+
referenceTarget: SpatialElementVector3;
|
|
93
|
+
referenceView: SpatialElementProfileReference;
|
|
94
|
+
appearanceProfile: SpatialElementProfileReference;
|
|
95
|
+
poster: SpatialElementPoster;
|
|
96
|
+
representations: {
|
|
97
|
+
low: SpatialElementAssetRepresentation & {
|
|
98
|
+
lod: 'low';
|
|
99
|
+
};
|
|
100
|
+
high: (SpatialElementAssetRepresentation & {
|
|
101
|
+
lod: 'high';
|
|
102
|
+
}) | null;
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
export interface LegacySpatialElementAssetRepresentation {
|
|
106
|
+
representationId: 'legacy-preview';
|
|
107
|
+
lod: 'low';
|
|
108
|
+
assetRevision: string;
|
|
109
|
+
canonicalRevision: null;
|
|
110
|
+
resource: SpatialElementAssetLocation;
|
|
111
|
+
requirements: SpatialElementAssetRequirements;
|
|
112
|
+
assetToCanonical: null;
|
|
113
|
+
costs: null;
|
|
114
|
+
}
|
|
115
|
+
/** Temporary adapter, explicitly not a physically verified or decimated low asset. */
|
|
116
|
+
export interface LegacySpatialElementAssetManifest {
|
|
117
|
+
schemaVersion: 1;
|
|
118
|
+
status: 'legacy-unverified';
|
|
119
|
+
brandId: string;
|
|
120
|
+
spatialElementId: string;
|
|
121
|
+
canonicalRevision: null;
|
|
122
|
+
canonicalBounds: null;
|
|
123
|
+
poster: SpatialElementPoster | null;
|
|
124
|
+
metadataGaps: readonly string[];
|
|
125
|
+
stage: SpatialStageConfig;
|
|
126
|
+
representations: {
|
|
127
|
+
low: LegacySpatialElementAssetRepresentation;
|
|
128
|
+
high: null;
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
export interface ProvisionalSpatialElementAssetManifest {
|
|
132
|
+
schemaVersion: 1;
|
|
133
|
+
status: 'provisional-shared-frame';
|
|
134
|
+
brandId: string;
|
|
135
|
+
spatialElementId: string;
|
|
136
|
+
canonicalRevision: null;
|
|
137
|
+
pair: SpatialElementLodPair;
|
|
138
|
+
stage: SpatialStageConfig;
|
|
139
|
+
}
|
|
140
|
+
export type SpatialElementAssetManifest = VerifiedSpatialElementAssetManifest | LegacySpatialElementAssetManifest | ProvisionalSpatialElementAssetManifest;
|
|
141
|
+
export declare function createStageSpatialElementAssetManifest(brandId: string, spatialElementId: string, stage: SpatialStageConfig): SpatialElementAssetManifest;
|
|
142
|
+
export declare function getSpatialElementEntityKey(brandId: string, spatialElementId: string): string;
|
|
143
|
+
export declare function getRepresentationResource(representation: SpatialElementAssetRepresentation | LegacySpatialElementAssetRepresentation): SpatialElementAssetResource;
|
|
144
|
+
export declare function createLegacySpatialElementAssetManifest(brandId: string, spatialElementId: string, stage: SpatialStageConfig, poster?: SpatialElementPoster | null): LegacySpatialElementAssetManifest;
|
|
145
|
+
export interface SpatialElementEntity {
|
|
146
|
+
readonly key: string;
|
|
147
|
+
readonly brandId: string;
|
|
148
|
+
readonly spatialElementId: string;
|
|
149
|
+
manifest: SpatialElementAssetManifest | null;
|
|
150
|
+
}
|
|
151
|
+
/** Runtime-owned logical identities survive page and asset-instance replacement. */
|
|
152
|
+
export declare class SpatialElementEntityStore {
|
|
153
|
+
private readonly entities;
|
|
154
|
+
get(brandId: string, spatialElementId: string): SpatialElementEntity;
|
|
155
|
+
setManifest(manifest: SpatialElementAssetManifest): SpatialElementEntity;
|
|
156
|
+
clear(): void;
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=spatialElementAssets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spatialElementAssets.d.ts","sourceRoot":"","sources":["../../src/catalog/spatialElementAssets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,KAAK,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACtG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,MAAM,CAAC;AAC/C,MAAM,MAAM,qBAAqB,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AACtE,iEAAiE;AACjE,MAAM,MAAM,qBAAqB,GAAG,SAAS;IAC5C,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;CACN,CAAC;AAEF,MAAM,WAAW,+BAA+B;IAC/C,QAAQ,EAAE,SAAS,CAAC,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC,EAAE,CAAC;IACpD,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,2BAA2B;IAC3C,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,KAAK,GAAG,MAAM,CAAC;CACvB;AAED,4FAA4F;AAC5F,MAAM,WAAW,2BAA4B,SAAQ,2BAA2B;IAC/E,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,+BAA+B,CAAC;CAC/C;AAED,MAAM,WAAW,wBAAwB;IACxC,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAA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