@spatial-elements/core 0.1.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (299) hide show
  1. package/LICENSE +373 -0
  2. package/README.md +17 -0
  3. package/dist/catalog/CarouselGlassCompositor.d.ts +24 -0
  4. package/dist/catalog/CarouselGlassCompositor.d.ts.map +1 -0
  5. package/dist/catalog/CarouselGlassCompositor.js +132 -0
  6. package/dist/catalog/CarouselGlassCompositor.js.map +1 -0
  7. package/dist/catalog/CatalogEndpointRegistry.d.ts +59 -0
  8. package/dist/catalog/CatalogEndpointRegistry.d.ts.map +1 -0
  9. package/dist/catalog/CatalogEndpointRegistry.js +187 -0
  10. package/dist/catalog/CatalogEndpointRegistry.js.map +1 -0
  11. package/dist/catalog/CatalogGeometryFade.d.ts +12 -0
  12. package/dist/catalog/CatalogGeometryFade.d.ts.map +1 -0
  13. package/dist/catalog/CatalogGeometryFade.js +67 -0
  14. package/dist/catalog/CatalogGeometryFade.js.map +1 -0
  15. package/dist/catalog/CatalogPreparation.d.ts +40 -0
  16. package/dist/catalog/CatalogPreparation.d.ts.map +1 -0
  17. package/dist/catalog/CatalogPreparation.js +141 -0
  18. package/dist/catalog/CatalogPreparation.js.map +1 -0
  19. package/dist/catalog/CatalogSections.d.ts +36 -0
  20. package/dist/catalog/CatalogSections.d.ts.map +1 -0
  21. package/dist/catalog/CatalogSections.js +51 -0
  22. package/dist/catalog/CatalogSections.js.map +1 -0
  23. package/dist/catalog/CatalogSpatialElementLayer.d.ts +149 -0
  24. package/dist/catalog/CatalogSpatialElementLayer.d.ts.map +1 -0
  25. package/dist/catalog/CatalogSpatialElementLayer.js +920 -0
  26. package/dist/catalog/CatalogSpatialElementLayer.js.map +1 -0
  27. package/dist/catalog/CatalogTransition.d.ts +93 -0
  28. package/dist/catalog/CatalogTransition.d.ts.map +1 -0
  29. package/dist/catalog/CatalogTransition.js +1299 -0
  30. package/dist/catalog/CatalogTransition.js.map +1 -0
  31. package/dist/catalog/EnvironmentCache.d.ts +30 -0
  32. package/dist/catalog/EnvironmentCache.d.ts.map +1 -0
  33. package/dist/catalog/EnvironmentCache.js +128 -0
  34. package/dist/catalog/EnvironmentCache.js.map +1 -0
  35. package/dist/catalog/PreparationGate.d.ts +10 -0
  36. package/dist/catalog/PreparationGate.d.ts.map +1 -0
  37. package/dist/catalog/PreparationGate.js +66 -0
  38. package/dist/catalog/PreparationGate.js.map +1 -0
  39. package/dist/catalog/PresentationLease.d.ts +16 -0
  40. package/dist/catalog/PresentationLease.d.ts.map +1 -0
  41. package/dist/catalog/PresentationLease.js +33 -0
  42. package/dist/catalog/PresentationLease.js.map +1 -0
  43. package/dist/catalog/SpatialGeometryCapture.d.ts +63 -0
  44. package/dist/catalog/SpatialGeometryCapture.d.ts.map +1 -0
  45. package/dist/catalog/SpatialGeometryCapture.js +158 -0
  46. package/dist/catalog/SpatialGeometryCapture.js.map +1 -0
  47. package/dist/catalog/assets/SpatialElementAssetManager.d.ts +92 -0
  48. package/dist/catalog/assets/SpatialElementAssetManager.d.ts.map +1 -0
  49. package/dist/catalog/assets/SpatialElementAssetManager.js +305 -0
  50. package/dist/catalog/assets/SpatialElementAssetManager.js.map +1 -0
  51. package/dist/catalog/assets/assetCosts.d.ts +4 -0
  52. package/dist/catalog/assets/assetCosts.d.ts.map +1 -0
  53. package/dist/catalog/assets/assetCosts.js +33 -0
  54. package/dist/catalog/assets/assetCosts.js.map +1 -0
  55. package/dist/catalog/assets/spatialElementAssetResources.d.ts +25 -0
  56. package/dist/catalog/assets/spatialElementAssetResources.d.ts.map +1 -0
  57. package/dist/catalog/assets/spatialElementAssetResources.js +100 -0
  58. package/dist/catalog/assets/spatialElementAssetResources.js.map +1 -0
  59. package/dist/catalog/carouselPanelProjection.d.ts +9 -0
  60. package/dist/catalog/carouselPanelProjection.d.ts.map +1 -0
  61. package/dist/catalog/carouselPanelProjection.js +33 -0
  62. package/dist/catalog/carouselPanelProjection.js.map +1 -0
  63. package/dist/catalog/carouselSelection.d.ts +7 -0
  64. package/dist/catalog/carouselSelection.d.ts.map +1 -0
  65. package/dist/catalog/carouselSelection.js +15 -0
  66. package/dist/catalog/carouselSelection.js.map +1 -0
  67. package/dist/catalog/catalogAction.d.ts +4 -0
  68. package/dist/catalog/catalogAction.d.ts.map +1 -0
  69. package/dist/catalog/catalogAction.js +9 -0
  70. package/dist/catalog/catalogAction.js.map +1 -0
  71. package/dist/catalog/catalogGeometryRequest.d.ts +13 -0
  72. package/dist/catalog/catalogGeometryRequest.d.ts.map +1 -0
  73. package/dist/catalog/catalogGeometryRequest.js +8 -0
  74. package/dist/catalog/catalogGeometryRequest.js.map +1 -0
  75. package/dist/catalog/catalogItems.d.ts +10 -0
  76. package/dist/catalog/catalogItems.d.ts.map +1 -0
  77. package/dist/catalog/catalogItems.js +23 -0
  78. package/dist/catalog/catalogItems.js.map +1 -0
  79. package/dist/catalog/catalogJourney.d.ts +38 -0
  80. package/dist/catalog/catalogJourney.d.ts.map +1 -0
  81. package/dist/catalog/catalogJourney.js +64 -0
  82. package/dist/catalog/catalogJourney.js.map +1 -0
  83. package/dist/catalog/catalogPage.d.ts +11 -0
  84. package/dist/catalog/catalogPage.d.ts.map +1 -0
  85. package/dist/catalog/catalogPage.js +2 -0
  86. package/dist/catalog/catalogPage.js.map +1 -0
  87. package/dist/catalog/catalogPose.d.ts +30 -0
  88. package/dist/catalog/catalogPose.d.ts.map +1 -0
  89. package/dist/catalog/catalogPose.js +35 -0
  90. package/dist/catalog/catalogPose.js.map +1 -0
  91. package/dist/catalog/catalogPresentation.d.ts +24 -0
  92. package/dist/catalog/catalogPresentation.d.ts.map +1 -0
  93. package/dist/catalog/catalogPresentation.js +56 -0
  94. package/dist/catalog/catalogPresentation.js.map +1 -0
  95. package/dist/catalog/catalogRecipes.d.ts +21 -0
  96. package/dist/catalog/catalogRecipes.d.ts.map +1 -0
  97. package/dist/catalog/catalogRecipes.js +84 -0
  98. package/dist/catalog/catalogRecipes.js.map +1 -0
  99. package/dist/catalog/catalogSurfaceCapture.d.ts +11 -0
  100. package/dist/catalog/catalogSurfaceCapture.d.ts.map +1 -0
  101. package/dist/catalog/catalogSurfaceCapture.js +11 -0
  102. package/dist/catalog/catalogSurfaceCapture.js.map +1 -0
  103. package/dist/catalog/catalogViewLink.d.ts +8 -0
  104. package/dist/catalog/catalogViewLink.d.ts.map +1 -0
  105. package/dist/catalog/catalogViewLink.js +37 -0
  106. package/dist/catalog/catalogViewLink.js.map +1 -0
  107. package/dist/catalog/rebasePresentation.d.ts +3 -0
  108. package/dist/catalog/rebasePresentation.d.ts.map +1 -0
  109. package/dist/catalog/rebasePresentation.js +26 -0
  110. package/dist/catalog/rebasePresentation.js.map +1 -0
  111. package/dist/catalog/spatialElementAssets.d.ts +158 -0
  112. package/dist/catalog/spatialElementAssets.d.ts.map +1 -0
  113. package/dist/catalog/spatialElementAssets.js +92 -0
  114. package/dist/catalog/spatialElementAssets.js.map +1 -0
  115. package/dist/catalog/spatialElementLodPair.d.ts +17 -0
  116. package/dist/catalog/spatialElementLodPair.d.ts.map +1 -0
  117. package/dist/catalog/spatialElementLodPair.js +5 -0
  118. package/dist/catalog/spatialElementLodPair.js.map +1 -0
  119. package/dist/catalog/transitionTiming.d.ts +15 -0
  120. package/dist/catalog/transitionTiming.d.ts.map +1 -0
  121. package/dist/catalog/transitionTiming.js +22 -0
  122. package/dist/catalog/transitionTiming.js.map +1 -0
  123. package/dist/index.d.ts +11 -0
  124. package/dist/index.d.ts.map +1 -0
  125. package/dist/index.js +8 -0
  126. package/dist/index.js.map +1 -0
  127. package/dist/spatial-element/SpatialElementDockController.d.ts +101 -0
  128. package/dist/spatial-element/SpatialElementDockController.d.ts.map +1 -0
  129. package/dist/spatial-element/SpatialElementDockController.js +627 -0
  130. package/dist/spatial-element/SpatialElementDockController.js.map +1 -0
  131. package/dist/spatial-element/spatialElement.d.ts +28 -0
  132. package/dist/spatial-element/spatialElement.d.ts.map +1 -0
  133. package/dist/spatial-element/spatialElement.js +45 -0
  134. package/dist/spatial-element/spatialElement.js.map +1 -0
  135. package/dist/spatial-element/spatialElementDock.d.ts +43 -0
  136. package/dist/spatial-element/spatialElementDock.d.ts.map +1 -0
  137. package/dist/spatial-element/spatialElementDock.js +126 -0
  138. package/dist/spatial-element/spatialElementDock.js.map +1 -0
  139. package/dist/spatial-element/spatialElementSectionRegistry.d.ts +29 -0
  140. package/dist/spatial-element/spatialElementSectionRegistry.d.ts.map +1 -0
  141. package/dist/spatial-element/spatialElementSectionRegistry.js +67 -0
  142. package/dist/spatial-element/spatialElementSectionRegistry.js.map +1 -0
  143. package/dist/spatial-element/types.d.ts +165 -0
  144. package/dist/spatial-element/types.d.ts.map +1 -0
  145. package/dist/spatial-element/types.js +2 -0
  146. package/dist/spatial-element/types.js.map +1 -0
  147. package/dist/stage/LiquidGlassPanel.d.ts +55 -0
  148. package/dist/stage/LiquidGlassPanel.d.ts.map +1 -0
  149. package/dist/stage/LiquidGlassPanel.js +447 -0
  150. package/dist/stage/LiquidGlassPanel.js.map +1 -0
  151. package/dist/stage/MinimapBlurPipeline.d.ts +34 -0
  152. package/dist/stage/MinimapBlurPipeline.d.ts.map +1 -0
  153. package/dist/stage/MinimapBlurPipeline.js +147 -0
  154. package/dist/stage/MinimapBlurPipeline.js.map +1 -0
  155. package/dist/stage/MinimapController.d.ts +113 -0
  156. package/dist/stage/MinimapController.d.ts.map +1 -0
  157. package/dist/stage/MinimapController.js +803 -0
  158. package/dist/stage/MinimapController.js.map +1 -0
  159. package/dist/stage/OrbitControlsInterop.d.ts +8 -0
  160. package/dist/stage/OrbitControlsInterop.d.ts.map +1 -0
  161. package/dist/stage/OrbitControlsInterop.js +19 -0
  162. package/dist/stage/OrbitControlsInterop.js.map +1 -0
  163. package/dist/stage/PageBindingController.d.ts +41 -0
  164. package/dist/stage/PageBindingController.d.ts.map +1 -0
  165. package/dist/stage/PageBindingController.js +92 -0
  166. package/dist/stage/PageBindingController.js.map +1 -0
  167. package/dist/stage/PanelPresentationController.d.ts +92 -0
  168. package/dist/stage/PanelPresentationController.d.ts.map +1 -0
  169. package/dist/stage/PanelPresentationController.js +569 -0
  170. package/dist/stage/PanelPresentationController.js.map +1 -0
  171. package/dist/stage/PresentationReadiness.d.ts +30 -0
  172. package/dist/stage/PresentationReadiness.d.ts.map +1 -0
  173. package/dist/stage/PresentationReadiness.js +94 -0
  174. package/dist/stage/PresentationReadiness.js.map +1 -0
  175. package/dist/stage/SpaceMouseAdapter.d.ts +76 -0
  176. package/dist/stage/SpaceMouseAdapter.d.ts.map +1 -0
  177. package/dist/stage/SpaceMouseAdapter.js +197 -0
  178. package/dist/stage/SpaceMouseAdapter.js.map +1 -0
  179. package/dist/stage/SpatialElementInteractionController.d.ts +126 -0
  180. package/dist/stage/SpatialElementInteractionController.d.ts.map +1 -0
  181. package/dist/stage/SpatialElementInteractionController.js +581 -0
  182. package/dist/stage/SpatialElementInteractionController.js.map +1 -0
  183. package/dist/stage/SpatialElementPresentationController.d.ts +82 -0
  184. package/dist/stage/SpatialElementPresentationController.d.ts.map +1 -0
  185. package/dist/stage/SpatialElementPresentationController.js +372 -0
  186. package/dist/stage/SpatialElementPresentationController.js.map +1 -0
  187. package/dist/stage/SpatialElementRefinement.d.ts +26 -0
  188. package/dist/stage/SpatialElementRefinement.d.ts.map +1 -0
  189. package/dist/stage/SpatialElementRefinement.js +105 -0
  190. package/dist/stage/SpatialElementRefinement.js.map +1 -0
  191. package/dist/stage/StageExperience.d.ts +536 -0
  192. package/dist/stage/StageExperience.d.ts.map +1 -0
  193. package/dist/stage/StageExperience.js +2399 -0
  194. package/dist/stage/StageExperience.js.map +1 -0
  195. package/dist/stage/StagePanelLayout.d.ts +15 -0
  196. package/dist/stage/StagePanelLayout.d.ts.map +1 -0
  197. package/dist/stage/StagePanelLayout.js +20 -0
  198. package/dist/stage/StagePanelLayout.js.map +1 -0
  199. package/dist/stage/StagePanelRuntime.d.ts +20 -0
  200. package/dist/stage/StagePanelRuntime.d.ts.map +1 -0
  201. package/dist/stage/StagePanelRuntime.js +2 -0
  202. package/dist/stage/StagePanelRuntime.js.map +1 -0
  203. package/dist/stage/StageRenderPipeline.d.ts +179 -0
  204. package/dist/stage/StageRenderPipeline.d.ts.map +1 -0
  205. package/dist/stage/StageRenderPipeline.js +901 -0
  206. package/dist/stage/StageRenderPipeline.js.map +1 -0
  207. package/dist/stage/VirtualScrollController.d.ts +64 -0
  208. package/dist/stage/VirtualScrollController.d.ts.map +1 -0
  209. package/dist/stage/VirtualScrollController.js +329 -0
  210. package/dist/stage/VirtualScrollController.js.map +1 -0
  211. package/dist/stage/cssProjection.d.ts +18 -0
  212. package/dist/stage/cssProjection.d.ts.map +1 -0
  213. package/dist/stage/cssProjection.js +52 -0
  214. package/dist/stage/cssProjection.js.map +1 -0
  215. package/dist/stage/damping.d.ts +3 -0
  216. package/dist/stage/damping.d.ts.map +1 -0
  217. package/dist/stage/damping.js +8 -0
  218. package/dist/stage/damping.js.map +1 -0
  219. package/dist/stage/minimap/MinimapGeometry.d.ts +31 -0
  220. package/dist/stage/minimap/MinimapGeometry.d.ts.map +1 -0
  221. package/dist/stage/minimap/MinimapGeometry.js +163 -0
  222. package/dist/stage/minimap/MinimapGeometry.js.map +1 -0
  223. package/dist/stage/minimap/MinimapModel.d.ts +16 -0
  224. package/dist/stage/minimap/MinimapModel.d.ts.map +1 -0
  225. package/dist/stage/minimap/MinimapModel.js +51 -0
  226. package/dist/stage/minimap/MinimapModel.js.map +1 -0
  227. package/dist/stage/minimap/MinimapProjection.d.ts +41 -0
  228. package/dist/stage/minimap/MinimapProjection.d.ts.map +1 -0
  229. package/dist/stage/minimap/MinimapProjection.js +113 -0
  230. package/dist/stage/minimap/MinimapProjection.js.map +1 -0
  231. package/dist/stage/minimap/MinimapState.d.ts +102 -0
  232. package/dist/stage/minimap/MinimapState.d.ts.map +1 -0
  233. package/dist/stage/minimap/MinimapState.js +2 -0
  234. package/dist/stage/minimap/MinimapState.js.map +1 -0
  235. package/dist/stage/minimapMeasurement.d.ts +5 -0
  236. package/dist/stage/minimapMeasurement.d.ts.map +1 -0
  237. package/dist/stage/minimapMeasurement.js +11 -0
  238. package/dist/stage/minimapMeasurement.js.map +1 -0
  239. package/dist/stage/panelContext.d.ts +71 -0
  240. package/dist/stage/panelContext.d.ts.map +1 -0
  241. package/dist/stage/panelContext.js +6 -0
  242. package/dist/stage/panelContext.js.map +1 -0
  243. package/dist/stage/panelShadow.d.ts +20 -0
  244. package/dist/stage/panelShadow.d.ts.map +1 -0
  245. package/dist/stage/panelShadow.js +22 -0
  246. package/dist/stage/panelShadow.js.map +1 -0
  247. package/dist/stage/renderMeasurement.d.ts +3 -0
  248. package/dist/stage/renderMeasurement.d.ts.map +1 -0
  249. package/dist/stage/renderMeasurement.js +19 -0
  250. package/dist/stage/renderMeasurement.js.map +1 -0
  251. package/dist/stage/renderTargetInventory.d.ts +17 -0
  252. package/dist/stage/renderTargetInventory.d.ts.map +1 -0
  253. package/dist/stage/renderTargetInventory.js +27 -0
  254. package/dist/stage/renderTargetInventory.js.map +1 -0
  255. package/dist/stage/rendererState.d.ts +14 -0
  256. package/dist/stage/rendererState.d.ts.map +1 -0
  257. package/dist/stage/rendererState.js +35 -0
  258. package/dist/stage/rendererState.js.map +1 -0
  259. package/dist/stage/resolveStageProfile.d.ts +44 -0
  260. package/dist/stage/resolveStageProfile.d.ts.map +1 -0
  261. package/dist/stage/resolveStageProfile.js +30 -0
  262. package/dist/stage/resolveStageProfile.js.map +1 -0
  263. package/dist/stage/scrollAnimation.d.ts +10 -0
  264. package/dist/stage/scrollAnimation.d.ts.map +1 -0
  265. package/dist/stage/scrollAnimation.js +11 -0
  266. package/dist/stage/scrollAnimation.js.map +1 -0
  267. package/dist/stage/scrollFrame.d.ts +43 -0
  268. package/dist/stage/scrollFrame.d.ts.map +1 -0
  269. package/dist/stage/scrollFrame.js +232 -0
  270. package/dist/stage/scrollFrame.js.map +1 -0
  271. package/dist/stage/spatialElementFrame.d.ts +6 -0
  272. package/dist/stage/spatialElementFrame.d.ts.map +1 -0
  273. package/dist/stage/spatialElementFrame.js +22 -0
  274. package/dist/stage/spatialElementFrame.js.map +1 -0
  275. package/dist/stage/stageConstants.d.ts +85 -0
  276. package/dist/stage/stageConstants.d.ts.map +1 -0
  277. package/dist/stage/stageConstants.js +85 -0
  278. package/dist/stage/stageConstants.js.map +1 -0
  279. package/dist/stage/stageDom.d.ts +10 -0
  280. package/dist/stage/stageDom.d.ts.map +1 -0
  281. package/dist/stage/stageDom.js +22 -0
  282. package/dist/stage/stageDom.js.map +1 -0
  283. package/dist/stage/stageMath.d.ts +187 -0
  284. package/dist/stage/stageMath.d.ts.map +1 -0
  285. package/dist/stage/stageMath.js +344 -0
  286. package/dist/stage/stageMath.js.map +1 -0
  287. package/dist/stage/stageSceneUtils.d.ts +42 -0
  288. package/dist/stage/stageSceneUtils.d.ts.map +1 -0
  289. package/dist/stage/stageSceneUtils.js +154 -0
  290. package/dist/stage/stageSceneUtils.js.map +1 -0
  291. package/dist/stage/stageTypes.d.ts +189 -0
  292. package/dist/stage/stageTypes.d.ts.map +1 -0
  293. package/dist/stage/stageTypes.js +2 -0
  294. package/dist/stage/stageTypes.js.map +1 -0
  295. package/dist/stage/stageVisualTest.d.ts +92 -0
  296. package/dist/stage/stageVisualTest.d.ts.map +1 -0
  297. package/dist/stage/stageVisualTest.js +5 -0
  298. package/dist/stage/stageVisualTest.js.map +1 -0
  299. package/package.json +61 -0
