@motionscript/core 0.1.0-alpha.0 → 0.1.0-alpha.5

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 (767) hide show
  1. package/CHANGELOG.md +282 -0
  2. package/LICENSE +201 -201
  3. package/NOTICE +48 -0
  4. package/README.md +93 -72
  5. package/dist/assets/asset-index.js.map +1 -1
  6. package/dist/assets/catalog.d.ts +9 -0
  7. package/dist/assets/catalog.d.ts.map +1 -1
  8. package/dist/assets/catalog.js +11 -0
  9. package/dist/assets/catalog.js.map +1 -1
  10. package/dist/assets/errors.d.ts.map +1 -1
  11. package/dist/assets/errors.js +8 -3
  12. package/dist/assets/errors.js.map +1 -1
  13. package/dist/assets/index.js.map +1 -1
  14. package/dist/assets/manager.d.ts +26 -1
  15. package/dist/assets/manager.d.ts.map +1 -1
  16. package/dist/assets/manager.js +93 -11
  17. package/dist/assets/manager.js.map +1 -1
  18. package/dist/assets/manifest.js.map +1 -1
  19. package/dist/assets/record.js.map +1 -1
  20. package/dist/assets/scope.d.ts +3 -3
  21. package/dist/assets/scope.d.ts.map +1 -1
  22. package/dist/assets/scope.js.map +1 -1
  23. package/dist/attributes/audio/filters/chain.d.ts +1 -1
  24. package/dist/attributes/audio/filters/chain.js.map +1 -1
  25. package/dist/attributes/audio/filters/curve.d.ts +8 -8
  26. package/dist/attributes/audio/filters/curve.d.ts.map +1 -1
  27. package/dist/attributes/audio/filters/curve.js +20 -19
  28. package/dist/attributes/audio/filters/curve.js.map +1 -1
  29. package/dist/attributes/audio/filters/implementations/echo.js.map +1 -1
  30. package/dist/attributes/audio/filters/implementations/gain.js.map +1 -1
  31. package/dist/attributes/audio/filters/implementations/highpass.js.map +1 -1
  32. package/dist/attributes/audio/filters/implementations/lowpass.js.map +1 -1
  33. package/dist/attributes/audio/filters/implementations/speed.d.ts +2 -2
  34. package/dist/attributes/audio/filters/implementations/speed.js.map +1 -1
  35. package/dist/attributes/audio/filters/implementations/tremolo.js.map +1 -1
  36. package/dist/attributes/audio/filters/index.d.ts +1 -1
  37. package/dist/attributes/audio/filters/index.d.ts.map +1 -1
  38. package/dist/attributes/audio/filters/index.js +1 -1
  39. package/dist/attributes/audio/filters/index.js.map +1 -1
  40. package/dist/attributes/audio/filters/registry.js.map +1 -1
  41. package/dist/attributes/audio/filters/union.js.map +1 -1
  42. package/dist/attributes/audio/request.d.ts +32 -4
  43. package/dist/attributes/audio/request.d.ts.map +1 -1
  44. package/dist/attributes/audio/request.js +9 -1
  45. package/dist/attributes/audio/request.js.map +1 -1
  46. package/dist/attributes/audio/schedule.d.ts +11 -2
  47. package/dist/attributes/audio/schedule.d.ts.map +1 -1
  48. package/dist/attributes/audio/schedule.js +15 -8
  49. package/dist/attributes/audio/schedule.js.map +1 -1
  50. package/dist/attributes/audio/sound.d.ts +4 -2
  51. package/dist/attributes/audio/sound.d.ts.map +1 -1
  52. package/dist/attributes/audio/sound.js +8 -4
  53. package/dist/attributes/audio/sound.js.map +1 -1
  54. package/dist/attributes/index.d.ts +1 -0
  55. package/dist/attributes/index.d.ts.map +1 -1
  56. package/dist/attributes/index.js +1 -0
  57. package/dist/attributes/index.js.map +1 -1
  58. package/dist/attributes/layout/alignment.js +1 -1
  59. package/dist/attributes/layout/alignment.js.map +1 -1
  60. package/dist/attributes/layout/index.js.map +1 -1
  61. package/dist/attributes/layout/insets.js.map +1 -1
  62. package/dist/attributes/layout/matrix2d.js.map +1 -1
  63. package/dist/attributes/layout/size.js.map +1 -1
  64. package/dist/attributes/layout/transform3d.js.map +1 -1
  65. package/dist/attributes/layout/vector2.js.map +1 -1
  66. package/dist/attributes/layout/world-transform.js.map +1 -1
  67. package/dist/attributes/mask/boolean.js.map +1 -1
  68. package/dist/attributes/mask/mask.js.map +1 -1
  69. package/dist/attributes/properties/decorator.d.ts +17 -6
  70. package/dist/attributes/properties/decorator.d.ts.map +1 -1
  71. package/dist/attributes/properties/decorator.js +26 -14
  72. package/dist/attributes/properties/decorator.js.map +1 -1
  73. package/dist/attributes/properties/inputs.js.map +1 -1
  74. package/dist/attributes/properties/typed.d.ts +9 -2
  75. package/dist/attributes/properties/typed.d.ts.map +1 -1
  76. package/dist/attributes/properties/typed.js +15 -1
  77. package/dist/attributes/properties/typed.js.map +1 -1
  78. package/dist/attributes/render3d/orbit.d.ts +8 -8
  79. package/dist/attributes/render3d/orbit.js +7 -7
  80. package/dist/attributes/render3d/orbit.js.map +1 -1
  81. package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
  82. package/dist/attributes/shape/corners/corner-style.js.map +1 -1
  83. package/dist/attributes/shape/corners/corners.js.map +1 -1
  84. package/dist/attributes/shape/corners/index.js.map +1 -1
  85. package/dist/attributes/shape/effects/backdrop.d.ts +4 -4
  86. package/dist/attributes/shape/effects/backdrop.d.ts.map +1 -1
  87. package/dist/attributes/shape/effects/backdrop.js.map +1 -1
  88. package/dist/attributes/shape/effects/chain.d.ts +28 -120
  89. package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
  90. package/dist/attributes/shape/effects/chain.js +16 -88
  91. package/dist/attributes/shape/effects/chain.js.map +1 -1
  92. package/dist/attributes/shape/effects/effect-data.js.map +1 -1
  93. package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
  94. package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
  95. package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
  96. package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
  97. package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
  98. package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
  99. package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
  100. package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +2 -2
  101. package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
  102. package/dist/attributes/shape/effects/implementations/curves.d.ts +1 -1
  103. package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
  104. package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
  105. package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
  106. package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
  107. package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
  108. package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
  109. package/dist/attributes/shape/effects/implementations/glass.d.ts +15 -24
  110. package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
  111. package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
  112. package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
  113. package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
  114. package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
  115. package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
  116. package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
  117. package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
  118. package/dist/attributes/shape/effects/implementations/lut.d.ts +1 -1
  119. package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
  120. package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
  121. package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
  122. package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
  123. package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
  124. package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
  125. package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
  126. package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
  127. package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
  128. package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
  129. package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
  130. package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
  131. package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
  132. package/dist/attributes/shape/effects/implementations/shader.js +15 -8
  133. package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
  134. package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
  135. package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
  136. package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
  137. package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
  138. package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
  139. package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
  140. package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
  141. package/dist/attributes/shape/effects/index.d.ts +2 -6
  142. package/dist/attributes/shape/effects/index.d.ts.map +1 -1
  143. package/dist/attributes/shape/effects/index.js.map +1 -1
  144. package/dist/attributes/shape/effects/registry.d.ts +23 -6
  145. package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
  146. package/dist/attributes/shape/effects/registry.js +44 -10
  147. package/dist/attributes/shape/effects/registry.js.map +1 -1
  148. package/dist/attributes/shape/effects/union.d.ts +2 -6
  149. package/dist/attributes/shape/effects/union.d.ts.map +1 -1
  150. package/dist/attributes/shape/effects/union.js.map +1 -1
  151. package/dist/attributes/shape/fill/blend.js.map +1 -1
  152. package/dist/attributes/shape/fill/chain.js.map +1 -1
  153. package/dist/attributes/shape/fill/coerce.js.map +1 -1
  154. package/dist/attributes/shape/fill/color/constants.js.map +1 -1
  155. package/dist/attributes/shape/fill/color/parser.d.ts.map +1 -1
  156. package/dist/attributes/shape/fill/color/parser.js +81 -44
  157. package/dist/attributes/shape/fill/color/parser.js.map +1 -1
  158. package/dist/attributes/shape/fill/gradient-stops.d.ts +16 -0
  159. package/dist/attributes/shape/fill/gradient-stops.d.ts.map +1 -0
  160. package/dist/attributes/shape/fill/gradient-stops.js +65 -0
  161. package/dist/attributes/shape/fill/gradient-stops.js.map +1 -0
  162. package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
  163. package/dist/attributes/shape/fill/implementations/color.js.map +1 -1
  164. package/dist/attributes/shape/fill/implementations/conic-gradient.d.ts.map +1 -1
  165. package/dist/attributes/shape/fill/implementations/conic-gradient.js +2 -5
  166. package/dist/attributes/shape/fill/implementations/conic-gradient.js.map +1 -1
  167. package/dist/attributes/shape/fill/implementations/dot-grid.js.map +1 -1
  168. package/dist/attributes/shape/fill/implementations/fractal-noise.d.ts.map +1 -1
  169. package/dist/attributes/shape/fill/implementations/fractal-noise.js +2 -10
  170. package/dist/attributes/shape/fill/implementations/fractal-noise.js.map +1 -1
  171. package/dist/attributes/shape/fill/implementations/grid.js.map +1 -1
  172. package/dist/attributes/shape/fill/implementations/image.d.ts.map +1 -1
  173. package/dist/attributes/shape/fill/implementations/image.js +5 -4
  174. package/dist/attributes/shape/fill/implementations/image.js.map +1 -1
  175. package/dist/attributes/shape/fill/implementations/linear-gradient.d.ts.map +1 -1
  176. package/dist/attributes/shape/fill/implementations/linear-gradient.js +2 -6
  177. package/dist/attributes/shape/fill/implementations/linear-gradient.js.map +1 -1
  178. package/dist/attributes/shape/fill/implementations/noise.js.map +1 -1
  179. package/dist/attributes/shape/fill/implementations/radial-gradient.d.ts.map +1 -1
  180. package/dist/attributes/shape/fill/implementations/radial-gradient.js +2 -5
  181. package/dist/attributes/shape/fill/implementations/radial-gradient.js.map +1 -1
  182. package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
  183. package/dist/attributes/shape/fill/implementations/stripe.js.map +1 -1
  184. package/dist/attributes/shape/fill/implementations/video.js +1 -1
  185. package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
  186. package/dist/attributes/shape/fill/index.js.map +1 -1
  187. package/dist/attributes/shape/fill/lerp.d.ts +9 -1
  188. package/dist/attributes/shape/fill/lerp.d.ts.map +1 -1
  189. package/dist/attributes/shape/fill/lerp.js +12 -1
  190. package/dist/attributes/shape/fill/lerp.js.map +1 -1
  191. package/dist/attributes/shape/fill/media-preset.js.map +1 -1
  192. package/dist/attributes/shape/fill/registry.js.map +1 -1
  193. package/dist/attributes/shape/fill/union.js.map +1 -1
  194. package/dist/attributes/shape/filters/chain.d.ts +4 -10
  195. package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
  196. package/dist/attributes/shape/filters/chain.js +1 -13
  197. package/dist/attributes/shape/filters/chain.js.map +1 -1
  198. package/dist/attributes/shape/filters/implementations/alpha.js.map +1 -1
  199. package/dist/attributes/shape/filters/implementations/blur.js.map +1 -1
  200. package/dist/attributes/shape/filters/implementations/color-adjustment.js.map +1 -1
  201. package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
  202. package/dist/attributes/shape/filters/implementations/curves.js.map +1 -1
  203. package/dist/attributes/shape/filters/implementations/echo.js.map +1 -1
  204. package/dist/attributes/shape/filters/implementations/exposure.js.map +1 -1
  205. package/dist/attributes/shape/filters/implementations/grayscale.js.map +1 -1
  206. package/dist/attributes/shape/filters/implementations/posterize-time.js.map +1 -1
  207. package/dist/attributes/shape/filters/index.d.ts +1 -1
  208. package/dist/attributes/shape/filters/index.js.map +1 -1
  209. package/dist/attributes/shape/filters/registry.d.ts +2 -2
  210. package/dist/attributes/shape/filters/registry.js +3 -3
  211. package/dist/attributes/shape/filters/registry.js.map +1 -1
  212. package/dist/attributes/shape/filters/union.d.ts +6 -7
  213. package/dist/attributes/shape/filters/union.d.ts.map +1 -1
  214. package/dist/attributes/shape/filters/union.js.map +1 -1
  215. package/dist/attributes/shape/path/anchors.d.ts.map +1 -1
  216. package/dist/attributes/shape/path/anchors.js +12 -5
  217. package/dist/attributes/shape/path/anchors.js.map +1 -1
  218. package/dist/attributes/shape/path/bezier.js.map +1 -1
  219. package/dist/attributes/shape/path/index.js.map +1 -1
  220. package/dist/attributes/shape/path/measure.js.map +1 -1
  221. package/dist/attributes/shape/path/morph.d.ts.map +1 -1
  222. package/dist/attributes/shape/path/morph.js +16 -4
  223. package/dist/attributes/shape/path/morph.js.map +1 -1
  224. package/dist/attributes/shape/path/ops.js.map +1 -1
  225. package/dist/attributes/shape/path/types.js.map +1 -1
  226. package/dist/attributes/shape/path/walk.js.map +1 -1
  227. package/dist/attributes/shape/shaders/index.js.map +1 -1
  228. package/dist/attributes/shape/shaders/pack.js.map +1 -1
  229. package/dist/attributes/shape/shaders/resolve.js.map +1 -1
  230. package/dist/attributes/shape/shadow/index.js.map +1 -1
  231. package/dist/attributes/shape/shadow/shadow.js.map +1 -1
  232. package/dist/attributes/shape/stroke/index.d.ts +2 -2
  233. package/dist/attributes/shape/stroke/index.d.ts.map +1 -1
  234. package/dist/attributes/shape/stroke/index.js +1 -1
  235. package/dist/attributes/shape/stroke/index.js.map +1 -1
  236. package/dist/attributes/shape/stroke/stroke.d.ts +27 -6
  237. package/dist/attributes/shape/stroke/stroke.d.ts.map +1 -1
  238. package/dist/attributes/shape/stroke/stroke.js +22 -2
  239. package/dist/attributes/shape/stroke/stroke.js.map +1 -1
  240. package/dist/attributes/shared/operators.js.map +1 -1
  241. package/dist/attributes/text/index.js.map +1 -1
  242. package/dist/attributes/text/ops.d.ts +6 -0
  243. package/dist/attributes/text/ops.d.ts.map +1 -1
  244. package/dist/attributes/text/ops.js +1 -0
  245. package/dist/attributes/text/ops.js.map +1 -1
  246. package/dist/attributes/text/types.js.map +1 -1
  247. package/dist/browser/chunks/chunk-FUZVFT3W.js +18 -0
  248. package/dist/browser/chunks/chunk-FUZVFT3W.js.map +7 -0
  249. package/dist/browser/chunks/chunk-QG6C23IJ.js +3 -0
  250. package/dist/browser/chunks/chunk-QG6C23IJ.js.map +7 -0
  251. package/dist/browser/chunks/chunk-SFNJRPBV.js +2 -0
  252. package/dist/browser/chunks/chunk-SFNJRPBV.js.map +7 -0
  253. package/dist/browser/component.js +1 -1
  254. package/dist/browser/component.js.map +3 -3
  255. package/dist/browser/index.js +1 -1
  256. package/dist/browser/index.js.map +4 -4
  257. package/dist/browser/jsx-jsx-dev-runtime.js +1 -1
  258. package/dist/browser/jsx-jsx-runtime.js +1 -1
  259. package/dist/browser/manifest.json +3 -2
  260. package/dist/browser/sdk.js +1 -1
  261. package/dist/component.js.map +1 -1
  262. package/dist/document/audio.d.ts +1 -1
  263. package/dist/document/audio.js +4 -4
  264. package/dist/document/audio.js.map +1 -1
  265. package/dist/document/builtins.d.ts.map +1 -1
  266. package/dist/document/builtins.js +8 -14
  267. package/dist/document/builtins.js.map +1 -1
  268. package/dist/document/command-traits.d.ts +1 -1
  269. package/dist/document/command-traits.d.ts.map +1 -1
  270. package/dist/document/command-traits.js +17 -3
  271. package/dist/document/command-traits.js.map +1 -1
  272. package/dist/document/deny-globals.js.map +1 -1
  273. package/dist/document/diff.js.map +1 -1
  274. package/dist/document/doc-index.d.ts +2 -2
  275. package/dist/document/doc-index.d.ts.map +1 -1
  276. package/dist/document/doc-index.js.map +1 -1
  277. package/dist/document/expression/compile.d.ts.map +1 -1
  278. package/dist/document/expression/compile.js +8 -5
  279. package/dist/document/expression/compile.js.map +1 -1
  280. package/dist/document/expression/index.js.map +1 -1
  281. package/dist/document/expression/ops.js +1 -1
  282. package/dist/document/expression/ops.js.map +1 -1
  283. package/dist/document/expression/parse.d.ts.map +1 -1
  284. package/dist/document/expression/parse.js +15 -6
  285. package/dist/document/expression/parse.js.map +1 -1
  286. package/dist/document/expression/refs.d.ts +1 -1
  287. package/dist/document/expression/refs.js +1 -1
  288. package/dist/document/expression/refs.js.map +1 -1
  289. package/dist/document/expression/types.js.map +1 -1
  290. package/dist/document/expression/walk.d.ts.map +1 -1
  291. package/dist/document/expression/walk.js +2 -1
  292. package/dist/document/expression/walk.js.map +1 -1
  293. package/dist/document/index.d.ts +2 -0
  294. package/dist/document/index.d.ts.map +1 -1
  295. package/dist/document/index.js +2 -0
  296. package/dist/document/index.js.map +1 -1
  297. package/dist/document/node-decorator.js.map +1 -1
  298. package/dist/document/node-descriptor.d.ts +19 -0
  299. package/dist/document/node-descriptor.d.ts.map +1 -1
  300. package/dist/document/node-descriptor.js.map +1 -1
  301. package/dist/document/placement.d.ts +70 -0
  302. package/dist/document/placement.d.ts.map +1 -0
  303. package/dist/document/placement.js +83 -0
  304. package/dist/document/placement.js.map +1 -0
  305. package/dist/document/project.d.ts +2 -2
  306. package/dist/document/project.d.ts.map +1 -1
  307. package/dist/document/project.js.map +1 -1
  308. package/dist/document/registry.d.ts +34 -16
  309. package/dist/document/registry.d.ts.map +1 -1
  310. package/dist/document/registry.js +51 -12
  311. package/dist/document/registry.js.map +1 -1
  312. package/dist/document/timeline-patch.js.map +1 -1
  313. package/dist/document/timeline.d.ts +73 -18
  314. package/dist/document/timeline.d.ts.map +1 -1
  315. package/dist/document/timeline.js +192 -40
  316. package/dist/document/timeline.js.map +1 -1
  317. package/dist/document/types.d.ts +12 -12
  318. package/dist/document/types.d.ts.map +1 -1
  319. package/dist/document/types.js +2 -2
  320. package/dist/document/types.js.map +1 -1
  321. package/dist/document/validate.d.ts +2 -2
  322. package/dist/document/validate.d.ts.map +1 -1
  323. package/dist/document/validate.js +37 -31
  324. package/dist/document/validate.js.map +1 -1
  325. package/dist/document/withdraw.d.ts +28 -0
  326. package/dist/document/withdraw.d.ts.map +1 -0
  327. package/dist/document/withdraw.js +61 -0
  328. package/dist/document/withdraw.js.map +1 -0
  329. package/dist/index.d.ts +1 -0
  330. package/dist/index.d.ts.map +1 -1
  331. package/dist/index.js +1 -0
  332. package/dist/index.js.map +1 -1
  333. package/dist/jsx/jsx-dev-runtime.js.map +1 -1
  334. package/dist/jsx/jsx-runtime.d.ts +9 -1
  335. package/dist/jsx/jsx-runtime.d.ts.map +1 -1
  336. package/dist/jsx/jsx-runtime.js +13 -3
  337. package/dist/jsx/jsx-runtime.js.map +1 -1
  338. package/dist/layout/bounds.d.ts +0 -1
  339. package/dist/layout/bounds.d.ts.map +1 -1
  340. package/dist/layout/bounds.js.map +1 -1
  341. package/dist/layout/constraints.js.map +1 -1
  342. package/dist/layout/flex.d.ts +4 -2
  343. package/dist/layout/flex.d.ts.map +1 -1
  344. package/dist/layout/flex.js +27 -11
  345. package/dist/layout/flex.js.map +1 -1
  346. package/dist/layout/freeform.js.map +1 -1
  347. package/dist/layout/grid.js.map +1 -1
  348. package/dist/layout/index.js.map +1 -1
  349. package/dist/layout/item.js.map +1 -1
  350. package/dist/layout/ops.d.ts +6 -0
  351. package/dist/layout/ops.d.ts.map +1 -1
  352. package/dist/layout/ops.js +6 -0
  353. package/dist/layout/ops.js.map +1 -1
  354. package/dist/layout/types.js.map +1 -1
  355. package/dist/nodes/2d/node-lifecycle.js.map +1 -1
  356. package/dist/nodes/2d/node-motion.js.map +1 -1
  357. package/dist/nodes/2d/node-render.d.ts +3 -3
  358. package/dist/nodes/2d/node-render.d.ts.map +1 -1
  359. package/dist/nodes/2d/node-render.js.map +1 -1
  360. package/dist/nodes/2d/node-transform.js.map +1 -1
  361. package/dist/nodes/2d/node2d.d.ts +115 -3
  362. package/dist/nodes/2d/node2d.d.ts.map +1 -1
  363. package/dist/nodes/2d/node2d.js +188 -32
  364. package/dist/nodes/2d/node2d.js.map +1 -1
  365. package/dist/nodes/2d/paint-node.d.ts +27 -0
  366. package/dist/nodes/2d/paint-node.d.ts.map +1 -1
  367. package/dist/nodes/2d/paint-node.js +42 -0
  368. package/dist/nodes/2d/paint-node.js.map +1 -1
  369. package/dist/nodes/audio/audio-bus.js.map +1 -1
  370. package/dist/nodes/audio/index.js.map +1 -1
  371. package/dist/nodes/audio/node-audio.d.ts +3 -2
  372. package/dist/nodes/audio/node-audio.d.ts.map +1 -1
  373. package/dist/nodes/audio/node-audio.js +8 -5
  374. package/dist/nodes/audio/node-audio.js.map +1 -1
  375. package/dist/nodes/audio/sound-node.d.ts +2 -2
  376. package/dist/nodes/audio/sound-node.d.ts.map +1 -1
  377. package/dist/nodes/audio/sound-node.js +2 -2
  378. package/dist/nodes/audio/sound-node.js.map +1 -1
  379. package/dist/nodes/geometry/bounds-shape-node.d.ts +4 -4
  380. package/dist/nodes/geometry/bounds-shape-node.js +2 -2
  381. package/dist/nodes/geometry/bounds-shape-node.js.map +1 -1
  382. package/dist/nodes/geometry/box-path-node.d.ts +3 -3
  383. package/dist/nodes/geometry/box-path-node.js +2 -2
  384. package/dist/nodes/geometry/box-path-node.js.map +1 -1
  385. package/dist/nodes/geometry/ellipse-node.js.map +1 -1
  386. package/dist/nodes/geometry/group-bounds.d.ts +2 -2
  387. package/dist/nodes/geometry/group-bounds.d.ts.map +1 -1
  388. package/dist/nodes/geometry/group-bounds.js +1 -2
  389. package/dist/nodes/geometry/group-bounds.js.map +1 -1
  390. package/dist/nodes/geometry/path-node.d.ts.map +1 -1
  391. package/dist/nodes/geometry/path-node.js +6 -0
  392. package/dist/nodes/geometry/path-node.js.map +1 -1
  393. package/dist/nodes/geometry/polygon-node.js.map +1 -1
  394. package/dist/nodes/geometry/polygram-node.js.map +1 -1
  395. package/dist/nodes/geometry/rect-node.js.map +1 -1
  396. package/dist/nodes/geometry/shape-node.js.map +1 -1
  397. package/dist/nodes/geometry/shape-outline.d.ts +2 -2
  398. package/dist/nodes/geometry/shape-outline.d.ts.map +1 -1
  399. package/dist/nodes/geometry/shape-outline.js +2 -13
  400. package/dist/nodes/geometry/shape-outline.js.map +1 -1
  401. package/dist/nodes/index.d.ts +3 -8
  402. package/dist/nodes/index.d.ts.map +1 -1
  403. package/dist/nodes/index.js +3 -8
  404. package/dist/nodes/index.js.map +1 -1
  405. package/dist/nodes/layout/camera-node.d.ts +9 -0
  406. package/dist/nodes/layout/camera-node.d.ts.map +1 -1
  407. package/dist/nodes/layout/camera-node.js +38 -3
  408. package/dist/nodes/layout/camera-node.js.map +1 -1
  409. package/dist/nodes/layout/orbit-camera-node.d.ts +1 -1
  410. package/dist/nodes/layout/orbit-camera-node.js +1 -1
  411. package/dist/nodes/layout/orbit-camera-node.js.map +1 -1
  412. package/dist/nodes/layout/rotated-box.js.map +1 -1
  413. package/dist/nodes/media/video-node.d.ts.map +1 -1
  414. package/dist/nodes/media/video-node.js +5 -3
  415. package/dist/nodes/media/video-node.js.map +1 -1
  416. package/dist/nodes/node/declare-paints.js.map +1 -1
  417. package/dist/nodes/node/node-editor-state.js.map +1 -1
  418. package/dist/nodes/node/node-reactive.js.map +1 -1
  419. package/dist/nodes/node/node-time.d.ts +3 -3
  420. package/dist/nodes/node/node-time.d.ts.map +1 -1
  421. package/dist/nodes/node/node-time.js +1 -1
  422. package/dist/nodes/node/node-time.js.map +1 -1
  423. package/dist/nodes/node/node-walk.js.map +1 -1
  424. package/dist/nodes/node/node.d.ts +5 -3
  425. package/dist/nodes/node/node.d.ts.map +1 -1
  426. package/dist/nodes/node/node.js +44 -19
  427. package/dist/nodes/node/node.js.map +1 -1
  428. package/dist/nodes/node/text-defaults.d.ts +10 -12
  429. package/dist/nodes/node/text-defaults.d.ts.map +1 -1
  430. package/dist/nodes/node/text-defaults.js +10 -12
  431. package/dist/nodes/node/text-defaults.js.map +1 -1
  432. package/dist/nodes/{scene → root}/canvas2d-node.d.ts +2 -2
  433. package/dist/nodes/root/canvas2d-node.d.ts.map +1 -0
  434. package/dist/nodes/{scene → root}/canvas2d-node.js +2 -2
  435. package/dist/nodes/root/canvas2d-node.js.map +1 -0
  436. package/dist/nodes/root/provider-node.d.ts.map +1 -0
  437. package/dist/nodes/root/provider-node.js.map +1 -0
  438. package/dist/nodes/root/theme-provider-node.d.ts.map +1 -0
  439. package/dist/nodes/root/theme-provider-node.js.map +1 -0
  440. package/dist/nodes/text/default-text-style-node.d.ts +5 -2
  441. package/dist/nodes/text/default-text-style-node.d.ts.map +1 -1
  442. package/dist/nodes/text/default-text-style-node.js +10 -4
  443. package/dist/nodes/text/default-text-style-node.js.map +1 -1
  444. package/dist/nodes/text/number-format.d.ts +1 -1
  445. package/dist/nodes/text/number-format.js +1 -1
  446. package/dist/nodes/text/number-format.js.map +1 -1
  447. package/dist/nodes/text/number-node.js.map +1 -1
  448. package/dist/nodes/text/number-pattern.js.map +1 -1
  449. package/dist/nodes/text/richtext-node.js +1 -1
  450. package/dist/nodes/text/richtext-node.js.map +1 -1
  451. package/dist/nodes/text/text-base.d.ts.map +1 -1
  452. package/dist/nodes/text/text-base.js +1 -1
  453. package/dist/nodes/text/text-base.js.map +1 -1
  454. package/dist/nodes/text/text-node.js.map +1 -1
  455. package/dist/nodes/text/text-selection.js.map +1 -1
  456. package/dist/nodes/three/camera-nodes.d.ts +21 -3
  457. package/dist/nodes/three/camera-nodes.d.ts.map +1 -1
  458. package/dist/nodes/three/camera-nodes.js +42 -1
  459. package/dist/nodes/three/camera-nodes.js.map +1 -1
  460. package/dist/nodes/three/canvas3d-node.d.ts +29 -6
  461. package/dist/nodes/three/canvas3d-node.d.ts.map +1 -1
  462. package/dist/nodes/three/canvas3d-node.js +44 -2
  463. package/dist/nodes/three/canvas3d-node.js.map +1 -1
  464. package/dist/nodes/three/drawable-nodes.d.ts +25 -11
  465. package/dist/nodes/three/drawable-nodes.d.ts.map +1 -1
  466. package/dist/nodes/three/drawable-nodes.js +43 -13
  467. package/dist/nodes/three/drawable-nodes.js.map +1 -1
  468. package/dist/nodes/three/environment-nodes.d.ts +9 -3
  469. package/dist/nodes/three/environment-nodes.d.ts.map +1 -1
  470. package/dist/nodes/three/environment-nodes.js.map +1 -1
  471. package/dist/nodes/three/geometry-nodes.d.ts +2 -2
  472. package/dist/nodes/three/geometry-nodes.js +2 -2
  473. package/dist/nodes/three/geometry-nodes.js.map +1 -1
  474. package/dist/nodes/three/grid-geometry3d.js.map +1 -1
  475. package/dist/nodes/three/group3d.js.map +1 -1
  476. package/dist/nodes/three/light-nodes.d.ts.map +1 -1
  477. package/dist/nodes/three/light-nodes.js +3 -3
  478. package/dist/nodes/three/light-nodes.js.map +1 -1
  479. package/dist/nodes/three/mesh3d.js.map +1 -1
  480. package/dist/nodes/three/node3d.d.ts +48 -0
  481. package/dist/nodes/three/node3d.d.ts.map +1 -1
  482. package/dist/nodes/three/node3d.js +53 -3
  483. package/dist/nodes/three/node3d.js.map +1 -1
  484. package/dist/platform/audio-sink.d.ts +2 -2
  485. package/dist/platform/audio-sink.d.ts.map +1 -1
  486. package/dist/platform/audio-sink.js.map +1 -1
  487. package/dist/platform/exporter.d.ts +13 -8
  488. package/dist/platform/exporter.d.ts.map +1 -1
  489. package/dist/platform/exporter.js.map +1 -1
  490. package/dist/platform/index.d.ts +1 -1
  491. package/dist/platform/index.d.ts.map +1 -1
  492. package/dist/platform/index.js.map +1 -1
  493. package/dist/platform/stepped-clock.js.map +1 -1
  494. package/dist/platform/storage-adapter.d.ts +12 -6
  495. package/dist/platform/storage-adapter.d.ts.map +1 -1
  496. package/dist/platform/storage-adapter.js +4 -0
  497. package/dist/platform/storage-adapter.js.map +1 -1
  498. package/dist/platform/ticker.d.ts +6 -0
  499. package/dist/platform/ticker.d.ts.map +1 -1
  500. package/dist/platform/ticker.js +6 -0
  501. package/dist/platform/ticker.js.map +1 -1
  502. package/dist/project/config.js.map +1 -1
  503. package/dist/project/index.js.map +1 -1
  504. package/dist/project/tree.d.ts +3 -3
  505. package/dist/project/tree.d.ts.map +1 -1
  506. package/dist/project/tree.js.map +1 -1
  507. package/dist/props/host.js.map +1 -1
  508. package/dist/props/index.js.map +1 -1
  509. package/dist/props/observer.js.map +1 -1
  510. package/dist/props/slot.js.map +1 -1
  511. package/dist/renamed-scene-names.d.ts +17 -0
  512. package/dist/renamed-scene-names.d.ts.map +1 -0
  513. package/dist/renamed-scene-names.js +9 -0
  514. package/dist/renamed-scene-names.js.map +1 -0
  515. package/dist/render/canvas-render-context2d.d.ts +10 -3
  516. package/dist/render/canvas-render-context2d.d.ts.map +1 -1
  517. package/dist/render/canvas-render-context2d.js +10 -0
  518. package/dist/render/canvas-render-context2d.js.map +1 -1
  519. package/dist/render/clip-contains.js.map +1 -1
  520. package/dist/render/clip.js.map +1 -1
  521. package/dist/render/descriptors/ellipse.js.map +1 -1
  522. package/dist/render/descriptors/latex.js.map +1 -1
  523. package/dist/render/descriptors/line.js.map +1 -1
  524. package/dist/render/descriptors/path-builder.js.map +1 -1
  525. package/dist/render/descriptors/path.js.map +1 -1
  526. package/dist/render/descriptors/polygon.js.map +1 -1
  527. package/dist/render/descriptors/polygram.js.map +1 -1
  528. package/dist/render/descriptors/rect.js.map +1 -1
  529. package/dist/render/descriptors/richtext.js.map +1 -1
  530. package/dist/render/descriptors/shape.d.ts +12 -0
  531. package/dist/render/descriptors/shape.d.ts.map +1 -1
  532. package/dist/render/descriptors/shape.js.map +1 -1
  533. package/dist/render/descriptors/text.d.ts +2 -2
  534. package/dist/render/descriptors/text.js +2 -2
  535. package/dist/render/descriptors/text.js.map +1 -1
  536. package/dist/render/descriptors/transform.d.ts +2 -2
  537. package/dist/render/descriptors/transform.d.ts.map +1 -1
  538. package/dist/render/descriptors/transform.js.map +1 -1
  539. package/dist/render/graphics2d.d.ts +3 -3
  540. package/dist/render/graphics2d.d.ts.map +1 -1
  541. package/dist/render/graphics2d.js +1 -1
  542. package/dist/render/graphics2d.js.map +1 -1
  543. package/dist/render/index.js.map +1 -1
  544. package/dist/render/measure-context.js.map +1 -1
  545. package/dist/render/null-render-context.js.map +1 -1
  546. package/dist/render/render-context2d.d.ts +5 -5
  547. package/dist/render/render-context2d.d.ts.map +1 -1
  548. package/dist/render/render-context2d.js.map +1 -1
  549. package/dist/render/surface.js.map +1 -1
  550. package/dist/render/text-defaults.js.map +1 -1
  551. package/dist/render/text-layout.js.map +1 -1
  552. package/dist/render3d/bounds3d.d.ts.map +1 -1
  553. package/dist/render3d/bounds3d.js +4 -2
  554. package/dist/render3d/bounds3d.js.map +1 -1
  555. package/dist/render3d/builders.js.map +1 -1
  556. package/dist/render3d/camera.d.ts +6 -0
  557. package/dist/render3d/camera.d.ts.map +1 -1
  558. package/dist/render3d/camera.js +5 -3
  559. package/dist/render3d/camera.js.map +1 -1
  560. package/dist/render3d/fill3d.d.ts +2 -9
  561. package/dist/render3d/fill3d.d.ts.map +1 -1
  562. package/dist/render3d/fill3d.js +2 -13
  563. package/dist/render3d/fill3d.js.map +1 -1
  564. package/dist/render3d/geometry.d.ts +8 -1
  565. package/dist/render3d/geometry.d.ts.map +1 -1
  566. package/dist/render3d/geometry.js.map +1 -1
  567. package/dist/render3d/graphics3d.d.ts +8 -4
  568. package/dist/render3d/graphics3d.d.ts.map +1 -1
  569. package/dist/render3d/graphics3d.js +18 -10
  570. package/dist/render3d/graphics3d.js.map +1 -1
  571. package/dist/render3d/index.d.ts +1 -1
  572. package/dist/render3d/index.js +1 -1
  573. package/dist/render3d/index.js.map +1 -1
  574. package/dist/render3d/inert.d.ts +14 -0
  575. package/dist/render3d/inert.d.ts.map +1 -0
  576. package/dist/render3d/inert.js +62 -0
  577. package/dist/render3d/inert.js.map +1 -0
  578. package/dist/render3d/light.js.map +1 -1
  579. package/dist/render3d/material.d.ts +10 -5
  580. package/dist/render3d/material.d.ts.map +1 -1
  581. package/dist/render3d/material.js.map +1 -1
  582. package/dist/render3d/matrix4.js.map +1 -1
  583. package/dist/render3d/render-context3d.js.map +1 -1
  584. package/dist/render3d/resources.d.ts +2 -2
  585. package/dist/render3d/resources.js +2 -2
  586. package/dist/render3d/resources.js.map +1 -1
  587. package/dist/render3d/rounded-box.js.map +1 -1
  588. package/dist/render3d/scene-settings.d.ts +23 -4
  589. package/dist/render3d/scene-settings.d.ts.map +1 -1
  590. package/dist/render3d/scene-settings.js.map +1 -1
  591. package/dist/render3d/scene3d.d.ts +11 -0
  592. package/dist/render3d/scene3d.d.ts.map +1 -1
  593. package/dist/render3d/scene3d.js +39 -6
  594. package/dist/render3d/scene3d.js.map +1 -1
  595. package/dist/render3d/segments.js.map +1 -1
  596. package/dist/render3d/texture.d.ts +9 -0
  597. package/dist/render3d/texture.d.ts.map +1 -1
  598. package/dist/render3d/texture.js +13 -0
  599. package/dist/render3d/texture.js.map +1 -1
  600. package/dist/render3d/tracking.js.map +1 -1
  601. package/dist/render3d/transform.d.ts +1 -1
  602. package/dist/render3d/transform.js.map +1 -1
  603. package/dist/render3d/vector3.d.ts +18 -1
  604. package/dist/render3d/vector3.d.ts.map +1 -1
  605. package/dist/render3d/vector3.js +27 -0
  606. package/dist/render3d/vector3.js.map +1 -1
  607. package/dist/render3d/walk.d.ts +1 -1
  608. package/dist/render3d/walk.d.ts.map +1 -1
  609. package/dist/render3d/walk.js +5 -1
  610. package/dist/render3d/walk.js.map +1 -1
  611. package/dist/runtime/asset-refine.js.map +1 -1
  612. package/dist/runtime/asset-timeline.js.map +1 -1
  613. package/dist/runtime/asset-update.js.map +1 -1
  614. package/dist/runtime/audio-index.d.ts +2 -2
  615. package/dist/runtime/audio-index.d.ts.map +1 -1
  616. package/dist/runtime/audio-index.js +8 -2
  617. package/dist/runtime/audio-index.js.map +1 -1
  618. package/dist/runtime/builtin-context.js.map +1 -1
  619. package/dist/runtime/clip-instance.d.ts +5 -3
  620. package/dist/runtime/clip-instance.d.ts.map +1 -1
  621. package/dist/runtime/clip-instance.js +10 -6
  622. package/dist/runtime/clip-instance.js.map +1 -1
  623. package/dist/runtime/clip-store.d.ts +9 -0
  624. package/dist/runtime/clip-store.d.ts.map +1 -1
  625. package/dist/runtime/clip-store.js +33 -3
  626. package/dist/runtime/clip-store.js.map +1 -1
  627. package/dist/runtime/engine.d.ts +5 -0
  628. package/dist/runtime/engine.d.ts.map +1 -1
  629. package/dist/runtime/engine.js +2 -0
  630. package/dist/runtime/engine.js.map +1 -1
  631. package/dist/runtime/frame-time.d.ts +31 -0
  632. package/dist/runtime/frame-time.d.ts.map +1 -0
  633. package/dist/runtime/frame-time.js +29 -0
  634. package/dist/runtime/frame-time.js.map +1 -0
  635. package/dist/runtime/index.d.ts +1 -0
  636. package/dist/runtime/index.d.ts.map +1 -1
  637. package/dist/runtime/index.js +1 -0
  638. package/dist/runtime/index.js.map +1 -1
  639. package/dist/runtime/node-picking.d.ts +44 -3
  640. package/dist/runtime/node-picking.d.ts.map +1 -1
  641. package/dist/runtime/node-picking.js +118 -3
  642. package/dist/runtime/node-picking.js.map +1 -1
  643. package/dist/runtime/node-picking3d.d.ts +2 -1
  644. package/dist/runtime/node-picking3d.d.ts.map +1 -1
  645. package/dist/runtime/node-picking3d.js +5 -2
  646. package/dist/runtime/node-picking3d.js.map +1 -1
  647. package/dist/runtime/placement.d.ts.map +1 -1
  648. package/dist/runtime/placement.js +4 -5
  649. package/dist/runtime/placement.js.map +1 -1
  650. package/dist/runtime/playback-controller.d.ts +31 -2
  651. package/dist/runtime/playback-controller.d.ts.map +1 -1
  652. package/dist/runtime/playback-controller.js +63 -6
  653. package/dist/runtime/playback-controller.js.map +1 -1
  654. package/dist/runtime/playback.js.map +1 -1
  655. package/dist/runtime/precompisition.js.map +1 -1
  656. package/dist/runtime/project-assets.js.map +1 -1
  657. package/dist/runtime/session.d.ts +9 -7
  658. package/dist/runtime/session.d.ts.map +1 -1
  659. package/dist/runtime/session.js +12 -4
  660. package/dist/runtime/session.js.map +1 -1
  661. package/dist/runtime/settle.js.map +1 -1
  662. package/dist/runtime/state-evaluator.d.ts +1 -1
  663. package/dist/runtime/state-evaluator.d.ts.map +1 -1
  664. package/dist/runtime/state-evaluator.js +4 -3
  665. package/dist/runtime/state-evaluator.js.map +1 -1
  666. package/dist/runtime/text-geometry.js.map +1 -1
  667. package/dist/sdk/index.d.ts +27 -22
  668. package/dist/sdk/index.d.ts.map +1 -1
  669. package/dist/sdk/index.js +23 -9
  670. package/dist/sdk/index.js.map +1 -1
  671. package/dist/tween/command-decorator.d.ts +12 -4
  672. package/dist/tween/command-decorator.d.ts.map +1 -1
  673. package/dist/tween/command-decorator.js +10 -22
  674. package/dist/tween/command-decorator.js.map +1 -1
  675. package/dist/tween/command.js.map +1 -1
  676. package/dist/tween/ease/constants.d.ts.map +1 -1
  677. package/dist/tween/ease/constants.js +8 -5
  678. package/dist/tween/ease/constants.js.map +1 -1
  679. package/dist/tween/ease/curve.d.ts.map +1 -1
  680. package/dist/tween/ease/curve.js +4 -3
  681. package/dist/tween/ease/curve.js.map +1 -1
  682. package/dist/tween/ease/describe.d.ts +15 -0
  683. package/dist/tween/ease/describe.d.ts.map +1 -0
  684. package/dist/tween/ease/describe.js +37 -0
  685. package/dist/tween/ease/describe.js.map +1 -0
  686. package/dist/tween/ease/type.js.map +1 -1
  687. package/dist/tween/index.js.map +1 -1
  688. package/dist/tween/inert.js.map +1 -1
  689. package/dist/tween/lerp.js.map +1 -1
  690. package/dist/tween/loop.js.map +1 -1
  691. package/dist/tween/prepare.d.ts +3 -3
  692. package/dist/tween/prepare.js +3 -3
  693. package/dist/tween/prepare.js.map +1 -1
  694. package/dist/tween/seekable.d.ts +12 -1
  695. package/dist/tween/seekable.d.ts.map +1 -1
  696. package/dist/tween/seekable.js +15 -0
  697. package/dist/tween/seekable.js.map +1 -1
  698. package/dist/tween/stepper.js.map +1 -1
  699. package/dist/tween/to-command.js.map +1 -1
  700. package/dist/util/clamp.js.map +1 -1
  701. package/dist/util/context.js.map +1 -1
  702. package/dist/util/csv.js.map +1 -1
  703. package/dist/util/generateList.js.map +1 -1
  704. package/dist/util/index.js.map +1 -1
  705. package/dist/util/metrics.d.ts +1 -1
  706. package/dist/util/metrics.js +1 -1
  707. package/dist/util/metrics.js.map +1 -1
  708. package/dist/util/random.js.map +1 -1
  709. package/dist/util/reference.js.map +1 -1
  710. package/dist/util/scheduler.js.map +1 -1
  711. package/package.json +2 -1
  712. package/dist/attributes/shape/effects/implementations/displace.d.ts +0 -48
  713. package/dist/attributes/shape/effects/implementations/displace.d.ts.map +0 -1
  714. package/dist/attributes/shape/effects/implementations/displace.js +0 -30
  715. package/dist/attributes/shape/effects/implementations/displace.js.map +0 -1
  716. package/dist/attributes/shape/effects/implementations/god-rays.d.ts +0 -28
  717. package/dist/attributes/shape/effects/implementations/god-rays.d.ts.map +0 -1
  718. package/dist/attributes/shape/effects/implementations/god-rays.js +0 -26
  719. package/dist/attributes/shape/effects/implementations/god-rays.js.map +0 -1
  720. package/dist/attributes/shape/effects/implementations/texture.d.ts +0 -28
  721. package/dist/attributes/shape/effects/implementations/texture.d.ts.map +0 -1
  722. package/dist/attributes/shape/effects/implementations/texture.js +0 -25
  723. package/dist/attributes/shape/effects/implementations/texture.js.map +0 -1
  724. package/dist/attributes/shape/effects/implementations/trails.d.ts +0 -41
  725. package/dist/attributes/shape/effects/implementations/trails.d.ts.map +0 -1
  726. package/dist/attributes/shape/effects/implementations/trails.js +0 -22
  727. package/dist/attributes/shape/effects/implementations/trails.js.map +0 -1
  728. package/dist/browser/chunks/chunk-2T3HXSC2.js +0 -2
  729. package/dist/browser/chunks/chunk-2T3HXSC2.js.map +0 -7
  730. package/dist/browser/chunks/chunk-P3XQCHDW.js +0 -16
  731. package/dist/browser/chunks/chunk-P3XQCHDW.js.map +0 -7
  732. package/dist/browser/chunks/chunk-VJQMKHGQ.js +0 -3
  733. package/dist/browser/chunks/chunk-VJQMKHGQ.js.map +0 -7
  734. package/dist/nodes/geometry/dot-grid-node.d.ts +0 -105
  735. package/dist/nodes/geometry/dot-grid-node.d.ts.map +0 -1
  736. package/dist/nodes/geometry/dot-grid-node.js +0 -142
  737. package/dist/nodes/geometry/dot-grid-node.js.map +0 -1
  738. package/dist/nodes/geometry/grid-lines.d.ts +0 -101
  739. package/dist/nodes/geometry/grid-lines.d.ts.map +0 -1
  740. package/dist/nodes/geometry/grid-lines.js +0 -128
  741. package/dist/nodes/geometry/grid-lines.js.map +0 -1
  742. package/dist/nodes/geometry/grid-pattern-node.d.ts +0 -58
  743. package/dist/nodes/geometry/grid-pattern-node.d.ts.map +0 -1
  744. package/dist/nodes/geometry/grid-pattern-node.js +0 -172
  745. package/dist/nodes/geometry/grid-pattern-node.js.map +0 -1
  746. package/dist/nodes/geometry/line-grid-node.d.ts +0 -62
  747. package/dist/nodes/geometry/line-grid-node.d.ts.map +0 -1
  748. package/dist/nodes/geometry/line-grid-node.js +0 -127
  749. package/dist/nodes/geometry/line-grid-node.js.map +0 -1
  750. package/dist/nodes/geometry/line-node.d.ts +0 -58
  751. package/dist/nodes/geometry/line-node.d.ts.map +0 -1
  752. package/dist/nodes/geometry/line-node.js +0 -123
  753. package/dist/nodes/geometry/line-node.js.map +0 -1
  754. package/dist/nodes/geometry/viewport-pattern-node.d.ts +0 -39
  755. package/dist/nodes/geometry/viewport-pattern-node.d.ts.map +0 -1
  756. package/dist/nodes/geometry/viewport-pattern-node.js +0 -79
  757. package/dist/nodes/geometry/viewport-pattern-node.js.map +0 -1
  758. package/dist/nodes/scene/canvas2d-node.d.ts.map +0 -1
  759. package/dist/nodes/scene/canvas2d-node.js.map +0 -1
  760. package/dist/nodes/scene/provider-node.d.ts.map +0 -1
  761. package/dist/nodes/scene/provider-node.js.map +0 -1
  762. package/dist/nodes/scene/theme-provider-node.d.ts.map +0 -1
  763. package/dist/nodes/scene/theme-provider-node.js.map +0 -1
  764. /package/dist/nodes/{scene → root}/provider-node.d.ts +0 -0
  765. /package/dist/nodes/{scene → root}/provider-node.js +0 -0
  766. /package/dist/nodes/{scene → root}/theme-provider-node.d.ts +0 -0
  767. /package/dist/nodes/{scene → root}/theme-provider-node.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"node-picking3d.js","sourceRoot":"","sources":["../../src/runtime/node-picking3d.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG9C,OAAO,EAAE,YAAY,EAAE,MAAM,EAAiB,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,sBAAsB,EAAqB,MAAM,mBAAmB,CAAC;AAG9E,OAAO,EACH,gBAAgB,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,GACrE,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACH,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,aAAa,EAC3E,YAAY,EAAE,gBAAgB,EAAE,YAAY,GAC/C,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAgE1C;;;;;;;;;;;;GAYG;AACH,gBAAgB;AAChB,MAAM,UAAU,cAAc,CAAC,MAAgB,EAAE,KAAoB,EAAE,IAAY;IAC/E,MAAM,UAAU,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC9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AC,CAAC,EAAE,CAAC,CAAC;QACnD,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/B,CAAC,CAAC;IACF,OAAO;QACH,EAAE,EAAE,IAAI,CAAC,EAAE;QACX,IAAI;QACJ,IAAI,EAAE,IAAI,CAAC,SAAS;QACpB,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC;QACjC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC;QAClC,WAAW,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC;QACrC,UAAU,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC;QACpC,MAAM,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACpE,KAAK,EAAE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI;QAC5B,MAAM,EAAE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI;QAC7B,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,QAAQ;QAC5B,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK;QACtB,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,OAAO;QAC1B,0EAA0E;QAC1E,4EAA4E;QAC5E,MAAM,EAAE,IAAI,CAAC,MAAM;KACtB,CAAC;AACN,CAAC","sourcesContent":["import { Node } from \"@/nodes/node/node\";\nimport { Node3D } from \"@/nodes/three/node3d\";\nimport { Canvas3D } from \"@/nodes/three/canvas3d-node\";\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\nimport { applyToPoint, invert, type Matrix2D } from \"@/attributes/layout/matrix2d\";\nimport { resolveCameraPlacement, type CameraData3D } from \"@/render3d/camera\";\nimport type { Scene3D, Scene3DOp } from \"@/render3d/scene3d\";\nimport type { Transform3D } from \"@/render3d/transform\";\nimport {\n geometryBounds3D, transformBox3, unionBox3, centeredBox3, corners3, type Box3,\n} from \"@/render3d/bounds3d\";\nimport {\n applyMatrix4, identity4, invert4, lookAtRotation4, multiply4, orthographic4,\n perspective4, transformMatrix4, translation4, type Matrix4,\n} from \"@/render3d/matrix4\";\nimport type { Vector3 } from \"@/render3d/vector3\";\nimport { nodePath } from \"@/project/tree\";\nimport type { NodeBox } from \"./node-picking\";\n\n/**\n * Where a `Node3D`'s pixels landed — the 3D half of `node-picking.ts`, and the\n * reason an editor can put a selection box round a cube at all.\n *\n * **The answer is a 2D box, deliberately.** A mesh has no rectangle in it: what\n * it has is an extent in three dimensions, seen through a camera. So this\n * projects the node's world-space AABB into the `Canvas3D`'s own plane and takes\n * the **screen-space AABB of the result** — the box that encloses the shape as\n * drawn, from wherever the camera happens to be. That is the same box every 3D\n * editor draws for the same reason: an oriented box in 3D read as a hexagon on\n * screen, and nothing you could grab on it would mean anything in two\n * dimensions.\n *\n * Because it is a 2D box in the canvas's plane, it composes with everything the\n * 2D side already does — the canvas's own rotation, its ancestors', a camera\n * scope above it — by being handed the canvas's `renderMatrix` and mapped\n * through it exactly as {@link nodeBox} maps a node's corners. Nothing here has\n * to know what is above the canvas.\n *\n * **Two walks, joined on the node id.** Bounds come from the recorded\n * {@link Scene3D} rather than from the node tree, because the scene is the seam\n * everything else goes through (the render and the asset pass both build it) and\n * a node that draws through a custom `renderSelf` is measured correctly for\n * free. Paths come from the tree, because a path is a child *index* and ops\n * don't carry one. The two meet on `Node3D.id`, which the scene records as the\n * `key` on every `push`.\n *\n * **Nothing here imports `node-picking.ts` at runtime.** The canvas's own box\n * and CTM arrive as a {@link Canvas3DFrame} parameter instead, so the dependency\n * runs one way — the 2D walk reaches into this file and never the reverse. The\n * `NodeBox` import is type-only and erased.\n *\n * Two things a caller should know about what it gets back. A box is **not\n * clipped to the viewport**: a mesh that has drifted off the side of its canvas\n * reports where it went, even though the 3D pass is confined to the rect and no\n * pixels of it are drawn. That is the honest answer for an overlay saying where\n * a node is, and it costs the picker nothing — {@link pickIn} only consults this\n * file for a point already inside the rect.\n *\n * And the cost: every entry point here records the scene afresh, so a pick or a\n * box walk pays one `buildScene3D()` per viewport it touches. That is the same\n * pass the render and the asset declaration each make every frame, and 3D scene\n * trees are small, so it is fine at pointer rate — but a host calling\n * {@link collectBoxes} on every pointer move over a document full of viewports\n * is paying it per viewport per move.\n */\n\n/** What the 2D walk already knows about the canvas, handed down. */\n/** @internal */\nexport interface Canvas3DFrame {\n /**\n * The canvas's own box. Its folded `rotation`/`scale`/`opacity` carry to\n * every 3D node inside it — a mesh has none of its own, and what an editor\n * needs those for (cursor angles, pixels-per-unit) is a question about the\n * plane the box is drawn in.\n */\n box: NodeBox;\n /** `renderMatrix(canvas)` — the canvas's CTM, canvas y-down. */\n matrix: Matrix2D;\n}\n\n/**\n * Every 3D node's box inside `canvas`, **nearest camera first**.\n *\n * Depth order rather than draw order, which is the one place this diverges from\n * {@link collectBoxes}: a 3D scene has no draw order to speak of (the renderer\n * sorts by depth and the depth buffer settles the rest), so \"topmost\" means\n * \"nearest\", and a picker walking this list front-to-back gets the node you can\n * actually see.\n *\n * Empty when the scene has no camera that resolves, when the canvas has no size,\n * or when nothing in it can be measured — see {@link geometryBounds3D} for the\n * last of those.\n */\n/** @internal */\nexport function collectBoxes3D(canvas: Canvas3D, frame: Canvas3DFrame, path: string): NodeBox[] {\n const projection = canvas3DProjection(canvas);\n if (!projection) return [];\n\n const out: { box: NodeBox; depth: number }[] = [];\n for (const entry of nodes3DOf(canvas, path)) {\n const world = projection.boxes.get(entry.node.id);\n if (!world) continue;\n const projected = projectBox3(world, projection);\n if (!projected) continue;\n out.push({\n box: toNodeBox(entry.node, entry.path, projected.rect, frame),\n depth: projected.depth,\n });\n }\n // View space looks down −Z, so a nearer node has the larger (less negative)\n // z — descending puts the front of the scene first.\n out.sort((a, b) => b.depth - a.depth);\n return out.map((entry) => entry.box);\n}\n\n/**\n * Where a handful of arbitrary points around one `Node3D` land on screen — the\n * ingredient a box can't supply for a gizmo.\n *\n * `origin`, `parentPoints` and `localPoints` all come back in the **same\n * viewport space** {@link NodeBox} does, so a caller drawing both together\n * (a box for the outline, this for the handles) never has two coordinate\n * systems to reconcile. A `null` entry means that point sits behind the\n * camera — mirrors {@link projectBox3}'s own eye-plane guard, just per point\n * instead of per clipped edge, since there's no box to keep in shape here.\n *\n * Not `@internal`, unlike {@link projectNode3D} itself: this is what a host\n * gets back from `projectNode3DAt`/`PlaybackController.projectNode3D`, the\n * same public tier as {@link NodeBox}.\n */\nexport interface Node3DFrame {\n /** The node's own position, projected — a gizmo's pivot. */\n origin: Vector2 | null;\n /**\n * `parentPoints` transformed by the node's **parent's** world matrix, then\n * projected. The frame `Node3DProps.position` is itself expressed in, so\n * this is the space a move or scale handle belongs in: a point named\n * `{ ...position, x: position.x + 1 }` projects to where nudging `x` by\n * one unit would actually land, with no need to know whether \"one unit\"\n * means local or world space at the point of asking.\n */\n parentPoints: (Vector2 | null)[];\n /**\n * `localPoints` transformed by the node's **own** world matrix, then\n * projected. For geometry that has to track the node's current\n * orientation — a rotation ring wrapping the mesh as it's actually\n * turned, not as it started.\n */\n localPoints: (Vector2 | null)[];\n}\n\nconst ORIGIN_3D: Vector3 = { x: 0, y: 0, z: 0 };\n\n/**\n * Project `parentPoints`/`localPoints` for the `Node3D` at `targetPath`\n * inside `canvas`, or `null` when the canvas has no projection (see\n * {@link canvas3DProjection}) or the path doesn't resolve to a node in it.\n *\n * `canvasPath` is the canvas's own structural path — the same root\n * {@link collectBoxes3D} and {@link pickNode3D} are handed — and `targetPath`\n * the node being projected, found the same way {@link nodeBoxAt} finds one\n * (`node-picking.ts`, one level up).\n */\n/** @internal */\nexport function projectNode3D(\n canvas: Canvas3D,\n frame: Canvas3DFrame,\n canvasPath: string,\n targetPath: string,\n parentPoints: readonly Vector3[],\n localPoints: readonly Vector3[],\n): Node3DFrame | null {\n const projection = canvas3DProjection(canvas);\n if (!projection) return null;\n\n const entry = nodes3DOf(canvas, canvasPath).find((e) => e.path === targetPath);\n if (!entry) return null;\n\n const own = projection.matrices.get(entry.node.id);\n const parent = projection.parentMatrices.get(entry.node.id);\n if (!own || !parent) return null;\n\n const project = (matrix: Matrix4, points: readonly Vector3[]): (Vector2 | null)[] =>\n points.map((point) => projectPoint3(matrix, point, projection, frame));\n\n return {\n origin: projectPoint3(own, ORIGIN_3D, projection, frame),\n parentPoints: project(parent, parentPoints),\n localPoints: project(own, localPoints),\n };\n}\n\n/**\n * `point` (in whatever space `matrix` maps to world space) projected into\n * `frame`'s viewport space, or `null` when it lands behind the camera.\n *\n * The single-point sibling of {@link projectBox3}: no edges to clip, so a\n * point either has a clip-space `w` in front of the eye or it doesn't.\n */\nfunction projectPoint3(\n matrix: Matrix4,\n point: Vector3,\n projection: Canvas3DProjection,\n frame: Canvas3DFrame,\n): Vector2 | null {\n const world = applyMatrix4(matrix, point);\n const clip = applyMatrix4(projection.clip, { x: world.x, y: world.y, z: world.z });\n if (clip.w <= MIN_CLIP_W) return null;\n\n const ndcX = clip.x / clip.w;\n const ndcY = clip.y / clip.w;\n const rectX = projection.centerX + ndcX * (projection.width / 2);\n const rectY = projection.centerY + ndcY * (projection.height / 2);\n\n const p = applyToPoint(frame.matrix, { x: rectX, y: -rectY });\n return { x: p.x, y: -p.y };\n}\n\n/**\n * The nearest 3D node in `canvas` whose box contains `point` (viewport space,\n * y-up), or `null`.\n *\n * The box, not the mesh — the module note says why there is no mesh-accurate\n * answer to give. `tolerance` is grab-slop in scene units, applied in the\n * canvas's own plane so it stays the constant on-screen distance the caller\n * quoted it as.\n */\n/** @internal */\nexport function pickNode3D(\n canvas: Canvas3D,\n frame: Canvas3DFrame,\n point: Vector2,\n tolerance: number,\n path: string,\n): NodeBox | null {\n const projection = canvas3DProjection(canvas);\n if (!projection) return null;\n\n // Into the canvas's own plane, undoing everything above it in one step —\n // the same inverse `containsPoint` takes, with the same y-flips in and out.\n const inverse = invert(frame.matrix);\n if (!inverse) return null;\n const mapped = applyToPoint(inverse, { x: point.x, y: -point.y });\n const local = { x: mapped.x, y: -mapped.y };\n\n let best: { node: Node3D; path: string; rect: Rect2D } | null = null;\n let bestDepth = -Infinity;\n for (const entry of nodes3DOf(canvas, path)) {\n const world = projection.boxes.get(entry.node.id);\n if (!world) continue;\n const projected = projectBox3(world, projection);\n if (!projected) continue;\n if (!rectContains(projected.rect, local, tolerance)) continue;\n if (projected.depth <= bestDepth) continue;\n bestDepth = projected.depth;\n best = { node: entry.node, path: entry.path, rect: projected.rect };\n }\n return best ? toNodeBox(best.node, best.path, best.rect, frame) : null;\n}\n\n// ─── The tree walk: which node is at which path ──────────────────────────────\n\ninterface Node3DEntry {\n node: Node3D;\n path: string;\n}\n\n/**\n * Every `Node3D` under `canvas`, with the structural path it sits at.\n *\n * Indexed against {@link Node._allChildren} rather than `children`, so a mesh\n * and a HUD label under the same viewport are numbered the way the author wrote\n * them — see the accessor's own note for what goes wrong otherwise.\n */\nfunction nodes3DOf(canvas: Canvas3D, path: string): Node3DEntry[] {\n const out: Node3DEntry[] = [];\n walk3D(canvas._allChildren, path, out);\n return out;\n}\n\nfunction walk3D(children: readonly Node[], parentPath: string, out: Node3DEntry[]): void {\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n if (!(child instanceof Node3D)) continue;\n const path = nodePath(parentPath, i);\n out.push({ node: child, path });\n walk3D(child._allChildren, path, out);\n }\n}\n\n// ─── The op walk: how big each node is, and where it is looked at from ───────\n\n/** Everything the projection needs, resolved once per call. */\ninterface Canvas3DProjection {\n /** World-space bounds per `Node3D.id`, each including its subtree. */\n boxes: Map<string, Box3>;\n /** Each node's own world matrix, per `Node3D.id` — see {@link Node3DFrame}. */\n matrices: Map<string, Matrix4>;\n /** Each node's *parent's* world matrix, keyed by the node's own id. */\n parentMatrices: Map<string, Matrix4>;\n /** `projection · view` — world space straight to clip space. */\n clip: Matrix4;\n /** The view matrix alone, for the depth sort. */\n view: Matrix4;\n /** The canvas's local rect, which the 3D buffer is stretched onto. */\n width: number;\n height: number;\n centerX: number;\n centerY: number;\n}\n\nfunction canvas3DProjection(canvas: Canvas3D): Canvas3DProjection | null {\n const bounds = canvas._localBounds();\n if (!(bounds.width > 0) || !(bounds.height > 0)) return null;\n\n const scene = canvas._scene3D();\n const walked = walkScene3D(scene);\n if (walked.boxes.size === 0) return null;\n\n const view = invert4(walked.camera);\n if (!view) return null;\n\n const aspect = bounds.width / bounds.height;\n return {\n boxes: walked.boxes,\n matrices: walked.matrices,\n parentMatrices: walked.parentMatrices,\n clip: multiply4(projectionMatrix(walked.descriptor, aspect), view),\n view,\n width: bounds.width,\n height: bounds.height,\n centerX: bounds.x,\n centerY: bounds.y,\n };\n}\n\n/** One open `push` scope: where it is, whether it draws, and what it has drawn. */\ninterface Scope3D {\n key: string | undefined;\n matrix: Matrix4;\n visible: boolean;\n box: Box3 | null;\n}\n\ninterface WalkedScene3D {\n boxes: Map<string, Box3>;\n /** Each node's own world matrix, per `Node3D.id` — captured at `push`,\n * unlike `boxes`, which needs children merged in first at `pop`. */\n matrices: Map<string, Matrix4>;\n /** Each node's *parent's* world matrix, keyed by the node's own id. */\n parentMatrices: Map<string, Matrix4>;\n /** The camera's world matrix, or the renderer's own framing when none was set. */\n camera: Matrix4;\n descriptor: CameraData3D | null;\n}\n\n/**\n * Replay the recorded scene, accumulating a world-space box per node.\n *\n * A node's box is the union of everything it drew and everything its children\n * drew, which is what makes a `Group3D` — which draws nothing itself — still\n * selectable as the thing it contains.\n *\n * An invisible scope contributes nothing and is recorded for nobody: `visible:\n * false` is a live object the renderer skips, so there are no pixels to put a\n * box round, and letting one inflate its parent's box would put that parent's\n * box round empty space. The 2D walk skips `opacity: 0` nodes on the same\n * grounds.\n */\nfunction walkScene3D(scene: Scene3D): WalkedScene3D {\n const boxes = new Map<string, Box3>();\n const matrices = new Map<string, Matrix4>();\n const parentMatrices = new Map<string, Matrix4>();\n const root: Scope3D = { key: undefined, matrix: identity4(), visible: true, box: null };\n const stack: Scope3D[] = [root];\n let camera: Matrix4 | null = null;\n let descriptor: CameraData3D | null = null;\n\n const top = (): Scope3D => stack[stack.length - 1];\n\n for (const op of scene.ops()) {\n const scope = top();\n switch (op.kind) {\n case \"push\": {\n const matrix = scopeMatrix(scope.matrix, op.transform);\n if (op.transform?.key !== undefined) {\n matrices.set(op.transform.key, matrix);\n parentMatrices.set(op.transform.key, scope.matrix);\n }\n stack.push({\n key: op.transform?.key,\n matrix,\n visible: scope.visible && op.transform?.visible !== false,\n box: null,\n });\n break;\n }\n case \"pop\": {\n // The root frame is never popped: `Node3D.render` brackets its own\n // begin/end, and `Scene3D.assertBalanced` catches a hand-built\n // scene that doesn't. Guarding anyway keeps a malformed op list\n // from reading past the bottom of the stack.\n if (stack.length === 1) break;\n const closed = stack.pop() as Scope3D;\n if (!closed.visible || !closed.box) break;\n if (closed.key !== undefined) boxes.set(closed.key, closed.box);\n const parent = top();\n parent.box = unionBox3(parent.box, closed.box);\n break;\n }\n case \"camera\": {\n descriptor = op.camera;\n camera = cameraMatrix4(op.camera, scope.matrix);\n break;\n }\n case \"light\":\n // A light has no extent. A node that is only a light therefore\n // gets no box and cannot be picked on the canvas, which is the\n // honest answer — there is nothing on screen at its position.\n break;\n default: {\n if (!scope.visible) break;\n const drawn = drawableBox3(op, scope.matrix);\n if (drawn) scope.box = unionBox3(scope.box, drawn);\n break;\n }\n }\n }\n\n return {\n boxes,\n matrices,\n parentMatrices,\n camera: camera ?? DEFAULT_CAMERA_MATRIX,\n descriptor,\n };\n}\n\n/** A scope's world matrix: the parent's, composed with the node's own placement. */\nfunction scopeMatrix(parent: Matrix4, transform: Transform3D | undefined): Matrix4 {\n return multiply4(parent, transformMatrix4(transform, parent));\n}\n\n/** The world box a single drawable op contributes, or `null` when it has none. */\nfunction drawableBox3(op: Scene3DOp, parent: Matrix4): Box3 | null {\n if (op.kind === \"model\") return null; // its extent arrives with the file\n if (!(\"transform\" in op)) return null;\n\n const matrix = scopeMatrix(parent, op.transform);\n\n if (op.kind === \"sprite\") {\n // A sprite is a camera-facing unit quad scaled by its transform — three's\n // `Sprite` has no geometry to ask, so this is the one place the extent is\n // assumed rather than read.\n return transformBox3(centeredBox3(0.5, 0.5, 0), matrix);\n }\n\n if (!(\"geometry\" in op)) return null;\n const local = geometryBounds3D(op.geometry);\n if (!local) return null;\n\n if (op.kind === \"instances\") {\n // Every instance is placed inside the op's own transform, so the union is\n // taken in that space and mapped out once.\n let box: Box3 | null = null;\n for (const instance of op.instances) {\n box = unionBox3(box, transformBox3(local, transformMatrix4(instance, null)));\n }\n return box ? transformBox3(box, matrix) : null;\n }\n\n return transformBox3(local, matrix);\n}\n\n// ─── The camera ──────────────────────────────────────────────────────────────\n\n/**\n * The camera's world matrix.\n *\n * `lookAt` takes the camera branch of three's `Object3D.lookAt` — **−Z** at the\n * target, where every other node aims its +Z — and is resolved against the\n * camera's *world* position, so a camera riding inside an animated rig points\n * where the author said rather than where its group happens to face. See\n * {@link lookAtRotation4}, which the two branches share.\n *\n * The polar placement (`target`/`orbit`/`elevation`/`distance`) is resolved by\n * core's own {@link resolveCameraPlacement} — the same call the renderer makes.\n * Two places deriving \"where is the camera\" from one descriptor is two chances to\n * disagree about what the author is looking at, and a gizmo drawn against a\n * camera nobody renders is worse than no gizmo at all.\n */\nfunction cameraMatrix4(descriptor: CameraData3D, parent: Matrix4): Matrix4 {\n const placement = resolveCameraPlacement(descriptor);\n\n if (placement.lookAt === undefined) {\n return multiply4(parent, transformMatrix4({ ...descriptor, position: placement.position }, parent));\n }\n const placed = applyMatrix4(parent, placement.position);\n const origin: Vector3 = { x: placed.x, y: placed.y, z: placed.z };\n return multiply4(translation4(origin), lookAtRotation4(origin, placement.lookAt));\n}\n\n/**\n * Where the renderer looks from when a scene declares no camera: pulled back\n * along +Z, aimed at the origin. Mirrors `applyCamera`'s own fallback, which is\n * what makes a bare `g.box()` render something rather than a black frame — and\n * therefore what makes it pickable here.\n */\nconst DEFAULT_CAMERA_MATRIX: Matrix4 = multiply4(\n translation4({ x: 0, y: 0, z: 5 }),\n lookAtRotation4({ x: 0, y: 0, z: 5 }, { x: 0, y: 0, z: 0 }),\n);\n\n/** three's default fov when a perspective descriptor omits one. */\nconst DEFAULT_FOV = 50;\nconst DEFAULT_NEAR = 0.1;\nconst DEFAULT_FAR = 1000;\n\n/** The projection a descriptor asks for, framed to the canvas's aspect. */\nfunction projectionMatrix(descriptor: CameraData3D | null, aspect: number): Matrix4 {\n if (descriptor === null) {\n return perspective4(DEFAULT_FOV, aspect, DEFAULT_NEAR, DEFAULT_FAR, 1);\n }\n if (descriptor.type === \"perspective\") {\n return perspective4(\n descriptor.fov ?? DEFAULT_FOV,\n // Always the node's own aspect. There is no override any more: it was\n // a field whose documentation said not to set it, and setting it\n // stretched the render — so a gizmo can only ever have been wrong by\n // agreeing with one.\n aspect,\n descriptor.near ?? DEFAULT_NEAR,\n descriptor.far ?? DEFAULT_FAR,\n descriptor.zoom ?? 1,\n );\n }\n // `frustumHeight` sets the visible world height and the width follows the\n // node's aspect — the same rule `applyCamera` applies, restated rather than\n // shared because that one lives in the renderer, which core cannot import.\n const halfHeight = (descriptor.frustumHeight ?? 10) / 2;\n return orthographic4(\n -halfHeight * aspect,\n halfHeight * aspect,\n halfHeight,\n -halfHeight,\n descriptor.near ?? DEFAULT_NEAR,\n descriptor.far ?? DEFAULT_FAR,\n descriptor.zoom ?? 1,\n );\n}\n\n// ─── Projection ──────────────────────────────────────────────────────────────\n\n/** An axis-aligned rect in the canvas's own plane, y-up. */\ninterface Rect2D {\n minX: number;\n minY: number;\n maxX: number;\n maxY: number;\n}\n\n/** The twelve edges of {@link corners3}'s eight corners, as index pairs. */\nconst BOX_EDGES: readonly (readonly [number, number])[] = [\n [0, 1], [2, 3], [4, 5], [6, 7],\n [0, 2], [1, 3], [4, 6], [5, 7],\n [0, 4], [1, 5], [2, 6], [3, 7],\n];\n\n/**\n * Smallest `w` a projected point may have before it counts as behind the camera.\n * A point at `w = 0` is on the plane through the eye and projects to infinity.\n */\nconst MIN_CLIP_W = 1e-4;\n\n/**\n * How far outside the canvas a projected box is allowed to reach, as a multiple\n * of the canvas's own size.\n *\n * A box straddling the eye plane genuinely does extend to the horizon, and the\n * arithmetic says so — a corner a millimetre in front of the camera projects\n * thousands of units out. That is the right answer and a useless one: the host\n * draws this, and an overlay rectangle a million pixels wide is a rendering\n * problem rather than a selection. Clamping keeps the box pointing the right way\n * while it is mostly off-screen, and it is only ever reached in the case where\n * the box is already unusable as a target.\n */\nconst OFFSCREEN_LIMIT = 8;\n\n/**\n * The world box projected into the canvas's plane, plus its view-space depth.\n *\n * The **edges** are clipped rather than the corners being clamped: a box with\n * one corner behind the eye has that corner's projection reflected through the\n * origin, so bounding the raw eight would produce a box on the wrong side of the\n * screen. Clipping each edge where it crosses the eye plane gives the visible\n * span and nothing else. Entirely-behind boxes drop out with no edges surviving,\n * which is how a node behind the camera stops being selectable.\n */\nfunction projectBox3(\n world: Box3,\n projection: Canvas3DProjection,\n): { rect: Rect2D; depth: number } | null {\n const corners = corners3(world);\n const clip = corners.map((corner) => applyMatrix4(projection.clip, corner));\n\n let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;\n let any = false;\n\n const include = (x: number, y: number, w: number) => {\n const ndcX = x / w;\n const ndcY = y / w;\n if (ndcX < minX) minX = ndcX;\n if (ndcY < minY) minY = ndcY;\n if (ndcX > maxX) maxX = ndcX;\n if (ndcY > maxY) maxY = ndcY;\n any = true;\n };\n\n for (const [a, b] of BOX_EDGES) {\n const p = clip[a];\n const q = clip[b];\n const pIn = p.w > MIN_CLIP_W;\n const qIn = q.w > MIN_CLIP_W;\n if (!pIn && !qIn) continue;\n if (pIn) include(p.x, p.y, p.w);\n if (qIn) include(q.x, q.y, q.w);\n if (pIn === qIn) continue;\n // Exactly one end is in front: cut the edge where `w` reaches the plane.\n const t = (MIN_CLIP_W - p.w) / (q.w - p.w);\n include(p.x + (q.x - p.x) * t, p.y + (q.y - p.y) * t, MIN_CLIP_W);\n }\n\n if (!any) return null;\n\n const halfWidth = projection.width / 2;\n const halfHeight = projection.height / 2;\n const limitX = halfWidth * OFFSCREEN_LIMIT;\n const limitY = halfHeight * OFFSCREEN_LIMIT;\n\n const rect: Rect2D = {\n minX: clamp(projection.centerX + minX * halfWidth, projection.centerX - limitX, projection.centerX + limitX),\n maxX: clamp(projection.centerX + maxX * halfWidth, projection.centerX - limitX, projection.centerX + limitX),\n minY: clamp(projection.centerY + minY * halfHeight, projection.centerY - limitY, projection.centerY + limitY),\n maxY: clamp(projection.centerY + maxY * halfHeight, projection.centerY - limitY, projection.centerY + limitY),\n };\n\n // Depth is taken at the box centre in view space, where the camera looks down\n // −Z: a nearer node has the larger value. One point rather than eight,\n // because what this orders is \"which of two overlapping nodes did you mean\",\n // and their centres answer that as well as their nearest corners would.\n const centre: Vector3 = {\n x: (world.min.x + world.max.x) / 2,\n y: (world.min.y + world.max.y) / 2,\n z: (world.min.z + world.max.z) / 2,\n };\n const viewed = applyMatrix4(projection.view, centre);\n\n return { rect, depth: viewed.z };\n}\n\nfunction clamp(value: number, low: number, high: number): number {\n return value < low ? low : value > high ? high : value;\n}\n\n/** Whether `point` (canvas-local, y-up) lands in `rect`, widened by `slop`. */\nfunction rectContains(rect: Rect2D, point: Vector2, slop: number): boolean {\n return point.x >= rect.minX - slop\n && point.x <= rect.maxX + slop\n && point.y >= rect.minY - slop\n && point.y <= rect.maxY + slop;\n}\n\n/**\n * The projected rect as a {@link NodeBox}, in viewport space.\n *\n * The corner mapping is {@link worldAnchors}' — y flipped on the way in and back\n * out, because the CTM is canvas y-down while everything either side of it is\n * y-up. Doing it here rather than reusing `worldAnchors` is what lets the rect\n * keep its own centre: the box is axis-aligned in the canvas's plane but not\n * centred on the canvas's origin, and `worldAnchors` maps offsets from wherever\n * the matrix already is.\n *\n * `rotation`, `scale` and `opacity` are the **canvas's**. A mesh has none of its\n * own that mean anything in two dimensions — its `rotation` is three angles and\n * its opacity is its material's — and what a host reads these for is the plane\n * the box was drawn in, which is exactly what the canvas describes.\n */\nfunction toNodeBox(node: Node3D, path: string, rect: Rect2D, frame: Canvas3DFrame): NodeBox {\n const at = (x: number, y: number): Vector2 => {\n const p = applyToPoint(frame.matrix, { x, y: -y });\n return { x: p.x, y: -p.y };\n };\n return {\n id: node.id,\n path,\n type: node.className,\n topLeft: at(rect.minX, rect.maxY),\n topRight: at(rect.maxX, rect.maxY),\n bottomRight: at(rect.maxX, rect.minY),\n bottomLeft: at(rect.minX, rect.minY),\n center: at((rect.minX + rect.maxX) / 2, (rect.minY + rect.maxY) / 2),\n width: rect.maxX - rect.minX,\n height: rect.maxY - rect.minY,\n rotation: frame.box.rotation,\n scale: frame.box.scale,\n opacity: frame.box.opacity,\n // A mesh locks on its own account, not the viewport's — a locked Canvas3D\n // is already unpickable above, so reaching here means the viewport is free.\n locked: node.locked,\n };\n}\n"]}
