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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (767) hide show
  1. package/CHANGELOG.md +282 -0
  2. package/LICENSE +201 -201
  3. package/NOTICE +48 -0
  4. package/README.md +93 -72
  5. package/dist/assets/asset-index.js.map +1 -1
  6. package/dist/assets/catalog.d.ts +9 -0
  7. package/dist/assets/catalog.d.ts.map +1 -1
  8. package/dist/assets/catalog.js +11 -0
  9. package/dist/assets/catalog.js.map +1 -1
  10. package/dist/assets/errors.d.ts.map +1 -1
  11. package/dist/assets/errors.js +8 -3
  12. package/dist/assets/errors.js.map +1 -1
  13. package/dist/assets/index.js.map +1 -1
  14. package/dist/assets/manager.d.ts +26 -1
  15. package/dist/assets/manager.d.ts.map +1 -1
  16. package/dist/assets/manager.js +93 -11
  17. package/dist/assets/manager.js.map +1 -1
  18. package/dist/assets/manifest.js.map +1 -1
  19. package/dist/assets/record.js.map +1 -1
  20. package/dist/assets/scope.d.ts +3 -3
  21. package/dist/assets/scope.d.ts.map +1 -1
  22. package/dist/assets/scope.js.map +1 -1
  23. package/dist/attributes/audio/filters/chain.d.ts +1 -1
  24. package/dist/attributes/audio/filters/chain.js.map +1 -1
  25. package/dist/attributes/audio/filters/curve.d.ts +8 -8
  26. package/dist/attributes/audio/filters/curve.d.ts.map +1 -1
  27. package/dist/attributes/audio/filters/curve.js +20 -19
  28. package/dist/attributes/audio/filters/curve.js.map +1 -1
  29. package/dist/attributes/audio/filters/implementations/echo.js.map +1 -1
  30. package/dist/attributes/audio/filters/implementations/gain.js.map +1 -1
  31. package/dist/attributes/audio/filters/implementations/highpass.js.map +1 -1
  32. package/dist/attributes/audio/filters/implementations/lowpass.js.map +1 -1
  33. package/dist/attributes/audio/filters/implementations/speed.d.ts +2 -2
  34. package/dist/attributes/audio/filters/implementations/speed.js.map +1 -1
  35. package/dist/attributes/audio/filters/implementations/tremolo.js.map +1 -1
  36. package/dist/attributes/audio/filters/index.d.ts +1 -1
  37. package/dist/attributes/audio/filters/index.d.ts.map +1 -1
  38. package/dist/attributes/audio/filters/index.js +1 -1
  39. package/dist/attributes/audio/filters/index.js.map +1 -1
  40. package/dist/attributes/audio/filters/registry.js.map +1 -1
  41. package/dist/attributes/audio/filters/union.js.map +1 -1
  42. package/dist/attributes/audio/request.d.ts +32 -4
  43. package/dist/attributes/audio/request.d.ts.map +1 -1
  44. package/dist/attributes/audio/request.js +9 -1
  45. package/dist/attributes/audio/request.js.map +1 -1
  46. package/dist/attributes/audio/schedule.d.ts +11 -2
  47. package/dist/attributes/audio/schedule.d.ts.map +1 -1
  48. package/dist/attributes/audio/schedule.js +15 -8
  49. package/dist/attributes/audio/schedule.js.map +1 -1
  50. package/dist/attributes/audio/sound.d.ts +4 -2
  51. package/dist/attributes/audio/sound.d.ts.map +1 -1
  52. package/dist/attributes/audio/sound.js +8 -4
  53. package/dist/attributes/audio/sound.js.map +1 -1
  54. package/dist/attributes/index.d.ts +1 -0
  55. package/dist/attributes/index.d.ts.map +1 -1
  56. package/dist/attributes/index.js +1 -0
  57. package/dist/attributes/index.js.map +1 -1
  58. package/dist/attributes/layout/alignment.js +1 -1
  59. package/dist/attributes/layout/alignment.js.map +1 -1
  60. package/dist/attributes/layout/index.js.map +1 -1
  61. package/dist/attributes/layout/insets.js.map +1 -1
  62. package/dist/attributes/layout/matrix2d.js.map +1 -1
  63. package/dist/attributes/layout/size.js.map +1 -1
  64. package/dist/attributes/layout/transform3d.js.map +1 -1
  65. package/dist/attributes/layout/vector2.js.map +1 -1
  66. package/dist/attributes/layout/world-transform.js.map +1 -1
  67. package/dist/attributes/mask/boolean.js.map +1 -1
  68. package/dist/attributes/mask/mask.js.map +1 -1
  69. package/dist/attributes/properties/decorator.d.ts +17 -6
  70. package/dist/attributes/properties/decorator.d.ts.map +1 -1
  71. package/dist/attributes/properties/decorator.js +26 -14
  72. package/dist/attributes/properties/decorator.js.map +1 -1
  73. package/dist/attributes/properties/inputs.js.map +1 -1
  74. package/dist/attributes/properties/typed.d.ts +9 -2
  75. package/dist/attributes/properties/typed.d.ts.map +1 -1
  76. package/dist/attributes/properties/typed.js +15 -1
  77. package/dist/attributes/properties/typed.js.map +1 -1
  78. package/dist/attributes/render3d/orbit.d.ts +8 -8
  79. package/dist/attributes/render3d/orbit.js +7 -7
  80. package/dist/attributes/render3d/orbit.js.map +1 -1
  81. package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
  82. package/dist/attributes/shape/corners/corner-style.js.map +1 -1
  83. package/dist/attributes/shape/corners/corners.js.map +1 -1
  84. package/dist/attributes/shape/corners/index.js.map +1 -1
  85. package/dist/attributes/shape/effects/backdrop.d.ts +4 -4
  86. package/dist/attributes/shape/effects/backdrop.d.ts.map +1 -1
  87. package/dist/attributes/shape/effects/backdrop.js.map +1 -1
  88. package/dist/attributes/shape/effects/chain.d.ts +28 -120
  89. package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
  90. package/dist/attributes/shape/effects/chain.js +16 -88
  91. package/dist/attributes/shape/effects/chain.js.map +1 -1
  92. package/dist/attributes/shape/effects/effect-data.js.map +1 -1
  93. package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
  94. package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
  95. package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
  96. package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
  97. package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
  98. package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
  99. package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
  100. package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +2 -2
  101. package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
  102. package/dist/attributes/shape/effects/implementations/curves.d.ts +1 -1
  103. package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
  104. package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
  105. package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
  106. package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
  107. package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
  108. package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
  109. package/dist/attributes/shape/effects/implementations/glass.d.ts +15 -24
  110. package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
  111. package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
  112. package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
  113. package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
  114. package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
  115. package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
  116. package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
  117. package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
  118. package/dist/attributes/shape/effects/implementations/lut.d.ts +1 -1
  119. package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
  120. package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
  121. package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
  122. package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
  123. package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
  124. package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
  125. package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
  126. package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
  127. package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
  128. package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
  129. package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
  130. package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
  131. package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
  132. package/dist/attributes/shape/effects/implementations/shader.js +15 -8
  133. package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
  134. package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
  135. package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
  136. package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
  137. package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
  138. package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
  139. package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
  140. package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
  141. package/dist/attributes/shape/effects/index.d.ts +2 -6
  142. package/dist/attributes/shape/effects/index.d.ts.map +1 -1
  143. package/dist/attributes/shape/effects/index.js.map +1 -1
  144. package/dist/attributes/shape/effects/registry.d.ts +23 -6
  145. package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
  146. package/dist/attributes/shape/effects/registry.js +44 -10
  147. package/dist/attributes/shape/effects/registry.js.map +1 -1
  148. package/dist/attributes/shape/effects/union.d.ts +2 -6
  149. package/dist/attributes/shape/effects/union.d.ts.map +1 -1
  150. package/dist/attributes/shape/effects/union.js.map +1 -1
  151. package/dist/attributes/shape/fill/blend.js.map +1 -1
  152. package/dist/attributes/shape/fill/chain.js.map +1 -1
  153. package/dist/attributes/shape/fill/coerce.js.map +1 -1
  154. package/dist/attributes/shape/fill/color/constants.js.map +1 -1
  155. package/dist/attributes/shape/fill/color/parser.d.ts.map +1 -1
  156. package/dist/attributes/shape/fill/color/parser.js +81 -44
  157. package/dist/attributes/shape/fill/color/parser.js.map +1 -1
  158. package/dist/attributes/shape/fill/gradient-stops.d.ts +16 -0
  159. package/dist/attributes/shape/fill/gradient-stops.d.ts.map +1 -0
  160. package/dist/attributes/shape/fill/gradient-stops.js +65 -0
  161. package/dist/attributes/shape/fill/gradient-stops.js.map +1 -0
  162. package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
  163. package/dist/attributes/shape/fill/implementations/color.js.map +1 -1
  164. package/dist/attributes/shape/fill/implementations/conic-gradient.d.ts.map +1 -1
  165. package/dist/attributes/shape/fill/implementations/conic-gradient.js +2 -5
  166. package/dist/attributes/shape/fill/implementations/conic-gradient.js.map +1 -1
  167. package/dist/attributes/shape/fill/implementations/dot-grid.js.map +1 -1
  168. package/dist/attributes/shape/fill/implementations/fractal-noise.d.ts.map +1 -1
  169. package/dist/attributes/shape/fill/implementations/fractal-noise.js +2 -10
  170. package/dist/attributes/shape/fill/implementations/fractal-noise.js.map +1 -1
  171. package/dist/attributes/shape/fill/implementations/grid.js.map +1 -1
  172. package/dist/attributes/shape/fill/implementations/image.d.ts.map +1 -1
  173. package/dist/attributes/shape/fill/implementations/image.js +5 -4
  174. package/dist/attributes/shape/fill/implementations/image.js.map +1 -1
  175. package/dist/attributes/shape/fill/implementations/linear-gradient.d.ts.map +1 -1
  176. package/dist/attributes/shape/fill/implementations/linear-gradient.js +2 -6
  177. package/dist/attributes/shape/fill/implementations/linear-gradient.js.map +1 -1
  178. package/dist/attributes/shape/fill/implementations/noise.js.map +1 -1
  179. package/dist/attributes/shape/fill/implementations/radial-gradient.d.ts.map +1 -1
  180. package/dist/attributes/shape/fill/implementations/radial-gradient.js +2 -5
  181. package/dist/attributes/shape/fill/implementations/radial-gradient.js.map +1 -1
  182. package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
  183. package/dist/attributes/shape/fill/implementations/stripe.js.map +1 -1
  184. package/dist/attributes/shape/fill/implementations/video.js +1 -1
  185. package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
  186. package/dist/attributes/shape/fill/index.js.map +1 -1
  187. package/dist/attributes/shape/fill/lerp.d.ts +9 -1
  188. package/dist/attributes/shape/fill/lerp.d.ts.map +1 -1
  189. package/dist/attributes/shape/fill/lerp.js +12 -1
  190. package/dist/attributes/shape/fill/lerp.js.map +1 -1
  191. package/dist/attributes/shape/fill/media-preset.js.map +1 -1
  192. package/dist/attributes/shape/fill/registry.js.map +1 -1
  193. package/dist/attributes/shape/fill/union.js.map +1 -1
  194. package/dist/attributes/shape/filters/chain.d.ts +4 -10
  195. package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
  196. package/dist/attributes/shape/filters/chain.js +1 -13
  197. package/dist/attributes/shape/filters/chain.js.map +1 -1
  198. package/dist/attributes/shape/filters/implementations/alpha.js.map +1 -1
  199. package/dist/attributes/shape/filters/implementations/blur.js.map +1 -1
  200. package/dist/attributes/shape/filters/implementations/color-adjustment.js.map +1 -1
  201. package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
  202. package/dist/attributes/shape/filters/implementations/curves.js.map +1 -1
  203. package/dist/attributes/shape/filters/implementations/echo.js.map +1 -1
  204. package/dist/attributes/shape/filters/implementations/exposure.js.map +1 -1
  205. package/dist/attributes/shape/filters/implementations/grayscale.js.map +1 -1
  206. package/dist/attributes/shape/filters/implementations/posterize-time.js.map +1 -1
  207. package/dist/attributes/shape/filters/index.d.ts +1 -1
  208. package/dist/attributes/shape/filters/index.js.map +1 -1
  209. package/dist/attributes/shape/filters/registry.d.ts +2 -2
  210. package/dist/attributes/shape/filters/registry.js +3 -3
  211. package/dist/attributes/shape/filters/registry.js.map +1 -1
  212. package/dist/attributes/shape/filters/union.d.ts +6 -7
  213. package/dist/attributes/shape/filters/union.d.ts.map +1 -1
  214. package/dist/attributes/shape/filters/union.js.map +1 -1
  215. package/dist/attributes/shape/path/anchors.d.ts.map +1 -1
  216. package/dist/attributes/shape/path/anchors.js +12 -5
  217. package/dist/attributes/shape/path/anchors.js.map +1 -1
  218. package/dist/attributes/shape/path/bezier.js.map +1 -1
  219. package/dist/attributes/shape/path/index.js.map +1 -1
  220. package/dist/attributes/shape/path/measure.js.map +1 -1
  221. package/dist/attributes/shape/path/morph.d.ts.map +1 -1
  222. package/dist/attributes/shape/path/morph.js +16 -4
  223. package/dist/attributes/shape/path/morph.js.map +1 -1
  224. package/dist/attributes/shape/path/ops.js.map +1 -1
  225. package/dist/attributes/shape/path/types.js.map +1 -1
  226. package/dist/attributes/shape/path/walk.js.map +1 -1
  227. package/dist/attributes/shape/shaders/index.js.map +1 -1
  228. package/dist/attributes/shape/shaders/pack.js.map +1 -1
  229. package/dist/attributes/shape/shaders/resolve.js.map +1 -1
  230. package/dist/attributes/shape/shadow/index.js.map +1 -1
  231. package/dist/attributes/shape/shadow/shadow.js.map +1 -1
  232. package/dist/attributes/shape/stroke/index.d.ts +2 -2
  233. package/dist/attributes/shape/stroke/index.d.ts.map +1 -1
  234. package/dist/attributes/shape/stroke/index.js +1 -1
  235. package/dist/attributes/shape/stroke/index.js.map +1 -1
  236. package/dist/attributes/shape/stroke/stroke.d.ts +27 -6
  237. package/dist/attributes/shape/stroke/stroke.d.ts.map +1 -1
  238. package/dist/attributes/shape/stroke/stroke.js +22 -2
  239. package/dist/attributes/shape/stroke/stroke.js.map +1 -1
  240. package/dist/attributes/shared/operators.js.map +1 -1
  241. package/dist/attributes/text/index.js.map +1 -1
  242. package/dist/attributes/text/ops.d.ts +6 -0
  243. package/dist/attributes/text/ops.d.ts.map +1 -1
  244. package/dist/attributes/text/ops.js +1 -0
  245. package/dist/attributes/text/ops.js.map +1 -1
  246. package/dist/attributes/text/types.js.map +1 -1
  247. package/dist/browser/chunks/chunk-FUZVFT3W.js +18 -0
  248. package/dist/browser/chunks/chunk-FUZVFT3W.js.map +7 -0
  249. package/dist/browser/chunks/chunk-QG6C23IJ.js +3 -0
  250. package/dist/browser/chunks/chunk-QG6C23IJ.js.map +7 -0
  251. package/dist/browser/chunks/chunk-SFNJRPBV.js +2 -0
  252. package/dist/browser/chunks/chunk-SFNJRPBV.js.map +7 -0
  253. package/dist/browser/component.js +1 -1
  254. package/dist/browser/component.js.map +3 -3
  255. package/dist/browser/index.js +1 -1
  256. package/dist/browser/index.js.map +4 -4
  257. package/dist/browser/jsx-jsx-dev-runtime.js +1 -1
  258. package/dist/browser/jsx-jsx-runtime.js +1 -1
  259. package/dist/browser/manifest.json +3 -2
  260. package/dist/browser/sdk.js +1 -1
  261. package/dist/component.js.map +1 -1
  262. package/dist/document/audio.d.ts +1 -1
  263. package/dist/document/audio.js +4 -4
  264. package/dist/document/audio.js.map +1 -1
  265. package/dist/document/builtins.d.ts.map +1 -1
  266. package/dist/document/builtins.js +8 -14
  267. package/dist/document/builtins.js.map +1 -1
  268. package/dist/document/command-traits.d.ts +1 -1
  269. package/dist/document/command-traits.d.ts.map +1 -1
  270. package/dist/document/command-traits.js +17 -3
  271. package/dist/document/command-traits.js.map +1 -1
  272. package/dist/document/deny-globals.js.map +1 -1
  273. package/dist/document/diff.js.map +1 -1
  274. package/dist/document/doc-index.d.ts +2 -2
  275. package/dist/document/doc-index.d.ts.map +1 -1
  276. package/dist/document/doc-index.js.map +1 -1
  277. package/dist/document/expression/compile.d.ts.map +1 -1
  278. package/dist/document/expression/compile.js +8 -5
  279. package/dist/document/expression/compile.js.map +1 -1
  280. package/dist/document/expression/index.js.map +1 -1
  281. package/dist/document/expression/ops.js +1 -1
  282. package/dist/document/expression/ops.js.map +1 -1
  283. package/dist/document/expression/parse.d.ts.map +1 -1
  284. package/dist/document/expression/parse.js +15 -6
  285. package/dist/document/expression/parse.js.map +1 -1
  286. package/dist/document/expression/refs.d.ts +1 -1
  287. package/dist/document/expression/refs.js +1 -1
  288. package/dist/document/expression/refs.js.map +1 -1
  289. package/dist/document/expression/types.js.map +1 -1
  290. package/dist/document/expression/walk.d.ts.map +1 -1
  291. package/dist/document/expression/walk.js +2 -1
  292. package/dist/document/expression/walk.js.map +1 -1
  293. package/dist/document/index.d.ts +2 -0
  294. package/dist/document/index.d.ts.map +1 -1
  295. package/dist/document/index.js +2 -0
  296. package/dist/document/index.js.map +1 -1
  297. package/dist/document/node-decorator.js.map +1 -1
  298. package/dist/document/node-descriptor.d.ts +19 -0
  299. package/dist/document/node-descriptor.d.ts.map +1 -1
  300. package/dist/document/node-descriptor.js.map +1 -1
  301. package/dist/document/placement.d.ts +70 -0
  302. package/dist/document/placement.d.ts.map +1 -0
  303. package/dist/document/placement.js +83 -0
  304. package/dist/document/placement.js.map +1 -0
  305. package/dist/document/project.d.ts +2 -2
  306. package/dist/document/project.d.ts.map +1 -1
  307. package/dist/document/project.js.map +1 -1
  308. package/dist/document/registry.d.ts +34 -16
  309. package/dist/document/registry.d.ts.map +1 -1
  310. package/dist/document/registry.js +51 -12
  311. package/dist/document/registry.js.map +1 -1
  312. package/dist/document/timeline-patch.js.map +1 -1
  313. package/dist/document/timeline.d.ts +73 -18
  314. package/dist/document/timeline.d.ts.map +1 -1
  315. package/dist/document/timeline.js +192 -40
  316. package/dist/document/timeline.js.map +1 -1
  317. package/dist/document/types.d.ts +12 -12
  318. package/dist/document/types.d.ts.map +1 -1
  319. package/dist/document/types.js +2 -2
  320. package/dist/document/types.js.map +1 -1
  321. package/dist/document/validate.d.ts +2 -2
  322. package/dist/document/validate.d.ts.map +1 -1
  323. package/dist/document/validate.js +37 -31
  324. package/dist/document/validate.js.map +1 -1
  325. package/dist/document/withdraw.d.ts +28 -0
  326. package/dist/document/withdraw.d.ts.map +1 -0
  327. package/dist/document/withdraw.js +61 -0
  328. package/dist/document/withdraw.js.map +1 -0
  329. package/dist/index.d.ts +1 -0
  330. package/dist/index.d.ts.map +1 -1
  331. package/dist/index.js +1 -0
  332. package/dist/index.js.map +1 -1
  333. package/dist/jsx/jsx-dev-runtime.js.map +1 -1
  334. package/dist/jsx/jsx-runtime.d.ts +9 -1
  335. package/dist/jsx/jsx-runtime.d.ts.map +1 -1
  336. package/dist/jsx/jsx-runtime.js +13 -3
  337. package/dist/jsx/jsx-runtime.js.map +1 -1
  338. package/dist/layout/bounds.d.ts +0 -1
  339. package/dist/layout/bounds.d.ts.map +1 -1
  340. package/dist/layout/bounds.js.map +1 -1
  341. package/dist/layout/constraints.js.map +1 -1
  342. package/dist/layout/flex.d.ts +4 -2
  343. package/dist/layout/flex.d.ts.map +1 -1
  344. package/dist/layout/flex.js +27 -11
  345. package/dist/layout/flex.js.map +1 -1
  346. package/dist/layout/freeform.js.map +1 -1
  347. package/dist/layout/grid.js.map +1 -1
  348. package/dist/layout/index.js.map +1 -1
  349. package/dist/layout/item.js.map +1 -1
  350. package/dist/layout/ops.d.ts +6 -0
  351. package/dist/layout/ops.d.ts.map +1 -1
  352. package/dist/layout/ops.js +6 -0
  353. package/dist/layout/ops.js.map +1 -1
  354. package/dist/layout/types.js.map +1 -1
  355. package/dist/nodes/2d/node-lifecycle.js.map +1 -1
  356. package/dist/nodes/2d/node-motion.js.map +1 -1
  357. package/dist/nodes/2d/node-render.d.ts +3 -3
  358. package/dist/nodes/2d/node-render.d.ts.map +1 -1
  359. package/dist/nodes/2d/node-render.js.map +1 -1
  360. package/dist/nodes/2d/node-transform.js.map +1 -1
  361. package/dist/nodes/2d/node2d.d.ts +115 -3
  362. package/dist/nodes/2d/node2d.d.ts.map +1 -1
  363. package/dist/nodes/2d/node2d.js +188 -32
  364. package/dist/nodes/2d/node2d.js.map +1 -1
  365. package/dist/nodes/2d/paint-node.d.ts +27 -0
  366. package/dist/nodes/2d/paint-node.d.ts.map +1 -1
  367. package/dist/nodes/2d/paint-node.js +42 -0
  368. package/dist/nodes/2d/paint-node.js.map +1 -1
  369. package/dist/nodes/audio/audio-bus.js.map +1 -1
  370. package/dist/nodes/audio/index.js.map +1 -1
  371. package/dist/nodes/audio/node-audio.d.ts +3 -2
  372. package/dist/nodes/audio/node-audio.d.ts.map +1 -1
  373. package/dist/nodes/audio/node-audio.js +8 -5
  374. package/dist/nodes/audio/node-audio.js.map +1 -1
  375. package/dist/nodes/audio/sound-node.d.ts +2 -2
  376. package/dist/nodes/audio/sound-node.d.ts.map +1 -1
  377. package/dist/nodes/audio/sound-node.js +2 -2
  378. package/dist/nodes/audio/sound-node.js.map +1 -1
  379. package/dist/nodes/geometry/bounds-shape-node.d.ts +4 -4
  380. package/dist/nodes/geometry/bounds-shape-node.js +2 -2
  381. package/dist/nodes/geometry/bounds-shape-node.js.map +1 -1
  382. package/dist/nodes/geometry/box-path-node.d.ts +3 -3
  383. package/dist/nodes/geometry/box-path-node.js +2 -2
  384. package/dist/nodes/geometry/box-path-node.js.map +1 -1
  385. package/dist/nodes/geometry/ellipse-node.js.map +1 -1
  386. package/dist/nodes/geometry/group-bounds.d.ts +2 -2
  387. package/dist/nodes/geometry/group-bounds.d.ts.map +1 -1
  388. package/dist/nodes/geometry/group-bounds.js +1 -2
  389. package/dist/nodes/geometry/group-bounds.js.map +1 -1
  390. package/dist/nodes/geometry/path-node.d.ts.map +1 -1
  391. package/dist/nodes/geometry/path-node.js +6 -0
  392. package/dist/nodes/geometry/path-node.js.map +1 -1
  393. package/dist/nodes/geometry/polygon-node.js.map +1 -1
  394. package/dist/nodes/geometry/polygram-node.js.map +1 -1
  395. package/dist/nodes/geometry/rect-node.js.map +1 -1
  396. package/dist/nodes/geometry/shape-node.js.map +1 -1
  397. package/dist/nodes/geometry/shape-outline.d.ts +2 -2
  398. package/dist/nodes/geometry/shape-outline.d.ts.map +1 -1
  399. package/dist/nodes/geometry/shape-outline.js +2 -13
  400. package/dist/nodes/geometry/shape-outline.js.map +1 -1
  401. package/dist/nodes/index.d.ts +3 -8
  402. package/dist/nodes/index.d.ts.map +1 -1
  403. package/dist/nodes/index.js +3 -8
  404. package/dist/nodes/index.js.map +1 -1
  405. package/dist/nodes/layout/camera-node.d.ts +9 -0
  406. package/dist/nodes/layout/camera-node.d.ts.map +1 -1
  407. package/dist/nodes/layout/camera-node.js +38 -3
  408. package/dist/nodes/layout/camera-node.js.map +1 -1
  409. package/dist/nodes/layout/orbit-camera-node.d.ts +1 -1
  410. package/dist/nodes/layout/orbit-camera-node.js +1 -1
  411. package/dist/nodes/layout/orbit-camera-node.js.map +1 -1
  412. package/dist/nodes/layout/rotated-box.js.map +1 -1
  413. package/dist/nodes/media/video-node.d.ts.map +1 -1
  414. package/dist/nodes/media/video-node.js +5 -3
  415. package/dist/nodes/media/video-node.js.map +1 -1
  416. package/dist/nodes/node/declare-paints.js.map +1 -1
  417. package/dist/nodes/node/node-editor-state.js.map +1 -1
  418. package/dist/nodes/node/node-reactive.js.map +1 -1
  419. package/dist/nodes/node/node-time.d.ts +3 -3
  420. package/dist/nodes/node/node-time.d.ts.map +1 -1
  421. package/dist/nodes/node/node-time.js +1 -1
  422. package/dist/nodes/node/node-time.js.map +1 -1
  423. package/dist/nodes/node/node-walk.js.map +1 -1
  424. package/dist/nodes/node/node.d.ts +5 -3
  425. package/dist/nodes/node/node.d.ts.map +1 -1
  426. package/dist/nodes/node/node.js +44 -19
  427. package/dist/nodes/node/node.js.map +1 -1
  428. package/dist/nodes/node/text-defaults.d.ts +10 -12
  429. package/dist/nodes/node/text-defaults.d.ts.map +1 -1
  430. package/dist/nodes/node/text-defaults.js +10 -12
  431. package/dist/nodes/node/text-defaults.js.map +1 -1
  432. package/dist/nodes/{scene → root}/canvas2d-node.d.ts +2 -2
  433. package/dist/nodes/root/canvas2d-node.d.ts.map +1 -0
  434. package/dist/nodes/{scene → root}/canvas2d-node.js +2 -2
  435. package/dist/nodes/root/canvas2d-node.js.map +1 -0
  436. package/dist/nodes/root/provider-node.d.ts.map +1 -0
  437. package/dist/nodes/root/provider-node.js.map +1 -0
  438. package/dist/nodes/root/theme-provider-node.d.ts.map +1 -0
  439. package/dist/nodes/root/theme-provider-node.js.map +1 -0
  440. package/dist/nodes/text/default-text-style-node.d.ts +5 -2
  441. package/dist/nodes/text/default-text-style-node.d.ts.map +1 -1
  442. package/dist/nodes/text/default-text-style-node.js +10 -4
  443. package/dist/nodes/text/default-text-style-node.js.map +1 -1
  444. package/dist/nodes/text/number-format.d.ts +1 -1
  445. package/dist/nodes/text/number-format.js +1 -1
  446. package/dist/nodes/text/number-format.js.map +1 -1
  447. package/dist/nodes/text/number-node.js.map +1 -1
  448. package/dist/nodes/text/number-pattern.js.map +1 -1
  449. package/dist/nodes/text/richtext-node.js +1 -1
  450. package/dist/nodes/text/richtext-node.js.map +1 -1
  451. package/dist/nodes/text/text-base.d.ts.map +1 -1
  452. package/dist/nodes/text/text-base.js +1 -1
  453. package/dist/nodes/text/text-base.js.map +1 -1
  454. package/dist/nodes/text/text-node.js.map +1 -1
  455. package/dist/nodes/text/text-selection.js.map +1 -1
  456. package/dist/nodes/three/camera-nodes.d.ts +21 -3
  457. package/dist/nodes/three/camera-nodes.d.ts.map +1 -1
  458. package/dist/nodes/three/camera-nodes.js +42 -1
  459. package/dist/nodes/three/camera-nodes.js.map +1 -1
  460. package/dist/nodes/three/canvas3d-node.d.ts +29 -6
  461. package/dist/nodes/three/canvas3d-node.d.ts.map +1 -1
  462. package/dist/nodes/three/canvas3d-node.js +44 -2
  463. package/dist/nodes/three/canvas3d-node.js.map +1 -1
  464. package/dist/nodes/three/drawable-nodes.d.ts +25 -11
  465. package/dist/nodes/three/drawable-nodes.d.ts.map +1 -1
  466. package/dist/nodes/three/drawable-nodes.js +43 -13
  467. package/dist/nodes/three/drawable-nodes.js.map +1 -1
  468. package/dist/nodes/three/environment-nodes.d.ts +9 -3
  469. package/dist/nodes/three/environment-nodes.d.ts.map +1 -1
  470. package/dist/nodes/three/environment-nodes.js.map +1 -1
  471. package/dist/nodes/three/geometry-nodes.d.ts +2 -2
  472. package/dist/nodes/three/geometry-nodes.js +2 -2
  473. package/dist/nodes/three/geometry-nodes.js.map +1 -1
  474. package/dist/nodes/three/grid-geometry3d.js.map +1 -1
  475. package/dist/nodes/three/group3d.js.map +1 -1
  476. package/dist/nodes/three/light-nodes.d.ts.map +1 -1
  477. package/dist/nodes/three/light-nodes.js +3 -3
  478. package/dist/nodes/three/light-nodes.js.map +1 -1
  479. package/dist/nodes/three/mesh3d.js.map +1 -1
  480. package/dist/nodes/three/node3d.d.ts +48 -0
  481. package/dist/nodes/three/node3d.d.ts.map +1 -1
  482. package/dist/nodes/three/node3d.js +53 -3
  483. package/dist/nodes/three/node3d.js.map +1 -1
  484. package/dist/platform/audio-sink.d.ts +2 -2
  485. package/dist/platform/audio-sink.d.ts.map +1 -1
  486. package/dist/platform/audio-sink.js.map +1 -1
  487. package/dist/platform/exporter.d.ts +13 -8
  488. package/dist/platform/exporter.d.ts.map +1 -1
  489. package/dist/platform/exporter.js.map +1 -1
  490. package/dist/platform/index.d.ts +1 -1
  491. package/dist/platform/index.d.ts.map +1 -1
  492. package/dist/platform/index.js.map +1 -1
  493. package/dist/platform/stepped-clock.js.map +1 -1
  494. package/dist/platform/storage-adapter.d.ts +12 -6
  495. package/dist/platform/storage-adapter.d.ts.map +1 -1
  496. package/dist/platform/storage-adapter.js +4 -0
  497. package/dist/platform/storage-adapter.js.map +1 -1
  498. package/dist/platform/ticker.d.ts +6 -0
  499. package/dist/platform/ticker.d.ts.map +1 -1
  500. package/dist/platform/ticker.js +6 -0
  501. package/dist/platform/ticker.js.map +1 -1
  502. package/dist/project/config.js.map +1 -1
  503. package/dist/project/index.js.map +1 -1
  504. package/dist/project/tree.d.ts +3 -3
  505. package/dist/project/tree.d.ts.map +1 -1
  506. package/dist/project/tree.js.map +1 -1
  507. package/dist/props/host.js.map +1 -1
  508. package/dist/props/index.js.map +1 -1
  509. package/dist/props/observer.js.map +1 -1
  510. package/dist/props/slot.js.map +1 -1
  511. package/dist/renamed-scene-names.d.ts +17 -0
  512. package/dist/renamed-scene-names.d.ts.map +1 -0
  513. package/dist/renamed-scene-names.js +9 -0
  514. package/dist/renamed-scene-names.js.map +1 -0
  515. package/dist/render/canvas-render-context2d.d.ts +10 -3
  516. package/dist/render/canvas-render-context2d.d.ts.map +1 -1
  517. package/dist/render/canvas-render-context2d.js +10 -0
  518. package/dist/render/canvas-render-context2d.js.map +1 -1
  519. package/dist/render/clip-contains.js.map +1 -1
  520. package/dist/render/clip.js.map +1 -1
  521. package/dist/render/descriptors/ellipse.js.map +1 -1
  522. package/dist/render/descriptors/latex.js.map +1 -1
  523. package/dist/render/descriptors/line.js.map +1 -1
  524. package/dist/render/descriptors/path-builder.js.map +1 -1
  525. package/dist/render/descriptors/path.js.map +1 -1
  526. package/dist/render/descriptors/polygon.js.map +1 -1
  527. package/dist/render/descriptors/polygram.js.map +1 -1
  528. package/dist/render/descriptors/rect.js.map +1 -1
  529. package/dist/render/descriptors/richtext.js.map +1 -1
  530. package/dist/render/descriptors/shape.d.ts +12 -0
  531. package/dist/render/descriptors/shape.d.ts.map +1 -1
  532. package/dist/render/descriptors/shape.js.map +1 -1
  533. package/dist/render/descriptors/text.d.ts +2 -2
  534. package/dist/render/descriptors/text.js +2 -2
  535. package/dist/render/descriptors/text.js.map +1 -1
  536. package/dist/render/descriptors/transform.d.ts +2 -2
  537. package/dist/render/descriptors/transform.d.ts.map +1 -1
  538. package/dist/render/descriptors/transform.js.map +1 -1
  539. package/dist/render/graphics2d.d.ts +3 -3
  540. package/dist/render/graphics2d.d.ts.map +1 -1
  541. package/dist/render/graphics2d.js +1 -1
  542. package/dist/render/graphics2d.js.map +1 -1
  543. package/dist/render/index.js.map +1 -1
  544. package/dist/render/measure-context.js.map +1 -1
  545. package/dist/render/null-render-context.js.map +1 -1
  546. package/dist/render/render-context2d.d.ts +5 -5
  547. package/dist/render/render-context2d.d.ts.map +1 -1
  548. package/dist/render/render-context2d.js.map +1 -1
  549. package/dist/render/surface.js.map +1 -1
  550. package/dist/render/text-defaults.js.map +1 -1
  551. package/dist/render/text-layout.js.map +1 -1
  552. package/dist/render3d/bounds3d.d.ts.map +1 -1
  553. package/dist/render3d/bounds3d.js +4 -2
  554. package/dist/render3d/bounds3d.js.map +1 -1
  555. package/dist/render3d/builders.js.map +1 -1
  556. package/dist/render3d/camera.d.ts +6 -0
  557. package/dist/render3d/camera.d.ts.map +1 -1
  558. package/dist/render3d/camera.js +5 -3
  559. package/dist/render3d/camera.js.map +1 -1
  560. package/dist/render3d/fill3d.d.ts +2 -9
  561. package/dist/render3d/fill3d.d.ts.map +1 -1
  562. package/dist/render3d/fill3d.js +2 -13
  563. package/dist/render3d/fill3d.js.map +1 -1
  564. package/dist/render3d/geometry.d.ts +8 -1
  565. package/dist/render3d/geometry.d.ts.map +1 -1
  566. package/dist/render3d/geometry.js.map +1 -1
  567. package/dist/render3d/graphics3d.d.ts +8 -4
  568. package/dist/render3d/graphics3d.d.ts.map +1 -1
  569. package/dist/render3d/graphics3d.js +18 -10
  570. package/dist/render3d/graphics3d.js.map +1 -1
  571. package/dist/render3d/index.d.ts +1 -1
  572. package/dist/render3d/index.js +1 -1
  573. package/dist/render3d/index.js.map +1 -1
  574. package/dist/render3d/inert.d.ts +14 -0
  575. package/dist/render3d/inert.d.ts.map +1 -0
  576. package/dist/render3d/inert.js +62 -0
  577. package/dist/render3d/inert.js.map +1 -0
  578. package/dist/render3d/light.js.map +1 -1
  579. package/dist/render3d/material.d.ts +10 -5
  580. package/dist/render3d/material.d.ts.map +1 -1
  581. package/dist/render3d/material.js.map +1 -1
  582. package/dist/render3d/matrix4.js.map +1 -1
  583. package/dist/render3d/render-context3d.js.map +1 -1
  584. package/dist/render3d/resources.d.ts +2 -2
  585. package/dist/render3d/resources.js +2 -2
  586. package/dist/render3d/resources.js.map +1 -1
  587. package/dist/render3d/rounded-box.js.map +1 -1
  588. package/dist/render3d/scene-settings.d.ts +23 -4
  589. package/dist/render3d/scene-settings.d.ts.map +1 -1
  590. package/dist/render3d/scene-settings.js.map +1 -1
  591. package/dist/render3d/scene3d.d.ts +11 -0
  592. package/dist/render3d/scene3d.d.ts.map +1 -1
  593. package/dist/render3d/scene3d.js +39 -6
  594. package/dist/render3d/scene3d.js.map +1 -1
  595. package/dist/render3d/segments.js.map +1 -1
  596. package/dist/render3d/texture.d.ts +9 -0
  597. package/dist/render3d/texture.d.ts.map +1 -1
  598. package/dist/render3d/texture.js +13 -0
  599. package/dist/render3d/texture.js.map +1 -1
  600. package/dist/render3d/tracking.js.map +1 -1
  601. package/dist/render3d/transform.d.ts +1 -1
  602. package/dist/render3d/transform.js.map +1 -1
  603. package/dist/render3d/vector3.d.ts +18 -1
  604. package/dist/render3d/vector3.d.ts.map +1 -1
  605. package/dist/render3d/vector3.js +27 -0
  606. package/dist/render3d/vector3.js.map +1 -1
  607. package/dist/render3d/walk.d.ts +1 -1
  608. package/dist/render3d/walk.d.ts.map +1 -1
  609. package/dist/render3d/walk.js +5 -1
  610. package/dist/render3d/walk.js.map +1 -1
  611. package/dist/runtime/asset-refine.js.map +1 -1
  612. package/dist/runtime/asset-timeline.js.map +1 -1
  613. package/dist/runtime/asset-update.js.map +1 -1
  614. package/dist/runtime/audio-index.d.ts +2 -2
  615. package/dist/runtime/audio-index.d.ts.map +1 -1
  616. package/dist/runtime/audio-index.js +8 -2
  617. package/dist/runtime/audio-index.js.map +1 -1
  618. package/dist/runtime/builtin-context.js.map +1 -1
  619. package/dist/runtime/clip-instance.d.ts +5 -3
  620. package/dist/runtime/clip-instance.d.ts.map +1 -1
  621. package/dist/runtime/clip-instance.js +10 -6
  622. package/dist/runtime/clip-instance.js.map +1 -1
  623. package/dist/runtime/clip-store.d.ts +9 -0
  624. package/dist/runtime/clip-store.d.ts.map +1 -1
  625. package/dist/runtime/clip-store.js +33 -3
  626. package/dist/runtime/clip-store.js.map +1 -1
  627. package/dist/runtime/engine.d.ts +5 -0
  628. package/dist/runtime/engine.d.ts.map +1 -1
  629. package/dist/runtime/engine.js +2 -0
  630. package/dist/runtime/engine.js.map +1 -1
  631. package/dist/runtime/frame-time.d.ts +31 -0
  632. package/dist/runtime/frame-time.d.ts.map +1 -0
  633. package/dist/runtime/frame-time.js +29 -0
  634. package/dist/runtime/frame-time.js.map +1 -0
  635. package/dist/runtime/index.d.ts +1 -0
  636. package/dist/runtime/index.d.ts.map +1 -1
  637. package/dist/runtime/index.js +1 -0
  638. package/dist/runtime/index.js.map +1 -1
  639. package/dist/runtime/node-picking.d.ts +44 -3
  640. package/dist/runtime/node-picking.d.ts.map +1 -1
  641. package/dist/runtime/node-picking.js +118 -3
  642. package/dist/runtime/node-picking.js.map +1 -1
  643. package/dist/runtime/node-picking3d.d.ts +2 -1
  644. package/dist/runtime/node-picking3d.d.ts.map +1 -1
  645. package/dist/runtime/node-picking3d.js +5 -2
  646. package/dist/runtime/node-picking3d.js.map +1 -1
  647. package/dist/runtime/placement.d.ts.map +1 -1
  648. package/dist/runtime/placement.js +4 -5
  649. package/dist/runtime/placement.js.map +1 -1
  650. package/dist/runtime/playback-controller.d.ts +31 -2
  651. package/dist/runtime/playback-controller.d.ts.map +1 -1
  652. package/dist/runtime/playback-controller.js +63 -6
  653. package/dist/runtime/playback-controller.js.map +1 -1
  654. package/dist/runtime/playback.js.map +1 -1
  655. package/dist/runtime/precompisition.js.map +1 -1
  656. package/dist/runtime/project-assets.js.map +1 -1
  657. package/dist/runtime/session.d.ts +9 -7
  658. package/dist/runtime/session.d.ts.map +1 -1
  659. package/dist/runtime/session.js +12 -4
  660. package/dist/runtime/session.js.map +1 -1
  661. package/dist/runtime/settle.js.map +1 -1
  662. package/dist/runtime/state-evaluator.d.ts +1 -1
  663. package/dist/runtime/state-evaluator.d.ts.map +1 -1
  664. package/dist/runtime/state-evaluator.js +4 -3
  665. package/dist/runtime/state-evaluator.js.map +1 -1
  666. package/dist/runtime/text-geometry.js.map +1 -1
  667. package/dist/sdk/index.d.ts +27 -22
  668. package/dist/sdk/index.d.ts.map +1 -1
  669. package/dist/sdk/index.js +23 -9
  670. package/dist/sdk/index.js.map +1 -1
  671. package/dist/tween/command-decorator.d.ts +12 -4
  672. package/dist/tween/command-decorator.d.ts.map +1 -1
  673. package/dist/tween/command-decorator.js +10 -22
  674. package/dist/tween/command-decorator.js.map +1 -1
  675. package/dist/tween/command.js.map +1 -1
  676. package/dist/tween/ease/constants.d.ts.map +1 -1
  677. package/dist/tween/ease/constants.js +8 -5
  678. package/dist/tween/ease/constants.js.map +1 -1
  679. package/dist/tween/ease/curve.d.ts.map +1 -1
  680. package/dist/tween/ease/curve.js +4 -3
  681. package/dist/tween/ease/curve.js.map +1 -1
  682. package/dist/tween/ease/describe.d.ts +15 -0
  683. package/dist/tween/ease/describe.d.ts.map +1 -0
  684. package/dist/tween/ease/describe.js +37 -0
  685. package/dist/tween/ease/describe.js.map +1 -0
  686. package/dist/tween/ease/type.js.map +1 -1
  687. package/dist/tween/index.js.map +1 -1
  688. package/dist/tween/inert.js.map +1 -1
  689. package/dist/tween/lerp.js.map +1 -1
  690. package/dist/tween/loop.js.map +1 -1
  691. package/dist/tween/prepare.d.ts +3 -3
  692. package/dist/tween/prepare.js +3 -3
  693. package/dist/tween/prepare.js.map +1 -1
  694. package/dist/tween/seekable.d.ts +12 -1
  695. package/dist/tween/seekable.d.ts.map +1 -1
  696. package/dist/tween/seekable.js +15 -0
  697. package/dist/tween/seekable.js.map +1 -1
  698. package/dist/tween/stepper.js.map +1 -1
  699. package/dist/tween/to-command.js.map +1 -1
  700. package/dist/util/clamp.js.map +1 -1
  701. package/dist/util/context.js.map +1 -1
  702. package/dist/util/csv.js.map +1 -1
  703. package/dist/util/generateList.js.map +1 -1
  704. package/dist/util/index.js.map +1 -1
  705. package/dist/util/metrics.d.ts +1 -1
  706. package/dist/util/metrics.js +1 -1
  707. package/dist/util/metrics.js.map +1 -1
  708. package/dist/util/random.js.map +1 -1
  709. package/dist/util/reference.js.map +1 -1
  710. package/dist/util/scheduler.js.map +1 -1
  711. package/package.json +2 -1
  712. package/dist/attributes/shape/effects/implementations/displace.d.ts +0 -48
  713. package/dist/attributes/shape/effects/implementations/displace.d.ts.map +0 -1
  714. package/dist/attributes/shape/effects/implementations/displace.js +0 -30
  715. package/dist/attributes/shape/effects/implementations/displace.js.map +0 -1
  716. package/dist/attributes/shape/effects/implementations/god-rays.d.ts +0 -28
  717. package/dist/attributes/shape/effects/implementations/god-rays.d.ts.map +0 -1
  718. package/dist/attributes/shape/effects/implementations/god-rays.js +0 -26
  719. package/dist/attributes/shape/effects/implementations/god-rays.js.map +0 -1
  720. package/dist/attributes/shape/effects/implementations/texture.d.ts +0 -28
  721. package/dist/attributes/shape/effects/implementations/texture.d.ts.map +0 -1
  722. package/dist/attributes/shape/effects/implementations/texture.js +0 -25
  723. package/dist/attributes/shape/effects/implementations/texture.js.map +0 -1
  724. package/dist/attributes/shape/effects/implementations/trails.d.ts +0 -41
  725. package/dist/attributes/shape/effects/implementations/trails.d.ts.map +0 -1
  726. package/dist/attributes/shape/effects/implementations/trails.js +0 -22
  727. package/dist/attributes/shape/effects/implementations/trails.js.map +0 -1
  728. package/dist/browser/chunks/chunk-2T3HXSC2.js +0 -2
  729. package/dist/browser/chunks/chunk-2T3HXSC2.js.map +0 -7
  730. package/dist/browser/chunks/chunk-P3XQCHDW.js +0 -16
  731. package/dist/browser/chunks/chunk-P3XQCHDW.js.map +0 -7
  732. package/dist/browser/chunks/chunk-VJQMKHGQ.js +0 -3
  733. package/dist/browser/chunks/chunk-VJQMKHGQ.js.map +0 -7
  734. package/dist/nodes/geometry/dot-grid-node.d.ts +0 -105
  735. package/dist/nodes/geometry/dot-grid-node.d.ts.map +0 -1
  736. package/dist/nodes/geometry/dot-grid-node.js +0 -142
  737. package/dist/nodes/geometry/dot-grid-node.js.map +0 -1
  738. package/dist/nodes/geometry/grid-lines.d.ts +0 -101
  739. package/dist/nodes/geometry/grid-lines.d.ts.map +0 -1
  740. package/dist/nodes/geometry/grid-lines.js +0 -128
  741. package/dist/nodes/geometry/grid-lines.js.map +0 -1
  742. package/dist/nodes/geometry/grid-pattern-node.d.ts +0 -58
  743. package/dist/nodes/geometry/grid-pattern-node.d.ts.map +0 -1
  744. package/dist/nodes/geometry/grid-pattern-node.js +0 -172
  745. package/dist/nodes/geometry/grid-pattern-node.js.map +0 -1
  746. package/dist/nodes/geometry/line-grid-node.d.ts +0 -62
  747. package/dist/nodes/geometry/line-grid-node.d.ts.map +0 -1
  748. package/dist/nodes/geometry/line-grid-node.js +0 -127
  749. package/dist/nodes/geometry/line-grid-node.js.map +0 -1
  750. package/dist/nodes/geometry/line-node.d.ts +0 -58
  751. package/dist/nodes/geometry/line-node.d.ts.map +0 -1
  752. package/dist/nodes/geometry/line-node.js +0 -123
  753. package/dist/nodes/geometry/line-node.js.map +0 -1
  754. package/dist/nodes/geometry/viewport-pattern-node.d.ts +0 -39
  755. package/dist/nodes/geometry/viewport-pattern-node.d.ts.map +0 -1
  756. package/dist/nodes/geometry/viewport-pattern-node.js +0 -79
  757. package/dist/nodes/geometry/viewport-pattern-node.js.map +0 -1
  758. package/dist/nodes/scene/canvas2d-node.d.ts.map +0 -1
  759. package/dist/nodes/scene/canvas2d-node.js.map +0 -1
  760. package/dist/nodes/scene/provider-node.d.ts.map +0 -1
  761. package/dist/nodes/scene/provider-node.js.map +0 -1
  762. package/dist/nodes/scene/theme-provider-node.d.ts.map +0 -1
  763. package/dist/nodes/scene/theme-provider-node.js.map +0 -1
  764. /package/dist/nodes/{scene → root}/provider-node.d.ts +0 -0
  765. /package/dist/nodes/{scene → root}/provider-node.js +0 -0
  766. /package/dist/nodes/{scene → root}/theme-provider-node.d.ts +0 -0
  767. /package/dist/nodes/{scene → root}/theme-provider-node.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"node.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,MAAM,iBAAiB,CAAC;AAClG,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAG3D,OAAO,EAAW,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAIrD,OAAO,EAAE,eAAe,EAAe,MAAM,mCAAmC,CAAC;AACjF,OAAO,EACH,SAAS,EACT,kBAAkB,EAClB,iBAAiB,EACjB,QAAQ,EACR,eAAe,EACf,SAAS,GACZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,eAAe,EAAE,cAAc,EAAuC,MAAM,wBAAwB,CAAC;AAE9G,OAAO,EAAE,OAAO,EAAE,M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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;AApeG;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,MAAM,iBAAiB,CAAC;AAClG,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAG3D,OAAO,EAAW,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAIrD,OAAO,EAAE,eAAe,EAAkC,MAAM,mCAAmC,CAAC;AACpG,OAAO,EACH,SAAS,EACT,kBAAkB,EAClB,iBAAiB,EACjB,QAAQ,EACR,eAAe,EACf,SAAS,GACZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,eAAe,EAAE,cAAc,EAAuC,MAAM,wBAAwB,CAAC;AAE9G,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAQpD,iFAAiF;AACjF,MAAM,QAAQ,GAAkC;IAC5C,IAAI,EAAE,6EAA6E;IACnF,IAAI,EAAE,0EAA0E;IAChF,KAAK,EAAE,qEAAqE;CAC/E,CAAC;AAEF,0GAA0G;AAC1G,SAAS,aAAa,CAAC,IAAkB;IACrC,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC;IACpC,MAAM,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AAC,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"]}
