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

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 (904) hide show
  1. package/CHANGELOG.md +247 -0
  2. package/LICENSE +201 -201
  3. package/NOTICE +48 -0
  4. package/README.md +93 -72
  5. package/dist/assets/asset-index.js.map +1 -1
  6. package/dist/assets/catalog.d.ts +9 -0
  7. package/dist/assets/catalog.d.ts.map +1 -1
  8. package/dist/assets/catalog.js +11 -0
  9. package/dist/assets/catalog.js.map +1 -1
  10. package/dist/assets/errors.d.ts.map +1 -1
  11. package/dist/assets/errors.js +8 -3
  12. package/dist/assets/errors.js.map +1 -1
  13. package/dist/assets/index.js.map +1 -1
  14. package/dist/assets/manager.d.ts +26 -1
  15. package/dist/assets/manager.d.ts.map +1 -1
  16. package/dist/assets/manager.js +79 -4
  17. package/dist/assets/manager.js.map +1 -1
  18. package/dist/assets/manifest.js.map +1 -1
  19. package/dist/assets/record.js.map +1 -1
  20. package/dist/assets/scope.d.ts +3 -3
  21. package/dist/assets/scope.d.ts.map +1 -1
  22. package/dist/assets/scope.js.map +1 -1
  23. package/dist/attributes/audio/filters/chain.d.ts +1 -1
  24. package/dist/attributes/audio/filters/chain.js.map +1 -1
  25. package/dist/attributes/audio/filters/curve.d.ts +8 -8
  26. package/dist/attributes/audio/filters/curve.d.ts.map +1 -1
  27. package/dist/attributes/audio/filters/curve.js +20 -19
  28. package/dist/attributes/audio/filters/curve.js.map +1 -1
  29. package/dist/attributes/audio/filters/implementations/echo.js.map +1 -1
  30. package/dist/attributes/audio/filters/implementations/gain.js.map +1 -1
  31. package/dist/attributes/audio/filters/implementations/highpass.js.map +1 -1
  32. package/dist/attributes/audio/filters/implementations/lowpass.js.map +1 -1
  33. package/dist/attributes/audio/filters/implementations/speed.d.ts +2 -2
  34. package/dist/attributes/audio/filters/implementations/speed.js.map +1 -1
  35. package/dist/attributes/audio/filters/implementations/tremolo.js.map +1 -1
  36. package/dist/attributes/audio/filters/index.d.ts +1 -1
  37. package/dist/attributes/audio/filters/index.d.ts.map +1 -1
  38. package/dist/attributes/audio/filters/index.js +1 -1
  39. package/dist/attributes/audio/filters/index.js.map +1 -1
  40. package/dist/attributes/audio/filters/registry.js.map +1 -1
  41. package/dist/attributes/audio/filters/union.js.map +1 -1
  42. package/dist/attributes/audio/request.d.ts +17 -2
  43. package/dist/attributes/audio/request.d.ts.map +1 -1
  44. package/dist/attributes/audio/request.js.map +1 -1
  45. package/dist/attributes/audio/schedule.d.ts +4 -2
  46. package/dist/attributes/audio/schedule.d.ts.map +1 -1
  47. package/dist/attributes/audio/schedule.js +15 -8
  48. package/dist/attributes/audio/schedule.js.map +1 -1
  49. package/dist/attributes/audio/sound.d.ts +4 -2
  50. package/dist/attributes/audio/sound.d.ts.map +1 -1
  51. package/dist/attributes/audio/sound.js +8 -4
  52. package/dist/attributes/audio/sound.js.map +1 -1
  53. package/dist/attributes/index.js.map +1 -1
  54. package/dist/attributes/layout/alignment.js +1 -1
  55. package/dist/attributes/layout/alignment.js.map +1 -1
  56. package/dist/attributes/layout/index.js.map +1 -1
  57. package/dist/attributes/layout/insets.js.map +1 -1
  58. package/dist/attributes/layout/matrix2d.js.map +1 -1
  59. package/dist/attributes/layout/size.js.map +1 -1
  60. package/dist/attributes/layout/transform3d.js.map +1 -1
  61. package/dist/attributes/layout/vector2.js.map +1 -1
  62. package/dist/attributes/layout/world-transform.js.map +1 -1
  63. package/dist/attributes/mask/boolean.js.map +1 -1
  64. package/dist/attributes/mask/mask.js.map +1 -1
  65. package/dist/attributes/properties/decorator.d.ts +3 -1
  66. package/dist/attributes/properties/decorator.d.ts.map +1 -1
  67. package/dist/attributes/properties/decorator.js.map +1 -1
  68. package/dist/attributes/properties/inputs.js.map +1 -1
  69. package/dist/attributes/properties/typed.d.ts +9 -2
  70. package/dist/attributes/properties/typed.d.ts.map +1 -1
  71. package/dist/attributes/properties/typed.js +15 -1
  72. package/dist/attributes/properties/typed.js.map +1 -1
  73. package/dist/attributes/render3d/orbit.d.ts +8 -8
  74. package/dist/attributes/render3d/orbit.js +7 -7
  75. package/dist/attributes/render3d/orbit.js.map +1 -1
  76. package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
  77. package/dist/attributes/shape/corners/corner-style.js.map +1 -1
  78. package/dist/attributes/shape/corners/corners.js.map +1 -1
  79. package/dist/attributes/shape/corners/index.js.map +1 -1
  80. package/dist/attributes/shape/effects/backdrop.d.ts +4 -4
  81. package/dist/attributes/shape/effects/backdrop.d.ts.map +1 -1
  82. package/dist/attributes/shape/effects/backdrop.js.map +1 -1
  83. package/dist/attributes/shape/effects/chain.d.ts +28 -120
  84. package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
  85. package/dist/attributes/shape/effects/chain.js +16 -88
  86. package/dist/attributes/shape/effects/chain.js.map +1 -1
  87. package/dist/attributes/shape/effects/effect-data.js.map +1 -1
  88. package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
  89. package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
  90. package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
  91. package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
  92. package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
  93. package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
  94. package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
  95. package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +2 -2
  96. package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
  97. package/dist/attributes/shape/effects/implementations/curves.d.ts +1 -1
  98. package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
  99. package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
  100. package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
  101. package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
  102. package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
  103. package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
  104. package/dist/attributes/shape/effects/implementations/glass.d.ts +15 -24
  105. package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
  106. package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
  107. package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
  108. package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
  109. package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
  110. package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
  111. package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
  112. package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
  113. package/dist/attributes/shape/effects/implementations/lut.d.ts +1 -1
  114. package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
  115. package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
  116. package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
  117. package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
  118. package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
  119. package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
  120. package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
  121. package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
  122. package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
  123. package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
  124. package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
  125. package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
  126. package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
  127. package/dist/attributes/shape/effects/implementations/shader.js +15 -8
  128. package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
  129. package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
  130. package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
  131. package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
  132. package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
  133. package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
  134. package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
  135. package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
  136. package/dist/attributes/shape/effects/index.d.ts +2 -6
  137. package/dist/attributes/shape/effects/index.d.ts.map +1 -1
  138. package/dist/attributes/shape/effects/index.js.map +1 -1
  139. package/dist/attributes/shape/effects/registry.d.ts +23 -6
  140. package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
  141. package/dist/attributes/shape/effects/registry.js +44 -10
  142. package/dist/attributes/shape/effects/registry.js.map +1 -1
  143. package/dist/attributes/shape/effects/union.d.ts +2 -6
  144. package/dist/attributes/shape/effects/union.d.ts.map +1 -1
  145. package/dist/attributes/shape/effects/union.js.map +1 -1
  146. package/dist/attributes/shape/fill/blend.js.map +1 -1
  147. package/dist/attributes/shape/fill/chain.js.map +1 -1
  148. package/dist/attributes/shape/fill/coerce.js.map +1 -1
  149. package/dist/attributes/shape/fill/color/constants.js.map +1 -1
  150. package/dist/attributes/shape/fill/color/parser.d.ts.map +1 -1
  151. package/dist/attributes/shape/fill/color/parser.js +81 -44
  152. package/dist/attributes/shape/fill/color/parser.js.map +1 -1
  153. package/dist/attributes/shape/fill/gradient-stops.d.ts +16 -0
  154. package/dist/attributes/shape/fill/gradient-stops.d.ts.map +1 -0
  155. package/dist/attributes/shape/fill/gradient-stops.js +65 -0
  156. package/dist/attributes/shape/fill/gradient-stops.js.map +1 -0
  157. package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
  158. package/dist/attributes/shape/fill/implementations/color.js.map +1 -1
  159. package/dist/attributes/shape/fill/implementations/conic-gradient.d.ts.map +1 -1
  160. package/dist/attributes/shape/fill/implementations/conic-gradient.js +2 -5
  161. package/dist/attributes/shape/fill/implementations/conic-gradient.js.map +1 -1
  162. package/dist/attributes/shape/fill/implementations/dot-grid.js.map +1 -1
  163. package/dist/attributes/shape/fill/implementations/fractal-noise.d.ts.map +1 -1
  164. package/dist/attributes/shape/fill/implementations/fractal-noise.js +2 -10
  165. package/dist/attributes/shape/fill/implementations/fractal-noise.js.map +1 -1
  166. package/dist/attributes/shape/fill/implementations/grid.js.map +1 -1
  167. package/dist/attributes/shape/fill/implementations/image.d.ts.map +1 -1
  168. package/dist/attributes/shape/fill/implementations/image.js +5 -4
  169. package/dist/attributes/shape/fill/implementations/image.js.map +1 -1
  170. package/dist/attributes/shape/fill/implementations/linear-gradient.d.ts.map +1 -1
  171. package/dist/attributes/shape/fill/implementations/linear-gradient.js +2 -6
  172. package/dist/attributes/shape/fill/implementations/linear-gradient.js.map +1 -1
  173. package/dist/attributes/shape/fill/implementations/noise.js.map +1 -1
  174. package/dist/attributes/shape/fill/implementations/radial-gradient.d.ts.map +1 -1
  175. package/dist/attributes/shape/fill/implementations/radial-gradient.js +2 -5
  176. package/dist/attributes/shape/fill/implementations/radial-gradient.js.map +1 -1
  177. package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
  178. package/dist/attributes/shape/fill/implementations/stripe.js.map +1 -1
  179. package/dist/attributes/shape/fill/implementations/video.js +1 -1
  180. package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
  181. package/dist/attributes/shape/fill/index.js.map +1 -1
  182. package/dist/attributes/shape/fill/lerp.js.map +1 -1
  183. package/dist/attributes/shape/fill/media-preset.js.map +1 -1
  184. package/dist/attributes/shape/fill/registry.js.map +1 -1
  185. package/dist/attributes/shape/fill/union.js.map +1 -1
  186. package/dist/attributes/shape/filters/chain.d.ts +4 -10
  187. package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
  188. package/dist/attributes/shape/filters/chain.js +1 -13
  189. package/dist/attributes/shape/filters/chain.js.map +1 -1
  190. package/dist/attributes/shape/filters/implementations/alpha.js.map +1 -1
  191. package/dist/attributes/shape/filters/implementations/blur.js.map +1 -1
  192. package/dist/attributes/shape/filters/implementations/color-adjustment.js.map +1 -1
  193. package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
  194. package/dist/attributes/shape/filters/implementations/curves.js.map +1 -1
  195. package/dist/attributes/shape/filters/implementations/echo.js.map +1 -1
  196. package/dist/attributes/shape/filters/implementations/exposure.js.map +1 -1
  197. package/dist/attributes/shape/filters/implementations/grayscale.js.map +1 -1
  198. package/dist/attributes/shape/filters/implementations/posterize-time.js.map +1 -1
  199. package/dist/attributes/shape/filters/index.d.ts +1 -1
  200. package/dist/attributes/shape/filters/index.js.map +1 -1
  201. package/dist/attributes/shape/filters/registry.d.ts +2 -2
  202. package/dist/attributes/shape/filters/registry.js +3 -3
  203. package/dist/attributes/shape/filters/registry.js.map +1 -1
  204. package/dist/attributes/shape/filters/union.d.ts +6 -7
  205. package/dist/attributes/shape/filters/union.d.ts.map +1 -1
  206. package/dist/attributes/shape/filters/union.js.map +1 -1
  207. package/dist/attributes/shape/path/anchors.d.ts.map +1 -1
  208. package/dist/attributes/shape/path/anchors.js +12 -5
  209. package/dist/attributes/shape/path/anchors.js.map +1 -1
  210. package/dist/attributes/shape/path/bezier.js.map +1 -1
  211. package/dist/attributes/shape/path/index.js.map +1 -1
  212. package/dist/attributes/shape/path/measure.js.map +1 -1
  213. package/dist/attributes/shape/path/morph.d.ts.map +1 -1
  214. package/dist/attributes/shape/path/morph.js +16 -4
  215. package/dist/attributes/shape/path/morph.js.map +1 -1
  216. package/dist/attributes/shape/path/ops.js.map +1 -1
  217. package/dist/attributes/shape/path/types.js.map +1 -1
  218. package/dist/attributes/shape/path/walk.js.map +1 -1
  219. package/dist/attributes/shape/shaders/index.js.map +1 -1
  220. package/dist/attributes/shape/shaders/pack.js.map +1 -1
  221. package/dist/attributes/shape/shaders/resolve.js.map +1 -1
  222. package/dist/attributes/shape/shadow/index.js.map +1 -1
  223. package/dist/attributes/shape/shadow/shadow.js.map +1 -1
  224. package/dist/attributes/shape/stroke/index.d.ts +2 -2
  225. package/dist/attributes/shape/stroke/index.d.ts.map +1 -1
  226. package/dist/attributes/shape/stroke/index.js +1 -1
  227. package/dist/attributes/shape/stroke/index.js.map +1 -1
  228. package/dist/attributes/shape/stroke/stroke.d.ts +27 -6
  229. package/dist/attributes/shape/stroke/stroke.d.ts.map +1 -1
  230. package/dist/attributes/shape/stroke/stroke.js +22 -2
  231. package/dist/attributes/shape/stroke/stroke.js.map +1 -1
  232. package/dist/attributes/shared/operators.js.map +1 -1
  233. package/dist/attributes/text/index.js.map +1 -1
  234. package/dist/attributes/text/ops.d.ts +6 -0
  235. package/dist/attributes/text/ops.d.ts.map +1 -1
  236. package/dist/attributes/text/ops.js +1 -0
  237. package/dist/attributes/text/ops.js.map +1 -1
  238. package/dist/attributes/text/types.js.map +1 -1
  239. package/dist/browser/chunks/chunk-2RIYH36X.js +3 -0
  240. package/dist/browser/chunks/chunk-2RIYH36X.js.map +7 -0
  241. package/dist/browser/chunks/chunk-DDJN3QII.js +15 -0
  242. package/dist/browser/chunks/chunk-DDJN3QII.js.map +7 -0
  243. package/dist/browser/chunks/chunk-DHB4COFY.js +2 -0
  244. package/dist/browser/chunks/chunk-DHB4COFY.js.map +7 -0
  245. package/dist/browser/chunks/chunk-EJDPYDQI.js +5 -0
  246. package/dist/browser/chunks/chunk-EJDPYDQI.js.map +7 -0
  247. package/dist/browser/chunks/chunk-SFNJRPBV.js +2 -0
  248. package/dist/browser/chunks/chunk-SFNJRPBV.js.map +7 -0
  249. package/dist/browser/chunks/chunk-XAWE4EAK.js +2 -0
  250. package/dist/browser/chunks/chunk-XAWE4EAK.js.map +7 -0
  251. package/dist/browser/component.js +1 -1
  252. package/dist/browser/component.js.map +4 -4
  253. package/dist/browser/experimental.js +2 -0
  254. package/dist/browser/experimental.js.map +7 -0
  255. package/dist/browser/index.js +1 -1
  256. package/dist/browser/index.js.map +4 -4
  257. package/dist/browser/jsx-jsx-dev-runtime.js +1 -1
  258. package/dist/browser/jsx-jsx-runtime.js +1 -1
  259. package/dist/browser/manifest.json +4 -2
  260. package/dist/browser/sdk.js +1 -1
  261. package/dist/component/api.d.ts +508 -0
  262. package/dist/component/api.d.ts.map +1 -0
  263. package/dist/component/api.js +4 -0
  264. package/dist/component/api.js.map +1 -0
  265. package/dist/component/builtins/audio.d.ts +26 -0
  266. package/dist/component/builtins/audio.d.ts.map +1 -0
  267. package/dist/component/builtins/audio.js +41 -0
  268. package/dist/component/builtins/audio.js.map +1 -0
  269. package/dist/component/builtins/canvas3d.d.ts +98 -0
  270. package/dist/component/builtins/canvas3d.d.ts.map +1 -0
  271. package/dist/component/builtins/canvas3d.js +21 -0
  272. package/dist/component/builtins/canvas3d.js.map +1 -0
  273. package/dist/component/builtins/composite.d.ts +56 -0
  274. package/dist/component/builtins/composite.d.ts.map +1 -0
  275. package/dist/component/builtins/composite.js +25 -0
  276. package/dist/component/builtins/composite.js.map +1 -0
  277. package/dist/component/builtins/geometry.d.ts +505 -0
  278. package/dist/component/builtins/geometry.d.ts.map +1 -0
  279. package/dist/component/builtins/geometry.js +107 -0
  280. package/dist/component/builtins/geometry.js.map +1 -0
  281. package/dist/component/builtins/layout.d.ts +88 -0
  282. package/dist/component/builtins/layout.d.ts.map +1 -0
  283. package/dist/component/builtins/layout.js +84 -0
  284. package/dist/component/builtins/layout.js.map +1 -0
  285. package/dist/component/builtins/media.d.ts +95 -0
  286. package/dist/component/builtins/media.d.ts.map +1 -0
  287. package/dist/component/builtins/media.js +149 -0
  288. package/dist/component/builtins/media.js.map +1 -0
  289. package/dist/component/builtins/providers.d.ts +23 -0
  290. package/dist/component/builtins/providers.d.ts.map +1 -0
  291. package/dist/component/builtins/providers.js +30 -0
  292. package/dist/component/builtins/providers.js.map +1 -0
  293. package/dist/component/builtins/text.d.ts +193 -0
  294. package/dist/component/builtins/text.d.ts.map +1 -0
  295. package/dist/component/builtins/text.js +113 -0
  296. package/dist/component/builtins/text.js.map +1 -0
  297. package/dist/component/builtins/three.d.ts +1085 -0
  298. package/dist/component/builtins/three.d.ts.map +1 -0
  299. package/dist/component/builtins/three.js +265 -0
  300. package/dist/component/builtins/three.js.map +1 -0
  301. package/dist/component/clip-of.d.ts +5 -0
  302. package/dist/component/clip-of.d.ts.map +1 -0
  303. package/dist/component/clip-of.js +33 -0
  304. package/dist/component/clip-of.js.map +1 -0
  305. package/dist/component/commands-for.d.ts +19 -0
  306. package/dist/component/commands-for.d.ts.map +1 -0
  307. package/dist/component/commands-for.js +5 -0
  308. package/dist/component/commands-for.js.map +1 -0
  309. package/dist/component/component-audio.d.ts +9 -0
  310. package/dist/component/component-audio.d.ts.map +1 -0
  311. package/dist/component/component-audio.js +18 -0
  312. package/dist/component/component-audio.js.map +1 -0
  313. package/dist/component/component2d.d.ts +9 -0
  314. package/dist/component/component2d.d.ts.map +1 -0
  315. package/dist/component/component2d.js +239 -0
  316. package/dist/component/component2d.js.map +1 -0
  317. package/dist/component/component3d.d.ts +9 -0
  318. package/dist/component/component3d.d.ts.map +1 -0
  319. package/dist/component/component3d.js +99 -0
  320. package/dist/component/component3d.js.map +1 -0
  321. package/dist/component/factory.d.ts +63 -0
  322. package/dist/component/factory.d.ts.map +1 -0
  323. package/dist/component/factory.js +313 -0
  324. package/dist/component/factory.js.map +1 -0
  325. package/dist/component/modules/aim.d.ts +30 -0
  326. package/dist/component/modules/aim.d.ts.map +1 -0
  327. package/dist/component/modules/aim.js +39 -0
  328. package/dist/component/modules/aim.js.map +1 -0
  329. package/dist/component/modules/corners.d.ts +13 -0
  330. package/dist/component/modules/corners.d.ts.map +1 -0
  331. package/dist/component/modules/corners.js +12 -0
  332. package/dist/component/modules/corners.js.map +1 -0
  333. package/dist/component/modules/flow.d.ts +26 -0
  334. package/dist/component/modules/flow.d.ts.map +1 -0
  335. package/dist/component/modules/flow.js +55 -0
  336. package/dist/component/modules/flow.js.map +1 -0
  337. package/dist/component/modules/material.d.ts +40 -0
  338. package/dist/component/modules/material.d.ts.map +1 -0
  339. package/dist/component/modules/material.js +75 -0
  340. package/dist/component/modules/material.js.map +1 -0
  341. package/dist/component/modules/paint.d.ts +71 -0
  342. package/dist/component/modules/paint.d.ts.map +1 -0
  343. package/dist/component/modules/paint.js +106 -0
  344. package/dist/component/modules/paint.js.map +1 -0
  345. package/dist/component/modules/shapes.d.ts +31 -0
  346. package/dist/component/modules/shapes.d.ts.map +1 -0
  347. package/dist/component/modules/shapes.js +43 -0
  348. package/dist/component/modules/shapes.js.map +1 -0
  349. package/dist/component/modules/text-layout.d.ts +26 -0
  350. package/dist/component/modules/text-layout.d.ts.map +1 -0
  351. package/dist/component/modules/text-layout.js +57 -0
  352. package/dist/component/modules/text-layout.js.map +1 -0
  353. package/dist/component/modules/text-style.d.ts +48 -0
  354. package/dist/component/modules/text-style.d.ts.map +1 -0
  355. package/dist/component/modules/text-style.js +63 -0
  356. package/dist/component/modules/text-style.js.map +1 -0
  357. package/dist/component/modules/three-entries.d.ts +23 -0
  358. package/dist/component/modules/three-entries.d.ts.map +1 -0
  359. package/dist/component/modules/three-entries.js +41 -0
  360. package/dist/component/modules/three-entries.js.map +1 -0
  361. package/dist/component/modules/view3d.d.ts +55 -0
  362. package/dist/component/modules/view3d.d.ts.map +1 -0
  363. package/dist/component/modules/view3d.js +160 -0
  364. package/dist/component/modules/view3d.js.map +1 -0
  365. package/dist/component/timeline.d.ts +22 -0
  366. package/dist/component/timeline.d.ts.map +1 -0
  367. package/dist/component/timeline.js +128 -0
  368. package/dist/component/timeline.js.map +1 -0
  369. package/dist/component/type-def.d.ts +26 -0
  370. package/dist/component/type-def.d.ts.map +1 -0
  371. package/dist/component/type-def.js +16 -0
  372. package/dist/component/type-def.js.map +1 -0
  373. package/dist/component/types.d.ts +91 -0
  374. package/dist/component/types.d.ts.map +1 -0
  375. package/dist/component/types.js +88 -0
  376. package/dist/component/types.js.map +1 -0
  377. package/dist/component/views.d.ts +121 -0
  378. package/dist/component/views.d.ts.map +1 -0
  379. package/dist/component/views.js +413 -0
  380. package/dist/component/views.js.map +1 -0
  381. package/dist/component.d.ts +4 -5
  382. package/dist/component.d.ts.map +1 -1
  383. package/dist/component.js +3 -5
  384. package/dist/component.js.map +1 -1
  385. package/dist/document/audio.d.ts +10 -2
  386. package/dist/document/audio.d.ts.map +1 -1
  387. package/dist/document/audio.js +45 -4
  388. package/dist/document/audio.js.map +1 -1
  389. package/dist/document/builtins.d.ts.map +1 -1
  390. package/dist/document/builtins.js +15 -39
  391. package/dist/document/builtins.js.map +1 -1
  392. package/dist/document/command-traits.d.ts +1 -1
  393. package/dist/document/command-traits.js +16 -1
  394. package/dist/document/command-traits.js.map +1 -1
  395. package/dist/document/deny-globals.js.map +1 -1
  396. package/dist/document/diff.d.ts.map +1 -1
  397. package/dist/document/diff.js +3 -3
  398. package/dist/document/diff.js.map +1 -1
  399. package/dist/document/doc-index.d.ts +2 -2
  400. package/dist/document/doc-index.d.ts.map +1 -1
  401. package/dist/document/doc-index.js +3 -3
  402. package/dist/document/doc-index.js.map +1 -1
  403. package/dist/document/expression/compile.d.ts.map +1 -1
  404. package/dist/document/expression/compile.js +8 -5
  405. package/dist/document/expression/compile.js.map +1 -1
  406. package/dist/document/expression/index.js.map +1 -1
  407. package/dist/document/expression/ops.js +1 -1
  408. package/dist/document/expression/ops.js.map +1 -1
  409. package/dist/document/expression/parse.d.ts.map +1 -1
  410. package/dist/document/expression/parse.js +15 -6
  411. package/dist/document/expression/parse.js.map +1 -1
  412. package/dist/document/expression/refs.d.ts +1 -1
  413. package/dist/document/expression/refs.js +1 -1
  414. package/dist/document/expression/refs.js.map +1 -1
  415. package/dist/document/expression/types.js.map +1 -1
  416. package/dist/document/expression/walk.d.ts.map +1 -1
  417. package/dist/document/expression/walk.js +2 -1
  418. package/dist/document/expression/walk.js.map +1 -1
  419. package/dist/document/index.d.ts +2 -0
  420. package/dist/document/index.d.ts.map +1 -1
  421. package/dist/document/index.js +2 -0
  422. package/dist/document/index.js.map +1 -1
  423. package/dist/document/node-decorator.js.map +1 -1
  424. package/dist/document/node-descriptor.d.ts +25 -0
  425. package/dist/document/node-descriptor.d.ts.map +1 -1
  426. package/dist/document/node-descriptor.js.map +1 -1
  427. package/dist/document/placement.d.ts +70 -0
  428. package/dist/document/placement.d.ts.map +1 -0
  429. package/dist/document/placement.js +83 -0
  430. package/dist/document/placement.js.map +1 -0
  431. package/dist/document/project.d.ts +2 -2
  432. package/dist/document/project.d.ts.map +1 -1
  433. package/dist/document/project.js.map +1 -1
  434. package/dist/document/registry.d.ts +23 -11
  435. package/dist/document/registry.d.ts.map +1 -1
  436. package/dist/document/registry.js +46 -19
  437. package/dist/document/registry.js.map +1 -1
  438. package/dist/document/settled-index.d.ts +49 -0
  439. package/dist/document/settled-index.d.ts.map +1 -0
  440. package/dist/document/settled-index.js +247 -0
  441. package/dist/document/settled-index.js.map +1 -0
  442. package/dist/document/timeline-patch.js.map +1 -1
  443. package/dist/document/timeline.d.ts +100 -19
  444. package/dist/document/timeline.d.ts.map +1 -1
  445. package/dist/document/timeline.js +290 -42
  446. package/dist/document/timeline.js.map +1 -1
  447. package/dist/document/types.d.ts +12 -12
  448. package/dist/document/types.d.ts.map +1 -1
  449. package/dist/document/types.js +2 -2
  450. package/dist/document/types.js.map +1 -1
  451. package/dist/document/validate.d.ts +2 -2
  452. package/dist/document/validate.d.ts.map +1 -1
  453. package/dist/document/validate.js +37 -31
  454. package/dist/document/validate.js.map +1 -1
  455. package/dist/document/withdraw.d.ts +28 -0
  456. package/dist/document/withdraw.d.ts.map +1 -0
  457. package/dist/document/withdraw.js +61 -0
  458. package/dist/document/withdraw.js.map +1 -0
  459. package/dist/experimental.d.ts +22 -0
  460. package/dist/experimental.d.ts.map +1 -0
  461. package/dist/experimental.js +20 -0
  462. package/dist/experimental.js.map +1 -0
  463. package/dist/index.d.ts +10 -0
  464. package/dist/index.d.ts.map +1 -1
  465. package/dist/index.js +10 -0
  466. package/dist/index.js.map +1 -1
  467. package/dist/jsx/jsx-dev-runtime.js.map +1 -1
  468. package/dist/jsx/jsx-runtime.d.ts +9 -1
  469. package/dist/jsx/jsx-runtime.d.ts.map +1 -1
  470. package/dist/jsx/jsx-runtime.js +13 -3
  471. package/dist/jsx/jsx-runtime.js.map +1 -1
  472. package/dist/layout/bounds.d.ts +0 -1
  473. package/dist/layout/bounds.d.ts.map +1 -1
  474. package/dist/layout/bounds.js.map +1 -1
  475. package/dist/layout/constraints.js.map +1 -1
  476. package/dist/layout/flex.d.ts +4 -2
  477. package/dist/layout/flex.d.ts.map +1 -1
  478. package/dist/layout/flex.js +27 -11
  479. package/dist/layout/flex.js.map +1 -1
  480. package/dist/layout/freeform.js.map +1 -1
  481. package/dist/layout/grid.js.map +1 -1
  482. package/dist/layout/index.js.map +1 -1
  483. package/dist/layout/item.js.map +1 -1
  484. package/dist/layout/ops.d.ts +6 -0
  485. package/dist/layout/ops.d.ts.map +1 -1
  486. package/dist/layout/ops.js +6 -0
  487. package/dist/layout/ops.js.map +1 -1
  488. package/dist/layout/types.js.map +1 -1
  489. package/dist/nodes/2d/node-lifecycle.js.map +1 -1
  490. package/dist/nodes/2d/node-motion.js.map +1 -1
  491. package/dist/nodes/2d/node-render.d.ts +3 -3
  492. package/dist/nodes/2d/node-render.d.ts.map +1 -1
  493. package/dist/nodes/2d/node-render.js.map +1 -1
  494. package/dist/nodes/2d/node-transform.js.map +1 -1
  495. package/dist/nodes/2d/node2d.d.ts +115 -3
  496. package/dist/nodes/2d/node2d.d.ts.map +1 -1
  497. package/dist/nodes/2d/node2d.js +180 -28
  498. package/dist/nodes/2d/node2d.js.map +1 -1
  499. package/dist/nodes/2d/paint-node.d.ts +27 -0
  500. package/dist/nodes/2d/paint-node.d.ts.map +1 -1
  501. package/dist/nodes/2d/paint-node.js +42 -0
  502. package/dist/nodes/2d/paint-node.js.map +1 -1
  503. package/dist/nodes/audio/audio-bus.js.map +1 -1
  504. package/dist/nodes/audio/index.d.ts +2 -2
  505. package/dist/nodes/audio/index.d.ts.map +1 -1
  506. package/dist/nodes/audio/index.js +0 -2
  507. package/dist/nodes/audio/index.js.map +1 -1
  508. package/dist/nodes/audio/node-audio.js.map +1 -1
  509. package/dist/nodes/audio/sound-node.d.ts +4 -3
  510. package/dist/nodes/audio/sound-node.d.ts.map +1 -1
  511. package/dist/nodes/audio/sound-node.js +4 -1
  512. package/dist/nodes/audio/sound-node.js.map +1 -1
  513. package/dist/nodes/geometry/bounds-shape-node.d.ts +4 -4
  514. package/dist/nodes/geometry/bounds-shape-node.js +2 -2
  515. package/dist/nodes/geometry/bounds-shape-node.js.map +1 -1
  516. package/dist/nodes/geometry/box-path-node.d.ts +3 -3
  517. package/dist/nodes/geometry/box-path-node.js +2 -2
  518. package/dist/nodes/geometry/box-path-node.js.map +1 -1
  519. package/dist/nodes/geometry/ellipse-node.js.map +1 -1
  520. package/dist/nodes/geometry/group-bounds.d.ts +2 -2
  521. package/dist/nodes/geometry/group-bounds.d.ts.map +1 -1
  522. package/dist/nodes/geometry/group-bounds.js +1 -2
  523. package/dist/nodes/geometry/group-bounds.js.map +1 -1
  524. package/dist/nodes/geometry/path-node.d.ts.map +1 -1
  525. package/dist/nodes/geometry/path-node.js +6 -0
  526. package/dist/nodes/geometry/path-node.js.map +1 -1
  527. package/dist/nodes/geometry/polygon-node.js.map +1 -1
  528. package/dist/nodes/geometry/polygram-node.js.map +1 -1
  529. package/dist/nodes/geometry/rect-node.js.map +1 -1
  530. package/dist/nodes/geometry/shape-node.js.map +1 -1
  531. package/dist/nodes/geometry/shape-outline.d.ts +2 -2
  532. package/dist/nodes/geometry/shape-outline.d.ts.map +1 -1
  533. package/dist/nodes/geometry/shape-outline.js +2 -13
  534. package/dist/nodes/geometry/shape-outline.js.map +1 -1
  535. package/dist/nodes/index.d.ts +40 -33
  536. package/dist/nodes/index.d.ts.map +1 -1
  537. package/dist/nodes/index.js +17 -36
  538. package/dist/nodes/index.js.map +1 -1
  539. package/dist/nodes/layout/camera-node.d.ts +9 -0
  540. package/dist/nodes/layout/camera-node.d.ts.map +1 -1
  541. package/dist/nodes/layout/camera-node.js +38 -3
  542. package/dist/nodes/layout/camera-node.js.map +1 -1
  543. package/dist/nodes/layout/orbit-camera-node.d.ts +1 -1
  544. package/dist/nodes/layout/orbit-camera-node.js +1 -1
  545. package/dist/nodes/layout/orbit-camera-node.js.map +1 -1
  546. package/dist/nodes/layout/rotated-box.js.map +1 -1
  547. package/dist/nodes/media/video-node.d.ts.map +1 -1
  548. package/dist/nodes/media/video-node.js +2 -0
  549. package/dist/nodes/media/video-node.js.map +1 -1
  550. package/dist/nodes/node/declare-paints.js.map +1 -1
  551. package/dist/nodes/node/node-editor-state.js.map +1 -1
  552. package/dist/nodes/node/node-reactive.js.map +1 -1
  553. package/dist/nodes/node/node-time.d.ts +3 -3
  554. package/dist/nodes/node/node-time.d.ts.map +1 -1
  555. package/dist/nodes/node/node-time.js +1 -1
  556. package/dist/nodes/node/node-time.js.map +1 -1
  557. package/dist/nodes/node/node-walk.js.map +1 -1
  558. package/dist/nodes/node/node.d.ts +12 -4
  559. package/dist/nodes/node/node.d.ts.map +1 -1
  560. package/dist/nodes/node/node.js +67 -27
  561. package/dist/nodes/node/node.js.map +1 -1
  562. package/dist/nodes/node/text-defaults.d.ts +10 -12
  563. package/dist/nodes/node/text-defaults.d.ts.map +1 -1
  564. package/dist/nodes/node/text-defaults.js +10 -12
  565. package/dist/nodes/node/text-defaults.js.map +1 -1
  566. package/dist/nodes/{scene → root}/canvas2d-node.d.ts +4 -3
  567. package/dist/nodes/root/canvas2d-node.d.ts.map +1 -0
  568. package/dist/nodes/{scene → root}/canvas2d-node.js +5 -2
  569. package/dist/nodes/root/canvas2d-node.js.map +1 -0
  570. package/dist/nodes/root/provider-node.d.ts.map +1 -0
  571. package/dist/nodes/root/provider-node.js.map +1 -0
  572. package/dist/nodes/root/theme-provider-node.d.ts.map +1 -0
  573. package/dist/nodes/root/theme-provider-node.js.map +1 -0
  574. package/dist/nodes/text/default-text-style-node.d.ts +5 -2
  575. package/dist/nodes/text/default-text-style-node.d.ts.map +1 -1
  576. package/dist/nodes/text/default-text-style-node.js +10 -4
  577. package/dist/nodes/text/default-text-style-node.js.map +1 -1
  578. package/dist/nodes/text/number-format.d.ts +1 -1
  579. package/dist/nodes/text/number-format.js +1 -1
  580. package/dist/nodes/text/number-format.js.map +1 -1
  581. package/dist/nodes/text/number-node.js.map +1 -1
  582. package/dist/nodes/text/number-pattern.js.map +1 -1
  583. package/dist/nodes/text/richtext-node.d.ts +0 -5
  584. package/dist/nodes/text/richtext-node.d.ts.map +1 -1
  585. package/dist/nodes/text/richtext-node.js +6 -72
  586. package/dist/nodes/text/richtext-node.js.map +1 -1
  587. package/dist/nodes/text/text-base.d.ts +5 -22
  588. package/dist/nodes/text/text-base.d.ts.map +1 -1
  589. package/dist/nodes/text/text-base.js +13 -364
  590. package/dist/nodes/text/text-base.js.map +1 -1
  591. package/dist/nodes/text/text-layout.d.ts +87 -0
  592. package/dist/nodes/text/text-layout.d.ts.map +1 -0
  593. package/dist/nodes/text/text-layout.js +368 -0
  594. package/dist/nodes/text/text-layout.js.map +1 -0
  595. package/dist/nodes/text/text-node.js.map +1 -1
  596. package/dist/nodes/text/text-selection.js.map +1 -1
  597. package/dist/nodes/three/camera-nodes.d.ts +21 -3
  598. package/dist/nodes/three/camera-nodes.d.ts.map +1 -1
  599. package/dist/nodes/three/camera-nodes.js +42 -1
  600. package/dist/nodes/three/camera-nodes.js.map +1 -1
  601. package/dist/nodes/three/canvas3d-node.d.ts +32 -7
  602. package/dist/nodes/three/canvas3d-node.d.ts.map +1 -1
  603. package/dist/nodes/three/canvas3d-node.js +50 -2
  604. package/dist/nodes/three/canvas3d-node.js.map +1 -1
  605. package/dist/nodes/three/drawable-nodes.d.ts +25 -11
  606. package/dist/nodes/three/drawable-nodes.d.ts.map +1 -1
  607. package/dist/nodes/three/drawable-nodes.js +43 -13
  608. package/dist/nodes/three/drawable-nodes.js.map +1 -1
  609. package/dist/nodes/three/environment-nodes.d.ts +9 -3
  610. package/dist/nodes/three/environment-nodes.d.ts.map +1 -1
  611. package/dist/nodes/three/environment-nodes.js.map +1 -1
  612. package/dist/nodes/three/geometry-nodes.d.ts +2 -2
  613. package/dist/nodes/three/geometry-nodes.js +2 -2
  614. package/dist/nodes/three/geometry-nodes.js.map +1 -1
  615. package/dist/nodes/three/grid-geometry3d.js.map +1 -1
  616. package/dist/nodes/three/group3d.js.map +1 -1
  617. package/dist/nodes/three/light-nodes.d.ts.map +1 -1
  618. package/dist/nodes/three/light-nodes.js +3 -3
  619. package/dist/nodes/three/light-nodes.js.map +1 -1
  620. package/dist/nodes/three/mesh3d.js.map +1 -1
  621. package/dist/nodes/three/node3d.d.ts +48 -0
  622. package/dist/nodes/three/node3d.d.ts.map +1 -1
  623. package/dist/nodes/three/node3d.js +53 -3
  624. package/dist/nodes/three/node3d.js.map +1 -1
  625. package/dist/platform/audio-sink.d.ts +2 -2
  626. package/dist/platform/audio-sink.d.ts.map +1 -1
  627. package/dist/platform/audio-sink.js.map +1 -1
  628. package/dist/platform/exporter.d.ts +13 -8
  629. package/dist/platform/exporter.d.ts.map +1 -1
  630. package/dist/platform/exporter.js.map +1 -1
  631. package/dist/platform/index.d.ts +1 -1
  632. package/dist/platform/index.d.ts.map +1 -1
  633. package/dist/platform/index.js.map +1 -1
  634. package/dist/platform/stepped-clock.js.map +1 -1
  635. package/dist/platform/storage-adapter.d.ts +12 -6
  636. package/dist/platform/storage-adapter.d.ts.map +1 -1
  637. package/dist/platform/storage-adapter.js +4 -0
  638. package/dist/platform/storage-adapter.js.map +1 -1
  639. package/dist/platform/ticker.d.ts +6 -0
  640. package/dist/platform/ticker.d.ts.map +1 -1
  641. package/dist/platform/ticker.js +6 -0
  642. package/dist/platform/ticker.js.map +1 -1
  643. package/dist/project/config.js.map +1 -1
  644. package/dist/project/index.js.map +1 -1
  645. package/dist/project/tree.d.ts +3 -3
  646. package/dist/project/tree.d.ts.map +1 -1
  647. package/dist/project/tree.js.map +1 -1
  648. package/dist/props/host.js.map +1 -1
  649. package/dist/props/index.js.map +1 -1
  650. package/dist/props/observer.js.map +1 -1
  651. package/dist/props/slot.js.map +1 -1
  652. package/dist/renamed-scene-names.d.ts +17 -0
  653. package/dist/renamed-scene-names.d.ts.map +1 -0
  654. package/dist/renamed-scene-names.js +9 -0
  655. package/dist/renamed-scene-names.js.map +1 -0
  656. package/dist/render/canvas-render-context2d.d.ts +2 -2
  657. package/dist/render/canvas-render-context2d.d.ts.map +1 -1
  658. package/dist/render/canvas-render-context2d.js.map +1 -1
  659. package/dist/render/clip-contains.js.map +1 -1
  660. package/dist/render/clip.js.map +1 -1
  661. package/dist/render/descriptors/ellipse.js.map +1 -1
  662. package/dist/render/descriptors/latex.js.map +1 -1
  663. package/dist/render/descriptors/line.js.map +1 -1
  664. package/dist/render/descriptors/path-builder.js.map +1 -1
  665. package/dist/render/descriptors/path.js.map +1 -1
  666. package/dist/render/descriptors/polygon.js.map +1 -1
  667. package/dist/render/descriptors/polygram.js.map +1 -1
  668. package/dist/render/descriptors/rect.js.map +1 -1
  669. package/dist/render/descriptors/richtext.js.map +1 -1
  670. package/dist/render/descriptors/shape.d.ts +12 -0
  671. package/dist/render/descriptors/shape.d.ts.map +1 -1
  672. package/dist/render/descriptors/shape.js.map +1 -1
  673. package/dist/render/descriptors/text.d.ts +2 -2
  674. package/dist/render/descriptors/text.js +2 -2
  675. package/dist/render/descriptors/text.js.map +1 -1
  676. package/dist/render/descriptors/transform.d.ts +2 -2
  677. package/dist/render/descriptors/transform.d.ts.map +1 -1
  678. package/dist/render/descriptors/transform.js.map +1 -1
  679. package/dist/render/graphics2d.d.ts +3 -3
  680. package/dist/render/graphics2d.d.ts.map +1 -1
  681. package/dist/render/graphics2d.js +1 -1
  682. package/dist/render/graphics2d.js.map +1 -1
  683. package/dist/render/index.js.map +1 -1
  684. package/dist/render/measure-context.js.map +1 -1
  685. package/dist/render/null-render-context.js.map +1 -1
  686. package/dist/render/render-context2d.d.ts +2 -2
  687. package/dist/render/render-context2d.d.ts.map +1 -1
  688. package/dist/render/render-context2d.js.map +1 -1
  689. package/dist/render/surface.js.map +1 -1
  690. package/dist/render/text-defaults.js.map +1 -1
  691. package/dist/render/text-layout.js.map +1 -1
  692. package/dist/render3d/bounds3d.d.ts.map +1 -1
  693. package/dist/render3d/bounds3d.js +4 -2
  694. package/dist/render3d/bounds3d.js.map +1 -1
  695. package/dist/render3d/builders.js.map +1 -1
  696. package/dist/render3d/camera.d.ts +6 -0
  697. package/dist/render3d/camera.d.ts.map +1 -1
  698. package/dist/render3d/camera.js +5 -3
  699. package/dist/render3d/camera.js.map +1 -1
  700. package/dist/render3d/fill3d.d.ts +2 -9
  701. package/dist/render3d/fill3d.d.ts.map +1 -1
  702. package/dist/render3d/fill3d.js +2 -13
  703. package/dist/render3d/fill3d.js.map +1 -1
  704. package/dist/render3d/geometry.d.ts +8 -1
  705. package/dist/render3d/geometry.d.ts.map +1 -1
  706. package/dist/render3d/geometry.js.map +1 -1
  707. package/dist/render3d/graphics3d.d.ts +8 -4
  708. package/dist/render3d/graphics3d.d.ts.map +1 -1
  709. package/dist/render3d/graphics3d.js +18 -10
  710. package/dist/render3d/graphics3d.js.map +1 -1
  711. package/dist/render3d/index.d.ts +1 -1
  712. package/dist/render3d/index.js +1 -1
  713. package/dist/render3d/index.js.map +1 -1
  714. package/dist/render3d/inert.d.ts +14 -0
  715. package/dist/render3d/inert.d.ts.map +1 -0
  716. package/dist/render3d/inert.js +62 -0
  717. package/dist/render3d/inert.js.map +1 -0
  718. package/dist/render3d/light.js.map +1 -1
  719. package/dist/render3d/material.d.ts +10 -5
  720. package/dist/render3d/material.d.ts.map +1 -1
  721. package/dist/render3d/material.js.map +1 -1
  722. package/dist/render3d/matrix4.js.map +1 -1
  723. package/dist/render3d/render-context3d.js.map +1 -1
  724. package/dist/render3d/resources.js.map +1 -1
  725. package/dist/render3d/rounded-box.js.map +1 -1
  726. package/dist/render3d/scene-settings.d.ts +23 -4
  727. package/dist/render3d/scene-settings.d.ts.map +1 -1
  728. package/dist/render3d/scene-settings.js.map +1 -1
  729. package/dist/render3d/scene3d.d.ts +11 -0
  730. package/dist/render3d/scene3d.d.ts.map +1 -1
  731. package/dist/render3d/scene3d.js +39 -6
  732. package/dist/render3d/scene3d.js.map +1 -1
  733. package/dist/render3d/segments.js.map +1 -1
  734. package/dist/render3d/texture.d.ts +9 -0
  735. package/dist/render3d/texture.d.ts.map +1 -1
  736. package/dist/render3d/texture.js +13 -0
  737. package/dist/render3d/texture.js.map +1 -1
  738. package/dist/render3d/tracking.js.map +1 -1
  739. package/dist/render3d/transform.d.ts +1 -1
  740. package/dist/render3d/transform.js.map +1 -1
  741. package/dist/render3d/vector3.d.ts +18 -1
  742. package/dist/render3d/vector3.d.ts.map +1 -1
  743. package/dist/render3d/vector3.js +27 -0
  744. package/dist/render3d/vector3.js.map +1 -1
  745. package/dist/render3d/walk.d.ts +1 -1
  746. package/dist/render3d/walk.d.ts.map +1 -1
  747. package/dist/render3d/walk.js +5 -1
  748. package/dist/render3d/walk.js.map +1 -1
  749. package/dist/runtime/asset-refine.js.map +1 -1
  750. package/dist/runtime/asset-timeline.js.map +1 -1
  751. package/dist/runtime/asset-update.js.map +1 -1
  752. package/dist/runtime/audio-index.js.map +1 -1
  753. package/dist/runtime/builtin-context.js.map +1 -1
  754. package/dist/runtime/clip-instance.d.ts +9 -4
  755. package/dist/runtime/clip-instance.d.ts.map +1 -1
  756. package/dist/runtime/clip-instance.js +27 -9
  757. package/dist/runtime/clip-instance.js.map +1 -1
  758. package/dist/runtime/clip-store.d.ts +18 -0
  759. package/dist/runtime/clip-store.d.ts.map +1 -1
  760. package/dist/runtime/clip-store.js +97 -0
  761. package/dist/runtime/clip-store.js.map +1 -1
  762. package/dist/runtime/engine.d.ts +5 -0
  763. package/dist/runtime/engine.d.ts.map +1 -1
  764. package/dist/runtime/engine.js +2 -0
  765. package/dist/runtime/engine.js.map +1 -1
  766. package/dist/runtime/frame-time.d.ts +31 -0
  767. package/dist/runtime/frame-time.d.ts.map +1 -0
  768. package/dist/runtime/frame-time.js +29 -0
  769. package/dist/runtime/frame-time.js.map +1 -0
  770. package/dist/runtime/index.d.ts +1 -0
  771. package/dist/runtime/index.d.ts.map +1 -1
  772. package/dist/runtime/index.js +1 -0
  773. package/dist/runtime/index.js.map +1 -1
  774. package/dist/runtime/node-picking.d.ts +44 -3
  775. package/dist/runtime/node-picking.d.ts.map +1 -1
  776. package/dist/runtime/node-picking.js +124 -10
  777. package/dist/runtime/node-picking.js.map +1 -1
  778. package/dist/runtime/node-picking3d.d.ts +13 -5
  779. package/dist/runtime/node-picking3d.d.ts.map +1 -1
  780. package/dist/runtime/node-picking3d.js +10 -2
  781. package/dist/runtime/node-picking3d.js.map +1 -1
  782. package/dist/runtime/placement.d.ts.map +1 -1
  783. package/dist/runtime/placement.js +4 -5
  784. package/dist/runtime/placement.js.map +1 -1
  785. package/dist/runtime/playback-controller.d.ts +31 -2
  786. package/dist/runtime/playback-controller.d.ts.map +1 -1
  787. package/dist/runtime/playback-controller.js +63 -6
  788. package/dist/runtime/playback-controller.js.map +1 -1
  789. package/dist/runtime/playback.js.map +1 -1
  790. package/dist/runtime/precompisition.js.map +1 -1
  791. package/dist/runtime/project-assets.js.map +1 -1
  792. package/dist/runtime/session.d.ts +9 -7
  793. package/dist/runtime/session.d.ts.map +1 -1
  794. package/dist/runtime/session.js +12 -4
  795. package/dist/runtime/session.js.map +1 -1
  796. package/dist/runtime/settle.js.map +1 -1
  797. package/dist/runtime/state-evaluator.d.ts +1 -1
  798. package/dist/runtime/state-evaluator.d.ts.map +1 -1
  799. package/dist/runtime/state-evaluator.js +4 -3
  800. package/dist/runtime/state-evaluator.js.map +1 -1
  801. package/dist/runtime/text-geometry.d.ts.map +1 -1
  802. package/dist/runtime/text-geometry.js +7 -3
  803. package/dist/runtime/text-geometry.js.map +1 -1
  804. package/dist/sdk/index.d.ts +50 -25
  805. package/dist/sdk/index.d.ts.map +1 -1
  806. package/dist/sdk/index.js +52 -42
  807. package/dist/sdk/index.js.map +1 -1
  808. package/dist/tween/command-decorator.d.ts +2 -0
  809. package/dist/tween/command-decorator.d.ts.map +1 -1
  810. package/dist/tween/command-decorator.js.map +1 -1
  811. package/dist/tween/command.d.ts +12 -0
  812. package/dist/tween/command.d.ts.map +1 -1
  813. package/dist/tween/command.js +14 -0
  814. package/dist/tween/command.js.map +1 -1
  815. package/dist/tween/ease/constants.d.ts.map +1 -1
  816. package/dist/tween/ease/constants.js +8 -5
  817. package/dist/tween/ease/constants.js.map +1 -1
  818. package/dist/tween/ease/curve.d.ts.map +1 -1
  819. package/dist/tween/ease/curve.js +4 -3
  820. package/dist/tween/ease/curve.js.map +1 -1
  821. package/dist/tween/ease/describe.d.ts +15 -0
  822. package/dist/tween/ease/describe.d.ts.map +1 -0
  823. package/dist/tween/ease/describe.js +37 -0
  824. package/dist/tween/ease/describe.js.map +1 -0
  825. package/dist/tween/ease/type.js.map +1 -1
  826. package/dist/tween/index.js.map +1 -1
  827. package/dist/tween/inert.js.map +1 -1
  828. package/dist/tween/lerp.js.map +1 -1
  829. package/dist/tween/loop.js.map +1 -1
  830. package/dist/tween/prepare.d.ts +3 -3
  831. package/dist/tween/prepare.js +3 -3
  832. package/dist/tween/prepare.js.map +1 -1
  833. package/dist/tween/seekable.d.ts +1 -1
  834. package/dist/tween/seekable.js.map +1 -1
  835. package/dist/tween/stepper.js.map +1 -1
  836. package/dist/tween/to-command.js.map +1 -1
  837. package/dist/util/clamp.js.map +1 -1
  838. package/dist/util/context.js.map +1 -1
  839. package/dist/util/csv.js.map +1 -1
  840. package/dist/util/generateList.js.map +1 -1
  841. package/dist/util/index.js.map +1 -1
  842. package/dist/util/metrics.d.ts +1 -1
  843. package/dist/util/metrics.js +1 -1
  844. package/dist/util/metrics.js.map +1 -1
  845. package/dist/util/random.js.map +1 -1
  846. package/dist/util/reference.js.map +1 -1
  847. package/dist/util/scheduler.js.map +1 -1
  848. package/package.json +7 -1
  849. package/dist/attributes/shape/effects/implementations/displace.d.ts +0 -48
  850. package/dist/attributes/shape/effects/implementations/displace.d.ts.map +0 -1
  851. package/dist/attributes/shape/effects/implementations/displace.js +0 -30
  852. package/dist/attributes/shape/effects/implementations/displace.js.map +0 -1
  853. package/dist/attributes/shape/effects/implementations/god-rays.d.ts +0 -28
  854. package/dist/attributes/shape/effects/implementations/god-rays.d.ts.map +0 -1
  855. package/dist/attributes/shape/effects/implementations/god-rays.js +0 -26
  856. package/dist/attributes/shape/effects/implementations/god-rays.js.map +0 -1
  857. package/dist/attributes/shape/effects/implementations/texture.d.ts +0 -28
  858. package/dist/attributes/shape/effects/implementations/texture.d.ts.map +0 -1
  859. package/dist/attributes/shape/effects/implementations/texture.js +0 -25
  860. package/dist/attributes/shape/effects/implementations/texture.js.map +0 -1
  861. package/dist/attributes/shape/effects/implementations/trails.d.ts +0 -41
  862. package/dist/attributes/shape/effects/implementations/trails.d.ts.map +0 -1
  863. package/dist/attributes/shape/effects/implementations/trails.js +0 -22
  864. package/dist/attributes/shape/effects/implementations/trails.js.map +0 -1
  865. package/dist/browser/chunks/chunk-2T3HXSC2.js +0 -2
  866. package/dist/browser/chunks/chunk-2T3HXSC2.js.map +0 -7
  867. package/dist/browser/chunks/chunk-KJXGRHOL.js +0 -3
  868. package/dist/browser/chunks/chunk-KJXGRHOL.js.map +0 -7
  869. package/dist/browser/chunks/chunk-TGDX2SS2.js +0 -18
  870. package/dist/browser/chunks/chunk-TGDX2SS2.js.map +0 -7
  871. package/dist/nodes/geometry/dot-grid-node.d.ts +0 -105
  872. package/dist/nodes/geometry/dot-grid-node.d.ts.map +0 -1
  873. package/dist/nodes/geometry/dot-grid-node.js +0 -142
  874. package/dist/nodes/geometry/dot-grid-node.js.map +0 -1
  875. package/dist/nodes/geometry/grid-lines.d.ts +0 -101
  876. package/dist/nodes/geometry/grid-lines.d.ts.map +0 -1
  877. package/dist/nodes/geometry/grid-lines.js +0 -128
  878. package/dist/nodes/geometry/grid-lines.js.map +0 -1
  879. package/dist/nodes/geometry/grid-pattern-node.d.ts +0 -58
  880. package/dist/nodes/geometry/grid-pattern-node.d.ts.map +0 -1
  881. package/dist/nodes/geometry/grid-pattern-node.js +0 -172
  882. package/dist/nodes/geometry/grid-pattern-node.js.map +0 -1
  883. package/dist/nodes/geometry/line-grid-node.d.ts +0 -62
  884. package/dist/nodes/geometry/line-grid-node.d.ts.map +0 -1
  885. package/dist/nodes/geometry/line-grid-node.js +0 -127
  886. package/dist/nodes/geometry/line-grid-node.js.map +0 -1
  887. package/dist/nodes/geometry/line-node.d.ts +0 -58
  888. package/dist/nodes/geometry/line-node.d.ts.map +0 -1
  889. package/dist/nodes/geometry/line-node.js +0 -123
  890. package/dist/nodes/geometry/line-node.js.map +0 -1
  891. package/dist/nodes/geometry/viewport-pattern-node.d.ts +0 -39
  892. package/dist/nodes/geometry/viewport-pattern-node.d.ts.map +0 -1
  893. package/dist/nodes/geometry/viewport-pattern-node.js +0 -79
  894. package/dist/nodes/geometry/viewport-pattern-node.js.map +0 -1
  895. package/dist/nodes/scene/canvas2d-node.d.ts.map +0 -1
  896. package/dist/nodes/scene/canvas2d-node.js.map +0 -1
  897. package/dist/nodes/scene/provider-node.d.ts.map +0 -1
  898. package/dist/nodes/scene/provider-node.js.map +0 -1
  899. package/dist/nodes/scene/theme-provider-node.d.ts.map +0 -1
  900. package/dist/nodes/scene/theme-provider-node.js.map +0 -1
  901. /package/dist/nodes/{scene → root}/provider-node.d.ts +0 -0
  902. /package/dist/nodes/{scene → root}/provider-node.js +0 -0
  903. /package/dist/nodes/{scene → root}/theme-provider-node.d.ts +0 -0
  904. /package/dist/nodes/{scene → root}/theme-provider-node.js +0 -0
