@pascal-app/core 0.9.1 → 1.0.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 (378) hide show
  1. package/README.md +17 -10
  2. package/dist/events/bus.d.ts +49 -2
  3. package/dist/events/bus.d.ts.map +1 -1
  4. package/dist/hooks/scene-registry/item-clip-registry.d.ts +18 -0
  5. package/dist/hooks/scene-registry/item-clip-registry.d.ts.map +1 -0
  6. package/dist/hooks/scene-registry/item-clip-registry.js +10 -0
  7. package/dist/hooks/scene-registry/scene-registry.d.ts +8 -1
  8. package/dist/hooks/scene-registry/scene-registry.d.ts.map +1 -1
  9. package/dist/hooks/scene-registry/scene-registry.js +27 -1
  10. package/dist/hooks/spatial-grid/floor-placed-elevation.d.ts +17 -1
  11. package/dist/hooks/spatial-grid/floor-placed-elevation.d.ts.map +1 -1
  12. package/dist/hooks/spatial-grid/floor-placed-elevation.js +61 -8
  13. package/dist/hooks/spatial-grid/spatial-grid-manager.d.ts +135 -28
  14. package/dist/hooks/spatial-grid/spatial-grid-manager.d.ts.map +1 -1
  15. package/dist/hooks/spatial-grid/spatial-grid-manager.js +427 -271
  16. package/dist/hooks/spatial-grid/spatial-grid-sync.d.ts +46 -1
  17. package/dist/hooks/spatial-grid/spatial-grid-sync.d.ts.map +1 -1
  18. package/dist/hooks/spatial-grid/spatial-grid-sync.js +208 -9
  19. package/dist/hooks/spatial-grid/support-host-id.d.ts +3 -0
  20. package/dist/hooks/spatial-grid/support-host-id.d.ts.map +1 -0
  21. package/dist/hooks/spatial-grid/support-host-id.js +2 -0
  22. package/dist/hooks/spatial-grid/support-host-patch.d.ts +51 -0
  23. package/dist/hooks/spatial-grid/support-host-patch.d.ts.map +1 -0
  24. package/dist/hooks/spatial-grid/support-host-patch.js +164 -0
  25. package/dist/index.d.ts +33 -11
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +32 -10
  28. package/dist/lib/level-name.d.ts +4 -0
  29. package/dist/lib/level-name.d.ts.map +1 -0
  30. package/dist/lib/level-name.js +10 -0
  31. package/dist/lib/measurement-geometry.d.ts +23 -0
  32. package/dist/lib/measurement-geometry.d.ts.map +1 -0
  33. package/dist/lib/measurement-geometry.js +249 -0
  34. package/dist/lib/polygon-geometry.d.ts +0 -1
  35. package/dist/lib/polygon-geometry.d.ts.map +1 -1
  36. package/dist/lib/polygon-geometry.js +0 -18
  37. package/dist/lib/selection-proxy.d.ts +4 -0
  38. package/dist/lib/selection-proxy.d.ts.map +1 -0
  39. package/dist/lib/selection-proxy.js +12 -0
  40. package/dist/lib/slab-polygon.d.ts +31 -2
  41. package/dist/lib/slab-polygon.d.ts.map +1 -1
  42. package/dist/lib/slab-polygon.js +557 -31
  43. package/dist/lib/slots.d.ts +14 -0
  44. package/dist/lib/slots.d.ts.map +1 -0
  45. package/dist/lib/slots.js +26 -0
  46. package/dist/lib/space-detection.d.ts +40 -6
  47. package/dist/lib/space-detection.d.ts.map +1 -1
  48. package/dist/lib/space-detection.js +574 -192
  49. package/dist/lib/terrain-brush.d.ts +163 -0
  50. package/dist/lib/terrain-brush.d.ts.map +1 -0
  51. package/dist/lib/terrain-brush.js +359 -0
  52. package/dist/lib/terrain-codec.d.ts +51 -0
  53. package/dist/lib/terrain-codec.d.ts.map +1 -0
  54. package/dist/lib/terrain-codec.js +167 -0
  55. package/dist/lib/terrain-field.d.ts +150 -0
  56. package/dist/lib/terrain-field.d.ts.map +1 -0
  57. package/dist/lib/terrain-field.js +248 -0
  58. package/dist/lib/terrain-raycast.d.ts +44 -0
  59. package/dist/lib/terrain-raycast.d.ts.map +1 -0
  60. package/dist/lib/terrain-raycast.js +188 -0
  61. package/dist/lib/terrain-source.d.ts +60 -0
  62. package/dist/lib/terrain-source.d.ts.map +1 -0
  63. package/dist/lib/terrain-source.js +90 -0
  64. package/dist/lib/terrain-support.d.ts +60 -0
  65. package/dist/lib/terrain-support.d.ts.map +1 -0
  66. package/dist/lib/terrain-support.js +150 -0
  67. package/dist/lib/wall-distance.d.ts +60 -0
  68. package/dist/lib/wall-distance.d.ts.map +1 -0
  69. package/dist/lib/wall-distance.js +85 -0
  70. package/dist/lib/zone-quantities.d.ts +21 -0
  71. package/dist/lib/zone-quantities.d.ts.map +1 -0
  72. package/dist/lib/zone-quantities.js +428 -0
  73. package/dist/material-library.d.ts +28 -1
  74. package/dist/material-library.d.ts.map +1 -1
  75. package/dist/material-library.js +2233 -441
  76. package/dist/registry/handles.d.ts +91 -3
  77. package/dist/registry/handles.d.ts.map +1 -1
  78. package/dist/registry/index.d.ts +3 -3
  79. package/dist/registry/index.d.ts.map +1 -1
  80. package/dist/registry/index.js +1 -1
  81. package/dist/registry/registry.d.ts +46 -3
  82. package/dist/registry/registry.d.ts.map +1 -1
  83. package/dist/registry/registry.js +82 -1
  84. package/dist/registry/subtree.d.ts.map +1 -1
  85. package/dist/registry/subtree.js +8 -1
  86. package/dist/registry/types.d.ts +781 -39
  87. package/dist/registry/types.d.ts.map +1 -1
  88. package/dist/schema/index.d.ts +27 -8
  89. package/dist/schema/index.d.ts.map +1 -1
  90. package/dist/schema/index.js +23 -6
  91. package/dist/schema/material.d.ts +3 -2
  92. package/dist/schema/material.d.ts.map +1 -1
  93. package/dist/schema/material.js +7 -5
  94. package/dist/schema/nodes/box-vent.d.ts +2 -2
  95. package/dist/schema/nodes/cabinet.d.ts +536 -0
  96. package/dist/schema/nodes/cabinet.d.ts.map +1 -0
  97. package/dist/schema/nodes/cabinet.js +139 -0
  98. package/dist/schema/nodes/ceiling.d.ts +4 -3
  99. package/dist/schema/nodes/ceiling.d.ts.map +1 -1
  100. package/dist/schema/nodes/ceiling.js +11 -1
  101. package/dist/schema/nodes/chimney.d.ts +4 -4
  102. package/dist/schema/nodes/column.d.ts +4 -2
  103. package/dist/schema/nodes/column.d.ts.map +1 -1
  104. package/dist/schema/nodes/column.js +5 -0
  105. package/dist/schema/nodes/construction-dimension.d.ts +195 -0
  106. package/dist/schema/nodes/construction-dimension.d.ts.map +1 -0
  107. package/dist/schema/nodes/construction-dimension.js +151 -0
  108. package/dist/schema/nodes/cupola.d.ts +2 -2
  109. package/dist/schema/nodes/door.d.ts +42 -5
  110. package/dist/schema/nodes/door.d.ts.map +1 -1
  111. package/dist/schema/nodes/door.js +32 -0
  112. package/dist/schema/nodes/dormer.d.ts +8 -8
  113. package/dist/schema/nodes/dormer.js +1 -1
  114. package/dist/schema/nodes/downspout.d.ts +2 -2
  115. package/dist/schema/nodes/duct-fitting.d.ts +91 -0
  116. package/dist/schema/nodes/duct-fitting.d.ts.map +1 -0
  117. package/dist/schema/nodes/duct-fitting.js +92 -0
  118. package/dist/schema/nodes/duct-segment.d.ts +61 -0
  119. package/dist/schema/nodes/duct-segment.d.ts.map +1 -0
  120. package/dist/schema/nodes/duct-segment.js +73 -0
  121. package/dist/schema/nodes/duct-terminal.d.ts +58 -0
  122. package/dist/schema/nodes/duct-terminal.d.ts.map +1 -0
  123. package/dist/schema/nodes/duct-terminal.js +53 -0
  124. package/dist/schema/nodes/elevator.d.ts +3 -2
  125. package/dist/schema/nodes/elevator.d.ts.map +1 -1
  126. package/dist/schema/nodes/elevator.js +3 -0
  127. package/dist/schema/nodes/eyebrow-vent.d.ts +2 -2
  128. package/dist/schema/nodes/fence.d.ts +20 -2
  129. package/dist/schema/nodes/fence.d.ts.map +1 -1
  130. package/dist/schema/nodes/fence.js +33 -2
  131. package/dist/schema/nodes/gutter.d.ts +2 -2
  132. package/dist/schema/nodes/hvac-equipment.d.ts +64 -0
  133. package/dist/schema/nodes/hvac-equipment.d.ts.map +1 -0
  134. package/dist/schema/nodes/hvac-equipment.js +57 -0
  135. package/dist/schema/nodes/item.d.ts +9 -0
  136. package/dist/schema/nodes/item.d.ts.map +1 -1
  137. package/dist/schema/nodes/item.js +24 -0
  138. package/dist/schema/nodes/level.d.ts +2 -1
  139. package/dist/schema/nodes/level.d.ts.map +1 -1
  140. package/dist/schema/nodes/level.js +12 -31
  141. package/dist/schema/nodes/lineset.d.ts +42 -0
  142. package/dist/schema/nodes/lineset.d.ts.map +1 -0
  143. package/dist/schema/nodes/lineset.js +38 -0
  144. package/dist/schema/nodes/liquid-line.d.ts +34 -0
  145. package/dist/schema/nodes/liquid-line.d.ts.map +1 -0
  146. package/dist/schema/nodes/liquid-line.js +24 -0
  147. package/dist/schema/nodes/measurement.d.ts +306 -0
  148. package/dist/schema/nodes/measurement.d.ts.map +1 -0
  149. package/dist/schema/nodes/measurement.js +87 -0
  150. package/dist/schema/nodes/pipe-fitting.d.ts +56 -0
  151. package/dist/schema/nodes/pipe-fitting.d.ts.map +1 -0
  152. package/dist/schema/nodes/pipe-fitting.js +45 -0
  153. package/dist/schema/nodes/pipe-segment.d.ts +48 -0
  154. package/dist/schema/nodes/pipe-segment.d.ts.map +1 -0
  155. package/dist/schema/nodes/pipe-segment.js +36 -0
  156. package/dist/schema/nodes/pipe-trap.d.ts +43 -0
  157. package/dist/schema/nodes/pipe-trap.d.ts.map +1 -0
  158. package/dist/schema/nodes/pipe-trap.js +36 -0
  159. package/dist/schema/nodes/ridge-vent.d.ts +18 -3
  160. package/dist/schema/nodes/ridge-vent.d.ts.map +1 -1
  161. package/dist/schema/nodes/ridge-vent.js +221 -3
  162. package/dist/schema/nodes/roof-segment-shape.d.ts +90 -0
  163. package/dist/schema/nodes/roof-segment-shape.d.ts.map +1 -0
  164. package/dist/schema/nodes/roof-segment-shape.js +318 -0
  165. package/dist/schema/nodes/roof-segment-walls.d.ts +101 -0
  166. package/dist/schema/nodes/roof-segment-walls.d.ts.map +1 -0
  167. package/dist/schema/nodes/roof-segment-walls.js +330 -0
  168. package/dist/schema/nodes/roof-segment.d.ts +84 -8
  169. package/dist/schema/nodes/roof-segment.d.ts.map +1 -1
  170. package/dist/schema/nodes/roof-segment.js +290 -5
  171. package/dist/schema/nodes/roof.d.ts +8 -8
  172. package/dist/schema/nodes/shelf.d.ts +4 -2
  173. package/dist/schema/nodes/shelf.d.ts.map +1 -1
  174. package/dist/schema/nodes/shelf.js +8 -0
  175. package/dist/schema/nodes/site.d.ts +9 -0
  176. package/dist/schema/nodes/site.d.ts.map +1 -1
  177. package/dist/schema/nodes/site.js +8 -6
  178. package/dist/schema/nodes/skylight.d.ts +10 -10
  179. package/dist/schema/nodes/slab.d.ts +8 -2
  180. package/dist/schema/nodes/slab.d.ts.map +1 -1
  181. package/dist/schema/nodes/slab.js +18 -2
  182. package/dist/schema/nodes/solar-panel.d.ts +4 -4
  183. package/dist/schema/nodes/spawn.d.ts +1 -0
  184. package/dist/schema/nodes/spawn.d.ts.map +1 -1
  185. package/dist/schema/nodes/spawn.js +2 -0
  186. package/dist/schema/nodes/stair-segment.d.ts +4 -4
  187. package/dist/schema/nodes/stair.d.ts +16 -13
  188. package/dist/schema/nodes/stair.d.ts.map +1 -1
  189. package/dist/schema/nodes/stair.js +11 -1
  190. package/dist/schema/nodes/structural-grid.d.ts +27 -0
  191. package/dist/schema/nodes/structural-grid.d.ts.map +1 -0
  192. package/dist/schema/nodes/structural-grid.js +17 -0
  193. package/dist/schema/nodes/turbine-vent.d.ts +2 -2
  194. package/dist/schema/nodes/wall.d.ts +248 -6
  195. package/dist/schema/nodes/wall.d.ts.map +1 -1
  196. package/dist/schema/nodes/wall.js +266 -0
  197. package/dist/schema/nodes/window.d.ts +40 -3
  198. package/dist/schema/nodes/window.d.ts.map +1 -1
  199. package/dist/schema/nodes/window.js +30 -0
  200. package/dist/schema/nodes/zone.d.ts +22 -0
  201. package/dist/schema/nodes/zone.d.ts.map +1 -1
  202. package/dist/schema/nodes/zone.js +21 -0
  203. package/dist/schema/scene-material.d.ts +41 -0
  204. package/dist/schema/scene-material.d.ts.map +1 -0
  205. package/dist/schema/scene-material.js +9 -0
  206. package/dist/schema/terrain.d.ts +28 -0
  207. package/dist/schema/terrain.d.ts.map +1 -0
  208. package/dist/schema/terrain.js +30 -0
  209. package/dist/schema/types.d.ts +1300 -97
  210. package/dist/schema/types.d.ts.map +1 -1
  211. package/dist/schema/types.js +27 -0
  212. package/dist/services/__fixtures__/wall-plane-top-boundary-repro.d.ts +80 -0
  213. package/dist/services/__fixtures__/wall-plane-top-boundary-repro.d.ts.map +1 -0
  214. package/dist/services/__fixtures__/wall-plane-top-boundary-repro.js +89 -0
  215. package/dist/services/alignment-anchors.d.ts.map +1 -1
  216. package/dist/services/alignment-anchors.js +30 -1
  217. package/dist/services/alignment.d.ts +5 -0
  218. package/dist/services/alignment.d.ts.map +1 -1
  219. package/dist/services/alignment.js +2 -0
  220. package/dist/services/hosting.d.ts +8 -0
  221. package/dist/services/hosting.d.ts.map +1 -1
  222. package/dist/services/hosting.js +13 -4
  223. package/dist/services/index.d.ts +9 -2
  224. package/dist/services/index.d.ts.map +1 -1
  225. package/dist/services/index.js +9 -2
  226. package/dist/services/level-height.d.ts +27 -0
  227. package/dist/services/level-height.d.ts.map +1 -0
  228. package/dist/services/level-height.js +94 -0
  229. package/dist/services/opening-guides.d.ts +141 -0
  230. package/dist/services/opening-guides.d.ts.map +1 -0
  231. package/dist/services/opening-guides.js +267 -0
  232. package/dist/services/port-connectivity.d.ts +115 -0
  233. package/dist/services/port-connectivity.d.ts.map +1 -0
  234. package/dist/services/port-connectivity.js +300 -0
  235. package/dist/services/riser-diagram.d.ts +40 -0
  236. package/dist/services/riser-diagram.d.ts.map +1 -0
  237. package/dist/services/riser-diagram.js +110 -0
  238. package/dist/services/snap.d.ts +9 -1
  239. package/dist/services/snap.d.ts.map +1 -1
  240. package/dist/services/snap.js +21 -1
  241. package/dist/services/storey.d.ts +103 -0
  242. package/dist/services/storey.d.ts.map +1 -0
  243. package/dist/services/storey.js +296 -0
  244. package/dist/services/system-graph.d.ts +30 -0
  245. package/dist/services/system-graph.d.ts.map +1 -0
  246. package/dist/services/system-graph.js +164 -0
  247. package/dist/services/validate-dwv.d.ts +32 -0
  248. package/dist/services/validate-dwv.d.ts.map +1 -0
  249. package/dist/services/validate-dwv.js +118 -0
  250. package/dist/store/actions/node-actions.d.ts.map +1 -1
  251. package/dist/store/actions/node-actions.js +141 -4
  252. package/dist/store/history-control.d.ts +31 -0
  253. package/dist/store/history-control.d.ts.map +1 -1
  254. package/dist/store/history-control.js +130 -0
  255. package/dist/store/use-live-terrain.d.ts +65 -0
  256. package/dist/store/use-live-terrain.d.ts.map +1 -0
  257. package/dist/store/use-live-terrain.js +31 -0
  258. package/dist/store/use-live-transforms.d.ts +8 -0
  259. package/dist/store/use-live-transforms.d.ts.map +1 -1
  260. package/dist/store/use-scene.d.ts +47 -3
  261. package/dist/store/use-scene.d.ts.map +1 -1
  262. package/dist/store/use-scene.js +992 -55
  263. package/dist/systems/elevator/elevator-opening-system.d.ts +1 -0
  264. package/dist/systems/elevator/elevator-opening-system.d.ts.map +1 -1
  265. package/dist/systems/elevator/elevator-opening-system.js +27 -21
  266. package/dist/systems/elevator/elevator-service.d.ts +0 -2
  267. package/dist/systems/elevator/elevator-service.d.ts.map +1 -1
  268. package/dist/systems/elevator/elevator-service.js +2 -24
  269. package/dist/systems/fence/fence-centerline.d.ts +12 -0
  270. package/dist/systems/fence/fence-centerline.d.ts.map +1 -0
  271. package/dist/systems/fence/fence-centerline.js +37 -0
  272. package/dist/systems/fence/fence-spline.d.ts +39 -0
  273. package/dist/systems/fence/fence-spline.d.ts.map +1 -0
  274. package/dist/systems/fence/fence-spline.js +196 -0
  275. package/dist/systems/slab/slab-placement.d.ts +11 -0
  276. package/dist/systems/slab/slab-placement.d.ts.map +1 -0
  277. package/dist/systems/slab/slab-placement.js +14 -0
  278. package/dist/systems/slab/slab-support.d.ts +137 -0
  279. package/dist/systems/slab/slab-support.d.ts.map +1 -0
  280. package/dist/systems/slab/slab-support.js +557 -0
  281. package/dist/systems/stair/stair-footprint.d.ts.map +1 -1
  282. package/dist/systems/stair/stair-footprint.js +21 -11
  283. package/dist/systems/stair/stair-opening-preview.d.ts +1300 -505
  284. package/dist/systems/stair/stair-opening-preview.d.ts.map +1 -1
  285. package/dist/systems/stair/stair-opening-sync.d.ts.map +1 -1
  286. package/dist/systems/stair/stair-opening-sync.js +19 -33
  287. package/dist/systems/stair/stair-opening-system.d.ts.map +1 -1
  288. package/dist/systems/stair/stair-opening-system.js +32 -4
  289. package/dist/systems/stair/stair-rise.d.ts +22 -0
  290. package/dist/systems/stair/stair-rise.d.ts.map +1 -0
  291. package/dist/systems/stair/stair-rise.js +79 -0
  292. package/dist/systems/wall/wall-curve.d.ts +10 -0
  293. package/dist/systems/wall/wall-curve.d.ts.map +1 -1
  294. package/dist/systems/wall/wall-curve.js +1 -1
  295. package/dist/systems/wall/wall-mitering.d.ts.map +1 -1
  296. package/dist/systems/wall/wall-mitering.js +44 -8
  297. package/dist/systems/wall/wall-top.d.ts +40 -0
  298. package/dist/systems/wall/wall-top.d.ts.map +1 -0
  299. package/dist/systems/wall/wall-top.js +46 -0
  300. package/dist/utils/clone-scene-graph.d.ts +1 -0
  301. package/dist/utils/clone-scene-graph.d.ts.map +1 -1
  302. package/dist/utils/clone-scene-graph.js +56 -5
  303. package/dist/utils/heal-scene-graph.d.ts +18 -0
  304. package/dist/utils/heal-scene-graph.d.ts.map +1 -0
  305. package/dist/utils/heal-scene-graph.js +106 -0
  306. package/dist/validation/validate-build-json.d.ts +3 -0
  307. package/dist/validation/validate-build-json.d.ts.map +1 -1
  308. package/dist/validation/validate-build-json.js +90 -5
  309. package/package.json +4 -4
  310. package/dist/hooks/spatial-grid/floor-placed-elevation.test.d.ts +0 -2
  311. package/dist/hooks/spatial-grid/floor-placed-elevation.test.d.ts.map +0 -1
  312. package/dist/hooks/spatial-grid/floor-placed-elevation.test.js +0 -273
  313. package/dist/lib/space-detection-pause.test.d.ts +0 -2
  314. package/dist/lib/space-detection-pause.test.d.ts.map +0 -1
  315. package/dist/lib/space-detection-pause.test.js +0 -42
  316. package/dist/lib/space-detection.test.d.ts +0 -2
  317. package/dist/lib/space-detection.test.d.ts.map +0 -1
  318. package/dist/lib/space-detection.test.js +0 -77
  319. package/dist/registry/registry.test.d.ts +0 -2
  320. package/dist/registry/registry.test.d.ts.map +0 -1
  321. package/dist/registry/registry.test.js +0 -183
  322. package/dist/registry/relations-resolver.test.d.ts +0 -2
  323. package/dist/registry/relations-resolver.test.d.ts.map +0 -1
  324. package/dist/registry/relations-resolver.test.js +0 -183
  325. package/dist/registry/scene-api.test.d.ts +0 -2
  326. package/dist/registry/scene-api.test.d.ts.map +0 -1
  327. package/dist/registry/scene-api.test.js +0 -183
  328. package/dist/registry/subtree.test.d.ts +0 -2
  329. package/dist/registry/subtree.test.d.ts.map +0 -1
  330. package/dist/registry/subtree.test.js +0 -133
  331. package/dist/schema/asset-url.test.d.ts +0 -2
  332. package/dist/schema/asset-url.test.d.ts.map +0 -1
  333. package/dist/schema/asset-url.test.js +0 -134
  334. package/dist/services/alignment-anchors.test.d.ts +0 -2
  335. package/dist/services/alignment-anchors.test.d.ts.map +0 -1
  336. package/dist/services/alignment-anchors.test.js +0 -383
  337. package/dist/services/alignment.test.d.ts +0 -2
  338. package/dist/services/alignment.test.d.ts.map +0 -1
  339. package/dist/services/alignment.test.js +0 -92
  340. package/dist/services/drag-session.test.d.ts +0 -2
  341. package/dist/services/drag-session.test.d.ts.map +0 -1
  342. package/dist/services/drag-session.test.js +0 -219
  343. package/dist/services/hosting.test.d.ts +0 -2
  344. package/dist/services/hosting.test.d.ts.map +0 -1
  345. package/dist/services/hosting.test.js +0 -199
  346. package/dist/services/movement.test.d.ts +0 -2
  347. package/dist/services/movement.test.d.ts.map +0 -1
  348. package/dist/services/movement.test.js +0 -133
  349. package/dist/services/single-undo-dance.test.d.ts +0 -2
  350. package/dist/services/single-undo-dance.test.d.ts.map +0 -1
  351. package/dist/services/single-undo-dance.test.js +0 -210
  352. package/dist/services/snap.test.d.ts +0 -2
  353. package/dist/services/snap.test.d.ts.map +0 -1
  354. package/dist/services/snap.test.js +0 -95
  355. package/dist/store/actions/node-mutation-sanitize.test.d.ts +0 -2
  356. package/dist/store/actions/node-mutation-sanitize.test.d.ts.map +0 -1
  357. package/dist/store/actions/node-mutation-sanitize.test.js +0 -147
  358. package/dist/store/actions/reparent.test.d.ts +0 -2
  359. package/dist/store/actions/reparent.test.d.ts.map +0 -1
  360. package/dist/store/actions/reparent.test.js +0 -212
  361. package/dist/store/use-scene-elevator-migration.test.d.ts +0 -2
  362. package/dist/store/use-scene-elevator-migration.test.d.ts.map +0 -1
  363. package/dist/store/use-scene-elevator-migration.test.js +0 -109
  364. package/dist/systems/elevator/elevator-opening-sync.test.d.ts +0 -2
  365. package/dist/systems/elevator/elevator-opening-sync.test.d.ts.map +0 -1
  366. package/dist/systems/elevator/elevator-opening-sync.test.js +0 -146
  367. package/dist/systems/elevator/elevator-runtime.test.d.ts +0 -2
  368. package/dist/systems/elevator/elevator-runtime.test.d.ts.map +0 -1
  369. package/dist/systems/elevator/elevator-runtime.test.js +0 -64
  370. package/dist/systems/stair/stair-opening-preview.test.d.ts +0 -2
  371. package/dist/systems/stair/stair-opening-preview.test.d.ts.map +0 -1
  372. package/dist/systems/stair/stair-opening-preview.test.js +0 -80
  373. package/dist/systems/stair/stair-opening-sync.test.d.ts +0 -2
  374. package/dist/systems/stair/stair-opening-sync.test.d.ts.map +0 -1
  375. package/dist/systems/stair/stair-opening-sync.test.js +0 -446
  376. package/dist/utils/clone-scene-graph.test.d.ts +0 -2
  377. package/dist/utils/clone-scene-graph.test.d.ts.map +0 -1
  378. package/dist/utils/clone-scene-graph.test.js +0 -59
