@motionscript/core 0.1.0-alpha.6 → 0.1.0-alpha.8

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 (804) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/NOTICE +15 -14
  3. package/README.md +5 -7
  4. package/dist/assets/errors.js +4 -5
  5. package/dist/assets/errors.js.map +1 -1
  6. package/dist/assets/manager.d.ts.map +1 -1
  7. package/dist/assets/manager.js +7 -5
  8. package/dist/assets/manager.js.map +1 -1
  9. package/dist/assets/scope.d.ts +1 -1
  10. package/dist/assets/scope.d.ts.map +1 -1
  11. package/dist/assets/scope.js +1 -1
  12. package/dist/assets/scope.js.map +1 -1
  13. package/dist/attributes/audio/effects/chain.d.ts +73 -0
  14. package/dist/attributes/audio/effects/chain.d.ts.map +1 -0
  15. package/dist/attributes/audio/effects/chain.js +67 -0
  16. package/dist/attributes/audio/effects/chain.js.map +1 -0
  17. package/dist/attributes/audio/effects/implementations/echo.d.ts +14 -0
  18. package/dist/attributes/audio/effects/implementations/echo.d.ts.map +1 -0
  19. package/dist/attributes/audio/effects/implementations/echo.js +11 -0
  20. package/dist/attributes/audio/effects/implementations/echo.js.map +1 -0
  21. package/dist/attributes/audio/effects/implementations/gain.d.ts +10 -0
  22. package/dist/attributes/audio/effects/implementations/gain.d.ts.map +1 -0
  23. package/dist/attributes/audio/effects/implementations/gain.js +6 -0
  24. package/dist/attributes/audio/effects/implementations/gain.js.map +1 -0
  25. package/dist/attributes/audio/effects/implementations/highpass.d.ts +12 -0
  26. package/dist/attributes/audio/effects/implementations/highpass.d.ts.map +1 -0
  27. package/dist/attributes/audio/effects/implementations/highpass.js +10 -0
  28. package/dist/attributes/audio/effects/implementations/highpass.js.map +1 -0
  29. package/dist/attributes/audio/effects/implementations/lowpass.d.ts +12 -0
  30. package/dist/attributes/audio/effects/implementations/lowpass.d.ts.map +1 -0
  31. package/dist/attributes/audio/effects/implementations/lowpass.js +10 -0
  32. package/dist/attributes/audio/effects/implementations/lowpass.js.map +1 -0
  33. package/dist/attributes/audio/effects/implementations/tremolo.d.ts +12 -0
  34. package/dist/attributes/audio/effects/implementations/tremolo.d.ts.map +1 -0
  35. package/dist/attributes/audio/effects/implementations/tremolo.js +10 -0
  36. package/dist/attributes/audio/effects/implementations/tremolo.js.map +1 -0
  37. package/dist/attributes/audio/effects/index.d.ts +12 -0
  38. package/dist/attributes/audio/effects/index.d.ts.map +1 -0
  39. package/dist/attributes/audio/effects/index.js +4 -0
  40. package/dist/attributes/audio/effects/index.js.map +1 -0
  41. package/dist/attributes/audio/effects/registry.d.ts +36 -0
  42. package/dist/attributes/audio/effects/registry.d.ts.map +1 -0
  43. package/dist/attributes/audio/effects/registry.js +80 -0
  44. package/dist/attributes/audio/effects/registry.js.map +1 -0
  45. package/dist/attributes/audio/effects/union.d.ts +14 -0
  46. package/dist/attributes/audio/effects/union.d.ts.map +1 -0
  47. package/dist/attributes/audio/effects/union.js +24 -0
  48. package/dist/attributes/audio/effects/union.js.map +1 -0
  49. package/dist/attributes/audio/ramp.d.ts +103 -0
  50. package/dist/attributes/audio/ramp.d.ts.map +1 -0
  51. package/dist/attributes/audio/ramp.js +246 -0
  52. package/dist/attributes/audio/ramp.js.map +1 -0
  53. package/dist/attributes/audio/request.d.ts +24 -13
  54. package/dist/attributes/audio/request.d.ts.map +1 -1
  55. package/dist/attributes/audio/request.js +4 -3
  56. package/dist/attributes/audio/request.js.map +1 -1
  57. package/dist/attributes/audio/schedule.d.ts +24 -31
  58. package/dist/attributes/audio/schedule.d.ts.map +1 -1
  59. package/dist/attributes/audio/schedule.js +42 -28
  60. package/dist/attributes/audio/schedule.js.map +1 -1
  61. package/dist/attributes/audio/sound.d.ts +15 -12
  62. package/dist/attributes/audio/sound.d.ts.map +1 -1
  63. package/dist/attributes/audio/sound.js +8 -10
  64. package/dist/attributes/audio/sound.js.map +1 -1
  65. package/dist/attributes/audio/transition.d.ts +33 -0
  66. package/dist/attributes/audio/transition.d.ts.map +1 -0
  67. package/dist/attributes/audio/transition.js +48 -0
  68. package/dist/attributes/audio/transition.js.map +1 -0
  69. package/dist/attributes/index.d.ts +7 -8
  70. package/dist/attributes/index.d.ts.map +1 -1
  71. package/dist/attributes/index.js +6 -9
  72. package/dist/attributes/index.js.map +1 -1
  73. package/dist/attributes/layout/insets.d.ts +1 -1
  74. package/dist/attributes/layout/insets.js.map +1 -1
  75. package/dist/attributes/layout/matrix2d.d.ts +2 -2
  76. package/dist/attributes/layout/matrix2d.js.map +1 -1
  77. package/dist/attributes/layout/size.d.ts +1 -1
  78. package/dist/attributes/layout/size.js +1 -1
  79. package/dist/attributes/layout/size.js.map +1 -1
  80. package/dist/attributes/layout/space3d.js +1 -1
  81. package/dist/attributes/layout/space3d.js.map +1 -1
  82. package/dist/attributes/properties/decorator.d.ts +44 -11
  83. package/dist/attributes/properties/decorator.d.ts.map +1 -1
  84. package/dist/attributes/properties/decorator.js +37 -9
  85. package/dist/attributes/properties/decorator.js.map +1 -1
  86. package/dist/attributes/properties/inputs.d.ts +1 -1
  87. package/dist/attributes/properties/inputs.js +1 -1
  88. package/dist/attributes/properties/inputs.js.map +1 -1
  89. package/dist/attributes/properties/typed.d.ts +24 -145
  90. package/dist/attributes/properties/typed.d.ts.map +1 -1
  91. package/dist/attributes/properties/typed.js +16 -112
  92. package/dist/attributes/properties/typed.js.map +1 -1
  93. package/dist/attributes/shape/corners/corner-radius.d.ts +2 -3
  94. package/dist/attributes/shape/corners/corner-radius.d.ts.map +1 -1
  95. package/dist/attributes/shape/corners/corner-radius.js +2 -3
  96. package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
  97. package/dist/attributes/shape/effects/chain.d.ts +96 -409
  98. package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
  99. package/dist/attributes/shape/effects/chain.js +93 -283
  100. package/dist/attributes/shape/effects/chain.js.map +1 -1
  101. package/dist/attributes/shape/effects/effect-data.d.ts +1 -1
  102. package/dist/attributes/shape/effects/effect-data.js.map +1 -1
  103. package/dist/attributes/shape/effects/implementations/ascii.d.ts +45 -13
  104. package/dist/attributes/shape/effects/implementations/ascii.d.ts.map +1 -1
  105. package/dist/attributes/shape/effects/implementations/ascii.js +29 -23
  106. package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
  107. package/dist/attributes/shape/effects/implementations/bit-crush.d.ts +32 -7
  108. package/dist/attributes/shape/effects/implementations/bit-crush.d.ts.map +1 -1
  109. package/dist/attributes/shape/effects/implementations/bit-crush.js +17 -15
  110. package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
  111. package/dist/attributes/shape/effects/implementations/block-displace.d.ts +46 -10
  112. package/dist/attributes/shape/effects/implementations/block-displace.d.ts.map +1 -1
  113. package/dist/attributes/shape/effects/implementations/block-displace.js +21 -19
  114. package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
  115. package/dist/attributes/shape/effects/implementations/bloom.d.ts +32 -7
  116. package/dist/attributes/shape/effects/implementations/bloom.d.ts.map +1 -1
  117. package/dist/attributes/shape/effects/implementations/bloom.js +17 -11
  118. package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
  119. package/dist/attributes/shape/effects/implementations/blur.d.ts +16 -3
  120. package/dist/attributes/shape/effects/implementations/blur.d.ts.map +1 -1
  121. package/dist/attributes/shape/effects/implementations/blur.js +13 -5
  122. package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
  123. package/dist/attributes/shape/effects/implementations/bulge.d.ts +28 -9
  124. package/dist/attributes/shape/effects/implementations/bulge.d.ts.map +1 -1
  125. package/dist/attributes/shape/effects/implementations/bulge.js +15 -14
  126. package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
  127. package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts +21 -5
  128. package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts.map +1 -1
  129. package/dist/attributes/shape/effects/implementations/chromatic-aberration.js +15 -10
  130. package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
  131. package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +96 -26
  132. package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts.map +1 -1
  133. package/dist/attributes/shape/effects/implementations/color-adjustment.js +29 -26
  134. package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
  135. package/dist/attributes/shape/effects/implementations/curves.d.ts +20 -6
  136. package/dist/attributes/shape/effects/implementations/curves.d.ts.map +1 -1
  137. package/dist/attributes/shape/effects/implementations/curves.js +26 -23
  138. package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
  139. package/dist/attributes/shape/effects/implementations/directional-blur.d.ts +26 -5
  140. package/dist/attributes/shape/effects/implementations/directional-blur.d.ts.map +1 -1
  141. package/dist/attributes/shape/effects/implementations/directional-blur.js +15 -10
  142. package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
  143. package/dist/attributes/shape/effects/implementations/dither.d.ts +58 -11
  144. package/dist/attributes/shape/effects/implementations/dither.d.ts.map +1 -1
  145. package/dist/attributes/shape/effects/implementations/dither.js +26 -20
  146. package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
  147. package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts +47 -15
  148. package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts.map +1 -1
  149. package/dist/attributes/shape/effects/implementations/drop-shadow.js +24 -29
  150. package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
  151. package/dist/attributes/shape/effects/implementations/duotone.d.ts +26 -7
  152. package/dist/attributes/shape/effects/implementations/duotone.d.ts.map +1 -1
  153. package/dist/attributes/shape/effects/implementations/duotone.js +17 -16
  154. package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
  155. package/dist/attributes/shape/effects/implementations/edges.d.ts +29 -7
  156. package/dist/attributes/shape/effects/implementations/edges.d.ts.map +1 -1
  157. package/dist/attributes/shape/effects/implementations/edges.js +17 -14
  158. package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
  159. package/dist/attributes/shape/effects/implementations/glass.d.ts +76 -19
  160. package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
  161. package/dist/attributes/shape/effects/implementations/glass.js +28 -22
  162. package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
  163. package/dist/attributes/shape/effects/implementations/glow.d.ts +149 -42
  164. package/dist/attributes/shape/effects/implementations/glow.d.ts.map +1 -1
  165. package/dist/attributes/shape/effects/implementations/glow.js +74 -72
  166. package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
  167. package/dist/attributes/shape/effects/implementations/grain.d.ts +43 -11
  168. package/dist/attributes/shape/effects/implementations/grain.d.ts.map +1 -1
  169. package/dist/attributes/shape/effects/implementations/grain.js +21 -18
  170. package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
  171. package/dist/attributes/shape/effects/implementations/grayscale.d.ts +17 -3
  172. package/dist/attributes/shape/effects/implementations/grayscale.d.ts.map +1 -1
  173. package/dist/attributes/shape/effects/implementations/grayscale.js +13 -5
  174. package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
  175. package/dist/attributes/shape/effects/implementations/halftone.d.ts +40 -9
  176. package/dist/attributes/shape/effects/implementations/halftone.d.ts.map +1 -1
  177. package/dist/attributes/shape/effects/implementations/halftone.js +20 -16
  178. package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
  179. package/dist/attributes/shape/effects/implementations/invert.d.ts +23 -5
  180. package/dist/attributes/shape/effects/implementations/invert.d.ts.map +1 -1
  181. package/dist/attributes/shape/effects/implementations/invert.js +15 -10
  182. package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
  183. package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts +57 -18
  184. package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts.map +1 -1
  185. package/dist/attributes/shape/effects/implementations/kaleidoscope.js +25 -22
  186. package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
  187. package/dist/attributes/shape/effects/implementations/lut.d.ts +34 -7
  188. package/dist/attributes/shape/effects/implementations/lut.d.ts.map +1 -1
  189. package/dist/attributes/shape/effects/implementations/lut.js +20 -16
  190. package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
  191. package/dist/attributes/shape/effects/implementations/magnify.d.ts +27 -9
  192. package/dist/attributes/shape/effects/implementations/magnify.d.ts.map +1 -1
  193. package/dist/attributes/shape/effects/implementations/magnify.js +17 -14
  194. package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
  195. package/dist/attributes/shape/effects/implementations/motion-blur.d.ts +54 -19
  196. package/dist/attributes/shape/effects/implementations/motion-blur.d.ts.map +1 -1
  197. package/dist/attributes/shape/effects/implementations/motion-blur.js +42 -20
  198. package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
  199. package/dist/attributes/shape/effects/implementations/oil-paint.d.ts +17 -3
  200. package/dist/attributes/shape/effects/implementations/oil-paint.d.ts.map +1 -1
  201. package/dist/attributes/shape/effects/implementations/oil-paint.js +13 -9
  202. package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
  203. package/dist/attributes/shape/effects/implementations/outline.d.ts +28 -8
  204. package/dist/attributes/shape/effects/implementations/outline.d.ts.map +1 -1
  205. package/dist/attributes/shape/effects/implementations/outline.js +18 -17
  206. package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
  207. package/dist/attributes/shape/effects/implementations/pixelate.d.ts +25 -6
  208. package/dist/attributes/shape/effects/implementations/pixelate.d.ts.map +1 -1
  209. package/dist/attributes/shape/effects/implementations/pixelate.js +16 -14
  210. package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
  211. package/dist/attributes/shape/effects/implementations/posterize.d.ts +14 -3
  212. package/dist/attributes/shape/effects/implementations/posterize.d.ts.map +1 -1
  213. package/dist/attributes/shape/effects/implementations/posterize.js +13 -9
  214. package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
  215. package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts +91 -26
  216. package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts.map +1 -1
  217. package/dist/attributes/shape/effects/implementations/progressive-blur.js +27 -28
  218. package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
  219. package/dist/attributes/shape/effects/implementations/radial-blur.d.ts +49 -10
  220. package/dist/attributes/shape/effects/implementations/radial-blur.d.ts.map +1 -1
  221. package/dist/attributes/shape/effects/implementations/radial-blur.js +19 -20
  222. package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
  223. package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts +36 -6
  224. package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts.map +1 -1
  225. package/dist/attributes/shape/effects/implementations/rgb-shift.js +16 -15
  226. package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
  227. package/dist/attributes/shape/effects/implementations/scanlines.d.ts +52 -11
  228. package/dist/attributes/shape/effects/implementations/scanlines.d.ts.map +1 -1
  229. package/dist/attributes/shape/effects/implementations/scanlines.js +21 -18
  230. package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
  231. package/dist/attributes/shape/effects/implementations/scatter.d.ts +23 -9
  232. package/dist/attributes/shape/effects/implementations/scatter.d.ts.map +1 -1
  233. package/dist/attributes/shape/effects/implementations/scatter.js +15 -12
  234. package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
  235. package/dist/attributes/shape/effects/implementations/shader.d.ts +90 -34
  236. package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
  237. package/dist/attributes/shape/effects/implementations/shader.js +42 -26
  238. package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
  239. package/dist/attributes/shape/effects/implementations/sharpen.d.ts +23 -5
  240. package/dist/attributes/shape/effects/implementations/sharpen.d.ts.map +1 -1
  241. package/dist/attributes/shape/effects/implementations/sharpen.js +16 -11
  242. package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
  243. package/dist/attributes/shape/effects/implementations/streak.d.ts +40 -9
  244. package/dist/attributes/shape/effects/implementations/streak.d.ts.map +1 -1
  245. package/dist/attributes/shape/effects/implementations/streak.js +19 -16
  246. package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
  247. package/dist/attributes/shape/effects/implementations/threshold.d.ts +24 -5
  248. package/dist/attributes/shape/effects/implementations/threshold.d.ts.map +1 -1
  249. package/dist/attributes/shape/effects/implementations/threshold.js +17 -11
  250. package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
  251. package/dist/attributes/shape/effects/implementations/twirl.d.ts +35 -8
  252. package/dist/attributes/shape/effects/implementations/twirl.d.ts.map +1 -1
  253. package/dist/attributes/shape/effects/implementations/twirl.js +17 -16
  254. package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
  255. package/dist/attributes/shape/effects/implementations/vignette.d.ts +37 -7
  256. package/dist/attributes/shape/effects/implementations/vignette.d.ts.map +1 -1
  257. package/dist/attributes/shape/effects/implementations/vignette.js +19 -18
  258. package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
  259. package/dist/attributes/shape/effects/implementations/vintage.d.ts +24 -5
  260. package/dist/attributes/shape/effects/implementations/vintage.d.ts.map +1 -1
  261. package/dist/attributes/shape/effects/implementations/vintage.js +15 -10
  262. package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
  263. package/dist/attributes/shape/effects/implementations/wave.d.ts +61 -14
  264. package/dist/attributes/shape/effects/implementations/wave.d.ts.map +1 -1
  265. package/dist/attributes/shape/effects/implementations/wave.js +26 -23
  266. package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
  267. package/dist/attributes/shape/effects/index.d.ts +4 -2
  268. package/dist/attributes/shape/effects/index.d.ts.map +1 -1
  269. package/dist/attributes/shape/effects/index.js +1 -1
  270. package/dist/attributes/shape/effects/index.js.map +1 -1
  271. package/dist/attributes/shape/effects/registry.d.ts +11 -0
  272. package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
  273. package/dist/attributes/shape/effects/registry.js +113 -102
  274. package/dist/attributes/shape/effects/registry.js.map +1 -1
  275. package/dist/attributes/shape/effects/spec.d.ts +229 -0
  276. package/dist/attributes/shape/effects/spec.d.ts.map +1 -0
  277. package/dist/attributes/shape/effects/spec.js +178 -0
  278. package/dist/attributes/shape/effects/spec.js.map +1 -0
  279. package/dist/attributes/shape/fill/chain.d.ts +7 -9
  280. package/dist/attributes/shape/fill/chain.d.ts.map +1 -1
  281. package/dist/attributes/shape/fill/chain.js +9 -11
  282. package/dist/attributes/shape/fill/chain.js.map +1 -1
  283. package/dist/attributes/shape/fill/color/parser.d.ts +1 -1
  284. package/dist/attributes/shape/fill/color/parser.js +1 -1
  285. package/dist/attributes/shape/fill/color/parser.js.map +1 -1
  286. package/dist/attributes/shape/fill/implementations/canvas3d.d.ts +2 -2
  287. package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
  288. package/dist/attributes/shape/fill/implementations/shader.d.ts +28 -27
  289. package/dist/attributes/shape/fill/implementations/shader.d.ts.map +1 -1
  290. package/dist/attributes/shape/fill/implementations/shader.js +20 -14
  291. package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
  292. package/dist/attributes/shape/fill/implementations/video.d.ts +1 -1
  293. package/dist/attributes/shape/fill/implementations/video.js +1 -1
  294. package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
  295. package/dist/attributes/shape/fill/index.d.ts +1 -1
  296. package/dist/attributes/shape/fill/index.d.ts.map +1 -1
  297. package/dist/attributes/shape/fill/index.js.map +1 -1
  298. package/dist/attributes/shape/fill/lerp.d.ts +1 -1
  299. package/dist/attributes/shape/fill/lerp.js.map +1 -1
  300. package/dist/attributes/shape/fill/registry.d.ts +1 -2
  301. package/dist/attributes/shape/fill/registry.d.ts.map +1 -1
  302. package/dist/attributes/shape/fill/registry.js +1 -2
  303. package/dist/attributes/shape/fill/registry.js.map +1 -1
  304. package/dist/attributes/shape/filters/chain.d.ts +3 -7
  305. package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
  306. package/dist/attributes/shape/filters/chain.js +2 -6
  307. package/dist/attributes/shape/filters/chain.js.map +1 -1
  308. package/dist/attributes/shape/filters/implementations/color-matrix.d.ts +2 -2
  309. package/dist/attributes/shape/filters/implementations/color-matrix.d.ts.map +1 -1
  310. package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
  311. package/dist/attributes/shape/filters/registry.d.ts +1 -1
  312. package/dist/attributes/shape/filters/registry.d.ts.map +1 -1
  313. package/dist/attributes/shape/filters/registry.js +3 -3
  314. package/dist/attributes/shape/filters/registry.js.map +1 -1
  315. package/dist/attributes/shape/filters/union.d.ts +6 -6
  316. package/dist/attributes/shape/filters/union.d.ts.map +1 -1
  317. package/dist/attributes/shape/filters/union.js.map +1 -1
  318. package/dist/attributes/shape/path/ops.d.ts +1 -2
  319. package/dist/attributes/shape/path/ops.d.ts.map +1 -1
  320. package/dist/attributes/shape/path/ops.js.map +1 -1
  321. package/dist/attributes/shape/shaders/index.d.ts +2 -0
  322. package/dist/attributes/shape/shaders/index.d.ts.map +1 -1
  323. package/dist/attributes/shape/shaders/index.js +2 -0
  324. package/dist/attributes/shape/shaders/index.js.map +1 -1
  325. package/dist/attributes/shape/shaders/language.d.ts +26 -0
  326. package/dist/attributes/shape/shaders/language.d.ts.map +1 -0
  327. package/dist/attributes/shape/shaders/language.js +20 -0
  328. package/dist/attributes/shape/shaders/language.js.map +1 -0
  329. package/dist/attributes/shape/shaders/pack.d.ts +25 -11
  330. package/dist/attributes/shape/shaders/pack.d.ts.map +1 -1
  331. package/dist/attributes/shape/shaders/pack.js +9 -4
  332. package/dist/attributes/shape/shaders/pack.js.map +1 -1
  333. package/dist/attributes/shape/shaders/resolve.d.ts +4 -5
  334. package/dist/attributes/shape/shaders/resolve.d.ts.map +1 -1
  335. package/dist/attributes/shape/shaders/resolve.js +3 -6
  336. package/dist/attributes/shape/shaders/resolve.js.map +1 -1
  337. package/dist/attributes/shape/shaders/uniforms.d.ts +41 -0
  338. package/dist/attributes/shape/shaders/uniforms.d.ts.map +1 -0
  339. package/dist/attributes/shape/shaders/uniforms.js +0 -0
  340. package/dist/attributes/shape/shaders/uniforms.js.map +1 -0
  341. package/dist/attributes/shared/operators.d.ts +2 -2
  342. package/dist/attributes/shared/operators.js.map +1 -1
  343. package/dist/attributes/text/types.d.ts +2 -3
  344. package/dist/attributes/text/types.d.ts.map +1 -1
  345. package/dist/attributes/text/types.js.map +1 -1
  346. package/dist/browser/chunks/chunk-AOT33LMS.js +13 -0
  347. package/dist/browser/chunks/chunk-AOT33LMS.js.map +7 -0
  348. package/dist/browser/chunks/chunk-GKM6UZJR.js +6 -0
  349. package/dist/browser/chunks/chunk-GKM6UZJR.js.map +7 -0
  350. package/dist/browser/chunks/chunk-LKUYVFU3.js +2 -0
  351. package/dist/browser/chunks/{chunk-DHB4COFY.js.map → chunk-LKUYVFU3.js.map} +4 -4
  352. package/dist/browser/chunks/chunk-ZRPZPWZU.js +3 -0
  353. package/dist/browser/chunks/chunk-ZRPZPWZU.js.map +7 -0
  354. package/dist/browser/component.js +1 -1
  355. package/dist/browser/component.js.map +4 -4
  356. package/dist/browser/experimental.js +1 -1
  357. package/dist/browser/experimental.js.map +4 -4
  358. package/dist/browser/index.js +1 -1
  359. package/dist/browser/index.js.map +4 -4
  360. package/dist/browser/manifest.json +2 -4
  361. package/dist/browser/sdk.js +1 -1
  362. package/dist/component.d.ts +10 -18
  363. package/dist/component.d.ts.map +1 -1
  364. package/dist/component.js +10 -17
  365. package/dist/component.js.map +1 -1
  366. package/dist/components/builtins/audio/audio.d.ts +62 -0
  367. package/dist/components/builtins/audio/audio.d.ts.map +1 -0
  368. package/dist/components/builtins/audio/audio.js +38 -0
  369. package/dist/components/builtins/audio/audio.js.map +1 -0
  370. package/dist/components/builtins/geometry/composite.d.ts +93 -0
  371. package/dist/components/builtins/geometry/composite.d.ts.map +1 -0
  372. package/dist/components/builtins/geometry/composite.js +25 -0
  373. package/dist/components/builtins/geometry/composite.js.map +1 -0
  374. package/dist/components/builtins/geometry/geometry.d.ts +921 -0
  375. package/dist/components/builtins/geometry/geometry.d.ts.map +1 -0
  376. package/dist/components/builtins/geometry/geometry.js +107 -0
  377. package/dist/components/builtins/geometry/geometry.js.map +1 -0
  378. package/dist/components/builtins/geometry/shape-outline.d.ts +93 -0
  379. package/dist/components/builtins/geometry/shape-outline.d.ts.map +1 -0
  380. package/dist/components/builtins/geometry/shape-outline.js +470 -0
  381. package/dist/components/builtins/geometry/shape-outline.js.map +1 -0
  382. package/dist/components/builtins/layout/layout.d.ts +186 -0
  383. package/dist/components/builtins/layout/layout.d.ts.map +1 -0
  384. package/dist/components/builtins/layout/layout.js +84 -0
  385. package/dist/components/builtins/layout/layout.js.map +1 -0
  386. package/dist/components/builtins/media/media.d.ts +240 -0
  387. package/dist/components/builtins/media/media.d.ts.map +1 -0
  388. package/dist/components/builtins/media/media.js +143 -0
  389. package/dist/components/builtins/media/media.js.map +1 -0
  390. package/dist/components/builtins/providers/providers.d.ts +47 -0
  391. package/dist/components/builtins/providers/providers.d.ts.map +1 -0
  392. package/dist/components/builtins/providers/providers.js +30 -0
  393. package/dist/components/builtins/providers/providers.js.map +1 -0
  394. package/dist/components/builtins/text/number-format.d.ts +66 -0
  395. package/dist/components/builtins/text/number-format.d.ts.map +1 -0
  396. package/dist/components/builtins/text/number-format.js +227 -0
  397. package/dist/components/builtins/text/number-format.js.map +1 -0
  398. package/dist/components/builtins/text/number-pattern.d.ts +51 -0
  399. package/dist/components/builtins/text/number-pattern.d.ts.map +1 -0
  400. package/dist/components/builtins/text/number-pattern.js +77 -0
  401. package/dist/components/builtins/text/number-pattern.js.map +1 -0
  402. package/dist/components/builtins/text/text-defaults.d.ts +32 -0
  403. package/dist/components/builtins/text/text-defaults.d.ts.map +1 -0
  404. package/dist/components/builtins/text/text-defaults.js +37 -0
  405. package/dist/components/builtins/text/text-defaults.js.map +1 -0
  406. package/dist/components/builtins/text/text-layout.d.ts +82 -0
  407. package/dist/components/builtins/text/text-layout.d.ts.map +1 -0
  408. package/dist/components/builtins/text/text-layout.js +331 -0
  409. package/dist/components/builtins/text/text-layout.js.map +1 -0
  410. package/dist/components/builtins/text/text.d.ts +409 -0
  411. package/dist/components/builtins/text/text.d.ts.map +1 -0
  412. package/dist/components/builtins/text/text.js +116 -0
  413. package/dist/components/builtins/text/text.js.map +1 -0
  414. package/dist/components/builtins/three/canvas3d.d.ts +245 -0
  415. package/dist/components/builtins/three/canvas3d.d.ts.map +1 -0
  416. package/dist/components/builtins/three/canvas3d.js +21 -0
  417. package/dist/components/builtins/three/canvas3d.js.map +1 -0
  418. package/dist/components/builtins/three/grid-geometry3d.d.ts +62 -0
  419. package/dist/components/builtins/three/grid-geometry3d.d.ts.map +1 -0
  420. package/dist/components/builtins/three/grid-geometry3d.js +114 -0
  421. package/dist/components/builtins/three/grid-geometry3d.js.map +1 -0
  422. package/dist/components/builtins/three/three.d.ts +1889 -0
  423. package/dist/components/builtins/three/three.d.ts.map +1 -0
  424. package/dist/components/builtins/three/three.js +305 -0
  425. package/dist/components/builtins/three/three.js.map +1 -0
  426. package/dist/components/factory/api.d.ts +543 -0
  427. package/dist/components/factory/api.d.ts.map +1 -0
  428. package/dist/components/factory/api.js +4 -0
  429. package/dist/components/factory/api.js.map +1 -0
  430. package/dist/components/factory/clip-of.d.ts +5 -0
  431. package/dist/components/factory/clip-of.d.ts.map +1 -0
  432. package/dist/components/factory/clip-of.js +33 -0
  433. package/dist/components/factory/clip-of.js.map +1 -0
  434. package/dist/components/factory/commands-for.d.ts +19 -0
  435. package/dist/components/factory/commands-for.d.ts.map +1 -0
  436. package/dist/components/factory/commands-for.js +5 -0
  437. package/dist/components/factory/commands-for.js.map +1 -0
  438. package/dist/components/factory/component-audio.d.ts +9 -0
  439. package/dist/components/factory/component-audio.d.ts.map +1 -0
  440. package/dist/components/factory/component-audio.js +18 -0
  441. package/dist/components/factory/component-audio.js.map +1 -0
  442. package/dist/components/factory/component2d.d.ts +8 -0
  443. package/dist/components/factory/component2d.d.ts.map +1 -0
  444. package/dist/components/factory/component2d.js +240 -0
  445. package/dist/components/factory/component2d.js.map +1 -0
  446. package/dist/components/factory/component3d.d.ts +9 -0
  447. package/dist/components/factory/component3d.d.ts.map +1 -0
  448. package/dist/components/factory/component3d.js +107 -0
  449. package/dist/components/factory/component3d.js.map +1 -0
  450. package/dist/components/factory/factory.d.ts +66 -0
  451. package/dist/components/factory/factory.d.ts.map +1 -0
  452. package/dist/components/factory/factory.js +347 -0
  453. package/dist/components/factory/factory.js.map +1 -0
  454. package/dist/components/factory/timeline.d.ts +22 -0
  455. package/dist/components/factory/timeline.d.ts.map +1 -0
  456. package/dist/components/factory/timeline.js +128 -0
  457. package/dist/components/factory/timeline.js.map +1 -0
  458. package/dist/components/factory/type-def.d.ts +26 -0
  459. package/dist/components/factory/type-def.d.ts.map +1 -0
  460. package/dist/components/factory/type-def.js +16 -0
  461. package/dist/components/factory/type-def.js.map +1 -0
  462. package/dist/components/factory/types.d.ts +91 -0
  463. package/dist/components/factory/types.d.ts.map +1 -0
  464. package/dist/components/factory/types.js +88 -0
  465. package/dist/components/factory/types.js.map +1 -0
  466. package/dist/components/factory/views.d.ts +121 -0
  467. package/dist/components/factory/views.d.ts.map +1 -0
  468. package/dist/components/factory/views.js +413 -0
  469. package/dist/components/factory/views.js.map +1 -0
  470. package/dist/components/modules/aim.d.ts +30 -0
  471. package/dist/components/modules/aim.d.ts.map +1 -0
  472. package/dist/components/modules/aim.js +39 -0
  473. package/dist/components/modules/aim.js.map +1 -0
  474. package/dist/components/modules/corners.d.ts +13 -0
  475. package/dist/components/modules/corners.d.ts.map +1 -0
  476. package/dist/components/modules/corners.js +12 -0
  477. package/dist/components/modules/corners.js.map +1 -0
  478. package/dist/components/modules/flow.d.ts +26 -0
  479. package/dist/components/modules/flow.d.ts.map +1 -0
  480. package/dist/components/modules/flow.js +57 -0
  481. package/dist/components/modules/flow.js.map +1 -0
  482. package/dist/components/modules/material.d.ts +40 -0
  483. package/dist/components/modules/material.d.ts.map +1 -0
  484. package/dist/components/modules/material.js +75 -0
  485. package/dist/components/modules/material.js.map +1 -0
  486. package/dist/components/modules/paint.d.ts +71 -0
  487. package/dist/components/modules/paint.d.ts.map +1 -0
  488. package/dist/components/modules/paint.js +106 -0
  489. package/dist/components/modules/paint.js.map +1 -0
  490. package/dist/components/modules/shapes.d.ts +31 -0
  491. package/dist/components/modules/shapes.d.ts.map +1 -0
  492. package/dist/components/modules/shapes.js +43 -0
  493. package/dist/components/modules/shapes.js.map +1 -0
  494. package/dist/components/modules/text-layout.d.ts +26 -0
  495. package/dist/components/modules/text-layout.d.ts.map +1 -0
  496. package/dist/components/modules/text-layout.js +57 -0
  497. package/dist/components/modules/text-layout.js.map +1 -0
  498. package/dist/components/modules/text-style.d.ts +48 -0
  499. package/dist/components/modules/text-style.d.ts.map +1 -0
  500. package/dist/components/modules/text-style.js +63 -0
  501. package/dist/components/modules/text-style.js.map +1 -0
  502. package/dist/components/modules/three-entries.d.ts +23 -0
  503. package/dist/components/modules/three-entries.d.ts.map +1 -0
  504. package/dist/components/modules/three-entries.js +41 -0
  505. package/dist/components/modules/three-entries.js.map +1 -0
  506. package/dist/components/modules/view3d.d.ts +59 -0
  507. package/dist/components/modules/view3d.d.ts.map +1 -0
  508. package/dist/components/modules/view3d.js +171 -0
  509. package/dist/components/modules/view3d.js.map +1 -0
  510. package/dist/components/trees/2d/group-bounds.d.ts +56 -0
  511. package/dist/components/trees/2d/group-bounds.d.ts.map +1 -0
  512. package/dist/components/trees/2d/group-bounds.js +87 -0
  513. package/dist/components/trees/2d/group-bounds.js.map +1 -0
  514. package/dist/components/trees/2d/node-lifecycle.d.ts +46 -0
  515. package/dist/components/trees/2d/node-lifecycle.d.ts.map +1 -0
  516. package/dist/components/trees/2d/node-lifecycle.js +264 -0
  517. package/dist/components/trees/2d/node-lifecycle.js.map +1 -0
  518. package/dist/components/trees/2d/node-motion.d.ts +56 -0
  519. package/dist/components/trees/2d/node-motion.d.ts.map +1 -0
  520. package/dist/components/trees/2d/node-motion.js +86 -0
  521. package/dist/components/trees/2d/node-motion.js.map +1 -0
  522. package/dist/components/trees/2d/node-render.d.ts +36 -0
  523. package/dist/components/trees/2d/node-render.d.ts.map +1 -0
  524. package/dist/components/trees/2d/node-render.js +67 -0
  525. package/dist/components/trees/2d/node-render.js.map +1 -0
  526. package/dist/components/trees/2d/node-space.d.ts +63 -0
  527. package/dist/components/trees/2d/node-space.d.ts.map +1 -0
  528. package/dist/components/trees/2d/node-space.js +131 -0
  529. package/dist/components/trees/2d/node-space.js.map +1 -0
  530. package/dist/components/trees/2d/node-transform.d.ts +55 -0
  531. package/dist/components/trees/2d/node-transform.d.ts.map +1 -0
  532. package/dist/components/trees/2d/node-transform.js +73 -0
  533. package/dist/components/trees/2d/node-transform.js.map +1 -0
  534. package/dist/components/trees/2d/node2d.d.ts +1020 -0
  535. package/dist/components/trees/2d/node2d.d.ts.map +1 -0
  536. package/dist/components/trees/2d/node2d.js +1481 -0
  537. package/dist/components/trees/2d/node2d.js.map +1 -0
  538. package/dist/components/trees/audio/index.d.ts +2 -0
  539. package/dist/components/trees/audio/index.d.ts.map +1 -0
  540. package/dist/components/trees/audio/index.js +2 -0
  541. package/dist/components/trees/audio/index.js.map +1 -0
  542. package/dist/components/trees/audio/node-audio.d.ts +116 -0
  543. package/dist/components/trees/audio/node-audio.d.ts.map +1 -0
  544. package/dist/components/trees/audio/node-audio.js +171 -0
  545. package/dist/components/trees/audio/node-audio.js.map +1 -0
  546. package/dist/components/trees/index.d.ts +10 -0
  547. package/dist/components/trees/index.d.ts.map +1 -0
  548. package/dist/components/trees/index.js +14 -0
  549. package/dist/components/trees/index.js.map +1 -0
  550. package/dist/components/trees/node/node-editor-state.d.ts +53 -0
  551. package/dist/components/trees/node/node-editor-state.d.ts.map +1 -0
  552. package/dist/components/trees/node/node-editor-state.js +23 -0
  553. package/dist/components/trees/node/node-editor-state.js.map +1 -0
  554. package/dist/components/trees/node/node-reactive.d.ts +89 -0
  555. package/dist/components/trees/node/node-reactive.d.ts.map +1 -0
  556. package/dist/components/trees/node/node-reactive.js +135 -0
  557. package/dist/components/trees/node/node-reactive.js.map +1 -0
  558. package/dist/components/trees/node/node-time.d.ts +39 -0
  559. package/dist/components/trees/node/node-time.d.ts.map +1 -0
  560. package/dist/components/trees/node/node-time.js +14 -0
  561. package/dist/components/trees/node/node-time.js.map +1 -0
  562. package/dist/components/trees/node/node-walk.d.ts +46 -0
  563. package/dist/components/trees/node/node-walk.d.ts.map +1 -0
  564. package/dist/components/trees/node/node-walk.js +74 -0
  565. package/dist/components/trees/node/node-walk.js.map +1 -0
  566. package/dist/components/trees/node/node.d.ts +401 -0
  567. package/dist/components/trees/node/node.d.ts.map +1 -0
  568. package/dist/components/trees/node/node.js +680 -0
  569. package/dist/components/trees/node/node.js.map +1 -0
  570. package/dist/components/trees/root/canvas2d-node.d.ts +163 -0
  571. package/dist/components/trees/root/canvas2d-node.d.ts.map +1 -0
  572. package/dist/components/trees/root/canvas2d-node.js +216 -0
  573. package/dist/components/trees/root/canvas2d-node.js.map +1 -0
  574. package/dist/components/trees/three/node3d.d.ts +222 -0
  575. package/dist/components/trees/three/node3d.d.ts.map +1 -0
  576. package/dist/components/trees/three/node3d.js +289 -0
  577. package/dist/components/trees/three/node3d.js.map +1 -0
  578. package/dist/document/builtins.js +13 -13
  579. package/dist/document/builtins.js.map +1 -1
  580. package/dist/document/command-traits.d.ts +14 -4
  581. package/dist/document/command-traits.d.ts.map +1 -1
  582. package/dist/document/command-traits.js +35 -7
  583. package/dist/document/command-traits.js.map +1 -1
  584. package/dist/document/deny-globals.d.ts +2 -2
  585. package/dist/document/deny-globals.js +2 -2
  586. package/dist/document/deny-globals.js.map +1 -1
  587. package/dist/document/expression/index.d.ts +1 -1
  588. package/dist/document/expression/index.js +1 -1
  589. package/dist/document/expression/index.js.map +1 -1
  590. package/dist/document/expression/ops.js +1 -1
  591. package/dist/document/expression/ops.js.map +1 -1
  592. package/dist/document/index.d.ts +9 -2
  593. package/dist/document/index.d.ts.map +1 -1
  594. package/dist/document/index.js +5 -2
  595. package/dist/document/index.js.map +1 -1
  596. package/dist/document/migrate.d.ts +70 -0
  597. package/dist/document/migrate.d.ts.map +1 -0
  598. package/dist/document/migrate.js +202 -0
  599. package/dist/document/migrate.js.map +1 -0
  600. package/dist/document/missing-node.d.ts +27 -0
  601. package/dist/document/missing-node.d.ts.map +1 -0
  602. package/dist/document/missing-node.js +48 -0
  603. package/dist/document/missing-node.js.map +1 -0
  604. package/dist/document/node-decorator.d.ts +14 -10
  605. package/dist/document/node-decorator.d.ts.map +1 -1
  606. package/dist/document/node-decorator.js +14 -10
  607. package/dist/document/node-decorator.js.map +1 -1
  608. package/dist/document/node-descriptor.d.ts +7 -3
  609. package/dist/document/node-descriptor.d.ts.map +1 -1
  610. package/dist/document/node-descriptor.js.map +1 -1
  611. package/dist/document/placement.d.ts +2 -1
  612. package/dist/document/placement.d.ts.map +1 -1
  613. package/dist/document/placement.js.map +1 -1
  614. package/dist/document/project.d.ts +2 -0
  615. package/dist/document/project.d.ts.map +1 -1
  616. package/dist/document/project.js +1 -0
  617. package/dist/document/project.js.map +1 -1
  618. package/dist/document/prop-evolution.d.ts +51 -0
  619. package/dist/document/prop-evolution.d.ts.map +1 -0
  620. package/dist/document/prop-evolution.js +83 -0
  621. package/dist/document/prop-evolution.js.map +1 -0
  622. package/dist/document/registry.d.ts +39 -25
  623. package/dist/document/registry.d.ts.map +1 -1
  624. package/dist/document/registry.js +41 -21
  625. package/dist/document/registry.js.map +1 -1
  626. package/dist/document/settled-index.d.ts +2 -0
  627. package/dist/document/settled-index.d.ts.map +1 -1
  628. package/dist/document/settled-index.js +5 -5
  629. package/dist/document/settled-index.js.map +1 -1
  630. package/dist/document/timeline-patch.d.ts +4 -0
  631. package/dist/document/timeline-patch.d.ts.map +1 -1
  632. package/dist/document/timeline-patch.js +28 -3
  633. package/dist/document/timeline-patch.js.map +1 -1
  634. package/dist/document/timeline.d.ts +48 -4
  635. package/dist/document/timeline.d.ts.map +1 -1
  636. package/dist/document/timeline.js +174 -44
  637. package/dist/document/timeline.js.map +1 -1
  638. package/dist/document/types.d.ts +18 -32
  639. package/dist/document/types.d.ts.map +1 -1
  640. package/dist/document/types.js.map +1 -1
  641. package/dist/document/validate.d.ts +18 -6
  642. package/dist/document/validate.d.ts.map +1 -1
  643. package/dist/document/validate.js +158 -21
  644. package/dist/document/validate.js.map +1 -1
  645. package/dist/document/vocabulary.d.ts +28 -0
  646. package/dist/document/vocabulary.d.ts.map +1 -0
  647. package/dist/document/vocabulary.js +42 -0
  648. package/dist/document/vocabulary.js.map +1 -0
  649. package/dist/experimental.d.ts +79 -19
  650. package/dist/experimental.d.ts.map +1 -1
  651. package/dist/experimental.js +31 -17
  652. package/dist/experimental.js.map +1 -1
  653. package/dist/index.d.ts +10 -11
  654. package/dist/index.d.ts.map +1 -1
  655. package/dist/index.js +10 -11
  656. package/dist/index.js.map +1 -1
  657. package/dist/layout/types.d.ts +1 -1
  658. package/dist/layout/types.js.map +1 -1
  659. package/dist/platform/exporter.d.ts +13 -0
  660. package/dist/platform/exporter.d.ts.map +1 -1
  661. package/dist/platform/exporter.js.map +1 -1
  662. package/dist/props/host.d.ts +1 -1
  663. package/dist/props/host.js.map +1 -1
  664. package/dist/props/slot.d.ts +1 -1
  665. package/dist/props/slot.js +1 -1
  666. package/dist/props/slot.js.map +1 -1
  667. package/dist/renamed-scene-names.d.ts +1 -1
  668. package/dist/renamed-scene-names.d.ts.map +1 -1
  669. package/dist/renamed-scene-names.js +1 -1
  670. package/dist/renamed-scene-names.js.map +1 -1
  671. package/dist/render/canvas-render-context2d.d.ts +9 -0
  672. package/dist/render/canvas-render-context2d.d.ts.map +1 -1
  673. package/dist/render/canvas-render-context2d.js +10 -0
  674. package/dist/render/canvas-render-context2d.js.map +1 -1
  675. package/dist/render/clip-contains.js +1 -1
  676. package/dist/render/clip-contains.js.map +1 -1
  677. package/dist/render/clip.d.ts +1 -1
  678. package/dist/render/clip.js +1 -1
  679. package/dist/render/clip.js.map +1 -1
  680. package/dist/render/descriptors/rect.js.map +1 -1
  681. package/dist/render/descriptors/text.d.ts +13 -7
  682. package/dist/render/descriptors/text.d.ts.map +1 -1
  683. package/dist/render/descriptors/text.js +9 -3
  684. package/dist/render/descriptors/text.js.map +1 -1
  685. package/dist/render/index.d.ts +2 -0
  686. package/dist/render/index.d.ts.map +1 -1
  687. package/dist/render/index.js +1 -0
  688. package/dist/render/index.js.map +1 -1
  689. package/dist/render/render-context2d.d.ts +3 -3
  690. package/dist/render/render-context2d.js.map +1 -1
  691. package/dist/render/render-issue.d.ts +39 -0
  692. package/dist/render/render-issue.d.ts.map +1 -0
  693. package/dist/render/render-issue.js +29 -0
  694. package/dist/render/render-issue.js.map +1 -0
  695. package/dist/render/surface.d.ts +2 -2
  696. package/dist/render/surface.js.map +1 -1
  697. package/dist/render3d/builders.d.ts +1 -1
  698. package/dist/render3d/builders.js +1 -1
  699. package/dist/render3d/builders.js.map +1 -1
  700. package/dist/render3d/graphics3d.d.ts +13 -19
  701. package/dist/render3d/graphics3d.d.ts.map +1 -1
  702. package/dist/render3d/graphics3d.js +67 -24
  703. package/dist/render3d/graphics3d.js.map +1 -1
  704. package/dist/render3d/scene3d.d.ts +1 -1
  705. package/dist/render3d/scene3d.js +1 -1
  706. package/dist/render3d/scene3d.js.map +1 -1
  707. package/dist/render3d/texture.d.ts +2 -2
  708. package/dist/render3d/texture.d.ts.map +1 -1
  709. package/dist/render3d/texture.js.map +1 -1
  710. package/dist/render3d/vector3.d.ts +2 -2
  711. package/dist/render3d/vector3.js +2 -2
  712. package/dist/render3d/vector3.js.map +1 -1
  713. package/dist/runtime/asset-refine.d.ts +1 -1
  714. package/dist/runtime/asset-refine.d.ts.map +1 -1
  715. package/dist/runtime/asset-refine.js +3 -2
  716. package/dist/runtime/asset-refine.js.map +1 -1
  717. package/dist/runtime/asset-timeline.d.ts +10 -0
  718. package/dist/runtime/asset-timeline.d.ts.map +1 -1
  719. package/dist/runtime/asset-timeline.js.map +1 -1
  720. package/dist/runtime/asset-update.d.ts.map +1 -1
  721. package/dist/runtime/asset-update.js +8 -1
  722. package/dist/runtime/asset-update.js.map +1 -1
  723. package/dist/runtime/audio-index.d.ts +0 -11
  724. package/dist/runtime/audio-index.d.ts.map +1 -1
  725. package/dist/runtime/audio-index.js +0 -25
  726. package/dist/runtime/audio-index.js.map +1 -1
  727. package/dist/runtime/clip-instance.d.ts +6 -4
  728. package/dist/runtime/clip-instance.d.ts.map +1 -1
  729. package/dist/runtime/clip-instance.js +8 -4
  730. package/dist/runtime/clip-instance.js.map +1 -1
  731. package/dist/runtime/clip-store.d.ts +2 -3
  732. package/dist/runtime/clip-store.d.ts.map +1 -1
  733. package/dist/runtime/clip-store.js +34 -37
  734. package/dist/runtime/clip-store.js.map +1 -1
  735. package/dist/runtime/engine.d.ts +8 -6
  736. package/dist/runtime/engine.d.ts.map +1 -1
  737. package/dist/runtime/engine.js +4 -3
  738. package/dist/runtime/engine.js.map +1 -1
  739. package/dist/runtime/node-picking.d.ts +2 -2
  740. package/dist/runtime/node-picking.d.ts.map +1 -1
  741. package/dist/runtime/node-picking.js +3 -3
  742. package/dist/runtime/node-picking.js.map +1 -1
  743. package/dist/runtime/node-picking3d.d.ts +2 -2
  744. package/dist/runtime/node-picking3d.d.ts.map +1 -1
  745. package/dist/runtime/node-picking3d.js +1 -1
  746. package/dist/runtime/node-picking3d.js.map +1 -1
  747. package/dist/runtime/playback-controller.d.ts +2 -2
  748. package/dist/runtime/playback-controller.d.ts.map +1 -1
  749. package/dist/runtime/playback-controller.js +15 -5
  750. package/dist/runtime/playback-controller.js.map +1 -1
  751. package/dist/runtime/session.d.ts +7 -3
  752. package/dist/runtime/session.d.ts.map +1 -1
  753. package/dist/runtime/session.js +11 -4
  754. package/dist/runtime/session.js.map +1 -1
  755. package/dist/runtime/state-evaluator.d.ts +2 -2
  756. package/dist/runtime/state-evaluator.d.ts.map +1 -1
  757. package/dist/runtime/state-evaluator.js.map +1 -1
  758. package/dist/runtime/text-geometry.d.ts +2 -2
  759. package/dist/runtime/text-geometry.d.ts.map +1 -1
  760. package/dist/runtime/text-geometry.js +4 -5
  761. package/dist/runtime/text-geometry.js.map +1 -1
  762. package/dist/sdk/index.d.ts +50 -44
  763. package/dist/sdk/index.d.ts.map +1 -1
  764. package/dist/sdk/index.js +35 -29
  765. package/dist/sdk/index.js.map +1 -1
  766. package/dist/tween/command-decorator.d.ts +14 -9
  767. package/dist/tween/command-decorator.d.ts.map +1 -1
  768. package/dist/tween/command-decorator.js +3 -2
  769. package/dist/tween/command-decorator.js.map +1 -1
  770. package/dist/tween/command.d.ts +1 -1
  771. package/dist/tween/command.js.map +1 -1
  772. package/dist/tween/ease/describe.d.ts +2 -0
  773. package/dist/tween/ease/describe.d.ts.map +1 -1
  774. package/dist/tween/ease/describe.js +4 -0
  775. package/dist/tween/ease/describe.js.map +1 -1
  776. package/dist/tween/ease/spec.d.ts +31 -0
  777. package/dist/tween/ease/spec.d.ts.map +1 -0
  778. package/dist/tween/ease/spec.js +51 -0
  779. package/dist/tween/ease/spec.js.map +1 -0
  780. package/dist/tween/index.d.ts +3 -1
  781. package/dist/tween/index.d.ts.map +1 -1
  782. package/dist/tween/index.js +2 -1
  783. package/dist/tween/index.js.map +1 -1
  784. package/dist/tween/loop.d.ts +1 -1
  785. package/dist/tween/loop.js +1 -1
  786. package/dist/tween/loop.js.map +1 -1
  787. package/dist/util/reference.d.ts +6 -6
  788. package/dist/util/reference.js.map +1 -1
  789. package/package.json +3 -11
  790. package/dist/browser/chunks/chunk-2RIYH36X.js +0 -3
  791. package/dist/browser/chunks/chunk-2RIYH36X.js.map +0 -7
  792. package/dist/browser/chunks/chunk-DDJN3QII.js +0 -15
  793. package/dist/browser/chunks/chunk-DDJN3QII.js.map +0 -7
  794. package/dist/browser/chunks/chunk-DHB4COFY.js +0 -2
  795. package/dist/browser/chunks/chunk-EJDPYDQI.js +0 -5
  796. package/dist/browser/chunks/chunk-EJDPYDQI.js.map +0 -7
  797. package/dist/browser/chunks/chunk-SFNJRPBV.js +0 -2
  798. package/dist/browser/chunks/chunk-SFNJRPBV.js.map +0 -7
  799. package/dist/browser/chunks/chunk-XAWE4EAK.js +0 -2
  800. package/dist/browser/chunks/chunk-XAWE4EAK.js.map +0 -7
  801. package/dist/browser/jsx-jsx-dev-runtime.js +0 -2
  802. package/dist/browser/jsx-jsx-dev-runtime.js.map +0 -7
  803. package/dist/browser/jsx-jsx-runtime.js +0 -2
  804. package/dist/browser/jsx-jsx-runtime.js.map +0 -7