@@ -1,13 +1,13 @@
1
1
  import type { AssetCatalog } from "../assets/catalog.js";
2
2
  import type { Size2D } from "../attributes/layout/size.js";
3
3
  import type { Registry } from "../document/registry.js";
4
- import { type PlacedCommandInfo } from "../document/timeline.js";
4
+ import { type PlacedCommandInfo, type PlacedSound } from "../document/timeline.js";
5
5
  import type { TimelinePatch } from "../document/timeline-patch.js";
6
6
  import type { PropSlot } from "../props/slot.js";
7
7
  import { type ClipDocument, type NodeSpan } from "../document/types.js";
8
8
  import type { Node } from "../nodes/node/node.js";
9
9
  import { type NodeEditorStates } from "../nodes/node/node-editor-state.js";
10
- import { Canvas2D } from "../nodes/scene/canvas2d-node.js";
10
+ import { Canvas2D } from "../nodes/root/canvas2d-node.js";
11
11
  import type { MeasureContext2D } from "../render/measure-context.js";
12
12
  import type { RenderPass2D } from "../render/render-context2d.js";
13
13
  /** What a clip is built and measured against — the same for every track in a session. */
@@ -34,7 +34,7 @@ export declare class ClipInstance {
34
34
  /** The clip document this instance plays, as handed in — before audio lowering. */
35
35
  get clip(): ClipDocument;
36
36
  /**
37
- * Build the tree, then fix every command against it laid out — see `SceneTimeline.compile`.
37
+ * Build the tree, then fix every command against it laid out — see `ClipTimeline.compile`.
38
38
  * `measurer` stands in for the scope's during the build only.
39
39
  */
40
40
  build(measurer?: MeasureContext2D): void;
@@ -48,8 +48,11 @@ export declare class ClipInstance {
48
48
  /** {@link update}'s plan, for a caller that has to look at the tree before it changes. */
49
49
  planUpdate(next: ClipDocument): TimelinePatch | null;
50
50
  applyUpdate(patch: TimelinePatch, next: ClipDocument, duration: number, measurer?: MeasureContext2D): void;
51
- /** Every command as compiled, with what each writes — see `SceneTimeline.placedCommands`. */
51
+ /** Every command as compiled, with what each writes — see `ClipTimeline.placedCommands`. */
52
52
  placedCommands(): readonly PlacedCommandInfo[];
53
+ commandSounds(): PlacedSound[];
54
+ /** `read`, with the tree's presence as it stands at `seconds`; the presence is put back after. */
55
+ atPresence<T>(seconds: number, read: () => T): T;
53
56
  evaluateAt(seconds: number, onWrite?: (index: number, slot: PropSlot<unknown>) => void): void;
54
57
  attach(seconds: number, editor?: NodeEditorStates): void;
55
58
  layout(measurer?: MeasureContext2D): void;
@@ -58,6 +61,8 @@ export declare class ClipInstance {
58
61
  primeMotion(at: number): void;
59
62
  /** The node a document row built, mounted or not; the canvas for the root. */
60
63
  node(rowId: string): Node | undefined;
64
+ /** What a document row holds before any command acts on it — see `ClipTimeline.baselineProps`. */
65
+ baselineProps(rowId: string): Record<string, unknown> | undefined;
61
66
  /** Every document row's effective span, the root's excepted. */
62
67
  rowSpans(): NodeSpan[];
63
68
  /** One row's effective span — `undefined` for the root, which spans the clip, and for an id no row has. */
@@ -1 +1 @@
1
- {"version":3,"file":"clip-instance.d.ts","sourceRoot":"","sources":["../../src/runtime/clip-instance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAiB,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAIH,KAAK,YAAY,EACjB,KAAK,QAAQ,EAEhB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAqB,KAAK,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAE1F,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAG9D,yFAAyF;AACzF,MAAM,WAAW,YAAY;IACzB,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,EAAE,gBAAgB,CAAC;CAC9B;AAED;;;;;;;GAOG;AACH,qBAAa,YAAY;IAG6B,OAAO,CAAC,QAAQ,C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KAAK,CAAkE;IAExF,OAAO,CAAC,UAAU;IASlB;;;OAGG;IACH,OAAO,CAAC,QAAQ;CASnB"}
@@ -1,9 +1,9 @@
1
- import { loweredAudioDocument } from "../document/audio.js";
2
- import { SceneTimeline } from "../document/timeline.js";
3
- import { effectiveSpans, isAudioDocument, ROOT_NODE_ID, } from "../document/types.js";
1
+ import { clipDocument } from "../document/audio.js";
2
+ import { ClipTimeline } from "../document/timeline.js";
3
+ import { effectiveSpans, ROOT_NODE_ID, } from "../document/types.js";
4
4
  import { applyEditorStates } from "../nodes/node/node-editor-state.js";
5
5
  import { primeMotionTree, sampleTree } from "../nodes/node/node-walk.js";
6
- import { Canvas2D } from "../nodes/scene/canvas2d-node.js";
6
+ import { Canvas2D } from "../nodes/root/canvas2d-node.js";
7
7
  import { nodePath } from "../project/tree.js";
8
8
  import { ContextMap } from "../util/context.js";
9
9
  /**
@@ -24,11 +24,11 @@ export class ClipInstance {
24
24
  this._doc = lowered(clip);
25
25
  const { width, height } = _scope.viewport;
26
26
  // Seeded here because this canvas *is* the document's root row, yet it is
27
- // the one node no `Registry.instantiate` makes: `SceneTimeline` applies
27
+ // the one node no `Registry.instantiate` makes: `ClipTimeline` applies
28
28
  // that row's props with `set()`, which writes @property fields only, so
29
29
  // an unseeded root would report a UUID no document row mentions.
30
30
  this.canvas = new Canvas2D({ id: ROOT_NODE_ID, width, height, flow: "freeform" });
31
- this._timeline = new SceneTimeline(this._doc, _scope.registry, this.canvas);
31
+ this._timeline = new ClipTimeline(this._doc, _scope.registry, this.canvas);
32
32
  this._indexRows();
33
33
  }
34
34
  get duration() {
@@ -39,7 +39,7 @@ export class ClipInstance {
39
39
  return this._clip;
40
40
  }
41
41
  /**
42
- * Build the tree, then fix every command against it laid out — see `SceneTimeline.compile`.
42
+ * Build the tree, then fix every command against it laid out — see `ClipTimeline.compile`.
43
43
  * `measurer` stands in for the scope's during the build only.
44
44
  */
45
45
  build(measurer = this._scope.measurer) {
@@ -87,10 +87,24 @@ export class ClipInstance {
87
87
  this._duration = duration;
88
88
  this._indexRows();
89
89
  }
90
- /** Every command as compiled, with what each writes — see `SceneTimeline.placedCommands`. */
90
+ /** Every command as compiled, with what each writes — see `ClipTimeline.placedCommands`. */
91
91
  placedCommands() {
92
92
  return this._timeline.placedCommands();
93
93
  }
94
+ commandSounds() {
95
+ return this._timeline.commandSounds();
96
+ }
97
+ /** `read`, with the tree's presence as it stands at `seconds`; the presence is put back after. */
98
+ atPresence(seconds, read) {
99
+ const was = this._timeline.presenceTime;
100
+ this._timeline.syncPresence(seconds);
101
+ try {
102
+ return read();
103
+ }
104
+ finally {
105
+ this._timeline.syncPresence(was);
106
+ }
107
+ }
94
108
  evaluateAt(seconds, onWrite) {
95
109
  this._timeline.syncPresence(seconds);
96
110
  this._timeline.evaluateAt(seconds, onWrite);
@@ -119,6 +133,10 @@ export class ClipInstance {
119
133
  node(rowId) {
120
134
  return this._timeline.liveNode(rowId);
121
135
  }
136
+ /** What a document row holds before any command acts on it — see `ClipTimeline.baselineProps`. */
137
+ baselineProps(rowId) {
138
+ return this._timeline.baselineProps(rowId);
139
+ }
122
140
  /** Every document row's effective span, the root's excepted. */
123
141
  rowSpans() {
124
142
  return [...this._rows.values()].map((row) => row.span);
@@ -220,6 +238,6 @@ export class ClipInstance {
220
238
  }
221
239
  }
222
240
  function lowered(clip) {
223
- return isAudioDocument(clip) ? loweredAudioDocument(clip) : clip;
241
+ return clipDocument(clip);
224
242
  }
225
243
  //# sourceMappingURL=clip-instance.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"clip-instance.js","sourceRoot":"","sources":["../../src/runtime/clip-instance.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,EAAE,aAAa,EAA0B,MAAM,qBAAqB,CAAC;AAG5E,OAAO,EACH,cAAc,EACd,eAAe,EACf,YAAY,GAIf,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,iBAAiB,E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AAI,CAAC,EAAE,KAAK,YAAY;gBAAE,SAAS;YACvC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAE,EAAE,CAAC,CAAC;QACpF,CAAC;IACL,CAAC;IAED;;;OAGG;IACK,QAAQ,CAAC,IAAU;QACvB,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACpC,IAAI,CAAC,GAAG;YAAE,OAAO,SAAS,CAAC;QAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,MAAM,MAAM,GAAG,GAAG,CAAC,QAAQ,KAAK,IAAI,IAAI,GAAG,CAAC,QAAQ,KAAK,YAAY;YACjE,CAAC,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM;YACxB,CAAC,CAAC,MAAM,KAAK,IAAI,IAAI,MAAM,CAAC,EAAE,KAAK,GAAG,CAAC,QAAQ,CAAC;QACpD,OAAO,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IACzC,CAAC;CACJ;AAED,SAAS,OAAO,CAAC,IAAkB;IAC/B,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACrE,CAAC","sourcesContent":["import type { AssetCatalog } from \"@/assets/catalog\";\nimport type { Size2D } from \"@/attributes/layout/size\";\nimport { loweredAudioDocument } from \"@/document/audio\";\nimport type { Registry } from \"@/document/registry\";\nimport { SceneTimeline, type PlacedCommandInfo } from \"@/document/timeline\";\nimport type { TimelinePatch } from \"@/document/timeline-patch\";\nimport type { PropSlot } from \"@/props/slot\";\nimport {\n effectiveSpans,\n isAudioDocument,\n ROOT_NODE_ID,\n type ClipDocument,\n type NodeSpan,\n type SceneDocument,\n} from \"@/document/types\";\nimport type { Node } from \"@/nodes/node/node\";\nimport { applyEditorStates, type NodeEditorStates } from \"@/nodes/node/node-editor-state\";\nimport { primeMotionTree, sampleTree } from \"@/nodes/node/node-walk\";\nimport { Canvas2D } from \"@/nodes/scene/canvas2d-node\";\nimport { nodePath } from \"@/project/tree\";\nimport type { MeasureContext2D } from \"@/render/measure-context\";\nimport type { RenderPass2D } from \"@/render/render-context2d\";\nimport { ContextMap } from \"@/util/context\";\n\n/** What a clip is built and measured against — the same for every track in a session. */\nexport interface RuntimeScope {\n registry: Registry;\n viewport: Size2D;\n fps: number;\n assets: AssetCatalog;\n measurer: MeasureContext2D;\n}\n\n/**\n * One track's clip, live: the viewport-sized {@link Canvas2D} it builds into and\n * the timeline compiled over it.\n *\n * Built once, then asked for a time. Nothing resets one — a caller that needs a\n * fresh tree builds a new instance — which is what lets the measuring pass and\n * the evaluator each hold their own instead of taking turns with one.\n */\nexport class ClipInstance {\n readonly canvas: Canvas2D;\n\n constructor(clip: ClipDocument, duration: number, private readonly _scope: RuntimeScope) {\n this._clip = clip;\n this._duration = duration;\n this._doc = lowered(clip);\n const { width, height } = _scope.viewport;\n // Seeded here because this canvas *is* the document's root row, yet it is\n // the one node no `Registry.instantiate` makes: `SceneTimeline` applies\n // that row's props with `set()`, which writes @property fields only, so\n // an unseeded root would report a UUID no document row mentions.\n this.canvas = new Canvas2D({ id: ROOT_NODE_ID, width, height, flow: \"freeform\" });\n this._timeline = new SceneTimeline(this._doc, _scope.registry, this.canvas);\n this._indexRows();\n }\n\n get duration(): number {\n return this._duration;\n }\n\n /** The clip document this instance plays, as handed in — before audio lowering. */\n get clip(): ClipDocument {\n return this._clip;\n }\n\n /**\n * Build the tree, then fix every command against it laid out — see `SceneTimeline.compile`.\n * `measurer` stands in for the scope's during the build only.\n */\n build(measurer: MeasureContext2D = this._scope.measurer): void {\n this.attach(0);\n this._timeline.build();\n this.sample();\n this.layout(measurer);\n this._timeline.compile(() => {\n this.sample();\n this.layout(measurer);\n });\n this.layout(measurer);\n }\n\n /**\n * Patch the built tree to play `next`, re-instantiating and recompiling only\n * what the difference touches. `false` means the change needs a fresh instance\n * (see `planTimelinePatch`); the tree is untouched then. A throw leaves the tree\n * unusable — the caller disposes it and builds fresh.\n */\n update(next: ClipDocument, duration: number): boolean {\n if (next === this._clip) {\n this._duration = duration;\n return true;\n }\n const patch = this.planUpdate(next);\n if (!patch) return false;\n this.applyUpdate(patch, next, duration);\n return true;\n }\n\n /** {@link update}'s plan, for a caller that has to look at the tree before it changes. */\n planUpdate(next: ClipDocument): TimelinePatch | null {\n return this._timeline.planUpdate(lowered(next));\n }\n\n applyUpdate(\n patch: TimelinePatch,\n next: ClipDocument,\n duration: number,\n measurer: MeasureContext2D = this._scope.measurer,\n ): void {\n this.attach(0);\n const relayout = () => {\n this.sample();\n this.layout(measurer);\n };\n this._timeline.applyUpdate(patch, relayout, relayout);\n this.layout(measurer);\n this._clip = next;\n this._doc = patch.next.doc;\n this._duration = duration;\n this._indexRows();\n }\n\n /** Every command as compiled, with what each writes — see `SceneTimeline.placedCommands`. */\n placedCommands(): readonly PlacedCommandInfo[] {\n return this._timeline.placedCommands();\n }\n\n evaluateAt(seconds: number, onWrite?: (index: number, slot: PropSlot<unknown>) => void): void {\n this._timeline.syncPresence(seconds);\n this._timeline.evaluateAt(seconds, onWrite);\n }\n\n attach(seconds: number, editor?: NodeEditorStates): void {\n this.canvas.attach({ assets: this._scope.assets, context: ContextMap.EMPTY, time: seconds });\n // Before layout, so a node that appeared this frame gets its editor state\n // on the frame it appears — and a hidden one is out of the flow before it\n // is measured.\n applyEditorStates(this.canvas, editor);\n }\n\n layout(measurer: MeasureContext2D = this._scope.measurer): void {\n const { width, height } = this._scope.viewport;\n this.canvas.layout({ x: 0, y: 0, width, height }, measurer);\n }\n\n render(pass: RenderPass2D): void {\n this.canvas.render(pass);\n }\n\n sample(): void {\n sampleTree(this.canvas);\n }\n\n primeMotion(at: number): void {\n primeMotionTree(this.canvas, at);\n }\n\n /** The node a document row built, mounted or not; the canvas for the root. */\n node(rowId: string): Node | undefined {\n return this._timeline.liveNode(rowId);\n }\n\n /** Every document row's effective span, the root's excepted. */\n rowSpans(): NodeSpan[] {\n return [...this._rows.values()].map((row) => row.span);\n }\n\n /** One row's effective span — `undefined` for the root, which spans the clip, and for an id no row has. */\n rowSpan(id: string): NodeSpan | undefined {\n return this._rows.get(id)?.span;\n }\n\n /**\n * `node`'s owner key as {@link forEachOwner} spells it, mounted or not —\n * `undefined` for a node no row built.\n */\n ownerKeyOf(node: Node): string | undefined {\n let below = \"\";\n for (let current: Node = node; ;) {\n if (current === this.canvas || this._timeline.liveNode(current.id) === current) {\n const row = current === this.canvas ? ROOT_NODE_ID : current.id;\n return below === \"\" ? row : `${row}/${below}`;\n }\n const parent = current.parent;\n if (!parent) return undefined;\n const index = parent._allChildren.indexOf(current);\n below = below === \"\" ? String(index) : `${index}.${below}`;\n current = parent;\n }\n }\n\n /**\n * When `node` is in the tree, in clip seconds: its document row's effective\n * span, or the nearest row ancestor's for a node a composite built. The canvas\n * spans the clip. `undefined` for a node outside this tree.\n */\n spanOf(node: Node): NodeSpan | undefined {\n for (let current: Node | null = node; current; current = current.parent) {\n if (current === this.canvas) return { start: 0, end: this.duration };\n const span = this._rowSpan(current);\n if (span) return { ...span };\n }\n return undefined;\n }\n\n /**\n * Visit every mounted node, parents first, with its span, its structural path\n * and its **owner key** — the nearest row's id, plus the path below that row for\n * a node a composite built. A UUID changes on every build and a path from the\n * root changes whenever an earlier sibling enters or leaves; this does neither.\n */\n forEachOwner(visit: (node: Node, ownerKey: string, span: NodeSpan, path: string) => void): void {\n const walk = (node: Node, row: string, below: string, span: NodeSpan, path: string): void => {\n if (!node.mounted) return;\n const own = node === this.canvas ? undefined : this._rowSpan(node);\n if (own) {\n row = node.id;\n below = \"\";\n span = own;\n }\n visit(node, below === \"\" ? row : `${row}/${below}`, span, path);\n const children = node._allChildren;\n for (let i = 0; i < children.length; i++) {\n walk(children[i], row, below === \"\" ? String(i) : `${below}.${i}`, span, nodePath(path, i));\n }\n };\n walk(this.canvas, ROOT_NODE_ID, \"\", { start: 0, end: this.duration }, \"\");\n }\n\n dispose(): void {\n for (const child of this.canvas.children) child.dispose();\n this.canvas.dispose();\n }\n\n private _clip: ClipDocument;\n private _doc: SceneDocument;\n private _duration: number;\n private readonly _timeline: SceneTimeline;\n private readonly _rows = new Map<string, { parentId: string | null; span: NodeSpan }>();\n\n private _indexRows(): void {\n this._rows.clear();\n const spans = effectiveSpans(this._doc.nodes);\n for (const spec of this._doc.nodes) {\n if (spec.id === ROOT_NODE_ID) continue;\n this._rows.set(spec.id, { parentId: spec.parentId, span: spans.get(spec.id)! });\n }\n }\n\n /**\n * `node`'s row span when a document row built it. The parent is checked as well\n * as the id, because a composite can hand its own id down to a child it builds.\n */\n private _rowSpan(node: Node): NodeSpan | undefined {\n const row = this._rows.get(node.id);\n if (!row) return undefined;\n const parent = node.parent;\n const placed = row.parentId === null || row.parentId === ROOT_NODE_ID\n ? parent === this.canvas\n : parent !== null && parent.id === row.parentId;\n return placed ? row.span : undefined;\n }\n}\n\nfunction lowered(clip: ClipDocument): SceneDocument {\n return isAudioDocument(clip) ? loweredAudioDocument(clip) : clip;\n}\n"]}
1
+ {"version":3,"file":"clip-instance.js","sourceRoot":"","sources":["../../src/runtime/clip-instance.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAE,YAAY,EAA4C,MAAM,qBAAqB,CAAC;AAG7F,OAAO,EACH,cAAc,EACd,YAAY,GAIf,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,iBAAiB,EAAyB,MAAM,gCAAgC,CAAC;AAC1F,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,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;IAC/B,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["import type { AssetCatalog } from \"@/assets/catalog\";\r\nimport type { Size2D } from \"@/attributes/layout/size\";\r\nimport { clipDocument } from \"@/document/audio\";\r\nimport type { Registry } from \"@/document/registry\";\r\nimport { ClipTimeline, type PlacedCommandInfo, type PlacedSound } from \"@/document/timeline\";\r\nimport type { TimelinePatch } from \"@/document/timeline-patch\";\r\nimport type { PropSlot } from \"@/props/slot\";\r\nimport {\r\n effectiveSpans,\r\n ROOT_NODE_ID,\r\n type ClipDocument,\r\n type NodeSpan,\r\n type VisualDocument,\r\n} from \"@/document/types\";\r\nimport type { Node } from \"@/nodes/node/node\";\r\nimport { applyEditorStates, type NodeEditorStates } from \"@/nodes/node/node-editor-state\";\r\nimport { primeMotionTree, sampleTree } from \"@/nodes/node/node-walk\";\r\nimport { Canvas2D } from \"@/nodes/root/canvas2d-node\";\r\nimport { nodePath } from \"@/project/tree\";\r\nimport type { MeasureContext2D } from \"@/render/measure-context\";\r\nimport type { RenderPass2D } from \"@/render/render-context2d\";\r\nimport { ContextMap } from \"@/util/context\";\r\n\r\n/** What a clip is built and measured against — the same for every track in a session. */\r\nexport interface RuntimeScope {\r\n registry: Registry;\r\n viewport: Size2D;\r\n fps: number;\r\n assets: AssetCatalog;\r\n measurer: MeasureContext2D;\r\n}\r\n\r\n/**\r\n * One track's clip, live: the viewport-sized {@link Canvas2D} it builds into and\r\n * the timeline compiled over it.\r\n *\r\n * Built once, then asked for a time. Nothing resets one — a caller that needs a\r\n * fresh tree builds a new instance — which is what lets the measuring pass and\r\n * the evaluator each hold their own instead of taking turns with one.\r\n */\r\nexport class ClipInstance {\r\n readonly canvas: Canvas2D;\r\n\r\n constructor(clip: ClipDocument, duration: number, private readonly _scope: RuntimeScope) {\r\n this._clip = clip;\r\n this._duration = duration;\r\n this._doc = lowered(clip);\r\n const { width, height } = _scope.viewport;\r\n // Seeded here because this canvas *is* the document's root row, yet it is\r\n // the one node no `Registry.instantiate` makes: `ClipTimeline` applies\r\n // that row's props with `set()`, which writes @property fields only, so\r\n // an unseeded root would report a UUID no document row mentions.\r\n this.canvas = new Canvas2D({ id: ROOT_NODE_ID, width, height, flow: \"freeform\" });\r\n this._timeline = new ClipTimeline(this._doc, _scope.registry, this.canvas);\r\n this._indexRows();\r\n }\r\n\r\n get duration(): number {\r\n return this._duration;\r\n }\r\n\r\n /** The clip document this instance plays, as handed in — before audio lowering. */\r\n get clip(): ClipDocument {\r\n return this._clip;\r\n }\r\n\r\n /**\r\n * Build the tree, then fix every command against it laid out — see `ClipTimeline.compile`.\r\n * `measurer` stands in for the scope's during the build only.\r\n */\r\n build(measurer: MeasureContext2D = this._scope.measurer): void {\r\n this.attach(0);\r\n this._timeline.build();\r\n this.sample();\r\n this.layout(measurer);\r\n this._timeline.compile(() => {\r\n this.sample();\r\n this.layout(measurer);\r\n });\r\n this.layout(measurer);\r\n }\r\n\r\n /**\r\n * Patch the built tree to play `next`, re-instantiating and recompiling only\r\n * what the difference touches. `false` means the change needs a fresh instance\r\n * (see `planTimelinePatch`); the tree is untouched then. A throw leaves the tree\r\n * unusable — the caller disposes it and builds fresh.\r\n */\r\n update(next: ClipDocument, duration: number): boolean {\r\n if (next === this._clip) {\r\n this._duration = duration;\r\n return true;\r\n }\r\n const patch = this.planUpdate(next);\r\n if (!patch) return false;\r\n this.applyUpdate(patch, next, duration);\r\n return true;\r\n }\r\n\r\n /** {@link update}'s plan, for a caller that has to look at the tree before it changes. */\r\n planUpdate(next: ClipDocument): TimelinePatch | null {\r\n return this._timeline.planUpdate(lowered(next));\r\n }\r\n\r\n applyUpdate(\r\n patch: TimelinePatch,\r\n next: ClipDocument,\r\n duration: number,\r\n measurer: MeasureContext2D = this._scope.measurer,\r\n ): void {\r\n this.attach(0);\r\n const relayout = () => {\r\n this.sample();\r\n this.layout(measurer);\r\n };\r\n this._timeline.applyUpdate(patch, relayout, relayout);\r\n this.layout(measurer);\r\n this._clip = next;\r\n this._doc = patch.next.doc;\r\n this._duration = duration;\r\n this._indexRows();\r\n }\r\n\r\n /** Every command as compiled, with what each writes — see `ClipTimeline.placedCommands`. */\r\n placedCommands(): readonly PlacedCommandInfo[] {\r\n return this._timeline.placedCommands();\r\n }\r\n\r\n commandSounds(): PlacedSound[] {\r\n return this._timeline.commandSounds();\r\n }\r\n\r\n /** `read`, with the tree's presence as it stands at `seconds`; the presence is put back after. */\r\n atPresence<T>(seconds: number, read: () => T): T {\r\n const was = this._timeline.presenceTime;\r\n this._timeline.syncPresence(seconds);\r\n try {\r\n return read();\r\n } finally {\r\n this._timeline.syncPresence(was);\r\n }\r\n }\r\n\r\n evaluateAt(seconds: number, onWrite?: (index: number, slot: PropSlot<unknown>) => void): void {\r\n this._timeline.syncPresence(seconds);\r\n this._timeline.evaluateAt(seconds, onWrite);\r\n }\r\n\r\n attach(seconds: number, editor?: NodeEditorStates): void {\r\n this.canvas.attach({ assets: this._scope.assets, context: ContextMap.EMPTY, time: seconds });\r\n // Before layout, so a node that appeared this frame gets its editor state\r\n // on the frame it appears — and a hidden one is out of the flow before it\r\n // is measured.\r\n applyEditorStates(this.canvas, editor);\r\n }\r\n\r\n layout(measurer: MeasureContext2D = this._scope.measurer): void {\r\n const { width, height } = this._scope.viewport;\r\n this.canvas.layout({ x: 0, y: 0, width, height }, measurer);\r\n }\r\n\r\n render(pass: RenderPass2D): void {\r\n this.canvas.render(pass);\r\n }\r\n\r\n sample(): void {\r\n sampleTree(this.canvas);\r\n }\r\n\r\n primeMotion(at: number): void {\r\n primeMotionTree(this.canvas, at);\r\n }\r\n\r\n /** The node a document row built, mounted or not; the canvas for the root. */\r\n node(rowId: string): Node | undefined {\r\n return this._timeline.liveNode(rowId);\r\n }\r\n\r\n /** What a document row holds before any command acts on it — see `ClipTimeline.baselineProps`. */\r\n baselineProps(rowId: string): Record<string, unknown> | undefined {\r\n return this._timeline.baselineProps(rowId);\r\n }\r\n\r\n /** Every document row's effective span, the root's excepted. */\r\n rowSpans(): NodeSpan[] {\r\n return [...this._rows.values()].map((row) => row.span);\r\n }\r\n\r\n /** One row's effective span — `undefined` for the root, which spans the clip, and for an id no row has. */\r\n rowSpan(id: string): NodeSpan | undefined {\r\n return this._rows.get(id)?.span;\r\n }\r\n\r\n /**\r\n * `node`'s owner key as {@link forEachOwner} spells it, mounted or not —\r\n * `undefined` for a node no row built.\r\n */\r\n ownerKeyOf(node: Node): string | undefined {\r\n let below = \"\";\r\n for (let current: Node = node; ;) {\r\n if (current === this.canvas || this._timeline.liveNode(current.id) === current) {\r\n const row = current === this.canvas ? ROOT_NODE_ID : current.id;\r\n return below === \"\" ? row : `${row}/${below}`;\r\n }\r\n const parent = current.parent;\r\n if (!parent) return undefined;\r\n const index = parent._allChildren.indexOf(current);\r\n below = below === \"\" ? String(index) : `${index}.${below}`;\r\n current = parent;\r\n }\r\n }\r\n\r\n /**\r\n * When `node` is in the tree, in clip seconds: its document row's effective\r\n * span, or the nearest row ancestor's for a node a composite built. The canvas\r\n * spans the clip. `undefined` for a node outside this tree.\r\n */\r\n spanOf(node: Node): NodeSpan | undefined {\r\n for (let current: Node | null = node; current; current = current.parent) {\r\n if (current === this.canvas) return { start: 0, end: this.duration };\r\n const span = this._rowSpan(current);\r\n if (span) return { ...span };\r\n }\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Visit every mounted node, parents first, with its span, its structural path\r\n * and its **owner key** — the nearest row's id, plus the path below that row for\r\n * a node a composite built. A UUID changes on every build and a path from the\r\n * root changes whenever an earlier sibling enters or leaves; this does neither.\r\n */\r\n forEachOwner(visit: (node: Node, ownerKey: string, span: NodeSpan, path: string) => void): void {\r\n const walk = (node: Node, row: string, below: string, span: NodeSpan, path: string): void => {\r\n if (!node.mounted) return;\r\n const own = node === this.canvas ? undefined : this._rowSpan(node);\r\n if (own) {\r\n row = node.id;\r\n below = \"\";\r\n span = own;\r\n }\r\n visit(node, below === \"\" ? row : `${row}/${below}`, span, path);\r\n const children = node._allChildren;\r\n for (let i = 0; i < children.length; i++) {\r\n walk(children[i], row, below === \"\" ? String(i) : `${below}.${i}`, span, nodePath(path, i));\r\n }\r\n };\r\n walk(this.canvas, ROOT_NODE_ID, \"\", { start: 0, end: this.duration }, \"\");\r\n }\r\n\r\n dispose(): void {\r\n for (const child of this.canvas.children) child.dispose();\r\n this.canvas.dispose();\r\n }\r\n\r\n private _clip: ClipDocument;\r\n private _doc: VisualDocument;\r\n private _duration: number;\r\n private readonly _timeline: ClipTimeline;\r\n private readonly _rows = new Map<string, { parentId: string | null; span: NodeSpan }>();\r\n\r\n private _indexRows(): void {\r\n this._rows.clear();\r\n const spans = effectiveSpans(this._doc.nodes);\r\n for (const spec of this._doc.nodes) {\r\n if (spec.id === ROOT_NODE_ID) continue;\r\n this._rows.set(spec.id, { parentId: spec.parentId, span: spans.get(spec.id)! });\r\n }\r\n }\r\n\r\n /**\r\n * `node`'s row span when a document row built it. The parent is checked as well\r\n * as the id, because a composite can hand its own id down to a child it builds.\r\n */\r\n private _rowSpan(node: Node): NodeSpan | undefined {\r\n const row = this._rows.get(node.id);\r\n if (!row) return undefined;\r\n const parent = node.parent;\r\n const placed = row.parentId === null || row.parentId === ROOT_NODE_ID\r\n ? parent === this.canvas\r\n : parent !== null && parent.id === row.parentId;\r\n return placed ? row.span : undefined;\r\n }\r\n}\r\n\r\nfunction lowered(clip: ClipDocument): VisualDocument {\r\n return clipDocument(clip);\r\n}\r\n"]}
@@ -58,6 +58,15 @@ export declare class ClipStore {
58
58
  * track again, since colours resolve against it as props are written.
59
59
  */
60
60
  setProject(next: ProjectDocument): StoreUpdate;
61
+ /**
62
+ * Start every track again against the same document.
63
+ *
64
+ * For a change the document does not carry: the catalog these clips build
65
+ * against gained an entry, so a track that failed for want of it, or measured
66
+ * against the old size, has to be built again. {@link setProject} cannot say
67
+ * so, since it compares documents and this one has not changed.
68
+ */
69
+ reset(): void;
61
70
  /** `trackId`'s built tree, building it — or draining its parked build — first. `null` when building throws. */
62
71
  ensureBuilt(trackId: string): ClipInstance | null;
63
72
  /** Build and refine `trackId` now, unless it already has been. */
@@ -138,6 +147,15 @@ export declare class ClipStore {
138
147
  * does not stop the rest.
139
148
  */
140
149
  private _declareAudio;
150
+ /**
151
+ * What the placed commands play, as one owner: a sound is scheduled ahead of
152
+ * time from where its command sits, not written per frame. Rebuilt whenever
153
+ * the track's audio is published, so a moved or edited command moves its sound.
154
+ */
155
+ private _declareCommandAudio;
156
+ /** The placed commands' sounds, under the row that plays each, so a request keeps its id and its waveform its row. */
157
+ private _commandSoundsOf;
158
+ private _setCommandAudio;
141
159
  private _ownerError;
142
160
  /**
143
161
  * Republish what the track's indices hold. A snapshot, so a result already
@@ -1 +1 @@
1
- {"version":3,"file":"clip-store.d.ts","sourceRoot":"","sources":["../../src/runtime/clip-store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAIhD,OAAO,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAYjE,OAAO,EAAE,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAA4C,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AACvF,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,WAAW,EAAsB,MAAM,kBAAkB,CAAC;AAE1G,+EAA+E;AAC/E,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C,MAAM,WAAW,gBAAgB;IAC7B,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,mFAAmF;IACnF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,+EAA+E;IAC/E,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,iGAAiG;IACjG,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,8EAA8E;IAC9E,OAAO,CAAC,EAAE,CAAC,GAA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AC5C,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,QAAQ,CAAK;IACrB,OAAO,CAAC,SAAS,CAAS;IAE1B,OAAO,CAAC,MAAM;IA6Bd,OAAO,CAAC,UAAU;IAiElB,2HAA2H;IAC3H,OAAO,CAAC,OAAO;IAkBf,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,QAAQ;IAShB,OAAO,CAAC,iBAAiB;IAczB,OAAO,CAAC,MAAM;IAMd,OAAO,CAAC,MAAM;IAId,qEAAqE;IACrE,OAAO,CAAC,KAAK;IAuBb;;;OAGG;IACH,OAAO,CAAE,MAAM;IA2Df,OAAO,CAAC,YAAY;IAapB,OAAO,CAAC,OAAO;IAYf,sGAAsG;IACtG,OAAO,CAAC,WAAW;IAkFnB,OAAO,CAAC,KAAK;IAUb,OAAO,CAAC,KAAK;IAOb;;;;OAIG;IACH,OAAO,CAAC,aAAa;IA+BrB;;;;OAIG;IACH,OAAO,CAAC,oBAAoB;IAe5B,sHAAsH;IACtH,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,gBAAgB;IA4BxB,OAAO,CAAC,WAAW;IAWnB;;;;OAIG;IACH,OAAO,CAAC,QAAQ;IAkChB,wEAAwE;IACxE,OAAO,CAAC,aAAa;IAgBrB;;;OAGG;IACH,OAAO,CAAC,QAAQ;IAmBhB,OAAO,CAAC,gBAAgB;CAQ3B"}
@@ -6,6 +6,10 @@ import { now, yieldToScheduler } from "../util/scheduler.js";
6
6
  import { refineAssets } from "./asset-refine.js";
7
7
  import { dirtyOwners, OwnerDependencies, SlotNamer } from "./asset-update.js";
8
8
  import { AudioIndex, declaredAudio, declaresAudio } from "./audio-index.js";
9
+ import { requestOf } from "../attributes/audio/schedule.js";
10
+ import { busPathOf, busPathTo, findBusById, NodeAudio } from "../nodes/audio/node-audio.js";
11
+ /** The owner key the placed commands' sounds go under. */
12
+ const COMMAND_AUDIO = "@commands";
9
13
  import { ClipInstance } from "./clip-instance.js";
10
14
  import { placeTracks, spanFrames, trackFrameCount } from "./placement.js";
11
15
  /** Half a 60 Hz frame, leaving the other half for input handling and paint. */
@@ -81,6 +85,25 @@ export class ClipStore {
81
85
  this._spans = spans;
82
86
  return update;
83
87
  }
88
+ /**
89
+ * Start every track again against the same document.
90
+ *
91
+ * For a change the document does not carry: the catalog these clips build
92
+ * against gained an entry, so a track that failed for want of it, or measured
93
+ * against the old size, has to be built again. {@link setProject} cannot say
94
+ * so, since it compares documents and this one has not changed.
95
+ */
96
+ reset() {
97
+ if (this._disposed)
98
+ return;
99
+ const previous = this._entries;
100
+ this._entries = new Map();
101
+ for (const track of this._project.tracks)
102
+ this._entries.set(track.id, this._fresh(track));
103
+ for (const old of previous.values())
104
+ this._discard(old);
105
+ this._version++;
106
+ }
84
107
  /** `trackId`'s built tree, building it — or draining its parked build — first. `null` when building throws. */
85
108
  ensureBuilt(trackId) {
86
109
  const entry = this._entries.get(trackId);
@@ -284,6 +307,8 @@ export class ClipStore {
284
307
  errors: [],
285
308
  index: new AssetIndex(frameCount),
286
309
  audio: new AudioIndex(),
310
+ commandAudio: new Set(),
311
+ commandSounds: null,
287
312
  deps: new OwnerDependencies(),
288
313
  assetDeps: new Map(),
289
314
  audioDeps: new Map(),
@@ -518,6 +543,8 @@ export class ClipStore {
518
543
  _resetAssets(entry) {
519
544
  entry.index = new AssetIndex(entry.frameCount);
520
545
  entry.audio = new AudioIndex();
546
+ entry.commandAudio = new Set();
547
+ entry.commandSounds = null;
521
548
  entry.deps = new OwnerDependencies();
522
549
  entry.assetDeps.clear();
523
550
  entry.audioDeps.clear();
@@ -656,6 +683,9 @@ export class ClipStore {
656
683
  const reads = [];
657
684
  slots.set(ownerKey, reads);
658
685
  if (!declaresAudio(node)) {
686
+ const sounds = entry.instance ? this._commandSoundsOf(entry, entry.instance).get(ownerKey) : undefined;
687
+ if (sounds)
688
+ return this._setCommandAudio(entry, entry.instance, ownerKey, sounds);
659
689
  entry.audio.removeOwner(ownerKey);
660
690
  entry.audioErrors.delete(ownerKey);
661
691
  return;
@@ -672,6 +702,72 @@ export class ClipStore {
672
702
  entry.audioErrors.set(ownerKey, { ...buildErrorOf(entry.track.id, err), nodeId: node.id });
673
703
  }
674
704
  }
705
+ /**
706
+ * What the placed commands play, as one owner: a sound is scheduled ahead of
707
+ * time from where its command sits, not written per frame. Rebuilt whenever
708
+ * the track's audio is published, so a moved or edited command moves its sound.
709
+ */
710
+ _declareCommandAudio(entry) {
711
+ const instance = entry.instance;
712
+ entry.commandSounds = null;
713
+ if (!instance || this._refine === "none")
714
+ return;
715
+ const byOwner = this._commandSoundsOf(entry, instance);
716
+ for (const key of entry.commandAudio) {
717
+ if (byOwner.has(key))
718
+ continue;
719
+ entry.audio.removeOwner(key);
720
+ entry.audioErrors.delete(key);
721
+ }
722
+ entry.commandAudio = new Set(byOwner.keys());
723
+ for (const [key, sounds] of byOwner)
724
+ this._setCommandAudio(entry, instance, key, sounds);
725
+ entry.commandSounds = null;
726
+ }
727
+ /** The placed commands' sounds, under the row that plays each, so a request keeps its id and its waveform its row. */
728
+ _commandSoundsOf(entry, instance) {
729
+ if (entry.commandSounds)
730
+ return entry.commandSounds;
731
+ const byOwner = new Map();
732
+ for (const sound of instance.commandSounds()) {
733
+ const key = instance.ownerKeyOf(sound.node) ?? COMMAND_AUDIO;
734
+ const list = byOwner.get(key);
735
+ if (list)
736
+ list.push(sound);
737
+ else
738
+ byOwner.set(key, [sound]);
739
+ }
740
+ return (entry.commandSounds = byOwner);
741
+ }
742
+ _setCommandAudio(entry, instance, key, sounds) {
743
+ const catalog = this._scope.assets;
744
+ const spanOf = (node) => {
745
+ const found = instance.spanOf(node);
746
+ if (!found)
747
+ throw new Error(`${node.className} is not in the tree, so it has no span.`);
748
+ return found;
749
+ };
750
+ const scope = { catalog, span: { start: 0, end: Infinity }, clip: () => { }, _spanOf: spanOf };
751
+ try {
752
+ const requests = sounds.map((sound, n) => {
753
+ const { bus: busId, closed, ...options } = sound.options;
754
+ // The buses as they stand when the sound starts: a bus may since have left.
755
+ const bus = instance.atPresence(sound.at, () => {
756
+ const target = busId ? findBusById(sound.node, busId) : null;
757
+ return target ? busPathTo(target, scope) : sound.node instanceof NodeAudio ? busPathOf(sound.node, scope) : undefined;
758
+ });
759
+ const trimEnd = options.trimEnd ?? (closed ? catalog.getMediaDuration(sound.src) : undefined);
760
+ return requestOf({ ...options, trimEnd, src: sound.src, at: sound.at, until: sound.until, bus }, catalog, key, n);
761
+ });
762
+ entry.audio.setOwner(key, requests);
763
+ entry.audioErrors.delete(key);
764
+ entry.commandAudio.add(key);
765
+ }
766
+ catch (err) {
767
+ entry.audio.removeOwner(key);
768
+ entry.audioErrors.set(key, { ...buildErrorOf(entry.track.id, err), nodeId: sounds[0].node.id });
769
+ }
770
+ }
675
771
  _ownerError(entry, owner) {
676
772
  const error = owner.error;
677
773
  return {
@@ -688,6 +784,7 @@ export class ClipStore {
688
784
  * nothing in it would differ. Whether it changed.
689
785
  */
690
786
  _refresh(entry, landed = false) {
787
+ this._declareCommandAudio(entry);
691
788
  const prior = entry.discovered;
692
789
  const { fps } = this._scope;
693
790
  const records = prior && sameRecords(prior.assetRecords, entry.index.records())