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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (904) hide show
  1. package/CHANGELOG.md +247 -0
  2. package/LICENSE +201 -201
  3. package/NOTICE +48 -0
  4. package/README.md +93 -72
  5. package/dist/assets/asset-index.js.map +1 -1
  6. package/dist/assets/catalog.d.ts +9 -0
  7. package/dist/assets/catalog.d.ts.map +1 -1
  8. package/dist/assets/catalog.js +11 -0
  9. package/dist/assets/catalog.js.map +1 -1
  10. package/dist/assets/errors.d.ts.map +1 -1
  11. package/dist/assets/errors.js +8 -3
  12. package/dist/assets/errors.js.map +1 -1
  13. package/dist/assets/index.js.map +1 -1
  14. package/dist/assets/manager.d.ts +26 -1
  15. package/dist/assets/manager.d.ts.map +1 -1
  16. package/dist/assets/manager.js +79 -4
  17. package/dist/assets/manager.js.map +1 -1
  18. package/dist/assets/manifest.js.map +1 -1
  19. package/dist/assets/record.js.map +1 -1
  20. package/dist/assets/scope.d.ts +3 -3
  21. package/dist/assets/scope.d.ts.map +1 -1
  22. package/dist/assets/scope.js.map +1 -1
  23. package/dist/attributes/audio/filters/chain.d.ts +1 -1
  24. package/dist/attributes/audio/filters/chain.js.map +1 -1
  25. package/dist/attributes/audio/filters/curve.d.ts +8 -8
  26. package/dist/attributes/audio/filters/curve.d.ts.map +1 -1
  27. package/dist/attributes/audio/filters/curve.js +20 -19
  28. package/dist/attributes/audio/filters/curve.js.map +1 -1
  29. package/dist/attributes/audio/filters/implementations/echo.js.map +1 -1
  30. package/dist/attributes/audio/filters/implementations/gain.js.map +1 -1
  31. package/dist/attributes/audio/filters/implementations/highpass.js.map +1 -1
  32. package/dist/attributes/audio/filters/implementations/lowpass.js.map +1 -1
  33. package/dist/attributes/audio/filters/implementations/speed.d.ts +2 -2
  34. package/dist/attributes/audio/filters/implementations/speed.js.map +1 -1
  35. package/dist/attributes/audio/filters/implementations/tremolo.js.map +1 -1
  36. package/dist/attributes/audio/filters/index.d.ts +1 -1
  37. package/dist/attributes/audio/filters/index.d.ts.map +1 -1
  38. package/dist/attributes/audio/filters/index.js +1 -1
  39. package/dist/attributes/audio/filters/index.js.map +1 -1
  40. package/dist/attributes/audio/filters/registry.js.map +1 -1
  41. package/dist/attributes/audio/filters/union.js.map +1 -1
  42. package/dist/attributes/audio/request.d.ts +17 -2
  43. package/dist/attributes/audio/request.d.ts.map +1 -1
  44. package/dist/attributes/audio/request.js.map +1 -1
  45. package/dist/attributes/audio/schedule.d.ts +4 -2
  46. package/dist/attributes/audio/schedule.d.ts.map +1 -1
  47. package/dist/attributes/audio/schedule.js +15 -8
  48. package/dist/attributes/audio/schedule.js.map +1 -1
  49. package/dist/attributes/audio/sound.d.ts +4 -2
  50. package/dist/attributes/audio/sound.d.ts.map +1 -1
  51. package/dist/attributes/audio/sound.js +8 -4
  52. package/dist/attributes/audio/sound.js.map +1 -1
  53. package/dist/attributes/index.js.map +1 -1
  54. package/dist/attributes/layout/alignment.js +1 -1
  55. package/dist/attributes/layout/alignment.js.map +1 -1
  56. package/dist/attributes/layout/index.js.map +1 -1
  57. package/dist/attributes/layout/insets.js.map +1 -1
  58. package/dist/attributes/layout/matrix2d.js.map +1 -1
  59. package/dist/attributes/layout/size.js.map +1 -1
  60. package/dist/attributes/layout/transform3d.js.map +1 -1
  61. package/dist/attributes/layout/vector2.js.map +1 -1
  62. package/dist/attributes/layout/world-transform.js.map +1 -1
  63. package/dist/attributes/mask/boolean.js.map +1 -1
  64. package/dist/attributes/mask/mask.js.map +1 -1
  65. package/dist/attributes/properties/decorator.d.ts +3 -1
  66. package/dist/attributes/properties/decorator.d.ts.map +1 -1
  67. package/dist/attributes/properties/decorator.js.map +1 -1
  68. package/dist/attributes/properties/inputs.js.map +1 -1
  69. package/dist/attributes/properties/typed.d.ts +9 -2
  70. package/dist/attributes/properties/typed.d.ts.map +1 -1
  71. package/dist/attributes/properties/typed.js +15 -1
  72. package/dist/attributes/properties/typed.js.map +1 -1
  73. package/dist/attributes/render3d/orbit.d.ts +8 -8
  74. package/dist/attributes/render3d/orbit.js +7 -7
  75. package/dist/attributes/render3d/orbit.js.map +1 -1
  76. package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
  77. package/dist/attributes/shape/corners/corner-style.js.map +1 -1
  78. package/dist/attributes/shape/corners/corners.js.map +1 -1
  79. package/dist/attributes/shape/corners/index.js.map +1 -1
  80. package/dist/attributes/shape/effects/backdrop.d.ts +4 -4
  81. package/dist/attributes/shape/effects/backdrop.d.ts.map +1 -1
  82. package/dist/attributes/shape/effects/backdrop.js.map +1 -1
  83. package/dist/attributes/shape/effects/chain.d.ts +28 -120
  84. package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
  85. package/dist/attributes/shape/effects/chain.js +16 -88
  86. package/dist/attributes/shape/effects/chain.js.map +1 -1
  87. package/dist/attributes/shape/effects/effect-data.js.map +1 -1
  88. package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
  89. package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
  90. package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
  91. package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
  92. package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
  93. package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
  94. package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
  95. package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +2 -2
  96. package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
  97. package/dist/attributes/shape/effects/implementations/curves.d.ts +1 -1
  98. package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
  99. package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
  100. package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
  101. package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
  102. package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
  103. package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
  104. package/dist/attributes/shape/effects/implementations/glass.d.ts +15 -24
  105. package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
  106. package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
  107. package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
  108. package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
  109. package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
  110. package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
  111. package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
  112. package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
  113. package/dist/attributes/shape/effects/implementations/lut.d.ts +1 -1
  114. package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
  115. package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
  116. package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
  117. package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
  118. package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
  119. package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
  120. package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
  121. package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
  122. package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
  123. package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
  124. package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
  125. package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
  126. package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
  127. package/dist/attributes/shape/effects/implementations/shader.js +15 -8
  128. package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
  129. package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
  130. package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
  131. package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
  132. package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
  133. package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
  134. package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
  135. package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
  136. package/dist/attributes/shape/effects/index.d.ts +2 -6
  137. package/dist/attributes/shape/effects/index.d.ts.map +1 -1
  138. package/dist/attributes/shape/effects/index.js.map +1 -1
  139. package/dist/attributes/shape/effects/registry.d.ts +23 -6
  140. package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
  141. package/dist/attributes/shape/effects/registry.js +44 -10
  142. package/dist/attributes/shape/effects/registry.js.map +1 -1
  143. package/dist/attributes/shape/effects/union.d.ts +2 -6
  144. package/dist/attributes/shape/effects/union.d.ts.map +1 -1
  145. package/dist/attributes/shape/effects/union.js.map +1 -1
  146. package/dist/attributes/shape/fill/blend.js.map +1 -1
  147. package/dist/attributes/shape/fill/chain.js.map +1 -1
  148. package/dist/attributes/shape/fill/coerce.js.map +1 -1
  149. package/dist/attributes/shape/fill/color/constants.js.map +1 -1
  150. package/dist/attributes/shape/fill/color/parser.d.ts.map +1 -1
  151. package/dist/attributes/shape/fill/color/parser.js +81 -44
  152. package/dist/attributes/shape/fill/color/parser.js.map +1 -1
  153. package/dist/attributes/shape/fill/gradient-stops.d.ts +16 -0
  154. package/dist/attributes/shape/fill/gradient-stops.d.ts.map +1 -0
  155. package/dist/attributes/shape/fill/gradient-stops.js +65 -0
  156. package/dist/attributes/shape/fill/gradient-stops.js.map +1 -0
  157. package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
  158. package/dist/attributes/shape/fill/implementations/color.js.map +1 -1
  159. package/dist/attributes/shape/fill/implementations/conic-gradient.d.ts.map +1 -1
  160. package/dist/attributes/shape/fill/implementations/conic-gradient.js +2 -5
  161. package/dist/attributes/shape/fill/implementations/conic-gradient.js.map +1 -1
  162. package/dist/attributes/shape/fill/implementations/dot-grid.js.map +1 -1
  163. package/dist/attributes/shape/fill/implementations/fractal-noise.d.ts.map +1 -1
  164. package/dist/attributes/shape/fill/implementations/fractal-noise.js +2 -10
  165. package/dist/attributes/shape/fill/implementations/fractal-noise.js.map +1 -1
  166. package/dist/attributes/shape/fill/implementations/grid.js.map +1 -1
  167. package/dist/attributes/shape/fill/implementations/image.d.ts.map +1 -1
  168. package/dist/attributes/shape/fill/implementations/image.js +5 -4
  169. package/dist/attributes/shape/fill/implementations/image.js.map +1 -1
  170. package/dist/attributes/shape/fill/implementations/linear-gradient.d.ts.map +1 -1
  171. package/dist/attributes/shape/fill/implementations/linear-gradient.js +2 -6
  172. package/dist/attributes/shape/fill/implementations/linear-gradient.js.map +1 -1
  173. package/dist/attributes/shape/fill/implementations/noise.js.map +1 -1
  174. package/dist/attributes/shape/fill/implementations/radial-gradient.d.ts.map +1 -1
  175. package/dist/attributes/shape/fill/implementations/radial-gradient.js +2 -5
  176. package/dist/attributes/shape/fill/implementations/radial-gradient.js.map +1 -1
  177. package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
  178. package/dist/attributes/shape/fill/implementations/stripe.js.map +1 -1
  179. package/dist/attributes/shape/fill/implementations/video.js +1 -1
  180. package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
  181. package/dist/attributes/shape/fill/index.js.map +1 -1
  182. package/dist/attributes/shape/fill/lerp.js.map +1 -1
  183. package/dist/attributes/shape/fill/media-preset.js.map +1 -1
  184. package/dist/attributes/shape/fill/registry.js.map +1 -1
  185. package/dist/attributes/shape/fill/union.js.map +1 -1
  186. package/dist/attributes/shape/filters/chain.d.ts +4 -10
  187. package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
  188. package/dist/attributes/shape/filters/chain.js +1 -13
  189. package/dist/attributes/shape/filters/chain.js.map +1 -1
  190. package/dist/attributes/shape/filters/implementations/alpha.js.map +1 -1
  191. package/dist/attributes/shape/filters/implementations/blur.js.map +1 -1
  192. package/dist/attributes/shape/filters/implementations/color-adjustment.js.map +1 -1
  193. package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
  194. package/dist/attributes/shape/filters/implementations/curves.js.map +1 -1
  195. package/dist/attributes/shape/filters/implementations/echo.js.map +1 -1
  196. package/dist/attributes/shape/filters/implementations/exposure.js.map +1 -1
  197. package/dist/attributes/shape/filters/implementations/grayscale.js.map +1 -1
  198. package/dist/attributes/shape/filters/implementations/posterize-time.js.map +1 -1
  199. package/dist/attributes/shape/filters/index.d.ts +1 -1
  200. package/dist/attributes/shape/filters/index.js.map +1 -1
  201. package/dist/attributes/shape/filters/registry.d.ts +2 -2
  202. package/dist/attributes/shape/filters/registry.js +3 -3
  203. package/dist/attributes/shape/filters/registry.js.map +1 -1
  204. package/dist/attributes/shape/filters/union.d.ts +6 -7
  205. package/dist/attributes/shape/filters/union.d.ts.map +1 -1
  206. package/dist/attributes/shape/filters/union.js.map +1 -1
  207. package/dist/attributes/shape/path/anchors.d.ts.map +1 -1
  208. package/dist/attributes/shape/path/anchors.js +12 -5
  209. package/dist/attributes/shape/path/anchors.js.map +1 -1
  210. package/dist/attributes/shape/path/bezier.js.map +1 -1
  211. package/dist/attributes/shape/path/index.js.map +1 -1
  212. package/dist/attributes/shape/path/measure.js.map +1 -1
  213. package/dist/attributes/shape/path/morph.d.ts.map +1 -1
  214. package/dist/attributes/shape/path/morph.js +16 -4
  215. package/dist/attributes/shape/path/morph.js.map +1 -1
  216. package/dist/attributes/shape/path/ops.js.map +1 -1
  217. package/dist/attributes/shape/path/types.js.map +1 -1
  218. package/dist/attributes/shape/path/walk.js.map +1 -1
  219. package/dist/attributes/shape/shaders/index.js.map +1 -1
  220. package/dist/attributes/shape/shaders/pack.js.map +1 -1
  221. package/dist/attributes/shape/shaders/resolve.js.map +1 -1
  222. package/dist/attributes/shape/shadow/index.js.map +1 -1
  223. package/dist/attributes/shape/shadow/shadow.js.map +1 -1
  224. package/dist/attributes/shape/stroke/index.d.ts +2 -2
  225. package/dist/attributes/shape/stroke/index.d.ts.map +1 -1
  226. package/dist/attributes/shape/stroke/index.js +1 -1
  227. package/dist/attributes/shape/stroke/index.js.map +1 -1
  228. package/dist/attributes/shape/stroke/stroke.d.ts +27 -6
  229. package/dist/attributes/shape/stroke/stroke.d.ts.map +1 -1
  230. package/dist/attributes/shape/stroke/stroke.js +22 -2
  231. package/dist/attributes/shape/stroke/stroke.js.map +1 -1
  232. package/dist/attributes/shared/operators.js.map +1 -1
  233. package/dist/attributes/text/index.js.map +1 -1
  234. package/dist/attributes/text/ops.d.ts +6 -0
  235. package/dist/attributes/text/ops.d.ts.map +1 -1
  236. package/dist/attributes/text/ops.js +1 -0
  237. package/dist/attributes/text/ops.js.map +1 -1
  238. package/dist/attributes/text/types.js.map +1 -1
  239. package/dist/browser/chunks/chunk-2RIYH36X.js +3 -0
  240. package/dist/browser/chunks/chunk-2RIYH36X.js.map +7 -0
  241. package/dist/browser/chunks/chunk-DDJN3QII.js +15 -0
  242. package/dist/browser/chunks/chunk-DDJN3QII.js.map +7 -0
  243. package/dist/browser/chunks/chunk-DHB4COFY.js +2 -0
  244. package/dist/browser/chunks/chunk-DHB4COFY.js.map +7 -0
  245. package/dist/browser/chunks/chunk-EJDPYDQI.js +5 -0
  246. package/dist/browser/chunks/chunk-EJDPYDQI.js.map +7 -0
  247. package/dist/browser/chunks/chunk-SFNJRPBV.js +2 -0
  248. package/dist/browser/chunks/chunk-SFNJRPBV.js.map +7 -0
  249. package/dist/browser/chunks/chunk-XAWE4EAK.js +2 -0
  250. package/dist/browser/chunks/chunk-XAWE4EAK.js.map +7 -0
  251. package/dist/browser/component.js +1 -1
  252. package/dist/browser/component.js.map +4 -4
  253. package/dist/browser/experimental.js +2 -0
  254. package/dist/browser/experimental.js.map +7 -0
  255. package/dist/browser/index.js +1 -1
  256. package/dist/browser/index.js.map +4 -4
  257. package/dist/browser/jsx-jsx-dev-runtime.js +1 -1
  258. package/dist/browser/jsx-jsx-runtime.js +1 -1
  259. package/dist/browser/manifest.json +4 -2
  260. package/dist/browser/sdk.js +1 -1
  261. package/dist/component/api.d.ts +508 -0
  262. package/dist/component/api.d.ts.map +1 -0
  263. package/dist/component/api.js +4 -0
  264. package/dist/component/api.js.map +1 -0
  265. package/dist/component/builtins/audio.d.ts +26 -0
  266. package/dist/component/builtins/audio.d.ts.map +1 -0
  267. package/dist/component/builtins/audio.js +41 -0
  268. package/dist/component/builtins/audio.js.map +1 -0
  269. package/dist/component/builtins/canvas3d.d.ts +98 -0
  270. package/dist/component/builtins/canvas3d.d.ts.map +1 -0
  271. package/dist/component/builtins/canvas3d.js +21 -0
  272. package/dist/component/builtins/canvas3d.js.map +1 -0
  273. package/dist/component/builtins/composite.d.ts +56 -0
  274. package/dist/component/builtins/composite.d.ts.map +1 -0
  275. package/dist/component/builtins/composite.js +25 -0
  276. package/dist/component/builtins/composite.js.map +1 -0
  277. package/dist/component/builtins/geometry.d.ts +505 -0
  278. package/dist/component/builtins/geometry.d.ts.map +1 -0
  279. package/dist/component/builtins/geometry.js +107 -0
  280. package/dist/component/builtins/geometry.js.map +1 -0
  281. package/dist/component/builtins/layout.d.ts +88 -0
  282. package/dist/component/builtins/layout.d.ts.map +1 -0
  283. package/dist/component/builtins/layout.js +84 -0
  284. package/dist/component/builtins/layout.js.map +1 -0
  285. package/dist/component/builtins/media.d.ts +95 -0
  286. package/dist/component/builtins/media.d.ts.map +1 -0
  287. package/dist/component/builtins/media.js +149 -0
  288. package/dist/component/builtins/media.js.map +1 -0
  289. package/dist/component/builtins/providers.d.ts +23 -0
  290. package/dist/component/builtins/providers.d.ts.map +1 -0
  291. package/dist/component/builtins/providers.js +30 -0
  292. package/dist/component/builtins/providers.js.map +1 -0
  293. package/dist/component/builtins/text.d.ts +193 -0
  294. package/dist/component/builtins/text.d.ts.map +1 -0
  295. package/dist/component/builtins/text.js +113 -0
  296. package/dist/component/builtins/text.js.map +1 -0
  297. package/dist/component/builtins/three.d.ts +1085 -0
  298. package/dist/component/builtins/three.d.ts.map +1 -0
  299. package/dist/component/builtins/three.js +265 -0
  300. package/dist/component/builtins/three.js.map +1 -0
  301. package/dist/component/clip-of.d.ts +5 -0
  302. package/dist/component/clip-of.d.ts.map +1 -0
  303. package/dist/component/clip-of.js +33 -0
  304. package/dist/component/clip-of.js.map +1 -0
  305. package/dist/component/commands-for.d.ts +19 -0
  306. package/dist/component/commands-for.d.ts.map +1 -0
  307. package/dist/component/commands-for.js +5 -0
  308. package/dist/component/commands-for.js.map +1 -0
  309. package/dist/component/component-audio.d.ts +9 -0
  310. package/dist/component/component-audio.d.ts.map +1 -0
  311. package/dist/component/component-audio.js +18 -0
  312. package/dist/component/component-audio.js.map +1 -0
  313. package/dist/component/component2d.d.ts +9 -0
  314. package/dist/component/component2d.d.ts.map +1 -0
  315. package/dist/component/component2d.js +239 -0
  316. package/dist/component/component2d.js.map +1 -0
  317. package/dist/component/component3d.d.ts +9 -0
  318. package/dist/component/component3d.d.ts.map +1 -0
  319. package/dist/component/component3d.js +99 -0
  320. package/dist/component/component3d.js.map +1 -0
  321. package/dist/component/factory.d.ts +63 -0
  322. package/dist/component/factory.d.ts.map +1 -0
  323. package/dist/component/factory.js +313 -0
  324. package/dist/component/factory.js.map +1 -0
  325. package/dist/component/modules/aim.d.ts +30 -0
  326. package/dist/component/modules/aim.d.ts.map +1 -0
  327. package/dist/component/modules/aim.js +39 -0
  328. package/dist/component/modules/aim.js.map +1 -0
  329. package/dist/component/modules/corners.d.ts +13 -0
  330. package/dist/component/modules/corners.d.ts.map +1 -0
  331. package/dist/component/modules/corners.js +12 -0
  332. package/dist/component/modules/corners.js.map +1 -0
  333. package/dist/component/modules/flow.d.ts +26 -0
  334. package/dist/component/modules/flow.d.ts.map +1 -0
  335. package/dist/component/modules/flow.js +55 -0
  336. package/dist/component/modules/flow.js.map +1 -0
  337. package/dist/component/modules/material.d.ts +40 -0
  338. package/dist/component/modules/material.d.ts.map +1 -0
  339. package/dist/component/modules/material.js +75 -0
  340. package/dist/component/modules/material.js.map +1 -0
  341. package/dist/component/modules/paint.d.ts +71 -0
  342. package/dist/component/modules/paint.d.ts.map +1 -0
  343. package/dist/component/modules/paint.js +106 -0
  344. package/dist/component/modules/paint.js.map +1 -0
  345. package/dist/component/modules/shapes.d.ts +31 -0
  346. package/dist/component/modules/shapes.d.ts.map +1 -0
  347. package/dist/component/modules/shapes.js +43 -0
  348. package/dist/component/modules/shapes.js.map +1 -0
  349. package/dist/component/modules/text-layout.d.ts +26 -0
  350. package/dist/component/modules/text-layout.d.ts.map +1 -0
  351. package/dist/component/modules/text-layout.js +57 -0
  352. package/dist/component/modules/text-layout.js.map +1 -0
  353. package/dist/component/modules/text-style.d.ts +48 -0
  354. package/dist/component/modules/text-style.d.ts.map +1 -0
  355. package/dist/component/modules/text-style.js +63 -0
  356. package/dist/component/modules/text-style.js.map +1 -0
  357. package/dist/component/modules/three-entries.d.ts +23 -0
  358. package/dist/component/modules/three-entries.d.ts.map +1 -0
  359. package/dist/component/modules/three-entries.js +41 -0
  360. package/dist/component/modules/three-entries.js.map +1 -0
  361. package/dist/component/modules/view3d.d.ts +55 -0
  362. package/dist/component/modules/view3d.d.ts.map +1 -0
  363. package/dist/component/modules/view3d.js +160 -0
  364. package/dist/component/modules/view3d.js.map +1 -0
  365. package/dist/component/timeline.d.ts +22 -0
  366. package/dist/component/timeline.d.ts.map +1 -0
  367. package/dist/component/timeline.js +128 -0
  368. package/dist/component/timeline.js.map +1 -0
  369. package/dist/component/type-def.d.ts +26 -0
  370. package/dist/component/type-def.d.ts.map +1 -0
  371. package/dist/component/type-def.js +16 -0
  372. package/dist/component/type-def.js.map +1 -0
  373. package/dist/component/types.d.ts +91 -0
  374. package/dist/component/types.d.ts.map +1 -0
  375. package/dist/component/types.js +88 -0
  376. package/dist/component/types.js.map +1 -0
  377. package/dist/component/views.d.ts +121 -0
  378. package/dist/component/views.d.ts.map +1 -0
  379. package/dist/component/views.js +413 -0
  380. package/dist/component/views.js.map +1 -0
  381. package/dist/component.d.ts +4 -5
  382. package/dist/component.d.ts.map +1 -1
  383. package/dist/component.js +3 -5
  384. package/dist/component.js.map +1 -1
  385. package/dist/document/audio.d.ts +10 -2
  386. package/dist/document/audio.d.ts.map +1 -1
  387. package/dist/document/audio.js +45 -4
  388. package/dist/document/audio.js.map +1 -1
  389. package/dist/document/builtins.d.ts.map +1 -1
  390. package/dist/document/builtins.js +15 -39
  391. package/dist/document/builtins.js.map +1 -1
  392. package/dist/document/command-traits.d.ts +1 -1
  393. package/dist/document/command-traits.js +16 -1
  394. package/dist/document/command-traits.js.map +1 -1
  395. package/dist/document/deny-globals.js.map +1 -1
  396. package/dist/document/diff.d.ts.map +1 -1
  397. package/dist/document/diff.js +3 -3
  398. package/dist/document/diff.js.map +1 -1
  399. package/dist/document/doc-index.d.ts +2 -2
  400. package/dist/document/doc-index.d.ts.map +1 -1
  401. package/dist/document/doc-index.js +3 -3
  402. package/dist/document/doc-index.js.map +1 -1
  403. package/dist/document/expression/compile.d.ts.map +1 -1
  404. package/dist/document/expression/compile.js +8 -5
  405. package/dist/document/expression/compile.js.map +1 -1
  406. package/dist/document/expression/index.js.map +1 -1
  407. package/dist/document/expression/ops.js +1 -1
  408. package/dist/document/expression/ops.js.map +1 -1
  409. package/dist/document/expression/parse.d.ts.map +1 -1
  410. package/dist/document/expression/parse.js +15 -6
  411. package/dist/document/expression/parse.js.map +1 -1
  412. package/dist/document/expression/refs.d.ts +1 -1
  413. package/dist/document/expression/refs.js +1 -1
  414. package/dist/document/expression/refs.js.map +1 -1
  415. package/dist/document/expression/types.js.map +1 -1
  416. package/dist/document/expression/walk.d.ts.map +1 -1
  417. package/dist/document/expression/walk.js +2 -1
  418. package/dist/document/expression/walk.js.map +1 -1
  419. package/dist/document/index.d.ts +2 -0
  420. package/dist/document/index.d.ts.map +1 -1
  421. package/dist/document/index.js +2 -0
  422. package/dist/document/index.js.map +1 -1
  423. package/dist/document/node-decorator.js.map +1 -1
  424. package/dist/document/node-descriptor.d.ts +25 -0
  425. package/dist/document/node-descriptor.d.ts.map +1 -1
  426. package/dist/document/node-descriptor.js.map +1 -1
  427. package/dist/document/placement.d.ts +70 -0
  428. package/dist/document/placement.d.ts.map +1 -0
  429. package/dist/document/placement.js +83 -0
  430. package/dist/document/placement.js.map +1 -0
  431. package/dist/document/project.d.ts +2 -2
  432. package/dist/document/project.d.ts.map +1 -1
  433. package/dist/document/project.js.map +1 -1
  434. package/dist/document/registry.d.ts +23 -11
  435. package/dist/document/registry.d.ts.map +1 -1
  436. package/dist/document/registry.js +46 -19
  437. package/dist/document/registry.js.map +1 -1
  438. package/dist/document/settled-index.d.ts +49 -0
  439. package/dist/document/settled-index.d.ts.map +1 -0
  440. package/dist/document/settled-index.js +247 -0
  441. package/dist/document/settled-index.js.map +1 -0
  442. package/dist/document/timeline-patch.js.map +1 -1
  443. package/dist/document/timeline.d.ts +100 -19
  444. package/dist/document/timeline.d.ts.map +1 -1
  445. package/dist/document/timeline.js +290 -42
  446. package/dist/document/timeline.js.map +1 -1
  447. package/dist/document/types.d.ts +12 -12
  448. package/dist/document/types.d.ts.map +1 -1
  449. package/dist/document/types.js +2 -2
  450. package/dist/document/types.js.map +1 -1
  451. package/dist/document/validate.d.ts +2 -2
  452. package/dist/document/validate.d.ts.map +1 -1
  453. package/dist/document/validate.js +37 -31
  454. package/dist/document/validate.js.map +1 -1
  455. package/dist/document/withdraw.d.ts +28 -0
  456. package/dist/document/withdraw.d.ts.map +1 -0
  457. package/dist/document/withdraw.js +61 -0
  458. package/dist/document/withdraw.js.map +1 -0
  459. package/dist/experimental.d.ts +22 -0
  460. package/dist/experimental.d.ts.map +1 -0
  461. package/dist/experimental.js +20 -0
  462. package/dist/experimental.js.map +1 -0
  463. package/dist/index.d.ts +10 -0
  464. package/dist/index.d.ts.map +1 -1
  465. package/dist/index.js +10 -0
  466. package/dist/index.js.map +1 -1
  467. package/dist/jsx/jsx-dev-runtime.js.map +1 -1
  468. package/dist/jsx/jsx-runtime.d.ts +9 -1
  469. package/dist/jsx/jsx-runtime.d.ts.map +1 -1
  470. package/dist/jsx/jsx-runtime.js +13 -3
  471. package/dist/jsx/jsx-runtime.js.map +1 -1
  472. package/dist/layout/bounds.d.ts +0 -1
  473. package/dist/layout/bounds.d.ts.map +1 -1
  474. package/dist/layout/bounds.js.map +1 -1
  475. package/dist/layout/constraints.js.map +1 -1
  476. package/dist/layout/flex.d.ts +4 -2
  477. package/dist/layout/flex.d.ts.map +1 -1
  478. package/dist/layout/flex.js +27 -11
  479. package/dist/layout/flex.js.map +1 -1
  480. package/dist/layout/freeform.js.map +1 -1
  481. package/dist/layout/grid.js.map +1 -1
  482. package/dist/layout/index.js.map +1 -1
  483. package/dist/layout/item.js.map +1 -1
  484. package/dist/layout/ops.d.ts +6 -0
  485. package/dist/layout/ops.d.ts.map +1 -1
  486. package/dist/layout/ops.js +6 -0
  487. package/dist/layout/ops.js.map +1 -1
  488. package/dist/layout/types.js.map +1 -1
  489. package/dist/nodes/2d/node-lifecycle.js.map +1 -1
  490. package/dist/nodes/2d/node-motion.js.map +1 -1
  491. package/dist/nodes/2d/node-render.d.ts +3 -3
  492. package/dist/nodes/2d/node-render.d.ts.map +1 -1
  493. package/dist/nodes/2d/node-render.js.map +1 -1
  494. package/dist/nodes/2d/node-transform.js.map +1 -1
  495. package/dist/nodes/2d/node2d.d.ts +115 -3
  496. package/dist/nodes/2d/node2d.d.ts.map +1 -1
  497. package/dist/nodes/2d/node2d.js +180 -28
  498. package/dist/nodes/2d/node2d.js.map +1 -1
  499. package/dist/nodes/2d/paint-node.d.ts +27 -0
  500. package/dist/nodes/2d/paint-node.d.ts.map +1 -1
  501. package/dist/nodes/2d/paint-node.js +42 -0
  502. package/dist/nodes/2d/paint-node.js.map +1 -1
  503. package/dist/nodes/audio/audio-bus.js.map +1 -1
  504. package/dist/nodes/audio/index.d.ts +2 -2
  505. package/dist/nodes/audio/index.d.ts.map +1 -1
  506. package/dist/nodes/audio/index.js +0 -2
  507. package/dist/nodes/audio/index.js.map +1 -1
  508. package/dist/nodes/audio/node-audio.js.map +1 -1
  509. package/dist/nodes/audio/sound-node.d.ts +4 -3
  510. package/dist/nodes/audio/sound-node.d.ts.map +1 -1
  511. package/dist/nodes/audio/sound-node.js +4 -1
  512. package/dist/nodes/audio/sound-node.js.map +1 -1
  513. package/dist/nodes/geometry/bounds-shape-node.d.ts +4 -4
  514. package/dist/nodes/geometry/bounds-shape-node.js +2 -2
  515. package/dist/nodes/geometry/bounds-shape-node.js.map +1 -1
  516. package/dist/nodes/geometry/box-path-node.d.ts +3 -3
  517. package/dist/nodes/geometry/box-path-node.js +2 -2
  518. package/dist/nodes/geometry/box-path-node.js.map +1 -1
  519. package/dist/nodes/geometry/ellipse-node.js.map +1 -1
  520. package/dist/nodes/geometry/group-bounds.d.ts +2 -2
  521. package/dist/nodes/geometry/group-bounds.d.ts.map +1 -1
  522. package/dist/nodes/geometry/group-bounds.js +1 -2
  523. package/dist/nodes/geometry/group-bounds.js.map +1 -1
  524. package/dist/nodes/geometry/path-node.d.ts.map +1 -1
  525. package/dist/nodes/geometry/path-node.js +6 -0
  526. package/dist/nodes/geometry/path-node.js.map +1 -1
  527. package/dist/nodes/geometry/polygon-node.js.map +1 -1
  528. package/dist/nodes/geometry/polygram-node.js.map +1 -1
  529. package/dist/nodes/geometry/rect-node.js.map +1 -1
  530. package/dist/nodes/geometry/shape-node.js.map +1 -1
  531. package/dist/nodes/geometry/shape-outline.d.ts +2 -2
  532. package/dist/nodes/geometry/shape-outline.d.ts.map +1 -1
  533. package/dist/nodes/geometry/shape-outline.js +2 -13
  534. package/dist/nodes/geometry/shape-outline.js.map +1 -1
  535. package/dist/nodes/index.d.ts +40 -33
  536. package/dist/nodes/index.d.ts.map +1 -1
  537. package/dist/nodes/index.js +17 -36
  538. package/dist/nodes/index.js.map +1 -1
  539. package/dist/nodes/layout/camera-node.d.ts +9 -0
  540. package/dist/nodes/layout/camera-node.d.ts.map +1 -1
  541. package/dist/nodes/layout/camera-node.js +38 -3
  542. package/dist/nodes/layout/camera-node.js.map +1 -1
  543. package/dist/nodes/layout/orbit-camera-node.d.ts +1 -1
  544. package/dist/nodes/layout/orbit-camera-node.js +1 -1
  545. package/dist/nodes/layout/orbit-camera-node.js.map +1 -1
  546. package/dist/nodes/layout/rotated-box.js.map +1 -1
  547. package/dist/nodes/media/video-node.d.ts.map +1 -1
  548. package/dist/nodes/media/video-node.js +2 -0
  549. package/dist/nodes/media/video-node.js.map +1 -1
  550. package/dist/nodes/node/declare-paints.js.map +1 -1
  551. package/dist/nodes/node/node-editor-state.js.map +1 -1
  552. package/dist/nodes/node/node-reactive.js.map +1 -1
  553. package/dist/nodes/node/node-time.d.ts +3 -3
  554. package/dist/nodes/node/node-time.d.ts.map +1 -1
  555. package/dist/nodes/node/node-time.js +1 -1
  556. package/dist/nodes/node/node-time.js.map +1 -1
  557. package/dist/nodes/node/node-walk.js.map +1 -1
  558. package/dist/nodes/node/node.d.ts +12 -4
  559. package/dist/nodes/node/node.d.ts.map +1 -1
  560. package/dist/nodes/node/node.js +67 -27
  561. package/dist/nodes/node/node.js.map +1 -1
  562. package/dist/nodes/node/text-defaults.d.ts +10 -12
  563. package/dist/nodes/node/text-defaults.d.ts.map +1 -1
  564. package/dist/nodes/node/text-defaults.js +10 -12
  565. package/dist/nodes/node/text-defaults.js.map +1 -1
  566. package/dist/nodes/{scene → root}/canvas2d-node.d.ts +4 -3
  567. package/dist/nodes/root/canvas2d-node.d.ts.map +1 -0
  568. package/dist/nodes/{scene → root}/canvas2d-node.js +5 -2
  569. package/dist/nodes/root/canvas2d-node.js.map +1 -0
  570. package/dist/nodes/root/provider-node.d.ts.map +1 -0
  571. package/dist/nodes/root/provider-node.js.map +1 -0
  572. package/dist/nodes/root/theme-provider-node.d.ts.map +1 -0
  573. package/dist/nodes/root/theme-provider-node.js.map +1 -0
  574. package/dist/nodes/text/default-text-style-node.d.ts +5 -2
  575. package/dist/nodes/text/default-text-style-node.d.ts.map +1 -1
  576. package/dist/nodes/text/default-text-style-node.js +10 -4
  577. package/dist/nodes/text/default-text-style-node.js.map +1 -1
  578. package/dist/nodes/text/number-format.d.ts +1 -1
  579. package/dist/nodes/text/number-format.js +1 -1
  580. package/dist/nodes/text/number-format.js.map +1 -1
  581. package/dist/nodes/text/number-node.js.map +1 -1
  582. package/dist/nodes/text/number-pattern.js.map +1 -1
  583. package/dist/nodes/text/richtext-node.d.ts +0 -5
  584. package/dist/nodes/text/richtext-node.d.ts.map +1 -1
  585. package/dist/nodes/text/richtext-node.js +6 -72
  586. package/dist/nodes/text/richtext-node.js.map +1 -1
  587. package/dist/nodes/text/text-base.d.ts +5 -22
  588. package/dist/nodes/text/text-base.d.ts.map +1 -1
  589. package/dist/nodes/text/text-base.js +13 -364
  590. package/dist/nodes/text/text-base.js.map +1 -1
  591. package/dist/nodes/text/text-layout.d.ts +87 -0
  592. package/dist/nodes/text/text-layout.d.ts.map +1 -0
  593. package/dist/nodes/text/text-layout.js +368 -0
  594. package/dist/nodes/text/text-layout.js.map +1 -0
  595. package/dist/nodes/text/text-node.js.map +1 -1
  596. package/dist/nodes/text/text-selection.js.map +1 -1
  597. package/dist/nodes/three/camera-nodes.d.ts +21 -3
  598. package/dist/nodes/three/camera-nodes.d.ts.map +1 -1
  599. package/dist/nodes/three/camera-nodes.js +42 -1
  600. package/dist/nodes/three/camera-nodes.js.map +1 -1
  601. package/dist/nodes/three/canvas3d-node.d.ts +32 -7
  602. package/dist/nodes/three/canvas3d-node.d.ts.map +1 -1
  603. package/dist/nodes/three/canvas3d-node.js +50 -2
  604. package/dist/nodes/three/canvas3d-node.js.map +1 -1
  605. package/dist/nodes/three/drawable-nodes.d.ts +25 -11
  606. package/dist/nodes/three/drawable-nodes.d.ts.map +1 -1
  607. package/dist/nodes/three/drawable-nodes.js +43 -13
  608. package/dist/nodes/three/drawable-nodes.js.map +1 -1
  609. package/dist/nodes/three/environment-nodes.d.ts +9 -3
  610. package/dist/nodes/three/environment-nodes.d.ts.map +1 -1
  611. package/dist/nodes/three/environment-nodes.js.map +1 -1
  612. package/dist/nodes/three/geometry-nodes.d.ts +2 -2
  613. package/dist/nodes/three/geometry-nodes.js +2 -2
  614. package/dist/nodes/three/geometry-nodes.js.map +1 -1
  615. package/dist/nodes/three/grid-geometry3d.js.map +1 -1
  616. package/dist/nodes/three/group3d.js.map +1 -1
  617. package/dist/nodes/three/light-nodes.d.ts.map +1 -1
  618. package/dist/nodes/three/light-nodes.js +3 -3
  619. package/dist/nodes/three/light-nodes.js.map +1 -1
  620. package/dist/nodes/three/mesh3d.js.map +1 -1
  621. package/dist/nodes/three/node3d.d.ts +48 -0
  622. package/dist/nodes/three/node3d.d.ts.map +1 -1
  623. package/dist/nodes/three/node3d.js +53 -3
  624. package/dist/nodes/three/node3d.js.map +1 -1
  625. package/dist/platform/audio-sink.d.ts +2 -2
  626. package/dist/platform/audio-sink.d.ts.map +1 -1
  627. package/dist/platform/audio-sink.js.map +1 -1
  628. package/dist/platform/exporter.d.ts +13 -8
  629. package/dist/platform/exporter.d.ts.map +1 -1
  630. package/dist/platform/exporter.js.map +1 -1
  631. package/dist/platform/index.d.ts +1 -1
  632. package/dist/platform/index.d.ts.map +1 -1
  633. package/dist/platform/index.js.map +1 -1
  634. package/dist/platform/stepped-clock.js.map +1 -1
  635. package/dist/platform/storage-adapter.d.ts +12 -6
  636. package/dist/platform/storage-adapter.d.ts.map +1 -1
  637. package/dist/platform/storage-adapter.js +4 -0
  638. package/dist/platform/storage-adapter.js.map +1 -1
  639. package/dist/platform/ticker.d.ts +6 -0
  640. package/dist/platform/ticker.d.ts.map +1 -1
  641. package/dist/platform/ticker.js +6 -0
  642. package/dist/platform/ticker.js.map +1 -1
  643. package/dist/project/config.js.map +1 -1
  644. package/dist/project/index.js.map +1 -1
  645. package/dist/project/tree.d.ts +3 -3
  646. package/dist/project/tree.d.ts.map +1 -1
  647. package/dist/project/tree.js.map +1 -1
  648. package/dist/props/host.js.map +1 -1
  649. package/dist/props/index.js.map +1 -1
  650. package/dist/props/observer.js.map +1 -1
  651. package/dist/props/slot.js.map +1 -1
  652. package/dist/renamed-scene-names.d.ts +17 -0
  653. package/dist/renamed-scene-names.d.ts.map +1 -0
  654. package/dist/renamed-scene-names.js +9 -0
  655. package/dist/renamed-scene-names.js.map +1 -0
  656. package/dist/render/canvas-render-context2d.d.ts +2 -2
  657. package/dist/render/canvas-render-context2d.d.ts.map +1 -1
  658. package/dist/render/canvas-render-context2d.js.map +1 -1
  659. package/dist/render/clip-contains.js.map +1 -1
  660. package/dist/render/clip.js.map +1 -1
  661. package/dist/render/descriptors/ellipse.js.map +1 -1
  662. package/dist/render/descriptors/latex.js.map +1 -1
  663. package/dist/render/descriptors/line.js.map +1 -1
  664. package/dist/render/descriptors/path-builder.js.map +1 -1
  665. package/dist/render/descriptors/path.js.map +1 -1
  666. package/dist/render/descriptors/polygon.js.map +1 -1
  667. package/dist/render/descriptors/polygram.js.map +1 -1
  668. package/dist/render/descriptors/rect.js.map +1 -1
  669. package/dist/render/descriptors/richtext.js.map +1 -1
  670. package/dist/render/descriptors/shape.d.ts +12 -0
  671. package/dist/render/descriptors/shape.d.ts.map +1 -1
  672. package/dist/render/descriptors/shape.js.map +1 -1
  673. package/dist/render/descriptors/text.d.ts +2 -2
  674. package/dist/render/descriptors/text.js +2 -2
  675. package/dist/render/descriptors/text.js.map +1 -1
  676. package/dist/render/descriptors/transform.d.ts +2 -2
  677. package/dist/render/descriptors/transform.d.ts.map +1 -1
  678. package/dist/render/descriptors/transform.js.map +1 -1
  679. package/dist/render/graphics2d.d.ts +3 -3
  680. package/dist/render/graphics2d.d.ts.map +1 -1
  681. package/dist/render/graphics2d.js +1 -1
  682. package/dist/render/graphics2d.js.map +1 -1
  683. package/dist/render/index.js.map +1 -1
  684. package/dist/render/measure-context.js.map +1 -1
  685. package/dist/render/null-render-context.js.map +1 -1
  686. package/dist/render/render-context2d.d.ts +2 -2
  687. package/dist/render/render-context2d.d.ts.map +1 -1
  688. package/dist/render/render-context2d.js.map +1 -1
  689. package/dist/render/surface.js.map +1 -1
  690. package/dist/render/text-defaults.js.map +1 -1
  691. package/dist/render/text-layout.js.map +1 -1
  692. package/dist/render3d/bounds3d.d.ts.map +1 -1
  693. package/dist/render3d/bounds3d.js +4 -2
  694. package/dist/render3d/bounds3d.js.map +1 -1
  695. package/dist/render3d/builders.js.map +1 -1
  696. package/dist/render3d/camera.d.ts +6 -0
  697. package/dist/render3d/camera.d.ts.map +1 -1
  698. package/dist/render3d/camera.js +5 -3
  699. package/dist/render3d/camera.js.map +1 -1
  700. package/dist/render3d/fill3d.d.ts +2 -9
  701. package/dist/render3d/fill3d.d.ts.map +1 -1
  702. package/dist/render3d/fill3d.js +2 -13
  703. package/dist/render3d/fill3d.js.map +1 -1
  704. package/dist/render3d/geometry.d.ts +8 -1
  705. package/dist/render3d/geometry.d.ts.map +1 -1
  706. package/dist/render3d/geometry.js.map +1 -1
  707. package/dist/render3d/graphics3d.d.ts +8 -4
  708. package/dist/render3d/graphics3d.d.ts.map +1 -1
  709. package/dist/render3d/graphics3d.js +18 -10
  710. package/dist/render3d/graphics3d.js.map +1 -1
  711. package/dist/render3d/index.d.ts +1 -1
  712. package/dist/render3d/index.js +1 -1
  713. package/dist/render3d/index.js.map +1 -1
  714. package/dist/render3d/inert.d.ts +14 -0
  715. package/dist/render3d/inert.d.ts.map +1 -0
  716. package/dist/render3d/inert.js +62 -0
  717. package/dist/render3d/inert.js.map +1 -0
  718. package/dist/render3d/light.js.map +1 -1
  719. package/dist/render3d/material.d.ts +10 -5
  720. package/dist/render3d/material.d.ts.map +1 -1
  721. package/dist/render3d/material.js.map +1 -1
  722. package/dist/render3d/matrix4.js.map +1 -1
  723. package/dist/render3d/render-context3d.js.map +1 -1
  724. package/dist/render3d/resources.js.map +1 -1
  725. package/dist/render3d/rounded-box.js.map +1 -1
  726. package/dist/render3d/scene-settings.d.ts +23 -4
  727. package/dist/render3d/scene-settings.d.ts.map +1 -1
  728. package/dist/render3d/scene-settings.js.map +1 -1
  729. package/dist/render3d/scene3d.d.ts +11 -0
  730. package/dist/render3d/scene3d.d.ts.map +1 -1
  731. package/dist/render3d/scene3d.js +39 -6
  732. package/dist/render3d/scene3d.js.map +1 -1
  733. package/dist/render3d/segments.js.map +1 -1
  734. package/dist/render3d/texture.d.ts +9 -0
  735. package/dist/render3d/texture.d.ts.map +1 -1
  736. package/dist/render3d/texture.js +13 -0
  737. package/dist/render3d/texture.js.map +1 -1
  738. package/dist/render3d/tracking.js.map +1 -1
  739. package/dist/render3d/transform.d.ts +1 -1
  740. package/dist/render3d/transform.js.map +1 -1
  741. package/dist/render3d/vector3.d.ts +18 -1
  742. package/dist/render3d/vector3.d.ts.map +1 -1
  743. package/dist/render3d/vector3.js +27 -0
  744. package/dist/render3d/vector3.js.map +1 -1
  745. package/dist/render3d/walk.d.ts +1 -1
  746. package/dist/render3d/walk.d.ts.map +1 -1
  747. package/dist/render3d/walk.js +5 -1
  748. package/dist/render3d/walk.js.map +1 -1
  749. package/dist/runtime/asset-refine.js.map +1 -1
  750. package/dist/runtime/asset-timeline.js.map +1 -1
  751. package/dist/runtime/asset-update.js.map +1 -1
  752. package/dist/runtime/audio-index.js.map +1 -1
  753. package/dist/runtime/builtin-context.js.map +1 -1
  754. package/dist/runtime/clip-instance.d.ts +9 -4
  755. package/dist/runtime/clip-instance.d.ts.map +1 -1
  756. package/dist/runtime/clip-instance.js +27 -9
  757. package/dist/runtime/clip-instance.js.map +1 -1
  758. package/dist/runtime/clip-store.d.ts +18 -0
  759. package/dist/runtime/clip-store.d.ts.map +1 -1
  760. package/dist/runtime/clip-store.js +97 -0
  761. package/dist/runtime/clip-store.js.map +1 -1
  762. package/dist/runtime/engine.d.ts +5 -0
  763. package/dist/runtime/engine.d.ts.map +1 -1
  764. package/dist/runtime/engine.js +2 -0
  765. package/dist/runtime/engine.js.map +1 -1
  766. package/dist/runtime/frame-time.d.ts +31 -0
  767. package/dist/runtime/frame-time.d.ts.map +1 -0
  768. package/dist/runtime/frame-time.js +29 -0
  769. package/dist/runtime/frame-time.js.map +1 -0
  770. package/dist/runtime/index.d.ts +1 -0
  771. package/dist/runtime/index.d.ts.map +1 -1
  772. package/dist/runtime/index.js +1 -0
  773. package/dist/runtime/index.js.map +1 -1
  774. package/dist/runtime/node-picking.d.ts +44 -3
  775. package/dist/runtime/node-picking.d.ts.map +1 -1
  776. package/dist/runtime/node-picking.js +124 -10
  777. package/dist/runtime/node-picking.js.map +1 -1
  778. package/dist/runtime/node-picking3d.d.ts +13 -5
  779. package/dist/runtime/node-picking3d.d.ts.map +1 -1
  780. package/dist/runtime/node-picking3d.js +10 -2
  781. package/dist/runtime/node-picking3d.js.map +1 -1
  782. package/dist/runtime/placement.d.ts.map +1 -1
  783. package/dist/runtime/placement.js +4 -5
  784. package/dist/runtime/placement.js.map +1 -1
  785. package/dist/runtime/playback-controller.d.ts +31 -2
  786. package/dist/runtime/playback-controller.d.ts.map +1 -1
  787. package/dist/runtime/playback-controller.js +63 -6
  788. package/dist/runtime/playback-controller.js.map +1 -1
  789. package/dist/runtime/playback.js.map +1 -1
  790. package/dist/runtime/precompisition.js.map +1 -1
  791. package/dist/runtime/project-assets.js.map +1 -1
  792. package/dist/runtime/session.d.ts +9 -7
  793. package/dist/runtime/session.d.ts.map +1 -1
  794. package/dist/runtime/session.js +12 -4
  795. package/dist/runtime/session.js.map +1 -1
  796. package/dist/runtime/settle.js.map +1 -1
  797. package/dist/runtime/state-evaluator.d.ts +1 -1
  798. package/dist/runtime/state-evaluator.d.ts.map +1 -1
  799. package/dist/runtime/state-evaluator.js +4 -3
  800. package/dist/runtime/state-evaluator.js.map +1 -1
  801. package/dist/runtime/text-geometry.d.ts.map +1 -1
  802. package/dist/runtime/text-geometry.js +7 -3
  803. package/dist/runtime/text-geometry.js.map +1 -1
  804. package/dist/sdk/index.d.ts +50 -25
  805. package/dist/sdk/index.d.ts.map +1 -1
  806. package/dist/sdk/index.js +52 -42
  807. package/dist/sdk/index.js.map +1 -1
  808. package/dist/tween/command-decorator.d.ts +2 -0
  809. package/dist/tween/command-decorator.d.ts.map +1 -1
  810. package/dist/tween/command-decorator.js.map +1 -1
  811. package/dist/tween/command.d.ts +12 -0
  812. package/dist/tween/command.d.ts.map +1 -1
  813. package/dist/tween/command.js +14 -0
  814. package/dist/tween/command.js.map +1 -1
  815. package/dist/tween/ease/constants.d.ts.map +1 -1
  816. package/dist/tween/ease/constants.js +8 -5
  817. package/dist/tween/ease/constants.js.map +1 -1
  818. package/dist/tween/ease/curve.d.ts.map +1 -1
  819. package/dist/tween/ease/curve.js +4 -3
  820. package/dist/tween/ease/curve.js.map +1 -1
  821. package/dist/tween/ease/describe.d.ts +15 -0
  822. package/dist/tween/ease/describe.d.ts.map +1 -0
  823. package/dist/tween/ease/describe.js +37 -0
  824. package/dist/tween/ease/describe.js.map +1 -0
  825. package/dist/tween/ease/type.js.map +1 -1
  826. package/dist/tween/index.js.map +1 -1
  827. package/dist/tween/inert.js.map +1 -1
  828. package/dist/tween/lerp.js.map +1 -1
  829. package/dist/tween/loop.js.map +1 -1
  830. package/dist/tween/prepare.d.ts +3 -3
  831. package/dist/tween/prepare.js +3 -3
  832. package/dist/tween/prepare.js.map +1 -1
  833. package/dist/tween/seekable.d.ts +1 -1
  834. package/dist/tween/seekable.js.map +1 -1
  835. package/dist/tween/stepper.js.map +1 -1
  836. package/dist/tween/to-command.js.map +1 -1
  837. package/dist/util/clamp.js.map +1 -1
  838. package/dist/util/context.js.map +1 -1
  839. package/dist/util/csv.js.map +1 -1
  840. package/dist/util/generateList.js.map +1 -1
  841. package/dist/util/index.js.map +1 -1
  842. package/dist/util/metrics.d.ts +1 -1
  843. package/dist/util/metrics.js +1 -1
  844. package/dist/util/metrics.js.map +1 -1
  845. package/dist/util/random.js.map +1 -1
  846. package/dist/util/reference.js.map +1 -1
  847. package/dist/util/scheduler.js.map +1 -1
  848. package/package.json +7 -1
  849. package/dist/attributes/shape/effects/implementations/displace.d.ts +0 -48
  850. package/dist/attributes/shape/effects/implementations/displace.d.ts.map +0 -1
  851. package/dist/attributes/shape/effects/implementations/displace.js +0 -30
  852. package/dist/attributes/shape/effects/implementations/displace.js.map +0 -1
  853. package/dist/attributes/shape/effects/implementations/god-rays.d.ts +0 -28
  854. package/dist/attributes/shape/effects/implementations/god-rays.d.ts.map +0 -1
  855. package/dist/attributes/shape/effects/implementations/god-rays.js +0 -26
  856. package/dist/attributes/shape/effects/implementations/god-rays.js.map +0 -1
  857. package/dist/attributes/shape/effects/implementations/texture.d.ts +0 -28
  858. package/dist/attributes/shape/effects/implementations/texture.d.ts.map +0 -1
  859. package/dist/attributes/shape/effects/implementations/texture.js +0 -25
  860. package/dist/attributes/shape/effects/implementations/texture.js.map +0 -1
  861. package/dist/attributes/shape/effects/implementations/trails.d.ts +0 -41
  862. package/dist/attributes/shape/effects/implementations/trails.d.ts.map +0 -1
  863. package/dist/attributes/shape/effects/implementations/trails.js +0 -22
  864. package/dist/attributes/shape/effects/implementations/trails.js.map +0 -1
  865. package/dist/browser/chunks/chunk-2T3HXSC2.js +0 -2
  866. package/dist/browser/chunks/chunk-2T3HXSC2.js.map +0 -7
  867. package/dist/browser/chunks/chunk-KJXGRHOL.js +0 -3
  868. package/dist/browser/chunks/chunk-KJXGRHOL.js.map +0 -7
  869. package/dist/browser/chunks/chunk-TGDX2SS2.js +0 -18
  870. package/dist/browser/chunks/chunk-TGDX2SS2.js.map +0 -7
  871. package/dist/nodes/geometry/dot-grid-node.d.ts +0 -105
  872. package/dist/nodes/geometry/dot-grid-node.d.ts.map +0 -1
  873. package/dist/nodes/geometry/dot-grid-node.js +0 -142
  874. package/dist/nodes/geometry/dot-grid-node.js.map +0 -1
  875. package/dist/nodes/geometry/grid-lines.d.ts +0 -101
  876. package/dist/nodes/geometry/grid-lines.d.ts.map +0 -1
  877. package/dist/nodes/geometry/grid-lines.js +0 -128
  878. package/dist/nodes/geometry/grid-lines.js.map +0 -1
  879. package/dist/nodes/geometry/grid-pattern-node.d.ts +0 -58
  880. package/dist/nodes/geometry/grid-pattern-node.d.ts.map +0 -1
  881. package/dist/nodes/geometry/grid-pattern-node.js +0 -172
  882. package/dist/nodes/geometry/grid-pattern-node.js.map +0 -1
  883. package/dist/nodes/geometry/line-grid-node.d.ts +0 -62
  884. package/dist/nodes/geometry/line-grid-node.d.ts.map +0 -1
  885. package/dist/nodes/geometry/line-grid-node.js +0 -127
  886. package/dist/nodes/geometry/line-grid-node.js.map +0 -1
  887. package/dist/nodes/geometry/line-node.d.ts +0 -58
  888. package/dist/nodes/geometry/line-node.d.ts.map +0 -1
  889. package/dist/nodes/geometry/line-node.js +0 -123
  890. package/dist/nodes/geometry/line-node.js.map +0 -1
  891. package/dist/nodes/geometry/viewport-pattern-node.d.ts +0 -39
  892. package/dist/nodes/geometry/viewport-pattern-node.d.ts.map +0 -1
  893. package/dist/nodes/geometry/viewport-pattern-node.js +0 -79
  894. package/dist/nodes/geometry/viewport-pattern-node.js.map +0 -1
  895. package/dist/nodes/scene/canvas2d-node.d.ts.map +0 -1
  896. package/dist/nodes/scene/canvas2d-node.js.map +0 -1
  897. package/dist/nodes/scene/provider-node.d.ts.map +0 -1
  898. package/dist/nodes/scene/provider-node.js.map +0 -1
  899. package/dist/nodes/scene/theme-provider-node.d.ts.map +0 -1
  900. package/dist/nodes/scene/theme-provider-node.js.map +0 -1
  901. /package/dist/nodes/{scene → root}/provider-node.d.ts +0 -0
  902. /package/dist/nodes/{scene → root}/provider-node.js +0 -0
  903. /package/dist/nodes/{scene → root}/theme-provider-node.d.ts +0 -0
  904. /package/dist/nodes/{scene → root}/theme-provider-node.js +0 -0