@@ -1,446 +0,0 @@
1
- import { describe, expect, test } from 'bun:test';
2
- import { BuildingNode, CeilingNode, LevelNode, SlabNode, StairNode, StairSegmentNode, } from '../../schema';
3
- import { syncAutoStairOpenings } from './stair-opening-sync';
4
- describe('syncAutoStairOpenings', () => {
5
- test('only applies stair holes to destination slabs that overlap the opening', () => {
6
- const building = BuildingNode.parse({ name: 'Building' });
7
- const ground = LevelNode.parse({ name: 'Ground', level: 0, parentId: building.id });
8
- const upper = LevelNode.parse({ name: 'Upper', level: 1, parentId: building.id });
9
- const landingSlab = SlabNode.parse({
10
- name: 'Landing Slab',
11
- parentId: upper.id,
12
- polygon: [
13
- [0, 0],
14
- [4, 0],
15
- [4, 3],
16
- [0, 3],
17
- ],
18
- });
19
- const bedroomSlab = SlabNode.parse({
20
- name: 'Bedroom Slab',
21
- parentId: upper.id,
22
- polygon: [
23
- [4, 0],
24
- [8, 0],
25
- [8, 3],
26
- [4, 3],
27
- ],
28
- });
29
- const segment = StairSegmentNode.parse({
30
- parentId: 'stair_main',
31
- width: 1,
32
- length: 2.6,
33
- height: 2.5,
34
- stepCount: 12,
35
- });
36
- const stair = StairNode.parse({
37
- id: 'stair_main',
38
- name: 'Main Stair',
39
- parentId: ground.id,
40
- position: [2, 0, 0.2],
41
- stairType: 'straight',
42
- fromLevelId: ground.id,
43
- toLevelId: upper.id,
44
- slabOpeningMode: 'destination',
45
- children: [segment.id],
46
- });
47
- const nodes = Object.fromEntries([
48
- building,
49
- ground,
50
- upper,
51
- landingSlab,
52
- bedroomSlab,
53
- stair,
54
- { ...segment, parentId: stair.id },
55
- ].map((node) => [node.id, node]));
56
- const updates = syncAutoStairOpenings(nodes);
57
- const landingUpdate = updates.find((update) => update.id === landingSlab.id);
58
- const bedroomUpdate = updates.find((update) => update.id === bedroomSlab.id);
59
- expect(landingUpdate?.data.holes).toHaveLength(1);
60
- expect(landingUpdate?.data.holeMetadata).toEqual([{ source: 'stair', stairId: stair.id }]);
61
- expect(bedroomUpdate).toBeUndefined();
62
- });
63
- test('applies stair holes to a later destination slab when the configured offset overhangs the slab edge', () => {
64
- const building = BuildingNode.parse({ name: 'Building' });
65
- const ground = LevelNode.parse({ name: 'Ground', level: 0, parentId: building.id });
66
- const upper = LevelNode.parse({ name: 'Upper', level: 1, parentId: building.id });
67
- const landingSlab = SlabNode.parse({
68
- name: 'Landing Slab',
69
- parentId: upper.id,
70
- polygon: [
71
- [0, 0],
72
- [4, 0],
73
- [4, 3],
74
- [0, 3],
75
- ],
76
- });
77
- const segment = StairSegmentNode.parse({
78
- parentId: 'stair_edge',
79
- width: 1,
80
- length: 2.6,
81
- height: 2.5,
82
- stepCount: 12,
83
- });
84
- const stair = StairNode.parse({
85
- id: 'stair_edge',
86
- name: 'Edge Stair',
87
- parentId: ground.id,
88
- position: [2, 0, 0],
89
- stairType: 'straight',
90
- fromLevelId: ground.id,
91
- toLevelId: upper.id,
92
- slabOpeningMode: 'destination',
93
- openingOffset: 0.08,
94
- children: [segment.id],
95
- });
96
- const nodes = Object.fromEntries([building, ground, upper, landingSlab, stair, { ...segment, parentId: stair.id }].map((node) => [node.id, node]));
97
- const updates = syncAutoStairOpenings(nodes);
98
- const landingUpdate = updates.find((update) => update.id === landingSlab.id);
99
- const hole = landingUpdate?.data.holes?.[0];
100
- expect(hole).toBeDefined();
101
- expect(Math.min(...hole.map(([, z]) => z))).toBeCloseTo(-0.08);
102
- expect(landingUpdate?.data.holeMetadata).toEqual([{ source: 'stair', stairId: stair.id }]);
103
- });
104
- test('does not apply stair holes to slabs on another building with a matching level number', () => {
105
- const buildingA = BuildingNode.parse({ name: 'Building A' });
106
- const groundA = LevelNode.parse({ name: 'Ground A', level: 0, parentId: buildingA.id });
107
- const upperA = LevelNode.parse({ name: 'Upper A', level: 1, parentId: buildingA.id });
108
- const buildingB = BuildingNode.parse({ name: 'Building B' });
109
- const upperB = LevelNode.parse({ name: 'Upper B', level: 1, parentId: buildingB.id });
110
- const slabA = SlabNode.parse({
111
- name: 'Upper A Slab',
112
- parentId: upperA.id,
113
- polygon: [
114
- [0, 0],
115
- [4, 0],
116
- [4, 3],
117
- [0, 3],
118
- ],
119
- });
120
- const slabB = SlabNode.parse({
121
- name: 'Upper B Slab',
122
- parentId: upperB.id,
123
- polygon: [
124
- [0, 0],
125
- [4, 0],
126
- [4, 3],
127
- [0, 3],
128
- ],
129
- });
130
- const segment = StairSegmentNode.parse({
131
- parentId: 'stair_scoped',
132
- width: 1,
133
- length: 2.6,
134
- height: 2.5,
135
- stepCount: 12,
136
- });
137
- const stair = StairNode.parse({
138
- id: 'stair_scoped',
139
- name: 'Scoped Stair',
140
- parentId: groundA.id,
141
- position: [2, 0, 0.2],
142
- stairType: 'straight',
143
- fromLevelId: groundA.id,
144
- toLevelId: upperA.id,
145
- slabOpeningMode: 'destination',
146
- children: [segment.id],
147
- });
148
- const nodes = Object.fromEntries([
149
- buildingA,
150
- groundA,
151
- upperA,
152
- buildingB,
153
- upperB,
154
- slabA,
155
- slabB,
156
- stair,
157
- { ...segment, parentId: stair.id },
158
- ].map((node) => [node.id, node]));
159
- const updates = syncAutoStairOpenings(nodes);
160
- expect(updates.find((update) => update.id === slabA.id)?.data.holes).toHaveLength(1);
161
- expect(updates.find((update) => update.id === slabB.id)).toBeUndefined();
162
- });
163
- test('uses the parent level when a stair has stale from-level data', () => {
164
- const building = BuildingNode.parse({ name: 'Building' });
165
- const ground = LevelNode.parse({ name: 'Ground', level: 0, parentId: building.id });
166
- const upper = LevelNode.parse({ name: 'Upper', level: 1, parentId: building.id });
167
- const landingSlab = SlabNode.parse({
168
- name: 'Landing Slab',
169
- parentId: upper.id,
170
- polygon: [
171
- [0, 0],
172
- [4, 0],
173
- [4, 8],
174
- [0, 8],
175
- ],
176
- });
177
- const segment = StairSegmentNode.parse({
178
- parentId: 'stair_stale_from',
179
- width: 1,
180
- length: 6,
181
- height: 2.5,
182
- stepCount: 12,
183
- });
184
- const stair = StairNode.parse({
185
- id: 'stair_stale_from',
186
- name: 'Stale From Stair',
187
- parentId: ground.id,
188
- position: [2, 0, 0.2],
189
- stairType: 'straight',
190
- fromLevelId: 'default',
191
- toLevelId: upper.id,
192
- slabOpeningMode: 'destination',
193
- children: [segment.id],
194
- });
195
- const nodes = Object.fromEntries([building, ground, upper, landingSlab, stair, { ...segment, parentId: stair.id }].map((node) => [node.id, node]));
196
- const updates = syncAutoStairOpenings(nodes);
197
- const landingUpdate = updates.find((update) => update.id === landingSlab.id);
198
- const hole = landingUpdate?.data.holes?.[0];
199
- expect(hole).toBeDefined();
200
- expect(Math.min(...hole.map(([, z]) => z))).toBeGreaterThan(0.9);
201
- expect(landingUpdate?.data.holeMetadata).toEqual([{ source: 'stair', stairId: stair.id }]);
202
- });
203
- test('infers the destination level when a destination stair has blank level fields', () => {
204
- const building = BuildingNode.parse({ name: 'Building' });
205
- const ground = LevelNode.parse({ name: 'Ground', level: 0, parentId: building.id });
206
- const upper = LevelNode.parse({ name: 'Upper', level: 1, parentId: building.id });
207
- const landingSlab = SlabNode.parse({
208
- name: 'Landing Slab',
209
- parentId: upper.id,
210
- polygon: [
211
- [0, 0],
212
- [4, 0],
213
- [4, 8],
214
- [0, 8],
215
- ],
216
- });
217
- const segment = StairSegmentNode.parse({
218
- parentId: 'stair_blank_levels',
219
- width: 1,
220
- length: 6,
221
- height: 2.5,
222
- stepCount: 12,
223
- });
224
- const stair = StairNode.parse({
225
- id: 'stair_blank_levels',
226
- name: 'Blank Level Stair',
227
- parentId: ground.id,
228
- position: [2, 0, 0.2],
229
- stairType: 'straight',
230
- fromLevelId: '',
231
- toLevelId: '',
232
- slabOpeningMode: 'destination',
233
- children: [segment.id],
234
- });
235
- const nodes = Object.fromEntries([building, ground, upper, landingSlab, stair, { ...segment, parentId: stair.id }].map((node) => [node.id, node]));
236
- const updates = syncAutoStairOpenings(nodes);
237
- const landingUpdate = updates.find((update) => update.id === landingSlab.id);
238
- expect(landingUpdate?.data.holes).toHaveLength(1);
239
- expect(landingUpdate?.data.holeMetadata).toEqual([{ source: 'stair', stairId: stair.id }]);
240
- });
241
- test('infers the destination level when a destination stair targets its source level', () => {
242
- const building = BuildingNode.parse({ name: 'Building' });
243
- const ground = LevelNode.parse({ name: 'Ground', level: 0, parentId: building.id });
244
- const upper = LevelNode.parse({ name: 'Upper', level: 1, parentId: building.id });
245
- const landingSlab = SlabNode.parse({
246
- name: 'Landing Slab',
247
- parentId: upper.id,
248
- polygon: [
249
- [0, 0],
250
- [4, 0],
251
- [4, 8],
252
- [0, 8],
253
- ],
254
- });
255
- const segment = StairSegmentNode.parse({
256
- parentId: 'stair_self_target',
257
- width: 1,
258
- length: 6,
259
- height: 2.5,
260
- stepCount: 12,
261
- });
262
- const stair = StairNode.parse({
263
- id: 'stair_self_target',
264
- name: 'Self Target Stair',
265
- parentId: ground.id,
266
- position: [2, 0, 0.2],
267
- stairType: 'straight',
268
- fromLevelId: ground.id,
269
- toLevelId: ground.id,
270
- slabOpeningMode: 'destination',
271
- children: [segment.id],
272
- });
273
- const nodes = Object.fromEntries([building, ground, upper, landingSlab, stair, { ...segment, parentId: stair.id }].map((node) => [node.id, node]));
274
- const updates = syncAutoStairOpenings(nodes);
275
- const landingUpdate = updates.find((update) => update.id === landingSlab.id);
276
- expect(landingUpdate?.data.holes).toHaveLength(1);
277
- expect(landingUpdate?.data.holeMetadata).toEqual([{ source: 'stair', stairId: stair.id }]);
278
- });
279
- test('does not add stair holes when a manual surface hole already covers them', () => {
280
- const building = BuildingNode.parse({ name: 'Building' });
281
- const ground = LevelNode.parse({ name: 'Ground', level: 0, parentId: building.id });
282
- const upper = LevelNode.parse({ name: 'Upper', level: 1, parentId: building.id });
283
- const manualOpening = [
284
- [1.0, 0.0],
285
- [3.0, 0.0],
286
- [3.0, 3.0],
287
- [1.0, 3.0],
288
- ];
289
- const sourceCeiling = CeilingNode.parse({
290
- name: 'Source Ceiling',
291
- parentId: ground.id,
292
- polygon: [
293
- [0, 0],
294
- [4, 0],
295
- [4, 3],
296
- [0, 3],
297
- ],
298
- holes: [manualOpening],
299
- holeMetadata: [{ source: 'manual' }],
300
- });
301
- const landingSlab = SlabNode.parse({
302
- name: 'Landing Slab',
303
- parentId: upper.id,
304
- polygon: [
305
- [0, 0],
306
- [4, 0],
307
- [4, 3],
308
- [0, 3],
309
- ],
310
- holes: [manualOpening],
311
- holeMetadata: [{ source: 'manual' }],
312
- });
313
- const segment = StairSegmentNode.parse({
314
- parentId: 'stair_main',
315
- width: 1,
316
- length: 2.6,
317
- height: 2.5,
318
- stepCount: 12,
319
- });
320
- const stair = StairNode.parse({
321
- id: 'stair_main',
322
- name: 'Main Stair',
323
- parentId: ground.id,
324
- position: [2, 0, 0.2],
325
- stairType: 'straight',
326
- fromLevelId: ground.id,
327
- toLevelId: upper.id,
328
- slabOpeningMode: 'destination',
329
- children: [segment.id],
330
- });
331
- const nodes = Object.fromEntries([
332
- building,
333
- ground,
334
- upper,
335
- sourceCeiling,
336
- landingSlab,
337
- stair,
338
- { ...segment, parentId: stair.id },
339
- ].map((node) => [node.id, node]));
340
- const updates = syncAutoStairOpenings(nodes);
341
- expect(updates.find((update) => update.id === landingSlab.id)).toBeUndefined();
342
- expect(updates.find((update) => update.id === sourceCeiling.id)).toBeUndefined();
343
- });
344
- test('adds stair holes when an existing manual hole is too small', () => {
345
- const building = BuildingNode.parse({ name: 'Building' });
346
- const ground = LevelNode.parse({ name: 'Ground', level: 0, parentId: building.id });
347
- const upper = LevelNode.parse({ name: 'Upper', level: 1, parentId: building.id });
348
- const smallManualOpening = [
349
- [1.8, 1.6],
350
- [2.2, 1.6],
351
- [2.2, 2.1],
352
- [1.8, 2.1],
353
- ];
354
- const landingSlab = SlabNode.parse({
355
- name: 'Landing Slab',
356
- parentId: upper.id,
357
- polygon: [
358
- [0, 0],
359
- [4, 0],
360
- [4, 3],
361
- [0, 3],
362
- ],
363
- holes: [smallManualOpening],
364
- holeMetadata: [{ source: 'manual' }],
365
- });
366
- const segment = StairSegmentNode.parse({
367
- parentId: 'stair_main',
368
- width: 1,
369
- length: 2.6,
370
- height: 2.5,
371
- stepCount: 12,
372
- });
373
- const stair = StairNode.parse({
374
- id: 'stair_main',
375
- name: 'Main Stair',
376
- parentId: ground.id,
377
- position: [2, 0, 0.2],
378
- stairType: 'straight',
379
- fromLevelId: ground.id,
380
- toLevelId: upper.id,
381
- slabOpeningMode: 'destination',
382
- children: [segment.id],
383
- });
384
- const nodes = Object.fromEntries([building, ground, upper, landingSlab, stair, { ...segment, parentId: stair.id }].map((node) => [node.id, node]));
385
- const updates = syncAutoStairOpenings(nodes);
386
- const landingUpdate = updates.find((update) => update.id === landingSlab.id);
387
- expect(landingUpdate?.data.holes).toHaveLength(2);
388
- expect(landingUpdate?.data.holes?.[0]).toEqual(smallManualOpening);
389
- expect(landingUpdate?.data.holeMetadata).toEqual([
390
- { source: 'manual' },
391
- { source: 'stair', stairId: stair.id },
392
- ]);
393
- });
394
- test('removes stale auto stair holes when a manual hole overlaps the stair opening', () => {
395
- const building = BuildingNode.parse({ name: 'Building' });
396
- const ground = LevelNode.parse({ name: 'Ground', level: 0, parentId: building.id });
397
- const upper = LevelNode.parse({ name: 'Upper', level: 1, parentId: building.id });
398
- const manualOpening = [
399
- [1.0, 0.0],
400
- [3.0, 0.0],
401
- [3.0, 3.0],
402
- [1.0, 3.0],
403
- ];
404
- const staleAutoOpening = [
405
- [1.5, 1],
406
- [2.5, 1],
407
- [2.5, 2.8],
408
- [1.5, 2.8],
409
- ];
410
- const landingSlab = SlabNode.parse({
411
- name: 'Landing Slab',
412
- parentId: upper.id,
413
- polygon: [
414
- [0, 0],
415
- [4, 0],
416
- [4, 3],
417
- [0, 3],
418
- ],
419
- holes: [manualOpening, staleAutoOpening],
420
- holeMetadata: [{ source: 'manual' }, { source: 'stair', stairId: 'stair_main' }],
421
- });
422
- const segment = StairSegmentNode.parse({
423
- parentId: 'stair_main',
424
- width: 1,
425
- length: 2.6,
426
- height: 2.5,
427
- stepCount: 12,
428
- });
429
- const stair = StairNode.parse({
430
- id: 'stair_main',
431
- name: 'Main Stair',
432
- parentId: ground.id,
433
- position: [2, 0, 0.2],
434
- stairType: 'straight',
435
- fromLevelId: ground.id,
436
- toLevelId: upper.id,
437
- slabOpeningMode: 'destination',
438
- children: [segment.id],
439
- });
440
- const nodes = Object.fromEntries([building, ground, upper, landingSlab, stair, { ...segment, parentId: stair.id }].map((node) => [node.id, node]));
441
- const updates = syncAutoStairOpenings(nodes);
442
- const landingUpdate = updates.find((update) => update.id === landingSlab.id);
443
- expect(landingUpdate?.data.holes).toEqual([manualOpening]);
444
- expect(landingUpdate?.data.holeMetadata).toEqual([{ source: 'manual' }]);
445
- });
446
- });
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=clone-scene-graph.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"clone-scene-graph.test.d.ts","sourceRoot":"","sources":["../../src/utils/clone-scene-graph.test.ts"],"names":[],"mappings":""}
@@ -1,59 +0,0 @@
1
- import { describe, expect, test } from 'bun:test';
2
- import { forkSceneGraph } from './clone-scene-graph';
3
- function makeNode(id, type, extra = {}) {
4
- return {
5
- object: 'node',
6
- id,
7
- type,
8
- parentId: null,
9
- visible: true,
10
- metadata: {},
11
- ...extra,
12
- };
13
- }
14
- function makeSceneGraph() {
15
- const site = makeNode('site_1', 'site', { children: ['level_1'] });
16
- const level = makeNode('level_1', 'level', {
17
- parentId: 'site_1',
18
- children: ['wall_1', 'scan_1', 'guide_1'],
19
- });
20
- const wall = makeNode('wall_1', 'wall', { parentId: 'level_1' });
21
- const scan = makeNode('scan_1', 'scan', { parentId: 'level_1', url: 'scan.glb' });
22
- const guide = makeNode('guide_1', 'guide', { parentId: 'level_1', url: 'guide.png' });
23
- return {
24
- nodes: {
25
- ['site_1']: site,
26
- ['level_1']: level,
27
- ['wall_1']: wall,
28
- ['scan_1']: scan,
29
- ['guide_1']: guide,
30
- },
31
- rootNodeIds: ['site_1'],
32
- collections: {
33
- ['collection_1']: {
34
- id: 'collection_1',
35
- name: 'References',
36
- nodeIds: ['scan_1', 'guide_1'],
37
- },
38
- },
39
- };
40
- }
41
- describe('forkSceneGraph', () => {
42
- test('strips scan and guide nodes by default', () => {
43
- const forked = forkSceneGraph(makeSceneGraph());
44
- const nodes = Object.values(forked.nodes);
45
- expect(nodes.some((node) => node.type === 'scan')).toBe(false);
46
- expect(nodes.some((node) => node.type === 'guide')).toBe(false);
47
- expect(nodes.some((node) => node.type === 'wall')).toBe(true);
48
- expect(forked.collections).toEqual({});
49
- });
50
- test('preserves scan and guide nodes when requested', () => {
51
- const forked = forkSceneGraph(makeSceneGraph(), { preserveScans: true });
52
- const nodes = Object.values(forked.nodes);
53
- expect(nodes.some((node) => node.type === 'scan')).toBe(true);
54
- expect(nodes.some((node) => node.type === 'guide')).toBe(true);
55
- expect(nodes.map((node) => node.id)).not.toContain('scan_1');
56
- expect(nodes.map((node) => node.id)).not.toContain('guide_1');
57
- expect(Object.values(forked.collections ?? {}).flatMap((collection) => collection.nodeIds)).toHaveLength(2);
58
- });
59
- });