@spatial-elements/core 1.0.0-beta.7 → 1.0.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/catalog/CarouselDeviceCamera.d.ts +8 -0
- package/dist/catalog/CarouselDeviceCamera.d.ts.map +1 -1
- package/dist/catalog/CarouselDeviceCamera.js +15 -1
- package/dist/catalog/CarouselDeviceCamera.js.map +1 -1
- package/dist/catalog/CarouselGlassCompositor.d.ts +8 -2
- package/dist/catalog/CarouselGlassCompositor.d.ts.map +1 -1
- package/dist/catalog/CarouselGlassCompositor.js +69 -12
- package/dist/catalog/CarouselGlassCompositor.js.map +1 -1
- package/dist/catalog/CarouselGround.d.ts +22 -1
- package/dist/catalog/CarouselGround.d.ts.map +1 -1
- package/dist/catalog/CarouselGround.js +185 -24
- package/dist/catalog/CarouselGround.js.map +1 -1
- package/dist/catalog/CatalogDepthBlur.d.ts +20 -1
- package/dist/catalog/CatalogDepthBlur.d.ts.map +1 -1
- package/dist/catalog/CatalogDepthBlur.js +126 -23
- package/dist/catalog/CatalogDepthBlur.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 +39 -7
- package/dist/catalog/CatalogGeometryFade.js.map +1 -1
- package/dist/catalog/CatalogModelOutline.d.ts +3 -1
- package/dist/catalog/CatalogModelOutline.d.ts.map +1 -1
- package/dist/catalog/CatalogModelOutline.js +11 -2
- package/dist/catalog/CatalogModelOutline.js.map +1 -1
- package/dist/catalog/CatalogPreparation.d.ts.map +1 -1
- package/dist/catalog/CatalogPreparation.js +8 -6
- package/dist/catalog/CatalogPreparation.js.map +1 -1
- package/dist/catalog/CatalogSpatialElementLayer.d.ts +129 -3
- package/dist/catalog/CatalogSpatialElementLayer.d.ts.map +1 -1
- package/dist/catalog/CatalogSpatialElementLayer.js +408 -33
- package/dist/catalog/CatalogSpatialElementLayer.js.map +1 -1
- package/dist/catalog/CatalogTransition.d.ts +4 -0
- package/dist/catalog/CatalogTransition.d.ts.map +1 -1
- package/dist/catalog/CatalogTransition.js +91 -22
- 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/SpatialPageRegistry.d.ts +1 -0
- package/dist/catalog/SpatialPageRegistry.d.ts.map +1 -1
- package/dist/catalog/SpatialPageRegistry.js.map +1 -1
- 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/cardProjection.d.ts +31 -0
- package/dist/catalog/cardProjection.d.ts.map +1 -1
- package/dist/catalog/cardProjection.js +63 -4
- package/dist/catalog/cardProjection.js.map +1 -1
- 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/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/catalogJourney.d.ts +2 -0
- package/dist/catalog/catalogJourney.d.ts.map +1 -1
- package/dist/catalog/catalogJourney.js.map +1 -1
- package/dist/catalog/catalogPose.d.ts +18 -0
- package/dist/catalog/catalogPose.d.ts.map +1 -1
- package/dist/catalog/catalogPose.js +26 -5
- package/dist/catalog/catalogPose.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/listDeviceOrientation.d.ts +2 -0
- package/dist/catalog/listDeviceOrientation.d.ts.map +1 -1
- package/dist/catalog/listDeviceOrientation.js +18 -1
- package/dist/catalog/listDeviceOrientation.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 +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -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 +24 -0
- package/dist/spatial-element/SectionSurfaceRegistry.d.ts.map +1 -0
- package/dist/spatial-element/SectionSurfaceRegistry.js +48 -0
- package/dist/spatial-element/SectionSurfaceRegistry.js.map +1 -0
- package/dist/spatial-element/SpatialElementDockController.d.ts +19 -9
- package/dist/spatial-element/SpatialElementDockController.d.ts.map +1 -1
- package/dist/spatial-element/SpatialElementDockController.js +189 -93
- 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 +245 -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 +53 -0
- package/dist/spatial-element/responsiveLayout.d.ts +1389 -0
- package/dist/spatial-element/responsiveLayout.d.ts.map +1 -0
- package/dist/spatial-element/responsiveLayout.js +265 -0
- package/dist/spatial-element/responsiveLayout.js.map +1 -0
- package/dist/spatial-element/sectionBackground.d.ts +29 -0
- package/dist/spatial-element/sectionBackground.d.ts.map +1 -0
- package/dist/spatial-element/sectionBackground.js +66 -0
- package/dist/spatial-element/sectionBackground.js.map +1 -0
- package/dist/spatial-element/spatialElement.d.ts +1 -0
- package/dist/spatial-element/spatialElement.d.ts.map +1 -1
- package/dist/spatial-element/spatialElement.js +1 -0
- 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/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/spatialTheme.d.ts +12 -1
- package/dist/spatial-element/spatialTheme.d.ts.map +1 -1
- package/dist/spatial-element/spatialTheme.js +30 -1
- package/dist/spatial-element/spatialTheme.js.map +1 -1
- package/dist/spatial-element/types.d.ts +50 -2
- 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/LiquidGlassPanel.d.ts +3 -0
- package/dist/stage/LiquidGlassPanel.d.ts.map +1 -1
- package/dist/stage/LiquidGlassPanel.js +27 -2
- package/dist/stage/LiquidGlassPanel.js.map +1 -1
- package/dist/stage/MinimapController.d.ts.map +1 -1
- package/dist/stage/MinimapController.js +28 -47
- package/dist/stage/MinimapController.js.map +1 -1
- package/dist/stage/PageBindingController.d.ts +4 -0
- package/dist/stage/PageBindingController.d.ts.map +1 -1
- package/dist/stage/PageBindingController.js +12 -4
- package/dist/stage/PageBindingController.js.map +1 -1
- package/dist/stage/PanelPresentationController.d.ts +17 -0
- package/dist/stage/PanelPresentationController.d.ts.map +1 -1
- package/dist/stage/PanelPresentationController.js +69 -13
- package/dist/stage/PanelPresentationController.js.map +1 -1
- package/dist/stage/SpatialElementInteractionController.d.ts +7 -0
- package/dist/stage/SpatialElementInteractionController.d.ts.map +1 -1
- package/dist/stage/SpatialElementInteractionController.js +9 -0
- 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 +167 -5
- package/dist/stage/StageExperience.d.ts.map +1 -1
- package/dist/stage/StageExperience.js +384 -58
- package/dist/stage/StageExperience.js.map +1 -1
- package/dist/stage/StageRenderPipeline.d.ts +76 -1
- package/dist/stage/StageRenderPipeline.d.ts.map +1 -1
- package/dist/stage/StageRenderPipeline.js +421 -46
- 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 +57 -4
- package/dist/stage/VirtualScrollController.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/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/panelContext.d.ts +7 -0
- package/dist/stage/panelContext.d.ts.map +1 -1
- package/dist/stage/panelContext.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/stageDom.d.ts.map +1 -1
- package/dist/stage/stageDom.js +6 -1
- package/dist/stage/stageDom.js.map +1 -1
- package/dist/stage/stageMath.d.ts +3 -3
- package/dist/stage/stageMath.d.ts.map +1 -1
- package/dist/stage/stageMath.js +11 -10
- package/dist/stage/stageMath.js.map +1 -1
- package/dist/stage/stageTypes.d.ts +7 -1
- package/dist/stage/stageTypes.d.ts.map +1 -1
- package/dist/stage/stageTypes.js.map +1 -1
- package/dist/stage/stageVisualTest.d.ts +19 -0
- package/dist/stage/stageVisualTest.d.ts.map +1 -1
- package/dist/stage/stageVisualTest.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spatialElementDock.js","sourceRoot":"","sources":["../../src/spatial-element/spatialElementDock.ts"],"names":[],"mappings":"AAQA,MAAM,8BAA8B,GAAG,GAAG,CAAC;AAC3C,MAAM,yCAAyC,GAAG,GAAG,CAAC;AACtD,MAAM,yCAAyC,GAAG,CAAC,CAAC;AACpD,MAAM,CAAC,MAAM,sCAAsC,GAAG,CAAC,CAAC;AAExD,0EAA0E;AAC1E,MAAM,UAAU,gCAAgC,CAC/C,aAAqB,EACrB,GAAG,GAAG,CAAC,EACP,MAAM,GAAG,EA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OAAO,OAAO,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACjD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACpE,CAAC;AAED,sFAAsF;AACtF,MAAM,UAAU,2BAA2B,CAC1C,OAAe,EACf,UAAkB,EAClB,eAAwB,EACxB,aAAa,GAAG,EAAE;IAElB,OAAO,eAAe;QACrB,CAAC,CAAC,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,UAAU,GAAG,aAAa,EAAE,CAAC,CAAC;QACpD,CAAC,CAAC,OAAO,IAAI,UAAU,CAAC;AAC1B,CAAC","sourcesContent":["/** A viewport-aligned rectangle expressed in CSS pixels. */\nexport interface SpatialElementDockRect {\n\tleft: number;\n\ttop: number;\n\twidth: number;\n\theight: number;\n}\n\nconst MAX_DOCKED_MINIMAP_MODEL_SCALE = 1.4;\nconst MIN_CONFIGURED_DOCKED_MINIMAP_MODEL_SCALE = 0.2;\nconst MAX_CONFIGURED_DOCKED_MINIMAP_MODEL_SCALE = 2;\nexport const SPATIAL_ELEMENT_TABS_DOCK_SEAM_OVERLAP = 1;\n\n/** Resolves the fixed spatial-element-header rectangle for a viewport. */\nexport function getSpatialElementDockDestination(\n\tviewportWidth: number,\n\ttop = 8,\n\theight = 86\n): SpatialElementDockRect {\n\tconst inset = 16;\n\treturn {\n\t\tleft: inset,\n\t\ttop,\n\t\twidth: Math.max(viewportWidth - inset * 2, 1),\n\t\theight\n\t};\n}\n\n/** Pins the unchanged minimap to the top edge of the viewport. */\nexport function getMinimapDockDestination(source: SpatialElementDockRect): SpatialElementDockRect {\n\treturn {\n\t\t...source,\n\t\ttop: 0\n\t};\n}\n\n/** Fits the docked minimap around a compact header without consuming most of its copy width. */\nexport function getCompactMinimapDockDestination(\n\tsource: SpatialElementDockRect,\n\theader: SpatialElementDockRect,\n\tviewportWidth: number,\n\tinset = 4\n): SpatialElementDockRect {\n\tconst safeInset = Math.max(inset, 0);\n\tconst size = Math.max(\n\t\tMath.min(source.width, header.height + 8, viewportWidth - safeInset * 2),\n\t\t1\n\t);\n\tconst minimumLeft = header.left + safeInset;\n\tconst maximumLeft = Math.max(header.left + header.width - size - safeInset, minimumLeft);\n\n\treturn {\n\t\tleft: Math.min(Math.max(source.left, minimumLeft), maximumLeft),\n\t\ttop: Math.max(header.top - (size - header.height) * 0.5, 0),\n\t\twidth: size,\n\t\theight: size\n\t};\n}\n\n/** Overlaps the subnavigation with the header edge to avoid a compositing seam between surfaces. */\nexport function getSpatialElementTabsDockDestination(\n\tsource: SpatialElementDockRect,\n\theader: SpatialElementDockRect,\n\tviewportWidth: number,\n\tinset = 8,\n\tseamOverlap = SPATIAL_ELEMENT_TABS_DOCK_SEAM_OVERLAP\n): SpatialElementDockRect {\n\tconst safeInset = Math.max(inset, 0);\n\tconst safeSeamOverlap = Number.isFinite(seamOverlap) ? Math.max(seamOverlap, 0) : 0;\n\tconst left = Math.min(\n\t\tMath.max(source.left, safeInset),\n\t\tMath.max(viewportWidth - safeInset, safeInset)\n\t);\n\tconst width = Math.max(Math.min(source.width, viewportWidth - left - safeInset), 1);\n\n\treturn {\n\t\tleft,\n\t\ttop: header.top + header.height - safeSeamOverlap,\n\t\twidth,\n\t\theight: Math.max(source.height, 1)\n\t};\n}\n\n/** Returns the exact visual-scroll point where the source tabs meet their dock destination. */\nexport function getSpatialElementTabsDockBreakpoint(sourceDocumentTop: number, dockTop: number) {\n\treturn Math.max(sourceDocumentTop - dockTop, 0);\n}\n\n/** Tabs only dock after the element header is available as their visible anchor. */\nexport function getSpatialElementTabsDockTarget(\n\tscrollY: number,\n\tbreakpoint: number,\n\theaderDocked: boolean,\n\tcurrentlyDocked = false,\n\treleaseOffset = 1\n) {\n\tif (!headerDocked) return false;\n\treturn currentlyDocked\n\t\t? scrollY >= Math.max(breakpoint - Math.max(releaseOffset, 0), 0)\n\t\t: scrollY >= breakpoint;\n}\n\n/** Morphs the dock shell over a short, reversible distance after the visual handoff. */\nexport function getSpatialElementTabsDockProgress(scrollY: number, breakpoint: number, distance = 24) {\n\tconst safeDistance = Number.isFinite(distance) ? Math.max(distance, 0) : 0;\n\tif (safeDistance === 0) return scrollY >= breakpoint ? 1 : 0;\n\treturn Math.min(Math.max((scrollY - breakpoint) / safeDistance, 0), 1);\n}\n\n/** Leaves a small reading gap below the complete docked header stack for anchor navigation. */\nexport function getSpatialElementSectionScrollOffset(tabs: SpatialElementDockRect, gap = 16) {\n\treturn Math.max(tabs.top + tabs.height + Math.max(gap, 0), 0);\n}\n\n/**\n * Makes the docked element overhang as deliberately as the minimap is taller than\n * the header, without requiring spatial-element-specific optical tuning.\n */\nexport function getDockedMinimapModelScale(\n\tminimap: SpatialElementDockRect,\n\theader: SpatialElementDockRect,\n\tconfiguredScale?: number\n) {\n\tif (configuredScale !== undefined && Number.isFinite(configuredScale)) {\n\t\treturn Math.min(\n\t\t\tMath.max(configuredScale, MIN_CONFIGURED_DOCKED_MINIMAP_MODEL_SCALE),\n\t\t\tMAX_CONFIGURED_DOCKED_MINIMAP_MODEL_SCALE\n\t\t);\n\t}\n\n\tconst minimapHeight = Number.isFinite(minimap.height) ? Math.max(minimap.height, 0) : 0;\n\tconst headerHeight = Number.isFinite(header.height) ? Math.max(header.height, 0) : 0;\n\tif (minimapHeight === 0 || headerHeight === 0) return 1;\n\n\treturn Math.min(Math.max(minimapHeight / headerHeight, 1), MAX_DOCKED_MINIMAP_MODEL_SCALE);\n}\n\n/** Reserves the scaled model's potential right-side overhang before header copy. */\nexport function getDockedMinimapCopyReserve(\n\tminimap: SpatialElementDockRect,\n\theader: SpatialElementDockRect,\n\tmodelScale: number,\n\tgap = 16\n) {\n\tconst safeScale = Number.isFinite(modelScale) ? Math.max(modelScale, 1) : 1;\n\tconst modelOverflow = Math.max(minimap.width, 0) * (safeScale - 1) * 0.5;\n\treturn Math.max(minimap.left + minimap.width + modelOverflow + gap - header.left, 0);\n}\n\n/** Covers the complete scaled model overhang with a viewport-aligned interaction target. */\nexport function getDockedMinimapInteractionRect(\n\tminimap: SpatialElementDockRect,\n\theader: SpatialElementDockRect,\n\tmodelScale: number\n): SpatialElementDockRect {\n\tconst safeScale = Number.isFinite(modelScale) ? Math.max(modelScale, 1) : 1;\n\tconst width = Math.max(minimap.width, 1) * safeScale;\n\tconst height = Math.max(minimap.height, 1) * safeScale;\n\n\treturn {\n\t\tleft: minimap.left - (width - minimap.width) * 0.5,\n\t\ttop: header.top,\n\t\twidth,\n\t\theight\n\t};\n}\n\n/** Returns the scroll position where the minimap naturally reaches its fixed position. */\nexport function getSpatialElementDockBreakpoint(minimapDocumentTop: number, minimapDockTop: number) {\n\treturn Math.max(minimapDocumentTop - minimapDockTop, 0);\n}\n\n/**\n * Maps page scroll directly to the minimap/header handoff. The transition starts\n * at the top of the page and completes when the source minimap has fully left the viewport.\n */\nexport function getSpatialElementDockPresentationProgress(\n\tscrollY: number,\n\tminimapDocumentBottom: number,\n\tstartScrollY = 0\n) {\n\tconst start = Number.isFinite(startScrollY) ? Math.max(startScrollY, 0) : 0;\n\tconst end = Number.isFinite(minimapDocumentBottom)\n\t\t? Math.max(minimapDocumentBottom, start)\n\t\t: start;\n\tif (end === start) return scrollY >= end ? 1 : 0;\n\treturn Math.min(Math.max((scrollY - start) / (end - start), 0), 1);\n}\n\n/** Adds a small release hysteresis so trackpad momentum cannot flicker the header. */\nexport function getSpatialElementDockTarget(\n\tscrollY: number,\n\tbreakpoint: number,\n\tcurrentlyDocked: boolean,\n\treleaseOffset = 16\n) {\n\treturn currentlyDocked\n\t\t? scrollY >= Math.max(breakpoint - releaseOffset, 0)\n\t\t: scrollY >= breakpoint;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"spatialElementDock.js","sourceRoot":"","sources":["../../src/spatial-element/spatialElementDock.ts"],"names":[],"m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AC,CAAC;AACzD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,yCAAyC,CACxD,OAAe,EACf,qBAA6B,EAC7B,YAAY,GAAG,CAAC;IAEhB,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5E,MAAM,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC,qBAAqB,CAAC;QACjD,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,qBAAqB,EAAE,KAAK,CAAC;QACxC,CAAC,CAAC,KAAK,CAAC;IACT,IAAI,GAAG,KAAK,KAAK;QAAE,OAAO,OAAO,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACjD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACpE,CAAC;AAED,sFAAsF;AACtF,MAAM,UAAU,2BAA2B,CAC1C,OAAe,EACf,UAAkB,EAClB,eAAwB,EACxB,aAAa,GAAG,EAAE;IAElB,OAAO,eAAe;QACrB,CAAC,CAAC,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,UAAU,GAAG,aAAa,EAAE,CAAC,CAAC;QACpD,CAAC,CAAC,OAAO,IAAI,UAAU,CAAC;AAC1B,CAAC;AACD,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAA8B,MAAM,uBAAuB,CAAC","sourcesContent":["/** A viewport-aligned rectangle expressed in CSS pixels. */\nexport interface SpatialElementDockRect {\n\tleft: number;\n\ttop: number;\n\twidth: number;\n\theight: number;\n}\n\nconst MAX_DOCKED_MINIMAP_MODEL_SCALE = 1.4;\nconst MIN_CONFIGURED_DOCKED_MINIMAP_MODEL_SCALE = 0.2;\nconst MAX_CONFIGURED_DOCKED_MINIMAP_MODEL_SCALE = 2;\nexport const SPATIAL_ELEMENT_TABS_DOCK_SEAM_OVERLAP = 1;\n\n/** Shared endpoint geometry. Intrinsic submenu width is bounded, never stretched. */\nexport function resolveSpatialElementDockLayout(input: ResponsiveLayoutInput, submenuWidth = 0) {\n\tconst detail = resolveDetailLayout(input);\n\tif (!detail.dock) return undefined;\n\tconst asRect = ({ x, y, width, height }: { x: number; y: number; width: number; height: number }): SpatialElementDockRect =>\n\t\t({ left: x, top: y, width, height });\n\tconst header = asRect(detail.dock.surface);\n\tconst minimap = asRect(detail.dock.minimap);\n\tconst submenu = detail.submenu && {\n\t\tleft: detail.submenu.x,\n\t\ttop: header.top + header.height,\n\t\twidth: Math.min(Math.max(Number.isFinite(submenuWidth) ? submenuWidth : 0, 0), detail.submenu.maxWidth),\n\t\theight: detail.submenu.height\n\t};\n\tconst gap = submenu ? spatialLayoutTokens.hero[detail.layout].submenuAfterGap : 8;\n\treturn {\n\t\tlayout: detail.layout, header, minimap, submenu,\n\t\ttitleReserve: detail.dock.titleLeft - header.left,\n\t\tsectionOffset: header.top + header.height + (submenu?.height ?? 0) + gap\n\t};\n}\n\n/** Resolves the fixed spatial-element-header rectangle for a viewport. */\nexport function getSpatialElementDockDestination(\n\tviewportWidth: number,\n\ttop = 8,\n\theight = 86\n): SpatialElementDockRect {\n\tconst inset = 16;\n\treturn {\n\t\tleft: inset,\n\t\ttop,\n\t\twidth: Math.max(viewportWidth - inset * 2, 1),\n\t\theight\n\t};\n}\n\n/** Pins the unchanged minimap to the top edge of the viewport. */\nexport function getMinimapDockDestination(source: SpatialElementDockRect): SpatialElementDockRect {\n\treturn {\n\t\t...source,\n\t\ttop: 0\n\t};\n}\n\n/** Fits the docked minimap around a compact header without consuming most of its copy width. */\nexport function getCompactMinimapDockDestination(\n\tsource: SpatialElementDockRect,\n\theader: SpatialElementDockRect,\n\tviewportWidth: number,\n\tinset = 4\n): SpatialElementDockRect {\n\tconst safeInset = Math.max(inset, 0);\n\tconst size = Math.max(\n\t\tMath.min(source.width, header.height + 8, viewportWidth - safeInset * 2),\n\t\t1\n\t);\n\tconst minimumLeft = header.left + safeInset;\n\tconst maximumLeft = Math.max(header.left + header.width - size - safeInset, minimumLeft);\n\n\treturn {\n\t\tleft: Math.min(Math.max(source.left, minimumLeft), maximumLeft),\n\t\ttop: Math.max(header.top - (size - header.height) * 0.5, 0),\n\t\twidth: size,\n\t\theight: size\n\t};\n}\n\n/** Overlaps the subnavigation with the header edge to avoid a compositing seam between surfaces. */\nexport function getSpatialElementTabsDockDestination(\n\tsource: SpatialElementDockRect,\n\theader: SpatialElementDockRect,\n\tviewportWidth: number,\n\tinset = 8,\n\tseamOverlap = SPATIAL_ELEMENT_TABS_DOCK_SEAM_OVERLAP\n): SpatialElementDockRect {\n\tconst safeInset = Math.max(inset, 0);\n\tconst safeSeamOverlap = Number.isFinite(seamOverlap) ? Math.max(seamOverlap, 0) : 0;\n\tconst left = Math.min(\n\t\tMath.max(source.left, safeInset),\n\t\tMath.max(viewportWidth - safeInset, safeInset)\n\t);\n\tconst width = Math.max(Math.min(source.width, viewportWidth - left - safeInset), 1);\n\n\treturn {\n\t\tleft,\n\t\ttop: header.top + header.height - safeSeamOverlap,\n\t\twidth,\n\t\theight: Math.max(source.height, 1)\n\t};\n}\n\n/** Returns the exact visual-scroll point where the source tabs meet their dock destination. */\nexport function getSpatialElementTabsDockBreakpoint(sourceDocumentTop: number, dockTop: number) {\n\treturn Math.max(sourceDocumentTop - dockTop, 0);\n}\n\n/** Tabs only dock after the element header is available as their visible anchor. */\nexport function getSpatialElementTabsDockTarget(\n\tscrollY: number,\n\tbreakpoint: number,\n\theaderDocked: boolean,\n\tcurrentlyDocked = false,\n\treleaseOffset = 1\n) {\n\tif (!headerDocked) return false;\n\treturn currentlyDocked\n\t\t? scrollY >= Math.max(breakpoint - Math.max(releaseOffset, 0), 0)\n\t\t: scrollY >= breakpoint;\n}\n\n/** Morphs the dock shell over a short, reversible distance after the visual handoff. */\nexport function getSpatialElementTabsDockProgress(scrollY: number, breakpoint: number, distance = 24) {\n\tconst safeDistance = Number.isFinite(distance) ? Math.max(distance, 0) : 0;\n\tif (safeDistance === 0) return scrollY >= breakpoint ? 1 : 0;\n\treturn Math.min(Math.max((scrollY - breakpoint) / safeDistance, 0), 1);\n}\n\n/** Leaves a small reading gap below the complete docked header stack for anchor navigation. */\nexport function getSpatialElementSectionScrollOffset(tabs: SpatialElementDockRect, gap = 16) {\n\treturn Math.max(tabs.top + tabs.height + Math.max(gap, 0), 0);\n}\n\n/**\n * Makes the docked element overhang as deliberately as the minimap is taller than\n * the header, without requiring spatial-element-specific optical tuning.\n */\nexport function getDockedMinimapModelScale(\n\tminimap: SpatialElementDockRect,\n\theader: SpatialElementDockRect,\n\tconfiguredScale?: number\n) {\n\tif (configuredScale !== undefined && Number.isFinite(configuredScale)) {\n\t\treturn Math.min(\n\t\t\tMath.max(configuredScale, MIN_CONFIGURED_DOCKED_MINIMAP_MODEL_SCALE),\n\t\t\tMAX_CONFIGURED_DOCKED_MINIMAP_MODEL_SCALE\n\t\t);\n\t}\n\n\tconst minimapHeight = Number.isFinite(minimap.height) ? Math.max(minimap.height, 0) : 0;\n\tconst headerHeight = Number.isFinite(header.height) ? Math.max(header.height, 0) : 0;\n\tif (minimapHeight === 0 || headerHeight === 0) return 1;\n\n\treturn Math.min(Math.max(minimapHeight / headerHeight, 1), MAX_DOCKED_MINIMAP_MODEL_SCALE);\n}\n\n/** Reserves the scaled model's potential right-side overhang before header copy. */\nexport function getDockedMinimapCopyReserve(\n\tminimap: SpatialElementDockRect,\n\theader: SpatialElementDockRect,\n\tmodelScale: number,\n\tgap = 16\n) {\n\tconst safeScale = Number.isFinite(modelScale) ? Math.max(modelScale, 1) : 1;\n\tconst modelOverflow = Math.max(minimap.width, 0) * (safeScale - 1) * 0.5;\n\treturn Math.max(minimap.left + minimap.width + modelOverflow + gap - header.left, 0);\n}\n\n/** Covers the complete scaled model overhang with a viewport-aligned interaction target. */\nexport function getDockedMinimapInteractionRect(\n\tminimap: SpatialElementDockRect,\n\theader: SpatialElementDockRect,\n\tmodelScale: number\n): SpatialElementDockRect {\n\tconst safeScale = Number.isFinite(modelScale) ? Math.max(modelScale, 1) : 1;\n\tconst width = Math.max(minimap.width, 1) * safeScale;\n\tconst height = Math.max(minimap.height, 1) * safeScale;\n\n\treturn {\n\t\tleft: minimap.left - (width - minimap.width) * 0.5,\n\t\ttop: header.top,\n\t\twidth,\n\t\theight\n\t};\n}\n\n/** Returns the scroll position where the minimap naturally reaches its fixed position. */\nexport function getSpatialElementDockBreakpoint(minimapDocumentTop: number, minimapDockTop: number) {\n\treturn Math.max(minimapDocumentTop - minimapDockTop, 0);\n}\n\n/**\n * Maps page scroll directly to the minimap/header handoff. The transition starts\n * at the top of the page and completes when the source minimap has fully left the viewport.\n */\nexport function getSpatialElementDockPresentationProgress(\n\tscrollY: number,\n\tminimapDocumentBottom: number,\n\tstartScrollY = 0\n) {\n\tconst start = Number.isFinite(startScrollY) ? Math.max(startScrollY, 0) : 0;\n\tconst end = Number.isFinite(minimapDocumentBottom)\n\t\t? Math.max(minimapDocumentBottom, start)\n\t\t: start;\n\tif (end === start) return scrollY >= end ? 1 : 0;\n\treturn Math.min(Math.max((scrollY - start) / (end - start), 0), 1);\n}\n\n/** Adds a small release hysteresis so trackpad momentum cannot flicker the header. */\nexport function getSpatialElementDockTarget(\n\tscrollY: number,\n\tbreakpoint: number,\n\tcurrentlyDocked: boolean,\n\treleaseOffset = 16\n) {\n\treturn currentlyDocked\n\t\t? scrollY >= Math.max(breakpoint - releaseOffset, 0)\n\t\t: scrollY >= breakpoint;\n}\nimport { resolveDetailLayout, spatialLayoutTokens, type ResponsiveLayoutInput } from './responsiveLayout.js';\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { SpatialElementMediaItem } from './types.js';
|
|
2
|
+
/** First selectable view is always the model. Keep supplied data immutable. */
|
|
3
|
+
export declare function resolveSpatialElementMedia(items?: readonly SpatialElementMediaItem[]): SpatialElementMediaItem[];
|
|
4
|
+
/** A fixed origin and validated ID prevent a player entry from becoming arbitrary iframe HTML. */
|
|
5
|
+
export declare function spatialYoutubeEmbedUrl(videoId: string): string | undefined;
|
|
6
|
+
/** Controls and player frames own their input before any free-space gesture policy. */
|
|
7
|
+
export declare function resolveDetailGestureOwner(options: {
|
|
8
|
+
media: SpatialElementMediaItem['kind'];
|
|
9
|
+
split: boolean;
|
|
10
|
+
paneHidden: boolean;
|
|
11
|
+
clientX: number;
|
|
12
|
+
paneLeft: number;
|
|
13
|
+
uiTarget: boolean;
|
|
14
|
+
modelHit: boolean;
|
|
15
|
+
}): 'ui' | 'model' | 'document';
|
|
16
|
+
//# sourceMappingURL=spatialElementMedia.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spatialElementMedia.d.ts","sourceRoot":"","sources":["../../src/spatial-element/spatialElementMedia.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAE1D,+EAA+E;AAC/E,wBAAgB,0BAA0B,CAAC,KAAK,GAAE,SAAS,uBAAuB,EAAO,GAAG,uBAAuB,EAAE,CAOpH;AAED,kGAAkG;AAClG,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,sBAIrD;AAED,uFAAuF;AACvF,wBAAgB,yBAAyB,CAAC,OAAO,EAAE;IAClD,KAAK,EAAE,uBAAuB,CAAC,MAAM,CAAC,CAAC;IACvC,KAAK,EAAE,OAAO,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;CAClB,GAAG,IAAI,GAAG,OAAO,GAAG,UAAU,CAM9B"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** First selectable view is always the model. Keep supplied data immutable. */
|
|
2
|
+
export function resolveSpatialElementMedia(items = []) {
|
|
3
|
+
const minimap = items.find(item => item.kind === 'minimap');
|
|
4
|
+
const ids = new Set(items.map(item => item.id));
|
|
5
|
+
let modelId = 'model';
|
|
6
|
+
while (!minimap && ids.has(modelId))
|
|
7
|
+
modelId = `_${modelId}`;
|
|
8
|
+
return [minimap ?? { id: modelId, kind: 'minimap', label: '3D view' },
|
|
9
|
+
...items.filter(item => item.kind !== 'minimap')];
|
|
10
|
+
}
|
|
11
|
+
/** A fixed origin and validated ID prevent a player entry from becoming arbitrary iframe HTML. */
|
|
12
|
+
export function spatialYoutubeEmbedUrl(videoId) {
|
|
13
|
+
return /^[A-Za-z0-9_-]{11}$/.test(videoId)
|
|
14
|
+
? `https://www.youtube-nocookie.com/embed/${videoId}?autoplay=0&rel=0`
|
|
15
|
+
: undefined;
|
|
16
|
+
}
|
|
17
|
+
/** Controls and player frames own their input before any free-space gesture policy. */
|
|
18
|
+
export function resolveDetailGestureOwner(options) {
|
|
19
|
+
if (options.uiTarget)
|
|
20
|
+
return 'ui';
|
|
21
|
+
if (options.media !== 'minimap')
|
|
22
|
+
return 'document';
|
|
23
|
+
if (options.paneHidden)
|
|
24
|
+
return 'model';
|
|
25
|
+
if (options.split)
|
|
26
|
+
return options.clientX < options.paneLeft ? 'model' : 'document';
|
|
27
|
+
return options.modelHit ? 'model' : 'document';
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=spatialElementMedia.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spatialElementMedia.js","sourceRoot":"","sources":["../../src/spatial-element/spatialElementMedia.ts"],"names":[],"mappings":"AAEA,+EAA+E;AAC/E,MAAM,UAAU,0BAA0B,CAAC,QAA4C,EAAE;IACxF,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,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able view is always the model. Keep supplied data immutable. */\nexport function resolveSpatialElementMedia(items: readonly SpatialElementMediaItem[] = []): SpatialElementMediaItem[] {\n\tconst minimap = items.find(item => item.kind === 'minimap');\n\tconst ids = new Set(items.map(item => item.id));\n\tlet modelId = 'model';\n\twhile (!minimap && ids.has(modelId)) modelId = `_${modelId}`;\n\treturn [minimap ?? { id: modelId, kind: 'minimap', label: '3D view' },\n\t\t...items.filter(item => item.kind !== 'minimap')];\n}\n\n/** A fixed origin and validated ID prevent a player entry from becoming arbitrary iframe HTML. */\nexport function spatialYoutubeEmbedUrl(videoId: string) {\n\treturn /^[A-Za-z0-9_-]{11}$/.test(videoId)\n\t\t? `https://www.youtube-nocookie.com/embed/${videoId}?autoplay=0&rel=0`\n\t\t: undefined;\n}\n\n/** Controls and player frames own their input before any free-space gesture policy. */\nexport function resolveDetailGestureOwner(options: {\n\tmedia: SpatialElementMediaItem['kind'];\n\tsplit: boolean;\n\tpaneHidden: boolean;\n\tclientX: number;\n\tpaneLeft: number;\n\tuiTarget: boolean;\n\tmodelHit: boolean;\n}): 'ui' | 'model' | 'document' {\n\tif (options.uiTarget) return 'ui';\n\tif (options.media !== 'minimap') return 'document';\n\tif (options.paneHidden) return 'model';\n\tif (options.split) return options.clientX < options.paneLeft ? 'model' : 'document';\n\treturn options.modelHit ? 'model' : 'document';\n}\n"]}
|
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
import type { SpatialTheme } from './types.js';
|
|
1
|
+
import type { SpatialSectionBackgrounds, SpatialTheme, SpatialThemeRadii } from './types.js';
|
|
2
|
+
/** Works for both factory inputs and older complete themes without split radius roles. */
|
|
3
|
+
export declare function resolveSpatialThemeRadii(theme: {
|
|
4
|
+
panelShape?: {
|
|
5
|
+
radius?: number;
|
|
6
|
+
};
|
|
7
|
+
radii?: Partial<SpatialThemeRadii>;
|
|
8
|
+
}): SpatialThemeRadii;
|
|
9
|
+
/** Resolve missing new roles without changing the legacy section material or source object. */
|
|
10
|
+
export declare function resolveSpatialSectionBackgrounds(theme: {
|
|
11
|
+
sectionBackgrounds?: Partial<SpatialSectionBackgrounds>;
|
|
12
|
+
}): SpatialSectionBackgrounds;
|
|
2
13
|
/** Input for createSpatialTheme. Every appearance group merges with the library defaults. */
|
|
3
14
|
export type SpatialThemeOptions = Pick<SpatialTheme, 'id' | 'name'> & {
|
|
4
15
|
/** Flat page color, independent of each element's HDR background. Default: #eef1f4. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spatialTheme.d.ts","sourceRoot":"","sources":["../../src/spatial-element/spatialTheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"spatialTheme.d.ts","sourceRoot":"","sources":["../../src/spatial-element/spatialTheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAW7F,0FAA0F;AAC1F,wBAAgB,wBAAwB,CAAC,KAAK,EAAE;IAC/C,UAAU,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACjC,KAAK,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;CACnC,GAAG,iBAAiB,CAMpB;AAED,+FAA+F;AAC/F,wBAAgB,gCAAgC,CAAC,KAAK,EAAE;IACvD,kBAAkB,CAAC,EAAE,OAAO,CAAC,yBAAyB,CAAC,CAAC;CACxD,GAAG,yBAAyB,CAO5B;AAED,6FAA6F;AAC7F,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,YAAY,EAAE,IAAI,GAAG,MAAM,CAAC,GAAG;IACrE,uFAAuF;IACvF,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG;KAAG,CAAC,IAAI,OAAO,CAAC,MAAM,YAAY,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AAEpG;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,GAAG,YAAY,CAoD7E"}
|
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
const defaultSectionBackgrounds = {
|
|
2
|
+
standard: '#ffffff',
|
|
3
|
+
muted: '#f5f7f9'
|
|
4
|
+
};
|
|
5
|
+
function nonNegativeFinite(value, fallback) {
|
|
6
|
+
return typeof value === 'number' && Number.isFinite(value) ? Math.max(0, value) : fallback;
|
|
7
|
+
}
|
|
8
|
+
/** Works for both factory inputs and older complete themes without split radius roles. */
|
|
9
|
+
export function resolveSpatialThemeRadii(theme) {
|
|
10
|
+
const legacy = theme.panelShape?.radius;
|
|
11
|
+
return {
|
|
12
|
+
control: nonNegativeFinite(theme.radii?.control, nonNegativeFinite(legacy, 12)),
|
|
13
|
+
panel: nonNegativeFinite(theme.radii?.panel, nonNegativeFinite(legacy, 16))
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/** Resolve missing new roles without changing the legacy section material or source object. */
|
|
17
|
+
export function resolveSpatialSectionBackgrounds(theme) {
|
|
18
|
+
const color = (value, fallback) => typeof value === 'string' && value.trim() ? value.trim() : fallback;
|
|
19
|
+
return {
|
|
20
|
+
standard: color(theme.sectionBackgrounds?.standard, defaultSectionBackgrounds.standard),
|
|
21
|
+
muted: color(theme.sectionBackgrounds?.muted, defaultSectionBackgrounds.muted)
|
|
22
|
+
};
|
|
23
|
+
}
|
|
1
24
|
/**
|
|
2
25
|
* Creates a complete theme from a brand identity and optional appearance overrides.
|
|
3
26
|
* Nested groups merge field-by-field; returned objects are independent between calls.
|
|
@@ -9,6 +32,8 @@ export function createSpatialTheme(options) {
|
|
|
9
32
|
id: options.id,
|
|
10
33
|
name: options.name,
|
|
11
34
|
background: options.background ?? '#eef1f4',
|
|
35
|
+
radii: resolveSpatialThemeRadii(options),
|
|
36
|
+
sectionBackgrounds: resolveSpatialSectionBackgrounds(options),
|
|
12
37
|
...(options.sceneBackground ? { sceneBackground: { ...options.sceneBackground } } : {}),
|
|
13
38
|
minimapTheme: {
|
|
14
39
|
expandedHeight: 240,
|
|
@@ -23,7 +48,11 @@ export function createSpatialTheme(options) {
|
|
|
23
48
|
outlineColor: options.colors?.accent ?? '#285c89',
|
|
24
49
|
...options.interactionTheme
|
|
25
50
|
},
|
|
26
|
-
panelShape: {
|
|
51
|
+
panelShape: {
|
|
52
|
+
...options.panelShape,
|
|
53
|
+
radius: nonNegativeFinite(options.panelShape?.radius, 16),
|
|
54
|
+
contentInset: nonNegativeFinite(options.panelShape?.contentInset, 26)
|
|
55
|
+
},
|
|
27
56
|
panelTheme: {
|
|
28
57
|
surface: 'frosted',
|
|
29
58
|
tint: '#ffffff',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spatialTheme.js","sourceRoot":"","sources":["../../src/spatial-element/spatialTheme.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"spatialTheme.js","sourceRoot":"","sources":["../../src/spatial-element/spatialTheme.ts"],"names":[],"mappings":"AAEA,MAAM,yBAAyB,GAA8B;IAC5D,QAAQ,EAAE,SAAS;IACnB,KAAK,EAAE,SAAS;CAChB,CAAC;AAEF,SAAS,iBAAiB,CAAC,KAAyB,EAAE,QAAgB;IACrE,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;AAC5F,CAAC;AAED,0FAA0F;AAC1F,MAAM,UAAU,wBAAwB,CAAC,KAGxC;IACA,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,EAAE,MAAM,CAAC;IACxC,OAAO;QACN,OAAO,EAAE,iBAAiB,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,iBA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EAAE,OAAO,CAAC,MAAM,EAAE,MAAM,IAAI,SAAS;YAClD,GAAG,OAAO,CAAC,YAAY;SACvB;QACD,gBAAgB,EAAE;YACjB,YAAY,EAAE,OAAO,CAAC,MAAM,EAAE,MAAM,IAAI,SAAS;YACjD,GAAG,OAAO,CAAC,gBAAgB;SAC3B;QACD,UAAU,EAAE;YACX,GAAG,OAAO,CAAC,UAAU;YACrB,MAAM,EAAE,iBAAiB,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,CAAC;YACzD,YAAY,EAAE,iBAAiB,CAAC,OAAO,CAAC,UAAU,EAAE,YAAY,EAAE,EAAE,CAAC;SACrE;QACD,UAAU,EAAE;YACX,OAAO,EAAE,SAAS;YAClB,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,IAAI;YACjB,YAAY,EAAE,CAAC;YACf,eAAe,EAAE,GAAG;YACpB,OAAO,EAAE,CAAC;YACV,GAAG,OAAO,CAAC,UAAU;SACrB;QACD,gBAAgB,EAAE;YACjB,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,IAAI;YACjB,YAAY,EAAE,CAAC;YACf,eAAe,EAAE,GAAG;YACpB,GAAG,OAAO,CAAC,gBAAgB;SAC3B;QACD,YAAY,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC,EAAE,GAAG,OAAO,CAAC,YAAY,EAAE;QAC7F,MAAM,EAAE;YACP,GAAG,EAAE,SAAS;YACd,IAAI,EAAE,SAAS;YACf,MAAM,EAAE,SAAS;YACjB,QAAQ,EAAE,SAAS;YACnB,aAAa,EAAE,SAAS;YACxB,GAAG,OAAO,CAAC,MAAM;SACjB;KACD,CAAC;AACH,CAAC","sourcesContent":["import type { SpatialSectionBackgrounds, SpatialTheme, SpatialThemeRadii } from './types.js';\n\nconst defaultSectionBackgrounds: SpatialSectionBackgrounds = {\n\tstandard: '#ffffff',\n\tmuted: '#f5f7f9'\n};\n\nfunction nonNegativeFinite(value: number | undefined, fallback: number) {\n\treturn typeof value === 'number' && Number.isFinite(value) ? Math.max(0, value) : fallback;\n}\n\n/** Works for both factory inputs and older complete themes without split radius roles. */\nexport function resolveSpatialThemeRadii(theme: {\n\tpanelShape?: { radius?: number };\n\tradii?: Partial<SpatialThemeRadii>;\n}): SpatialThemeRadii {\n\tconst legacy = theme.panelShape?.radius;\n\treturn {\n\t\tcontrol: nonNegativeFinite(theme.radii?.control, nonNegativeFinite(legacy, 12)),\n\t\tpanel: nonNegativeFinite(theme.radii?.panel, nonNegativeFinite(legacy, 16))\n\t};\n}\n\n/** Resolve missing new roles without changing the legacy section material or source object. */\nexport function resolveSpatialSectionBackgrounds(theme: {\n\tsectionBackgrounds?: Partial<SpatialSectionBackgrounds>;\n}): SpatialSectionBackgrounds {\n\tconst color = (value: string | undefined, fallback: string) =>\n\t\ttypeof value === 'string' && value.trim() ? value.trim() : fallback;\n\treturn {\n\t\tstandard: color(theme.sectionBackgrounds?.standard, defaultSectionBackgrounds.standard),\n\t\tmuted: color(theme.sectionBackgrounds?.muted, defaultSectionBackgrounds.muted)\n\t};\n}\n\n/** Input for createSpatialTheme. Every appearance group merges with the library defaults. */\nexport type SpatialThemeOptions = Pick<SpatialTheme, 'id' | 'name'> & {\n\t/** Flat page color, independent of each element's HDR background. Default: #eef1f4. */\n\tbackground?: string;\n} & { [K in Exclude<keyof SpatialTheme, 'id' | 'name' | 'background'>]?: Partial<SpatialTheme[K]> };\n\n/**\n * Creates a complete theme from a brand identity and optional appearance overrides.\n * Nested groups merge field-by-field; returned objects are independent between calls.\n * @example\n * const theme = createSpatialTheme({ id: 'shop', name: 'My shop', colors: { accent: '#285c89' } });\n */\nexport function createSpatialTheme(options: SpatialThemeOptions): SpatialTheme {\n\treturn {\n\t\tid: options.id,\n\t\tname: options.name,\n\t\tbackground: options.background ?? '#eef1f4',\n\t\tradii: resolveSpatialThemeRadii(options),\n\t\tsectionBackgrounds: resolveSpatialSectionBackgrounds(options),\n\t\t...(options.sceneBackground ? { sceneBackground: { ...options.sceneBackground } } : {}),\n\t\tminimapTheme: {\n\t\t\texpandedHeight: 240,\n\t\t\toverlayColor: '#000000',\n\t\t\toverlayOpacity: 0.35,\n\t\t\toverlayBlur: 5,\n\t\t\tcontextOpacity: 0,\n\t\t\tviewportColor: options.colors?.accent ?? '#285c89',\n\t\t\t...options.minimapTheme\n\t\t},\n\t\tinteractionTheme: {\n\t\t\toutlineColor: options.colors?.accent ?? '#285c89',\n\t\t\t...options.interactionTheme\n\t\t},\n\t\tpanelShape: {\n\t\t\t...options.panelShape,\n\t\t\tradius: nonNegativeFinite(options.panelShape?.radius, 16),\n\t\t\tcontentInset: nonNegativeFinite(options.panelShape?.contentInset, 26)\n\t\t},\n\t\tpanelTheme: {\n\t\t\tsurface: 'frosted',\n\t\t\ttint: '#ffffff',\n\t\t\ttintOpacity: 0.65,\n\t\t\tbackdropBlur: 8,\n\t\t\tshadowIntensity: 0.2,\n\t\t\topacity: 1,\n\t\t\t...options.panelTheme\n\t\t},\n\t\tdockedPanelTheme: {\n\t\t\ttint: '#ffffff',\n\t\t\ttintOpacity: 0.92,\n\t\t\tbackdropBlur: 5,\n\t\t\tshadowIntensity: 0.2,\n\t\t\t...options.dockedPanelTheme\n\t\t},\n\t\tsectionTheme: { tint: '#ffffff', tintOpacity: 0.8, backdropBlur: 8, ...options.sectionTheme },\n\t\tcolors: {\n\t\t\tink: '#173047',\n\t\t\tbody: '#263c4d',\n\t\t\taccent: '#285c89',\n\t\t\tonAccent: '#ffffff',\n\t\t\ttabBackground: '#e4ebf1',\n\t\t\t...options.colors\n\t\t}\n\t};\n}\n"]}
|
|
@@ -7,7 +7,7 @@ import type { StagePanelMinimapOptions, StagePanelShape, StagePanelTheme } from
|
|
|
7
7
|
* Includes the element's assets automatically; pass these items to ListSection or CarouselSection.
|
|
8
8
|
* Detail-only media and breadcrumbs are omitted. No catalog data belongs in the layout.
|
|
9
9
|
*/
|
|
10
|
-
export interface SpatialListItem extends Partial<Pick<SpatialElementData, 'geometry' | 'hdr' | 'background' | 'model' | 'camera' | 'assetManifest' | 'fallbackImage' | 'fallbackImageSize'>> {
|
|
10
|
+
export interface SpatialListItem extends Partial<Pick<SpatialElementData, 'geometry' | 'hdr' | 'background' | 'model' | 'camera' | 'minimap' | 'assetManifest' | 'fallbackImage' | 'fallbackImageSize'>> {
|
|
11
11
|
/** @internal Runtime-only pose provider installed by a section, never serialized in route data. */
|
|
12
12
|
pose?: import('../catalog/catalogPose.js').CatalogPoseProvider;
|
|
13
13
|
/** Optional full summary projection, sourced from the same document as the DETAIL. */
|
|
@@ -18,6 +18,8 @@ export interface SpatialListItem extends Partial<Pick<SpatialElementData, 'geome
|
|
|
18
18
|
sectionLink?: {
|
|
19
19
|
href: string;
|
|
20
20
|
label: string;
|
|
21
|
+
/** Assert that this anchor opens the fully docked content view (3XL: pane header). */
|
|
22
|
+
targetPresentation?: 'dock';
|
|
21
23
|
};
|
|
22
24
|
};
|
|
23
25
|
/** Stable optional key when the same element occurs twice within a section. */
|
|
@@ -28,6 +30,8 @@ export interface SpatialListItem extends Partial<Pick<SpatialElementData, 'geome
|
|
|
28
30
|
id: string;
|
|
29
31
|
/** Ordinary link to the detail page. */
|
|
30
32
|
href: string;
|
|
33
|
+
/** Optional assertion for a fragment link opening fully docked detail content (3XL: pane header). */
|
|
34
|
+
targetPresentation?: 'dock';
|
|
31
35
|
/** Short label above the title; the helper supplies an empty string when omitted. */
|
|
32
36
|
eyebrow: string;
|
|
33
37
|
/** Visible card title. */
|
|
@@ -43,6 +47,16 @@ export interface SpatialSectionTheme {
|
|
|
43
47
|
/** CSS backdrop blur radius in pixels. */
|
|
44
48
|
backdropBlur: number;
|
|
45
49
|
}
|
|
50
|
+
/** CSS-pixel radii for the two layout surface roles. */
|
|
51
|
+
export interface SpatialThemeRadii {
|
|
52
|
+
control: number;
|
|
53
|
+
panel: number;
|
|
54
|
+
}
|
|
55
|
+
/** Opaque section colors, independent of the flat page color and glass materials. */
|
|
56
|
+
export interface SpatialSectionBackgrounds {
|
|
57
|
+
standard: string;
|
|
58
|
+
muted: string;
|
|
59
|
+
}
|
|
46
60
|
/** CSS material used only by the fixed element header and its docked subnavigation. */
|
|
47
61
|
export interface SpatialDockedPanelTheme {
|
|
48
62
|
/** Gaussian CSS backdrop blur radius in pixels. */
|
|
@@ -64,6 +78,10 @@ export interface SpatialTheme {
|
|
|
64
78
|
name: string;
|
|
65
79
|
/** Opaque CSS/Three.js color behind content and the independently revealed HDR stage. */
|
|
66
80
|
background: string;
|
|
81
|
+
/** Optional for hand-authored legacy themes; createSpatialTheme resolves both roles. */
|
|
82
|
+
radii?: SpatialThemeRadii;
|
|
83
|
+
/** Optional for hand-authored legacy themes; createSpatialTheme supplies both colors. */
|
|
84
|
+
sectionBackgrounds?: SpatialSectionBackgrounds;
|
|
67
85
|
/** Shared minimap appearance; element-specific framing belongs in SpatialElementData.minimap. */
|
|
68
86
|
minimapTheme: SpatialMinimapTheme;
|
|
69
87
|
/** Hover/selection outline appearance. */
|
|
@@ -109,7 +127,9 @@ export type SpatialElementMediaItem = {
|
|
|
109
127
|
id: string;
|
|
110
128
|
kind: 'minimap';
|
|
111
129
|
label: string;
|
|
112
|
-
}
|
|
130
|
+
}
|
|
131
|
+
/** @deprecated A drawing needs a real source. Use kind: 'image' instead. */
|
|
132
|
+
| {
|
|
113
133
|
id: string;
|
|
114
134
|
kind: 'drawing';
|
|
115
135
|
label: string;
|
|
@@ -119,6 +139,25 @@ export type SpatialElementMediaItem = {
|
|
|
119
139
|
label: string;
|
|
120
140
|
src: string;
|
|
121
141
|
alt: string;
|
|
142
|
+
} | {
|
|
143
|
+
id: string;
|
|
144
|
+
kind: 'video';
|
|
145
|
+
label: string;
|
|
146
|
+
src: string;
|
|
147
|
+
poster?: string;
|
|
148
|
+
/** Optional WebVTT caption tracks. Native controls remain available. */
|
|
149
|
+
captions?: {
|
|
150
|
+
src: string;
|
|
151
|
+
language: string;
|
|
152
|
+
label: string;
|
|
153
|
+
default?: boolean;
|
|
154
|
+
}[];
|
|
155
|
+
} | {
|
|
156
|
+
id: string;
|
|
157
|
+
kind: 'youtube';
|
|
158
|
+
label: string;
|
|
159
|
+
videoId: string;
|
|
160
|
+
poster?: string;
|
|
122
161
|
};
|
|
123
162
|
/** Optional CSS presentation for a regular HTML element section. */
|
|
124
163
|
export interface SpatialElementSectionStyle {
|
|
@@ -132,10 +171,19 @@ export interface SpatialElementSectionStyle {
|
|
|
132
171
|
/** CSS max-width such as `920px`, `72rem`, or `100%`. */
|
|
133
172
|
width?: string;
|
|
134
173
|
}
|
|
174
|
+
export type SectionBackgroundColor = 'transparent' | 'standard' | 'muted' | 'transparentToStandard' | 'transparentToMuted' | 'standardToTransparent' | 'standardToMuted' | 'mutedToTransparent' | 'mutedToStandard';
|
|
175
|
+
export interface SectionBackground {
|
|
176
|
+
color: SectionBackgroundColor;
|
|
177
|
+
size?: 'standard' | 'full';
|
|
178
|
+
}
|
|
135
179
|
/** Metadata supplied to a composable spatial-element `Section`. */
|
|
136
180
|
export interface SpatialElementSectionDefinition {
|
|
137
181
|
id: string;
|
|
138
182
|
title: string;
|
|
183
|
+
/** Optional visible heading, separate from the navigation/accessibility title. */
|
|
184
|
+
headline?: string;
|
|
185
|
+
/** Semantic section background; legacy style remains available during migration. */
|
|
186
|
+
background?: SectionBackground;
|
|
139
187
|
style?: SpatialElementSectionStyle;
|
|
140
188
|
}
|
|
141
189
|
/** Minimal section metadata consumed by generated element navigation. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/spatial-element/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,oCAAoC,CAAC;AAC9F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,KAAK,EACX,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EACX,wBAAwB,EACxB,eAAe,EACf,eAAe,EACf,MAAM,0BAA0B,CAAC;AAElC;;;;GAIG;AACH,MAAM,WAAW,eAAgB,SAAQ,OAAO,CAC/C,IAAI,CACH,kBAAkB,EAChB,UAAU,GACV,KAAK,GACL,YAAY,GACZ,OAAO,GACP,QAAQ,GACR,eAAe,GACf,eAAe,GACf,mBAAmB,CACrB,CACD;IACA,mGAAmG;IACnG,IAAI,CAAC,EAAE,OAAO,2BAA2B,EAAE,mBAAmB,CAAC;IAC/D,sFAAsF;IACtF,OAAO,CAAC,EAAE;QACT,QAAQ,EAAE,qBAAqB,EAAE,CAAC;QAClC,MAAM,CAAC,EAAE,oBAAoB,CAAC;QAC9B,qEAAqE;QACrE,WAAW,CAAC,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/spatial-element/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,oCAAoC,CAAC;AAC9F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,KAAK,EACX,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EACX,wBAAwB,EACxB,eAAe,EACf,eAAe,EACf,MAAM,0BAA0B,CAAC;AAElC;;;;GAIG;AACH,MAAM,WAAW,eAAgB,SAAQ,OAAO,CAC/C,IAAI,CACH,kBAAkB,EAChB,UAAU,GACV,KAAK,GACL,YAAY,GACZ,OAAO,GACP,QAAQ,GACR,SAAS,GACT,eAAe,GACf,eAAe,GACf,mBAAmB,CACrB,CACD;IACA,mGAAmG;IACnG,IAAI,CAAC,EAAE,OAAO,2BAA2B,EAAE,mBAAmB,CAAC;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,kGAAkG;IAClG,GAAG,EAAE,MAAM,CAAC;IACZ,oGAAoG;IACpG,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,gGAAgG;IAChG,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,4FAA4F;IAC5F,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,iFAAiF;IACjF,aAAa,CAAC,EAAE,mCAAmC,CAAC;IACpD,8FAA8F;IAC9F,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qFAAqF;IACrF,iBAAiB,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,wFAAwF;IACxF,WAAW,CAAC,EAAE,wBAAwB,EAAE,CAAC;IACzC,+FAA+F;IAC/F,KAAK,CAAC,EAAE,uBAAuB,EAAE,CAAC;IAClC,kFAAkF;IAClF,OAAO,CAAC,EAAE,IAAI,CAAC,wBAAwB,EAAE,MAAM,mBAAmB,CAAC,CAAC;CACpE;AAED,6FAA6F;AAC7F,MAAM,MAAM,mBAAmB,GAAG,IAAI,CACrC,wBAAwB,EACtB,gBAAgB,GAChB,cAAc,GACd,gBAAgB,GAChB,aAAa,GACb,cAAc,GACd,gBAAgB,GAChB,eAAe,CACjB,CAAC;AAEF,8DAA8D;AAC9D,MAAM,WAAW,eAAe;IAC/B,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,wBAAwB,EAAE,CAAC;CACzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/spatial-element/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { VerifiedSpatialElementAssetManifest } from '../catalog/spatialElementAssets.js';\nimport type { SpatialElementGeometry } from './spatialElementGeometry.js';\nimport type {\n\tBackgroundSettings,\n\tStageCameraSettings,\n\tStageInteractionTheme,\n\tStageModelSettings\n} from '../stage/stageTypes.js';\nimport type {\n\tStagePanelMinimapOptions,\n\tStagePanelShape,\n\tStagePanelTheme\n} from '../stage/panelContext.js';\n\n/**\n * Category-card projection created by {@link getSpatialListItems}.\n * Includes the element's assets automatically; pass these items to ListSection or CarouselSection.\n * Detail-only media and breadcrumbs are omitted. No catalog data belongs in the layout.\n */\nexport interface SpatialListItem extends Partial<\n\tPick<\n\t\tSpatialElementData,\n\t\t| 'geometry'\n\t\t| 'hdr'\n\t\t| 'background'\n\t\t| 'model'\n\t\t| 'camera'\n\t\t| 'assetManifest'\n\t\t| 'fallbackImage'\n\t\t| 'fallbackImageSize'\n\t>\n> {\n\t/** @internal Runtime-only pose provider installed by a section, never serialized in route data. */\n\tpose?: import('../catalog/catalogPose.js').CatalogPoseProvider;\n\t/** Optional full summary projection, sourced from the same document as the DETAIL. */\n\tsummary?: {\n\t\tfeatures: SpatialElementFeature[];\n\t\taction?: SpatialElementAction;\n\t\t/** Optional authored link to an existing element content section. */\n\t\tsectionLink?: { href: string; label: string };\n\t};\n\t/** Stable optional key when the same element occurs twice within a section. */\n\titemKey?: string;\n\t/** @internal Presentation identity assigned by a section; assets retain element identity. */\n\toccurrence?: string;\n\t/** Stable element identity, shared with the detail document. */\n\tid: string;\n\t/** Ordinary link to the detail page. */\n\thref: string;\n\t/** Short label above the title; the helper supplies an empty string when omitted. */\n\teyebrow: string;\n\t/** Visible card title. */\n\ttitle: string;\n\t/** Plain-text feature labels for compact card presentation. */\n\tfeatures: string[];\n}\n\n/** Shared CSS-glass controls for regular element sections. */\nexport interface SpatialSectionTheme {\n\ttint: string;\n\t/** Direct tint opacity from zero to one. */\n\ttintOpacity: number;\n\t/** CSS backdrop blur radius in pixels. */\n\tbackdropBlur: number;\n}\n\n/** CSS material used only by the fixed element header and its docked subnavigation. */\nexport interface SpatialDockedPanelTheme {\n\t/** Gaussian CSS backdrop blur radius in pixels. */\n\tbackdropBlur: number;\n\t/** Surface tint, using the same color representation as a stage panel. */\n\ttint: NonNullable<StagePanelTheme['tint']>;\n\t/** Direct tint opacity from zero to one. */\n\ttintOpacity: number;\n\t/** Normalized shadow intensity from zero to one. */\n\tshadowIntensity: number;\n}\n\n/** Shared visual language supplied by a brand layout to element pages beneath it. */\nexport interface SpatialTheme {\n\t/** Optional presentation overrides for the element's HDR backdrop; lighting is unchanged. */\n\tsceneBackground?: Partial<BackgroundSettings>;\n\t/** Stable namespace shared by pages and transitions, e.g. `shop`. Not an element ID. */\n\tid: string;\n\t/** Human-readable brand name used in accessible labels. */\n\tname: string;\n\t/** Opaque CSS/Three.js color behind content and the independently revealed HDR stage. */\n\tbackground: string;\n\t/** Shared minimap appearance; element-specific framing belongs in SpatialElementData.minimap. */\n\tminimapTheme: SpatialMinimapTheme;\n\t/** Hover/selection outline appearance. */\n\tinteractionTheme: Partial<StageInteractionTheme>;\n\t/** Panel corner radius and content padding, in CSS pixels. */\n\tpanelShape: StagePanelShape;\n\t/** Default panel material. `frosted` uses CSS blur; `glass` also uses GPU refraction. */\n\tpanelTheme: StagePanelTheme;\n\t/** Appearance of the compact header and tabs shown after scrolling past the hero. */\n\tdockedPanelTheme: SpatialDockedPanelTheme;\n\t/** Appearance of ordinary HTML content sections. */\n\tsectionTheme: SpatialSectionTheme;\n\t/** Semantic text, action and navigation colors. */\n\tcolors: {\n\t\tink: string;\n\t\tbody: string;\n\t\taccent: string;\n\t\tonAccent: string;\n\t\ttabBackground: string;\n\t};\n}\n\n/** A single line in the spatial-element-summary feature list. */\nexport interface SpatialElementFeature {\n\tlabel: string;\n\t/** Optional short marker displayed before the feature text. */\n\tmarker?: string;\n}\n\n/** Primary conversion action displayed in the element summary panel. */\nexport interface SpatialElementAction {\n\tlabel: string;\n\t/** Stable behavior identity for shared presentation; never supplies an event handler. */\n\tsemanticId?: string;\n\thref?: string;\n\tariaLabel?: string;\n}\n\n/** A breadcrumb link or terminal breadcrumb label. */\nexport interface SpatialElementBreadcrumb {\n\tlabel: string;\n\thref?: string;\n}\n\n/** Media entries rendered in the element rail. */\nexport type SpatialElementMediaItem =\n\t| { id: string; kind: 'minimap'; label: string }\n\t| { id: string; kind: 'drawing'; label: string }\n\t| { id: string; kind: 'image'; label: string; src: string; alt: string };\n\n/** Optional CSS presentation for a regular HTML element section. */\nexport interface SpatialElementSectionStyle {\n\t/** Overrides the brand section tint. */\n\ttint?: string;\n\t/** Overrides the brand section tint opacity from zero to one. */\n\ttintOpacity?: number;\n\t/** Overrides the brand section backdrop blur radius in pixels. */\n\tbackdropBlur?: number;\n\ttextColor?: string;\n\t/** CSS max-width such as `920px`, `72rem`, or `100%`. */\n\twidth?: string;\n}\n\n/** Metadata supplied to a composable spatial-element `Section`. */\nexport interface SpatialElementSectionDefinition {\n\tid: string;\n\ttitle: string;\n\tstyle?: SpatialElementSectionStyle;\n}\n\n/** Minimal section metadata consumed by generated element navigation. */\nexport type SpatialElementSectionNavigationItem = Pick<\n\tSpatialElementSectionDefinition,\n\t'id' | 'title'\n>;\n\n/**\n * Serializable element content AND its 3D presentation. Supply the same source data to\n * getSpatialListItems on a category page and SpatialElementPage on the detail page.\n * Only id, title, geometry and hdr are required. Layout-wide appearance belongs in SpatialTheme.\n */\nexport interface SpatialElementData {\n\t/** Stable element identity within the shell's theme namespace; also used by findSpatialElement. */\n\tid: string;\n\t/** Optional identity assertion. When supplied, must match the enclosing theme.id. */\n\tbrandId?: string;\n\t/** Document title. Defaults to title. */\n\tpageTitle?: string;\n\t/** Short category/series label displayed above the title. Defaults to an empty string. */\n\teyebrow?: string;\n\t/** Visible element name. */\n\ttitle: string;\n\t/** Summary bullets. Defaults to an empty list. */\n\tfeatures?: SpatialElementFeature[];\n\t/** Optional primary action; omitted actions render no button. */\n\taction?: SpatialElementAction;\n\t/** Required Low/High model sources. Identical URLs share one load; both exports must share coordinates. */\n\tgeometry: SpatialElementGeometry;\n\t/** Detail lighting and background HDR. Category lighting is explicitly set on ContentPage.hdr. */\n\thdr: string;\n\t/** HDR background blur/tint. Does not change the theme's flat page background or model lighting. */\n\tbackground?: BackgroundSettings;\n\t/** Imported model pose, excluded meshes and material replacements. Rotations are in radians. */\n\tmodel?: StageModelSettings;\n\t/** Initial orbit in degrees and optional fit controls. Distance is fitted automatically. */\n\tcamera?: StageCameraSettings;\n\t/** Advanced verified resource manifest. Omit for the normal GLB/LOD workflow. */\n\tassetManifest?: VerifiedSpatialElementAssetManifest;\n\t/** Poster URL displayed during loading, without JavaScript, or when WebGPU is unavailable. */\n\tfallbackImage?: string;\n\t/** Actual poster pixel dimensions [width, height], not physical model dimensions. */\n\tfallbackImageSize?: readonly [number, number];\n\t/** Navigation trail. Entries without href are plain text; defaults to an empty list. */\n\tbreadcrumbs?: SpatialElementBreadcrumb[];\n\t/** Media rail entries. Defaults to one interactive 3D minimap; [] hides the rail's entries. */\n\tmedia?: SpatialElementMediaItem[];\n\t/** Element-specific minimap fit/hover/docked pose. Colors come from the theme. */\n\tminimap?: Omit<StagePanelMinimapOptions, keyof SpatialMinimapTheme>;\n}\n\n/** Brand-wide minimap appearance; framing and model pose remain spatial-element-specific. */\nexport type SpatialMinimapTheme = Pick<\n\tStagePanelMinimapOptions,\n\t| 'expandedHeight'\n\t| 'overlayColor'\n\t| 'overlayOpacity'\n\t| 'overlayBlur'\n\t| 'contextColor'\n\t| 'contextOpacity'\n\t| 'viewportColor'\n>;\n\n/** Category/content page metadata; only title is required. */\nexport interface ContentPageData {\n\t/** Browser document title; defaults to title. */\n\tpageTitle?: string;\n\ttitle: string;\n\teyebrow?: string;\n\tintro?: string;\n\tbreadcrumbs?: SpatialElementBreadcrumb[];\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/spatial-element/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { VerifiedSpatialElementAssetManifest } from '../catalog/spatialElementAssets.js';\nimport type { SpatialElementGeometry } from './spatialElementGeometry.js';\nimport type {\n\tBackgroundSettings,\n\tStageCameraSettings,\n\tStageInteractionTheme,\n\tStageModelSettings\n} from '../stage/stageTypes.js';\nimport type {\n\tStagePanelMinimapOptions,\n\tStagePanelShape,\n\tStagePanelTheme\n} from '../stage/panelContext.js';\n\n/**\n * Category-card projection created by {@link getSpatialListItems}.\n * Includes the element's assets automatically; pass these items to ListSection or CarouselSection.\n * Detail-only media and breadcrumbs are omitted. No catalog data belongs in the layout.\n */\nexport interface SpatialListItem extends Partial<\n\tPick<\n\t\tSpatialElementData,\n\t\t| 'geometry'\n\t\t| 'hdr'\n\t\t| 'background'\n\t\t| 'model'\n\t\t| 'camera'\n\t\t| 'minimap'\n\t\t| 'assetManifest'\n\t\t| 'fallbackImage'\n\t\t| 'fallbackImageSize'\n\t>\n> {\n\t/** @internal Runtime-only pose provider installed by a section, never serialized in route data. */\n\tpose?: import('../catalog/catalogPose.js').CatalogPoseProvider;\n\t/** Optional full summary projection, sourced from the same document as the DETAIL. */\n\tsummary?: {\n\t\tfeatures: SpatialElementFeature[];\n\t\taction?: SpatialElementAction;\n\t\t/** Optional authored link to an existing element content section. */\n\t\tsectionLink?: { href: string; label: string;\n\t\t\t/** Assert that this anchor opens the fully docked content view (3XL: pane header). */\n\t\t\ttargetPresentation?: 'dock' };\n\t};\n\t/** Stable optional key when the same element occurs twice within a section. */\n\titemKey?: string;\n\t/** @internal Presentation identity assigned by a section; assets retain element identity. */\n\toccurrence?: string;\n\t/** Stable element identity, shared with the detail document. */\n\tid: string;\n\t/** Ordinary link to the detail page. */\n\thref: string;\n\t/** Optional assertion for a fragment link opening fully docked detail content (3XL: pane header). */\n\ttargetPresentation?: 'dock';\n\t/** Short label above the title; the helper supplies an empty string when omitted. */\n\teyebrow: string;\n\t/** Visible card title. */\n\ttitle: string;\n\t/** Plain-text feature labels for compact card presentation. */\n\tfeatures: string[];\n}\n\n/** Shared CSS-glass controls for regular element sections. */\nexport interface SpatialSectionTheme {\n\ttint: string;\n\t/** Direct tint opacity from zero to one. */\n\ttintOpacity: number;\n\t/** CSS backdrop blur radius in pixels. */\n\tbackdropBlur: number;\n}\n\n/** CSS-pixel radii for the two layout surface roles. */\nexport interface SpatialThemeRadii {\n\tcontrol: number;\n\tpanel: number;\n}\n\n/** Opaque section colors, independent of the flat page color and glass materials. */\nexport interface SpatialSectionBackgrounds {\n\tstandard: string;\n\tmuted: string;\n}\n\n/** CSS material used only by the fixed element header and its docked subnavigation. */\nexport interface SpatialDockedPanelTheme {\n\t/** Gaussian CSS backdrop blur radius in pixels. */\n\tbackdropBlur: number;\n\t/** Surface tint, using the same color representation as a stage panel. */\n\ttint: NonNullable<StagePanelTheme['tint']>;\n\t/** Direct tint opacity from zero to one. */\n\ttintOpacity: number;\n\t/** Normalized shadow intensity from zero to one. */\n\tshadowIntensity: number;\n}\n\n/** Shared visual language supplied by a brand layout to element pages beneath it. */\nexport interface SpatialTheme {\n\t/** Optional presentation overrides for the element's HDR backdrop; lighting is unchanged. */\n\tsceneBackground?: Partial<BackgroundSettings>;\n\t/** Stable namespace shared by pages and transitions, e.g. `shop`. Not an element ID. */\n\tid: string;\n\t/** Human-readable brand name used in accessible labels. */\n\tname: string;\n\t/** Opaque CSS/Three.js color behind content and the independently revealed HDR stage. */\n\tbackground: string;\n\t/** Optional for hand-authored legacy themes; createSpatialTheme resolves both roles. */\n\tradii?: SpatialThemeRadii;\n\t/** Optional for hand-authored legacy themes; createSpatialTheme supplies both colors. */\n\tsectionBackgrounds?: SpatialSectionBackgrounds;\n\t/** Shared minimap appearance; element-specific framing belongs in SpatialElementData.minimap. */\n\tminimapTheme: SpatialMinimapTheme;\n\t/** Hover/selection outline appearance. */\n\tinteractionTheme: Partial<StageInteractionTheme>;\n\t/** Panel corner radius and content padding, in CSS pixels. */\n\tpanelShape: StagePanelShape;\n\t/** Default panel material. `frosted` uses CSS blur; `glass` also uses GPU refraction. */\n\tpanelTheme: StagePanelTheme;\n\t/** Appearance of the compact header and tabs shown after scrolling past the hero. */\n\tdockedPanelTheme: SpatialDockedPanelTheme;\n\t/** Appearance of ordinary HTML content sections. */\n\tsectionTheme: SpatialSectionTheme;\n\t/** Semantic text, action and navigation colors. */\n\tcolors: {\n\t\tink: string;\n\t\tbody: string;\n\t\taccent: string;\n\t\tonAccent: string;\n\t\ttabBackground: string;\n\t};\n}\n\n/** A single line in the spatial-element-summary feature list. */\nexport interface SpatialElementFeature {\n\tlabel: string;\n\t/** Optional short marker displayed before the feature text. */\n\tmarker?: string;\n}\n\n/** Primary conversion action displayed in the element summary panel. */\nexport interface SpatialElementAction {\n\tlabel: string;\n\t/** Stable behavior identity for shared presentation; never supplies an event handler. */\n\tsemanticId?: string;\n\thref?: string;\n\tariaLabel?: string;\n}\n\n/** A breadcrumb link or terminal breadcrumb label. */\nexport interface SpatialElementBreadcrumb {\n\tlabel: string;\n\thref?: string;\n}\n\n/** Media entries rendered in the element rail. */\nexport type SpatialElementMediaItem =\n\t| { id: string; kind: 'minimap'; label: string }\n\t/** @deprecated A drawing needs a real source. Use kind: 'image' instead. */\n\t| { id: string; kind: 'drawing'; label: string }\n\t| { id: string; kind: 'image'; label: string; src: string; alt: string }\n\t| {\n\t\tid: string; kind: 'video'; label: string; src: string; poster?: string;\n\t\t/** Optional WebVTT caption tracks. Native controls remain available. */\n\t\tcaptions?: { src: string; language: string; label: string; default?: boolean }[];\n\t}\n\t| { id: string; kind: 'youtube'; label: string; videoId: string; poster?: string };\n\n/** Optional CSS presentation for a regular HTML element section. */\nexport interface SpatialElementSectionStyle {\n\t/** Overrides the brand section tint. */\n\ttint?: string;\n\t/** Overrides the brand section tint opacity from zero to one. */\n\ttintOpacity?: number;\n\t/** Overrides the brand section backdrop blur radius in pixels. */\n\tbackdropBlur?: number;\n\ttextColor?: string;\n\t/** CSS max-width such as `920px`, `72rem`, or `100%`. */\n\twidth?: string;\n}\n\nexport type SectionBackgroundColor =\n\t| 'transparent' | 'standard' | 'muted'\n\t| 'transparentToStandard' | 'transparentToMuted'\n\t| 'standardToTransparent' | 'standardToMuted'\n\t| 'mutedToTransparent' | 'mutedToStandard';\n\nexport interface SectionBackground {\n\tcolor: SectionBackgroundColor;\n\tsize?: 'standard' | 'full';\n}\n\n/** Metadata supplied to a composable spatial-element `Section`. */\nexport interface SpatialElementSectionDefinition {\n\tid: string;\n\ttitle: string;\n\t/** Optional visible heading, separate from the navigation/accessibility title. */\n\theadline?: string;\n\t/** Semantic section background; legacy style remains available during migration. */\n\tbackground?: SectionBackground;\n\tstyle?: SpatialElementSectionStyle;\n}\n\n/** Minimal section metadata consumed by generated element navigation. */\nexport type SpatialElementSectionNavigationItem = Pick<\n\tSpatialElementSectionDefinition,\n\t'id' | 'title'\n>;\n\n/**\n * Serializable element content AND its 3D presentation. Supply the same source data to\n * getSpatialListItems on a category page and SpatialElementPage on the detail page.\n * Only id, title, geometry and hdr are required. Layout-wide appearance belongs in SpatialTheme.\n */\nexport interface SpatialElementData {\n\t/** Stable element identity within the shell's theme namespace; also used by findSpatialElement. */\n\tid: string;\n\t/** Optional identity assertion. When supplied, must match the enclosing theme.id. */\n\tbrandId?: string;\n\t/** Document title. Defaults to title. */\n\tpageTitle?: string;\n\t/** Short category/series label displayed above the title. Defaults to an empty string. */\n\teyebrow?: string;\n\t/** Visible element name. */\n\ttitle: string;\n\t/** Summary bullets. Defaults to an empty list. */\n\tfeatures?: SpatialElementFeature[];\n\t/** Optional primary action; omitted actions render no button. */\n\taction?: SpatialElementAction;\n\t/** Required Low/High model sources. Identical URLs share one load; both exports must share coordinates. */\n\tgeometry: SpatialElementGeometry;\n\t/** Detail lighting and background HDR. Category lighting is explicitly set on ContentPage.hdr. */\n\thdr: string;\n\t/** HDR background blur/tint. Does not change the theme's flat page background or model lighting. */\n\tbackground?: BackgroundSettings;\n\t/** Imported model pose, excluded meshes and material replacements. Rotations are in radians. */\n\tmodel?: StageModelSettings;\n\t/** Initial orbit in degrees and optional fit controls. Distance is fitted automatically. */\n\tcamera?: StageCameraSettings;\n\t/** Advanced verified resource manifest. Omit for the normal GLB/LOD workflow. */\n\tassetManifest?: VerifiedSpatialElementAssetManifest;\n\t/** Poster URL displayed during loading, without JavaScript, or when WebGPU is unavailable. */\n\tfallbackImage?: string;\n\t/** Actual poster pixel dimensions [width, height], not physical model dimensions. */\n\tfallbackImageSize?: readonly [number, number];\n\t/** Navigation trail. Entries without href are plain text; defaults to an empty list. */\n\tbreadcrumbs?: SpatialElementBreadcrumb[];\n\t/** Media rail entries. Defaults to one interactive 3D minimap; [] hides the rail's entries. */\n\tmedia?: SpatialElementMediaItem[];\n\t/** Element-specific minimap fit/hover/docked pose. Colors come from the theme. */\n\tminimap?: Omit<StagePanelMinimapOptions, keyof SpatialMinimapTheme>;\n}\n\n/** Brand-wide minimap appearance; framing and model pose remain spatial-element-specific. */\nexport type SpatialMinimapTheme = Pick<\n\tStagePanelMinimapOptions,\n\t| 'expandedHeight'\n\t| 'overlayColor'\n\t| 'overlayOpacity'\n\t| 'overlayBlur'\n\t| 'contextColor'\n\t| 'contextOpacity'\n\t| 'viewportColor'\n>;\n\n/** Category/content page metadata; only title is required. */\nexport interface ContentPageData {\n\t/** Browser document title; defaults to title. */\n\tpageTitle?: string;\n\ttitle: string;\n\teyebrow?: string;\n\tintro?: string;\n\tbreadcrumbs?: SpatialElementBreadcrumb[];\n}\n"]}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import * as THREE from 'three/webgpu';
|
|
2
|
+
export interface BackgroundOutputScratch {
|
|
3
|
+
/** Borrowed storage. Only BackgroundLayerOutput may resize or dispose it. */
|
|
4
|
+
readonly target: THREE.RenderTarget;
|
|
5
|
+
readonly generation: number;
|
|
6
|
+
isCurrent(): boolean;
|
|
7
|
+
/** Synchronous submission only. No Canvas publication or asynchronous callback. */
|
|
8
|
+
borrow(draw: () => void): boolean;
|
|
9
|
+
}
|
|
10
|
+
type Mode = 'explicit' | 'fallback' | 'disposed';
|
|
11
|
+
/** Internal output owner; callers must select it before the first Background Canvas draw.
|
|
12
|
+
* Scene/blur inputs and the Canvas are borrowed, never owned. No Stage integration yet.
|
|
13
|
+
*/
|
|
14
|
+
export declare class BackgroundLayerOutput {
|
|
15
|
+
private readonly renderer;
|
|
16
|
+
private readonly canvas;
|
|
17
|
+
private mode;
|
|
18
|
+
private generation;
|
|
19
|
+
private contentsValid;
|
|
20
|
+
private busy;
|
|
21
|
+
private resizing;
|
|
22
|
+
private publications;
|
|
23
|
+
private borrows;
|
|
24
|
+
private readonly target;
|
|
25
|
+
private readonly outputTexture;
|
|
26
|
+
private readonly output;
|
|
27
|
+
private readonly size;
|
|
28
|
+
private readonly css;
|
|
29
|
+
private readonly viewport;
|
|
30
|
+
private readonly exposure;
|
|
31
|
+
private readonly onResize;
|
|
32
|
+
private readonly onCanvasDispose;
|
|
33
|
+
private readonly onTargetDispose;
|
|
34
|
+
private constructor();
|
|
35
|
+
/** No draw, clear, compile or access to Three's private framebuffer cache. */
|
|
36
|
+
static create(renderer: THREE.WebGPURenderer, canvas: THREE.CanvasTarget): BackgroundLayerOutput | undefined;
|
|
37
|
+
/** The display is the existing opaque, depth-independent fullscreen QuadMesh. */
|
|
38
|
+
compose(display: Pick<THREE.QuadMesh, 'render'>, panels: () => void, publish?: boolean): boolean;
|
|
39
|
+
clearTransparent(publish?: boolean): boolean;
|
|
40
|
+
/** Only a fully rebuilt target may be published. Never used for hidden warming. */
|
|
41
|
+
publish(): boolean;
|
|
42
|
+
/** The handle is an owner/generation capability, not a copy or a second target. */
|
|
43
|
+
captureScratch(): BackgroundOutputScratch | undefined;
|
|
44
|
+
/** Resize only to the actual Canvas. Holding an outgoing Canvas is the caller's job. */
|
|
45
|
+
resize(): boolean;
|
|
46
|
+
/** Terminal for this owner. The Stage must not later recreate an explicit owner. */
|
|
47
|
+
selectFallback(): void;
|
|
48
|
+
dispose(): void;
|
|
49
|
+
getRenderTargets(): readonly THREE.RenderTarget[];
|
|
50
|
+
getStats(): {
|
|
51
|
+
mode: Mode;
|
|
52
|
+
generation: number;
|
|
53
|
+
contentsValid: boolean;
|
|
54
|
+
busy: boolean;
|
|
55
|
+
publications: number;
|
|
56
|
+
borrows: number;
|
|
57
|
+
width: number;
|
|
58
|
+
height: number;
|
|
59
|
+
samples: number;
|
|
60
|
+
};
|
|
61
|
+
private rebuild;
|
|
62
|
+
private borrow;
|
|
63
|
+
private bindTarget;
|
|
64
|
+
private publishCurrent;
|
|
65
|
+
private assertDestination;
|
|
66
|
+
private assertIdle;
|
|
67
|
+
private current;
|
|
68
|
+
private usable;
|
|
69
|
+
private profileCurrent;
|
|
70
|
+
private profileMatches;
|
|
71
|
+
private release;
|
|
72
|
+
/** No await may escape this scope, including a failing public RenderPipeline.render(). */
|
|
73
|
+
private withState;
|
|
74
|
+
}
|
|
75
|
+
export {};
|
|
76
|
+
//# sourceMappingURL=BackgroundLayerOutput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BackgroundLayerOutput.d.ts","sourceRoot":"","sources":["../../src/stage/BackgroundLayerOutput.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAGtC,MAAM,WAAW,uBAAuB;IACvC,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC;IACpC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,SAAS,IAAI,OAAO,CAAC;IACrB,mFAAmF;IACnF,MAAM,CAAC,IAAI,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC;CAClC;AAED,KAAK,IAAI,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,CAAC;AAcjD;;GAEG;AACH,qBAAa,qBAAqB;IAmBb,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAC5C,OAAO,CAAC,QAAQ,CAAC,MAAM;IAnBxB,OAAO,CAAC,IAAI,CAAoB;IAChC,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,QAAQ,CAAS;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