@motionscript/core 0.1.0-alpha.3 → 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 (746) hide show
  1. package/CHANGELOG.md +220 -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 +79 -4
  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 +17 -2
  43. package/dist/attributes/audio/request.d.ts.map +1 -1
  44. package/dist/attributes/audio/request.js.map +1 -1
  45. package/dist/attributes/audio/schedule.d.ts +4 -2
  46. package/dist/attributes/audio/schedule.d.ts.map +1 -1
  47. package/dist/attributes/audio/schedule.js +15 -8
  48. package/dist/attributes/audio/schedule.js.map +1 -1
  49. package/dist/attributes/audio/sound.d.ts +4 -2
  50. package/dist/attributes/audio/sound.d.ts.map +1 -1
  51. package/dist/attributes/audio/sound.js +8 -4
  52. package/dist/attributes/audio/sound.js.map +1 -1
  53. package/dist/attributes/index.js.map +1 -1
  54. package/dist/attributes/layout/alignment.js +1 -1
  55. package/dist/attributes/layout/alignment.js.map +1 -1
  56. package/dist/attributes/layout/index.js.map +1 -1
  57. package/dist/attributes/layout/insets.js.map +1 -1
  58. package/dist/attributes/layout/matrix2d.js.map +1 -1
  59. package/dist/attributes/layout/size.js.map +1 -1
  60. package/dist/attributes/layout/transform3d.js.map +1 -1
  61. package/dist/attributes/layout/vector2.js.map +1 -1
  62. package/dist/attributes/layout/world-transform.js.map +1 -1
  63. package/dist/attributes/mask/boolean.js.map +1 -1
  64. package/dist/attributes/mask/mask.js.map +1 -1
  65. package/dist/attributes/properties/decorator.d.ts +3 -1
  66. package/dist/attributes/properties/decorator.d.ts.map +1 -1
  67. package/dist/attributes/properties/decorator.js.map +1 -1
  68. package/dist/attributes/properties/inputs.js.map +1 -1
  69. package/dist/attributes/properties/typed.d.ts +9 -2
  70. package/dist/attributes/properties/typed.d.ts.map +1 -1
  71. package/dist/attributes/properties/typed.js +15 -1
  72. package/dist/attributes/properties/typed.js.map +1 -1
  73. package/dist/attributes/render3d/orbit.d.ts +8 -8
  74. package/dist/attributes/render3d/orbit.js +7 -7
  75. package/dist/attributes/render3d/orbit.js.map +1 -1
  76. package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
  77. package/dist/attributes/shape/corners/corner-style.js.map +1 -1
  78. package/dist/attributes/shape/corners/corners.js.map +1 -1
  79. package/dist/attributes/shape/corners/index.js.map +1 -1
  80. package/dist/attributes/shape/effects/backdrop.d.ts +4 -4
  81. package/dist/attributes/shape/effects/backdrop.d.ts.map +1 -1
  82. package/dist/attributes/shape/effects/backdrop.js.map +1 -1
  83. package/dist/attributes/shape/effects/chain.d.ts +28 -120
  84. package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
  85. package/dist/attributes/shape/effects/chain.js +16 -88
  86. package/dist/attributes/shape/effects/chain.js.map +1 -1
  87. package/dist/attributes/shape/effects/effect-data.js.map +1 -1
  88. package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
  89. package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
  90. package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
  91. package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
  92. package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
  93. package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
  94. package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
  95. package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +2 -2
  96. package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
  97. package/dist/attributes/shape/effects/implementations/curves.d.ts +1 -1
  98. package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
  99. package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
  100. package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
  101. package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
  102. package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
  103. package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
  104. package/dist/attributes/shape/effects/implementations/glass.d.ts +15 -24
  105. package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
  106. package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
  107. package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
  108. package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
  109. package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
  110. package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
  111. package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
  112. package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
  113. package/dist/attributes/shape/effects/implementations/lut.d.ts +1 -1
  114. package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
  115. package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
  116. package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
  117. package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
  118. package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
  119. package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
  120. package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
  121. package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
  122. package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
  123. package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
  124. package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
  125. package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
  126. package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
  127. package/dist/attributes/shape/effects/implementations/shader.js +15 -8
  128. package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
  129. package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
  130. package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
  131. package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
  132. package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
  133. package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
  134. package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
  135. package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
  136. package/dist/attributes/shape/effects/index.d.ts +2 -6
  137. package/dist/attributes/shape/effects/index.d.ts.map +1 -1
  138. package/dist/attributes/shape/effects/index.js.map +1 -1
  139. package/dist/attributes/shape/effects/registry.d.ts +23 -6
  140. package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
  141. package/dist/attributes/shape/effects/registry.js +44 -10
  142. package/dist/attributes/shape/effects/registry.js.map +1 -1
  143. package/dist/attributes/shape/effects/union.d.ts +2 -6
  144. package/dist/attributes/shape/effects/union.d.ts.map +1 -1
  145. package/dist/attributes/shape/effects/union.js.map +1 -1
  146. package/dist/attributes/shape/fill/blend.js.map +1 -1
  147. package/dist/attributes/shape/fill/chain.js.map +1 -1
  148. package/dist/attributes/shape/fill/coerce.js.map +1 -1
  149. package/dist/attributes/shape/fill/color/constants.js.map +1 -1
  150. package/dist/attributes/shape/fill/color/parser.d.ts.map +1 -1
  151. package/dist/attributes/shape/fill/color/parser.js +81 -44
  152. package/dist/attributes/shape/fill/color/parser.js.map +1 -1
  153. package/dist/attributes/shape/fill/gradient-stops.d.ts +16 -0
  154. package/dist/attributes/shape/fill/gradient-stops.d.ts.map +1 -0
  155. package/dist/attributes/shape/fill/gradient-stops.js +65 -0
  156. package/dist/attributes/shape/fill/gradient-stops.js.map +1 -0
  157. package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
  158. package/dist/attributes/shape/fill/implementations/color.js.map +1 -1
  159. package/dist/attributes/shape/fill/implementations/conic-gradient.d.ts.map +1 -1
  160. package/dist/attributes/shape/fill/implementations/conic-gradient.js +2 -5
  161. package/dist/attributes/shape/fill/implementations/conic-gradient.js.map +1 -1
  162. package/dist/attributes/shape/fill/implementations/dot-grid.js.map +1 -1
  163. package/dist/attributes/shape/fill/implementations/fractal-noise.d.ts.map +1 -1
  164. package/dist/attributes/shape/fill/implementations/fractal-noise.js +2 -10
  165. package/dist/attributes/shape/fill/implementations/fractal-noise.js.map +1 -1
  166. package/dist/attributes/shape/fill/implementations/grid.js.map +1 -1
  167. package/dist/attributes/shape/fill/implementations/image.d.ts.map +1 -1
  168. package/dist/attributes/shape/fill/implementations/image.js +5 -4
  169. package/dist/attributes/shape/fill/implementations/image.js.map +1 -1
  170. package/dist/attributes/shape/fill/implementations/linear-gradient.d.ts.map +1 -1
  171. package/dist/attributes/shape/fill/implementations/linear-gradient.js +2 -6
  172. package/dist/attributes/shape/fill/implementations/linear-gradient.js.map +1 -1
  173. package/dist/attributes/shape/fill/implementations/noise.js.map +1 -1
  174. package/dist/attributes/shape/fill/implementations/radial-gradient.d.ts.map +1 -1
  175. package/dist/attributes/shape/fill/implementations/radial-gradient.js +2 -5
  176. package/dist/attributes/shape/fill/implementations/radial-gradient.js.map +1 -1
  177. package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
  178. package/dist/attributes/shape/fill/implementations/stripe.js.map +1 -1
  179. package/dist/attributes/shape/fill/implementations/video.js +1 -1
  180. package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
  181. package/dist/attributes/shape/fill/index.js.map +1 -1
  182. package/dist/attributes/shape/fill/lerp.js.map +1 -1
  183. package/dist/attributes/shape/fill/media-preset.js.map +1 -1
  184. package/dist/attributes/shape/fill/registry.js.map +1 -1
  185. package/dist/attributes/shape/fill/union.js.map +1 -1
  186. package/dist/attributes/shape/filters/chain.d.ts +4 -10
  187. package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
  188. package/dist/attributes/shape/filters/chain.js +1 -13
  189. package/dist/attributes/shape/filters/chain.js.map +1 -1
  190. package/dist/attributes/shape/filters/implementations/alpha.js.map +1 -1
  191. package/dist/attributes/shape/filters/implementations/blur.js.map +1 -1
  192. package/dist/attributes/shape/filters/implementations/color-adjustment.js.map +1 -1
  193. package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
  194. package/dist/attributes/shape/filters/implementations/curves.js.map +1 -1
  195. package/dist/attributes/shape/filters/implementations/echo.js.map +1 -1
  196. package/dist/attributes/shape/filters/implementations/exposure.js.map +1 -1
  197. package/dist/attributes/shape/filters/implementations/grayscale.js.map +1 -1
  198. package/dist/attributes/shape/filters/implementations/posterize-time.js.map +1 -1
  199. package/dist/attributes/shape/filters/index.d.ts +1 -1
  200. package/dist/attributes/shape/filters/index.js.map +1 -1
  201. package/dist/attributes/shape/filters/registry.d.ts +2 -2
  202. package/dist/attributes/shape/filters/registry.js +3 -3
  203. package/dist/attributes/shape/filters/registry.js.map +1 -1
  204. package/dist/attributes/shape/filters/union.d.ts +6 -7
  205. package/dist/attributes/shape/filters/union.d.ts.map +1 -1
  206. package/dist/attributes/shape/filters/union.js.map +1 -1
  207. package/dist/attributes/shape/path/anchors.d.ts.map +1 -1
  208. package/dist/attributes/shape/path/anchors.js +12 -5
  209. package/dist/attributes/shape/path/anchors.js.map +1 -1
  210. package/dist/attributes/shape/path/bezier.js.map +1 -1
  211. package/dist/attributes/shape/path/index.js.map +1 -1
  212. package/dist/attributes/shape/path/measure.js.map +1 -1
  213. package/dist/attributes/shape/path/morph.d.ts.map +1 -1
  214. package/dist/attributes/shape/path/morph.js +16 -4
  215. package/dist/attributes/shape/path/morph.js.map +1 -1
  216. package/dist/attributes/shape/path/ops.js.map +1 -1
  217. package/dist/attributes/shape/path/types.js.map +1 -1
  218. package/dist/attributes/shape/path/walk.js.map +1 -1
  219. package/dist/attributes/shape/shaders/index.js.map +1 -1
  220. package/dist/attributes/shape/shaders/pack.js.map +1 -1
  221. package/dist/attributes/shape/shaders/resolve.js.map +1 -1
  222. package/dist/attributes/shape/shadow/index.js.map +1 -1
  223. package/dist/attributes/shape/shadow/shadow.js.map +1 -1
  224. package/dist/attributes/shape/stroke/index.d.ts +2 -2
  225. package/dist/attributes/shape/stroke/index.d.ts.map +1 -1
  226. package/dist/attributes/shape/stroke/index.js +1 -1
  227. package/dist/attributes/shape/stroke/index.js.map +1 -1
  228. package/dist/attributes/shape/stroke/stroke.d.ts +27 -6
  229. package/dist/attributes/shape/stroke/stroke.d.ts.map +1 -1
  230. package/dist/attributes/shape/stroke/stroke.js +22 -2
  231. package/dist/attributes/shape/stroke/stroke.js.map +1 -1
  232. package/dist/attributes/shared/operators.js.map +1 -1
  233. package/dist/attributes/text/index.js.map +1 -1
  234. package/dist/attributes/text/ops.d.ts +6 -0
  235. package/dist/attributes/text/ops.d.ts.map +1 -1
  236. package/dist/attributes/text/ops.js +1 -0
  237. package/dist/attributes/text/ops.js.map +1 -1
  238. package/dist/attributes/text/types.js.map +1 -1
  239. package/dist/browser/chunks/chunk-FUZVFT3W.js +18 -0
  240. package/dist/browser/chunks/chunk-FUZVFT3W.js.map +7 -0
  241. package/dist/browser/chunks/chunk-QG6C23IJ.js +3 -0
  242. package/dist/browser/chunks/chunk-QG6C23IJ.js.map +7 -0
  243. package/dist/browser/chunks/chunk-SFNJRPBV.js +2 -0
  244. package/dist/browser/chunks/chunk-SFNJRPBV.js.map +7 -0
  245. package/dist/browser/component.js +1 -1
  246. package/dist/browser/component.js.map +1 -1
  247. package/dist/browser/index.js +1 -1
  248. package/dist/browser/index.js.map +4 -4
  249. package/dist/browser/jsx-jsx-dev-runtime.js +1 -1
  250. package/dist/browser/jsx-jsx-runtime.js +1 -1
  251. package/dist/browser/manifest.json +3 -2
  252. package/dist/browser/sdk.js +1 -1
  253. package/dist/component.js.map +1 -1
  254. package/dist/document/audio.d.ts +1 -1
  255. package/dist/document/audio.js +4 -4
  256. package/dist/document/audio.js.map +1 -1
  257. package/dist/document/builtins.d.ts.map +1 -1
  258. package/dist/document/builtins.js +8 -14
  259. package/dist/document/builtins.js.map +1 -1
  260. package/dist/document/command-traits.d.ts +1 -1
  261. package/dist/document/command-traits.js +13 -1
  262. package/dist/document/command-traits.js.map +1 -1
  263. package/dist/document/deny-globals.js.map +1 -1
  264. package/dist/document/diff.js.map +1 -1
  265. package/dist/document/doc-index.d.ts +2 -2
  266. package/dist/document/doc-index.d.ts.map +1 -1
  267. package/dist/document/doc-index.js.map +1 -1
  268. package/dist/document/expression/compile.d.ts.map +1 -1
  269. package/dist/document/expression/compile.js +8 -5
  270. package/dist/document/expression/compile.js.map +1 -1
  271. package/dist/document/expression/index.js.map +1 -1
  272. package/dist/document/expression/ops.js +1 -1
  273. package/dist/document/expression/ops.js.map +1 -1
  274. package/dist/document/expression/parse.d.ts.map +1 -1
  275. package/dist/document/expression/parse.js +15 -6
  276. package/dist/document/expression/parse.js.map +1 -1
  277. package/dist/document/expression/refs.d.ts +1 -1
  278. package/dist/document/expression/refs.js +1 -1
  279. package/dist/document/expression/refs.js.map +1 -1
  280. package/dist/document/expression/types.js.map +1 -1
  281. package/dist/document/expression/walk.d.ts.map +1 -1
  282. package/dist/document/expression/walk.js +2 -1
  283. package/dist/document/expression/walk.js.map +1 -1
  284. package/dist/document/index.d.ts +2 -0
  285. package/dist/document/index.d.ts.map +1 -1
  286. package/dist/document/index.js +2 -0
  287. package/dist/document/index.js.map +1 -1
  288. package/dist/document/node-decorator.js.map +1 -1
  289. package/dist/document/node-descriptor.d.ts +19 -0
  290. package/dist/document/node-descriptor.d.ts.map +1 -1
  291. package/dist/document/node-descriptor.js.map +1 -1
  292. package/dist/document/placement.d.ts +70 -0
  293. package/dist/document/placement.d.ts.map +1 -0
  294. package/dist/document/placement.js +83 -0
  295. package/dist/document/placement.js.map +1 -0
  296. package/dist/document/project.d.ts +2 -2
  297. package/dist/document/project.d.ts.map +1 -1
  298. package/dist/document/project.js.map +1 -1
  299. package/dist/document/registry.d.ts +17 -0
  300. package/dist/document/registry.d.ts.map +1 -1
  301. package/dist/document/registry.js +29 -2
  302. package/dist/document/registry.js.map +1 -1
  303. package/dist/document/timeline-patch.js.map +1 -1
  304. package/dist/document/timeline.d.ts +73 -18
  305. package/dist/document/timeline.d.ts.map +1 -1
  306. package/dist/document/timeline.js +192 -40
  307. package/dist/document/timeline.js.map +1 -1
  308. package/dist/document/types.d.ts +12 -12
  309. package/dist/document/types.d.ts.map +1 -1
  310. package/dist/document/types.js +2 -2
  311. package/dist/document/types.js.map +1 -1
  312. package/dist/document/validate.d.ts +2 -2
  313. package/dist/document/validate.d.ts.map +1 -1
  314. package/dist/document/validate.js +37 -31
  315. package/dist/document/validate.js.map +1 -1
  316. package/dist/document/withdraw.d.ts +28 -0
  317. package/dist/document/withdraw.d.ts.map +1 -0
  318. package/dist/document/withdraw.js +61 -0
  319. package/dist/document/withdraw.js.map +1 -0
  320. package/dist/index.d.ts +1 -0
  321. package/dist/index.d.ts.map +1 -1
  322. package/dist/index.js +1 -0
  323. package/dist/index.js.map +1 -1
  324. package/dist/jsx/jsx-dev-runtime.js.map +1 -1
  325. package/dist/jsx/jsx-runtime.d.ts +9 -1
  326. package/dist/jsx/jsx-runtime.d.ts.map +1 -1
  327. package/dist/jsx/jsx-runtime.js +13 -3
  328. package/dist/jsx/jsx-runtime.js.map +1 -1
  329. package/dist/layout/bounds.d.ts +0 -1
  330. package/dist/layout/bounds.d.ts.map +1 -1
  331. package/dist/layout/bounds.js.map +1 -1
  332. package/dist/layout/constraints.js.map +1 -1
  333. package/dist/layout/flex.d.ts +4 -2
  334. package/dist/layout/flex.d.ts.map +1 -1
  335. package/dist/layout/flex.js +27 -11
  336. package/dist/layout/flex.js.map +1 -1
  337. package/dist/layout/freeform.js.map +1 -1
  338. package/dist/layout/grid.js.map +1 -1
  339. package/dist/layout/index.js.map +1 -1
  340. package/dist/layout/item.js.map +1 -1
  341. package/dist/layout/ops.d.ts +6 -0
  342. package/dist/layout/ops.d.ts.map +1 -1
  343. package/dist/layout/ops.js +6 -0
  344. package/dist/layout/ops.js.map +1 -1
  345. package/dist/layout/types.js.map +1 -1
  346. package/dist/nodes/2d/node-lifecycle.js.map +1 -1
  347. package/dist/nodes/2d/node-motion.js.map +1 -1
  348. package/dist/nodes/2d/node-render.d.ts +3 -3
  349. package/dist/nodes/2d/node-render.d.ts.map +1 -1
  350. package/dist/nodes/2d/node-render.js.map +1 -1
  351. package/dist/nodes/2d/node-transform.js.map +1 -1
  352. package/dist/nodes/2d/node2d.d.ts +115 -3
  353. package/dist/nodes/2d/node2d.d.ts.map +1 -1
  354. package/dist/nodes/2d/node2d.js +180 -28
  355. package/dist/nodes/2d/node2d.js.map +1 -1
  356. package/dist/nodes/2d/paint-node.d.ts +27 -0
  357. package/dist/nodes/2d/paint-node.d.ts.map +1 -1
  358. package/dist/nodes/2d/paint-node.js +42 -0
  359. package/dist/nodes/2d/paint-node.js.map +1 -1
  360. package/dist/nodes/audio/audio-bus.js.map +1 -1
  361. package/dist/nodes/audio/index.js.map +1 -1
  362. package/dist/nodes/audio/node-audio.js.map +1 -1
  363. package/dist/nodes/audio/sound-node.d.ts +2 -2
  364. package/dist/nodes/audio/sound-node.d.ts.map +1 -1
  365. package/dist/nodes/audio/sound-node.js +1 -1
  366. package/dist/nodes/audio/sound-node.js.map +1 -1
  367. package/dist/nodes/geometry/bounds-shape-node.d.ts +4 -4
  368. package/dist/nodes/geometry/bounds-shape-node.js +2 -2
  369. package/dist/nodes/geometry/bounds-shape-node.js.map +1 -1
  370. package/dist/nodes/geometry/box-path-node.d.ts +3 -3
  371. package/dist/nodes/geometry/box-path-node.js +2 -2
  372. package/dist/nodes/geometry/box-path-node.js.map +1 -1
  373. package/dist/nodes/geometry/ellipse-node.js.map +1 -1
  374. package/dist/nodes/geometry/group-bounds.d.ts +2 -2
  375. package/dist/nodes/geometry/group-bounds.d.ts.map +1 -1
  376. package/dist/nodes/geometry/group-bounds.js +1 -2
  377. package/dist/nodes/geometry/group-bounds.js.map +1 -1
  378. package/dist/nodes/geometry/path-node.d.ts.map +1 -1
  379. package/dist/nodes/geometry/path-node.js +6 -0
  380. package/dist/nodes/geometry/path-node.js.map +1 -1
  381. package/dist/nodes/geometry/polygon-node.js.map +1 -1
  382. package/dist/nodes/geometry/polygram-node.js.map +1 -1
  383. package/dist/nodes/geometry/rect-node.js.map +1 -1
  384. package/dist/nodes/geometry/shape-node.js.map +1 -1
  385. package/dist/nodes/geometry/shape-outline.d.ts +2 -2
  386. package/dist/nodes/geometry/shape-outline.d.ts.map +1 -1
  387. package/dist/nodes/geometry/shape-outline.js +2 -13
  388. package/dist/nodes/geometry/shape-outline.js.map +1 -1
  389. package/dist/nodes/index.d.ts +3 -8
  390. package/dist/nodes/index.d.ts.map +1 -1
  391. package/dist/nodes/index.js +3 -8
  392. package/dist/nodes/index.js.map +1 -1
  393. package/dist/nodes/layout/camera-node.d.ts +9 -0
  394. package/dist/nodes/layout/camera-node.d.ts.map +1 -1
  395. package/dist/nodes/layout/camera-node.js +38 -3
  396. package/dist/nodes/layout/camera-node.js.map +1 -1
  397. package/dist/nodes/layout/orbit-camera-node.d.ts +1 -1
  398. package/dist/nodes/layout/orbit-camera-node.js +1 -1
  399. package/dist/nodes/layout/orbit-camera-node.js.map +1 -1
  400. package/dist/nodes/layout/rotated-box.js.map +1 -1
  401. package/dist/nodes/media/video-node.d.ts.map +1 -1
  402. package/dist/nodes/media/video-node.js +2 -0
  403. package/dist/nodes/media/video-node.js.map +1 -1
  404. package/dist/nodes/node/declare-paints.js.map +1 -1
  405. package/dist/nodes/node/node-editor-state.js.map +1 -1
  406. package/dist/nodes/node/node-reactive.js.map +1 -1
  407. package/dist/nodes/node/node-time.d.ts +3 -3
  408. package/dist/nodes/node/node-time.d.ts.map +1 -1
  409. package/dist/nodes/node/node-time.js +1 -1
  410. package/dist/nodes/node/node-time.js.map +1 -1
  411. package/dist/nodes/node/node-walk.js.map +1 -1
  412. package/dist/nodes/node/node.d.ts +5 -3
  413. package/dist/nodes/node/node.d.ts.map +1 -1
  414. package/dist/nodes/node/node.js +44 -19
  415. package/dist/nodes/node/node.js.map +1 -1
  416. package/dist/nodes/node/text-defaults.d.ts +10 -12
  417. package/dist/nodes/node/text-defaults.d.ts.map +1 -1
  418. package/dist/nodes/node/text-defaults.js +10 -12
  419. package/dist/nodes/node/text-defaults.js.map +1 -1
  420. package/dist/nodes/{scene → root}/canvas2d-node.d.ts +2 -2
  421. package/dist/nodes/root/canvas2d-node.d.ts.map +1 -0
  422. package/dist/nodes/{scene → root}/canvas2d-node.js +2 -2
  423. package/dist/nodes/root/canvas2d-node.js.map +1 -0
  424. package/dist/nodes/root/provider-node.d.ts.map +1 -0
  425. package/dist/nodes/root/provider-node.js.map +1 -0
  426. package/dist/nodes/root/theme-provider-node.d.ts.map +1 -0
  427. package/dist/nodes/root/theme-provider-node.js.map +1 -0
  428. package/dist/nodes/text/default-text-style-node.d.ts +5 -2
  429. package/dist/nodes/text/default-text-style-node.d.ts.map +1 -1
  430. package/dist/nodes/text/default-text-style-node.js +10 -4
  431. package/dist/nodes/text/default-text-style-node.js.map +1 -1
  432. package/dist/nodes/text/number-format.d.ts +1 -1
  433. package/dist/nodes/text/number-format.js +1 -1
  434. package/dist/nodes/text/number-format.js.map +1 -1
  435. package/dist/nodes/text/number-node.js.map +1 -1
  436. package/dist/nodes/text/number-pattern.js.map +1 -1
  437. package/dist/nodes/text/richtext-node.js +1 -1
  438. package/dist/nodes/text/richtext-node.js.map +1 -1
  439. package/dist/nodes/text/text-base.d.ts.map +1 -1
  440. package/dist/nodes/text/text-base.js +1 -1
  441. package/dist/nodes/text/text-base.js.map +1 -1
  442. package/dist/nodes/text/text-node.js.map +1 -1
  443. package/dist/nodes/text/text-selection.js.map +1 -1
  444. package/dist/nodes/three/camera-nodes.d.ts +21 -3
  445. package/dist/nodes/three/camera-nodes.d.ts.map +1 -1
  446. package/dist/nodes/three/camera-nodes.js +42 -1
  447. package/dist/nodes/three/camera-nodes.js.map +1 -1
  448. package/dist/nodes/three/canvas3d-node.d.ts +29 -6
  449. package/dist/nodes/three/canvas3d-node.d.ts.map +1 -1
  450. package/dist/nodes/three/canvas3d-node.js +44 -2
  451. package/dist/nodes/three/canvas3d-node.js.map +1 -1
  452. package/dist/nodes/three/drawable-nodes.d.ts +25 -11
  453. package/dist/nodes/three/drawable-nodes.d.ts.map +1 -1
  454. package/dist/nodes/three/drawable-nodes.js +43 -13
  455. package/dist/nodes/three/drawable-nodes.js.map +1 -1
  456. package/dist/nodes/three/environment-nodes.d.ts +9 -3
  457. package/dist/nodes/three/environment-nodes.d.ts.map +1 -1
  458. package/dist/nodes/three/environment-nodes.js.map +1 -1
  459. package/dist/nodes/three/geometry-nodes.d.ts +2 -2
  460. package/dist/nodes/three/geometry-nodes.js +2 -2
  461. package/dist/nodes/three/geometry-nodes.js.map +1 -1
  462. package/dist/nodes/three/grid-geometry3d.js.map +1 -1
  463. package/dist/nodes/three/group3d.js.map +1 -1
  464. package/dist/nodes/three/light-nodes.d.ts.map +1 -1
  465. package/dist/nodes/three/light-nodes.js +3 -3
  466. package/dist/nodes/three/light-nodes.js.map +1 -1
  467. package/dist/nodes/three/mesh3d.js.map +1 -1
  468. package/dist/nodes/three/node3d.d.ts +48 -0
  469. package/dist/nodes/three/node3d.d.ts.map +1 -1
  470. package/dist/nodes/three/node3d.js +53 -3
  471. package/dist/nodes/three/node3d.js.map +1 -1
  472. package/dist/platform/audio-sink.d.ts +2 -2
  473. package/dist/platform/audio-sink.d.ts.map +1 -1
  474. package/dist/platform/audio-sink.js.map +1 -1
  475. package/dist/platform/exporter.d.ts +13 -8
  476. package/dist/platform/exporter.d.ts.map +1 -1
  477. package/dist/platform/exporter.js.map +1 -1
  478. package/dist/platform/index.d.ts +1 -1
  479. package/dist/platform/index.d.ts.map +1 -1
  480. package/dist/platform/index.js.map +1 -1
  481. package/dist/platform/stepped-clock.js.map +1 -1
  482. package/dist/platform/storage-adapter.d.ts +12 -6
  483. package/dist/platform/storage-adapter.d.ts.map +1 -1
  484. package/dist/platform/storage-adapter.js +4 -0
  485. package/dist/platform/storage-adapter.js.map +1 -1
  486. package/dist/platform/ticker.d.ts +6 -0
  487. package/dist/platform/ticker.d.ts.map +1 -1
  488. package/dist/platform/ticker.js +6 -0
  489. package/dist/platform/ticker.js.map +1 -1
  490. package/dist/project/config.js.map +1 -1
  491. package/dist/project/index.js.map +1 -1
  492. package/dist/project/tree.d.ts +3 -3
  493. package/dist/project/tree.d.ts.map +1 -1
  494. package/dist/project/tree.js.map +1 -1
  495. package/dist/props/host.js.map +1 -1
  496. package/dist/props/index.js.map +1 -1
  497. package/dist/props/observer.js.map +1 -1
  498. package/dist/props/slot.js.map +1 -1
  499. package/dist/renamed-scene-names.d.ts +17 -0
  500. package/dist/renamed-scene-names.d.ts.map +1 -0
  501. package/dist/renamed-scene-names.js +9 -0
  502. package/dist/renamed-scene-names.js.map +1 -0
  503. package/dist/render/canvas-render-context2d.d.ts +2 -2
  504. package/dist/render/canvas-render-context2d.d.ts.map +1 -1
  505. package/dist/render/canvas-render-context2d.js.map +1 -1
  506. package/dist/render/clip-contains.js.map +1 -1
  507. package/dist/render/clip.js.map +1 -1
  508. package/dist/render/descriptors/ellipse.js.map +1 -1
  509. package/dist/render/descriptors/latex.js.map +1 -1
  510. package/dist/render/descriptors/line.js.map +1 -1
  511. package/dist/render/descriptors/path-builder.js.map +1 -1
  512. package/dist/render/descriptors/path.js.map +1 -1
  513. package/dist/render/descriptors/polygon.js.map +1 -1
  514. package/dist/render/descriptors/polygram.js.map +1 -1
  515. package/dist/render/descriptors/rect.js.map +1 -1
  516. package/dist/render/descriptors/richtext.js.map +1 -1
  517. package/dist/render/descriptors/shape.d.ts +12 -0
  518. package/dist/render/descriptors/shape.d.ts.map +1 -1
  519. package/dist/render/descriptors/shape.js.map +1 -1
  520. package/dist/render/descriptors/text.d.ts +2 -2
  521. package/dist/render/descriptors/text.js +2 -2
  522. package/dist/render/descriptors/text.js.map +1 -1
  523. package/dist/render/descriptors/transform.d.ts +2 -2
  524. package/dist/render/descriptors/transform.d.ts.map +1 -1
  525. package/dist/render/descriptors/transform.js.map +1 -1
  526. package/dist/render/graphics2d.d.ts +3 -3
  527. package/dist/render/graphics2d.d.ts.map +1 -1
  528. package/dist/render/graphics2d.js +1 -1
  529. package/dist/render/graphics2d.js.map +1 -1
  530. package/dist/render/index.js.map +1 -1
  531. package/dist/render/measure-context.js.map +1 -1
  532. package/dist/render/null-render-context.js.map +1 -1
  533. package/dist/render/render-context2d.d.ts +2 -2
  534. package/dist/render/render-context2d.d.ts.map +1 -1
  535. package/dist/render/render-context2d.js.map +1 -1
  536. package/dist/render/surface.js.map +1 -1
  537. package/dist/render/text-defaults.js.map +1 -1
  538. package/dist/render/text-layout.js.map +1 -1
  539. package/dist/render3d/bounds3d.d.ts.map +1 -1
  540. package/dist/render3d/bounds3d.js +4 -2
  541. package/dist/render3d/bounds3d.js.map +1 -1
  542. package/dist/render3d/builders.js.map +1 -1
  543. package/dist/render3d/camera.d.ts +6 -0
  544. package/dist/render3d/camera.d.ts.map +1 -1
  545. package/dist/render3d/camera.js +5 -3
  546. package/dist/render3d/camera.js.map +1 -1
  547. package/dist/render3d/fill3d.d.ts +2 -9
  548. package/dist/render3d/fill3d.d.ts.map +1 -1
  549. package/dist/render3d/fill3d.js +2 -13
  550. package/dist/render3d/fill3d.js.map +1 -1
  551. package/dist/render3d/geometry.d.ts +8 -1
  552. package/dist/render3d/geometry.d.ts.map +1 -1
  553. package/dist/render3d/geometry.js.map +1 -1
  554. package/dist/render3d/graphics3d.d.ts +8 -4
  555. package/dist/render3d/graphics3d.d.ts.map +1 -1
  556. package/dist/render3d/graphics3d.js +18 -10
  557. package/dist/render3d/graphics3d.js.map +1 -1
  558. package/dist/render3d/index.d.ts +1 -1
  559. package/dist/render3d/index.js +1 -1
  560. package/dist/render3d/index.js.map +1 -1
  561. package/dist/render3d/inert.d.ts +14 -0
  562. package/dist/render3d/inert.d.ts.map +1 -0
  563. package/dist/render3d/inert.js +62 -0
  564. package/dist/render3d/inert.js.map +1 -0
  565. package/dist/render3d/light.js.map +1 -1
  566. package/dist/render3d/material.d.ts +10 -5
  567. package/dist/render3d/material.d.ts.map +1 -1
  568. package/dist/render3d/material.js.map +1 -1
  569. package/dist/render3d/matrix4.js.map +1 -1
  570. package/dist/render3d/render-context3d.js.map +1 -1
  571. package/dist/render3d/resources.js.map +1 -1
  572. package/dist/render3d/rounded-box.js.map +1 -1
  573. package/dist/render3d/scene-settings.d.ts +23 -4
  574. package/dist/render3d/scene-settings.d.ts.map +1 -1
  575. package/dist/render3d/scene-settings.js.map +1 -1
  576. package/dist/render3d/scene3d.d.ts +11 -0
  577. package/dist/render3d/scene3d.d.ts.map +1 -1
  578. package/dist/render3d/scene3d.js +39 -6
  579. package/dist/render3d/scene3d.js.map +1 -1
  580. package/dist/render3d/segments.js.map +1 -1
  581. package/dist/render3d/texture.d.ts +9 -0
  582. package/dist/render3d/texture.d.ts.map +1 -1
  583. package/dist/render3d/texture.js +13 -0
  584. package/dist/render3d/texture.js.map +1 -1
  585. package/dist/render3d/tracking.js.map +1 -1
  586. package/dist/render3d/transform.d.ts +1 -1
  587. package/dist/render3d/transform.js.map +1 -1
  588. package/dist/render3d/vector3.d.ts +18 -1
  589. package/dist/render3d/vector3.d.ts.map +1 -1
  590. package/dist/render3d/vector3.js +27 -0
  591. package/dist/render3d/vector3.js.map +1 -1
  592. package/dist/render3d/walk.d.ts +1 -1
  593. package/dist/render3d/walk.d.ts.map +1 -1
  594. package/dist/render3d/walk.js +5 -1
  595. package/dist/render3d/walk.js.map +1 -1
  596. package/dist/runtime/asset-refine.js.map +1 -1
  597. package/dist/runtime/asset-timeline.js.map +1 -1
  598. package/dist/runtime/asset-update.js.map +1 -1
  599. package/dist/runtime/audio-index.js.map +1 -1
  600. package/dist/runtime/builtin-context.js.map +1 -1
  601. package/dist/runtime/clip-instance.d.ts +5 -3
  602. package/dist/runtime/clip-instance.d.ts.map +1 -1
  603. package/dist/runtime/clip-instance.js +10 -6
  604. package/dist/runtime/clip-instance.js.map +1 -1
  605. package/dist/runtime/clip-store.d.ts +9 -0
  606. package/dist/runtime/clip-store.d.ts.map +1 -1
  607. package/dist/runtime/clip-store.js +19 -0
  608. package/dist/runtime/clip-store.js.map +1 -1
  609. package/dist/runtime/engine.d.ts +5 -0
  610. package/dist/runtime/engine.d.ts.map +1 -1
  611. package/dist/runtime/engine.js +2 -0
  612. package/dist/runtime/engine.js.map +1 -1
  613. package/dist/runtime/frame-time.d.ts +31 -0
  614. package/dist/runtime/frame-time.d.ts.map +1 -0
  615. package/dist/runtime/frame-time.js +29 -0
  616. package/dist/runtime/frame-time.js.map +1 -0
  617. package/dist/runtime/index.d.ts +1 -0
  618. package/dist/runtime/index.d.ts.map +1 -1
  619. package/dist/runtime/index.js +1 -0
  620. package/dist/runtime/index.js.map +1 -1
  621. package/dist/runtime/node-picking.d.ts +44 -3
  622. package/dist/runtime/node-picking.d.ts.map +1 -1
  623. package/dist/runtime/node-picking.js +118 -3
  624. package/dist/runtime/node-picking.js.map +1 -1
  625. package/dist/runtime/node-picking3d.d.ts +2 -1
  626. package/dist/runtime/node-picking3d.d.ts.map +1 -1
  627. package/dist/runtime/node-picking3d.js +5 -2
  628. package/dist/runtime/node-picking3d.js.map +1 -1
  629. package/dist/runtime/placement.d.ts.map +1 -1
  630. package/dist/runtime/placement.js +4 -5
  631. package/dist/runtime/placement.js.map +1 -1
  632. package/dist/runtime/playback-controller.d.ts +31 -2
  633. package/dist/runtime/playback-controller.d.ts.map +1 -1
  634. package/dist/runtime/playback-controller.js +63 -6
  635. package/dist/runtime/playback-controller.js.map +1 -1
  636. package/dist/runtime/playback.js.map +1 -1
  637. package/dist/runtime/precompisition.js.map +1 -1
  638. package/dist/runtime/project-assets.js.map +1 -1
  639. package/dist/runtime/session.d.ts +9 -7
  640. package/dist/runtime/session.d.ts.map +1 -1
  641. package/dist/runtime/session.js +12 -4
  642. package/dist/runtime/session.js.map +1 -1
  643. package/dist/runtime/settle.js.map +1 -1
  644. package/dist/runtime/state-evaluator.d.ts +1 -1
  645. package/dist/runtime/state-evaluator.d.ts.map +1 -1
  646. package/dist/runtime/state-evaluator.js +4 -3
  647. package/dist/runtime/state-evaluator.js.map +1 -1
  648. package/dist/runtime/text-geometry.js.map +1 -1
  649. package/dist/sdk/index.d.ts +19 -15
  650. package/dist/sdk/index.d.ts.map +1 -1
  651. package/dist/sdk/index.js +11 -6
  652. package/dist/sdk/index.js.map +1 -1
  653. package/dist/tween/command-decorator.d.ts +2 -0
  654. package/dist/tween/command-decorator.d.ts.map +1 -1
  655. package/dist/tween/command-decorator.js.map +1 -1
  656. package/dist/tween/command.js.map +1 -1
  657. package/dist/tween/ease/constants.d.ts.map +1 -1
  658. package/dist/tween/ease/constants.js +8 -5
  659. package/dist/tween/ease/constants.js.map +1 -1
  660. package/dist/tween/ease/curve.d.ts.map +1 -1
  661. package/dist/tween/ease/curve.js +4 -3
  662. package/dist/tween/ease/curve.js.map +1 -1
  663. package/dist/tween/ease/describe.d.ts +15 -0
  664. package/dist/tween/ease/describe.d.ts.map +1 -0
  665. package/dist/tween/ease/describe.js +37 -0
  666. package/dist/tween/ease/describe.js.map +1 -0
  667. package/dist/tween/ease/type.js.map +1 -1
  668. package/dist/tween/index.js.map +1 -1
  669. package/dist/tween/inert.js.map +1 -1
  670. package/dist/tween/lerp.js.map +1 -1
  671. package/dist/tween/loop.js.map +1 -1
  672. package/dist/tween/prepare.d.ts +3 -3
  673. package/dist/tween/prepare.js +3 -3
  674. package/dist/tween/prepare.js.map +1 -1
  675. package/dist/tween/seekable.d.ts +1 -1
  676. package/dist/tween/seekable.js.map +1 -1
  677. package/dist/tween/stepper.js.map +1 -1
  678. package/dist/tween/to-command.js.map +1 -1
  679. package/dist/util/clamp.js.map +1 -1
  680. package/dist/util/context.js.map +1 -1
  681. package/dist/util/csv.js.map +1 -1
  682. package/dist/util/generateList.js.map +1 -1
  683. package/dist/util/index.js.map +1 -1
  684. package/dist/util/metrics.d.ts +1 -1
  685. package/dist/util/metrics.js +1 -1
  686. package/dist/util/metrics.js.map +1 -1
  687. package/dist/util/random.js.map +1 -1
  688. package/dist/util/reference.js.map +1 -1
  689. package/dist/util/scheduler.js.map +1 -1
  690. package/package.json +2 -1
  691. package/dist/attributes/shape/effects/implementations/displace.d.ts +0 -48
  692. package/dist/attributes/shape/effects/implementations/displace.d.ts.map +0 -1
  693. package/dist/attributes/shape/effects/implementations/displace.js +0 -30
  694. package/dist/attributes/shape/effects/implementations/displace.js.map +0 -1
  695. package/dist/attributes/shape/effects/implementations/god-rays.d.ts +0 -28
  696. package/dist/attributes/shape/effects/implementations/god-rays.d.ts.map +0 -1
  697. package/dist/attributes/shape/effects/implementations/god-rays.js +0 -26
  698. package/dist/attributes/shape/effects/implementations/god-rays.js.map +0 -1
  699. package/dist/attributes/shape/effects/implementations/texture.d.ts +0 -28
  700. package/dist/attributes/shape/effects/implementations/texture.d.ts.map +0 -1
  701. package/dist/attributes/shape/effects/implementations/texture.js +0 -25
  702. package/dist/attributes/shape/effects/implementations/texture.js.map +0 -1
  703. package/dist/attributes/shape/effects/implementations/trails.d.ts +0 -41
  704. package/dist/attributes/shape/effects/implementations/trails.d.ts.map +0 -1
  705. package/dist/attributes/shape/effects/implementations/trails.js +0 -22
  706. package/dist/attributes/shape/effects/implementations/trails.js.map +0 -1
  707. package/dist/browser/chunks/chunk-2T3HXSC2.js +0 -2
  708. package/dist/browser/chunks/chunk-2T3HXSC2.js.map +0 -7
  709. package/dist/browser/chunks/chunk-KJXGRHOL.js +0 -3
  710. package/dist/browser/chunks/chunk-KJXGRHOL.js.map +0 -7
  711. package/dist/browser/chunks/chunk-TGDX2SS2.js +0 -18
  712. package/dist/browser/chunks/chunk-TGDX2SS2.js.map +0 -7
  713. package/dist/nodes/geometry/dot-grid-node.d.ts +0 -105
  714. package/dist/nodes/geometry/dot-grid-node.d.ts.map +0 -1
  715. package/dist/nodes/geometry/dot-grid-node.js +0 -142
  716. package/dist/nodes/geometry/dot-grid-node.js.map +0 -1
  717. package/dist/nodes/geometry/grid-lines.d.ts +0 -101
  718. package/dist/nodes/geometry/grid-lines.d.ts.map +0 -1
  719. package/dist/nodes/geometry/grid-lines.js +0 -128
  720. package/dist/nodes/geometry/grid-lines.js.map +0 -1
  721. package/dist/nodes/geometry/grid-pattern-node.d.ts +0 -58
  722. package/dist/nodes/geometry/grid-pattern-node.d.ts.map +0 -1
  723. package/dist/nodes/geometry/grid-pattern-node.js +0 -172
  724. package/dist/nodes/geometry/grid-pattern-node.js.map +0 -1
  725. package/dist/nodes/geometry/line-grid-node.d.ts +0 -62
  726. package/dist/nodes/geometry/line-grid-node.d.ts.map +0 -1
  727. package/dist/nodes/geometry/line-grid-node.js +0 -127
  728. package/dist/nodes/geometry/line-grid-node.js.map +0 -1
  729. package/dist/nodes/geometry/line-node.d.ts +0 -58
  730. package/dist/nodes/geometry/line-node.d.ts.map +0 -1
  731. package/dist/nodes/geometry/line-node.js +0 -123
  732. package/dist/nodes/geometry/line-node.js.map +0 -1
  733. package/dist/nodes/geometry/viewport-pattern-node.d.ts +0 -39
  734. package/dist/nodes/geometry/viewport-pattern-node.d.ts.map +0 -1
  735. package/dist/nodes/geometry/viewport-pattern-node.js +0 -79
  736. package/dist/nodes/geometry/viewport-pattern-node.js.map +0 -1
  737. package/dist/nodes/scene/canvas2d-node.d.ts.map +0 -1
  738. package/dist/nodes/scene/canvas2d-node.js.map +0 -1
  739. package/dist/nodes/scene/provider-node.d.ts.map +0 -1
  740. package/dist/nodes/scene/provider-node.js.map +0 -1
  741. package/dist/nodes/scene/theme-provider-node.d.ts.map +0 -1
  742. package/dist/nodes/scene/theme-provider-node.js.map +0 -1
  743. /package/dist/nodes/{scene → root}/provider-node.d.ts +0 -0
  744. /package/dist/nodes/{scene → root}/provider-node.js +0 -0
  745. /package/dist/nodes/{scene → root}/theme-provider-node.d.ts +0 -0
  746. /package/dist/nodes/{scene → root}/theme-provider-node.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"node-reactive.js","sourceRoot":"","sources":["../../../src/nodes/node/node-reactive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAgB,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,WAAW,EAAqB,M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,GAAG,EAAE,IAAI,CAAC,IAAI,KAAK,EAAE,CAAC;oBAC9B,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC;gBAC7B,CAAC;YACL,CAAC;YACD,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAClD,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC;QAC3B,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC;YAAE,kBAAkB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACzD,CAAC,EAAE,MAAM,CAAC,CAAC;AACf,CAAC","sourcesContent":["import { PropSlot, PropSnapshot } from \"@/props/slot\";\nimport { ensureCells, PropHost, TweenFn } from \"@/props/host\";\nimport { EasingFunction } from \"@/tween/ease/type\";\nimport { driveCommand, type Command } from \"@/tween/command\";\nimport { TweenStepper } from \"@/tween/stepper\";\nimport { PropOptions } from \"@/attributes/properties/decorator\";\n\n/**\n * Companion implementation of {@link Node2D}'s property machinery and its\n * save/restore state stack. The bodies live here as free functions over a\n * narrow {@link ReactiveHost} so `node.ts` keeps only thin delegators (and the\n * hot-path `set`/`_writeProp`, which stay inline on the class). Mirrors the\n * existing `getPropSlot(host, name)` pattern in `props/host.ts`.\n */\n\n/**\n * The slice of a {@link Node2D} these helpers touch: the {@link PropHost} maps\n * plus the internal write/tween seams. `_writeProp` and `_prepareStep` remain\n * methods on `Node2D`; the helpers call back through them so subclass behaviour\n * and the inline hot path are preserved.\n */\n/** @internal */\nexport interface ReactiveHost extends PropHost {\n readonly id: string;\n _writeProp(field: string, value: unknown): void;\n _prepareStep(to: Record<string, unknown>, duration: number, easing?: EasingFunction): TweenStepper;\n /** LIFO stack of save() snapshot layers; owned as an instance field on Node2D. */\n _stateStack: Map<string, PropSnapshot<any>>[];\n}\n\n/**\n * Create the {@link PropSlot} + accessor for a freshly-declared prop and register\n * its tween/mapper metadata. Extracted from `Node2D._registerProp`; defines the\n * getter/setter on `host` so writes route through `host._writeProp`\n * (mapper-aware, binding-aware).\n */\n/** @internal */\nexport function registerProp<Int>(host: ReactiveHost, field: string, options?: PropOptions<any, Int>): void {\n const slot = new PropSlot<Int>(undefined as unknown as Int, host, field);\n const cells = ensureCells(host);\n cells.slots.set(field, slot);\n if (options?.tween) {\n (cells.tweens ??= new Map()).set(field, options.tween as TweenFn<any>);\n }\n if (options?.mapper) {\n (cells.mappers ??= new Map()).set(field, options.mapper as (ext: any, prev?: any) => any);\n }\n Object.defineProperty(host, field, {\n get: () => slot.get(),\n set: (value: any) => host._writeProp(field, value),\n enumerable: true,\n configurable: true,\n });\n}\n\n/**\n * Apply (or re-apply) a prop's initial value plus optional tween/mapper. A first\n * call creates the cell via {@link registerProp}; a subsequent call for the same\n * field reuses the cell and only refines its tween/mapper (so a subclass can\n * override a parent default without losing the cell or its bindings), then\n * writes the value. Extracted from `Node2D.applyProp`.\n */\n/** @internal */\nexport function applyProp<Ext, Int = Ext>(\n host: ReactiveHost,\n field: string,\n initial: Ext | (() => Ext) | undefined,\n options?: PropOptions<Ext, Int>,\n): void {\n const existing = host.__cells?.slots.get(field);\n if (!existing) {\n registerProp<Int>(host, field, options);\n } else if (options) {\n // Allow subclasses to refine tween/mapper on an inherited field.\n if (options.tween) {\n (ensureCells(host).tweens ??= new Map()).set(field, options.tween as TweenFn<any>);\n }\n if (options.mapper) {\n (ensureCells(host).mappers ??= new Map()).set(field, options.mapper as (ext: any, prev?: any) => any);\n }\n }\n host._writeProp(field, initial);\n}\n\n/** Snapshot every registered prop's current value/binding into a plain object. */\n/** @internal */\nexport function collectProperties(host: ReactiveHost): Record<string, any> {\n const result: Record<string, any> = {};\n if (host.__cells) {\n for (const key of host.__cells.slots.keys()) {\n result[key] = (host as any)[key];\n }\n }\n return result;\n}\n\n// ---- State stack (save / restore) -----------------------------------------\n\n/**\n * Every declared prop of a node, captured as the value **or binding** its slot\n * holds — see {@link Node2D.captureProps}, which is the public way to make one.\n *\n * Keyed by prop name. Opaque on purpose: what a slot holds is the *mapped*,\n * internal form, and reading it out to write back through `set` is exactly the\n * round-trip a layer exists to avoid.\n */\nexport type PropLayer = Map<string, PropSnapshot<any>>;\n\n/** Snapshot every prop slot (value or binding) into a fresh layer. */\n/** @internal */\nexport function captureLayer(host: ReactiveHost): PropLayer {\n const layer: PropLayer = new Map();\n const slots = host.__cells?.slots;\n if (!slots) return layer;\n for (const [key, slot] of slots) {\n layer.set(key, slot.snapshot());\n }\n return layer;\n}\n\n/** Push a snapshot of every prop slot (value or binding) onto the stack. */\n/** @internal */\nexport function saveState(host: ReactiveHost): void {\n if (!host.__cells) return;\n host._stateStack.push(captureLayer(host));\n}\n\n/** Pop the top snapshot layer, or `undefined` if the stack is empty. */\n/** @internal */\nexport function popState(host: ReactiveHost): PropLayer | undefined {\n return host._stateStack.pop();\n}\n\n/** Instantly reapply a snapshot layer to every captured slot. */\n/** @internal */\nexport function applySnapshotLayer(host: ReactiveHost, layer: PropLayer): void {\n const slots = host.__cells?.slots;\n if (!slots) return;\n for (const [key, snap] of layer) {\n slots.get(key)?.restoreFrom(snap);\n }\n}\n\n/**\n * Animated restore: tween the numeric / custom-tweenable props toward their\n * saved resolved values, then reapply the full snapshot so bindings are\n * restored (not frozen at the tween's landing value) and non-tweened props snap.\n *\n * A {@link Command} rather than a generator: `_prepareStep`'s stepper already\n * drives the tween as a pure function of elapsed time, so `driveCommand` wraps\n * it directly and fires the snapshot reapply exactly at `t === 1` — the same\n * \"commit at the end, restore what came before below it\" shape\n * `packages/components/code`'s `runTransition` uses.\n *\n * `_prepareStep` is called **lazily, on the command's first evaluation**, not\n * when this function runs — it snapshots each prop's `from` off the *live*\n * node, and a generator's body (what this replaces) never ran a line until the\n * caller's first `.next()` either. Building it eagerly would snapshot whatever\n * the node happened to hold at `restore()`-call time instead of at first-drive\n * time, which can differ if the caller does more to the node in between.\n */\n/** @internal */\nexport function restoreAnimated(\n host: ReactiveHost,\n layer: PropLayer | undefined,\n duration: number,\n easing?: EasingFunction,\n): Command<Record<string, never>> {\n let stepper: TweenStepper | null = null;\n\n return driveCommand(duration, (t) => {\n if (!stepper) {\n // `to()` reads each snapshot's resolved `value` (correct even for a\n // bound slot), so the node animates back to where it *was*.\n const target: Record<string, unknown> = {};\n if (layer) {\n for (const [key, snap] of layer) {\n target[key] = snap.value;\n }\n }\n stepper = host._prepareStep(target, duration);\n }\n stepper.seek(t * duration);\n if (layer && t >= 1) applySnapshotLayer(host, layer);\n }, easing);\n}\n"]}
