@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,383 +0,0 @@
1
- import { beforeEach, describe, expect, test } from 'bun:test';
2
- import { z } from 'zod';
3
- import { nodeRegistry, registerNode } from '../registry';
4
- import { getElevatorShaftDepth, getElevatorShaftWallThickness, getElevatorShaftWidth, } from '../systems/elevator/elevator-geometry';
5
- import { stairFootprintAABB } from '../systems/stair/stair-footprint';
6
- import { collectAlignmentAnchors, footprintAABB, footprintAABBFrom, movingAlignmentAnchors, movingFootprintAnchors, polygonAnchors, wallSegmentAnchors, } from './alignment-anchors';
7
- // Minimal floor-placed def whose footprint reads `dimensions` / `rotation`
8
- // straight off the node, so tests can drive the AABB math directly.
9
- function floorPlacedDef(kind, applies) {
10
- return {
11
- kind,
12
- schemaVersion: 1,
13
- schema: z.object({ type: z.literal(kind) }),
14
- category: 'utility',
15
- defaults: () => ({}),
16
- capabilities: {
17
- floorPlaced: {
18
- footprint: (n) => ({
19
- dimensions: n.dimensions ?? [1, 1, 1],
20
- rotation: n.rotation ?? [0, 0, 0],
21
- }),
22
- ...(applies ? { applies } : {}),
23
- },
24
- },
25
- renderer: { kind: 'parametric', module: async () => ({ default: () => null }) },
26
- };
27
- }
28
- // Mirrors the real elevator/stair definitions, which expose their plan
29
- // footprint via the `alignmentFootprint` capability rather than a hardcoded
30
- // branch in the anchor bridge. The glue (shaft-outset box / stair AABB) is
31
- // reproduced here from the same core helpers production uses.
32
- function elevatorDef() {
33
- return {
34
- kind: 'elevator',
35
- schemaVersion: 1,
36
- schema: z.object({ type: z.literal('elevator') }),
37
- category: 'structure',
38
- defaults: () => ({}),
39
- capabilities: {
40
- alignmentFootprint: (n) => {
41
- const e = n;
42
- const wall = getElevatorShaftWallThickness(e);
43
- return {
44
- shape: 'box',
45
- dimensions: [getElevatorShaftWidth(e) + wall * 2, 1, getElevatorShaftDepth(e) + wall * 2],
46
- rotation: [0, e.rotation ?? 0, 0],
47
- };
48
- },
49
- },
50
- renderer: { kind: 'parametric', module: async () => ({ default: () => null }) },
51
- };
52
- }
53
- function stairDef() {
54
- return {
55
- kind: 'stair',
56
- schemaVersion: 1,
57
- schema: z.object({ type: z.literal('stair') }),
58
- category: 'structure',
59
- defaults: () => ({}),
60
- capabilities: {
61
- alignmentFootprint: (n, nodes) => {
62
- const aabb = stairFootprintAABB(n, nodes);
63
- return aabb ? { shape: 'aabb', ...aabb } : null;
64
- },
65
- },
66
- renderer: { kind: 'parametric', module: async () => ({ default: () => null }) },
67
- };
68
- }
69
- function plainDef(kind) {
70
- return {
71
- kind,
72
- schemaVersion: 1,
73
- schema: z.object({ type: z.literal(kind) }),
74
- category: 'utility',
75
- defaults: () => ({}),
76
- capabilities: {},
77
- renderer: { kind: 'parametric', module: async () => ({ default: () => null }) },
78
- };
79
- }
80
- const node = (over) => over;
81
- describe('footprintAABBFrom', () => {
82
- test('unrotated box is centred at position', () => {
83
- const aabb = footprintAABBFrom([10, 0, 20], [2, 1, 4], 0);
84
- expect(aabb).toEqual({ minX: 9, minZ: 18, maxX: 11, maxZ: 22 });
85
- });
86
- test('90° rotation swaps width and depth extents', () => {
87
- const aabb = footprintAABBFrom([0, 0, 0], [2, 1, 4], Math.PI / 2);
88
- expect(aabb.minX).toBeCloseTo(-2, 10);
89
- expect(aabb.maxX).toBeCloseTo(2, 10);
90
- expect(aabb.minZ).toBeCloseTo(-1, 10);
91
- expect(aabb.maxZ).toBeCloseTo(1, 10);
92
- });
93
- });
94
- describe('footprintAABB', () => {
95
- beforeEach(() => nodeRegistry._reset());
96
- test('reads dimensions + rotation from a floor-placed kind', () => {
97
- registerNode(floorPlacedDef('box'));
98
- const aabb = footprintAABB(node({ id: 'b1', type: 'box', position: [10, 0, 20], dimensions: [2, 1, 4] }));
99
- expect(aabb).toEqual({ minX: 9, minZ: 18, maxX: 11, maxZ: 22 });
100
- });
101
- test('returns null for a kind without a footprint', () => {
102
- registerNode(plainDef('wall'));
103
- expect(footprintAABB(node({ id: 'w1', type: 'wall', position: [0, 0, 0] }))).toBeNull();
104
- });
105
- test('derives an elevator footprint from its OUTER SHAFT, not the cab', () => {
106
- // Aligns to the visible shaft outline: cab 2×4 + 0.09 m wall each side →
107
- // 2.18 × 4.18, centred at (10, 20). The cab corners alone would sit ~9 cm
108
- // inside the drawn edge (past the 8 cm snap), so a guide never appeared.
109
- // The footprint comes from the elevator's `alignmentFootprint` (box) cap.
110
- registerNode(elevatorDef());
111
- const aabb = footprintAABB(node({ id: 'e1', type: 'elevator', position: [10, 0, 20], width: 2, depth: 4, rotation: 0 }));
112
- expect(aabb).toEqual({ minX: 8.91, minZ: 17.91, maxX: 11.09, maxZ: 22.09 });
113
- });
114
- test('returns null when the kind predicate excludes the node', () => {
115
- registerNode(floorPlacedDef('lamp', (n) => !n.attached));
116
- expect(footprintAABB(node({ id: 'l1', type: 'lamp', position: [0, 0, 0], attached: true }))).toBeNull();
117
- expect(footprintAABB(node({ id: 'l2', type: 'lamp', position: [0, 0, 0], attached: false }))).not.toBeNull();
118
- });
119
- });
120
- describe('movingFootprintAnchors', () => {
121
- beforeEach(() => nodeRegistry._reset());
122
- test('relocates the footprint corners around the proposed centre (edges only, no centre anchor)', () => {
123
- registerNode(floorPlacedDef('box'));
124
- const anchors = movingFootprintAnchors(node({ id: 'm', type: 'box', position: [0, 0, 0], dimensions: [2, 1, 4] }), 10, 20);
125
- // 2×4 box centred at (10, 20): corners at x∈{9,11}, z∈{18,22}.
126
- expect(anchors).toHaveLength(4);
127
- expect(anchors.every((a) => a.kind === 'corner')).toBe(true);
128
- expect(new Set(anchors.map((a) => a.x))).toEqual(new Set([9, 11]));
129
- expect(new Set(anchors.map((a) => a.z))).toEqual(new Set([18, 22]));
130
- });
131
- test('rotationY override drives the AABB regardless of node rotation', () => {
132
- registerNode(floorPlacedDef('box'));
133
- const anchors = movingFootprintAnchors(node({
134
- id: 'm',
135
- type: 'box',
136
- position: [0, 0, 0],
137
- dimensions: [2, 1, 4],
138
- rotation: [0, 0, 0],
139
- }), 0, 0, Math.PI / 2);
140
- const xs = anchors.map((a) => a.x);
141
- // Rotated 90°, the 2×4 box spans ±2 in X (its depth) rather than ±1.
142
- expect(Math.max(...xs)).toBeCloseTo(2, 10);
143
- expect(Math.min(...xs)).toBeCloseTo(-2, 10);
144
- });
145
- test('returns empty for a footprintless kind', () => {
146
- registerNode(plainDef('wall'));
147
- expect(movingFootprintAnchors(node({ id: 'w', type: 'wall', position: [0, 0, 0] }), 1, 1)).toEqual([]);
148
- });
149
- });
150
- describe('movingAlignmentAnchors', () => {
151
- beforeEach(() => nodeRegistry._reset());
152
- test('relocates a straight stair by its segment-chain footprint', () => {
153
- registerNode(stairDef());
154
- const nodes = {
155
- st: node({
156
- id: 'st',
157
- type: 'stair',
158
- position: [0, 0, 0],
159
- rotation: 0,
160
- stairType: 'straight',
161
- width: 1,
162
- children: ['seg'],
163
- }),
164
- seg: node({
165
- id: 'seg',
166
- type: 'stair-segment',
167
- parentId: 'st',
168
- width: 1,
169
- length: 3,
170
- height: 2.5,
171
- attachmentSide: 'front',
172
- }),
173
- };
174
- const anchors = movingAlignmentAnchors(nodes.st, nodes, 10, 20, 0);
175
- expect(anchors).toHaveLength(4);
176
- expect(new Set(anchors.map((a) => a.x))).toEqual(new Set([9.5, 10.5]));
177
- expect(new Set(anchors.map((a) => a.z))).toEqual(new Set([20, 23]));
178
- });
179
- test('rotation override drives a moving straight stair footprint', () => {
180
- registerNode(stairDef());
181
- const nodes = {
182
- st: node({
183
- id: 'st',
184
- type: 'stair',
185
- position: [0, 0, 0],
186
- rotation: 0,
187
- stairType: 'straight',
188
- width: 1,
189
- children: ['seg'],
190
- }),
191
- seg: node({
192
- id: 'seg',
193
- type: 'stair-segment',
194
- parentId: 'st',
195
- width: 1,
196
- length: 3,
197
- height: 2.5,
198
- attachmentSide: 'front',
199
- }),
200
- };
201
- const anchors = movingAlignmentAnchors(nodes.st, nodes, 10, 20, Math.PI / 2);
202
- const xs = anchors.map((a) => a.x);
203
- const zs = anchors.map((a) => a.z);
204
- expect(Math.min(...xs)).toBeCloseTo(10, 10);
205
- expect(Math.max(...xs)).toBeCloseTo(13, 10);
206
- expect(Math.min(...zs)).toBeCloseTo(19.5, 10);
207
- expect(Math.max(...zs)).toBeCloseTo(20.5, 10);
208
- });
209
- });
210
- describe('wallSegmentAnchors', () => {
211
- test('returns both endpoints as corners and the chord midpoint as center', () => {
212
- const anchors = wallSegmentAnchors('w', [0, 0], [4, 2]);
213
- expect(anchors).toEqual([
214
- { nodeId: 'w', kind: 'corner', x: 0, z: 0 },
215
- { nodeId: 'w', kind: 'corner', x: 4, z: 2 },
216
- { nodeId: 'w', kind: 'center', x: 2, z: 1 },
217
- ]);
218
- });
219
- test('adds ±thickness/2 face corners on each endpoint when thickness is given', () => {
220
- // Horizontal wall along +X: perpendicular is ±Z, so faces sit at z = ±0.1.
221
- const anchors = wallSegmentAnchors('w', [0, 0], [4, 0], 0.2);
222
- expect(anchors).toEqual([
223
- { nodeId: 'w', kind: 'corner', x: 0, z: 0 },
224
- { nodeId: 'w', kind: 'corner', x: 4, z: 0 },
225
- { nodeId: 'w', kind: 'center', x: 2, z: 0 },
226
- { nodeId: 'w', kind: 'corner', x: 0, z: 0.1 },
227
- { nodeId: 'w', kind: 'corner', x: 0, z: -0.1 },
228
- { nodeId: 'w', kind: 'corner', x: 4, z: 0.1 },
229
- { nodeId: 'w', kind: 'corner', x: 4, z: -0.1 },
230
- ]);
231
- });
232
- test('skips face corners for zero/degenerate input', () => {
233
- expect(wallSegmentAnchors('w', [0, 0], [4, 0], 0)).toHaveLength(3);
234
- expect(wallSegmentAnchors('w', [1, 1], [1, 1], 0.2)).toHaveLength(3);
235
- });
236
- });
237
- describe('polygonAnchors', () => {
238
- test('returns each vertex as a corner anchor', () => {
239
- expect(polygonAnchors('s', [
240
- [0, 0],
241
- [2, 0],
242
- [2, 3],
243
- ])).toEqual([
244
- { nodeId: 's', kind: 'corner', x: 0, z: 0 },
245
- { nodeId: 's', kind: 'corner', x: 2, z: 0 },
246
- { nodeId: 's', kind: 'corner', x: 2, z: 3 },
247
- ]);
248
- });
249
- });
250
- describe('collectAlignmentAnchors', () => {
251
- beforeEach(() => nodeRegistry._reset());
252
- test('unions footprint corners, segment anchors and polygon vertices, excluding the moving node', () => {
253
- registerNode(floorPlacedDef('box'));
254
- const nodes = {
255
- moving: node({ id: 'moving', type: 'box', position: [0, 0, 0], dimensions: [1, 1, 1] }),
256
- box: node({ id: 'box', type: 'box', position: [5, 0, 5], dimensions: [2, 1, 2] }),
257
- wall: node({ id: 'wall', type: 'wall', start: [0, 0], end: [4, 0] }),
258
- slab: node({
259
- id: 'slab',
260
- type: 'slab',
261
- polygon: [
262
- [0, 0],
263
- [2, 0],
264
- [2, 2],
265
- ],
266
- }),
267
- };
268
- const anchors = collectAlignmentAnchors(nodes, 'moving');
269
- const ids = anchors.map((a) => a.nodeId);
270
- expect(ids).not.toContain('moving');
271
- expect(ids.filter((id) => id === 'box')).toHaveLength(4); // corner anchors
272
- expect(ids.filter((id) => id === 'wall')).toHaveLength(7); // endpoints + midpoint + 4 face corners
273
- expect(ids.filter((id) => id === 'slab')).toHaveLength(3); // polygon vertices
274
- });
275
- test('levelId filter keeps only nodes resolving to that level (incl. nested)', () => {
276
- registerNode(floorPlacedDef('box'));
277
- registerNode(elevatorDef());
278
- const nodes = {
279
- b: node({ id: 'b', type: 'building' }),
280
- L1: node({ id: 'L1', type: 'level', parentId: 'b' }),
281
- L2: node({ id: 'L2', type: 'level', parentId: 'b' }),
282
- moving: node({ id: 'moving', type: 'box', parentId: 'L1', position: [0, 0, 0] }),
283
- sameFloor: node({ id: 'sameFloor', type: 'box', parentId: 'L1', position: [5, 0, 5] }),
284
- // Item resting on `sameFloor` — resolves to L1 through the parent chain.
285
- nested: node({ id: 'nested', type: 'box', parentId: 'sameFloor', position: [5, 0, 5] }),
286
- otherFloor: node({ id: 'otherFloor', type: 'box', parentId: 'L2', position: [5, 0, 5] }),
287
- // Building-scoped (parented to the building, no level ancestor) — spans
288
- // every floor, so it stays in the pool regardless of the active level.
289
- elevator: node({
290
- id: 'elevator',
291
- type: 'elevator',
292
- parentId: 'b',
293
- position: [9, 0, 9],
294
- width: 1.6,
295
- depth: 1.6,
296
- }),
297
- };
298
- const ids = collectAlignmentAnchors(nodes, 'moving', 'L1').map((a) => a.nodeId);
299
- expect(ids.filter((id) => id === 'sameFloor')).toHaveLength(4);
300
- expect(ids.filter((id) => id === 'nested')).toHaveLength(4);
301
- expect(ids.filter((id) => id === 'elevator')).toHaveLength(4);
302
- expect(ids).not.toContain('otherFloor');
303
- });
304
- test('straight stair contributes its segment-chain footprint corners', () => {
305
- registerNode(stairDef());
306
- const nodes = {
307
- st: node({
308
- id: 'st',
309
- type: 'stair',
310
- position: [0, 0, 0],
311
- rotation: 0,
312
- stairType: 'straight',
313
- width: 1,
314
- children: ['seg'],
315
- }),
316
- // Single 1×3 flight; origin at the run start, extending +Z by length.
317
- seg: node({
318
- id: 'seg',
319
- type: 'stair-segment',
320
- parentId: 'st',
321
- width: 1,
322
- length: 3,
323
- height: 2.5,
324
- attachmentSide: 'front',
325
- }),
326
- };
327
- const anchors = collectAlignmentAnchors(nodes, '').filter((a) => a.nodeId === 'st');
328
- expect(anchors).toHaveLength(4);
329
- expect(anchors.every((a) => a.kind === 'corner')).toBe(true);
330
- expect(new Set(anchors.map((a) => a.x))).toEqual(new Set([-0.5, 0.5]));
331
- expect(new Set(anchors.map((a) => a.z))).toEqual(new Set([0, 3]));
332
- });
333
- test('curved stair contributes its sector bounding-box corners', () => {
334
- registerNode(stairDef());
335
- const nodes = {
336
- cs: node({
337
- id: 'cs',
338
- type: 'stair',
339
- position: [0, 0, 0],
340
- rotation: 0,
341
- stairType: 'curved',
342
- width: 1,
343
- innerRadius: 1,
344
- sweepAngle: Math.PI / 2,
345
- }),
346
- };
347
- const anchors = collectAlignmentAnchors(nodes, '').filter((a) => a.nodeId === 'cs');
348
- expect(anchors).toHaveLength(4);
349
- // outerRadius = inner(1) + width(1) = 2, sweep π/2 centred on +X. Outer rim
350
- // reaches X=2 at the bisector; min X is the inner rim's ±π/4 ends (cos45·1);
351
- // Z spans ±(outer·sin45).
352
- const xs = anchors.map((a) => a.x);
353
- const zs = anchors.map((a) => a.z);
354
- expect(Math.max(...xs)).toBeCloseTo(2, 5);
355
- expect(Math.min(...xs)).toBeCloseTo(Math.SQRT1_2, 5);
356
- expect(Math.max(...zs)).toBeCloseTo(Math.SQRT2, 5);
357
- expect(Math.min(...zs)).toBeCloseTo(-Math.SQRT2, 5);
358
- });
359
- test('spiral stair contributes a full-circle bounding box', () => {
360
- registerNode(stairDef());
361
- const nodes = {
362
- sp: node({
363
- id: 'sp',
364
- type: 'stair',
365
- position: [5, 0, 5],
366
- rotation: 0,
367
- stairType: 'spiral',
368
- width: 1,
369
- innerRadius: 0.5,
370
- sweepAngle: Math.PI * 2,
371
- }),
372
- };
373
- const anchors = collectAlignmentAnchors(nodes, '').filter((a) => a.nodeId === 'sp');
374
- expect(anchors).toHaveLength(4);
375
- // outerRadius = inner(0.5) + width(1) = 1.5, a full revolution about (5, 5).
376
- const xs = anchors.map((a) => a.x);
377
- const zs = anchors.map((a) => a.z);
378
- expect(Math.max(...xs)).toBeCloseTo(6.5, 2);
379
- expect(Math.min(...xs)).toBeCloseTo(3.5, 2);
380
- expect(Math.max(...zs)).toBeCloseTo(6.5, 2);
381
- expect(Math.min(...zs)).toBeCloseTo(3.5, 2);
382
- });
383
- });
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=alignment.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"alignment.test.d.ts","sourceRoot":"","sources":["../../src/services/alignment.test.ts"],"names":[],"mappings":""}
@@ -1,92 +0,0 @@
1
- import { describe, expect, test } from 'bun:test';
2
- import { bboxAnchors, resolveAlignment } from './alignment';
3
- function center(nodeId, x, z) {
4
- return { nodeId, kind: 'center', x, z };
5
- }
6
- function corner(nodeId, x, z) {
7
- return { nodeId, kind: 'corner', x, z };
8
- }
9
- describe('resolveAlignment', () => {
10
- test('returns empty when no candidates within threshold', () => {
11
- const result = resolveAlignment({
12
- moving: [center('m', 0, 0)],
13
- candidates: [center('a', 1, 1)],
14
- threshold: 0.5,
15
- });
16
- expect(result.guides).toEqual([]);
17
- expect(result.snap).toBeNull();
18
- });
19
- test('snaps moving anchor onto candidate X when within threshold', () => {
20
- const result = resolveAlignment({
21
- moving: [center('m', 0.03, 5)],
22
- candidates: [center('a', 0, 2)],
23
- threshold: 0.1,
24
- });
25
- expect(result.snap).toEqual({ dx: -0.03, dz: 0 });
26
- expect(result.guides).toHaveLength(1);
27
- expect(result.guides[0].axis).toBe('x');
28
- expect(result.guides[0].coord).toBe(0);
29
- expect(result.guides[0].from.z).toBe(2);
30
- expect(result.guides[0].to.z).toBe(5);
31
- });
32
- test('snaps both axes when both match', () => {
33
- const result = resolveAlignment({
34
- moving: [center('m', 0.03, 0.04)],
35
- candidates: [center('a', 0, 0)],
36
- threshold: 0.1,
37
- });
38
- expect(result.snap).toEqual({ dx: -0.03, dz: -0.04 });
39
- expect(result.guides).toHaveLength(2);
40
- });
41
- test('picks closest candidate per axis', () => {
42
- const result = resolveAlignment({
43
- moving: [center('m', 0.08, 0)],
44
- candidates: [center('a', 0, 5), center('b', 0.1, 5), center('c', 0.05, 10)],
45
- threshold: 0.1,
46
- });
47
- // |0.1 - 0.08| = 0.02 wins over |0.05 - 0.08| = 0.03 and |0 - 0.08| = 0.08
48
- expect(result.snap?.dx).toBeCloseTo(0.02, 10);
49
- expect(result.guides[0].candidateNodeId).toBe('b');
50
- });
51
- test('ties on the matched axis break toward the nearest perpendicular anchor', () => {
52
- const result = resolveAlignment({
53
- moving: [corner('m', 0.02, 4)],
54
- candidates: [corner('far', 0, 0), corner('near', 0, 5)],
55
- threshold: 0.1,
56
- });
57
- // Both share X (Δx = 0.02); 'near' (z=5) is closer to the moving z=4 than
58
- // 'far' (z=0), so the guide connects to the nearest real anchor.
59
- expect(result.guides[0].candidateNodeId).toBe('near');
60
- });
61
- test('threshold = 0 disables alignment', () => {
62
- const result = resolveAlignment({
63
- moving: [center('m', 0, 0)],
64
- candidates: [center('a', 0, 0)],
65
- threshold: 0,
66
- });
67
- expect(result.guides).toEqual([]);
68
- expect(result.snap).toBeNull();
69
- });
70
- test('distance is the perpendicular gap to the matched axis', () => {
71
- const result = resolveAlignment({
72
- moving: [center('m', 0.02, 3)],
73
- candidates: [center('a', 0, 0)],
74
- threshold: 0.1,
75
- });
76
- // After snap: moving at (0, 3). X guide runs along x=0 from z=0 to z=3.
77
- expect(result.guides[0].distance).toBeCloseTo(3, 10);
78
- });
79
- });
80
- describe('bboxAnchors', () => {
81
- test('returns 9 anchors with correct kinds and positions', () => {
82
- const anchors = bboxAnchors('node', 0, 0, 2, 4);
83
- expect(anchors).toHaveLength(9);
84
- const corners = anchors.filter((a) => a.kind === 'corner');
85
- const edges = anchors.filter((a) => a.kind === 'edge-mid');
86
- const centers = anchors.filter((a) => a.kind === 'center');
87
- expect(corners).toHaveLength(4);
88
- expect(edges).toHaveLength(4);
89
- expect(centers).toHaveLength(1);
90
- expect(centers[0]).toEqual({ nodeId: 'node', kind: 'center', x: 1, z: 2 });
91
- });
92
- });
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=drag-session.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"drag-session.test.d.ts","sourceRoot":"","sources":["../../src/services/drag-session.test.ts"],"names":[],"mappings":""}