@spatial-elements/core 1.0.0-beta.10 → 1.0.0-beta.12

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.
Files changed (104) hide show
  1. package/dist/catalog/CatalogEndpointRegistry.d.ts +2 -2
  2. package/dist/catalog/CatalogEndpointRegistry.d.ts.map +1 -1
  3. package/dist/catalog/CatalogEndpointRegistry.js.map +1 -1
  4. package/dist/catalog/CatalogModelOutline.d.ts.map +1 -1
  5. package/dist/catalog/CatalogModelOutline.js +4 -3
  6. package/dist/catalog/CatalogModelOutline.js.map +1 -1
  7. package/dist/catalog/CatalogTransition.d.ts +1 -1
  8. package/dist/catalog/CatalogTransition.js +1 -1
  9. package/dist/catalog/CatalogTransition.js.map +1 -1
  10. package/dist/catalog/catalogRecipes.js +2 -2
  11. package/dist/catalog/catalogRecipes.js.map +1 -1
  12. package/dist/catalog/listDeviceOrientation.d.ts +3 -0
  13. package/dist/catalog/listDeviceOrientation.d.ts.map +1 -1
  14. package/dist/catalog/listDeviceOrientation.js +15 -4
  15. package/dist/catalog/listDeviceOrientation.js.map +1 -1
  16. package/dist/catalog/stagedDockGeometry.js +2 -2
  17. package/dist/catalog/stagedDockGeometry.js.map +1 -1
  18. package/dist/spatial-element/SpatialElementDockController.d.ts +2 -3
  19. package/dist/spatial-element/SpatialElementDockController.d.ts.map +1 -1
  20. package/dist/spatial-element/SpatialElementDockController.js +13 -31
  21. package/dist/spatial-element/SpatialElementDockController.js.map +1 -1
  22. package/dist/spatial-element/SpatialElementHeaderFields.d.ts +18 -0
  23. package/dist/spatial-element/SpatialElementHeaderFields.d.ts.map +1 -0
  24. package/dist/spatial-element/SpatialElementHeaderFields.js +100 -0
  25. package/dist/spatial-element/SpatialElementHeaderFields.js.map +1 -0
  26. package/dist/spatial-element/SpatialElementPaneController.d.ts +0 -1
  27. package/dist/spatial-element/SpatialElementPaneController.d.ts.map +1 -1
  28. package/dist/spatial-element/SpatialElementPaneController.js +1 -5
  29. package/dist/spatial-element/SpatialElementPaneController.js.map +1 -1
  30. package/dist/spatial-element/messages.d.ts +13 -0
  31. package/dist/spatial-element/messages.d.ts.map +1 -1
  32. package/dist/spatial-element/messages.js +13 -0
  33. package/dist/spatial-element/messages.js.map +1 -1
  34. package/dist/spatial-element/spatialElementDock.d.ts +1 -1
  35. package/dist/spatial-element/spatialElementDock.js +1 -1
  36. package/dist/spatial-element/spatialElementDock.js.map +1 -1
  37. package/dist/stage/LiquidGlassPanel.d.ts.map +1 -1
  38. package/dist/stage/LiquidGlassPanel.js +5 -2
  39. package/dist/stage/LiquidGlassPanel.js.map +1 -1
  40. package/dist/stage/MinimapController.d.ts +1 -0
  41. package/dist/stage/MinimapController.d.ts.map +1 -1
  42. package/dist/stage/MinimapController.js +15 -9
  43. package/dist/stage/MinimapController.js.map +1 -1
  44. package/dist/stage/PanelPresentationController.d.ts.map +1 -1
  45. package/dist/stage/PanelPresentationController.js +16 -1
  46. package/dist/stage/PanelPresentationController.js.map +1 -1
  47. package/dist/stage/SpaceMouseAdapter.d.ts +10 -2
  48. package/dist/stage/SpaceMouseAdapter.d.ts.map +1 -1
  49. package/dist/stage/SpaceMouseAdapter.js +50 -8
  50. package/dist/stage/SpaceMouseAdapter.js.map +1 -1
  51. package/dist/stage/SpatialElementInteractionController.d.ts +5 -1
  52. package/dist/stage/SpatialElementInteractionController.d.ts.map +1 -1
  53. package/dist/stage/SpatialElementInteractionController.js +64 -32
  54. package/dist/stage/SpatialElementInteractionController.js.map +1 -1
  55. package/dist/stage/StageExperience.d.ts +3 -1
  56. package/dist/stage/StageExperience.d.ts.map +1 -1
  57. package/dist/stage/StageExperience.js +26 -9
  58. package/dist/stage/StageExperience.js.map +1 -1
  59. package/dist/stage/StageRenderPipeline.d.ts +1 -0
  60. package/dist/stage/StageRenderPipeline.d.ts.map +1 -1
  61. package/dist/stage/StageRenderPipeline.js +23 -5
  62. package/dist/stage/StageRenderPipeline.js.map +1 -1
  63. package/dist/stage/minimap/MinimapModelGeometry.d.ts +2 -0
  64. package/dist/stage/minimap/MinimapModelGeometry.d.ts.map +1 -1
  65. package/dist/stage/minimap/MinimapModelGeometry.js +28 -0
  66. package/dist/stage/minimap/MinimapModelGeometry.js.map +1 -1
  67. package/dist/stage/minimap/MinimapState.d.ts +3 -3
  68. package/dist/stage/minimap/MinimapState.d.ts.map +1 -1
  69. package/dist/stage/minimap/MinimapState.js.map +1 -1
  70. package/dist/stage/panelContext.d.ts +7 -0
  71. package/dist/stage/panelContext.d.ts.map +1 -1
  72. package/dist/stage/panelContext.js.map +1 -1
  73. package/dist/stage/panelFocusMath.d.ts +40 -0
  74. package/dist/stage/panelFocusMath.d.ts.map +1 -0
  75. package/dist/stage/panelFocusMath.js +83 -0
  76. package/dist/stage/panelFocusMath.js.map +1 -0
  77. package/dist/stage/scalarMath.d.ts +6 -0
  78. package/dist/stage/scalarMath.d.ts.map +1 -0
  79. package/dist/stage/scalarMath.js +6 -0
  80. package/dist/stage/scalarMath.js.map +1 -0
  81. package/dist/stage/spaceMousePermission.d.ts +13 -0
  82. package/dist/stage/spaceMousePermission.d.ts.map +1 -0
  83. package/dist/stage/spaceMousePermission.js +69 -0
  84. package/dist/stage/spaceMousePermission.js.map +1 -0
  85. package/dist/stage/spaceMousePlatform.d.ts +12 -0
  86. package/dist/stage/spaceMousePlatform.d.ts.map +1 -0
  87. package/dist/stage/spaceMousePlatform.js +19 -0
  88. package/dist/stage/spaceMousePlatform.js.map +1 -0
  89. package/dist/stage/stageConstants.d.ts.map +1 -1
  90. package/dist/stage/stageConstants.js +4 -4
  91. package/dist/stage/stageConstants.js.map +1 -1
  92. package/dist/stage/stageMath.d.ts +3 -36
  93. package/dist/stage/stageMath.d.ts.map +1 -1
  94. package/dist/stage/stageMath.js +28 -106
  95. package/dist/stage/stageMath.js.map +1 -1
  96. package/dist/stage/stageTypes.d.ts +3 -1
  97. package/dist/stage/stageTypes.d.ts.map +1 -1
  98. package/dist/stage/stageTypes.js.map +1 -1
  99. package/dist/stage/webgpuSupport.d.ts +3 -0
  100. package/dist/stage/webgpuSupport.d.ts.map +1 -0
  101. package/dist/stage/webgpuSupport.js +14 -0
  102. package/dist/stage/webgpuSupport.js.map +1 -0
  103. package/logo.svg +90 -53
  104. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"SpatialElementPaneController.js","sourceRoot":"","sources":["../../src/spatial-element/SpatialElementPaneController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAA8B,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,4BAA4B,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClJ,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,8BAA8B,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC7J,OAAO,EAAE,gBAAgB,EAAE,iCAAiC,EAAE,MAAM,4BAA4B,CAAC;AAEjG,oFAAoF;AACpF,MAAM,UAAU,4BAA4B,CAAC,IAA6D,EACzG,QAA2C,EAAE,KAAa;IAC1D,MAAM,QAAQ,GAAG,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,GAAG,CAAC,GAAG,QAAQ,CAAC,KAAK,GAAG,CAAC;QACjE,CAAC,EAAE,QAAQ,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;IACrD,MAAM,OAAO,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC;IACrE,MAAM,MAAM,GAAG,mBAAmB,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAA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C,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,GAAG,QAAQ,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,MAAM,GAAG,QAAQ,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC;IAC3J,CAAC,CAAC;CACF","sourcesContent":["import { resolveDetailLayout, type ResponsiveLayoutInput } from './responsiveLayout.js';\nimport { STAGE_PANEL_LAYOUT_EVENT } from '../stage/panelContext.js';\nimport { getStageVisualScrollPosition, STAGE_SCROLL_PRIORITY, subscribeStageScrollFrame, syncStageScrollToNative } from '../stage/scrollFrame.js';\nimport { getPanelFocusBlur, getPanelFocusOffset, getPanelFocusOpacity, getPanelFocusPerspectiveOffset, getPerspectiveDistance } from '../stage/stageMath.js';\nimport { PANEL_CAMERA_FOV, PANEL_FOCUS_PERSPECTIVE_MAX_SCALE } from '../stage/stageConstants.js';\n\n/** The native pane uses the same focus curve and camera-facing motion as panels. */\nexport function resolvePaneFocusPresentation(rect: { x: number; y: number; width: number; height: number },\n\tviewport: { width: number; height: number }, focus: number) {\n\tconst position = { x: rect.x + rect.width / 2 - viewport.width / 2,\n\t\ty: viewport.height / 2 - rect.y - rect.height / 2 };\n\tconst options = { width: rect.width, height: rect.height, position };\n\tconst offset = getPanelFocusOffset(options, focus, viewport.width, viewport.height);\n\tconst distance = getPerspectiveDistance(viewport.height, PANEL_CAMERA_FOV);\n\tconst perspective = getPanelFocusPerspectiveOffset({ x: position.x + offset.x, y: position.y + offset.y }, offset.z, distance);\n\treturn { x: offset.x + perspective.x, y: -offset.y - perspective.y,\n\t\tscale: Math.min(PANEL_FOCUS_PERSPECTIVE_MAX_SCALE, Math.max(1, distance / Math.max(distance - offset.z, 1))),\n\t\topacity: getPanelFocusOpacity(focus), blur: getPanelFocusBlur(focus, options),\n\t\tpivotY: rect.y + rect.height / 2 };\n}\n\n/** One document coordinate system; clipping changes paint and hit testing only. */\nexport function resolvePaneScrollClip(bodyTop: number, bodyHeight: number, viewportTop: number, viewportBottom: number, scrollY: number) {\n\treturn {\n\t\ttop: Math.max(0, scrollY + viewportTop - bodyTop),\n\t\tbottom: Math.max(0, bodyTop + bodyHeight - scrollY - viewportBottom)\n\t};\n}\n\n/** Keeps fixed 3XL regions and the ordinary document body on the Stage scroll clock. */\nexport class SpatialElementPaneController {\n\tprivate body?: HTMLElement;\n\tprivate stage?: HTMLElement;\n\tprivate regions: HTMLElement[] = [];\n\tprivate hiddenRegions: HTMLElement[] = [];\n\tprivate observer?: ResizeObserver;\n\tprivate stageObserver?: MutationObserver;\n\tprivate stopScroll?: () => void;\n\tprivate frame = 0;\n\tprivate layout?: ReturnType<typeof resolveDetailLayout>;\n\tprivate metricKey = '';\n\tprivate bodyTop = 0;\n\tprivate bodyHeight = 0;\n\tprivate scrollY = 0;\n\tprivate hidden = false;\n\tprivate focus = 0;\n\tprivate focusPose = { x: 0, y: 0, scale: 1, opacity: 1, blur: 0, pivotY: 0 };\n\tprivate savedScroll?: { x: number; y: number };\n\tprivate actionBottom = Infinity;\n\tprivate sectionPositions: { element: HTMLElement; top: number }[] = [];\n\tprivate restoreAnchor?: { element: HTMLElement; offset: number };\n\tprivate resizeAnchor?: { element: HTMLElement; offset: number };\n\tprivate readingTop = 0;\n\tprivate started = false;\n\n\tconstructor(private readonly root: HTMLElement,\n\t\tprivate readonly readMetrics: () => ResponsiveLayoutInput | undefined,\n\t\tprivate readonly onMode: (split: boolean) => void) {}\n\n\tstart() {\n\t\tif (this.started) return;\n\t\tthis.started = true;\n\t\tthis.stage = this.root.closest<HTMLElement>('.stage') ?? undefined;\n\t\tthis.body = this.root.querySelector<HTMLElement>('[data-spatial-detail-pane-body]') ?? undefined;\n\t\tthis.regions = Array.from(this.root.querySelectorAll<HTMLElement>('[data-spatial-detail-fixed]'));\n\t\tthis.hiddenRegions = Array.from(this.root.querySelectorAll<HTMLElement>('[data-spatial-detail-pane-body], [data-spatial-detail-pane-header], [data-spatial-detail-pane-submenu-shell]'));\n\t\tthis.scrollY = getStageVisualScrollPosition().scrollY;\n\t\tthis.observer = new ResizeObserver(this.schedule);\n\t\tif (this.body) this.observer.observe(this.body);\n\t\tthis.stageObserver = new MutationObserver(this.schedule);\n\t\tif (this.stage) this.stageObserver.observe(this.stage, { attributes: true, attributeFilter: ['class'] });\n\t\twindow.addEventListener(STAGE_PANEL_LAYOUT_EVENT, this.schedule);\n\t\twindow.addEventListener('resize', this.handleResize, { passive: true });\n\t\tthis.root.addEventListener('focusin', this.handleFocus);\n\t\tthis.stopScroll = subscribeStageScrollFrame(frame => {\n\t\t\tthis.scrollY = frame.scrollY;\n\t\t\tthis.paint();\n\t\t}, STAGE_SCROLL_PRIORITY.virtualDocument + 2);\n\t\tthis.update();\n\t}\n\n\tsetHidden(hidden: boolean) {\n\t\tif (this.hidden === hidden) return;\n\t\tthis.hidden = hidden;\n\t\tif (hidden && this.layout?.composition === 'split') this.savedScroll = { x: window.scrollX, y: window.scrollY };\n\t\tthis.root.toggleAttribute('data-spatial-detail-pane-hidden', hidden);\n\t\tfor (const region of this.hiddenRegions) region.inert = hidden && this.layout?.composition === 'split';\n\t\tif (!hidden && this.savedScroll) {\n\t\t\twindow.scrollTo({ left: this.savedScroll.x, top: this.savedScroll.y, behavior: 'instant' });\n\t\t\tsyncStageScrollToNative();\n\t\t\tthis.savedScroll = undefined;\n\t\t}\n\t}\n\n\tsetFocus(focus: number, fullscreen = false) {\n\t\tthis.focus = fullscreen ? 1 : Math.max(0, Math.min(1, Number.isFinite(focus) ? focus : 0));\n\t\tthis.paintFocus();\n\t}\n\n\tdestroy() {\n\t\tthis.started = false;\n\t\tthis.stopScroll?.();\n\t\tthis.observer?.disconnect();\n\t\tthis.stageObserver?.disconnect();\n\t\tcancelAnimationFrame(this.frame);\n\t\twindow.removeEventListener(STAGE_PANEL_LAYOUT_EVENT, this.schedule);\n\t\twindow.removeEventListener('resize', this.handleResize);\n\t\tthis.root.removeEventListener('focusin', this.handleFocus);\n\t\tfor (const region of this.regions) region.removeAttribute('data-stage-fixed-region');\n\t}\n\n\tprivate readonly schedule = () => {\n\t\tif (!this.started || this.frame) return;\n\t\tthis.frame = requestAnimationFrame(() => { this.frame = 0; this.update(); });\n\t};\n\n\tprivate readAnchor() {\n\t\tconst anchor = this.sectionPositions.filter(item => item.top <= this.scrollY + this.readingTop + 1).at(-1);\n\t\treturn anchor ? { element: anchor.element, offset: this.scrollY + this.readingTop - anchor.top } : undefined;\n\t}\n\n\tprivate readonly handleResize = () => {\n\t\t// CSS reflows before the shared viewport probe's next frame. Preserve the\n\t\t// last stable document anchor now, before any observer can cache new boxes\n\t\t// against old metrics. Keep it across consecutive breakpoint crossings.\n\t\tthis.resizeAnchor ??= this.restoreAnchor ?? this.readAnchor();\n\t\tthis.schedule();\n\t};\n\n\tprivate update() {\n\t\tconst metrics = this.readMetrics();\n\t\tif (!metrics || !this.body) return;\n\t\tif (!this.stage?.classList.contains('stage-virtual-scroll-active')) this.scrollY = window.scrollY;\n\t\tconst key = JSON.stringify(metrics);\n\t\tconst metricsChanged = key !== this.metricKey;\n\t\tif (key !== this.metricKey) {\n\t\t\tconst previous = this.layout;\n\t\t\tconst next = resolveDetailLayout(metrics);\n\t\t\tif (previous && previous.composition !== next.composition && this.scrollY > 1) {\n\t\t\t\tthis.restoreAnchor = this.resizeAnchor ?? this.restoreAnchor ?? this.readAnchor();\n\t\t\t}\n\t\t\tif (!this.restoreAnchor) this.resizeAnchor = undefined;\n\t\t\tthis.metricKey = key;\n\t\t\tthis.layout = next;\n\t\t\tconst split = next.composition === 'split';\n\t\t\tthis.root.toggleAttribute('data-spatial-detail-pane', split);\n\t\t\tthis.root.toggleAttribute('data-spatial-detail-flow', next.shortHeightFallback);\n\t\t\tfor (const region of this.regions) region.toggleAttribute('data-stage-fixed-region', split);\n\t\t\tfor (const region of this.hiddenRegions) region.inert = split && this.hidden;\n\t\t\tthis.onMode(split);\n\t\t\t// The framework flushes the native summary ownership before its new box is measured.\n\t\t\tthis.schedule();\n\t\t}\n\t\tconst rect = this.body.getBoundingClientRect();\n\t\t// A breakpoint can remove the paint transform before this resize callback.\n\t\tif (this.layout?.composition !== 'split') this.focusPose = { x: 0, y: 0, scale: 1, opacity: 1, blur: 0, pivotY: 0 };\n\t\tconst bodyHeightChanged = Math.abs(this.bodyHeight - rect.height / this.focusPose.scale) > 0.5;\n\t\tthis.bodyTop = this.neutralY(rect.top) + this.scrollY;\n\t\tthis.bodyHeight = rect.height / this.focusPose.scale;\n\t\tthis.sectionPositions = Array.from(this.body.querySelectorAll<HTMLElement>('[data-spatial-element-tab-target]'))\n\t\t\t.map(element => ({ element, top: this.neutralY(element.getBoundingClientRect().top) + this.scrollY }));\n\t\tconst action = this.body.querySelector<HTMLElement>('[data-catalog-rich-shared=\"primary-action\"]');\n\t\tthis.actionBottom = action ? this.neutralY(action.getBoundingClientRect().bottom) + this.scrollY : Infinity;\n\t\tthis.readingTop = this.layout?.pane?.body.y ?? (Number.parseFloat(getComputedStyle(this.root).getPropertyValue('--spatial-element-section-scroll-offset')) || 0);\n\t\tconst summaryReady = this.layout?.composition !== 'split' || Boolean(this.body.querySelector('[data-spatial-summary-root]'));\n\t\tif (!metricsChanged && !bodyHeightChanged && summaryReady && this.restoreAnchor && this.restoreAnchor.element.isConnected) {\n\t\t\tconst anchor = this.restoreAnchor;\n\t\t\tthis.restoreAnchor = undefined;\n\t\t\tthis.resizeAnchor = undefined;\n\t\t\tconst y = Math.max(0, this.neutralY(anchor.element.getBoundingClientRect().top) + this.scrollY + anchor.offset - this.readingTop);\n\t\t\twindow.scrollTo({ top: y, behavior: 'instant' });\n\t\t\tsyncStageScrollToNative();\n\t\t\tthis.scrollY = getStageVisualScrollPosition().scrollY;\n\t\t}\n\t\tif (this.restoreAnchor) this.schedule();\n\t\tthis.paint();\n\t}\n\n\tprivate paint() {\n\t\tthis.paintFocus();\n\t\tconst pane = this.layout?.pane;\n\t\tif (!pane || !this.body) {\n\t\t\tthis.root.removeAttribute('data-spatial-detail-pane-clipped');\n\t\t\tthis.body?.style.removeProperty('clip-path');\n\t\t\tthis.root.style.removeProperty('--spatial-pane-fixed-compensation');\n\t\t\treturn;\n\t\t}\n\t\tconst enhanced = this.stage?.classList.contains('stage-virtual-scroll-active');\n\t\tthis.root.style.setProperty('--spatial-pane-fixed-compensation', `${enhanced ? this.scrollY : 0}px`);\n\t\tconst clip = resolvePaneScrollClip(this.bodyTop, this.bodyHeight, pane.body.y, pane.body.y + pane.body.height, this.scrollY);\n\t\tthis.body.style.clipPath = `inset(${clip.top}px 0 ${clip.bottom}px 0 round 0 0 var(--spatial-element-panel-radius) var(--spatial-element-panel-radius))`;\n\t\tthis.root.toggleAttribute('data-spatial-detail-pane-clipped', true);\n\t\tthis.root.toggleAttribute('data-spatial-detail-pane-action', this.actionBottom - this.scrollY <= pane.body.y);\n\t}\n\n\t/** Measurements remain in document coordinates while the pane moves in paint. */\n\tprivate neutralY(y: number) {\n\t\tconst { scale, pivotY, y: offset } = this.focusPose;\n\t\treturn pivotY + (y - pivotY - offset) / scale;\n\t}\n\n\tprivate paintFocus() {\n\t\tconst pane = this.layout?.pane;\n\t\tconst metrics = this.readMetrics();\n\t\tthis.focusPose = pane && metrics ? resolvePaneFocusPresentation(pane.surface, metrics, this.focus)\n\t\t\t: { x: 0, y: 0, scale: 1, opacity: 1, blur: 0, pivotY: 0 };\n\t\tconst pose = this.focusPose;\n\t\tthis.root.toggleAttribute('data-spatial-detail-pane-zooming', Boolean(pane && this.focus > 0.001));\n\t\tthis.setHidden(Boolean(pane && pose.opacity < 0.12));\n\t\tconst values = { '--spatial-pane-focus-x': `${pose.x}px`, '--spatial-pane-focus-y': `${pose.y}px`,\n\t\t\t'--spatial-pane-focus-scale': String(pose.scale), '--spatial-pane-focus-opacity': String(pose.opacity),\n\t\t\t'--spatial-pane-focus-blur': `${pose.blur}px` };\n\t\tfor (const [name, value] of Object.entries(values)) {\n\t\t\tif (this.root.style.getPropertyValue(name) !== value) this.root.style.setProperty(name, value);\n\t\t}\n\t\tif (!pane || !this.body) return;\n\t\tthis.body.style.setProperty('--spatial-pane-focus-origin-y', `${pose.pivotY - this.bodyTop + this.scrollY}px`);\n\t\tfor (const region of this.regions) {\n\t\t\tconst top = region.hasAttribute('data-spatial-detail-pane-submenu-shell') ? this.layout!.submenu!.y\n\t\t\t\t: region.hasAttribute('data-spatial-detail-pane-header') || region.hasAttribute('data-spatial-detail-pane-surface') ? pane.surface.y : undefined;\n\t\t\tif (top !== undefined) region.style.setProperty('--spatial-pane-focus-origin-y', `${pose.pivotY - top}px`);\n\t\t}\n\t}\n\n\tprivate readonly handleFocus = (event: FocusEvent) => {\n\t\t// VirtualScrollController owns the enhanced path; native DOM uses identical bounds.\n\t\tif (!this.layout?.pane || this.hidden || this.stage?.classList.contains('stage-virtual-scroll-active')) return;\n\t\tconst target = event.target;\n\t\tif (!(target instanceof HTMLElement) || !this.body?.contains(target)) return;\n\t\tconst rect = target.getBoundingClientRect();\n\t\tconst viewport = this.layout.pane.body;\n\t\tconst bottom = Math.min(viewport.y + viewport.height, this.layout.submenu?.y ?? Infinity);\n\t\tif (rect.top >= viewport.y && rect.bottom <= bottom) return;\n\t\twindow.scrollTo({ top: Math.max(0, window.scrollY + rect.top - viewport.y - Math.max(0, (bottom - viewport.y - rect.height) / 2)), behavior: 'instant' });\n\t};\n}\n"]}
