@spatial-elements/core 0.1.0-beta.2 → 1.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -3
- package/dist/catalog/CatalogGeometryFade.d.ts.map +1 -1
- package/dist/catalog/CatalogGeometryFade.js +6 -2
- package/dist/catalog/CatalogGeometryFade.js.map +1 -1
- package/dist/catalog/CatalogPreparation.d.ts +3 -3
- package/dist/catalog/CatalogPreparation.d.ts.map +1 -1
- package/dist/catalog/CatalogPreparation.js +2 -1
- package/dist/catalog/CatalogPreparation.js.map +1 -1
- package/dist/catalog/CatalogSpatialElementLayer.d.ts.map +1 -1
- package/dist/catalog/CatalogSpatialElementLayer.js +33 -17
- package/dist/catalog/CatalogSpatialElementLayer.js.map +1 -1
- package/dist/catalog/CatalogTransition.d.ts.map +1 -1
- package/dist/catalog/CatalogTransition.js +25 -7
- package/dist/catalog/CatalogTransition.js.map +1 -1
- package/dist/catalog/SpatialPageRegistry.d.ts +17 -0
- package/dist/catalog/SpatialPageRegistry.d.ts.map +1 -0
- package/dist/catalog/SpatialPageRegistry.js +21 -0
- package/dist/catalog/SpatialPageRegistry.js.map +1 -0
- package/dist/catalog/catalogPage.d.ts +7 -3
- package/dist/catalog/catalogPage.d.ts.map +1 -1
- package/dist/catalog/catalogPage.js.map +1 -1
- package/dist/catalog/spatialElementAssets.d.ts +5 -5
- package/dist/catalog/spatialElementAssets.d.ts.map +1 -1
- package/dist/catalog/spatialElementAssets.js.map +1 -1
- package/dist/catalog/spatialElementLodPair.d.ts +2 -1
- package/dist/catalog/spatialElementLodPair.d.ts.map +1 -1
- package/dist/catalog/spatialElementLodPair.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/spatial-element/SpatialElementDockController.d.ts.map +1 -1
- package/dist/spatial-element/SpatialElementDockController.js +4 -3
- package/dist/spatial-element/SpatialElementDockController.js.map +1 -1
- package/dist/spatial-element/spatialElement.d.ts +16 -12
- package/dist/spatial-element/spatialElement.d.ts.map +1 -1
- package/dist/spatial-element/spatialElement.js +32 -6
- package/dist/spatial-element/spatialElement.js.map +1 -1
- package/dist/spatial-element/spatialElementGeometry.d.ts +22 -0
- package/dist/spatial-element/spatialElementGeometry.d.ts.map +1 -0
- package/dist/spatial-element/spatialElementGeometry.js +40 -0
- package/dist/spatial-element/spatialElementGeometry.js.map +1 -0
- package/dist/spatial-element/spatialElementScene.d.ts +16 -0
- package/dist/spatial-element/spatialElementScene.d.ts.map +1 -0
- package/dist/spatial-element/spatialElementScene.js +22 -0
- package/dist/spatial-element/spatialElementScene.js.map +1 -0
- package/dist/spatial-element/spatialTheme.d.ts +16 -0
- package/dist/spatial-element/spatialTheme.d.ts.map +1 -0
- package/dist/spatial-element/spatialTheme.js +53 -0
- package/dist/spatial-element/spatialTheme.js.map +1 -0
- package/dist/spatial-element/types.d.ts +63 -33
- package/dist/spatial-element/types.d.ts.map +1 -1
- package/dist/spatial-element/types.js.map +1 -1
- package/dist/stage/MinimapController.js +1 -1
- package/dist/stage/MinimapController.js.map +1 -1
- package/dist/stage/PanelPresentationController.d.ts.map +1 -1
- package/dist/stage/PanelPresentationController.js +5 -3
- package/dist/stage/PanelPresentationController.js.map +1 -1
- package/dist/stage/SpatialElementInteractionController.d.ts +0 -1
- package/dist/stage/SpatialElementInteractionController.d.ts.map +1 -1
- package/dist/stage/SpatialElementInteractionController.js +0 -2
- package/dist/stage/SpatialElementInteractionController.js.map +1 -1
- package/dist/stage/StageExperience.d.ts +10 -4
- package/dist/stage/StageExperience.d.ts.map +1 -1
- package/dist/stage/StageExperience.js +18 -8
- package/dist/stage/StageExperience.js.map +1 -1
- package/dist/stage/StageRenderPipeline.d.ts +8 -1
- package/dist/stage/StageRenderPipeline.d.ts.map +1 -1
- package/dist/stage/StageRenderPipeline.js +23 -6
- package/dist/stage/StageRenderPipeline.js.map +1 -1
- package/dist/stage/VirtualScrollController.d.ts.map +1 -1
- package/dist/stage/VirtualScrollController.js +0 -2
- package/dist/stage/VirtualScrollController.js.map +1 -1
- package/dist/stage/minimap/MinimapGeometry.d.ts.map +1 -1
- package/dist/stage/minimap/MinimapGeometry.js +29 -0
- package/dist/stage/minimap/MinimapGeometry.js.map +1 -1
- package/dist/stage/panelContext.d.ts +1 -1
- package/dist/stage/panelContext.d.ts.map +1 -1
- package/dist/stage/panelContext.js.map +1 -1
- package/dist/stage/renderSettings.d.ts +10 -0
- package/dist/stage/renderSettings.d.ts.map +1 -0
- package/dist/stage/renderSettings.js +27 -0
- package/dist/stage/renderSettings.js.map +1 -0
- package/dist/stage/renderTargetInventory.d.ts +1 -1
- package/dist/stage/renderTargetInventory.js +1 -1
- package/dist/stage/renderTargetInventory.js.map +1 -1
- package/dist/stage/spatialElementFrame.d.ts.map +1 -1
- package/dist/stage/spatialElementFrame.js +5 -1
- package/dist/stage/spatialElementFrame.js.map +1 -1
- package/dist/stage/stageTypes.d.ts +9 -0
- package/dist/stage/stageTypes.d.ts.map +1 -1
- package/dist/stage/stageTypes.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VirtualScrollController.js","sourceRoot":"","sources":["../../src/stage/VirtualScrollController.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,qBAAqB,EACrB,4BAA4B,EAC5B,oBAAoB,EACpB,yBAAyB,EACzB,uBAAuB,EAEvB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,iCAAiC,EACjC,6BAA6B,EAC7B,+BAA+B,EAC/B,qBAAqB,EACrB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,YAAY,GAAG,6BAA6B,CAAC;AACnD,MAAM,qBAAqB,GAAG,EAAE,CAAC;AACjC,MAAM,wBAAwB,GAAG,IAAI,GAAG,CAAC;IACxC,WAAW;IACX,SAAS;IACT,KAAK;IACL,MAAM;IACN,UAAU;IACV,QAAQ;IAC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,CAAC,OAAO,OAAO,CAAC,OAAO,QAAQ,CAAC;QAC9E,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,oBAAoB,EAAE,GAAG,OAAO,IAAI,CAAC,CAAC;IACtE,CAAC;IAEO,qBAAqB;QAC5B,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC;QAClD,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;QACpF,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;IACrD,CAAC;CACD","sourcesContent":["import {\n\tSTAGE_SCROLL_PRIORITY,\n\tgetStageVisualScrollPosition,\n\tmarkStageScrollInput,\n\tsubscribeStageScrollFrame,\n\tsyncStageScrollToNative,\n\ttype StageScrollFrame\n} from './scrollFrame.js';\nimport {\n\tSTAGE_ANCHOR_NAVIGATION_END_EVENT,\n\tSTAGE_ANCHOR_NAVIGATION_EVENT,\n\tSTAGE_ANCHOR_SCROLL_DURATION_MS,\n\teaseStageAnchorScroll\n} from './scrollAnimation.js';\n\nconst ACTIVE_CLASS = 'stage-virtual-scroll-active';\nconst FOCUS_VIEWPORT_MARGIN = 24;\nconst SCROLL_INTERRUPTION_KEYS = new Set([\n\t'ArrowDown',\n\t'ArrowUp',\n\t'End',\n\t'Home',\n\t'PageDown',\n\t'PageUp',\n\t' '\n]);\n\nexport type ScrollRestoreTarget = { x: number; y: number } | { hash: string };\n\nexport interface ScrollPositions {\n\tnative: { x: number; y: number };\n\tvisual: { x: number; y: number };\n}\n\n/**\n * Keeps native scrolling as the input and scrollbar source while moving the\n * complete visible DOM from the same animation frame consumed by the stage.\n */\nexport class VirtualScrollController {\n\tprivate stopScrollFrames?: () => void;\n\tprivate resizeObserver?: ResizeObserver;\n\tprivate measureFrame = 0;\n\tprivate hashFrame = 0;\n\tprivate anchorScrollFrame = 0;\n\tprivate anchorNavigationTargetId?: string;\n\tprivate scrollY = 0;\n\tprivate started = false;\n\tprivate navigation?: { token: object; interrupted: boolean };\n\tprivate historyHashUrl?: string;\n\t/** The navigation bridge supplies SvelteKit's public history writers. */\n\twriteHash?: (url: URL, replace: boolean) => void;\n\n\tconstructor(\n\t\tprivate readonly container: HTMLElement,\n\t\tprivate readonly content: HTMLElement,\n\t\tprivate readonly spacer: HTMLElement\n\t) {}\n\n\tget active() {\n\t\treturn this.started;\n\t}\n\n\treadPositions(): ScrollPositions {\n\t\tconst visual = getStageVisualScrollPosition();\n\t\treturn {\n\t\t\tnative: { x: window.scrollX, y: window.scrollY },\n\t\t\tvisual: { x: visual.scrollX, y: visual.scrollY }\n\t\t};\n\t}\n\n\tbeginNavigation(token: object) {\n\t\tthis.cancelAnchorScroll();\n\t\tif (this.hashFrame) cancelAnimationFrame(this.hashFrame);\n\t\tthis.hashFrame = 0;\n\t\tthis.navigation = { token, interrupted: false };\n\t}\n\n\tmeasureExtentNow() {\n\t\tif (!this.started) return;\n\t\tif (this.measureFrame) cancelAnimationFrame(this.measureFrame);\n\t\tthis.measureFrame = 0;\n\t\tthis.measureDocumentHeight();\n\t\treturn Number.parseFloat(this.spacer.style.height);\n\t}\n\n\trestoreTarget(target: ScrollRestoreTarget, token: object) {\n\t\tif (!this.started || this.navigation?.token !== token || this.navigation.interrupted) return;\n\t\tlet position: { x: number; y: number };\n\t\tif ('hash' in target) {\n\t\t\tconst element = this.getHashTarget(target.hash);\n\t\t\tposition = { x: 0, y: element ? this.getElementScrollTop(element) : 0 };\n\t\t} else {\n\t\t\tposition = target;\n\t\t}\n\t\twindow.scrollTo({ left: position.x, top: position.y, behavior: 'instant' });\n\t\tsyncStageScrollToNative();\n\t\treturn this.readPositions();\n\t}\n\n\tendNavigation(token: object) {\n\t\tif (this.navigation?.token === token) this.navigation = undefined;\n\t}\n\n\tstart() {\n\t\tif (this.started) return;\n\t\tthis.started = true;\n\n\t\t// Preserve the in-flow height before the content becomes viewport-fixed.\n\t\tthis.measureDocumentHeight();\n\t\tthis.container.classList.add(ACTIVE_CLASS);\n\t\tthis.applyPosition(window.scrollX, window.scrollY);\n\t\tthis.measureDocumentHeight();\n\n\t\tthis.stopScrollFrames = subscribeStageScrollFrame(\n\t\t\tthis.handleScrollFrame,\n\t\t\tSTAGE_SCROLL_PRIORITY.virtualDocument\n\t\t);\n\t\twindow.addEventListener('resize', this.handleResize, { passive: true });\n\t\t// Panel content is moved into the CSS3D renderer after enhancement. Listen\n\t\t// on the stable stage container so anchors and focus keep working there too.\n\t\tthis.container.addEventListener('click', this.handleAnchorClick);\n\t\tthis.container.addEventListener('focusin', this.handleFocusIn);\n\t\twindow.addEventListener('hashchange', this.handleHashChange);\n\t\twindow.addEventListener('popstate', this.handlePopState);\n\t\twindow.addEventListener('wheel', this.handleUserInput, { passive: true });\n\t\twindow.addEventListener('touchstart', this.handleUserInput, { passive: true });\n\t\twindow.addEventListener('pointerdown', this.handleUserInput, { passive: true });\n\t\twindow.addEventListener('keydown', this.handleScrollInterruptionKey);\n\n\t\tif ('ResizeObserver' in window) {\n\t\t\tthis.resizeObserver = new ResizeObserver(this.scheduleMeasurement);\n\t\t\tthis.resizeObserver.observe(this.content);\n\t\t}\n\n\t\tvoid document.fonts?.ready.then(() => this.scheduleMeasurement());\n\t\tif (window.location.hash) this.scheduleHashNavigation();\n\t}\n\n\tdestroy() {\n\t\tif (!this.started) return;\n\t\tthis.started = false;\n\t\tthis.stopScrollFrames?.();\n\t\tthis.stopScrollFrames = undefined;\n\t\twindow.removeEventListener('resize', this.handleResize);\n\t\tthis.container.removeEventListener('click', this.handleAnchorClick);\n\t\tthis.container.removeEventListener('focusin', this.handleFocusIn);\n\t\twindow.removeEventListener('hashchange', this.handleHashChange);\n\t\twindow.removeEventListener('popstate', this.handlePopState);\n\t\twindow.removeEventListener('wheel', this.handleUserInput);\n\t\twindow.removeEventListener('touchstart', this.handleUserInput);\n\t\twindow.removeEventListener('pointerdown', this.handleUserInput);\n\t\twindow.removeEventListener('keydown', this.handleScrollInterruptionKey);\n\t\tthis.resizeObserver?.disconnect();\n\t\tthis.resizeObserver = undefined;\n\t\tif (this.measureFrame) cancelAnimationFrame(this.measureFrame);\n\t\tif (this.hashFrame) cancelAnimationFrame(this.hashFrame);\n\t\tthis.historyHashUrl = undefined;\n\t\tthis.navigation = undefined;\n\t\tthis.cancelAnchorScroll();\n\t\tthis.measureFrame = 0;\n\t\tthis.hashFrame = 0;\n\t\tthis.content.style.removeProperty('transform');\n\t\tthis.content.style.removeProperty('--virtual-scroll-y');\n\t\tthis.spacer.style.removeProperty('height');\n\t\tthis.container.classList.remove(ACTIVE_CLASS);\n\t}\n\n\tprivate readonly handleScrollFrame = (frame: StageScrollFrame) => {\n\t\tthis.applyPosition(frame.scrollX, frame.scrollY);\n\t};\n\n\tprivate readonly handleResize = () => {\n\t\tthis.scheduleMeasurement();\n\t};\n\n\tprivate readonly handleHashChange = (event: HashChangeEvent) => {\n\t\tconst restoredByHistory = event.newURL === this.historyHashUrl;\n\t\tthis.historyHashUrl = undefined;\n\t\tif (!restoredByHistory) this.scheduleHashNavigation();\n\t};\n\tprivate readonly handlePopState = () => {\n\t\tif (!this.writeHash) return;\n\t\t// History restoration wins over a fragment, including SvelteKit shallow entries.\n\t\tif (this.hashFrame) cancelAnimationFrame(this.hashFrame);\n\t\tthis.hashFrame = 0;\n\t\tthis.historyHashUrl = window.location.href;\n\t};\n\tprivate readonly handleUserInput = () => {\n\t\tthis.cancelAnchorScroll();\n\t\tif (this.navigation) this.navigation.interrupted = true;\n\t};\n\tprivate readonly handleScrollInterruptionKey = (event: KeyboardEvent) => {\n\t\tif (SCROLL_INTERRUPTION_KEYS.has(event.key)) this.handleUserInput();\n\t};\n\n\tprivate readonly cancelAnchorScroll = () => {\n\t\tif (this.anchorScrollFrame) cancelAnimationFrame(this.anchorScrollFrame);\n\t\tthis.anchorScrollFrame = 0;\n\t\tthis.completeAnchorNavigation();\n\t};\n\n\tprivate completeAnchorNavigation() {\n\t\tconst targetId = this.anchorNavigationTargetId;\n\t\tif (!targetId) return;\n\t\tthis.anchorNavigationTargetId = undefined;\n\t\twindow.dispatchEvent(\n\t\t\tnew CustomEvent(STAGE_ANCHOR_NAVIGATION_END_EVENT, { detail: { targetId } })\n\t\t);\n\t}\n\n\tprivate readonly scheduleMeasurement = () => {\n\t\tif (!this.started || this.measureFrame) return;\n\t\tthis.measureFrame = requestAnimationFrame(() => {\n\t\t\tthis.measureFrame = 0;\n\t\t\tthis.measureDocumentHeight();\n\t\t});\n\t};\n\n\tprivate readonly handleAnchorClick = (event: MouseEvent) => {\n\t\tif (\n\t\t\tthis.navigation ||\n\t\t\tevent.defaultPrevented ||\n\t\t\tevent.button !== 0 ||\n\t\t\tevent.metaKey ||\n\t\t\tevent.ctrlKey ||\n\t\t\tevent.shiftKey ||\n\t\t\tevent.altKey\n\t\t)\n\t\t\treturn;\n\t\tconst target =\n\t\t\tevent.target instanceof Element ? event.target.closest<HTMLAnchorElement>('a[href]') : null;\n\t\tif (!target) return;\n\n\t\tconst url = new URL(target.href, window.location.href);\n\t\tif (\n\t\t\t!url.hash ||\n\t\t\turl.origin !== window.location.origin ||\n\t\t\turl.pathname !== window.location.pathname ||\n\t\t\turl.search !== window.location.search\n\t\t)\n\t\t\treturn;\n\n\t\tconst element = this.getHashTarget(url.hash);\n\t\tif (!element) return;\n\n\t\tevent.preventDefault();\n\t\tconst animated =\n\t\t\ttarget.hasAttribute('data-spatial-element-tab-id') ||\n\t\t\ttarget.hasAttribute('data-spatial-element-section-navigation');\n\t\tconst navigationHash =\n\t\t\tanimated && element.hasAttribute('data-stage-scroll-top') ? '' : url.hash;\n\t\tif (window.location.hash !== navigationHash) {\n\t\t\tif (this.writeHash) {\n\t\t\t\turl.hash = navigationHash;\n\t\t\t\tthis.writeHash(url, animated);\n\t\t\t} else if (animated) {\n\t\t\t\turl.hash = navigationHash;\n\t\t\t\thistory.replaceState(history.state, '', url);\n\t\t\t} else {\n\t\t\t\twindow.location.hash = navigationHash;\n\t\t\t}\n\t\t}\n\t\tthis.scrollElementIntoView(element, false, animated);\n\t};\n\n\tprivate scheduleHashNavigation() {\n\t\tif (!this.started || this.hashFrame || this.navigation) return;\n\t\tthis.hashFrame = requestAnimationFrame(() => {\n\t\t\tthis.hashFrame = 0;\n\t\t\tconst element = this.getHashTarget(window.location.hash);\n\t\t\tif (element) {\n\t\t\t\tthis.scrollElementIntoView(element, false, element.hasAttribute('data-spatial-element-tab-target'));\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate getHashTarget(hash: string) {\n\t\tif (!hash || hash === '#') return null;\n\t\ttry {\n\t\t\treturn this.container.querySelector<HTMLElement>(\n\t\t\t\t`#${CSS.escape(decodeURIComponent(hash.slice(1)))}`\n\t\t\t);\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tprivate readonly handleFocusIn = (event: FocusEvent) => {\n\t\tif (this.navigation || !(event.target instanceof HTMLElement)) return;\n\t\tconst rect = event.target.getBoundingClientRect();\n\t\tif (\n\t\t\trect.top >= FOCUS_VIEWPORT_MARGIN &&\n\t\t\trect.bottom <= window.innerHeight - FOCUS_VIEWPORT_MARGIN\n\t\t)\n\t\t\treturn;\n\n\t\tthis.scrollElementIntoView(event.target, true);\n\t};\n\n\tprivate getElementScrollTop(element: HTMLElement, center = false) {\n\t\tconst rect = element.getBoundingClientRect();\n\t\tconst style = window.getComputedStyle(element);\n\t\tconst scrollMarginTop = Number.parseFloat(style.scrollMarginTop) || 0;\n\t\tconst documentTop = rect.top + this.scrollY;\n\t\treturn Math.max(\n\t\t\telement.hasAttribute('data-stage-scroll-top')\n\t\t\t\t? 0\n\t\t\t\t: center\n\t\t\t\t\t? documentTop - (window.innerHeight - rect.height) * 0.5\n\t\t\t\t\t: documentTop - scrollMarginTop,\n\t\t\t0\n\t\t);\n\t}\n\n\tprivate scrollElementIntoView(element: HTMLElement, center = false, animated = false) {\n\t\tconst targetY = this.getElementScrollTop(element, center);\n\n\t\tthis.cancelAnchorScroll();\n\t\tif (animated) {\n\t\t\tthis.anchorNavigationTargetId = element.id;\n\t\t\twindow.dispatchEvent(\n\t\t\t\tnew CustomEvent(STAGE_ANCHOR_NAVIGATION_EVENT, {\n\t\t\t\t\tdetail: { targetId: element.id }\n\t\t\t\t})\n\t\t\t);\n\t\t}\n\t\tif (!animated || window.matchMedia('(prefers-reduced-motion: reduce)').matches) {\n\t\t\tmarkStageScrollInput(animated ? 'navigation' : 'programmatic');\n\t\t\twindow.scrollTo({ top: targetY, behavior: 'instant' });\n\t\t\tthis.completeAnchorNavigation();\n\t\t\treturn;\n\t\t}\n\n\t\tconst startY = this.scrollY;\n\t\tconst distance = targetY - startY;\n\t\tif (Math.abs(distance) < 0.5) {\n\t\t\tmarkStageScrollInput('navigation');\n\t\t\twindow.scrollTo({ top: targetY, behavior: 'instant' });\n\t\t\tthis.completeAnchorNavigation();\n\t\t\treturn;\n\t\t}\n\n\t\tlet startTime: number | undefined;\n\t\tconst animate = (time: number) => {\n\t\t\tif (!this.started) return;\n\t\t\tstartTime ??= time;\n\t\t\tconst progress = Math.min((time - startTime) / STAGE_ANCHOR_SCROLL_DURATION_MS, 1);\n\t\t\tconst scrollTop = startY + distance * easeStageAnchorScroll(progress);\n\t\t\tmarkStageScrollInput('navigation');\n\t\t\twindow.scrollTo({ top: progress === 1 ? targetY : scrollTop, behavior: 'instant' });\n\n\t\t\tif (progress < 1) {\n\t\t\t\tthis.anchorScrollFrame = requestAnimationFrame(animate);\n\t\t\t} else {\n\t\t\t\tthis.anchorScrollFrame = 0;\n\t\t\t\tthis.completeAnchorNavigation();\n\t\t\t}\n\t\t};\n\n\t\tthis.anchorScrollFrame = requestAnimationFrame(animate);\n\t}\n\n\tprivate applyPosition(scrollX: number, scrollY: number) {\n\t\tthis.scrollY = scrollY;\n\t\tthis.content.style.transform = `translate3d(${-scrollX}px, ${-scrollY}px, 0)`;\n\t\tthis.content.style.setProperty('--virtual-scroll-y', `${scrollY}px`);\n\t}\n\n\tprivate measureDocumentHeight() {\n\t\tconst rect = this.content.getBoundingClientRect();\n\t\tconst height = Math.max(this.content.scrollHeight, rect.height, window.innerHeight);\n\t\tthis.spacer.style.height = `${Math.ceil(height)}px`;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"VirtualScrollController.js","sourceRoot":"","sources":["../../src/stage/VirtualScrollController.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,qBAAqB,EACrB,4BAA4B,EAC5B,oBAAoB,EACpB,yBAAyB,EACzB,uBAAuB,EAEvB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,iCAAiC,EACjC,6BAA6B,EAC7B,+BAA+B,EAC/B,qBAAqB,EACrB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,YAAY,GAAG,6BAA6B,CAAC;AACnD,MAAM,qBAAqB,GAAG,EAAE,CAAC;AACjC,MAAM,wBAAwB,GAAG,IAAI,GAAG,CAAC;IACxC,WAAW;IACX,SAAS;IACT,KAAK;IACL,MAAM;IACN,UAAU;IACV,QAAQ;IACR,GAAG;CACH,CAAC,CAAC;AASH;;;GAGG;AACH,MAAM,OAAO,uBAAuB;IAejB;IACA;IACA;IAhBV,gBAAgB,CAAc;IAC9B,cAAc,CAAkB;IAChC,YAAY,GAAG,CAAC,CAAC;IACjB,SAAS,GAAG,CAAC,CAAC;IACd,iBAAiB,GAAG,CAAC,CAAC;IACtB,wBAAwB,CAAU;IAClC,OAAO,GAAG,CAAC,CAAC;IACZ,OAAO,GAAG,KAAK,CAAC;IAChB,UAAU,CAA2C;IACrD,cAAc,CAAU;IAChC,yEAAyE;IACzE,SAAS,CAAwC;IAEjD,YACkB,SAAsB,EACtB,OAAoB,EACpB,MAAmB;QAFnB,cAAS,GAAT,SAAS,CAAa;QACtB,YAAO,GAAP,OAAO,CAAa;QACpB,WAAM,GAAN,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AC;YACtE,oBAAoB,CAAC,YAAY,CAAC,CAAC;YACnC,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC;YAEpF,IAAI,QAAQ,GAAG,CAAC,EAAE,CAAC;gBAClB,IAAI,CAAC,iBAAiB,GAAG,qBAAqB,CAAC,OAAO,CAAC,CAAC;YACzD,CAAC;iBAAM,CAAC;gBACP,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAC;gBAC3B,IAAI,CAAC,wBAAwB,EAAE,CAAC;YACjC,CAAC;QACF,CAAC,CAAC;QAEF,IAAI,CAAC,iBAAiB,GAAG,qBAAqB,CAAC,OAAO,CAAC,CAAC;IACzD,CAAC;IAEO,aAAa,CAAC,OAAe,EAAE,OAAe;QACrD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,GAAG,eAAe,CAAC,OAAO,OAAO,CAAC,OAAO,QAAQ,CAAC;IAC/E,CAAC;IAEO,qBAAqB;QAC5B,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC;QAClD,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;QACpF,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;IACrD,CAAC;CACD","sourcesContent":["import {\n\tSTAGE_SCROLL_PRIORITY,\n\tgetStageVisualScrollPosition,\n\tmarkStageScrollInput,\n\tsubscribeStageScrollFrame,\n\tsyncStageScrollToNative,\n\ttype StageScrollFrame\n} from './scrollFrame.js';\nimport {\n\tSTAGE_ANCHOR_NAVIGATION_END_EVENT,\n\tSTAGE_ANCHOR_NAVIGATION_EVENT,\n\tSTAGE_ANCHOR_SCROLL_DURATION_MS,\n\teaseStageAnchorScroll\n} from './scrollAnimation.js';\n\nconst ACTIVE_CLASS = 'stage-virtual-scroll-active';\nconst FOCUS_VIEWPORT_MARGIN = 24;\nconst SCROLL_INTERRUPTION_KEYS = new Set([\n\t'ArrowDown',\n\t'ArrowUp',\n\t'End',\n\t'Home',\n\t'PageDown',\n\t'PageUp',\n\t' '\n]);\n\nexport type ScrollRestoreTarget = { x: number; y: number } | { hash: string };\n\nexport interface ScrollPositions {\n\tnative: { x: number; y: number };\n\tvisual: { x: number; y: number };\n}\n\n/**\n * Keeps native scrolling as the input and scrollbar source while moving the\n * complete visible DOM from the same animation frame consumed by the stage.\n */\nexport class VirtualScrollController {\n\tprivate stopScrollFrames?: () => void;\n\tprivate resizeObserver?: ResizeObserver;\n\tprivate measureFrame = 0;\n\tprivate hashFrame = 0;\n\tprivate anchorScrollFrame = 0;\n\tprivate anchorNavigationTargetId?: string;\n\tprivate scrollY = 0;\n\tprivate started = false;\n\tprivate navigation?: { token: object; interrupted: boolean };\n\tprivate historyHashUrl?: string;\n\t/** The navigation bridge supplies SvelteKit's public history writers. */\n\twriteHash?: (url: URL, replace: boolean) => void;\n\n\tconstructor(\n\t\tprivate readonly container: HTMLElement,\n\t\tprivate readonly content: HTMLElement,\n\t\tprivate readonly spacer: HTMLElement\n\t) {}\n\n\tget active() {\n\t\treturn this.started;\n\t}\n\n\treadPositions(): ScrollPositions {\n\t\tconst visual = getStageVisualScrollPosition();\n\t\treturn {\n\t\t\tnative: { x: window.scrollX, y: window.scrollY },\n\t\t\tvisual: { x: visual.scrollX, y: visual.scrollY }\n\t\t};\n\t}\n\n\tbeginNavigation(token: object) {\n\t\tthis.cancelAnchorScroll();\n\t\tif (this.hashFrame) cancelAnimationFrame(this.hashFrame);\n\t\tthis.hashFrame = 0;\n\t\tthis.navigation = { token, interrupted: false };\n\t}\n\n\tmeasureExtentNow() {\n\t\tif (!this.started) return;\n\t\tif (this.measureFrame) cancelAnimationFrame(this.measureFrame);\n\t\tthis.measureFrame = 0;\n\t\tthis.measureDocumentHeight();\n\t\treturn Number.parseFloat(this.spacer.style.height);\n\t}\n\n\trestoreTarget(target: ScrollRestoreTarget, token: object) {\n\t\tif (!this.started || this.navigation?.token !== token || this.navigation.interrupted) return;\n\t\tlet position: { x: number; y: number };\n\t\tif ('hash' in target) {\n\t\t\tconst element = this.getHashTarget(target.hash);\n\t\t\tposition = { x: 0, y: element ? this.getElementScrollTop(element) : 0 };\n\t\t} else {\n\t\t\tposition = target;\n\t\t}\n\t\twindow.scrollTo({ left: position.x, top: position.y, behavior: 'instant' });\n\t\tsyncStageScrollToNative();\n\t\treturn this.readPositions();\n\t}\n\n\tendNavigation(token: object) {\n\t\tif (this.navigation?.token === token) this.navigation = undefined;\n\t}\n\n\tstart() {\n\t\tif (this.started) return;\n\t\tthis.started = true;\n\n\t\t// Preserve the in-flow height before the content becomes viewport-fixed.\n\t\tthis.measureDocumentHeight();\n\t\tthis.container.classList.add(ACTIVE_CLASS);\n\t\tthis.applyPosition(window.scrollX, window.scrollY);\n\t\tthis.measureDocumentHeight();\n\n\t\tthis.stopScrollFrames = subscribeStageScrollFrame(\n\t\t\tthis.handleScrollFrame,\n\t\t\tSTAGE_SCROLL_PRIORITY.virtualDocument\n\t\t);\n\t\twindow.addEventListener('resize', this.handleResize, { passive: true });\n\t\t// Panel content is moved into the CSS3D renderer after enhancement. Listen\n\t\t// on the stable stage container so anchors and focus keep working there too.\n\t\tthis.container.addEventListener('click', this.handleAnchorClick);\n\t\tthis.container.addEventListener('focusin', this.handleFocusIn);\n\t\twindow.addEventListener('hashchange', this.handleHashChange);\n\t\twindow.addEventListener('popstate', this.handlePopState);\n\t\twindow.addEventListener('wheel', this.handleUserInput, { passive: true });\n\t\twindow.addEventListener('touchstart', this.handleUserInput, { passive: true });\n\t\twindow.addEventListener('pointerdown', this.handleUserInput, { passive: true });\n\t\twindow.addEventListener('keydown', this.handleScrollInterruptionKey);\n\n\t\tif ('ResizeObserver' in window) {\n\t\t\tthis.resizeObserver = new ResizeObserver(this.scheduleMeasurement);\n\t\t\tthis.resizeObserver.observe(this.content);\n\t\t}\n\n\t\tvoid document.fonts?.ready.then(() => this.scheduleMeasurement());\n\t\tif (window.location.hash) this.scheduleHashNavigation();\n\t}\n\n\tdestroy() {\n\t\tif (!this.started) return;\n\t\tthis.started = false;\n\t\tthis.stopScrollFrames?.();\n\t\tthis.stopScrollFrames = undefined;\n\t\twindow.removeEventListener('resize', this.handleResize);\n\t\tthis.container.removeEventListener('click', this.handleAnchorClick);\n\t\tthis.container.removeEventListener('focusin', this.handleFocusIn);\n\t\twindow.removeEventListener('hashchange', this.handleHashChange);\n\t\twindow.removeEventListener('popstate', this.handlePopState);\n\t\twindow.removeEventListener('wheel', this.handleUserInput);\n\t\twindow.removeEventListener('touchstart', this.handleUserInput);\n\t\twindow.removeEventListener('pointerdown', this.handleUserInput);\n\t\twindow.removeEventListener('keydown', this.handleScrollInterruptionKey);\n\t\tthis.resizeObserver?.disconnect();\n\t\tthis.resizeObserver = undefined;\n\t\tif (this.measureFrame) cancelAnimationFrame(this.measureFrame);\n\t\tif (this.hashFrame) cancelAnimationFrame(this.hashFrame);\n\t\tthis.historyHashUrl = undefined;\n\t\tthis.navigation = undefined;\n\t\tthis.cancelAnchorScroll();\n\t\tthis.measureFrame = 0;\n\t\tthis.hashFrame = 0;\n\t\tthis.content.style.removeProperty('transform');\n\t\tthis.spacer.style.removeProperty('height');\n\t\tthis.container.classList.remove(ACTIVE_CLASS);\n\t}\n\n\tprivate readonly handleScrollFrame = (frame: StageScrollFrame) => {\n\t\tthis.applyPosition(frame.scrollX, frame.scrollY);\n\t};\n\n\tprivate readonly handleResize = () => {\n\t\tthis.scheduleMeasurement();\n\t};\n\n\tprivate readonly handleHashChange = (event: HashChangeEvent) => {\n\t\tconst restoredByHistory = event.newURL === this.historyHashUrl;\n\t\tthis.historyHashUrl = undefined;\n\t\tif (!restoredByHistory) this.scheduleHashNavigation();\n\t};\n\tprivate readonly handlePopState = () => {\n\t\tif (!this.writeHash) return;\n\t\t// History restoration wins over a fragment, including SvelteKit shallow entries.\n\t\tif (this.hashFrame) cancelAnimationFrame(this.hashFrame);\n\t\tthis.hashFrame = 0;\n\t\tthis.historyHashUrl = window.location.href;\n\t};\n\tprivate readonly handleUserInput = () => {\n\t\tthis.cancelAnchorScroll();\n\t\tif (this.navigation) this.navigation.interrupted = true;\n\t};\n\tprivate readonly handleScrollInterruptionKey = (event: KeyboardEvent) => {\n\t\tif (SCROLL_INTERRUPTION_KEYS.has(event.key)) this.handleUserInput();\n\t};\n\n\tprivate readonly cancelAnchorScroll = () => {\n\t\tif (this.anchorScrollFrame) cancelAnimationFrame(this.anchorScrollFrame);\n\t\tthis.anchorScrollFrame = 0;\n\t\tthis.completeAnchorNavigation();\n\t};\n\n\tprivate completeAnchorNavigation() {\n\t\tconst targetId = this.anchorNavigationTargetId;\n\t\tif (!targetId) return;\n\t\tthis.anchorNavigationTargetId = undefined;\n\t\twindow.dispatchEvent(\n\t\t\tnew CustomEvent(STAGE_ANCHOR_NAVIGATION_END_EVENT, { detail: { targetId } })\n\t\t);\n\t}\n\n\tprivate readonly scheduleMeasurement = () => {\n\t\tif (!this.started || this.measureFrame) return;\n\t\tthis.measureFrame = requestAnimationFrame(() => {\n\t\t\tthis.measureFrame = 0;\n\t\t\tthis.measureDocumentHeight();\n\t\t});\n\t};\n\n\tprivate readonly handleAnchorClick = (event: MouseEvent) => {\n\t\tif (\n\t\t\tthis.navigation ||\n\t\t\tevent.defaultPrevented ||\n\t\t\tevent.button !== 0 ||\n\t\t\tevent.metaKey ||\n\t\t\tevent.ctrlKey ||\n\t\t\tevent.shiftKey ||\n\t\t\tevent.altKey\n\t\t)\n\t\t\treturn;\n\t\tconst target =\n\t\t\tevent.target instanceof Element ? event.target.closest<HTMLAnchorElement>('a[href]') : null;\n\t\tif (!target) return;\n\n\t\tconst url = new URL(target.href, window.location.href);\n\t\tif (\n\t\t\t!url.hash ||\n\t\t\turl.origin !== window.location.origin ||\n\t\t\turl.pathname !== window.location.pathname ||\n\t\t\turl.search !== window.location.search\n\t\t)\n\t\t\treturn;\n\n\t\tconst element = this.getHashTarget(url.hash);\n\t\tif (!element) return;\n\n\t\tevent.preventDefault();\n\t\tconst animated =\n\t\t\ttarget.hasAttribute('data-spatial-element-tab-id') ||\n\t\t\ttarget.hasAttribute('data-spatial-element-section-navigation');\n\t\tconst navigationHash =\n\t\t\tanimated && element.hasAttribute('data-stage-scroll-top') ? '' : url.hash;\n\t\tif (window.location.hash !== navigationHash) {\n\t\t\tif (this.writeHash) {\n\t\t\t\turl.hash = navigationHash;\n\t\t\t\tthis.writeHash(url, animated);\n\t\t\t} else if (animated) {\n\t\t\t\turl.hash = navigationHash;\n\t\t\t\thistory.replaceState(history.state, '', url);\n\t\t\t} else {\n\t\t\t\twindow.location.hash = navigationHash;\n\t\t\t}\n\t\t}\n\t\tthis.scrollElementIntoView(element, false, animated);\n\t};\n\n\tprivate scheduleHashNavigation() {\n\t\tif (!this.started || this.hashFrame || this.navigation) return;\n\t\tthis.hashFrame = requestAnimationFrame(() => {\n\t\t\tthis.hashFrame = 0;\n\t\t\tconst element = this.getHashTarget(window.location.hash);\n\t\t\tif (element) {\n\t\t\t\tthis.scrollElementIntoView(element, false, element.hasAttribute('data-spatial-element-tab-target'));\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate getHashTarget(hash: string) {\n\t\tif (!hash || hash === '#') return null;\n\t\ttry {\n\t\t\treturn this.container.querySelector<HTMLElement>(\n\t\t\t\t`#${CSS.escape(decodeURIComponent(hash.slice(1)))}`\n\t\t\t);\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tprivate readonly handleFocusIn = (event: FocusEvent) => {\n\t\tif (this.navigation || !(event.target instanceof HTMLElement)) return;\n\t\tconst rect = event.target.getBoundingClientRect();\n\t\tif (\n\t\t\trect.top >= FOCUS_VIEWPORT_MARGIN &&\n\t\t\trect.bottom <= window.innerHeight - FOCUS_VIEWPORT_MARGIN\n\t\t)\n\t\t\treturn;\n\n\t\tthis.scrollElementIntoView(event.target, true);\n\t};\n\n\tprivate getElementScrollTop(element: HTMLElement, center = false) {\n\t\tconst rect = element.getBoundingClientRect();\n\t\tconst style = window.getComputedStyle(element);\n\t\tconst scrollMarginTop = Number.parseFloat(style.scrollMarginTop) || 0;\n\t\tconst documentTop = rect.top + this.scrollY;\n\t\treturn Math.max(\n\t\t\telement.hasAttribute('data-stage-scroll-top')\n\t\t\t\t? 0\n\t\t\t\t: center\n\t\t\t\t\t? documentTop - (window.innerHeight - rect.height) * 0.5\n\t\t\t\t\t: documentTop - scrollMarginTop,\n\t\t\t0\n\t\t);\n\t}\n\n\tprivate scrollElementIntoView(element: HTMLElement, center = false, animated = false) {\n\t\tconst targetY = this.getElementScrollTop(element, center);\n\n\t\tthis.cancelAnchorScroll();\n\t\tif (animated) {\n\t\t\tthis.anchorNavigationTargetId = element.id;\n\t\t\twindow.dispatchEvent(\n\t\t\t\tnew CustomEvent(STAGE_ANCHOR_NAVIGATION_EVENT, {\n\t\t\t\t\tdetail: { targetId: element.id }\n\t\t\t\t})\n\t\t\t);\n\t\t}\n\t\tif (!animated || window.matchMedia('(prefers-reduced-motion: reduce)').matches) {\n\t\t\tmarkStageScrollInput(animated ? 'navigation' : 'programmatic');\n\t\t\twindow.scrollTo({ top: targetY, behavior: 'instant' });\n\t\t\tthis.completeAnchorNavigation();\n\t\t\treturn;\n\t\t}\n\n\t\tconst startY = this.scrollY;\n\t\tconst distance = targetY - startY;\n\t\tif (Math.abs(distance) < 0.5) {\n\t\t\tmarkStageScrollInput('navigation');\n\t\t\twindow.scrollTo({ top: targetY, behavior: 'instant' });\n\t\t\tthis.completeAnchorNavigation();\n\t\t\treturn;\n\t\t}\n\n\t\tlet startTime: number | undefined;\n\t\tconst animate = (time: number) => {\n\t\t\tif (!this.started) return;\n\t\t\tstartTime ??= time;\n\t\t\tconst progress = Math.min((time - startTime) / STAGE_ANCHOR_SCROLL_DURATION_MS, 1);\n\t\t\tconst scrollTop = startY + distance * easeStageAnchorScroll(progress);\n\t\t\tmarkStageScrollInput('navigation');\n\t\t\twindow.scrollTo({ top: progress === 1 ? targetY : scrollTop, behavior: 'instant' });\n\n\t\t\tif (progress < 1) {\n\t\t\t\tthis.anchorScrollFrame = requestAnimationFrame(animate);\n\t\t\t} else {\n\t\t\t\tthis.anchorScrollFrame = 0;\n\t\t\t\tthis.completeAnchorNavigation();\n\t\t\t}\n\t\t};\n\n\t\tthis.anchorScrollFrame = requestAnimationFrame(animate);\n\t}\n\n\tprivate applyPosition(scrollX: number, scrollY: number) {\n\t\tthis.scrollY = scrollY;\n\t\tthis.content.style.transform = `translate3d(${-scrollX}px, ${-scrollY}px, 0)`;\n\t}\n\n\tprivate measureDocumentHeight() {\n\t\tconst rect = this.content.getBoundingClientRect();\n\t\tconst height = Math.max(this.content.scrollHeight, rect.height, window.innerHeight);\n\t\tthis.spacer.style.height = `${Math.ceil(height)}px`;\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MinimapGeometry.d.ts","sourceRoot":"","sources":["../../../src/stage/minimap/MinimapGeometry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAGtC,sEAAsE;AACtE,MAAM,WAAW,kBAAkB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACnB;
|
|
1
|
+
{"version":3,"file":"MinimapGeometry.d.ts","sourceRoot":"","sources":["../../../src/stage/minimap/MinimapGeometry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAGtC,sEAAsE;AACtE,M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AE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,QAAQ,CAAC,EACtD,QAAQ,EAAE,KAAK,CAAC,cAAc,QAI9B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as THREE from 'three/webgpu';
|
|
2
2
|
import { smoothstep } from '../stageMath.js';
|
|
3
|
+
const viewportRingStates = new WeakMap();
|
|
3
4
|
/**
|
|
4
5
|
* Blends viewport corners into the panel corners as the cutout reaches an edge.
|
|
5
6
|
* Sharing this result keeps the cutout and its border visually synchronized.
|
|
@@ -83,6 +84,22 @@ export function createMinimapViewportRingGeometry(panelWidth, panelHeight, left,
|
|
|
83
84
|
* explicit quad topology, so no triangle can ever cross the viewport.
|
|
84
85
|
*/
|
|
85
86
|
export function updateMinimapViewportRingGeometry(geometry, panelWidth, panelHeight, left, top, width, height, radii, lineWidth) {
|
|
87
|
+
const previous = viewportRingStates.get(geometry);
|
|
88
|
+
if (previous &&
|
|
89
|
+
previous.panelWidth === panelWidth &&
|
|
90
|
+
previous.panelHeight === panelHeight &&
|
|
91
|
+
previous.left === left &&
|
|
92
|
+
previous.top === top &&
|
|
93
|
+
previous.width === width &&
|
|
94
|
+
previous.height === height &&
|
|
95
|
+
previous.lineWidth === lineWidth &&
|
|
96
|
+
previous.topLeft === radii.topLeft &&
|
|
97
|
+
previous.topRight === radii.topRight &&
|
|
98
|
+
previous.bottomRight === radii.bottomRight &&
|
|
99
|
+
previous.bottomLeft === radii.bottomLeft &&
|
|
100
|
+
previous.position === geometry.getAttribute('position') &&
|
|
101
|
+
previous.index === geometry.getIndex())
|
|
102
|
+
return;
|
|
86
103
|
const panelW = Math.max(panelWidth, 0.001);
|
|
87
104
|
const panelH = Math.max(panelHeight, 0.001);
|
|
88
105
|
const thickness = THREE.MathUtils.clamp(lineWidth, 0.5, Math.min(width, height) * 0.45);
|
|
@@ -131,6 +148,18 @@ export function updateMinimapViewportRingGeometry(geometry, panelWidth, panelHei
|
|
|
131
148
|
position.needsUpdate = true;
|
|
132
149
|
geometry.computeBoundingBox();
|
|
133
150
|
geometry.computeBoundingSphere();
|
|
151
|
+
viewportRingStates.set(geometry, {
|
|
152
|
+
panelWidth,
|
|
153
|
+
panelHeight,
|
|
154
|
+
left,
|
|
155
|
+
top,
|
|
156
|
+
width,
|
|
157
|
+
height,
|
|
158
|
+
lineWidth,
|
|
159
|
+
...radii,
|
|
160
|
+
position: position,
|
|
161
|
+
index: geometry.getIndex()
|
|
162
|
+
});
|
|
134
163
|
}
|
|
135
164
|
/** Replaces a mesh geometry while releasing the previous GPU resource. */
|
|
136
165
|
export function replaceMeshGeometry(mesh, geometry) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MinimapGeometry.js","sourceRoot":"","sources":["../../../src/stage/minimap/MinimapGeometry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAU7C;;;GAGG;AACH,MAAM,UAAU,6BAA6B,CAC5C,UAAkB,EAClB,WAAmB,EACnB,IAAY,EACZ,GAAW,EACX,KAAa,EACb,MAAc,EACd,MAAc,EACd,WAAmB;IAEnB,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,GAAG,IAAI,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC;IACrD,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,WAAW,GAAG,GAAG,GAAG,MAAM,EAAE,CAAC,CAAC,CAAC;IACvD,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;IACzD,MAAM,WAAW,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;IAC5D,MAAM,UAAU,GAAG,KAAK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AG,GAAG,EAAE,CAAC,CAAC,CAAC;IAC/F,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC5D,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,QAAQ,EAAE,GAAG,GAAG,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC;IACvF,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,KAAK,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;IACvD,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,OAAO,EAAE,GAAG,GAAG,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IACtF,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;IACxD,MAAM,CACL,CAAC,GAAG,KAAK,CAAC,UAAU,EACpB,CAAC,GAAG,KAAK,CAAC,UAAU,EACpB,KAAK,CAAC,UAAU,EAChB,IAAI,CAAC,EAAE,EACP,IAAI,CAAC,EAAE,GAAG,GAAG,EACb,KAAK,CACL,CAAC;IAEF,OAAO,MAAM,CAAC;AACf,CAAC","sourcesContent":["import * as THREE from 'three/webgpu';\nimport { smoothstep } from '../stageMath.js';\n\n/** Per-corner radii used by the minimap viewport and panel shapes. */\nexport interface MinimapCornerRadii {\n\ttopLeft: number;\n\ttopRight: number;\n\tbottomRight: number;\n\tbottomLeft: number;\n}\n\n/**\n * Blends viewport corners into the panel corners as the cutout reaches an edge.\n * Sharing this result keeps the cutout and its border visually synchronized.\n */\nexport function getMinimapViewportCornerRadii(\n\tpanelWidth: number,\n\tpanelHeight: number,\n\tleft: number,\n\ttop: number,\n\twidth: number,\n\theight: number,\n\tradius: number,\n\tpanelRadius: number\n): MinimapCornerRadii {\n\tconst right = Math.max(panelWidth - left - width, 0);\n\tconst bottom = Math.max(panelHeight - top - height, 0);\n\tconst limit = Math.max(Math.min(width, height) * 0.5, 0);\n\tconst innerRadius = THREE.MathUtils.clamp(radius, 0, limit);\n\tconst edgeRadius = THREE.MathUtils.clamp(panelRadius, 0, limit);\n\tconst edgeBlendDistance = Math.max(edgeRadius * 1.45, 1);\n\tconst cornerRadius = (horizontalDistance: number, verticalDistance: number) => {\n\t\tconst distance = Math.max(Math.max(horizontalDistance, 0), Math.max(verticalDistance, 0));\n\t\tconst proximity = 1 - THREE.MathUtils.clamp(distance / edgeBlendDistance, 0, 1);\n\t\treturn THREE.MathUtils.lerp(innerRadius, edgeRadius, smoothstep(0, 1, proximity));\n\t};\n\treturn {\n\t\ttopLeft: cornerRadius(left, top),\n\t\ttopRight: cornerRadius(right, top),\n\t\tbottomRight: cornerRadius(right, bottom),\n\t\tbottomLeft: cornerRadius(left, bottom)\n\t};\n}\n\n/** Creates the rounded panel surface used by the minimap composite. */\nexport function createMinimapPanelGeometry(\n\tpanelWidth: number,\n\tpanelHeight: number,\n\tpanelRadius: number\n) {\n\tconst geometry = new THREE.BufferGeometry();\n\tupdateMinimapPanelGeometry(geometry, panelWidth, panelHeight, panelRadius);\n\treturn geometry;\n}\n\n/** Fixed convex fan with the original quadratic corner profile; resize in-place. */\nexport function updateMinimapPanelGeometry(\n\tgeometry: THREE.BufferGeometry,\n\tpanelWidth: number,\n\tpanelHeight: number,\n\tpanelRadius: number\n) {\n\tconst panelW = Math.max(panelWidth, 0.001);\n\tconst panelH = Math.max(panelHeight, 0.001);\n\tconst radius = THREE.MathUtils.clamp(panelRadius, 0, Math.min(panelW, panelH) * 0.5);\n\tconst count = 44;\n\tlet position = geometry.getAttribute('position');\n\tlet uv = geometry.getAttribute('uv');\n\tif (!position) {\n\t\tposition = new THREE.Float32BufferAttribute((count + 1) * 3, 3).setUsage(\n\t\t\tTHREE.DynamicDrawUsage\n\t\t);\n\t\tuv = new THREE.Float32BufferAttribute((count + 1) * 2, 2).setUsage(THREE.DynamicDrawUsage);\n\t\tgeometry.setAttribute('position', position);\n\t\tgeometry.setAttribute('uv', uv);\n\t\tconst indices: number[] = [];\n\t\tfor (let i = 0; i < count; i++) indices.push(0, i + 1, ((i + 1) % count) + 1);\n\t\tgeometry.setIndex(indices);\n\t}\n\tposition.setXYZ(0, 0, 0, 0);\n\tuv.setXY(0, 0.5, 0.5);\n\tfor (let corner = 0; corner < 4; corner++) {\n\t\tconst xSign = corner < 2 ? 1 : -1;\n\t\tconst ySign = corner === 0 || corner === 3 ? -1 : 1;\n\t\tfor (let step = 0; step <= 10; step++) {\n\t\t\tconst t = step / 10;\n\t\t\tconst a = radius * (1 - t) ** 2;\n\t\t\tconst b = radius * t ** 2;\n\t\t\tconst x = xSign * (panelW * 0.5 - (corner % 2 === 0 ? a : b));\n\t\t\tconst y = ySign * (panelH * 0.5 - (corner % 2 === 0 ? b : a));\n\t\t\tconst index = 1 + corner * 11 + step;\n\t\t\tposition.setXYZ(index, x, y, 0);\n\t\t\tuv.setXY(index, x / panelW + 0.5, 0.5 - y / panelH);\n\t\t}\n\t}\n\tposition.needsUpdate = true;\n\tuv.needsUpdate = true;\n\tgeometry.computeBoundingBox();\n\tgeometry.computeBoundingSphere();\n}\n\n/** Creates the rounded border that marks the main camera viewport on the minimap. */\nexport function createMinimapViewportRingGeometry(\n\tpanelWidth: number,\n\tpanelHeight: number,\n\tleft: number,\n\ttop: number,\n\twidth: number,\n\theight: number,\n\tradii: MinimapCornerRadii,\n\tlineWidth: number\n) {\n\tconst geometry = new THREE.BufferGeometry();\n\tupdateMinimapViewportRingGeometry(\n\t\tgeometry,\n\t\tpanelWidth,\n\t\tpanelHeight,\n\t\tleft,\n\t\ttop,\n\t\twidth,\n\t\theight,\n\t\tradii,\n\t\tlineWidth\n\t);\n\treturn geometry;\n}\n\n/**\n * Updates the viewport border without replacing its GPU buffers.\n *\n * `ShapeGeometry` triangulates a rounded rectangle with a hole through Earcut.\n * During animated size/radius transitions that topology can briefly contain a\n * diagonal triangle across the hole. A paired outer/inner contour has fixed,\n * explicit quad topology, so no triangle can ever cross the viewport.\n */\nexport function updateMinimapViewportRingGeometry(\n\tgeometry: THREE.BufferGeometry,\n\tpanelWidth: number,\n\tpanelHeight: number,\n\tleft: number,\n\ttop: number,\n\twidth: number,\n\theight: number,\n\tradii: MinimapCornerRadii,\n\tlineWidth: number\n) {\n\tconst panelW = Math.max(panelWidth, 0.001);\n\tconst panelH = Math.max(panelHeight, 0.001);\n\tconst thickness = THREE.MathUtils.clamp(lineWidth, 0.5, Math.min(width, height) * 0.45);\n\tconst outerX = left - panelW * 0.5;\n\tconst outerY = panelH * 0.5 - top - height;\n\tconst innerX = outerX + thickness;\n\tconst innerY = outerY + thickness;\n\tconst innerWidth = Math.max(width - thickness * 2, 0.001);\n\tconst innerHeight = Math.max(height - thickness * 2, 0.001);\n\tconst radiusLimit = Math.max(Math.min(width, height) * 0.5, 0);\n\tconst outerRadii = {\n\t\ttopLeft: THREE.MathUtils.clamp(radii.topLeft, 0, radiusLimit),\n\t\ttopRight: THREE.MathUtils.clamp(radii.topRight, 0, radiusLimit),\n\t\tbottomRight: THREE.MathUtils.clamp(radii.bottomRight, 0, radiusLimit),\n\t\tbottomLeft: THREE.MathUtils.clamp(radii.bottomLeft, 0, radiusLimit)\n\t};\n\tconst innerRadii = {\n\t\ttopLeft: Math.max(outerRadii.topLeft - thickness, 0),\n\t\ttopRight: Math.max(outerRadii.topRight - thickness, 0),\n\t\tbottomRight: Math.max(outerRadii.bottomRight - thickness, 0),\n\t\tbottomLeft: Math.max(outerRadii.bottomLeft - thickness, 0)\n\t};\n\tconst outer = createRoundedRectContour(outerX, outerY, width, height, outerRadii, 10);\n\tconst inner = createRoundedRectContour(innerX, innerY, innerWidth, innerHeight, innerRadii, 10);\n\tconst vertexCount = outer.length * 2;\n\tlet position = geometry.getAttribute('position');\n\tif (!(position instanceof THREE.BufferAttribute) || position.count !== vertexCount) {\n\t\tposition = new THREE.Float32BufferAttribute(vertexCount * 3, 3);\n\t\tposition.setUsage(THREE.DynamicDrawUsage);\n\t\tgeometry.setAttribute('position', position);\n\n\t\tconst indices: number[] = [];\n\t\tfor (let index = 0; index < outer.length; index += 1) {\n\t\t\tconst next = (index + 1) % outer.length;\n\t\t\tconst outerIndex = index * 2;\n\t\t\tconst innerIndex = outerIndex + 1;\n\t\t\tconst nextOuterIndex = next * 2;\n\t\t\tconst nextInnerIndex = nextOuterIndex + 1;\n\t\t\tindices.push(\n\t\t\t\touterIndex,\n\t\t\t\tnextOuterIndex,\n\t\t\t\tnextInnerIndex,\n\t\t\t\touterIndex,\n\t\t\t\tnextInnerIndex,\n\t\t\t\tinnerIndex\n\t\t\t);\n\t\t}\n\t\tgeometry.setIndex(indices);\n\t}\n\n\tfor (let index = 0; index < outer.length; index += 1) {\n\t\tposition.setXYZ(index * 2, outer[index].x, outer[index].y, 0);\n\t\tposition.setXYZ(index * 2 + 1, inner[index].x, inner[index].y, 0);\n\t}\n\tposition.needsUpdate = true;\n\tgeometry.computeBoundingBox();\n\tgeometry.computeBoundingSphere();\n}\n\n/** Replaces a mesh geometry while releasing the previous GPU resource. */\nexport function replaceMeshGeometry(\n\tmesh: THREE.Mesh<THREE.BufferGeometry, THREE.Material>,\n\tgeometry: THREE.BufferGeometry\n) {\n\tmesh.geometry.dispose();\n\tmesh.geometry = geometry;\n}\n\nfunction createRoundedRectContour(\n\tx: number,\n\ty: number,\n\twidth: number,\n\theight: number,\n\tradii: MinimapCornerRadii,\n\tsegmentsPerCorner: number\n) {\n\tconst right = x + width;\n\tconst top = y + height;\n\tconst segments = Math.max(Math.floor(segmentsPerCorner), 1);\n\tconst points: THREE.Vector2[] = [];\n\tconst addArc = (\n\t\tcenterX: number,\n\t\tcenterY: number,\n\t\tradius: number,\n\t\tstartAngle: number,\n\t\tendAngle: number,\n\t\tincludeEnd = true\n\t) => {\n\t\tconst lastStep = includeEnd ? segments : segments - 1;\n\t\tfor (let step = 1; step <= lastStep; step += 1) {\n\t\t\tconst angle = THREE.MathUtils.lerp(startAngle, endAngle, step / segments);\n\t\t\tpoints.push(\n\t\t\t\tnew THREE.Vector2(centerX + Math.cos(angle) * radius, centerY + Math.sin(angle) * radius)\n\t\t\t);\n\t\t}\n\t};\n\n\tpoints.push(new THREE.Vector2(x + radii.bottomLeft, y));\n\tpoints.push(new THREE.Vector2(right - radii.bottomRight, y));\n\taddArc(right - radii.bottomRight, y + radii.bottomRight, radii.bottomRight, -Math.PI * 0.5, 0);\n\tpoints.push(new THREE.Vector2(right, top - radii.topRight));\n\taddArc(right - radii.topRight, top - radii.topRight, radii.topRight, 0, Math.PI * 0.5);\n\tpoints.push(new THREE.Vector2(x + radii.topLeft, top));\n\taddArc(x + radii.topLeft, top - radii.topLeft, radii.topLeft, Math.PI * 0.5, Math.PI);\n\tpoints.push(new THREE.Vector2(x, y + radii.bottomLeft));\n\taddArc(\n\t\tx + radii.bottomLeft,\n\t\ty + radii.bottomLeft,\n\t\tradii.bottomLeft,\n\t\tMath.PI,\n\t\tMath.PI * 1.5,\n\t\tfalse\n\t);\n\n\treturn points;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"MinimapGeometry.js","sourceRoot":"","sources":["../../../src/stage/minimap/MinimapGeometry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAsB7C,MAAM,kBAAkB,GAAG,IAAI,OAAO,EAA2C,CAAC;AAElF;;;GAGG;AACH,MAAM,UAAU,6BAA6B,CAC5C,UAAkB,EAClB,WAAmB,EACnB,IAAY,EACZ,GAAW,EACX,KAAa,EACb,MAAc,EACd,MAAc,EACd,WAAmB;IAEnB,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AAC,CAAC;IAC7D,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC,GAAG,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;IAC/F,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC5D,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,QAAQ,EAAE,GAAG,GAAG,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC;IACvF,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,KAAK,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;IACvD,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,OAAO,EAAE,GAAG,GAAG,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IACtF,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;IACxD,MAAM,CACL,CAAC,GAAG,KAAK,CAAC,UAAU,EACpB,CAAC,GAAG,KAAK,CAAC,UAAU,EACpB,KAAK,CAAC,UAAU,EAChB,IAAI,CAAC,EAAE,EACP,IAAI,CAAC,EAAE,GAAG,GAAG,EACb,KAAK,CACL,CAAC;IAEF,OAAO,MAAM,CAAC;AACf,CAAC","sourcesContent":["import * as THREE from 'three/webgpu';\nimport { smoothstep } from '../stageMath.js';\n\n/** Per-corner radii used by the minimap viewport and panel shapes. */\nexport interface MinimapCornerRadii {\n\ttopLeft: number;\n\ttopRight: number;\n\tbottomRight: number;\n\tbottomLeft: number;\n}\n\ninterface ViewportRingState extends MinimapCornerRadii {\n\tpanelWidth: number;\n\tpanelHeight: number;\n\tleft: number;\n\ttop: number;\n\twidth: number;\n\theight: number;\n\tlineWidth: number;\n\tposition: THREE.BufferAttribute;\n\tindex: THREE.BufferAttribute | null;\n}\n\nconst viewportRingStates = new WeakMap<THREE.BufferGeometry, ViewportRingState>();\n\n/**\n * Blends viewport corners into the panel corners as the cutout reaches an edge.\n * Sharing this result keeps the cutout and its border visually synchronized.\n */\nexport function getMinimapViewportCornerRadii(\n\tpanelWidth: number,\n\tpanelHeight: number,\n\tleft: number,\n\ttop: number,\n\twidth: number,\n\theight: number,\n\tradius: number,\n\tpanelRadius: number\n): MinimapCornerRadii {\n\tconst right = Math.max(panelWidth - left - width, 0);\n\tconst bottom = Math.max(panelHeight - top - height, 0);\n\tconst limit = Math.max(Math.min(width, height) * 0.5, 0);\n\tconst innerRadius = THREE.MathUtils.clamp(radius, 0, limit);\n\tconst edgeRadius = THREE.MathUtils.clamp(panelRadius, 0, limit);\n\tconst edgeBlendDistance = Math.max(edgeRadius * 1.45, 1);\n\tconst cornerRadius = (horizontalDistance: number, verticalDistance: number) => {\n\t\tconst distance = Math.max(Math.max(horizontalDistance, 0), Math.max(verticalDistance, 0));\n\t\tconst proximity = 1 - THREE.MathUtils.clamp(distance / edgeBlendDistance, 0, 1);\n\t\treturn THREE.MathUtils.lerp(innerRadius, edgeRadius, smoothstep(0, 1, proximity));\n\t};\n\treturn {\n\t\ttopLeft: cornerRadius(left, top),\n\t\ttopRight: cornerRadius(right, top),\n\t\tbottomRight: cornerRadius(right, bottom),\n\t\tbottomLeft: cornerRadius(left, bottom)\n\t};\n}\n\n/** Creates the rounded panel surface used by the minimap composite. */\nexport function createMinimapPanelGeometry(\n\tpanelWidth: number,\n\tpanelHeight: number,\n\tpanelRadius: number\n) {\n\tconst geometry = new THREE.BufferGeometry();\n\tupdateMinimapPanelGeometry(geometry, panelWidth, panelHeight, panelRadius);\n\treturn geometry;\n}\n\n/** Fixed convex fan with the original quadratic corner profile; resize in-place. */\nexport function updateMinimapPanelGeometry(\n\tgeometry: THREE.BufferGeometry,\n\tpanelWidth: number,\n\tpanelHeight: number,\n\tpanelRadius: number\n) {\n\tconst panelW = Math.max(panelWidth, 0.001);\n\tconst panelH = Math.max(panelHeight, 0.001);\n\tconst radius = THREE.MathUtils.clamp(panelRadius, 0, Math.min(panelW, panelH) * 0.5);\n\tconst count = 44;\n\tlet position = geometry.getAttribute('position');\n\tlet uv = geometry.getAttribute('uv');\n\tif (!position) {\n\t\tposition = new THREE.Float32BufferAttribute((count + 1) * 3, 3).setUsage(\n\t\t\tTHREE.DynamicDrawUsage\n\t\t);\n\t\tuv = new THREE.Float32BufferAttribute((count + 1) * 2, 2).setUsage(THREE.DynamicDrawUsage);\n\t\tgeometry.setAttribute('position', position);\n\t\tgeometry.setAttribute('uv', uv);\n\t\tconst indices: number[] = [];\n\t\tfor (let i = 0; i < count; i++) indices.push(0, i + 1, ((i + 1) % count) + 1);\n\t\tgeometry.setIndex(indices);\n\t}\n\tposition.setXYZ(0, 0, 0, 0);\n\tuv.setXY(0, 0.5, 0.5);\n\tfor (let corner = 0; corner < 4; corner++) {\n\t\tconst xSign = corner < 2 ? 1 : -1;\n\t\tconst ySign = corner === 0 || corner === 3 ? -1 : 1;\n\t\tfor (let step = 0; step <= 10; step++) {\n\t\t\tconst t = step / 10;\n\t\t\tconst a = radius * (1 - t) ** 2;\n\t\t\tconst b = radius * t ** 2;\n\t\t\tconst x = xSign * (panelW * 0.5 - (corner % 2 === 0 ? a : b));\n\t\t\tconst y = ySign * (panelH * 0.5 - (corner % 2 === 0 ? b : a));\n\t\t\tconst index = 1 + corner * 11 + step;\n\t\t\tposition.setXYZ(index, x, y, 0);\n\t\t\tuv.setXY(index, x / panelW + 0.5, 0.5 - y / panelH);\n\t\t}\n\t}\n\tposition.needsUpdate = true;\n\tuv.needsUpdate = true;\n\tgeometry.computeBoundingBox();\n\tgeometry.computeBoundingSphere();\n}\n\n/** Creates the rounded border that marks the main camera viewport on the minimap. */\nexport function createMinimapViewportRingGeometry(\n\tpanelWidth: number,\n\tpanelHeight: number,\n\tleft: number,\n\ttop: number,\n\twidth: number,\n\theight: number,\n\tradii: MinimapCornerRadii,\n\tlineWidth: number\n) {\n\tconst geometry = new THREE.BufferGeometry();\n\tupdateMinimapViewportRingGeometry(\n\t\tgeometry,\n\t\tpanelWidth,\n\t\tpanelHeight,\n\t\tleft,\n\t\ttop,\n\t\twidth,\n\t\theight,\n\t\tradii,\n\t\tlineWidth\n\t);\n\treturn geometry;\n}\n\n/**\n * Updates the viewport border without replacing its GPU buffers.\n *\n * `ShapeGeometry` triangulates a rounded rectangle with a hole through Earcut.\n * During animated size/radius transitions that topology can briefly contain a\n * diagonal triangle across the hole. A paired outer/inner contour has fixed,\n * explicit quad topology, so no triangle can ever cross the viewport.\n */\nexport function updateMinimapViewportRingGeometry(\n\tgeometry: THREE.BufferGeometry,\n\tpanelWidth: number,\n\tpanelHeight: number,\n\tleft: number,\n\ttop: number,\n\twidth: number,\n\theight: number,\n\tradii: MinimapCornerRadii,\n\tlineWidth: number\n) {\n\tconst previous = viewportRingStates.get(geometry);\n\tif (\n\t\tprevious &&\n\t\tprevious.panelWidth === panelWidth &&\n\t\tprevious.panelHeight === panelHeight &&\n\t\tprevious.left === left &&\n\t\tprevious.top === top &&\n\t\tprevious.width === width &&\n\t\tprevious.height === height &&\n\t\tprevious.lineWidth === lineWidth &&\n\t\tprevious.topLeft === radii.topLeft &&\n\t\tprevious.topRight === radii.topRight &&\n\t\tprevious.bottomRight === radii.bottomRight &&\n\t\tprevious.bottomLeft === radii.bottomLeft &&\n\t\tprevious.position === geometry.getAttribute('position') &&\n\t\tprevious.index === geometry.getIndex()\n\t)\n\t\treturn;\n\n\tconst panelW = Math.max(panelWidth, 0.001);\n\tconst panelH = Math.max(panelHeight, 0.001);\n\tconst thickness = THREE.MathUtils.clamp(lineWidth, 0.5, Math.min(width, height) * 0.45);\n\tconst outerX = left - panelW * 0.5;\n\tconst outerY = panelH * 0.5 - top - height;\n\tconst innerX = outerX + thickness;\n\tconst innerY = outerY + thickness;\n\tconst innerWidth = Math.max(width - thickness * 2, 0.001);\n\tconst innerHeight = Math.max(height - thickness * 2, 0.001);\n\tconst radiusLimit = Math.max(Math.min(width, height) * 0.5, 0);\n\tconst outerRadii = {\n\t\ttopLeft: THREE.MathUtils.clamp(radii.topLeft, 0, radiusLimit),\n\t\ttopRight: THREE.MathUtils.clamp(radii.topRight, 0, radiusLimit),\n\t\tbottomRight: THREE.MathUtils.clamp(radii.bottomRight, 0, radiusLimit),\n\t\tbottomLeft: THREE.MathUtils.clamp(radii.bottomLeft, 0, radiusLimit)\n\t};\n\tconst innerRadii = {\n\t\ttopLeft: Math.max(outerRadii.topLeft - thickness, 0),\n\t\ttopRight: Math.max(outerRadii.topRight - thickness, 0),\n\t\tbottomRight: Math.max(outerRadii.bottomRight - thickness, 0),\n\t\tbottomLeft: Math.max(outerRadii.bottomLeft - thickness, 0)\n\t};\n\tconst outer = createRoundedRectContour(outerX, outerY, width, height, outerRadii, 10);\n\tconst inner = createRoundedRectContour(innerX, innerY, innerWidth, innerHeight, innerRadii, 10);\n\tconst vertexCount = outer.length * 2;\n\tlet position = geometry.getAttribute('position');\n\tif (!(position instanceof THREE.BufferAttribute) || position.count !== vertexCount) {\n\t\tposition = new THREE.Float32BufferAttribute(vertexCount * 3, 3);\n\t\tposition.setUsage(THREE.DynamicDrawUsage);\n\t\tgeometry.setAttribute('position', position);\n\n\t\tconst indices: number[] = [];\n\t\tfor (let index = 0; index < outer.length; index += 1) {\n\t\t\tconst next = (index + 1) % outer.length;\n\t\t\tconst outerIndex = index * 2;\n\t\t\tconst innerIndex = outerIndex + 1;\n\t\t\tconst nextOuterIndex = next * 2;\n\t\t\tconst nextInnerIndex = nextOuterIndex + 1;\n\t\t\tindices.push(\n\t\t\t\touterIndex,\n\t\t\t\tnextOuterIndex,\n\t\t\t\tnextInnerIndex,\n\t\t\t\touterIndex,\n\t\t\t\tnextInnerIndex,\n\t\t\t\tinnerIndex\n\t\t\t);\n\t\t}\n\t\tgeometry.setIndex(indices);\n\t}\n\n\tfor (let index = 0; index < outer.length; index += 1) {\n\t\tposition.setXYZ(index * 2, outer[index].x, outer[index].y, 0);\n\t\tposition.setXYZ(index * 2 + 1, inner[index].x, inner[index].y, 0);\n\t}\n\tposition.needsUpdate = true;\n\tgeometry.computeBoundingBox();\n\tgeometry.computeBoundingSphere();\n\tviewportRingStates.set(geometry, {\n\t\tpanelWidth,\n\t\tpanelHeight,\n\t\tleft,\n\t\ttop,\n\t\twidth,\n\t\theight,\n\t\tlineWidth,\n\t\t...radii,\n\t\tposition: position as THREE.BufferAttribute,\n\t\tindex: geometry.getIndex()\n\t});\n}\n\n/** Replaces a mesh geometry while releasing the previous GPU resource. */\nexport function replaceMeshGeometry(\n\tmesh: THREE.Mesh<THREE.BufferGeometry, THREE.Material>,\n\tgeometry: THREE.BufferGeometry\n) {\n\tmesh.geometry.dispose();\n\tmesh.geometry = geometry;\n}\n\nfunction createRoundedRectContour(\n\tx: number,\n\ty: number,\n\twidth: number,\n\theight: number,\n\tradii: MinimapCornerRadii,\n\tsegmentsPerCorner: number\n) {\n\tconst right = x + width;\n\tconst top = y + height;\n\tconst segments = Math.max(Math.floor(segmentsPerCorner), 1);\n\tconst points: THREE.Vector2[] = [];\n\tconst addArc = (\n\t\tcenterX: number,\n\t\tcenterY: number,\n\t\tradius: number,\n\t\tstartAngle: number,\n\t\tendAngle: number,\n\t\tincludeEnd = true\n\t) => {\n\t\tconst lastStep = includeEnd ? segments : segments - 1;\n\t\tfor (let step = 1; step <= lastStep; step += 1) {\n\t\t\tconst angle = THREE.MathUtils.lerp(startAngle, endAngle, step / segments);\n\t\t\tpoints.push(\n\t\t\t\tnew THREE.Vector2(centerX + Math.cos(angle) * radius, centerY + Math.sin(angle) * radius)\n\t\t\t);\n\t\t}\n\t};\n\n\tpoints.push(new THREE.Vector2(x + radii.bottomLeft, y));\n\tpoints.push(new THREE.Vector2(right - radii.bottomRight, y));\n\taddArc(right - radii.bottomRight, y + radii.bottomRight, radii.bottomRight, -Math.PI * 0.5, 0);\n\tpoints.push(new THREE.Vector2(right, top - radii.topRight));\n\taddArc(right - radii.topRight, top - radii.topRight, radii.topRight, 0, Math.PI * 0.5);\n\tpoints.push(new THREE.Vector2(x + radii.topLeft, top));\n\taddArc(x + radii.topLeft, top - radii.topLeft, radii.topLeft, Math.PI * 0.5, Math.PI);\n\tpoints.push(new THREE.Vector2(x, y + radii.bottomLeft));\n\taddArc(\n\t\tx + radii.bottomLeft,\n\t\ty + radii.bottomLeft,\n\t\tradii.bottomLeft,\n\t\tMath.PI,\n\t\tMath.PI * 1.5,\n\t\tfalse\n\t);\n\n\treturn points;\n}\n"]}
|
|
@@ -62,7 +62,7 @@ export interface StageViewportRegistration {
|
|
|
62
62
|
getElement(): HTMLElement | undefined;
|
|
63
63
|
}
|
|
64
64
|
export interface StageContext {
|
|
65
|
-
prefetchSpatialElement?(stage: import('../spatial-element/
|
|
65
|
+
prefetchSpatialElement?(stage: import('../spatial-element/spatialElementScene.js').SpatialElementScene): void;
|
|
66
66
|
registerPanel(panel: StagePanelRegistration): () => void;
|
|
67
67
|
registerViewport(viewport: StageViewportRegistration): () => void;
|
|
68
68
|
/** Restores the element camera to its initial fitted pose. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panelContext.d.ts","sourceRoot":"","sources":["../../src/stage/panelContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,KAAK,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEjF,eAAO,MAAM,iBAAiB,eAAkB,CAAC;AAEjD,uFAAuF;AACvF,eAAO,MAAM,wBAAwB,uB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IAC7E,kBAAkB,IAAI,MAAM,GAAG,SAAS,CAAC;CACzC;AAED,MAAM,WAAW,yBAAyB;IACzC,UAAU,IAAI,WAAW,GAAG,SAAS,CAAC;CACtC;AAED,MAAM,WAAW,YAAY;IAC5B,sBAAsB,CAAC,CAAC,KAAK,EAAE,OAAO,2CAA2C,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAC9G,aAAa,CAAC,KAAK,EAAE,sBAAsB,GAAG,MAAM,IAAI,CAAC;IACzD,gBAAgB,CAAC,QAAQ,EAAE,yBAAyB,GAAG,MAAM,IAAI,CAAC;IAClE,8DAA8D;IAC9D,SAAS,IAAI,IAAI,CAAC;CAClB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panelContext.js","sourceRoot":"","sources":["../../src/stage/panelContext.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;AAEjD,uFAAuF;AACvF,MAAM,CAAC,MAAM,wBAAwB,GAAG,oBAAoB,CAAC;AAE7D,+FAA+F;AAC/F,MAAM,CAAC,MAAM,wBAAwB,GAAG,oBAAoB,CAAC","sourcesContent":["\nimport type { LiquidGlassPanelOptions } from './LiquidGlassPanel.js';\nimport type { StageMinimapDockedView, StagePanelSurface } from './stageTypes.js';\n\nexport const STAGE_CONTEXT_KEY = Symbol('stage');\n\n/** Notifies an active stage that externally positioned panel frames changed layout. */\nexport const STAGE_PANEL_LAYOUT_EVENT = 'stage:panel-layout';\n\n/** Notifies an active stage that an external panel visual changed without affecting layout. */\nexport const STAGE_PANEL_VISUAL_EVENT = 'stage:panel-visual';\n\nexport interface StagePanelPose {\n\twidth: number;\n\theight: number;\n\tposition: { x: number; y: number };\n}\n\nexport interface StagePanelShape {\n\tradius: number;\n\tcontentInset?: number;\n}\n\nexport type StagePanelTheme = Omit<\n\tLiquidGlassPanelOptions,\n\t'width' | 'height' | 'position' | 'radius'\n> & {\n\t/** Semantic surface style. Defaults to the WebGPU-backed `glass` mode. */\n\tsurface?: StagePanelSurface;\n};\n\n\n\nexport interface StagePanelMinimapOptions {\n\texpandedHeight?: number;\n\tinset?: number;\n\t/** Additional unbounded scale applied to the fitted model. Values below 0.2 are clamped. */\n\tmodelScale?: number;\n\t/** Model multiplier at full pointer hover. Use 1 to disable hover enlargement. */\n\thoverModelScale?: number;\n\t/** Hover multiplier used once the minimap is expanded by camera zoom. */\n\texpandedHoverModelScale?: number;\n\t/** Optional spatial-element-specific presentation used while the minimap is docked. */\n\tdockedView?: StageMinimapDockedView;\n\toverlayColor?: string | number;\n\toverlayOpacity?: number;\n\t/** Gaussian blur radius in CSS pixels. */\n\toverlayBlur?: number;\n\tcontextColor?: string | number;\n\tcontextOpacity?: number;\n\tviewportColor?: string | number;\n}\n\nexport interface StagePanelRegistration {\n\tgetContentInset(): number;\n\tgetElement(): HTMLElement | undefined;\n\tgetFrameElement(): HTMLElement | undefined;\n\tgetSurfaceElement(): HTMLElement | undefined;\n\tgetPointerReactive(): boolean;\n\tgetMinimapOptions(): StagePanelMinimapOptions | undefined;\n\tgetOptions(): LiquidGlassPanelOptions;\n\tgetSurface(): StagePanelSurface;\n\t/** Returns the opacity of the panel surface without affecting panel content. */\n\tgetSurfaceOpacity(): number;\n\t/** Returns a transient presentation scale applied to a rendered minimap model. */\n\tgetMinimapModelScale(): number;\n\t/** Returns the animated transition from the regular to the docked minimap view. */\n\tgetMinimapDockProgress(): number;\n\t/** Returns the viewport-space top edge used to anchor the rendered model. */\n\tgetMinimapModelTop(): number | undefined;\n}\n\nexport interface StageViewportRegistration {\n\tgetElement(): HTMLElement | undefined;\n}\n\nexport interface StageContext {\n\tprefetchSpatialElement?(stage: import('../spatial-element/
|
|
1
|
+
{"version":3,"file":"panelContext.js","sourceRoot":"","sources":["../../src/stage/panelContext.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;AAEjD,uFAAuF;AACvF,MAAM,CAAC,MAAM,wBAAwB,GAAG,oBAAoB,CAAC;AAE7D,+FAA+F;AAC/F,MAAM,CAAC,MAAM,wBAAwB,GAAG,oBAAoB,CAAC","sourcesContent":["\nimport type { LiquidGlassPanelOptions } from './LiquidGlassPanel.js';\nimport type { StageMinimapDockedView, StagePanelSurface } from './stageTypes.js';\n\nexport const STAGE_CONTEXT_KEY = Symbol('stage');\n\n/** Notifies an active stage that externally positioned panel frames changed layout. */\nexport const STAGE_PANEL_LAYOUT_EVENT = 'stage:panel-layout';\n\n/** Notifies an active stage that an external panel visual changed without affecting layout. */\nexport const STAGE_PANEL_VISUAL_EVENT = 'stage:panel-visual';\n\nexport interface StagePanelPose {\n\twidth: number;\n\theight: number;\n\tposition: { x: number; y: number };\n}\n\nexport interface StagePanelShape {\n\tradius: number;\n\tcontentInset?: number;\n}\n\nexport type StagePanelTheme = Omit<\n\tLiquidGlassPanelOptions,\n\t'width' | 'height' | 'position' | 'radius'\n> & {\n\t/** Semantic surface style. Defaults to the WebGPU-backed `glass` mode. */\n\tsurface?: StagePanelSurface;\n};\n\n\n\nexport interface StagePanelMinimapOptions {\n\texpandedHeight?: number;\n\tinset?: number;\n\t/** Additional unbounded scale applied to the fitted model. Values below 0.2 are clamped. */\n\tmodelScale?: number;\n\t/** Model multiplier at full pointer hover. Use 1 to disable hover enlargement. */\n\thoverModelScale?: number;\n\t/** Hover multiplier used once the minimap is expanded by camera zoom. */\n\texpandedHoverModelScale?: number;\n\t/** Optional spatial-element-specific presentation used while the minimap is docked. */\n\tdockedView?: StageMinimapDockedView;\n\toverlayColor?: string | number;\n\toverlayOpacity?: number;\n\t/** Gaussian blur radius in CSS pixels. */\n\toverlayBlur?: number;\n\tcontextColor?: string | number;\n\tcontextOpacity?: number;\n\tviewportColor?: string | number;\n}\n\nexport interface StagePanelRegistration {\n\tgetContentInset(): number;\n\tgetElement(): HTMLElement | undefined;\n\tgetFrameElement(): HTMLElement | undefined;\n\tgetSurfaceElement(): HTMLElement | undefined;\n\tgetPointerReactive(): boolean;\n\tgetMinimapOptions(): StagePanelMinimapOptions | undefined;\n\tgetOptions(): LiquidGlassPanelOptions;\n\tgetSurface(): StagePanelSurface;\n\t/** Returns the opacity of the panel surface without affecting panel content. */\n\tgetSurfaceOpacity(): number;\n\t/** Returns a transient presentation scale applied to a rendered minimap model. */\n\tgetMinimapModelScale(): number;\n\t/** Returns the animated transition from the regular to the docked minimap view. */\n\tgetMinimapDockProgress(): number;\n\t/** Returns the viewport-space top edge used to anchor the rendered model. */\n\tgetMinimapModelTop(): number | undefined;\n}\n\nexport interface StageViewportRegistration {\n\tgetElement(): HTMLElement | undefined;\n}\n\nexport interface StageContext {\n\tprefetchSpatialElement?(stage: import('../spatial-element/spatialElementScene.js').SpatialElementScene): void;\n\tregisterPanel(panel: StagePanelRegistration): () => void;\n\tregisterViewport(viewport: StageViewportRegistration): () => void;\n\t/** Restores the element camera to its initial fitted pose. */\n\tresetView(): void;\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { StageRenderSettings } from './stageTypes.js';
|
|
2
|
+
export interface ResolvedStageRenderSettings {
|
|
3
|
+
maxPixelRatio: number;
|
|
4
|
+
maxPixels: number | null;
|
|
5
|
+
}
|
|
6
|
+
export declare const DEFAULT_STAGE_RENDER_SETTINGS: Readonly<ResolvedStageRenderSettings>;
|
|
7
|
+
export declare function resolveStageRenderSettings(settings?: StageRenderSettings): ResolvedStageRenderSettings;
|
|
8
|
+
/** Keep the viewport aspect ratio and allow subsampling on very large displays. */
|
|
9
|
+
export declare function getStageRenderPixelRatio(width: number, height: number, devicePixelRatio: number, settings?: Readonly<ResolvedStageRenderSettings>): number;
|
|
10
|
+
//# sourceMappingURL=renderSettings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderSettings.d.ts","sourceRoot":"","sources":["../../src/stage/renderSettings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,MAAM,WAAW,2BAA2B;IAC3C,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,2BAA2B,CAG/E,CAAC;AAEF,wBAAgB,0BAA0B,CACzC,QAAQ,GAAE,mBAAwB,GAChC,2BAA2B,CAa7B;AAED,mFAAmF;AACnF,wBAAgB,wBAAwB,CACvC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,MAAM,EACxB,QAAQ,GAAE,QAAQ,CAAC,2BAA2B,CAAiC,UAW/E"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const DEFAULT_STAGE_RENDER_SETTINGS = {
|
|
2
|
+
maxPixelRatio: 1,
|
|
3
|
+
maxPixels: 1920 * 1080
|
|
4
|
+
};
|
|
5
|
+
export function resolveStageRenderSettings(settings = {}) {
|
|
6
|
+
return {
|
|
7
|
+
maxPixelRatio: Number.isFinite(settings.maxPixelRatio) && settings.maxPixelRatio > 0
|
|
8
|
+
? settings.maxPixelRatio
|
|
9
|
+
: DEFAULT_STAGE_RENDER_SETTINGS.maxPixelRatio,
|
|
10
|
+
maxPixels: settings.maxPixels === null
|
|
11
|
+
? null
|
|
12
|
+
: Number.isFinite(settings.maxPixels) && settings.maxPixels > 0
|
|
13
|
+
? Math.max(1, Math.floor(settings.maxPixels))
|
|
14
|
+
: DEFAULT_STAGE_RENDER_SETTINGS.maxPixels
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/** Keep the viewport aspect ratio and allow subsampling on very large displays. */
|
|
18
|
+
export function getStageRenderPixelRatio(width, height, devicePixelRatio, settings = DEFAULT_STAGE_RENDER_SETTINGS) {
|
|
19
|
+
const viewportWidth = Number.isFinite(width) && width > 0 ? width : 1;
|
|
20
|
+
const viewportHeight = Number.isFinite(height) && height > 0 ? height : 1;
|
|
21
|
+
const nativeRatio = Number.isFinite(devicePixelRatio) && devicePixelRatio > 0 ? devicePixelRatio : 1;
|
|
22
|
+
const pixelBudgetRatio = settings.maxPixels === null
|
|
23
|
+
? Infinity
|
|
24
|
+
: Math.sqrt(settings.maxPixels / (viewportWidth * viewportHeight));
|
|
25
|
+
return Math.min(nativeRatio, settings.maxPixelRatio, pixelBudgetRatio);
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=renderSettings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderSettings.js","sourceRoot":"","sources":["../../src/stage/renderSettings.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,6BAA6B,GAA0C;IACnF,aAAa,EAAE,CAAC;IAChB,SAAS,EAAE,IAAI,GAAG,IAAI;CACtB,CAAC;AAEF,MAAM,UAAU,0BAA0B,CACzC,WAAgC,EAAE;IAElC,OAAO;QACN,aAAa,EACZ,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,QAAQ,CAAC,aAAc,GAAG,CAAC;YACrE,CAAC,CAAC,QAAQ,CAAC,aAAc;YACzB,CAAC,CAAC,6BAA6B,CAAC,aAAa;QAC/C,SAAS,EACR,QAAQ,CAAC,SAAS,KAAK,IAAI;YAC1B,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,QAAQ,CAAC,SAAU,GAAG,CAAC;gBAC/D,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAU,CAAC,CAAC;gBAC9C,CAAC,CAAC,6BAA6B,CAAC,SAAS;KAC5C,CAAC;AACH,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,wBAAwB,CACvC,KAAa,EACb,MAAc,EACd,gBAAwB,EACxB,WAAkD,6BAA6B;IAE/E,MAAM,aAAa,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACtE,MAAM,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1E,MAAM,WAAW,GAChB,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,gBAAgB,GAAG,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;IAClF,MAAM,gBAAgB,GACrB,QAAQ,CAAC,SAAS,KAAK,IAAI;QAC1B,CAAC,CAAC,QAAQ;QACV,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,GAAG,CAAC,aAAa,GAAG,cAAc,CAAC,CAAC,CAAC;IACrE,OAAO,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,QAAQ,CAAC,aAAa,EAAE,gBAAgB,CAAC,CAAC;AACxE,CAAC","sourcesContent":["import type { StageRenderSettings } from './stageTypes.js';\n\nexport interface ResolvedStageRenderSettings {\n\tmaxPixelRatio: number;\n\tmaxPixels: number | null;\n}\n\nexport const DEFAULT_STAGE_RENDER_SETTINGS: Readonly<ResolvedStageRenderSettings> = {\n\tmaxPixelRatio: 1,\n\tmaxPixels: 1920 * 1080\n};\n\nexport function resolveStageRenderSettings(\n\tsettings: StageRenderSettings = {}\n): ResolvedStageRenderSettings {\n\treturn {\n\t\tmaxPixelRatio:\n\t\t\tNumber.isFinite(settings.maxPixelRatio) && settings.maxPixelRatio! > 0\n\t\t\t\t? settings.maxPixelRatio!\n\t\t\t\t: DEFAULT_STAGE_RENDER_SETTINGS.maxPixelRatio,\n\t\tmaxPixels:\n\t\t\tsettings.maxPixels === null\n\t\t\t\t? null\n\t\t\t\t: Number.isFinite(settings.maxPixels) && settings.maxPixels! > 0\n\t\t\t\t\t? Math.max(1, Math.floor(settings.maxPixels!))\n\t\t\t\t\t: DEFAULT_STAGE_RENDER_SETTINGS.maxPixels\n\t};\n}\n\n/** Keep the viewport aspect ratio and allow subsampling on very large displays. */\nexport function getStageRenderPixelRatio(\n\twidth: number,\n\theight: number,\n\tdevicePixelRatio: number,\n\tsettings: Readonly<ResolvedStageRenderSettings> = DEFAULT_STAGE_RENDER_SETTINGS\n) {\n\tconst viewportWidth = Number.isFinite(width) && width > 0 ? width : 1;\n\tconst viewportHeight = Number.isFinite(height) && height > 0 ? height : 1;\n\tconst nativeRatio =\n\t\tNumber.isFinite(devicePixelRatio) && devicePixelRatio > 0 ? devicePixelRatio : 1;\n\tconst pixelBudgetRatio =\n\t\tsettings.maxPixels === null\n\t\t\t? Infinity\n\t\t\t: Math.sqrt(settings.maxPixels / (viewportWidth * viewportHeight));\n\treturn Math.min(nativeRatio, settings.maxPixelRatio, pixelBudgetRatio);\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RenderTarget } from 'three/webgpu';
|
|
2
|
-
/** Three
|
|
2
|
+
/** Three r186 diagnostic adapter only; never used for rendering or ownership. */
|
|
3
3
|
export declare function gaussianTargets(effect: unknown): RenderTarget[];
|
|
4
4
|
export declare function describeRenderTargets(groups: Readonly<Record<string, readonly RenderTarget[]>>): {
|
|
5
5
|
liveTargets: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Three
|
|
1
|
+
/** Three r186 diagnostic adapter only; never used for rendering or ownership. */
|
|
2
2
|
export function gaussianTargets(effect) {
|
|
3
3
|
const node = effect;
|
|
4
4
|
return [node?._horizontalRT, node?._verticalRT].filter((target) => Boolean(target));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderTargetInventory.js","sourceRoot":"","sources":["../../src/stage/renderTargetInventory.ts"],"names":[],"mappings":"AAEA,iFAAiF;AACjF,MAAM,UAAU,eAAe,CAAC,MAAe;IAC9C,MAAM,IAAI,GAAG,MAAkF,CAAC;IAChG,OAAO,CAAC,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,EAA0B,EAAE,CACzF,OAAO,CAAC,MAAM,CAAC,CACf,CAAC;AACH,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,MAAyD;IAC9F,MAAM,IAAI,GAAG,IAAI,GAAG,EAAgB,CAAC;IACrC,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,EAAE,CAClE,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;QACzB,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC;YAAE,OAAO,EAAE,CAAC;QAChC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACjB,OAAO;YACN;gBACC,KAAK;gBACL,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI;gBACvB,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,KAAK,EAAE,MAAM,CAAC,WAAW;gBACzB,gBAAgB,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM;gBACxC,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI;aAC9B;SACD,CAAC;IACH,CAAC,CAAC,CACF,CAAC;IACF,OAAO,EAAE,WAAW,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC;AACjD,CAAC","sourcesContent":["import type { RenderTarget } from 'three/webgpu';\n\n/** Three
|
|
1
|
+
{"version":3,"file":"renderTargetInventory.js","sourceRoot":"","sources":["../../src/stage/renderTargetInventory.ts"],"names":[],"mappings":"AAEA,iFAAiF;AACjF,MAAM,UAAU,eAAe,CAAC,MAAe;IAC9C,MAAM,IAAI,GAAG,MAAkF,CAAC;IAChG,OAAO,CAAC,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,EAA0B,EAAE,CACzF,OAAO,CAAC,MAAM,CAAC,CACf,CAAC;AACH,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,MAAyD;IAC9F,MAAM,IAAI,GAAG,IAAI,GAAG,EAAgB,CAAC;IACrC,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,EAAE,CAClE,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;QACzB,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC;YAAE,OAAO,EAAE,CAAC;QAChC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACjB,OAAO;YACN;gBACC,KAAK;gBACL,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI;gBACvB,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,KAAK,EAAE,MAAM,CAAC,WAAW;gBACzB,gBAAgB,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM;gBACxC,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI;aAC9B;SACD,CAAC;IACH,CAAC,CAAC,CACF,CAAC;IACF,OAAO,EAAE,WAAW,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC;AACjD,CAAC","sourcesContent":["import type { RenderTarget } from 'three/webgpu';\n\n/** Three r186 diagnostic adapter only; never used for rendering or ownership. */\nexport function gaussianTargets(effect: unknown): RenderTarget[] {\n\tconst node = effect as { _horizontalRT?: RenderTarget; _verticalRT?: RenderTarget } | undefined;\n\treturn [node?._horizontalRT, node?._verticalRT].filter((target): target is RenderTarget =>\n\t\tBoolean(target)\n\t);\n}\n\nexport function describeRenderTargets(groups: Readonly<Record<string, readonly RenderTarget[]>>) {\n\tconst seen = new Set<RenderTarget>();\n\tconst targets = Object.entries(groups).flatMap(([owner, values]) =>\n\t\tvalues.flatMap((target) => {\n\t\t\tif (seen.has(target)) return [];\n\t\t\tseen.add(target);\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\towner,\n\t\t\t\t\tid: target.texture.uuid,\n\t\t\t\t\twidth: target.width,\n\t\t\t\t\theight: target.height,\n\t\t\t\t\tsamples: target.samples,\n\t\t\t\t\tdepth: target.depthBuffer,\n\t\t\t\t\tcolorAttachments: target.textures.length,\n\t\t\t\t\tcolorType: target.texture.type\n\t\t\t\t}\n\t\t\t];\n\t\t})\n\t);\n\treturn { liveTargets: targets.length, targets };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spatialElementFrame.d.ts","sourceRoot":"","sources":["../../src/stage/spatialElementFrame.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"spatialElementFrame.d.ts","sourceRoot":"","sources":["../../src/stage/spatialElementFrame.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,sFAAsF;AACtF,wBAAgB,0BAA0B,CACzC,KAAK,EAAE,KAAK,CAAC,QAAQ,EACrB,MAAM,EAAE,KAAK,CAAC,QAAQ,EACtB,IAAI,EAAE,qBAAqB,EAC3B,QAAQ,EAAE,kBAAkB,cA6B5B"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as THREE from 'three/webgpu';
|
|
2
|
+
import { getMeshBounds } from './stageSceneUtils.js';
|
|
2
3
|
/** The same import and fit transform is used for both LODs and every presentation. */
|
|
3
4
|
export function prepareSpatialElementFrame(model, source, pair, settings) {
|
|
4
5
|
const frame = new THREE.Group();
|
|
@@ -10,7 +11,10 @@ export function prepareSpatialElementFrame(model, source, pair, settings) {
|
|
|
10
11
|
pose.add(frame);
|
|
11
12
|
model.add(pose);
|
|
12
13
|
pose.updateMatrix();
|
|
13
|
-
const
|
|
14
|
+
const excluded = new Set(settings.excludeMeshes ?? []);
|
|
15
|
+
const bounds = pair.bounds
|
|
16
|
+
? new THREE.Box3(new THREE.Vector3(...pair.bounds.min), new THREE.Vector3(...pair.bounds.max)).applyMatrix4(pose.matrix)
|
|
17
|
+
: getMeshBounds(pose, (mesh) => !excluded.has(mesh.name));
|
|
14
18
|
const center = bounds.getCenter(new THREE.Vector3());
|
|
15
19
|
const size = bounds.getSize(new THREE.Vector3());
|
|
16
20
|
const scale = 3 / Math.max(size.x, size.y, size.z, 1);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spatialElementFrame.js","sourceRoot":"","sources":["../../src/stage/spatialElementFrame.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"spatialElementFrame.js","sourceRoot":"","sources":["../../src/stage/spatialElementFrame.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAIrD,sFAAsF;AACtF,MAAM,UAAU,0BAA0B,CACzC,KAAqB,EACrB,MAAsB,EACtB,IAA2B,EAC3B,QAA4B;IAE5B,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;IAChC,KAAK,CAAC,gBAAgB,GAAG,KAAK,CAAC;IAC/B,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC1C,KAAK,CA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IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACtD,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC7B,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,CAAC;IACnD,KAAK,CAAC,YAAY,EAAE,CAAC;IACrB,OAAO,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["import * as THREE from 'three/webgpu';\nimport { getMeshBounds } from './stageSceneUtils.js';\nimport type { SpatialElementLodPair } from '../catalog/spatialElementLodPair.js';\nimport type { StageModelSettings } from './stageTypes.js';\n\n/** The same import and fit transform is used for both LODs and every presentation. */\nexport function prepareSpatialElementFrame(\n\tmodel: THREE.Object3D,\n\tsource: THREE.Object3D,\n\tpair: SpatialElementLodPair,\n\tsettings: StageModelSettings\n) {\n\tconst frame = new THREE.Group();\n\tframe.matrixAutoUpdate = false;\n\tframe.matrix.fromArray(pair.assetToFrame);\n\tframe.add(source);\n\tconst pose = new THREE.Group();\n\tpose.rotation.set(\n\t\tsettings.rotation?.x ?? 0,\n\t\tsettings.rotation?.y ?? 0,\n\t\tsettings.rotation?.z ?? 0\n\t);\n\tpose.add(frame);\n\tmodel.add(pose);\n\tpose.updateMatrix();\n\tconst excluded = new Set(settings.excludeMeshes ?? []);\n\tconst bounds = pair.bounds\n\t\t? new THREE.Box3(\n\t\t\t\tnew THREE.Vector3(...pair.bounds.min),\n\t\t\t\tnew THREE.Vector3(...pair.bounds.max)\n\t\t\t).applyMatrix4(pose.matrix)\n\t\t: getMeshBounds(pose, (mesh) => !excluded.has(mesh.name));\n\tconst center = bounds.getCenter(new THREE.Vector3());\n\tconst size = bounds.getSize(new THREE.Vector3());\n\tconst scale = 3 / Math.max(size.x, size.y, size.z, 1);\n\tmodel.scale.setScalar(scale);\n\tmodel.position.copy(center).multiplyScalar(-scale);\n\tmodel.updateMatrix();\n\treturn bounds.applyMatrix4(model.matrix);\n}\n"]}
|
|
@@ -149,8 +149,17 @@ export interface StageVisualTestView {
|
|
|
149
149
|
z: number;
|
|
150
150
|
}>;
|
|
151
151
|
}
|
|
152
|
+
/** Bounds WebGPU rasterization cost independently of native DOM text resolution. */
|
|
153
|
+
export interface StageRenderSettings {
|
|
154
|
+
/** Maximum physical pixels per CSS pixel. Defaults to 1. */
|
|
155
|
+
maxPixelRatio?: number;
|
|
156
|
+
/** Maximum pixels per full-size canvas/capture. Defaults to 2,073,600; null disables this limit. */
|
|
157
|
+
maxPixels?: number | null;
|
|
158
|
+
}
|
|
152
159
|
/** Construction options for a {@link StageExperience}. */
|
|
153
160
|
export interface StageExperienceOptions {
|
|
161
|
+
/** Stage-wide output quality; native DOM content remains at the device pixel ratio. */
|
|
162
|
+
renderSettings?: StageRenderSettings;
|
|
154
163
|
/** Directory containing Draco decoder files, including trailing slash. */
|
|
155
164
|
dracoDecoderPath?: string;
|
|
156
165
|
/** Opaque page surface, independent of the HDR environment. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stageTypes.d.ts","sourceRoot":"","sources":["../../src/stage/stageTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,KAAK,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAErE,8EAA8E;AAC9E,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;AAE9D,sEAAsE;AACtE,MAAM,WAAW,kBAAkB;IAClC,qFAAqF;IACrF,UAAU,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,IAAI,EAAE,mBAAmB,CAAC;IAC1B,4EAA4E;IAC5E,aAAa,EAAE,MAAM,CAAC;CACtB;AAED,iFAAiF;A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ypes.js","sourceRoot":"","sources":["../../src/stage/stageTypes.ts"],"names":[],"mappings":"","sourcesContent":["import type { SpatialElementLodPair } from '../catalog/spatialElementLodPair.js';\nimport type { ColorRepresentation, Mesh } from 'three';\nimport type { LiquidGlassPanelOptions } from './LiquidGlassPanel.js';\n\n/** Selects the rendering backend and visual complexity of a panel surface. */\nexport type StagePanelSurface = 'solid' | 'frosted' | 'glass';\n\n/** Controls how the HDR environment is presented behind the stage. */\nexport interface BackgroundSettings {\n\t/** Three.js background blur amount in the range supported by the active renderer. */\n\tblurriness: number;\n\t/** Color mixed over the HDR background. */\n\ttint: ColorRepresentation;\n\t/** Strength of the background tint, where zero leaves the HDR unchanged. */\n\ttintIntensity: number;\n}\n\n/** Axis rotations, in radians, applied to a loaded model before it is fitted. */\nexport interface StageModelRotation {\n\tx?: number;\n\ty?: number;\n\tz?: number;\n}\n\n/** Controls the fitted camera's initial orbit around the element. */\nexport interface StageCameraSettings {\n\t/** Horizontal viewing angle in degrees. Positive values view from the right. */\n\tazimuth?: number;\n\t/** Vertical viewing angle in degrees. Positive values view from above. */\n\televation?: number;\n\t/** Empty space in CSS pixels reserved on every side of the automatic element fit. */\n\tfitPadding?: number;\n\t/** Presentation multiplier applied after fitting. Values above one make the element larger. */\n\tfitScale?: number;\n}\n\n/** Supported blend modes for declarative stage material replacements. */\nexport type StageMaterialBlending = 'normal' | 'additive';\n\n/** Serializable subset used to replace an asset mesh with a physical material. */\nexport interface StagePhysicalMaterialSettings {\n\ttype: 'physical';\n\tcolor?: ColorRepresentation;\n\topacity?: number;\n\ttransparent?: boolean;\n\tmetalness?: number;\n\troughness?: number;\n\tiridescence?: number;\n\tclearcoat?: number;\n\tblending?: StageMaterialBlending;\n}\n\nexport type StageMaterialSettings = StagePhysicalMaterialSettings;\n\n/** Controls the authored model pose and which meshes represent the actual element. */\nexport interface StageModelSettings {\n\t/** Optional rotation applied on top of the GLB scene's authored root rotation. */\n\trotation?: StageModelRotation;\n\t/**\n\t * Exact, case-sensitive mesh names that remain visible on the main stage but do\n\t * not participate in element bounds, picking, outlining, or element minimaps.\n\t */\n\texcludeMeshes?: readonly string[];\n\t/** Physical material replacements keyed by exact, case-sensitive mesh name. */\n\tmaterialOverrides?: Readonly<Record<string, StageMaterialSettings>>;\n}\n\n/** Controls the minimap model presentation while its panel is docked. */\nexport interface StageMinimapDockedView {\n\t/** Model multiplier used only while the minimap is docked. */\n\tscale?: number;\n\t/** Horizontal viewing angle in degrees. Positive values view from the right. */\n\tazimuth?: number;\n\t/** Vertical viewing angle in degrees. Positive values view from above. */\n\televation?: number;\n}\n\n/** Configures the optional element minimap rendered on top of a panel. */\nexport interface StageMinimapOptions {\n\t/** Panel height, in CSS pixels, at maximum stage zoom. */\n\texpandedHeight?: number;\n\t/** Space, in CSS pixels, reserved around the minimap model. */\n\tinset?: number;\n\t/** Additional unbounded scale applied to the fitted minimap model. Values below 0.2 are clamped. */\n\tmodelScale?: number;\n\t/** Model multiplier at full pointer hover. Use 1 to disable hover enlargement. */\n\thoverModelScale?: number;\n\t/** Hover multiplier used once the minimap is expanded by camera zoom. */\n\texpandedHoverModelScale?: number;\n\t/** Optional spatial-element-specific presentation used while the minimap is docked. */\n\tdockedView?: StageMinimapDockedView;\n\t/** Color drawn over the blurred area outside the viewport cutout. */\n\toverlayColor?: ColorRepresentation;\n\t/** Overlay alpha using the same zero-to-one convention as CSS/Figma. */\n\toverlayOpacity?: number;\n\t/** Gaussian blur radius in CSS pixels. */\n\toverlayBlur?: number;\n\t/** Color behind the minimap capture when no stage background is rendered. */\n\tcontextColor?: ColorRepresentation;\n\t/** Alpha of the minimap capture background. */\n\tcontextOpacity?: number;\n\t/** Color of the rectangle describing the main camera viewport. */\n\tviewportColor?: ColorRepresentation;\n}\n\n/** Connects one DOM panel declaration to its WebGPU and CSS3D representations. */\nexport interface StagePanelTarget {\n\t/** Accessible DOM content displayed above the WebGPU panel. */\n\tcontent: HTMLElement;\n\t/** Inner content padding in CSS pixels. */\n\tcontentInset: number;\n\t/** DOM element whose layout determines the panel position and dimensions. */\n\tframe: HTMLElement;\n\t/** Complete DOM surface used by solid and frosted CSS3D panels. */\n\tsurfaceElement: HTMLElement;\n\t/** Enables the panel's minimap rendering mode. */\n\tminimap?: StageMinimapOptions;\n\t/** Enables proximity lift and pointer-driven tilt. Defaults to true. */\n\tpointerReactive?: boolean;\n\t/** Shared geometry, tint, blur, and shadow configuration. */\n\toptions: LiquidGlassPanelOptions;\n\t/** Visual surface backend. All variants share the same CSS3D transform pipeline. */\n\tsurface: StagePanelSurface;\n\t/** Reads the current opacity of the visual surface independently of its content. */\n\tgetSurfaceOpacity?: () => number;\n\t/** Reads a transient scale applied only to the rendered minimap model. */\n\tgetMinimapModelScale?: () => number;\n\t/** Reads the animated transition from the regular to the docked minimap view. */\n\tgetMinimapDockProgress?: () => number;\n\t/** Reads the viewport-space top edge used to anchor the rendered model. */\n\tgetMinimapModelTop?: () => number | undefined;\n}\n\n/** Identifies the DOM region used to frame the main element camera. */\nexport interface StageViewportTarget {\n\telement: HTMLElement;\n}\n\n/** Describes the independently animated phases of a close-up zoom. */\nexport interface StageZoomFocusState {\n\t/** Camera-derived close-up amount, from the fitted view to maximum zoom. */\n\tfocus: number;\n\t/** Progress used to fade and move ordinary page content and panels. */\n\tuiFocus: number;\n\t/** Exact opacity applied to ordinary panels and non-stage DOM content. */\n\tuiOpacity: number;\n\t/** Delayed progress used to expand and morph the minimap. */\n\tminimapFocus: number;\n}\n\n/** A deterministic camera pose used by browser-level visual regression tests. */\nexport interface StageVisualTestView {\n\t/** Normalized camera distance, where zero is the fitted view and one is maximum zoom. */\n\tzoom?: number;\n\t/** Horizontal orbit offset from the initial pose, in degrees. */\n\tazimuth?: number;\n\t/** Vertical orbit offset from the initial pose, in degrees. */\n\tpolar?: number;\n\t/** Orbit-target offset expressed as a fraction of the fitted model radius. */\n\ttargetOffset?: Partial<{ x: number; y: number; z: number }>;\n}\n\n/** Construction options for a {@link StageExperience}. */\nexport interface StageExperienceOptions {\n\t/** Directory containing Draco decoder files, including trailing slash. */\n\tdracoDecoderPath?: string;\n\t/** Opaque page surface, independent of the HDR environment. */\n\tpageBackground?: string;\n\t/** Reveals semantic content when the device can no longer render. */\n\tonDeviceLost?: () => void;\n\tlodPair?: SpatialElementLodPair;\n\t/** Catalog pages register their own presentations, including an intentionally empty list. */\n\tcatalog?: boolean;\n\t/** A restored dock uses Low only; optional detail preparation resumes when the hero returns. */\n\tdeferDetailPreparation?: boolean;\n\theroIsPresented?: () => boolean;\n\tbackground?: BackgroundSettings;\n\thdr?: string;\n\tglb?: string;\n\tmodel?: StageModelSettings;\n\tcamera?: StageCameraSettings;\n\tinteractionTheme?: Partial<StageInteractionTheme>;\n\tpanels?: StagePanelTarget[];\n\tviewport?: StageViewportTarget;\n\t/** Enables optional 3DxWare/SpaceMouse navigation. Defaults to true. */\n\tenableSpaceMouse?: boolean;\n\t/** Receives the normalized, sequenced phases of a close-up zoom. */\n\tonZoomFocusChange?: (state: StageZoomFocusState) => void;\n}\n\n/** Visual and filtering options for element hover interaction. */\nexport interface StageInteractionTheme {\n\toutlineColor: ColorRepresentation;\n\toutlineOpacity: number;\n\toutlineThickness: number;\n\toutlineGlow: number;\n\toutlineGlowThickness: number;\n\t/** Returns true for model meshes that must not participate in picking or outlining. */\n\texcludeMesh?: (mesh: Mesh) => boolean;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"stageTypes.js","sourceRoot":"","sources":["../../src/stage/stageTypes.ts"],"names":[],"mappings":"","sourcesContent":["import type { SpatialElementLodPair } from '../catalog/spatialElementLodPair.js';\nimport type { ColorRepresentation, Mesh } from 'three';\nimport type { LiquidGlassPanelOptions } from './LiquidGlassPanel.js';\n\n/** Selects the rendering backend and visual complexity of a panel surface. */\nexport type StagePanelSurface = 'solid' | 'frosted' | 'glass';\n\n/** Controls how the HDR environment is presented behind the stage. */\nexport interface BackgroundSettings {\n\t/** Three.js background blur amount in the range supported by the active renderer. */\n\tblurriness: number;\n\t/** Color mixed over the HDR background. */\n\ttint: ColorRepresentation;\n\t/** Strength of the background tint, where zero leaves the HDR unchanged. */\n\ttintIntensity: number;\n}\n\n/** Axis rotations, in radians, applied to a loaded model before it is fitted. */\nexport interface StageModelRotation {\n\tx?: number;\n\ty?: number;\n\tz?: number;\n}\n\n/** Controls the fitted camera's initial orbit around the element. */\nexport interface StageCameraSettings {\n\t/** Horizontal viewing angle in degrees. Positive values view from the right. */\n\tazimuth?: number;\n\t/** Vertical viewing angle in degrees. Positive values view from above. */\n\televation?: number;\n\t/** Empty space in CSS pixels reserved on every side of the automatic element fit. */\n\tfitPadding?: number;\n\t/** Presentation multiplier applied after fitting. Values above one make the element larger. */\n\tfitScale?: number;\n}\n\n/** Supported blend modes for declarative stage material replacements. */\nexport type StageMaterialBlending = 'normal' | 'additive';\n\n/** Serializable subset used to replace an asset mesh with a physical material. */\nexport interface StagePhysicalMaterialSettings {\n\ttype: 'physical';\n\tcolor?: ColorRepresentation;\n\topacity?: number;\n\ttransparent?: boolean;\n\tmetalness?: number;\n\troughness?: number;\n\tiridescence?: number;\n\tclearcoat?: number;\n\tblending?: StageMaterialBlending;\n}\n\nexport type StageMaterialSettings = StagePhysicalMaterialSettings;\n\n/** Controls the authored model pose and which meshes represent the actual element. */\nexport interface StageModelSettings {\n\t/** Optional rotation applied on top of the GLB scene's authored root rotation. */\n\trotation?: StageModelRotation;\n\t/**\n\t * Exact, case-sensitive mesh names that remain visible on the main stage but do\n\t * not participate in element bounds, picking, outlining, or element minimaps.\n\t */\n\texcludeMeshes?: readonly string[];\n\t/** Physical material replacements keyed by exact, case-sensitive mesh name. */\n\tmaterialOverrides?: Readonly<Record<string, StageMaterialSettings>>;\n}\n\n/** Controls the minimap model presentation while its panel is docked. */\nexport interface StageMinimapDockedView {\n\t/** Model multiplier used only while the minimap is docked. */\n\tscale?: number;\n\t/** Horizontal viewing angle in degrees. Positive values view from the right. */\n\tazimuth?: number;\n\t/** Vertical viewing angle in degrees. Positive values view from above. */\n\televation?: number;\n}\n\n/** Configures the optional element minimap rendered on top of a panel. */\nexport interface StageMinimapOptions {\n\t/** Panel height, in CSS pixels, at maximum stage zoom. */\n\texpandedHeight?: number;\n\t/** Space, in CSS pixels, reserved around the minimap model. */\n\tinset?: number;\n\t/** Additional unbounded scale applied to the fitted minimap model. Values below 0.2 are clamped. */\n\tmodelScale?: number;\n\t/** Model multiplier at full pointer hover. Use 1 to disable hover enlargement. */\n\thoverModelScale?: number;\n\t/** Hover multiplier used once the minimap is expanded by camera zoom. */\n\texpandedHoverModelScale?: number;\n\t/** Optional spatial-element-specific presentation used while the minimap is docked. */\n\tdockedView?: StageMinimapDockedView;\n\t/** Color drawn over the blurred area outside the viewport cutout. */\n\toverlayColor?: ColorRepresentation;\n\t/** Overlay alpha using the same zero-to-one convention as CSS/Figma. */\n\toverlayOpacity?: number;\n\t/** Gaussian blur radius in CSS pixels. */\n\toverlayBlur?: number;\n\t/** Color behind the minimap capture when no stage background is rendered. */\n\tcontextColor?: ColorRepresentation;\n\t/** Alpha of the minimap capture background. */\n\tcontextOpacity?: number;\n\t/** Color of the rectangle describing the main camera viewport. */\n\tviewportColor?: ColorRepresentation;\n}\n\n/** Connects one DOM panel declaration to its WebGPU and CSS3D representations. */\nexport interface StagePanelTarget {\n\t/** Accessible DOM content displayed above the WebGPU panel. */\n\tcontent: HTMLElement;\n\t/** Inner content padding in CSS pixels. */\n\tcontentInset: number;\n\t/** DOM element whose layout determines the panel position and dimensions. */\n\tframe: HTMLElement;\n\t/** Complete DOM surface used by solid and frosted CSS3D panels. */\n\tsurfaceElement: HTMLElement;\n\t/** Enables the panel's minimap rendering mode. */\n\tminimap?: StageMinimapOptions;\n\t/** Enables proximity lift and pointer-driven tilt. Defaults to true. */\n\tpointerReactive?: boolean;\n\t/** Shared geometry, tint, blur, and shadow configuration. */\n\toptions: LiquidGlassPanelOptions;\n\t/** Visual surface backend. All variants share the same CSS3D transform pipeline. */\n\tsurface: StagePanelSurface;\n\t/** Reads the current opacity of the visual surface independently of its content. */\n\tgetSurfaceOpacity?: () => number;\n\t/** Reads a transient scale applied only to the rendered minimap model. */\n\tgetMinimapModelScale?: () => number;\n\t/** Reads the animated transition from the regular to the docked minimap view. */\n\tgetMinimapDockProgress?: () => number;\n\t/** Reads the viewport-space top edge used to anchor the rendered model. */\n\tgetMinimapModelTop?: () => number | undefined;\n}\n\n/** Identifies the DOM region used to frame the main element camera. */\nexport interface StageViewportTarget {\n\telement: HTMLElement;\n}\n\n/** Describes the independently animated phases of a close-up zoom. */\nexport interface StageZoomFocusState {\n\t/** Camera-derived close-up amount, from the fitted view to maximum zoom. */\n\tfocus: number;\n\t/** Progress used to fade and move ordinary page content and panels. */\n\tuiFocus: number;\n\t/** Exact opacity applied to ordinary panels and non-stage DOM content. */\n\tuiOpacity: number;\n\t/** Delayed progress used to expand and morph the minimap. */\n\tminimapFocus: number;\n}\n\n/** A deterministic camera pose used by browser-level visual regression tests. */\nexport interface StageVisualTestView {\n\t/** Normalized camera distance, where zero is the fitted view and one is maximum zoom. */\n\tzoom?: number;\n\t/** Horizontal orbit offset from the initial pose, in degrees. */\n\tazimuth?: number;\n\t/** Vertical orbit offset from the initial pose, in degrees. */\n\tpolar?: number;\n\t/** Orbit-target offset expressed as a fraction of the fitted model radius. */\n\ttargetOffset?: Partial<{ x: number; y: number; z: number }>;\n}\n\n/** Bounds WebGPU rasterization cost independently of native DOM text resolution. */\nexport interface StageRenderSettings {\n\t/** Maximum physical pixels per CSS pixel. Defaults to 1. */\n\tmaxPixelRatio?: number;\n\t/** Maximum pixels per full-size canvas/capture. Defaults to 2,073,600; null disables this limit. */\n\tmaxPixels?: number | null;\n}\n\n/** Construction options for a {@link StageExperience}. */\nexport interface StageExperienceOptions {\n\t/** Stage-wide output quality; native DOM content remains at the device pixel ratio. */\n\trenderSettings?: StageRenderSettings;\n\t/** Directory containing Draco decoder files, including trailing slash. */\n\tdracoDecoderPath?: string;\n\t/** Opaque page surface, independent of the HDR environment. */\n\tpageBackground?: string;\n\t/** Reveals semantic content when the device can no longer render. */\n\tonDeviceLost?: () => void;\n\tlodPair?: SpatialElementLodPair;\n\t/** Catalog pages register their own presentations, including an intentionally empty list. */\n\tcatalog?: boolean;\n\t/** A restored dock uses Low only; optional detail preparation resumes when the hero returns. */\n\tdeferDetailPreparation?: boolean;\n\theroIsPresented?: () => boolean;\n\tbackground?: BackgroundSettings;\n\thdr?: string;\n\tglb?: string;\n\tmodel?: StageModelSettings;\n\tcamera?: StageCameraSettings;\n\tinteractionTheme?: Partial<StageInteractionTheme>;\n\tpanels?: StagePanelTarget[];\n\tviewport?: StageViewportTarget;\n\t/** Enables optional 3DxWare/SpaceMouse navigation. Defaults to true. */\n\tenableSpaceMouse?: boolean;\n\t/** Receives the normalized, sequenced phases of a close-up zoom. */\n\tonZoomFocusChange?: (state: StageZoomFocusState) => void;\n}\n\n/** Visual and filtering options for element hover interaction. */\nexport interface StageInteractionTheme {\n\toutlineColor: ColorRepresentation;\n\toutlineOpacity: number;\n\toutlineThickness: number;\n\toutlineGlow: number;\n\toutlineGlowThickness: number;\n\t/** Returns true for model meshes that must not participate in picking or outlining. */\n\texcludeMesh?: (mesh: Mesh) => boolean;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spatial-elements/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.0-beta.3",
|
|
4
4
|
"description": "Framework-independent rendering and catalog runtime for Spatial Elements.",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -51,11 +51,11 @@
|
|
|
51
51
|
"@3dconnexion/3dconnexionjs": "0.8.1"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"three": "^0.
|
|
54
|
+
"three": "^0.186.1"
|
|
55
55
|
},
|
|
56
56
|
"publishConfig": {
|
|
57
57
|
"access": "public",
|
|
58
|
-
"tag": "
|
|
58
|
+
"tag": "latest",
|
|
59
59
|
"registry": "https://registry.npmjs.org/"
|
|
60
60
|
}
|
|
61
61
|
}
|