@@ -6,20 +6,18 @@
6
6
  * only what the manifest registered and a family called `""` shapes against
7
7
  * nothing and paints no glyphs. Which family that is, though, is a fact about
8
8
  * the application: which fonts it vendored, which it licensed, what its UI is
9
- * set in. A component shipped as its own package cannot know it, and the two
10
- * nodes that used to reach for `assets`'s `BUILTIN_FONT_FAMILY` were reaching
11
- * across exactly the seam this file marks.
9
+ * set in. A component shipped as its own package cannot know it, and the engine
10
+ * has no built-in family to offer in its place.
12
11
  *
13
- * So the answer is *supplied*, once, by the composition root — the same place
14
- * that registers the node classes (`nodes/register`). The default is Inter
15
- * because that is what the studio vendors, and a host that ships something else
16
- * says so instead of every node learning its name.
12
+ * So the answer is *supplied*, once, by the host application's composition
13
+ * root, through {@link setHostTextFamily}. Until a host does, the answer is
14
+ * `""`, and a host that ships a typeface says so instead of every node learning
15
+ * its name.
17
16
  *
18
- * This is deliberately **not** a prop. The value is already carried as one: the
19
- * appearance bag's `fontFamily`, which the props mappers fill in from here when
20
- * the author has left it empty. What lives here is only the answer to "empty
21
- * means what?", which is one answer for the whole application rather than one
22
- * per node.
17
+ * This is deliberately **not** a prop. The prop is the node's own `fontFamily`,
18
+ * which a host's props mapping can fill in from here when the author has left
19
+ * it empty. What lives here is only the answer to "empty means what?", which is
20
+ * one answer for the whole application rather than one per node.
23
21
  */