1
+ {"version":3,"file":"node-picking3d.js","sourceRoot":"","sources":["../../src/runtime/node-picking3d.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAG7D,OAAO,EAAE,YAAY,EAAE,MAAM,EAAiB,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,sBAAsB,EAAqB,MAAM,mBAAmB,CAAC;AAG9E,OAAO,EACH,gBAAgB,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,GACrE,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACH,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,aAAa,EAC3E,YAAY,EAAE,gBAAgB,EAAE,YAAY,GAC/C,MAAM,oBAAoB,CAAC;AAE5B,OAAO,E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GAAG,CAAC,CAAC;QACpE,KAAK,EAAE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI;QAC5B,MAAM,EAAE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI;QAC7B,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,QAAQ;QAC5B,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK;QACtB,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,OAAO;QAC1B,0EAA0E;QAC1E,4EAA4E;QAC5E,MAAM,EAAE,IAAI,CAAC,MAAM;KACtB,CAAC;AACN,CAAC","sourcesContent":["import { Node } from \"@/nodes/node/node\";\r\nimport { Node3D, parentSpaceOf } from \"@/nodes/three/node3d\";\r\nimport { Canvas3D } from \"@/nodes/three/canvas3d-node\";\r\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\r\nimport { applyToPoint, invert, type Matrix2D } from \"@/attributes/layout/matrix2d\";\r\nimport { resolveCameraPlacement, type CameraData3D } from \"@/render3d/camera\";\r\nimport type { Scene3D, Scene3DOp } from \"@/render3d/scene3d\";\r\nimport type { Transform3D } from \"@/render3d/transform\";\r\nimport {\r\n geometryBounds3D, transformBox3, unionBox3, centeredBox3, corners3, type Box3,\r\n} from \"@/render3d/bounds3d\";\r\nimport {\r\n applyMatrix4, identity4, invert4, lookAtRotation4, multiply4, orthographic4,\r\n perspective4, transformMatrix4, translation4, type Matrix4,\r\n} from \"@/render3d/matrix4\";\r\nimport type { Vector3 } from \"@/render3d/vector3\";\r\nimport { nodePath } from \"@/project/tree\";\r\nimport type { NodeBox } from \"./node-picking\";\r\n\r\n/**\r\n * Where a `Node3D`'s pixels landed — the 3D half of `node-picking.ts`, and the\r\n * reason an editor can put a selection box round a cube at all.\r\n *\r\n * **The answer is a 2D box, deliberately.** A mesh has no rectangle in it: what\r\n * it has is an extent in three dimensions, seen through a camera. So this\r\n * projects the node's world-space AABB into the `Canvas3D`'s own plane and takes\r\n * the **screen-space AABB of the result** — the box that encloses the shape as\r\n * drawn, from wherever the camera happens to be. That is the same box every 3D\r\n * editor draws for the same reason: an oriented box in 3D read as a hexagon on\r\n * screen, and nothing you could grab on it would mean anything in two\r\n * dimensions.\r\n *\r\n * Because it is a 2D box in the canvas's plane, it composes with everything the\r\n * 2D side already does — the canvas's own rotation, its ancestors', a camera\r\n * scope above it — by being handed the canvas's `renderMatrix` and mapped\r\n * through it exactly as {@link nodeBox} maps a node's corners. Nothing here has\r\n * to know what is above the canvas.\r\n *\r\n * **Two walks, joined on the node id.** Bounds come from the recorded\r\n * {@link Scene3D} rather than from the node tree, because the scene is the seam\r\n * everything else goes through (the render and the asset pass both build it) and\r\n * a node that draws through a custom `renderSelf` is measured correctly for\r\n * free. Paths come from the tree, because a path is a child *index* and ops\r\n * don't carry one. The two meet on `Node3D.id`, which the scene records as the\r\n * `key` on every `push`.\r\n *\r\n * **Nothing here imports `node-picking.ts` at runtime.** The canvas's own box\r\n * and CTM arrive as a {@link Canvas3DFrame} parameter instead, so the dependency\r\n * runs one way — the 2D walk reaches into this file and never the reverse. The\r\n * `NodeBox` import is type-only and erased.\r\n *\r\n * Two things a caller should know about what it gets back. A box is **not\r\n * clipped to the viewport**: a mesh that has drifted off the side of its canvas\r\n * reports where it went, even though the 3D pass is confined to the rect and no\r\n * pixels of it are drawn. That is the honest answer for an overlay saying where\r\n * a node is, and it costs the picker nothing — {@link pickIn} only consults this\r\n * file for a point already inside the rect.\r\n *\r\n * And the cost: every entry point here records the scene afresh, so a pick or a\r\n * box walk pays one `buildScene3D()` per viewport it touches. That is the same\r\n * pass the render and the asset declaration each make every frame, and 3D scene\r\n * trees are small, so it is fine at pointer rate — but a host calling\r\n * {@link collectBoxes} on every pointer move over a document full of viewports\r\n * is paying it per viewport per move.\r\n */\r\n\r\n/** What the 2D walk already knows about the canvas, handed down. */\r\n/** @internal */\r\nexport interface Canvas3DFrame {\r\n /**\r\n * The canvas's own box. Its folded `rotation`/`scale`/`opacity` carry to\r\n * every 3D node inside it — a mesh has none of its own, and what an editor\r\n * needs those for (cursor angles, pixels-per-unit) is a question about the\r\n * plane the box is drawn in.\r\n */\r\n box: NodeBox;\r\n /** `renderMatrix(canvas)` — the canvas's CTM, canvas y-down. */\r\n matrix: Matrix2D;\r\n}\r\n\r\n/**\r\n * Every 3D node's box inside `canvas`, **nearest camera first**.\r\n *\r\n * Depth order rather than draw order, which is the one place this diverges from\r\n * {@link collectBoxes}: a 3D scene has no draw order to speak of (the renderer\r\n * sorts by depth and the depth buffer settles the rest), so \"topmost\" means\r\n * \"nearest\", and a picker walking this list front-to-back gets the node you can\r\n * actually see.\r\n *\r\n * Empty when the scene has no camera that resolves, when the canvas has no size,\r\n * or when nothing in it can be measured — see {@link geometryBounds3D} for the\r\n * last of those.\r\n */\r\n/** @internal */\r\nexport function collectBoxes3D(canvas: Canvas3D, frame: Canvas3DFrame, path: string): NodeBox[] {\r\n const projection = canvas3DProjection(canvas);\r\n if (!projection) return [];\r\n\r\n const out: { box: NodeBox; depth: number }[] = [];\r\n for (const entry of nodes3DOf(canvas, path)) {\r\n const world = projection.boxes.get(entry.node.id);\r\n if (!world) continue;\r\n const projected = projectBox3(world, projection);\r\n if (!projected) continue;\r\n out.push({\r\n box: toNodeBox(entry.node, entry.path, projected.rect, frame),\r\n depth: projected.depth,\r\n });\r\n }\r\n // View space looks down −Z, so a nearer node has the larger (less negative)\r\n // z — descending puts the front of the scene first.\r\n out.sort((a, b) => b.depth - a.depth);\r\n return out.map((entry) => entry.box);\r\n}\r\n\r\n/**\r\n * Where a handful of arbitrary points around one `Node3D` land on screen — the\r\n * ingredient a box can't supply for a gizmo.\r\n *\r\n * `origin`, `parentPoints` and `localPoints` all come back in the **same\r\n * viewport space** {@link NodeBox} does, so a caller drawing both together\r\n * (a box for the outline, this for the handles) never has two coordinate\r\n * systems to reconcile. A `null` entry means that point sits behind the\r\n * camera — mirrors {@link projectBox3}'s own eye-plane guard, just per point\r\n * instead of per clipped edge, since there's no box to keep in shape here.\r\n *\r\n * Not `@internal`, unlike {@link projectNode3D} itself: this is what a host\r\n * gets back from `projectNode3DAt`/`PlaybackController.projectNode3D`, the\r\n * same public tier as {@link NodeBox}.\r\n */\r\nexport interface Node3DFrame {\r\n /** The node's own position, projected — a gizmo's pivot. */\r\n origin: Vector2 | null;\r\n /**\r\n * `parentPoints` transformed by the node's **parent's** world matrix, then\r\n * projected, through the parent's own coordinates where it places its\r\n * children by them. The frame `Node3DProps.position` is itself expressed in, so\r\n * this is the space a move or scale handle belongs in: a point named\r\n * `{ ...position, x: position.x + 1 }` projects to where nudging `x` by\r\n * one unit would actually land, with no need to know whether \"one unit\"\r\n * means local or world space at the point of asking.\r\n */\r\n parentPoints: (Vector2 | null)[];\r\n /**\r\n * `localPoints` transformed by the node's **own** world matrix, then\r\n * projected. For geometry that has to track the node's current\r\n * orientation — a rotation ring wrapping the mesh as it's actually\r\n * turned, not as it started.\r\n */\r\n localPoints: (Vector2 | null)[];\r\n}\r\n\r\nconst ORIGIN_3D: Vector3 = { x: 0, y: 0, z: 0 };\r\n\r\n/**\r\n * Project `parentPoints`/`localPoints` for the `Node3D` at `targetPath`\r\n * inside `canvas`, or `null` when the canvas has no projection (see\r\n * {@link canvas3DProjection}) or the path doesn't resolve to a node in it.\r\n *\r\n * `canvasPath` is the canvas's own structural path — the same root\r\n * {@link collectBoxes3D} and {@link pickNode3D} are handed — and `targetPath`\r\n * the node being projected, found the same way {@link nodeBoxAt} finds one\r\n * (`node-picking.ts`, one level up).\r\n */\r\n/** @internal */\r\nexport function projectNode3D(\r\n canvas: Canvas3D,\r\n frame: Canvas3DFrame,\r\n canvasPath: string,\r\n targetPath: string,\r\n parentPoints: readonly Vector3[],\r\n localPoints: readonly Vector3[],\r\n): Node3DFrame | null {\r\n const projection = canvas3DProjection(canvas);\r\n if (!projection) return null;\r\n\r\n const entry = nodes3DOf(canvas, canvasPath).find((e) => e.path === targetPath);\r\n if (!entry) return null;\r\n\r\n const own = projection.matrices.get(entry.node.id);\r\n const parent = projection.parentMatrices.get(entry.node.id);\r\n if (!own || !parent) return null;\r\n\r\n const project = (matrix: Matrix4, points: readonly Vector3[]): (Vector2 | null)[] =>\r\n points.map((point) => projectPoint3(matrix, point, projection, frame));\r\n\r\n // A parent with coordinates of its own places the node by them, so that is the frame its position is in.\r\n const space = parentSpaceOf(entry.node);\r\n const placed = space ? parentPoints.map((point) => space.toLocal(point.x, point.y, point.z)) : parentPoints;\r\n\r\n return {\r\n origin: projectPoint3(own, ORIGIN_3D, projection, frame),\r\n parentPoints: project(parent, placed),\r\n localPoints: project(own, localPoints),\r\n };\r\n}\r\n\r\n/**\r\n * `point` (in whatever space `matrix` maps to world space) projected into\r\n * `frame`'s viewport space, or `null` when it lands behind the camera.\r\n *\r\n * The single-point sibling of {@link projectBox3}: no edges to clip, so a\r\n * point either has a clip-space `w` in front of the eye or it doesn't.\r\n */\r\nfunction projectPoint3(\r\n matrix: Matrix4,\r\n point: Vector3,\r\n projection: Canvas3DProjection,\r\n frame: Canvas3DFrame,\r\n): Vector2 | null {\r\n const world = applyMatrix4(matrix, point);\r\n const clip = applyMatrix4(projection.clip, { x: world.x, y: world.y, z: world.z });\r\n if (clip.w <= MIN_CLIP_W) return null;\r\n\r\n const ndcX = clip.x / clip.w;\r\n const ndcY = clip.y / clip.w;\r\n const rectX = projection.centerX + ndcX * (projection.width / 2);\r\n const rectY = projection.centerY + ndcY * (projection.height / 2);\r\n\r\n const p = applyToPoint(frame.matrix, { x: rectX, y: -rectY });\r\n return { x: p.x, y: -p.y };\r\n}\r\n\r\n/**\r\n * The nearest 3D node in `canvas` whose box contains `point` (viewport space,\r\n * y-up), or `null`.\r\n *\r\n * The box, not the mesh — the module note says why there is no mesh-accurate\r\n * answer to give. `tolerance` is grab-slop in scene units, applied in the\r\n * canvas's own plane so it stays the constant on-screen distance the caller\r\n * quoted it as.\r\n */\r\n/** @internal */\r\nexport function pickNode3D(\r\n canvas: Canvas3D,\r\n frame: Canvas3DFrame,\r\n point: Vector2,\r\n tolerance: number,\r\n path: string,\r\n): NodeBox | null {\r\n const projection = canvas3DProjection(canvas);\r\n if (!projection) return null;\r\n\r\n // Into the canvas's own plane, undoing everything above it in one step —\r\n // the same inverse `containsPoint` takes, with the same y-flips in and out.\r\n const inverse = invert(frame.matrix);\r\n if (!inverse) return null;\r\n const mapped = applyToPoint(inverse, { x: point.x, y: -point.y });\r\n const local = { x: mapped.x, y: -mapped.y };\r\n\r\n let best: { node: Node3D; path: string; rect: Rect2D } | null = null;\r\n let bestDepth = -Infinity;\r\n for (const entry of nodes3DOf(canvas, path)) {\r\n const world = projection.boxes.get(entry.node.id);\r\n if (!world) continue;\r\n const projected = projectBox3(world, projection);\r\n if (!projected) continue;\r\n if (!rectContains(projected.rect, local, tolerance)) continue;\r\n if (projected.depth <= bestDepth) continue;\r\n bestDepth = projected.depth;\r\n best = { node: entry.node, path: entry.path, rect: projected.rect };\r\n }\r\n return best ? toNodeBox(best.node, best.path, best.rect, frame) : null;\r\n}\r\n\r\n// ─── The tree walk: which node is at which path ──────────────────────────────\r\n\r\ninterface Node3DEntry {\r\n node: Node3D;\r\n path: string;\r\n}\r\n\r\n/**\r\n * Every `Node3D` under `canvas`, with the structural path it sits at.\r\n *\r\n * Indexed against {@link Node._allChildren} rather than `children`, so a mesh\r\n * and a HUD label under the same viewport are numbered the way the author wrote\r\n * them — see the accessor's own note for what goes wrong otherwise.\r\n */\r\nfunction nodes3DOf(canvas: Canvas3D, path: string): Node3DEntry[] {\r\n const out: Node3DEntry[] = [];\r\n walk3D(canvas._allChildren, path, out);\r\n return out;\r\n}\r\n\r\nfunction walk3D(children: readonly Node[], parentPath: string, out: Node3DEntry[]): void {\r\n for (let i = 0; i < children.length; i++) {\r\n const child = children[i];\r\n if (!(child instanceof Node3D)) continue;\r\n const path = nodePath(parentPath, i);\r\n out.push({ node: child, path });\r\n walk3D(child._allChildren, path, out);\r\n }\r\n}\r\n\r\n// ─── The op walk: how big each node is, and where it is looked at from ───────\r\n\r\n/** Everything the projection needs, resolved once per call. */\r\ninterface Canvas3DProjection {\r\n /** World-space bounds per `Node3D.id`, each including its subtree. */\r\n boxes: Map<string, Box3>;\r\n /** Each node's own world matrix, per `Node3D.id` — see {@link Node3DFrame}. */\r\n matrices: Map<string, Matrix4>;\r\n /** Each node's *parent's* world matrix, keyed by the node's own id. */\r\n parentMatrices: Map<string, Matrix4>;\r\n /** `projection · view` — world space straight to clip space. */\r\n clip: Matrix4;\r\n /** The view matrix alone, for the depth sort. */\r\n view: Matrix4;\r\n /** The canvas's local rect, which the 3D buffer is stretched onto. */\r\n width: number;\r\n height: number;\r\n centerX: number;\r\n centerY: number;\r\n}\r\n\r\nfunction canvas3DProjection(canvas: Canvas3D): Canvas3DProjection | null {\r\n const bounds = canvas._localBounds();\r\n if (!(bounds.width > 0) || !(bounds.height > 0)) return null;\r\n\r\n const scene = canvas._scene3D();\r\n const walked = walkScene3D(scene);\r\n if (walked.boxes.size === 0) return null;\r\n\r\n const view = invert4(walked.camera);\r\n if (!view) return null;\r\n\r\n const aspect = bounds.width / bounds.height;\r\n return {\r\n boxes: walked.boxes,\r\n matrices: walked.matrices,\r\n parentMatrices: walked.parentMatrices,\r\n clip: multiply4(projectionMatrix(walked.descriptor, aspect), view),\r\n view,\r\n width: bounds.width,\r\n height: bounds.height,\r\n centerX: bounds.x,\r\n centerY: bounds.y,\r\n };\r\n}\r\n\r\n/** One open `push` scope: where it is, whether it draws, and what it has drawn. */\r\ninterface Scope3D {\r\n key: string | undefined;\r\n matrix: Matrix4;\r\n visible: boolean;\r\n box: Box3 | null;\r\n}\r\n\r\ninterface WalkedScene3D {\r\n boxes: Map<string, Box3>;\r\n /** Each node's own world matrix, per `Node3D.id` — captured at `push`,\r\n * unlike `boxes`, which needs children merged in first at `pop`. */\r\n matrices: Map<string, Matrix4>;\r\n /** Each node's *parent's* world matrix, keyed by the node's own id. */\r\n parentMatrices: Map<string, Matrix4>;\r\n /** The camera's world matrix, or the renderer's own framing when none was set. */\r\n camera: Matrix4;\r\n descriptor: CameraData3D | null;\r\n}\r\n\r\n/**\r\n * Replay the recorded scene, accumulating a world-space box per node.\r\n *\r\n * A node's box is the union of everything it drew and everything its children\r\n * drew, which is what makes a `Group3D` — which draws nothing itself — still\r\n * selectable as the thing it contains.\r\n *\r\n * An invisible scope contributes nothing and is recorded for nobody: `visible:\r\n * false` is a live object the renderer skips, so there are no pixels to put a\r\n * box round, and letting one inflate its parent's box would put that parent's\r\n * box round empty space. The 2D walk skips `opacity: 0` nodes on the same\r\n * grounds.\r\n */\r\nfunction walkScene3D(scene: Scene3D): WalkedScene3D {\r\n const boxes = new Map<string, Box3>();\r\n const matrices = new Map<string, Matrix4>();\r\n const parentMatrices = new Map<string, Matrix4>();\r\n const root: Scope3D = { key: undefined, matrix: identity4(), visible: true, box: null };\r\n const stack: Scope3D[] = [root];\r\n let camera: Matrix4 | null = null;\r\n let descriptor: CameraData3D | null = null;\r\n\r\n const top = (): Scope3D => stack[stack.length - 1];\r\n\r\n for (const op of scene.ops()) {\r\n const scope = top();\r\n switch (op.kind) {\r\n case \"push\": {\r\n const matrix = scopeMatrix(scope.matrix, op.transform);\r\n if (op.transform?.key !== undefined) {\r\n matrices.set(op.transform.key, matrix);\r\n parentMatrices.set(op.transform.key, scope.matrix);\r\n }\r\n stack.push({\r\n key: op.transform?.key,\r\n matrix,\r\n visible: scope.visible && op.transform?.visible !== false,\r\n box: null,\r\n });\r\n break;\r\n }\r\n case \"pop\": {\r\n // The root frame is never popped: `Node3D.render` brackets its own\r\n // begin/end, and `Scene3D.assertBalanced` catches a hand-built\r\n // scene that doesn't. Guarding anyway keeps a malformed op list\r\n // from reading past the bottom of the stack.\r\n if (stack.length === 1) break;\r\n const closed = stack.pop() as Scope3D;\r\n if (!closed.visible || !closed.box) break;\r\n if (closed.key !== undefined) boxes.set(closed.key, closed.box);\r\n const parent = top();\r\n parent.box = unionBox3(parent.box, closed.box);\r\n break;\r\n }\r\n case \"camera\": {\r\n descriptor = op.camera;\r\n camera = cameraMatrix4(op.camera, scope.matrix);\r\n break;\r\n }\r\n case \"light\":\r\n // A light has no extent. A node that is only a light therefore\r\n // gets no box and cannot be picked on the canvas, which is the\r\n // honest answer — there is nothing on screen at its position.\r\n break;\r\n default: {\r\n if (!scope.visible) break;\r\n const drawn = drawableBox3(op, scope.matrix);\r\n if (drawn) scope.box = unionBox3(scope.box, drawn);\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return {\r\n boxes,\r\n matrices,\r\n parentMatrices,\r\n camera: camera ?? DEFAULT_CAMERA_MATRIX,\r\n descriptor,\r\n };\r\n}\r\n\r\n/** A scope's world matrix: the parent's, composed with the node's own placement. */\r\nfunction scopeMatrix(parent: Matrix4, transform: Transform3D | undefined): Matrix4 {\r\n return multiply4(parent, transformMatrix4(transform, parent));\r\n}\r\n\r\n/** The world box a single drawable op contributes, or `null` when it has none. */\r\nfunction drawableBox3(op: Scene3DOp, parent: Matrix4): Box3 | null {\r\n if (op.kind === \"model\") return null; // its extent arrives with the file\r\n if (!(\"transform\" in op)) return null;\r\n\r\n const matrix = scopeMatrix(parent, op.transform);\r\n\r\n if (op.kind === \"sprite\") {\r\n // A sprite is a camera-facing unit quad scaled by its transform — three's\r\n // `Sprite` has no geometry to ask, so this is the one place the extent is\r\n // assumed rather than read.\r\n return transformBox3(centeredBox3(0.5, 0.5, 0), matrix);\r\n }\r\n\r\n if (!(\"geometry\" in op)) return null;\r\n const local = geometryBounds3D(op.geometry);\r\n if (!local) return null;\r\n\r\n if (op.kind === \"instances\") {\r\n // Every instance is placed inside the op's own transform, so the union is\r\n // taken in that space and mapped out once.\r\n let box: Box3 | null = null;\r\n for (const instance of op.instances) {\r\n box = unionBox3(box, transformBox3(local, transformMatrix4(instance, null)));\r\n }\r\n return box ? transformBox3(box, matrix) : null;\r\n }\r\n\r\n return transformBox3(local, matrix);\r\n}\r\n\r\n// ─── The camera ──────────────────────────────────────────────────────────────\r\n\r\n/**\r\n * The camera's world matrix.\r\n *\r\n * `lookAt` takes the camera branch of three's `Object3D.lookAt` — **−Z** at the\r\n * target, where every other node aims its +Z — and is resolved against the\r\n * camera's *world* position, so a camera riding inside an animated rig points\r\n * where the author said rather than where its group happens to face. See\r\n * {@link lookAtRotation4}, which the two branches share.\r\n *\r\n * The polar placement (`target`/`orbit`/`elevation`/`distance`) is resolved by\r\n * core's own {@link resolveCameraPlacement} — the same call the renderer makes.\r\n * Two places deriving \"where is the camera\" from one descriptor is two chances to\r\n * disagree about what the author is looking at, and a gizmo drawn against a\r\n * camera nobody renders is worse than no gizmo at all.\r\n */\r\nfunction cameraMatrix4(descriptor: CameraData3D, parent: Matrix4): Matrix4 {\r\n const placement = resolveCameraPlacement(descriptor);\r\n\r\n if (placement.lookAt === undefined) {\r\n return multiply4(parent, transformMatrix4({ ...descriptor, position: placement.position }, parent));\r\n }\r\n const placed = applyMatrix4(parent, placement.position);\r\n const origin: Vector3 = { x: placed.x, y: placed.y, z: placed.z };\r\n return multiply4(translation4(origin), lookAtRotation4(origin, placement.lookAt));\r\n}\r\n\r\n/**\r\n * Where the renderer looks from when a scene declares no camera: pulled back\r\n * along +Z, aimed at the origin. Mirrors `applyCamera`'s own fallback, which is\r\n * what makes a bare `g.box()` render something rather than a black frame — and\r\n * therefore what makes it pickable here.\r\n */\r\nconst DEFAULT_CAMERA_MATRIX: Matrix4 = multiply4(\r\n translation4({ x: 0, y: 0, z: 5 }),\r\n lookAtRotation4({ x: 0, y: 0, z: 5 }, { x: 0, y: 0, z: 0 }),\r\n);\r\n\r\n/** three's default fov when a perspective descriptor omits one. */\r\nconst DEFAULT_FOV = 50;\r\nconst DEFAULT_NEAR = 0.1;\r\nconst DEFAULT_FAR = 1000;\r\n\r\n/** The projection a descriptor asks for, framed to the canvas's aspect. */\r\nfunction projectionMatrix(descriptor: CameraData3D | null, aspect: number): Matrix4 {\r\n if (descriptor === null) {\r\n return perspective4(DEFAULT_FOV, aspect, DEFAULT_NEAR, DEFAULT_FAR, 1);\r\n }\r\n if (descriptor.type === \"perspective\") {\r\n return perspective4(\r\n descriptor.fov ?? DEFAULT_FOV,\r\n // Always the node's own aspect. There is no override any more: it was\r\n // a field whose documentation said not to set it, and setting it\r\n // stretched the render — so a gizmo can only ever have been wrong by\r\n // agreeing with one.\r\n aspect,\r\n descriptor.near ?? DEFAULT_NEAR,\r\n descriptor.far ?? DEFAULT_FAR,\r\n descriptor.zoom ?? 1,\r\n );\r\n }\r\n // `frustumHeight` sets the visible world height and the width follows the\r\n // node's aspect — the same rule `applyCamera` applies, restated rather than\r\n // shared because that one lives in the renderer, which core cannot import.\r\n const halfHeight = (descriptor.frustumHeight ?? 10) / 2;\r\n return orthographic4(\r\n -halfHeight * aspect,\r\n halfHeight * aspect,\r\n halfHeight,\r\n -halfHeight,\r\n descriptor.near ?? DEFAULT_NEAR,\r\n descriptor.far ?? DEFAULT_FAR,\r\n descriptor.zoom ?? 1,\r\n );\r\n}\r\n\r\n// ─── Projection ──────────────────────────────────────────────────────────────\r\n\r\n/** An axis-aligned rect in the canvas's own plane, y-up. */\r\ninterface Rect2D {\r\n minX: number;\r\n minY: number;\r\n maxX: number;\r\n maxY: number;\r\n}\r\n\r\n/** The twelve edges of {@link corners3}'s eight corners, as index pairs. */\r\nconst BOX_EDGES: readonly (readonly [number, number])[] = [\r\n [0, 1], [2, 3], [4, 5], [6, 7],\r\n [0, 2], [1, 3], [4, 6], [5, 7],\r\n [0, 4], [1, 5], [2, 6], [3, 7],\r\n];\r\n\r\n/**\r\n * Smallest `w` a projected point may have before it counts as behind the camera.\r\n * A point at `w = 0` is on the plane through the eye and projects to infinity.\r\n */\r\nconst MIN_CLIP_W = 1e-4;\r\n\r\n/**\r\n * How far outside the canvas a projected box is allowed to reach, as a multiple\r\n * of the canvas's own size.\r\n *\r\n * A box straddling the eye plane genuinely does extend to the horizon, and the\r\n * arithmetic says so — a corner a millimetre in front of the camera projects\r\n * thousands of units out. That is the right answer and a useless one: the host\r\n * draws this, and an overlay rectangle a million pixels wide is a rendering\r\n * problem rather than a selection. Clamping keeps the box pointing the right way\r\n * while it is mostly off-screen, and it is only ever reached in the case where\r\n * the box is already unusable as a target.\r\n */\r\nconst OFFSCREEN_LIMIT = 8;\r\n\r\n/**\r\n * The world box projected into the canvas's plane, plus its view-space depth.\r\n *\r\n * The **edges** are clipped rather than the corners being clamped: a box with\r\n * one corner behind the eye has that corner's projection reflected through the\r\n * origin, so bounding the raw eight would produce a box on the wrong side of the\r\n * screen. Clipping each edge where it crosses the eye plane gives the visible\r\n * span and nothing else. Entirely-behind boxes drop out with no edges surviving,\r\n * which is how a node behind the camera stops being selectable.\r\n */\r\nfunction projectBox3(\r\n world: Box3,\r\n projection: Canvas3DProjection,\r\n): { rect: Rect2D; depth: number } | null {\r\n const corners = corners3(world);\r\n const clip = corners.map((corner) => applyMatrix4(projection.clip, corner));\r\n\r\n let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;\r\n let any = false;\r\n\r\n const include = (x: number, y: number, w: number) => {\r\n const ndcX = x / w;\r\n const ndcY = y / w;\r\n if (ndcX < minX) minX = ndcX;\r\n if (ndcY < minY) minY = ndcY;\r\n if (ndcX > maxX) maxX = ndcX;\r\n if (ndcY > maxY) maxY = ndcY;\r\n any = true;\r\n };\r\n\r\n for (const [a, b] of BOX_EDGES) {\r\n const p = clip[a];\r\n const q = clip[b];\r\n const pIn = p.w > MIN_CLIP_W;\r\n const qIn = q.w > MIN_CLIP_W;\r\n if (!pIn && !qIn) continue;\r\n if (pIn) include(p.x, p.y, p.w);\r\n if (qIn) include(q.x, q.y, q.w);\r\n if (pIn === qIn) continue;\r\n // Exactly one end is in front: cut the edge where `w` reaches the plane.\r\n const t = (MIN_CLIP_W - p.w) / (q.w - p.w);\r\n include(p.x + (q.x - p.x) * t, p.y + (q.y - p.y) * t, MIN_CLIP_W);\r\n }\r\n\r\n if (!any) return null;\r\n\r\n const halfWidth = projection.width / 2;\r\n const halfHeight = projection.height / 2;\r\n const limitX = halfWidth * OFFSCREEN_LIMIT;\r\n const limitY = halfHeight * OFFSCREEN_LIMIT;\r\n\r\n const rect: Rect2D = {\r\n minX: clamp(projection.centerX + minX * halfWidth, projection.centerX - limitX, projection.centerX + limitX),\r\n maxX: clamp(projection.centerX + maxX * halfWidth, projection.centerX - limitX, projection.centerX + limitX),\r\n minY: clamp(projection.centerY + minY * halfHeight, projection.centerY - limitY, projection.centerY + limitY),\r\n maxY: clamp(projection.centerY + maxY * halfHeight, projection.centerY - limitY, projection.centerY + limitY),\r\n };\r\n\r\n // Depth is taken at the box centre in view space, where the camera looks down\r\n // −Z: a nearer node has the larger value. One point rather than eight,\r\n // because what this orders is \"which of two overlapping nodes did you mean\",\r\n // and their centres answer that as well as their nearest corners would.\r\n const centre: Vector3 = {\r\n x: (world.min.x + world.max.x) / 2,\r\n y: (world.min.y + world.max.y) / 2,\r\n z: (world.min.z + world.max.z) / 2,\r\n };\r\n const viewed = applyMatrix4(projection.view, centre);\r\n\r\n return { rect, depth: viewed.z };\r\n}\r\n\r\nfunction clamp(value: number, low: number, high: number): number {\r\n return value < low ? low : value > high ? high : value;\r\n}\r\n\r\n/** Whether `point` (canvas-local, y-up) lands in `rect`, widened by `slop`. */\r\nfunction rectContains(rect: Rect2D, point: Vector2, slop: number): boolean {\r\n return point.x >= rect.minX - slop\r\n && point.x <= rect.maxX + slop\r\n && point.y >= rect.minY - slop\r\n && point.y <= rect.maxY + slop;\r\n}\r\n\r\n/**\r\n * The projected rect as a {@link NodeBox}, in viewport space.\r\n *\r\n * The corner mapping is {@link worldAnchors}' — y flipped on the way in and back\r\n * out, because the CTM is canvas y-down while everything either side of it is\r\n * y-up. Doing it here rather than reusing `worldAnchors` is what lets the rect\r\n * keep its own centre: the box is axis-aligned in the canvas's plane but not\r\n * centred on the canvas's origin, and `worldAnchors` maps offsets from wherever\r\n * the matrix already is.\r\n *\r\n * `rotation`, `scale` and `opacity` are the **canvas's**. A mesh has none of its\r\n * own that mean anything in two dimensions — its `rotation` is three angles and\r\n * its opacity is its material's — and what a host reads these for is the plane\r\n * the box was drawn in, which is exactly what the canvas describes.\r\n */\r\nfunction toNodeBox(node: Node3D, path: string, rect: Rect2D, frame: Canvas3DFrame): NodeBox {\r\n const at = (x: number, y: number): Vector2 => {\r\n const p = applyToPoint(frame.matrix, { x, y: -y });\r\n return { x: p.x, y: -p.y };\r\n };\r\n return {\r\n id: node.id,\r\n path,\r\n type: node.className,\r\n topLeft: at(rect.minX, rect.maxY),\r\n topRight: at(rect.maxX, rect.maxY),\r\n bottomRight: at(rect.maxX, rect.minY),\r\n bottomLeft: at(rect.minX, rect.minY),\r\n center: at((rect.minX + rect.maxX) / 2, (rect.minY + rect.maxY) / 2),\r\n width: rect.maxX - rect.minX,\r\n height: rect.maxY - rect.minY,\r\n rotation: frame.box.rotation,\r\n scale: frame.box.scale,\r\n opacity: frame.box.opacity,\r\n // A mesh locks on its own account, not the viewport's — a locked Canvas3D\r\n // is already unpickable above, so reaching here means the viewport is free.\r\n locked: node.locked,\r\n };\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"placement.d.ts","sourceRoot":"","sources":["../../src/runtime/placement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,yEAAyE;AACzE,MAAM,WAAW,SAAS;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,6FAA6F;IAC7F,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAGpE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,EAAE,CAK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;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,EAAE,GAAG,MAAM,CAI5E;AAED,iDAAiD;AACjD,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,CAErF;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE9E;AAED;;;GAGG;AACH,wBAAgB,UAAU,CACtB,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC,EACxB,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,GACnB;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAejD"}
@@ -1,3 +1,4 @@
1
+ import { clipFrameToTime, clipTimeToFrame } from "./frame-time.js";
1
2
  /**
2
3
  * Frames a clip occupies. Rounded up, so a length off a frame boundary still
3
4
  * covers its last partial frame, and never less than one, so a still is drawn.
@@ -5,7 +6,7 @@
5
6
  export function trackFrameCount(seconds, fps) {
6
7
  if (typeof seconds !== "number" || !Number.isFinite(seconds))
7
8
  return 1;
8
- return Math.max(1, Math.ceil(seconds * fps));
9
+ return Math.max(1, Math.ceil(clipTimeToFrame(seconds, fps)));
9
10
  }
10
11
  /**
11
12
  * Where each track sits, from nothing but what the document declares.
@@ -15,7 +16,7 @@ export function trackFrameCount(seconds, fps) {
15
16
  */
16
17
  export function placeTracks(tracks, fps) {
17
18
  return tracks.map((track, index) => {
18
- const startFrame = Math.max(0, Math.round((track.startAt ?? 0) * fps));
19
+ const startFrame = Math.max(0, Math.round(clipTimeToFrame(track.startAt ?? 0, fps)));
19
20
  return { id: track.id, index, startFrame, endFrame: startFrame + trackFrameCount(track.duration, fps) - 1 };
20
21
  });
21
22
  }
@@ -35,9 +36,7 @@ export function spansCovering(spans, frame) {
35
36
  * the end shows where the track stops — a track can cut its clip short.
36
37
  */
37
38
  export function frameTime(frame, fps, duration) {
38
- // `frame * (1 / fps)`, not `frame / fps`: the two disagree in the last bit, and
39
- // a span boundary has to fall on the same side of a frame as the evaluator puts it.
40
- return Math.min(frame * (1 / fps), duration);
39
+ return Math.min(clipFrameToTime(frame, fps), duration);
41
40
  }
42
41
  /**
43
42
  * The clip-local frames a node present over `span` is drawn on: the first whose
@@ -1 +1 @@
1
- {"version":3,"file":"placement.js","sourceRoot":"","sources":["../../src/runtime/placement.ts"],"names":[],"mappings":"AAYA;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,OAAe,EAAE,GAAW;IACxD,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC;QAAE,OAAO,CAAC,CAAC;IACvE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC;AACjD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,MAAwB,EAAE,GAAW;IAC7D,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;QAC/B,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;QACvE,OAAO,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,GAAG,eAAe,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;IAChH,CAAC,CAAC,CAAC;AACP,CAAC;AAED,6GAA6G;AAC7G,MAAM,UAAU,aAAa,CAAC,KAAsC;IAChE,IAAI,KAAK,GAAG,CAAC,CAAC;IACd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U,EAAE,CAAC;IAEvE,IAAI,QAAQ,GAAG,IAAI,CAAC;IACpB,IAAI,IAAI,CAAC,GAAG,KAAK,QAAQ,EAAE,CAAC;QACxB,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QACnE,OAAO,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,GAAG;YAAE,QAAQ,EAAE,CAAC;QAC7D,OAAO,QAAQ,GAAG,IAAI,IAAI,EAAE,CAAC,QAAQ,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG;YAAE,QAAQ,EAAE,CAAC;IACtE,CAAC;IACD,OAAO,UAAU,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACpE,CAAC","sourcesContent":["import type { Track } from \"@/document/project\";\nimport type { NodeSpan } from \"@/document/types\";\n\n/** One track's span on the project timeline. `endFrame` is inclusive. */\nexport interface TrackSpan {\n id: string;\n /** Position in `ProjectDocument.tracks`, which is also paint order: first is at the back. */\n index: number;\n startFrame: number;\n endFrame: number;\n}\n\n/**\n * Frames a clip occupies. Rounded up, so a length off a frame boundary still\n * covers its last partial frame, and never less than one, so a still is drawn.\n */\nexport function trackFrameCount(seconds: number, fps: number): number {\n if (typeof seconds !== \"number\" || !Number.isFinite(seconds)) return 1;\n return Math.max(1, Math.ceil(seconds * fps));\n}\n\n/**\n * Where each track sits, from nothing but what the document declares.\n *\n * A start rounds to the nearest frame while a length rounds up: a start is a\n * point, and flooring it would put every track a frame early.\n */\nexport function placeTracks(tracks: readonly Track[], fps: number): TrackSpan[] {\n return tracks.map((track, index) => {\n const startFrame = Math.max(0, Math.round((track.startAt ?? 0) * fps));\n return { id: track.id, index, startFrame, endFrame: startFrame + trackFrameCount(track.duration, fps) - 1 };\n });\n}\n\n/** The furthest any track reaches — not the sum of their lengths, since gaps and overlaps are both legal. */\nexport function totalFramesOf(spans: readonly { endFrame: number }[]): number {\n let total = 0;\n for (const span of spans) total = Math.max(total, span.endFrame + 1);\n return total;\n}\n\n/** The spans covering `frame`, back to front. */\nexport function spansCovering(spans: readonly TrackSpan[], frame: number): TrackSpan[] {\n return spans.filter(span => frame >= span.startFrame && frame <= span.endFrame);\n}\n\n/**\n * The clip time a track shows at its local `frame`. Clamped, so a frame held past\n * the end shows where the track stops — a track can cut its clip short.\n */\nexport function frameTime(frame: number, fps: number, duration: number): number {\n // `frame * (1 / fps)`, not `frame / fps`: the two disagree in the last bit, and\n // a span boundary has to fall on the same side of a frame as the evaluator puts it.\n return Math.min(frame * (1 / fps), duration);\n}\n\n/**\n * The clip-local frames a node present over `span` is drawn on: the first whose\n * time reaches its start and the last before its end. `null` when it covers none.\n */\nexport function spanFrames(\n span: Readonly<NodeSpan>,\n fps: number,\n frameCount: number,\n): { startFrame: number; endFrame: number } | null {\n const last = frameCount - 1;\n const at = (frame: number) => frameTime(frame, fps, Infinity);\n\n let startFrame = Math.min(last + 1, Math.max(0, Math.ceil(span.start * fps)));\n while (startFrame > 0 && at(startFrame - 1) >= span.start) startFrame--;\n while (startFrame <= last && at(startFrame) < span.start) startFrame++;\n\n let endFrame = last;\n if (span.end !== Infinity) {\n endFrame = Math.max(-1, Math.min(last, Math.ceil(span.end * fps)));\n while (endFrame >= 0 && at(endFrame) >= span.end) endFrame--;\n while (endFrame < last && at(endFrame + 1) < span.end) endFrame++;\n }\n return startFrame <= endFrame ? { startFrame, endFrame } : null;\n}\n"]}
1
+ {"version":3,"file":"placement.js","sourceRoot":"","sources":["../../src/runtime/placement.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAWhE;;;GAGG;AACH,MAAM,UAAU,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,EAAE,CAAC;QAC7D,OAAO,QAAQ,GAAG,IAAI,IAAI,EAAE,CAAC,QAAQ,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG;YAAE,QAAQ,EAAE,CAAC;IACtE,CAAC;IACD,OAAO,UAAU,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACpE,CAAC","sourcesContent":["import type { Track } from \"@/document/project\";\r\nimport type { NodeSpan } from \"@/document/types\";\r\nimport { clipFrameToTime, clipTimeToFrame } from \"./frame-time\";\r\n\r\n/** One track's span on the project timeline. `endFrame` is inclusive. */\r\nexport interface TrackSpan {\r\n id: string;\r\n /** Position in `ProjectDocument.tracks`, which is also paint order: first is at the back. */\r\n index: number;\r\n startFrame: number;\r\n endFrame: number;\r\n}\r\n\r\n/**\r\n * Frames a clip occupies. Rounded up, so a length off a frame boundary still\r\n * covers its last partial frame, and never less than one, so a still is drawn.\r\n */\r\nexport function trackFrameCount(seconds: number, fps: number): number {\r\n if (typeof seconds !== \"number\" || !Number.isFinite(seconds)) return 1;\r\n return Math.max(1, Math.ceil(clipTimeToFrame(seconds, fps)));\r\n}\r\n\r\n/**\r\n * Where each track sits, from nothing but what the document declares.\r\n *\r\n * A start rounds to the nearest frame while a length rounds up: a start is a\r\n * point, and flooring it would put every track a frame early.\r\n */\r\nexport function placeTracks(tracks: readonly Track[], fps: number): TrackSpan[] {\r\n return tracks.map((track, index) => {\r\n const startFrame = Math.max(0, Math.round(clipTimeToFrame(track.startAt ?? 0, fps)));\r\n return { id: track.id, index, startFrame, endFrame: startFrame + trackFrameCount(track.duration, fps) - 1 };\r\n });\r\n}\r\n\r\n/** The furthest any track reaches — not the sum of their lengths, since gaps and overlaps are both legal. */\r\nexport function totalFramesOf(spans: readonly { endFrame: number }[]): number {\r\n let total = 0;\r\n for (const span of spans) total = Math.max(total, span.endFrame + 1);\r\n return total;\r\n}\r\n\r\n/** The spans covering `frame`, back to front. */\r\nexport function spansCovering(spans: readonly TrackSpan[], frame: number): TrackSpan[] {\r\n return spans.filter(span => frame >= span.startFrame && frame <= span.endFrame);\r\n}\r\n\r\n/**\r\n * The clip time a track shows at its local `frame`. Clamped, so a frame held past\r\n * the end shows where the track stops — a track can cut its clip short.\r\n */\r\nexport function frameTime(frame: number, fps: number, duration: number): number {\r\n return Math.min(clipFrameToTime(frame, fps), duration);\r\n}\r\n\r\n/**\r\n * The clip-local frames a node present over `span` is drawn on: the first whose\r\n * time reaches its start and the last before its end. `null` when it covers none.\r\n */\r\nexport function spanFrames(\r\n span: Readonly<NodeSpan>,\r\n fps: number,\r\n frameCount: number,\r\n): { startFrame: number; endFrame: number } | null {\r\n const last = frameCount - 1;\r\n const at = (frame: number) => frameTime(frame, fps, Infinity);\r\n\r\n let startFrame = Math.min(last + 1, Math.max(0, Math.ceil(span.start * fps)));\r\n while (startFrame > 0 && at(startFrame - 1) >= span.start) startFrame--;\r\n while (startFrame <= last && at(startFrame) < span.start) startFrame++;\r\n\r\n let endFrame = last;\r\n if (span.end !== Infinity) {\r\n endFrame = Math.max(-1, Math.min(last, Math.ceil(span.end * fps)));\r\n while (endFrame >= 0 && at(endFrame) >= span.end) endFrame--;\r\n while (endFrame < last && at(endFrame + 1) < span.end) endFrame++;\r\n }\r\n return startFrame <= endFrame ? { startFrame, endFrame } : null;\r\n}\r\n"]}
@@ -7,12 +7,12 @@ import { Ticker, TimeCallback } from "../platform/ticker.js";
7
7
  import { AudioSink } from "../platform/audio-sink.js";
8
8
  import { AssetCatalog } from "../assets/catalog.js";
9
9
  import { Size2D } from "../attributes/layout/size.js";
10
- import { Node2D } from "../nodes/2d/node2d.js";
10
+ import { Node2D, type NodeHandle } from "../nodes/2d/node2d.js";
11
11
  import type { NodeEditorStates } from "../nodes/node/node-editor-state.js";
12
12
  import type { ProjectDocument } from "../document/project.js";
13
13
  import type { Registry } from "../document/registry.js";
14
14
  import { Vector2 } from "../attributes/layout/vector2.js";
15
- import { NodeBox } from "./node-picking.js";
15
+ import { NodeBox, type ReparentPlacement } from "./node-picking.js";
16
16
  import type { Node3DFrame } from "./node-picking3d.js";
17
17
  import type { Vector3 } from "../render3d/vector3.js";
18
18
  import { NodeTextLayout } from "./text-geometry.js";
@@ -221,6 +221,13 @@ export declare class PlaybackController {
221
221
  * hole where an added picture has not arrived. See {@link pendingSwap}.
222
222
  */
223
223
  setProject(next: ProjectDocument): void;
224
+ /**
225
+ * The catalog this controller builds against changed in place: build every
226
+ * track again and repaint, as a swap to the same document would if it could
227
+ * tell. A clip that failed for want of an entry the catalog now has builds,
228
+ * and one measured against an old size is measured again.
229
+ */
230
+ reconcileCatalog(): void;
224
231
  /** Resolves when the paint {@link setProject} scheduled has landed — for a caller that swaps in order to read the result. */
225
232
  whenReplaced(): Promise<void>;
226
233
  private lastReplacePaint;
@@ -266,6 +273,13 @@ export declare class PlaybackController {
266
273
  */
267
274
  getTreeState(): TreeState | null;
268
275
  getNodeState(nodeId: string): NodeState | null;
276
+ /**
277
+ * What a document node of the current track holds before any command has
278
+ * acted on it, whatever frame is showing and whether or not it is on screen:
279
+ * the props an editor shows for the node itself, where {@link getNodeState}
280
+ * is the node at this frame. `null` when the track holds no such row.
281
+ */
282
+ getNodeInitialProps(nodeId: string): NodeState["properties"] | null;
269
283
  /**
270
284
  * The on-screen box of one node at the current frame, or `null` when the path
271
285
  * does not resolve. See {@link NodeBox}.
@@ -291,6 +305,21 @@ export declare class PlaybackController {
291
305
  * in, in that plane's own y-up frame — see {@link parentPlanePointAt}.
292
306
  */
293
307
  parentPlanePoint(path: string, point: Vector2): Vector2 | null;
308
+ /**
309
+ * Where a viewport point lands in the coordinates the node at `path`
310
+ * positions its children in, or `null` when those are pixels — see
311
+ * {@link childPlanePointAt}.
312
+ */
313
+ childPlanePoint(path: string, point: Vector2): Vector2 | null;
314
+ /**
315
+ * What keeps the node at `path` looking as it does once it moves under the
316
+ * node at `parentPath` — see {@link reparentPlacementAt}.
317
+ */
318
+ reparentPlacement(path: string, parentPath: string, offsets: readonly Vector2[]): ReparentPlacement | null;
319
+ /** The points an editor may drag on the node at `path`, in viewport space — see {@link nodeHandlesAt}. */
320
+ nodeHandles(path: string): NodeHandle[] | null;
321
+ /** The value of `prop` that puts its handle under a viewport point — see {@link handleValueAt}. */
322
+ handleValue(path: string, prop: string, point: Vector2): Vector2 | null;
294
323
  /**
295
324
  * Where a Text node's caret slots landed on screen, or `null` when the path
296
325
  * doesn't resolve, the node isn't text, or the measurer has no caret model.
@@ -1 +1 @@
1
- {"version":3,"file":"playback-controller.d.ts","sourceRoot":"","sources":["../../src/runtime/playback-controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAI1E,OAAO,EAAE,SAAS,EAAE,SAAS,EAA0B,MAAM,gBAAgB,CAAC;AAE9E,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAiB,mBAAmB,EAAE,KAAK,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAI7G,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGhD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO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CD,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAElD"}
@@ -8,9 +8,10 @@ import { ClipStore, DEFAULT_PRECOMP_BUDGET_MS } from "./clip-store.js";
8
8
  import { yieldToScheduler } from "../util/scheduler.js";
9
9
  import { AssetNotLoadedError } from "../assets/errors.js";
10
10
  import { Node2D } from "../nodes/2d/node2d.js";
11
- import { collectBoxes, nodeAt, nodeBoxAt, parentPlanePointAt, pickNode, projectNode3DAt } from "./node-picking.js";
11
+ import { childPlanePointAt, collectBoxes, handleValueAt, nodeAt, nodeBoxAt, nodeHandlesAt, parentPlanePointAt, pickNode, projectNode3DAt, reparentPlacementAt } from "./node-picking.js";
12
12
  import { nodeTextLayout } from "./text-geometry.js";
13
13
  import { spanFrames, spansCovering, trackFrameCount } from "./placement.js";
14
+ import { clipFrameToTime, clipTimeToFrame } from "./frame-time.js";
14
15
  /**
15
16
  * Orchestrates playback of a project document.
16
17
  *
@@ -271,7 +272,7 @@ export class PlaybackController {
271
272
  // so time-to-first-frame is O(the tracks on screen), not O(the project).
272
273
  this.precomp = this.precomper.ensureCovering(0);
273
274
  this.stateEvaluator = new StateEvaluator(project, scope, this.store);
274
- this.assetManager = new AssetManager(this.precomp, this.storageAdapter, this.audioDevice);
275
+ this.assetManager = new AssetManager(this.precomp, this.storageAdapter, this.audioDevice, (error) => this.captureRenderError(error));
275
276
  this.masterClock.setDuration(this.totalDuration);
276
277
  this.masterClock.onPlay((t, speed, reverse) => {
277
278
  this.audioDevice.play(t, speed, reverse);
@@ -285,7 +286,7 @@ export class PlaybackController {
285
286
  // A tick is also a render pass: claim a generation so a stale paused
286
287
  // seek can't paint after the clock has moved on (and vice-versa).
287
288
  const gen = ++this.seekGeneration;
288
- const frame = this.fps * currentTime;
289
+ const frame = clipTimeToFrame(currentTime, this.fps);
289
290
  if (frame >= this.totalFrames)
290
291
  this.masterClock.pause();
291
292
  this.discoverThrough(frame);
@@ -387,7 +388,7 @@ export class PlaybackController {
387
388
  }
388
389
  /** Current playback position in frames (float). */
389
390
  get currentFrame() {
390
- return this.masterClock.currentTime * this.fps;
391
+ return clipTimeToFrame(this.masterClock.currentTime, this.fps);
391
392
  }
392
393
  /** Register a callback that fires on every clock tick with the current time. */
393
394
  onTime(cb) {
@@ -456,7 +457,7 @@ export class PlaybackController {
456
457
  const clamped = Math.max(0, Math.min(frame, this.totalFrames));
457
458
  this.masterClock.pause();
458
459
  this.discoverThrough(clamped);
459
- this.masterClock.seek(clamped / this.fps);
460
+ this.masterClock.seek(clipFrameToTime(clamped, this.fps));
460
461
  await this.loadFrame(clamped);
461
462
  if (!this.isCurrent(gen))
462
463
  return;
@@ -500,6 +501,18 @@ export class PlaybackController {
500
501
  this.lastReplacePaint = this.loadAndRepaint(frame, gen);
501
502
  this.startBackgroundPrecomp();
502
503
  }
504
+ /**
505
+ * The catalog this controller builds against changed in place: build every
506
+ * track again and repaint, as a swap to the same document would if it could
507
+ * tell. A clip that failed for want of an entry the catalog now has builds,
508
+ * and one measured against an old size is measured again.
509
+ */
510
+ reconcileCatalog() {
511
+ if (this.disposed)
512
+ return;
513
+ this.store.reset();
514
+ this.setProject(this.store.project);
515
+ }
503
516
  /** Resolves when the paint {@link setProject} scheduled has landed — for a caller that swaps in order to read the result. */
504
517
  whenReplaced() {
505
518
  return this.lastReplacePaint;
@@ -540,7 +553,7 @@ export class PlaybackController {
540
553
  // the live playback position.
541
554
  ++this.seekGeneration;
542
555
  const clamped = Math.max(0, Math.min(frame, this.totalFrames));
543
- this.masterClock.seek(clamped / this.fps);
556
+ this.masterClock.seek(clipFrameToTime(clamped, this.fps));
544
557
  }
545
558
  /**
546
559
  * Capture the current frame as a base-64 PNG data URL. Renders afresh — the
@@ -630,6 +643,15 @@ export class PlaybackController {
630
643
  return null;
631
644
  return { id: node.id, type: node.className, properties: node.properties };
632
645
  }
646
+ /**
647
+ * What a document node of the current track holds before any command has
648
+ * acted on it, whatever frame is showing and whether or not it is on screen:
649
+ * the props an editor shows for the node itself, where {@link getNodeState}
650
+ * is the node at this frame. `null` when the track holds no such row.
651
+ */
652
+ getNodeInitialProps(nodeId) {
653
+ return this.stateEvaluator.currentInstance?.baselineProps(nodeId) ?? null;
654
+ }
633
655
  // ---- Direct manipulation ----------------------------------------------
634
656
  // Where a node's pixels are, what is under a point, and a write path fast
635
657
  // enough for a drag. See `runtime/node-picking.ts` for the geometry.
@@ -688,6 +710,41 @@ export class PlaybackController {
688
710
  return null;
689
711
  return parentPlanePointAt(canvas, path, point);
690
712
  }
713
+ /**
714
+ * Where a viewport point lands in the coordinates the node at `path`
715
+ * positions its children in, or `null` when those are pixels — see
716
+ * {@link childPlanePointAt}.
717
+ */
718
+ childPlanePoint(path, point) {
719
+ const canvas = this.stateEvaluator.currentCanvas;
720
+ if (!canvas)
721
+ return null;
722
+ return childPlanePointAt(canvas, path, point);
723
+ }
724
+ /**
725
+ * What keeps the node at `path` looking as it does once it moves under the
726
+ * node at `parentPath` — see {@link reparentPlacementAt}.
727
+ */
728
+ reparentPlacement(path, parentPath, offsets) {
729
+ const canvas = this.stateEvaluator.currentCanvas;
730
+ if (!canvas)
731
+ return null;
732
+ return reparentPlacementAt(canvas, path, parentPath, offsets);
733
+ }
734
+ /** The points an editor may drag on the node at `path`, in viewport space — see {@link nodeHandlesAt}. */
735
+ nodeHandles(path) {
736
+ const canvas = this.stateEvaluator.currentCanvas;
737
+ if (!canvas)
738
+ return null;
739
+ return nodeHandlesAt(canvas, path);
740
+ }
741
+ /** The value of `prop` that puts its handle under a viewport point — see {@link handleValueAt}. */
742
+ handleValue(path, prop, point) {
743
+ const canvas = this.stateEvaluator.currentCanvas;
744
+ if (!canvas)
745
+ return null;
746
+ return handleValueAt(canvas, path, prop, point);
747
+ }
691
748
  /**
692
749
  * Where a Text node's caret slots landed on screen, or `null` when the path
693
750
  * doesn't resolve, the node isn't text, or the measurer has no caret model.