1
+ {"version":3,"file":"SpatialElementPaneController.js","sourceRoot":"","sources":["../../src/spatial-element/SpatialElementPaneController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAA8B,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,4BAA4B,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClJ,OAAO,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,GAAG,CAAC,QAAQ,CAAC,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,IAAI,QAAQ,CAAC,CAAC;QAC1F,IAAI,IAAI,CAAC,GAAG,IAAI,QAAQ,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,IAAI,MAAM;YAAE,OAAO;QAC5D,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,GAAG,QAAQ,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,MAAM,GAAG,QAAQ,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC;IAC3J,CAAC,CAAC;CACF","sourcesContent":["import { resolveDetailLayout, type ResponsiveLayoutInput } from './responsiveLayout.js';\nimport { STAGE_PANEL_LAYOUT_EVENT } from '../stage/panelContext.js';\nimport { getStageVisualScrollPosition, STAGE_SCROLL_PRIORITY, subscribeStageScrollFrame, syncStageScrollToNative } from '../stage/scrollFrame.js';\nimport { getPanelFocusBlur, getPanelFocusOffset, getPanelFocusOpacity, getPanelFocusPerspectiveOffset, getPerspectiveDistance } from '../stage/panelFocusMath.js';\nimport { PANEL_CAMERA_FOV, PANEL_FOCUS_PERSPECTIVE_MAX_SCALE } from '../stage/stageConstants.js';\n\n/** The native pane uses the same focus curve and camera-facing motion as panels. */\nexport function resolvePaneFocusPresentation(rect: { x: number; y: number; width: number; height: number },\n\tviewport: { width: number; height: number }, focus: number) {\n\tconst position = { x: rect.x + rect.width / 2 - viewport.width / 2,\n\t\ty: viewport.height / 2 - rect.y - rect.height / 2 };\n\tconst options = { width: rect.width, height: rect.height, position };\n\tconst offset = getPanelFocusOffset(options, focus, viewport.width, viewport.height);\n\tconst distance = getPerspectiveDistance(viewport.height, PANEL_CAMERA_FOV);\n\tconst perspective = getPanelFocusPerspectiveOffset({ x: position.x + offset.x, y: position.y + offset.y }, offset.z, distance);\n\treturn { x: offset.x + perspective.x, y: -offset.y - perspective.y,\n\t\tscale: Math.min(PANEL_FOCUS_PERSPECTIVE_MAX_SCALE, Math.max(1, distance / Math.max(distance - offset.z, 1))),\n\t\topacity: getPanelFocusOpacity(focus), blur: getPanelFocusBlur(focus, options),\n\t\tpivotY: rect.y + rect.height / 2 };\n}\n\n/** One document coordinate system; clipping changes paint and hit testing only. */\nexport function resolvePaneScrollClip(bodyTop: number, bodyHeight: number, viewportTop: number, viewportBottom: number, scrollY: number) {\n\treturn {\n\t\ttop: Math.max(0, scrollY + viewportTop - bodyTop),\n\t\tbottom: Math.max(0, bodyTop + bodyHeight - scrollY - viewportBottom)\n\t};\n}\n\n/** Keeps fixed 3XL regions and the ordinary document body on the Stage scroll clock. */\nexport class SpatialElementPaneController {\n\tprivate body?: HTMLElement;\n\tprivate stage?: HTMLElement;\n\tprivate regions: HTMLElement[] = [];\n\tprivate hiddenRegions: HTMLElement[] = [];\n\tprivate observer?: ResizeObserver;\n\tprivate stageObserver?: MutationObserver;\n\tprivate stopScroll?: () => void;\n\tprivate frame = 0;\n\tprivate layout?: ReturnType<typeof resolveDetailLayout>;\n\tprivate metricKey = '';\n\tprivate bodyTop = 0;\n\tprivate bodyHeight = 0;\n\tprivate scrollY = 0;\n\tprivate hidden = false;\n\tprivate focus = 0;\n\tprivate focusPose = { x: 0, y: 0, scale: 1, opacity: 1, blur: 0, pivotY: 0 };\n\tprivate savedScroll?: { x: number; y: number };\n\tprivate sectionPositions: { element: HTMLElement; top: number }[] = [];\n\tprivate restoreAnchor?: { element: HTMLElement; offset: number };\n\tprivate resizeAnchor?: { element: HTMLElement; offset: number };\n\tprivate readingTop = 0;\n\tprivate started = false;\n\n\tconstructor(private readonly root: HTMLElement,\n\t\tprivate readonly readMetrics: () => ResponsiveLayoutInput | undefined,\n\t\tprivate readonly onMode: (split: boolean) => void) {}\n\n\tstart() {\n\t\tif (this.started) return;\n\t\tthis.started = true;\n\t\tthis.stage = this.root.closest<HTMLElement>('.stage') ?? undefined;\n\t\tthis.body = this.root.querySelector<HTMLElement>('[data-spatial-detail-pane-body]') ?? undefined;\n\t\tthis.regions = Array.from(this.root.querySelectorAll<HTMLElement>('[data-spatial-detail-fixed]'));\n\t\tthis.hiddenRegions = Array.from(this.root.querySelectorAll<HTMLElement>('[data-spatial-detail-pane-body], [data-spatial-detail-pane-header], [data-spatial-detail-pane-submenu-shell]'));\n\t\tthis.scrollY = getStageVisualScrollPosition().scrollY;\n\t\tthis.observer = new ResizeObserver(this.schedule);\n\t\tif (this.body) this.observer.observe(this.body);\n\t\tthis.stageObserver = new MutationObserver(this.schedule);\n\t\tif (this.stage) this.stageObserver.observe(this.stage, { attributes: true, attributeFilter: ['class'] });\n\t\twindow.addEventListener(STAGE_PANEL_LAYOUT_EVENT, this.schedule);\n\t\twindow.addEventListener('resize', this.handleResize, { passive: true });\n\t\tthis.root.addEventListener('focusin', this.handleFocus);\n\t\tthis.stopScroll = subscribeStageScrollFrame(frame => {\n\t\t\tthis.scrollY = frame.scrollY;\n\t\t\tthis.paint();\n\t\t}, STAGE_SCROLL_PRIORITY.virtualDocument + 2);\n\t\tthis.update();\n\t}\n\n\tsetHidden(hidden: boolean) {\n\t\tif (this.hidden === hidden) return;\n\t\tthis.hidden = hidden;\n\t\tif (hidden && this.layout?.composition === 'split') this.savedScroll = { x: window.scrollX, y: window.scrollY };\n\t\tthis.root.toggleAttribute('data-spatial-detail-pane-hidden', hidden);\n\t\tfor (const region of this.hiddenRegions) region.inert = hidden && this.layout?.composition === 'split';\n\t\tif (!hidden && this.savedScroll) {\n\t\t\twindow.scrollTo({ left: this.savedScroll.x, top: this.savedScroll.y, behavior: 'instant' });\n\t\t\tsyncStageScrollToNative();\n\t\t\tthis.savedScroll = undefined;\n\t\t}\n\t}\n\n\tsetFocus(focus: number, fullscreen = false) {\n\t\tthis.focus = fullscreen ? 1 : Math.max(0, Math.min(1, Number.isFinite(focus) ? focus : 0));\n\t\tthis.paintFocus();\n\t}\n\n\tdestroy() {\n\t\tthis.started = false;\n\t\tthis.stopScroll?.();\n\t\tthis.observer?.disconnect();\n\t\tthis.stageObserver?.disconnect();\n\t\tcancelAnimationFrame(this.frame);\n\t\twindow.removeEventListener(STAGE_PANEL_LAYOUT_EVENT, this.schedule);\n\t\twindow.removeEventListener('resize', this.handleResize);\n\t\tthis.root.removeEventListener('focusin', this.handleFocus);\n\t\tfor (const region of this.regions) region.removeAttribute('data-stage-fixed-region');\n\t}\n\n\tprivate readonly schedule = () => {\n\t\tif (!this.started || this.frame) return;\n\t\tthis.frame = requestAnimationFrame(() => { this.frame = 0; this.update(); });\n\t};\n\n\tprivate readAnchor() {\n\t\tconst anchor = this.sectionPositions.filter(item => item.top <= this.scrollY + this.readingTop + 1).at(-1);\n\t\treturn anchor ? { element: anchor.element, offset: this.scrollY + this.readingTop - anchor.top } : undefined;\n\t}\n\n\tprivate readonly handleResize = () => {\n\t\t// CSS reflows before the shared viewport probe's next frame. Preserve the\n\t\t// last stable document anchor now, before any observer can cache new boxes\n\t\t// against old metrics. Keep it across consecutive breakpoint crossings.\n\t\tthis.resizeAnchor ??= this.restoreAnchor ?? this.readAnchor();\n\t\tthis.schedule();\n\t};\n\n\tprivate update() {\n\t\tconst metrics = this.readMetrics();\n\t\tif (!metrics || !this.body) return;\n\t\tif (!this.stage?.classList.contains('stage-virtual-scroll-active')) this.scrollY = window.scrollY;\n\t\tconst key = JSON.stringify(metrics);\n\t\tconst metricsChanged = key !== this.metricKey;\n\t\tif (key !== this.metricKey) {\n\t\t\tconst previous = this.layout;\n\t\t\tconst next = resolveDetailLayout(metrics);\n\t\t\tif (previous && previous.composition !== next.composition && this.scrollY > 1) {\n\t\t\t\tthis.restoreAnchor = this.resizeAnchor ?? this.restoreAnchor ?? this.readAnchor();\n\t\t\t}\n\t\t\tif (!this.restoreAnchor) this.resizeAnchor = undefined;\n\t\t\tthis.metricKey = key;\n\t\t\tthis.layout = next;\n\t\t\tconst split = next.composition === 'split';\n\t\t\tthis.root.toggleAttribute('data-spatial-detail-pane', split);\n\t\t\tthis.root.toggleAttribute('data-spatial-detail-flow', next.shortHeightFallback);\n\t\t\tfor (const region of this.regions) region.toggleAttribute('data-stage-fixed-region', split);\n\t\t\tfor (const region of this.hiddenRegions) region.inert = split && this.hidden;\n\t\t\tthis.onMode(split);\n\t\t\t// The framework flushes the native summary ownership before its new box is measured.\n\t\t\tthis.schedule();\n\t\t}\n\t\tconst rect = this.body.getBoundingClientRect();\n\t\t// A breakpoint can remove the paint transform before this resize callback.\n\t\tif (this.layout?.composition !== 'split') this.focusPose = { x: 0, y: 0, scale: 1, opacity: 1, blur: 0, pivotY: 0 };\n\t\tconst bodyHeightChanged = Math.abs(this.bodyHeight - rect.height / this.focusPose.scale) > 0.5;\n\t\tthis.bodyTop = this.neutralY(rect.top) + this.scrollY;\n\t\tthis.bodyHeight = rect.height / this.focusPose.scale;\n\t\tthis.sectionPositions = Array.from(this.body.querySelectorAll<HTMLElement>('[data-spatial-element-tab-target]'))\n\t\t\t.map(element => ({ element, top: this.neutralY(element.getBoundingClientRect().top) + this.scrollY }));\n\t\tthis.readingTop = this.layout?.pane?.body.y ?? (Number.parseFloat(getComputedStyle(this.root).getPropertyValue('--spatial-element-section-scroll-offset')) || 0);\n\t\tconst summaryReady = this.layout?.composition !== 'split' || Boolean(this.body.querySelector('[data-spatial-summary-root]'));\n\t\tif (!metricsChanged && !bodyHeightChanged && summaryReady && this.restoreAnchor && this.restoreAnchor.element.isConnected) {\n\t\t\tconst anchor = this.restoreAnchor;\n\t\t\tthis.restoreAnchor = undefined;\n\t\t\tthis.resizeAnchor = undefined;\n\t\t\tconst y = Math.max(0, this.neutralY(anchor.element.getBoundingClientRect().top) + this.scrollY + anchor.offset - this.readingTop);\n\t\t\twindow.scrollTo({ top: y, behavior: 'instant' });\n\t\t\tsyncStageScrollToNative();\n\t\t\tthis.scrollY = getStageVisualScrollPosition().scrollY;\n\t\t}\n\t\tif (this.restoreAnchor) this.schedule();\n\t\tthis.paint();\n\t}\n\n\tprivate paint() {\n\t\tthis.paintFocus();\n\t\tconst pane = this.layout?.pane;\n\t\tif (!pane || !this.body) {\n\t\t\tthis.root.removeAttribute('data-spatial-detail-pane-clipped');\n\t\t\tthis.body?.style.removeProperty('clip-path');\n\t\t\tthis.root.style.removeProperty('--spatial-pane-fixed-compensation');\n\t\t\treturn;\n\t\t}\n\t\tconst enhanced = this.stage?.classList.contains('stage-virtual-scroll-active');\n\t\tthis.root.style.setProperty('--spatial-pane-fixed-compensation', `${enhanced ? this.scrollY : 0}px`);\n\t\tconst clip = resolvePaneScrollClip(this.bodyTop, this.bodyHeight, pane.body.y, pane.body.y + pane.body.height, this.scrollY);\n\t\tthis.body.style.clipPath = `inset(${clip.top}px 0 ${clip.bottom}px 0 round 0 0 var(--spatial-element-panel-radius) var(--spatial-element-panel-radius))`;\n\t\tthis.root.toggleAttribute('data-spatial-detail-pane-clipped', true);\n\t}\n\n\t/** Measurements remain in document coordinates while the pane moves in paint. */\n\tprivate neutralY(y: number) {\n\t\tconst { scale, pivotY, y: offset } = this.focusPose;\n\t\treturn pivotY + (y - pivotY - offset) / scale;\n\t}\n\n\tprivate paintFocus() {\n\t\tconst pane = this.layout?.pane;\n\t\tconst metrics = this.readMetrics();\n\t\tthis.focusPose = pane && metrics ? resolvePaneFocusPresentation(pane.surface, metrics, this.focus)\n\t\t\t: { x: 0, y: 0, scale: 1, opacity: 1, blur: 0, pivotY: 0 };\n\t\tconst pose = this.focusPose;\n\t\tthis.root.toggleAttribute('data-spatial-detail-pane-zooming', Boolean(pane && this.focus > 0.001));\n\t\tthis.setHidden(Boolean(pane && pose.opacity < 0.12));\n\t\tconst values = { '--spatial-pane-focus-x': `${pose.x}px`, '--spatial-pane-focus-y': `${pose.y}px`,\n\t\t\t'--spatial-pane-focus-scale': String(pose.scale), '--spatial-pane-focus-opacity': String(pose.opacity),\n\t\t\t'--spatial-pane-focus-blur': `${pose.blur}px` };\n\t\tfor (const [name, value] of Object.entries(values)) {\n\t\t\tif (this.root.style.getPropertyValue(name) !== value) this.root.style.setProperty(name, value);\n\t\t}\n\t\tif (!pane || !this.body) return;\n\t\tthis.body.style.setProperty('--spatial-pane-focus-origin-y', `${pose.pivotY - this.bodyTop + this.scrollY}px`);\n\t\tfor (const region of this.regions) {\n\t\t\tconst top = region.hasAttribute('data-spatial-detail-pane-submenu-shell') ? this.layout!.submenu!.y\n\t\t\t\t: region.hasAttribute('data-spatial-detail-pane-header') || region.hasAttribute('data-spatial-detail-pane-surface') ? pane.surface.y : undefined;\n\t\t\tif (top !== undefined) region.style.setProperty('--spatial-pane-focus-origin-y', `${pose.pivotY - top}px`);\n\t\t}\n\t}\n\n\tprivate readonly handleFocus = (event: FocusEvent) => {\n\t\t// VirtualScrollController owns the enhanced path; native DOM uses identical bounds.\n\t\tif (!this.layout?.pane || this.hidden || this.stage?.classList.contains('stage-virtual-scroll-active')) return;\n\t\tconst target = event.target;\n\t\tif (!(target instanceof HTMLElement) || !this.body?.contains(target)) return;\n\t\tconst rect = target.getBoundingClientRect();\n\t\tconst viewport = this.layout.pane.body;\n\t\tconst bottom = Math.min(viewport.y + viewport.height, this.layout.submenu?.y ?? Infinity);\n\t\tif (rect.top >= viewport.y && rect.bottom <= bottom) return;\n\t\twindow.scrollTo({ top: Math.max(0, window.scrollY + rect.top - viewport.y - Math.max(0, (bottom - viewport.y - rect.height) / 2)), behavior: 'instant' });\n\t};\n}\n"]}
@@ -16,6 +16,19 @@ export interface SpatialMessages {
16
16
  mousePan: string;
17
17
  /** Plain text; {spacemouse} inserts the external SpaceMouse link. */
18
18
  mouseNavigationHint: string;
19
+ spaceMousePermission: string;
20
+ spaceMouseTitle: string;
21
+ spaceMouseConnected: string;
22
+ spaceMouseConnecting: string;
23
+ spaceMouseReady: string;
24
+ spaceMouseCancelled: string;
25
+ spaceMousePermissionTitle: string;
26
+ spaceMouseUnavailableTitle: string;
27
+ spaceMouseUnavailable: string;
28
+ spaceMouseDiscover: string;
29
+ spaceMouseClose: string;
30
+ spaceMouseConfirm: string;
31
+ spaceMouseDenied: string;
19
32
  touchRotate: string;
20
33
  touchZoom: string;
21
34
  touchPan: string;
@@ -1 +1 @@
1
- {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/spatial-element/messages.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,MAAM,WAAW,eAAe;IAC/B,QAAQ,EAAE;QACT,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,eAAe,EAAE;QAChB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,EAAE,MAAM,CAAC;QACZ,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,qEAAqE;QACrE,mBAAmB,EAAE,MAAM,CAAC;QAC5B,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,eAAe,EAAE,MAAM,CAAC;KACxB,CAAC;CACF;AAED,iFAAiF;AACjF,MAAM,MAAM,oBAAoB,GAAG;KAAG,CAAC,IAAI,MAAM,eAAe,CAAC,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AAElG,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC;KAC5C,CAAC,IAAI,MAAM,eAAe,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;CAC1D,CAiBC,CAAC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,oBAAoB,GAAG;KAAG,CAAC,IAAI,MAAM,eAAe,CAAC,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AAElG,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC;KAC5C,CAAC,IAAI,MAAM,eAAe,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;CAC1D,CA8BC,CAAC;AAEH,wBAAgB,sBAAsB,CAAC,KAAK,GAAE,oBAAyB,GAAG,eAAe,CAaxF"}
@@ -9,6 +9,19 @@ export const defaultSpatialMessages = Object.freeze({
9
9
  mouseZoom: 'Use the scroll wheel',
10
10
  mousePan: 'Drag with the right mouse button',
11
11
  mouseNavigationHint: 'Alternatively, use a {spacemouse} to navigate.',
12
+ spaceMousePermission: 'To use your SpaceMouse, allow this website to access the local 3Dconnexion driver. Select OK to try again and allow access when your browser asks.',
13
+ spaceMouseTitle: 'click to connect spacemouse for 3d navigation',
14
+ spaceMouseConnected: 'spacemouse is connected, click to disconnect',
15
+ spaceMouseConnecting: "Searching for SpaceMouse, click to cancel",
16
+ spaceMouseReady: "SpaceMouse connected. You can now navigate the model.",
17
+ spaceMouseCancelled: "SpaceMouse search cancelled at your request.",
18
+ spaceMousePermissionTitle: "Allow SpaceMouse access",
19
+ spaceMouseUnavailableTitle: "No SpaceMouse found",
20
+ spaceMouseUnavailable: "No SpaceMouse connection could be established. Connect your device and check that the 3Dconnexion 3DxWare driver is installed and running.",
21
+ spaceMouseDiscover: "Discover SpaceMouse at 3dconnexion.com",
22
+ spaceMouseClose: "Close",
23
+ spaceMouseConfirm: "OK",
24
+ spaceMouseDenied: 'Access is blocked. Allow access to apps on this device in your browser’s site settings, then try again.',
12
25
  touchRotate: 'Drag with one finger',
13
26
  touchZoom: 'Pinch with two fingers',
14
27
  touchPan: 'Drag with two fingers',
@@ -1 +1 @@
1
- {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/spatial-element/messages.ts"],"names":[],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EAAE,KAAK,CAAC,eAAe,CAAC;KACrF,CAAC;AACH,CAAC","sourcesContent":["/** Package-owned interface copy. Product content remains part of SpatialElementData. */\nexport interface SpatialMessages {\n\tcontrols: {\n\t\thelp: string;\n\t\tcloseHelp: string;\n\t\tdetailView: string;\n\t\tfullscreen: string;\n\t};\n\tinteractionHelp: {\n\t\ttitle: string;\n\t\trotate: string;\n\t\tzoom: string;\n\t\tpan: string;\n\t\tmouseRotate: string;\n\t\tmouseZoom: string;\n\t\tmousePan: string;\n\t\t/** Plain text; {spacemouse} inserts the external SpaceMouse link. */\n\t\tmouseNavigationHint: string;\n\t\ttouchRotate: string;\n\t\ttouchZoom: string;\n\t\ttouchPan: string;\n\t\ttouchHint: string;\n\t\ttouchScrollHint: string;\n\t};\n}\n\n/** Override individual strings; omitted groups/keys use the English defaults. */\nexport type SpatialMessagesInput = { [K in keyof SpatialMessages]?: Partial<SpatialMessages[K]> };\n\nexport const defaultSpatialMessages: Readonly<{\n\t[K in keyof SpatialMessages]: Readonly<SpatialMessages[K]>;\n}> = Object.freeze({\n\tcontrols: Object.freeze({ help: '3D controls', closeHelp: 'Close help', detailView: 'Detail view', fullscreen: 'Fullscreen' }),\n\tinteractionHelp: Object.freeze({\n\t\ttitle: 'Explore in 3D',\n\t\trotate: 'Rotate',\n\t\tzoom: 'Zoom',\n\t\tpan: 'Pan',\n\t\tmouseRotate: 'Drag with the left mouse button',\n\t\tmouseZoom: 'Use the scroll wheel',\n\t\tmousePan: 'Drag with the right mouse button',\n\t\tmouseNavigationHint: 'Alternatively, use a {spacemouse} to navigate.',\n\t\ttouchRotate: 'Drag with one finger',\n\t\ttouchZoom: 'Pinch with two fingers',\n\t\ttouchPan: 'Drag with two fingers',\n\t\ttouchHint: '3D · Drag with one finger to rotate',\n\t\ttouchScrollHint: 'Touch outside the model to scroll the page.'\n\t})\n});\n\nexport function resolveSpatialMessages(input: SpatialMessagesInput = {}): SpatialMessages {\n\tconst merge = <T extends object>(defaults: T, overrides?: Partial<T>): T => {\n\t\tconst result = { ...defaults };\n\t\tfor (const key of Object.keys(defaults) as (keyof T)[]) {\n\t\t\tconst value = overrides?.[key];\n\t\t\tif (typeof value === 'string') result[key] = value as T[keyof T];\n\t\t}\n\t\treturn result;\n\t};\n\treturn {\n\t\tcontrols: merge(defaultSpatialMessages.controls, input.controls),\n\t\tinteractionHelp: merge(defaultSpatialMessages.interactionHelp, input.interactionHelp)\n\t};\n}\n"]}
1
+ {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/spatial-element/messages.ts"],"names":[],"mappings":"AA0CA,MAAM,CAAC,MAAM,sBAAsB,GAE9B,MAAM,CAAC,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC;IAC9H,eAAe,EAAE,MAAM,CAAC,MAAM,CAAC;QAC9B,KAAK,EAAE,eAAe;QACtB,MAAM,EAAE,QAAQ;QAChB,IAAI,EAAE,MAAM;QACZ,GAAG,EAAE,KAAK;QACV,WAAW,EAAE,iCAAiC;QAC9C,SAAS,EAAE,sBAAsB;QACjC,QAAQ,EAAE,kCAAkC;QAC5C,mBAAmB,EAAE,gDAAgD;QACrE,oBAAoB,EAAE,oJAAoJ;QAC1K,eAAe,EAAE,+CAA+C;QAChE,mBAAmB,EAAE,8CAA8C;QACnE,oBAAoB,EAAE,2CAA2C;QACjE,eAAe,EAAE,uDAAuD;QACxE,mBAAmB,EAAE,8CAA8C;QACnE,yBAAyB,EAAE,yBAAyB;QACpD,0BAA0B,EAAE,qBAAqB;QACjD,qBAAqB,EAAE,4IAA4I;QACnK,kBAAkB,EAAE,wCAAwC;QAC5D,eAAe,EAAE,OAAO;QACxB,iBAAiB,EAAE,IAAI;QACvB,gBAAgB,EAAE,yGAAyG;QAC3H,WAAW,EAAE,sBAAsB;QACnC,SAAS,EAAE,wBAAwB;QACnC,QAAQ,EAAE,uBAAuB;QACjC,SAAS,EAAE,qCAAqC;QAChD,eAAe,EAAE,6CAA6C;KAC9D,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,UAAU,sBAAsB,CAAC,QAA8B,EAAE;IACtE,MAAM,KAAK,GAAG,CAAmB,QAAW,EAAE,SAAsB,EAAK,EAAE;QAC1E,MAAM,MAAM,GAAG,EAAE,GAAG,QAAQ,EAAE,CAAC;QAC/B,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAgB,EAAE,CAAC;YACxD,MAAM,KAAK,GAAG,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC;YAC/B,IAAI,OAAO,KAAK,KAAK,QAAQ;gBAAE,MAAM,CAAC,GAAG,CAAC,GAAG,KAAmB,CAAC;QAClE,CAAC;QACD,OAAO,MAAM,CAAC;IACf,CAAC,CAAC;IACF,OAAO;QACN,QAAQ,EAAE,KAAK,CAAC,sBAAsB,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC;QAChE,eAAe,EAAE,KAAK,CAAC,sBAAsB,CAAC,eAAe,EAAE,KAAK,CAAC,eAAe,CAAC;KACrF,CAAC;AACH,CAAC","sourcesContent":["/** Package-owned interface copy. Product content remains part of SpatialElementData. */\nexport interface SpatialMessages {\n\tcontrols: {\n\t\thelp: string;\n\t\tcloseHelp: string;\n\t\tdetailView: string;\n\t\tfullscreen: string;\n\t};\n\tinteractionHelp: {\n\t\ttitle: string;\n\t\trotate: string;\n\t\tzoom: string;\n\t\tpan: string;\n\t\tmouseRotate: string;\n\t\tmouseZoom: string;\n\t\tmousePan: string;\n\t\t/** Plain text; {spacemouse} inserts the external SpaceMouse link. */\n\t\tmouseNavigationHint: string;\n\t\tspaceMousePermission: string;\n\t\tspaceMouseTitle: string;\n\t\tspaceMouseConnected: string;\n\t\tspaceMouseConnecting: string;\n\t\tspaceMouseReady: string;\n\t\tspaceMouseCancelled: string;\n\t\tspaceMousePermissionTitle: string;\n\t\tspaceMouseUnavailableTitle: string;\n\t\tspaceMouseUnavailable: string;\n\t\tspaceMouseDiscover: string;\n\t\tspaceMouseClose: string;\n\t\tspaceMouseConfirm: string;\n\t\tspaceMouseDenied: string;\n\t\ttouchRotate: string;\n\t\ttouchZoom: string;\n\t\ttouchPan: string;\n\t\ttouchHint: string;\n\t\ttouchScrollHint: string;\n\t};\n}\n\n/** Override individual strings; omitted groups/keys use the English defaults. */\nexport type SpatialMessagesInput = { [K in keyof SpatialMessages]?: Partial<SpatialMessages[K]> };\n\nexport const defaultSpatialMessages: Readonly<{\n\t[K in keyof SpatialMessages]: Readonly<SpatialMessages[K]>;\n}> = Object.freeze({\n\tcontrols: Object.freeze({ help: '3D controls', closeHelp: 'Close help', detailView: 'Detail view', fullscreen: 'Fullscreen' }),\n\tinteractionHelp: Object.freeze({\n\t\ttitle: 'Explore in 3D',\n\t\trotate: 'Rotate',\n\t\tzoom: 'Zoom',\n\t\tpan: 'Pan',\n\t\tmouseRotate: 'Drag with the left mouse button',\n\t\tmouseZoom: 'Use the scroll wheel',\n\t\tmousePan: 'Drag with the right mouse button',\n\t\tmouseNavigationHint: 'Alternatively, use a {spacemouse} to navigate.',\n\t\tspaceMousePermission: 'To use your SpaceMouse, allow this website to access the local 3Dconnexion driver. Select OK to try again and allow access when your browser asks.',\n\t\tspaceMouseTitle: 'click to connect spacemouse for 3d navigation',\n\t\tspaceMouseConnected: 'spacemouse is connected, click to disconnect',\n\t\tspaceMouseConnecting: \"Searching for SpaceMouse, click to cancel\",\n\t\tspaceMouseReady: \"SpaceMouse connected. You can now navigate the model.\",\n\t\tspaceMouseCancelled: \"SpaceMouse search cancelled at your request.\",\n\t\tspaceMousePermissionTitle: \"Allow SpaceMouse access\",\n\t\tspaceMouseUnavailableTitle: \"No SpaceMouse found\",\n\t\tspaceMouseUnavailable: \"No SpaceMouse connection could be established. Connect your device and check that the 3Dconnexion 3DxWare driver is installed and running.\",\n\t\tspaceMouseDiscover: \"Discover SpaceMouse at 3dconnexion.com\",\n\t\tspaceMouseClose: \"Close\",\n\t\tspaceMouseConfirm: \"OK\",\n\t\tspaceMouseDenied: 'Access is blocked. Allow access to apps on this device in your browser’s site settings, then try again.',\n\t\ttouchRotate: 'Drag with one finger',\n\t\ttouchZoom: 'Pinch with two fingers',\n\t\ttouchPan: 'Drag with two fingers',\n\t\ttouchHint: '3D · Drag with one finger to rotate',\n\t\ttouchScrollHint: 'Touch outside the model to scroll the page.'\n\t})\n});\n\nexport function resolveSpatialMessages(input: SpatialMessagesInput = {}): SpatialMessages {\n\tconst merge = <T extends object>(defaults: T, overrides?: Partial<T>): T => {\n\t\tconst result = { ...defaults };\n\t\tfor (const key of Object.keys(defaults) as (keyof T)[]) {\n\t\t\tconst value = overrides?.[key];\n\t\t\tif (typeof value === 'string') result[key] = value as T[keyof T];\n\t\t}\n\t\treturn result;\n\t};\n\treturn {\n\t\tcontrols: merge(defaultSpatialMessages.controls, input.controls),\n\t\tinteractionHelp: merge(defaultSpatialMessages.interactionHelp, input.interactionHelp)\n\t};\n}\n"]}
@@ -49,7 +49,7 @@ export declare function getDockedMinimapInteractionRect(minimap: SpatialElementD
49
49
  export declare function getSpatialElementDockBreakpoint(minimapDocumentTop: number, minimapDockTop: number): number;
50
50
  /**
51
51
  * Maps page scroll directly to the minimap/header handoff. The transition starts
52
- * at the top of the page and completes when the source minimap has fully left the viewport.
52
+ * at the supplied docking threshold and completes when the source panel has left the viewport.
53
53
  */
54
54
  export declare function getSpatialElementDockPresentationProgress(scrollY: number, minimapDocumentBottom: number, startScrollY?: number): number;
55
55
  /** Adds a small release hysteresis so trackpad momentum cannot flicker the header. */
@@ -127,7 +127,7 @@ export function getSpatialElementDockBreakpoint(minimapDocumentTop, minimapDockT
127
127
  }
128
128
  /**
129
129
  * Maps page scroll directly to the minimap/header handoff. The transition starts
130
- * at the top of the page and completes when the source minimap has fully left the viewport.
130
+ * at the supplied docking threshold and completes when the source panel has left the viewport.
131
131
  */
132
132
  export function getSpatialElementDockPresentationProgress(scrollY, minimapDocumentBottom, startScrollY = 0) {
133
133
  const start = Number.isFinite(startScrollY) ? Math.max(startScrollY, 0) : 0;
@@ -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,qFAAqF;AACrF,MAAM,UAAU,+BAA+B,CAAC,KAA4B,EAAE,YAAY,GAAG,CAAC;IAC7F,MAAM,MAAM,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAC1C,IAAI,CAAC,MAAM,CAAC,IAAI;QAAE,OAAO,SAAS,CAAC;IACnC,MAAM,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAA2D,EAA0B,EAAE,CAC3H,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IACtC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC3C,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI;QACjC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;QACtB,GAAG,EAAE,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,MAAM;QAC/B,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC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AE,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"]}
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,qFAAqF;AACrF,MAAM,UAAU,+BAA+B,CAAC,KAA4B,EAAE,YAAY,GAAG,CAAC;IAC7F,MAAM,MAAM,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAC1C,IAAI,CAAC,MAAM,CAAC,IAAI;QAAE,OAAO,SAAS,CAAC;IACnC,MAAM,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAA2D,EAA0B,EAAE,CAC3H,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IACtC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC3C,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI;QACjC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;QACtB,GAAG,EAAE,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,MAAM;QAC/B,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAA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BAAmB,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 supplied docking threshold and completes when the source panel has 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"]}
@@ -1 +1 @@
1
- {"version":3,"file":"LiquidGlassPanel.d.ts","sourceRoot":"","sources":["../../src/stage/LiquidGlassPanel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AA6BtC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAOzC,MAAM,WAAW,uBAAuB;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACpC,gEAAgE;IAChE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uFAAuF;IACvF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B,8EAA8E;IAC9E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4DAA4D;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iEAAiE;IACjE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAkBD,wFAAwF;AACxF,eAAO,MAAM,2BAA2B,OAAO,CAAC;AAEhD,+FAA+F;AAC/F,wBAAgB,8BAA8B,CAC7C,OAAO,GAAE,uBAA4B,GACnC,QAAQ,CAAC,uBAAuB,CAAC,CA2BnC;AAUD,qBAAa,gBAAgB;IAC5B,u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AAuB,CAAC,CAAC;IAEpD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAoC;IACpE,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;IACvC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;IACxC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAuB;IACxD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAuB;IACrD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAKzB;IACJ,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAA8B;IAC/D,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAA6B;IACjE,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA0B;IACxD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA0B;IACxD,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAsD;IACzF,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAgB;gBAErC,eAAe,EAAE,KAAK,CAAC,OAAO,EAAE,OAAO,GAAE,uBAA4B;IAqGjF,qFAAqF;IACrF,mBAAmB;IAEnB,kBAAkB,CAAC,KAAK,EAAE,MAAM;IAehC,kBAAkB,CAAC,eAAe,EAAE,KAAK,CAAC,OAAO;IAKjD,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,SAAsB;IA0CzE,OAAO;CAWP;AAmID;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,GAkCQ,IAAI,CAAC,MAAM,CAAC,CAC9E"}
@@ -300,12 +300,15 @@ export function inverseAcesToneMapping(target) {
300
300
  const outputMatrix = mat3(1.60475, -0.53108, -0.07367, -0.10208, 1.10813, -0.00605, -0.00327, -0.07276, 1.07602);
301
301
  const fittedTarget = tslMax(inverse(outputMatrix).mul(target), 0);
302
302
  const a = float(1).sub(fittedTarget.mul(0.983729));
303
- const b = float(0.0245786).sub(fittedTarget.mul(0.432951));
303
+ const b = float(0.0245786).sub(fittedTarget.mul(0.983729 * 0.432951));
304
304
  const c = float(-0.000090537).sub(fittedTarget.mul(0.238081));
305
305
  const discriminant = tslMax(b.mul(b).sub(a.mul(c).mul(4)), 0);
306
306
  const fittedInput = b.negate().add(sqrt(discriminant)).div(a.mul(2));
307
307
  const transformedInput = inverse(inputMatrix).mul(fittedInput);
308
- return tslMax(transformedInput.mul(0.6 / STAGE_TONE_MAPPING_EXPOSURE), 0);
308
+ // Saturated UI colors can require a negative scene-linear channel before
309
+ // ACES. Clamping it here changes the hue (notably blue -> lavender). The
310
+ // output transform clamps only after reversing the matrix/curve, as intended.
311
+ return transformedInput.mul(0.6 / STAGE_TONE_MAPPING_EXPOSURE);
309
312
  }
310
313
  function getDepthColor(tint) {
311
314
  return new THREE.Color(tint).lerp(new THREE.Color(0x101820), 0.72);