@@ -0,0 +1,413 @@
1
+ import { NullRenderContext } from "../render/null-render-context.js";
2
+ import { Graphics2D as GraphicsClass } from "../render/graphics2d.js";
3
+ import { frameIn, Node2D as Node2DClass } from "../nodes/2d/node2d.js";
4
+ import { Node3D } from "../nodes/three/node3d.js";
5
+ import { Scene3D } from "../render3d/scene3d.js";
6
+ import { clipOf } from "../component/clip-of.js";
7
+ /** The node a view stands for: how the engine's own modules (`Paint`, `Flow`) reach past the public surface. */
8
+ export const NODE = Symbol("componentNode");
9
+ let pass = null;
10
+ export function withPass(node, scope, room, run) {
11
+ const outer = pass;
12
+ pass = { node, scope, room, sizes: new Map() };
13
+ try {
14
+ return run();
15
+ }
16
+ finally {
17
+ pass = outer;
18
+ }
19
+ }
20
+ const decided = new WeakSet();
21
+ /** An engine module sized this node itself in this measure: its factory reports the size as it stands. */
22
+ export function markDecided(node) {
23
+ decided.add(node);
24
+ }
25
+ export function takeDecided(node) {
26
+ return decided.delete(node);
27
+ }
28
+ export function currentPass() {
29
+ if (!pass)
30
+ throw new Error("A component's measure or layout helper ran outside a measure or layout pass.");
31
+ return pass;
32
+ }
33
+ function measureChild(node, max) {
34
+ const p = currentPass();
35
+ const constraints = { maxWidth: max.width, maxHeight: max.height };
36
+ const measured = node.measure(constraints, p.scope);
37
+ const size = { width: measured.width ?? 0, height: measured.height ?? 0 };
38
+ p.sizes.set(node, size);
39
+ return size;
40
+ }
41
+ // ---- child views ------------------------------------------------------------
42
+ const childViews = new WeakMap();
43
+ /** A child as its parent's fields see it. One per child node, reused every frame. */
44
+ class ChildViewImpl {
45
+ [NODE];
46
+ state;
47
+ constructor(node) {
48
+ this[NODE] = node;
49
+ // The node's own accessors are its resolved values; a proxy keeps a parent from writing through them.
50
+ this.state = new Proxy(node, {
51
+ set: () => { throw new TypeError("A child's state is read-only to its parent; animate it with a command."); },
52
+ });
53
+ }
54
+ get id() { return this[NODE].id; }
55
+ get key() { return (keyOf(this[NODE]) ?? this[NODE].className); }
56
+ get size() {
57
+ // Outside a pass (a command being built), the size it was last laid out at, as a command's own node reports.
58
+ if (!pass) {
59
+ const box = this[NODE].layoutBounds;
60
+ return { width: box?.width ?? 0, height: box?.height ?? 0 };
61
+ }
62
+ return pass.sizes.get(this[NODE]) ?? measureChild(this[NODE], pass.room);
63
+ }
64
+ get children() {
65
+ const node = this[NODE];
66
+ return node._commandChildren ? node._commandChildren() : node.children.map(childView);
67
+ }
68
+ measure(max) {
69
+ return measureChild(this[NODE], max);
70
+ }
71
+ to(targets) {
72
+ return { _piece: { kind: "child", node: this[NODE], targets: targets } };
73
+ }
74
+ run(name, args) {
75
+ return { _piece: { kind: "run", node: this[NODE], name, args } };
76
+ }
77
+ }
78
+ export function childView(node) {
79
+ let view = childViews.get(node);
80
+ if (!view)
81
+ childViews.set(node, view = new ChildViewImpl(node));
82
+ return view;
83
+ }
84
+ export function nodeOfView(view) {
85
+ return view[NODE];
86
+ }
87
+ const nodeViews = new WeakMap();
88
+ const NO_FRAME = { x: 0, y: 0, rotation: 0, scale: 1 };
89
+ /** A node outside a component's own children (an ancestor, a referenced node), as one reader's fields read it. */
90
+ class NodeViewImpl {
91
+ reader;
92
+ [NODE];
93
+ state;
94
+ constructor(node, reader) {
95
+ this.reader = reader;
96
+ this[NODE] = node;
97
+ // A component's state as its own fields read it: a reference of its own is a view from where it stands.
98
+ // Anything else it has (a 2D node's cardinal points) reads off the node.
99
+ const fields = node._view ?? node;
100
+ this.state = new Proxy(fields, {
101
+ get: (target, key) => {
102
+ // Its constructor is the node's: what a host asks to tell what kind of node it reads.
103
+ if (key === "constructor")
104
+ return node.constructor;
105
+ if (key in target)
106
+ return Reflect.get(target, key);
107
+ const value = Reflect.get(node, key);
108
+ // A method of the node runs on the node, not on this read-only view.
109
+ return typeof value === "function" ? value.bind(node) : value;
110
+ },
111
+ set: () => { throw new TypeError("Another node's state is read-only to a component; animate it with a command."); },
112
+ });
113
+ }
114
+ get id() { return this[NODE].id; }
115
+ get key() { return (keyOf(this[NODE]) ?? this[NODE].className); }
116
+ get size() {
117
+ const node = this[NODE];
118
+ const box = node instanceof Node2DClass ? node.layoutBounds : undefined;
119
+ return { width: box?.width ?? 0, height: box?.height ?? 0 };
120
+ }
121
+ get frame() {
122
+ const node = this[NODE];
123
+ return node instanceof Node2DClass && this.reader instanceof Node2DClass ? frameIn(this.reader, node) : NO_FRAME;
124
+ }
125
+ }
126
+ /** `node` as `reader` sees it. One view per pair. */
127
+ export function nodeView(node, reader) {
128
+ let byReader = nodeViews.get(node);
129
+ if (!byReader)
130
+ nodeViews.set(node, byReader = new WeakMap());
131
+ let view = byReader.get(reader);
132
+ if (!view)
133
+ byReader.set(reader, view = new NodeViewImpl(node, reader));
134
+ return view;
135
+ }
136
+ export function nodeOfNodeView(view) {
137
+ return view[NODE];
138
+ }
139
+ const found = new WeakMap();
140
+ /** The node with `id` in `reader`'s scene, as `reader` sees it, or `null`. Remembered per reader while it stays in the scene. */
141
+ export function referenced(reader, id) {
142
+ if (typeof id !== "string" || id === "")
143
+ return null;
144
+ let known = found.get(reader);
145
+ let node = known?.get(id);
146
+ if (!node || node.id !== id || rootOf(node) !== rootOf(reader)) {
147
+ node = findIn(rootOf(reader), id) ?? undefined;
148
+ if (!node) {
149
+ known?.delete(id);
150
+ return null;
151
+ }
152
+ if (!known)
153
+ found.set(reader, known = new Map());
154
+ known.set(id, node);
155
+ }
156
+ return nodeView(node, reader);
157
+ }
158
+ function rootOf(node) {
159
+ let at = node;
160
+ while (at.parent)
161
+ at = at.parent;
162
+ return at;
163
+ }
164
+ function findIn(at, id) {
165
+ if (at.id === id)
166
+ return at;
167
+ for (const child of at._allChildren) {
168
+ const hit = findIn(child, id);
169
+ if (hit)
170
+ return hit;
171
+ }
172
+ return null;
173
+ }
174
+ let keyOf = () => undefined;
175
+ /** Set by the factory module, which owns the node descriptors. */
176
+ export function setKeyLookup(lookup) {
177
+ keyOf = lookup;
178
+ }
179
+ export function stateViewPrototype(keys, references = new Set()) {
180
+ const entries = {};
181
+ for (const key of keys) {
182
+ entries[key] = references.has(key)
183
+ ? { get() { return referenced(this[NODE], this[NODE][key]); }, enumerable: true }
184
+ : { get() { return this[NODE][key]; }, enumerable: true };
185
+ }
186
+ const proto = {};
187
+ // The children of the node's own tree, as its commands see them too.
188
+ Object.defineProperty(proto, "children", {
189
+ get() { return this[NODE]._commandChildren(); },
190
+ enumerable: false,
191
+ });
192
+ return { proto, entries };
193
+ }
194
+ export function stateView(shape, node) {
195
+ const view = Object.create(shape.proto);
196
+ Object.defineProperties(view, shape.entries);
197
+ view[NODE] = node;
198
+ return view;
199
+ }
200
+ /** A command's `state`: where it starts, so a frame function reading it never sees its own writes. */
201
+ export function snapshot(view) {
202
+ const out = {};
203
+ for (const key in view)
204
+ out[key] = view[key];
205
+ return out;
206
+ }
207
+ // ---- measurer and render context --------------------------------------------
208
+ export class MeasurerImpl {
209
+ host;
210
+ max = {};
211
+ scope = null;
212
+ constructor(host) {
213
+ this.host = host;
214
+ }
215
+ get time() {
216
+ return this.host.time;
217
+ }
218
+ text(text, font) {
219
+ if (!this.scope)
220
+ throw new Error("measurer.text was called outside measure.");
221
+ return this.scope.measureText(text, font.fontSize, font.fontFamily, font.fontWeight, font.letterSpacing);
222
+ }
223
+ }
224
+ /** Reused every frame: `pass` and `cut` are rewritten before each render. */
225
+ export class RenderContextImpl {
226
+ host;
227
+ probing;
228
+ pass = null;
229
+ /** The near-plane cut a 2.5D space puts in front of this node's own paint. */
230
+ cut = null;
231
+ /**
232
+ * `probing`: `render` runs only to find the shape it paints (for clip and
233
+ * picking outside a frame), so nothing is drawn and no child is visited.
234
+ */
235
+ constructor(host, probing = false) {
236
+ this.host = host;
237
+ this.probing = probing;
238
+ }
239
+ get size() {
240
+ const box = this.host.layoutBounds;
241
+ return { width: box?.width ?? 0, height: box?.height ?? 0 };
242
+ }
243
+ get time() {
244
+ return this.host.time;
245
+ }
246
+ draw(graphics) {
247
+ if (!graphics || this.probing)
248
+ return;
249
+ const out = this.target();
250
+ if (Array.isArray(graphics))
251
+ for (const g of graphics)
252
+ out.draw(g);
253
+ else
254
+ out.draw(graphics);
255
+ }
256
+ children() {
257
+ if (this.probing)
258
+ return;
259
+ // Drawn plainly, so a space or composite the last frame declared no longer holds for them.
260
+ if (!this.composite)
261
+ this.host._record = null;
262
+ this.host._renderOwnChildren(this.target());
263
+ }
264
+ /** What this render has declared so far. Its host's record follows at once, so the children it draws see it. */
265
+ composite = null;
266
+ _declare(composite) {
267
+ this.composite = { ...this.composite, ...composite };
268
+ if (!this.probing)
269
+ this.host._record = this.composite;
270
+ }
271
+ mask(options) {
272
+ this._declare({ bounds: "first" });
273
+ if (this.probing)
274
+ return;
275
+ const out = this.target();
276
+ const [stencil, ...content] = this.host.children;
277
+ if (!stencil)
278
+ return;
279
+ if (content.length === 0) {
280
+ stencil.render(out);
281
+ return;
282
+ }
283
+ out.beginMask({ mode: options.mode, inverted: options.inverted });
284
+ stencil.render(out);
285
+ out.applyMask();
286
+ for (const child of content)
287
+ child.render(out);
288
+ out.endMask();
289
+ }
290
+ merge(op, paint) {
291
+ this._declare({ bounds: op === "subtract" ? "first" : op === "intersect" ? "intersect" : "union" });
292
+ if (this.probing)
293
+ return;
294
+ const out = this.target();
295
+ out.beginBoolean(op);
296
+ for (const child of this.host._allChildren)
297
+ if (child instanceof Node2DClass)
298
+ child.render(out);
299
+ out.endBoolean();
300
+ // A drawing with no shape of its own paints the merged outline.
301
+ out.draw(new GraphicsClass().shadow(paint.shadow).fill(paint.fill));
302
+ if (paint.overlay && paint.overlay.length > 0)
303
+ out.draw(new GraphicsClass().fill(paint.overlay));
304
+ out.draw(new GraphicsClass().stroke(paint.stroke));
305
+ }
306
+ /** Your children, through a camera viewing your box: aimed at `lookAt`, zoomed, turned by `heading`. */
307
+ camera(scope) {
308
+ this._declare({ camera: scope });
309
+ if (this.probing)
310
+ return;
311
+ const out = this.target();
312
+ const rect = this.host.layoutBounds;
313
+ out.beginCamera({ x: rect?.x ?? 0, y: -(rect?.y ?? 0), width: rect?.width ?? 0, height: rect?.height ?? 0 }, scope.lookAt, scope.zoom, scope.heading);
314
+ for (const child of this.host._allChildren)
315
+ if (child instanceof Node2DClass)
316
+ child.render(out);
317
+ out.endCamera();
318
+ }
319
+ /** Your 3D children, rendered in order into a new scene. */
320
+ scene3D() {
321
+ const scene = new Scene3D();
322
+ for (const child of this.host._allChildren)
323
+ if (child instanceof Node3D)
324
+ child.render(scene);
325
+ this._declare({ scene });
326
+ return scene;
327
+ }
328
+ /** Your children, standing in one 2.5D space seen by `camera`, drawn far to near. */
329
+ space(camera) {
330
+ this._declare({ space: camera });
331
+ if (!this.probing)
332
+ this.host._renderOwnChildren(this.target());
333
+ }
334
+ textStyle(style, body) {
335
+ if (this.probing)
336
+ return body();
337
+ const out = this.target();
338
+ out.pushTextStyle(style);
339
+ try {
340
+ body();
341
+ }
342
+ finally {
343
+ out.popTextStyle();
344
+ }
345
+ }
346
+ clip(shape, body) {
347
+ if (this.probing)
348
+ return body();
349
+ const outline = clipOf(shape);
350
+ // No outline is no clip, as a node with no `clipSelf` confines nothing.
351
+ if (outline.isEmpty())
352
+ return body();
353
+ const out = this.target();
354
+ out.beginClip(outline);
355
+ try {
356
+ body();
357
+ }
358
+ finally {
359
+ out.endClip();
360
+ }
361
+ }
362
+ /** An ancestor stands this node in a space: one opens it, and nothing between them flattens. */
363
+ get inSpace() {
364
+ for (let at = this.host.parent; at; at = at.parent) {
365
+ if (!(at instanceof Node2DClass))
366
+ return false;
367
+ if (at._spaceCamera())
368
+ return true;
369
+ if (!at._rendersChildrenInSpace())
370
+ return false;
371
+ }
372
+ return false;
373
+ }
374
+ ancestor(component) {
375
+ for (let at = this.host.parent; at; at = at.parent) {
376
+ if (at instanceof component.node)
377
+ return nodeView(at, this.host);
378
+ }
379
+ return null;
380
+ }
381
+ /** Paint `body` in front of the space's near plane, as `Node2D` does for its own paint. */
382
+ inFront(body) {
383
+ if (this.probing)
384
+ return;
385
+ const out = this.target();
386
+ if (!this.cut) {
387
+ body();
388
+ return;
389
+ }
390
+ out.beginClip(this.cut);
391
+ try {
392
+ body();
393
+ }
394
+ finally {
395
+ out.endClip();
396
+ }
397
+ }
398
+ target() {
399
+ if (this.probing)
400
+ return PROBE_PASS;
401
+ if (!this.pass)
402
+ throw new Error("A component's render context was used outside render.");
403
+ return this.pass;
404
+ }
405
+ }
406
+ /** Where a probe's scoped calls (a clip, a camera) land: a pass that draws nothing. */
407
+ const PROBE_PASS = new NullRenderContext();
408
+ export function internalsOf(ctx) {
409
+ if (!(ctx instanceof RenderContextImpl))
410
+ throw new TypeError("Paint.draw takes the render context its render field was given.");
411
+ return ctx;
412
+ }
413
+ //# sourceMappingURL=views.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"views.js","sourceRoot":"","sources":["../../src/component/views.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,UAAU,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAO7C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAe7C,gHAAgH;AAChH,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;AAwB5C,IAAI,IAAI,GAAgB,IAAI,CAAC;AAE7B,MAAM,UAAU,QAAQ,CAAI,IAAY,EAAE,KAAuB,EAAE,IAAS,EAAE,GAAY;IACtF,MAAM,KAAK,GAAG,IAAI,CAAC;IACnB,IAAI,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC;IAC/C,IAAI,CAAC;QACD,OAAO,GAAG,EAAE,CAAC;IACjB,CAAC;YAAS,CAAC;QACP,IAAI,GAAG,KAAK,CAAC;IACjB,CAAC;AACL,CAAC;AAED,MAAM,OAAO,GAAG,IAAI,OAAO,EAAU,CAAC;AAEtC,0GAA0G;AAC1G,MAAM,UAAU,WAAW,CAAC,IAAY;IACpC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACtB,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,IA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AAS,CAAC,IAAI;gBAAE,OAAO,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAA0C,CAAC;QAC9G,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,2FAA2F;IAC3F,OAAO,CAAC,IAAgB;QACpB,IAAI,IAAI,CAAC,OAAO;YAAE,OAAO;QACzB,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QAC1B,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;YACZ,IAAI,EAAE,CAAC;YACP,OAAO;QACX,CAAC;QACD,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxB,IAAI,CAAC;YACD,IAAI,EAAE,CAAC;QACX,CAAC;gBAAS,CAAC;YACP,GAAG,CAAC,OAAO,EAAE,CAAC;QAClB,CAAC;IACL,CAAC;IAED,MAAM;QACF,IAAI,IAAI,CAAC,OAAO;YAAE,OAAO,UAAU,CAAC;QACpC,IAAI,CAAC,IAAI,CAAC,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;QACzF,OAAO,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;CACJ;AAED,uFAAuF;AACvF,MAAM,UAAU,GAAiB,IAAI,iBAAiB,EAAE,CAAC;AAEzD,MAAM,UAAU,WAAW,CAAC,GAAoB;IAC5C,IAAI,CAAC,CAAC,GAAG,YAAY,iBAAiB,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,iEAAiE,CAAC,CAAC;IAChI,OAAO,GAAG,CAAC;AACf,CAAC","sourcesContent":["import type { Size2D } from \"@/attributes/layout/size\";\r\nimport type { SizeConstraints } from \"@/layout/constraints\";\r\nimport type { Node2D, CameraScope } from \"@/nodes/2d/node2d\";\r\nimport type { Node } from \"@/nodes/node/node\";\r\nimport type { Graphics2D } from \"@/render/graphics2d\";\r\nimport type { MeasureContext2D } from \"@/render/measure-context\";\r\nimport type { RenderPass2D } from \"@/render/render-context2d\";\r\nimport type { Clip } from \"@/render/clip\";\r\nimport { NullRenderContext } from \"@/render/null-render-context\";\r\nimport { Graphics2D as GraphicsClass } from \"@/render/graphics2d\";\r\nimport { frameIn, Node2D as Node2DClass } from \"@/nodes/2d/node2d\";\r\nimport { Node3D } from \"@/nodes/three/node3d\";\r\nimport { Scene3D } from \"@/render3d/scene3d\";\r\nimport type { BooleanOperation } from \"@/attributes/mask/boolean\";\r\nimport type { MaskOptions } from \"@/attributes/mask/mask\";\r\nimport type { ChildBoundsMode } from \"@/nodes/geometry/group-bounds\";\r\nimport type { SpaceCamera } from \"@/attributes/layout/space3d\";\r\nimport type { TextStyle } from \"@/attributes/text/types\";\r\nimport type { MergePaint, ChildView, Clock, Component, Element, FontSpec, Max, Measurer, NodeFrame, NodeView, Piece, RenderContext2D } from \"@/component/api\";\r\nimport { clipOf } from \"@/component/clip-of\";\r\n\r\n/**\r\n * What a render did with its children beyond drawing them: composited them\r\n * (the ink bounds that leaves), looked at them through a camera, or stood them\r\n * in a 2.5D space. Picking and the space machinery read it between frames.\r\n */\r\nexport interface Composite {\r\n readonly bounds?: ChildBoundsMode;\r\n readonly camera?: CameraScope;\r\n readonly space?: SpaceCamera;\r\n /** The scene its 3D children were rendered into: what picking projects through. */\r\n readonly scene?: Scene3D;\r\n}\r\n\r\n/** The node a view stands for: how the engine's own modules (`Paint`, `Flow`) reach past the public surface. */\r\nexport const NODE = Symbol(\"componentNode\");\r\n\r\n/** What a generated node exposes to its views and modules. Never part of the authoring surface. */\r\nexport interface ComponentHost extends Node2D {\r\n _renderOwnChildren(pass: RenderPass2D): void;\r\n _animate(frame: (t: number) => Record<string, unknown>, duration: number, easing: unknown): unknown;\r\n _lastShape: Graphics2D | null;\r\n /** The composite its last render or probe declared; `undefined` before either. */\r\n _record: Composite | null | undefined;\r\n}\r\n\r\n// ---- the pass in progress -------------------------------------------------\r\n\r\n/**\r\n * Measure and layout run synchronously, one node at a time, so the node being\r\n * laid out and its measurer are a single slot rather than state on every view.\r\n */\r\ninterface Pass {\r\n readonly node: Node2D;\r\n readonly scope: MeasureContext2D;\r\n readonly room: Max;\r\n readonly sizes: Map<Node2D, Size2D>;\r\n}\r\n\r\nlet pass: Pass | null = null;\r\n\r\nexport function withPass<T>(node: Node2D, scope: MeasureContext2D, room: Max, run: () => T): T {\r\n const outer = pass;\r\n pass = { node, scope, room, sizes: new Map() };\r\n try {\r\n return run();\r\n } finally {\r\n pass = outer;\r\n }\r\n}\r\n\r\nconst decided = new WeakSet<Node2D>();\r\n\r\n/** An engine module sized this node itself in this measure: its factory reports the size as it stands. */\r\nexport function markDecided(node: Node2D): void {\r\n decided.add(node);\r\n}\r\n\r\nexport function takeDecided(node: Node2D): boolean {\r\n return decided.delete(node);\r\n}\r\n\r\nexport function currentPass(): Pass {\r\n if (!pass) throw new Error(\"A component's measure or layout helper ran outside a measure or layout pass.\");\r\n return pass;\r\n}\r\n\r\nfunction measureChild(node: Node2D, max: Max): Size2D {\r\n const p = currentPass();\r\n const constraints: SizeConstraints = { maxWidth: max.width, maxHeight: max.height };\r\n const measured = node.measure(constraints, p.scope);\r\n const size = { width: measured.width ?? 0, height: measured.height ?? 0 };\r\n p.sizes.set(node, size);\r\n return size;\r\n}\r\n\r\n// ---- child views ------------------------------------------------------------\r\n\r\nconst childViews = new WeakMap<Node2D, ChildViewImpl>();\r\n\r\n/** A child as its parent's fields see it. One per child node, reused every frame. */\r\nclass ChildViewImpl implements ChildView {\r\n readonly [NODE]: Node2D;\r\n readonly state: never;\r\n\r\n constructor(node: Node2D) {\r\n this[NODE] = node;\r\n // The node's own accessors are its resolved values; a proxy keeps a parent from writing through them.\r\n this.state = new Proxy(node, {\r\n set: () => { throw new TypeError(\"A child's state is read-only to its parent; animate it with a command.\"); },\r\n }) as never;\r\n }\r\n\r\n get id(): string { return this[NODE].id; }\r\n get key(): never { return (keyOf(this[NODE]) ?? this[NODE].className) as never; }\r\n\r\n get size(): Size2D {\r\n // Outside a pass (a command being built), the size it was last laid out at, as a command's own node reports.\r\n if (!pass) {\r\n const box = this[NODE].layoutBounds;\r\n return { width: box?.width ?? 0, height: box?.height ?? 0 };\r\n }\r\n return pass.sizes.get(this[NODE]) ?? measureChild(this[NODE], pass.room);\r\n }\r\n\r\n get children(): readonly ChildView[] {\r\n const node = this[NODE] as Node2D & { _commandChildren?(): readonly ChildView[] };\r\n return node._commandChildren ? node._commandChildren() : node.children.map(childView);\r\n }\r\n\r\n measure(max: Max): Size2D {\r\n return measureChild(this[NODE], max);\r\n }\r\n\r\n to(targets: object): Piece {\r\n return { _piece: { kind: \"child\", node: this[NODE], targets: targets as Record<string, unknown> } };\r\n }\r\n\r\n run(name: string, args?: object): Piece {\r\n return { _piece: { kind: \"run\", node: this[NODE], name, args } };\r\n }\r\n}\r\n\r\nexport function childView(node: Node2D | Node): ChildView {\r\n let view = childViews.get(node as Node2D);\r\n if (!view) childViews.set(node as Node2D, view = new ChildViewImpl(node as Node2D));\r\n return view as unknown as ChildView;\r\n}\r\n\r\nexport function nodeOfView(view: ChildView<any>): Node2D {\r\n return (view as unknown as ChildViewImpl)[NODE];\r\n}\r\n\r\nconst nodeViews = new WeakMap<Node, WeakMap<Node, NodeViewImpl>>();\r\n\r\nconst NO_FRAME: NodeFrame = { x: 0, y: 0, rotation: 0, scale: 1 };\r\n\r\n/** A node outside a component's own children (an ancestor, a referenced node), as one reader's fields read it. */\r\nclass NodeViewImpl implements NodeView {\r\n readonly [NODE]: Node;\r\n readonly state: never;\r\n\r\n constructor(node: Node, readonly reader: Node) {\r\n this[NODE] = node;\r\n // A component's state as its own fields read it: a reference of its own is a view from where it stands.\r\n // Anything else it has (a 2D node's cardinal points) reads off the node.\r\n const fields = (node as { _view?: object })._view ?? node;\r\n this.state = new Proxy(fields, {\r\n get: (target, key) => {\r\n // Its constructor is the node's: what a host asks to tell what kind of node it reads.\r\n if (key === \"constructor\") return node.constructor;\r\n if (key in target) return Reflect.get(target, key);\r\n const value = Reflect.get(node, key) as unknown;\r\n // A method of the node runs on the node, not on this read-only view.\r\n return typeof value === \"function\" ? (value as (...args: unknown[]) => unknown).bind(node) : value;\r\n },\r\n set: () => { throw new TypeError(\"Another node's state is read-only to a component; animate it with a command.\"); },\r\n }) as never;\r\n }\r\n\r\n get id(): string { return this[NODE].id; }\r\n get key(): never { return (keyOf(this[NODE] as Node2D) ?? this[NODE].className) as never; }\r\n\r\n get size(): Size2D {\r\n const node = this[NODE];\r\n const box = node instanceof Node2DClass ? node.layoutBounds : undefined;\r\n return { width: box?.width ?? 0, height: box?.height ?? 0 };\r\n }\r\n\r\n get frame(): NodeFrame {\r\n const node = this[NODE];\r\n return node instanceof Node2DClass && this.reader instanceof Node2DClass ? frameIn(this.reader, node) : NO_FRAME;\r\n }\r\n}\r\n\r\n/** `node` as `reader` sees it. One view per pair. */\r\nexport function nodeView(node: Node, reader: Node): NodeView {\r\n let byReader = nodeViews.get(node);\r\n if (!byReader) nodeViews.set(node, byReader = new WeakMap());\r\n let view = byReader.get(reader);\r\n if (!view) byReader.set(reader, view = new NodeViewImpl(node, reader));\r\n return view;\r\n}\r\n\r\nexport function nodeOfNodeView(view: NodeView): Node {\r\n return (view as unknown as NodeViewImpl)[NODE];\r\n}\r\n\r\nconst found = new WeakMap<Node, Map<string, Node>>();\r\n\r\n/** The node with `id` in `reader`'s scene, as `reader` sees it, or `null`. Remembered per reader while it stays in the scene. */\r\nexport function referenced(reader: Node, id: unknown): NodeView | null {\r\n if (typeof id !== \"string\" || id === \"\") return null;\r\n let known = found.get(reader);\r\n let node = known?.get(id);\r\n if (!node || node.id !== id || rootOf(node) !== rootOf(reader)) {\r\n node = findIn(rootOf(reader), id) ?? undefined;\r\n if (!node) {\r\n known?.delete(id);\r\n return null;\r\n }\r\n if (!known) found.set(reader, known = new Map());\r\n known.set(id, node);\r\n }\r\n return nodeView(node, reader);\r\n}\r\n\r\nfunction rootOf(node: Node): Node {\r\n let at = node;\r\n while (at.parent) at = at.parent;\r\n return at;\r\n}\r\n\r\nfunction findIn(at: Node, id: string): Node | null {\r\n if (at.id === id) return at;\r\n for (const child of at._allChildren) {\r\n const hit = findIn(child, id);\r\n if (hit) return hit;\r\n }\r\n return null;\r\n}\r\n\r\nlet keyOf: (node: Node2D) => string | undefined = () => undefined;\r\n/** Set by the factory module, which owns the node descriptors. */\r\nexport function setKeyLookup(lookup: (node: Node2D) => string | undefined): void {\r\n keyOf = lookup;\r\n}\r\n\r\n// ---- state views ------------------------------------------------------------\r\n\r\n/**\r\n * One prototype of getters per component, so a node's `state` is a single\r\n * object made once: every read goes straight to the node's own slot, and a\r\n * frame allocates nothing to hand its fields their values.\r\n */\r\nexport interface ViewShape {\r\n readonly proto: object;\r\n /** Own, so `{ ...state }` copies every entry; the getters themselves are shared. */\r\n readonly entries: PropertyDescriptorMap;\r\n}\r\n\r\nexport function stateViewPrototype(keys: readonly string[], references: ReadonlySet<string> = new Set()): ViewShape {\r\n const entries: PropertyDescriptorMap = {};\r\n for (const key of keys) {\r\n entries[key] = references.has(key)\r\n ? { get(this: { [NODE]: Node }) { return referenced(this[NODE], (this[NODE] as unknown as Record<string, unknown>)[key]); }, enumerable: true }\r\n : { get(this: { [NODE]: object }) { return (this[NODE] as Record<string, unknown>)[key]; }, enumerable: true };\r\n }\r\n const proto = {};\r\n // The children of the node's own tree, as its commands see them too.\r\n Object.defineProperty(proto, \"children\", {\r\n get(this: { [NODE]: { _commandChildren(): readonly ChildView[] } }) { return this[NODE]._commandChildren(); },\r\n enumerable: false,\r\n });\r\n return { proto, entries };\r\n}\r\n\r\nexport function stateView(shape: ViewShape, node: object): object {\r\n const view = Object.create(shape.proto) as { [NODE]: object };\r\n Object.defineProperties(view, shape.entries);\r\n view[NODE] = node;\r\n return view;\r\n}\r\n\r\n/** A command's `state`: where it starts, so a frame function reading it never sees its own writes. */\r\nexport function snapshot(view: object): Record<string, unknown> {\r\n const out: Record<string, unknown> = {};\r\n for (const key in view) out[key] = (view as Record<string, unknown>)[key];\r\n return out;\r\n}\r\n\r\n// ---- measurer and render context --------------------------------------------\r\n\r\nexport class MeasurerImpl implements Measurer {\r\n max: Max = {};\r\n scope: MeasureContext2D | null = null;\r\n\r\n constructor(readonly host: Node) { }\r\n\r\n get time(): Clock {\r\n return this.host.time;\r\n }\r\n\r\n text(text: string, font: FontSpec): Size2D {\r\n if (!this.scope) throw new Error(\"measurer.text was called outside measure.\");\r\n return this.scope.measureText(text, font.fontSize, font.fontFamily, font.fontWeight, font.letterSpacing);\r\n }\r\n}\r\n\r\n/** Reused every frame: `pass` and `cut` are rewritten before each render. */\r\nexport class RenderContextImpl implements RenderContext2D {\r\n pass: RenderPass2D | null = null;\r\n /** The near-plane cut a 2.5D space puts in front of this node's own paint. */\r\n cut: Clip | null = null;\r\n\r\n /**\r\n * `probing`: `render` runs only to find the shape it paints (for clip and\r\n * picking outside a frame), so nothing is drawn and no child is visited.\r\n */\r\n constructor(readonly host: ComponentHost, readonly probing = false) { }\r\n\r\n get size(): Size2D {\r\n const box = this.host.layoutBounds;\r\n return { width: box?.width ?? 0, height: box?.height ?? 0 };\r\n }\r\n\r\n get time(): Clock {\r\n return this.host.time;\r\n }\r\n\r\n draw(graphics: Graphics2D | readonly Graphics2D[] | null | undefined): void {\r\n if (!graphics || this.probing) return;\r\n const out = this.target();\r\n if (Array.isArray(graphics)) for (const g of graphics) out.draw(g);\r\n else out.draw(graphics as Graphics2D);\r\n }\r\n\r\n children(): void {\r\n if (this.probing) return;\r\n // Drawn plainly, so a space or composite the last frame declared no longer holds for them.\r\n if (!this.composite) this.host._record = null;\r\n this.host._renderOwnChildren(this.target());\r\n }\r\n\r\n /** What this render has declared so far. Its host's record follows at once, so the children it draws see it. */\r\n composite: Composite | null = null;\r\n\r\n private _declare(composite: Composite): void {\r\n this.composite = { ...this.composite, ...composite };\r\n if (!this.probing) this.host._record = this.composite;\r\n }\r\n\r\n mask(options: MaskOptions): void {\r\n this._declare({ bounds: \"first\" });\r\n if (this.probing) return;\r\n const out = this.target();\r\n const [stencil, ...content] = this.host.children;\r\n if (!stencil) return;\r\n if (content.length === 0) {\r\n stencil.render(out);\r\n return;\r\n }\r\n out.beginMask({ mode: options.mode, inverted: options.inverted });\r\n stencil.render(out);\r\n out.applyMask();\r\n for (const child of content) child.render(out);\r\n out.endMask();\r\n }\r\n\r\n merge(op: BooleanOperation, paint: MergePaint): void {\r\n this._declare({ bounds: op === \"subtract\" ? \"first\" : op === \"intersect\" ? \"intersect\" : \"union\" });\r\n if (this.probing) return;\r\n const out = this.target();\r\n out.beginBoolean(op);\r\n for (const child of this.host._allChildren) if (child instanceof Node2DClass) child.render(out);\r\n out.endBoolean();\r\n // A drawing with no shape of its own paints the merged outline.\r\n out.draw(new GraphicsClass().shadow(paint.shadow).fill(paint.fill));\r\n if (paint.overlay && (paint.overlay as unknown[]).length > 0) out.draw(new GraphicsClass().fill(paint.overlay));\r\n out.draw(new GraphicsClass().stroke(paint.stroke));\r\n }\r\n\r\n /** Your children, through a camera viewing your box: aimed at `lookAt`, zoomed, turned by `heading`. */\r\n camera(scope: CameraScope): void {\r\n this._declare({ camera: scope });\r\n if (this.probing) return;\r\n const out = this.target();\r\n const rect = this.host.layoutBounds;\r\n out.beginCamera({ x: rect?.x ?? 0, y: -(rect?.y ?? 0), width: rect?.width ?? 0, height: rect?.height ?? 0 }, scope.lookAt, scope.zoom, scope.heading);\r\n for (const child of this.host._allChildren) if (child instanceof Node2DClass) child.render(out);\r\n out.endCamera();\r\n }\r\n\r\n /** Your 3D children, rendered in order into a new scene. */\r\n scene3D(): Scene3D {\r\n const scene = new Scene3D();\r\n for (const child of this.host._allChildren) if (child instanceof Node3D) child.render(scene);\r\n this._declare({ scene });\r\n return scene;\r\n }\r\n\r\n /** Your children, standing in one 2.5D space seen by `camera`, drawn far to near. */\r\n space(camera: SpaceCamera): void {\r\n this._declare({ space: camera });\r\n if (!this.probing) this.host._renderOwnChildren(this.target());\r\n }\r\n\r\n textStyle(style: TextStyle | null, body: () => void): void {\r\n if (this.probing) return body();\r\n const out = this.target();\r\n out.pushTextStyle(style);\r\n try {\r\n body();\r\n } finally {\r\n out.popTextStyle();\r\n }\r\n }\r\n\r\n clip(shape: Graphics2D, body: () => void): void {\r\n if (this.probing) return body();\r\n const outline = clipOf(shape);\r\n // No outline is no clip, as a node with no `clipSelf` confines nothing.\r\n if (outline.isEmpty()) return body();\r\n const out = this.target();\r\n out.beginClip(outline);\r\n try {\r\n body();\r\n } finally {\r\n out.endClip();\r\n }\r\n }\r\n\r\n /** An ancestor stands this node in a space: one opens it, and nothing between them flattens. */\r\n get inSpace(): boolean {\r\n for (let at = this.host.parent; at; at = at.parent) {\r\n if (!(at instanceof Node2DClass)) return false;\r\n if (at._spaceCamera()) return true;\r\n if (!at._rendersChildrenInSpace()) return false;\r\n }\r\n return false;\r\n }\r\n\r\n ancestor<K extends string, S, C>(component: Component<K, S, C, any, any, any>): NodeView<Element<K, S, C>> | null {\r\n for (let at = this.host.parent; at; at = at.parent) {\r\n if (at instanceof component.node) return nodeView(at, this.host) as unknown as NodeView<Element<K, S, C>>;\r\n }\r\n return null;\r\n }\r\n\r\n /** Paint `body` in front of the space's near plane, as `Node2D` does for its own paint. */\r\n inFront(body: () => void): void {\r\n if (this.probing) return;\r\n const out = this.target();\r\n if (!this.cut) {\r\n body();\r\n return;\r\n }\r\n out.beginClip(this.cut);\r\n try {\r\n body();\r\n } finally {\r\n out.endClip();\r\n }\r\n }\r\n\r\n target(): RenderPass2D {\r\n if (this.probing) return PROBE_PASS;\r\n if (!this.pass) throw new Error(\"A component's render context was used outside render.\");\r\n return this.pass;\r\n }\r\n}\r\n\r\n/** Where a probe's scoped calls (a clip, a camera) land: a pass that draws nothing. */\r\nconst PROBE_PASS: RenderPass2D = new NullRenderContext();\r\n\r\nexport function internalsOf(ctx: RenderContext2D): RenderContextImpl {\r\n if (!(ctx instanceof RenderContextImpl)) throw new TypeError(\"Paint.draw takes the render context its render field was given.\");\r\n return ctx;\r\n}\r\n"]}
@@ -5,9 +5,8 @@
5
5
  * A subpath rather than the main barrel, and the reason is worth stating:
6
6
  * none of this is engine API. A scene author never reaches for it. It is the
7
7
  * machinery a `@motionscript/*` component uses to be a component — to
8
- * choreograph an entrance that can be seeked, to declare the assets of paints
9
- * it computes rather than stores, to ask what family a host's text falls back
10
- * to. Putting it in the main barrel would offer three more names to everyone
8
+ * choreograph an entrance that can be seeked, to ask what family a host's text
9
+ * falls back to. Putting it in the main barrel would offer three more names to everyone
11
10
  * who wanted a `Rect`, and one of them (`hold`) already means something else
12
11
  * there — audio automation has its own, and the collision is how this surface
13
12
  * announced itself.
@@ -17,8 +16,8 @@
17
16
  * formatter beside the Number node, the orbit-camera lerps under `attributes/`)
18
17
  * rather than duplicated or reinvented here.
19
18
  */
20
- export * from "./tween/seekable.js";
21
- export * from "./nodes/node/declare-paints.js";
19
+ export { at, hold, sequence, together } from "./tween/seekable.js";
20
+ export type { Placed, Seekable } from "./tween/seekable.js";
22
21
  export * from "./nodes/node/text-defaults.js";
23
22
  export * from "./util/metrics.js";
24
23
  export * from "./nodes/text/number-format.js";
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../src/component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,cAAc,kBAAkB,CAAA;AAChC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,gBAAgB,CAAA;AAC9B,cAAc,4BAA4B,CAAA;AAC1C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,gCAAgC,CAAA"}
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../src/component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC/D,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AACxD,cAAc,4BAA4B,CAAA;AAC1C,cAAc,gBAAgB,CAAA;AAC9B,cAAc,4BAA4B,CAAA;AAC1C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,gCAAgC,CAAA"}
package/dist/component.js CHANGED
@@ -5,9 +5,8 @@
5
5
  * A subpath rather than the main barrel, and the reason is worth stating:
6
6
  * none of this is engine API. A scene author never reaches for it. It is the
7
7
  * machinery a `@motionscript/*` component uses to be a component — to
8
- * choreograph an entrance that can be seeked, to declare the assets of paints
9
- * it computes rather than stores, to ask what family a host's text falls back
10
- * to. Putting it in the main barrel would offer three more names to everyone
8
+ * choreograph an entrance that can be seeked, to ask what family a host's text
9
+ * falls back to. Putting it in the main barrel would offer three more names to everyone
11
10
  * who wanted a `Rect`, and one of them (`hold`) already means something else
12
11
  * there — audio automation has its own, and the collision is how this surface
13
12
  * announced itself.
@@ -17,8 +16,7 @@
17
16
  * formatter beside the Number node, the orbit-camera lerps under `attributes/`)
18
17
  * rather than duplicated or reinvented here.
19
18
  */
20
- export * from "./tween/seekable.js";
21
- export * from "./nodes/node/declare-paints.js";
19
+ export { at, hold, sequence, together } from "./tween/seekable.js";
22
20
  export * from "./nodes/node/text-defaults.js";
23
21
  export * from "./util/metrics.js";
24
22
  export * from "./nodes/text/number-format.js";
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sourceRoot":"","sources":["../src/component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,cAAc,kBAAkB,CAAA;AAChC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,gBAAgB,CAAA;AAC9B,cAAc,4BAA4B,CAAA;AAC1C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,gCAAgC,CAAA","sourcesContent":["/**\n * What a **component package** built on this engine needs, and cannot supply\n * itself.\n *\n * A subpath rather than the main barrel, and the reason is worth stating:\n * none of this is engine API. A scene author never reaches for it. It is the\n * machinery a `@motionscript/*` component uses to be a component — to\n * choreograph an entrance that can be seeked, to declare the assets of paints\n * it computes rather than stores, to ask what family a host's text falls back\n * to. Putting it in the main barrel would offer three more names to everyone\n * who wanted a `Rect`, and one of them (`hold`) already means something else\n * there — audio automation has its own, and the collision is how this surface\n * announced itself.\n *\n * This file is a **re-export barrel only** — everything it names lives beside\n * whatever actually owns it (the path model beside the Path node, the number\n * formatter beside the Number node, the orbit-camera lerps under `attributes/`)\n * rather than duplicated or reinvented here.\n */\nexport * from \"@/tween/seekable\"\nexport * from \"@/nodes/node/declare-paints\"\nexport * from \"@/nodes/node/text-defaults\"\nexport * from \"@/util/metrics\"\nexport * from \"@/nodes/text/number-format\"\nexport * from \"@/nodes/text/number-pattern\"\nexport * from \"@/attributes/render3d/orbit\"\nexport * from \"@/nodes/geometry/shape-outline\"\n"]}
1
+ {"version":3,"file":"component.js","sourceRoot":"","sources":["../src/component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAE/D,cAAc,4BAA4B,CAAA;AAC1C,cAAc,gBAAgB,CAAA;AAC9B,cAAc,4BAA4B,CAAA;AAC1C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,gCAAgC,CAAA","sourcesContent":["/**\r\n * What a **component package** built on this engine needs, and cannot supply\r\n * itself.\r\n *\r\n * A subpath rather than the main barrel, and the reason is worth stating:\r\n * none of this is engine API. A scene author never reaches for it. It is the\r\n * machinery a `@motionscript/*` component uses to be a component — to\r\n * choreograph an entrance that can be seeked, to ask what family a host's text\r\n * falls back to. Putting it in the main barrel would offer three more names to everyone\r\n * who wanted a `Rect`, and one of them (`hold`) already means something else\r\n * there — audio automation has its own, and the collision is how this surface\r\n * announced itself.\r\n *\r\n * This file is a **re-export barrel only** — everything it names lives beside\r\n * whatever actually owns it (the path model beside the Path node, the number\r\n * formatter beside the Number node, the orbit-camera lerps under `attributes/`)\r\n * rather than duplicated or reinvented here.\r\n */\r\nexport { at, hold, sequence, together } from \"@/tween/seekable\"\r\nexport type { Placed, Seekable } from \"@/tween/seekable\"\r\nexport * from \"@/nodes/node/text-defaults\"\r\nexport * from \"@/util/metrics\"\r\nexport * from \"@/nodes/text/number-format\"\r\nexport * from \"@/nodes/text/number-pattern\"\r\nexport * from \"@/attributes/render3d/orbit\"\r\nexport * from \"@/nodes/geometry/shape-outline\"\r\n"]}
@@ -1,4 +1,4 @@
1
- import type { AudioDocument, CompositionDocument } from "./types.js";
1
+ import type { AudioDocument, ClipDocument, CompositionDocument, VisualDocument } from "./types.js";
2
2
  /**
3
3
  * The id the authored root bus is rewritten to.
4
4
  *
@@ -10,7 +10,7 @@ declare const AUDIO_ROOT_ID = "@bus";
10
10
  * An audio document, as the composition it already is.
11
11
  *
12
12
  * There is no second evaluator for sound, and this is what keeps it that way:
13
- * an audio clip is compiled, seeked and restored by `SceneTimeline` like any
13
+ * an audio clip is compiled, seeked and restored by `ClipTimeline` like any
14
14
  * other, so a bus fade and a rectangle's fade cannot drift because there is only
15
15
  * one machine running them.
16
16
  *
@@ -23,4 +23,12 @@ declare const AUDIO_ROOT_ID = "@bus";
23
23
  */
24
24
  export declare function loweredAudioDocument(doc: AudioDocument): CompositionDocument;
25
25
  export { AUDIO_ROOT_ID };
26
+ /**
27
+ * A `sound` or `video` row with no `play` command of its own plays as it did
28
+ * before sound came only from commands: a sound over its span (open-ended, to
29
+ * its own end), a video once per segment, or over its span while it plays.
30
+ */
31
+ export declare function withPlayedSounds(doc: CompositionDocument): CompositionDocument;
32
+ /** A clip as its timeline builds it: an audio document lowered to the composition it is, its sounds played. */
33
+ export declare function clipDocument(doc: ClipDocument): VisualDocument;
26
34
  //# sourceMappingURL=audio.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"audio.d.ts","sourceRoot":"","sources":["../../src/document/audio.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAe,mBAAmB,EAA2B,MAAM,SAAS,CAAC;AAExG;;;;;GAKG;AACH,QAAA,MAAM,aAAa,SAAS,CAAC;AAY7B;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,aAAa,GAAG,mBAAmB,CAY5E;AAwBD,OAAO,EAAE,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"audio.d.ts","sourceRoot":"","sources":["../../src/document/audio.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAe,mBAAmB,EAA2B,cAAc,EAAE,MAAM,SAAS,CAAC;AAGtI;;;;;GAKG;AACH,QAAA,MAAM,aAAa,SAAS,CAAC;AAY7B;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,aAAa,GAAG,mBAAmB,CAY5E;AAwBD,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,mBAAmB,GAAG,mBAAmB,CA4B9E;AAED,+GAA+G;AAC/G,wBAAgB,YAAY,CAAC,GAAG,EAAE,YAAY,GAAG,cAAc,CAG9D"}