@spatial-elements/core 0.1.0-beta.2 → 1.0.0-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (391) hide show
  1. package/README.md +16 -13
  2. package/dist/catalog/CarouselDeviceCamera.d.ts +20 -0
  3. package/dist/catalog/CarouselDeviceCamera.d.ts.map +1 -0
  4. package/dist/catalog/CarouselDeviceCamera.js +58 -0
  5. package/dist/catalog/CarouselDeviceCamera.js.map +1 -0
  6. package/dist/catalog/CarouselGlassCompositor.d.ts +14 -3
  7. package/dist/catalog/CarouselGlassCompositor.d.ts.map +1 -1
  8. package/dist/catalog/CarouselGlassCompositor.js +164 -28
  9. package/dist/catalog/CarouselGlassCompositor.js.map +1 -1
  10. package/dist/catalog/CarouselGround.d.ts +43 -0
  11. package/dist/catalog/CarouselGround.d.ts.map +1 -0
  12. package/dist/catalog/CarouselGround.js +270 -0
  13. package/dist/catalog/CarouselGround.js.map +1 -0
  14. package/dist/catalog/CarouselSectionSurfaces.d.ts +10 -0
  15. package/dist/catalog/CarouselSectionSurfaces.d.ts.map +1 -0
  16. package/dist/catalog/CarouselSectionSurfaces.js +55 -0
  17. package/dist/catalog/CarouselSectionSurfaces.js.map +1 -0
  18. package/dist/catalog/CatalogDepthBlur.d.ts +45 -0
  19. package/dist/catalog/CatalogDepthBlur.d.ts.map +1 -0
  20. package/dist/catalog/CatalogDepthBlur.js +190 -0
  21. package/dist/catalog/CatalogDepthBlur.js.map +1 -0
  22. package/dist/catalog/CatalogEndpointRegistry.d.ts +4 -2
  23. package/dist/catalog/CatalogEndpointRegistry.d.ts.map +1 -1
  24. package/dist/catalog/CatalogEndpointRegistry.js +2 -0
  25. package/dist/catalog/CatalogEndpointRegistry.js.map +1 -1
  26. package/dist/catalog/CatalogGeometryFade.d.ts +5 -1
  27. package/dist/catalog/CatalogGeometryFade.d.ts.map +1 -1
  28. package/dist/catalog/CatalogGeometryFade.js +45 -9
  29. package/dist/catalog/CatalogGeometryFade.js.map +1 -1
  30. package/dist/catalog/CatalogModelOutline.d.ts +33 -0
  31. package/dist/catalog/CatalogModelOutline.d.ts.map +1 -0
  32. package/dist/catalog/CatalogModelOutline.js +144 -0
  33. package/dist/catalog/CatalogModelOutline.js.map +1 -0
  34. package/dist/catalog/CatalogNavigationRegistry.d.ts +44 -0
  35. package/dist/catalog/CatalogNavigationRegistry.d.ts.map +1 -0
  36. package/dist/catalog/CatalogNavigationRegistry.js +66 -0
  37. package/dist/catalog/CatalogNavigationRegistry.js.map +1 -0
  38. package/dist/catalog/CatalogPreparation.d.ts +3 -3
  39. package/dist/catalog/CatalogPreparation.d.ts.map +1 -1
  40. package/dist/catalog/CatalogPreparation.js +10 -7
  41. package/dist/catalog/CatalogPreparation.js.map +1 -1
  42. package/dist/catalog/CatalogSpatialElementLayer.d.ts +175 -5
  43. package/dist/catalog/CatalogSpatialElementLayer.d.ts.map +1 -1
  44. package/dist/catalog/CatalogSpatialElementLayer.js +739 -121
  45. package/dist/catalog/CatalogSpatialElementLayer.js.map +1 -1
  46. package/dist/catalog/CatalogTransition.d.ts +5 -3
  47. package/dist/catalog/CatalogTransition.d.ts.map +1 -1
  48. package/dist/catalog/CatalogTransition.js +207 -91
  49. package/dist/catalog/CatalogTransition.js.map +1 -1
  50. package/dist/catalog/CatalogWarmOutputContext.d.ts +39 -0
  51. package/dist/catalog/CatalogWarmOutputContext.d.ts.map +1 -0
  52. package/dist/catalog/CatalogWarmOutputContext.js +159 -0
  53. package/dist/catalog/CatalogWarmOutputContext.js.map +1 -0
  54. package/dist/catalog/EarlyNavigationCoordinator.d.ts +35 -0
  55. package/dist/catalog/EarlyNavigationCoordinator.d.ts.map +1 -0
  56. package/dist/catalog/EarlyNavigationCoordinator.js +103 -0
  57. package/dist/catalog/EarlyNavigationCoordinator.js.map +1 -0
  58. package/dist/catalog/NavigationFeedback.d.ts +12 -0
  59. package/dist/catalog/NavigationFeedback.d.ts.map +1 -0
  60. package/dist/catalog/NavigationFeedback.js +40 -0
  61. package/dist/catalog/NavigationFeedback.js.map +1 -0
  62. package/dist/catalog/PreparationGate.d.ts +4 -0
  63. package/dist/catalog/PreparationGate.d.ts.map +1 -1
  64. package/dist/catalog/PreparationGate.js +1 -0
  65. package/dist/catalog/PreparationGate.js.map +1 -1
  66. package/dist/catalog/SourceDomClipping.d.ts +8 -0
  67. package/dist/catalog/SourceDomClipping.d.ts.map +1 -0
  68. package/dist/catalog/SourceDomClipping.js +74 -0
  69. package/dist/catalog/SourceDomClipping.js.map +1 -0
  70. package/dist/catalog/SourceDomMotion.d.ts +28 -0
  71. package/dist/catalog/SourceDomMotion.d.ts.map +1 -0
  72. package/dist/catalog/SourceDomMotion.js +111 -0
  73. package/dist/catalog/SourceDomMotion.js.map +1 -0
  74. package/dist/catalog/SpatialGeometryCapture.d.ts +9 -0
  75. package/dist/catalog/SpatialGeometryCapture.d.ts.map +1 -1
  76. package/dist/catalog/SpatialGeometryCapture.js +11 -1
  77. package/dist/catalog/SpatialGeometryCapture.js.map +1 -1
  78. package/dist/catalog/SpatialPageRegistry.d.ts +18 -0
  79. package/dist/catalog/SpatialPageRegistry.d.ts.map +1 -0
  80. package/dist/catalog/SpatialPageRegistry.js +21 -0
  81. package/dist/catalog/SpatialPageRegistry.js.map +1 -0
  82. package/dist/catalog/StagedCatalogTransition.d.ts +74 -0
  83. package/dist/catalog/StagedCatalogTransition.d.ts.map +1 -0
  84. package/dist/catalog/StagedCatalogTransition.js +270 -0
  85. package/dist/catalog/StagedCatalogTransition.js.map +1 -0
  86. package/dist/catalog/cardModelFit.d.ts +7 -0
  87. package/dist/catalog/cardModelFit.d.ts.map +1 -0
  88. package/dist/catalog/cardModelFit.js +16 -0
  89. package/dist/catalog/cardModelFit.js.map +1 -0
  90. package/dist/catalog/cardProjection.d.ts +39 -0
  91. package/dist/catalog/cardProjection.d.ts.map +1 -0
  92. package/dist/catalog/cardProjection.js +110 -0
  93. package/dist/catalog/cardProjection.js.map +1 -0
  94. package/dist/catalog/carouselMotion.d.ts +74 -0
  95. package/dist/catalog/carouselMotion.d.ts.map +1 -0
  96. package/dist/catalog/carouselMotion.js +185 -0
  97. package/dist/catalog/carouselMotion.js.map +1 -0
  98. package/dist/catalog/carouselPanelProjection.d.ts.map +1 -1
  99. package/dist/catalog/carouselPanelProjection.js +48 -11
  100. package/dist/catalog/carouselPanelProjection.js.map +1 -1
  101. package/dist/catalog/carouselProximity.d.ts +11 -0
  102. package/dist/catalog/carouselProximity.d.ts.map +1 -0
  103. package/dist/catalog/carouselProximity.js +13 -0
  104. package/dist/catalog/carouselProximity.js.map +1 -0
  105. package/dist/catalog/carouselSupport.d.ts +4 -0
  106. package/dist/catalog/carouselSupport.d.ts.map +1 -0
  107. package/dist/catalog/carouselSupport.js +30 -0
  108. package/dist/catalog/carouselSupport.js.map +1 -0
  109. package/dist/catalog/catalogActivationFocus.d.ts +5 -0
  110. package/dist/catalog/catalogActivationFocus.d.ts.map +1 -0
  111. package/dist/catalog/catalogActivationFocus.js +39 -0
  112. package/dist/catalog/catalogActivationFocus.js.map +1 -0
  113. package/dist/catalog/catalogDomSnapshot.d.ts +18 -0
  114. package/dist/catalog/catalogDomSnapshot.d.ts.map +1 -0
  115. package/dist/catalog/catalogDomSnapshot.js +51 -0
  116. package/dist/catalog/catalogDomSnapshot.js.map +1 -0
  117. package/dist/catalog/catalogJourney.d.ts +4 -1
  118. package/dist/catalog/catalogJourney.d.ts.map +1 -1
  119. package/dist/catalog/catalogJourney.js +7 -15
  120. package/dist/catalog/catalogJourney.js.map +1 -1
  121. package/dist/catalog/catalogPage.d.ts +7 -3
  122. package/dist/catalog/catalogPage.d.ts.map +1 -1
  123. package/dist/catalog/catalogPage.js.map +1 -1
  124. package/dist/catalog/catalogPose.d.ts +54 -6
  125. package/dist/catalog/catalogPose.d.ts.map +1 -1
  126. package/dist/catalog/catalogPose.js +100 -23
  127. package/dist/catalog/catalogPose.js.map +1 -1
  128. package/dist/catalog/catalogRecipes.d.ts +3 -2
  129. package/dist/catalog/catalogRecipes.d.ts.map +1 -1
  130. package/dist/catalog/catalogRecipes.js +12 -27
  131. package/dist/catalog/catalogRecipes.js.map +1 -1
  132. package/dist/catalog/catalogTransitionViewport.d.ts +9 -0
  133. package/dist/catalog/catalogTransitionViewport.d.ts.map +1 -0
  134. package/dist/catalog/catalogTransitionViewport.js +13 -0
  135. package/dist/catalog/catalogTransitionViewport.js.map +1 -0
  136. package/dist/catalog/catalogViewLink.d.ts +2 -0
  137. package/dist/catalog/catalogViewLink.d.ts.map +1 -1
  138. package/dist/catalog/catalogViewLink.js +10 -2
  139. package/dist/catalog/catalogViewLink.js.map +1 -1
  140. package/dist/catalog/deviceYaw.d.ts +21 -0
  141. package/dist/catalog/deviceYaw.d.ts.map +1 -0
  142. package/dist/catalog/deviceYaw.js +87 -0
  143. package/dist/catalog/deviceYaw.js.map +1 -0
  144. package/dist/catalog/listDeviceOrientation.d.ts +20 -0
  145. package/dist/catalog/listDeviceOrientation.d.ts.map +1 -0
  146. package/dist/catalog/listDeviceOrientation.js +273 -0
  147. package/dist/catalog/listDeviceOrientation.js.map +1 -0
  148. package/dist/catalog/spatialElementAssets.d.ts +5 -5
  149. package/dist/catalog/spatialElementAssets.d.ts.map +1 -1
  150. package/dist/catalog/spatialElementAssets.js.map +1 -1
  151. package/dist/catalog/spatialElementLodPair.d.ts +2 -1
  152. package/dist/catalog/spatialElementLodPair.d.ts.map +1 -1
  153. package/dist/catalog/spatialElementLodPair.js.map +1 -1
  154. package/dist/catalog/stagedDetailGeometry.d.ts +37 -0
  155. package/dist/catalog/stagedDetailGeometry.d.ts.map +1 -0
  156. package/dist/catalog/stagedDetailGeometry.js +55 -0
  157. package/dist/catalog/stagedDetailGeometry.js.map +1 -0
  158. package/dist/catalog/stagedDockGeometry.d.ts +66 -0
  159. package/dist/catalog/stagedDockGeometry.d.ts.map +1 -0
  160. package/dist/catalog/stagedDockGeometry.js +66 -0
  161. package/dist/catalog/stagedDockGeometry.js.map +1 -0
  162. package/dist/index.d.ts +6 -2
  163. package/dist/index.d.ts.map +1 -1
  164. package/dist/index.js +5 -1
  165. package/dist/index.js.map +1 -1
  166. package/dist/spatial-element/ResponsiveViewportMetrics.d.ts +18 -0
  167. package/dist/spatial-element/ResponsiveViewportMetrics.d.ts.map +1 -0
  168. package/dist/spatial-element/ResponsiveViewportMetrics.js +68 -0
  169. package/dist/spatial-element/ResponsiveViewportMetrics.js.map +1 -0
  170. package/dist/spatial-element/SectionSurfaceRegistry.d.ts +2 -0
  171. package/dist/spatial-element/SectionSurfaceRegistry.d.ts.map +1 -0
  172. package/dist/spatial-element/SectionSurfaceRegistry.js +2 -0
  173. package/dist/spatial-element/SectionSurfaceRegistry.js.map +1 -0
  174. package/dist/spatial-element/SpatialElementDockController.d.ts +23 -11
  175. package/dist/spatial-element/SpatialElementDockController.d.ts.map +1 -1
  176. package/dist/spatial-element/SpatialElementDockController.js +228 -96
  177. package/dist/spatial-element/SpatialElementDockController.js.map +1 -1
  178. package/dist/spatial-element/SpatialElementPaneController.d.ts +67 -0
  179. package/dist/spatial-element/SpatialElementPaneController.d.ts.map +1 -0
  180. package/dist/spatial-element/SpatialElementPaneController.js +246 -0
  181. package/dist/spatial-element/SpatialElementPaneController.js.map +1 -0
  182. package/dist/spatial-element/activeDetailSection.d.ts +8 -0
  183. package/dist/spatial-element/activeDetailSection.d.ts.map +1 -0
  184. package/dist/spatial-element/activeDetailSection.js +19 -0
  185. package/dist/spatial-element/activeDetailSection.js.map +1 -0
  186. package/dist/spatial-element/layoutTokens.json +228 -0
  187. package/dist/spatial-element/messages.d.ts +46 -0
  188. package/dist/spatial-element/messages.d.ts.map +1 -0
  189. package/dist/spatial-element/messages.js +46 -0
  190. package/dist/spatial-element/messages.js.map +1 -0
  191. package/dist/spatial-element/responsiveLayout.d.ts +1353 -0
  192. package/dist/spatial-element/responsiveLayout.d.ts.map +1 -0
  193. package/dist/spatial-element/responsiveLayout.js +210 -0
  194. package/dist/spatial-element/responsiveLayout.js.map +1 -0
  195. package/dist/spatial-element/sectionBackground.d.ts +3 -0
  196. package/dist/spatial-element/sectionBackground.d.ts.map +1 -0
  197. package/dist/spatial-element/sectionBackground.js +2 -0
  198. package/dist/spatial-element/sectionBackground.js.map +1 -0
  199. package/dist/spatial-element/spatialElement.d.ts +17 -12
  200. package/dist/spatial-element/spatialElement.d.ts.map +1 -1
  201. package/dist/spatial-element/spatialElement.js +33 -6
  202. package/dist/spatial-element/spatialElement.js.map +1 -1
  203. package/dist/spatial-element/spatialElementDock.d.ts +15 -0
  204. package/dist/spatial-element/spatialElementDock.d.ts.map +1 -1
  205. package/dist/spatial-element/spatialElementDock.js +22 -0
  206. package/dist/spatial-element/spatialElementDock.js.map +1 -1
  207. package/dist/spatial-element/spatialElementGeometry.d.ts +22 -0
  208. package/dist/spatial-element/spatialElementGeometry.d.ts.map +1 -0
  209. package/dist/spatial-element/spatialElementGeometry.js +40 -0
  210. package/dist/spatial-element/spatialElementGeometry.js.map +1 -0
  211. package/dist/spatial-element/spatialElementMedia.d.ts +16 -0
  212. package/dist/spatial-element/spatialElementMedia.d.ts.map +1 -0
  213. package/dist/spatial-element/spatialElementMedia.js +29 -0
  214. package/dist/spatial-element/spatialElementMedia.js.map +1 -0
  215. package/dist/spatial-element/spatialElementScene.d.ts +16 -0
  216. package/dist/spatial-element/spatialElementScene.d.ts.map +1 -0
  217. package/dist/spatial-element/spatialElementScene.js +22 -0
  218. package/dist/spatial-element/spatialElementScene.js.map +1 -0
  219. package/dist/spatial-element/spatialElementSectionRegistry.d.ts +6 -25
  220. package/dist/spatial-element/spatialElementSectionRegistry.d.ts.map +1 -1
  221. package/dist/spatial-element/spatialElementSectionRegistry.js +6 -63
  222. package/dist/spatial-element/spatialElementSectionRegistry.js.map +1 -1
  223. package/dist/spatial-element/spatialTheme.d.ts +27 -0
  224. package/dist/spatial-element/spatialTheme.d.ts.map +1 -0
  225. package/dist/spatial-element/spatialTheme.js +83 -0
  226. package/dist/spatial-element/spatialTheme.js.map +1 -0
  227. package/dist/spatial-element/types.d.ts +117 -36
  228. package/dist/spatial-element/types.d.ts.map +1 -1
  229. package/dist/spatial-element/types.js.map +1 -1
  230. package/dist/stage/BackgroundLayerOutput.d.ts +76 -0
  231. package/dist/stage/BackgroundLayerOutput.d.ts.map +1 -0
  232. package/dist/stage/BackgroundLayerOutput.js +333 -0
  233. package/dist/stage/BackgroundLayerOutput.js.map +1 -0
  234. package/dist/stage/DeviceGeometryMotion.d.ts +13 -0
  235. package/dist/stage/DeviceGeometryMotion.d.ts.map +1 -0
  236. package/dist/stage/DeviceGeometryMotion.js +37 -0
  237. package/dist/stage/DeviceGeometryMotion.js.map +1 -0
  238. package/dist/stage/LiquidGlassPanel.d.ts +7 -0
  239. package/dist/stage/LiquidGlassPanel.d.ts.map +1 -1
  240. package/dist/stage/LiquidGlassPanel.js +51 -7
  241. package/dist/stage/LiquidGlassPanel.js.map +1 -1
  242. package/dist/stage/MinimapController.d.ts +4 -1
  243. package/dist/stage/MinimapController.d.ts.map +1 -1
  244. package/dist/stage/MinimapController.js +62 -71
  245. package/dist/stage/MinimapController.js.map +1 -1
  246. package/dist/stage/ModelPointerPreview.d.ts +22 -0
  247. package/dist/stage/ModelPointerPreview.d.ts.map +1 -0
  248. package/dist/stage/ModelPointerPreview.js +71 -0
  249. package/dist/stage/ModelPointerPreview.js.map +1 -0
  250. package/dist/stage/PageBindingController.d.ts +10 -0
  251. package/dist/stage/PageBindingController.d.ts.map +1 -1
  252. package/dist/stage/PageBindingController.js +45 -5
  253. package/dist/stage/PageBindingController.js.map +1 -1
  254. package/dist/stage/PanelPresentationController.d.ts +21 -1
  255. package/dist/stage/PanelPresentationController.d.ts.map +1 -1
  256. package/dist/stage/PanelPresentationController.js +190 -31
  257. package/dist/stage/PanelPresentationController.js.map +1 -1
  258. package/dist/stage/SpaceMouseAdapter.d.ts +10 -2
  259. package/dist/stage/SpaceMouseAdapter.d.ts.map +1 -1
  260. package/dist/stage/SpaceMouseAdapter.js +50 -8
  261. package/dist/stage/SpaceMouseAdapter.js.map +1 -1
  262. package/dist/stage/SpatialElementInteractionController.d.ts +24 -2
  263. package/dist/stage/SpatialElementInteractionController.d.ts.map +1 -1
  264. package/dist/stage/SpatialElementInteractionController.js +198 -45
  265. package/dist/stage/SpatialElementInteractionController.js.map +1 -1
  266. package/dist/stage/SpatialElementPresentationController.d.ts +14 -2
  267. package/dist/stage/SpatialElementPresentationController.d.ts.map +1 -1
  268. package/dist/stage/SpatialElementPresentationController.js +47 -2
  269. package/dist/stage/SpatialElementPresentationController.js.map +1 -1
  270. package/dist/stage/SpatialElementRefinement.d.ts +34 -1
  271. package/dist/stage/SpatialElementRefinement.d.ts.map +1 -1
  272. package/dist/stage/SpatialElementRefinement.js +175 -37
  273. package/dist/stage/SpatialElementRefinement.js.map +1 -1
  274. package/dist/stage/StageExperience.d.ts +266 -11
  275. package/dist/stage/StageExperience.d.ts.map +1 -1
  276. package/dist/stage/StageExperience.js +673 -126
  277. package/dist/stage/StageExperience.js.map +1 -1
  278. package/dist/stage/StageFullscreenController.d.ts +17 -0
  279. package/dist/stage/StageFullscreenController.d.ts.map +1 -0
  280. package/dist/stage/StageFullscreenController.js +90 -0
  281. package/dist/stage/StageFullscreenController.js.map +1 -0
  282. package/dist/stage/StagePanelRuntime.d.ts +2 -1
  283. package/dist/stage/StagePanelRuntime.d.ts.map +1 -1
  284. package/dist/stage/StagePanelRuntime.js.map +1 -1
  285. package/dist/stage/StageRenderPipeline.d.ts +90 -2
  286. package/dist/stage/StageRenderPipeline.d.ts.map +1 -1
  287. package/dist/stage/StageRenderPipeline.js +494 -120
  288. package/dist/stage/StageRenderPipeline.js.map +1 -1
  289. package/dist/stage/VirtualScrollController.d.ts +7 -0
  290. package/dist/stage/VirtualScrollController.d.ts.map +1 -1
  291. package/dist/stage/VirtualScrollController.js +63 -6
  292. package/dist/stage/VirtualScrollController.js.map +1 -1
  293. package/dist/stage/inertLease.d.ts +2 -0
  294. package/dist/stage/inertLease.d.ts.map +1 -0
  295. package/dist/stage/inertLease.js +18 -0
  296. package/dist/stage/inertLease.js.map +1 -0
  297. package/dist/stage/interactionGuidance.d.ts +22 -0
  298. package/dist/stage/interactionGuidance.d.ts.map +1 -0
  299. package/dist/stage/interactionGuidance.js +53 -0
  300. package/dist/stage/interactionGuidance.js.map +1 -0
  301. package/dist/stage/interactionOutline.d.ts +14 -0
  302. package/dist/stage/interactionOutline.d.ts.map +1 -0
  303. package/dist/stage/interactionOutline.js +59 -0
  304. package/dist/stage/interactionOutline.js.map +1 -0
  305. package/dist/stage/minimap/MinimapGeometry.d.ts.map +1 -1
  306. package/dist/stage/minimap/MinimapGeometry.js +29 -0
  307. package/dist/stage/minimap/MinimapGeometry.js.map +1 -1
  308. package/dist/stage/minimap/MinimapModel.d.ts +2 -1
  309. package/dist/stage/minimap/MinimapModel.d.ts.map +1 -1
  310. package/dist/stage/minimap/MinimapModel.js +34 -4
  311. package/dist/stage/minimap/MinimapModel.js.map +1 -1
  312. package/dist/stage/minimap/MinimapModelGeometry.d.ts +21 -0
  313. package/dist/stage/minimap/MinimapModelGeometry.d.ts.map +1 -0
  314. package/dist/stage/minimap/MinimapModelGeometry.js +68 -0
  315. package/dist/stage/minimap/MinimapModelGeometry.js.map +1 -0
  316. package/dist/stage/minimap/MinimapProjection.d.ts +7 -0
  317. package/dist/stage/minimap/MinimapProjection.d.ts.map +1 -1
  318. package/dist/stage/minimap/MinimapProjection.js +14 -13
  319. package/dist/stage/minimap/MinimapProjection.js.map +1 -1
  320. package/dist/stage/minimap/MinimapState.d.ts +6 -11
  321. package/dist/stage/minimap/MinimapState.d.ts.map +1 -1
  322. package/dist/stage/minimap/MinimapState.js.map +1 -1
  323. package/dist/stage/mouseHover.d.ts +9 -0
  324. package/dist/stage/mouseHover.d.ts.map +1 -0
  325. package/dist/stage/mouseHover.js +55 -0
  326. package/dist/stage/mouseHover.js.map +1 -0
  327. package/dist/stage/panelContext.d.ts +33 -2
  328. package/dist/stage/panelContext.d.ts.map +1 -1
  329. package/dist/stage/panelContext.js.map +1 -1
  330. package/dist/stage/panelFocusMath.d.ts +34 -0
  331. package/dist/stage/panelFocusMath.d.ts.map +1 -0
  332. package/dist/stage/panelFocusMath.js +79 -0
  333. package/dist/stage/panelFocusMath.js.map +1 -0
  334. package/dist/stage/renderSettings.d.ts +10 -0
  335. package/dist/stage/renderSettings.d.ts.map +1 -0
  336. package/dist/stage/renderSettings.js +27 -0
  337. package/dist/stage/renderSettings.js.map +1 -0
  338. package/dist/stage/renderTargetInventory.d.ts +1 -1
  339. package/dist/stage/renderTargetInventory.js +1 -1
  340. package/dist/stage/renderTargetInventory.js.map +1 -1
  341. package/dist/stage/rendererState.d.ts +2 -0
  342. package/dist/stage/rendererState.d.ts.map +1 -1
  343. package/dist/stage/rendererState.js +13 -0
  344. package/dist/stage/rendererState.js.map +1 -1
  345. package/dist/stage/scalarMath.d.ts +6 -0
  346. package/dist/stage/scalarMath.d.ts.map +1 -0
  347. package/dist/stage/scalarMath.js +6 -0
  348. package/dist/stage/scalarMath.js.map +1 -0
  349. package/dist/stage/sceneEndpointEligibility.d.ts +20 -0
  350. package/dist/stage/sceneEndpointEligibility.d.ts.map +1 -0
  351. package/dist/stage/sceneEndpointEligibility.js +363 -0
  352. package/dist/stage/sceneEndpointEligibility.js.map +1 -0
  353. package/dist/stage/scrollFrame.d.ts +2 -0
  354. package/dist/stage/scrollFrame.d.ts.map +1 -1
  355. package/dist/stage/scrollFrame.js +18 -5
  356. package/dist/stage/scrollFrame.js.map +1 -1
  357. package/dist/stage/spaceMousePermission.d.ts +11 -0
  358. package/dist/stage/spaceMousePermission.d.ts.map +1 -0
  359. package/dist/stage/spaceMousePermission.js +63 -0
  360. package/dist/stage/spaceMousePermission.js.map +1 -0
  361. package/dist/stage/spaceMousePlatform.d.ts +12 -0
  362. package/dist/stage/spaceMousePlatform.d.ts.map +1 -0
  363. package/dist/stage/spaceMousePlatform.js +13 -0
  364. package/dist/stage/spaceMousePlatform.js.map +1 -0
  365. package/dist/stage/spatialElementFrame.d.ts.map +1 -1
  366. package/dist/stage/spatialElementFrame.js +5 -1
  367. package/dist/stage/spatialElementFrame.js.map +1 -1
  368. package/dist/stage/stageConstants.d.ts +3 -3
  369. package/dist/stage/stageConstants.d.ts.map +1 -1
  370. package/dist/stage/stageConstants.js +10 -10
  371. package/dist/stage/stageConstants.js.map +1 -1
  372. package/dist/stage/stageDom.d.ts +2 -0
  373. package/dist/stage/stageDom.d.ts.map +1 -1
  374. package/dist/stage/stageDom.js +10 -1
  375. package/dist/stage/stageDom.js.map +1 -1
  376. package/dist/stage/stageMath.d.ts +4 -33
  377. package/dist/stage/stageMath.d.ts.map +1 -1
  378. package/dist/stage/stageMath.js +39 -110
  379. package/dist/stage/stageMath.js.map +1 -1
  380. package/dist/stage/stageTypes.d.ts +32 -4
  381. package/dist/stage/stageTypes.d.ts.map +1 -1
  382. package/dist/stage/stageTypes.js.map +1 -1
  383. package/dist/stage/stageVisualTest.d.ts +24 -1
  384. package/dist/stage/stageVisualTest.d.ts.map +1 -1
  385. package/dist/stage/stageVisualTest.js.map +1 -1
  386. package/dist/stage/webgpuSupport.d.ts +3 -0
  387. package/dist/stage/webgpuSupport.d.ts.map +1 -0
  388. package/dist/stage/webgpuSupport.js +14 -0
  389. package/dist/stage/webgpuSupport.js.map +1 -0
  390. package/logo.svg +225 -0
  391. package/package.json +7 -5