24
22
  /**
25
23
  * Declares the family this application's components fall back to.
@@ -1 +1 @@
1
- {"version":3,"file":"text-defaults.d.ts","sourceRoot":"","sources":["../../../src/nodes/node/text-defaults.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAIH;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEtD;AAED,uDAAuD;AACvD,wBAAgB,cAAc,IAAI,MAAM,CAEvC"}
1
+ {"version":3,"file":"text-defaults.d.ts","sourceRoot":"","sources":["../../../src/nodes/node/text-defaults.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEtD;AAED,uDAAuD;AACvD,wBAAgB,cAAc,IAAI,MAAM,CAEvC"}
@@ -6,20 +6,18 @@
6
6
  * only what the manifest registered and a family called `""` shapes against
7
7
  * nothing and paints no glyphs. Which family that is, though, is a fact about
8
8
  * the application: which fonts it vendored, which it licensed, what its UI is
9
- * set in. A component shipped as its own package cannot know it, and the two
10
- * nodes that used to reach for `assets`'s `BUILTIN_FONT_FAMILY` were reaching
11
- * across exactly the seam this file marks.
9
+ * set in. A component shipped as its own package cannot know it, and the engine
10
+ * has no built-in family to offer in its place.
12
11
  *
13
- * So the answer is *supplied*, once, by the composition root — the same place
14
- * that registers the node classes (`nodes/register`). The default is Inter
15
- * because that is what the studio vendors, and a host that ships something else
16
- * says so instead of every node learning its name.
12
+ * So the answer is *supplied*, once, by the host application's composition
13
+ * root, through {@link setHostTextFamily}. Until a host does, the answer is
14
+ * `""`, and a host that ships a typeface says so instead of every node learning
15
+ * its name.
17
16
  *
18
- * This is deliberately **not** a prop. The value is already carried as one: the
19
- * appearance bag's `fontFamily`, which the props mappers fill in from here when
20
- * the author has left it empty. What lives here is only the answer to "empty
21
- * means what?", which is one answer for the whole application rather than one
22
- * per node.
17
+ * This is deliberately **not** a prop. The prop is the node's own `fontFamily`,
18
+ * which a host's props mapping can fill in from here when the author has left
19
+ * it empty. What lives here is only the answer to "empty means what?", which is
20
+ * one answer for the whole application rather than one per node.
23
21
  */