@@ -1 +1 @@
1
- {"version":3,"file":"builtins.js","sourceRoot":"","sources":["../../src/document/builtins.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAkC,MAAM,iBAAiB,CAAC;AAK/E,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAC5F,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACzF,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EACH,cAAc,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,kBAAkB,EACzG,aAAa,EAA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,EAAE,EAAE,CACnC,YAAY,CAAC,CAAC,EAAE,GAAG,EAAE;QAChB,MAAiB,CAAC,IAAI,EAAE,CAAC;IAC9B,CAAC,CAAgD,CAAC,CAAC;AAC3D,CAAC","sourcesContent":["import type { Fill } from \"@/attributes/shape/fill/chain\";\r\nimport type { Shadow } from \"@/attributes/shape/shadow/shadow\";\r\nimport type { Stroke } from \"@/attributes/shape/stroke/stroke\";\r\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\r\nimport { driveCommand, type Command, type CommandArgs } from \"@/tween/command\";\r\nimport type { EasingFunction } from \"@/tween/ease/type\";\r\nimport type { Node } from \"@/nodes/node/node\";\r\nimport type { Node2D } from \"@/nodes/2d/node2d\";\r\n\r\nimport { BooleanGroup, MaskGroup } from \"@/component/builtins/composite\";\r\nimport { Ellipse, PathShape, Polygon, Polygram, Rect } from \"@/component/builtins/geometry\";\r\nimport { Camera, OrbitCamera, RotatedBox } from \"@/component/builtins/layout\";\r\nimport { Video } from \"@/component/builtins/media\";\r\nimport { AudioBus, SoundNode } from \"@/component/builtins/audio\";\r\nimport { Canvas2D } from \"@/nodes/root/canvas2d-node\";\r\nimport { Provider, ThemeProvider } from \"@/component/builtins/providers\";\r\nimport { DefaultTextStyle, NumberNode, RichText, Text } from \"@/component/builtins/text\";\r\nimport { Canvas3D } from \"@/component/builtins/canvas3d\";\r\nimport {\r\n AmbientLight3D, AreaLight3D, Box3D, Camera3D, Capsule3D, Circle3D, Cone3D, Cylinder3D, DirectionalLight3D,\r\n Environment3D, Extrude3D, Fog3D, Group3D, HemisphereLight3D, Instances3D, Lathe3D, Line3D, Mesh3D, Model3D,\r\n Plane3D, PointLight3D, Points3D, Polyhedron3D, Ring3D, Sphere3D, SpotLight3D, Sprite3D, Torus3D, TorusKnot3D, Tube3D,\r\n} from \"@/component/builtins/three\";\r\n\r\nimport { lerpVector2 } from \"@/attributes/layout/vector2\";\r\nimport { lerpColor } from \"@/attributes/shape/fill/lerp\";\r\nimport { parseColor } from \"@/attributes/shape/fill/color/parser\";\r\nimport { lerpVector3 } from \"@/render3d/vector3\";\r\nimport { lerpNumber } from \"@/tween/lerp\";\r\n\r\nimport type { NodeConstructor, Registry, VariableLerp } from \"./registry\";\r\n\r\n/**\r\n * Registration of everything `@motionscript/core` itself ships.\r\n *\r\n * The keys here are **document API**. A stored scene names its nodes and its\r\n * animations with these strings, so renaming one silently breaks every document\r\n * that used it — they are as much a public contract as an exported symbol, and\r\n * are deliberately spelled out rather than derived from `constructor.name`\r\n * (which a minifier is free to mangle).\r\n */\r\n\r\n/** Every built-in node type, keyed as a document names it. */\r\nconst NODE_TYPES: Record<string, NodeConstructor> = {\r\n // Clip root and structural\r\n canvas2d: Canvas2D as unknown as NodeConstructor,\r\n provider: Provider as unknown as NodeConstructor,\r\n \"theme-provider\": ThemeProvider as unknown as NodeConstructor,\r\n \"default-text-style\": DefaultTextStyle as unknown as NodeConstructor,\r\n\r\n // Geometry\r\n rect: Rect as unknown as NodeConstructor,\r\n ellipse: Ellipse as unknown as NodeConstructor,\r\n // The **unit-box** path, not `path-node.ts`'s face-value `Path`. A stored\r\n // document's `data` is a fraction of the node's own box, so a resize is an\r\n // ordinary `width`/`height` write and every editor gizmo works on it\r\n // unchanged (`box-path-node.ts` has the whole argument). `Path` draws its\r\n // `d` at face value and hugs it, which is right for geometry somebody wrote\r\n // in code — it stays exported for that, and is reached by importing the\r\n // class rather than by naming a type in a document.\r\n path: PathShape as unknown as NodeConstructor,\r\n polygon: Polygon as unknown as NodeConstructor,\r\n polygram: Polygram as unknown as NodeConstructor,\r\n boolean: BooleanGroup as unknown as NodeConstructor,\r\n mask: MaskGroup as unknown as NodeConstructor,\r\n\r\n // Layout\r\n camera: Camera as unknown as NodeConstructor,\r\n orbitCamera: OrbitCamera as unknown as NodeConstructor,\r\n \"rotated-box\": RotatedBox as unknown as NodeConstructor,\r\n\r\n // Text\r\n text: Text as unknown as NodeConstructor,\r\n richtext: RichText as unknown as NodeConstructor,\r\n number: NumberNode as unknown as NodeConstructor,\r\n\r\n // Media\r\n video: Video as unknown as NodeConstructor,\r\n\r\n // Audio — a bus groups, a sound plays. `audioBus` is also the root of an\r\n // AudioDocument, the way `canvas2d` is the root of a scene.\r\n audioBus: AudioBus as unknown as NodeConstructor,\r\n sound: SoundNode as unknown as NodeConstructor,\r\n\r\n // 3D — the viewport, then the tree that lives inside it\r\n canvas3d: Canvas3D as unknown as NodeConstructor,\r\n group3d: Group3D as unknown as NodeConstructor,\r\n mesh3d: Mesh3D as unknown as NodeConstructor,\r\n box3d: Box3D as unknown as NodeConstructor,\r\n sphere3d: Sphere3D as unknown as NodeConstructor,\r\n plane3d: Plane3D as unknown as NodeConstructor,\r\n circle3d: Circle3D as unknown as NodeConstructor,\r\n cylinder3d: Cylinder3D as unknown as NodeConstructor,\r\n cone3d: Cone3D as unknown as NodeConstructor,\r\n capsule3d: Capsule3D as unknown as NodeConstructor,\r\n torus3d: Torus3D as unknown as NodeConstructor,\r\n \"torus-knot3d\": TorusKnot3D as unknown as NodeConstructor,\r\n tube3d: Tube3D as unknown as NodeConstructor,\r\n lathe3d: Lathe3D as unknown as NodeConstructor,\r\n extrude3d: Extrude3D as unknown as NodeConstructor,\r\n ring3d: Ring3D as unknown as NodeConstructor,\r\n polyhedron3d: Polyhedron3D as unknown as NodeConstructor,\r\n points3d: Points3D as unknown as NodeConstructor,\r\n line3d: Line3D as unknown as NodeConstructor,\r\n sprite3d: Sprite3D as unknown as NodeConstructor,\r\n instances3d: Instances3D as unknown as NodeConstructor,\r\n model3d: Model3D as unknown as NodeConstructor,\r\n camera3d: Camera3D as unknown as NodeConstructor,\r\n \"ambient-light3d\": AmbientLight3D as unknown as NodeConstructor,\r\n \"directional-light3d\": DirectionalLight3D as unknown as NodeConstructor,\r\n \"point-light3d\": PointLight3D as unknown as NodeConstructor,\r\n \"spot-light3d\": SpotLight3D as unknown as NodeConstructor,\r\n \"hemisphere-light3d\": HemisphereLight3D as unknown as NodeConstructor,\r\n \"area-light3d\": AreaLight3D as unknown as NodeConstructor,\r\n fog3d: Fog3D as unknown as NodeConstructor,\r\n environment3d: Environment3D as unknown as NodeConstructor,\r\n};\r\n\r\n/** A node method taking one {@link CommandArgs}. */\r\ntype EasedMethod = (args: CommandArgs) => Command<Record<string, unknown>>;\r\n\r\n/** Call a paint command (`fillTo`/`overlayTo`/`strokeTo`/`shadowTo`). */\r\nfunction paintCommand(method: string, argKey: string) {\r\n return (\r\n target: Node,\r\n args: Record<string, unknown>,\r\n duration: number,\r\n easing?: EasingFunction,\r\n ): Command<Record<string, unknown>> => {\r\n const fn = (target as unknown as Record<string, unknown>)[method];\r\n if (typeof fn !== \"function\") {\r\n throw new Error(\r\n `Command \"${method}\" is not available on ${target.constructor.name}.`,\r\n );\r\n }\r\n return (fn as EasedMethod).call(target, { data: args[argKey] as Record<string, unknown>, duration, easing });\r\n };\r\n}\r\n\r\n/**\r\n * The interpolations a document can name in `VariableSpec.lerp`.\r\n *\r\n * Deliberately the small set a variable actually holds — a number, a point, a\r\n * colour — rather than one entry per attribute in the library. A variable drives\r\n * props *through* an expression, so it only has to carry the quantity that\r\n * varies: a gradient that shifts is one `stop` number bound into a fill, not a\r\n * whole fill being interpolated a second time. Anything else is a\r\n * `registry.addLerp` away.\r\n */\r\nconst VARIABLE_LERPS: Record<string, VariableLerp> = {\r\n number: lerpNumber as VariableLerp,\r\n vector2: lerpVector2 as VariableLerp,\r\n vector3: lerpVector3 as VariableLerp,\r\n /**\r\n * Parse both ends, blend per channel, hand back a CSS string.\r\n *\r\n * A string rather than the parsed tuple because that is what the prop on the\r\n * far side of the expression takes — every fill, stroke and shadow resolves\r\n * a colour from CSS text, and `parseColor` reads theme tokens and the\r\n * `\"white/10\"` opacity suffix too, so a variable can hold either.\r\n */\r\n color: ((from, to, t) => {\r\n const [r, g, b, a] = lerpColor(parseColor(String(from)), parseColor(String(to)), t);\r\n const channel = (v: number) => Math.round(Math.min(Math.max(v, 0), 1) * 255);\r\n return `rgba(${channel(r)}, ${channel(g)}, ${channel(b)}, ${Number(a.toFixed(4))})`;\r\n }) as VariableLerp,\r\n /**\r\n * No interpolation: hold `from` until the tween lands, then take `to`.\r\n *\r\n * The default for a non-numeric variable: a discrete value (a string of\r\n * text, an enum, a boolean) has no midpoint, and inventing one produces a\r\n * frame that is neither state.\r\n */\r\n step: ((from, to, t) => (t >= 1 ? to : from)) as VariableLerp,\r\n};\r\n\r\n/**\r\n * Seed a {@link Registry} with everything `@motionscript/core` itself ships.\r\n *\r\n * **Internal, and called from `Registry`'s own constructor.** It used to be\r\n * public and every host had to call it at module scope before compiling\r\n * anything — which `sideEffects: false` is entitled to delete, with a failure\r\n * mode (\"unknown node type rect\") that points nowhere near the cause. A registry\r\n * that seeds itself makes the vocabulary a value dependency of the engine\r\n * instead, so there is nothing left to tree-shake and nothing to remember.\r\n *\r\n * @internal\r\n */\r\nexport function installBuiltins(registry: Registry): void {\r\n for (const [key, ctor] of Object.entries(NODE_TYPES)) {\r\n registry.addNode(key, ctor);\r\n }\r\n for (const [key, lerp] of Object.entries(VARIABLE_LERPS)) {\r\n registry.addLerp(key, lerp);\r\n }\r\n\r\n // ── Props ────────────────────────────────────────────────────────────────\r\n // `args` *is* the props diff — no wrapper key, since `to`/`set` each carry\r\n // exactly one argument and a node's own props are already a fixed,\r\n // known-shape bag (not something a second command parameter could collide\r\n // with the way `to`/`set` never gained one).\r\n registry.addCommand(\"to\", (target, args, duration, easing) =>\r\n (target as Node2D).to({\r\n // Copied: `_prepareStep` expands sugar into its target in place, which\r\n // would rewrite the document row a diff compares by identity.\r\n data: { ...args } as Record<string, never>,\r\n duration,\r\n easing,\r\n }) as unknown as Command<Record<string, unknown>>);\r\n\r\n // A stamp: write props with no tween. `duration` is ignored, which is what\r\n // makes it usable as the \"set this here\" a keyframe editor needs.\r\n //\r\n // `binds` because its args reach `set()` verbatim, so an expression among\r\n // them is a binding — this is how a prop starts following a variable partway\r\n // through a scene rather than from the moment its node is authored.\r\n registry.addCommand(\"set\", (target, args) => {\r\n const props = args as Record<string, never>;\r\n return driveCommand(0, () => {\r\n (target as Node2D).set(props);\r\n }) as unknown as Command<Record<string, unknown>>;\r\n }, { binds: true });\r\n\r\n // ── Paint (PaintNode / Canvas2D) ───────────────────────────────────────\r\n // Node-less rather than per-type, like `to` and `set` above: these are\r\n // generic over every painted node, and they take a `TweenOptions` bag where\r\n // an ordinary command takes a bare easing function — so they need a factory\r\n // that knows that convention rather than the uniform one a node type's own\r\n // table dispatches through.\r\n // Each declares the one key it reads, in the kind its property uses, so a\r\n // host draws the same paint stack for the command as for the prop.\r\n registry.addCommand(\"fillTo\", paintCommand(\"fillTo\", \"fill\"), { args: [{ key: \"fill\", kind: \"fills\" }], method: \"fillTo\" });\r\n registry.addCommand(\"overlayTo\", paintCommand(\"overlayTo\", \"overlay\"), { args: [{ key: \"overlay\", kind: \"fills\" }], method: \"overlayTo\" });\r\n registry.addCommand(\"strokeTo\", paintCommand(\"strokeTo\", \"stroke\"), { args: [{ key: \"stroke\", kind: \"strokes\" }], method: \"strokeTo\" });\r\n registry.addCommand(\"shadowTo\", paintCommand(\"shadowTo\", \"shadow\"), { args: [{ key: \"shadow\", kind: \"shadows\" }], method: \"shadowTo\" });\r\n\r\n // Transform, camera, text and `restore` commands are not registered here:\r\n // they are `@command()` methods, and `Registry.addNode` publishes them off\r\n // the classes above. See `document/registry.ts`.\r\n\r\n // ── Variables ────────────────────────────────────────────────────────────\r\n // Tween a variable. The one command that drives many nodes at once: every\r\n // prop bound to `\"=[id]\"` follows what this writes, with no command of its\r\n // own and nothing to keep in sync.\r\n registry.addVariableCommand(\"variableTo\", (target, args, duration, easing) => {\r\n const to = (args as { value?: unknown }).value;\r\n const lerpKey = (args as { lerp?: unknown }).lerp;\r\n const override = typeof lerpKey === \"string\" ? registry.lerp(lerpKey) : undefined;\r\n if (lerpKey !== undefined && !override) {\r\n throw new Error(\r\n `A \"lerp\" param must name a registered lerp (variable \"${target.id}\"), ` +\r\n `got ${JSON.stringify(lerpKey)}. Registered: ${registry.lerpKeys().join(\", \")}.`,\r\n );\r\n }\r\n const lerp = override ?? target.lerp;\r\n\r\n // `from` is captured on the command's first evaluation rather than here,\r\n // exactly as a node's `to()` does: the timeline builds commands in order\r\n // and runs each to `at(1)`, so the capture sees the state its\r\n // predecessors left. Captured once, it is then a pure function of `t`.\r\n let from: unknown;\r\n let captured = false;\r\n return driveCommand(duration, (t) => {\r\n if (!captured) {\r\n from = target.get();\r\n captured = true;\r\n }\r\n target.set(lerp(from, to, t));\r\n }, easing) as unknown as Command<Record<string, unknown>>;\r\n });\r\n\r\n // A stamp, matching `set`: write the value with no tween, ignoring duration.\r\n registry.addVariableCommand(\"variableSet\", (target, args) =>\r\n driveCommand(0, () => {\r\n target.set((args as { value?: unknown }).value);\r\n }) as unknown as Command<Record<string, unknown>>);\r\n\r\n // ── State ────────────────────────────────────────────────────────────────\r\n // `restore` pops the layer a `save` pushed, and is published off `Node`'s own\r\n // `@command()`. `save` is not one, so it is registered here — both are\r\n // commands so the pair is placed on the timeline like anything else, and a\r\n // seek past the save still produces the same frame: the value is computed\r\n // from the chain rather than accumulated as the playhead moves.\r\n registry.addCommand(\"save\", (target) =>\r\n driveCommand(0, () => {\r\n (target as Node2D).save();\r\n }) as unknown as Command<Record<string, unknown>>);\r\n}\r\n\r\n/** Type-only re-exports, so a caller writing args gets the same shapes. */\r\nexport type { Fill, Shadow, Stroke, Vector2 };\r\n"]}
1
+ {"version":3,"file":"builtins.js","sourceRoot":"","sources":["../../src/document/builtins.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAkC,MAAM,iBAAiB,CAAC;AAK/E,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,yCAAyC,CAAC;AACtG,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM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ACD,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;QAClC,CAAC,EAAE,MAAM,CAAgD,CAAC;IAC9D,CAAC,CAAC,CAAC;IAEH,6EAA6E;IAC7E,QAAQ,CAAC,kBAAkB,CAAC,aAAa,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CACxD,YAAY,CAAC,CAAC,EAAE,GAAG,EAAE;QACjB,MAAM,CAAC,GAAG,CAAE,IAA4B,CAAC,KAAK,CAAC,CAAC;IACpD,CAAC,CAAgD,CAAC,CAAC;IAEvD,4EAA4E;IAC5E,8EAA8E;IAC9E,sEAAsE;IACtE,2EAA2E;IAC3E,0EAA0E;IAC1E,gEAAgE;IAChE,QAAQ,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CACnC,YAAY,CAAC,CAAC,EAAE,GAAG,EAAE;QAChB,MAAiB,CAAC,IAAI,EAAE,CAAC;IAC9B,CAAC,CAAgD,CAAC,CAAC;AAC3D,CAAC","sourcesContent":["import type { Fill } from \"@/attributes/shape/fill/chain\";\r\nimport type { Shadow } from \"@/attributes/shape/shadow/shadow\";\r\nimport type { Stroke } from \"@/attributes/shape/stroke/stroke\";\r\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\r\nimport { driveCommand, type Command, type CommandArgs } from \"@/tween/command\";\r\nimport type { EasingFunction } from \"@/tween/ease/type\";\r\nimport type { Node } from \"@/components/trees/node/node\";\r\nimport type { Node2D } from \"@/components/trees/2d/node2d\";\r\n\r\nimport { BooleanGroup, MaskGroup } from \"@/components/builtins/geometry/composite\";\r\nimport { Ellipse, PathShape, Polygon, Polygram, Rect } from \"@/components/builtins/geometry/geometry\";\r\nimport { Camera, OrbitCamera, RotatedBox } from \"@/components/builtins/layout/layout\";\r\nimport { Video } from \"@/components/builtins/media/media\";\r\nimport { AudioBus, SoundNode } from \"@/components/builtins/audio/audio\";\r\nimport { Canvas2D } from \"@/components/trees/root/canvas2d-node\";\r\nimport { Provider, ThemeProvider } from \"@/components/builtins/providers/providers\";\r\nimport { DefaultTextStyle, NumberNode, RichText, Text } from \"@/components/builtins/text/text\";\r\nimport { Canvas3D } from \"@/components/builtins/three/canvas3d\";\r\nimport {\r\n AmbientLight3D, AreaLight3D, Box3D, Camera3D, Capsule3D, Circle3D, Cone3D, Cylinder3D, DirectionalLight3D,\r\n Environment3D, Extrude3D, Fog3D, Group3D, HemisphereLight3D, Instances3D, Lathe3D, Line3D, Mesh3D, Model3D,\r\n Plane3D, PointLight3D, Points3D, Polyhedron3D, Ring3D, Sphere3D, SpotLight3D, Sprite3D, Torus3D, TorusKnot3D, Tube3D,\r\n} from \"@/components/builtins/three/three\";\r\n\r\nimport { lerpVector2 } from \"@/attributes/layout/vector2\";\r\nimport { lerpColor } from \"@/attributes/shape/fill/lerp\";\r\nimport { parseColor } from \"@/attributes/shape/fill/color/parser\";\r\nimport { lerpVector3 } from \"@/render3d/vector3\";\r\nimport { lerpNumber } from \"@/tween/lerp\";\r\n\r\nimport type { NodeConstructor, Registry, VariableLerp } from \"./registry\";\r\n\r\n/**\r\n * Registration of everything `@motionscript/core` itself ships.\r\n *\r\n * The keys here are **document API**. A stored scene names its nodes and its\r\n * animations with these strings, so renaming one silently breaks every document\r\n * that used it — they are as much a public contract as an exported symbol, and\r\n * are deliberately spelled out rather than derived from `constructor.name`\r\n * (which a minifier is free to mangle).\r\n */\r\n\r\n/** Every built-in node type, keyed as a document names it. */\r\nconst NODE_TYPES: Record<string, NodeConstructor> = {\r\n // Clip root and structural\r\n canvas2d: Canvas2D as unknown as NodeConstructor,\r\n provider: Provider as unknown as NodeConstructor,\r\n \"theme-provider\": ThemeProvider as unknown as NodeConstructor,\r\n \"default-text-style\": DefaultTextStyle as unknown as NodeConstructor,\r\n\r\n // Geometry\r\n rect: Rect as unknown as NodeConstructor,\r\n ellipse: Ellipse as unknown as NodeConstructor,\r\n // The **unit-box** path, not `path-node.ts`'s face-value `Path`. A stored\r\n // document's `data` is a fraction of the node's own box, so a resize is an\r\n // ordinary `width`/`height` write and every editor gizmo works on it\r\n // unchanged (`box-path-node.ts` has the whole argument). `Path` draws its\r\n // `d` at face value and hugs it, which is right for geometry somebody wrote\r\n // in code — it stays exported for that, and is reached by importing the\r\n // class rather than by naming a type in a document.\r\n path: PathShape as unknown as NodeConstructor,\r\n polygon: Polygon as unknown as NodeConstructor,\r\n polygram: Polygram as unknown as NodeConstructor,\r\n boolean: BooleanGroup as unknown as NodeConstructor,\r\n mask: MaskGroup as unknown as NodeConstructor,\r\n\r\n // Layout\r\n camera: Camera as unknown as NodeConstructor,\r\n orbitCamera: OrbitCamera as unknown as NodeConstructor,\r\n \"rotated-box\": RotatedBox as unknown as NodeConstructor,\r\n\r\n // Text\r\n text: Text as unknown as NodeConstructor,\r\n richtext: RichText as unknown as NodeConstructor,\r\n number: NumberNode as unknown as NodeConstructor,\r\n\r\n // Media\r\n video: Video as unknown as NodeConstructor,\r\n\r\n // Audio — a bus groups, a sound plays. `audioBus` is also the root of an\r\n // AudioDocument, the way `canvas2d` is the root of a scene.\r\n audioBus: AudioBus as unknown as NodeConstructor,\r\n sound: SoundNode as unknown as NodeConstructor,\r\n\r\n // 3D — the viewport, then the tree that lives inside it\r\n canvas3d: Canvas3D as unknown as NodeConstructor,\r\n group3d: Group3D as unknown as NodeConstructor,\r\n mesh3d: Mesh3D as unknown as NodeConstructor,\r\n box3d: Box3D as unknown as NodeConstructor,\r\n sphere3d: Sphere3D as unknown as NodeConstructor,\r\n plane3d: Plane3D as unknown as NodeConstructor,\r\n circle3d: Circle3D as unknown as NodeConstructor,\r\n cylinder3d: Cylinder3D as unknown as NodeConstructor,\r\n cone3d: Cone3D as unknown as NodeConstructor,\r\n capsule3d: Capsule3D as unknown as NodeConstructor,\r\n torus3d: Torus3D as unknown as NodeConstructor,\r\n \"torus-knot3d\": TorusKnot3D as unknown as NodeConstructor,\r\n tube3d: Tube3D as unknown as NodeConstructor,\r\n lathe3d: Lathe3D as unknown as NodeConstructor,\r\n extrude3d: Extrude3D as unknown as NodeConstructor,\r\n ring3d: Ring3D as unknown as NodeConstructor,\r\n polyhedron3d: Polyhedron3D as unknown as NodeConstructor,\r\n points3d: Points3D as unknown as NodeConstructor,\r\n line3d: Line3D as unknown as NodeConstructor,\r\n sprite3d: Sprite3D as unknown as NodeConstructor,\r\n instances3d: Instances3D as unknown as NodeConstructor,\r\n model3d: Model3D as unknown as NodeConstructor,\r\n camera3d: Camera3D as unknown as NodeConstructor,\r\n \"ambient-light3d\": AmbientLight3D as unknown as NodeConstructor,\r\n \"directional-light3d\": DirectionalLight3D as unknown as NodeConstructor,\r\n \"point-light3d\": PointLight3D as unknown as NodeConstructor,\r\n \"spot-light3d\": SpotLight3D as unknown as NodeConstructor,\r\n \"hemisphere-light3d\": HemisphereLight3D as unknown as NodeConstructor,\r\n \"area-light3d\": AreaLight3D as unknown as NodeConstructor,\r\n fog3d: Fog3D as unknown as NodeConstructor,\r\n environment3d: Environment3D as unknown as NodeConstructor,\r\n};\r\n\r\n/** A node method taking one {@link CommandArgs}. */\r\ntype EasedMethod = (args: CommandArgs) => Command<Record<string, unknown>>;\r\n\r\n/** Call a paint command (`fillTo`/`overlayTo`/`strokeTo`/`shadowTo`). */\r\nfunction paintCommand(method: string, argKey: string) {\r\n return (\r\n target: Node,\r\n args: Record<string, unknown>,\r\n duration: number,\r\n easing?: EasingFunction,\r\n ): Command<Record<string, unknown>> => {\r\n const fn = (target as unknown as Record<string, unknown>)[method];\r\n if (typeof fn !== \"function\") {\r\n throw new Error(\r\n `Command \"${method}\" is not available on ${target.constructor.name}.`,\r\n );\r\n }\r\n return (fn as EasedMethod).call(target, { data: args[argKey] as Record<string, unknown>, duration, easing });\r\n };\r\n}\r\n\r\n/**\r\n * The interpolations a document can name in `VariableSpec.lerp`.\r\n *\r\n * Deliberately the small set a variable actually holds — a number, a point, a\r\n * colour — rather than one entry per attribute in the library. A variable drives\r\n * props *through* an expression, so it only has to carry the quantity that\r\n * varies: a gradient that shifts is one `stop` number bound into a fill, not a\r\n * whole fill being interpolated a second time. Anything else is a\r\n * `registry.addLerp` away.\r\n */\r\nconst VARIABLE_LERPS: Record<string, VariableLerp> = {\r\n number: lerpNumber as VariableLerp,\r\n vector2: lerpVector2 as VariableLerp,\r\n vector3: lerpVector3 as VariableLerp,\r\n /**\r\n * Parse both ends, blend per channel, hand back a CSS string.\r\n *\r\n * A string rather than the parsed tuple because that is what the prop on the\r\n * far side of the expression takes — every fill, stroke and shadow resolves\r\n * a colour from CSS text, and `parseColor` reads theme tokens and the\r\n * `\"white/10\"` opacity suffix too, so a variable can hold either.\r\n */\r\n color: ((from, to, t) => {\r\n const [r, g, b, a] = lerpColor(parseColor(String(from)), parseColor(String(to)), t);\r\n const channel = (v: number) => Math.round(Math.min(Math.max(v, 0), 1) * 255);\r\n return `rgba(${channel(r)}, ${channel(g)}, ${channel(b)}, ${Number(a.toFixed(4))})`;\r\n }) as VariableLerp,\r\n /**\r\n * No interpolation: hold `from` until the tween lands, then take `to`.\r\n *\r\n * The default for a non-numeric variable: a discrete value (a string of\r\n * text, an enum, a boolean) has no midpoint, and inventing one produces a\r\n * frame that is neither state.\r\n */\r\n step: ((from, to, t) => (t >= 1 ? to : from)) as VariableLerp,\r\n};\r\n\r\n/**\r\n * Seed a {@link Registry} with everything `@motionscript/core` itself ships.\r\n *\r\n * **Internal, and called from `Registry`'s own constructor.** It used to be\r\n * public and every host had to call it at module scope before compiling\r\n * anything — which `sideEffects: false` is entitled to delete, with a failure\r\n * mode (\"unknown node type rect\") that points nowhere near the cause. A registry\r\n * that seeds itself makes the vocabulary a value dependency of the engine\r\n * instead, so there is nothing left to tree-shake and nothing to remember.\r\n *\r\n * @internal\r\n */\r\nexport function installBuiltins(registry: Registry): void {\r\n for (const [key, ctor] of Object.entries(NODE_TYPES)) {\r\n registry.addNode(key, ctor);\r\n }\r\n for (const [key, lerp] of Object.entries(VARIABLE_LERPS)) {\r\n registry.addLerp(key, lerp);\r\n }\r\n\r\n // ── Props ────────────────────────────────────────────────────────────────\r\n // `args` *is* the props diff — no wrapper key, since `to`/`set` each carry\r\n // exactly one argument and a node's own props are already a fixed,\r\n // known-shape bag (not something a second command parameter could collide\r\n // with the way `to`/`set` never gained one).\r\n registry.addCommand(\"to\", (target, args, duration, easing) =>\r\n (target as Node2D).to({\r\n // Copied: `_prepareStep` expands sugar into its target in place, which\r\n // would rewrite the document row a diff compares by identity.\r\n data: { ...args } as Record<string, never>,\r\n duration,\r\n easing,\r\n }) as unknown as Command<Record<string, unknown>>);\r\n\r\n // A stamp: write props with no tween. `duration` is ignored, which is what\r\n // makes it usable as the \"set this here\" a keyframe editor needs.\r\n //\r\n // `binds` because its args reach `set()` verbatim, so an expression among\r\n // them is a binding — this is how a prop starts following a variable partway\r\n // through a scene rather than from the moment its node is authored.\r\n registry.addCommand(\"set\", (target, args) => {\r\n const props = args as Record<string, never>;\r\n return driveCommand(0, () => {\r\n (target as Node2D).set(props);\r\n }) as unknown as Command<Record<string, unknown>>;\r\n }, { binds: true });\r\n\r\n // ── Paint (shapes, text, Canvas2D) ─────────────────────────────────────\r\n // Node-less rather than per-type, like `to` and `set` above: these are\r\n // generic over every painted node, and they take a `TweenOptions` bag where\r\n // an ordinary command takes a bare easing function — so they need a factory\r\n // that knows that convention rather than the uniform one a node type's own\r\n // table dispatches through.\r\n // Each declares the one key it reads, in the kind its property uses, so a\r\n // host draws the same paint stack for the command as for the prop.\r\n registry.addCommand(\"fillTo\", paintCommand(\"fillTo\", \"fill\"), { args: [{ key: \"fill\", kind: \"fills\" }], method: \"fillTo\" });\r\n registry.addCommand(\"overlayTo\", paintCommand(\"overlayTo\", \"overlay\"), { args: [{ key: \"overlay\", kind: \"fills\" }], method: \"overlayTo\" });\r\n registry.addCommand(\"strokeTo\", paintCommand(\"strokeTo\", \"stroke\"), { args: [{ key: \"stroke\", kind: \"strokes\" }], method: \"strokeTo\" });\r\n registry.addCommand(\"shadowTo\", paintCommand(\"shadowTo\", \"shadow\"), { args: [{ key: \"shadow\", kind: \"shadows\" }], method: \"shadowTo\" });\r\n\r\n // Transform, camera, text and `restore` commands are not registered here:\r\n // they are `command()` methods, and `Registry.addNode` publishes them off\r\n // the classes above. See `document/registry.ts`.\r\n\r\n // ── Variables ────────────────────────────────────────────────────────────\r\n // Tween a variable. The one command that drives many nodes at once: every\r\n // prop bound to `\"=[id]\"` follows what this writes, with no command of its\r\n // own and nothing to keep in sync.\r\n registry.addVariableCommand(\"variableTo\", (target, args, duration, easing) => {\r\n const to = (args as { value?: unknown }).value;\r\n const lerpKey = (args as { lerp?: unknown }).lerp;\r\n const override = typeof lerpKey === \"string\" ? registry.lerp(lerpKey) : undefined;\r\n if (lerpKey !== undefined && !override) {\r\n throw new Error(\r\n `A \"lerp\" param must name a registered lerp (variable \"${target.id}\"), ` +\r\n `got ${JSON.stringify(lerpKey)}. Registered: ${registry.lerpKeys().join(\", \")}.`,\r\n );\r\n }\r\n const lerp = override ?? target.lerp;\r\n\r\n // `from` is captured on the command's first evaluation rather than here,\r\n // exactly as a node's `to()` does: the timeline builds commands in order\r\n // and runs each to `at(1)`, so the capture sees the state its\r\n // predecessors left. Captured once, it is then a pure function of `t`.\r\n let from: unknown;\r\n let captured = false;\r\n return driveCommand(duration, (t) => {\r\n if (!captured) {\r\n from = target.get();\r\n captured = true;\r\n }\r\n target.set(lerp(from, to, t));\r\n }, easing) as unknown as Command<Record<string, unknown>>;\r\n });\r\n\r\n // A stamp, matching `set`: write the value with no tween, ignoring duration.\r\n registry.addVariableCommand(\"variableSet\", (target, args) =>\r\n driveCommand(0, () => {\r\n target.set((args as { value?: unknown }).value);\r\n }) as unknown as Command<Record<string, unknown>>);\r\n\r\n // ── State ────────────────────────────────────────────────────────────────\r\n // `restore` pops the layer a `save` pushed, and is published off `Node`'s own\r\n // `command()`. `save` is not one, so it is registered here — both are\r\n // commands so the pair is placed on the timeline like anything else, and a\r\n // seek past the save still produces the same frame: the value is computed\r\n // from the chain rather than accumulated as the playhead moves.\r\n registry.addCommand(\"save\", (target) =>\r\n driveCommand(0, () => {\r\n (target as Node2D).save();\r\n }) as unknown as Command<Record<string, unknown>>);\r\n}\r\n\r\n/** Type-only re-exports, so a caller writing args gets the same shapes. */\r\nexport type { Fill, Shadow, Stroke, Vector2 };\r\n"]}
@@ -5,8 +5,8 @@ import type { CommandSpec, NodeSpec } from "./types.js";
5
5
  * registry without building anything.
6
6
  *
7
7
  * Only the library's own implementations are described: a command resolving to a
8
- * subclass override or a component's method could do anything, so it is `known:
9
- * false` and assumed to read and write layout.
8
+ * component's method could do anything, so it is `known: false` and assumed to
9
+ * read and write layout.
10
10
  */
11
11
  export interface CommandTraits {
12
12
  scope: "node" | "variable";
@@ -23,6 +23,8 @@ export declare const ALIGNMENT_KEYS: readonly string[];
23
23
  /**
24
24
  * How a document command resolves, as `ClipTimeline._buildPlaced` resolves it,
25
25
  * and what it does — or `null` when it resolves to nothing (compiling it throws).
26
+ * One the build skips — aimed at a placeholder, or unpublished by its target's
27
+ * type — writes nothing, which is known.
26
28
  * `target` is the command's target row; for `targetId: null` a document with no
27
29
  * explicit root row may pass `undefined`.
28
30
  */
@@ -42,8 +44,16 @@ export declare function hasNodeRef(value: unknown): boolean;
42
44
  /**
43
45
  * Whether writing `key` on a node of `type` leaves every laid-out box unchanged.
44
46
  *
45
- * Answered only for the library's own classes — a custom node may lay itself out
46
- * from anything — and there only for the props layout never reads.
47
+ * Every node's placement is applied after layout; past that, answered only for
48
+ * the library's own classes, since a custom node may lay itself out from anything.
47
49
  */
48
50
  export declare function isLayoutNeutralProp(registry: Registry, type: string, key: string): boolean;
51
+ /** Whether `key` is placement every node of `type` holds as a plain slot, read only once a frame is drawn. */
52
+ export declare function isPlacementProp(registry: Registry, type: string, key: string): boolean;
53
+ /**
54
+ * Whether a new `key` on `row` can be written onto its live node as a fresh
55
+ * build would set it: placement, on a row with no prop its node turns into
56
+ * placement when built (`topLeft` binds `x` and `y`).
57
+ */
58
+ export declare function writesPlacementInPlace(registry: Registry, row: NodeSpec, key: string): boolean;
49
59
  //# sourceMappingURL=command-traits.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"command-traits.d.ts","sourceRoot":"","sources":["../../src/document/command-traits.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAwB,MAAM,YAAY,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGrD;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC1B,KAAK,EAAE,MAAM,GAAG,UAAU,CAAC;IAC3B,oFAAoF;IACpF,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,uFAAuF;IACvF,WAAW,EAAE,OAAO,CAAC;IACrB,kDAAkD;IAClD,YAAY,EAAE,OAAO,CAAC;CACzB;AAED,0FAA0F;AAC1F,eAAO,MAAM,cAAc,EAAE,SAAS,MAAM,EAG3C,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,aAAa,GAAG,IAAI,CAoCvH;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,MAAM,EAAE,CAY7G;AAED,iEAAiE;AACjE,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAG3E;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAMlD;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,O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MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAGtF;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAI9F"}
@@ -1,4 +1,4 @@
1
- import { Node } from "../nodes/node/node.js";
1
+ import { Node } from "../components/trees/node/node.js";
2
2
  import { expressionOps } from "./expression/ops.js";
3
3
  import { Registry } from "./registry.js";
4
4
  import { ROOT_NODE_ID } from "./types.js";
@@ -7,9 +7,12 @@ export const ALIGNMENT_KEYS = [
7
7
  "center", "topLeft", "topRight", "bottomLeft", "bottomRight",
8
8
  "topCenter", "bottomCenter", "centerLeft", "centerRight",
9
9
  ];
10
+ const SKIPPED = { scope: "node", known: true, lifecycle: false, readsLayout: false, writesLayout: false };
10
11
  /**
11
12
  * How a document command resolves, as `ClipTimeline._buildPlaced` resolves it,
12
13
  * and what it does — or `null` when it resolves to nothing (compiling it throws).
14
+ * One the build skips — aimed at a placeholder, or unpublished by its target's
15
+ * type — writes nothing, which is known.
13
16
  * `target` is the command's target row; for `targetId: null` a document with no
14
17
  * explicit root row may pass `undefined`.
15
18
  */
@@ -22,8 +25,10 @@ export function commandTraits(registry, spec, target) {
22
25
  }
23
26
  const row = target ?? (spec.targetId === null ? DEFAULT_ROOT : undefined);
24
27
  const record = row ? registry.node(row.type) : undefined;
25
- if (!row || !record)
28
+ if (!row)
26
29
  return null;
30
+ if (!record)
31
+ return registry.strict ? null : SKIPPED;
27
32
  let chain;
28
33
  if (global) {
29
34
  chain = GLOBAL_NODE_COMMANDS[spec.type];
@@ -33,7 +38,7 @@ export function commandTraits(registry, spec, target) {
33
38
  else {
34
39
  const entry = record.commands.get(spec.type);
35
40
  if (!entry)
36
- return null;
41
+ return registry.strict ? null : SKIPPED;
37
42
  // A method published under a core command's key is not the core command.
38
43
  chain = entry.method === spec.type ? NODE_COMMANDS[spec.type] : undefined;
39
44
  }
@@ -89,17 +94,34 @@ export function hasNodeRef(value) {
89
94
  /**
90
95
  * Whether writing `key` on a node of `type` leaves every laid-out box unchanged.
91
96
  *
92
- * Answered only for the library's own classes — a custom node may lay itself out
93
- * from anything — and there only for the props layout never reads.
97
+ * Every node's placement is applied after layout; past that, answered only for
98
+ * the library's own classes, since a custom node may lay itself out from anything.
94
99
  */
95
100
  export function isLayoutNeutralProp(registry, type, key) {
96
101
  const record = registry.node(type);
97
- if (!record || !coreLibrary().ctors.has(record.ctor))
102
+ if (!record)
98
103
  return false;
99
104
  // Sound has no box, and the 2D walk skips an audio child.
100
105
  if (record.descriptor.dimension === "audio")
101
106
  return true;
102
- return NEUTRAL_KEYS.has(key);
107
+ if (isPlacementProp(registry, type, key))
108
+ return true;
109
+ return coreLibrary().ctors.has(record.ctor) && NEUTRAL_KEYS.has(key);
110
+ }
111
+ /** Whether `key` is placement every node of `type` holds as a plain slot, read only once a frame is drawn. */
112
+ export function isPlacementProp(registry, type, key) {
113
+ const dimension = registry.node(type)?.descriptor.dimension;
114
+ return dimension === "3d" ? PLACEMENT_3D.has(key) : dimension === "2d" && PLACEMENT_2D.has(key);
115
+ }
116
+ /**
117
+ * Whether a new `key` on `row` can be written onto its live node as a fresh
118
+ * build would set it: placement, on a row with no prop its node turns into
119
+ * placement when built (`topLeft` binds `x` and `y`).
120
+ */
121
+ export function writesPlacementInPlace(registry, row, key) {
122
+ const dimension = registry.node(row.type)?.descriptor.dimension;
123
+ const sugar = dimension === "3d" ? PLACEMENT_SUGAR_3D : PLACEMENT_SUGAR_2D;
124
+ return isPlacementProp(registry, row.type, key) && !Object.keys(row.props).some((prop) => sugar.has(prop));
103
125
  }
104
126
  const LIFECYCLE = new Set(["removeChildAt", "addChildAt", "reparent"]);
105
127
  const VARIABLE_COMMANDS = new Set(["variableTo", "variableSet"]);
@@ -107,6 +129,12 @@ const NEUTRAL_KEYS = new Set([
107
129
  "x", "y", "rotation", "scale", "opacity", "fill", "stroke", "shadow", "overlay",
108
130
  "effects", "blend", "transformOrigin", "zoom", "lookAt", "heading",
109
131
  ]);
132
+ const PLACEMENT_2D = new Set(["x", "y", "rotation", "scale", "opacity"]);
133
+ const PLACEMENT_3D = new Set(["x", "y", "z", "rotationX", "rotationY", "rotationZ", "scaleX", "scaleY", "scaleZ"]);
134
+ const PLACEMENT_SUGAR_2D = new Set([
135
+ "center", "topLeft", "topRight", "bottomLeft", "bottomRight", "topCenter", "bottomCenter", "centerLeft", "centerRight",
136
+ ]);
137
+ const PLACEMENT_SUGAR_3D = new Set(["position", "rotation", "scale"]);
110
138
  const DEFAULT_ROOT = { id: ROOT_NODE_ID, type: "canvas2d", parentId: null, layerOrder: 0, props: {} };
111
139
  // Each command's behaviour, as the methods on its target it runs through. A class
112
140
  // overriding any of them is running something else under the command's name.
@@ -1 +1 @@
1
- {"version":3,"file":"command-traits.js","sourceRoot":"","sources":["../../src/document/command-traits.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAwB,MAAM,YAAY,CAAC;AAE5D,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAqBvC,0FAA0F;AAC1F,MAAM,CAAC,MAAM,cAAc,GAAsB;IAC7C,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa;IAC5D,WAAW,EAAE,cAAc,EAAE,YAAY,EAAE,aAAa;CAC3D,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,QAAkB,EAAE,IAAiB,EAAE,MAA4B;IAC7F,MAAM,SAAS,GAAG,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3C,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3C,IAAI,MAAM,EAAE,KA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M,CAAC,IAAI,CAAC,GAAG,CAAE,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC;IAC1G,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,2EAA2E;AAC3E,SAAS,mBAAmB,CAAC,IAAY;IACrC,MAAM,OAAO,GAAG,WAAW,EAAE,CAAC;IAC9B,IAAI,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACtC,IAAI,CAAC,KAAK,EAAE,CAAC;QACT,MAAM,KAAK,GAAG,IAAI,GAAG,EAAW,CAAC;QACjC,KAAK,MAAM,IAAI,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;YAC/B,KAAK,IAAI,KAAK,GAAG,IAAI,CAAC,SAAS,EAAE,KAAK,IAAI,KAAK,KAAK,MAAM,CAAC,SAAS,EAAE,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;gBACzG,MAAM,GAAG,GAAG,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;gBACzD,IAAI,GAAG,IAAI,OAAO,GAAG,CAAC,KAAK,KAAK,UAAU;oBAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YACrE,CAAC;QACL,CAAC;QACD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC;IAC/C,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC","sourcesContent":["import { Node } from \"@/nodes/node/node\";\r\nimport { expressionOps } from \"./expression/ops\";\r\nimport { Registry, type NodeConstructor } from \"./registry\";\r\nimport type { CommandSpec, NodeSpec } from \"./types\";\r\nimport { ROOT_NODE_ID } from \"./types\";\r\n\r\n/**\r\n * What a command can do to the tree around it, read off the document and the\r\n * registry without building anything.\r\n *\r\n * Only the library's own implementations are described: a command resolving to a\r\n * subclass override or a component's method could do anything, so it is `known:\r\n * false` and assumed to read and write layout.\r\n */\r\nexport interface CommandTraits {\r\n scope: \"node\" | \"variable\";\r\n /** Resolves to the library's own implementation, so the rules below hold for it. */\r\n known: boolean;\r\n lifecycle: boolean;\r\n /** Building it can read a laid-out box, so it must be built against a settled tree. */\r\n readsLayout: boolean;\r\n /** Running it can change what layout computes. */\r\n writesLayout: boolean;\r\n}\r\n\r\n/** The nine named alignment props, which position a node against its own laid-out box. */\r\nexport const ALIGNMENT_KEYS: readonly string[] = [\r\n \"center\", \"topLeft\", \"topRight\", \"bottomLeft\", \"bottomRight\",\r\n \"topCenter\", \"bottomCenter\", \"centerLeft\", \"centerRight\",\r\n];\r\n\r\n/**\r\n * How a document command resolves, as `ClipTimeline._buildPlaced` resolves it,\r\n * and what it does — or `null` when it resolves to nothing (compiling it throws).\r\n * `target` is the command's target row; for `targetId: null` a document with no\r\n * explicit root row may pass `undefined`.\r\n */\r\nexport function commandTraits(registry: Registry, spec: CommandSpec, target: NodeSpec | undefined): CommandTraits | null {\r\n const lifecycle = LIFECYCLE.has(spec.type);\r\n const global = registry.command(spec.type);\r\n if (global?.scope === \"variable\") {\r\n const known = VARIABLE_COMMANDS.has(spec.type);\r\n return { scope: \"variable\", known, lifecycle, readsLayout: !known, writesLayout: false };\r\n }\r\n\r\n const row = target ?? (spec.targetId === null ? DEFAULT_ROOT : undefined);\r\n const record = row ? registry.node(row.type) : undefined;\r\n if (!row || !record) return null;\r\n\r\n let chain: readonly string[] | undefined;\r\n if (global) {\r\n chain = GLOBAL_NODE_COMMANDS[spec.type];\r\n if (chain && typeof methodOf(record.ctor, chain[0]) !== \"function\") return null;\r\n } else {\r\n const entry = record.commands.get(spec.type);\r\n if (!entry) return null;\r\n // A method published under a core command's key is not the core command.\r\n chain = entry.method === spec.type ? NODE_COMMANDS[spec.type] : undefined;\r\n }\r\n\r\n const known = !lifecycle && chain !== undefined && implementsCore(record.ctor, chain);\r\n if (!known) return { scope: \"node\", known, lifecycle, readsLayout: true, writesLayout: true };\r\n\r\n const args = spec.args ?? {};\r\n const props = row.props ?? {};\r\n const written = writtenKeys(spec.type, args);\r\n return {\r\n scope: \"node\",\r\n known,\r\n lifecycle,\r\n readsLayout: readsLayout(spec.type, args, props, written),\r\n writesLayout: written === undefined || written.some((key) => !isLayoutNeutralProp(registry, row.type, key)),\r\n };\r\n}\r\n\r\n/**\r\n * The node ids a command's args name through a `nodeRef` argument — the nodes\r\n * whose boxes it may read when it is built, beside its own target.\r\n */\r\nexport function commandNodeRefs(registry: Registry, spec: CommandSpec, target: NodeSpec | undefined): string[] {\r\n const global = registry.command(spec.type);\r\n const row = target ?? (spec.targetId === null ? DEFAULT_ROOT : undefined);\r\n const descriptors = global\r\n ? (global.scope === \"node\" ? global.args : undefined)\r\n : row ? registry.node(row.type)?.commands.get(spec.type)?.args : undefined;\r\n const refs: string[] = [];\r\n for (const descriptor of descriptors ?? []) {\r\n const value = spec.args?.[descriptor.key];\r\n if (descriptor.kind === \"nodeRef\" && typeof value === \"string\" && value !== \"\") refs.push(value);\r\n }\r\n return refs;\r\n}\r\n\r\n/** Whether `type` hands its descendants a context of its own. */\r\nexport function isContextProvider(registry: Registry, type: string): boolean {\r\n const ctor = registry.node(type)?.ctor;\r\n return ctor !== undefined && methodOf(ctor, \"provideContext\") !== methodOf(Node, \"provideContext\");\r\n}\r\n\r\n/**\r\n * Whether an authored value holds an expression reading another node's prop\r\n * (`[card.x]`), at any depth. An unparsable one counts: it fails the build anyway.\r\n */\r\nexport function hasNodeRef(value: unknown): boolean {\r\n for (const site of expressionOps.collect(value, \"\")) {\r\n const parsed = expressionOps.tryParse(site.source);\r\n if (\"error\" in parsed || parsed.expression.refs.some((ref) => ref.includes(\".\"))) return true;\r\n }\r\n return false;\r\n}\r\n\r\n/**\r\n * Whether writing `key` on a node of `type` leaves every laid-out box unchanged.\r\n *\r\n * Answered only for the library's own classes — a custom node may lay itself out\r\n * from anything — and there only for the props layout never reads.\r\n */\r\nexport function isLayoutNeutralProp(registry: Registry, type: string, key: string): boolean {\r\n const record = registry.node(type);\r\n if (!record || !coreLibrary().ctors.has(record.ctor)) return false;\r\n // Sound has no box, and the 2D walk skips an audio child.\r\n if (record.descriptor.dimension === \"audio\") return true;\r\n return NEUTRAL_KEYS.has(key);\r\n}\r\n\r\nconst LIFECYCLE = new Set([\"removeChildAt\", \"addChildAt\", \"reparent\"]);\r\n\r\nconst VARIABLE_COMMANDS = new Set([\"variableTo\", \"variableSet\"]);\r\n\r\nconst NEUTRAL_KEYS = new Set([\r\n \"x\", \"y\", \"rotation\", \"scale\", \"opacity\", \"fill\", \"stroke\", \"shadow\", \"overlay\",\r\n \"effects\", \"blend\", \"transformOrigin\", \"zoom\", \"lookAt\", \"heading\",\r\n]);\r\n\r\nconst DEFAULT_ROOT: NodeSpec = { id: ROOT_NODE_ID, type: \"canvas2d\", parentId: null, layerOrder: 0, props: {} };\r\n\r\n// Each command's behaviour, as the methods on its target it runs through. A class\r\n// overriding any of them is running something else under the command's name.\r\nconst TO = [\"to\", \"_prepareStep\", \"_writeProp\"];\r\nconst PAINT = [\"command\", \"set\", \"_writeProp\"];\r\n\r\nconst GLOBAL_NODE_COMMANDS: Readonly<Record<string, readonly string[]>> = {\r\n to: TO,\r\n set: [\"set\", \"_writeProp\"],\r\n save: [\"save\"],\r\n fillTo: [\"fillTo\", ...PAINT],\r\n overlayTo: [\"overlayTo\", ...PAINT],\r\n strokeTo: [\"strokeTo\", ...PAINT],\r\n shadowTo: [\"shadowTo\", ...PAINT],\r\n};\r\n\r\nconst NODE_COMMANDS: Readonly<Record<string, readonly string[]>> = {\r\n ...GLOBAL_NODE_COMMANDS,\r\n restore: [\"restore\", \"_prepareStep\", \"_writeProp\"],\r\n fadeTo: [\"fadeTo\", ...TO],\r\n rotateTo: [\"rotateTo\", ...TO],\r\n scaleTo: [\"scaleTo\", ...TO],\r\n layoutTo: [\"layoutTo\", ...TO],\r\n effectTo: [\"effectTo\", ...TO],\r\n progressTo: [\"progressTo\", ...TO],\r\n pulse: [\"pulse\", ...PAINT],\r\n wiggle: [\"wiggle\", ...PAINT],\r\n flash: [\"flash\", ...PAINT],\r\n moveTo: [\"moveTo\", ...TO, \"command\", \"set\"],\r\n zoomTo: [\"zoomTo\", ...TO],\r\n panTo: [\"panTo\", ...TO],\r\n headingTo: [\"headingTo\", ...TO],\r\n countTo: [\"countTo\", ...TO],\r\n append: [\"append\", ...TO],\r\n prepend: [\"prepend\", ...TO],\r\n // Plays its node's sound: scheduled ahead of time, writing nothing.\r\n play: [\"play\"],\r\n};\r\n\r\n/** Named commands' writes. `to`/`set` write their args; absent means \"anything\". */\r\nconst WRITES: Readonly<Record<string, readonly string[]>> = {\r\n fadeTo: [\"opacity\"],\r\n rotateTo: [\"rotation\"],\r\n scaleTo: [\"scale\"],\r\n layoutTo: [\"width\", \"height\", \"padding\"],\r\n effectTo: [\"effects\"],\r\n progressTo: [\"start\", \"end\"],\r\n pulse: [\"scale\"],\r\n wiggle: [\"rotation\"],\r\n flash: [\"start\", \"end\"],\r\n moveTo: [\"x\", \"y\"],\r\n zoomTo: [\"zoom\"],\r\n panTo: [\"lookAt\"],\r\n headingTo: [\"heading\"],\r\n fillTo: [\"fill\"],\r\n overlayTo: [\"overlay\"],\r\n strokeTo: [\"stroke\"],\r\n shadowTo: [\"shadow\"],\r\n play: [],\r\n};\r\n\r\n/** What a known command reads `from` — every command but the stamps. */\r\nconst READS_FROM = new Set(Object.keys(NODE_COMMANDS).filter((type) => type !== \"set\" && type !== \"save\"));\r\n\r\nfunction readsLayout(\r\n type: string,\r\n args: Record<string, unknown>,\r\n props: Record<string, unknown>,\r\n written: readonly string[] | undefined,\r\n): boolean {\r\n // Resolved against the node's own box the moment the step is prepared.\r\n if (hasAlignmentKey(args)) return true;\r\n // Aimed at another node's box.\r\n if (type === \"moveTo\" && typeof args.target === \"string\" && args.target !== \"\") return true;\r\n // An alignment-authored node's x/y are bindings over its box, and a node-ref\r\n // expression may read another node's (`[card.x]` on an aligned card); taking a\r\n // `from`, or a snapshot, evaluates them.\r\n const aligned = hasAlignmentKey(props);\r\n const refBound = nodeRefKeys(props);\r\n if (type === \"save\" || type === \"restore\") return aligned || refBound.size > 0;\r\n if (!READS_FROM.has(type)) return false;\r\n const touched = type === \"append\" || type === \"prepend\" ? [\"text\"] : type === \"countTo\" ? [\"value\"] : written ?? [];\r\n return touched.some((key) => refBound.has(key) || (aligned && (key === \"x\" || key === \"y\")));\r\n}\r\n\r\nfunction writtenKeys(type: string, args: Record<string, unknown>): readonly string[] | undefined {\r\n const named = WRITES[type];\r\n if (named) return named;\r\n if (type !== \"to\" && type !== \"set\") return undefined;\r\n const keys: string[] = [];\r\n for (const key of Object.keys(args)) {\r\n if (key === \"size\") keys.push(\"width\", \"height\");\r\n else if (type === \"to\" && key === \"pivot\") keys.push(\"transformOrigin\");\r\n else if (type === \"to\" && ALIGNMENT_KEYS.includes(key)) keys.push(\"x\", \"y\", \"transformOrigin\");\r\n else keys.push(key);\r\n }\r\n return keys;\r\n}\r\n\r\nfunction hasAlignmentKey(values: Record<string, unknown>): boolean {\r\n return ALIGNMENT_KEYS.some((key) => values[key] !== undefined);\r\n}\r\n\r\nconst REF_KEYS = new WeakMap<object, ReadonlySet<string>>();\r\n\r\n/** The top-level props of a row whose authored value reads another node. */\r\nfunction nodeRefKeys(props: Record<string, unknown>): ReadonlySet<string> {\r\n let keys = REF_KEYS.get(props);\r\n if (!keys) {\r\n const found = new Set<string>();\r\n for (const key of Object.keys(props)) {\r\n if (hasNodeRef(props[key])) found.add(key);\r\n }\r\n REF_KEYS.set(props, (keys = found));\r\n }\r\n return keys;\r\n}\r\n\r\nfunction methodOf(ctor: abstract new (...args: never[]) => unknown, name: string): unknown {\r\n return (ctor.prototype as Record<string, unknown>)[name];\r\n}\r\n\r\nconst KNOWN = new WeakMap<object, Map<readonly string[], boolean>>();\r\n\r\nfunction implementsCore(ctor: NodeConstructor, chain: readonly string[]): boolean {\r\n let byChain = KNOWN.get(ctor);\r\n if (!byChain) KNOWN.set(ctor, (byChain = new Map()));\r\n let known = byChain.get(chain);\r\n if (known === undefined) {\r\n // A method the class lacks entirely is not an override of one.\r\n known = chain.every((name) => {\r\n const impl = methodOf(ctor, name);\r\n return impl === undefined || coreImplementations(name).has(impl);\r\n });\r\n byChain.set(chain, known);\r\n }\r\n return known;\r\n}\r\n\r\ninterface CoreLibrary {\r\n ctors: ReadonlySet<NodeConstructor>;\r\n methods: Map<string, ReadonlySet<unknown>>;\r\n}\r\n\r\nlet core: CoreLibrary | null = null;\r\n\r\nfunction coreLibrary(): CoreLibrary {\r\n if (!core) {\r\n // A registry seeds itself with exactly what the library ships, so a fresh one is that list.\r\n const seeded = new Registry();\r\n core = { ctors: new Set(seeded.nodeKeys().map((key) => seeded.node(key)!.ctor)), methods: new Map() };\r\n }\r\n return core;\r\n}\r\n\r\n/** Every body the library's classes give `name`, base classes included. */\r\nfunction coreImplementations(name: string): ReadonlySet<unknown> {\r\n const library = coreLibrary();\r\n let impls = library.methods.get(name);\r\n if (!impls) {\r\n const found = new Set<unknown>();\r\n for (const ctor of library.ctors) {\r\n for (let proto = ctor.prototype; proto && proto !== Object.prototype; proto = Object.getPrototypeOf(proto)) {\r\n const own = Object.getOwnPropertyDescriptor(proto, name);\r\n if (own && typeof own.value === \"function\") found.add(own.value);\r\n }\r\n }\r\n library.methods.set(name, (impls = found));\r\n }\r\n return impls;\r\n}\r\n"]}
1
+ {"version":3,"file":"command-traits.js","sourceRoot":"","sources":["../../src/document/command-traits.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAwB,MAAM,YAAY,CAAC;AAE5D,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAqBvC,0FAA0F;AAC1F,MAAM,CAAC,MAAM,cA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AAW,EAAE,CAAC;IAC9B,IAAI,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACtC,IAAI,CAAC,KAAK,EAAE,CAAC;QACT,MAAM,KAAK,GAAG,IAAI,GAAG,EAAW,CAAC;QACjC,KAAK,MAAM,IAAI,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;YAC/B,KAAK,IAAI,KAAK,GAAG,IAAI,CAAC,SAAS,EAAE,KAAK,IAAI,KAAK,KAAK,MAAM,CAAC,SAAS,EAAE,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;gBACzG,MAAM,GAAG,GAAG,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;gBACzD,IAAI,GAAG,IAAI,OAAO,GAAG,CAAC,KAAK,KAAK,UAAU;oBAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YACrE,CAAC;QACL,CAAC;QACD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC;IAC/C,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC","sourcesContent":["import { Node } from \"@/components/trees/node/node\";\r\nimport { expressionOps } from \"./expression/ops\";\r\nimport { Registry, type NodeConstructor } from \"./registry\";\r\nimport type { CommandSpec, NodeSpec } from \"./types\";\r\nimport { ROOT_NODE_ID } from \"./types\";\r\n\r\n/**\r\n * What a command can do to the tree around it, read off the document and the\r\n * registry without building anything.\r\n *\r\n * Only the library's own implementations are described: a command resolving to a\r\n * component's method could do anything, so it is `known: false` and assumed to\r\n * read and write layout.\r\n */\r\nexport interface CommandTraits {\r\n scope: \"node\" | \"variable\";\r\n /** Resolves to the library's own implementation, so the rules below hold for it. */\r\n known: boolean;\r\n lifecycle: boolean;\r\n /** Building it can read a laid-out box, so it must be built against a settled tree. */\r\n readsLayout: boolean;\r\n /** Running it can change what layout computes. */\r\n writesLayout: boolean;\r\n}\r\n\r\n/** The nine named alignment props, which position a node against its own laid-out box. */\r\nexport const ALIGNMENT_KEYS: readonly string[] = [\r\n \"center\", \"topLeft\", \"topRight\", \"bottomLeft\", \"bottomRight\",\r\n \"topCenter\", \"bottomCenter\", \"centerLeft\", \"centerRight\",\r\n];\r\n\r\nconst SKIPPED: CommandTraits = { scope: \"node\", known: true, lifecycle: false, readsLayout: false, writesLayout: false };\r\n\r\n/**\r\n * How a document command resolves, as `ClipTimeline._buildPlaced` resolves it,\r\n * and what it does — or `null` when it resolves to nothing (compiling it throws).\r\n * One the build skips — aimed at a placeholder, or unpublished by its target's\r\n * type — writes nothing, which is known.\r\n * `target` is the command's target row; for `targetId: null` a document with no\r\n * explicit root row may pass `undefined`.\r\n */\r\nexport function commandTraits(registry: Registry, spec: CommandSpec, target: NodeSpec | undefined): CommandTraits | null {\r\n const lifecycle = LIFECYCLE.has(spec.type);\r\n const global = registry.command(spec.type);\r\n if (global?.scope === \"variable\") {\r\n const known = VARIABLE_COMMANDS.has(spec.type);\r\n return { scope: \"variable\", known, lifecycle, readsLayout: !known, writesLayout: false };\r\n }\r\n\r\n const row = target ?? (spec.targetId === null ? DEFAULT_ROOT : undefined);\r\n const record = row ? registry.node(row.type) : undefined;\r\n if (!row) return null;\r\n if (!record) return registry.strict ? null : SKIPPED;\r\n\r\n let chain: readonly string[] | undefined;\r\n if (global) {\r\n chain = GLOBAL_NODE_COMMANDS[spec.type];\r\n if (chain && typeof methodOf(record.ctor, chain[0]) !== \"function\") return null;\r\n } else {\r\n const entry = record.commands.get(spec.type);\r\n if (!entry) return registry.strict ? null : SKIPPED;\r\n // A method published under a core command's key is not the core command.\r\n chain = entry.method === spec.type ? NODE_COMMANDS[spec.type] : undefined;\r\n }\r\n\r\n const known = !lifecycle && chain !== undefined && implementsCore(record.ctor, chain);\r\n if (!known) return { scope: \"node\", known, lifecycle, readsLayout: true, writesLayout: true };\r\n\r\n const args = spec.args ?? {};\r\n const props = row.props ?? {};\r\n const written = writtenKeys(spec.type, args);\r\n return {\r\n scope: \"node\",\r\n known,\r\n lifecycle,\r\n readsLayout: readsLayout(spec.type, args, props, written),\r\n writesLayout: written === undefined || written.some((key) => !isLayoutNeutralProp(registry, row.type, key)),\r\n };\r\n}\r\n\r\n/**\r\n * The node ids a command's args name through a `nodeRef` argument — the nodes\r\n * whose boxes it may read when it is built, beside its own target.\r\n */\r\nexport function commandNodeRefs(registry: Registry, spec: CommandSpec, target: NodeSpec | undefined): string[] {\r\n const global = registry.command(spec.type);\r\n const row = target ?? (spec.targetId === null ? DEFAULT_ROOT : undefined);\r\n const descriptors = global\r\n ? (global.scope === \"node\" ? global.args : undefined)\r\n : row ? registry.node(row.type)?.commands.get(spec.type)?.args : undefined;\r\n const refs: string[] = [];\r\n for (const descriptor of descriptors ?? []) {\r\n const value = spec.args?.[descriptor.key];\r\n if (descriptor.kind === \"nodeRef\" && typeof value === \"string\" && value !== \"\") refs.push(value);\r\n }\r\n return refs;\r\n}\r\n\r\n/** Whether `type` hands its descendants a context of its own. */\r\nexport function isContextProvider(registry: Registry, type: string): boolean {\r\n const ctor = registry.node(type)?.ctor;\r\n return ctor !== undefined && methodOf(ctor, \"provideContext\") !== methodOf(Node, \"provideContext\");\r\n}\r\n\r\n/**\r\n * Whether an authored value holds an expression reading another node's prop\r\n * (`[card.x]`), at any depth. An unparsable one counts: it fails the build anyway.\r\n */\r\nexport function hasNodeRef(value: unknown): boolean {\r\n for (const site of expressionOps.collect(value, \"\")) {\r\n const parsed = expressionOps.tryParse(site.source);\r\n if (\"error\" in parsed || parsed.expression.refs.some((ref) => ref.includes(\".\"))) return true;\r\n }\r\n return false;\r\n}\r\n\r\n/**\r\n * Whether writing `key` on a node of `type` leaves every laid-out box unchanged.\r\n *\r\n * Every node's placement is applied after layout; past that, answered only for\r\n * the library's own classes, since a custom node may lay itself out from anything.\r\n */\r\nexport function isLayoutNeutralProp(registry: Registry, type: string, key: string): boolean {\r\n const record = registry.node(type);\r\n if (!record) return false;\r\n // Sound has no box, and the 2D walk skips an audio child.\r\n if (record.descriptor.dimension === \"audio\") return true;\r\n if (isPlacementProp(registry, type, key)) return true;\r\n return coreLibrary().ctors.has(record.ctor) && NEUTRAL_KEYS.has(key);\r\n}\r\n\r\n/** Whether `key` is placement every node of `type` holds as a plain slot, read only once a frame is drawn. */\r\nexport function isPlacementProp(registry: Registry, type: string, key: string): boolean {\r\n const dimension = registry.node(type)?.descriptor.dimension;\r\n return dimension === \"3d\" ? PLACEMENT_3D.has(key) : dimension === \"2d\" && PLACEMENT_2D.has(key);\r\n}\r\n\r\n/**\r\n * Whether a new `key` on `row` can be written onto its live node as a fresh\r\n * build would set it: placement, on a row with no prop its node turns into\r\n * placement when built (`topLeft` binds `x` and `y`).\r\n */\r\nexport function writesPlacementInPlace(registry: Registry, row: NodeSpec, key: string): boolean {\r\n const dimension = registry.node(row.type)?.descriptor.dimension;\r\n const sugar = dimension === \"3d\" ? PLACEMENT_SUGAR_3D : PLACEMENT_SUGAR_2D;\r\n return isPlacementProp(registry, row.type, key) && !Object.keys(row.props).some((prop) => sugar.has(prop));\r\n}\r\n\r\nconst LIFECYCLE = new Set([\"removeChildAt\", \"addChildAt\", \"reparent\"]);\r\n\r\nconst VARIABLE_COMMANDS = new Set([\"variableTo\", \"variableSet\"]);\r\n\r\nconst NEUTRAL_KEYS = new Set([\r\n \"x\", \"y\", \"rotation\", \"scale\", \"opacity\", \"fill\", \"stroke\", \"shadow\", \"overlay\",\r\n \"effects\", \"blend\", \"transformOrigin\", \"zoom\", \"lookAt\", \"heading\",\r\n]);\r\n\r\nconst PLACEMENT_2D = new Set([\"x\", \"y\", \"rotation\", \"scale\", \"opacity\"]);\r\n\r\nconst PLACEMENT_3D = new Set([\"x\", \"y\", \"z\", \"rotationX\", \"rotationY\", \"rotationZ\", \"scaleX\", \"scaleY\", \"scaleZ\"]);\r\n\r\nconst PLACEMENT_SUGAR_2D = new Set([\r\n \"center\", \"topLeft\", \"topRight\", \"bottomLeft\", \"bottomRight\", \"topCenter\", \"bottomCenter\", \"centerLeft\", \"centerRight\",\r\n]);\r\n\r\nconst PLACEMENT_SUGAR_3D = new Set([\"position\", \"rotation\", \"scale\"]);\r\n\r\nconst DEFAULT_ROOT: NodeSpec = { id: ROOT_NODE_ID, type: \"canvas2d\", parentId: null, layerOrder: 0, props: {} };\r\n\r\n// Each command's behaviour, as the methods on its target it runs through. A class\r\n// overriding any of them is running something else under the command's name.\r\nconst TO = [\"to\", \"_prepareStep\", \"_writeProp\"];\r\nconst PAINT = [\"command\", \"set\", \"_writeProp\"];\r\n\r\nconst GLOBAL_NODE_COMMANDS: Readonly<Record<string, readonly string[]>> = {\r\n to: TO,\r\n set: [\"set\", \"_writeProp\"],\r\n save: [\"save\"],\r\n fillTo: [\"fillTo\", ...PAINT],\r\n overlayTo: [\"overlayTo\", ...PAINT],\r\n strokeTo: [\"strokeTo\", ...PAINT],\r\n shadowTo: [\"shadowTo\", ...PAINT],\r\n};\r\n\r\nconst NODE_COMMANDS: Readonly<Record<string, readonly string[]>> = {\r\n ...GLOBAL_NODE_COMMANDS,\r\n restore: [\"restore\", \"_prepareStep\", \"_writeProp\"],\r\n fadeTo: [\"fadeTo\", ...TO],\r\n rotateTo: [\"rotateTo\", ...TO],\r\n scaleTo: [\"scaleTo\", ...TO],\r\n layoutTo: [\"layoutTo\", ...TO],\r\n effectTo: [\"effectTo\", ...TO],\r\n progressTo: [\"progressTo\", ...TO],\r\n pulse: [\"pulse\", ...PAINT],\r\n wiggle: [\"wiggle\", ...PAINT],\r\n flash: [\"flash\", ...PAINT],\r\n moveTo: [\"moveTo\", ...TO, \"command\", \"set\"],\r\n zoomTo: [\"zoomTo\", ...TO],\r\n panTo: [\"panTo\", ...TO],\r\n headingTo: [\"headingTo\", ...TO],\r\n countTo: [\"countTo\", ...TO],\r\n append: [\"append\", ...TO],\r\n prepend: [\"prepend\", ...TO],\r\n // Plays its node's sound: scheduled ahead of time, writing nothing.\r\n play: [\"play\"],\r\n};\r\n\r\n/** Named commands' writes. `to`/`set` write their args; absent means \"anything\". */\r\nconst WRITES: Readonly<Record<string, readonly string[]>> = {\r\n fadeTo: [\"opacity\"],\r\n rotateTo: [\"rotation\"],\r\n scaleTo: [\"scale\"],\r\n layoutTo: [\"width\", \"height\", \"padding\"],\r\n effectTo: [\"effects\"],\r\n progressTo: [\"start\", \"end\"],\r\n pulse: [\"scale\"],\r\n wiggle: [\"rotation\"],\r\n flash: [\"start\", \"end\"],\r\n moveTo: [\"x\", \"y\"],\r\n zoomTo: [\"zoom\"],\r\n panTo: [\"lookAt\"],\r\n headingTo: [\"heading\"],\r\n fillTo: [\"fill\"],\r\n overlayTo: [\"overlay\"],\r\n strokeTo: [\"stroke\"],\r\n shadowTo: [\"shadow\"],\r\n play: [],\r\n};\r\n\r\n/** What a known command reads `from` — every command but the stamps. */\r\nconst READS_FROM = new Set(Object.keys(NODE_COMMANDS).filter((type) => type !== \"set\" && type !== \"save\"));\r\n\r\nfunction readsLayout(\r\n type: string,\r\n args: Record<string, unknown>,\r\n props: Record<string, unknown>,\r\n written: readonly string[] | undefined,\r\n): boolean {\r\n // Resolved against the node's own box the moment the step is prepared.\r\n if (hasAlignmentKey(args)) return true;\r\n // Aimed at another node's box.\r\n if (type === \"moveTo\" && typeof args.target === \"string\" && args.target !== \"\") return true;\r\n // An alignment-authored node's x/y are bindings over its box, and a node-ref\r\n // expression may read another node's (`[card.x]` on an aligned card); taking a\r\n // `from`, or a snapshot, evaluates them.\r\n const aligned = hasAlignmentKey(props);\r\n const refBound = nodeRefKeys(props);\r\n if (type === \"save\" || type === \"restore\") return aligned || refBound.size > 0;\r\n if (!READS_FROM.has(type)) return false;\r\n const touched = type === \"append\" || type === \"prepend\" ? [\"text\"] : type === \"countTo\" ? [\"value\"] : written ?? [];\r\n return touched.some((key) => refBound.has(key) || (aligned && (key === \"x\" || key === \"y\")));\r\n}\r\n\r\nfunction writtenKeys(type: string, args: Record<string, unknown>): readonly string[] | undefined {\r\n const named = WRITES[type];\r\n if (named) return named;\r\n if (type !== \"to\" && type !== \"set\") return undefined;\r\n const keys: string[] = [];\r\n for (const key of Object.keys(args)) {\r\n if (key === \"size\") keys.push(\"width\", \"height\");\r\n else if (type === \"to\" && key === \"pivot\") keys.push(\"transformOrigin\");\r\n else if (type === \"to\" && ALIGNMENT_KEYS.includes(key)) keys.push(\"x\", \"y\", \"transformOrigin\");\r\n else keys.push(key);\r\n }\r\n return keys;\r\n}\r\n\r\nfunction hasAlignmentKey(values: Record<string, unknown>): boolean {\r\n return ALIGNMENT_KEYS.some((key) => values[key] !== undefined);\r\n}\r\n\r\nconst REF_KEYS = new WeakMap<object, ReadonlySet<string>>();\r\n\r\n/** The top-level props of a row whose authored value reads another node. */\r\nfunction nodeRefKeys(props: Record<string, unknown>): ReadonlySet<string> {\r\n let keys = REF_KEYS.get(props);\r\n if (!keys) {\r\n const found = new Set<string>();\r\n for (const key of Object.keys(props)) {\r\n if (hasNodeRef(props[key])) found.add(key);\r\n }\r\n REF_KEYS.set(props, (keys = found));\r\n }\r\n return keys;\r\n}\r\n\r\nfunction methodOf(ctor: abstract new (...args: never[]) => unknown, name: string): unknown {\r\n return (ctor.prototype as Record<string, unknown>)[name];\r\n}\r\n\r\nconst KNOWN = new WeakMap<object, Map<readonly string[], boolean>>();\r\n\r\nfunction implementsCore(ctor: NodeConstructor, chain: readonly string[]): boolean {\r\n let byChain = KNOWN.get(ctor);\r\n if (!byChain) KNOWN.set(ctor, (byChain = new Map()));\r\n let known = byChain.get(chain);\r\n if (known === undefined) {\r\n // A method the class lacks entirely is not an override of one.\r\n known = chain.every((name) => {\r\n const impl = methodOf(ctor, name);\r\n return impl === undefined || coreImplementations(name).has(impl);\r\n });\r\n byChain.set(chain, known);\r\n }\r\n return known;\r\n}\r\n\r\ninterface CoreLibrary {\r\n ctors: ReadonlySet<NodeConstructor>;\r\n methods: Map<string, ReadonlySet<unknown>>;\r\n}\r\n\r\nlet core: CoreLibrary | null = null;\r\n\r\nfunction coreLibrary(): CoreLibrary {\r\n if (!core) {\r\n // A registry seeds itself with exactly what the library ships, so a fresh one is that list.\r\n const seeded = new Registry();\r\n core = { ctors: new Set(seeded.nodeKeys().map((key) => seeded.node(key)!.ctor)), methods: new Map() };\r\n }\r\n return core;\r\n}\r\n\r\n/** Every body the library's classes give `name`, base classes included. */\r\nfunction coreImplementations(name: string): ReadonlySet<unknown> {\r\n const library = coreLibrary();\r\n let impls = library.methods.get(name);\r\n if (!impls) {\r\n const found = new Set<unknown>();\r\n for (const ctor of library.ctors) {\r\n for (let proto = ctor.prototype; proto && proto !== Object.prototype; proto = Object.getPrototypeOf(proto)) {\r\n const own = Object.getOwnPropertyDescriptor(proto, name);\r\n if (own && typeof own.value === \"function\") found.add(own.value);\r\n }\r\n }\r\n library.methods.set(name, (impls = found));\r\n }\r\n return impls;\r\n}\r\n"]}
@@ -7,7 +7,7 @@
7
7
  * host's own realm**, and that is forced by the architecture rather than
8
8
  * chosen: the node it produces has to be a live class that satisfies
9
9
  * `instanceof` against the host's own already-loaded `core`, and participate
10
- * in the same per-frame reactive `@property` graph. A live class instance
10
+ * in the same per-frame reactive `property` graph. A live class instance
11
11
  * cannot cross a worker or cross-origin iframe boundary, so the usual "run it
12
12
  * in another realm" answer is closed off by what the renderer is, not by how
13
13
  * much effort is spent on it.
@@ -24,7 +24,7 @@
24
24
  * is `Function`, and `Function("return globalThis")()` walks straight back
25
25
  * out. Closing that would mean freezing or poisoning `Object.prototype`,
26
26
  * `Function` and every async/generator constructor, which breaks the engine
27
- * itself — it subclasses, it uses decorators, it builds objects constantly.
27
+ * itself — it subclasses, it writes prototypes, it builds objects constantly.
28
28
  * So the honest security boundary is not this file. It is whatever gate the
29
29
  * *host* puts in front of calling `Registry.addNodeFromSource` at all — a
30
30
  * compiled node's source is not evaluated until something upstream decides
@@ -7,7 +7,7 @@
7
7
  * host's own realm**, and that is forced by the architecture rather than
8
8
  * chosen: the node it produces has to be a live class that satisfies
9
9
  * `instanceof` against the host's own already-loaded `core`, and participate
10
- * in the same per-frame reactive `@property` graph. A live class instance
10
+ * in the same per-frame reactive `property` graph. A live class instance
11
11
  * cannot cross a worker or cross-origin iframe boundary, so the usual "run it
12
12
  * in another realm" answer is closed off by what the renderer is, not by how
13
13
  * much effort is spent on it.
@@ -24,7 +24,7 @@
24
24
  * is `Function`, and `Function("return globalThis")()` walks straight back
25
25
  * out. Closing that would mean freezing or poisoning `Object.prototype`,
26
26
  * `Function` and every async/generator constructor, which breaks the engine
27
- * itself — it subclasses, it uses decorators, it builds objects constantly.
27
+ * itself — it subclasses, it writes prototypes, it builds objects constantly.
28
28
  * So the honest security boundary is not this file. It is whatever gate the
29
29
  * *host* puts in front of calling `Registry.addNodeFromSource` at all — a
30
30
  * compiled node's source is not evaluated until something upstream decides
@@ -1 +1 @@
1
- {"version":3,"file":"deny-globals.js","sourceRoot":"","sources":["../../src/document/deny-globals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,cAAc,GAAsB;IAC7C,2DAA2D;IAC3D,YAAY;IACZ,QAAQ;IACR,MAAM;IACN,KAAK;IACL,QAAQ;IACR,QAAQ;IAER,wBAAwB;IACxB,EAAE;IACF,2EAA2E;IAC3E,kEAAkE;IAClE,yEAAyE;IACzE,2EAA2E;IAC3E,yDAAyD;IACzD,UAAU;IACV,eAAe;IAEf,oDAAoD;IACpD,UAAU;IACV,WAAW;IACX,UAAU;IACV,SAAS;IACT,QAAQ;IACR,gBAAgB;IAEhB,iEAAiE;IACjE,+CAA+C;IAC/C,OAAO;IACP,gBAAgB;IAChB,WAAW;IACX,aAAa;IACb,SAAS;IACT,UAAU;IACV,SAAS;IAET,sCAAsC;IACtC,cAAc;IACd,gBAAgB;IAChB,WAAW;IACX,QAAQ;IACR,aAAa;IACb,QAAQ;IAER,qCAAqC;IACrC,QAAQ;IACR,cAAc;IACd,eAAe;IACf,gBAAgB;IAChB,kBAAkB;IAClB,aAAa;IAEb,6DAA6D;IAC7D,OAAO;IACP,SAAS;IACT,QAAQ;IACR,MAAM;IACN,OAAO;IACP,cAAc;CACjB,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;AAElD,MAAM,OAAO,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;AACtE,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;IACrB,MAAM,IAAI,KAAK,CACX,iCAAiC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,wBAAwB;QACvE,uFAAuF,CAC9F,CAAC;AACN,CAAC","sourcesContent":["/**\r\n * The ambient capabilities a dynamic node's compiled source is denied.\r\n *\r\n * ## What this is, and what it very deliberately is not\r\n *\r\n * A dynamic node's compiled JS is evaluated with `new Function` **in the\r\n * host's own realm**, and that is forced by the architecture rather than\r\n * chosen: the node it produces has to be a live class that satisfies\r\n * `instanceof` against the host's own already-loaded `core`, and participate\r\n * in the same per-frame reactive `@property` graph. A live class instance\r\n * cannot cross a worker or cross-origin iframe boundary, so the usual \"run it\r\n * in another realm\" answer is closed off by what the renderer is, not by how\r\n * much effort is spent on it.\r\n *\r\n * What *is* possible in one realm is taking the dangerous names out of scope.\r\n * Every identifier below becomes a parameter of the `new Function` factory\r\n * bound to `undefined`, so `fetch(...)` inside a compiled node is a call on\r\n * `undefined` rather than a network request. Under `\"use strict\"` — which the\r\n * factory already sets — a bare `this` is `undefined` too, so the usual back\r\n * door is shut.\r\n *\r\n * **This is hardening, not a sandbox.** A determined script can still reach\r\n * the real global object through the intrinsics: `({}).constructor.constructor`\r\n * is `Function`, and `Function(\"return globalThis\")()` walks straight back\r\n * out. Closing that would mean freezing or poisoning `Object.prototype`,\r\n * `Function` and every async/generator constructor, which breaks the engine\r\n * itself — it subclasses, it uses decorators, it builds objects constantly.\r\n * So the honest security boundary is not this file. It is whatever gate the\r\n * *host* puts in front of calling `Registry.addNodeFromSource` at all — a\r\n * compiled node's source is not evaluated until something upstream decides\r\n * it should be.\r\n *\r\n * This file's job is to make the easy paths closed, the accidents impossible,\r\n * and the escape require obvious intent that a reviewer would notice.\r\n */\r\n\r\n/**\r\n * Names bound to `undefined` in every dynamic node module's scope.\r\n *\r\n * Grouped by what they'd be used for, because the list is only auditable if\r\n * you can see what each entry is keeping out. Adding a browser API here is\r\n * cheap; leaving one out is the bug.\r\n *\r\n * This engine's `Registry` only ever evaluates a dynamic node inside a\r\n * browser-realm page (a real browser tab, or headless's own Playwright page —\r\n * never bare Node), so this list is scoped to that one realm rather than also\r\n * covering Node globals (`process`, `require`, `global`) that never apply\r\n * here.\r\n */\r\nexport const DENIED_GLOBALS: readonly string[] = [\r\n // Reaching the global object, and from it everything else.\r\n \"globalThis\",\r\n \"window\",\r\n \"self\",\r\n \"top\",\r\n \"parent\",\r\n \"frames\",\r\n\r\n // Evaluating more code.\r\n //\r\n // `eval` is missing on purpose and cannot be added: strict mode forbids it\r\n // as a binding name, so naming it here makes `new Function` throw\r\n // \"Unexpected eval or arguments in strict mode\" and *every* dynamic node\r\n // stops linking. It stays reachable, which is one more reason this file is\r\n // not the security boundary — see the module note above.\r\n \"Function\",\r\n \"importScripts\",\r\n\r\n // The DOM: reading the page, and `document.cookie`.\r\n \"document\",\r\n \"navigator\",\r\n \"location\",\r\n \"history\",\r\n \"screen\",\r\n \"customElements\",\r\n\r\n // Anywhere to send what was found. (`navigator.sendBeacon` needs\r\n // `navigator`, which is already denied above.)\r\n \"fetch\",\r\n \"XMLHttpRequest\",\r\n \"WebSocket\",\r\n \"EventSource\",\r\n \"Request\",\r\n \"Response\",\r\n \"Headers\",\r\n\r\n // Anywhere to read a credential from.\r\n \"localStorage\",\r\n \"sessionStorage\",\r\n \"indexedDB\",\r\n \"caches\",\r\n \"cookieStore\",\r\n \"crypto\",\r\n\r\n // Other threads and other documents.\r\n \"Worker\",\r\n \"SharedWorker\",\r\n \"ServiceWorker\",\r\n \"MessageChannel\",\r\n \"BroadcastChannel\",\r\n \"postMessage\",\r\n\r\n // Things that ask the user for something, or leave the page.\r\n \"alert\",\r\n \"confirm\",\r\n \"prompt\",\r\n \"open\",\r\n \"print\",\r\n \"Notification\",\r\n];\r\n\r\n/**\r\n * Names strict mode refuses to bind, and which would therefore break linking\r\n * for every dynamic node rather than protecting anything.\r\n *\r\n * Checked rather than trusted: adding one to the list above is an easy\r\n * mistake that fails at *evaluation* time, on whichever node happens to\r\n * compile first, with an error naming neither the list nor the culprit.\r\n */\r\nconst UNBINDABLE = new Set([\"eval\", \"arguments\"]);\r\n\r\nconst illegal = DENIED_GLOBALS.filter((name) => UNBINDABLE.has(name));\r\nif (illegal.length > 0) {\r\n throw new Error(\r\n `DENIED_GLOBALS cannot contain ${illegal.join(\", \")}: strict mode forbids ` +\r\n `binding those names, so no dynamic node would link at all. See the note in this file.`,\r\n );\r\n}\r\n"]}
1
+ {"version":3,"file":"deny-globals.js","sourceRoot":"","sources":["../../src/document/deny-globals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,cAAc,GAAsB;IAC7C,2DAA2D;IAC3D,YAAY;IACZ,QAAQ;IACR,MAAM;IACN,KAAK;IACL,QAAQ;IACR,QAAQ;IAER,wBAAwB;IACxB,EAAE;IACF,2EAA2E;IAC3E,kEAAkE;IAClE,yEAAyE;IACzE,2EAA2E;IAC3E,yDAAyD;IACzD,UAAU;IACV,eAAe;IAEf,oDAAoD;IACpD,UAAU;IACV,WAAW;IACX,UAAU;IACV,SAAS;IACT,QAAQ;IACR,gBAAgB;IAEhB,iEAAiE;IACjE,+CAA+C;IAC/C,OAAO;IACP,gBAAgB;IAChB,WAAW;IACX,aAAa;IACb,SAAS;IACT,UAAU;IACV,SAAS;IAET,sCAAsC;IACtC,cAAc;IACd,gBAAgB;IAChB,WAAW;IACX,QAAQ;IACR,aAAa;IACb,QAAQ;IAER,qCAAqC;IACrC,QAAQ;IACR,cAAc;IACd,eAAe;IACf,gBAAgB;IAChB,kBAAkB;IAClB,aAAa;IAEb,6DAA6D;IAC7D,OAAO;IACP,SAAS;IACT,QAAQ;IACR,MAAM;IACN,OAAO;IACP,cAAc;CACjB,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;AAElD,MAAM,OAAO,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;AACtE,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;IACrB,MAAM,IAAI,KAAK,CACX,iCAAiC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,wBAAwB;QACvE,uFAAuF,CAC9F,CAAC;AACN,CAAC","sourcesContent":["/**\r\n * The ambient capabilities a dynamic node's compiled source is denied.\r\n *\r\n * ## What this is, and what it very deliberately is not\r\n *\r\n * A dynamic node's compiled JS is evaluated with `new Function` **in the\r\n * host's own realm**, and that is forced by the architecture rather than\r\n * chosen: the node it produces has to be a live class that satisfies\r\n * `instanceof` against the host's own already-loaded `core`, and participate\r\n * in the same per-frame reactive `property` graph. A live class instance\r\n * cannot cross a worker or cross-origin iframe boundary, so the usual \"run it\r\n * in another realm\" answer is closed off by what the renderer is, not by how\r\n * much effort is spent on it.\r\n *\r\n * What *is* possible in one realm is taking the dangerous names out of scope.\r\n * Every identifier below becomes a parameter of the `new Function` factory\r\n * bound to `undefined`, so `fetch(...)` inside a compiled node is a call on\r\n * `undefined` rather than a network request. Under `\"use strict\"` — which the\r\n * factory already sets — a bare `this` is `undefined` too, so the usual back\r\n * door is shut.\r\n *\r\n * **This is hardening, not a sandbox.** A determined script can still reach\r\n * the real global object through the intrinsics: `({}).constructor.constructor`\r\n * is `Function`, and `Function(\"return globalThis\")()` walks straight back\r\n * out. Closing that would mean freezing or poisoning `Object.prototype`,\r\n * `Function` and every async/generator constructor, which breaks the engine\r\n * itself — it subclasses, it writes prototypes, it builds objects constantly.\r\n * So the honest security boundary is not this file. It is whatever gate the\r\n * *host* puts in front of calling `Registry.addNodeFromSource` at all — a\r\n * compiled node's source is not evaluated until something upstream decides\r\n * it should be.\r\n *\r\n * This file's job is to make the easy paths closed, the accidents impossible,\r\n * and the escape require obvious intent that a reviewer would notice.\r\n */\r\n\r\n/**\r\n * Names bound to `undefined` in every dynamic node module's scope.\r\n *\r\n * Grouped by what they'd be used for, because the list is only auditable if\r\n * you can see what each entry is keeping out. Adding a browser API here is\r\n * cheap; leaving one out is the bug.\r\n *\r\n * This engine's `Registry` only ever evaluates a dynamic node inside a\r\n * browser-realm page (a real browser tab, or headless's own Playwright page —\r\n * never bare Node), so this list is scoped to that one realm rather than also\r\n * covering Node globals (`process`, `require`, `global`) that never apply\r\n * here.\r\n */\r\nexport const DENIED_GLOBALS: readonly string[] = [\r\n // Reaching the global object, and from it everything else.\r\n \"globalThis\",\r\n \"window\",\r\n \"self\",\r\n \"top\",\r\n \"parent\",\r\n \"frames\",\r\n\r\n // Evaluating more code.\r\n //\r\n // `eval` is missing on purpose and cannot be added: strict mode forbids it\r\n // as a binding name, so naming it here makes `new Function` throw\r\n // \"Unexpected eval or arguments in strict mode\" and *every* dynamic node\r\n // stops linking. It stays reachable, which is one more reason this file is\r\n // not the security boundary — see the module note above.\r\n \"Function\",\r\n \"importScripts\",\r\n\r\n // The DOM: reading the page, and `document.cookie`.\r\n \"document\",\r\n \"navigator\",\r\n \"location\",\r\n \"history\",\r\n \"screen\",\r\n \"customElements\",\r\n\r\n // Anywhere to send what was found. (`navigator.sendBeacon` needs\r\n // `navigator`, which is already denied above.)\r\n \"fetch\",\r\n \"XMLHttpRequest\",\r\n \"WebSocket\",\r\n \"EventSource\",\r\n \"Request\",\r\n \"Response\",\r\n \"Headers\",\r\n\r\n // Anywhere to read a credential from.\r\n \"localStorage\",\r\n \"sessionStorage\",\r\n \"indexedDB\",\r\n \"caches\",\r\n \"cookieStore\",\r\n \"crypto\",\r\n\r\n // Other threads and other documents.\r\n \"Worker\",\r\n \"SharedWorker\",\r\n \"ServiceWorker\",\r\n \"MessageChannel\",\r\n \"BroadcastChannel\",\r\n \"postMessage\",\r\n\r\n // Things that ask the user for something, or leave the page.\r\n \"alert\",\r\n \"confirm\",\r\n \"prompt\",\r\n \"open\",\r\n \"print\",\r\n \"Notification\",\r\n];\r\n\r\n/**\r\n * Names strict mode refuses to bind, and which would therefore break linking\r\n * for every dynamic node rather than protecting anything.\r\n *\r\n * Checked rather than trusted: adding one to the list above is an easy\r\n * mistake that fails at *evaluation* time, on whichever node happens to\r\n * compile first, with an error naming neither the list nor the culprit.\r\n */\r\nconst UNBINDABLE = new Set([\"eval\", \"arguments\"]);\r\n\r\nconst illegal = DENIED_GLOBALS.filter((name) => UNBINDABLE.has(name));\r\nif (illegal.length > 0) {\r\n throw new Error(\r\n `DENIED_GLOBALS cannot contain ${illegal.join(\", \")}: strict mode forbids ` +\r\n `binding those names, so no dynamic node would link at all. See the note in this file.`,\r\n );\r\n}\r\n"]}
@@ -2,7 +2,7 @@
2
2
  * **Expressions**: a prop that follows a variable instead of holding a value.
3
3
  *
4
4
  * A document is data, so it cannot carry a function — which is exactly what a
5
- * derived prop is (`packages/core/src/props/`: a `@property`'s slot either holds
5
+ * derived prop is (`packages/core/src/props/`: a `property`'s slot either holds
6
6
  * a value or is *bound* to a thunk). An expression is that function written as
7
7
  * a string a document can store:
8
8
  *
@@ -2,7 +2,7 @@
2
2
  * **Expressions**: a prop that follows a variable instead of holding a value.
3
3
  *
4
4
  * A document is data, so it cannot carry a function — which is exactly what a
5
- * derived prop is (`packages/core/src/props/`: a `@property`'s slot either holds
5
+ * derived prop is (`packages/core/src/props/`: a `property`'s slot either holds
6
6
  * a value or is *bound* to a thunk). An expression is that function written as
7
7
  * a string a document can store:
8
8
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/document/expression/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC","sourcesContent":["/**\r\n * **Expressions**: a prop that follows a variable instead of holding a value.\r\n *\r\n * A document is data, so it cannot carry a function — which is exactly what a\r\n * derived prop is (`packages/core/src/props/`: a `@property`'s slot either holds\r\n * a value or is *bound* to a thunk). An expression is that function written as\r\n * a string a document can store:\r\n *\r\n * ```json\r\n * { \"id\": \"card\", \"type\": \"rect\", \"props\": { \"x\": \"=4[g]+3\", \"opacity\": \"=[g]\" } }\r\n * ```\r\n *\r\n * A leading `=` marks the string as a formula rather than a value, and `[name]`\r\n * reads the `VariableSpec` with that id. What it compiles to is an ordinary\r\n * prop binding, so nothing underneath it changes: a command writes the\r\n * variable's slot, and a bound prop recomputes on every read, so each of them\r\n * sees the new value without anything being invalidated. That is what makes one\r\n * variable able to drive twenty nodes without twenty copies of the same tween.\r\n *\r\n * Three rules the syntax turns on, each of which removes a question a reader\r\n * would otherwise have to ask:\r\n *\r\n * - **`=` marks the whole string, not part of it.** There is no `${…}` hole in\r\n * surrounding text. A prop is either a value or a formula, so nothing has to\r\n * define what a half-interpolated `cornerRadius` means. A literal string that\r\n * really does start with `=` is written `\"==\"`.\r\n * - **A lone `[x]` passes the value through, unconverted.** `\"=[c]\"` on a `fill`\r\n * yields whatever `c` holds — a colour string, a `Vector2`, an object — while\r\n * anything with arithmetic in it is numeric. Without that rule a variable\r\n * could only ever be a number, and driving four nodes' `fill` from one place\r\n * is half the reason variables exist.\r\n * - **Angles are degrees**, matching every angle in the library (`rotation`,\r\n * `startAngle`, 3D Euler rotations). `sin(30)` is `0.5`.\r\n *\r\n * Expressions **bind**; they are not tween destinations. See\r\n * `document/timeline.ts` for where that is enforced and why.\r\n *\r\n * One value — {@link expressionOps} — carries every operation: recognition,\r\n * parsing, compiling, the authored-value walk, and the name lists a host's\r\n * completion needs. The free functions this used to export\r\n * (`isExpressionSource`, `unescapeExpression`, `parseExpression`,\r\n * `tryParseExpression`, `compileExpression`, `compileValue`, `compileProps`,\r\n * `collectExpressions`, `expressionFunctionNames`, `expressionConstantNames`)\r\n * are those methods now.\r\n */\r\nexport { expressionOps } from \"./ops\";\r\nexport { ExpressionError } from \"./types\";\r\nexport type * from \"./types\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/document/expression/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC","sourcesContent":["/**\r\n * **Expressions**: a prop that follows a variable instead of holding a value.\r\n *\r\n * A document is data, so it cannot carry a function — which is exactly what a\r\n * derived prop is (`packages/core/src/props/`: a `property`'s slot either holds\r\n * a value or is *bound* to a thunk). An expression is that function written as\r\n * a string a document can store:\r\n *\r\n * ```json\r\n * { \"id\": \"card\", \"type\": \"rect\", \"props\": { \"x\": \"=4[g]+3\", \"opacity\": \"=[g]\" } }\r\n * ```\r\n *\r\n * A leading `=` marks the string as a formula rather than a value, and `[name]`\r\n * reads the `VariableSpec` with that id. What it compiles to is an ordinary\r\n * prop binding, so nothing underneath it changes: a command writes the\r\n * variable's slot, and a bound prop recomputes on every read, so each of them\r\n * sees the new value without anything being invalidated. That is what makes one\r\n * variable able to drive twenty nodes without twenty copies of the same tween.\r\n *\r\n * Three rules the syntax turns on, each of which removes a question a reader\r\n * would otherwise have to ask:\r\n *\r\n * - **`=` marks the whole string, not part of it.** There is no `${…}` hole in\r\n * surrounding text. A prop is either a value or a formula, so nothing has to\r\n * define what a half-interpolated `cornerRadius` means. A literal string that\r\n * really does start with `=` is written `\"==\"`.\r\n * - **A lone `[x]` passes the value through, unconverted.** `\"=[c]\"` on a `fill`\r\n * yields whatever `c` holds — a colour string, a `Vector2`, an object — while\r\n * anything with arithmetic in it is numeric. Without that rule a variable\r\n * could only ever be a number, and driving four nodes' `fill` from one place\r\n * is half the reason variables exist.\r\n * - **Angles are degrees**, matching every angle in the library (`rotation`,\r\n * `startAngle`, 3D Euler rotations). `sin(30)` is `0.5`.\r\n *\r\n * Expressions **bind**; they are not tween destinations. See\r\n * `document/timeline.ts` for where that is enforced and why.\r\n *\r\n * One value — {@link expressionOps} — carries every operation: recognition,\r\n * parsing, compiling, the authored-value walk, and the name lists a host's\r\n * completion needs. The free functions this used to export\r\n * (`isExpressionSource`, `unescapeExpression`, `parseExpression`,\r\n * `tryParseExpression`, `compileExpression`, `compileValue`, `compileProps`,\r\n * `collectExpressions`, `expressionFunctionNames`, `expressionConstantNames`)\r\n * are those methods now.\r\n */\r\nexport { expressionOps } from \"./ops\";\r\nexport { ExpressionError } from \"./types\";\r\nexport type * from \"./types\";\r\n"]}
@@ -5,7 +5,7 @@
5
5
  * call site one grep from its implementation. Unlike `pathOps`, `insetsOps` and
6
6
  * the rest, this is **not** an `AttributeOps`: an expression is not an attribute,
7
7
  * has no `resolve`/`lerp` pair, and nothing in `attributes/properties/typed.ts`
8
- * builds a decorator from it. Only the naming convention transfers.
8
+ * builds a property from it. Only the naming convention transfers.
9
9
  *
10
10
  * Behind it is one grammar. There were two — this one and the function-plot
11
11
  * language in `@motionscript/math` — agreeing on every rule they documented and
@@ -1 +1 @@
1
- {"version":3,"file":"ops.js","sourceRoot":"","sources":["../../../src/document/expression/ops.ts"],"names":[],"mappings":"AAAA;;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ps` has, for the same reason — one value to import, and a\r\n * call site one grep from its implementation. Unlike `pathOps`, `insetsOps` and\r\n * the rest, this is **not** an `AttributeOps`: an expression is not an attribute,\r\n * has no `resolve`/`lerp` pair, and nothing in `attributes/properties/typed.ts`\r\n * builds a decorator from it. Only the naming convention transfers.\r\n *\r\n * Behind it is one grammar. There were two — this one and the function-plot\r\n * language in `@motionscript/math` — agreeing on every rule they documented and\r\n * disagreeing everywhere they hadn't. The pipeline is now:\r\n *\r\n * a prop value ── bind/collect ──▶ \"=4[g]+3\" ── parse ──▶ ExpressionNode\r\n * (one walk) the marker │\r\n * stripped here ▼\r\n * compile ──▶ () => unknown\r\n *\r\n * A dialect chooses the function library and how a reference is spelled, so\r\n * `sin` can be degrees here and radians in a plot without a second parser.\r\n */\r\nimport { DOCUMENT_DIALECT, parse, sortedKeys } from \"./parse\";\r\nimport { compile } from \"./compile\";\r\nimport { bind, bindProps, collect, isSource, renameRefs, unescape } from \"./walk\";\r\nimport type {\r\n CompiledProps, CompiledValue, ExpressionDialect, ExpressionSite,\r\n ParsedExpression, VariableResolver,\r\n} from \"./types\";\r\n\r\n/** {@link parse}, tolerating the `=` a raw prop value still carries. */\r\nfunction parseSource(source: string, dialect: ExpressionDialect = DOCUMENT_DIALECT): ParsedExpression {\r\n return parse(isSource(source) ? source.slice(1) : source, dialect);\r\n}\r\n\r\nexport interface ExpressionOps {\r\n // ── Recognition ────────────────────────────────────────────────────────\r\n /** True for a formula. `\"==\"` escapes a literal string starting with `=`. */\r\n isSource(value: unknown): value is string;\r\n /** Strip that escape: `\"==x\"` → `\"=x\"`. Everything else passes through. */\r\n unescape(value: string): string;\r\n\r\n // ── Reading ────────────────────────────────────────────────────────────\r\n /** Parse a formula, with or without its leading `=`. Throws `ExpressionError`. */\r\n parse(source: string, dialect?: ExpressionDialect): ParsedExpression;\r\n /** {@link ExpressionOps.parse} without throwing — the shape a validator wants. */\r\n tryParse(source: string, dialect?: ExpressionDialect): { expression: ParsedExpression } | { error: string };\r\n\r\n // ── Binding ────────────────────────────────────────────────────────────\r\n /** A parsed formula into the binding a `PropSlot` takes. */\r\n compile(parsed: ParsedExpression, resolve: VariableResolver, path?: string): () => unknown;\r\n /** One authored prop value: a plain value, or the binding an expression inside it produced. */\r\n bind(value: unknown, resolve: VariableResolver, path?: string): CompiledValue;\r\n /** A whole props bag, split into what a constructor can take and what has to be bound. */\r\n bindProps(props: Record<string, unknown> | undefined, resolve: VariableResolver, path?: string): CompiledProps;\r\n\r\n // ── Inspecting ─────────────────────────────────────────────────────────\r\n /** Every expression inside an authored value, with a JSON-Pointer-style path. */\r\n collect(value: unknown, path: string): ExpressionSite[];\r\n /** Rewrite the `[ref]`s inside every expression in a value; `undefined` keeps one. */\r\n renameRefs<T>(value: T, rename: (ref: string) => string | undefined): T;\r\n /** Every function name, for a host offering completion. Sorted. */\r\n functions(): string[];\r\n /** Every constant name, for a host offering completion. Sorted. */\r\n constants(): string[];\r\n /** The language a document's props are written in. */\r\n readonly dialect: ExpressionDialect;\r\n}\r\n\r\nexport const expressionOps: ExpressionOps = {\r\n isSource,\r\n unescape,\r\n\r\n parse: parseSource,\r\n tryParse: (source, dialect) => {\r\n try {\r\n return { expression: parseSource(source, dialect) };\r\n } catch (e) {\r\n return { error: e instanceof Error ? e.message : String(e) };\r\n }\r\n },\r\n\r\n compile,\r\n bind,\r\n bindProps,\r\n\r\n collect,\r\n renameRefs,\r\n functions: () => sortedKeys(DOCUMENT_DIALECT.functions),\r\n constants: () => sortedKeys(DOCUMENT_DIALECT.constants),\r\n dialect: DOCUMENT_DIALECT,\r\n};\r\n"]}
1
+ {"version":3,"file":"ops.js","sourceRoot":"","sources":["../../../src/document/expression/ops.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAMlF,wEAAwE;AACxE,SAAS,WAAW,CAAC,MAAc,EAAE,UAA6B,gBAAgB;IAC9E,OAAO,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACvE,CAAC;AAoCD,MAAM,CAAC,MAAM,aAAa,GAAkB;IACxC,QAAQ;IACR,QAAQ;IAER,KAAK,EAAE,WAAW;IAClB,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE;QAC1B,IAAI,CAAC;YACD,OAAO,EAAE,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;QACxD,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACT,OAAO,EAAE,KAAK,EAAE,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;QACjE,CAAC;IACL,CAAC;IAED,OAAO;IACP,IAAI;IACJ,SAAS;IAET,OAAO;IACP,UAAU;IACV,SAAS,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,SAAS,CAAC;IACvD,SAAS,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,SAAS,CAAC;IACvD,OAAO,EAAE,gBAAgB;CAC5B,CAAC","sourcesContent":["/**\r\n * Every expression operation, on one object.\r\n *\r\n * The same shape `pathOps` has, for the same reason — one value to import, and a\r\n * call site one grep from its implementation. Unlike `pathOps`, `insetsOps` and\r\n * the rest, this is **not** an `AttributeOps`: an expression is not an attribute,\r\n * has no `resolve`/`lerp` pair, and nothing in `attributes/properties/typed.ts`\r\n * builds a property from it. Only the naming convention transfers.\r\n *\r\n * Behind it is one grammar. There were two — this one and the function-plot\r\n * language in `@motionscript/math` — agreeing on every rule they documented and\r\n * disagreeing everywhere they hadn't. The pipeline is now:\r\n *\r\n * a prop value ── bind/collect ──▶ \"=4[g]+3\" ── parse ──▶ ExpressionNode\r\n * (one walk) the marker │\r\n * stripped here ▼\r\n * compile ──▶ () => unknown\r\n *\r\n * A dialect chooses the function library and how a reference is spelled, so\r\n * `sin` can be degrees here and radians in a plot without a second parser.\r\n */\r\nimport { DOCUMENT_DIALECT, parse, sortedKeys } from \"./parse\";\r\nimport { compile } from \"./compile\";\r\nimport { bind, bindProps, collect, isSource, renameRefs, unescape } from \"./walk\";\r\nimport type {\r\n CompiledProps, CompiledValue, ExpressionDialect, ExpressionSite,\r\n ParsedExpression, VariableResolver,\r\n} from \"./types\";\r\n\r\n/** {@link parse}, tolerating the `=` a raw prop value still carries. */\r\nfunction parseSource(source: string, dialect: ExpressionDialect = DOCUMENT_DIALECT): ParsedExpression {\r\n return parse(isSource(source) ? source.slice(1) : source, dialect);\r\n}\r\n\r\nexport interface ExpressionOps {\r\n // ── Recognition ────────────────────────────────────────────────────────\r\n /** True for a formula. `\"==\"` escapes a literal string starting with `=`. */\r\n isSource(value: unknown): value is string;\r\n /** Strip that escape: `\"==x\"` → `\"=x\"`. Everything else passes through. */\r\n unescape(value: string): string;\r\n\r\n // ── Reading ────────────────────────────────────────────────────────────\r\n /** Parse a formula, with or without its leading `=`. Throws `ExpressionError`. */\r\n parse(source: string, dialect?: ExpressionDialect): ParsedExpression;\r\n /** {@link ExpressionOps.parse} without throwing — the shape a validator wants. */\r\n tryParse(source: string, dialect?: ExpressionDialect): { expression: ParsedExpression } | { error: string };\r\n\r\n // ── Binding ────────────────────────────────────────────────────────────\r\n /** A parsed formula into the binding a `PropSlot` takes. */\r\n compile(parsed: ParsedExpression, resolve: VariableResolver, path?: string): () => unknown;\r\n /** One authored prop value: a plain value, or the binding an expression inside it produced. */\r\n bind(value: unknown, resolve: VariableResolver, path?: string): CompiledValue;\r\n /** A whole props bag, split into what a constructor can take and what has to be bound. */\r\n bindProps(props: Record<string, unknown> | undefined, resolve: VariableResolver, path?: string): CompiledProps;\r\n\r\n // ── Inspecting ─────────────────────────────────────────────────────────\r\n /** Every expression inside an authored value, with a JSON-Pointer-style path. */\r\n collect(value: unknown, path: string): ExpressionSite[];\r\n /** Rewrite the `[ref]`s inside every expression in a value; `undefined` keeps one. */\r\n renameRefs<T>(value: T, rename: (ref: string) => string | undefined): T;\r\n /** Every function name, for a host offering completion. Sorted. */\r\n functions(): string[];\r\n /** Every constant name, for a host offering completion. Sorted. */\r\n constants(): string[];\r\n /** The language a document's props are written in. */\r\n readonly dialect: ExpressionDialect;\r\n}\r\n\r\nexport const expressionOps: ExpressionOps = {\r\n isSource,\r\n unescape,\r\n\r\n parse: parseSource,\r\n tryParse: (source, dialect) => {\r\n try {\r\n return { expression: parseSource(source, dialect) };\r\n } catch (e) {\r\n return { error: e instanceof Error ? e.message : String(e) };\r\n }\r\n },\r\n\r\n compile,\r\n bind,\r\n bindProps,\r\n\r\n collect,\r\n renameRefs,\r\n functions: () => sortedKeys(DOCUMENT_DIALECT.functions),\r\n constants: () => sortedKeys(DOCUMENT_DIALECT.constants),\r\n dialect: DOCUMENT_DIALECT,\r\n};\r\n"]}
@@ -2,10 +2,17 @@ export * from "./types.js";
2
2
  export * from "./project.js";
3
3
  export * from "./expression/index.js";
4
4
  export * from "./validate.js";
5
+ export { DOCUMENT_FORMAT_VERSION, DOCUMENT_MIGRATIONS, DocumentTooNewError, documentFormatVersion, migrateDocument, } from "./migrate.js";
6
+ export type { DocumentChange, DocumentMigration, DocumentMigrationResult, JsonDocument, NoteChange } from "./migrate.js";
7
+ export { migrateNodeProps } from "./prop-evolution.js";
8
+ export type { PropEvolution, PropMigration, PropNote } from "./prop-evolution.js";
9
+ export { missingNodeOf } from "./missing-node.js";
10
+ export { registryVocabulary, vocabularyBreaks } from "./vocabulary.js";
11
+ export type { RegistryVocabulary, VocabularyBreak } from "./vocabulary.js";
12
+ export type { MissingNodeInfo } from "./missing-node.js";
5
13
  export * from "./registry.js";
6
14
  export * from "./node-descriptor.js";
7
- export * from "./node-decorator.js";
8
- export * from "./withdraw.js";
15
+ export { NODE_META, getNodeDescriptor } from "./node-decorator.js";
9
16
  export * from "./placement.js";
10
17
  export * from "./timeline.js";
11
18
  export * from "./audio.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/document/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/document/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,OAAO,EACH,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,eAAe,GAClB,MAAM,WAAW,CAAC;AACnB,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACtH,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACpE,YAAY,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACxE,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAChE,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
@@ -2,10 +2,13 @@ export * from "./types.js";
2
2
  export * from "./project.js";
3
3
  export * from "./expression/index.js";
4
4
  export * from "./validate.js";
5
+ export { DOCUMENT_FORMAT_VERSION, DOCUMENT_MIGRATIONS, DocumentTooNewError, documentFormatVersion, migrateDocument, } from "./migrate.js";
6
+ export { migrateNodeProps } from "./prop-evolution.js";
7
+ export { missingNodeOf } from "./missing-node.js";
8
+ export { registryVocabulary, vocabularyBreaks } from "./vocabulary.js";
5
9
  export * from "./registry.js";
6
10
  export * from "./node-descriptor.js";
7
- export * from "./node-decorator.js";
8
- export * from "./withdraw.js";
11
+ export { NODE_META, getNodeDescriptor } from "./node-decorator.js";
9
12
  export * from "./placement.js";
10
13
  export * from "./timeline.js";
11
14
  export * from "./audio.js";