@@ -0,0 +1,190 @@
1
+ import * as THREE from 'three/webgpu';
2
+ import { texture, uniform } from 'three/tsl';
3
+ import { gaussianBlur } from 'three/addons/tsl/display/GaussianBlurNode.js';
4
+ import { gaussianTargets } from '../stage/renderTargetInventory.js';
5
+ import { clearFullTarget, withRendererState } from '../stage/rendererState.js';
6
+ export function resolveDepthBlurRect(bounds, radius, clip = { left: 0, top: 0, width: innerWidth, height: innerHeight }) {
7
+ const padding = Math.ceil(radius * 3 + 2);
8
+ const left = Math.max(0, clip.left, Math.floor(bounds.left - padding));
9
+ const top = Math.max(0, clip.top, Math.floor(bounds.top - padding));
10
+ const right = Math.min(innerWidth, clip.left + clip.width, Math.ceil(bounds.left + bounds.width + padding));
11
+ const bottom = Math.min(innerHeight, clip.top + clip.height, Math.ceil(bounds.top + bounds.height + padding));
12
+ return right > left && bottom > top ? { left, top, width: right - left, height: bottom - top } : undefined;
13
+ }
14
+ /** One bounded scratch image for all defocused models and panels, reused between draws. */
15
+ export class CatalogDepthBlur {
16
+ capture;
17
+ effect;
18
+ material;
19
+ quad;
20
+ camera = new THREE.PerspectiveCamera();
21
+ direction = uniform(new THREE.Vector2());
22
+ passes = 0;
23
+ resolvedTexture;
24
+ resolvedOpacity = uniform(1);
25
+ resolvedMaterial;
26
+ cacheResolveQuad;
27
+ resolvedCanvasQuad;
28
+ resolvedOffscreenQuad;
29
+ getRenderTargets() { return this.capture ? [this.capture, ...gaussianTargets(this.effect)] : []; }
30
+ getStats() { return { passes: this.passes, targets: this.getRenderTargets().length, size: this.capture?.width ?? 0 }; }
31
+ /** Idle preparation borrows the real capture context without resolving it onto any output. */
32
+ prepareCapture(renderer, camera, draw) {
33
+ this.ensureResources();
34
+ const destination = renderer.getRenderTarget(), previousCamera = this.camera.clone();
35
+ try {
36
+ this.camera.copy(camera);
37
+ renderer.setRenderTarget(this.capture);
38
+ draw(this.camera);
39
+ }
40
+ finally {
41
+ this.camera.copy(previousCamera);
42
+ renderer.setRenderTarget(destination);
43
+ }
44
+ }
45
+ /** Idle-only: retain one already blurred image, using the existing capture/Gaussian scratch. */
46
+ prepareResolved(renderer, camera, rect, radius, target, draw) {
47
+ this.ensureResources();
48
+ this.ensureResolvedComposite(target.texture);
49
+ const previousCamera = this.camera.clone(), direction = this.direction.value.clone();
50
+ try {
51
+ withRendererState(renderer, () => {
52
+ this.captureSource(renderer, camera, rect, radius, draw);
53
+ renderer.setRenderTarget(target);
54
+ renderer.setClearColor(0, 0);
55
+ clearFullTarget(renderer);
56
+ // The Gaussian resolves at 256²; this full-size copy introduces no resampling.
57
+ this.cacheResolveQuad.render(renderer);
58
+ });
59
+ }
60
+ finally {
61
+ this.camera.copy(previousCamera);
62
+ this.direction.value.copy(direction);
63
+ }
64
+ }
65
+ /** No allocation or Gaussian update: only the retained image and its linear opacity. */
66
+ drawResolved(renderer, source, rect, opacity, preserveCanvasScissor = false, warmOutput) {
67
+ if (!this.resolvedTexture || !this.resolvedCanvasQuad || !this.resolvedOffscreenQuad)
68
+ return false;
69
+ const destination = renderer.getRenderTarget();
70
+ const viewport = destination ? destination.viewport.clone() : renderer.getViewport(new THREE.Vector4());
71
+ const scissorTest = renderer.getScissorTest();
72
+ this.resolvedTexture.value = source;
73
+ this.resolvedOpacity.value = opacity;
74
+ try {
75
+ if (destination || !preserveCanvasScissor)
76
+ renderer.setScissorTest(false);
77
+ this.setOutputViewport(renderer, destination, viewport, rect);
78
+ (destination && !warmOutput?.usesCanvasOwner(destination) ? this.resolvedOffscreenQuad : this.resolvedCanvasQuad).render(renderer);
79
+ }
80
+ finally {
81
+ if (destination)
82
+ destination.viewport.copy(viewport);
83
+ else
84
+ renderer.setViewport(viewport);
85
+ renderer.setScissorTest(scissorTest);
86
+ }
87
+ return true;
88
+ }
89
+ render(renderer, camera, bounds, radius, draw, clip = { left: 0, top: 0, width: innerWidth, height: innerHeight }, preserveCanvasScissor = false) {
90
+ if (radius < 0.05) {
91
+ draw(camera);
92
+ return;
93
+ }
94
+ const rect = resolveDepthBlurRect(bounds, radius, clip);
95
+ if (!rect)
96
+ return;
97
+ this.ensureResources();
98
+ this.renderCapture(renderer, camera, rect.left, rect.top, rect.width, rect.height, radius, draw, preserveCanvasScissor);
99
+ }
100
+ ensureResolvedComposite(source) {
101
+ if (this.resolvedMaterial)
102
+ return;
103
+ const resolvedTexture = texture(source);
104
+ this.resolvedTexture = resolvedTexture;
105
+ this.resolvedMaterial = new THREE.NodeMaterial();
106
+ this.resolvedMaterial.fragmentNode = resolvedTexture.mul(this.resolvedOpacity);
107
+ this.resolvedMaterial.transparent = true;
108
+ this.resolvedMaterial.blending = THREE.CustomBlending;
109
+ this.resolvedMaterial.blendSrc = this.resolvedMaterial.blendSrcAlpha = THREE.OneFactor;
110
+ this.resolvedMaterial.blendDst = this.resolvedMaterial.blendDstAlpha = THREE.OneMinusSrcAlphaFactor;
111
+ this.resolvedMaterial.depthTest = this.resolvedMaterial.depthWrite = this.resolvedMaterial.toneMapped = false;
112
+ // The cache's HalfFloat copy must not replace the live resolve owner's
113
+ // Canvas/RGBA8 pipeline when a later pointer pose needs the live fallback.
114
+ this.cacheResolveQuad = new THREE.QuadMesh(this.material);
115
+ // Retain both render-object owners, just as the live geometry fade does.
116
+ this.resolvedCanvasQuad = new THREE.QuadMesh(this.resolvedMaterial);
117
+ this.resolvedOffscreenQuad = new THREE.QuadMesh(this.resolvedMaterial);
118
+ }
119
+ ensureResources() {
120
+ if (!this.capture) {
121
+ this.capture = new THREE.RenderTarget(512, 512, { type: THREE.HalfFloatType });
122
+ this.effect = gaussianBlur(texture(this.capture.texture), this.direction, 2, { resolutionScale: 0.5, premultipliedAlpha: false });
123
+ // Several actors reuse the scratch image within one stage frame.
124
+ this.effect.updateBeforeType = THREE.NodeUpdateType.RENDER;
125
+ this.material = new THREE.NodeMaterial();
126
+ this.material.fragmentNode = this.effect;
127
+ this.material.transparent = true;
128
+ // Captures and Gaussian samples are already premultiplied; do not multiply alpha twice.
129
+ this.material.blending = THREE.CustomBlending;
130
+ this.material.blendSrc = this.material.blendSrcAlpha = THREE.OneFactor;
131
+ this.material.blendDst = this.material.blendDstAlpha = THREE.OneMinusSrcAlphaFactor;
132
+ this.material.depthTest = false;
133
+ this.material.depthWrite = false;
134
+ this.material.toneMapped = false;
135
+ this.quad = new THREE.QuadMesh(this.material);
136
+ }
137
+ }
138
+ renderCapture(renderer, camera, left, top, width, height, radius, draw, preserveCanvasScissor) {
139
+ const destination = renderer.getRenderTarget();
140
+ const viewport = destination ? destination.viewport.clone() : renderer.getViewport(new THREE.Vector4());
141
+ const clearColor = renderer.getClearColor(new THREE.Color());
142
+ const clearAlpha = renderer.getClearAlpha();
143
+ const scissorTest = renderer.getScissorTest();
144
+ try {
145
+ this.captureSource(renderer, camera, { left, top, width, height }, radius, draw);
146
+ renderer.setRenderTarget(destination);
147
+ // Idle warmup still uses the real Canvas format, but must not paint it.
148
+ if (!destination && preserveCanvasScissor)
149
+ renderer.setScissorTest(scissorTest);
150
+ this.setOutputViewport(renderer, destination, viewport, { left, top, width, height });
151
+ this.quad.render(renderer);
152
+ this.passes++;
153
+ }
154
+ finally {
155
+ renderer.setRenderTarget(destination);
156
+ if (destination)
157
+ destination.viewport.copy(viewport);
158
+ else
159
+ renderer.setViewport(viewport);
160
+ renderer.setClearColor(clearColor, clearAlpha);
161
+ renderer.setScissorTest(scissorTest);
162
+ }
163
+ }
164
+ captureSource(renderer, camera, rect, radius, draw) {
165
+ this.camera.copy(camera);
166
+ this.camera.setViewOffset(innerWidth, innerHeight, rect.left, rect.top, rect.width, rect.height);
167
+ // The half-resolution Gaussian uses a kernel standard deviation of 7/3 texels.
168
+ this.direction.value.set(radius * 256 / rect.width / (7 / 3), radius * 256 / rect.height / (7 / 3));
169
+ renderer.setRenderTarget(this.capture);
170
+ renderer.setScissorTest(false);
171
+ renderer.setClearColor(0, 0);
172
+ renderer.clear();
173
+ draw(this.camera);
174
+ }
175
+ setOutputViewport(renderer, destination, viewport, rect) {
176
+ const scaleX = viewport.z / innerWidth, scaleY = viewport.w / innerHeight;
177
+ const output = new THREE.Vector4(viewport.x + rect.left * scaleX, viewport.y + rect.top * scaleY, rect.width * scaleX, rect.height * scaleY);
178
+ if (destination)
179
+ destination.viewport.copy(output);
180
+ else
181
+ renderer.setViewport(output);
182
+ }
183
+ dispose() {
184
+ this.capture?.dispose();
185
+ this.effect?.dispose();
186
+ this.material?.dispose();
187
+ this.resolvedMaterial?.dispose();
188
+ }
189
+ }
190
+ //# sourceMappingURL=CatalogDepthBlur.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CatalogDepthBlur.js","sourceR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D,OAAO;QACN,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC;QACxB,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC;QACvB,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC;QACzB,IAAI,CAAC,gBAAgB,EAAE,OAAO,EAAE,CAAC;IAClC,CAAC;CACD","sourcesContent":["import * as THREE from 'three/webgpu';\nimport { texture, uniform } from 'three/tsl';\nimport { gaussianBlur } from 'three/addons/tsl/display/GaussianBlurNode.js';\nimport { gaussianTargets } from '../stage/renderTargetInventory.js';\nimport { clearFullTarget, withRendererState } from '../stage/rendererState.js';\nimport type { CatalogWarmOutputContext } from './CatalogWarmOutputContext.js';\n\nexport interface BlurRect { left: number; top: number; width: number; height: number }\n\nexport function resolveDepthBlurRect(bounds: BlurRect, radius: number,\n\tclip: BlurRect = { left: 0, top: 0, width: innerWidth, height: innerHeight }): BlurRect | undefined {\n\tconst padding = Math.ceil(radius * 3 + 2);\n\tconst left = Math.max(0, clip.left, Math.floor(bounds.left - padding));\n\tconst top = Math.max(0, clip.top, Math.floor(bounds.top - padding));\n\tconst right = Math.min(innerWidth, clip.left + clip.width, Math.ceil(bounds.left + bounds.width + padding));\n\tconst bottom = Math.min(innerHeight, clip.top + clip.height, Math.ceil(bounds.top + bounds.height + padding));\n\treturn right > left && bottom > top ? { left, top, width: right - left, height: bottom - top } : undefined;\n}\n\n/** One bounded scratch image for all defocused models and panels, reused between draws. */\nexport class CatalogDepthBlur {\n\tprivate capture?: THREE.RenderTarget;\n\tprivate effect?: ReturnType<typeof gaussianBlur>;\n\tprivate material?: THREE.NodeMaterial;\n\tprivate quad?: THREE.QuadMesh;\n\tprivate readonly camera = new THREE.PerspectiveCamera();\n\tprivate readonly direction = uniform(new THREE.Vector2());\n\tprivate passes = 0;\n\tprivate resolvedTexture?: ReturnType<typeof texture>;\n\tprivate readonly resolvedOpacity = uniform(1);\n\tprivate resolvedMaterial?: THREE.NodeMaterial;\n\tprivate cacheResolveQuad?: THREE.QuadMesh;\n\tprivate resolvedCanvasQuad?: THREE.QuadMesh;\n\tprivate resolvedOffscreenQuad?: THREE.QuadMesh;\n\tgetRenderTargets() { return this.capture ? [this.capture, ...gaussianTargets(this.effect!)] : []; }\n\tgetStats() { return { passes: this.passes, targets: this.getRenderTargets().length, size: this.capture?.width ?? 0 }; }\n\t/** Idle preparation borrows the real capture context without resolving it onto any output. */\n\tprepareCapture(renderer: THREE.WebGPURenderer, camera: THREE.PerspectiveCamera,\n\t\tdraw: (camera: THREE.PerspectiveCamera) => void) {\n\t\tthis.ensureResources();\n\t\tconst destination = renderer.getRenderTarget(), previousCamera = this.camera.clone();\n\t\ttry {\n\t\t\tthis.camera.copy(camera);\n\t\t\trenderer.setRenderTarget(this.capture!);\n\t\t\tdraw(this.camera);\n\t\t} finally {\n\t\t\tthis.camera.copy(previousCamera);\n\t\t\trenderer.setRenderTarget(destination);\n\t\t}\n\t}\n\t/** Idle-only: retain one already blurred image, using the existing capture/Gaussian scratch. */\n\tprepareResolved(renderer: THREE.WebGPURenderer, camera: THREE.PerspectiveCamera,\n\t\trect: BlurRect, radius: number, target: THREE.RenderTarget,\n\t\tdraw: (camera: THREE.PerspectiveCamera) => void) {\n\t\tthis.ensureResources();\n\t\tthis.ensureResolvedComposite(target.texture);\n\t\tconst previousCamera = this.camera.clone(), direction = this.direction.value.clone();\n\t\ttry {\n\t\t\twithRendererState(renderer, () => {\n\t\t\t\tthis.captureSource(renderer, camera, rect, radius, draw);\n\t\t\t\trenderer.setRenderTarget(target);\n\t\t\t\trenderer.setClearColor(0, 0);\n\t\t\t\tclearFullTarget(renderer);\n\t\t\t\t// The Gaussian resolves at 256²; this full-size copy introduces no resampling.\n\t\t\t\tthis.cacheResolveQuad!.render(renderer);\n\t\t\t});\n\t\t} finally { this.camera.copy(previousCamera); this.direction.value.copy(direction); }\n\t}\n\t/** No allocation or Gaussian update: only the retained image and its linear opacity. */\n\tdrawResolved(renderer: THREE.WebGPURenderer, source: THREE.Texture, rect: BlurRect, opacity: number,\n\t\tpreserveCanvasScissor = false, warmOutput?: CatalogWarmOutputContext) {\n\t\tif (!this.resolvedTexture || !this.resolvedCanvasQuad || !this.resolvedOffscreenQuad) return false;\n\t\tconst destination = renderer.getRenderTarget();\n\t\tconst viewport = destination ? destination.viewport.clone() : renderer.getViewport(new THREE.Vector4());\n\t\tconst scissorTest = renderer.getScissorTest();\n\t\tthis.resolvedTexture.value = source;\n\t\tthis.resolvedOpacity.value = opacity;\n\t\ttry {\n\t\t\tif (destination || !preserveCanvasScissor) renderer.setScissorTest(false);\n\t\t\tthis.setOutputViewport(renderer, destination, viewport, rect);\n\t\t\t(destination && !warmOutput?.usesCanvasOwner(destination) ? this.resolvedOffscreenQuad : this.resolvedCanvasQuad).render(renderer);\n\t\t} finally {\n\t\t\tif (destination) destination.viewport.copy(viewport); else renderer.setViewport(viewport);\n\t\t\trenderer.setScissorTest(scissorTest);\n\t\t}\n\t\treturn true;\n\t}\n\n\trender(renderer: THREE.WebGPURenderer, camera: THREE.PerspectiveCamera,\n\t\tbounds: BlurRect, radius: number, draw: (camera: THREE.PerspectiveCamera) => void,\n\t\tclip: BlurRect = { left: 0, top: 0, width: innerWidth, height: innerHeight }, preserveCanvasScissor = false) {\n\t\tif (radius < 0.05) { draw(camera); return; }\n\t\tconst rect = resolveDepthBlurRect(bounds, radius, clip);\n\t\tif (!rect) return;\n\t\tthis.ensureResources();\n\t\tthis.renderCapture(renderer, camera, rect.left, rect.top, rect.width, rect.height, radius, draw, preserveCanvasScissor);\n\t}\n\tprivate ensureResolvedComposite(source: THREE.Texture) {\n\t\tif (this.resolvedMaterial) return;\n\t\tconst resolvedTexture = texture(source);\n\t\tthis.resolvedTexture = resolvedTexture;\n\t\tthis.resolvedMaterial = new THREE.NodeMaterial();\n\t\tthis.resolvedMaterial.fragmentNode = resolvedTexture.mul(this.resolvedOpacity);\n\t\tthis.resolvedMaterial.transparent = true;\n\t\tthis.resolvedMaterial.blending = THREE.CustomBlending;\n\t\tthis.resolvedMaterial.blendSrc = this.resolvedMaterial.blendSrcAlpha = THREE.OneFactor;\n\t\tthis.resolvedMaterial.blendDst = this.resolvedMaterial.blendDstAlpha = THREE.OneMinusSrcAlphaFactor;\n\t\tthis.resolvedMaterial.depthTest = this.resolvedMaterial.depthWrite = this.resolvedMaterial.toneMapped = false;\n\t\t// The cache's HalfFloat copy must not replace the live resolve owner's\n\t\t// Canvas/RGBA8 pipeline when a later pointer pose needs the live fallback.\n\t\tthis.cacheResolveQuad = new THREE.QuadMesh(this.material!);\n\t\t// Retain both render-object owners, just as the live geometry fade does.\n\t\tthis.resolvedCanvasQuad = new THREE.QuadMesh(this.resolvedMaterial);\n\t\tthis.resolvedOffscreenQuad = new THREE.QuadMesh(this.resolvedMaterial);\n\t}\n\tprivate ensureResources() {\n\t\tif (!this.capture) {\n\t\t\tthis.capture = new THREE.RenderTarget(512, 512, { type: THREE.HalfFloatType });\n\t\t\tthis.effect = gaussianBlur(texture(this.capture.texture), this.direction, 2,\n\t\t\t\t{ resolutionScale: 0.5, premultipliedAlpha: false });\n\t\t\t// Several actors reuse the scratch image within one stage frame.\n\t\t\tthis.effect.updateBeforeType = THREE.NodeUpdateType.RENDER;\n\t\t\tthis.material = new THREE.NodeMaterial();\n\t\t\tthis.material.fragmentNode = this.effect;\n\t\t\tthis.material.transparent = true;\n\t\t\t// Captures and Gaussian samples are already premultiplied; do not multiply alpha twice.\n\t\t\tthis.material.blending = THREE.CustomBlending;\n\t\t\tthis.material.blendSrc = this.material.blendSrcAlpha = THREE.OneFactor;\n\t\t\tthis.material.blendDst = this.material.blendDstAlpha = THREE.OneMinusSrcAlphaFactor;\n\t\t\tthis.material.depthTest = false;\n\t\t\tthis.material.depthWrite = false;\n\t\t\tthis.material.toneMapped = false;\n\t\t\tthis.quad = new THREE.QuadMesh(this.material);\n\t\t}\n\t}\n\tprivate renderCapture(renderer: THREE.WebGPURenderer, camera: THREE.PerspectiveCamera,\n\t\tleft: number, top: number, width: number, height: number, radius: number,\n\t\tdraw: (camera: THREE.PerspectiveCamera) => void, preserveCanvasScissor: boolean) {\n\t\tconst destination = renderer.getRenderTarget();\n\t\tconst viewport = destination ? destination.viewport.clone() : renderer.getViewport(new THREE.Vector4());\n\t\tconst clearColor = renderer.getClearColor(new THREE.Color());\n\t\tconst clearAlpha = renderer.getClearAlpha();\n\t\tconst scissorTest = renderer.getScissorTest();\n\t\ttry {\n\t\t\tthis.captureSource(renderer, camera, { left, top, width, height }, radius, draw);\n\t\t\trenderer.setRenderTarget(destination);\n\t\t\t// Idle warmup still uses the real Canvas format, but must not paint it.\n\t\t\tif (!destination && preserveCanvasScissor) renderer.setScissorTest(scissorTest);\n\t\t\tthis.setOutputViewport(renderer, destination, viewport, { left, top, width, height });\n\t\t\tthis.quad!.render(renderer);\n\t\t\tthis.passes++;\n\t\t} finally {\n\t\t\trenderer.setRenderTarget(destination);\n\t\t\tif (destination) destination.viewport.copy(viewport);\n\t\t\telse renderer.setViewport(viewport);\n\t\t\trenderer.setClearColor(clearColor, clearAlpha);\n\t\t\trenderer.setScissorTest(scissorTest);\n\t\t}\n\t}\n\tprivate captureSource(renderer: THREE.WebGPURenderer, camera: THREE.PerspectiveCamera,\n\t\trect: BlurRect, radius: number, draw: (camera: THREE.PerspectiveCamera) => void) {\n\t\tthis.camera.copy(camera);\n\t\tthis.camera.setViewOffset(innerWidth, innerHeight, rect.left, rect.top, rect.width, rect.height);\n\t\t// The half-resolution Gaussian uses a kernel standard deviation of 7/3 texels.\n\t\tthis.direction.value.set(radius * 256 / rect.width / (7 / 3), radius * 256 / rect.height / (7 / 3));\n\t\trenderer.setRenderTarget(this.capture!);\n\t\trenderer.setScissorTest(false);\n\t\trenderer.setClearColor(0, 0);\n\t\trenderer.clear();\n\t\tdraw(this.camera);\n\t}\n\tprivate setOutputViewport(renderer: THREE.WebGPURenderer, destination: THREE.RenderTarget | null,\n\t\tviewport: THREE.Vector4, rect: BlurRect) {\n\t\tconst scaleX = viewport.z / innerWidth, scaleY = viewport.w / innerHeight;\n\t\tconst output = new THREE.Vector4(viewport.x + rect.left * scaleX, viewport.y + rect.top * scaleY,\n\t\t\trect.width * scaleX, rect.height * scaleY);\n\t\tif (destination) destination.viewport.copy(output); else renderer.setViewport(output);\n\t}\n\tdispose() {\n\t\tthis.capture?.dispose();\n\t\tthis.effect?.dispose();\n\t\tthis.material?.dispose();\n\t\tthis.resolvedMaterial?.dispose();\n\t}\n}\n"]}
@@ -1,8 +1,9 @@
1
+ import { CatalogNavigationRegistry } from './CatalogNavigationRegistry.js';
1
2
  export interface CatalogIdentity {
2
3
  brandId: string;
3
4
  spatialElementId: string;
4
5
  }