@@ -0,0 +1,189 @@
1
+ import type { SpatialElementLodPair } from '../catalog/spatialElementLodPair.js';
2
+ import type { ColorRepresentation, Mesh } from 'three';
3
+ import type { LiquidGlassPanelOptions } from './LiquidGlassPanel.js';
4
+ /** Selects the rendering backend and visual complexity of a panel surface. */
5
+ export type StagePanelSurface = 'solid' | 'frosted' | 'glass';
6
+ /** Controls how the HDR environment is presented behind the stage. */
7
+ export interface BackgroundSettings {
8
+ /** Three.js background blur amount in the range supported by the active renderer. */
9
+ blurriness: number;
10
+ /** Color mixed over the HDR background. */
11
+ tint: ColorRepresentation;
12
+ /** Strength of the background tint, where zero leaves the HDR unchanged. */
13
+ tintIntensity: number;
14
+ }
15
+ /** Axis rotations, in radians, applied to a loaded model before it is fitted. */
16
+ export interface StageModelRotation {
17
+ x?: number;
18
+ y?: number;
19
+ z?: number;
20
+ }
21
+ /** Controls the fitted camera's initial orbit around the element. */
22
+ export interface StageCameraSettings {
23
+ /** Horizontal viewing angle in degrees. Positive values view from the right. */
24
+ azimuth?: number;
25
+ /** Vertical viewing angle in degrees. Positive values view from above. */
26
+ elevation?: number;
27
+ /** Empty space in CSS pixels reserved on every side of the automatic element fit. */
28
+ fitPadding?: number;
29
+ /** Presentation multiplier applied after fitting. Values above one make the element larger. */
30
+ fitScale?: number;
31
+ }
32
+ /** Supported blend modes for declarative stage material replacements. */
33
+ export type StageMaterialBlending = 'normal' | 'additive';
34
+ /** Serializable subset used to replace an asset mesh with a physical material. */
35
+ export interface StagePhysicalMaterialSettings {
36
+ type: 'physical';
37
+ color?: ColorRepresentation;
38
+ opacity?: number;
39
+ transparent?: boolean;
40
+ metalness?: number;
41
+ roughness?: number;
42
+ iridescence?: number;
43
+ clearcoat?: number;
44
+ blending?: StageMaterialBlending;
45
+ }
46
+ export type StageMaterialSettings = StagePhysicalMaterialSettings;
47
+ /** Controls the authored model pose and which meshes represent the actual element. */
48
+ export interface StageModelSettings {
49
+ /** Optional rotation applied on top of the GLB scene's authored root rotation. */
50
+ rotation?: StageModelRotation;
51
+ /**
52
+ * Exact, case-sensitive mesh names that remain visible on the main stage but do
53
+ * not participate in element bounds, picking, outlining, or element minimaps.
54
+ */
55
+ excludeMeshes?: readonly string[];
56
+ /** Physical material replacements keyed by exact, case-sensitive mesh name. */
57
+ materialOverrides?: Readonly<Record<string, StageMaterialSettings>>;
58
+ }
59
+ /** Controls the minimap model presentation while its panel is docked. */
60
+ export interface StageMinimapDockedView {
61
+ /** Model multiplier used only while the minimap is docked. */
62
+ scale?: number;
63
+ /** Horizontal viewing angle in degrees. Positive values view from the right. */
64
+ azimuth?: number;
65
+ /** Vertical viewing angle in degrees. Positive values view from above. */
66
+ elevation?: number;
67
+ }
68
+ /** Configures the optional element minimap rendered on top of a panel. */
69
+ export interface StageMinimapOptions {
70
+ /** Panel height, in CSS pixels, at maximum stage zoom. */
71
+ expandedHeight?: number;
72
+ /** Space, in CSS pixels, reserved around the minimap model. */
73
+ inset?: number;
74
+ /** Additional unbounded scale applied to the fitted minimap model. Values below 0.2 are clamped. */
75
+ modelScale?: number;
76
+ /** Model multiplier at full pointer hover. Use 1 to disable hover enlargement. */
77
+ hoverModelScale?: number;
78
+ /** Hover multiplier used once the minimap is expanded by camera zoom. */
79
+ expandedHoverModelScale?: number;
80
+ /** Optional spatial-element-specific presentation used while the minimap is docked. */
81
+ dockedView?: StageMinimapDockedView;
82
+ /** Color drawn over the blurred area outside the viewport cutout. */
83
+ overlayColor?: ColorRepresentation;
84
+ /** Overlay alpha using the same zero-to-one convention as CSS/Figma. */
85
+ overlayOpacity?: number;
86
+ /** Gaussian blur radius in CSS pixels. */
87
+ overlayBlur?: number;
88
+ /** Color behind the minimap capture when no stage background is rendered. */
89
+ contextColor?: ColorRepresentation;
90
+ /** Alpha of the minimap capture background. */
91
+ contextOpacity?: number;
92
+ /** Color of the rectangle describing the main camera viewport. */
93
+ viewportColor?: ColorRepresentation;
94
+ }
95
+ /** Connects one DOM panel declaration to its WebGPU and CSS3D representations. */
96
+ export interface StagePanelTarget {
97
+ /** Accessible DOM content displayed above the WebGPU panel. */
98
+ content: HTMLElement;
99
+ /** Inner content padding in CSS pixels. */
100
+ contentInset: number;
101
+ /** DOM element whose layout determines the panel position and dimensions. */
102
+ frame: HTMLElement;
103
+ /** Complete DOM surface used by solid and frosted CSS3D panels. */
104
+ surfaceElement: HTMLElement;
105
+ /** Enables the panel's minimap rendering mode. */
106
+ minimap?: StageMinimapOptions;
107
+ /** Enables proximity lift and pointer-driven tilt. Defaults to true. */
108
+ pointerReactive?: boolean;
109
+ /** Shared geometry, tint, blur, and shadow configuration. */
110
+ options: LiquidGlassPanelOptions;
111
+ /** Visual surface backend. All variants share the same CSS3D transform pipeline. */
112
+ surface: StagePanelSurface;
113
+ /** Reads the current opacity of the visual surface independently of its content. */
114
+ getSurfaceOpacity?: () => number;
115
+ /** Reads a transient scale applied only to the rendered minimap model. */
116
+ getMinimapModelScale?: () => number;
117
+ /** Reads the animated transition from the regular to the docked minimap view. */
118
+ getMinimapDockProgress?: () => number;
119
+ /** Reads the viewport-space top edge used to anchor the rendered model. */
120
+ getMinimapModelTop?: () => number | undefined;
121
+ }
122
+ /** Identifies the DOM region used to frame the main element camera. */
123
+ export interface StageViewportTarget {
124
+ element: HTMLElement;
125
+ }
126
+ /** Describes the independently animated phases of a close-up zoom. */
127
+ export interface StageZoomFocusState {
128
+ /** Camera-derived close-up amount, from the fitted view to maximum zoom. */
129
+ focus: number;
130
+ /** Progress used to fade and move ordinary page content and panels. */
131
+ uiFocus: number;
132
+ /** Exact opacity applied to ordinary panels and non-stage DOM content. */
133
+ uiOpacity: number;
134
+ /** Delayed progress used to expand and morph the minimap. */
135
+ minimapFocus: number;
136
+ }
137
+ /** A deterministic camera pose used by browser-level visual regression tests. */
138
+ export interface StageVisualTestView {
139
+ /** Normalized camera distance, where zero is the fitted view and one is maximum zoom. */
140
+ zoom?: number;
141
+ /** Horizontal orbit offset from the initial pose, in degrees. */
142
+ azimuth?: number;
143
+ /** Vertical orbit offset from the initial pose, in degrees. */
144
+ polar?: number;
145
+ /** Orbit-target offset expressed as a fraction of the fitted model radius. */
146
+ targetOffset?: Partial<{
147
+ x: number;
148
+ y: number;
149
+ z: number;
150
+ }>;
151
+ }
152
+ /** Construction options for a {@link StageExperience}. */
153
+ export interface StageExperienceOptions {
154
+ /** Directory containing Draco decoder files, including trailing slash. */
155
+ dracoDecoderPath?: string;
156
+ /** Opaque page surface, independent of the HDR environment. */
157
+ pageBackground?: string;
158
+ /** Reveals semantic content when the device can no longer render. */
159
+ onDeviceLost?: () => void;
160
+ lodPair?: SpatialElementLodPair;
161
+ /** Catalog pages register their own presentations, including an intentionally empty list. */
162
+ catalog?: boolean;
163
+ /** A restored dock uses Low only; optional detail preparation resumes when the hero returns. */
164
+ deferDetailPreparation?: boolean;
165
+ heroIsPresented?: () => boolean;
166
+ background?: BackgroundSettings;
167
+ hdr?: string;
168
+ glb?: string;
169
+ model?: StageModelSettings;
170
+ camera?: StageCameraSettings;
171
+ interactionTheme?: Partial<StageInteractionTheme>;
172
+ panels?: StagePanelTarget[];
173
+ viewport?: StageViewportTarget;
174
+ /** Enables optional 3DxWare/SpaceMouse navigation. Defaults to true. */
175
+ enableSpaceMouse?: boolean;
176
+ /** Receives the normalized, sequenced phases of a close-up zoom. */
177
+ onZoomFocusChange?: (state: StageZoomFocusState) => void;
178
+ }
179
+ /** Visual and filtering options for element hover interaction. */
180
+ export interface StageInteractionTheme {
181
+ outlineColor: ColorRepresentation;
182
+ outlineOpacity: number;
183
+ outlineThickness: number;
184
+ outlineGlow: number;
185
+ outlineGlowThickness: number;
186
+ /** Returns true for model meshes that must not participate in picking or outlining. */
187
+ excludeMesh?: (mesh: Mesh) => boolean;
188
+ }
189
+ //# sourceMappingURL=stageTypes.d.ts.map
@@ -0,0 +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;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C,EAAE,qBAAqB,CAAC;IAChC,6FAA6F;IAC7F,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gGAAgG;IAChG,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,eAAe,CAAC,EAAE,MAAM,OAAO,CAAC;IAChC,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,gBAAgB,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAClD,MAAM,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC5B,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAC/B,wEAAwE;IACxE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oEAAoE;IACpE,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;CACzD;AAED,kEAAkE;AAClE,MAAM,WAAW,qBAAqB;IACrC,YAAY,EAAE,mBAAmB,CAAC;IAClC,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,uFAAuF;IACvF,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC;CACtC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=stageTypes.js.map
@@ -0,0 +1 @@
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/** 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"]}
@@ -0,0 +1,92 @@
1
+ import type { StageVisualTestView, StageZoomFocusState } from './stageTypes.js';
2
+ import type { StageExperience } from './StageExperience.js';
3
+ export interface StageVisualTestRect {
4
+ x: number;
5
+ y: number;
6
+ width: number;
7
+ height: number;
8
+ }
9
+ export interface StageVisualTestMinimapRenderStats {
10
+ overlayCapturePasses: number;
11
+ depthNear: number;
12
+ depthFar: number;
13
+ viewportRingInForeground: boolean;
14
+ }
15
+ export type StageVisualTestQuaternion = [number, number, number, number];
16
+ export interface StageVisualTestMinimapOrientation {
17
+ rest: StageVisualTestQuaternion;
18
+ display: StageVisualTestQuaternion;
19
+ live: StageVisualTestQuaternion;
20
+ docked: StageVisualTestQuaternion | null;
21
+ dockProgress: number;
22
+ }
23
+ export type StageVisualTestRenderTargetStats = ReturnType<StageExperience['getVisualTestRenderTargetStats']>;
24
+ export interface StageVisualTestVisibilityStats {
25
+ stageViewportVisible: boolean;
26
+ visiblePanels: number;
27
+ visibleMinimaps: number;
28
+ stageModelRenderPasses: number;
29
+ panelBlurRenderPasses: number;
30
+ panelSceneRenderPasses: number;
31
+ minimapSceneRenderPasses: number;
32
+ }
33
+ /** Browser-only controls exposed when a stage is opened with `?stage-test=1`. */
34
+ export interface StageVisualTestController {
35
+ getNavigationTimings(): {
36
+ dataReady: number;
37
+ captured: number;
38
+ restoring: number;
39
+ bound: number;
40
+ };
41
+ captureHeroPresentation(): boolean;
42
+ getSpatialCapture(): ReturnType<StageExperience['getSpatialCapture']> | null;
43
+ releaseSpatialCapture(): void;
44
+ getCatalogOwnership(): ReturnType<import('../catalog/CatalogTransition.js').CatalogTransition['getOwnership']>;
45
+ /** Query-gated fixture registration for ambiguity/teardown tests. */
46
+ registerCatalogEndpoint(address: import('../catalog/CatalogEndpointRegistry.js').CatalogEndpointAddress, element: HTMLElement): () => void;
47
+ getCatalogEndpoints(): ReturnType<import('../catalog/CatalogEndpointRegistry.js').CatalogEndpointRegistry['getSnapshot']>;
48
+ loseDevice(): void;
49
+ /** Holds one destination after DOM commit to verify its pre-render visibility gate. */
50
+ holdNextPageBinding(): void;
51
+ releasePageBinding(): void;
52
+ getCatalogPresentation(): ReturnType<StageExperience['getCatalogPresentation']> | null;
53
+ /** Resource ownership diagnostics for catalog navigation acceptance. */
54
+ getCarouselStats(): ReturnType<import('../catalog/CatalogSpatialElementLayer.js').CatalogSpatialElementLayer['getStats']> | null;
55
+ getCatalogStats(): ReturnType<StageExperience['assets']['getStats']> | null;
56
+ /** Applies a deterministic camera pose and waits until dependent render state settles. */
57
+ setView(view: StageVisualTestView): Promise<void>;
58
+ /** Applies an equivalent zoom through the SpaceMouse camera/target dolly path. */
59
+ setSpaceMouseZoom(zoom: number): Promise<void>;
60
+ /** Repeats SpaceMouse updates while frames render, leaving the synthetic gesture active. */
61
+ driveSpaceMouseZoom(zoom: number, frames?: number): Promise<void>;
62
+ /** Ends a synthetic SpaceMouse gesture and lets dependent render state settle. */
63
+ stopSpaceMouse(): Promise<void>;
64
+ /** Returns the current rendered minimap bounds in viewport pixels. */
65
+ getMinimapRect(): StageVisualTestRect | null;
66
+ /** Returns the projected main element bounds in viewport pixels. */
67
+ getModelRect(): StageVisualTestRect | null;
68
+ /** Returns the projected 3D element bounds in viewport pixels. */
69
+ getMinimapModelRect(): StageVisualTestRect | null;
70
+ /** Returns canonical, displayed, and fully synchronized minimap orientations. */
71
+ getMinimapOrientation(): StageVisualTestMinimapOrientation | null;
72
+ /** Returns minimap overlay submissions for performance regression tests. */
73
+ getMinimapRenderStats(): StageVisualTestMinimapRenderStats;
74
+ /** Returns target allocation, resize, and warm-up counters. */
75
+ getRenderTargetStats(): StageVisualTestRenderTargetStats;
76
+ /** Returns current culling state and submitted render-pass counters. */
77
+ getVisibilityStats(): StageVisualTestVisibilityStats;
78
+ /** Restores the exact fitted camera pose without running the user-facing reset animation. */
79
+ reset(): Promise<void>;
80
+ /** Advances the renderer by a fixed number of synthetic frames. */
81
+ settle(frames?: number): Promise<void>;
82
+ /** Returns the latest zoom phases reported by the stage. */
83
+ getState(): StageZoomFocusState;
84
+ }
85
+ declare global {
86
+ interface Window {
87
+ __stageVisualTest?: StageVisualTestController;
88
+ }
89
+ }
90
+ /** Returns whether the current page explicitly requested deterministic visual-test controls. */
91
+ export declare function isStageVisualTestMode(): boolean;
92
+ //# sourceMappingURL=stageVisualTest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stageVisualTest.d.ts","sourceRoot":"","sources":["../../src/stage/stageVisualTest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,MAAM,WAAW,mBAAmB;IACnC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;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,CAAC;IAClE,4EAA4E;IAC5E,qBAAqB,IAAI,iCAAiC,CAAC;IAC3D,+DAA+D;IAC/D,oBAAoB,IAAI,gCAAgC,CAAC;IACzD,wEAAwE;IACxE,kBAAkB,IAAI,8BAA8B,CAAC;IACrD,6FAA6F;IAC7F,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,mEAAmE;IACnE,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,4DAA4D;IAC5D,QAAQ,IAAI,mBAAmB,CAAC;CAChC;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,MAAM;QACf,iBAAiB,CAAC,EAAE,yBAAyB,CAAC;KAC9C;CACD;AAED,gGAAgG;AAChG,wBAAgB,qBAAqB,YAEpC"}
@@ -0,0 +1,5 @@
1
+ /** Returns whether the current page explicitly requested deterministic visual-test controls. */
2
+ export function isStageVisualTestMode() {
3
+ return new URLSearchParams(window.location.search).get('stage-test') === '1';
4
+ }
5
+ //# sourceMappingURL=stageVisualTest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stageVisualTest.js","sourceRoot":"","sources":["../../src/stage/stageVisualTest.ts"],"names":[],"mappings":"AAwGA,gGAAgG;AAChG,MAAM,UAAU,qBAAqB;IACpC,OAAO,IAAI,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,GAAG,CAAC;AAC9E,CAAC","sourcesContent":["import type { StageVisualTestView, StageZoomFocusState } from './stageTypes.js';\nimport type { StageExperience } from './StageExperience.js';\n\nexport interface StageVisualTestRect {\n\tx: number;\n\ty: number;\n\twidth: number;\n\theight: number;\n}\n\nexport interface StageVisualTestMinimapRenderStats {\n\toverlayCapturePasses: number;\n\tdepthNear: number;\n\tdepthFar: number;\n\tviewportRingInForeground: boolean;\n}\n\nexport type StageVisualTestQuaternion = [number, number, number, number];\n\nexport interface StageVisualTestMinimapOrientation {\n\trest: StageVisualTestQuaternion;\n\tdisplay: StageVisualTestQuaternion;\n\tlive: StageVisualTestQuaternion;\n\tdocked: StageVisualTestQuaternion | null;\n\tdockProgress: number;\n}\n\nexport type StageVisualTestRenderTargetStats = ReturnType<\n\tStageExperience['getVisualTestRenderTargetStats']\n>;\n\nexport interface StageVisualTestVisibilityStats {\n\tstageViewportVisible: boolean;\n\tvisiblePanels: number;\n\tvisibleMinimaps: number;\n\tstageModelRenderPasses: number;\n\tpanelBlurRenderPasses: number;\n\tpanelSceneRenderPasses: number;\n\tminimapSceneRenderPasses: number;\n}\n\n/** Browser-only controls exposed when a stage is opened with `?stage-test=1`. */\nexport interface StageVisualTestController {\n\tgetNavigationTimings(): { dataReady: number; captured: number; restoring: number; bound: number };\n\tcaptureHeroPresentation(): boolean;\n\tgetSpatialCapture(): ReturnType<StageExperience['getSpatialCapture']> | null;\n\treleaseSpatialCapture(): void;\n\tgetCatalogOwnership(): ReturnType<\n\t\timport('../catalog/CatalogTransition.js').CatalogTransition['getOwnership']\n\t>;\n\t/** Query-gated fixture registration for ambiguity/teardown tests. */\n\tregisterCatalogEndpoint(\n\t\taddress: import('../catalog/CatalogEndpointRegistry.js').CatalogEndpointAddress,\n\t\telement: HTMLElement\n\t): () => void;\n\tgetCatalogEndpoints(): ReturnType<\n\t\timport('../catalog/CatalogEndpointRegistry.js').CatalogEndpointRegistry['getSnapshot']\n\t>;\n\tloseDevice(): void;\n\t/** Holds one destination after DOM commit to verify its pre-render visibility gate. */\n\tholdNextPageBinding(): void;\n\treleasePageBinding(): void;\n\tgetCatalogPresentation(): ReturnType<StageExperience['getCatalogPresentation']> | null;\n\t/** Resource ownership diagnostics for catalog navigation acceptance. */\n\tgetCarouselStats(): ReturnType<\n\t\timport('../catalog/CatalogSpatialElementLayer.js').CatalogSpatialElementLayer['getStats']\n\t> | null;\n\tgetCatalogStats(): ReturnType<StageExperience['assets']['getStats']> | null;\n\t/** Applies a deterministic camera pose and waits until dependent render state settles. */\n\tsetView(view: StageVisualTestView): Promise<void>;\n\t/** Applies an equivalent zoom through the SpaceMouse camera/target dolly path. */\n\tsetSpaceMouseZoom(zoom: number): Promise<void>;\n\t/** Repeats SpaceMouse updates while frames render, leaving the synthetic gesture active. */\n\tdriveSpaceMouseZoom(zoom: number, frames?: number): Promise<void>;\n\t/** Ends a synthetic SpaceMouse gesture and lets dependent render state settle. */\n\tstopSpaceMouse(): Promise<void>;\n\t/** Returns the current rendered minimap bounds in viewport pixels. */\n\tgetMinimapRect(): StageVisualTestRect | null;\n\t/** Returns the projected main element bounds in viewport pixels. */\n\tgetModelRect(): StageVisualTestRect | null;\n\t/** Returns the projected 3D element bounds in viewport pixels. */\n\tgetMinimapModelRect(): StageVisualTestRect | null;\n\t/** Returns canonical, displayed, and fully synchronized minimap orientations. */\n\tgetMinimapOrientation(): StageVisualTestMinimapOrientation | null;\n\t/** Returns minimap overlay submissions for performance regression tests. */\n\tgetMinimapRenderStats(): StageVisualTestMinimapRenderStats;\n\t/** Returns target allocation, resize, and warm-up counters. */\n\tgetRenderTargetStats(): StageVisualTestRenderTargetStats;\n\t/** Returns current culling state and submitted render-pass counters. */\n\tgetVisibilityStats(): StageVisualTestVisibilityStats;\n\t/** Restores the exact fitted camera pose without running the user-facing reset animation. */\n\treset(): Promise<void>;\n\t/** Advances the renderer by a fixed number of synthetic frames. */\n\tsettle(frames?: number): Promise<void>;\n\t/** Returns the latest zoom phases reported by the stage. */\n\tgetState(): StageZoomFocusState;\n}\n\ndeclare global {\n\tinterface Window {\n\t\t__stageVisualTest?: StageVisualTestController;\n\t}\n}\n\n/** Returns whether the current page explicitly requested deterministic visual-test controls. */\nexport function isStageVisualTestMode() {\n\treturn new URLSearchParams(window.location.search).get('stage-test') === '1';\n}\n"]}
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "@spatial-elements/core",
3
+ "version": "0.1.0-beta.1",
4
+ "description": "Framework-independent rendering and catalog runtime for Spatial Elements.",
5
+ "license": "MPL-2.0",
6
+ "type": "module",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/LauridBergjohann/spatial-elements.git",
10
+ "directory": "packages/core"
11
+ },
12
+ "homepage": "https://github.com/LauridBergjohann/spatial-elements#readme",
13
+ "bugs": {
14
+ "url": "https://github.com/LauridBergjohann/spatial-elements/issues"
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "LICENSE",
19
+ "README.md"
20
+ ],
21
+ "exports": {
22
+ ".": {
23
+ "types": "./dist/index.d.ts",
24
+ "default": "./dist/index.js"
25
+ },
26
+ "./stage/*": {
27
+ "types": "./dist/stage/*.d.ts",
28
+ "default": "./dist/stage/*.js"
29
+ },
30
+ "./catalog/*": {
31
+ "types": "./dist/catalog/*.d.ts",
32
+ "default": "./dist/catalog/*.js"
33
+ },
34
+ "./spatial-element/*": {
35
+ "types": "./dist/spatial-element/*.d.ts",
36
+ "default": "./dist/spatial-element/*.js"
37
+ }
38
+ },
39
+ "types": "./dist/index.d.ts",
40
+ "sideEffects": false,
41
+ "engines": {
42
+ "node": ">=22.12.0"
43
+ },
44
+ "scripts": {
45
+ "build": "node ../../scripts/clean-package.mjs core && tsc -p tsconfig.json",
46
+ "check": "tsc -p tsconfig.json --noEmit",
47
+ "dev": "tsc -p tsconfig.json --watch",
48
+ "prepack": "npm run build"
49
+ },
50
+ "dependencies": {
51
+ "@3dconnexion/3dconnexionjs": "0.8.1"
52
+ },
53
+ "peerDependencies": {
54
+ "three": "^0.185.1"
55
+ },
56
+ "publishConfig": {
57
+ "access": "public",
58
+ "tag": "beta",
59
+ "registry": "https://registry.npmjs.org/"
60
+ }
61
+ }