@motionscript/core 0.1.0-alpha.8 → 0.1.0

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 (817) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/LICENSE +201 -201
  3. package/NOTICE +49 -49
  4. package/README.md +91 -91
  5. package/dist/assets/asset-index.js.map +1 -1
  6. package/dist/assets/catalog.js.map +1 -1
  7. package/dist/assets/errors.js.map +1 -1
  8. package/dist/assets/index.js.map +1 -1
  9. package/dist/assets/manager.js.map +1 -1
  10. package/dist/assets/manifest.js.map +1 -1
  11. package/dist/assets/record.js.map +1 -1
  12. package/dist/assets/scope.js.map +1 -1
  13. package/dist/attributes/audio/effects/chain.js.map +1 -1
  14. package/dist/attributes/audio/effects/implementations/echo.js.map +1 -1
  15. package/dist/attributes/audio/effects/implementations/gain.js.map +1 -1
  16. package/dist/attributes/audio/effects/implementations/highpass.js.map +1 -1
  17. package/dist/attributes/audio/effects/implementations/lowpass.js.map +1 -1
  18. package/dist/attributes/audio/effects/implementations/tremolo.js.map +1 -1
  19. package/dist/attributes/audio/effects/index.js.map +1 -1
  20. package/dist/attributes/audio/effects/registry.js.map +1 -1
  21. package/dist/attributes/audio/effects/union.js.map +1 -1
  22. package/dist/attributes/audio/ramp.js.map +1 -1
  23. package/dist/attributes/audio/request.js.map +1 -1
  24. package/dist/attributes/audio/schedule.js.map +1 -1
  25. package/dist/attributes/audio/sound.js.map +1 -1
  26. package/dist/attributes/audio/transition.js.map +1 -1
  27. package/dist/attributes/index.js.map +1 -1
  28. package/dist/attributes/layout/alignment.js.map +1 -1
  29. package/dist/attributes/layout/index.js.map +1 -1
  30. package/dist/attributes/layout/insets.js.map +1 -1
  31. package/dist/attributes/layout/matrix2d.js.map +1 -1
  32. package/dist/attributes/layout/size.js.map +1 -1
  33. package/dist/attributes/layout/space3d.js.map +1 -1
  34. package/dist/attributes/layout/transform3d.js.map +1 -1
  35. package/dist/attributes/layout/vector2.js.map +1 -1
  36. package/dist/attributes/layout/world-transform.js.map +1 -1
  37. package/dist/attributes/mask/boolean.js.map +1 -1
  38. package/dist/attributes/mask/mask.js.map +1 -1
  39. package/dist/attributes/properties/decorator.js.map +1 -1
  40. package/dist/attributes/properties/inputs.js.map +1 -1
  41. package/dist/attributes/properties/typed.js.map +1 -1
  42. package/dist/attributes/render3d/orbit.js.map +1 -1
  43. package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
  44. package/dist/attributes/shape/corners/corner-style.js.map +1 -1
  45. package/dist/attributes/shape/corners/corners.js.map +1 -1
  46. package/dist/attributes/shape/corners/index.js.map +1 -1
  47. package/dist/attributes/shape/effects/backdrop.js.map +1 -1
  48. package/dist/attributes/shape/effects/chain.js.map +1 -1
  49. package/dist/attributes/shape/effects/effect-data.js.map +1 -1
  50. package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
  51. package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
  52. package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
  53. package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
  54. package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
  55. package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
  56. package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
  57. package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
  58. package/dist/attributes/shape/effects/implementations/curves.d.ts +2 -2
  59. package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
  60. package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
  61. package/dist/attributes/shape/effects/implementations/dither.d.ts +2 -2
  62. package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
  63. package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
  64. package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
  65. package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
  66. package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
  67. package/dist/attributes/shape/effects/implementations/glow.d.ts +4 -4
  68. package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
  69. package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
  70. package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
  71. package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
  72. package/dist/attributes/shape/effects/implementations/invert.d.ts +2 -2
  73. package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
  74. package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
  75. package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
  76. package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
  77. package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
  78. package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
  79. package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
  80. package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
  81. package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
  82. package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
  83. package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
  84. package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
  85. package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
  86. package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
  87. package/dist/attributes/shape/effects/implementations/shader.d.ts +2 -2
  88. package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
  89. package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
  90. package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
  91. package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
  92. package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
  93. package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
  94. package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
  95. package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
  96. package/dist/attributes/shape/effects/index.js.map +1 -1
  97. package/dist/attributes/shape/effects/registry.js.map +1 -1
  98. package/dist/attributes/shape/effects/spec.js.map +1 -1
  99. package/dist/attributes/shape/effects/union.js.map +1 -1
  100. package/dist/attributes/shape/fill/blend.js.map +1 -1
  101. package/dist/attributes/shape/fill/chain.js.map +1 -1
  102. package/dist/attributes/shape/fill/coerce.js.map +1 -1
  103. package/dist/attributes/shape/fill/color/constants.js.map +1 -1
  104. package/dist/attributes/shape/fill/color/parser.d.ts.map +1 -1
  105. package/dist/attributes/shape/fill/color/parser.js +20 -5
  106. package/dist/attributes/shape/fill/color/parser.js.map +1 -1
  107. package/dist/attributes/shape/fill/gradient-stops.js.map +1 -1
  108. package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
  109. package/dist/attributes/shape/fill/implementations/color.js.map +1 -1
  110. package/dist/attributes/shape/fill/implementations/conic-gradient.js.map +1 -1
  111. package/dist/attributes/shape/fill/implementations/dot-grid.js.map +1 -1
  112. package/dist/attributes/shape/fill/implementations/fractal-noise.js.map +1 -1
  113. package/dist/attributes/shape/fill/implementations/grid.js.map +1 -1
  114. package/dist/attributes/shape/fill/implementations/image.js.map +1 -1
  115. package/dist/attributes/shape/fill/implementations/linear-gradient.js.map +1 -1
  116. package/dist/attributes/shape/fill/implementations/noise.js.map +1 -1
  117. package/dist/attributes/shape/fill/implementations/radial-gradient.js.map +1 -1
  118. package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
  119. package/dist/attributes/shape/fill/implementations/stripe.js.map +1 -1
  120. package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
  121. package/dist/attributes/shape/fill/index.js.map +1 -1
  122. package/dist/attributes/shape/fill/lerp.js.map +1 -1
  123. package/dist/attributes/shape/fill/media-preset.js.map +1 -1
  124. package/dist/attributes/shape/fill/registry.js.map +1 -1
  125. package/dist/attributes/shape/fill/union.js.map +1 -1
  126. package/dist/attributes/shape/filters/chain.js.map +1 -1
  127. package/dist/attributes/shape/filters/implementations/alpha.js.map +1 -1
  128. package/dist/attributes/shape/filters/implementations/blur.js.map +1 -1
  129. package/dist/attributes/shape/filters/implementations/color-adjustment.js.map +1 -1
  130. package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
  131. package/dist/attributes/shape/filters/implementations/curves.js.map +1 -1
  132. package/dist/attributes/shape/filters/implementations/echo.js.map +1 -1
  133. package/dist/attributes/shape/filters/implementations/exposure.js.map +1 -1
  134. package/dist/attributes/shape/filters/implementations/grayscale.js.map +1 -1
  135. package/dist/attributes/shape/filters/implementations/posterize-time.js.map +1 -1
  136. package/dist/attributes/shape/filters/index.js.map +1 -1
  137. package/dist/attributes/shape/filters/registry.js.map +1 -1
  138. package/dist/attributes/shape/filters/union.js.map +1 -1
  139. package/dist/attributes/shape/path/anchors.js.map +1 -1
  140. package/dist/attributes/shape/path/bezier.js.map +1 -1
  141. package/dist/attributes/shape/path/index.js.map +1 -1
  142. package/dist/attributes/shape/path/measure.js.map +1 -1
  143. package/dist/attributes/shape/path/morph.js.map +1 -1
  144. package/dist/attributes/shape/path/ops.js.map +1 -1
  145. package/dist/attributes/shape/path/types.js.map +1 -1
  146. package/dist/attributes/shape/path/walk.js.map +1 -1
  147. package/dist/attributes/shape/shaders/index.js.map +1 -1
  148. package/dist/attributes/shape/shaders/language.js.map +1 -1
  149. package/dist/attributes/shape/shaders/pack.js.map +1 -1
  150. package/dist/attributes/shape/shaders/resolve.js.map +1 -1
  151. package/dist/attributes/shape/shadow/index.js.map +1 -1
  152. package/dist/attributes/shape/shadow/shadow.js.map +1 -1
  153. package/dist/attributes/shape/stroke/index.js.map +1 -1
  154. package/dist/attributes/shape/stroke/stroke.js.map +1 -1
  155. package/dist/attributes/shared/operators.js.map +1 -1
  156. package/dist/attributes/text/index.js.map +1 -1
  157. package/dist/attributes/text/ops.js.map +1 -1
  158. package/dist/attributes/text/types.js.map +1 -1
  159. package/dist/browser/chunks/{chunk-LKUYVFU3.js → chunk-4BDLFEOC.js} +1 -1
  160. package/dist/browser/chunks/chunk-4BDLFEOC.js.map +7 -0
  161. package/dist/browser/chunks/chunk-CCGVIR4F.js +3 -0
  162. package/dist/browser/chunks/chunk-CCGVIR4F.js.map +7 -0
  163. package/dist/browser/chunks/chunk-N4WSN5WY.js +13 -0
  164. package/dist/browser/chunks/chunk-N4WSN5WY.js.map +7 -0
  165. package/dist/browser/chunks/chunk-WZSI3GSK.js +6 -0
  166. package/dist/browser/chunks/chunk-WZSI3GSK.js.map +7 -0
  167. package/dist/browser/component.js +1 -1
  168. package/dist/browser/experimental.js +1 -1
  169. package/dist/browser/experimental.js.map +1 -1
  170. package/dist/browser/index.js +1 -1
  171. package/dist/browser/index.js.map +1 -1
  172. package/dist/browser/manifest.json +1 -1
  173. package/dist/browser/sdk.js +1 -1
  174. package/dist/component.js.map +1 -1
  175. package/dist/components/builtins/audio/audio.js.map +1 -1
  176. package/dist/components/builtins/geometry/composite.js.map +1 -1
  177. package/dist/components/builtins/geometry/geometry.js.map +1 -1
  178. package/dist/components/builtins/geometry/shape-outline.js.map +1 -1
  179. package/dist/components/builtins/layout/layout.js.map +1 -1
  180. package/dist/components/builtins/media/media.js.map +1 -1
  181. package/dist/components/builtins/providers/providers.js.map +1 -1
  182. package/dist/components/builtins/text/number-format.js.map +1 -1
  183. package/dist/components/builtins/text/number-pattern.js.map +1 -1
  184. package/dist/components/builtins/text/text-defaults.js.map +1 -1
  185. package/dist/components/builtins/text/text-layout.js.map +1 -1
  186. package/dist/components/builtins/text/text.d.ts +9 -9
  187. package/dist/components/builtins/text/text.js.map +1 -1
  188. package/dist/components/builtins/three/canvas3d.js.map +1 -1
  189. package/dist/components/builtins/three/grid-geometry3d.js.map +1 -1
  190. package/dist/components/builtins/three/three.js.map +1 -1
  191. package/dist/components/factory/api.js.map +1 -1
  192. package/dist/components/factory/clip-of.js.map +1 -1
  193. package/dist/components/factory/commands-for.js.map +1 -1
  194. package/dist/components/factory/component-audio.js.map +1 -1
  195. package/dist/components/factory/component2d.js.map +1 -1
  196. package/dist/components/factory/component3d.js.map +1 -1
  197. package/dist/components/factory/factory.js.map +1 -1
  198. package/dist/components/factory/timeline.js.map +1 -1
  199. package/dist/components/factory/type-def.js.map +1 -1
  200. package/dist/components/factory/types.js.map +1 -1
  201. package/dist/components/factory/views.d.ts.map +1 -1
  202. package/dist/components/factory/views.js +41 -1
  203. package/dist/components/factory/views.js.map +1 -1
  204. package/dist/components/modules/aim.js.map +1 -1
  205. package/dist/components/modules/corners.js.map +1 -1
  206. package/dist/components/modules/flow.js.map +1 -1
  207. package/dist/components/modules/material.js.map +1 -1
  208. package/dist/components/modules/paint.js.map +1 -1
  209. package/dist/components/modules/shapes.js.map +1 -1
  210. package/dist/components/modules/text-layout.js.map +1 -1
  211. package/dist/components/modules/text-style.d.ts +1 -1
  212. package/dist/components/modules/text-style.js.map +1 -1
  213. package/dist/components/modules/three-entries.js.map +1 -1
  214. package/dist/components/modules/view3d.js.map +1 -1
  215. package/dist/components/trees/2d/group-bounds.js.map +1 -1
  216. package/dist/components/trees/2d/node-lifecycle.js.map +1 -1
  217. package/dist/components/trees/2d/node-motion.js.map +1 -1
  218. package/dist/components/trees/2d/node-render.js.map +1 -1
  219. package/dist/components/trees/2d/node-space.js.map +1 -1
  220. package/dist/components/trees/2d/node-transform.js.map +1 -1
  221. package/dist/components/trees/2d/node2d.js.map +1 -1
  222. package/dist/components/trees/audio/index.js.map +1 -1
  223. package/dist/components/trees/audio/node-audio.js.map +1 -1
  224. package/dist/components/trees/index.js.map +1 -1
  225. package/dist/components/trees/node/node-editor-state.js.map +1 -1
  226. package/dist/components/trees/node/node-reactive.d.ts +3 -4
  227. package/dist/components/trees/node/node-reactive.d.ts.map +1 -1
  228. package/dist/components/trees/node/node-reactive.js +13 -10
  229. package/dist/components/trees/node/node-reactive.js.map +1 -1
  230. package/dist/components/trees/node/node-time.js.map +1 -1
  231. package/dist/components/trees/node/node-walk.js.map +1 -1
  232. package/dist/components/trees/node/node.js.map +1 -1
  233. package/dist/components/trees/root/canvas2d-node.js.map +1 -1
  234. package/dist/components/trees/three/node3d.js.map +1 -1
  235. package/dist/document/audio.js.map +1 -1
  236. package/dist/document/builtins.js.map +1 -1
  237. package/dist/document/command-traits.d.ts +8 -0
  238. package/dist/document/command-traits.d.ts.map +1 -1
  239. package/dist/document/command-traits.js +17 -0
  240. package/dist/document/command-traits.js.map +1 -1
  241. package/dist/document/deny-globals.js.map +1 -1
  242. package/dist/document/diff.js.map +1 -1
  243. package/dist/document/doc-index.js.map +1 -1
  244. package/dist/document/expression/compile.js.map +1 -1
  245. package/dist/document/expression/index.js.map +1 -1
  246. package/dist/document/expression/ops.js.map +1 -1
  247. package/dist/document/expression/parse.js.map +1 -1
  248. package/dist/document/expression/refs.js.map +1 -1
  249. package/dist/document/expression/types.js.map +1 -1
  250. package/dist/document/expression/walk.js.map +1 -1
  251. package/dist/document/index.js.map +1 -1
  252. package/dist/document/migrate.js.map +1 -1
  253. package/dist/document/missing-node.js.map +1 -1
  254. package/dist/document/node-decorator.js.map +1 -1
  255. package/dist/document/node-descriptor.js.map +1 -1
  256. package/dist/document/placement.js.map +1 -1
  257. package/dist/document/project.js.map +1 -1
  258. package/dist/document/prop-evolution.js.map +1 -1
  259. package/dist/document/registry.js.map +1 -1
  260. package/dist/document/settled-index.d.ts +6 -0
  261. package/dist/document/settled-index.d.ts.map +1 -1
  262. package/dist/document/settled-index.js +18 -1
  263. package/dist/document/settled-index.js.map +1 -1
  264. package/dist/document/timeline-patch.js.map +1 -1
  265. package/dist/document/timeline.d.ts.map +1 -1
  266. package/dist/document/timeline.js +26 -6
  267. package/dist/document/timeline.js.map +1 -1
  268. package/dist/document/types.js.map +1 -1
  269. package/dist/document/validate.js.map +1 -1
  270. package/dist/document/vocabulary.js.map +1 -1
  271. package/dist/experimental.d.ts.map +1 -1
  272. package/dist/experimental.js.map +1 -1
  273. package/dist/index.js.map +1 -1
  274. package/dist/layout/bounds.js.map +1 -1
  275. package/dist/layout/constraints.js.map +1 -1
  276. package/dist/layout/flex.js.map +1 -1
  277. package/dist/layout/freeform.js.map +1 -1
  278. package/dist/layout/grid.js.map +1 -1
  279. package/dist/layout/index.js.map +1 -1
  280. package/dist/layout/item.js.map +1 -1
  281. package/dist/layout/ops.js.map +1 -1
  282. package/dist/layout/types.js.map +1 -1
  283. package/dist/platform/audio-sink.js.map +1 -1
  284. package/dist/platform/exporter.js.map +1 -1
  285. package/dist/platform/index.js.map +1 -1
  286. package/dist/platform/stepped-clock.js.map +1 -1
  287. package/dist/platform/storage-adapter.js.map +1 -1
  288. package/dist/platform/ticker.js.map +1 -1
  289. package/dist/project/config.js.map +1 -1
  290. package/dist/project/index.js.map +1 -1
  291. package/dist/project/tree.js.map +1 -1
  292. package/dist/props/host.d.ts +5 -0
  293. package/dist/props/host.d.ts.map +1 -1
  294. package/dist/props/host.js +3 -1
  295. package/dist/props/host.js.map +1 -1
  296. package/dist/props/index.js.map +1 -1
  297. package/dist/props/layout.d.ts +29 -0
  298. package/dist/props/layout.d.ts.map +1 -0
  299. package/dist/props/layout.js +84 -0
  300. package/dist/props/layout.js.map +1 -0
  301. package/dist/props/observer.js.map +1 -1
  302. package/dist/props/slot.js.map +1 -1
  303. package/dist/renamed-scene-names.js.map +1 -1
  304. package/dist/render/canvas-render-context2d.js.map +1 -1
  305. package/dist/render/clip-contains.js.map +1 -1
  306. package/dist/render/clip.js.map +1 -1
  307. package/dist/render/descriptors/ellipse.js.map +1 -1
  308. package/dist/render/descriptors/line.js.map +1 -1
  309. package/dist/render/descriptors/path-builder.js.map +1 -1
  310. package/dist/render/descriptors/path.js.map +1 -1
  311. package/dist/render/descriptors/polygon.js.map +1 -1
  312. package/dist/render/descriptors/polygram.js.map +1 -1
  313. package/dist/render/descriptors/rect.js.map +1 -1
  314. package/dist/render/descriptors/richtext.js.map +1 -1
  315. package/dist/render/descriptors/shape.js.map +1 -1
  316. package/dist/render/descriptors/text.js.map +1 -1
  317. package/dist/render/descriptors/transform.js.map +1 -1
  318. package/dist/render/graphics2d.js.map +1 -1
  319. package/dist/render/index.js.map +1 -1
  320. package/dist/render/measure-context.js.map +1 -1
  321. package/dist/render/null-render-context.js.map +1 -1
  322. package/dist/render/render-context2d.js.map +1 -1
  323. package/dist/render/render-issue.js.map +1 -1
  324. package/dist/render/surface.js.map +1 -1
  325. package/dist/render/text-defaults.js.map +1 -1
  326. package/dist/render/text-layout.js.map +1 -1
  327. package/dist/render3d/bounds3d.js.map +1 -1
  328. package/dist/render3d/builders.js.map +1 -1
  329. package/dist/render3d/camera.js.map +1 -1
  330. package/dist/render3d/fill3d.js.map +1 -1
  331. package/dist/render3d/geometry.js.map +1 -1
  332. package/dist/render3d/graphics3d.js.map +1 -1
  333. package/dist/render3d/index.js.map +1 -1
  334. package/dist/render3d/inert.js.map +1 -1
  335. package/dist/render3d/light.js.map +1 -1
  336. package/dist/render3d/material.js.map +1 -1
  337. package/dist/render3d/matrix4.js.map +1 -1
  338. package/dist/render3d/render-context3d.js.map +1 -1
  339. package/dist/render3d/resources.js.map +1 -1
  340. package/dist/render3d/rounded-box.js.map +1 -1
  341. package/dist/render3d/scene-settings.js.map +1 -1
  342. package/dist/render3d/scene3d.js.map +1 -1
  343. package/dist/render3d/segments.js.map +1 -1
  344. package/dist/render3d/texture.js.map +1 -1
  345. package/dist/render3d/tracking.js.map +1 -1
  346. package/dist/render3d/transform.js.map +1 -1
  347. package/dist/render3d/vector3.js.map +1 -1
  348. package/dist/render3d/walk.js.map +1 -1
  349. package/dist/runtime/asset-refine.js.map +1 -1
  350. package/dist/runtime/asset-timeline.js.map +1 -1
  351. package/dist/runtime/asset-update.js.map +1 -1
  352. package/dist/runtime/audio-index.js.map +1 -1
  353. package/dist/runtime/builtin-context.js.map +1 -1
  354. package/dist/runtime/clip-instance.js.map +1 -1
  355. package/dist/runtime/clip-store.js.map +1 -1
  356. package/dist/runtime/engine.js.map +1 -1
  357. package/dist/runtime/frame-time.js.map +1 -1
  358. package/dist/runtime/index.js.map +1 -1
  359. package/dist/runtime/node-picking.js.map +1 -1
  360. package/dist/runtime/node-picking3d.js.map +1 -1
  361. package/dist/runtime/placement.js.map +1 -1
  362. package/dist/runtime/playback-controller.js.map +1 -1
  363. package/dist/runtime/playback.js.map +1 -1
  364. package/dist/runtime/precompisition.js.map +1 -1
  365. package/dist/runtime/project-assets.js.map +1 -1
  366. package/dist/runtime/session.js.map +1 -1
  367. package/dist/runtime/settle.js.map +1 -1
  368. package/dist/runtime/state-evaluator.js.map +1 -1
  369. package/dist/runtime/text-geometry.js.map +1 -1
  370. package/dist/sdk/index.js.map +1 -1
  371. package/dist/tween/command-decorator.js.map +1 -1
  372. package/dist/tween/command.js.map +1 -1
  373. package/dist/tween/ease/constants.js.map +1 -1
  374. package/dist/tween/ease/curve.js.map +1 -1
  375. package/dist/tween/ease/describe.js.map +1 -1
  376. package/dist/tween/ease/spec.js.map +1 -1
  377. package/dist/tween/ease/type.js.map +1 -1
  378. package/dist/tween/index.js.map +1 -1
  379. package/dist/tween/inert.js.map +1 -1
  380. package/dist/tween/lerp.js.map +1 -1
  381. package/dist/tween/loop.js.map +1 -1
  382. package/dist/tween/prepare.js.map +1 -1
  383. package/dist/tween/stepper.js.map +1 -1
  384. package/dist/tween/to-command.js.map +1 -1
  385. package/dist/util/clamp.js.map +1 -1
  386. package/dist/util/context.js.map +1 -1
  387. package/dist/util/csv.js.map +1 -1
  388. package/dist/util/generateList.js.map +1 -1
  389. package/dist/util/index.js.map +1 -1
  390. package/dist/util/metrics.js.map +1 -1
  391. package/dist/util/random.js.map +1 -1
  392. package/dist/util/reference.js.map +1 -1
  393. package/dist/util/scheduler.js.map +1 -1
  394. package/package.json +1 -1
  395. package/dist/attributes/audio/filters/chain.d.ts +0 -113
  396. package/dist/attributes/audio/filters/chain.d.ts.map +0 -1
  397. package/dist/attributes/audio/filters/chain.js +0 -104
  398. package/dist/attributes/audio/filters/chain.js.map +0 -1
  399. package/dist/attributes/audio/filters/curve.d.ts +0 -152
  400. package/dist/attributes/audio/filters/curve.d.ts.map +0 -1
  401. package/dist/attributes/audio/filters/curve.js +0 -250
  402. package/dist/attributes/audio/filters/curve.js.map +0 -1
  403. package/dist/attributes/audio/filters/implementations/echo.d.ts +0 -14
  404. package/dist/attributes/audio/filters/implementations/echo.d.ts.map +0 -1
  405. package/dist/attributes/audio/filters/implementations/echo.js +0 -11
  406. package/dist/attributes/audio/filters/implementations/echo.js.map +0 -1
  407. package/dist/attributes/audio/filters/implementations/gain.d.ts +0 -10
  408. package/dist/attributes/audio/filters/implementations/gain.d.ts.map +0 -1
  409. package/dist/attributes/audio/filters/implementations/gain.js +0 -6
  410. package/dist/attributes/audio/filters/implementations/gain.js.map +0 -1
  411. package/dist/attributes/audio/filters/implementations/highpass.d.ts +0 -12
  412. package/dist/attributes/audio/filters/implementations/highpass.d.ts.map +0 -1
  413. package/dist/attributes/audio/filters/implementations/highpass.js +0 -10
  414. package/dist/attributes/audio/filters/implementations/highpass.js.map +0 -1
  415. package/dist/attributes/audio/filters/implementations/lowpass.d.ts +0 -12
  416. package/dist/attributes/audio/filters/implementations/lowpass.d.ts.map +0 -1
  417. package/dist/attributes/audio/filters/implementations/lowpass.js +0 -10
  418. package/dist/attributes/audio/filters/implementations/lowpass.js.map +0 -1
  419. package/dist/attributes/audio/filters/implementations/speed.d.ts +0 -18
  420. package/dist/attributes/audio/filters/implementations/speed.d.ts.map +0 -1
  421. package/dist/attributes/audio/filters/implementations/speed.js +0 -6
  422. package/dist/attributes/audio/filters/implementations/speed.js.map +0 -1
  423. package/dist/attributes/audio/filters/implementations/tremolo.d.ts +0 -12
  424. package/dist/attributes/audio/filters/implementations/tremolo.d.ts.map +0 -1
  425. package/dist/attributes/audio/filters/implementations/tremolo.js +0 -10
  426. package/dist/attributes/audio/filters/implementations/tremolo.js.map +0 -1
  427. package/dist/attributes/audio/filters/index.d.ts +0 -22
  428. package/dist/attributes/audio/filters/index.d.ts.map +0 -1
  429. package/dist/attributes/audio/filters/index.js +0 -8
  430. package/dist/attributes/audio/filters/index.js.map +0 -1
  431. package/dist/attributes/audio/filters/registry.d.ts +0 -36
  432. package/dist/attributes/audio/filters/registry.d.ts.map +0 -1
  433. package/dist/attributes/audio/filters/registry.js +0 -82
  434. package/dist/attributes/audio/filters/registry.js.map +0 -1
  435. package/dist/attributes/audio/filters/union.d.ts +0 -18
  436. package/dist/attributes/audio/filters/union.d.ts.map +0 -1
  437. package/dist/attributes/audio/filters/union.js +0 -28
  438. package/dist/attributes/audio/filters/union.js.map +0 -1
  439. package/dist/attributes/shape/sksl-uniforms.d.ts +0 -146
  440. package/dist/attributes/shape/sksl-uniforms.d.ts.map +0 -1
  441. package/dist/attributes/shape/sksl-uniforms.js +0 -0
  442. package/dist/attributes/shape/sksl-uniforms.js.map +0 -1
  443. package/dist/browser/chunks/chunk-AOT33LMS.js +0 -13
  444. package/dist/browser/chunks/chunk-AOT33LMS.js.map +0 -7
  445. package/dist/browser/chunks/chunk-GKM6UZJR.js +0 -6
  446. package/dist/browser/chunks/chunk-GKM6UZJR.js.map +0 -7
  447. package/dist/browser/chunks/chunk-LKUYVFU3.js.map +0 -7
  448. package/dist/browser/chunks/chunk-ZRPZPWZU.js +0 -3
  449. package/dist/browser/chunks/chunk-ZRPZPWZU.js.map +0 -7
  450. package/dist/component/api.d.ts +0 -508
  451. package/dist/component/api.d.ts.map +0 -1
  452. package/dist/component/api.js +0 -4
  453. package/dist/component/api.js.map +0 -1
  454. package/dist/component/builtins/audio.d.ts +0 -26
  455. package/dist/component/builtins/audio.d.ts.map +0 -1
  456. package/dist/component/builtins/audio.js +0 -41
  457. package/dist/component/builtins/audio.js.map +0 -1
  458. package/dist/component/builtins/canvas3d.d.ts +0 -98
  459. package/dist/component/builtins/canvas3d.d.ts.map +0 -1
  460. package/dist/component/builtins/canvas3d.js +0 -21
  461. package/dist/component/builtins/canvas3d.js.map +0 -1
  462. package/dist/component/builtins/composite.d.ts +0 -56
  463. package/dist/component/builtins/composite.d.ts.map +0 -1
  464. package/dist/component/builtins/composite.js +0 -25
  465. package/dist/component/builtins/composite.js.map +0 -1
  466. package/dist/component/builtins/geometry.d.ts +0 -505
  467. package/dist/component/builtins/geometry.d.ts.map +0 -1
  468. package/dist/component/builtins/geometry.js +0 -107
  469. package/dist/component/builtins/geometry.js.map +0 -1
  470. package/dist/component/builtins/layout.d.ts +0 -88
  471. package/dist/component/builtins/layout.d.ts.map +0 -1
  472. package/dist/component/builtins/layout.js +0 -84
  473. package/dist/component/builtins/layout.js.map +0 -1
  474. package/dist/component/builtins/media.d.ts +0 -95
  475. package/dist/component/builtins/media.d.ts.map +0 -1
  476. package/dist/component/builtins/media.js +0 -149
  477. package/dist/component/builtins/media.js.map +0 -1
  478. package/dist/component/builtins/providers.d.ts +0 -23
  479. package/dist/component/builtins/providers.d.ts.map +0 -1
  480. package/dist/component/builtins/providers.js +0 -30
  481. package/dist/component/builtins/providers.js.map +0 -1
  482. package/dist/component/builtins/text.d.ts +0 -193
  483. package/dist/component/builtins/text.d.ts.map +0 -1
  484. package/dist/component/builtins/text.js +0 -113
  485. package/dist/component/builtins/text.js.map +0 -1
  486. package/dist/component/builtins/three.d.ts +0 -1085
  487. package/dist/component/builtins/three.d.ts.map +0 -1
  488. package/dist/component/builtins/three.js +0 -265
  489. package/dist/component/builtins/three.js.map +0 -1
  490. package/dist/component/clip-of.d.ts +0 -5
  491. package/dist/component/clip-of.d.ts.map +0 -1
  492. package/dist/component/clip-of.js +0 -33
  493. package/dist/component/clip-of.js.map +0 -1
  494. package/dist/component/commands-for.d.ts +0 -19
  495. package/dist/component/commands-for.d.ts.map +0 -1
  496. package/dist/component/commands-for.js +0 -5
  497. package/dist/component/commands-for.js.map +0 -1
  498. package/dist/component/component-audio.d.ts +0 -9
  499. package/dist/component/component-audio.d.ts.map +0 -1
  500. package/dist/component/component-audio.js +0 -18
  501. package/dist/component/component-audio.js.map +0 -1
  502. package/dist/component/component2d.d.ts +0 -9
  503. package/dist/component/component2d.d.ts.map +0 -1
  504. package/dist/component/component2d.js +0 -239
  505. package/dist/component/component2d.js.map +0 -1
  506. package/dist/component/component3d.d.ts +0 -9
  507. package/dist/component/component3d.d.ts.map +0 -1
  508. package/dist/component/component3d.js +0 -99
  509. package/dist/component/component3d.js.map +0 -1
  510. package/dist/component/factory.d.ts +0 -63
  511. package/dist/component/factory.d.ts.map +0 -1
  512. package/dist/component/factory.js +0 -313
  513. package/dist/component/factory.js.map +0 -1
  514. package/dist/component/modules/aim.d.ts +0 -30
  515. package/dist/component/modules/aim.d.ts.map +0 -1
  516. package/dist/component/modules/aim.js +0 -39
  517. package/dist/component/modules/aim.js.map +0 -1
  518. package/dist/component/modules/corners.d.ts +0 -13
  519. package/dist/component/modules/corners.d.ts.map +0 -1
  520. package/dist/component/modules/corners.js +0 -12
  521. package/dist/component/modules/corners.js.map +0 -1
  522. package/dist/component/modules/flow.d.ts +0 -26
  523. package/dist/component/modules/flow.d.ts.map +0 -1
  524. package/dist/component/modules/flow.js +0 -55
  525. package/dist/component/modules/flow.js.map +0 -1
  526. package/dist/component/modules/material.d.ts +0 -40
  527. package/dist/component/modules/material.d.ts.map +0 -1
  528. package/dist/component/modules/material.js +0 -75
  529. package/dist/component/modules/material.js.map +0 -1
  530. package/dist/component/modules/paint.d.ts +0 -71
  531. package/dist/component/modules/paint.d.ts.map +0 -1
  532. package/dist/component/modules/paint.js +0 -106
  533. package/dist/component/modules/paint.js.map +0 -1
  534. package/dist/component/modules/shapes.d.ts +0 -31
  535. package/dist/component/modules/shapes.d.ts.map +0 -1
  536. package/dist/component/modules/shapes.js +0 -43
  537. package/dist/component/modules/shapes.js.map +0 -1
  538. package/dist/component/modules/text-layout.d.ts +0 -26
  539. package/dist/component/modules/text-layout.d.ts.map +0 -1
  540. package/dist/component/modules/text-layout.js +0 -57
  541. package/dist/component/modules/text-layout.js.map +0 -1
  542. package/dist/component/modules/text-style.d.ts +0 -48
  543. package/dist/component/modules/text-style.d.ts.map +0 -1
  544. package/dist/component/modules/text-style.js +0 -63
  545. package/dist/component/modules/text-style.js.map +0 -1
  546. package/dist/component/modules/three-entries.d.ts +0 -23
  547. package/dist/component/modules/three-entries.d.ts.map +0 -1
  548. package/dist/component/modules/three-entries.js +0 -41
  549. package/dist/component/modules/three-entries.js.map +0 -1
  550. package/dist/component/modules/view3d.d.ts +0 -55
  551. package/dist/component/modules/view3d.d.ts.map +0 -1
  552. package/dist/component/modules/view3d.js +0 -160
  553. package/dist/component/modules/view3d.js.map +0 -1
  554. package/dist/component/timeline.d.ts +0 -22
  555. package/dist/component/timeline.d.ts.map +0 -1
  556. package/dist/component/timeline.js +0 -128
  557. package/dist/component/timeline.js.map +0 -1
  558. package/dist/component/type-def.d.ts +0 -26
  559. package/dist/component/type-def.d.ts.map +0 -1
  560. package/dist/component/type-def.js +0 -16
  561. package/dist/component/type-def.js.map +0 -1
  562. package/dist/component/types.d.ts +0 -91
  563. package/dist/component/types.d.ts.map +0 -1
  564. package/dist/component/types.js +0 -88
  565. package/dist/component/types.js.map +0 -1
  566. package/dist/component/views.d.ts +0 -121
  567. package/dist/component/views.d.ts.map +0 -1
  568. package/dist/component/views.js +0 -413
  569. package/dist/component/views.js.map +0 -1
  570. package/dist/document/withdraw.d.ts +0 -28
  571. package/dist/document/withdraw.d.ts.map +0 -1
  572. package/dist/document/withdraw.js +0 -61
  573. package/dist/document/withdraw.js.map +0 -1
  574. package/dist/jsx/jsx-dev-runtime.d.ts +0 -3
  575. package/dist/jsx/jsx-dev-runtime.d.ts.map +0 -1
  576. package/dist/jsx/jsx-dev-runtime.js +0 -3
  577. package/dist/jsx/jsx-dev-runtime.js.map +0 -1
  578. package/dist/jsx/jsx-runtime.d.ts +0 -27
  579. package/dist/jsx/jsx-runtime.d.ts.map +0 -1
  580. package/dist/jsx/jsx-runtime.js +0 -26
  581. package/dist/jsx/jsx-runtime.js.map +0 -1
  582. package/dist/nodes/2d/node-lifecycle.d.ts +0 -46
  583. package/dist/nodes/2d/node-lifecycle.d.ts.map +0 -1
  584. package/dist/nodes/2d/node-lifecycle.js +0 -264
  585. package/dist/nodes/2d/node-lifecycle.js.map +0 -1
  586. package/dist/nodes/2d/node-motion.d.ts +0 -56
  587. package/dist/nodes/2d/node-motion.d.ts.map +0 -1
  588. package/dist/nodes/2d/node-motion.js +0 -86
  589. package/dist/nodes/2d/node-motion.js.map +0 -1
  590. package/dist/nodes/2d/node-render.d.ts +0 -44
  591. package/dist/nodes/2d/node-render.d.ts.map +0 -1
  592. package/dist/nodes/2d/node-render.js +0 -80
  593. package/dist/nodes/2d/node-render.js.map +0 -1
  594. package/dist/nodes/2d/node-space.d.ts +0 -63
  595. package/dist/nodes/2d/node-space.d.ts.map +0 -1
  596. package/dist/nodes/2d/node-space.js +0 -131
  597. package/dist/nodes/2d/node-space.js.map +0 -1
  598. package/dist/nodes/2d/node-transform.d.ts +0 -55
  599. package/dist/nodes/2d/node-transform.d.ts.map +0 -1
  600. package/dist/nodes/2d/node-transform.js +0 -73
  601. package/dist/nodes/2d/node-transform.js.map +0 -1
  602. package/dist/nodes/2d/node2d.d.ts +0 -1111
  603. package/dist/nodes/2d/node2d.d.ts.map +0 -1
  604. package/dist/nodes/2d/node2d.js +0 -1665
  605. package/dist/nodes/2d/node2d.js.map +0 -1
  606. package/dist/nodes/2d/paint-node.d.ts +0 -142
  607. package/dist/nodes/2d/paint-node.d.ts.map +0 -1
  608. package/dist/nodes/2d/paint-node.js +0 -232
  609. package/dist/nodes/2d/paint-node.js.map +0 -1
  610. package/dist/nodes/audio/audio-bus.d.ts +0 -28
  611. package/dist/nodes/audio/audio-bus.d.ts.map +0 -1
  612. package/dist/nodes/audio/audio-bus.js +0 -33
  613. package/dist/nodes/audio/audio-bus.js.map +0 -1
  614. package/dist/nodes/audio/index.d.ts +0 -4
  615. package/dist/nodes/audio/index.d.ts.map +0 -1
  616. package/dist/nodes/audio/index.js +0 -2
  617. package/dist/nodes/audio/index.js.map +0 -1
  618. package/dist/nodes/audio/node-audio.d.ts +0 -107
  619. package/dist/nodes/audio/node-audio.d.ts.map +0 -1
  620. package/dist/nodes/audio/node-audio.js +0 -179
  621. package/dist/nodes/audio/node-audio.js.map +0 -1
  622. package/dist/nodes/audio/sound-node.d.ts +0 -41
  623. package/dist/nodes/audio/sound-node.d.ts.map +0 -1
  624. package/dist/nodes/audio/sound-node.js +0 -71
  625. package/dist/nodes/audio/sound-node.js.map +0 -1
  626. package/dist/nodes/geometry/boolean-node.d.ts +0 -28
  627. package/dist/nodes/geometry/boolean-node.d.ts.map +0 -1
  628. package/dist/nodes/geometry/boolean-node.js +0 -81
  629. package/dist/nodes/geometry/boolean-node.js.map +0 -1
  630. package/dist/nodes/geometry/bounds-shape-node.d.ts +0 -149
  631. package/dist/nodes/geometry/bounds-shape-node.d.ts.map +0 -1
  632. package/dist/nodes/geometry/bounds-shape-node.js +0 -181
  633. package/dist/nodes/geometry/bounds-shape-node.js.map +0 -1
  634. package/dist/nodes/geometry/box-path-node.d.ts +0 -89
  635. package/dist/nodes/geometry/box-path-node.d.ts.map +0 -1
  636. package/dist/nodes/geometry/box-path-node.js +0 -116
  637. package/dist/nodes/geometry/box-path-node.js.map +0 -1
  638. package/dist/nodes/geometry/ellipse-node.d.ts +0 -18
  639. package/dist/nodes/geometry/ellipse-node.d.ts.map +0 -1
  640. package/dist/nodes/geometry/ellipse-node.js +0 -45
  641. package/dist/nodes/geometry/ellipse-node.js.map +0 -1
  642. package/dist/nodes/geometry/group-bounds.d.ts +0 -56
  643. package/dist/nodes/geometry/group-bounds.d.ts.map +0 -1
  644. package/dist/nodes/geometry/group-bounds.js +0 -87
  645. package/dist/nodes/geometry/group-bounds.js.map +0 -1
  646. package/dist/nodes/geometry/mask-node.d.ts +0 -33
  647. package/dist/nodes/geometry/mask-node.d.ts.map +0 -1
  648. package/dist/nodes/geometry/mask-node.js +0 -66
  649. package/dist/nodes/geometry/mask-node.js.map +0 -1
  650. package/dist/nodes/geometry/path-node.d.ts +0 -26
  651. package/dist/nodes/geometry/path-node.d.ts.map +0 -1
  652. package/dist/nodes/geometry/path-node.js +0 -58
  653. package/dist/nodes/geometry/path-node.js.map +0 -1
  654. package/dist/nodes/geometry/polygon-node.d.ts +0 -26
  655. package/dist/nodes/geometry/polygon-node.d.ts.map +0 -1
  656. package/dist/nodes/geometry/polygon-node.js +0 -47
  657. package/dist/nodes/geometry/polygon-node.js.map +0 -1
  658. package/dist/nodes/geometry/polygram-node.d.ts +0 -33
  659. package/dist/nodes/geometry/polygram-node.d.ts.map +0 -1
  660. package/dist/nodes/geometry/polygram-node.js +0 -52
  661. package/dist/nodes/geometry/polygram-node.js.map +0 -1
  662. package/dist/nodes/geometry/rect-node.d.ts +0 -38
  663. package/dist/nodes/geometry/rect-node.d.ts.map +0 -1
  664. package/dist/nodes/geometry/rect-node.js +0 -56
  665. package/dist/nodes/geometry/rect-node.js.map +0 -1
  666. package/dist/nodes/geometry/shape-node.d.ts +0 -71
  667. package/dist/nodes/geometry/shape-node.d.ts.map +0 -1
  668. package/dist/nodes/geometry/shape-node.js +0 -140
  669. package/dist/nodes/geometry/shape-node.js.map +0 -1
  670. package/dist/nodes/geometry/shape-outline.d.ts +0 -93
  671. package/dist/nodes/geometry/shape-outline.d.ts.map +0 -1
  672. package/dist/nodes/geometry/shape-outline.js +0 -470
  673. package/dist/nodes/geometry/shape-outline.js.map +0 -1
  674. package/dist/nodes/index.d.ts +0 -53
  675. package/dist/nodes/index.d.ts.map +0 -1
  676. package/dist/nodes/index.js +0 -35
  677. package/dist/nodes/index.js.map +0 -1
  678. package/dist/nodes/layout/camera-node.d.ts +0 -80
  679. package/dist/nodes/layout/camera-node.d.ts.map +0 -1
  680. package/dist/nodes/layout/camera-node.js +0 -153
  681. package/dist/nodes/layout/camera-node.js.map +0 -1
  682. package/dist/nodes/layout/orbit-camera-node.d.ts +0 -80
  683. package/dist/nodes/layout/orbit-camera-node.d.ts.map +0 -1
  684. package/dist/nodes/layout/orbit-camera-node.js +0 -118
  685. package/dist/nodes/layout/orbit-camera-node.js.map +0 -1
  686. package/dist/nodes/layout/rotated-box.d.ts +0 -20
  687. package/dist/nodes/layout/rotated-box.d.ts.map +0 -1
  688. package/dist/nodes/layout/rotated-box.js +0 -76
  689. package/dist/nodes/layout/rotated-box.js.map +0 -1
  690. package/dist/nodes/media/video-node.d.ts +0 -229
  691. package/dist/nodes/media/video-node.d.ts.map +0 -1
  692. package/dist/nodes/media/video-node.js +0 -350
  693. package/dist/nodes/media/video-node.js.map +0 -1
  694. package/dist/nodes/node/declare-paints.d.ts +0 -19
  695. package/dist/nodes/node/declare-paints.d.ts.map +0 -1
  696. package/dist/nodes/node/declare-paints.js +0 -27
  697. package/dist/nodes/node/declare-paints.js.map +0 -1
  698. package/dist/nodes/node/node-editor-state.d.ts +0 -53
  699. package/dist/nodes/node/node-editor-state.d.ts.map +0 -1
  700. package/dist/nodes/node/node-editor-state.js +0 -23
  701. package/dist/nodes/node/node-editor-state.js.map +0 -1
  702. package/dist/nodes/node/node-reactive.d.ts +0 -89
  703. package/dist/nodes/node/node-reactive.d.ts.map +0 -1
  704. package/dist/nodes/node/node-reactive.js +0 -135
  705. package/dist/nodes/node/node-reactive.js.map +0 -1
  706. package/dist/nodes/node/node-time.d.ts +0 -39
  707. package/dist/nodes/node/node-time.d.ts.map +0 -1
  708. package/dist/nodes/node/node-time.js +0 -14
  709. package/dist/nodes/node/node-time.js.map +0 -1
  710. package/dist/nodes/node/node-walk.d.ts +0 -46
  711. package/dist/nodes/node/node-walk.d.ts.map +0 -1
  712. package/dist/nodes/node/node-walk.js +0 -74
  713. package/dist/nodes/node/node-walk.js.map +0 -1
  714. package/dist/nodes/node/node.d.ts +0 -445
  715. package/dist/nodes/node/node.d.ts.map +0 -1
  716. package/dist/nodes/node/node.js +0 -745
  717. package/dist/nodes/node/node.js.map +0 -1
  718. package/dist/nodes/node/text-defaults.d.ts +0 -32
  719. package/dist/nodes/node/text-defaults.d.ts.map +0 -1
  720. package/dist/nodes/node/text-defaults.js +0 -37
  721. package/dist/nodes/node/text-defaults.js.map +0 -1
  722. package/dist/nodes/root/canvas2d-node.d.ts +0 -163
  723. package/dist/nodes/root/canvas2d-node.d.ts.map +0 -1
  724. package/dist/nodes/root/canvas2d-node.js +0 -264
  725. package/dist/nodes/root/canvas2d-node.js.map +0 -1
  726. package/dist/nodes/root/provider-node.d.ts +0 -47
  727. package/dist/nodes/root/provider-node.d.ts.map +0 -1
  728. package/dist/nodes/root/provider-node.js +0 -63
  729. package/dist/nodes/root/provider-node.js.map +0 -1
  730. package/dist/nodes/root/theme-provider-node.d.ts +0 -29
  731. package/dist/nodes/root/theme-provider-node.d.ts.map +0 -1
  732. package/dist/nodes/root/theme-provider-node.js +0 -43
  733. package/dist/nodes/root/theme-provider-node.js.map +0 -1
  734. package/dist/nodes/text/default-text-style-node.d.ts +0 -103
  735. package/dist/nodes/text/default-text-style-node.d.ts.map +0 -1
  736. package/dist/nodes/text/default-text-style-node.js +0 -146
  737. package/dist/nodes/text/default-text-style-node.js.map +0 -1
  738. package/dist/nodes/text/number-format.d.ts +0 -66
  739. package/dist/nodes/text/number-format.d.ts.map +0 -1
  740. package/dist/nodes/text/number-format.js +0 -227
  741. package/dist/nodes/text/number-format.js.map +0 -1
  742. package/dist/nodes/text/number-node.d.ts +0 -94
  743. package/dist/nodes/text/number-node.d.ts.map +0 -1
  744. package/dist/nodes/text/number-node.js +0 -86
  745. package/dist/nodes/text/number-node.js.map +0 -1
  746. package/dist/nodes/text/number-pattern.d.ts +0 -51
  747. package/dist/nodes/text/number-pattern.d.ts.map +0 -1
  748. package/dist/nodes/text/number-pattern.js +0 -77
  749. package/dist/nodes/text/number-pattern.js.map +0 -1
  750. package/dist/nodes/text/richtext-node.d.ts +0 -68
  751. package/dist/nodes/text/richtext-node.d.ts.map +0 -1
  752. package/dist/nodes/text/richtext-node.js +0 -78
  753. package/dist/nodes/text/richtext-node.js.map +0 -1
  754. package/dist/nodes/text/text-base.d.ts +0 -118
  755. package/dist/nodes/text/text-base.d.ts.map +0 -1
  756. package/dist/nodes/text/text-base.js +0 -153
  757. package/dist/nodes/text/text-base.js.map +0 -1
  758. package/dist/nodes/text/text-layout.d.ts +0 -87
  759. package/dist/nodes/text/text-layout.d.ts.map +0 -1
  760. package/dist/nodes/text/text-layout.js +0 -368
  761. package/dist/nodes/text/text-layout.js.map +0 -1
  762. package/dist/nodes/text/text-node.d.ts +0 -84
  763. package/dist/nodes/text/text-node.d.ts.map +0 -1
  764. package/dist/nodes/text/text-node.js +0 -188
  765. package/dist/nodes/text/text-node.js.map +0 -1
  766. package/dist/nodes/text/text-selection.d.ts +0 -125
  767. package/dist/nodes/text/text-selection.d.ts.map +0 -1
  768. package/dist/nodes/text/text-selection.js +0 -209
  769. package/dist/nodes/text/text-selection.js.map +0 -1
  770. package/dist/nodes/three/camera-nodes.d.ts +0 -109
  771. package/dist/nodes/three/camera-nodes.d.ts.map +0 -1
  772. package/dist/nodes/three/camera-nodes.js +0 -112
  773. package/dist/nodes/three/camera-nodes.js.map +0 -1
  774. package/dist/nodes/three/canvas3d-node.d.ts +0 -295
  775. package/dist/nodes/three/canvas3d-node.d.ts.map +0 -1
  776. package/dist/nodes/three/canvas3d-node.js +0 -486
  777. package/dist/nodes/three/canvas3d-node.js.map +0 -1
  778. package/dist/nodes/three/drawable-nodes.d.ts +0 -173
  779. package/dist/nodes/three/drawable-nodes.d.ts.map +0 -1
  780. package/dist/nodes/three/drawable-nodes.js +0 -284
  781. package/dist/nodes/three/drawable-nodes.js.map +0 -1
  782. package/dist/nodes/three/environment-nodes.d.ts +0 -106
  783. package/dist/nodes/three/environment-nodes.d.ts.map +0 -1
  784. package/dist/nodes/three/environment-nodes.js +0 -134
  785. package/dist/nodes/three/environment-nodes.js.map +0 -1
  786. package/dist/nodes/three/geometry-nodes.d.ts +0 -197
  787. package/dist/nodes/three/geometry-nodes.d.ts.map +0 -1
  788. package/dist/nodes/three/geometry-nodes.js +0 -322
  789. package/dist/nodes/three/geometry-nodes.js.map +0 -1
  790. package/dist/nodes/three/grid-geometry3d.d.ts +0 -62
  791. package/dist/nodes/three/grid-geometry3d.d.ts.map +0 -1
  792. package/dist/nodes/three/grid-geometry3d.js +0 -114
  793. package/dist/nodes/three/grid-geometry3d.js.map +0 -1
  794. package/dist/nodes/three/group3d.d.ts +0 -23
  795. package/dist/nodes/three/group3d.d.ts.map +0 -1
  796. package/dist/nodes/three/group3d.js +0 -21
  797. package/dist/nodes/three/group3d.js.map +0 -1
  798. package/dist/nodes/three/light-nodes.d.ts +0 -120
  799. package/dist/nodes/three/light-nodes.d.ts.map +0 -1
  800. package/dist/nodes/three/light-nodes.js +0 -173
  801. package/dist/nodes/three/light-nodes.js.map +0 -1
  802. package/dist/nodes/three/mesh3d.d.ts +0 -117
  803. package/dist/nodes/three/mesh3d.d.ts.map +0 -1
  804. package/dist/nodes/three/mesh3d.js +0 -147
  805. package/dist/nodes/three/mesh3d.js.map +0 -1
  806. package/dist/nodes/three/node3d.d.ts +0 -230
  807. package/dist/nodes/three/node3d.d.ts.map +0 -1
  808. package/dist/nodes/three/node3d.js +0 -337
  809. package/dist/nodes/three/node3d.js.map +0 -1
  810. package/dist/render/descriptors/latex.d.ts +0 -6
  811. package/dist/render/descriptors/latex.d.ts.map +0 -1
  812. package/dist/render/descriptors/latex.js +0 -2
  813. package/dist/render/descriptors/latex.js.map +0 -1
  814. package/dist/tween/seekable.d.ts +0 -81
  815. package/dist/tween/seekable.d.ts.map +0 -1
  816. package/dist/tween/seekable.js +0 -137
  817. package/dist/tween/seekable.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"canvas2d-node.js","sourceRoot":"","sources":["../../../../src/components/trees/root/canvas2d-node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAErC,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,UAAU,EAAiC,MAAM,6BAA6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,GAAG,EAAE,CAAC,EAAE,CAAC;IACtF,MAAM,EAAE,OAAO,EAAE;IACjB,SAAS,EAAE,OAAO,EAAE;CACvB,CAAC,CAAC","sourcesContent":["import { RenderContext2D, RenderPass2D } from \"@/render/render-context2d\";\r\nimport { Graphics2D } from \"@/render/graphics2d\";\r\nimport { Clip } from \"@/render/clip\";\r\nimport { type Command, type CommandArgs } from \"@/tween/command\";\r\nimport { command } from \"@/tween/command-decorator\";\r\nimport { lerpLookAt, type LookAt, type SpaceCamera } from \"@/attributes/layout/space3d\";\r\nimport { NO_PROJECTION_3D, type Projection3D } from \"@/attributes/layout/matrix2d\";\r\nimport { Alignment } from \"@/attributes/layout/alignment\";\r\nimport type { FlowMode, FlowProps, FlowSettings, GapSize } from \"@/layout/types\";\r\nimport { fillOps } from \"@/attributes/shape/fill/registry\";\r\nimport { FillResolved } from \"@/attributes/shape/fill/union\";\r\nimport { Fill } from \"@/attributes/shape/fill/chain\";\r\nimport type { AssetScope } from \"@/assets/scope\";\r\nimport { CameraScope, Node2D, NodeConfig, Node2DProps } from \"@/components/trees/2d/node2d\";\r\nimport { spaceRootFrame } from \"@/components/trees/2d/node-space\";\r\nimport type { Node, NodeDimension } from \"@/components/trees/node/node\";\r\nimport { NodeAudio } from \"@/components/trees/audio/node-audio\";\r\nimport { declareMembers, property } from \"@/attributes/properties/decorator\";\r\nimport { alignmentProperty, fillProperty, flowProperty } from \"@/attributes/properties/typed\";\r\n\r\n/** @internal */\r\nexport interface Canvas2DProps extends Node2DProps, FlowProps {\r\n /**\r\n * Background fill layer(s). Each item can be a CSS color string, a fill\r\n * prop object, an already-resolved fill, or a {@link FillChain} from the\r\n * `Fills` builder. Painted behind the scene's children.\r\n */\r\n fill: Fill;\r\n /**\r\n * Overlay layer(s) — same loose values as {@link fill}, but painted *over*\r\n * the fill **and** the children (clipped to the viewport). Use for textures\r\n * laid across the whole scene, e.g. a VHS-grain image or video.\r\n */\r\n overlay: Fill;\r\n /** Camera magnification factor. Values > 1 zoom in; < 1 zoom out. */\r\n zoom: number;\r\n /**\r\n * World-space point that maps to the centre of the viewport. In a\r\n * {@link space3D} it is also what the camera orbits, and `z` puts it in\r\n * depth — the same sense as a node's `depth`, so a negative `z` flies in.\r\n */\r\n lookAt: LookAt;\r\n /** Rotation of the camera view in degrees (clockwise). */\r\n heading: number;\r\n /**\r\n * Place the children in one 3D space seen through this camera, rather than\r\n * each projecting through a perspective of its own. Their `depth` and tilt\r\n * are then positions and turns in that space, and siblings paint far to\r\n * near. A switch rather than something read off the camera's numbers, so\r\n * turning it on can never jump a tween.\r\n *\r\n * While it is on, `perspective` is the camera's distance from {@link lookAt}\r\n * at `dolly: 0` — CSS's convention, so that plane draws 1:1 and `0` is a\r\n * parallel projection — and the stage's own tilt and depth are unused.\r\n */\r\n space3D: boolean;\r\n /** Degrees about the vertical axis through {@link lookAt}. 0 is head-on; positive moves the camera to the right. Same as `Camera3D`. */\r\n orbit: number;\r\n /** Degrees above the layers. Positive looks down on them. Same as `Camera3D`. */\r\n elevation: number;\r\n /** Px the camera has moved in toward {@link lookAt}. Inert with no perspective, as depth is. */\r\n dolly: number;\r\n}\r\n\r\n/**\r\n * The single root container every clip document builds into.\r\n *\r\n * A `Canvas2D` is a plain {@link Node2D} that doubles as the clip's layout frame\r\n * and camera. It lays its children out (flex `horizontal`/`vertical` or\r\n * `freeform`, with `gap`, `align`, `padding`) and paints a scene-wide background\r\n * (`fill`) and `overlay` — *and* views those laid-out children through a viewport\r\n * transform (`zoom`, `lookAt`, `heading`).\r\n *\r\n * Unlike a {@link Rect} it is **not a shape**: it has no stroke, shadow, corner,\r\n * or `start`/`end` props. It carries only the scene-wide concerns — background\r\n * paint, child layout, and camera — so `stage.fill`, `stage.flow`, etc. read\r\n * the root directly without exposing per-shape geometry the scene root never has.\r\n *\r\n * Its layout props are the arrangement {@link Node2D} lays its children out by,\r\n * the same as a {@link Rect}'s — see {@link flowArrangement}.\r\n */\r\n/** @internal */\r\nexport class Canvas2D extends Node2D<Canvas2DProps> {\r\n\r\n // ---- Background paint -------------------------------------------------\r\n // Author-facing paint props. Like Rect, the declared type is the loose\r\n // `Fill` so assignment (`this.fill = 'red'`) and reads share one type; the\r\n // property accessor stores the *resolved* value via the mapper.\r\n declare fill: Fill;\r\n declare overlay: Fill;\r\n\r\n // ---- Layout container -------------------------------------------------\r\n declare flow: FlowMode;\r\n declare readonly gap: GapSize;\r\n declare readonly wrap: boolean;\r\n // `undefined` means \"follow `gap`\", not \"missing\" — see FlowProps.crossGap.\r\n declare readonly crossGap: number | undefined;\r\n declare readonly columns: number;\r\n // Declared loose as `Alignment` (covers `this.align = 'center'`); the\r\n // accessor stores the resolved per-axis `Vector2` pivot. See Rect.\r\n declare align: Alignment;\r\n\r\n // ---- Camera -----------------------------------------------------------\r\n /** Camera magnification factor (default: 1). */\r\n declare zoom: number;\r\n /** World-space focus point (default: {x:0, y:0}). */\r\n declare lookAt: LookAt;\r\n /** Camera view rotation in degrees (default: 0). */\r\n declare heading: number;\r\n declare space3D: boolean;\r\n declare orbit: number;\r\n declare elevation: number;\r\n declare dolly: number;\r\n\r\n constructor(props: NodeConfig<Canvas2D, Canvas2DProps>) {\r\n super(props);\r\n }\r\n\r\n // ---- Camera motion commands -------------------------------------------\r\n // Mirror the Camera node's viewport commands.\r\n\r\n /** Animate `zoom`. Values > 1 zoom in; < 1 zoom out. */\r\n zoomTo(args: CommandArgs<{ zoom: number }> & { duration: number }): Command<Canvas2DProps> {\r\n return this.to({ data: args.data as Partial<Canvas2DProps>, duration: args.duration, easing: args.easing });\r\n }\r\n\r\n /** Pan — animate `lookAt`, the world-space point mapped to the viewport center. `z` moves it in depth. */\r\n panTo(args: CommandArgs<{ lookAt: LookAt }> & { duration: number }): Command<Canvas2DProps> {\r\n return this.to({ data: args.data as Partial<Canvas2DProps>, duration: args.duration, easing: args.easing });\r\n }\r\n\r\n /**\r\n * Swing the camera round {@link lookAt}. The argument names are the ones the\r\n * 3D components' `orbitTo` takes, less `zoom`: here that is the lens, not a\r\n * distance, and it has a command of its own.\r\n */\r\n orbitTo(args: CommandArgs<{ orbit?: number; elevation?: number }> & { duration: number }): Command<Canvas2DProps> {\r\n return this.to({ data: args.data as Partial<Canvas2DProps>, duration: args.duration, easing: args.easing });\r\n }\r\n\r\n /** Move the camera in toward {@link lookAt} (positive) or back out. */\r\n dollyTo(args: CommandArgs<{ dolly: number }> & { duration: number }): Command<Canvas2DProps> {\r\n return this.to({ data: args.data as Partial<Canvas2DProps>, duration: args.duration, easing: args.easing });\r\n }\r\n\r\n /** Animate the view rotation (`heading`), in degrees clockwise. */\r\n headingTo(args: CommandArgs<{ heading: number }> & { duration: number }): Command<Canvas2DProps> {\r\n return this.to({ data: args.data as Partial<Canvas2DProps>, duration: args.duration, easing: args.easing });\r\n }\r\n\r\n fillTo(args: CommandArgs<Fill, FillResolved[]> & { duration: number }): Command<Canvas2DProps> {\r\n const from = this.fill as FillResolved[];\r\n const target = fillOps.resolve(args.data as Fill);\r\n const lerp = args.lerp ?? fillOps.lerp;\r\n return this.command<Canvas2DProps>(t => ({ fill: lerp(from, target, t) }) as Partial<Canvas2DProps>, args.duration, args.easing);\r\n }\r\n\r\n overlayTo(args: CommandArgs<Fill, FillResolved[]> & { duration: number }): Command<Canvas2DProps> {\r\n const from = this.overlay as FillResolved[];\r\n const target = fillOps.resolve(args.data as Fill);\r\n const lerp = args.lerp ?? fillOps.lerp;\r\n return this.command<Canvas2DProps>(t => ({ overlay: lerp(from, target, t) }) as Partial<Canvas2DProps>, args.duration, args.easing);\r\n }\r\n\r\n // ---- Layout -----------------------------------------------------------\r\n\r\n protected override flowArrangement(): FlowSettings {\r\n return this;\r\n }\r\n\r\n // ---- Drawing ----------------------------------------------------------\r\n\r\n // The viewport-sized background box behind the children.\r\n private shapeGraphics(): Graphics2D {\r\n return new Graphics2D().rect({\r\n width: this.layoutBounds.width,\r\n height: this.layoutBounds.height,\r\n });\r\n }\r\n\r\n protected override renderSelf(draw: RenderContext2D): void {\r\n const fill = this.fill as FillResolved[];\r\n if (fill.length === 0) return;\r\n draw.draw(this.shapeGraphics().fill(fill));\r\n }\r\n\r\n // Overlay over fill + children, clipped to the viewport silhouette.\r\n protected override renderOverlay(ctx: RenderContext2D): void {\r\n const overlay = this.overlay as FillResolved[];\r\n if (overlay.length === 0) return;\r\n ctx.draw(this.shapeGraphics().fill(overlay));\r\n }\r\n\r\n /**\r\n * Accept audio children as well as 2D ones.\r\n *\r\n * The scene root is where the two trees meet, mirroring `Canvas3D` — and for\r\n * the same reason it is *this* node: a composition already carries both\r\n * halves of a clip, so a voiceover belongs in the document that shows the\r\n * picture it is narrating rather than in a second document beside it.\r\n *\r\n * Nothing partitions them by hand. `Node2D.children` already filters to its\r\n * own kind, so layout and render skip the audio subtree for free, and the\r\n * audio declaration walk reads the unfiltered list.\r\n */\r\n protected override acceptsChild(child: Node): boolean {\r\n return child.dimension === \"2d\" || child.dimension === \"audio\";\r\n }\r\n\r\n override get _childTrees(): readonly NodeDimension[] {\r\n return [\"2d\", \"audio\"];\r\n }\r\n\r\n /** This node's children in the audio tree. */\r\n get childrenAudio(): NodeAudio[] {\r\n return this._allChildren.filter((c): c is NodeAudio => c instanceof NodeAudio);\r\n }\r\n\r\n // The world container, not a shape, so it declares its own `fill`/`overlay`.\r\n override declareAssets(assets: AssetScope): void {\r\n super.declareAssets(assets);\r\n assets.fill(this.fill as FillResolved[]);\r\n assets.fill(this.overlay as FillResolved[]);\r\n }\r\n\r\n // The viewport outline — used for `clip` and as the area backdrop effects\r\n // are confined to.\r\n protected override clipSelf(): Clip {\r\n return new Clip().rect({\r\n width: this.layoutBounds.width,\r\n height: this.layoutBounds.height,\r\n });\r\n }\r\n\r\n // ---- Rendering --------------------------------------------------------\r\n\r\n // Children are laid out by the flow engine; here we view that laid-out\r\n // world through the camera viewport transform, the same way the Camera node\r\n // does. When the camera is at rest (zoom 1, no heading, origin at 0) this is\r\n // the identity, so a plain layout root pays nothing extra.\r\n // Non-null exactly when renderChildren below opens a camera, so a consumer\r\n // reproducing the render transform (node picking) inserts the same scope in\r\n // the same place — and skips it on the at-rest fast path, where the renderer\r\n // pushes nothing at all.\r\n override _cameraScope(): CameraScope | null {\r\n if (this.space3D) return null;\r\n if (this.zoom === 1 && this.heading === 0 && this.lookAt.x === 0 && this.lookAt.y === 0) return null;\r\n return { lookAt: this.lookAt, zoom: this.zoom, heading: this.heading };\r\n }\r\n\r\n override _spaceCamera(): SpaceCamera | null {\r\n if (!this.space3D) return null;\r\n const rect = this.layoutBounds;\r\n return {\r\n perspective: this.perspective,\r\n orbit: this.orbit,\r\n elevation: this.elevation,\r\n dolly: this.dolly,\r\n lookAt: this.lookAt,\r\n zoom: this.zoom,\r\n heading: this.heading,\r\n viewportX: rect?.x ?? 0,\r\n viewportY: -(rect?.y ?? 0),\r\n };\r\n }\r\n\r\n // In a space the stage's own tilt and depth would turn the whole scene as\r\n // one flat card; its `perspective` is the camera's instead.\r\n protected override _projection(): Projection3D {\r\n return this.space3D ? NO_PROJECTION_3D : super._projection();\r\n }\r\n\r\n protected override renderChildren(ctx: RenderPass2D): void {\r\n const camera = this._spaceCamera();\r\n if (camera) {\r\n this._renderInSpace(ctx, spaceRootFrame(this, camera));\r\n return;\r\n }\r\n if (this.zoom === 1 && this.heading === 0 && this.lookAt.x === 0 && this.lookAt.y === 0) {\r\n super.renderChildren(ctx);\r\n return;\r\n }\r\n\r\n const rect = this.layoutBounds;\r\n const w = rect?.width ?? 0;\r\n const h = rect?.height ?? 0;\r\n const cx = rect?.x ?? 0;\r\n const cy = rect?.y ?? 0;\r\n\r\n ctx.beginCamera(\r\n { x: cx, y: -cy, width: w, height: h },\r\n this.lookAt,\r\n this.zoom,\r\n this.heading,\r\n );\r\n\r\n for (const child of this._children) if (child instanceof Node2D) child.render(ctx);\r\n\r\n ctx.endCamera();\r\n }\r\n}\r\n\r\ndeclareMembers(Canvas2D, {\r\n fill: fillProperty(),\r\n overlay: fillProperty(),\r\n flow: flowProperty(),\r\n gap: property({ default: 0 }),\r\n wrap: property({ default: false }),\r\n crossGap: property({ default: undefined }),\r\n columns: property({ default: 1 }),\r\n align: alignmentProperty(),\r\n zoom: property({ default: 1 }),\r\n lookAt: property({ default: { x: 0, y: 0 }, tween: lerpLookAt }),\r\n heading: property({ default: 0 }),\r\n space3D: property({ default: false }),\r\n orbit: property({ default: 0 }),\r\n elevation: property({ default: 0 }),\r\n dolly: property({ default: 0 }),\r\n\r\n zoomTo: command({ args: [{ key: \"zoom\", kind: \"number\", min: 0.01, step: 0.1, unit: \"×\" }] }),\r\n panTo: command({ args: [{ key: \"lookAt\", kind: \"vector2\", properties: { x: { kind: \"number\" }, y: { kind: \"number\" }, z: { kind: \"number\" } } }] }),\r\n orbitTo: command({ args: [{ key: \"orbit\", kind: \"number\", step: 1, unit: \"°\" }, { key: \"elevation\", kind: \"number\", step: 1, unit: \"°\" }] }),\r\n dollyTo: command({ args: [{ key: \"dolly\", kind: \"number\", step: 10 }] }),\r\n headingTo: command({ args: [{ key: \"heading\", kind: \"number\", step: 1, unit: \"°\" }] }),\r\n fillTo: command(),\r\n overlayTo: command(),\r\n});\r\n"]}