5
- export type CatalogSharedRole = 'summary-surface' | 'eyebrow' | 'title' | 'features' | 'primary-action';
6
+ export type CatalogSharedRole = 'summary-surface' | 'leading' | 'eyebrow' | 'title' | 'features' | 'action-details' | 'primary-action';
6
7
  export type CatalogEndpointRole = CatalogSharedRole | 'geometry' | 'container';
7
8
  export type CatalogEndpointSlot = 'catalog.card' | 'carousel.front' | 'carousel.neighbour' | 'detail.hero' | 'detail.summary' | 'detail.dock';
8
9
  export type CatalogContentSlot = 'catalog.card' | 'carousel.front' | 'carousel.neighbour';
@@ -21,6 +22,7 @@ interface Registration {
21
22
  }
22
23
  /** Owned by one persistent stage, never a process-global/SSR singleton. */
23
24
  export declare class CatalogEndpointRegistry {
25
+ readonly navigation: CatalogNavigationRegistry;
24
26
  private presentations;
25
27
  private entries;
26
28
  private revision;
@@ -39,7 +41,7 @@ export declare class CatalogEndpointRegistry {
39
41
  /** Read-only occurrence inventory; unlike resolve(), this does not change activation. */
40
42
  getContentEndpoints(): Registration[];
41
43
  registerPresentation(identity: CatalogIdentity, read: () => 'hero' | 'dock' | 'intermediate' | 'unavailable'): () => void;
42
- getComposition(identity: CatalogIdentity): "hero" | "dock" | "intermediate" | "unavailable";
44
+ getComposition(identity: CatalogIdentity): "unavailable" | "hero" | "dock" | "intermediate";
43
45
  register(address: CatalogEndpointAddress, element: HTMLElement): () => void;
44
46
  resolve(address: CatalogEndpointAddress): HTMLElement | undefined;
45
47
  /** Registration revision is not a rendered-pose/layout revision. No layout reads here. */
@@ -1 +1 @@
1
- {"version":3,"file":"CatalogEndpointRegistry.d.ts","sourceRoot":"","sources":["../../src/catalog/CatalogEndpointRegistry.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,MAAM,iBAAiB,GAC5B,iBAAiB,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,gBAAgB,CAAC;AACzE,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,GAAG,UAAU,GAAG,WAAW,CAAC;AAC/E,MAAM,MAAM,mBAAmB,GAC5B,cAAc,GACd,gBAAgB,GAChB,oBAAoB,GACpB,aAAa,GACb,gBAAgB,GAChB,aAAa,CAAC;AACjB,MAAM,MAAM,kBAAkB,GAAG,cAAc,GAAG,gBAAgB,GAAG,oBAAoB,CAAC;AAE1F,MAAM,WAAW,sBAAuB,SAAQ,eAAe;IAC9D,IAAI,EAAE,mBAAmB,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,mBAAmB,CAAC;CAC1B;AAED,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAE7D,sGAAsG;AACtG,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,eAAe,EAAE,IAAI,EAAE,iBAAiB,UAElF;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,sBAAsB,UAQjE;AAOD,UAAU,YAAY;IACrB,OAAO,EAAE,sBAAsB,CAAC;IAChC,OAAO,EAAE,WAAW,CAAC;CACrB;AAED,2EAA2E;AAC3E,qBAAa,uBAAuB;IACnC,OAAO,CAAC,aAAa,CAGjB;IACJ,OAAO,CAAC,OAAO,CAAwC;IACvD,OAAO,CAAC,QAAQ,CAAK;I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ClB,IAAI,GAAE,kBAAmC;IAQ1C,YAAY,CAAC,GAAG,CAAC,EAAE,MAAM;IAoBzB,0FAA0F;IAC1F,cAAc,CAAC,QAAQ,EAAE,eAAe,GAAG,kBAAkB,GAAG,SAAS;IAuDzE,uBAAuB,CAAC,QAAQ,EAAE,eAAe;IAIjD,yFAAyF;IACzF,mBAAmB;IASnB,oBAAoB,CACnB,QAAQ,EAAE,eAAe,EACzB,IAAI,EAAE,MAAM,MAAM,GAAG,MAAM,GAAG,cAAc,GAAG,aAAa;IAY7D,cAAc,CAAC,QAAQ,EAAE,eAAe;IAKxC,QAAQ,CAAC,OAAO,EAAE,sBAAsB,EAAE,OAAO,EAAE,WAAW,GAAG,MAAM,IAAI;IAe3E,OAAO,CAAC,OAAO,EAAE,sBAAsB,GAAG,WAAW,GAAG,SAAS;IA6DjE,0FAA0F;IAC1F,WAAW;;;;kBAtPL,mBAAmB;yBACZ,MAAM;kBACb,mBAAmB;qBAnBhB,MAAM;8BACG,MAAM;;;CA8QxB"}
@@ -1,3 +1,4 @@
1
+ import { CatalogNavigationRegistry } from './CatalogNavigationRegistry.js';
1
2
  export const CATALOG_ENDPOINTS = Symbol('catalog-endpoints');
2
3
  /** Semantic identity excludes representation and location; registrations additionally need a slot. */
3
4
  export function catalogSharedKey(identity, role) {
@@ -18,6 +19,7 @@ function catalogSlotKey(address) {
18
19
  }
19
20
  /** Owned by one persistent stage, never a process-global/SSR singleton. */
20
21
  export class CatalogEndpointRegistry {
22
+ navigation = new CatalogNavigationRegistry();
21
23
  presentations = new Map();
22
24
  entries = new Map();
23
25
  revision = 0;
@@ -1 +1 @@
1
- {"version":3,"file":"CatalogEndpointRegistry.js","sourceRoot":"","sources":["../../src/catalog/CatalogEndpointRegistry.ts"],"names":[],"mappings":"AAuBA,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAE7D,sGAAsG;AACtG,MAAM,UAAU,gBAAgB,CAAC,QAAyB,EAA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M,KAAK,GAAG,CAAC,cAAc,EAAE,gBAAgB,EAAE,oBAAoB,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;oBACxF,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CACnB,cAAc,CAAC,EAAE,GAAG,OAAO,EAAE,IAAI,EAAE,IAA0B,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CACnF,IAAI,EAAE,CAAC;iBACR,CAAC,CAAC;gBACH,KAAK,MAAM,KAAK,IAAI,KAAK;oBACxB,KAAK,CAAC,OAAO,CAAC,eAAe,CAC5B,uBAAuB,EACvB,KAAK,CAAC,OAAO,CAAC,UAAU,KAAK,UAAU,CACvC,CAAC;YACJ,CAAC;QACF,CAAC;QACD,kEAAkE;QAClE,OAAO,UAAU,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IACpE,CAAC;IAED,0FAA0F;IAC1F,WAAW;QACV,OAAO;YACN,oBAAoB,EAAE,IAAI,CAAC,QAAQ;YACnC,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CACvD,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAC5F;SACD,CAAC;IACH,CAAC;CACD","sourcesContent":["export interface CatalogIdentity {\n\tbrandId: string;\n\tspatialElementId: string;\n}\n\nexport type CatalogSharedRole =\n\t'summary-surface' | 'eyebrow' | 'title' | 'features' | 'primary-action';\nexport type CatalogEndpointRole = CatalogSharedRole | 'geometry' | 'container';\nexport type CatalogEndpointSlot =\n\t| 'catalog.card'\n\t| 'carousel.front'\n\t| 'carousel.neighbour'\n\t| 'detail.hero'\n\t| 'detail.summary'\n\t| 'detail.dock';\nexport type CatalogContentSlot = 'catalog.card' | 'carousel.front' | 'carousel.neighbour';\n\nexport interface CatalogEndpointAddress extends CatalogIdentity {\n\tslot: CatalogEndpointSlot;\n\toccurrence?: string;\n\trole: CatalogEndpointRole;\n}\n\nexport const CATALOG_ENDPOINTS = Symbol('catalog-endpoints');\n\n/** Semantic identity excludes representation and location; registrations additionally need a slot. */\nexport function catalogSharedKey(identity: CatalogIdentity, role: CatalogSharedRole) {\n\treturn JSON.stringify([identity.brandId, identity.spatialElementId, role]);\n}\n\nexport function catalogEndpointKey(address: CatalogEndpointAddress) {\n\treturn JSON.stringify([\n\t\taddress.brandId,\n\t\taddress.spatialElementId,\n\t\taddress.slot,\n\t\taddress.occurrence ?? null,\n\t\taddress.role\n\t]);\n}\n\n/** Index semantic slots first; resolution explicitly chooses a concrete occurrence. */\nfunction catalogSlotKey(address: CatalogEndpointAddress) {\n\treturn JSON.stringify([address.brandId, address.spatialElementId, address.slot, address.role]);\n}\n\ninterface Registration {\n\taddress: CatalogEndpointAddress;\n\telement: HTMLElement;\n}\n\n/** Owned by one persistent stage, never a process-global/SSR singleton. */\nexport class CatalogEndpointRegistry {\n\tprivate presentations = new Map<\n\t\tstring,\n\t\tSet<() => 'hero' | 'dock' | 'intermediate' | 'unavailable'>\n\t>();\n\tprivate entries = new Map<string, Set<Registration>>();\n\tprivate revision = 0;\n\tprivate preferred = new Map<string, string>();\n\tprivate preferredSlots = new Map<string, CatalogContentSlot>();\n\tprivate restoredOrigin?: CatalogIdentity & { occurrence: string; slot: CatalogContentSlot };\n\trestoreOrigin(origin?: CatalogIdentity & { occurrence: string; slot: CatalogContentSlot }) {\n\t\tthis.restoredOrigin = origin ? { ...origin } : undefined;\n\t\tif (origin) this.prefer(origin.brandId, origin.spatialElementId, origin.occurrence, origin.slot);\n\t}\n\tprefer(\n\t\tbrandId: string,\n\t\tspatialElementId: string,\n\t\toccurrence: string,\n\t\tslot: CatalogContentSlot = 'catalog.card'\n\t) {\n\t\tthis.preferred.set(JSON.stringify([brandId, spatialElementId]), occurrence);\n\t\tthis.preferredSlots.set(JSON.stringify([brandId, spatialElementId]), slot);\n\t\tif (this.preferredSlots.size > 100)\n\t\t\tthis.preferredSlots.delete(this.preferredSlots.keys().next().value!);\n\t\tif (this.preferred.size > 100) this.preferred.delete(this.preferred.keys().next().value!);\n\t}\n\trestoreFocus(key?: string) {\n\t\tif (!key?.startsWith('catalog:')) return;\n\t\ttry {\n\t\t\tconst tuple: unknown = JSON.parse(key.slice(8));\n\t\t\tif (\n\t\t\t\tArray.isArray(tuple) &&\n\t\t\t\t(tuple.length === 3 || tuple.length === 4) &&\n\t\t\t\ttuple.every((value) => typeof value === 'string')\n\t\t\t)\n\t\t\t\tthis.prefer(\n\t\t\t\t\ttuple[0],\n\t\t\t\t\ttuple[1],\n\t\t\t\t\ttuple[2],\n\t\t\t\t\ttuple[3] === 'carousel.front' ? 'carousel.front' : 'catalog.card'\n\t\t\t\t);\n\t\t} catch {\n\t\t\t/* Ignore stale or malformed entry metadata. */\n\t\t}\n\t}\n\n\t/** Activated/restored occurrence wins; otherwise require a unique visible composition. */\n\tgetContentSlot(identity: CatalogIdentity): CatalogContentSlot | undefined {\n\t\tconst key = JSON.stringify([identity.brandId, identity.spatialElementId]);\n\t\tconst preferred = this.preferred.get(key);\n\t\tconst preferredSlot = this.preferredSlots.get(key);\n\t\tconst slots: CatalogContentSlot[] = ['catalog.card', 'carousel.front', 'carousel.neighbour'];\n\t\tif (\n\t\t\tpreferredSlot &&\n\t\t\t[\n\t\t\t\t...(this.entries.get(\n\t\t\t\t\tcatalogSlotKey({ ...identity, slot: preferredSlot, role: 'container' })\n\t\t\t\t) ?? [])\n\t\t\t].some((entry) => entry.element.isConnected && entry.address.occurrence === preferred)\n\t\t)\n\t\t\treturn preferredSlot;\n\t\tif (preferredSlot?.startsWith('carousel.')) {\n\t\t\tconst other = preferredSlot === 'carousel.front' ? 'carousel.neighbour' : 'carousel.front';\n\t\t\tif (\n\t\t\t\t[\n\t\t\t\t\t...(this.entries.get(catalogSlotKey({ ...identity, slot: other, role: 'container' })) ??\n\t\t\t\t\t\t[])\n\t\t\t\t].some((entry) => entry.element.isConnected && entry.address.occurrence === preferred)\n\t\t\t)\n\t\t\t\treturn other;\n\t\t}\n\t\tif (\n\t\t\tthis.restoredOrigin?.brandId === identity.brandId &&\n\t\t\tthis.restoredOrigin.spatialElementId === identity.spatialElementId\n\t\t)\n\t\t\treturn undefined;\n\t\tconst visible = slots\n\t\t\t.map((slot) => ({\n\t\t\t\tslot,\n\t\t\t\tentries: [\n\t\t\t\t\t...(this.entries.get(catalogSlotKey({ ...identity, slot, role: 'container' })) ?? [])\n\t\t\t\t].filter(({ element }) => {\n\t\t\t\t\tif (!element.isConnected) return false;\n\t\t\t\t\tconst rect = element.getBoundingClientRect();\n\t\t\t\t\treturn (\n\t\t\t\t\t\trect.width > 0 &&\n\t\t\t\t\t\trect.height > 0 &&\n\t\t\t\t\t\trect.bottom > 0 &&\n\t\t\t\t\t\trect.top < innerHeight &&\n\t\t\t\t\t\trect.right > 0 &&\n\t\t\t\t\t\trect.left < innerWidth\n\t\t\t\t\t);\n\t\t\t\t})\n\t\t\t}))\n\t\t\t.filter(({ entries }) => entries.length > 0);\n\t\tif (visible.length !== 1) return undefined;\n\t\tconst candidate = visible[0];\n\t\treturn candidate.slot !== 'catalog.card' && candidate.entries.length !== 1\n\t\t\t? undefined\n\t\t\t: candidate.slot;\n\t}\n\n\tgetPreferredContentSlot(identity: CatalogIdentity) {\n\t\treturn this.preferredSlots.get(JSON.stringify([identity.brandId, identity.spatialElementId]));\n\t}\n\n\t/** Read-only occurrence inventory; unlike resolve(), this does not change activation. */\n\tgetContentEndpoints() {\n\t\treturn [...this.entries.values()]\n\t\t\t.flatMap((entries) => [...entries])\n\t\t\t.filter(\n\t\t\t\t({ address, element }) =>\n\t\t\t\t\taddress.role === 'container' && !address.slot.startsWith('detail.') && element.isConnected\n\t\t\t);\n\t}\n\n\tregisterPresentation(\n\t\tidentity: CatalogIdentity,\n\t\tread: () => 'hero' | 'dock' | 'intermediate' | 'unavailable'\n\t) {\n\t\tconst key = JSON.stringify([identity.brandId, identity.spatialElementId]);\n\t\tconst readers = this.presentations.get(key) ?? new Set();\n\t\treaders.add(read);\n\t\tthis.presentations.set(key, readers);\n\t\treturn () => {\n\t\t\treaders.delete(read);\n\t\t\tif (!readers.size && this.presentations.get(key) === readers) this.presentations.delete(key);\n\t\t};\n\t}\n\n\tgetComposition(identity: CatalogIdentity) {\n\t\tconst readers = this.presentations.get(JSON.stringify([identity.brandId, identity.spatialElementId]));\n\t\treturn readers?.size === 1 ? [...readers][0]() : 'unavailable';\n\t}\n\n\tregister(address: CatalogEndpointAddress, element: HTMLElement): () => void {\n\t\tconst key = catalogSlotKey(address);\n\t\tconst registration = { address: { ...address }, element };\n\t\tconst entries = this.entries.get(key) ?? new Set<Registration>();\n\t\tentries.add(registration);\n\t\tthis.entries.set(key, entries);\n\t\tthis.revision++;\n\t\treturn () => {\n\t\t\t// A late or repeated Svelte teardown only releases its own registration.\n\t\t\tif (!entries.delete(registration)) return;\n\t\t\tif (!entries.size && this.entries.get(key) === entries) this.entries.delete(key);\n\t\t\tthis.revision++;\n\t\t};\n\t}\n\n\tresolve(address: CatalogEndpointAddress): HTMLElement | undefined {\n\t\tlet candidates = [...(this.entries.get(catalogSlotKey(address)) ?? [])].filter(\n\t\t\t(entry) => entry.element.isConnected\n\t\t);\n\t\tif (address.slot === 'catalog.card' || address.slot.startsWith('carousel.')) {\n\t\t\tconst preferred =\n\t\t\t\taddress.occurrence ??\n\t\t\t\tthis.preferred.get(JSON.stringify([address.brandId, address.spatialElementId]));\n\t\t\tconst matching = candidates.filter((entry) => entry.address.occurrence === preferred);\n\t\t\tconst containers = this.entries.get(catalogSlotKey({ ...address, role: 'container' }));\n\t\t\tconst registeredPreference =\n\t\t\t\tpreferred &&\n\t\t\t\t[...(containers ?? [])].some(\n\t\t\t\t\t(entry) => entry.element.isConnected && entry.address.occurrence === preferred\n\t\t\t\t);\n\t\t\tif (\n\t\t\t\taddress.occurrence !== undefined ||\n\t\t\t\tregisteredPreference ||\n\t\t\t\t(preferred && matching.length)\n\t\t\t)\n\t\t\t\tcandidates = matching;\n\t\t\telse if (candidates.length > 1 && candidates.every((entry) => entry.address.occurrence)) {\n\t\t\t\tconst visible = candidates.filter((entry) => {\n\t\t\t\t\tconst rect = entry.element.getBoundingClientRect();\n\t\t\t\t\treturn (\n\t\t\t\t\t\trect.bottom > 0 && rect.top < innerHeight && rect.right > 0 && rect.left < innerWidth\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t\tconst sorted = visible.sort((a, b) =>\n\t\t\t\t\ta.address.occurrence!.localeCompare(b.address.occurrence!)\n\t\t\t\t);\n\t\t\t\tconst occurrence = sorted[0]?.address.occurrence;\n\t\t\t\tcandidates = occurrence\n\t\t\t\t\t? candidates.filter((entry) => entry.address.occurrence === occurrence)\n\t\t\t\t\t: [];\n\t\t\t}\n\t\t\tif (candidates.length === 1) {\n\t\t\t\tconst occurrence = candidates[0].address.occurrence;\n\t\t\t\tif (occurrence)\n\t\t\t\t\tthis.prefer(\n\t\t\t\t\t\taddress.brandId,\n\t\t\t\t\t\taddress.spatialElementId,\n\t\t\t\t\t\toccurrence,\n\t\t\t\t\t\taddress.slot as CatalogContentSlot\n\t\t\t\t\t);\n\t\t\t\tconst cards = ['catalog.card', 'carousel.front', 'carousel.neighbour'].flatMap((slot) => [\n\t\t\t\t\t...(this.entries.get(\n\t\t\t\t\t\tcatalogSlotKey({ ...address, slot: slot as CatalogContentSlot, role: 'container' })\n\t\t\t\t\t) ?? [])\n\t\t\t\t]);\n\t\t\t\tfor (const entry of cards)\n\t\t\t\t\tentry.element.toggleAttribute(\n\t\t\t\t\t\t'data-catalog-selected',\n\t\t\t\t\t\tentry.address.occurrence === occurrence\n\t\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\t// Ambiguity is a fallback, never a \"first DOM match wins\" choice.\n\t\treturn candidates.length === 1 ? candidates[0].element : undefined;\n\t}\n\n\t/** Registration revision is not a rendered-pose/layout revision. No layout reads here. */\n\tgetSnapshot() {\n\t\treturn {\n\t\t\tregistrationRevision: this.revision,\n\t\t\tentries: [...this.entries.values()].flatMap((entries) =>\n\t\t\t\t[...entries].map(({ address, element }) => ({ ...address, connected: element.isConnected }))\n\t\t\t)\n\t\t};\n\t}\n}\n"]}
1
+ {"version":3,"file":"CatalogEndpointRegistry.js","sourceRoot":"","sources":["../../src/catalog/CatalogEndpointRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAwB3E,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAE7D,sGAAsG;AACtG,MAAM,UAAU,gBAAgB,CAAC,QAAyB,EAAE,IAAuB;IAClF,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC,CAAC;AAC5E,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,OAA+B;IACjE,OAAO,IAAI,CAAC,SAAS,CAAC;QACrB,OAAO,CAAC,OAAO;QACf,OAAO,CAAC,gBAAgB;QACxB,OAAO,CAAC,IAAI;QACZ,OAAO,CAAC,UAAU,IAAI,IAAI;QAC1B,OAAO,CAAC,IAAI;KACZ,CAAC,CAAC;AACJ,CAAC;AAED,uFAAuF;AACvF,SAAS,cAAc,CAAC,OAA+B;IACtD,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,gBAAgB,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AAChG,CAAC;AAOD,2EAA2E;AAC3E,MAAM,OAAO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O,CAAC,CAAC,CAAC,SAAS,CAAC;IACpE,CAAC;IAED,0FAA0F;IAC1F,WAAW;QACV,OAAO;YACN,oBAAoB,EAAE,IAAI,CAAC,QAAQ;YACnC,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CACvD,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAC5F;SACD,CAAC;IACH,CAAC;CACD","sourcesContent":["import { CatalogNavigationRegistry } from './CatalogNavigationRegistry.js';\nexport interface CatalogIdentity {\n\tbrandId: string;\n\tspatialElementId: string;\n}\n\nexport type CatalogSharedRole =\n\t'summary-surface' | 'leading' | 'eyebrow' | 'title' | 'features' | 'action-details' | 'primary-action';\nexport type CatalogEndpointRole = CatalogSharedRole | 'geometry' | 'container';\nexport type CatalogEndpointSlot =\n\t| 'catalog.card'\n\t| 'carousel.front'\n\t| 'carousel.neighbour'\n\t| 'detail.hero'\n\t| 'detail.summary'\n\t| 'detail.dock';\nexport type CatalogContentSlot = 'catalog.card' | 'carousel.front' | 'carousel.neighbour';\n\nexport interface CatalogEndpointAddress extends CatalogIdentity {\n\tslot: CatalogEndpointSlot;\n\toccurrence?: string;\n\trole: CatalogEndpointRole;\n}\n\nexport const CATALOG_ENDPOINTS = Symbol('catalog-endpoints');\n\n/** Semantic identity excludes representation and location; registrations additionally need a slot. */\nexport function catalogSharedKey(identity: CatalogIdentity, role: CatalogSharedRole) {\n\treturn JSON.stringify([identity.brandId, identity.spatialElementId, role]);\n}\n\nexport function catalogEndpointKey(address: CatalogEndpointAddress) {\n\treturn JSON.stringify([\n\t\taddress.brandId,\n\t\taddress.spatialElementId,\n\t\taddress.slot,\n\t\taddress.occurrence ?? null,\n\t\taddress.role\n\t]);\n}\n\n/** Index semantic slots first; resolution explicitly chooses a concrete occurrence. */\nfunction catalogSlotKey(address: CatalogEndpointAddress) {\n\treturn JSON.stringify([address.brandId, address.spatialElementId, address.slot, address.role]);\n}\n\ninterface Registration {\n\taddress: CatalogEndpointAddress;\n\telement: HTMLElement;\n}\n\n/** Owned by one persistent stage, never a process-global/SSR singleton. */\nexport class CatalogEndpointRegistry {\n\treadonly navigation = new CatalogNavigationRegistry();\n\tprivate presentations = new Map<\n\t\tstring,\n\t\tSet<() => 'hero' | 'dock' | 'intermediate' | 'unavailable'>\n\t>();\n\tprivate entries = new Map<string, Set<Registration>>();\n\tprivate revision = 0;\n\tprivate preferred = new Map<string, string>();\n\tprivate preferredSlots = new Map<string, CatalogContentSlot>();\n\tprivate restoredOrigin?: CatalogIdentity & { occurrence: string; slot: CatalogContentSlot };\n\trestoreOrigin(origin?: CatalogIdentity & { occurrence: string; slot: CatalogContentSlot }) {\n\t\tthis.restoredOrigin = origin ? { ...origin } : undefined;\n\t\tif (origin) this.prefer(origin.brandId, origin.spatialElementId, origin.occurrence, origin.slot);\n\t}\n\tprefer(\n\t\tbrandId: string,\n\t\tspatialElementId: string,\n\t\toccurrence: string,\n\t\tslot: CatalogContentSlot = 'catalog.card'\n\t) {\n\t\tthis.preferred.set(JSON.stringify([brandId, spatialElementId]), occurrence);\n\t\tthis.preferredSlots.set(JSON.stringify([brandId, spatialElementId]), slot);\n\t\tif (this.preferredSlots.size > 100)\n\t\t\tthis.preferredSlots.delete(this.preferredSlots.keys().next().value!);\n\t\tif (this.preferred.size > 100) this.preferred.delete(this.preferred.keys().next().value!);\n\t}\n\trestoreFocus(key?: string) {\n\t\tif (!key?.startsWith('catalog:')) return;\n\t\ttry {\n\t\t\tconst tuple: unknown = JSON.parse(key.slice(8));\n\t\t\tif (\n\t\t\t\tArray.isArray(tuple) &&\n\t\t\t\t(tuple.length === 3 || tuple.length === 4) &&\n\t\t\t\ttuple.every((value) => typeof value === 'string')\n\t\t\t)\n\t\t\t\tthis.prefer(\n\t\t\t\t\ttuple[0],\n\t\t\t\t\ttuple[1],\n\t\t\t\t\ttuple[2],\n\t\t\t\t\ttuple[3] === 'carousel.front' ? 'carousel.front' : 'catalog.card'\n\t\t\t\t);\n\t\t} catch {\n\t\t\t/* Ignore stale or malformed entry metadata. */\n\t\t}\n\t}\n\n\t/** Activated/restored occurrence wins; otherwise require a unique visible composition. */\n\tgetContentSlot(identity: CatalogIdentity): CatalogContentSlot | undefined {\n\t\tconst key = JSON.stringify([identity.brandId, identity.spatialElementId]);\n\t\tconst preferred = this.preferred.get(key);\n\t\tconst preferredSlot = this.preferredSlots.get(key);\n\t\tconst slots: CatalogContentSlot[] = ['catalog.card', 'carousel.front', 'carousel.neighbour'];\n\t\tif (\n\t\t\tpreferredSlot &&\n\t\t\t[\n\t\t\t\t...(this.entries.get(\n\t\t\t\t\tcatalogSlotKey({ ...identity, slot: preferredSlot, role: 'container' })\n\t\t\t\t) ?? [])\n\t\t\t].some((entry) => entry.element.isConnected && entry.address.occurrence === preferred)\n\t\t)\n\t\t\treturn preferredSlot;\n\t\tif (preferredSlot?.startsWith('carousel.')) {\n\t\t\tconst other = preferredSlot === 'carousel.front' ? 'carousel.neighbour' : 'carousel.front';\n\t\t\tif (\n\t\t\t\t[\n\t\t\t\t\t...(this.entries.get(catalogSlotKey({ ...identity, slot: other, role: 'container' })) ??\n\t\t\t\t\t\t[])\n\t\t\t\t].some((entry) => entry.element.isConnected && entry.address.occurrence === preferred)\n\t\t\t)\n\t\t\t\treturn other;\n\t\t}\n\t\tif (\n\t\t\tthis.restoredOrigin?.brandId === identity.brandId &&\n\t\t\tthis.restoredOrigin.spatialElementId === identity.spatialElementId\n\t\t)\n\t\t\treturn undefined;\n\t\tconst visible = slots\n\t\t\t.map((slot) => ({\n\t\t\t\tslot,\n\t\t\t\tentries: [\n\t\t\t\t\t...(this.entries.get(catalogSlotKey({ ...identity, slot, role: 'container' })) ?? [])\n\t\t\t\t].filter(({ element }) => {\n\t\t\t\t\tif (!element.isConnected) return false;\n\t\t\t\t\tconst rect = element.getBoundingClientRect();\n\t\t\t\t\treturn (\n\t\t\t\t\t\trect.width > 0 &&\n\t\t\t\t\t\trect.height > 0 &&\n\t\t\t\t\t\trect.bottom > 0 &&\n\t\t\t\t\t\trect.top < innerHeight &&\n\t\t\t\t\t\trect.right > 0 &&\n\t\t\t\t\t\trect.left < innerWidth\n\t\t\t\t\t);\n\t\t\t\t})\n\t\t\t}))\n\t\t\t.filter(({ entries }) => entries.length > 0);\n\t\tif (visible.length !== 1) return undefined;\n\t\tconst candidate = visible[0];\n\t\treturn candidate.slot !== 'catalog.card' && candidate.entries.length !== 1\n\t\t\t? undefined\n\t\t\t: candidate.slot;\n\t}\n\n\tgetPreferredContentSlot(identity: CatalogIdentity) {\n\t\treturn this.preferredSlots.get(JSON.stringify([identity.brandId, identity.spatialElementId]));\n\t}\n\n\t/** Read-only occurrence inventory; unlike resolve(), this does not change activation. */\n\tgetContentEndpoints() {\n\t\treturn [...this.entries.values()]\n\t\t\t.flatMap((entries) => [...entries])\n\t\t\t.filter(\n\t\t\t\t({ address, element }) =>\n\t\t\t\t\taddress.role === 'container' && !address.slot.startsWith('detail.') && element.isConnected\n\t\t\t);\n\t}\n\n\tregisterPresentation(\n\t\tidentity: CatalogIdentity,\n\t\tread: () => 'hero' | 'dock' | 'intermediate' | 'unavailable'\n\t) {\n\t\tconst key = JSON.stringify([identity.brandId, identity.spatialElementId]);\n\t\tconst readers = this.presentations.get(key) ?? new Set();\n\t\treaders.add(read);\n\t\tthis.presentations.set(key, readers);\n\t\treturn () => {\n\t\t\treaders.delete(read);\n\t\t\tif (!readers.size && this.presentations.get(key) === readers) this.presentations.delete(key);\n\t\t};\n\t}\n\n\tgetComposition(identity: CatalogIdentity) {\n\t\tconst readers = this.presentations.get(JSON.stringify([identity.brandId, identity.spatialElementId]));\n\t\treturn readers?.size === 1 ? [...readers][0]() : 'unavailable';\n\t}\n\n\tregister(address: CatalogEndpointAddress, element: HTMLElement): () => void {\n\t\tconst key = catalogSlotKey(address);\n\t\tconst registration = { address: { ...address }, element };\n\t\tconst entries = this.entries.get(key) ?? new Set<Registration>();\n\t\tentries.add(registration);\n\t\tthis.entries.set(key, entries);\n\t\tthis.revision++;\n\t\treturn () => {\n\t\t\t// A late or repeated Svelte teardown only releases its own registration.\n\t\t\tif (!entries.delete(registration)) return;\n\t\t\tif (!entries.size && this.entries.get(key) === entries) this.entries.delete(key);\n\t\t\tthis.revision++;\n\t\t};\n\t}\n\n\tresolve(address: CatalogEndpointAddress): HTMLElement | undefined {\n\t\tlet candidates = [...(this.entries.get(catalogSlotKey(address)) ?? [])].filter(\n\t\t\t(entry) => entry.element.isConnected\n\t\t);\n\t\tif (address.slot === 'catalog.card' || address.slot.startsWith('carousel.')) {\n\t\t\tconst preferred =\n\t\t\t\taddress.occurrence ??\n\t\t\t\tthis.preferred.get(JSON.stringify([address.brandId, address.spatialElementId]));\n\t\t\tconst matching = candidates.filter((entry) => entry.address.occurrence === preferred);\n\t\t\tconst containers = this.entries.get(catalogSlotKey({ ...address, role: 'container' }));\n\t\t\tconst registeredPreference =\n\t\t\t\tpreferred &&\n\t\t\t\t[...(containers ?? [])].some(\n\t\t\t\t\t(entry) => entry.element.isConnected && entry.address.occurrence === preferred\n\t\t\t\t);\n\t\t\tif (\n\t\t\t\taddress.occurrence !== undefined ||\n\t\t\t\tregisteredPreference ||\n\t\t\t\t(preferred && matching.length)\n\t\t\t)\n\t\t\t\tcandidates = matching;\n\t\t\telse if (candidates.length > 1 && candidates.every((entry) => entry.address.occurrence)) {\n\t\t\t\tconst visible = candidates.filter((entry) => {\n\t\t\t\t\tconst rect = entry.element.getBoundingClientRect();\n\t\t\t\t\treturn (\n\t\t\t\t\t\trect.bottom > 0 && rect.top < innerHeight && rect.right > 0 && rect.left < innerWidth\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t\tconst sorted = visible.sort((a, b) =>\n\t\t\t\t\ta.address.occurrence!.localeCompare(b.address.occurrence!)\n\t\t\t\t);\n\t\t\t\tconst occurrence = sorted[0]?.address.occurrence;\n\t\t\t\tcandidates = occurrence\n\t\t\t\t\t? candidates.filter((entry) => entry.address.occurrence === occurrence)\n\t\t\t\t\t: [];\n\t\t\t}\n\t\t\tif (candidates.length === 1) {\n\t\t\t\tconst occurrence = candidates[0].address.occurrence;\n\t\t\t\tif (occurrence)\n\t\t\t\t\tthis.prefer(\n\t\t\t\t\t\taddress.brandId,\n\t\t\t\t\t\taddress.spatialElementId,\n\t\t\t\t\t\toccurrence,\n\t\t\t\t\t\taddress.slot as CatalogContentSlot\n\t\t\t\t\t);\n\t\t\t\tconst cards = ['catalog.card', 'carousel.front', 'carousel.neighbour'].flatMap((slot) => [\n\t\t\t\t\t...(this.entries.get(\n\t\t\t\t\t\tcatalogSlotKey({ ...address, slot: slot as CatalogContentSlot, role: 'container' })\n\t\t\t\t\t) ?? [])\n\t\t\t\t]);\n\t\t\t\tfor (const entry of cards)\n\t\t\t\t\tentry.element.toggleAttribute(\n\t\t\t\t\t\t'data-catalog-selected',\n\t\t\t\t\t\tentry.address.occurrence === occurrence\n\t\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\t// Ambiguity is a fallback, never a \"first DOM match wins\" choice.\n\t\treturn candidates.length === 1 ? candidates[0].element : undefined;\n\t}\n\n\t/** Registration revision is not a rendered-pose/layout revision. No layout reads here. */\n\tgetSnapshot() {\n\t\treturn {\n\t\t\tregistrationRevision: this.revision,\n\t\t\tentries: [...this.entries.values()].flatMap((entries) =>\n\t\t\t\t[...entries].map(({ address, element }) => ({ ...address, connected: element.isConnected }))\n\t\t\t)\n\t\t};\n\t}\n}\n"]}
@@ -1,12 +1,16 @@
1
1
  import * as THREE from 'three/webgpu';
2
+ import type { CatalogWarmOutputContext } from './CatalogWarmOutputContext.js';
2
3
  /** Fade the resolved image, never the individual opaque surfaces of a element. */
3
4
  export declare class CatalogGeometryFade {
4
5
  getRenderTargets(): THREE.RenderTarget<THREE.Texture<unknown, THREE.TextureEventMap>, THREE.RenderTargetEventMap>[];
5
6
  private capture?;
6
7
  private material?;
7
8
  private quad?;
9
+ private offscreenQuad?;
8
10
  private readonly alpha;
9
- render(renderer: THREE.WebGPURenderer, opacity: number, draw: () => void): void;
11
+ private frozenCapture?;
12
+ /** A source token belongs to one frozen source generation and output band only. */
13
+ render(renderer: THREE.WebGPURenderer, opacity: number, draw: () => void, warmOutput?: CatalogWarmOutputContext, frozenSource?: object): void;
10
14
  dispose(): void;
11
15
  }
12
16
  //# sourceMappingURL=CatalogGeometryFade.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CatalogGeometryFade.d.ts","sourceRoot":"","sources":["../../src/catalog/CatalogGeometryFade.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAGtC,kFAAkF;AAClF,qBAAa,mBAAmB;IAC/B,gBAAgB;IAGhB,OAAO,CAAC,OAAO,CAAC,CAAqB;IACrC,OAAO,CAAC,QAAQ,CAAC,CAAqB;IACtC,OAAO,CAAC,IAAI,CAAC,CAAiB;IAC9B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAc;IAEpC,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,IAAI;IA6CxE,OAAO;CAOP"}
1
+ {"version":3,"file":"CatalogGeometryFade.d.ts","sourceRoot":"","sources":["../../src/catalog/CatalogGeometryFade.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAGtC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAiB9E,kFAAkF;AAClF,qBAAa,mBAAmB;IAC/B,gBAAgB;IAGhB,OAAO,CAAC,OAAO,CAAC,CAAqB;IACrC,OAAO,CAAC,QAAQ,CAAC,CAAqB;IACtC,OAAO,CAAC,IAAI,CAAC,CAAiB;IAC9B,OAAO,CAAC,aAAa,CAAC,CAAiB;IACvC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAc;IACpC,OAAO,CAAC,aAAa,CAAC,CAAgB;IAEtC,mFAAmF;IACnF,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,IAAI,EACvE,UAAU,CAAC,EAAE,wBAAwB,EAAE,YAAY,CAAC,EAAE,MAAM;IA0E7D,OAAO;CASP"}
@@ -1,5 +1,6 @@
1
1
  import * as THREE from 'three/webgpu';
2
2
  import { texture, uniform } from 'three/tsl';
3
+ import { getRefinementSize } from '../stage/SpatialElementRefinement.js';
3
4
  /** Fade the resolved image, never the individual opaque surfaces of a element. */
4
5
  export class CatalogGeometryFade {
5
6
  getRenderTargets() {
@@ -8,8 +9,13 @@ export class CatalogGeometryFade {
8
9
  capture;
9
10
  material;
10
11
  quad;
12
+ offscreenQuad;
11
13
  alpha = uniform(1);
12
- render(renderer, opacity, draw) {
14
+ frozenCapture;
15
+ /** A source token belongs to one frozen source generation and output band only. */
16
+ render(renderer, opacity, draw, warmOutput, frozenSource) {
17
+ if (!frozenSource || warmOutput || opacity >= 1 || opacity <= 0)
18
+ this.frozenCapture = undefined;
13
19
  if (opacity >= 1) {
14
20
  draw();
15
21
  return;
@@ -18,11 +24,15 @@ export class CatalogGeometryFade {
18
24
  return;
19
25
  const destination = renderer.getRenderTarget();
20
26
  const size = destination ?? renderer.getDrawingBufferSize(new THREE.Vector2());
27
+ // Use the same budget as the preparation target. Otherwise the first moving
28
+ // frame reallocates a full-resolution MSAA capture after the bounded warm-up.
29
+ const { width, height } = getRefinementSize(size.width, size.height);
21
30
  if (!this.capture) {
22
- this.capture = new THREE.RenderTarget(size.width, size.height, {
31
+ this.capture = new THREE.RenderTarget(width, height, {
23
32
  type: THREE.HalfFloatType,
24
33
  samples: 4
25
34
  });
35
+ this.capture.addEventListener('dispose', () => { this.frozenCapture = undefined; });
26
36
  this.material = new THREE.NodeMaterial();
27
37
  this.material.fragmentNode = texture(this.capture.texture).mul(this.alpha);
28
38
  this.material.transparent = true;
@@ -31,23 +41,46 @@ export class CatalogGeometryFade {
31
41
  this.material.depthWrite = false;
32
42
  this.material.toneMapped = false;
33
43
  this.quad = new THREE.QuadMesh(this.material);
44
+ // Canvas output and High preparation can share a render-context format
45
+ // while using different color spaces. Keep both render-object owners alive:
46
+ // otherwise preparing High evicts the already warmed Canvas pipeline.
47
+ this.offscreenQuad = new THREE.QuadMesh(this.material);
34
48
  }
35
- this.capture.setSize(size.width, size.height);
49
+ this.capture.setSize(width, height);
50
+ const next = frozenSource && !warmOutput ? {
51
+ source: frozenSource, renderer, destination,
52
+ canvas: destination ? undefined : renderer.getCanvasTarget(),
53
+ width: size.width, height: size.height, captureWidth: width, captureHeight: height,
54
+ coordinateSystem: renderer.coordinateSystem, toneMapping: renderer.toneMapping,
55
+ exposure: renderer.toneMappingExposure, colorSpace: renderer.outputColorSpace
56
+ } : undefined;
57
+ const previous = this.frozenCapture;
58
+ const reuse = next && previous && next.source === previous.source && next.renderer === previous.renderer &&
59
+ next.destination === previous.destination && next.canvas === previous.canvas &&
60
+ next.width === previous.width && next.height === previous.height &&
61
+ next.captureWidth === previous.captureWidth && next.captureHeight === previous.captureHeight &&
62
+ next.coordinateSystem === previous.coordinateSystem && next.toneMapping === previous.toneMapping &&
63
+ next.exposure === previous.exposure && next.colorSpace === previous.colorSpace;
36
64
  const color = renderer.getClearColor(new THREE.Color());
37
65
  const clearAlpha = renderer.getClearAlpha();
38
66
  const scissor = renderer.getScissor(new THREE.Vector4());
39
67
  const scissorTest = renderer.getScissorTest();
40
68
  try {
41
- renderer.setRenderTarget(this.capture);
42
- renderer.setScissorTest(false);
43
- renderer.setClearColor(0x000000, 0);
44
- renderer.clear();
45
- draw();
69
+ // One shared scratch target: another band, ordinary draw or warmup replaces
70
+ // these pixels. The first fractional frame always performs the full capture.
71
+ this.frozenCapture = undefined;
72
+ if (!reuse) {
73
+ renderer.setRenderTarget(this.capture);
74
+ renderer.setScissorTest(false);
75
+ renderer.setClearColor(0x000000, 0);
76
+ renderer.clear();
77
+ draw();
78
+ }
46
79
  renderer.setRenderTarget(destination);
47
80
  renderer.setScissor(scissor);
48
81
  renderer.setScissorTest(scissorTest);
49
82
  this.alpha.value = opacity;
50
- this.quad.render(renderer);
83
+ (destination && !warmOutput?.usesCanvasOwner(destination) ? this.offscreenQuad : this.quad).render(renderer);
51
84
  }
52
85
  finally {
53
86
  renderer.setRenderTarget(destination);
@@ -55,13 +88,16 @@ export class CatalogGeometryFade {
55
88
  renderer.setScissor(scissor);
56
89
  renderer.setScissorTest(scissorTest);
57
90
  }
91
+ this.frozenCapture = next;
58
92
  }
59
93
  dispose() {
94
+ this.frozenCapture = undefined;
60
95
  this.capture?.dispose();
61
96
  this.material?.dispose();
62
97
  this.capture = undefined;
63
98
  this.material = undefined;
64
99
  this.quad = undefined;
100
+ this.offscreenQuad = undefined;
65
101
  }
66
102
  }
67
103
  //# sourceMappingURL=CatalogGeometryFade.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CatalogGeometryFade.js","sourceRoot":"","sources":["../../src/catalog/CatalogGeometryFade.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE7C,kFAAkF;AAClF,MAAM,OAAO,mBAAmB;IAC/B,gBAAgB;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3C,CAAC;IACO,OAAO,CAAsB;IAC7B,QAAQ,CAAsB;IAC9B,IAAI,CAAkB;IACb,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAEpC,MAAM,CAAC,QAA8B,EAAE,OAAe,EAAE,IAAgB;QACvE,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G,SAAS,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;IACvB,CAAC;CACD","sourcesContent":["import * as THREE from 'three/webgpu';\nimport { texture, uniform } from 'three/tsl';\n\n/** Fade the resolved image, never the individual opaque surfaces of a element. */\nexport class CatalogGeometryFade {\n\tgetRenderTargets() {\n\t\treturn this.capture ? [this.capture] : [];\n\t}\n\tprivate capture?: THREE.RenderTarget;\n\tprivate material?: THREE.NodeMaterial;\n\tprivate quad?: THREE.QuadMesh;\n\tprivate readonly alpha = uniform(1);\n\n\trender(renderer: THREE.WebGPURenderer, opacity: number, draw: () => void) {\n\t\tif (opacity >= 1) {\n\t\t\tdraw();\n\t\t\treturn;\n\t\t}\n\t\tif (opacity <= 0) return;\n\t\tconst destination = renderer.getRenderTarget();\n\t\tconst size = destination ?? renderer.getDrawingBufferSize(new THREE.Vector2());\n\t\tif (!this.capture) {\n\t\t\tthis.capture = new THREE.RenderTarget(size.width, size.height, {\n\t\t\t\ttype: THREE.HalfFloatType,\n\t\t\t\tsamples: 4\n\t\t\t});\n\t\t\tthis.material = new THREE.NodeMaterial();\n\t\t\tthis.material.fragmentNode = texture(this.capture.texture).mul(this.alpha);\n\t\t\tthis.material.transparent = true;\n\t\t\tthis.material.premultipliedAlpha = true;\n\t\t\tthis.material.depthTest = false;\n\t\t\tthis.material.depthWrite = false;\n\t\t\tthis.material.toneMapped = false;\n\t\t\tthis.quad = new THREE.QuadMesh(this.material);\n\t\t}\n\t\tthis.capture.setSize(size.width, size.height);\n\t\tconst color = renderer.getClearColor(new THREE.Color());\n\t\tconst clearAlpha = renderer.getClearAlpha();\n\t\tconst scissor = renderer.getScissor(new THREE.Vector4());\n\t\tconst scissorTest = renderer.getScissorTest();\n\t\ttry {\n\t\t\trenderer.setRenderTarget(this.capture);\n\t\t\trenderer.setScissorTest(false);\n\t\t\trenderer.setClearColor(0x000000, 0);\n\t\t\trenderer.clear();\n\t\t\tdraw();\n\t\t\trenderer.setRenderTarget(destination);\n\t\t\trenderer.setScissor(scissor);\n\t\t\trenderer.setScissorTest(scissorTest);\n\t\t\tthis.alpha.value = opacity;\n\t\t\tthis.quad!.render(renderer);\n\t\t} finally {\n\t\t\trenderer.setRenderTarget(destination);\n\t\t\trenderer.setClearColor(color, clearAlpha);\n\t\t\trenderer.setScissor(scissor);\n\t\t\trenderer.setScissorTest(scissorTest);\n\t\t}\n\t}\n\tdispose() {\n\t\tthis.capture?.dispose();\n\t\tthis.material?.dispose();\n\t\tthis.capture = undefined;\n\t\tthis.material = undefined;\n\t\tthis.quad = undefined;\n\t}\n}\n"]}
1
+ {"version":3,"file":"CatalogGeometryFade.js","sourceRoot":"","sources":["../../src/catalog/CatalogGeometryFade.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAkBzE,kFAAkF;AAClF,MAAM,OAAO,mBAAmB;IAC/B,gBAAgB;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3C,CAAC;IACO,OAAO,CAAsB;IAC7B,QAAQ,CAAsB;IAC9B,IAAI,CAAkB;IACtB,aAAa,CAAkB;IACtB,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAC5B,aAAa,CAAiB;IAEtC,mFAAmF;IACnF,MAAM,CAAC,QAA8B,EAAE,OAAe,EAAE,IAAgB,EACvE,UAAqC,EAAE,YAAqB;QAC5D,IAAI,CAAC,YAAY,IAAI,UAAU,IAAI,OAAO,IAAI,CAAC,IAAI,OAAO,IAAI,CAAC;YAAE,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;QAChG,IAAI,OAAO,IAAI,CAAC,EAAE,CAAC;YAClB,IAAI,EAAE,CAAC;Y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,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC/G,CAAC;gBAAS,CAAC;YACV,QAAQ,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;YACtC,QAAQ,CAAC,aAAa,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;YAC1C,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YAC7B,QAAQ,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;QACtC,CAAC;QACD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;IAC3B,CAAC;IACD,OAAO;QACN,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;QAC/B,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC;QACxB,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC;QACzB,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;QACtB,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;IAChC,CAAC;CACD","sourcesContent":["import * as THREE from 'three/webgpu';\nimport { texture, uniform } from 'three/tsl';\nimport { getRefinementSize } from '../stage/SpatialElementRefinement.js';\nimport type { CatalogWarmOutputContext } from './CatalogWarmOutputContext.js';\n\ninterface FrozenCapture {\n\tsource: object;\n\trenderer: THREE.WebGPURenderer;\n\tdestination: THREE.RenderTarget | null;\n\tcanvas?: THREE.CanvasTarget;\n\twidth: number;\n\theight: number;\n\tcaptureWidth: number;\n\tcaptureHeight: number;\n\tcoordinateSystem: THREE.WebGPURenderer['coordinateSystem'];\n\ttoneMapping: THREE.WebGPURenderer['toneMapping'];\n\texposure: number;\n\tcolorSpace: THREE.WebGPURenderer['outputColorSpace'];\n}\n\n/** Fade the resolved image, never the individual opaque surfaces of a element. */\nexport class CatalogGeometryFade {\n\tgetRenderTargets() {\n\t\treturn this.capture ? [this.capture] : [];\n\t}\n\tprivate capture?: THREE.RenderTarget;\n\tprivate material?: THREE.NodeMaterial;\n\tprivate quad?: THREE.QuadMesh;\n\tprivate offscreenQuad?: THREE.QuadMesh;\n\tprivate readonly alpha = uniform(1);\n\tprivate frozenCapture?: FrozenCapture;\n\n\t/** A source token belongs to one frozen source generation and output band only. */\n\trender(renderer: THREE.WebGPURenderer, opacity: number, draw: () => void,\n\t\twarmOutput?: CatalogWarmOutputContext, frozenSource?: object) {\n\t\tif (!frozenSource || warmOutput || opacity >= 1 || opacity <= 0) this.frozenCapture = undefined;\n\t\tif (opacity >= 1) {\n\t\t\tdraw();\n\t\t\treturn;\n\t\t}\n\t\tif (opacity <= 0) return;\n\t\tconst destination = renderer.getRenderTarget();\n\t\tconst size = destination ?? renderer.getDrawingBufferSize(new THREE.Vector2());\n\t\t// Use the same budget as the preparation target. Otherwise the first moving\n\t\t// frame reallocates a full-resolution MSAA capture after the bounded warm-up.\n\t\tconst { width, height } = getRefinementSize(size.width, size.height);\n\t\tif (!this.capture) {\n\t\t\tthis.capture = new THREE.RenderTarget(width, height, {\n\t\t\t\ttype: THREE.HalfFloatType,\n\t\t\t\tsamples: 4\n\t\t\t});\n\t\t\tthis.capture.addEventListener('dispose', () => { this.frozenCapture = undefined; });\n\t\t\tthis.material = new THREE.NodeMaterial();\n\t\t\tthis.material.fragmentNode = texture(this.capture.texture).mul(this.alpha);\n\t\t\tthis.material.transparent = true;\n\t\t\tthis.material.premultipliedAlpha = true;\n\t\t\tthis.material.depthTest = false;\n\t\t\tthis.material.depthWrite = false;\n\t\t\tthis.material.toneMapped = false;\n\t\t\tthis.quad = new THREE.QuadMesh(this.material);\n\t\t\t// Canvas output and High preparation can share a render-context format\n\t\t\t// while using different color spaces. Keep both render-object owners alive:\n\t\t\t// otherwise preparing High evicts the already warmed Canvas pipeline.\n\t\t\tthis.offscreenQuad = new THREE.QuadMesh(this.material);\n\t\t}\n\t\tthis.capture.setSize(width, height);\n\t\tconst next: FrozenCapture | undefined = frozenSource && !warmOutput ? {\n\t\t\tsource: frozenSource, renderer, destination,\n\t\t\tcanvas: destination ? undefined : renderer.getCanvasTarget(),\n\t\t\twidth: size.width, height: size.height, captureWidth: width, captureHeight: height,\n\t\t\tcoordinateSystem: renderer.coordinateSystem, toneMapping: renderer.toneMapping,\n\t\t\texposure: renderer.toneMappingExposure, colorSpace: renderer.outputColorSpace\n\t\t} : undefined;\n\t\tconst previous = this.frozenCapture;\n\t\tconst reuse = next && previous && next.source === previous.source && next.renderer === previous.renderer &&\n\t\t\tnext.destination === previous.destination && next.canvas === previous.canvas &&\n\t\t\tnext.width === previous.width && next.height === previous.height &&\n\t\t\tnext.captureWidth === previous.captureWidth && next.captureHeight === previous.captureHeight &&\n\t\t\tnext.coordinateSystem === previous.coordinateSystem && next.toneMapping === previous.toneMapping &&\n\t\t\tnext.exposure === previous.exposure && next.colorSpace === previous.colorSpace;\n\t\tconst color = renderer.getClearColor(new THREE.Color());\n\t\tconst clearAlpha = renderer.getClearAlpha();\n\t\tconst scissor = renderer.getScissor(new THREE.Vector4());\n\t\tconst scissorTest = renderer.getScissorTest();\n\t\ttry {\n\t\t\t// One shared scratch target: another band, ordinary draw or warmup replaces\n\t\t\t// these pixels. The first fractional frame always performs the full capture.\n\t\t\tthis.frozenCapture = undefined;\n\t\t\tif (!reuse) {\n\t\t\t\trenderer.setRenderTarget(this.capture);\n\t\t\t\trenderer.setScissorTest(false);\n\t\t\t\trenderer.setClearColor(0x000000, 0);\n\t\t\t\trenderer.clear();\n\t\t\t\tdraw();\n\t\t\t}\n\t\t\trenderer.setRenderTarget(destination);\n\t\t\trenderer.setScissor(scissor);\n\t\t\trenderer.setScissorTest(scissorTest);\n\t\t\tthis.alpha.value = opacity;\n\t\t\t(destination && !warmOutput?.usesCanvasOwner(destination) ? this.offscreenQuad : this.quad)!.render(renderer);\n\t\t} finally {\n\t\t\trenderer.setRenderTarget(destination);\n\t\t\trenderer.setClearColor(color, clearAlpha);\n\t\t\trenderer.setScissor(scissor);\n\t\t\trenderer.setScissorTest(scissorTest);\n\t\t}\n\t\tthis.frozenCapture = next;\n\t}\n\tdispose() {\n\t\tthis.frozenCapture = undefined;\n\t\tthis.capture?.dispose();\n\t\tthis.material?.dispose();\n\t\tthis.capture = undefined;\n\t\tthis.material = undefined;\n\t\tthis.quad = undefined;\n\t\tthis.offscreenQuad = undefined;\n\t}\n}\n"]}
@@ -0,0 +1,33 @@
1
+ import * as THREE from 'three/webgpu';
2
+ import type { StageInteractionTheme } from '../stage/stageTypes.js';
3
+ import type { BlurRect } from './CatalogDepthBlur.js';
4
+ import type { CatalogWarmOutputContext } from './CatalogWarmOutputContext.js';
5
+ /** A shared, cropped silhouette target. Idle hover fades reuse its last mask. */
6
+ export declare class CatalogModelOutline {
7
+ private readonly scene;
8
+ private readonly camera;
9
+ private readonly controls;
10
+ private readonly modelMatrix;
11
+ private readonly cameraMatrix;
12
+ private readonly projection;
13
+ private masks;
14
+ private source?;
15
+ private capture?;
16
+ private maskMaterial?;
17
+ private material?;
18
+ private quad?;
19
+ private offscreenQuad?;
20
+ private captures;
21
+ private passes;
22
+ getRenderTargets(): THREE.RenderTarget<THREE.Texture<unknown, THREE.TextureEventMap>, THREE.RenderTargetEventMap>[];
23
+ getStats(): {
24
+ captures: number;
25
+ passes: number;
26
+ targets: number;
27
+ size: number;
28
+ };
29
+ render(renderer: THREE.WebGPURenderer, camera: THREE.PerspectiveCamera, model: THREE.Object3D, bounds: BlurRect, clip: BlurRect, opacity: number, theme: StageInteractionTheme, warmOutput?: CatalogWarmOutputContext): void;
30
+ release(model: THREE.Object3D): void;
31
+ dispose(): void;
32
+ }
33
+ //# sourceMappingURL=CatalogModelOutline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CatalogModelOutline.d.ts","sourceRoot":"","sources":["../../src/catalog/CatalogModelOutline.ts"],"names":[],"mappings":"AAAA,OAAO,K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