24
22
  let fallbackFamily = "";
25
23
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"text-defaults.js","sourceRoot":"","sources":["../../../src/nodes/node/text-defaults.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,IAAI,cAAc,GAAG,EAAE,CAAA;AAEvB;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAc;IAC9C,cAAc,GAAG,MAAM,CAAA;AACzB,CAAC;AAED,uDAAuD;AACvD,MAAM,UAAU,cAAc;IAC5B,OAAO,cAAc,CAAA;AACvB,CAAC","sourcesContent":["/**\n * The family a component's text falls back to when the document names none.\n *\n * A node that draws a caption of its own — a button's label, a window's title —\n * has to put *some* family on it, because the renderer's font provider holds\n * only what the manifest registered and a family called `\"\"` shapes against\n * nothing and paints no glyphs. Which family that is, though, is a fact about\n * the application: which fonts it vendored, which it licensed, what its UI is\n * set in. A component shipped as its own package cannot know it, and the two\n * nodes that used to reach for `assets`'s `BUILTIN_FONT_FAMILY` were reaching\n * across exactly the seam this file marks.\n *\n * So the answer is *supplied*, once, by the composition root — the same place\n * that registers the node classes (`nodes/register`). The default is Inter\n * because that is what the studio vendors, and a host that ships something else\n * says so instead of every node learning its name.\n *\n * This is deliberately **not** a prop. The value is already carried as one: the\n * appearance bag's `fontFamily`, which the props mappers fill in from here when\n * the author has left it empty. What lives here is only the answer to \"empty\n * means what?\", which is one answer for the whole application rather than one\n * per node.\n */\n\nlet fallbackFamily = \"\"\n\n/**\n * Declares the family this application's components fall back to.\n *\n * Called by the composition root before the first build. Left unset, components\n * fall back to `\"\"`, which paints no glyphs — a legible blank rather than a\n * silently wrong typeface, and the same bargain an unregistered node type makes.\n */\nexport function setHostTextFamily(family: string): void {\n fallbackFamily = family\n}\n\n/** The family to use where the document names none. */\nexport function hostTextFamily(): string {\n return fallbackFamily\n}\n"]}
1
+ {"version":3,"file":"text-defaults.js","sourceRoot":"","sources":["../../../src/nodes/node/text-defaults.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,IAAI,cAAc,GAAG,EAAE,CAAA;AAEvB;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAc;IAC9C,cAAc,GAAG,MAAM,CAAA;AACzB,CAAC;AAED,uDAAuD;AACvD,MAAM,UAAU,cAAc;IAC5B,OAAO,cAAc,CAAA;AACvB,CAAC","sourcesContent":["/**\r\n * The family a component's text falls back to when the document names none.\r\n *\r\n * A node that draws a caption of its own — a button's label, a window's title —\r\n * has to put *some* family on it, because the renderer's font provider holds\r\n * only what the manifest registered and a family called `\"\"` shapes against\r\n * nothing and paints no glyphs. Which family that is, though, is a fact about\r\n * the application: which fonts it vendored, which it licensed, what its UI is\r\n * set in. A component shipped as its own package cannot know it, and the engine\r\n * has no built-in family to offer in its place.\r\n *\r\n * So the answer is *supplied*, once, by the host application's composition\r\n * root, through {@link setHostTextFamily}. Until a host does, the answer is\r\n * `\"\"`, and a host that ships a typeface says so instead of every node learning\r\n * its name.\r\n *\r\n * This is deliberately **not** a prop. The prop is the node's own `fontFamily`,\r\n * which a host's props mapping can fill in from here when the author has left\r\n * it empty. What lives here is only the answer to \"empty means what?\", which is\r\n * one answer for the whole application rather than one per node.\r\n */\r\n\r\nlet fallbackFamily = \"\"\r\n\r\n/**\r\n * Declares the family this application's components fall back to.\r\n *\r\n * Called by the composition root before the first build. Left unset, components\r\n * fall back to `\"\"`, which paints no glyphs — a legible blank rather than a\r\n * silently wrong typeface, and the same bargain an unregistered node type makes.\r\n */\r\nexport function setHostTextFamily(family: string): void {\r\n fallbackFamily = family\r\n}\r\n\r\n/** The family to use where the document names none. */\r\nexport function hostTextFamily(): string {\r\n return fallbackFamily\r\n}\r\n"]}
@@ -55,9 +55,9 @@ export interface Canvas2DProps extends Node2DProps, FlowProps {
55
55
  dolly: number;
56
56
  }
57
57
  /**
58
- * The single root container every {@link Scene} builds into.
58
+ * The single root container every clip document builds into.
59
59
  *
60
- * A `Canvas2D` is a plain {@link Node2D} that doubles as the scene's layout frame
60
+ * A `Canvas2D` is a plain {@link Node2D} that doubles as the clip's layout frame
61
61
  * and camera. It lays its children out (flex `horizontal`/`vertical` or
62
62
  * `freeform`, with `gap`, `align`, `padding`) and paints a scene-wide background
63
63
  * (`fill`) and `overlay` — *and* views those laid-out children through a viewport
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canvas2d-node.d.ts","sourceRoot":"","sources":["../../../src/nodes/root/canvas2d-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE1E,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEjE,OAAO,EAAc,KAAK,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,6BAA6B,CAAC;AACxF,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEjF,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEjF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAIrD,gBAAgB;AAChB,MAAM,WAAW,aAAc,SAAQ,WAAW,EAAE,SAAS;IACzD;;;;OAIG;IACH,IAAI,EAAE,IAAI,CAAC;IACX;;;;OAIG;IACH,OAAO,EAAE,IAAI,CAAC;IACd,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;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,aAAa,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;cAQ7B,QAAQ,IAAI,IAAI;IAiB1B,YAAY,IAAI,WAAW,GAAG,IAAI;IAMlC,YAAY,IAAI,WAAW,GAAG,IAAI;cAkBxB,WAAW,IAAI,YAAY;cAI3B,cAAc,CAAC,GAAG,EAAE,YAAY,GAAG,IAAI;CA4B7D"}
@@ -16,9 +16,9 @@ import { NodeAudio } from "../../nodes/audio/node-audio.js";
16
16
  import { property } from "../../attributes/properties/decorator.js";
17
17
  import { alignmentProperty, fillProperty, flowProperty } from "../../attributes/properties/typed.js";
18
18
  /**
19
- * The single root container every {@link Scene} builds into.
19
+ * The single root container every clip document builds into.
20
20
  *
21
- * A `Canvas2D` is a plain {@link Node2D} that doubles as the scene's layout frame
21
+ * A `Canvas2D` is a plain {@link Node2D} that doubles as the clip's layout frame
22
22
  * and camera. It lays its children out (flex `horizontal`/`vertical` or
23
23
  * `freeform`, with `gap`, `align`, `padding`) and paints a scene-wide background
24
24
  * (`fill`) and `overlay` — *and* views those laid-out children through a viewport
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canvas2d-node.js","sourceRoot":"","sources":["../../../src/nodes/root/canvas2d-node.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAErC,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,UAAU,EAAiC,MAAM,6BAA6B,CAAC;AACxF,OAAO,EAAE,gBAAgB,EAAqB,MAAM,8BAA8B,CAAC;AAGnF,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAI3D,OAAO,EAAe,MAAM,EAA2B,MAAM,mBAAmB,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACr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C,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC;qCAG5I;AAQD;IADC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;uCAGnI;AAID;IADC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC;uCAG/D;AAID;IADC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;yCAG3E;AAGD;IADC,OAAO,EAAE;sCAMT;AAGD;IADC,OAAO,EAAE;yCAMT","sourcesContent":["import { RenderContext2D, RenderPass2D } from \"@/render/render-context2d\";\r\nimport { Graphics2D } from \"@/render/graphics2d\";\r\nimport { Clip } from \"@/render/clip\";\r\nimport { type Command, type CommandArgs } from \"@/tween/command\";\r\nimport { command } from \"@/tween/command-decorator\";\r\nimport { lerpLookAt, type LookAt, type SpaceCamera } from \"@/attributes/layout/space3d\";\r\nimport { NO_PROJECTION_3D, type Projection3D } from \"@/attributes/layout/matrix2d\";\r\nimport { Alignment } from \"@/attributes/layout/alignment\";\r\nimport type { FlowMode, FlowProps, FlowSettings, GapSize } from \"@/layout/types\";\r\nimport { fillOps } from \"@/attributes/shape/fill/registry\";\r\nimport { FillResolved } from \"@/attributes/shape/fill/union\";\r\nimport { Fill } from \"@/attributes/shape/fill/chain\";\r\nimport type { AssetScope } from \"@/assets/scope\";\r\nimport { CameraScope, Node2D, NodeConfig, Node2DProps } from \"@/nodes/2d/node2d\";\r\nimport { spaceRootFrame } from \"@/nodes/2d/node-space\";\r\nimport type { Node } from \"@/nodes/node/node\";\r\nimport { NodeAudio } from \"@/nodes/audio/node-audio\";\r\nimport { property } from \"@/attributes/properties/decorator\";\r\nimport { alignmentProperty, fillProperty, flowProperty } from \"@/attributes/properties/typed\";\r\n\r\n/** @internal */\r\nexport interface Canvas2DProps extends Node2DProps, FlowProps {\r\n /**\r\n * Background fill layer(s). Each item can be a CSS color string, a fill\r\n * prop object, an already-resolved fill, or a {@link FillChain} from the\r\n * `Fills` builder. Painted behind the scene's children.\r\n */\r\n fill: Fill;\r\n /**\r\n * Overlay layer(s) — same loose values as {@link fill}, but painted *over*\r\n * the fill **and** the children (clipped to the viewport). Use for textures\r\n * laid across the whole scene, e.g. a VHS-grain image or video.\r\n */\r\n overlay: Fill;\r\n /** Camera magnification factor. Values > 1 zoom in; < 1 zoom out. */\r\n zoom: number;\r\n /**\r\n * World-space point that maps to the centre of the viewport. In a\r\n * {@link space3D} it is also what the camera orbits, and `z` puts it in\r\n * depth — the same sense as a node's `depth`, so a negative `z` flies in.\r\n */\r\n lookAt: LookAt;\r\n /** Rotation of the camera view in degrees (clockwise). */\r\n heading: number;\r\n /**\r\n * Place the children in one 3D space seen through this camera, rather than\r\n * each projecting through a perspective of its own. Their `depth` and tilt\r\n * are then positions and turns in that space, and siblings paint far to\r\n * near. A switch rather than something read off the camera's numbers, so\r\n * turning it on can never jump a tween.\r\n *\r\n * While it is on, `perspective` is the camera's distance from {@link lookAt}\r\n * at `dolly: 0` — CSS's convention, so that plane draws 1:1 and `0` is a\r\n * parallel projection — and the stage's own tilt and depth are unused.\r\n */\r\n space3D: boolean;\r\n /** Degrees about the vertical axis through {@link lookAt}. 0 is head-on; positive moves the camera to the right. Same as `Camera3D`. */\r\n orbit: number;\r\n /** Degrees above the layers. Positive looks down on them. Same as `Camera3D`. */\r\n elevation: number;\r\n /** Px the camera has moved in toward {@link lookAt}. Inert with no perspective, as depth is. */\r\n dolly: number;\r\n}\r\n\r\n/**\r\n * The single root container every clip document builds into.\r\n *\r\n * A `Canvas2D` is a plain {@link Node2D} that doubles as the clip's layout frame\r\n * and camera. It lays its children out (flex `horizontal`/`vertical` or\r\n * `freeform`, with `gap`, `align`, `padding`) and paints a scene-wide background\r\n * (`fill`) and `overlay` — *and* views those laid-out children through a viewport\r\n * transform (`zoom`, `lookAt`, `heading`).\r\n *\r\n * Unlike a {@link Rect} it is **not a shape**: it has no stroke, shadow, corner,\r\n * or `start`/`end` props. It carries only the scene-wide concerns — background\r\n * paint, child layout, and camera — so `stage.fill`, `stage.flow`, etc. read\r\n * the root directly without exposing per-shape geometry the scene root never has.\r\n *\r\n * Its layout props are the arrangement {@link Node2D} lays its children out by,\r\n * the same as a {@link Rect}'s — see {@link flowArrangement}.\r\n */\r\n/** @internal */\r\nexport class Canvas2D extends Node2D<Canvas2DProps> {\r\n\r\n // ---- Background paint -------------------------------------------------\r\n // Author-facing paint props. Like Rect, the declared type is the loose\r\n // `Fill` so assignment (`this.fill = 'red'`) and reads share one type; the\r\n // @property accessor stores the *resolved* value via the mapper.\r\n @fillProperty()\r\n declare fill: Fill;\r\n @fillProperty()\r\n declare overlay: Fill;\r\n\r\n // ---- Layout container -------------------------------------------------\r\n @flowProperty() declare flow: FlowMode;\r\n @property({ default: 0 }) declare readonly gap: GapSize;\r\n @property({ default: false }) declare readonly wrap: boolean;\r\n // `undefined` means \"follow `gap`\", not \"missing\" — see FlowProps.crossGap.\r\n @property({ default: undefined }) declare readonly crossGap: number | undefined;\r\n @property({ default: 1 }) declare readonly columns: number;\r\n // Declared loose as `Alignment` (covers `this.align = 'center'`); the\r\n // accessor stores the resolved per-axis `Vector2` pivot. See Rect.\r\n @alignmentProperty()\r\n declare align: Alignment;\r\n\r\n // ---- Camera -----------------------------------------------------------\r\n /** Camera magnification factor (default: 1). */\r\n @property({ default: 1 }) declare zoom: number;\r\n /** World-space focus point (default: {x:0, y:0}). */\r\n @property({ default: { x: 0, y: 0 }, tween: lerpLookAt }) declare lookAt: LookAt;\r\n /** Camera view rotation in degrees (default: 0). */\r\n @property({ default: 0 }) declare heading: number;\r\n @property({ default: false }) declare space3D: boolean;\r\n @property({ default: 0 }) declare orbit: number;\r\n @property({ default: 0 }) declare elevation: number;\r\n @property({ default: 0 }) declare dolly: number;\r\n\r\n constructor(props: NodeConfig<Canvas2D, Canvas2DProps>) {\r\n super(props);\r\n }\r\n\r\n // ---- Camera motion commands -------------------------------------------\r\n // Mirror the Camera node's viewport commands.\r\n\r\n /** Animate `zoom`. Values > 1 zoom in; < 1 zoom out. */\r\n @command({ args: [{ key: \"zoom\", kind: \"number\", min: 0.01, step: 0.1, unit: \"×\" }] })\r\n zoomTo(args: CommandArgs<{ zoom: number }> & { duration: number }): Command<Canvas2DProps> {\r\n return this.to({ data: args.data as Partial<Canvas2DProps>, duration: args.duration, easing: args.easing });\r\n }\r\n\r\n /** Pan — animate `lookAt`, the world-space point mapped to the viewport center. `z` moves it in depth. */\r\n @command({ args: [{ key: \"lookAt\", kind: \"vector2\", properties: { x: { kind: \"number\" }, y: { kind: \"number\" }, z: { kind: \"number\" } } }] })\r\n panTo(args: CommandArgs<{ lookAt: LookAt }> & { duration: number }): Command<Canvas2DProps> {\r\n return this.to({ data: args.data as Partial<Canvas2DProps>, duration: args.duration, easing: args.easing });\r\n }\r\n\r\n /**\r\n * Swing the camera round {@link lookAt}. The argument names are the ones the\r\n * 3D components' `orbitTo` takes, less `zoom`: here that is the lens, not a\r\n * distance, and it has a command of its own.\r\n */\r\n @command({ args: [{ key: \"orbit\", kind: \"number\", step: 1, unit: \"°\" }, { key: \"elevation\", kind: \"number\", step: 1, unit: \"°\" }] })\r\n orbitTo(args: CommandArgs<{ orbit?: number; elevation?: number }> & { duration: number }): Command<Canvas2DProps> {\r\n return this.to({ data: args.data as Partial<Canvas2DProps>, duration: args.duration, easing: args.easing });\r\n }\r\n\r\n /** Move the camera in toward {@link lookAt} (positive) or back out. */\r\n @command({ args: [{ key: \"dolly\", kind: \"number\", step: 10 }] })\r\n dollyTo(args: CommandArgs<{ dolly: number }> & { duration: number }): Command<Canvas2DProps> {\r\n return this.to({ data: args.data as Partial<Canvas2DProps>, duration: args.duration, easing: args.easing });\r\n }\r\n\r\n /** Animate the view rotation (`heading`), in degrees clockwise. */\r\n @command({ args: [{ key: \"heading\", kind: \"number\", step: 1, unit: \"°\" }] })\r\n headingTo(args: CommandArgs<{ heading: number }> & { duration: number }): Command<Canvas2DProps> {\r\n return this.to({ data: args.data as Partial<Canvas2DProps>, duration: args.duration, easing: args.easing });\r\n }\r\n\r\n @command()\r\n fillTo(args: CommandArgs<Fill, FillResolved[]> & { duration: number }): Command<Canvas2DProps> {\r\n const from = this.fill as FillResolved[];\r\n const target = fillOps.resolve(args.data as Fill);\r\n const lerp = args.lerp ?? fillOps.lerp;\r\n return this.command<Canvas2DProps>(t => ({ fill: lerp(from, target, t) }) as Partial<Canvas2DProps>, args.duration, args.easing);\r\n }\r\n\r\n @command()\r\n overlayTo(args: CommandArgs<Fill, FillResolved[]> & { duration: number }): Command<Canvas2DProps> {\r\n const from = this.overlay as FillResolved[];\r\n const target = fillOps.resolve(args.data as Fill);\r\n const lerp = args.lerp ?? fillOps.lerp;\r\n return this.command<Canvas2DProps>(t => ({ overlay: lerp(from, target, t) }) as Partial<Canvas2DProps>, args.duration, args.easing);\r\n }\r\n\r\n // ---- Layout -----------------------------------------------------------\r\n\r\n protected override flowArrangement(): FlowSettings {\r\n return this;\r\n }\r\n\r\n // ---- Drawing ----------------------------------------------------------\r\n\r\n // The viewport-sized background box behind the children.\r\n private shapeGraphics(): Graphics2D {\r\n return new Graphics2D().rect({\r\n width: this.layoutBounds.width,\r\n height: this.layoutBounds.height,\r\n });\r\n }\r\n\r\n protected override renderSelf(draw: RenderContext2D): void {\r\n const fill = this.fill as FillResolved[];\r\n if (fill.length === 0) return;\r\n draw.draw(this.shapeGraphics().fill(fill));\r\n }\r\n\r\n // Overlay over fill + children, clipped to the viewport silhouette.\r\n protected override renderOverlay(ctx: RenderContext2D): void {\r\n const overlay = this.overlay as FillResolved[];\r\n if (overlay.length === 0) return;\r\n ctx.draw(this.shapeGraphics().fill(overlay));\r\n }\r\n\r\n /**\r\n * Accept audio children as well as 2D ones.\r\n *\r\n * The scene root is where the two trees meet, mirroring `Canvas3D` — and for\r\n * the same reason it is *this* node: a composition already carries both\r\n * halves of a clip, so a voiceover belongs in the document that shows the\r\n * picture it is narrating rather than in a second document beside it.\r\n *\r\n * Nothing partitions them by hand. `Node2D.children` already filters to its\r\n * own kind, so layout and render skip the audio subtree for free, and the\r\n * audio declaration walk reads the unfiltered list.\r\n */\r\n protected override acceptsChild(child: Node): boolean {\r\n return child.dimension === \"2d\" || child.dimension === \"audio\";\r\n }\r\n\r\n /** This node's children in the audio tree. */\r\n get childrenAudio(): NodeAudio[] {\r\n return this._allChildren.filter((c): c is NodeAudio => c instanceof NodeAudio);\r\n }\r\n\r\n // The world container, not a shape, so it declares its own `fill`/`overlay`.\r\n override declareAssets(assets: AssetScope): void {\r\n super.declareAssets(assets);\r\n assets.fill(this.fill as FillResolved[]);\r\n assets.fill(this.overlay as FillResolved[]);\r\n }\r\n\r\n // The viewport outline — used for `clip` and as the area backdrop effects\r\n // are confined to.\r\n protected override clipSelf(): Clip {\r\n return new Clip().rect({\r\n width: this.layoutBounds.width,\r\n height: this.layoutBounds.height,\r\n });\r\n }\r\n\r\n // ---- Rendering --------------------------------------------------------\r\n\r\n // Children are laid out by the flow engine; here we view that laid-out\r\n // world through the camera viewport transform, the same way the Camera node\r\n // does. When the camera is at rest (zoom 1, no heading, origin at 0) this is\r\n // the identity, so a plain layout root pays nothing extra.\r\n // Non-null exactly when renderChildren below opens a camera, so a consumer\r\n // reproducing the render transform (node picking) inserts the same scope in\r\n // the same place — and skips it on the at-rest fast path, where the renderer\r\n // pushes nothing at all.\r\n override _cameraScope(): CameraScope | null {\r\n if (this.space3D) return null;\r\n if (this.zoom === 1 && this.heading === 0 && this.lookAt.x === 0 && this.lookAt.y === 0) return null;\r\n return { lookAt: this.lookAt, zoom: this.zoom, heading: this.heading };\r\n }\r\n\r\n override _spaceCamera(): SpaceCamera | null {\r\n if (!this.space3D) return null;\r\n const rect = this.layoutBounds;\r\n return {\r\n perspective: this.perspective,\r\n orbit: this.orbit,\r\n elevation: this.elevation,\r\n dolly: this.dolly,\r\n lookAt: this.lookAt,\r\n zoom: this.zoom,\r\n heading: this.heading,\r\n viewportX: rect?.x ?? 0,\r\n viewportY: -(rect?.y ?? 0),\r\n };\r\n }\r\n\r\n // In a space the stage's own tilt and depth would turn the whole scene as\r\n // one flat card; its `perspective` is the camera's instead.\r\n protected override _projection(): Projection3D {\r\n return this.space3D ? NO_PROJECTION_3D : super._projection();\r\n }\r\n\r\n protected override renderChildren(ctx: RenderPass2D): void {\r\n const camera = this._spaceCamera();\r\n if (camera) {\r\n this._renderInSpace(ctx, spaceRootFrame(this, camera));\r\n return;\r\n }\r\n if (this.zoom === 1 && this.heading === 0 && this.lookAt.x === 0 && this.lookAt.y === 0) {\r\n super.renderChildren(ctx);\r\n return;\r\n }\r\n\r\n const rect = this.layoutBounds;\r\n const w = rect?.width ?? 0;\r\n const h = rect?.height ?? 0;\r\n const cx = rect?.x ?? 0;\r\n const cy = rect?.y ?? 0;\r\n\r\n ctx.beginCamera(\r\n { x: cx, y: -cy, width: w, height: h },\r\n this.lookAt,\r\n this.zoom,\r\n this.heading,\r\n );\r\n\r\n for (const child of this._children) if (child instanceof Node2D) child.render(ctx);\r\n\r\n ctx.endCamera();\r\n }\r\n}\r\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-node.d.ts","sourceRoot":"","sources":["../../../src/nodes/root/provider-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEpE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAErD,MAAM,WAAW,aAAa,CAAC,CAAC,CAAE,SAAQ,WAAW;IACjD,mEAAmE;IACnE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACpB,iEAAiE;IACjE,KAAK,EAAE,CAAC,CAAC;CACZ;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBAAa,QAAQ,CAAC,CAAC,GAAG,OAAO,CAAE,SAAQ,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAC/D,SAAmD,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACxE,SAAmD,KAAK,CAAC,EAAE,CAAC,CAAC;gBAEjD,KAAK,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAI5D;uDACmD;IACnD,SAAS,CAAC,cAAc,IAAI,OAAO,CAAC,CAAC,CAAC,GAAG,SAAS;IAIlD;2EACuE;IACvE,SAAS,CAAC,YAAY,IAAI,CAAC,GAAG,SAAS;cAIpB,cAAc,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU;CAMpE"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-node.js","sourceRoot":"","sources":["../../../src/nodes/root/provider-node.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,MAAM,EAA2B,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAU7D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,OAAO,QAAsB,SAAQ,MAAwB;IAI/D,YAAY,KAAgD;QACxD,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAED;uDACmD;IACzC,cAAc;QACpB,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED;2EACuE;IAC7D,YAAY;QAClB,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAEkB,cAAc,CAAC,MAAkB;QAChD,MAAM,GAAG,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QAClC,IAAI,CAAC,GAAG;YAAE,OAAO,MAAM,CAAC;QACxB,MAAM,CAAC,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QAC9B,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IACpE,CAAC;CACJ;AAzBsD;IAAlD,QAAQ,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;yCAAuC;AACrB;IAAlD,QAAQ,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;uCAA4B","sourcesContent":["import { Node2D, NodeConfig, Node2DProps } from \"@/nodes/2d/node2d\";\r\nimport { property } from \"@/attributes/properties/decorator\";\r\nimport { Context, ContextMap } from \"@/util/context\";\r\n\r\nexport interface ProviderProps<T> extends Node2DProps {\r\n /** The context token this provider supplies to its descendants. */\r\n context: Context<T>;\r\n /** The value to provide. Omitted → the token's default value. */\r\n value: T;\r\n}\r\n\r\n/**\r\n * Generic context provider — the JSX-facing counterpart to {@link createContext}.\r\n * Wraps its children and supplies a token's value to everything below it;\r\n * descendants read it with `node.useContext(token)`. Nesting providers for the\r\n * same token shadows nearest-ancestor-wins.\r\n *\r\n * @example Inline use\r\n * ```tsx\r\n * const Money = createContext<number>(0, \"money\");\r\n * <Provider context={Money} value={500}>\r\n * <MyNode /> // useContext(Money) === 500\r\n * </Provider>\r\n * ```\r\n *\r\n * @example Reusable, pre-bound provider — extend and fix the token\r\n * ```tsx\r\n * class MoneyProvider extends Provider<number> {\r\n * protected override resolveContext() { return Money; }\r\n * }\r\n * <MoneyProvider value={500}>…</MoneyProvider>\r\n * ```\r\n *\r\n * It's a layout-transparent container: it has no paint of its own and\r\n * stack-centers its children (the base {@link Node2D} layout), so dropping a\r\n * provider into a tree changes inheritance, not appearance.\r\n */\r\nexport class Provider<T = unknown> extends Node2D<ProviderProps<T>> {\r\n @property({ default: undefined }) declare readonly context?: Context<T>;\r\n @property({ default: undefined }) declare readonly value?: T;\r\n\r\n constructor(props: NodeConfig<Provider<T>, ProviderProps<T>>) {\r\n super(props);\r\n }\r\n\r\n /** The token to provide. Override in a subclass to bind a fixed token so\r\n * authors don't re-pass `context` on every use. */\r\n protected resolveContext(): Context<T> | undefined {\r\n return this.context;\r\n }\r\n\r\n /** The value to provide. Override alongside {@link resolveContext} for a\r\n * provider that computes its value rather than taking it as a prop. */\r\n protected resolveValue(): T | undefined {\r\n return this.value;\r\n }\r\n\r\n protected override provideContext(parent: ContextMap): ContextMap {\r\n const ctx = this.resolveContext();\r\n if (!ctx) return parent;\r\n const v = this.resolveValue();\r\n return parent.with(ctx, v !== undefined ? v : ctx.defaultValue);\r\n }\r\n}\r\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-provider-node.d.ts","sourceRoot":"","sources":["../../../src/nodes/root/theme-provider-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAG5C,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACnD;wCACoC;IACpC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B;uCACmC;IACnC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OA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,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QACvF,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS;YAAE,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QACpE,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAfsD;IAAlD,QAAQ,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;4CAAkD;AAChC;IAAlD,QAAQ,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;2CAAiD;AAC/B;IAAlD,QAAQ,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;2CAAyC","sourcesContent":["import { Node2D, NodeConfig, Node2DProps } from \"@/nodes/2d/node2d\";\r\nimport { property } from \"@/attributes/properties/decorator\";\r\nimport { ContextMap } from \"@/util/context\";\r\nimport { ThemeToken, DataToken, SeedToken } from \"@/runtime/builtin-context\";\r\n\r\nexport interface ThemeProviderProps extends Node2DProps {\r\n /** Named values (e.g. colors) merged onto any ancestor theme, read via\r\n * `node.useContext(ThemeToken)`. */\r\n theme: Record<string, unknown>;\r\n /** Arbitrary data merged onto any ancestor data bag, read via\r\n * `node.useContext(DataToken)`. */\r\n data: Record<string, unknown>;\r\n /** A default seed passed down the tree, read via `node.useContext(SeedToken)`. */\r\n seed: string | number;\r\n}\r\n\r\n/**\r\n * Provides theme / data / seed to its descendants. A convenience wrapper over\r\n * the same context machinery as {@link Provider}: it sets three built-in tokens\r\n * at once and **merges** `theme`/`data` onto any ancestor provider's values\r\n * (nested `ThemeProvider`s accumulate; nearest wins per key), while `seed`\r\n * overrides the inherited seed.\r\n *\r\n * Layout-transparent like {@link Provider} — it carries context, not appearance.\r\n */\r\nexport class ThemeProvider extends Node2D<ThemeProviderProps> {\r\n @property({ default: undefined }) declare readonly theme?: Record<string, unknown>;\r\n @property({ default: undefined }) declare readonly data?: Record<string, unknown>;\r\n @property({ default: undefined }) declare readonly seed?: string | number;\r\n\r\n constructor(props: NodeConfig<ThemeProvider, ThemeProviderProps>) {\r\n super(props);\r\n }\r\n\r\n protected override provideContext(parent: ContextMap): ContextMap {\r\n let next = parent;\r\n if (this.theme) next = next.with(ThemeToken, { ...parent.get(ThemeToken), ...this.theme });\r\n if (this.data) next = next.with(DataToken, { ...parent.get(DataToken), ...this.data });\r\n if (this.seed !== undefined) next = next.with(SeedToken, this.seed);\r\n return next;\r\n }\r\n}\r\n"]}
@@ -92,9 +92,12 @@ export declare class DefaultTextStyle extends Node2D<DefaultTextStyleProps> {
92
92
  * `default` preset; and last the node's `@property` default, which its
93
93
  * constructor already applied. Each value is written through the property
94
94
  * setter, so a preset's `fill: 'brand-500'` is resolved exactly as if the author
95
- * had written it.
95
+ * had written it. A node with no `'autofit'` size (`modes.autofit` false)
96
+ * skips an inherited `'autofit'`, keeping its own size.
96
97
  *
97
98
  * @internal
98
99
  */
99
- export declare function applyTextDefaults(node: Node2D, props?: Record<string, unknown>): void;
100
+ export declare function applyTextDefaults(node: Node2D, props?: Record<string, unknown>, modes?: {
101
+ autofit: boolean;
102
+ }): void;
100
103
  //# sourceMappingURL=default-text-style-node.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"default-text-style-node.d.ts","sourceRoot":"","sources":["../../../src/nodes/text/default-text-style-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAG5C,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAa,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AACrD,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC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IACvE,SAAmD,SAAS,CAAC,EAAE,SAAS,CAAC;IACzE,SAAmD,aAAa,CAAC,EAAE,MAAM,CAAC;IAC1E,SAAmD,UAAU,CAAC,EAAE,MAAM,CAAC;IACvE,SAAmD,SAAS,CAAC,EAAE,SAAS,CAAC;IACzE,SAAmD,IAAI,CAAC,EAAE,IAAI,CAAC;IAC/D,SAAmD,MAAM,CAAC,EAAE,MAAM,CAAC;IACnE,SAAmD,MAAM,CAAC,EAAE,MAAM,CAAC;gBAEvD,KAAK,EAAE,UAAU,CAAC,gBAAgB,EAAE,qBAAqB,CAAC;cAInD,cAAc,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU;IAMjE;;;;;;;OAOG;cACgB,aAAa,CAAC,GAAG,EAAE,YAAY,GAAG,IAAI;IASzD;;;;;;;OAOG;IACH,OAAO,CAAC,YAAY;CAGvB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAC7B,IAAI,EAAE,MAAM,EACZ,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,KAAK,GAAE;IAAE,OAAO,EAAE,OAAO,CAAA;CAAsB,GAChD,IAAI,CAkBN"}
@@ -119,11 +119,12 @@ __decorate([
119
119
  * `default` preset; and last the node's `@property` default, which its
120
120
  * constructor already applied. Each value is written through the property
121
121
  * setter, so a preset's `fill: 'brand-500'` is resolved exactly as if the author
122
- * had written it.
122
+ * had written it. A node with no `'autofit'` size (`modes.autofit` false)
123
+ * skips an inherited `'autofit'`, keeping its own size.
123
124
  *
124
125
  * @internal
125
126
  */
126
- export function applyTextDefaults(node, props) {
127
+ export function applyTextDefaults(node, props, modes = { autofit: true }) {
127
128
  const variant = props?.variant;
128
129
  const cascade = textOps.mergeStyle(textOps.mergeStyle(textOps.preset("default"), node.useContext(TextStyleToken)), variant ? textOps.preset(variant) : undefined);
129
130
  const target = node;
@@ -133,8 +134,13 @@ export function applyTextDefaults(node, props) {
133
134
  const value = cascade[key];
134
135
  // An unset `fontFamily` is legitimate: the renderer resolves it against the
135
136
  // faces actually loaded, which core cannot see (`paragraph-layout.ts`'s `familyOf`).
136
- if (value !== undefined)
137
- target[key] = value;
137
+ if (value === undefined)
138
+ continue;
139
+ // A block of runs has no autofit mode (it is sized by its box), so an
140
+ // inherited `'autofit'` stays out, as `patchSpans` leaves it out of a span.
141
+ if (key === "fontSize" && value === "autofit" && !modes.autofit)
142
+ continue;
143
+ target[key] = value;
138
144
  }
139
145
  }
140
146
  //# sourceMappingURL=default-text-style-node.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"default-text-style-node.js","sourceRoot":"","sources":["../../../src/nodes/text/default-text-style-node.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,MAAM,EAA2B,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAE7D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAoBnF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,OAAO,gBAAiB,SAAQ,MAA6B;IAY/D,YAAY,KAA0D;QAClE,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAEkB,cAAc,CAAC,MAAkB;QAChD,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAC7C,MAAM,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,IAAI,CAAC,MAA+B,CAAC,CAAC;QACnF,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;;OAOG;IACgB,aAAa,CAAC,GAAiB;QAC9C,GAAG,CAAC,aAAa,C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C,MAAM,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,EAC9E,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAChD,CAAC;IACF,MAAM,MAAM,GAAG,IAA0C,CAAC;IAC1D,KAAK,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;QAChC,IAAI,KAAK,EAAE,CAAC,GAAG,CAAC,KAAK,SAAS;YAAE,SAAS;QACzC,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAC3B,4EAA4E;QAC5E,qFAAqF;QACrF,IAAI,KAAK,KAAK,SAAS;YAAE,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACjD,CAAC;AACL,CAAC","sourcesContent":["import { Node2D, NodeConfig, Node2DProps } from \"@/nodes/2d/node2d\";\nimport { property } from \"@/attributes/properties/decorator\";\nimport { ContextMap } from \"@/util/context\";\nimport { TextStyleToken } from \"@/runtime/builtin-context\";\nimport { EMPTY_TEXT_STYLE, TEXT_STYLE_KEYS, textOps } from \"@/attributes/text/ops\";\nimport type { FontStyle, TextAlign, TextStyle } from \"@/attributes/text/types\";\nimport { Fill } from \"@/attributes/shape/fill/chain\";\nimport { type Stroke } from \"@/attributes/shape/stroke/stroke\";\nimport { type Shadow } from \"@/attributes/shape/shadow/shadow\";\nimport { type RenderPass2D } from \"@/render/render-context2d\";\n\nexport interface DefaultTextStyleProps extends Node2DProps {\n fontFamily: string;\n fontSize: number | 'autofit';\n fontWeight: number;\n fontStyle: FontStyle;\n letterSpacing: number;\n lineHeight: number;\n textAlign: TextAlign;\n fill: Fill;\n stroke: Stroke;\n shadow: Shadow;\n}\n\n/**\n * Sets default text styling for everything drawn below it — the {@link Text} /\n * {@link RichText} nodes *and* the raw `Graphics2D` `text`/`richText` ops a custom\n * node draws. A descendant inherits each style prop it didn't set itself, from\n * the nearest ancestor `DefaultTextStyle` that did — author-set props always win\n * over inherited ones. Nesting accumulates per key (an inner `fontSize` and an\n * outer `fontFamily` both apply).\n *\n * Two channels carry that, because a node and a drawing have nothing else in\n * common:\n *\n * - **Nodes**, through context. Built on the same machinery as {@link Provider}:\n * it contributes the built-in {@link TextStyleToken}, merging only the keys the\n * author explicitly passed onto any ancestor's defaults. It contributes the\n * author's *raw* prop values (not resolved cell values), so each consumer\n * resolves them once through its own mapper — e.g. `fill='red'` is resolved by\n * `Text`'s fill mapper, not pre-resolved here. {@link applyTextDefaults} is the\n * consuming end.\n * - **Graphics2D**, through the render context ({@link RenderContext2D.pushTextStyle}),\n * pushed around this node's children for the duration of their draw and folded\n * into each under-specified text op. A `Graphics2D` isn't in the tree and has no\n * bind step, so the draw scope is the only place it can inherit from.\n *\n * Only the *shaping* keys reach a drawn op — `fill`/`stroke`/`shadow` are\n * group-scoped paint ops in a `Graphics2D`, not per-shape slots, so defaulting\n * them would change which shapes a group's paint covers. See\n * {@link TEXT_SHAPING_KEYS}.\n *\n * A node that owns its typography opts out of the second channel with\n * `ctx.pushTextStyle(null)`; `@motionscript/code`'s `Code` does exactly that.\n *\n * Layout-transparent like {@link Provider} — carries style, not appearance.\n */\nexport class DefaultTextStyle extends Node2D<DefaultTextStyleProps> {\n @property({ default: undefined }) declare readonly fontFamily?: string;\n @property({ default: undefined }) declare readonly fontSize?: number | 'autofit';\n @property({ default: undefined }) declare readonly fontWeight?: number;\n @property({ default: undefined }) declare readonly fontStyle?: FontStyle;\n @property({ default: undefined }) declare readonly letterSpacing?: number;\n @property({ default: undefined }) declare readonly lineHeight?: number;\n @property({ default: undefined }) declare readonly textAlign?: TextAlign;\n @property({ default: undefined }) declare readonly fill?: Fill;\n @property({ default: undefined }) declare readonly stroke?: Stroke;\n @property({ default: undefined }) declare readonly shadow?: Shadow;\n\n constructor(props: NodeConfig<DefaultTextStyle, DefaultTextStyleProps>) {\n super(props);\n }\n\n protected override provideContext(parent: ContextMap): ContextMap {\n const inherited = parent.get(TextStyleToken);\n const merged = textOps.mergeStyle(inherited, this._props as TextStyle | undefined);\n return merged === inherited ? parent : parent.with(TextStyleToken, merged);\n }\n\n /**\n * Open the render-context text-style scope around this node's children, so\n * the `Graphics2D` they draw inherit the same defaults their `Text` nodes do.\n *\n * `super.renderContent` is what renders those children, so the scope has to\n * wrap it — and be closed in a `finally`, since the stack outlives this node\n * and a leaked frame would restyle every sibling drawn after it.\n */\n protected override renderContent(ctx: RenderPass2D): void {\n ctx.pushTextStyle(this.currentStyle());\n try {\n super.renderContent(ctx);\n } finally {\n ctx.popTextStyle();\n }\n }\n\n /**\n * The keys this node currently sets, at their resolved values.\n *\n * Read off the properties rather than out of `_props` (which\n * {@link provideContext} uses): a prop can be a callback or mid-tween, and a\n * drawn op needs this frame's *value*. An unset prop defaults to `undefined`,\n * which is the same \"didn't set it\" signal the context channel reads.\n */\n private currentStyle(): TextStyle {\n return textOps.mergeStyle(EMPTY_TEXT_STYLE, this);\n }\n}\n\n/**\n * Apply text-style defaults to a `Text`/`RichText` node, for each style key the\n * author didn't pass — the node end of {@link DefaultTextStyle}'s context\n * channel, run once from the node's `resolveContext`.\n *\n * Precedence per key, highest to lowest: the author's own prop; the node's\n * `variant` preset; the nearest enclosing `<DefaultTextStyle>`; the theme's\n * `default` preset; and last the node's `@property` default, which its\n * constructor already applied. Each value is written through the property\n * setter, so a preset's `fill: 'brand-500'` is resolved exactly as if the author\n * had written it.\n *\n * @internal\n */\nexport function applyTextDefaults(node: Node2D, props?: Record<string, unknown>): void {\n const variant = props?.variant as string | undefined;\n const cascade = textOps.mergeStyle(\n textOps.mergeStyle(textOps.preset(\"default\"), node.useContext(TextStyleToken)),\n variant ? textOps.preset(variant) : undefined,\n );\n const target = node as unknown as Record<string, unknown>;\n for (const key of TEXT_STYLE_KEYS) {\n if (props?.[key] !== undefined) continue;\n const value = cascade[key];\n // An unset `fontFamily` is legitimate: the renderer resolves it against the\n // faces actually loaded, which core cannot see (`paragraph-layout.ts`'s `familyOf`).\n if (value !== undefined) target[key] = value;\n }\n}\n"]}
1
+ {"version":3,"file":"default-text-style-node.js","sourceRoot":"","sources":["../../../src/nodes/text/default-text-style-node.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,MAAM,EAA2B,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAE7D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAoBnF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,OAAO,gBAAiB,SAAQ,MAA6B;IAY/D,YAAY,KAA0D;QAClE,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAEkB,cAAc,CAAC,MAAkB;QAChD,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAC7C,MAAM,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,IAAI,CAAC,MAA+B,CAAC,CAAC;QACnF,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;;OAOG;IACgB,aAAa,CAAC,GAAiB;QAC9C,GAAG,CAAC,aAAa,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;QACvC,IAAI,CAAC;YACD,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QAC7B,CAAC;gBAAS,CAAC;YACP,GAAG,CAAC,YAAY,EAAE,CAAC;QACvB,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACK,YAAY;QAChB,OAAO,OAAO,CAAC,UAAU,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;IACtD,CAAC;CACJ;AAj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;QAChC,IAAI,KAAK,EAAE,CAAC,GAAG,CAAC,KAAK,SAAS;YAAE,SAAS;QACzC,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAC3B,4EAA4E;QAC5E,qFAAqF;QACrF,IAAI,KAAK,KAAK,SAAS;YAAE,SAAS;QAClC,sEAAsE;QACtE,4EAA4E;QAC5E,IAAI,GAAG,KAAK,UAAU,IAAI,KAAK,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,OAAO;YAAE,SAAS;QAC1E,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACxB,CAAC;AACL,CAAC","sourcesContent":["import { Node2D, NodeConfig, Node2DProps } from \"@/nodes/2d/node2d\";\r\nimport { property } from \"@/attributes/properties/decorator\";\r\nimport { ContextMap } from \"@/util/context\";\r\nimport { TextStyleToken } from \"@/runtime/builtin-context\";\r\nimport { EMPTY_TEXT_STYLE, TEXT_STYLE_KEYS, textOps } from \"@/attributes/text/ops\";\r\nimport type { FontStyle, TextAlign, TextStyle } from \"@/attributes/text/types\";\r\nimport { Fill } from \"@/attributes/shape/fill/chain\";\r\nimport { type Stroke } from \"@/attributes/shape/stroke/stroke\";\r\nimport { type Shadow } from \"@/attributes/shape/shadow/shadow\";\r\nimport { type RenderPass2D } from \"@/render/render-context2d\";\r\n\r\nexport interface DefaultTextStyleProps extends Node2DProps {\r\n fontFamily: string;\r\n fontSize: number | 'autofit';\r\n fontWeight: number;\r\n fontStyle: FontStyle;\r\n letterSpacing: number;\r\n lineHeight: number;\r\n textAlign: TextAlign;\r\n fill: Fill;\r\n stroke: Stroke;\r\n shadow: Shadow;\r\n}\r\n\r\n/**\r\n * Sets default text styling for everything drawn below it — the {@link Text} /\r\n * {@link RichText} nodes *and* the raw `Graphics2D` `text`/`richText` ops a custom\r\n * node draws. A descendant inherits each style prop it didn't set itself, from\r\n * the nearest ancestor `DefaultTextStyle` that did — author-set props always win\r\n * over inherited ones. Nesting accumulates per key (an inner `fontSize` and an\r\n * outer `fontFamily` both apply).\r\n *\r\n * Two channels carry that, because a node and a drawing have nothing else in\r\n * common:\r\n *\r\n * - **Nodes**, through context. Built on the same machinery as {@link Provider}:\r\n * it contributes the built-in {@link TextStyleToken}, merging only the keys the\r\n * author explicitly passed onto any ancestor's defaults. It contributes the\r\n * author's *raw* prop values (not resolved cell values), so each consumer\r\n * resolves them once through its own mapper — e.g. `fill='red'` is resolved by\r\n * `Text`'s fill mapper, not pre-resolved here. {@link applyTextDefaults} is the\r\n * consuming end.\r\n * - **Graphics2D**, through the render context ({@link RenderContext2D.pushTextStyle}),\r\n * pushed around this node's children for the duration of their draw and folded\r\n * into each under-specified text op. A `Graphics2D` isn't in the tree and has no\r\n * bind step, so the draw scope is the only place it can inherit from.\r\n *\r\n * Only the *shaping* keys reach a drawn op — `fill`/`stroke`/`shadow` are\r\n * group-scoped paint ops in a `Graphics2D`, not per-shape slots, so defaulting\r\n * them would change which shapes a group's paint covers. See\r\n * {@link TEXT_SHAPING_KEYS}.\r\n *\r\n * A node that owns its typography opts out of the second channel with\r\n * `ctx.pushTextStyle(null)`; `@motionscript/code`'s `Code` does exactly that.\r\n *\r\n * Layout-transparent like {@link Provider} — carries style, not appearance.\r\n */\r\nexport class DefaultTextStyle extends Node2D<DefaultTextStyleProps> {\r\n @property({ default: undefined }) declare readonly fontFamily?: string;\r\n @property({ default: undefined }) declare readonly fontSize?: number | 'autofit';\r\n @property({ default: undefined }) declare readonly fontWeight?: number;\r\n @property({ default: undefined }) declare readonly fontStyle?: FontStyle;\r\n @property({ default: undefined }) declare readonly letterSpacing?: number;\r\n @property({ default: undefined }) declare readonly lineHeight?: number;\r\n @property({ default: undefined }) declare readonly textAlign?: TextAlign;\r\n @property({ default: undefined }) declare readonly fill?: Fill;\r\n @property({ default: undefined }) declare readonly stroke?: Stroke;\r\n @property({ default: undefined }) declare readonly shadow?: Shadow;\r\n\r\n constructor(props: NodeConfig<DefaultTextStyle, DefaultTextStyleProps>) {\r\n super(props);\r\n }\r\n\r\n protected override provideContext(parent: ContextMap): ContextMap {\r\n const inherited = parent.get(TextStyleToken);\r\n const merged = textOps.mergeStyle(inherited, this._props as TextStyle | undefined);\r\n return merged === inherited ? parent : parent.with(TextStyleToken, merged);\r\n }\r\n\r\n /**\r\n * Open the render-context text-style scope around this node's children, so\r\n * the `Graphics2D` they draw inherit the same defaults their `Text` nodes do.\r\n *\r\n * `super.renderContent` is what renders those children, so the scope has to\r\n * wrap it — and be closed in a `finally`, since the stack outlives this node\r\n * and a leaked frame would restyle every sibling drawn after it.\r\n */\r\n protected override renderContent(ctx: RenderPass2D): void {\r\n ctx.pushTextStyle(this.currentStyle());\r\n try {\r\n super.renderContent(ctx);\r\n } finally {\r\n ctx.popTextStyle();\r\n }\r\n }\r\n\r\n /**\r\n * The keys this node currently sets, at their resolved values.\r\n *\r\n * Read off the properties rather than out of `_props` (which\r\n * {@link provideContext} uses): a prop can be a callback or mid-tween, and a\r\n * drawn op needs this frame's *value*. An unset prop defaults to `undefined`,\r\n * which is the same \"didn't set it\" signal the context channel reads.\r\n */\r\n private currentStyle(): TextStyle {\r\n return textOps.mergeStyle(EMPTY_TEXT_STYLE, this);\r\n }\r\n}\r\n\r\n/**\r\n * Apply text-style defaults to a `Text`/`RichText` node, for each style key the\r\n * author didn't pass — the node end of {@link DefaultTextStyle}'s context\r\n * channel, run once from the node's `resolveContext`.\r\n *\r\n * Precedence per key, highest to lowest: the author's own prop; the node's\r\n * `variant` preset; the nearest enclosing `<DefaultTextStyle>`; the theme's\r\n * `default` preset; and last the node's `@property` default, which its\r\n * constructor already applied. Each value is written through the property\r\n * setter, so a preset's `fill: 'brand-500'` is resolved exactly as if the author\r\n * had written it. A node with no `'autofit'` size (`modes.autofit` false)\r\n * skips an inherited `'autofit'`, keeping its own size.\r\n *\r\n * @internal\r\n */\r\nexport function applyTextDefaults(\r\n node: Node2D,\r\n props?: Record<string, unknown>,\r\n modes: { autofit: boolean } = { autofit: true },\r\n): void {\r\n const variant = props?.variant as string | undefined;\r\n const cascade = textOps.mergeStyle(\r\n textOps.mergeStyle(textOps.preset(\"default\"), node.useContext(TextStyleToken)),\r\n variant ? textOps.preset(variant) : undefined,\r\n );\r\n const target = node as unknown as Record<string, unknown>;\r\n for (const key of TEXT_STYLE_KEYS) {\r\n if (props?.[key] !== undefined) continue;\r\n const value = cascade[key];\r\n // An unset `fontFamily` is legitimate: the renderer resolves it against the\r\n // faces actually loaded, which core cannot see (`paragraph-layout.ts`'s `familyOf`).\r\n if (value === undefined) continue;\r\n // A block of runs has no autofit mode (it is sized by its box), so an\r\n // inherited `'autofit'` stays out, as `patchSpans` leaves it out of a span.\r\n if (key === \"fontSize\" && value === \"autofit\" && !modes.autofit) continue;\r\n target[key] = value;\r\n }\r\n}\r\n"]}