1
+ {"version":3,"file":"node-reactive.js","sourceRoot":"","sources":["../../../src/nodes/node/node-reactive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAgB,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,WAAW,EAAqB,MAAM,cAAc,CAAC;AAE9D,OAAO,EAAE,YAAY,EAAgB,MAAM,iBAAiB,CAAC;AA2B7D;;;;;GAKG;AACH,gBAAgB;AAChB,MAAM,UAAU,YAAY,CAAM,IAAkB,EAAE,KAAa,EAAE,OAA+B;IAChG,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAM,SAA2B,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IACzE,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IAChC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC7B,IAAI,OAAO,EAAE,KAAK,EAAE,CAAC;QACjB,CAAC,KAAK,CAAC,MAAM,KAAK,IAAI,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,KAAqB,CAAC,CAAC;IAC3E,CAAC;IACD,IAAI,OAAO,EAAE,MAAM,EAAE,CAAC;QAClB,CAAC,KAAK,CAAC,OAAO,KAAK,IAAI,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,MAAuC,CAAC,CAAC;IAC9F,CAAC;IACD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K,EAAE,CAAC;QAC9B,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,gBAAgB;AAChB,MAAM,UAAU,eAAe,CAC3B,IAAkB,EAClB,KAA4B,EAC5B,QAAgB,EAChB,MAAuB;IAEvB,IAAI,OAAO,GAAwB,IAAI,CAAC;IAExC,OAAO,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;QAChC,IAAI,CAAC,OAAO,EAAE,CAAC;YACX,oEAAoE;YACpE,4DAA4D;YAC5D,MAAM,MAAM,GAA4B,EAAE,CAAC;YAC3C,IAAI,KAAK,EAAE,CAAC;gBACR,KAAK,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,KAAK,EAAE,CAAC;oBAC9B,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC;gBAC7B,CAAC;YACL,CAAC;YACD,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAClD,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC;QAC3B,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC;YAAE,kBAAkB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACzD,CAAC,EAAE,MAAM,CAAC,CAAC;AACf,CAAC","sourcesContent":["import { PropSlot, PropSnapshot } from \"@/props/slot\";\r\nimport { ensureCells, PropHost, TweenFn } from \"@/props/host\";\r\nimport { EasingFunction } from \"@/tween/ease/type\";\r\nimport { driveCommand, type Command } from \"@/tween/command\";\r\nimport { TweenStepper } from \"@/tween/stepper\";\r\nimport { PropOptions } from \"@/attributes/properties/decorator\";\r\n\r\n/**\r\n * Companion implementation of {@link Node2D}'s property machinery and its\r\n * save/restore state stack. The bodies live here as free functions over a\r\n * narrow {@link ReactiveHost} so `node.ts` keeps only thin delegators (and the\r\n * hot-path `set`/`_writeProp`, which stay inline on the class). Mirrors the\r\n * existing `getPropSlot(host, name)` pattern in `props/host.ts`.\r\n */\r\n\r\n/**\r\n * The slice of a {@link Node2D} these helpers touch: the {@link PropHost} maps\r\n * plus the internal write/tween seams. `_writeProp` and `_prepareStep` remain\r\n * methods on `Node2D`; the helpers call back through them so subclass behaviour\r\n * and the inline hot path are preserved.\r\n */\r\n/** @internal */\r\nexport interface ReactiveHost extends PropHost {\r\n readonly id: string;\r\n _writeProp(field: string, value: unknown): void;\r\n _prepareStep(to: Record<string, unknown>, duration: number, easing?: EasingFunction): TweenStepper;\r\n /** LIFO stack of save() snapshot layers; owned as an instance field on Node2D. */\r\n _stateStack: Map<string, PropSnapshot<any>>[];\r\n}\r\n\r\n/**\r\n * Create the {@link PropSlot} + accessor for a freshly-declared prop and register\r\n * its tween/mapper metadata. Extracted from `Node2D._registerProp`; defines the\r\n * getter/setter on `host` so writes route through `host._writeProp`\r\n * (mapper-aware, binding-aware).\r\n */\r\n/** @internal */\r\nexport function registerProp<Int>(host: ReactiveHost, field: string, options?: PropOptions<any, Int>): void {\r\n const slot = new PropSlot<Int>(undefined as unknown as Int, host, field);\r\n const cells = ensureCells(host);\r\n cells.slots.set(field, slot);\r\n if (options?.tween) {\r\n (cells.tweens ??= new Map()).set(field, options.tween as TweenFn<any>);\r\n }\r\n if (options?.mapper) {\r\n (cells.mappers ??= new Map()).set(field, options.mapper as (ext: any, prev?: any) => any);\r\n }\r\n Object.defineProperty(host, field, {\r\n get: () => slot.get(),\r\n set: (value: any) => host._writeProp(field, value),\r\n enumerable: true,\r\n configurable: true,\r\n });\r\n}\r\n\r\n/**\r\n * Apply (or re-apply) a prop's initial value plus optional tween/mapper. A first\r\n * call creates the cell via {@link registerProp}; a subsequent call for the same\r\n * field reuses the cell and only refines its tween/mapper (so a subclass can\r\n * override a parent default without losing the cell or its bindings), then\r\n * writes the value. Extracted from `Node2D.applyProp`.\r\n */\r\n/** @internal */\r\nexport function applyProp<Ext, Int = Ext>(\r\n host: ReactiveHost,\r\n field: string,\r\n initial: Ext | (() => Ext) | undefined,\r\n options?: PropOptions<Ext, Int>,\r\n): void {\r\n const existing = host.__cells?.slots.get(field);\r\n if (!existing) {\r\n registerProp<Int>(host, field, options);\r\n } else if (options) {\r\n // Allow subclasses to refine tween/mapper on an inherited field.\r\n if (options.tween) {\r\n (ensureCells(host).tweens ??= new Map()).set(field, options.tween as TweenFn<any>);\r\n }\r\n if (options.mapper) {\r\n (ensureCells(host).mappers ??= new Map()).set(field, options.mapper as (ext: any, prev?: any) => any);\r\n }\r\n }\r\n host._writeProp(field, initial);\r\n}\r\n\r\n/** Snapshot every registered prop's current value/binding into a plain object. */\r\n/** @internal */\r\nexport function collectProperties(host: ReactiveHost): Record<string, any> {\r\n const result: Record<string, any> = {};\r\n if (host.__cells) {\r\n for (const key of host.__cells.slots.keys()) {\r\n result[key] = (host as any)[key];\r\n }\r\n }\r\n return result;\r\n}\r\n\r\n// ---- State stack (save / restore) -----------------------------------------\r\n\r\n/**\r\n * Every declared prop of a node, captured as the value **or binding** its slot\r\n * holds — see {@link Node2D.captureProps}, which is the public way to make one.\r\n *\r\n * Keyed by prop name. Opaque on purpose: what a slot holds is the *mapped*,\r\n * internal form, and reading it out to write back through `set` is exactly the\r\n * round-trip a layer exists to avoid.\r\n */\r\nexport type PropLayer = Map<string, PropSnapshot<any>>;\r\n\r\n/** Snapshot every prop slot (value or binding) into a fresh layer. */\r\n/** @internal */\r\nexport function captureLayer(host: ReactiveHost): PropLayer {\r\n const layer: PropLayer = new Map();\r\n const slots = host.__cells?.slots;\r\n if (!slots) return layer;\r\n for (const [key, slot] of slots) {\r\n layer.set(key, slot.snapshot());\r\n }\r\n return layer;\r\n}\r\n\r\n/** Push a snapshot of every prop slot (value or binding) onto the stack. */\r\n/** @internal */\r\nexport function saveState(host: ReactiveHost): void {\r\n if (!host.__cells) return;\r\n host._stateStack.push(captureLayer(host));\r\n}\r\n\r\n/** Pop the top snapshot layer, or `undefined` if the stack is empty. */\r\n/** @internal */\r\nexport function popState(host: ReactiveHost): PropLayer | undefined {\r\n return host._stateStack.pop();\r\n}\r\n\r\n/** Instantly reapply a snapshot layer to every captured slot. */\r\n/** @internal */\r\nexport function applySnapshotLayer(host: ReactiveHost, layer: PropLayer): void {\r\n const slots = host.__cells?.slots;\r\n if (!slots) return;\r\n for (const [key, snap] of layer) {\r\n slots.get(key)?.restoreFrom(snap);\r\n }\r\n}\r\n\r\n/**\r\n * Animated restore: tween the numeric / custom-tweenable props toward their\r\n * saved resolved values, then reapply the full snapshot so bindings are\r\n * restored (not frozen at the tween's landing value) and non-tweened props snap.\r\n *\r\n * A {@link Command} rather than a generator: `_prepareStep`'s stepper already\r\n * drives the tween as a pure function of elapsed time, so `driveCommand` wraps\r\n * it directly and fires the snapshot reapply exactly at `t === 1` — the same\r\n * \"commit at the end, restore what came before below it\" shape\r\n * `packages/components/code`'s `runTransition` uses.\r\n *\r\n * `_prepareStep` is called **lazily, on the command's first evaluation**, not\r\n * when this function runs — it snapshots each prop's `from` off the *live*\r\n * node, and a generator's body (what this replaces) never ran a line until the\r\n * caller's first `.next()` either. Building it eagerly would snapshot whatever\r\n * the node happened to hold at `restore()`-call time instead of at first-drive\r\n * time, which can differ if the caller does more to the node in between.\r\n */\r\n/** @internal */\r\nexport function restoreAnimated(\r\n host: ReactiveHost,\r\n layer: PropLayer | undefined,\r\n duration: number,\r\n easing?: EasingFunction,\r\n): Command<Record<string, never>> {\r\n let stepper: TweenStepper | null = null;\r\n\r\n return driveCommand(duration, (t) => {\r\n if (!stepper) {\r\n // `to()` reads each snapshot's resolved `value` (correct even for a\r\n // bound slot), so the node animates back to where it *was*.\r\n const target: Record<string, unknown> = {};\r\n if (layer) {\r\n for (const [key, snap] of layer) {\r\n target[key] = snap.value;\r\n }\r\n }\r\n stepper = host._prepareStep(target, duration);\r\n }\r\n stepper.seek(t * duration);\r\n if (layer && t >= 1) applySnapshotLayer(host, layer);\r\n }, easing);\r\n}\r\n"]}
@@ -12,9 +12,9 @@
12
12
  * and added then reads `elapsed === 0` on its first frame.
13
13
  */
14
14
  export interface NodeTime {
15
- /** Seconds since the scene started. */
15
+ /** Seconds since the clip started. */
16
16
  readonly total: number;
17
- /** The scene time at which this node was first advanced. */
17
+ /** The clip time at which this node was first advanced. */
18
18
  readonly creation: number;
19
19
  /** How long this node has existed: `total - creation`. */
20
20
  readonly elapsed: number;
@@ -34,6 +34,6 @@ export interface MutableNodeTime {
34
34
  }
35
35
  /** The zeroed holder a node keeps for its lifetime. @internal */
36
36
  export declare function createNodeTime(): MutableNodeTime;
37
- /** Advance `time` to `total` scene-seconds, seeding `creation` on first tick. @internal */
37
+ /** Advance `time` to `total` clip-seconds, seeding `creation` on first tick. @internal */
38
38
  export declare function advanceNodeTime(time: MutableNodeTime, total: number): void;
39
39
  //# sourceMappingURL=node-time.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"node-time.d.ts","sourceRoot":"","sources":["../../../src/nodes/node/node-time.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,QAAQ;IACrB,uCAAuC;IACvC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,4DAA4D;IAC5D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,0DAA0D;IAC1D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,iEAAiE;IACjE,OAAO,EAAE,OAAO,CAAC;CACpB;AAED,iEAAiE;AACjE,wBAAgB,cAAc,IAAI,eAAe,CAEhD;AAED,2FAA2F;AAC3F,wBAAgB,eAAe,CAAC,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAO1E"}
1
+ {"version":3,"file":"node-time.d.ts","sourceRoot":"","sources":["../../../src/nodes/node/node-time.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,QAAQ;IACrB,sCAAsC;IACtC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,2DAA2D;IAC3D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,0DAA0D;IAC1D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,iEAAiE;IACjE,OAAO,EAAE,OAAO,CAAC;CACpB;AAED,iEAAiE;AACjE,wBAAgB,cAAc,IAAI,eAAe,CAEhD;AAED,0FAA0F;AAC1F,wBAAgB,eAAe,CAAC,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAO1E"}
@@ -2,7 +2,7 @@
2
2
  export function createNodeTime() {
3
3
  return { total: 0, creation: 0, elapsed: 0, started: false };
4
4
  }
5
- /** Advance `time` to `total` scene-seconds, seeding `creation` on first tick. @internal */
5
+ /** Advance `time` to `total` clip-seconds, seeding `creation` on first tick. @internal */
6
6
  export function advanceNodeTime(time, total) {
7
7
  if (!time.started) {
8
8
  time.creation = total;
@@ -1 +1 @@
1
- {"version":3,"file":"node-time.js","sourceRoot":"","sources":["../../../src/nodes/node/node-time.ts"],"names":[],"mappings":"AAoCA,iEAAiE;AACjE,MAAM,UAAU,cAAc;IAC1B,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AACjE,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,eAAe,CAAC,IAAqB,EAAE,KAAa;IAChE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QAChB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACxB,CAAC;IACD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACnB,IAAI,CAAC,OAAO,GAAG,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC;AACzC,CAAC","sourcesContent":["/**\n * A node's place on the scene's clock, read via `node.time`.\n *\n * Advanced once per frame by `Node.attach`, and consumed by motion sampling,\n * the render context's `elapsed`, and anything a node's own `tick()` derives\n * from time.\n *\n * `creation` is seeded on the node's **first** advance rather than at\n * construction, so `elapsed` measures how long a node has been *in the scene* —\n * which is what an entrance animation, a video's playhead and a per-node\n * dissolve all actually mean. A node built during the generator's third second\n * and added then reads `elapsed === 0` on its first frame.\n */\nexport interface NodeTime {\n /** Seconds since the scene started. */\n readonly total: number;\n /** The scene time at which this node was first advanced. */\n readonly creation: number;\n /** How long this node has existed: `total - creation`. */\n readonly elapsed: number;\n}\n\n/**\n * The writable form the runtime advances. Nodes hand out {@link NodeTime}, which\n * is the same shape with every field read-only.\n *\n * @internal\n */\nexport interface MutableNodeTime {\n total: number;\n creation: number;\n elapsed: number;\n /** Whether {@link advanceNodeTime} has seeded `creation` yet. */\n started: boolean;\n}\n\n/** The zeroed holder a node keeps for its lifetime. @internal */\nexport function createNodeTime(): MutableNodeTime {\n return { total: 0, creation: 0, elapsed: 0, started: false };\n}\n\n/** Advance `time` to `total` scene-seconds, seeding `creation` on first tick. @internal */\nexport function advanceNodeTime(time: MutableNodeTime, total: number): void {\n if (!time.started) {\n time.creation = total;\n time.started = true;\n }\n time.total = total;\n time.elapsed = total - time.creation;\n}\n"]}
1
+ {"version":3,"file":"node-time.js","sourceRoot":"","sources":["../../../src/nodes/node/node-time.ts"],"names":[],"mappings":"AAoCA,iEAAiE;AACjE,MAAM,UAAU,cAAc;IAC1B,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AACjE,CAAC;AAED,0FAA0F;AAC1F,MAAM,UAAU,eAAe,CAAC,IAAqB,EAAE,KAAa;IAChE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QAChB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACxB,CAAC;IACD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACnB,IAAI,CAAC,OAAO,GAAG,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC;AACzC,CAAC","sourcesContent":["/**\r\n * A node's place on the scene's clock, read via `node.time`.\r\n *\r\n * Advanced once per frame by `Node.attach`, and consumed by motion sampling,\r\n * the render context's `elapsed`, and anything a node's own `tick()` derives\r\n * from time.\r\n *\r\n * `creation` is seeded on the node's **first** advance rather than at\r\n * construction, so `elapsed` measures how long a node has been *in the scene* —\r\n * which is what an entrance animation, a video's playhead and a per-node\r\n * dissolve all actually mean. A node built during the generator's third second\r\n * and added then reads `elapsed === 0` on its first frame.\r\n */\r\nexport interface NodeTime {\r\n /** Seconds since the clip started. */\r\n readonly total: number;\r\n /** The clip time at which this node was first advanced. */\r\n readonly creation: number;\r\n /** How long this node has existed: `total - creation`. */\r\n readonly elapsed: number;\r\n}\r\n\r\n/**\r\n * The writable form the runtime advances. Nodes hand out {@link NodeTime}, which\r\n * is the same shape with every field read-only.\r\n *\r\n * @internal\r\n */\r\nexport interface MutableNodeTime {\r\n total: number;\r\n creation: number;\r\n elapsed: number;\r\n /** Whether {@link advanceNodeTime} has seeded `creation` yet. */\r\n started: boolean;\r\n}\r\n\r\n/** The zeroed holder a node keeps for its lifetime. @internal */\r\nexport function createNodeTime(): MutableNodeTime {\r\n return { total: 0, creation: 0, elapsed: 0, started: false };\r\n}\r\n\r\n/** Advance `time` to `total` clip-seconds, seeding `creation` on first tick. @internal */\r\nexport function advanceNodeTime(time: MutableNodeTime, total: number): void {\r\n if (!time.started) {\r\n time.creation = total;\r\n time.started = true;\r\n }\r\n time.total = total;\r\n time.elapsed = total - time.creation;\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"node-walk.js","sourceRoot":"","sources":["../../../src/nodes/node/node-walk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAI1C;;;;;;GAMG;AAEH;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,IAAU,EAAE,KAAiB;IACrD,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC;AAED,wFAAwF;AACxF,MAAM,UAAU,WAAW,CAAC,IAAU,EAAE,KAAiB;IACrD,IAAI,CAAC,IAAI,CAAC,OAAO;QAAE,OAAO;IAC1B,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACzB,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC;IACnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE;QAAE,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,IAAU,EAAE,KAAyC;IAC9E,WAAW,CAAC,IAAI,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;AACjC,CAAC;AAED,SAAS,WAAW,CAAC,IAAU,EAAE,IAAY,EAAE,KAAyC;IACpF,IAAI,CAAC,IAAI,CAAC,OAAO;QAAE,OAAO;IAC1B,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAClB,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC;IACnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE;QAAE,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AACjG,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,IAAU,EAAE,IAAU;IAC9C,IAAwD,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;AACnF,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,IAAU;IACjC,IAAI,CAAC,OAAO,EAAE,CAAC;IACf,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ;QAAE,UAAU,CAAC,KAAK,CAAC,CAAC;AACzD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAAC,IAAU,EAAE,EAAU;IAClD,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;IACtB,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ;QAAE,eAAe,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAClE,CAAC","sourcesContent":["import { nodePath } from \"@/project/tree\";\nimport type { AssetScope } from \"@/assets/scope\";\nimport type { Node } from \"./node\";\n\n/**\n * The subtree traversals the runtime drives, as free functions over a {@link Node}:\n * what is left on `Node` is what a node *is*, and what is here is what the engine\n * *does to* one. Every walk stops at an unmounted node — see {@link Node.mounted}.\n *\n * @internal\n */\n\n/**\n * Declare one node's own assets — never its children's, so each node's\n * declarations stay attributable to it.\n */\nexport function declareNode(node: Node, scope: AssetScope): void {\n node.declareAssets(scope);\n}\n\n/** {@link declareNode} over `root` and every mounted descendant, in every dimension. */\nexport function declareTree(root: Node, scope: AssetScope): void {\n if (!root.mounted) return;\n declareNode(root, scope);\n const children = root._allChildren;\n for (let i = 0; i < children.length; i++) declareTree(children[i], scope);\n}\n\n/**\n * Visit `root` and every mounted descendant with its structural path.\n *\n * Indexed over every dimension's children, so a path does not shift when a sibling\n * of another dimension comes or goes the way a filtered `children` index would.\n */\nexport function forEachOwner(root: Node, visit: (node: Node, path: string) => void): void {\n visitOwners(root, \"\", visit);\n}\n\nfunction visitOwners(node: Node, path: string, visit: (node: Node, path: string) => void): void {\n if (!node.mounted) return;\n visit(node, path);\n const children = node._allChildren;\n for (let i = 0; i < children.length; i++) visitOwners(children[i], nodePath(path, i), visit);\n}\n\n/**\n * Bind `node` with `host`'s catalog, context and clock without adopting it — what a\n * runtime passes as `AssetDeclaration`'s `bindSubtree` for a `Tex.surface` source.\n */\nexport function bindDetached(host: Node, node: Node): void {\n (host as unknown as { attachDetached(node: Node): void }).attachDetached(node);\n}\n\n/**\n * Sample every node's derived render state (currently motion) for this frame.\n *\n * Normally done by `attach` as it advances the clock; this is the seam for the\n * priming path, which needs the same state seeded without moving time (see\n * `StateEvaluator.resetSlot`).\n */\nexport function sampleTree(node: Node): void {\n node._sample();\n for (const child of node.children) sampleTree(child);\n}\n\n/**\n * Record the subtree's current positions as the motion history's previous frame,\n * stamped `at`, deriving no velocity.\n *\n * The driven path calls this with the props evaluated one frame back, so the\n * {@link sampleTree} that follows measures against the timeline rather than\n * against wherever the playhead happened to be.\n */\nexport function primeMotionTree(node: Node, at: number): void {\n node._primeMotion(at);\n for (const child of node.children) primeMotionTree(child, at);\n}\n"]}
1
+ {"version":3,"file":"node-walk.js","sourceRoot":"","sources":["../../../src/nodes/node/node-walk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAI1C;;;;;;GAMG;AAEH;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,IAAU,EAAE,KAAiB;IACrD,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC;AAED,wFAAwF;AACxF,MAAM,UAAU,WAAW,CAAC,IAAU,EAAE,KAAiB;IACrD,IAAI,CAAC,IAAI,CAAC,OAAO;QAAE,OAAO;IAC1B,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,C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I,CAAC,QAAQ;QAAE,eAAe,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAClE,CAAC","sourcesContent":["import { nodePath } from \"@/project/tree\";\r\nimport type { AssetScope } from \"@/assets/scope\";\r\nimport type { Node } from \"./node\";\r\n\r\n/**\r\n * The subtree traversals the runtime drives, as free functions over a {@link Node}:\r\n * what is left on `Node` is what a node *is*, and what is here is what the engine\r\n * *does to* one. Every walk stops at an unmounted node — see {@link Node.mounted}.\r\n *\r\n * @internal\r\n */\r\n\r\n/**\r\n * Declare one node's own assets — never its children's, so each node's\r\n * declarations stay attributable to it.\r\n */\r\nexport function declareNode(node: Node, scope: AssetScope): void {\r\n node.declareAssets(scope);\r\n}\r\n\r\n/** {@link declareNode} over `root` and every mounted descendant, in every dimension. */\r\nexport function declareTree(root: Node, scope: AssetScope): void {\r\n if (!root.mounted) return;\r\n declareNode(root, scope);\r\n const children = root._allChildren;\r\n for (let i = 0; i < children.length; i++) declareTree(children[i], scope);\r\n}\r\n\r\n/**\r\n * Visit `root` and every mounted descendant with its structural path.\r\n *\r\n * Indexed over every dimension's children, so a path does not shift when a sibling\r\n * of another dimension comes or goes the way a filtered `children` index would.\r\n */\r\nexport function forEachOwner(root: Node, visit: (node: Node, path: string) => void): void {\r\n visitOwners(root, \"\", visit);\r\n}\r\n\r\nfunction visitOwners(node: Node, path: string, visit: (node: Node, path: string) => void): void {\r\n if (!node.mounted) return;\r\n visit(node, path);\r\n const children = node._allChildren;\r\n for (let i = 0; i < children.length; i++) visitOwners(children[i], nodePath(path, i), visit);\r\n}\r\n\r\n/**\r\n * Bind `node` with `host`'s catalog, context and clock without adopting it — what a\r\n * runtime passes as `AssetDeclaration`'s `bindSubtree` for a `Tex.surface` source.\r\n */\r\nexport function bindDetached(host: Node, node: Node): void {\r\n (host as unknown as { attachDetached(node: Node): void }).attachDetached(node);\r\n}\r\n\r\n/**\r\n * Sample every node's derived render state (currently motion) for this frame.\r\n *\r\n * Normally done by `attach` as it advances the clock; this is the seam for the\r\n * priming path, which needs the same state seeded without moving time (see\r\n * `StateEvaluator.resetSlot`).\r\n */\r\nexport function sampleTree(node: Node): void {\r\n node._sample();\r\n for (const child of node.children) sampleTree(child);\r\n}\r\n\r\n/**\r\n * Record the subtree's current positions as the motion history's previous frame,\r\n * stamped `at`, deriving no velocity.\r\n *\r\n * The driven path calls this with the props evaluated one frame back, so the\r\n * {@link sampleTree} that follows measures against the timeline rather than\r\n * against wherever the playhead happened to be.\r\n */\r\nexport function primeMotionTree(node: Node, at: number): void {\r\n node._primeMotion(at);\r\n for (const child of node.children) primeMotionTree(child, at);\r\n}\r\n"]}
@@ -37,7 +37,7 @@ export interface AttachScope {
37
37
  assets: AssetCatalog;
38
38
  /** The token map the parent provides to this node. */
39
39
  context: ContextMap;
40
- /** Scene-relative time, in seconds. */
40
+ /** Clip-relative time, in seconds. */
41
41
  time: number;
42
42
  }
43
43
  /**
@@ -252,6 +252,8 @@ export declare abstract class Node<P extends NodeProps = NodeProps> implements P
252
252
  * expands `to` in place and then delegates here.
253
253
  */
254
254
  _prepareStep(to: Partial<P>, duration: number, easing?: EasingFunction): TweenStepper;
255
+ /** What a node constructed without `field` holds: its declared default, through the mapper. */
256
+ private _unsetValue;
255
257
  /** @internal LIFO stack of save() snapshot layers. Underscore-internal so the prop companion can read it; not authoring surface. */
256
258
  _stateStack: PropLayer[];
257
259
  /**
@@ -297,7 +299,7 @@ export declare abstract class Node<P extends NodeProps = NodeProps> implements P
297
299
  /** This node's place on the scene clock. See {@link NodeTime}. */
298
300
  get time(): NodeTime;
299
301
  /**
300
- * Advance **this node's** clock to `total` scene-seconds, tick it, and
302
+ * Advance **this node's** clock to `total` clip-seconds, tick it, and
301
303
  * sample its derived render state.
302
304
  *
303
305
  * Per-node, not per-subtree: {@link attach} already recurses, so a recursive
@@ -410,7 +412,7 @@ export declare abstract class Node<P extends NodeProps = NodeProps> implements P
410
412
  * Insert `child` at `index` among this node's children.
411
413
  *
412
414
  * On {@link Node} rather than {@link Node2D} because it is tree machinery —
413
- * `SceneTimeline.syncPresence` reaches for it on whatever a spec's
415
+ * `ClipTimeline.syncPresence` reaches for it on whatever a spec's
414
416
  * `parentId` names, which since audio joined the graph is not always a 2D
415
417
  * node. `Node2D` overrides it for the animated insert, which measures the
416
418
  * child off-tree and so needs a laid-out one.
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/nodes/node/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAe,KAAK,OAAO,EAAE,KAAK,WAAW,EAAsB,MAAM,iBAAiB,CAAC;AAGlG,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAmB,WAAW,EAAE,MAAM,mCAAmC,CAAC;AASjF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAmC,KAAK,eAAe,EAAE,KAAK,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAC9G,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAGjE,YAAY,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAE5E,u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E,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAMpG,kEAAkE;IAClE,SAAS,CAAC,cAAc,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAO1D;;;OAGG;IACH,cAAc,IAAI,QAAQ,CAAC,IAAI,CAAC;IAIhC,0HAA0H;IAC1H,iBAAiB,CAAC,KAAK,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI;IAK3C,OAAO,CAAC,UAAU,CAA+B;IAEjD,OAAO,CAAC,SAAS;IAQjB,OAAO,CAAC,YAAY;IAQpB,OAAO,CAAC,YAAY;IAWpB,OAAO,IAAI,IAAI;CAalB"}
@@ -21,6 +21,13 @@ const HOSTS_OF = {
21
21
  "3d": "Put 3D nodes inside a <Canvas3D>, which is the one node that holds both.",
22
22
  audio: "Put audio nodes under an <AudioBus>, or directly on the scene root.",
23
23
  };
24
+ /** A withdrawn prop's options: every write, a tween's included, maps to the value its default maps to. */
25
+ function heldAtDefault(meta) {
26
+ const mapper = meta.options?.mapper;
27
+ const declared = typeof meta.default === "function" ? meta.default() : meta.default;
28
+ const held = declared === undefined || !mapper ? declared : mapper(declared, undefined);
29
+ return { ...meta.options, mapper: () => held };
30
+ }
24
31
  /**
25
32
  * The dimension-agnostic base of the scene graph: tree, identity, reactive
26
33
  * properties, commands, context, clock, asset declaration, teardown. Nothing
@@ -91,6 +98,10 @@ export class Node {
91
98
  }
92
99
  // Apply all @property()-decorated fields, reading initial values from props.
93
100
  for (const meta of getPropertyMeta(this)) {
101
+ if (meta.withdrawn) {
102
+ this.applyProp(meta.key, meta.default, heldAtDefault(meta));
103
+ continue;
104
+ }
94
105
  const propsVal = props ? props[meta.key] : undefined;
95
106
  const initial = propsVal !== undefined ? propsVal : meta.default;
96
107
  this.applyProp(meta.key, initial, meta.options);
@@ -211,7 +222,21 @@ export class Node {
211
222
  const mapper = this.__cells?.mappers?.get(field);
212
223
  if (typeof value === "function") {
213
224
  const extFn = value;
214
- slot.bind(mapper ? () => mapper(extFn(), slot.get()) : extFn);
225
+ if (mapper) {
226
+ // A binding that reads `undefined` — a node reference to a node that is
227
+ // not there — leaves the prop as a node built without it, and never
228
+ // reaches the mapper, which holds the shape the prop's readers go through.
229
+ let unset;
230
+ slot.bind(() => {
231
+ const read = extFn();
232
+ return read === undefined
233
+ ? (unset ??= { value: this._unsetValue(field, mapper) }).value
234
+ : mapper(read, slot.get());
235
+ });
236
+ }
237
+ else {
238
+ slot.bind(extFn);
239
+ }
215
240
  }
216
241
  else {
217
242
  slot.set(mapper ? mapper(value, slot.get()) : value);
@@ -293,8 +318,10 @@ export class Node {
293
318
  _prepareStep(to, duration, easing) {
294
319
  if (!this._mounted)
295
320
  return inertStepper(duration);
296
- // Numeric, mapper-free props (x/y/scale/rotation/opacity) write straight
297
- // to their slot — no property-setter / mapper indirection per step.
321
+ // A tween runs in stored space, so the destination is mapped once, here,
322
+ // and every step after it is a stored value written to the slot as it is.
323
+ // Writing a step through the setter would map it a second time, which only
324
+ // an idempotent mapper survives.
298
325
  const numCells = [];
299
326
  const numFrom = [];
300
327
  const numEnd = [];
@@ -305,7 +332,6 @@ export class Node {
305
332
  if (!slot)
306
333
  continue;
307
334
  const extVal = to[key];
308
- // Map external → internal so the tween operates in stored space.
309
335
  const mapper = this.__cells?.mappers?.get(key);
310
336
  const targetVal = mapper ? mapper(extVal, this[key]) : extVal;
311
337
  const tweenFn = this.__cells?.tweens?.get(key);
@@ -316,19 +342,12 @@ export class Node {
316
342
  });
317
343
  }
318
344
  else if (typeof targetVal === 'number') {
319
- if (mapper) {
320
- // Numeric but mapped: keep the setter path so the mapper runs.
321
- const from = this[key];
322
- customLerps.push((t) => { this[key] = from + (targetVal - from) * t; });
323
- }
324
- else {
325
- numCells.push(slot);
326
- numFrom.push(this[key]);
327
- numEnd.push(targetVal);
328
- }
345
+ numCells.push(slot);
346
+ numFrom.push(this[key]);
347
+ numEnd.push(targetVal);
329
348
  }
330
349
  else if (typeof targetVal === 'string') {
331
- stringSnaps.push([key, targetVal]);
350
+ stringSnaps.push([slot, targetVal]);
332
351
  }
333
352
  }
334
353
  const lerp = prepareNumericCellTween(numCells, numFrom, numEnd);
@@ -346,8 +365,8 @@ export class Node {
346
365
  // that end — leaving it out meant `seek(duration)` and running to
347
366
  // `duration` produced different nodes, and only the second was right.
348
367
  if (hasSnaps && t >= 1)
349
- for (const [key, val] of stringSnaps)
350
- this[key] = val;
368
+ for (const [slot, val] of stringSnaps)
369
+ slot.set(val);
351
370
  };
352
371
  let elapsed = 0;
353
372
  return {
@@ -369,6 +388,12 @@ export class Node {
369
388
  },
370
389
  };
371
390
  }
391
+ /** What a node constructed without `field` holds: its declared default, through the mapper. */
392
+ _unsetValue(field, mapper) {
393
+ const declared = getPropertyMeta(this).find((meta) => meta.key === field)?.default;
394
+ const initial = typeof declared === "function" ? declared() : declared;
395
+ return initial === undefined ? undefined : mapper(initial, undefined);
396
+ }
372
397
  // ---- State stack (save / restore) -------------------------------------
373
398
  // A per-node LIFO stack of property snapshots, mirroring Motion Canvas's
374
399
  // node.save()/restore(). `save()` pushes a snapshot of every declared prop;
@@ -420,7 +445,7 @@ export class Node {
420
445
  return this._time;
421
446
  }
422
447
  /**
423
- * Advance **this node's** clock to `total` scene-seconds, tick it, and
448
+ * Advance **this node's** clock to `total` clip-seconds, tick it, and
424
449
  * sample its derived render state.
425
450
  *
426
451
  * Per-node, not per-subtree: {@link attach} already recurses, so a recursive
@@ -615,7 +640,7 @@ export class Node {
615
640
  * Insert `child` at `index` among this node's children.
616
641
  *
617
642
  * On {@link Node} rather than {@link Node2D} because it is tree machinery —
618
- * `SceneTimeline.syncPresence` reaches for it on whatever a spec's
643
+ * `ClipTimeline.syncPresence` reaches for it on whatever a spec's
619
644
  * `parentId` names, which since audio joined the graph is not always a 2D
620
645
  * node. `Node2D` overrides it for the animated insert, which measures the
621
646
  * child off-tree and so needs a laid-out one.
@@ -1 +1 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eG;IADC,OAAO,EAAE;8BAGT;AA2KD;IADC,OAAO,EAAE;mCAST;AAyOD;IADC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC;sCAKrC","sourcesContent":["import { _observer, PropSlot } from \"@/props/slot\";\nimport { STRUCTURE_SLOT } from \"@/props/observer\";\nimport { PropHost, type PropCells } from \"@/props/host\";\nimport { EasingFunction } from \"@/tween/ease/type\";\nimport { toCommand } from \"@/tween/to-command\";\nimport { makeCommand, type Command, type CommandArgs, type CommandTarget } from \"@/tween/command\";\nimport { prepareNumericCellTween } from \"@/tween/prepare\";\nimport { inertCommand, inertStepper } from \"@/tween/inert\";\nimport { TweenStepper } from \"@/tween/stepper\";\nimport { RefTarget } from \"@/util/reference\";\nimport { Context, ContextMap } from \"@/util/context\";\nimport { AssetCatalog } from \"@/assets/catalog\";\nimport type { AssetScope } from \"@/assets/scope\";\nimport type { AudioScope } from \"@/attributes/audio/schedule\";\nimport { getPropertyMeta, PropOptions } from \"@/attributes/properties/decorator\";\nimport {\n applyProp,\n applySnapshotLayer,\n collectProperties,\n popState,\n restoreAnimated,\n saveState,\n} from \"./node-reactive\";\nimport type { PropLayer } from \"./node-reactive\";\nimport { advanceNodeTime, createNodeTime, type MutableNodeTime, type NodeTime } from \"@/nodes/node/node-time\";\nimport type { PropInputs } from \"@/attributes/properties/inputs\";\nimport { command } from \"@/tween/command-decorator\";\n\nexport type { NodeTime } from \"@/nodes/node/node-time\";\nexport type { PropInput, PropInputs } from \"@/attributes/properties/inputs\";\n\n/** Which scene graph a node belongs to. See {@link Node.dimension}. */\nexport type NodeDimension = \"2d\" | \"3d\" | \"audio\";\n\n/** Where a node of each dimension is allowed to live, for the mismatch error. */\nconst HOSTS_OF: Record<NodeDimension, string> = {\n \"2d\": \"2D nodes go in the 2D tree, or inside a <Canvas3D> as a HUD over its scene.\",\n \"3d\": \"Put 3D nodes inside a <Canvas3D>, which is the one node that holds both.\",\n audio: \"Put audio nodes under an <AudioBus>, or directly on the scene root.\",\n};\n\nexport interface NodeMetadata<T extends Node> {\n /**\n * Handle written with this node at construction. Typed as {@link RefTarget}\n * rather than `Reference<T>` so a ref declared as one of `T`'s *supertypes*\n * is accepted (`createRef<ShapeNode>()` on a `<Rect>`) — see the note there\n * for why that direction is the sound one.\n */\n ref?: RefTarget<T>;\n}\n\nexport type NodeConfig<T extends Node, P> = PropInputs<P> & NodeMetadata<T>;\n\n/**\n * Everything {@link Node.attach} needs to put a subtree into a live scene.\n *\n * The three things tree membership supplies, and the only three: what assets are\n * available, what context the ancestors provide, and where the playhead is.\n */\nexport interface AttachScope {\n /** Metadata for the assets this scene may declare. */\n assets: AssetCatalog;\n /** The token map the parent provides to this node. */\n context: ContextMap;\n /** Scene-relative time, in seconds. */\n time: number;\n}\n\n/**\n * A JSX/`children` child: a single {@link Node}, an arbitrarily-nested array of\n * children, or a falsy value. Nesting is allowed so `.map()` results can be\n * dropped straight in as a child, and falsy values are allowed so\n * `{condition && <Node/>}` works like in React — the constructor flattens\n * (`.flat(Infinity)`) and filters out everything but `Node` instances.\n */\nexport type NodeChildren = Node | false | null | undefined | NodeChildren[];\n\n/**\n * The props every node has, in either dimension.\n *\n * Deliberately tiny. Everything that reads as \"a box on a page\" — `x`/`y`,\n * `width`/`height`, `padding`, `flex`, anchors, `opacity` — lives on\n * {@link Node2DProps}, and everything that reads as \"a thing in space\" —\n * `position`, `quaternion`, `castShadow` — lives on `Node3DProps`, because a\n * prop that means nothing for half the tree is worse than no prop at all.\n */\nexport interface NodeProps {\n children: NodeChildren;\n /**\n * Seeds {@link Node.id}. A document's `NodeSpec.id` supplies it — see\n * `Registry.instantiate` — so an instantiated node answers to the identity\n * its row was authored under. Left out, the node falls back to a UUID, which\n * is what every hand-written `new Rect({…})` and JSX element gets.\n */\n id?: string;\n /**\n * The handle a node is *referenced by*, as against {@link NodeProps.id},\n * which addresses it. `\"=[card.x]\"` in any prop reads the `x` of the node\n * keyed `card` — see `NodeSpec.key`.\n *\n * Optional and never generated — a node has one only because an author wrote\n * one, which is what makes it safe to point a formula at — and unique per\n * document, which `document/validate.ts` enforces.\n */\n key?: string;\n}\n\n/**\n * The dimension-agnostic base of the scene graph: tree, identity, reactive\n * properties, commands, context, clock, asset declaration, teardown. Nothing\n * about *where* a node is or *how* it draws — that's {@link Node2D} / `Node3D`.\n * They meet only at `Canvas3D`; mixing them anywhere else throws (see\n * {@link acceptsChild}).\n *\n * Subclasses call {@link initProps} from their own constructor rather than the\n * base doing it: a subclass's field initializers only run *after* `super()`\n * returns, so applying `@property` defaults any earlier would write into cells\n * that don't exist yet.\n */\nexport abstract class Node<P extends NodeProps = NodeProps> implements PropHost {\n /**\n * Which scene graph this node belongs to.\n *\n * A getter rather than a field so it is answerable from the prototype during\n * construction, before any subclass field initializer has run.\n */\n abstract get dimension(): NodeDimension;\n\n constructor(props?: NodeConfig<any, P>) {\n // Retain the raw props (see _props doc) so a provider's provideContext can\n // read which keys the author passed. Captured before any default\n // application so it reflects exactly what the author passed. The object is\n // retained by reference, so a subclass expanding prop sugar in place\n // afterwards (`size`, `transform3D`) is reflected here too.\n this._props = props;\n // Neither is a @property: identity does not tween, so neither has any\n // business in the table `set()`, `to()` and the baseline restore walk\n // iterate.\n const identity = props as { id?: string; key?: string } | undefined;\n this.key = identity?.key;\n // Nullish, never falsy: `\"\"` is the scene root's real id, not a missing\n // one (`checkRootShape` in document/validate.ts defines the root as the\n // row holding it), and a UUID in its place would have the host's tree\n // report a root no document row mentions.\n this.id = identity?.id ?? crypto.randomUUID();\n }\n\n /** See {@link NodeProps.key}. */\n key?: string;\n\n private _hidden = false;\n private _locked = false;\n\n /**\n * Hidden by the editor — no paint, no pick, no layout slot. See\n * {@link NodeEditorState.hidden}.\n */\n get hidden(): boolean {\n return this._hidden;\n }\n\n /** Locked by the editor — unpickable, but drawn. See {@link NodeEditorState.locked}. */\n get locked(): boolean {\n return this._locked;\n }\n\n /**\n * @internal — written only by `applyEditorStates`, which owns both flags for\n * the whole tree. Not a setter pair, so a caller cannot set one and leave the\n * other holding a previous frame's answer.\n */\n _setEditorState(hidden: boolean, locked: boolean): void {\n this._hidden = hidden;\n this._locked = locked;\n }\n\n /**\n * Fire the `ref` and apply every `@property()`-decorated field, reading\n * initial values from `props`.\n *\n * Called by the concrete constructor ({@link Node2D}'s, `Node3D`'s) rather\n * than by this one, because a subclass's field initializers run *after*\n * `super()` returns: doing this here would apply props while the cells those\n * props write into are still `undefined`.\n */\n protected initProps(props?: NodeConfig<any, P>): void {\n if (props?.ref) {\n props.ref(this as any);\n }\n\n // Apply all @property()-decorated fields, reading initial values from props.\n for (const meta of getPropertyMeta(this)) {\n const propsVal = props ? (props as any)[meta.key] : undefined;\n const initial = propsVal !== undefined ? propsVal : meta.default;\n this.applyProp(meta.key, initial, meta.options);\n }\n }\n\n /**\n * Adopt the `children` prop. Called by the concrete constructor after its own\n * defaults are in place, so a child never lands in a tree whose parent has not\n * finished sizing itself.\n */\n protected adoptChildrenProp(props?: NodeConfig<any, P>): void {\n if (props && (props as any).children) {\n const raw = Array.isArray((props as any).children) ? (props as any).children : [(props as any).children];\n const flat = (raw as unknown[]).flat(Infinity)\n .filter((c: unknown): c is Node => c instanceof Node);\n if (flat.length > 0) this._addChildren(flat);\n }\n }\n\n /**\n * Whether `child` may be adopted by this node.\n *\n * A node holds children of its own dimension; the places the trees meet are\n * `Canvas3D`, which takes 2D and 3D, and `Canvas2D`, which takes 2D and\n * audio. Both partition what they accept. Rejecting the mix here rather than\n * letting it through is deliberate: a `Box3D` parented to a `Rect` would be\n * silently skipped by both the layout walk and the 3D walk, and would simply\n * never appear.\n */\n protected acceptsChild(child: Node): boolean {\n return child.dimension === this.dimension;\n }\n\n /** Throw if `child` belongs to another dimension. */\n protected assertAcceptsChild(child: Node): void {\n if (this.acceptsChild(child)) return;\n throw new TypeError(\n `${this.className} (${this.dimension}) cannot hold ${child.className} (${child.dimension}). ` +\n `${HOSTS_OF[child.dimension]}`,\n );\n }\n\n private _assets: AssetCatalog | null = null;\n protected _parent: Node | null = null;\n\n /**\n * Whether this node is in a live scene tree. Gates measure/layout/render,\n * asset declaration and every command — checked at the handful of places\n * the framework dispatches from, not per method.\n */\n private _mounted = false;\n\n /** See {@link _mounted}. */\n get mounted(): boolean {\n return this._mounted;\n }\n\n get parent(): Node | null {\n if (_observer !== null) _observer.read(this._structureSlot());\n return this._parent;\n }\n\n get assets(): AssetCatalog {\n if (!this._assets) throw new Error(\"Assets not bound — this node is not attached to a scene. See Node.attach().\");\n return this._assets;\n }\n\n /** Token→value map pushed down from ancestor providers, bound by {@link attach}. */\n private _context: ContextMap = ContextMap.EMPTY;\n /** True once {@link attach} has reached this node. */\n private _contextBound = false;\n\n /** Raw constructor props, retained so {@link provideContext} can see which keys were explicitly passed. Kept through {@link dispose} so a reused instance re-derives context on the next attach. */\n protected _props?: NodeConfig<any, P>;\n\n /** Read the nearest ancestor provider's value for `ctx` (or its default). */\n useContext<T>(ctx: Context<T>): T {\n return this._context.get(ctx);\n }\n\n /** Assigned in the constructor — see {@link NodeProps.id}. */\n readonly id: string;\n\n /**\n * The slots behind this node's `@property` fields. See {@link PropCells}.\n *\n * @internal — the authoring surface is the declared props themselves, plus\n * `set()`/`to()`/`captureProps()`.\n */\n __cells?: PropCells;\n\n protected _children: Node[] = [];\n\n /**\n * Flatten a constructor's raw `children` prop into the `Node` instances it\n * contains, without mutating or adding them — the same normalisation the\n * constructor applies before adding them, exposed standalone so\n * {@link applyDefaultSize} overrides can inspect children's own resolved\n * `width`/`height` *before* they're attached (JSX children are constructed,\n * defaults and all, before being passed in as props).\n */\n protected static flattenChildrenProp(props: { children?: unknown } | undefined): Node[] {\n const childProp = props ? props.children : undefined;\n if (!childProp) return [];\n const raw = Array.isArray(childProp) ? childProp : [childProp];\n return (raw as unknown[]).flat(Infinity).filter((c: unknown): c is Node => c instanceof Node);\n }\n\n // ---- Reactive properties ----------------------------------------------\n\n /**\n * Declare a prop on this node. Creates a {@link PropSlot}-backed accessor\n * for `field`, applies an initial value (callback → binding; otherwise\n * constant), and registers optional tween/mapper metadata used by `set()`\n * and `to()`.\n *\n * Subsequent calls for the same field reuse the existing slot and act as\n * a value assignment, so subclasses can override a parent's default by\n * calling applyProp again without losing the slot or its bindings.\n */\n protected applyProp<Ext, Int = Ext>(\n field: string,\n initial: Ext | (() => Ext) | undefined,\n options?: PropOptions<Ext, Int>,\n ): void {\n applyProp(this, field, initial, options);\n }\n\n /** @internal Hot-path prop write (mapper- and binding-aware). Public-but-underscored like `_prepareStep` so reactive companions in this directory can call it; not part of the authoring surface. */\n _writeProp(field: string, value: unknown): void {\n if (value === undefined) return;\n const slot = this.__cells?.slots.get(field);\n if (!slot) return;\n const mapper = this.__cells?.mappers?.get(field);\n if (typeof value === \"function\") {\n const extFn = value as () => any;\n slot.bind(mapper ? () => mapper(extFn(), slot.get()) : extFn);\n } else {\n slot.set(mapper ? mapper(value, slot.get()) : value);\n }\n }\n\n get properties(): P {\n return collectProperties(this) as P;\n }\n\n /**\n * This node's **class** name, for a message or a host's type column. Not an\n * authored identity — those are {@link id} and {@link key}, and nothing in\n * the document model is called a name any more. Nor is it the registry key a\n * document writes in `NodeSpec.type`: a minifier is free to rename a class.\n */\n get className(): string {\n return this.constructor.name;\n }\n\n set(props: { [K in keyof P]?: P[K] | (() => P[K]) }): void {\n const slots = this.__cells?.slots;\n if (!slots) return;\n // Iterate the caller's keys (usually 1–3) rather than every registered\n // prop (15+): set() runs in the per-frame hot path. Only keys backed by\n // a slot are written; unknown keys are ignored — which is also what\n // lets a subclass distribute its own sugar (2D's `size`, `transform3D`)\n // into real keys and then delegate here.\n for (const key in props) {\n const val = (props as any)[key];\n if (val !== undefined && slots.has(key)) this._writeProp(key, val);\n }\n }\n\n @command()\n to<D extends Partial<P> = Partial<P>>(args: CommandArgs<D> & { duration: number }): Command<P> {\n return toCommand<P>(this, args.data ?? {}, args.duration, args.easing);\n }\n\n /**\n * Build a {@link Command} from a pure function of normalized time — an\n * animation this node can be *evaluated* at, not only run through.\n *\n * The pair to {@link to}, and the seam a named command is written against.\n * `to()` covers \"move these props there\", which is most of it; this covers\n * everything a node wants to choreograph itself, where the values at time\n * `t` are a function the node knows and nobody outside could reconstruct\n * from a prop list.\n *\n * ```ts\n * @command()\n * draw(duration = 1, easing?: EasingFunction): Command<ChartProps> {\n * const from = this.progress;\n * return this.command((t) => ({ progress: lerpNumber(from, 1, t) }), duration, easing);\n * }\n * ```\n *\n * Snapshot whatever the animation starts from *outside* the callback, as\n * above — reading `this.progress` inside it would re-read the value the\n * command is itself writing, and the tween would chase its own tail.\n *\n * Prefer this over a `*method(): FrameGenerator`. A generator can only be\n * advanced, so a host that wants frame N has to run frames 0..N-1 to get it;\n * the same choreography as a `Command` can be asked directly.\n *\n * (The `@command()` above it is the *decorator*, which only records that the\n * method is offerable. This builds the thing it returns.)\n */\n protected command<Props = P>(\n at: (t: number) => Partial<Props>,\n duration: number = 1,\n easing?: EasingFunction,\n ): Command<Props> {\n if (!this._mounted) return inertCommand<Props>(this, duration);\n return makeCommand<Props>(\n this as unknown as CommandTarget<Props>,\n at,\n duration,\n easing,\n );\n }\n\n /**\n * Resolve a single `to()` step into a flat {@link TweenStepper} — all the\n * per-key setup (mapper, numeric-vs-custom routing) happens once here, then\n * `advance(dt)` is allocation-free. Used by both a chain's iterator path and\n * the batched `parallel` path.\n *\n * A subclass with positional sugar of its own (2D's `size` and anchors)\n * expands `to` in place and then delegates here.\n */\n _prepareStep(to: Partial<P>, duration: number, easing?: EasingFunction): TweenStepper {\n if (!this._mounted) return inertStepper(duration);\n // Numeric, mapper-free props (x/y/scale/rotation/opacity) write straight\n // to their slot — no property-setter / mapper indirection per step.\n const numCells: PropSlot<number>[] = [];\n const numFrom: number[] = [];\n const numEnd: number[] = [];\n const customLerps: Array<(t: number) => void> = [];\n const stringSnaps: Array<[string, string]> = [];\n\n for (const key of Object.keys(to)) {\n const slot = this.__cells?.slots.get(key);\n if (!slot) continue;\n const extVal = (to as any)[key];\n // Map external → internal so the tween operates in stored space.\n const mapper = this.__cells?.mappers?.get(key);\n const targetVal = mapper ? mapper(extVal, (this as any)[key]) : extVal;\n const tweenFn = this.__cells?.tweens?.get(key);\n if (tweenFn) {\n const from = (this as any)[key];\n customLerps.push((t) => {\n slot.set(tweenFn(from, targetVal, t));\n });\n } else if (typeof targetVal === 'number') {\n if (mapper) {\n // Numeric but mapped: keep the setter path so the mapper runs.\n const from = (this as any)[key] as number;\n customLerps.push((t) => { (this as any)[key] = from + (targetVal - from) * t; });\n } else {\n numCells.push(slot as PropSlot<number>);\n numFrom.push((this as any)[key] as number);\n numEnd.push(targetVal as number);\n }\n } else if (typeof targetVal === 'string') {\n stringSnaps.push([key, targetVal]);\n }\n }\n\n const lerp = prepareNumericCellTween(numCells, numFrom, numEnd);\n const hasCustom = customLerps.length > 0;\n const hasSnaps = stringSnaps.length > 0;\n\n const apply = (t: number): void => {\n const easedT = easing ? easing(t) : t;\n lerp(easedT);\n if (hasCustom) for (const fn of customLerps) fn(easedT);\n // A discrete prop has nothing between its endpoints, so it snaps at\n // the end rather than interpolating. Applied here rather than only in\n // `advance` because a `seek` past the end has, by definition, reached\n // that end — leaving it out meant `seek(duration)` and running to\n // `duration` produced different nodes, and only the second was right.\n if (hasSnaps && t >= 1) for (const [key, val] of stringSnaps) (this as any)[key] = val;\n };\n\n let elapsed = 0;\n return {\n // Tracks `elapsed`, so a seek and a subsequent advance agree about\n // where the tween is. Without it, seeking forward then advancing\n // rewound to `dt`.\n seek: (e: number) => {\n elapsed = e;\n apply(duration > 0 ? Math.min(e / duration, 1) : 1);\n },\n advance: (dt: number): boolean => {\n elapsed += dt;\n if (elapsed < duration) {\n apply(elapsed / duration);\n return false;\n }\n apply(1);\n return true;\n },\n };\n }\n\n // ---- State stack (save / restore) -------------------------------------\n // A per-node LIFO stack of property snapshots, mirroring Motion Canvas's\n // node.save()/restore(). `save()` pushes a snapshot of every declared prop;\n // `restore()` pops the most recent one and either snaps to it (no duration)\n // or tweens the numeric props back to it over `duration`.\n\n /** @internal LIFO stack of save() snapshot layers. Underscore-internal so the prop companion can read it; not authoring surface. */\n _stateStack: PropLayer[] = [];\n\n /**\n * Push a snapshot of this node's current state onto its save stack.\n *\n * Every reactive prop (`x`, `y`, `scale`, `opacity`, `fill`, …) is captured,\n * preserving reactive bindings — a prop bound to `() => other().x` is saved\n * as the binding, not just its resolved value, so {@link restore} re-binds\n * it rather than freezing the value. Calls stack: each `save()` pushes a new\n * layer, and each {@link restore} pops the most recent one.\n *\n * @example\n * node.save();\n * node.moveTo({ data: { x: 200, y: 0 }, duration: 1 });\n * node.restore({ duration: 1 }); // animate back to where it was saved\n */\n save(): void {\n saveState(this);\n }\n\n /**\n * Pop the most recent {@link save} snapshot and roll this node back to it.\n *\n * Called with no `duration` (or `0`), every prop is reapplied instantly —\n * plain values are set, reactive bindings are re-bound. Called with a\n * positive `duration`, the numeric props (and any with a custom `tween`)\n * animate toward their saved values over that many seconds; once the tween\n * finishes the full snapshot is reapplied, which re-binds any reactive props\n * and snaps non-tweenable props (e.g. strings) to their saved values.\n *\n * A no-op (returns immediately) if there is nothing on the stack.\n */\n restore(): void;\n restore(args: CommandArgs<Record<string, never>> & { duration: number }): Command<Record<string, never>>;\n @command()\n restore(args?: CommandArgs<Record<string, never>>): void | Command<Record<string, never>> {\n const layer = popState(this);\n const duration = args?.duration;\n if (duration === undefined || duration <= 0) {\n if (layer) applySnapshotLayer(this, layer);\n return;\n }\n return restoreAnimated(this, layer, duration, args?.easing);\n }\n\n // ---- Clock ------------------------------------------------------------\n\n protected _time: MutableNodeTime = createNodeTime();\n\n /**\n * Per-frame hook, called after this node's {@link time} has been advanced.\n *\n * Nothing to do in the general case. Override it for state that has to\n * follow the clock but isn't a prop — a {@link Video}'s audio playhead is\n * the one built-in example. Read `this.time` for the current frame.\n */\n public tick(): void { }\n\n /** This node's place on the scene clock. See {@link NodeTime}. */\n public get time(): NodeTime {\n if (_observer !== null) _observer.clock?.(this);\n return this._time;\n }\n\n /**\n * Advance **this node's** clock to `total` scene-seconds, tick it, and\n * sample its derived render state.\n *\n * Per-node, not per-subtree: {@link attach} already recurses, so a recursive\n * advance here would re-advance every descendant once per ancestor.\n *\n * Sampling happens here, not at render: this runs on every advanced frame in\n * every playback path (forward, scrub, precomp), whereas `render` runs only\n * for displayed frames. Sampling per-frame is what makes velocity correct on\n * the first frame after a scrub/rewind, where sampling only at render time\n * read zero. The advance loop runs before `generator.next()` (so audio\n * scheduling in generator bodies reads the right time), which means x/y here\n * still hold the previous frame's value — velocity therefore trails the\n * rendered position by one frame. That lag is constant and identical forward\n * vs. scrub, and imperceptible for motion blur.\n */\n private _advanceOwnTime(total: number): void {\n advanceNodeTime(this._time, total);\n this.tick();\n this._sample();\n }\n\n /**\n * Sample this node's own derived render state for the current frame. Nothing\n * to derive in the general case; {@link Node2D} samples its motion here.\n *\n * @internal The per-node half of `sampleTree` — a walk, not a node method.\n */\n _sample(): void { }\n\n /**\n * Record this node's current position as the motion history's previous\n * frame, stamped `at`, deriving no velocity.\n *\n * @internal The per-node half of `primeMotionTree`.\n */\n _primeMotion(at: number): void { }\n\n // ---- Attachment -------------------------------------------------------\n\n /**\n * Put this subtree into the scene: mark it mounted, bind the asset catalog\n * and inherited context, advance its clock to `scope.time`.\n *\n * Safe and cheap to call every frame — an unchanged catalog/context\n * short-circuits, and {@link resolveContext} fires only on first attach.\n *\n * @internal Driven by `ClipInstance` per frame, and by {@link add} for a mid-frame subtree.\n */\n attach(scope: AttachScope): void {\n const first = !this._mounted;\n this._mounted = true;\n\n if (this._assets !== scope.assets) this._assets = scope.assets;\n\n const next = this.provideContext(scope.context);\n // Unchanged map, already bound, and not this instance's first attach ⇒\n // the whole subtree already holds `next` and the walk below would be pure\n // repetition of the context half. The time half still has to run.\n const contextChanged = !this._contextBound || this._context !== next;\n if (contextChanged) {\n this._context = next;\n this._contextBound = true;\n }\n if (first) this.resolveContext(next);\n\n this._advanceOwnTime(scope.time);\n\n if (this._children.length === 0) return;\n const childScope = next === scope.context ? scope : { ...scope, context: next };\n for (const child of this._children) child.attach(childScope);\n }\n\n /**\n * Take this subtree out of the scene. Not a teardown — props/children/bindings\n * stay, so it can be attached elsewhere (`reparent`). {@link dispose} tears down.\n *\n * @internal Driven by {@link remove}/{@link clear}.\n */\n detach(): void {\n if (!this._mounted) return;\n this._mounted = false;\n for (const child of this._children) child.detach();\n }\n\n /** The scope this node was last attached with, for handing to a late child. */\n private _currentScope(): AttachScope | null {\n return this._assets && this._contextBound\n ? { assets: this._assets, context: this._context, time: this._time.total }\n : null;\n }\n\n /** Attach `child` if this node is itself attached; otherwise leave it for the walk. */\n /** @internal Shared with `Node2D.addChildAt`, which splices rather than pushes. */\n protected _attachChild(child: Node): void {\n if (!this._mounted) return;\n const scope = this._currentScope();\n if (scope) child.attach(scope);\n }\n\n // ---- Context lifecycle ------------------------------------------------\n\n /**\n * Apply inherited context **values** to this node, once, after it's linked\n * into the tree and ancestor providers have resolved. Runs exactly once per\n * instance — never write idempotency guards here.\n *\n * Structure (which children exist) belongs in the constructor via\n * {@link add}, from props — never here. This only writes context-derived\n * values onto that already-built structure, via refs.\n *\n * @example\n * protected override resolveContext(ctx: ContextMap): void {\n * this.accent().set({ fill: ctx.get(ThemeToken).accent });\n * }\n */\n protected resolveContext(ctx: ContextMap): void { }\n\n /**\n * Providers override this to attach their token(s) to the {@link ContextMap}\n * handed to descendants. Base passes the parent's map through unchanged.\n */\n protected provideContext(parent: ContextMap): ContextMap {\n return parent;\n }\n\n /**\n * Bind `node`'s asset catalog, context and clock without making it a child —\n * for a node used purely as a pixel source (`Tex.surface`), laid out on\n * demand rather than sitting in the tree.\n */\n protected attachDetached(node: Node): void {\n const scope = this._currentScope();\n if (scope) node.attach(scope);\n }\n\n /**\n * Declare what this node draws from its props and inherited context alone —\n * never `layoutBounds` or the clock. The runtime records what this reads and\n * calls it again only when one of those props is written, so anything else it\n * depends on is a change nobody will ask about.\n */\n declareAssets(assets: AssetScope): void { }\n\n /**\n * Declare the clips this node plays. Called once, in the state the node enters\n * the tree in: a request is scheduled ahead of time, so a later write to what\n * it reads is not heard — automate a level with a curve, or split the row.\n */\n declareAudio(audio: AudioScope): void { }\n\n get children(): Node[] {\n if (_observer !== null) _observer.read(this._structureSlot());\n return this._children;\n }\n\n /**\n * Every child, both dimensions, unfiltered — unlike {@link children}, which\n * a {@link Node2D} filters to its own kind. Used where index has to match\n * the authored tree (picking), since filtering would renumber it.\n */\n get _allChildren(): readonly Node[] {\n if (_observer !== null) _observer.read(this._structureSlot());\n return this._children;\n }\n\n /**\n * Add children — a node, an array, or a nested/JSX mix; falsy entries\n * (`cond && <Node/>`) are dropped. A child of the other dimension throws —\n * see {@link acceptsChild}.\n */\n add(child: NodeChildren): void {\n if (child instanceof Node) {\n this._addChild(child);\n return;\n }\n const flat = Node.flattenChildrenProp({ children: child });\n if (flat.length > 0) this._addChildren(flat);\n }\n\n /** Remove children — same shapes as {@link add}. Not a child of this one is a no-op. */\n remove(child: NodeChildren): void {\n if (child instanceof Node) {\n this._removeChild(child);\n return;\n }\n for (const node of Node.flattenChildrenProp({ children: child })) {\n this._removeChild(node);\n }\n }\n\n /** Remove every child, detaching each (see {@link remove}). */\n clear(): void {\n for (const child of this._children) {\n if (_observer !== null) this._structureChanged(child);\n child._parent = null;\n child.detach();\n }\n this._children.length = 0;\n }\n\n /**\n * Insert `child` at `index` among this node's children.\n *\n * On {@link Node} rather than {@link Node2D} because it is tree machinery —\n * `SceneTimeline.syncPresence` reaches for it on whatever a spec's\n * `parentId` names, which since audio joined the graph is not always a 2D\n * node. `Node2D` overrides it for the animated insert, which measures the\n * child off-tree and so needs a laid-out one.\n */\n @command({ args: [\"child\", \"index\"] })\n addChildAt(args: CommandArgs<{ child: Node; index: number }>): void | Command<Record<string, never>> {\n const { child, index } = args.data as { child: Node; index: number };\n this.assertAcceptsChild(child);\n this._insertChildAt(child, index);\n }\n\n /** @internal Shared with `Node2D.addChildAt`'s instant branch. */\n protected _insertChildAt(child: Node, index: number): void {\n if (_observer !== null) this._structureChanged(child);\n this._children.splice(index, 0, child);\n child._parent = this;\n this._attachChild(child);\n }\n\n /**\n * @internal The pseudo-slot {@link children} and {@link parent} report to an\n * observer. Allocated on first observation, so a tree nobody observes carries none.\n */\n _structureSlot(): PropSlot<null> {\n return this._structure ??= new PropSlot<null>(null, this, STRUCTURE_SLOT);\n }\n\n /** @internal Report a child entering or leaving this node — its parent link changes with it. Call only while observed. */\n _structureChanged(child: Node | null): void {\n _observer!.write(this._structureSlot());\n if (child) _observer!.write(child._structureSlot());\n }\n\n private _structure: PropSlot<null> | null = null;\n\n private _addChild(child: Node): void {\n this.assertAcceptsChild(child);\n if (_observer !== null) this._structureChanged(child);\n this._children.push(child);\n child._parent = this;\n this._attachChild(child);\n }\n\n private _addChildren(children: Node[]): void {\n for (const child of children) this.assertAcceptsChild(child);\n if (_observer !== null) for (const child of children) this._structureChanged(child);\n this._children.push(...children);\n for (const child of children) child._parent = this;\n for (const child of children) this._attachChild(child);\n }\n\n private _removeChild(child: Node): void {\n const i = this._children.indexOf(child);\n if (i < 0) return;\n if (_observer !== null) this._structureChanged(child);\n const [removed] = this._children.splice(i, 1);\n if (removed) {\n removed._parent = null;\n removed.detach();\n }\n }\n\n dispose(): void {\n if (this.__cells) {\n for (const slot of this.__cells.slots.values()) {\n slot.dispose();\n }\n }\n this.__cells = undefined;\n this._assets = null;\n this._mounted = false;\n // _props is retained (authored identity) so provideContext still works after reuse.\n this._context = ContextMap.EMPTY;\n this._contextBound = false;\n }\n}\n"]}
1
+ {"version":3,"file":"node.js","sourceRoot":"","sources":["../../../src/nodes/node/node.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAsD,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,CAAC;IAEO,YAAY,CAAC,KAAW;QAC5B,MAAM,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACxC,IAAI,CAAC,GAAG,CAAC;YAAE,OAAO;QAClB,IAAI,SAAS,KAAK,IAAI;YAAE,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;QACtD,MAAM,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAC9C,IAAI,OAAO,EAAE,CAAC;YACV,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;YACvB,OAAO,CAAC,MAAM,EAAE,CAAC;QACrB,CAAC;IACL,CAAC;IAED,OAAO;QACH,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACf,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;gBAC7C,IAAI,CAAC,OAAO,EAAE,CAAC;YACnB,CAAC;QACL,CAAC;QACD,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;QACzB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,oFAAoF;QACpF,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC,KAAK,CAAC;QACjC,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;IAC/B,CAAC;CACJ;AAteG;IADC,OAAO,EAAE;8BAGT;AA6KD;IADC,OAAO,EAAE;mCAST;AAyOD;IADC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC;sCAKrC","sourcesContent":["import { _observer, PropSlot } from \"@/props/slot\";\r\nimport { STRUCTURE_SLOT } from \"@/props/observer\";\r\nimport { PropHost, type PropCells } from \"@/props/host\";\r\nimport { EasingFunction } from \"@/tween/ease/type\";\r\nimport { toCommand } from \"@/tween/to-command\";\r\nimport { makeCommand, type Command, type CommandArgs, type CommandTarget } from \"@/tween/command\";\r\nimport { prepareNumericCellTween } from \"@/tween/prepare\";\r\nimport { inertCommand, inertStepper } from \"@/tween/inert\";\r\nimport { TweenStepper } from \"@/tween/stepper\";\r\nimport { RefTarget } from \"@/util/reference\";\r\nimport { Context, ContextMap } from \"@/util/context\";\r\nimport { AssetCatalog } from \"@/assets/catalog\";\r\nimport type { AssetScope } from \"@/assets/scope\";\r\nimport type { AudioScope } from \"@/attributes/audio/schedule\";\r\nimport { getPropertyMeta, PropOptions, type PropertyMeta } from \"@/attributes/properties/decorator\";\r\nimport {\r\n applyProp,\r\n applySnapshotLayer,\r\n collectProperties,\r\n popState,\r\n restoreAnimated,\r\n saveState,\r\n} from \"./node-reactive\";\r\nimport type { PropLayer } from \"./node-reactive\";\r\nimport { advanceNodeTime, createNodeTime, type MutableNodeTime, type NodeTime } from \"@/nodes/node/node-time\";\r\nimport type { PropInputs } from \"@/attributes/properties/inputs\";\r\nimport { command } from \"@/tween/command-decorator\";\r\n\r\nexport type { NodeTime } from \"@/nodes/node/node-time\";\r\nexport type { PropInput, PropInputs } from \"@/attributes/properties/inputs\";\r\n\r\n/** Which scene graph a node belongs to. See {@link Node.dimension}. */\r\nexport type NodeDimension = \"2d\" | \"3d\" | \"audio\";\r\n\r\n/** Where a node of each dimension is allowed to live, for the mismatch error. */\r\nconst HOSTS_OF: Record<NodeDimension, string> = {\r\n \"2d\": \"2D nodes go in the 2D tree, or inside a <Canvas3D> as a HUD over its scene.\",\r\n \"3d\": \"Put 3D nodes inside a <Canvas3D>, which is the one node that holds both.\",\r\n audio: \"Put audio nodes under an <AudioBus>, or directly on the scene root.\",\r\n};\r\n\r\n/** A withdrawn prop's options: every write, a tween's included, maps to the value its default maps to. */\r\nfunction heldAtDefault(meta: PropertyMeta): PropOptions<unknown, unknown> {\r\n const mapper = meta.options?.mapper;\r\n const declared = typeof meta.default === \"function\" ? (meta.default as () => unknown)() : meta.default;\r\n const held = declared === undefined || !mapper ? declared : mapper(declared, undefined);\r\n return { ...meta.options, mapper: () => held };\r\n}\r\n\r\nexport interface NodeMetadata<T extends Node> {\r\n /**\r\n * Handle written with this node at construction. Typed as {@link RefTarget}\r\n * rather than `Reference<T>` so a ref declared as one of `T`'s *supertypes*\r\n * is accepted (`createRef<ShapeNode>()` on a `<Rect>`) — see the note there\r\n * for why that direction is the sound one.\r\n */\r\n ref?: RefTarget<T>;\r\n}\r\n\r\nexport type NodeConfig<T extends Node, P> = PropInputs<P> & NodeMetadata<T>;\r\n\r\n/**\r\n * Everything {@link Node.attach} needs to put a subtree into a live scene.\r\n *\r\n * The three things tree membership supplies, and the only three: what assets are\r\n * available, what context the ancestors provide, and where the playhead is.\r\n */\r\nexport interface AttachScope {\r\n /** Metadata for the assets this scene may declare. */\r\n assets: AssetCatalog;\r\n /** The token map the parent provides to this node. */\r\n context: ContextMap;\r\n /** Clip-relative time, in seconds. */\r\n time: number;\r\n}\r\n\r\n/**\r\n * A JSX/`children` child: a single {@link Node}, an arbitrarily-nested array of\r\n * children, or a falsy value. Nesting is allowed so `.map()` results can be\r\n * dropped straight in as a child, and falsy values are allowed so\r\n * `{condition && <Node/>}` works like in React — the constructor flattens\r\n * (`.flat(Infinity)`) and filters out everything but `Node` instances.\r\n */\r\nexport type NodeChildren = Node | false | null | undefined | NodeChildren[];\r\n\r\n/**\r\n * The props every node has, in either dimension.\r\n *\r\n * Deliberately tiny. Everything that reads as \"a box on a page\" — `x`/`y`,\r\n * `width`/`height`, `padding`, `flex`, anchors, `opacity` — lives on\r\n * {@link Node2DProps}, and everything that reads as \"a thing in space\" —\r\n * `position`, `quaternion`, `castShadow` — lives on `Node3DProps`, because a\r\n * prop that means nothing for half the tree is worse than no prop at all.\r\n */\r\nexport interface NodeProps {\r\n children: NodeChildren;\r\n /**\r\n * Seeds {@link Node.id}. A document's `NodeSpec.id` supplies it — see\r\n * `Registry.instantiate` — so an instantiated node answers to the identity\r\n * its row was authored under. Left out, the node falls back to a UUID, which\r\n * is what every hand-written `new Rect({…})` and JSX element gets.\r\n */\r\n id?: string;\r\n /**\r\n * The handle a node is *referenced by*, as against {@link NodeProps.id},\r\n * which addresses it. `\"=[card.x]\"` in any prop reads the `x` of the node\r\n * keyed `card` — see `NodeSpec.key`.\r\n *\r\n * Optional and never generated — a node has one only because an author wrote\r\n * one, which is what makes it safe to point a formula at — and unique per\r\n * document, which `document/validate.ts` enforces.\r\n */\r\n key?: string;\r\n}\r\n\r\n/**\r\n * The dimension-agnostic base of the scene graph: tree, identity, reactive\r\n * properties, commands, context, clock, asset declaration, teardown. Nothing\r\n * about *where* a node is or *how* it draws — that's {@link Node2D} / `Node3D`.\r\n * They meet only at `Canvas3D`; mixing them anywhere else throws (see\r\n * {@link acceptsChild}).\r\n *\r\n * Subclasses call {@link initProps} from their own constructor rather than the\r\n * base doing it: a subclass's field initializers only run *after* `super()`\r\n * returns, so applying `@property` defaults any earlier would write into cells\r\n * that don't exist yet.\r\n */\r\nexport abstract class Node<P extends NodeProps = NodeProps> implements PropHost {\r\n /**\r\n * Which scene graph this node belongs to.\r\n *\r\n * A getter rather than a field so it is answerable from the prototype during\r\n * construction, before any subclass field initializer has run.\r\n */\r\n abstract get dimension(): NodeDimension;\r\n\r\n constructor(props?: NodeConfig<any, P>) {\r\n // Retain the raw props (see _props doc) so a provider's provideContext can\r\n // read which keys the author passed. Captured before any default\r\n // application so it reflects exactly what the author passed. The object is\r\n // retained by reference, so a subclass expanding prop sugar in place\r\n // afterwards (`size`, `transform3D`) is reflected here too.\r\n this._props = props;\r\n // Neither is a @property: identity does not tween, so neither has any\r\n // business in the table `set()`, `to()` and the baseline restore walk\r\n // iterate.\r\n const identity = props as { id?: string; key?: string } | undefined;\r\n this.key = identity?.key;\r\n // Nullish, never falsy: `\"\"` is the scene root's real id, not a missing\r\n // one (`checkRootShape` in document/validate.ts defines the root as the\r\n // row holding it), and a UUID in its place would have the host's tree\r\n // report a root no document row mentions.\r\n this.id = identity?.id ?? crypto.randomUUID();\r\n }\r\n\r\n /** See {@link NodeProps.key}. */\r\n key?: string;\r\n\r\n private _hidden = false;\r\n private _locked = false;\r\n\r\n /**\r\n * Hidden by the editor — no paint, no pick, no layout slot. See\r\n * {@link NodeEditorState.hidden}.\r\n */\r\n get hidden(): boolean {\r\n return this._hidden;\r\n }\r\n\r\n /** Locked by the editor — unpickable, but drawn. See {@link NodeEditorState.locked}. */\r\n get locked(): boolean {\r\n return this._locked;\r\n }\r\n\r\n /**\r\n * @internal — written only by `applyEditorStates`, which owns both flags for\r\n * the whole tree. Not a setter pair, so a caller cannot set one and leave the\r\n * other holding a previous frame's answer.\r\n */\r\n _setEditorState(hidden: boolean, locked: boolean): void {\r\n this._hidden = hidden;\r\n this._locked = locked;\r\n }\r\n\r\n /**\r\n * Fire the `ref` and apply every `@property()`-decorated field, reading\r\n * initial values from `props`.\r\n *\r\n * Called by the concrete constructor ({@link Node2D}'s, `Node3D`'s) rather\r\n * than by this one, because a subclass's field initializers run *after*\r\n * `super()` returns: doing this here would apply props while the cells those\r\n * props write into are still `undefined`.\r\n */\r\n protected initProps(props?: NodeConfig<any, P>): void {\r\n if (props?.ref) {\r\n props.ref(this as any);\r\n }\r\n\r\n // Apply all @property()-decorated fields, reading initial values from props.\r\n for (const meta of getPropertyMeta(this)) {\r\n if (meta.withdrawn) {\r\n this.applyProp(meta.key, meta.default, heldAtDefault(meta));\r\n continue;\r\n }\r\n const propsVal = props ? (props as any)[meta.key] : undefined;\r\n const initial = propsVal !== undefined ? propsVal : meta.default;\r\n this.applyProp(meta.key, initial, meta.options);\r\n }\r\n }\r\n\r\n /**\r\n * Adopt the `children` prop. Called by the concrete constructor after its own\r\n * defaults are in place, so a child never lands in a tree whose parent has not\r\n * finished sizing itself.\r\n */\r\n protected adoptChildrenProp(props?: NodeConfig<any, P>): void {\r\n if (props && (props as any).children) {\r\n const raw = Array.isArray((props as any).children) ? (props as any).children : [(props as any).children];\r\n const flat = (raw as unknown[]).flat(Infinity)\r\n .filter((c: unknown): c is Node => c instanceof Node);\r\n if (flat.length > 0) this._addChildren(flat);\r\n }\r\n }\r\n\r\n /**\r\n * Whether `child` may be adopted by this node.\r\n *\r\n * A node holds children of its own dimension; the places the trees meet are\r\n * `Canvas3D`, which takes 2D and 3D, and `Canvas2D`, which takes 2D and\r\n * audio. Both partition what they accept. Rejecting the mix here rather than\r\n * letting it through is deliberate: a `Box3D` parented to a `Rect` would be\r\n * silently skipped by both the layout walk and the 3D walk, and would simply\r\n * never appear.\r\n */\r\n protected acceptsChild(child: Node): boolean {\r\n return child.dimension === this.dimension;\r\n }\r\n\r\n /** Throw if `child` belongs to another dimension. */\r\n protected assertAcceptsChild(child: Node): void {\r\n if (this.acceptsChild(child)) return;\r\n throw new TypeError(\r\n `${this.className} (${this.dimension}) cannot hold ${child.className} (${child.dimension}). ` +\r\n `${HOSTS_OF[child.dimension]}`,\r\n );\r\n }\r\n\r\n private _assets: AssetCatalog | null = null;\r\n protected _parent: Node | null = null;\r\n\r\n /**\r\n * Whether this node is in a live scene tree. Gates measure/layout/render,\r\n * asset declaration and every command — checked at the handful of places\r\n * the framework dispatches from, not per method.\r\n */\r\n private _mounted = false;\r\n\r\n /** See {@link _mounted}. */\r\n get mounted(): boolean {\r\n return this._mounted;\r\n }\r\n\r\n get parent(): Node | null {\r\n if (_observer !== null) _observer.read(this._structureSlot());\r\n return this._parent;\r\n }\r\n\r\n get assets(): AssetCatalog {\r\n if (!this._assets) throw new Error(\"Assets not bound — this node is not attached to a scene. See Node.attach().\");\r\n return this._assets;\r\n }\r\n\r\n /** Token→value map pushed down from ancestor providers, bound by {@link attach}. */\r\n private _context: ContextMap = ContextMap.EMPTY;\r\n /** True once {@link attach} has reached this node. */\r\n private _contextBound = false;\r\n\r\n /** Raw constructor props, retained so {@link provideContext} can see which keys were explicitly passed. Kept through {@link dispose} so a reused instance re-derives context on the next attach. */\r\n protected _props?: NodeConfig<any, P>;\r\n\r\n /** Read the nearest ancestor provider's value for `ctx` (or its default). */\r\n useContext<T>(ctx: Context<T>): T {\r\n return this._context.get(ctx);\r\n }\r\n\r\n /** Assigned in the constructor — see {@link NodeProps.id}. */\r\n readonly id: string;\r\n\r\n /**\r\n * The slots behind this node's `@property` fields. See {@link PropCells}.\r\n *\r\n * @internal — the authoring surface is the declared props themselves, plus\r\n * `set()`/`to()`/`captureProps()`.\r\n */\r\n __cells?: PropCells;\r\n\r\n protected _children: Node[] = [];\r\n\r\n /**\r\n * Flatten a constructor's raw `children` prop into the `Node` instances it\r\n * contains, without mutating or adding them — the same normalisation the\r\n * constructor applies before adding them, exposed standalone so\r\n * {@link applyDefaultSize} overrides can inspect children's own resolved\r\n * `width`/`height` *before* they're attached (JSX children are constructed,\r\n * defaults and all, before being passed in as props).\r\n */\r\n protected static flattenChildrenProp(props: { children?: unknown } | undefined): Node[] {\r\n const childProp = props ? props.children : undefined;\r\n if (!childProp) return [];\r\n const raw = Array.isArray(childProp) ? childProp : [childProp];\r\n return (raw as unknown[]).flat(Infinity).filter((c: unknown): c is Node => c instanceof Node);\r\n }\r\n\r\n // ---- Reactive properties ----------------------------------------------\r\n\r\n /**\r\n * Declare a prop on this node. Creates a {@link PropSlot}-backed accessor\r\n * for `field`, applies an initial value (callback → binding; otherwise\r\n * constant), and registers optional tween/mapper metadata used by `set()`\r\n * and `to()`.\r\n *\r\n * Subsequent calls for the same field reuse the existing slot and act as\r\n * a value assignment, so subclasses can override a parent's default by\r\n * calling applyProp again without losing the slot or its bindings.\r\n */\r\n protected applyProp<Ext, Int = Ext>(\r\n field: string,\r\n initial: Ext | (() => Ext) | undefined,\r\n options?: PropOptions<Ext, Int>,\r\n ): void {\r\n applyProp(this, field, initial, options);\r\n }\r\n\r\n /** @internal Hot-path prop write (mapper- and binding-aware). Public-but-underscored like `_prepareStep` so reactive companions in this directory can call it; not part of the authoring surface. */\r\n _writeProp(field: string, value: unknown): void {\r\n if (value === undefined) return;\r\n const slot = this.__cells?.slots.get(field);\r\n if (!slot) return;\r\n const mapper = this.__cells?.mappers?.get(field);\r\n if (typeof value === \"function\") {\r\n const extFn = value as () => any;\r\n if (mapper) {\r\n // A binding that reads `undefined` — a node reference to a node that is\r\n // not there — leaves the prop as a node built without it, and never\r\n // reaches the mapper, which holds the shape the prop's readers go through.\r\n let unset: { value: unknown } | undefined;\r\n slot.bind(() => {\r\n const read = extFn();\r\n return read === undefined\r\n ? (unset ??= { value: this._unsetValue(field, mapper) }).value\r\n : mapper(read, slot.get());\r\n });\r\n } else {\r\n slot.bind(extFn);\r\n }\r\n } else {\r\n slot.set(mapper ? mapper(value, slot.get()) : value);\r\n }\r\n }\r\n\r\n get properties(): P {\r\n return collectProperties(this) as P;\r\n }\r\n\r\n /**\r\n * This node's **class** name, for a message or a host's type column. Not an\r\n * authored identity — those are {@link id} and {@link key}, and nothing in\r\n * the document model is called a name any more. Nor is it the registry key a\r\n * document writes in `NodeSpec.type`: a minifier is free to rename a class.\r\n */\r\n get className(): string {\r\n return this.constructor.name;\r\n }\r\n\r\n set(props: { [K in keyof P]?: P[K] | (() => P[K]) }): void {\r\n const slots = this.__cells?.slots;\r\n if (!slots) return;\r\n // Iterate the caller's keys (usually 1–3) rather than every registered\r\n // prop (15+): set() runs in the per-frame hot path. Only keys backed by\r\n // a slot are written; unknown keys are ignored — which is also what\r\n // lets a subclass distribute its own sugar (2D's `size`, `transform3D`)\r\n // into real keys and then delegate here.\r\n for (const key in props) {\r\n const val = (props as any)[key];\r\n if (val !== undefined && slots.has(key)) this._writeProp(key, val);\r\n }\r\n }\r\n\r\n @command()\r\n to<D extends Partial<P> = Partial<P>>(args: CommandArgs<D> & { duration: number }): Command<P> {\r\n return toCommand<P>(this, args.data ?? {}, args.duration, args.easing);\r\n }\r\n\r\n /**\r\n * Build a {@link Command} from a pure function of normalized time — an\r\n * animation this node can be *evaluated* at, not only run through.\r\n *\r\n * The pair to {@link to}, and the seam a named command is written against.\r\n * `to()` covers \"move these props there\", which is most of it; this covers\r\n * everything a node wants to choreograph itself, where the values at time\r\n * `t` are a function the node knows and nobody outside could reconstruct\r\n * from a prop list.\r\n *\r\n * ```ts\r\n * @command()\r\n * draw(duration = 1, easing?: EasingFunction): Command<ChartProps> {\r\n * const from = this.progress;\r\n * return this.command((t) => ({ progress: lerpNumber(from, 1, t) }), duration, easing);\r\n * }\r\n * ```\r\n *\r\n * Snapshot whatever the animation starts from *outside* the callback, as\r\n * above — reading `this.progress` inside it would re-read the value the\r\n * command is itself writing, and the tween would chase its own tail.\r\n *\r\n * Prefer this over a `*method(): FrameGenerator`. A generator can only be\r\n * advanced, so a host that wants frame N has to run frames 0..N-1 to get it;\r\n * the same choreography as a `Command` can be asked directly.\r\n *\r\n * (The `@command()` above it is the *decorator*, which only records that the\r\n * method is offerable. This builds the thing it returns.)\r\n */\r\n protected command<Props = P>(\r\n at: (t: number) => Partial<Props>,\r\n duration: number = 1,\r\n easing?: EasingFunction,\r\n ): Command<Props> {\r\n if (!this._mounted) return inertCommand<Props>(this, duration);\r\n return makeCommand<Props>(\r\n this as unknown as CommandTarget<Props>,\r\n at,\r\n duration,\r\n easing,\r\n );\r\n }\r\n\r\n /**\r\n * Resolve a single `to()` step into a flat {@link TweenStepper} — all the\r\n * per-key setup (mapper, numeric-vs-custom routing) happens once here, then\r\n * `advance(dt)` is allocation-free. Used by both a chain's iterator path and\r\n * the batched `parallel` path.\r\n *\r\n * A subclass with positional sugar of its own (2D's `size` and anchors)\r\n * expands `to` in place and then delegates here.\r\n */\r\n _prepareStep(to: Partial<P>, duration: number, easing?: EasingFunction): TweenStepper {\r\n if (!this._mounted) return inertStepper(duration);\r\n // A tween runs in stored space, so the destination is mapped once, here,\r\n // and every step after it is a stored value written to the slot as it is.\r\n // Writing a step through the setter would map it a second time, which only\r\n // an idempotent mapper survives.\r\n const numCells: PropSlot<number>[] = [];\r\n const numFrom: number[] = [];\r\n const numEnd: number[] = [];\r\n const customLerps: Array<(t: number) => void> = [];\r\n const stringSnaps: Array<[PropSlot<string>, string]> = [];\r\n\r\n for (const key of Object.keys(to)) {\r\n const slot = this.__cells?.slots.get(key);\r\n if (!slot) continue;\r\n const extVal = (to as any)[key];\r\n const mapper = this.__cells?.mappers?.get(key);\r\n const targetVal = mapper ? mapper(extVal, (this as any)[key]) : extVal;\r\n const tweenFn = this.__cells?.tweens?.get(key);\r\n if (tweenFn) {\r\n const from = (this as any)[key];\r\n customLerps.push((t) => {\r\n slot.set(tweenFn(from, targetVal, t));\r\n });\r\n } else if (typeof targetVal === 'number') {\r\n numCells.push(slot as PropSlot<number>);\r\n numFrom.push((this as any)[key] as number);\r\n numEnd.push(targetVal as number);\r\n } else if (typeof targetVal === 'string') {\r\n stringSnaps.push([slot as PropSlot<string>, targetVal]);\r\n }\r\n }\r\n\r\n const lerp = prepareNumericCellTween(numCells, numFrom, numEnd);\r\n const hasCustom = customLerps.length > 0;\r\n const hasSnaps = stringSnaps.length > 0;\r\n\r\n const apply = (t: number): void => {\r\n const easedT = easing ? easing(t) : t;\r\n lerp(easedT);\r\n if (hasCustom) for (const fn of customLerps) fn(easedT);\r\n // A discrete prop has nothing between its endpoints, so it snaps at\r\n // the end rather than interpolating. Applied here rather than only in\r\n // `advance` because a `seek` past the end has, by definition, reached\r\n // that end — leaving it out meant `seek(duration)` and running to\r\n // `duration` produced different nodes, and only the second was right.\r\n if (hasSnaps && t >= 1) for (const [slot, val] of stringSnaps) slot.set(val);\r\n };\r\n\r\n let elapsed = 0;\r\n return {\r\n // Tracks `elapsed`, so a seek and a subsequent advance agree about\r\n // where the tween is. Without it, seeking forward then advancing\r\n // rewound to `dt`.\r\n seek: (e: number) => {\r\n elapsed = e;\r\n apply(duration > 0 ? Math.min(e / duration, 1) : 1);\r\n },\r\n advance: (dt: number): boolean => {\r\n elapsed += dt;\r\n if (elapsed < duration) {\r\n apply(elapsed / duration);\r\n return false;\r\n }\r\n apply(1);\r\n return true;\r\n },\r\n };\r\n }\r\n\r\n /** What a node constructed without `field` holds: its declared default, through the mapper. */\r\n private _unsetValue(field: string, mapper: (ext: any, prev?: any) => any): unknown {\r\n const declared = getPropertyMeta(this).find((meta) => meta.key === field)?.default;\r\n const initial = typeof declared === \"function\" ? declared() : declared;\r\n return initial === undefined ? undefined : mapper(initial, undefined);\r\n }\r\n\r\n // ---- State stack (save / restore) -------------------------------------\r\n // A per-node LIFO stack of property snapshots, mirroring Motion Canvas's\r\n // node.save()/restore(). `save()` pushes a snapshot of every declared prop;\r\n // `restore()` pops the most recent one and either snaps to it (no duration)\r\n // or tweens the numeric props back to it over `duration`.\r\n\r\n /** @internal LIFO stack of save() snapshot layers. Underscore-internal so the prop companion can read it; not authoring surface. */\r\n _stateStack: PropLayer[] = [];\r\n\r\n /**\r\n * Push a snapshot of this node's current state onto its save stack.\r\n *\r\n * Every reactive prop (`x`, `y`, `scale`, `opacity`, `fill`, …) is captured,\r\n * preserving reactive bindings — a prop bound to `() => other().x` is saved\r\n * as the binding, not just its resolved value, so {@link restore} re-binds\r\n * it rather than freezing the value. Calls stack: each `save()` pushes a new\r\n * layer, and each {@link restore} pops the most recent one.\r\n *\r\n * @example\r\n * node.save();\r\n * node.moveTo({ data: { x: 200, y: 0 }, duration: 1 });\r\n * node.restore({ duration: 1 }); // animate back to where it was saved\r\n */\r\n save(): void {\r\n saveState(this);\r\n }\r\n\r\n /**\r\n * Pop the most recent {@link save} snapshot and roll this node back to it.\r\n *\r\n * Called with no `duration` (or `0`), every prop is reapplied instantly —\r\n * plain values are set, reactive bindings are re-bound. Called with a\r\n * positive `duration`, the numeric props (and any with a custom `tween`)\r\n * animate toward their saved values over that many seconds; once the tween\r\n * finishes the full snapshot is reapplied, which re-binds any reactive props\r\n * and snaps non-tweenable props (e.g. strings) to their saved values.\r\n *\r\n * A no-op (returns immediately) if there is nothing on the stack.\r\n */\r\n restore(): void;\r\n restore(args: CommandArgs<Record<string, never>> & { duration: number }): Command<Record<string, never>>;\r\n @command()\r\n restore(args?: CommandArgs<Record<string, never>>): void | Command<Record<string, never>> {\r\n const layer = popState(this);\r\n const duration = args?.duration;\r\n if (duration === undefined || duration <= 0) {\r\n if (layer) applySnapshotLayer(this, layer);\r\n return;\r\n }\r\n return restoreAnimated(this, layer, duration, args?.easing);\r\n }\r\n\r\n // ---- Clock ------------------------------------------------------------\r\n\r\n protected _time: MutableNodeTime = createNodeTime();\r\n\r\n /**\r\n * Per-frame hook, called after this node's {@link time} has been advanced.\r\n *\r\n * Nothing to do in the general case. Override it for state that has to\r\n * follow the clock but isn't a prop — a {@link Video}'s audio playhead is\r\n * the one built-in example. Read `this.time` for the current frame.\r\n */\r\n public tick(): void { }\r\n\r\n /** This node's place on the scene clock. See {@link NodeTime}. */\r\n public get time(): NodeTime {\r\n if (_observer !== null) _observer.clock?.(this);\r\n return this._time;\r\n }\r\n\r\n /**\r\n * Advance **this node's** clock to `total` clip-seconds, tick it, and\r\n * sample its derived render state.\r\n *\r\n * Per-node, not per-subtree: {@link attach} already recurses, so a recursive\r\n * advance here would re-advance every descendant once per ancestor.\r\n *\r\n * Sampling happens here, not at render: this runs on every advanced frame in\r\n * every playback path (forward, scrub, precomp), whereas `render` runs only\r\n * for displayed frames. Sampling per-frame is what makes velocity correct on\r\n * the first frame after a scrub/rewind, where sampling only at render time\r\n * read zero. The advance loop runs before `generator.next()` (so audio\r\n * scheduling in generator bodies reads the right time), which means x/y here\r\n * still hold the previous frame's value — velocity therefore trails the\r\n * rendered position by one frame. That lag is constant and identical forward\r\n * vs. scrub, and imperceptible for motion blur.\r\n */\r\n private _advanceOwnTime(total: number): void {\r\n advanceNodeTime(this._time, total);\r\n this.tick();\r\n this._sample();\r\n }\r\n\r\n /**\r\n * Sample this node's own derived render state for the current frame. Nothing\r\n * to derive in the general case; {@link Node2D} samples its motion here.\r\n *\r\n * @internal The per-node half of `sampleTree` — a walk, not a node method.\r\n */\r\n _sample(): void { }\r\n\r\n /**\r\n * Record this node's current position as the motion history's previous\r\n * frame, stamped `at`, deriving no velocity.\r\n *\r\n * @internal The per-node half of `primeMotionTree`.\r\n */\r\n _primeMotion(at: number): void { }\r\n\r\n // ---- Attachment -------------------------------------------------------\r\n\r\n /**\r\n * Put this subtree into the scene: mark it mounted, bind the asset catalog\r\n * and inherited context, advance its clock to `scope.time`.\r\n *\r\n * Safe and cheap to call every frame — an unchanged catalog/context\r\n * short-circuits, and {@link resolveContext} fires only on first attach.\r\n *\r\n * @internal Driven by `ClipInstance` per frame, and by {@link add} for a mid-frame subtree.\r\n */\r\n attach(scope: AttachScope): void {\r\n const first = !this._mounted;\r\n this._mounted = true;\r\n\r\n if (this._assets !== scope.assets) this._assets = scope.assets;\r\n\r\n const next = this.provideContext(scope.context);\r\n // Unchanged map, already bound, and not this instance's first attach ⇒\r\n // the whole subtree already holds `next` and the walk below would be pure\r\n // repetition of the context half. The time half still has to run.\r\n const contextChanged = !this._contextBound || this._context !== next;\r\n if (contextChanged) {\r\n this._context = next;\r\n this._contextBound = true;\r\n }\r\n if (first) this.resolveContext(next);\r\n\r\n this._advanceOwnTime(scope.time);\r\n\r\n if (this._children.length === 0) return;\r\n const childScope = next === scope.context ? scope : { ...scope, context: next };\r\n for (const child of this._children) child.attach(childScope);\r\n }\r\n\r\n /**\r\n * Take this subtree out of the scene. Not a teardown — props/children/bindings\r\n * stay, so it can be attached elsewhere (`reparent`). {@link dispose} tears down.\r\n *\r\n * @internal Driven by {@link remove}/{@link clear}.\r\n */\r\n detach(): void {\r\n if (!this._mounted) return;\r\n this._mounted = false;\r\n for (const child of this._children) child.detach();\r\n }\r\n\r\n /** The scope this node was last attached with, for handing to a late child. */\r\n private _currentScope(): AttachScope | null {\r\n return this._assets && this._contextBound\r\n ? { assets: this._assets, context: this._context, time: this._time.total }\r\n : null;\r\n }\r\n\r\n /** Attach `child` if this node is itself attached; otherwise leave it for the walk. */\r\n /** @internal Shared with `Node2D.addChildAt`, which splices rather than pushes. */\r\n protected _attachChild(child: Node): void {\r\n if (!this._mounted) return;\r\n const scope = this._currentScope();\r\n if (scope) child.attach(scope);\r\n }\r\n\r\n // ---- Context lifecycle ------------------------------------------------\r\n\r\n /**\r\n * Apply inherited context **values** to this node, once, after it's linked\r\n * into the tree and ancestor providers have resolved. Runs exactly once per\r\n * instance — never write idempotency guards here.\r\n *\r\n * Structure (which children exist) belongs in the constructor via\r\n * {@link add}, from props — never here. This only writes context-derived\r\n * values onto that already-built structure, via refs.\r\n *\r\n * @example\r\n * protected override resolveContext(ctx: ContextMap): void {\r\n * this.accent().set({ fill: ctx.get(ThemeToken).accent });\r\n * }\r\n */\r\n protected resolveContext(ctx: ContextMap): void { }\r\n\r\n /**\r\n * Providers override this to attach their token(s) to the {@link ContextMap}\r\n * handed to descendants. Base passes the parent's map through unchanged.\r\n */\r\n protected provideContext(parent: ContextMap): ContextMap {\r\n return parent;\r\n }\r\n\r\n /**\r\n * Bind `node`'s asset catalog, context and clock without making it a child —\r\n * for a node used purely as a pixel source (`Tex.surface`), laid out on\r\n * demand rather than sitting in the tree.\r\n */\r\n protected attachDetached(node: Node): void {\r\n const scope = this._currentScope();\r\n if (scope) node.attach(scope);\r\n }\r\n\r\n /**\r\n * Declare what this node draws from its props and inherited context alone —\r\n * never `layoutBounds` or the clock. The runtime records what this reads and\r\n * calls it again only when one of those props is written, so anything else it\r\n * depends on is a change nobody will ask about.\r\n */\r\n declareAssets(assets: AssetScope): void { }\r\n\r\n /**\r\n * Declare the clips this node plays. Called once, in the state the node enters\r\n * the tree in: a request is scheduled ahead of time, so a later write to what\r\n * it reads is not heard — automate a level with a curve, or split the row.\r\n */\r\n declareAudio(audio: AudioScope): void { }\r\n\r\n get children(): Node[] {\r\n if (_observer !== null) _observer.read(this._structureSlot());\r\n return this._children;\r\n }\r\n\r\n /**\r\n * Every child, both dimensions, unfiltered — unlike {@link children}, which\r\n * a {@link Node2D} filters to its own kind. Used where index has to match\r\n * the authored tree (picking), since filtering would renumber it.\r\n */\r\n get _allChildren(): readonly Node[] {\r\n if (_observer !== null) _observer.read(this._structureSlot());\r\n return this._children;\r\n }\r\n\r\n /**\r\n * Add children — a node, an array, or a nested/JSX mix; falsy entries\r\n * (`cond && <Node/>`) are dropped. A child of the other dimension throws —\r\n * see {@link acceptsChild}.\r\n */\r\n add(child: NodeChildren): void {\r\n if (child instanceof Node) {\r\n this._addChild(child);\r\n return;\r\n }\r\n const flat = Node.flattenChildrenProp({ children: child });\r\n if (flat.length > 0) this._addChildren(flat);\r\n }\r\n\r\n /** Remove children — same shapes as {@link add}. Not a child of this one is a no-op. */\r\n remove(child: NodeChildren): void {\r\n if (child instanceof Node) {\r\n this._removeChild(child);\r\n return;\r\n }\r\n for (const node of Node.flattenChildrenProp({ children: child })) {\r\n this._removeChild(node);\r\n }\r\n }\r\n\r\n /** Remove every child, detaching each (see {@link remove}). */\r\n clear(): void {\r\n for (const child of this._children) {\r\n if (_observer !== null) this._structureChanged(child);\r\n child._parent = null;\r\n child.detach();\r\n }\r\n this._children.length = 0;\r\n }\r\n\r\n /**\r\n * Insert `child` at `index` among this node's children.\r\n *\r\n * On {@link Node} rather than {@link Node2D} because it is tree machinery —\r\n * `ClipTimeline.syncPresence` reaches for it on whatever a spec's\r\n * `parentId` names, which since audio joined the graph is not always a 2D\r\n * node. `Node2D` overrides it for the animated insert, which measures the\r\n * child off-tree and so needs a laid-out one.\r\n */\r\n @command({ args: [\"child\", \"index\"] })\r\n addChildAt(args: CommandArgs<{ child: Node; index: number }>): void | Command<Record<string, never>> {\r\n const { child, index } = args.data as { child: Node; index: number };\r\n this.assertAcceptsChild(child);\r\n this._insertChildAt(child, index);\r\n }\r\n\r\n /** @internal Shared with `Node2D.addChildAt`'s instant branch. */\r\n protected _insertChildAt(child: Node, index: number): void {\r\n if (_observer !== null) this._structureChanged(child);\r\n this._children.splice(index, 0, child);\r\n child._parent = this;\r\n this._attachChild(child);\r\n }\r\n\r\n /**\r\n * @internal The pseudo-slot {@link children} and {@link parent} report to an\r\n * observer. Allocated on first observation, so a tree nobody observes carries none.\r\n */\r\n _structureSlot(): PropSlot<null> {\r\n return this._structure ??= new PropSlot<null>(null, this, STRUCTURE_SLOT);\r\n }\r\n\r\n /** @internal Report a child entering or leaving this node — its parent link changes with it. Call only while observed. */\r\n _structureChanged(child: Node | null): void {\r\n _observer!.write(this._structureSlot());\r\n if (child) _observer!.write(child._structureSlot());\r\n }\r\n\r\n private _structure: PropSlot<null> | null = null;\r\n\r\n private _addChild(child: Node): void {\r\n this.assertAcceptsChild(child);\r\n if (_observer !== null) this._structureChanged(child);\r\n this._children.push(child);\r\n child._parent = this;\r\n this._attachChild(child);\r\n }\r\n\r\n private _addChildren(children: Node[]): void {\r\n for (const child of children) this.assertAcceptsChild(child);\r\n if (_observer !== null) for (const child of children) this._structureChanged(child);\r\n this._children.push(...children);\r\n for (const child of children) child._parent = this;\r\n for (const child of children) this._attachChild(child);\r\n }\r\n\r\n private _removeChild(child: Node): void {\r\n const i = this._children.indexOf(child);\r\n if (i < 0) return;\r\n if (_observer !== null) this._structureChanged(child);\r\n const [removed] = this._children.splice(i, 1);\r\n if (removed) {\r\n removed._parent = null;\r\n removed.detach();\r\n }\r\n }\r\n\r\n dispose(): void {\r\n if (this.__cells) {\r\n for (const slot of this.__cells.slots.values()) {\r\n slot.dispose();\r\n }\r\n }\r\n this.__cells = undefined;\r\n this._assets = null;\r\n this._mounted = false;\r\n // _props is retained (authored identity) so provideContext still works after reuse.\r\n this._context = ContextMap.EMPTY;\r\n this._contextBound = false;\r\n }\r\n}\r\n"]}