1
+ {"version":3,"file":"canvas2d-node.js","sourceRoot":"","sources":["../../../../src/components/trees/root/canvas2d-node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAErC,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,UAAU,EAAiC,MAAM,6BAA6B,CAAC;AACxF,OAAO,EAAE,gBAAgB,EAAqB,MAAM,8BAA8B,CAAC;AAGnF,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAI3D,OAAO,EAAe,MAAM,EAA2B,MAAM,8BAA8B,CAAC;AAC5F,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAElE,OAAO,EAAE,SAAS,EAAE,MAA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AAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;IAC7F,KAAK,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC;IACnJ,OAAO,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;IAC5I,OAAO,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC;IACxE,SAAS,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;IACtF,MAAM,EAAE,OAAO,EAAE;IACjB,SAAS,EAAE,OAAO,EAAE;CACvB,CAAC,CAAC","sourcesContent":["import { RenderContext2D, RenderPass2D } from \"@/render/render-context2d\";\nimport { Graphics2D } from \"@/render/graphics2d\";\nimport { Clip } from \"@/render/clip\";\nimport { type Command, type CommandArgs } from \"@/tween/command\";\nimport { command } from \"@/tween/command-decorator\";\nimport { lerpLookAt, type LookAt, type SpaceCamera } from \"@/attributes/layout/space3d\";\nimport { NO_PROJECTION_3D, type Projection3D } from \"@/attributes/layout/matrix2d\";\nimport { Alignment } from \"@/attributes/layout/alignment\";\nimport type { FlowMode, FlowProps, FlowSettings, GapSize } from \"@/layout/types\";\nimport { fillOps } from \"@/attributes/shape/fill/registry\";\nimport { FillResolved } from \"@/attributes/shape/fill/union\";\nimport { Fill } from \"@/attributes/shape/fill/chain\";\nimport type { AssetScope } from \"@/assets/scope\";\nimport { CameraScope, Node2D, NodeConfig, Node2DProps } from \"@/components/trees/2d/node2d\";\nimport { spaceRootFrame } from \"@/components/trees/2d/node-space\";\nimport type { Node, NodeDimension } from \"@/components/trees/node/node\";\nimport { NodeAudio } from \"@/components/trees/audio/node-audio\";\nimport { declareMembers, property } from \"@/attributes/properties/decorator\";\nimport { alignmentProperty, fillProperty, flowProperty } from \"@/attributes/properties/typed\";\n\n/** @internal */\nexport interface Canvas2DProps extends Node2DProps, FlowProps {\n /**\n * Background fill layer(s). Each item can be a CSS color string, a fill\n * prop object, an already-resolved fill, or a {@link FillChain} from the\n * `Fills` builder. Painted behind the scene's children.\n */\n fill: Fill;\n /**\n * Overlay layer(s) — same loose values as {@link fill}, but painted *over*\n * the fill **and** the children (clipped to the viewport). Use for textures\n * laid across the whole scene, e.g. a VHS-grain image or video.\n */\n overlay: Fill;\n /** Camera magnification factor. Values > 1 zoom in; < 1 zoom out. */\n zoom: number;\n /**\n * World-space point that maps to the centre of the viewport. In a\n * {@link space3D} it is also what the camera orbits, and `z` puts it in\n * depth — the same sense as a node's `depth`, so a negative `z` flies in.\n */\n lookAt: LookAt;\n /** Rotation of the camera view in degrees (clockwise). */\n heading: number;\n /**\n * Place the children in one 3D space seen through this camera, rather than\n * each projecting through a perspective of its own. Their `depth` and tilt\n * are then positions and turns in that space, and siblings paint far to\n * near. A switch rather than something read off the camera's numbers, so\n * turning it on can never jump a tween.\n *\n * While it is on, `perspective` is the camera's distance from {@link lookAt}\n * at `dolly: 0` — CSS's convention, so that plane draws 1:1 and `0` is a\n * parallel projection — and the stage's own tilt and depth are unused.\n */\n space3D: boolean;\n /** Degrees about the vertical axis through {@link lookAt}. 0 is head-on; positive moves the camera to the right. Same as `Camera3D`. */\n orbit: number;\n /** Degrees above the layers. Positive looks down on them. Same as `Camera3D`. */\n elevation: number;\n /** Px the camera has moved in toward {@link lookAt}. Inert with no perspective, as depth is. */\n dolly: number;\n}\n\n/**\n * The single root container every clip document builds into.\n *\n * A `Canvas2D` is a plain {@link Node2D} that doubles as the clip's layout frame\n * and camera. It lays its children out (flex `horizontal`/`vertical` or\n * `freeform`, with `gap`, `align`, `padding`) and paints a scene-wide background\n * (`fill`) and `overlay` — *and* views those laid-out children through a viewport\n * transform (`zoom`, `lookAt`, `heading`).\n *\n * Unlike a {@link Rect} it is **not a shape**: it has no stroke, shadow, corner,\n * or `start`/`end` props. It carries only the scene-wide concerns — background\n * paint, child layout, and camera — so `stage.fill`, `stage.flow`, etc. read\n * the root directly without exposing per-shape geometry the scene root never has.\n *\n * Its layout props are the arrangement {@link Node2D} lays its children out by,\n * the same as a {@link Rect}'s — see {@link flowArrangement}.\n */\n/** @internal */\nexport class Canvas2D extends Node2D<Canvas2DProps> {\n\n // ---- Background paint -------------------------------------------------\n // Author-facing paint props. Like Rect, the declared type is the loose\n // `Fill` so assignment (`this.fill = 'red'`) and reads share one type; the\n // property accessor stores the *resolved* value via the mapper.\n declare fill: Fill;\n declare overlay: Fill;\n\n // ---- Layout container -------------------------------------------------\n declare flow: FlowMode;\n declare readonly gap: GapSize;\n declare readonly wrap: boolean;\n // `undefined` means \"follow `gap`\", not \"missing\" — see FlowProps.crossGap.\n declare readonly crossGap: number | undefined;\n declare readonly columns: number;\n // Declared loose as `Alignment` (covers `this.align = 'center'`); the\n // accessor stores the resolved per-axis `Vector2` pivot. See Rect.\n declare align: Alignment;\n\n // ---- Camera -----------------------------------------------------------\n /** Camera magnification factor (default: 1). */\n declare zoom: number;\n /** World-space focus point (default: {x:0, y:0}). */\n declare lookAt: LookAt;\n /** Camera view rotation in degrees (default: 0). */\n declare heading: number;\n declare space3D: boolean;\n declare orbit: number;\n declare elevation: number;\n declare dolly: number;\n\n constructor(props: NodeConfig<Canvas2D, Canvas2DProps>) {\n super(props);\n }\n\n // ---- Camera motion commands -------------------------------------------\n // Mirror the Camera node's viewport commands.\n\n /** Animate `zoom`. Values > 1 zoom in; < 1 zoom out. */\n zoomTo(args: CommandArgs<{ zoom: number }> & { duration: number }): Command<Canvas2DProps> {\n return this.to({ data: args.data as Partial<Canvas2DProps>, duration: args.duration, easing: args.easing });\n }\n\n /** Pan — animate `lookAt`, the world-space point mapped to the viewport center. `z` moves it in depth. */\n panTo(args: CommandArgs<{ lookAt: LookAt }> & { duration: number }): Command<Canvas2DProps> {\n return this.to({ data: args.data as Partial<Canvas2DProps>, duration: args.duration, easing: args.easing });\n }\n\n /**\n * Swing the camera round {@link lookAt}. The argument names are the ones the\n * 3D components' `orbitTo` takes, less `zoom`: here that is the lens, not a\n * distance, and it has a command of its own.\n */\n orbitTo(args: CommandArgs<{ orbit?: number; elevation?: number }> & { duration: number }): Command<Canvas2DProps> {\n return this.to({ data: args.data as Partial<Canvas2DProps>, duration: args.duration, easing: args.easing });\n }\n\n /** Move the camera in toward {@link lookAt} (positive) or back out. */\n dollyTo(args: CommandArgs<{ dolly: number }> & { duration: number }): Command<Canvas2DProps> {\n return this.to({ data: args.data as Partial<Canvas2DProps>, duration: args.duration, easing: args.easing });\n }\n\n /** Animate the view rotation (`heading`), in degrees clockwise. */\n headingTo(args: CommandArgs<{ heading: number }> & { duration: number }): Command<Canvas2DProps> {\n return this.to({ data: args.data as Partial<Canvas2DProps>, duration: args.duration, easing: args.easing });\n }\n\n fillTo(args: CommandArgs<Fill, FillResolved[]> & { duration: number }): Command<Canvas2DProps> {\n const from = this.fill as FillResolved[];\n const target = fillOps.resolve(args.data as Fill);\n const lerp = args.lerp ?? fillOps.lerp;\n return this.command<Canvas2DProps>(t => ({ fill: lerp(from, target, t) }) as Partial<Canvas2DProps>, args.duration, args.easing);\n }\n\n overlayTo(args: CommandArgs<Fill, FillResolved[]> & { duration: number }): Command<Canvas2DProps> {\n const from = this.overlay as FillResolved[];\n const target = fillOps.resolve(args.data as Fill);\n const lerp = args.lerp ?? fillOps.lerp;\n return this.command<Canvas2DProps>(t => ({ overlay: lerp(from, target, t) }) as Partial<Canvas2DProps>, args.duration, args.easing);\n }\n\n // ---- Layout -----------------------------------------------------------\n\n protected override flowArrangement(): FlowSettings {\n return this;\n }\n\n // ---- Drawing ----------------------------------------------------------\n\n // The viewport-sized background box behind the children.\n private shapeGraphics(): Graphics2D {\n return new Graphics2D().rect({\n width: this.layoutBounds.width,\n height: this.layoutBounds.height,\n });\n }\n\n protected override renderSelf(draw: RenderContext2D): void {\n const fill = this.fill as FillResolved[];\n if (fill.length === 0) return;\n draw.draw(this.shapeGraphics().fill(fill));\n }\n\n // Overlay over fill + children, clipped to the viewport silhouette.\n protected override renderOverlay(ctx: RenderContext2D): void {\n const overlay = this.overlay as FillResolved[];\n if (overlay.length === 0) return;\n ctx.draw(this.shapeGraphics().fill(overlay));\n }\n\n /**\n * Accept audio children as well as 2D ones.\n *\n * The scene root is where the two trees meet, mirroring `Canvas3D` — and for\n * the same reason it is *this* node: a composition already carries both\n * halves of a clip, so a voiceover belongs in the document that shows the\n * picture it is narrating rather than in a second document beside it.\n *\n * Nothing partitions them by hand. `Node2D.children` already filters to its\n * own kind, so layout and render skip the audio subtree for free, and the\n * audio declaration walk reads the unfiltered list.\n */\n protected override acceptsChild(child: Node): boolean {\n return child.dimension === \"2d\" || child.dimension === \"audio\";\n }\n\n override get _childTrees(): readonly NodeDimension[] {\n return [\"2d\", \"audio\"];\n }\n\n /** This node's children in the audio tree. */\n get childrenAudio(): NodeAudio[] {\n return this._allChildren.filter((c): c is NodeAudio => c instanceof NodeAudio);\n }\n\n // The world container, not a shape, so it declares its own `fill`/`overlay`.\n override declareAssets(assets: AssetScope): void {\n super.declareAssets(assets);\n assets.fill(this.fill as FillResolved[]);\n assets.fill(this.overlay as FillResolved[]);\n }\n\n // The viewport outline — used for `clip` and as the area backdrop effects\n // are confined to.\n protected override clipSelf(): Clip {\n return new Clip().rect({\n width: this.layoutBounds.width,\n height: this.layoutBounds.height,\n });\n }\n\n // ---- Rendering --------------------------------------------------------\n\n // Children are laid out by the flow engine; here we view that laid-out\n // world through the camera viewport transform, the same way the Camera node\n // does. When the camera is at rest (zoom 1, no heading, origin at 0) this is\n // the identity, so a plain layout root pays nothing extra.\n // Non-null exactly when renderChildren below opens a camera, so a consumer\n // reproducing the render transform (node picking) inserts the same scope in\n // the same place — and skips it on the at-rest fast path, where the renderer\n // pushes nothing at all.\n override _cameraScope(): CameraScope | null {\n if (this.space3D) return null;\n if (this.zoom === 1 && this.heading === 0 && this.lookAt.x === 0 && this.lookAt.y === 0) return null;\n return { lookAt: this.lookAt, zoom: this.zoom, heading: this.heading };\n }\n\n override _spaceCamera(): SpaceCamera | null {\n if (!this.space3D) return null;\n const rect = this.layoutBounds;\n return {\n perspective: this.perspective,\n orbit: this.orbit,\n elevation: this.elevation,\n dolly: this.dolly,\n lookAt: this.lookAt,\n zoom: this.zoom,\n heading: this.heading,\n viewportX: rect?.x ?? 0,\n viewportY: -(rect?.y ?? 0),\n };\n }\n\n // In a space the stage's own tilt and depth would turn the whole scene as\n // one flat card; its `perspective` is the camera's instead.\n protected override _projection(): Projection3D {\n return this.space3D ? NO_PROJECTION_3D : super._projection();\n }\n\n protected override renderChildren(ctx: RenderPass2D): void {\n const camera = this._spaceCamera();\n if (camera) {\n this._renderInSpace(ctx, spaceRootFrame(this, camera));\n return;\n }\n if (this.zoom === 1 && this.heading === 0 && this.lookAt.x === 0 && this.lookAt.y === 0) {\n super.renderChildren(ctx);\n return;\n }\n\n const rect = this.layoutBounds;\n const w = rect?.width ?? 0;\n const h = rect?.height ?? 0;\n const cx = rect?.x ?? 0;\n const cy = rect?.y ?? 0;\n\n ctx.beginCamera(\n { x: cx, y: -cy, width: w, height: h },\n this.lookAt,\n this.zoom,\n this.heading,\n );\n\n for (const child of this._children) if (child instanceof Node2D) child.render(ctx);\n\n ctx.endCamera();\n }\n}\n\ndeclareMembers(Canvas2D, {\n fill: fillProperty(),\n overlay: fillProperty(),\n flow: flowProperty(),\n gap: property({ default: 0 }),\n wrap: property({ default: false }),\n crossGap: property({ default: undefined }),\n columns: property({ default: 1 }),\n align: alignmentProperty(),\n zoom: property({ default: 1 }),\n lookAt: property({ default: { x: 0, y: 0 }, tween: lerpLookAt }),\n heading: property({ default: 0 }),\n space3D: property({ default: false }),\n orbit: property({ default: 0 }),\n elevation: property({ default: 0 }),\n dolly: property({ default: 0 }),\n\n zoomTo: command({ args: [{ key: \"zoom\", kind: \"number\", min: 0.01, step: 0.1, unit: \"×\" }] }),\n panTo: command({ args: [{ key: \"lookAt\", kind: \"vector2\", properties: { x: { kind: \"number\" }, y: { kind: \"number\" }, z: { kind: \"number\" } } }] }),\n orbitTo: command({ args: [{ key: \"orbit\", kind: \"number\", step: 1, unit: \"°\" }, { key: \"elevation\", kind: \"number\", step: 1, unit: \"°\" }] }),\n dollyTo: command({ args: [{ key: \"dolly\", kind: \"number\", step: 10 }] }),\n headingTo: command({ args: [{ key: \"heading\", kind: \"number\", step: 1, unit: \"°\" }] }),\n fillTo: command(),\n overlayTo: command(),\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"node3d.js","sourceRoot":"","sources":["../../../../src/components/trees/three/node3d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAC5F,OAAO,EACH,cAAc,GAEjB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO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AAC;QACrD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YACzB,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;YACrB,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,SAAS;gBAAE,GAAG,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QACpE,CAAC;QAED,wDAAwD;QACxD,IAAI,GAAG,KAAK,UAAU,EAAE,CAAC;YACrB,MAAM,KAAK,GAAI,KAAgB,CAAC,KAAK,CAAC;YACtC,IAAI,KAAK,KAAK,SAAS,IAAI,GAAG,CAAC,aAAa,KAAK,SAAS;gBAAE,GAAG,CAAC,aAAa,GAAG,KAAK,CAAC;QAC1F,CAAC;IACL,CAAC;IAED,OAAQ,GAAS,IAAI,KAAK,CAAC;AAC/B,CAAC;AAED,2FAA2F;AAC3F,SAAS,MAAM,CAAmB,IAAmB;IACjD,MAAM,GAAG,GAAe,EAAE,CAAC;IAC3B,KAAK,MAAM,GAAG,IAAI,IAAI;QAAE,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,SAAS;YAAE,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;IAC1E,OAAO,GAAG,CAAC;AACf,CAAC;AAED,SAAS,WAAW,CAAC,MAAe,EAAE,KAAa;IAC/C,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AACtE,CAAC","sourcesContent":["import { declareMembers, property } from \"@/attributes/properties/decorator\";\r\nimport { optionalVector3Property, quaternionProperty } from \"@/attributes/properties/typed\";\r\nimport {\r\n resolveVector3,\r\n type Euler3, type EulerOrder, type Quaternion, type Vector3, type Vector3Input,\r\n} from \"@/render3d/vector3\";\r\nimport type { RenderContext3D } from \"@/render3d/render-context3d\";\r\nimport { Scene3D } from \"@/render3d/scene3d\";\r\nimport { declare3DResources } from \"@/render3d/tracking\";\r\nimport type { AssetScope } from \"@/assets/scope\";\r\nimport type { Shadow3D, Transform3D } from \"@/render3d/transform\";\r\nimport { Node, type NodeConfig, type NodeDimension, type NodeProps } from \"@/components/trees/node/node\";\r\nimport type { Command, CommandArgs } from \"@/tween/command\";\r\nimport { command } from \"@/tween/command-decorator\";\r\nimport type { EasingFunction } from \"@/tween/ease/type\";\r\nimport type { TweenStepper } from \"@/tween/stepper\";\r\n\r\nexport interface Node3DProps extends NodeProps {\r\n /** Position in the parent's local space. A scalar sets all three axes. */\r\n position: Vector3Input;\r\n /** Position on one axis. The same names 2D uses, one dimension over. */\r\n x: number;\r\n y: number;\r\n z: number;\r\n /**\r\n * Euler rotation in **degrees**, matching 2D `rotation`. Ignored when\r\n * {@link quaternion} is set.\r\n */\r\n rotation: Vector3Input | Euler3;\r\n /** Rotation about one axis, in **degrees**. Same names as 2D's. */\r\n rotationX: number;\r\n rotationY: number;\r\n rotationZ: number;\r\n /** The order the Euler axes are applied in. Default `\"XYZ\"`. */\r\n rotationOrder: EulerOrder;\r\n /**\r\n * Rotation as a unit quaternion. Wins over {@link rotation} — use it for\r\n * tumbles where Euler interpolation would gimbal.\r\n */\r\n quaternion: Quaternion;\r\n /** Per-axis scale; a scalar scales uniformly. Default 1. */\r\n scale: Vector3Input;\r\n scaleX: number;\r\n scaleY: number;\r\n scaleZ: number;\r\n /**\r\n * World-space point to orient toward, applied after {@link position}. Wins\r\n * over both {@link rotation} and {@link quaternion}.\r\n */\r\n lookAt: Vector3Input | undefined;\r\n /** Hide without removing — the cached renderer object stays alive. */\r\n visible: boolean;\r\n /**\r\n * Shadow participation. Default `true`, so turning shadows on for the scene\r\n * turns them on. Pass `false` to opt out, or `\"cast\"`/`\"receive\"` for one half.\r\n */\r\n shadow: Shadow3D;\r\n /** Draw-order override, for tuning transparent sorting. */\r\n renderOrder: number;\r\n}\r\n\r\n/**\r\n * A 3D parent's own coordinates for where its children sit: the units of a\r\n * graph, say. Position only, as a `ChildPlane` is in 2D: a child keeps its\r\n * size, turn and scale. Answered by the parent ({@link Node3D._spaceOf}, or\r\n * `Canvas3D._spaceOf` for a child of the viewport itself).\r\n */\r\nexport interface ChildSpace3D {\r\n /** A child's `x`/`y`/`z` as a point in the parent's local space. */\r\n toLocal(x: number, y: number, z: number): Vector3;\r\n}\r\n\r\n/** A parent that may place its 3D children in coordinates of its own: a `Node3D`, or a 3D viewport. */\r\ninterface SpaceHolder3D {\r\n _spaceOf(child: Node3D | null): ChildSpace3D | null;\r\n}\r\n\r\n/**\r\n * The coordinates `node`'s parent places it by, or `null` when they are the\r\n * parent's local space. The parent may be a 3D node or the viewport holding it.\r\n */\r\n/** @internal */\r\nexport function parentSpaceOf(node: Node3D): ChildSpace3D | null {\r\n const parent = node.parent as Partial<SpaceHolder3D> | null;\r\n return typeof parent?._spaceOf === \"function\" ? parent._spaceOf(node) : null;\r\n}\r\n\r\n/** The three axis props each vector prop distributes into, in order. */\r\nconst VECTOR_SUGAR: Readonly<Record<string, readonly [string, string, string]>> = {\r\n position: [\"x\", \"y\", \"z\"],\r\n rotation: [\"rotationX\", \"rotationY\", \"rotationZ\"],\r\n scale: [\"scaleX\", \"scaleY\", \"scaleZ\"],\r\n};\r\n\r\n/**\r\n * A thing in 3D space — the root of the 3D scene graph.\r\n *\r\n * The sibling of {@link Node2D}: same tree, same props, same `to()`/`set()`/\r\n * `save()`/`restore()`, same refs, context and per-node clock, all inherited from\r\n * {@link Node}. What differs is the only thing that genuinely differs between the\r\n * two — how a node is placed and how it draws. There is no `width`, no `padding`,\r\n * no anchor and no flex here, because none of them mean anything for a mesh; a 3D\r\n * node's whole placement is its transform.\r\n *\r\n * Canvas3D({\r\n * children: [\r\n * Camera3D({ orbit: 30, elevation: 18, distance: 6 }),\r\n * AmbientLight3D({ intensity: 0.4 }),\r\n * Group3D({ ref: rig, children: [Box3D({ width: 2, cornerRadius: 0.15, fill: \"tomato\" })] }),\r\n * ],\r\n * })\r\n *\r\n * rig().to({ data: { rotationY: 360, y: 1 }, duration: 2 });\r\n *\r\n * ── Axes are scalars, and vectors are sugar over them ─────────────────────────\r\n * `x`, `y`, `z`, `rotationX/Y/Z` and `scaleX/Y/Z` are the real props, and they\r\n * are named exactly what 2D names them. `position`, `rotation` and `scale` are\r\n * distributed into those three, the way `Node2D` already distributes `size` into\r\n * `width`/`height` — so both spellings tween identically and there is one source\r\n * of truth for where a node is. That is what makes `to({ y: 3 })` work: with a\r\n * single vector prop it would have had nothing to interpolate on the other two\r\n * axes, which is exactly the trap that made every 3D scene restate coordinates it\r\n * did not mean to change.\r\n *\r\n * A `Node3D` only ever lives under a `Canvas3D` — the one node that holds both\r\n * dimensions. Parenting one to a `Rect` throws rather than silently drawing\r\n * nothing (see {@link Node.acceptsChild}). Every 3D node type is a\r\n * `component3d`, which lowers onto this class and draws from its `render`.\r\n */\r\nexport class Node3D<P extends Node3DProps = Node3DProps> extends Node<P> {\r\n get dimension(): NodeDimension { return \"3d\"; }\r\n\r\n declare x: number;\r\n declare y: number;\r\n declare z: number;\r\n\r\n declare rotationX: number;\r\n declare rotationY: number;\r\n declare rotationZ: number;\r\n declare rotationOrder: EulerOrder;\r\n\r\n declare quaternion: Quaternion;\r\n\r\n declare scaleX: number;\r\n declare scaleY: number;\r\n declare scaleZ: number;\r\n\r\n declare lookAt: Vector3Input | undefined;\r\n declare visible: boolean;\r\n declare shadow: Shadow3D;\r\n declare renderOrder: number;\r\n\r\n constructor(props?: NodeConfig<any, P>) {\r\n super(props);\r\n // Distributed before `initProps`, which only ever applies keys that are\r\n // registered props — a `position` left in the bag would be dropped.\r\n this.initProps(distributeVectors(props) as NodeConfig<any, P>);\r\n this.adoptChildrenProp(props);\r\n }\r\n\r\n /** Animate the position, whichever axes are given; the rest stay where they are. */\r\n moveTo(args: CommandArgs<{ x?: number; y?: number; z?: number }> & { duration: number }): Command<P> {\r\n return this.to({ data: stated(args.data) as Partial<P>, duration: args.duration, easing: args.easing });\r\n }\r\n\r\n /** Animate the Euler rotation, in degrees, whichever axes are given. */\r\n rotateTo(\r\n args: CommandArgs<{ rotationX?: number; rotationY?: number; rotationZ?: number }> & { duration: number },\r\n ): Command<P> {\r\n return this.to({ data: stated(args.data) as Partial<P>, duration: args.duration, easing: args.easing });\r\n }\r\n\r\n /** Animate the scale: `scale` on every axis, and any axis given beside it on that one. */\r\n scaleTo(\r\n args: CommandArgs<{ scale?: number; scaleX?: number; scaleY?: number; scaleZ?: number }> & { duration: number },\r\n ): Command<P> {\r\n return this.to({ data: stated(args.data) as Partial<P>, duration: args.duration, easing: args.easing });\r\n }\r\n\r\n /** This node's position, composed from the axis props. */\r\n get position(): Vector3 {\r\n return { x: this.x, y: this.y, z: this.z };\r\n }\r\n set position(value: Vector3Input) {\r\n this.set({ position: value } as never);\r\n }\r\n\r\n /** This node's Euler rotation in degrees, composed from the axis props. */\r\n get rotation(): Euler3 {\r\n return { x: this.rotationX, y: this.rotationY, z: this.rotationZ, order: this.rotationOrder };\r\n }\r\n set rotation(value: Vector3Input | Euler3) {\r\n this.set({ rotation: value } as never);\r\n }\r\n\r\n /** This node's scale, composed from the axis props. */\r\n get scale(): Vector3 {\r\n return { x: this.scaleX, y: this.scaleY, z: this.scaleZ };\r\n }\r\n set scale(value: Vector3Input) {\r\n this.set({ scale: value } as never);\r\n }\r\n\r\n /**\r\n * Distribute the vector sugar into axis props, then write as usual.\r\n *\r\n * Same shape as `Node2D.set`'s handling of `size`, and for the same reason:\r\n * `position` has no slot of its own, so it has to become three writes\r\n * before the generic loop runs. An explicitly stated axis in the same call\r\n * wins over the vector, which is what lets `{ position: p, y: 0 }` mean what\r\n * it reads like.\r\n */\r\n override set(props: { [K in keyof P]?: P[K] | (() => P[K]) }): void {\r\n super.set(distributeVectors(props) as typeof props);\r\n }\r\n\r\n /**\r\n * The tween half of the same rule. Expanded here rather than in the command\r\n * so `to({ position: [...] })` and `to({ x, y, z })` produce identical\r\n * steppers — one interpolating path, whichever way it was written.\r\n */\r\n override _prepareStep(to: Partial<P>, duration: number, easing?: EasingFunction): TweenStepper {\r\n return super._prepareStep(distributeVectors(to) as Partial<P>, duration, easing);\r\n }\r\n\r\n /**\r\n * This node's placement, as the renderer's own vocabulary.\r\n *\r\n * Sampled fresh every frame from the prop slots, so a tween moves the object\r\n * without anything here caching state between frames.\r\n *\r\n * `quaternion` is only emitted when it has been set away from identity: it\r\n * wins over `rotation` in a {@link Transform3D}, so always sending it would\r\n * make `rotation` silently do nothing.\r\n */\r\n protected transform3D(): Transform3D {\r\n const quaternion = this.quaternion as unknown as Quaternion;\r\n const identityQuaternion =\r\n quaternion.x === 0 && quaternion.y === 0 && quaternion.z === 0 && quaternion.w === 1;\r\n const space = parentSpaceOf(this);\r\n return {\r\n position: space ? space.toLocal(this.x, this.y, this.z) : this.position,\r\n rotation: this.rotation,\r\n quaternion: identityQuaternion ? undefined : quaternion,\r\n scale: this.scale,\r\n lookAt: this.lookAt,\r\n visible: this.visible,\r\n shadow: this.shadow,\r\n renderOrder: this.renderOrder,\r\n };\r\n }\r\n\r\n /**\r\n * The coordinates `child`'s `x`/`y`/`z` are in, or `null` (the default) when\r\n * they are this node's local space. A `null` child is one not here yet.\r\n */\r\n /** @internal */\r\n _spaceOf(_child: Node3D | null): ChildSpace3D | null {\r\n return null;\r\n }\r\n\r\n /**\r\n * The transform that goes on this node's *group* — the scope its children\r\n * nest inside. Defaults to this node's own placement, which is right for\r\n * everything that lives at its own origin.\r\n *\r\n * A camera answers identity and places itself instead: three aims a\r\n * camera's -Z at `lookAt` but a plain group's +Z, so hanging a camera's\r\n * placement on its group would point the shot backwards.\r\n */\r\n protected groupTransform(): Transform3D {\r\n return this.transform3D();\r\n }\r\n\r\n /**\r\n * Draw this node's own contribution to the scene — a `ctx.draw(graphics3D)`\r\n * for something with geometry, a `ctx.light(...)` for a light, nothing at all\r\n * for a plain {@link Group3D}. Children are recorded after it, nested inside\r\n * this node's transform.\r\n */\r\n protected renderSelf(ctx: RenderContext3D): void { }\r\n\r\n /**\r\n * Record this node and its subtree into `ctx`.\r\n *\r\n * An invisible node still opens its scope: `visible: false` is a renderer-side\r\n * flag on a live object rather than a removal, which is what lets a node be\r\n * hidden and shown again without its GPU resources being rebuilt. Skipping the\r\n * walk here would instead sweep the whole subtree out of the cache.\r\n */\r\n render(ctx: RenderContext3D): void {\r\n // The editor's flag folds into `visible` rather than adding a second one:\r\n // the 3D side already has exactly this concept, honoured by the picking\r\n // walk, and two flags meaning \"do not show this\" would be two places to\r\n // ask. Still opens its scope — see the note above on why an invisible\r\n // node keeps its cached renderer object.\r\n if (this.hidden) {\r\n ctx.begin({ id: this.id, transform: { ...this.groupTransform(), visible: false } });\r\n ctx.end();\r\n return;\r\n }\r\n ctx.begin({ id: this.id, transform: this.groupTransform() });\r\n this.renderSelf(ctx);\r\n for (const child of this._children) {\r\n if (child instanceof Node3D) child.render(ctx);\r\n }\r\n ctx.end();\r\n }\r\n\r\n /**\r\n * What {@link renderSelf} records, never {@link render}: the placement lives on\r\n * the group scope, so moving a node does not change what it declares.\r\n */\r\n declareAssets(assets: AssetScope): void {\r\n if (this.renderSelf === Node3D.prototype.renderSelf) return;\r\n const scene = new Scene3D();\r\n this.renderSelf(scene);\r\n declare3DResources(scene, assets);\r\n }\r\n}\r\n\r\ndeclareMembers(Node3D, {\r\n x: property({ default: 0 }),\r\n y: property({ default: 0 }),\r\n z: property({ default: 0 }),\r\n rotationX: property({ default: 0 }),\r\n rotationY: property({ default: 0 }),\r\n rotationZ: property({ default: 0 }),\r\n rotationOrder: property({ default: \"XYZ\" }),\r\n quaternion: quaternionProperty(),\r\n scaleX: property({ default: 1 }),\r\n scaleY: property({ default: 1 }),\r\n scaleZ: property({ default: 1 }),\r\n lookAt: optionalVector3Property(\"snap\"),\r\n visible: property({ default: true }),\r\n shadow: property({ default: true }),\r\n renderOrder: property({ default: 0 }),\r\n\r\n moveTo: command({ args: [\"x\", \"y\", \"z\"] }),\r\n rotateTo: command({ args: [\"rotationX\", \"rotationY\", \"rotationZ\"] }),\r\n scaleTo: command({\r\n args: [{ key: \"scale\", kind: \"number\", min: 0, step: 0.05, unit: \"×\" }, \"scaleX\", \"scaleY\", \"scaleZ\"],\r\n }),\r\n});\r\n\r\n/**\r\n * Expand `position`/`rotation`/`scale` in a prop bag into their axis props.\r\n *\r\n * Returns the bag untouched when it names none of them, so the common write path\r\n * allocates nothing. A **binding** expands into three bindings that each resolve\r\n * the vector and take one component — so `position={() => lift()}` stays a\r\n * binding, and one thunk driving all three axes is still read once per axis per\r\n * frame rather than being frozen at bind time.\r\n */\r\nfunction distributeVectors<T extends object>(props: T | undefined): T | undefined {\r\n if (!props) return props;\r\n\r\n let out: Record<string, unknown> | undefined;\r\n\r\n for (const key in VECTOR_SUGAR) {\r\n const value = (props as Record<string, unknown>)[key];\r\n if (value === undefined) continue;\r\n\r\n out ??= { ...(props as Record<string, unknown>) };\r\n delete out[key];\r\n\r\n const axes = VECTOR_SUGAR[key];\r\n\r\n if (typeof value === \"function\") {\r\n const read = value as () => Vector3Input;\r\n for (let i = 0; i < 3; i++) {\r\n const axis = axes[i];\r\n if (out[axis] !== undefined) continue;\r\n out[axis] = () => componentOf(resolveVector3(read()), i);\r\n }\r\n continue;\r\n }\r\n\r\n const vector = resolveVector3(value as Vector3Input);\r\n for (let i = 0; i < 3; i++) {\r\n const axis = axes[i];\r\n if (out[axis] === undefined) out[axis] = componentOf(vector, i);\r\n }\r\n\r\n // `order` rides on an Euler and has nowhere else to go.\r\n if (key === \"rotation\") {\r\n const order = (value as Euler3).order;\r\n if (order !== undefined && out.rotationOrder === undefined) out.rotationOrder = order;\r\n }\r\n }\r\n\r\n return (out as T) ?? props;\r\n}\r\n\r\n/** `data` without the keys left unstated, so a tween never aims an axis at `undefined`. */\r\nfunction stated<T extends object>(data: T | undefined): Partial<T> {\r\n const out: Partial<T> = {};\r\n for (const key in data) if (data[key] !== undefined) out[key] = data[key];\r\n return out;\r\n}\r\n\r\nfunction componentOf(vector: Vector3, index: number): number {\r\n return index === 0 ? vector.x : index === 1 ? vector.y : vector.z;\r\n}\r\n"]}
1
+ {"version":3,"file":"node3d.js","sourceRoot":"","sources":["../../../../src/components/trees/three/node3d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAC5F,OAAO,EACH,cAAc,GAEjB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAGzD,OAAO,EAAE,IAAI,EAAuD,MAAM,8BAA8B,CAAC;AAEzG,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAgEpD;;;GAGG;AACH,gBAAgB;AAChB,MAAM,UAAU,aAAa,CAAC,IAAY;IACtC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAuC,CAAC;IAC5D,OAAO,OAAO,MAAM,EAAE,QAAQ,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACjF,CAAC;AAED,wEAAwE;AACxE,MAAM,YAAY,GAAgE;IAC9E,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IACzB,QAAQ,EAAE,CAAC,WAAW,EAAE,WAAW,EAAE,WAAW,CAAC;IACjD,KAAK,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC;CACxC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,OAAO,MAA4C,SAAQ,IAAO;IACpE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;YAAE,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;IAC1E,OAAO,GAAG,CAAC;AACf,CAAC;AAED,SAAS,WAAW,CAAC,MAAe,EAAE,KAAa;IAC/C,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AACtE,CAAC","sourcesContent":["import { declareMembers, property } from \"@/attributes/properties/decorator\";\nimport { optionalVector3Property, quaternionProperty } from \"@/attributes/properties/typed\";\nimport {\n resolveVector3,\n type Euler3, type EulerOrder, type Quaternion, type Vector3, type Vector3Input,\n} from \"@/render3d/vector3\";\nimport type { RenderContext3D } from \"@/render3d/render-context3d\";\nimport { Scene3D } from \"@/render3d/scene3d\";\nimport { declare3DResources } from \"@/render3d/tracking\";\nimport type { AssetScope } from \"@/assets/scope\";\nimport type { Shadow3D, Transform3D } from \"@/render3d/transform\";\nimport { Node, type NodeConfig, type NodeDimension, type NodeProps } from \"@/components/trees/node/node\";\nimport type { Command, CommandArgs } from \"@/tween/command\";\nimport { command } from \"@/tween/command-decorator\";\nimport type { EasingFunction } from \"@/tween/ease/type\";\nimport type { TweenStepper } from \"@/tween/stepper\";\n\nexport interface Node3DProps extends NodeProps {\n /** Position in the parent's local space. A scalar sets all three axes. */\n position: Vector3Input;\n /** Position on one axis. The same names 2D uses, one dimension over. */\n x: number;\n y: number;\n z: number;\n /**\n * Euler rotation in **degrees**, matching 2D `rotation`. Ignored when\n * {@link quaternion} is set.\n */\n rotation: Vector3Input | Euler3;\n /** Rotation about one axis, in **degrees**. Same names as 2D's. */\n rotationX: number;\n rotationY: number;\n rotationZ: number;\n /** The order the Euler axes are applied in. Default `\"XYZ\"`. */\n rotationOrder: EulerOrder;\n /**\n * Rotation as a unit quaternion. Wins over {@link rotation} — use it for\n * tumbles where Euler interpolation would gimbal.\n */\n quaternion: Quaternion;\n /** Per-axis scale; a scalar scales uniformly. Default 1. */\n scale: Vector3Input;\n scaleX: number;\n scaleY: number;\n scaleZ: number;\n /**\n * World-space point to orient toward, applied after {@link position}. Wins\n * over both {@link rotation} and {@link quaternion}.\n */\n lookAt: Vector3Input | undefined;\n /** Hide without removing — the cached renderer object stays alive. */\n visible: boolean;\n /**\n * Shadow participation. Default `true`, so turning shadows on for the scene\n * turns them on. Pass `false` to opt out, or `\"cast\"`/`\"receive\"` for one half.\n */\n shadow: Shadow3D;\n /** Draw-order override, for tuning transparent sorting. */\n renderOrder: number;\n}\n\n/**\n * A 3D parent's own coordinates for where its children sit: the units of a\n * graph, say. Position only, as a `ChildPlane` is in 2D: a child keeps its\n * size, turn and scale. Answered by the parent ({@link Node3D._spaceOf}, or\n * `Canvas3D._spaceOf` for a child of the viewport itself).\n */\nexport interface ChildSpace3D {\n /** A child's `x`/`y`/`z` as a point in the parent's local space. */\n toLocal(x: number, y: number, z: number): Vector3;\n}\n\n/** A parent that may place its 3D children in coordinates of its own: a `Node3D`, or a 3D viewport. */\ninterface SpaceHolder3D {\n _spaceOf(child: Node3D | null): ChildSpace3D | null;\n}\n\n/**\n * The coordinates `node`'s parent places it by, or `null` when they are the\n * parent's local space. The parent may be a 3D node or the viewport holding it.\n */\n/** @internal */\nexport function parentSpaceOf(node: Node3D): ChildSpace3D | null {\n const parent = node.parent as Partial<SpaceHolder3D> | null;\n return typeof parent?._spaceOf === \"function\" ? parent._spaceOf(node) : null;\n}\n\n/** The three axis props each vector prop distributes into, in order. */\nconst VECTOR_SUGAR: Readonly<Record<string, readonly [string, string, string]>> = {\n position: [\"x\", \"y\", \"z\"],\n rotation: [\"rotationX\", \"rotationY\", \"rotationZ\"],\n scale: [\"scaleX\", \"scaleY\", \"scaleZ\"],\n};\n\n/**\n * A thing in 3D space — the root of the 3D scene graph.\n *\n * The sibling of {@link Node2D}: same tree, same props, same `to()`/`set()`/\n * `save()`/`restore()`, same refs, context and per-node clock, all inherited from\n * {@link Node}. What differs is the only thing that genuinely differs between the\n * two — how a node is placed and how it draws. There is no `width`, no `padding`,\n * no anchor and no flex here, because none of them mean anything for a mesh; a 3D\n * node's whole placement is its transform.\n *\n * Canvas3D({\n * children: [\n * Camera3D({ orbit: 30, elevation: 18, distance: 6 }),\n * AmbientLight3D({ intensity: 0.4 }),\n * Group3D({ ref: rig, children: [Box3D({ width: 2, cornerRadius: 0.15, fill: \"tomato\" })] }),\n * ],\n * })\n *\n * rig().to({ data: { rotationY: 360, y: 1 }, duration: 2 });\n *\n * ── Axes are scalars, and vectors are sugar over them ─────────────────────────\n * `x`, `y`, `z`, `rotationX/Y/Z` and `scaleX/Y/Z` are the real props, and they\n * are named exactly what 2D names them. `position`, `rotation` and `scale` are\n * distributed into those three, the way `Node2D` already distributes `size` into\n * `width`/`height` — so both spellings tween identically and there is one source\n * of truth for where a node is. That is what makes `to({ y: 3 })` work: with a\n * single vector prop it would have had nothing to interpolate on the other two\n * axes, which is exactly the trap that made every 3D scene restate coordinates it\n * did not mean to change.\n *\n * A `Node3D` only ever lives under a `Canvas3D` — the one node that holds both\n * dimensions. Parenting one to a `Rect` throws rather than silently drawing\n * nothing (see {@link Node.acceptsChild}). Every 3D node type is a\n * `component3d`, which lowers onto this class and draws from its `render`.\n */\nexport class Node3D<P extends Node3DProps = Node3DProps> extends Node<P> {\n get dimension(): NodeDimension { return \"3d\"; }\n\n declare x: number;\n declare y: number;\n declare z: number;\n\n declare rotationX: number;\n declare rotationY: number;\n declare rotationZ: number;\n declare rotationOrder: EulerOrder;\n\n declare quaternion: Quaternion;\n\n declare scaleX: number;\n declare scaleY: number;\n declare scaleZ: number;\n\n declare lookAt: Vector3Input | undefined;\n declare visible: boolean;\n declare shadow: Shadow3D;\n declare renderOrder: number;\n\n constructor(props?: NodeConfig<any, P>) {\n super(props);\n // Distributed before `initProps`, which only ever applies keys that are\n // registered props — a `position` left in the bag would be dropped.\n this.initProps(distributeVectors(props) as NodeConfig<any, P>);\n this.adoptChildrenProp(props);\n }\n\n /** Animate the position, whichever axes are given; the rest stay where they are. */\n moveTo(args: CommandArgs<{ x?: number; y?: number; z?: number }> & { duration: number }): Command<P> {\n return this.to({ data: stated(args.data) as Partial<P>, duration: args.duration, easing: args.easing });\n }\n\n /** Animate the Euler rotation, in degrees, whichever axes are given. */\n rotateTo(\n args: CommandArgs<{ rotationX?: number; rotationY?: number; rotationZ?: number }> & { duration: number },\n ): Command<P> {\n return this.to({ data: stated(args.data) as Partial<P>, duration: args.duration, easing: args.easing });\n }\n\n /** Animate the scale: `scale` on every axis, and any axis given beside it on that one. */\n scaleTo(\n args: CommandArgs<{ scale?: number; scaleX?: number; scaleY?: number; scaleZ?: number }> & { duration: number },\n ): Command<P> {\n return this.to({ data: stated(args.data) as Partial<P>, duration: args.duration, easing: args.easing });\n }\n\n /** This node's position, composed from the axis props. */\n get position(): Vector3 {\n return { x: this.x, y: this.y, z: this.z };\n }\n set position(value: Vector3Input) {\n this.set({ position: value } as never);\n }\n\n /** This node's Euler rotation in degrees, composed from the axis props. */\n get rotation(): Euler3 {\n return { x: this.rotationX, y: this.rotationY, z: this.rotationZ, order: this.rotationOrder };\n }\n set rotation(value: Vector3Input | Euler3) {\n this.set({ rotation: value } as never);\n }\n\n /** This node's scale, composed from the axis props. */\n get scale(): Vector3 {\n return { x: this.scaleX, y: this.scaleY, z: this.scaleZ };\n }\n set scale(value: Vector3Input) {\n this.set({ scale: value } as never);\n }\n\n /**\n * Distribute the vector sugar into axis props, then write as usual.\n *\n * Same shape as `Node2D.set`'s handling of `size`, and for the same reason:\n * `position` has no slot of its own, so it has to become three writes\n * before the generic loop runs. An explicitly stated axis in the same call\n * wins over the vector, which is what lets `{ position: p, y: 0 }` mean what\n * it reads like.\n */\n override set(props: { [K in keyof P]?: P[K] | (() => P[K]) }): void {\n super.set(distributeVectors(props) as typeof props);\n }\n\n /**\n * The tween half of the same rule. Expanded here rather than in the command\n * so `to({ position: [...] })` and `to({ x, y, z })` produce identical\n * steppers — one interpolating path, whichever way it was written.\n */\n override _prepareStep(to: Partial<P>, duration: number, easing?: EasingFunction): TweenStepper {\n return super._prepareStep(distributeVectors(to) as Partial<P>, duration, easing);\n }\n\n /**\n * This node's placement, as the renderer's own vocabulary.\n *\n * Sampled fresh every frame from the prop slots, so a tween moves the object\n * without anything here caching state between frames.\n *\n * `quaternion` is only emitted when it has been set away from identity: it\n * wins over `rotation` in a {@link Transform3D}, so always sending it would\n * make `rotation` silently do nothing.\n */\n protected transform3D(): Transform3D {\n const quaternion = this.quaternion as unknown as Quaternion;\n const identityQuaternion =\n quaternion.x === 0 && quaternion.y === 0 && quaternion.z === 0 && quaternion.w === 1;\n const space = parentSpaceOf(this);\n return {\n position: space ? space.toLocal(this.x, this.y, this.z) : this.position,\n rotation: this.rotation,\n quaternion: identityQuaternion ? undefined : quaternion,\n scale: this.scale,\n lookAt: this.lookAt,\n visible: this.visible,\n shadow: this.shadow,\n renderOrder: this.renderOrder,\n };\n }\n\n /**\n * The coordinates `child`'s `x`/`y`/`z` are in, or `null` (the default) when\n * they are this node's local space. A `null` child is one not here yet.\n */\n /** @internal */\n _spaceOf(_child: Node3D | null): ChildSpace3D | null {\n return null;\n }\n\n /**\n * The transform that goes on this node's *group* — the scope its children\n * nest inside. Defaults to this node's own placement, which is right for\n * everything that lives at its own origin.\n *\n * A camera answers identity and places itself instead: three aims a\n * camera's -Z at `lookAt` but a plain group's +Z, so hanging a camera's\n * placement on its group would point the shot backwards.\n */\n protected groupTransform(): Transform3D {\n return this.transform3D();\n }\n\n /**\n * Draw this node's own contribution to the scene — a `ctx.draw(graphics3D)`\n * for something with geometry, a `ctx.light(...)` for a light, nothing at all\n * for a plain {@link Group3D}. Children are recorded after it, nested inside\n * this node's transform.\n */\n protected renderSelf(ctx: RenderContext3D): void { }\n\n /**\n * Record this node and its subtree into `ctx`.\n *\n * An invisible node still opens its scope: `visible: false` is a renderer-side\n * flag on a live object rather than a removal, which is what lets a node be\n * hidden and shown again without its GPU resources being rebuilt. Skipping the\n * walk here would instead sweep the whole subtree out of the cache.\n */\n render(ctx: RenderContext3D): void {\n // The editor's flag folds into `visible` rather than adding a second one:\n // the 3D side already has exactly this concept, honoured by the picking\n // walk, and two flags meaning \"do not show this\" would be two places to\n // ask. Still opens its scope — see the note above on why an invisible\n // node keeps its cached renderer object.\n if (this.hidden) {\n ctx.begin({ id: this.id, transform: { ...this.groupTransform(), visible: false } });\n ctx.end();\n return;\n }\n ctx.begin({ id: this.id, transform: this.groupTransform() });\n this.renderSelf(ctx);\n for (const child of this._children) {\n if (child instanceof Node3D) child.render(ctx);\n }\n ctx.end();\n }\n\n /**\n * What {@link renderSelf} records, never {@link render}: the placement lives on\n * the group scope, so moving a node does not change what it declares.\n */\n declareAssets(assets: AssetScope): void {\n if (this.renderSelf === Node3D.prototype.renderSelf) return;\n const scene = new Scene3D();\n this.renderSelf(scene);\n declare3DResources(scene, assets);\n }\n}\n\ndeclareMembers(Node3D, {\n x: property({ default: 0 }),\n y: property({ default: 0 }),\n z: property({ default: 0 }),\n rotationX: property({ default: 0 }),\n rotationY: property({ default: 0 }),\n rotationZ: property({ default: 0 }),\n rotationOrder: property({ default: \"XYZ\" }),\n quaternion: quaternionProperty(),\n scaleX: property({ default: 1 }),\n scaleY: property({ default: 1 }),\n scaleZ: property({ default: 1 }),\n lookAt: optionalVector3Property(\"snap\"),\n visible: property({ default: true }),\n shadow: property({ default: true }),\n renderOrder: property({ default: 0 }),\n\n moveTo: command({ args: [\"x\", \"y\", \"z\"] }),\n rotateTo: command({ args: [\"rotationX\", \"rotationY\", \"rotationZ\"] }),\n scaleTo: command({\n args: [{ key: \"scale\", kind: \"number\", min: 0, step: 0.05, unit: \"×\" }, \"scaleX\", \"scaleY\", \"scaleZ\"],\n }),\n});\n\n/**\n * Expand `position`/`rotation`/`scale` in a prop bag into their axis props.\n *\n * Returns the bag untouched when it names none of them, so the common write path\n * allocates nothing. A **binding** expands into three bindings that each resolve\n * the vector and take one component — so `position={() => lift()}` stays a\n * binding, and one thunk driving all three axes is still read once per axis per\n * frame rather than being frozen at bind time.\n */\nfunction distributeVectors<T extends object>(props: T | undefined): T | undefined {\n if (!props) return props;\n\n let out: Record<string, unknown> | undefined;\n\n for (const key in VECTOR_SUGAR) {\n const value = (props as Record<string, unknown>)[key];\n if (value === undefined) continue;\n\n out ??= { ...(props as Record<string, unknown>) };\n delete out[key];\n\n const axes = VECTOR_SUGAR[key];\n\n if (typeof value === \"function\") {\n const read = value as () => Vector3Input;\n for (let i = 0; i < 3; i++) {\n const axis = axes[i];\n if (out[axis] !== undefined) continue;\n out[axis] = () => componentOf(resolveVector3(read()), i);\n }\n continue;\n }\n\n const vector = resolveVector3(value as Vector3Input);\n for (let i = 0; i < 3; i++) {\n const axis = axes[i];\n if (out[axis] === undefined) out[axis] = componentOf(vector, i);\n }\n\n // `order` rides on an Euler and has nowhere else to go.\n if (key === \"rotation\") {\n const order = (value as Euler3).order;\n if (order !== undefined && out.rotationOrder === undefined) out.rotationOrder = order;\n }\n }\n\n return (out as T) ?? props;\n}\n\n/** `data` without the keys left unstated, so a tween never aims an axis at `undefined`. */\nfunction stated<T extends object>(data: T | undefined): Partial<T> {\n const out: Partial<T> = {};\n for (const key in data) if (data[key] !== undefined) out[key] = data[key];\n return out;\n}\n\nfunction componentOf(vector: Vector3, index: number): number {\n return index === 0 ? vector.x : index === 1 ? vector.y : vector.z;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"audio.js","sourceRoot":"","sources":["../../src/document/audio.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAErE;;;;;GAKG;AACH,MAAM,aAAa,GAAG,MAAM,CAAC;AAE7B,yEAAyE;AACzE,SAAS,cAAc;IACnB,OAAO,EAAE,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,IAA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AG,EAAE,QAAQ,EAAE,CAAC,GAAG,GAAG,CAAC,QAAQ,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;AACxF,CAAC;AAED,+GAA+G;AAC/G,MAAM,UAAU,YAAY,CAAC,GAAiB;IAC1C,MAAM,OAAO,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IACvE,OAAO,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;AAC1E,CAAC","sourcesContent":["import type { AudioDocument, ClipDocument, CommandSpec, CompositionDocument, NodeSpec, TimedNodeSpec, VisualDocument } from \"./types\";\r\nimport { isAudioDocument, isStillDocument, nodeSpan } from \"./types\";\r\n\r\n/**\r\n * The id the authored root bus is rewritten to.\r\n *\r\n * Namespaced like every other synthesized id in the document layer, so it can\r\n * never collide with one a document authored itself.\r\n */\r\nconst AUDIO_ROOT_ID = \"@bus\";\r\n\r\n/** The root bus when an audio document doesn't author one explicitly. */\r\nfunction defaultRootBus(): NodeSpec {\r\n return { id: AUDIO_ROOT_ID, type: \"audioBus\", parentId: null, layerOrder: 0, props: {} };\r\n}\r\n\r\n/** The root a lowered audio clip hangs from. Draws nothing; lays out once. */\r\nfunction clipRoot(): NodeSpec {\r\n return { id: \"\", type: \"canvas2d\", parentId: null, layerOrder: 0, props: {} };\r\n}\r\n\r\n/**\r\n * An audio document, as the composition it already is.\r\n *\r\n * There is no second evaluator for sound, and this is what keeps it that way:\r\n * an audio clip is compiled, seeked and restored by `ClipTimeline` like any\r\n * other, so a bus fade and a rectangle's fade cannot drift because there is only\r\n * one machine running them.\r\n *\r\n * The only thing that has to be arranged is the root. An audio document's own\r\n * root is a bus, but a clip's root is always a `Canvas2D` — so the bus\r\n * becomes that canvas's single audio child under {@link AUDIO_ROOT_ID}, and\r\n * every `targetId: null` / `parentId: null` is rewritten to name it. The canvas\r\n * draws nothing and lays out an empty box once, which is the whole cost of a\r\n * clip that is only sound.\r\n */\r\nexport function loweredAudioDocument(doc: AudioDocument): CompositionDocument {\r\n const nodes: TimedNodeSpec[] = [clipRoot()];\r\n if (!doc.nodes.some(isRootBus)) nodes.push(defaultRootBus());\r\n for (const spec of doc.nodes) nodes.push(reparent(spec));\r\n\r\n return {\r\n kind: \"composition\",\r\n duration: doc.duration,\r\n variables: doc.variables,\r\n nodes,\r\n commands: doc.commands.map(retarget),\r\n };\r\n}\r\n\r\n/** The row an audio document means as its root bus. */\r\nfunction isRootBus(spec: NodeSpec): boolean {\r\n return spec.id === \"\" && spec.type === \"audioBus\";\r\n}\r\n\r\n/** A node spec with the implicit root resolved to {@link AUDIO_ROOT_ID}. */\r\nfunction reparent(spec: TimedNodeSpec): TimedNodeSpec {\r\n if (isRootBus(spec)) return { ...spec, id: AUDIO_ROOT_ID, parentId: null };\r\n // `null` is the document's own convention for \"the root\"; `\"\"` is the same\r\n // row named by id, which `checkTree` also resolves. Both mean the bus.\r\n if (spec.parentId === null || spec.parentId === \"\") return { ...spec, parentId: AUDIO_ROOT_ID };\r\n return spec;\r\n}\r\n\r\n/** A command with the implicit root resolved to {@link AUDIO_ROOT_ID}. */\r\nfunction retarget(command: CommandSpec): CommandSpec {\r\n if (command.targetId === null || command.targetId === \"\") {\r\n return { ...command, targetId: AUDIO_ROOT_ID };\r\n }\r\n return command;\r\n}\r\n\r\nexport { AUDIO_ROOT_ID };\r\n\r\n/**\r\n * A `sound` or `video` row with no `play` command of its own plays as it did\r\n * before sound came only from commands: a sound over its span (open-ended, to\r\n * its own end), a video once per segment, or over its span while it plays.\r\n */\r\nexport function withPlayedSounds(doc: CompositionDocument): CompositionDocument {\r\n const played = new Set(doc.commands.filter((c) => c.type === \"play\").map((c) => c.targetId));\r\n const added: CommandSpec[] = [];\r\n for (const spec of doc.nodes) {\r\n if ((spec.type !== \"sound\" && spec.type !== \"video\") || played.has(spec.id)) continue;\r\n const { start, end } = nodeSpan(spec);\r\n const segments = spec.type === \"video\" ? (spec.props as { segments?: unknown }).segments : undefined;\r\n if (Array.isArray(segments) && segments.length > 0) {\r\n (segments as { at: number; from: number; duration: number; speed?: number; volume?: number }[]).forEach((segment, i) => {\r\n added.push({\r\n // An endless segment plays to the source's end: a command has no endless length.\r\n id: `@play:${spec.id}:${i}`, type: \"play\", targetId: spec.id, at: start + segment.at,\r\n duration: Number.isFinite(segment.duration) ? segment.duration : 0,\r\n args: {\r\n from: segment.from,\r\n ...(segment.speed !== undefined && { speed: segment.speed }),\r\n ...(segment.volume !== undefined && { volume: segment.volume }),\r\n },\r\n });\r\n });\r\n continue;\r\n }\r\n added.push({\r\n id: `@play:${spec.id}`, type: \"play\", targetId: spec.id, at: start,\r\n duration: Number.isFinite(end) ? end - start : 0, args: {},\r\n });\r\n }\r\n return added.length === 0 ? doc : { ...doc, commands: [...doc.commands, ...added] };\r\n}\r\n\r\n/** A clip as its timeline builds it: an audio document lowered to the composition it is, its sounds played. */\r\nexport function clipDocument(doc: ClipDocument): VisualDocument {\r\n const lowered = isAudioDocument(doc) ? loweredAudioDocument(doc) : doc;\r\n return isStillDocument(lowered) ? lowered : withPlayedSounds(lowered);\r\n}\r\n"]}
1
+ {"version":3,"file":"audio.js","sourceRoot":"","sources":["../../src/document/audio.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAErE;;;;;GAKG;AACH,MAAM,aAAa,GAAG,MAAM,CAAC;AAE7B,yEAAyE;AACzE,SAAS,cAAc;IACnB,OAAO,EAAE,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;AAC7F,CAAC;AAED,8EAA8E;AAC9E,SAAS,QAAQ;IACb,OAAO,EAAE,EAAE,EAAE,EA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CAAC,GAAiB;IAC1C,MAAM,OAAO,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IACvE,OAAO,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;AAC1E,CAAC","sourcesContent":["import type { AudioDocument, ClipDocument, CommandSpec, CompositionDocument, NodeSpec, TimedNodeSpec, VisualDocument } from \"./types\";\nimport { isAudioDocument, isStillDocument, nodeSpan } from \"./types\";\n\n/**\n * The id the authored root bus is rewritten to.\n *\n * Namespaced like every other synthesized id in the document layer, so it can\n * never collide with one a document authored itself.\n */\nconst AUDIO_ROOT_ID = \"@bus\";\n\n/** The root bus when an audio document doesn't author one explicitly. */\nfunction defaultRootBus(): NodeSpec {\n return { id: AUDIO_ROOT_ID, type: \"audioBus\", parentId: null, layerOrder: 0, props: {} };\n}\n\n/** The root a lowered audio clip hangs from. Draws nothing; lays out once. */\nfunction clipRoot(): NodeSpec {\n return { id: \"\", type: \"canvas2d\", parentId: null, layerOrder: 0, props: {} };\n}\n\n/**\n * An audio document, as the composition it already is.\n *\n * There is no second evaluator for sound, and this is what keeps it that way:\n * an audio clip is compiled, seeked and restored by `ClipTimeline` like any\n * other, so a bus fade and a rectangle's fade cannot drift because there is only\n * one machine running them.\n *\n * The only thing that has to be arranged is the root. An audio document's own\n * root is a bus, but a clip's root is always a `Canvas2D` — so the bus\n * becomes that canvas's single audio child under {@link AUDIO_ROOT_ID}, and\n * every `targetId: null` / `parentId: null` is rewritten to name it. The canvas\n * draws nothing and lays out an empty box once, which is the whole cost of a\n * clip that is only sound.\n */\nexport function loweredAudioDocument(doc: AudioDocument): CompositionDocument {\n const nodes: TimedNodeSpec[] = [clipRoot()];\n if (!doc.nodes.some(isRootBus)) nodes.push(defaultRootBus());\n for (const spec of doc.nodes) nodes.push(reparent(spec));\n\n return {\n kind: \"composition\",\n duration: doc.duration,\n variables: doc.variables,\n nodes,\n commands: doc.commands.map(retarget),\n };\n}\n\n/** The row an audio document means as its root bus. */\nfunction isRootBus(spec: NodeSpec): boolean {\n return spec.id === \"\" && spec.type === \"audioBus\";\n}\n\n/** A node spec with the implicit root resolved to {@link AUDIO_ROOT_ID}. */\nfunction reparent(spec: TimedNodeSpec): TimedNodeSpec {\n if (isRootBus(spec)) return { ...spec, id: AUDIO_ROOT_ID, parentId: null };\n // `null` is the document's own convention for \"the root\"; `\"\"` is the same\n // row named by id, which `checkTree` also resolves. Both mean the bus.\n if (spec.parentId === null || spec.parentId === \"\") return { ...spec, parentId: AUDIO_ROOT_ID };\n return spec;\n}\n\n/** A command with the implicit root resolved to {@link AUDIO_ROOT_ID}. */\nfunction retarget(command: CommandSpec): CommandSpec {\n if (command.targetId === null || command.targetId === \"\") {\n return { ...command, targetId: AUDIO_ROOT_ID };\n }\n return command;\n}\n\nexport { AUDIO_ROOT_ID };\n\n/**\n * A `sound` or `video` row with no `play` command of its own plays as it did\n * before sound came only from commands: a sound over its span (open-ended, to\n * its own end), a video once per segment, or over its span while it plays.\n */\nexport function withPlayedSounds(doc: CompositionDocument): CompositionDocument {\n const played = new Set(doc.commands.filter((c) => c.type === \"play\").map((c) => c.targetId));\n const added: CommandSpec[] = [];\n for (const spec of doc.nodes) {\n if ((spec.type !== \"sound\" && spec.type !== \"video\") || played.has(spec.id)) continue;\n const { start, end } = nodeSpan(spec);\n const segments = spec.type === \"video\" ? (spec.props as { segments?: unknown }).segments : undefined;\n if (Array.isArray(segments) && segments.length > 0) {\n (segments as { at: number; from: number; duration: number; speed?: number; volume?: number }[]).forEach((segment, i) => {\n added.push({\n // An endless segment plays to the source's end: a command has no endless length.\n id: `@play:${spec.id}:${i}`, type: \"play\", targetId: spec.id, at: start + segment.at,\n duration: Number.isFinite(segment.duration) ? segment.duration : 0,\n args: {\n from: segment.from,\n ...(segment.speed !== undefined && { speed: segment.speed }),\n ...(segment.volume !== undefined && { volume: segment.volume }),\n },\n });\n });\n continue;\n }\n added.push({\n id: `@play:${spec.id}`, type: \"play\", targetId: spec.id, at: start,\n duration: Number.isFinite(end) ? end - start : 0, args: {},\n });\n }\n return added.length === 0 ? doc : { ...doc, commands: [...doc.commands, ...added] };\n}\n\n/** A clip as its timeline builds it: an audio document lowered to the composition it is, its sounds played. */\nexport function clipDocument(doc: ClipDocument): VisualDocument {\n const lowered = isAudioDocument(doc) ? loweredAudioDocument(doc) : doc;\n return isStillDocument(lowered) ? lowered : withPlayedSounds(lowered);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"builtins.js","sourceRoot":"","sources":["../../src/document/builtins.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAkC,MAAM,iBAAiB,CAAC;AAK/E,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,yCAAyC,CAAC;AACtG,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACtF,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,iCAAiC,CAAC;AAC/F,OAAO,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAChE,OAAO,EACH,cAAc,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,k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MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CACnC,YAAY,CAAC,CAAC,EAAE,GAAG,EAAE;QAChB,MAAiB,CAAC,IAAI,EAAE,CAAC;IAC9B,CAAC,CAAgD,CAAC,CAAC;AAC3D,CAAC","sourcesContent":["import type { Fill } from \"@/attributes/shape/fill/chain\";\r\nimport type { Shadow } from \"@/attributes/shape/shadow/shadow\";\r\nimport type { Stroke } from \"@/attributes/shape/stroke/stroke\";\r\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\r\nimport { driveCommand, type Command, type CommandArgs } from \"@/tween/command\";\r\nimport type { EasingFunction } from \"@/tween/ease/type\";\r\nimport type { Node } from \"@/components/trees/node/node\";\r\nimport type { Node2D } from \"@/components/trees/2d/node2d\";\r\n\r\nimport { BooleanGroup, MaskGroup } from \"@/components/builtins/geometry/composite\";\r\nimport { Ellipse, PathShape, Polygon, Polygram, Rect } from \"@/components/builtins/geometry/geometry\";\r\nimport { Camera, OrbitCamera, RotatedBox } from \"@/components/builtins/layout/layout\";\r\nimport { Video } from \"@/components/builtins/media/media\";\r\nimport { AudioBus, SoundNode } from \"@/components/builtins/audio/audio\";\r\nimport { Canvas2D } from \"@/components/trees/root/canvas2d-node\";\r\nimport { Provider, ThemeProvider } from \"@/components/builtins/providers/providers\";\r\nimport { DefaultTextStyle, NumberNode, RichText, Text } from \"@/components/builtins/text/text\";\r\nimport { Canvas3D } from \"@/components/builtins/three/canvas3d\";\r\nimport {\r\n AmbientLight3D, AreaLight3D, Box3D, Camera3D, Capsule3D, Circle3D, Cone3D, Cylinder3D, DirectionalLight3D,\r\n Environment3D, Extrude3D, Fog3D, Group3D, HemisphereLight3D, Instances3D, Lathe3D, Line3D, Mesh3D, Model3D,\r\n Plane3D, PointLight3D, Points3D, Polyhedron3D, Ring3D, Sphere3D, SpotLight3D, Sprite3D, Torus3D, TorusKnot3D, Tube3D,\r\n} from \"@/components/builtins/three/three\";\r\n\r\nimport { lerpVector2 } from \"@/attributes/layout/vector2\";\r\nimport { lerpColor } from \"@/attributes/shape/fill/lerp\";\r\nimport { parseColor } from \"@/attributes/shape/fill/color/parser\";\r\nimport { lerpVector3 } from \"@/render3d/vector3\";\r\nimport { lerpNumber } from \"@/tween/lerp\";\r\n\r\nimport type { NodeConstructor, Registry, VariableLerp } from \"./registry\";\r\n\r\n/**\r\n * Registration of everything `@motionscript/core` itself ships.\r\n *\r\n * The keys here are **document API**. A stored scene names its nodes and its\r\n * animations with these strings, so renaming one silently breaks every document\r\n * that used it — they are as much a public contract as an exported symbol, and\r\n * are deliberately spelled out rather than derived from `constructor.name`\r\n * (which a minifier is free to mangle).\r\n */\r\n\r\n/** Every built-in node type, keyed as a document names it. */\r\nconst NODE_TYPES: Record<string, NodeConstructor> = {\r\n // Clip root and structural\r\n canvas2d: Canvas2D as unknown as NodeConstructor,\r\n provider: Provider as unknown as NodeConstructor,\r\n \"theme-provider\": ThemeProvider as unknown as NodeConstructor,\r\n \"default-text-style\": DefaultTextStyle as unknown as NodeConstructor,\r\n\r\n // Geometry\r\n rect: Rect as unknown as NodeConstructor,\r\n ellipse: Ellipse as unknown as NodeConstructor,\r\n // The **unit-box** path, not `path-node.ts`'s face-value `Path`. A stored\r\n // document's `data` is a fraction of the node's own box, so a resize is an\r\n // ordinary `width`/`height` write and every editor gizmo works on it\r\n // unchanged (`box-path-node.ts` has the whole argument). `Path` draws its\r\n // `d` at face value and hugs it, which is right for geometry somebody wrote\r\n // in code — it stays exported for that, and is reached by importing the\r\n // class rather than by naming a type in a document.\r\n path: PathShape as unknown as NodeConstructor,\r\n polygon: Polygon as unknown as NodeConstructor,\r\n polygram: Polygram as unknown as NodeConstructor,\r\n boolean: BooleanGroup as unknown as NodeConstructor,\r\n mask: MaskGroup as unknown as NodeConstructor,\r\n\r\n // Layout\r\n camera: Camera as unknown as NodeConstructor,\r\n orbitCamera: OrbitCamera as unknown as NodeConstructor,\r\n \"rotated-box\": RotatedBox as unknown as NodeConstructor,\r\n\r\n // Text\r\n text: Text as unknown as NodeConstructor,\r\n richtext: RichText as unknown as NodeConstructor,\r\n number: NumberNode as unknown as NodeConstructor,\r\n\r\n // Media\r\n video: Video as unknown as NodeConstructor,\r\n\r\n // Audio — a bus groups, a sound plays. `audioBus` is also the root of an\r\n // AudioDocument, the way `canvas2d` is the root of a scene.\r\n audioBus: AudioBus as unknown as NodeConstructor,\r\n sound: SoundNode as unknown as NodeConstructor,\r\n\r\n // 3D — the viewport, then the tree that lives inside it\r\n canvas3d: Canvas3D as unknown as NodeConstructor,\r\n group3d: Group3D as unknown as NodeConstructor,\r\n mesh3d: Mesh3D as unknown as NodeConstructor,\r\n box3d: Box3D as unknown as NodeConstructor,\r\n sphere3d: Sphere3D as unknown as NodeConstructor,\r\n plane3d: Plane3D as unknown as NodeConstructor,\r\n circle3d: Circle3D as unknown as NodeConstructor,\r\n cylinder3d: Cylinder3D as unknown as NodeConstructor,\r\n cone3d: Cone3D as unknown as NodeConstructor,\r\n capsule3d: Capsule3D as unknown as NodeConstructor,\r\n torus3d: Torus3D as unknown as NodeConstructor,\r\n \"torus-knot3d\": TorusKnot3D as unknown as NodeConstructor,\r\n tube3d: Tube3D as unknown as NodeConstructor,\r\n lathe3d: Lathe3D as unknown as NodeConstructor,\r\n extrude3d: Extrude3D as unknown as NodeConstructor,\r\n ring3d: Ring3D as unknown as NodeConstructor,\r\n polyhedron3d: Polyhedron3D as unknown as NodeConstructor,\r\n points3d: Points3D as unknown as NodeConstructor,\r\n line3d: Line3D as unknown as NodeConstructor,\r\n sprite3d: Sprite3D as unknown as NodeConstructor,\r\n instances3d: Instances3D as unknown as NodeConstructor,\r\n model3d: Model3D as unknown as NodeConstructor,\r\n camera3d: Camera3D as unknown as NodeConstructor,\r\n \"ambient-light3d\": AmbientLight3D as unknown as NodeConstructor,\r\n \"directional-light3d\": DirectionalLight3D as unknown as NodeConstructor,\r\n \"point-light3d\": PointLight3D as unknown as NodeConstructor,\r\n \"spot-light3d\": SpotLight3D as unknown as NodeConstructor,\r\n \"hemisphere-light3d\": HemisphereLight3D as unknown as NodeConstructor,\r\n \"area-light3d\": AreaLight3D as unknown as NodeConstructor,\r\n fog3d: Fog3D as unknown as NodeConstructor,\r\n environment3d: Environment3D as unknown as NodeConstructor,\r\n};\r\n\r\n/** A node method taking one {@link CommandArgs}. */\r\ntype EasedMethod = (args: CommandArgs) => Command<Record<string, unknown>>;\r\n\r\n/** Call a paint command (`fillTo`/`overlayTo`/`strokeTo`/`shadowTo`). */\r\nfunction paintCommand(method: string, argKey: string) {\r\n return (\r\n target: Node,\r\n args: Record<string, unknown>,\r\n duration: number,\r\n easing?: EasingFunction,\r\n ): Command<Record<string, unknown>> => {\r\n const fn = (target as unknown as Record<string, unknown>)[method];\r\n if (typeof fn !== \"function\") {\r\n throw new Error(\r\n `Command \"${method}\" is not available on ${target.constructor.name}.`,\r\n );\r\n }\r\n return (fn as EasedMethod).call(target, { data: args[argKey] as Record<string, unknown>, duration, easing });\r\n };\r\n}\r\n\r\n/**\r\n * The interpolations a document can name in `VariableSpec.lerp`.\r\n *\r\n * Deliberately the small set a variable actually holds — a number, a point, a\r\n * colour — rather than one entry per attribute in the library. A variable drives\r\n * props *through* an expression, so it only has to carry the quantity that\r\n * varies: a gradient that shifts is one `stop` number bound into a fill, not a\r\n * whole fill being interpolated a second time. Anything else is a\r\n * `registry.addLerp` away.\r\n */\r\nconst VARIABLE_LERPS: Record<string, VariableLerp> = {\r\n number: lerpNumber as VariableLerp,\r\n vector2: lerpVector2 as VariableLerp,\r\n vector3: lerpVector3 as VariableLerp,\r\n /**\r\n * Parse both ends, blend per channel, hand back a CSS string.\r\n *\r\n * A string rather than the parsed tuple because that is what the prop on the\r\n * far side of the expression takes — every fill, stroke and shadow resolves\r\n * a colour from CSS text, and `parseColor` reads theme tokens and the\r\n * `\"white/10\"` opacity suffix too, so a variable can hold either.\r\n */\r\n color: ((from, to, t) => {\r\n const [r, g, b, a] = lerpColor(parseColor(String(from)), parseColor(String(to)), t);\r\n const channel = (v: number) => Math.round(Math.min(Math.max(v, 0), 1) * 255);\r\n return `rgba(${channel(r)}, ${channel(g)}, ${channel(b)}, ${Number(a.toFixed(4))})`;\r\n }) as VariableLerp,\r\n /**\r\n * No interpolation: hold `from` until the tween lands, then take `to`.\r\n *\r\n * The default for a non-numeric variable: a discrete value (a string of\r\n * text, an enum, a boolean) has no midpoint, and inventing one produces a\r\n * frame that is neither state.\r\n */\r\n step: ((from, to, t) => (t >= 1 ? to : from)) as VariableLerp,\r\n};\r\n\r\n/**\r\n * Seed a {@link Registry} with everything `@motionscript/core` itself ships.\r\n *\r\n * **Internal, and called from `Registry`'s own constructor.** It used to be\r\n * public and every host had to call it at module scope before compiling\r\n * anything — which `sideEffects: false` is entitled to delete, with a failure\r\n * mode (\"unknown node type rect\") that points nowhere near the cause. A registry\r\n * that seeds itself makes the vocabulary a value dependency of the engine\r\n * instead, so there is nothing left to tree-shake and nothing to remember.\r\n *\r\n * @internal\r\n */\r\nexport function installBuiltins(registry: Registry): void {\r\n for (const [key, ctor] of Object.entries(NODE_TYPES)) {\r\n registry.addNode(key, ctor);\r\n }\r\n for (const [key, lerp] of Object.entries(VARIABLE_LERPS)) {\r\n registry.addLerp(key, lerp);\r\n }\r\n\r\n // ── Props ────────────────────────────────────────────────────────────────\r\n // `args` *is* the props diff — no wrapper key, since `to`/`set` each carry\r\n // exactly one argument and a node's own props are already a fixed,\r\n // known-shape bag (not something a second command parameter could collide\r\n // with the way `to`/`set` never gained one).\r\n registry.addCommand(\"to\", (target, args, duration, easing) =>\r\n (target as Node2D).to({\r\n // Copied: `_prepareStep` expands sugar into its target in place, which\r\n // would rewrite the document row a diff compares by identity.\r\n data: { ...args } as Record<string, never>,\r\n duration,\r\n easing,\r\n }) as unknown as Command<Record<string, unknown>>);\r\n\r\n // A stamp: write props with no tween. `duration` is ignored, which is what\r\n // makes it usable as the \"set this here\" a keyframe editor needs.\r\n //\r\n // `binds` because its args reach `set()` verbatim, so an expression among\r\n // them is a binding — this is how a prop starts following a variable partway\r\n // through a scene rather than from the moment its node is authored.\r\n registry.addCommand(\"set\", (target, args) => {\r\n const props = args as Record<string, never>;\r\n return driveCommand(0, () => {\r\n (target as Node2D).set(props);\r\n }) as unknown as Command<Record<string, unknown>>;\r\n }, { binds: true });\r\n\r\n // ── Paint (shapes, text, Canvas2D) ─────────────────────────────────────\r\n // Node-less rather than per-type, like `to` and `set` above: these are\r\n // generic over every painted node, and they take a `TweenOptions` bag where\r\n // an ordinary command takes a bare easing function — so they need a factory\r\n // that knows that convention rather than the uniform one a node type's own\r\n // table dispatches through.\r\n // Each declares the one key it reads, in the kind its property uses, so a\r\n // host draws the same paint stack for the command as for the prop.\r\n registry.addCommand(\"fillTo\", paintCommand(\"fillTo\", \"fill\"), { args: [{ key: \"fill\", kind: \"fills\" }], method: \"fillTo\" });\r\n registry.addCommand(\"overlayTo\", paintCommand(\"overlayTo\", \"overlay\"), { args: [{ key: \"overlay\", kind: \"fills\" }], method: \"overlayTo\" });\r\n registry.addCommand(\"strokeTo\", paintCommand(\"strokeTo\", \"stroke\"), { args: [{ key: \"stroke\", kind: \"strokes\" }], method: \"strokeTo\" });\r\n registry.addCommand(\"shadowTo\", paintCommand(\"shadowTo\", \"shadow\"), { args: [{ key: \"shadow\", kind: \"shadows\" }], method: \"shadowTo\" });\r\n\r\n // Transform, camera, text and `restore` commands are not registered here:\r\n // they are `command()` methods, and `Registry.addNode` publishes them off\r\n // the classes above. See `document/registry.ts`.\r\n\r\n // ── Variables ────────────────────────────────────────────────────────────\r\n // Tween a variable. The one command that drives many nodes at once: every\r\n // prop bound to `\"=[id]\"` follows what this writes, with no command of its\r\n // own and nothing to keep in sync.\r\n registry.addVariableCommand(\"variableTo\", (target, args, duration, easing) => {\r\n const to = (args as { value?: unknown }).value;\r\n const lerpKey = (args as { lerp?: unknown }).lerp;\r\n const override = typeof lerpKey === \"string\" ? registry.lerp(lerpKey) : undefined;\r\n if (lerpKey !== undefined && !override) {\r\n throw new Error(\r\n `A \"lerp\" param must name a registered lerp (variable \"${target.id}\"), ` +\r\n `got ${JSON.stringify(lerpKey)}. Registered: ${registry.lerpKeys().join(\", \")}.`,\r\n );\r\n }\r\n const lerp = override ?? target.lerp;\r\n\r\n // `from` is captured on the command's first evaluation rather than here,\r\n // exactly as a node's `to()` does: the timeline builds commands in order\r\n // and runs each to `at(1)`, so the capture sees the state its\r\n // predecessors left. Captured once, it is then a pure function of `t`.\r\n let from: unknown;\r\n let captured = false;\r\n return driveCommand(duration, (t) => {\r\n if (!captured) {\r\n from = target.get();\r\n captured = true;\r\n }\r\n target.set(lerp(from, to, t));\r\n }, easing) as unknown as Command<Record<string, unknown>>;\r\n });\r\n\r\n // A stamp, matching `set`: write the value with no tween, ignoring duration.\r\n registry.addVariableCommand(\"variableSet\", (target, args) =>\r\n driveCommand(0, () => {\r\n target.set((args as { value?: unknown }).value);\r\n }) as unknown as Command<Record<string, unknown>>);\r\n\r\n // ── State ────────────────────────────────────────────────────────────────\r\n // `restore` pops the layer a `save` pushed, and is published off `Node`'s own\r\n // `command()`. `save` is not one, so it is registered here — both are\r\n // commands so the pair is placed on the timeline like anything else, and a\r\n // seek past the save still produces the same frame: the value is computed\r\n // from the chain rather than accumulated as the playhead moves.\r\n registry.addCommand(\"save\", (target) =>\r\n driveCommand(0, () => {\r\n (target as Node2D).save();\r\n }) as unknown as Command<Record<string, unknown>>);\r\n}\r\n\r\n/** Type-only re-exports, so a caller writing args gets the same shapes. */\r\nexport type { Fill, Shadow, Stroke, Vector2 };\r\n"]}
1
+ {"version":3,"file":"builtins.js","sourceRoot":"","sources":["../../src/document/builtins.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAkC,MAAM,iBAAiB,CAAC;AAK/E,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,yCAAyC,CAAC;AACtG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E,CAAC;gBACpB,QAAQ,GAAG,IAAI,CAAC;YACpB,CAAC;YACD,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;QAClC,CAAC,EAAE,MAAM,CAAgD,CAAC;IAC9D,CAAC,CAAC,CAAC;IAEH,6EAA6E;IAC7E,QAAQ,CAAC,kBAAkB,CAAC,aAAa,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CACxD,YAAY,CAAC,CAAC,EAAE,GAAG,EAAE;QACjB,MAAM,CAAC,GAAG,CAAE,IAA4B,CAAC,KAAK,CAAC,CAAC;IACpD,CAAC,CAAgD,CAAC,CAAC;IAEvD,4EAA4E;IAC5E,8EAA8E;IAC9E,sEAAsE;IACtE,2EAA2E;IAC3E,0EAA0E;IAC1E,gEAAgE;IAChE,QAAQ,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CACnC,YAAY,CAAC,CAAC,EAAE,GAAG,EAAE;QAChB,MAAiB,CAAC,IAAI,EAAE,CAAC;IAC9B,CAAC,CAAgD,CAAC,CAAC;AAC3D,CAAC","sourcesContent":["import type { Fill } from \"@/attributes/shape/fill/chain\";\nimport type { Shadow } from \"@/attributes/shape/shadow/shadow\";\nimport type { Stroke } from \"@/attributes/shape/stroke/stroke\";\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\nimport { driveCommand, type Command, type CommandArgs } from \"@/tween/command\";\nimport type { EasingFunction } from \"@/tween/ease/type\";\nimport type { Node } from \"@/components/trees/node/node\";\nimport type { Node2D } from \"@/components/trees/2d/node2d\";\n\nimport { BooleanGroup, MaskGroup } from \"@/components/builtins/geometry/composite\";\nimport { Ellipse, PathShape, Polygon, Polygram, Rect } from \"@/components/builtins/geometry/geometry\";\nimport { Camera, OrbitCamera, RotatedBox } from \"@/components/builtins/layout/layout\";\nimport { Video } from \"@/components/builtins/media/media\";\nimport { AudioBus, SoundNode } from \"@/components/builtins/audio/audio\";\nimport { Canvas2D } from \"@/components/trees/root/canvas2d-node\";\nimport { Provider, ThemeProvider } from \"@/components/builtins/providers/providers\";\nimport { DefaultTextStyle, NumberNode, RichText, Text } from \"@/components/builtins/text/text\";\nimport { Canvas3D } from \"@/components/builtins/three/canvas3d\";\nimport {\n AmbientLight3D, AreaLight3D, Box3D, Camera3D, Capsule3D, Circle3D, Cone3D, Cylinder3D, DirectionalLight3D,\n Environment3D, Extrude3D, Fog3D, Group3D, HemisphereLight3D, Instances3D, Lathe3D, Line3D, Mesh3D, Model3D,\n Plane3D, PointLight3D, Points3D, Polyhedron3D, Ring3D, Sphere3D, SpotLight3D, Sprite3D, Torus3D, TorusKnot3D, Tube3D,\n} from \"@/components/builtins/three/three\";\n\nimport { lerpVector2 } from \"@/attributes/layout/vector2\";\nimport { lerpColor } from \"@/attributes/shape/fill/lerp\";\nimport { parseColor } from \"@/attributes/shape/fill/color/parser\";\nimport { lerpVector3 } from \"@/render3d/vector3\";\nimport { lerpNumber } from \"@/tween/lerp\";\n\nimport type { NodeConstructor, Registry, VariableLerp } from \"./registry\";\n\n/**\n * Registration of everything `@motionscript/core` itself ships.\n *\n * The keys here are **document API**. A stored scene names its nodes and its\n * animations with these strings, so renaming one silently breaks every document\n * that used it — they are as much a public contract as an exported symbol, and\n * are deliberately spelled out rather than derived from `constructor.name`\n * (which a minifier is free to mangle).\n */\n\n/** Every built-in node type, keyed as a document names it. */\nconst NODE_TYPES: Record<string, NodeConstructor> = {\n // Clip root and structural\n canvas2d: Canvas2D as unknown as NodeConstructor,\n provider: Provider as unknown as NodeConstructor,\n \"theme-provider\": ThemeProvider as unknown as NodeConstructor,\n \"default-text-style\": DefaultTextStyle as unknown as NodeConstructor,\n\n // Geometry\n rect: Rect as unknown as NodeConstructor,\n ellipse: Ellipse as unknown as NodeConstructor,\n // The **unit-box** path, not `path-node.ts`'s face-value `Path`. A stored\n // document's `data` is a fraction of the node's own box, so a resize is an\n // ordinary `width`/`height` write and every editor gizmo works on it\n // unchanged (`box-path-node.ts` has the whole argument). `Path` draws its\n // `d` at face value and hugs it, which is right for geometry somebody wrote\n // in code — it stays exported for that, and is reached by importing the\n // class rather than by naming a type in a document.\n path: PathShape as unknown as NodeConstructor,\n polygon: Polygon as unknown as NodeConstructor,\n polygram: Polygram as unknown as NodeConstructor,\n boolean: BooleanGroup as unknown as NodeConstructor,\n mask: MaskGroup as unknown as NodeConstructor,\n\n // Layout\n camera: Camera as unknown as NodeConstructor,\n orbitCamera: OrbitCamera as unknown as NodeConstructor,\n \"rotated-box\": RotatedBox as unknown as NodeConstructor,\n\n // Text\n text: Text as unknown as NodeConstructor,\n richtext: RichText as unknown as NodeConstructor,\n number: NumberNode as unknown as NodeConstructor,\n\n // Media\n video: Video as unknown as NodeConstructor,\n\n // Audio — a bus groups, a sound plays. `audioBus` is also the root of an\n // AudioDocument, the way `canvas2d` is the root of a scene.\n audioBus: AudioBus as unknown as NodeConstructor,\n sound: SoundNode as unknown as NodeConstructor,\n\n // 3D — the viewport, then the tree that lives inside it\n canvas3d: Canvas3D as unknown as NodeConstructor,\n group3d: Group3D as unknown as NodeConstructor,\n mesh3d: Mesh3D as unknown as NodeConstructor,\n box3d: Box3D as unknown as NodeConstructor,\n sphere3d: Sphere3D as unknown as NodeConstructor,\n plane3d: Plane3D as unknown as NodeConstructor,\n circle3d: Circle3D as unknown as NodeConstructor,\n cylinder3d: Cylinder3D as unknown as NodeConstructor,\n cone3d: Cone3D as unknown as NodeConstructor,\n capsule3d: Capsule3D as unknown as NodeConstructor,\n torus3d: Torus3D as unknown as NodeConstructor,\n \"torus-knot3d\": TorusKnot3D as unknown as NodeConstructor,\n tube3d: Tube3D as unknown as NodeConstructor,\n lathe3d: Lathe3D as unknown as NodeConstructor,\n extrude3d: Extrude3D as unknown as NodeConstructor,\n ring3d: Ring3D as unknown as NodeConstructor,\n polyhedron3d: Polyhedron3D as unknown as NodeConstructor,\n points3d: Points3D as unknown as NodeConstructor,\n line3d: Line3D as unknown as NodeConstructor,\n sprite3d: Sprite3D as unknown as NodeConstructor,\n instances3d: Instances3D as unknown as NodeConstructor,\n model3d: Model3D as unknown as NodeConstructor,\n camera3d: Camera3D as unknown as NodeConstructor,\n \"ambient-light3d\": AmbientLight3D as unknown as NodeConstructor,\n \"directional-light3d\": DirectionalLight3D as unknown as NodeConstructor,\n \"point-light3d\": PointLight3D as unknown as NodeConstructor,\n \"spot-light3d\": SpotLight3D as unknown as NodeConstructor,\n \"hemisphere-light3d\": HemisphereLight3D as unknown as NodeConstructor,\n \"area-light3d\": AreaLight3D as unknown as NodeConstructor,\n fog3d: Fog3D as unknown as NodeConstructor,\n environment3d: Environment3D as unknown as NodeConstructor,\n};\n\n/** A node method taking one {@link CommandArgs}. */\ntype EasedMethod = (args: CommandArgs) => Command<Record<string, unknown>>;\n\n/** Call a paint command (`fillTo`/`overlayTo`/`strokeTo`/`shadowTo`). */\nfunction paintCommand(method: string, argKey: string) {\n return (\n target: Node,\n args: Record<string, unknown>,\n duration: number,\n easing?: EasingFunction,\n ): Command<Record<string, unknown>> => {\n const fn = (target as unknown as Record<string, unknown>)[method];\n if (typeof fn !== \"function\") {\n throw new Error(\n `Command \"${method}\" is not available on ${target.constructor.name}.`,\n );\n }\n return (fn as EasedMethod).call(target, { data: args[argKey] as Record<string, unknown>, duration, easing });\n };\n}\n\n/**\n * The interpolations a document can name in `VariableSpec.lerp`.\n *\n * Deliberately the small set a variable actually holds — a number, a point, a\n * colour — rather than one entry per attribute in the library. A variable drives\n * props *through* an expression, so it only has to carry the quantity that\n * varies: a gradient that shifts is one `stop` number bound into a fill, not a\n * whole fill being interpolated a second time. Anything else is a\n * `registry.addLerp` away.\n */\nconst VARIABLE_LERPS: Record<string, VariableLerp> = {\n number: lerpNumber as VariableLerp,\n vector2: lerpVector2 as VariableLerp,\n vector3: lerpVector3 as VariableLerp,\n /**\n * Parse both ends, blend per channel, hand back a CSS string.\n *\n * A string rather than the parsed tuple because that is what the prop on the\n * far side of the expression takes — every fill, stroke and shadow resolves\n * a colour from CSS text, and `parseColor` reads theme tokens and the\n * `\"white/10\"` opacity suffix too, so a variable can hold either.\n */\n color: ((from, to, t) => {\n const [r, g, b, a] = lerpColor(parseColor(String(from)), parseColor(String(to)), t);\n const channel = (v: number) => Math.round(Math.min(Math.max(v, 0), 1) * 255);\n return `rgba(${channel(r)}, ${channel(g)}, ${channel(b)}, ${Number(a.toFixed(4))})`;\n }) as VariableLerp,\n /**\n * No interpolation: hold `from` until the tween lands, then take `to`.\n *\n * The default for a non-numeric variable: a discrete value (a string of\n * text, an enum, a boolean) has no midpoint, and inventing one produces a\n * frame that is neither state.\n */\n step: ((from, to, t) => (t >= 1 ? to : from)) as VariableLerp,\n};\n\n/**\n * Seed a {@link Registry} with everything `@motionscript/core` itself ships.\n *\n * **Internal, and called from `Registry`'s own constructor.** It used to be\n * public and every host had to call it at module scope before compiling\n * anything — which `sideEffects: false` is entitled to delete, with a failure\n * mode (\"unknown node type rect\") that points nowhere near the cause. A registry\n * that seeds itself makes the vocabulary a value dependency of the engine\n * instead, so there is nothing left to tree-shake and nothing to remember.\n *\n * @internal\n */\nexport function installBuiltins(registry: Registry): void {\n for (const [key, ctor] of Object.entries(NODE_TYPES)) {\n registry.addNode(key, ctor);\n }\n for (const [key, lerp] of Object.entries(VARIABLE_LERPS)) {\n registry.addLerp(key, lerp);\n }\n\n // ── Props ────────────────────────────────────────────────────────────────\n // `args` *is* the props diff — no wrapper key, since `to`/`set` each carry\n // exactly one argument and a node's own props are already a fixed,\n // known-shape bag (not something a second command parameter could collide\n // with the way `to`/`set` never gained one).\n registry.addCommand(\"to\", (target, args, duration, easing) =>\n (target as Node2D).to({\n // Copied: `_prepareStep` expands sugar into its target in place, which\n // would rewrite the document row a diff compares by identity.\n data: { ...args } as Record<string, never>,\n duration,\n easing,\n }) as unknown as Command<Record<string, unknown>>);\n\n // A stamp: write props with no tween. `duration` is ignored, which is what\n // makes it usable as the \"set this here\" a keyframe editor needs.\n //\n // `binds` because its args reach `set()` verbatim, so an expression among\n // them is a binding — this is how a prop starts following a variable partway\n // through a scene rather than from the moment its node is authored.\n registry.addCommand(\"set\", (target, args) => {\n const props = args as Record<string, never>;\n return driveCommand(0, () => {\n (target as Node2D).set(props);\n }) as unknown as Command<Record<string, unknown>>;\n }, { binds: true });\n\n // ── Paint (shapes, text, Canvas2D) ─────────────────────────────────────\n // Node-less rather than per-type, like `to` and `set` above: these are\n // generic over every painted node, and they take a `TweenOptions` bag where\n // an ordinary command takes a bare easing function — so they need a factory\n // that knows that convention rather than the uniform one a node type's own\n // table dispatches through.\n // Each declares the one key it reads, in the kind its property uses, so a\n // host draws the same paint stack for the command as for the prop.\n registry.addCommand(\"fillTo\", paintCommand(\"fillTo\", \"fill\"), { args: [{ key: \"fill\", kind: \"fills\" }], method: \"fillTo\" });\n registry.addCommand(\"overlayTo\", paintCommand(\"overlayTo\", \"overlay\"), { args: [{ key: \"overlay\", kind: \"fills\" }], method: \"overlayTo\" });\n registry.addCommand(\"strokeTo\", paintCommand(\"strokeTo\", \"stroke\"), { args: [{ key: \"stroke\", kind: \"strokes\" }], method: \"strokeTo\" });\n registry.addCommand(\"shadowTo\", paintCommand(\"shadowTo\", \"shadow\"), { args: [{ key: \"shadow\", kind: \"shadows\" }], method: \"shadowTo\" });\n\n // Transform, camera, text and `restore` commands are not registered here:\n // they are `command()` methods, and `Registry.addNode` publishes them off\n // the classes above. See `document/registry.ts`.\n\n // ── Variables ────────────────────────────────────────────────────────────\n // Tween a variable. The one command that drives many nodes at once: every\n // prop bound to `\"=[id]\"` follows what this writes, with no command of its\n // own and nothing to keep in sync.\n registry.addVariableCommand(\"variableTo\", (target, args, duration, easing) => {\n const to = (args as { value?: unknown }).value;\n const lerpKey = (args as { lerp?: unknown }).lerp;\n const override = typeof lerpKey === \"string\" ? registry.lerp(lerpKey) : undefined;\n if (lerpKey !== undefined && !override) {\n throw new Error(\n `A \"lerp\" param must name a registered lerp (variable \"${target.id}\"), ` +\n `got ${JSON.stringify(lerpKey)}. Registered: ${registry.lerpKeys().join(\", \")}.`,\n );\n }\n const lerp = override ?? target.lerp;\n\n // `from` is captured on the command's first evaluation rather than here,\n // exactly as a node's `to()` does: the timeline builds commands in order\n // and runs each to `at(1)`, so the capture sees the state its\n // predecessors left. Captured once, it is then a pure function of `t`.\n let from: unknown;\n let captured = false;\n return driveCommand(duration, (t) => {\n if (!captured) {\n from = target.get();\n captured = true;\n }\n target.set(lerp(from, to, t));\n }, easing) as unknown as Command<Record<string, unknown>>;\n });\n\n // A stamp, matching `set`: write the value with no tween, ignoring duration.\n registry.addVariableCommand(\"variableSet\", (target, args) =>\n driveCommand(0, () => {\n target.set((args as { value?: unknown }).value);\n }) as unknown as Command<Record<string, unknown>>);\n\n // ── State ────────────────────────────────────────────────────────────────\n // `restore` pops the layer a `save` pushed, and is published off `Node`'s own\n // `command()`. `save` is not one, so it is registered here — both are\n // commands so the pair is placed on the timeline like anything else, and a\n // seek past the save still produces the same frame: the value is computed\n // from the chain rather than accumulated as the playhead moves.\n registry.addCommand(\"save\", (target) =>\n driveCommand(0, () => {\n (target as Node2D).save();\n }) as unknown as Command<Record<string, unknown>>);\n}\n\n/** Type-only re-exports, so a caller writing args gets the same shapes. */\nexport type { Fill, Shadow, Stroke, Vector2 };\n"]}
@@ -29,6 +29,14 @@ export declare const ALIGNMENT_KEYS: readonly string[];
29
29
  * explicit root row may pass `undefined`.
30
30
  */
31
31
  export declare function commandTraits(registry: Registry, spec: CommandSpec, target: NodeSpec | undefined): CommandTraits | null;
32
+ /**
33
+ * Whether a command with these traits, built, may be held at its end values once
34
+ * finished instead of run (`settled-index.ts`): the library's own implementation
35
+ * of a command whose `at` reads only what it captured when built. Expression args
36
+ * bind live values, so they keep it running. A component's own commands are
37
+ * marked by the factory instead, from their pieces.
38
+ */
39
+ export declare function holdsWhenFinished(traits: CommandTraits | null, spec: CommandSpec): boolean;
32
40
  /**
33
41
  * The node ids a command's args name through a `nodeRef` argument — the nodes
34
42
  * whose boxes it may read when it is built, beside its own target.
@@ -1 +1 @@
1
- {"version":3,"file":"command-traits.d.ts","sourceRoot":"","sources":["../../src/document/command-traits.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAwB,MAAM,YAAY,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGrD;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC1B,KAAK,EAAE,MAAM,GAAG,UAAU,CAAC;IAC3B,oFAAoF;IACpF,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,uFAAuF;IACvF,WAAW,EAAE,OAAO,CAAC;IACrB,kDAAkD;IAClD,YAAY,EAAE,OAAO,CAAC;CACzB;AAED,0FAA0F;AAC1F,eAAO,MAAM,cAAc,EAAE,SAAS,MAAM,EAG3C,CAAC;AAIF;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,aAAa,GAAG,IAAI,CAqCvH;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,MAAM,EAAE,CAY7G;AAED,iEAAiE;AACjE,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAG3E;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAMlD;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAO1F;AAED,8GAA8G;AAC9G,wBAAgB,eAAe,CAAC,QAAQ,EAAE,Q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AAM,GAAG,OAAO,CAG3E;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAMlD;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAO1F;AAED,8GAA8G;AAC9G,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAGtF;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAI9F"}
@@ -56,6 +56,17 @@ export function commandTraits(registry, spec, target) {
56
56
  writesLayout: written === undefined || written.some((key) => !isLayoutNeutralProp(registry, row.type, key)),
57
57
  };
58
58
  }
59
+ /**
60
+ * Whether a command with these traits, built, may be held at its end values once
61
+ * finished instead of run (`settled-index.ts`): the library's own implementation
62
+ * of a command whose `at` reads only what it captured when built. Expression args
63
+ * bind live values, so they keep it running. A component's own commands are
64
+ * marked by the factory instead, from their pieces.
65
+ */
66
+ export function holdsWhenFinished(traits, spec) {
67
+ return traits !== null && traits.known && !traits.lifecycle && HELD.has(spec.type)
68
+ && expressionOps.collect(spec.args ?? {}, "").length === 0;
69
+ }
59
70
  /**
60
71
  * The node ids a command's args name through a `nodeRef` argument — the nodes
61
72
  * whose boxes it may read when it is built, beside its own target.
@@ -125,6 +136,12 @@ export function writesPlacementInPlace(registry, row, key) {
125
136
  }
126
137
  const LIFECYCLE = new Set(["removeChildAt", "addChildAt", "reparent"]);
127
138
  const VARIABLE_COMMANDS = new Set(["variableTo", "variableSet"]);
139
+ // Known commands that are pure functions of `t`. A new one joins once `held-class-commands.test.ts` covers it.
140
+ const HELD = new Set([
141
+ "to", "set", "moveTo", "fadeTo", "rotateTo", "scaleTo", "layoutTo", "effectTo", "pulse", "wiggle",
142
+ "fillTo", "strokeTo", "shadowTo", "overlayTo", "progressTo", "zoomTo", "panTo", "headingTo",
143
+ "variableTo", "variableSet",
144
+ ]);
128
145
  const NEUTRAL_KEYS = new Set([
129
146
  "x", "y", "rotation", "scale", "opacity", "fill", "stroke", "shadow", "overlay",
130
147
  "effects", "blend", "transformOrigin", "zoom", "lookAt", "heading",