@motionscript/core 0.1.0 → 0.1.1-alpha.1

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 (1072) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/assets/asset-index.d.ts +1 -8
  3. package/dist/assets/asset-index.d.ts.map +1 -1
  4. package/dist/assets/asset-index.js +1 -8
  5. package/dist/assets/asset-index.js.map +1 -1
  6. package/dist/assets/catalog.d.ts +10 -72
  7. package/dist/assets/catalog.d.ts.map +1 -1
  8. package/dist/assets/catalog.js +3 -29
  9. package/dist/assets/catalog.js.map +1 -1
  10. package/dist/assets/errors.d.ts +8 -20
  11. package/dist/assets/errors.d.ts.map +1 -1
  12. package/dist/assets/errors.js +8 -20
  13. package/dist/assets/errors.js.map +1 -1
  14. package/dist/assets/index.d.ts.map +1 -1
  15. package/dist/assets/index.js.map +1 -1
  16. package/dist/assets/manager.d.ts +9 -51
  17. package/dist/assets/manager.d.ts.map +1 -1
  18. package/dist/assets/manager.js +13 -78
  19. package/dist/assets/manager.js.map +1 -1
  20. package/dist/assets/record.d.ts +2 -18
  21. package/dist/assets/record.d.ts.map +1 -1
  22. package/dist/assets/record.js.map +1 -1
  23. package/dist/assets/scope.d.ts +3 -18
  24. package/dist/assets/scope.d.ts.map +1 -1
  25. package/dist/assets/scope.js +2 -11
  26. package/dist/assets/scope.js.map +1 -1
  27. package/dist/attributes/audio/effects/chain.d.ts +2 -12
  28. package/dist/attributes/audio/effects/chain.d.ts.map +1 -1
  29. package/dist/attributes/audio/effects/chain.js +1 -7
  30. package/dist/attributes/audio/effects/chain.js.map +1 -1
  31. package/dist/attributes/audio/effects/registry.d.ts +3 -18
  32. package/dist/attributes/audio/effects/registry.d.ts.map +1 -1
  33. package/dist/attributes/audio/effects/registry.js +4 -23
  34. package/dist/attributes/audio/effects/registry.js.map +1 -1
  35. package/dist/attributes/audio/ramp.d.ts +5 -38
  36. package/dist/attributes/audio/ramp.d.ts.map +1 -1
  37. package/dist/attributes/audio/ramp.js +3 -28
  38. package/dist/attributes/audio/ramp.js.map +1 -1
  39. package/dist/attributes/audio/request.d.ts +10 -80
  40. package/dist/attributes/audio/request.d.ts.map +1 -1
  41. package/dist/attributes/audio/request.js +1 -4
  42. package/dist/attributes/audio/request.js.map +1 -1
  43. package/dist/attributes/audio/schedule.d.ts +2 -12
  44. package/dist/attributes/audio/schedule.d.ts.map +1 -1
  45. package/dist/attributes/audio/schedule.js +2 -11
  46. package/dist/attributes/audio/schedule.js.map +1 -1
  47. package/dist/attributes/audio/sound.d.ts +2 -26
  48. package/dist/attributes/audio/sound.d.ts.map +1 -1
  49. package/dist/attributes/audio/sound.js +1 -9
  50. package/dist/attributes/audio/sound.js.map +1 -1
  51. package/dist/attributes/audio/transition.d.ts +1 -8
  52. package/dist/attributes/audio/transition.d.ts.map +1 -1
  53. package/dist/attributes/audio/transition.js.map +1 -1
  54. package/dist/attributes/layout/alignment.d.ts +6 -38
  55. package/dist/attributes/layout/alignment.d.ts.map +1 -1
  56. package/dist/attributes/layout/alignment.js.map +1 -1
  57. package/dist/attributes/layout/insets.d.ts +2 -27
  58. package/dist/attributes/layout/insets.d.ts.map +1 -1
  59. package/dist/attributes/layout/insets.js.map +1 -1
  60. package/dist/attributes/layout/matrix2d.d.ts +29 -114
  61. package/dist/attributes/layout/matrix2d.d.ts.map +1 -1
  62. package/dist/attributes/layout/matrix2d.js +26 -110
  63. package/dist/attributes/layout/matrix2d.js.map +1 -1
  64. package/dist/attributes/layout/size.d.ts +3 -25
  65. package/dist/attributes/layout/size.d.ts.map +1 -1
  66. package/dist/attributes/layout/size.js +2 -18
  67. package/dist/attributes/layout/size.js.map +1 -1
  68. package/dist/attributes/layout/space3d.d.ts +16 -79
  69. package/dist/attributes/layout/space3d.d.ts.map +1 -1
  70. package/dist/attributes/layout/space3d.js +17 -81
  71. package/dist/attributes/layout/space3d.js.map +1 -1
  72. package/dist/attributes/layout/transform3d.d.ts +2 -23
  73. package/dist/attributes/layout/transform3d.d.ts.map +1 -1
  74. package/dist/attributes/layout/transform3d.js +1 -7
  75. package/dist/attributes/layout/transform3d.js.map +1 -1
  76. package/dist/attributes/layout/world-transform.d.ts +2 -16
  77. package/dist/attributes/layout/world-transform.d.ts.map +1 -1
  78. package/dist/attributes/layout/world-transform.js.map +1 -1
  79. package/dist/attributes/properties/decorator.d.ts +13 -73
  80. package/dist/attributes/properties/decorator.d.ts.map +1 -1
  81. package/dist/attributes/properties/decorator.js +9 -40
  82. package/dist/attributes/properties/decorator.js.map +1 -1
  83. package/dist/attributes/properties/typed.d.ts +6 -45
  84. package/dist/attributes/properties/typed.d.ts.map +1 -1
  85. package/dist/attributes/properties/typed.js +6 -37
  86. package/dist/attributes/properties/typed.js.map +1 -1
  87. package/dist/attributes/render3d/orbit.d.ts +11 -83
  88. package/dist/attributes/render3d/orbit.d.ts.map +1 -1
  89. package/dist/attributes/render3d/orbit.js +10 -73
  90. package/dist/attributes/render3d/orbit.js.map +1 -1
  91. package/dist/attributes/shape/corners/corner-radius.d.ts +1 -6
  92. package/dist/attributes/shape/corners/corner-radius.d.ts.map +1 -1
  93. package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
  94. package/dist/attributes/shape/corners/corner-style.d.ts +4 -25
  95. package/dist/attributes/shape/corners/corner-style.d.ts.map +1 -1
  96. package/dist/attributes/shape/corners/corner-style.js +2 -12
  97. package/dist/attributes/shape/corners/corner-style.js.map +1 -1
  98. package/dist/attributes/shape/corners/corners.d.ts +2 -21
  99. package/dist/attributes/shape/corners/corners.d.ts.map +1 -1
  100. package/dist/attributes/shape/corners/corners.js +2 -12
  101. package/dist/attributes/shape/corners/corners.js.map +1 -1
  102. package/dist/attributes/shape/effects/backdrop.d.ts +2 -18
  103. package/dist/attributes/shape/effects/backdrop.d.ts.map +1 -1
  104. package/dist/attributes/shape/effects/backdrop.js +3 -26
  105. package/dist/attributes/shape/effects/backdrop.js.map +1 -1
  106. package/dist/attributes/shape/effects/chain.d.ts +36 -328
  107. package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
  108. package/dist/attributes/shape/effects/chain.js +24 -242
  109. package/dist/attributes/shape/effects/chain.js.map +1 -1
  110. package/dist/attributes/shape/effects/effect-data.d.ts +19 -127
  111. package/dist/attributes/shape/effects/effect-data.d.ts.map +1 -1
  112. package/dist/attributes/shape/effects/effect-data.js +6 -33
  113. package/dist/attributes/shape/effects/effect-data.js.map +1 -1
  114. package/dist/attributes/shape/effects/implementations/ascii.d.ts +6 -26
  115. package/dist/attributes/shape/effects/implementations/ascii.d.ts.map +1 -1
  116. package/dist/attributes/shape/effects/implementations/ascii.js +0 -3
  117. package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
  118. package/dist/attributes/shape/effects/implementations/bit-crush.d.ts +2 -21
  119. package/dist/attributes/shape/effects/implementations/bit-crush.d.ts.map +1 -1
  120. package/dist/attributes/shape/effects/implementations/bit-crush.js +0 -1
  121. package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
  122. package/dist/attributes/shape/effects/implementations/block-displace.d.ts +1 -14
  123. package/dist/attributes/shape/effects/implementations/block-displace.d.ts.map +1 -1
  124. package/dist/attributes/shape/effects/implementations/block-displace.js +0 -1
  125. package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
  126. package/dist/attributes/shape/effects/implementations/bloom.d.ts +0 -1
  127. package/dist/attributes/shape/effects/implementations/bloom.d.ts.map +1 -1
  128. package/dist/attributes/shape/effects/implementations/bloom.js +0 -1
  129. package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
  130. package/dist/attributes/shape/effects/implementations/blur.d.ts +0 -1
  131. package/dist/attributes/shape/effects/implementations/blur.d.ts.map +1 -1
  132. package/dist/attributes/shape/effects/implementations/blur.js +0 -1
  133. package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
  134. package/dist/attributes/shape/effects/implementations/bulge.d.ts +0 -1
  135. package/dist/attributes/shape/effects/implementations/bulge.d.ts.map +1 -1
  136. package/dist/attributes/shape/effects/implementations/bulge.js +0 -1
  137. package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
  138. package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts +0 -1
  139. package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts.map +1 -1
  140. package/dist/attributes/shape/effects/implementations/chromatic-aberration.js +0 -1
  141. package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
  142. package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +1 -12
  143. package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts.map +1 -1
  144. package/dist/attributes/shape/effects/implementations/color-adjustment.js +0 -1
  145. package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
  146. package/dist/attributes/shape/effects/implementations/curves.d.ts +1 -11
  147. package/dist/attributes/shape/effects/implementations/curves.d.ts.map +1 -1
  148. package/dist/attributes/shape/effects/implementations/curves.js +1 -6
  149. package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
  150. package/dist/attributes/shape/effects/implementations/directional-blur.d.ts +0 -1
  151. package/dist/attributes/shape/effects/implementations/directional-blur.d.ts.map +1 -1
  152. package/dist/attributes/shape/effects/implementations/directional-blur.js +0 -1
  153. package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
  154. package/dist/attributes/shape/effects/implementations/dither.d.ts +4 -35
  155. package/dist/attributes/shape/effects/implementations/dither.d.ts.map +1 -1
  156. package/dist/attributes/shape/effects/implementations/dither.js +1 -7
  157. package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
  158. package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts +1 -22
  159. package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts.map +1 -1
  160. package/dist/attributes/shape/effects/implementations/drop-shadow.js +0 -1
  161. package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
  162. package/dist/attributes/shape/effects/implementations/duotone.d.ts +1 -9
  163. package/dist/attributes/shape/effects/implementations/duotone.d.ts.map +1 -1
  164. package/dist/attributes/shape/effects/implementations/duotone.js +0 -1
  165. package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
  166. package/dist/attributes/shape/effects/implementations/edges.d.ts +2 -15
  167. package/dist/attributes/shape/effects/implementations/edges.d.ts.map +1 -1
  168. package/dist/attributes/shape/effects/implementations/edges.js +0 -1
  169. package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
  170. package/dist/attributes/shape/effects/implementations/glass.d.ts +1 -14
  171. package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
  172. package/dist/attributes/shape/effects/implementations/glass.js +0 -1
  173. package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
  174. package/dist/attributes/shape/effects/implementations/glow.d.ts +7 -47
  175. package/dist/attributes/shape/effects/implementations/glow.d.ts.map +1 -1
  176. package/dist/attributes/shape/effects/implementations/glow.js +1 -9
  177. package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
  178. package/dist/attributes/shape/effects/implementations/grain.d.ts +1 -14
  179. package/dist/attributes/shape/effects/implementations/grain.d.ts.map +1 -1
  180. package/dist/attributes/shape/effects/implementations/grain.js +0 -1
  181. package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
  182. package/dist/attributes/shape/effects/implementations/grayscale.d.ts +0 -1
  183. package/dist/attributes/shape/effects/implementations/grayscale.d.ts.map +1 -1
  184. package/dist/attributes/shape/effects/implementations/grayscale.js +0 -1
  185. package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
  186. package/dist/attributes/shape/effects/implementations/halftone.d.ts +5 -29
  187. package/dist/attributes/shape/effects/implementations/halftone.d.ts.map +1 -1
  188. package/dist/attributes/shape/effects/implementations/halftone.js +0 -1
  189. package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
  190. package/dist/attributes/shape/effects/implementations/invert.d.ts +3 -12
  191. package/dist/attributes/shape/effects/implementations/invert.d.ts.map +1 -1
  192. package/dist/attributes/shape/effects/implementations/invert.js +0 -1
  193. package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
  194. package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts +2 -19
  195. package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts.map +1 -1
  196. package/dist/attributes/shape/effects/implementations/kaleidoscope.js +1 -5
  197. package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
  198. package/dist/attributes/shape/effects/implementations/lut.d.ts +11 -36
  199. package/dist/attributes/shape/effects/implementations/lut.d.ts.map +1 -1
  200. package/dist/attributes/shape/effects/implementations/lut.js +2 -8
  201. package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
  202. package/dist/attributes/shape/effects/implementations/magnify.d.ts +0 -1
  203. package/dist/attributes/shape/effects/implementations/magnify.d.ts.map +1 -1
  204. package/dist/attributes/shape/effects/implementations/magnify.js +0 -1
  205. package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
  206. package/dist/attributes/shape/effects/implementations/motion-blur.d.ts +3 -17
  207. package/dist/attributes/shape/effects/implementations/motion-blur.d.ts.map +1 -1
  208. package/dist/attributes/shape/effects/implementations/motion-blur.js +2 -11
  209. package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
  210. package/dist/attributes/shape/effects/implementations/oil-paint.d.ts +1 -12
  211. package/dist/attributes/shape/effects/implementations/oil-paint.d.ts.map +1 -1
  212. package/dist/attributes/shape/effects/implementations/oil-paint.js +0 -1
  213. package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
  214. package/dist/attributes/shape/effects/implementations/outline.d.ts +2 -14
  215. package/dist/attributes/shape/effects/implementations/outline.d.ts.map +1 -1
  216. package/dist/attributes/shape/effects/implementations/outline.js +0 -1
  217. package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
  218. package/dist/attributes/shape/effects/implementations/pixelate.d.ts +1 -15
  219. package/dist/attributes/shape/effects/implementations/pixelate.d.ts.map +1 -1
  220. package/dist/attributes/shape/effects/implementations/pixelate.js +0 -1
  221. package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
  222. package/dist/attributes/shape/effects/implementations/posterize.d.ts +1 -10
  223. package/dist/attributes/shape/effects/implementations/posterize.d.ts.map +1 -1
  224. package/dist/attributes/shape/effects/implementations/posterize.js +0 -1
  225. package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
  226. package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts +3 -26
  227. package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts.map +1 -1
  228. package/dist/attributes/shape/effects/implementations/progressive-blur.js +1 -2
  229. package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
  230. package/dist/attributes/shape/effects/implementations/radial-blur.d.ts +2 -16
  231. package/dist/attributes/shape/effects/implementations/radial-blur.d.ts.map +1 -1
  232. package/dist/attributes/shape/effects/implementations/radial-blur.js +0 -1
  233. package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
  234. package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts +1 -13
  235. package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts.map +1 -1
  236. package/dist/attributes/shape/effects/implementations/rgb-shift.js +0 -1
  237. package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
  238. package/dist/attributes/shape/effects/implementations/scanlines.d.ts +1 -8
  239. package/dist/attributes/shape/effects/implementations/scanlines.d.ts.map +1 -1
  240. package/dist/attributes/shape/effects/implementations/scanlines.js +0 -1
  241. package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
  242. package/dist/attributes/shape/effects/implementations/scatter.d.ts +0 -1
  243. package/dist/attributes/shape/effects/implementations/scatter.d.ts.map +1 -1
  244. package/dist/attributes/shape/effects/implementations/scatter.js +0 -1
  245. package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
  246. package/dist/attributes/shape/effects/implementations/shader.d.ts +10 -53
  247. package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
  248. package/dist/attributes/shape/effects/implementations/shader.js +2 -9
  249. package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
  250. package/dist/attributes/shape/effects/implementations/sharpen.d.ts +1 -12
  251. package/dist/attributes/shape/effects/implementations/sharpen.d.ts.map +1 -1
  252. package/dist/attributes/shape/effects/implementations/sharpen.js +0 -1
  253. package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
  254. package/dist/attributes/shape/effects/implementations/streak.d.ts +1 -8
  255. package/dist/attributes/shape/effects/implementations/streak.d.ts.map +1 -1
  256. package/dist/attributes/shape/effects/implementations/streak.js +0 -1
  257. package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
  258. package/dist/attributes/shape/effects/implementations/threshold.d.ts +1 -9
  259. package/dist/attributes/shape/effects/implementations/threshold.d.ts.map +1 -1
  260. package/dist/attributes/shape/effects/implementations/threshold.js +0 -1
  261. package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
  262. package/dist/attributes/shape/effects/implementations/twirl.d.ts +1 -13
  263. package/dist/attributes/shape/effects/implementations/twirl.d.ts.map +1 -1
  264. package/dist/attributes/shape/effects/implementations/twirl.js +0 -1
  265. package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
  266. package/dist/attributes/shape/effects/implementations/vignette.d.ts +1 -9
  267. package/dist/attributes/shape/effects/implementations/vignette.d.ts.map +1 -1
  268. package/dist/attributes/shape/effects/implementations/vignette.js +0 -1
  269. package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
  270. package/dist/attributes/shape/effects/implementations/vintage.d.ts +0 -1
  271. package/dist/attributes/shape/effects/implementations/vintage.d.ts.map +1 -1
  272. package/dist/attributes/shape/effects/implementations/vintage.js +0 -1
  273. package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
  274. package/dist/attributes/shape/effects/implementations/wave.d.ts +3 -24
  275. package/dist/attributes/shape/effects/implementations/wave.d.ts.map +1 -1
  276. package/dist/attributes/shape/effects/implementations/wave.js +1 -5
  277. package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
  278. package/dist/attributes/shape/effects/registry.d.ts +6 -41
  279. package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
  280. package/dist/attributes/shape/effects/registry.js +7 -45
  281. package/dist/attributes/shape/effects/registry.js.map +1 -1
  282. package/dist/attributes/shape/effects/spec.d.ts +6 -30
  283. package/dist/attributes/shape/effects/spec.d.ts.map +1 -1
  284. package/dist/attributes/shape/effects/spec.js +3 -9
  285. package/dist/attributes/shape/effects/spec.js.map +1 -1
  286. package/dist/attributes/shape/fill/blend.d.ts +1 -17
  287. package/dist/attributes/shape/fill/blend.d.ts.map +1 -1
  288. package/dist/attributes/shape/fill/blend.js +2 -15
  289. package/dist/attributes/shape/fill/blend.js.map +1 -1
  290. package/dist/attributes/shape/fill/chain.d.ts +17 -125
  291. package/dist/attributes/shape/fill/chain.d.ts.map +1 -1
  292. package/dist/attributes/shape/fill/chain.js +22 -109
  293. package/dist/attributes/shape/fill/chain.js.map +1 -1
  294. package/dist/attributes/shape/fill/coerce.d.ts +10 -35
  295. package/dist/attributes/shape/fill/coerce.d.ts.map +1 -1
  296. package/dist/attributes/shape/fill/coerce.js +12 -47
  297. package/dist/attributes/shape/fill/coerce.js.map +1 -1
  298. package/dist/attributes/shape/fill/color/parser.d.ts +10 -44
  299. package/dist/attributes/shape/fill/color/parser.d.ts.map +1 -1
  300. package/dist/attributes/shape/fill/color/parser.js +15 -91
  301. package/dist/attributes/shape/fill/color/parser.js.map +1 -1
  302. package/dist/attributes/shape/fill/gradient-stops.d.ts +1 -8
  303. package/dist/attributes/shape/fill/gradient-stops.d.ts.map +1 -1
  304. package/dist/attributes/shape/fill/gradient-stops.js +2 -13
  305. package/dist/attributes/shape/fill/gradient-stops.js.map +1 -1
  306. package/dist/attributes/shape/fill/implementations/canvas3d.d.ts +2 -24
  307. package/dist/attributes/shape/fill/implementations/canvas3d.d.ts.map +1 -1
  308. package/dist/attributes/shape/fill/implementations/canvas3d.js +2 -9
  309. package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
  310. package/dist/attributes/shape/fill/implementations/dot-grid.d.ts +1 -14
  311. package/dist/attributes/shape/fill/implementations/dot-grid.d.ts.map +1 -1
  312. package/dist/attributes/shape/fill/implementations/dot-grid.js.map +1 -1
  313. package/dist/attributes/shape/fill/implementations/fractal-noise.d.ts +5 -28
  314. package/dist/attributes/shape/fill/implementations/fractal-noise.d.ts.map +1 -1
  315. package/dist/attributes/shape/fill/implementations/fractal-noise.js +0 -1
  316. package/dist/attributes/shape/fill/implementations/fractal-noise.js.map +1 -1
  317. package/dist/attributes/shape/fill/implementations/grid.d.ts +8 -21
  318. package/dist/attributes/shape/fill/implementations/grid.d.ts.map +1 -1
  319. package/dist/attributes/shape/fill/implementations/grid.js +2 -8
  320. package/dist/attributes/shape/fill/implementations/grid.js.map +1 -1
  321. package/dist/attributes/shape/fill/implementations/image.d.ts +13 -79
  322. package/dist/attributes/shape/fill/implementations/image.d.ts.map +1 -1
  323. package/dist/attributes/shape/fill/implementations/image.js +6 -23
  324. package/dist/attributes/shape/fill/implementations/image.js.map +1 -1
  325. package/dist/attributes/shape/fill/implementations/noise.d.ts +2 -15
  326. package/dist/attributes/shape/fill/implementations/noise.d.ts.map +1 -1
  327. package/dist/attributes/shape/fill/implementations/noise.js.map +1 -1
  328. package/dist/attributes/shape/fill/implementations/shader.d.ts +11 -45
  329. package/dist/attributes/shape/fill/implementations/shader.d.ts.map +1 -1
  330. package/dist/attributes/shape/fill/implementations/shader.js +5 -17
  331. package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
  332. package/dist/attributes/shape/fill/implementations/video.d.ts +12 -64
  333. package/dist/attributes/shape/fill/implementations/video.d.ts.map +1 -1
  334. package/dist/attributes/shape/fill/implementations/video.js +12 -50
  335. package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
  336. package/dist/attributes/shape/fill/lerp.d.ts +2 -13
  337. package/dist/attributes/shape/fill/lerp.d.ts.map +1 -1
  338. package/dist/attributes/shape/fill/lerp.js +2 -9
  339. package/dist/attributes/shape/fill/lerp.js.map +1 -1
  340. package/dist/attributes/shape/fill/media-preset.d.ts +8 -49
  341. package/dist/attributes/shape/fill/media-preset.d.ts.map +1 -1
  342. package/dist/attributes/shape/fill/media-preset.js +8 -35
  343. package/dist/attributes/shape/fill/media-preset.js.map +1 -1
  344. package/dist/attributes/shape/fill/registry.d.ts +2 -26
  345. package/dist/attributes/shape/fill/registry.d.ts.map +1 -1
  346. package/dist/attributes/shape/fill/registry.js +5 -40
  347. package/dist/attributes/shape/fill/registry.js.map +1 -1
  348. package/dist/attributes/shape/fill/union.d.ts +6 -30
  349. package/dist/attributes/shape/fill/union.d.ts.map +1 -1
  350. package/dist/attributes/shape/fill/union.js +1 -9
  351. package/dist/attributes/shape/fill/union.js.map +1 -1
  352. package/dist/attributes/shape/filters/chain.d.ts +15 -168
  353. package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
  354. package/dist/attributes/shape/filters/chain.js +8 -132
  355. package/dist/attributes/shape/filters/chain.js.map +1 -1
  356. package/dist/attributes/shape/filters/implementations/color-matrix.d.ts +1 -7
  357. package/dist/attributes/shape/filters/implementations/color-matrix.d.ts.map +1 -1
  358. package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
  359. package/dist/attributes/shape/filters/implementations/curves.d.ts +1 -7
  360. package/dist/attributes/shape/filters/implementations/curves.d.ts.map +1 -1
  361. package/dist/attributes/shape/filters/implementations/curves.js.map +1 -1
  362. package/dist/attributes/shape/filters/implementations/echo.d.ts +1 -11
  363. package/dist/attributes/shape/filters/implementations/echo.d.ts.map +1 -1
  364. package/dist/attributes/shape/filters/implementations/echo.js.map +1 -1
  365. package/dist/attributes/shape/filters/index.d.ts +1 -6
  366. package/dist/attributes/shape/filters/index.d.ts.map +1 -1
  367. package/dist/attributes/shape/filters/index.js +0 -2
  368. package/dist/attributes/shape/filters/index.js.map +1 -1
  369. package/dist/attributes/shape/filters/registry.d.ts +5 -35
  370. package/dist/attributes/shape/filters/registry.d.ts.map +1 -1
  371. package/dist/attributes/shape/filters/registry.js +7 -50
  372. package/dist/attributes/shape/filters/registry.js.map +1 -1
  373. package/dist/attributes/shape/filters/union.d.ts +10 -51
  374. package/dist/attributes/shape/filters/union.d.ts.map +1 -1
  375. package/dist/attributes/shape/filters/union.js.map +1 -1
  376. package/dist/attributes/shape/path/anchors.d.ts +18 -106
  377. package/dist/attributes/shape/path/anchors.d.ts.map +1 -1
  378. package/dist/attributes/shape/path/anchors.js +15 -124
  379. package/dist/attributes/shape/path/anchors.js.map +1 -1
  380. package/dist/attributes/shape/path/bezier.d.ts +6 -54
  381. package/dist/attributes/shape/path/bezier.d.ts.map +1 -1
  382. package/dist/attributes/shape/path/bezier.js +10 -98
  383. package/dist/attributes/shape/path/bezier.js.map +1 -1
  384. package/dist/attributes/shape/path/index.d.ts +1 -11
  385. package/dist/attributes/shape/path/index.d.ts.map +1 -1
  386. package/dist/attributes/shape/path/index.js +1 -11
  387. package/dist/attributes/shape/path/index.js.map +1 -1
  388. package/dist/attributes/shape/path/measure.d.ts +5 -41
  389. package/dist/attributes/shape/path/measure.d.ts.map +1 -1
  390. package/dist/attributes/shape/path/measure.js +8 -57
  391. package/dist/attributes/shape/path/measure.js.map +1 -1
  392. package/dist/attributes/shape/path/morph.d.ts +4 -41
  393. package/dist/attributes/shape/path/morph.d.ts.map +1 -1
  394. package/dist/attributes/shape/path/morph.js +17 -117
  395. package/dist/attributes/shape/path/morph.js.map +1 -1
  396. package/dist/attributes/shape/path/ops.d.ts +5 -19
  397. package/dist/attributes/shape/path/ops.d.ts.map +1 -1
  398. package/dist/attributes/shape/path/ops.js.map +1 -1
  399. package/dist/attributes/shape/path/types.d.ts +10 -67
  400. package/dist/attributes/shape/path/types.d.ts.map +1 -1
  401. package/dist/attributes/shape/path/types.js +0 -1
  402. package/dist/attributes/shape/path/types.js.map +1 -1
  403. package/dist/attributes/shape/path/walk.d.ts +9 -63
  404. package/dist/attributes/shape/path/walk.d.ts.map +1 -1
  405. package/dist/attributes/shape/path/walk.js +21 -100
  406. package/dist/attributes/shape/path/walk.js.map +1 -1
  407. package/dist/attributes/shape/shaders/language.d.ts +2 -14
  408. package/dist/attributes/shape/shaders/language.d.ts.map +1 -1
  409. package/dist/attributes/shape/shaders/language.js +1 -8
  410. package/dist/attributes/shape/shaders/language.js.map +1 -1
  411. package/dist/attributes/shape/shaders/pack.d.ts +13 -78
  412. package/dist/attributes/shape/shaders/pack.d.ts.map +1 -1
  413. package/dist/attributes/shape/shaders/pack.js +1 -10
  414. package/dist/attributes/shape/shaders/pack.js.map +1 -1
  415. package/dist/attributes/shape/shaders/resolve.d.ts +1 -11
  416. package/dist/attributes/shape/shaders/resolve.d.ts.map +1 -1
  417. package/dist/attributes/shape/shaders/resolve.js +3 -28
  418. package/dist/attributes/shape/shaders/resolve.js.map +1 -1
  419. package/dist/attributes/shape/shaders/uniforms.d.ts +3 -24
  420. package/dist/attributes/shape/shaders/uniforms.d.ts.map +1 -1
  421. package/dist/attributes/shape/shaders/uniforms.js +0 -0
  422. package/dist/attributes/shape/shaders/uniforms.js.map +1 -1
  423. package/dist/attributes/shape/shadow/shadow.d.ts +3 -20
  424. package/dist/attributes/shape/shadow/shadow.d.ts.map +1 -1
  425. package/dist/attributes/shape/shadow/shadow.js +0 -3
  426. package/dist/attributes/shape/shadow/shadow.js.map +1 -1
  427. package/dist/attributes/shape/stroke/stroke.d.ts +9 -58
  428. package/dist/attributes/shape/stroke/stroke.d.ts.map +1 -1
  429. package/dist/attributes/shape/stroke/stroke.js +0 -6
  430. package/dist/attributes/shape/stroke/stroke.js.map +1 -1
  431. package/dist/attributes/shared/operators.d.ts +1 -8
  432. package/dist/attributes/shared/operators.d.ts.map +1 -1
  433. package/dist/attributes/shared/operators.js.map +1 -1
  434. package/dist/attributes/text/index.d.ts +1 -11
  435. package/dist/attributes/text/index.d.ts.map +1 -1
  436. package/dist/attributes/text/index.js +1 -11
  437. package/dist/attributes/text/index.js.map +1 -1
  438. package/dist/attributes/text/ops.d.ts +4 -30
  439. package/dist/attributes/text/ops.d.ts.map +1 -1
  440. package/dist/attributes/text/ops.js +7 -23
  441. package/dist/attributes/text/ops.js.map +1 -1
  442. package/dist/attributes/text/types.d.ts +5 -28
  443. package/dist/attributes/text/types.d.ts.map +1 -1
  444. package/dist/attributes/text/types.js.map +1 -1
  445. package/dist/browser/chunks/chunk-5GLXFSCC.js +13 -0
  446. package/dist/browser/chunks/chunk-5GLXFSCC.js.map +7 -0
  447. package/dist/browser/chunks/{chunk-CCGVIR4F.js → chunk-5TDMGUXQ.js} +3 -3
  448. package/dist/browser/chunks/chunk-5TDMGUXQ.js.map +7 -0
  449. package/dist/browser/chunks/{chunk-4BDLFEOC.js → chunk-GEJEQQER.js} +1 -1
  450. package/dist/browser/chunks/chunk-GEJEQQER.js.map +7 -0
  451. package/dist/browser/chunks/chunk-MNMIIGNE.js +6 -0
  452. package/dist/browser/chunks/chunk-MNMIIGNE.js.map +7 -0
  453. package/dist/browser/component.js +1 -1
  454. package/dist/browser/experimental.js +1 -1
  455. package/dist/browser/index.js +1 -1
  456. package/dist/browser/index.js.map +4 -4
  457. package/dist/browser/manifest.json +1 -1
  458. package/dist/browser/sdk.js +1 -1
  459. package/dist/component.d.ts +3 -10
  460. package/dist/component.d.ts.map +1 -1
  461. package/dist/component.js +3 -10
  462. package/dist/component.js.map +1 -1
  463. package/dist/components/builtins/geometry/geometry.d.ts +15 -62
  464. package/dist/components/builtins/geometry/geometry.d.ts.map +1 -1
  465. package/dist/components/builtins/geometry/geometry.js.map +1 -1
  466. package/dist/components/builtins/geometry/shape-outline.d.ts +12 -61
  467. package/dist/components/builtins/geometry/shape-outline.d.ts.map +1 -1
  468. package/dist/components/builtins/geometry/shape-outline.js +29 -168
  469. package/dist/components/builtins/geometry/shape-outline.js.map +1 -1
  470. package/dist/components/builtins/layout/layout.d.ts +1 -14
  471. package/dist/components/builtins/layout/layout.d.ts.map +1 -1
  472. package/dist/components/builtins/layout/layout.js.map +1 -1
  473. package/dist/components/builtins/media/media.d.ts +11 -51
  474. package/dist/components/builtins/media/media.d.ts.map +1 -1
  475. package/dist/components/builtins/media/media.js +3 -7
  476. package/dist/components/builtins/media/media.js.map +1 -1
  477. package/dist/components/builtins/text/number-format.d.ts +14 -47
  478. package/dist/components/builtins/text/number-format.d.ts.map +1 -1
  479. package/dist/components/builtins/text/number-format.js +19 -69
  480. package/dist/components/builtins/text/number-format.js.map +1 -1
  481. package/dist/components/builtins/text/number-pattern.d.ts +3 -37
  482. package/dist/components/builtins/text/number-pattern.d.ts.map +1 -1
  483. package/dist/components/builtins/text/number-pattern.js +6 -48
  484. package/dist/components/builtins/text/number-pattern.js.map +1 -1
  485. package/dist/components/builtins/text/text-defaults.d.ts +7 -25
  486. package/dist/components/builtins/text/text-defaults.d.ts.map +1 -1
  487. package/dist/components/builtins/text/text-defaults.js +7 -25
  488. package/dist/components/builtins/text/text-defaults.js.map +1 -1
  489. package/dist/components/builtins/text/text-layout.d.ts +2 -11
  490. package/dist/components/builtins/text/text-layout.d.ts.map +1 -1
  491. package/dist/components/builtins/text/text-layout.js +7 -22
  492. package/dist/components/builtins/text/text-layout.js.map +1 -1
  493. package/dist/components/builtins/text/text.d.ts +8 -46
  494. package/dist/components/builtins/text/text.d.ts.map +1 -1
  495. package/dist/components/builtins/text/text.js.map +1 -1
  496. package/dist/components/builtins/three/canvas3d.d.ts +6 -51
  497. package/dist/components/builtins/three/canvas3d.d.ts.map +1 -1
  498. package/dist/components/builtins/three/canvas3d.js.map +1 -1
  499. package/dist/components/builtins/three/grid-geometry3d.d.ts +3 -39
  500. package/dist/components/builtins/three/grid-geometry3d.d.ts.map +1 -1
  501. package/dist/components/builtins/three/grid-geometry3d.js +8 -46
  502. package/dist/components/builtins/three/grid-geometry3d.js.map +1 -1
  503. package/dist/components/builtins/three/three.d.ts +22 -117
  504. package/dist/components/builtins/three/three.d.ts.map +1 -1
  505. package/dist/components/builtins/three/three.js +5 -17
  506. package/dist/components/builtins/three/three.js.map +1 -1
  507. package/dist/components/factory/api.d.ts.map +1 -1
  508. package/dist/components/factory/api.js.map +1 -1
  509. package/dist/components/factory/style.d.ts +38 -0
  510. package/dist/components/factory/style.d.ts.map +1 -0
  511. package/dist/components/factory/style.js +104 -0
  512. package/dist/components/factory/style.js.map +1 -0
  513. package/dist/components/factory/types.d.ts +9 -0
  514. package/dist/components/factory/types.d.ts.map +1 -1
  515. package/dist/components/factory/types.js +11 -0
  516. package/dist/components/factory/types.js.map +1 -1
  517. package/dist/components/factory/views.d.ts.map +1 -1
  518. package/dist/components/factory/views.js +0 -2
  519. package/dist/components/factory/views.js.map +1 -1
  520. package/dist/components/trees/2d/group-bounds.d.ts +12 -41
  521. package/dist/components/trees/2d/group-bounds.d.ts.map +1 -1
  522. package/dist/components/trees/2d/group-bounds.js +3 -22
  523. package/dist/components/trees/2d/group-bounds.js.map +1 -1
  524. package/dist/components/trees/2d/node-lifecycle.d.ts +8 -36
  525. package/dist/components/trees/2d/node-lifecycle.d.ts.map +1 -1
  526. package/dist/components/trees/2d/node-lifecycle.js +35 -127
  527. package/dist/components/trees/2d/node-lifecycle.js.map +1 -1
  528. package/dist/components/trees/2d/node-motion.d.ts +4 -36
  529. package/dist/components/trees/2d/node-motion.d.ts.map +1 -1
  530. package/dist/components/trees/2d/node-motion.js +3 -31
  531. package/dist/components/trees/2d/node-motion.js.map +1 -1
  532. package/dist/components/trees/2d/node-render.d.ts +3 -20
  533. package/dist/components/trees/2d/node-render.d.ts.map +1 -1
  534. package/dist/components/trees/2d/node-render.js +4 -23
  535. package/dist/components/trees/2d/node-render.js.map +1 -1
  536. package/dist/components/trees/2d/node-space.d.ts +4 -23
  537. package/dist/components/trees/2d/node-space.d.ts.map +1 -1
  538. package/dist/components/trees/2d/node-space.js +3 -17
  539. package/dist/components/trees/2d/node-space.js.map +1 -1
  540. package/dist/components/trees/2d/node-transform.d.ts +4 -33
  541. package/dist/components/trees/2d/node-transform.d.ts.map +1 -1
  542. package/dist/components/trees/2d/node-transform.js +4 -33
  543. package/dist/components/trees/2d/node-transform.js.map +1 -1
  544. package/dist/components/trees/2d/node2d.d.ts +112 -622
  545. package/dist/components/trees/2d/node2d.d.ts.map +1 -1
  546. package/dist/components/trees/2d/node2d.js +131 -605
  547. package/dist/components/trees/2d/node2d.js.map +1 -1
  548. package/dist/components/trees/audio/node-audio.d.ts +17 -65
  549. package/dist/components/trees/audio/node-audio.d.ts.map +1 -1
  550. package/dist/components/trees/audio/node-audio.js +18 -68
  551. package/dist/components/trees/audio/node-audio.js.map +1 -1
  552. package/dist/components/trees/node/node-editor-state.d.ts +5 -45
  553. package/dist/components/trees/node/node-editor-state.d.ts.map +1 -1
  554. package/dist/components/trees/node/node-editor-state.js +1 -13
  555. package/dist/components/trees/node/node-editor-state.js.map +1 -1
  556. package/dist/components/trees/node/node-reactive.d.ts +6 -53
  557. package/dist/components/trees/node/node-reactive.d.ts.map +1 -1
  558. package/dist/components/trees/node/node-reactive.js +4 -33
  559. package/dist/components/trees/node/node-reactive.js.map +1 -1
  560. package/dist/components/trees/node/node-time.d.ts +2 -15
  561. package/dist/components/trees/node/node-time.d.ts.map +1 -1
  562. package/dist/components/trees/node/node-time.js.map +1 -1
  563. package/dist/components/trees/node/node-walk.d.ts +7 -32
  564. package/dist/components/trees/node/node-walk.d.ts.map +1 -1
  565. package/dist/components/trees/node/node-walk.js +7 -32
  566. package/dist/components/trees/node/node-walk.js.map +1 -1
  567. package/dist/components/trees/node/node.d.ts +43 -248
  568. package/dist/components/trees/node/node.d.ts.map +1 -1
  569. package/dist/components/trees/node/node.js +51 -229
  570. package/dist/components/trees/node/node.js.map +1 -1
  571. package/dist/components/trees/root/canvas2d-node.d.ts +7 -60
  572. package/dist/components/trees/root/canvas2d-node.d.ts.map +1 -1
  573. package/dist/components/trees/root/canvas2d-node.js +7 -47
  574. package/dist/components/trees/root/canvas2d-node.js.map +1 -1
  575. package/dist/components/trees/three/node3d.d.ts +24 -112
  576. package/dist/components/trees/three/node3d.d.ts.map +1 -1
  577. package/dist/components/trees/three/node3d.js +22 -104
  578. package/dist/components/trees/three/node3d.js.map +1 -1
  579. package/dist/document/audio.d.ts +9 -21
  580. package/dist/document/audio.d.ts.map +1 -1
  581. package/dist/document/audio.js +13 -28
  582. package/dist/document/audio.js.map +1 -1
  583. package/dist/document/builtins.d.ts +3 -9
  584. package/dist/document/builtins.d.ts.map +1 -1
  585. package/dist/document/builtins.js +43 -89
  586. package/dist/document/builtins.js.map +1 -1
  587. package/dist/document/command-traits.d.ts +14 -37
  588. package/dist/document/command-traits.d.ts.map +1 -1
  589. package/dist/document/command-traits.js +22 -39
  590. package/dist/document/command-traits.js.map +1 -1
  591. package/dist/document/deny-globals.d.ts +9 -43
  592. package/dist/document/deny-globals.d.ts.map +1 -1
  593. package/dist/document/deny-globals.js +18 -58
  594. package/dist/document/deny-globals.js.map +1 -1
  595. package/dist/document/diff.d.ts +6 -16
  596. package/dist/document/diff.d.ts.map +1 -1
  597. package/dist/document/diff.js +5 -11
  598. package/dist/document/diff.js.map +1 -1
  599. package/dist/document/doc-index.d.ts +5 -13
  600. package/dist/document/doc-index.d.ts.map +1 -1
  601. package/dist/document/doc-index.js +0 -2
  602. package/dist/document/doc-index.js.map +1 -1
  603. package/dist/document/expression/compile.d.ts +2 -2
  604. package/dist/document/expression/compile.d.ts.map +1 -1
  605. package/dist/document/expression/compile.js +8 -18
  606. package/dist/document/expression/compile.js.map +1 -1
  607. package/dist/document/expression/index.d.ts +11 -41
  608. package/dist/document/expression/index.d.ts.map +1 -1
  609. package/dist/document/expression/index.js +11 -41
  610. package/dist/document/expression/index.js.map +1 -1
  611. package/dist/document/expression/ops.d.ts +3 -12
  612. package/dist/document/expression/ops.d.ts.map +1 -1
  613. package/dist/document/expression/ops.js +4 -20
  614. package/dist/document/expression/ops.js.map +1 -1
  615. package/dist/document/expression/parse.d.ts +4 -14
  616. package/dist/document/expression/parse.d.ts.map +1 -1
  617. package/dist/document/expression/parse.js +34 -55
  618. package/dist/document/expression/parse.js.map +1 -1
  619. package/dist/document/expression/refs.d.ts +2 -8
  620. package/dist/document/expression/refs.d.ts.map +1 -1
  621. package/dist/document/expression/refs.js +2 -6
  622. package/dist/document/expression/refs.js.map +1 -1
  623. package/dist/document/expression/types.d.ts +18 -63
  624. package/dist/document/expression/types.d.ts.map +1 -1
  625. package/dist/document/expression/types.js +4 -15
  626. package/dist/document/expression/types.js.map +1 -1
  627. package/dist/document/expression/walk.d.ts +6 -20
  628. package/dist/document/expression/walk.d.ts.map +1 -1
  629. package/dist/document/expression/walk.js +18 -44
  630. package/dist/document/expression/walk.js.map +1 -1
  631. package/dist/document/index.js +2 -3
  632. package/dist/document/index.js.map +1 -1
  633. package/dist/document/migrate.d.ts +7 -22
  634. package/dist/document/migrate.d.ts.map +1 -1
  635. package/dist/document/migrate.js +44 -15
  636. package/dist/document/migrate.js.map +1 -1
  637. package/dist/document/missing-node.d.ts +4 -11
  638. package/dist/document/missing-node.d.ts.map +1 -1
  639. package/dist/document/missing-node.js +2 -5
  640. package/dist/document/missing-node.js.map +1 -1
  641. package/dist/document/node-decorator.d.ts +12 -53
  642. package/dist/document/node-decorator.d.ts.map +1 -1
  643. package/dist/document/node-decorator.js +16 -57
  644. package/dist/document/node-decorator.js.map +1 -1
  645. package/dist/document/node-descriptor.d.ts +25 -62
  646. package/dist/document/node-descriptor.d.ts.map +1 -1
  647. package/dist/document/node-descriptor.js.map +1 -1
  648. package/dist/document/placement.d.ts +18 -41
  649. package/dist/document/placement.d.ts.map +1 -1
  650. package/dist/document/placement.js +4 -11
  651. package/dist/document/placement.js.map +1 -1
  652. package/dist/document/project.d.ts +19 -52
  653. package/dist/document/project.d.ts.map +1 -1
  654. package/dist/document/project.js +2 -6
  655. package/dist/document/project.js.map +1 -1
  656. package/dist/document/prop-evolution.d.ts +10 -20
  657. package/dist/document/prop-evolution.d.ts.map +1 -1
  658. package/dist/document/prop-evolution.js +3 -7
  659. package/dist/document/prop-evolution.js.map +1 -1
  660. package/dist/document/registry.d.ts +80 -318
  661. package/dist/document/registry.d.ts.map +1 -1
  662. package/dist/document/registry.js +43 -147
  663. package/dist/document/registry.js.map +1 -1
  664. package/dist/document/settled-index.d.ts +11 -23
  665. package/dist/document/settled-index.d.ts.map +1 -1
  666. package/dist/document/settled-index.js +15 -34
  667. package/dist/document/settled-index.js.map +1 -1
  668. package/dist/document/timeline-patch.d.ts +6 -15
  669. package/dist/document/timeline-patch.d.ts.map +1 -1
  670. package/dist/document/timeline-patch.js +12 -21
  671. package/dist/document/timeline-patch.js.map +1 -1
  672. package/dist/document/timeline.d.ts +56 -263
  673. package/dist/document/timeline.d.ts.map +1 -1
  674. package/dist/document/timeline.js +71 -275
  675. package/dist/document/timeline.js.map +1 -1
  676. package/dist/document/types.d.ts +90 -264
  677. package/dist/document/types.d.ts.map +1 -1
  678. package/dist/document/types.js +13 -30
  679. package/dist/document/types.js.map +1 -1
  680. package/dist/document/validate.d.ts +10 -40
  681. package/dist/document/validate.d.ts.map +1 -1
  682. package/dist/document/validate.js +72 -137
  683. package/dist/document/validate.js.map +1 -1
  684. package/dist/document/vocabulary.d.ts +4 -7
  685. package/dist/document/vocabulary.d.ts.map +1 -1
  686. package/dist/document/vocabulary.js +0 -1
  687. package/dist/document/vocabulary.js.map +1 -1
  688. package/dist/experimental.d.ts +2 -0
  689. package/dist/experimental.d.ts.map +1 -1
  690. package/dist/index.d.ts +0 -1
  691. package/dist/index.d.ts.map +1 -1
  692. package/dist/index.js +0 -1
  693. package/dist/index.js.map +1 -1
  694. package/dist/layout/bounds.d.ts +1 -11
  695. package/dist/layout/bounds.d.ts.map +1 -1
  696. package/dist/layout/bounds.js.map +1 -1
  697. package/dist/layout/flex.d.ts +6 -20
  698. package/dist/layout/flex.d.ts.map +1 -1
  699. package/dist/layout/flex.js +7 -28
  700. package/dist/layout/flex.js.map +1 -1
  701. package/dist/layout/ops.d.ts +2 -11
  702. package/dist/layout/ops.d.ts.map +1 -1
  703. package/dist/layout/ops.js +2 -22
  704. package/dist/layout/ops.js.map +1 -1
  705. package/dist/layout/types.d.ts +11 -55
  706. package/dist/layout/types.d.ts.map +1 -1
  707. package/dist/layout/types.js.map +1 -1
  708. package/dist/platform/audio-sink.d.ts +7 -43
  709. package/dist/platform/audio-sink.d.ts.map +1 -1
  710. package/dist/platform/audio-sink.js +4 -29
  711. package/dist/platform/audio-sink.js.map +1 -1
  712. package/dist/platform/exporter.d.ts +5 -31
  713. package/dist/platform/exporter.d.ts.map +1 -1
  714. package/dist/platform/exporter.js.map +1 -1
  715. package/dist/platform/stepped-clock.d.ts +1 -16
  716. package/dist/platform/stepped-clock.d.ts.map +1 -1
  717. package/dist/platform/stepped-clock.js +1 -16
  718. package/dist/platform/stepped-clock.js.map +1 -1
  719. package/dist/platform/storage-adapter.d.ts +8 -68
  720. package/dist/platform/storage-adapter.d.ts.map +1 -1
  721. package/dist/platform/storage-adapter.js +8 -60
  722. package/dist/platform/storage-adapter.js.map +1 -1
  723. package/dist/platform/ticker.d.ts +11 -45
  724. package/dist/platform/ticker.d.ts.map +1 -1
  725. package/dist/platform/ticker.js +10 -37
  726. package/dist/platform/ticker.js.map +1 -1
  727. package/dist/project/config.d.ts +4 -14
  728. package/dist/project/config.d.ts.map +1 -1
  729. package/dist/project/config.js.map +1 -1
  730. package/dist/project/tree.d.ts +6 -35
  731. package/dist/project/tree.d.ts.map +1 -1
  732. package/dist/project/tree.js +1 -8
  733. package/dist/project/tree.js.map +1 -1
  734. package/dist/props/host.d.ts +2 -13
  735. package/dist/props/host.d.ts.map +1 -1
  736. package/dist/props/host.js.map +1 -1
  737. package/dist/props/layout.d.ts +1 -12
  738. package/dist/props/layout.d.ts.map +1 -1
  739. package/dist/props/layout.js +1 -12
  740. package/dist/props/layout.js.map +1 -1
  741. package/dist/props/observer.d.ts +1 -7
  742. package/dist/props/observer.d.ts.map +1 -1
  743. package/dist/props/observer.js.map +1 -1
  744. package/dist/props/slot.d.ts +6 -19
  745. package/dist/props/slot.d.ts.map +1 -1
  746. package/dist/props/slot.js +5 -14
  747. package/dist/props/slot.js.map +1 -1
  748. package/dist/render/canvas-render-context2d.d.ts +8 -68
  749. package/dist/render/canvas-render-context2d.d.ts.map +1 -1
  750. package/dist/render/canvas-render-context2d.js +8 -69
  751. package/dist/render/canvas-render-context2d.js.map +1 -1
  752. package/dist/render/clip-contains.d.ts +2 -16
  753. package/dist/render/clip-contains.d.ts.map +1 -1
  754. package/dist/render/clip-contains.js +21 -82
  755. package/dist/render/clip-contains.js.map +1 -1
  756. package/dist/render/clip.d.ts +7 -25
  757. package/dist/render/clip.d.ts.map +1 -1
  758. package/dist/render/clip.js +5 -17
  759. package/dist/render/clip.js.map +1 -1
  760. package/dist/render/descriptors/ellipse.d.ts.map +1 -1
  761. package/dist/render/descriptors/ellipse.js +0 -1
  762. package/dist/render/descriptors/ellipse.js.map +1 -1
  763. package/dist/render/descriptors/line.d.ts.map +1 -1
  764. package/dist/render/descriptors/line.js +0 -1
  765. package/dist/render/descriptors/line.js.map +1 -1
  766. package/dist/render/descriptors/path-builder.d.ts +4 -32
  767. package/dist/render/descriptors/path-builder.d.ts.map +1 -1
  768. package/dist/render/descriptors/path-builder.js +3 -25
  769. package/dist/render/descriptors/path-builder.js.map +1 -1
  770. package/dist/render/descriptors/path.d.ts +1 -11
  771. package/dist/render/descriptors/path.d.ts.map +1 -1
  772. package/dist/render/descriptors/path.js +0 -1
  773. package/dist/render/descriptors/path.js.map +1 -1
  774. package/dist/render/descriptors/polygon.d.ts.map +1 -1
  775. package/dist/render/descriptors/polygon.js +0 -1
  776. package/dist/render/descriptors/polygon.js.map +1 -1
  777. package/dist/render/descriptors/polygram.d.ts.map +1 -1
  778. package/dist/render/descriptors/polygram.js +0 -1
  779. package/dist/render/descriptors/polygram.js.map +1 -1
  780. package/dist/render/descriptors/rect.d.ts.map +1 -1
  781. package/dist/render/descriptors/rect.js +0 -1
  782. package/dist/render/descriptors/rect.js.map +1 -1
  783. package/dist/render/descriptors/richtext.d.ts.map +1 -1
  784. package/dist/render/descriptors/richtext.js +0 -1
  785. package/dist/render/descriptors/richtext.js.map +1 -1
  786. package/dist/render/descriptors/shape.d.ts +17 -77
  787. package/dist/render/descriptors/shape.d.ts.map +1 -1
  788. package/dist/render/descriptors/shape.js +13 -47
  789. package/dist/render/descriptors/shape.js.map +1 -1
  790. package/dist/render/descriptors/text.d.ts +15 -94
  791. package/dist/render/descriptors/text.d.ts.map +1 -1
  792. package/dist/render/descriptors/text.js +8 -50
  793. package/dist/render/descriptors/text.js.map +1 -1
  794. package/dist/render/descriptors/transform.d.ts +5 -16
  795. package/dist/render/descriptors/transform.d.ts.map +1 -1
  796. package/dist/render/descriptors/transform.js +1 -17
  797. package/dist/render/descriptors/transform.js.map +1 -1
  798. package/dist/render/graphics2d.d.ts +24 -116
  799. package/dist/render/graphics2d.d.ts.map +1 -1
  800. package/dist/render/graphics2d.js +23 -108
  801. package/dist/render/graphics2d.js.map +1 -1
  802. package/dist/render/measure-context.d.ts +5 -29
  803. package/dist/render/measure-context.d.ts.map +1 -1
  804. package/dist/render/measure-context.js.map +1 -1
  805. package/dist/render/null-render-context.d.ts +2 -20
  806. package/dist/render/null-render-context.d.ts.map +1 -1
  807. package/dist/render/null-render-context.js +2 -20
  808. package/dist/render/null-render-context.js.map +1 -1
  809. package/dist/render/render-context2d.d.ts +52 -208
  810. package/dist/render/render-context2d.d.ts.map +1 -1
  811. package/dist/render/render-context2d.js.map +1 -1
  812. package/dist/render/surface.d.ts +2 -19
  813. package/dist/render/surface.d.ts.map +1 -1
  814. package/dist/render/surface.js.map +1 -1
  815. package/dist/render/text-defaults.d.ts +1 -17
  816. package/dist/render/text-defaults.d.ts.map +1 -1
  817. package/dist/render/text-defaults.js +6 -40
  818. package/dist/render/text-defaults.js.map +1 -1
  819. package/dist/render/text-layout.d.ts +12 -55
  820. package/dist/render/text-layout.d.ts.map +1 -1
  821. package/dist/render/text-layout.js +2 -16
  822. package/dist/render/text-layout.js.map +1 -1
  823. package/dist/render3d/bounds3d.d.ts +10 -32
  824. package/dist/render3d/bounds3d.d.ts.map +1 -1
  825. package/dist/render3d/bounds3d.js +2 -12
  826. package/dist/render3d/bounds3d.js.map +1 -1
  827. package/dist/render3d/builders.d.ts +8 -35
  828. package/dist/render3d/builders.d.ts.map +1 -1
  829. package/dist/render3d/builders.js +8 -35
  830. package/dist/render3d/builders.js.map +1 -1
  831. package/dist/render3d/camera.d.ts +10 -57
  832. package/dist/render3d/camera.d.ts.map +1 -1
  833. package/dist/render3d/camera.js +4 -26
  834. package/dist/render3d/camera.js.map +1 -1
  835. package/dist/render3d/fill3d.d.ts +7 -45
  836. package/dist/render3d/fill3d.d.ts.map +1 -1
  837. package/dist/render3d/fill3d.js +15 -85
  838. package/dist/render3d/fill3d.js.map +1 -1
  839. package/dist/render3d/geometry.d.ts +18 -106
  840. package/dist/render3d/geometry.d.ts.map +1 -1
  841. package/dist/render3d/geometry.js +2 -20
  842. package/dist/render3d/geometry.js.map +1 -1
  843. package/dist/render3d/graphics3d.d.ts +29 -133
  844. package/dist/render3d/graphics3d.d.ts.map +1 -1
  845. package/dist/render3d/graphics3d.js +23 -110
  846. package/dist/render3d/graphics3d.js.map +1 -1
  847. package/dist/render3d/index.d.ts +1 -16
  848. package/dist/render3d/index.d.ts.map +1 -1
  849. package/dist/render3d/index.js +1 -16
  850. package/dist/render3d/index.js.map +1 -1
  851. package/dist/render3d/inert.d.ts.map +1 -1
  852. package/dist/render3d/inert.js +1 -14
  853. package/dist/render3d/inert.js.map +1 -1
  854. package/dist/render3d/light.d.ts +3 -26
  855. package/dist/render3d/light.d.ts.map +1 -1
  856. package/dist/render3d/light.js.map +1 -1
  857. package/dist/render3d/material.d.ts +13 -87
  858. package/dist/render3d/material.d.ts.map +1 -1
  859. package/dist/render3d/material.js +2 -16
  860. package/dist/render3d/material.js.map +1 -1
  861. package/dist/render3d/matrix4.d.ts +14 -68
  862. package/dist/render3d/matrix4.d.ts.map +1 -1
  863. package/dist/render3d/matrix4.js +11 -60
  864. package/dist/render3d/matrix4.js.map +1 -1
  865. package/dist/render3d/render-context3d.d.ts +13 -51
  866. package/dist/render3d/render-context3d.d.ts.map +1 -1
  867. package/dist/render3d/render-context3d.js +9 -21
  868. package/dist/render3d/render-context3d.js.map +1 -1
  869. package/dist/render3d/resources.d.ts +9 -53
  870. package/dist/render3d/resources.d.ts.map +1 -1
  871. package/dist/render3d/resources.js +8 -48
  872. package/dist/render3d/resources.js.map +1 -1
  873. package/dist/render3d/rounded-box.d.ts +7 -21
  874. package/dist/render3d/rounded-box.d.ts.map +1 -1
  875. package/dist/render3d/rounded-box.js +7 -46
  876. package/dist/render3d/rounded-box.js.map +1 -1
  877. package/dist/render3d/scene-settings.d.ts +20 -78
  878. package/dist/render3d/scene-settings.d.ts.map +1 -1
  879. package/dist/render3d/scene-settings.js.map +1 -1
  880. package/dist/render3d/scene3d.d.ts +11 -53
  881. package/dist/render3d/scene3d.d.ts.map +1 -1
  882. package/dist/render3d/scene3d.js +12 -59
  883. package/dist/render3d/scene3d.js.map +1 -1
  884. package/dist/render3d/segments.d.ts +2 -25
  885. package/dist/render3d/segments.d.ts.map +1 -1
  886. package/dist/render3d/segments.js +1 -11
  887. package/dist/render3d/segments.js.map +1 -1
  888. package/dist/render3d/texture.d.ts +25 -112
  889. package/dist/render3d/texture.d.ts.map +1 -1
  890. package/dist/render3d/texture.js +3 -27
  891. package/dist/render3d/texture.js.map +1 -1
  892. package/dist/render3d/tracking.d.ts +2 -19
  893. package/dist/render3d/tracking.d.ts.map +1 -1
  894. package/dist/render3d/tracking.js +2 -19
  895. package/dist/render3d/tracking.js.map +1 -1
  896. package/dist/render3d/transform.d.ts +14 -60
  897. package/dist/render3d/transform.d.ts.map +1 -1
  898. package/dist/render3d/transform.js +0 -2
  899. package/dist/render3d/transform.js.map +1 -1
  900. package/dist/render3d/vector3.d.ts +6 -48
  901. package/dist/render3d/vector3.d.ts.map +1 -1
  902. package/dist/render3d/vector3.js +4 -38
  903. package/dist/render3d/vector3.js.map +1 -1
  904. package/dist/render3d/walk.d.ts +3 -27
  905. package/dist/render3d/walk.d.ts.map +1 -1
  906. package/dist/render3d/walk.js +5 -33
  907. package/dist/render3d/walk.js.map +1 -1
  908. package/dist/runtime/asset-refine.d.ts +34 -20
  909. package/dist/runtime/asset-refine.d.ts.map +1 -1
  910. package/dist/runtime/asset-refine.js +127 -31
  911. package/dist/runtime/asset-refine.js.map +1 -1
  912. package/dist/runtime/asset-timeline.d.ts +14 -53
  913. package/dist/runtime/asset-timeline.d.ts.map +1 -1
  914. package/dist/runtime/asset-timeline.js +6 -27
  915. package/dist/runtime/asset-timeline.js.map +1 -1
  916. package/dist/runtime/asset-update.d.ts +7 -26
  917. package/dist/runtime/asset-update.d.ts.map +1 -1
  918. package/dist/runtime/asset-update.js +6 -18
  919. package/dist/runtime/asset-update.js.map +1 -1
  920. package/dist/runtime/audio-index.d.ts +0 -2
  921. package/dist/runtime/audio-index.d.ts.map +1 -1
  922. package/dist/runtime/audio-index.js +0 -2
  923. package/dist/runtime/audio-index.js.map +1 -1
  924. package/dist/runtime/builtin-context.d.ts +3 -9
  925. package/dist/runtime/builtin-context.d.ts.map +1 -1
  926. package/dist/runtime/builtin-context.js +3 -9
  927. package/dist/runtime/builtin-context.js.map +1 -1
  928. package/dist/runtime/clip-instance.d.ts +12 -39
  929. package/dist/runtime/clip-instance.d.ts.map +1 -1
  930. package/dist/runtime/clip-instance.js +21 -45
  931. package/dist/runtime/clip-instance.js.map +1 -1
  932. package/dist/runtime/clip-store.d.ts +26 -68
  933. package/dist/runtime/clip-store.d.ts.map +1 -1
  934. package/dist/runtime/clip-store.js +47 -81
  935. package/dist/runtime/clip-store.js.map +1 -1
  936. package/dist/runtime/engine.d.ts +31 -85
  937. package/dist/runtime/engine.d.ts.map +1 -1
  938. package/dist/runtime/engine.js +16 -49
  939. package/dist/runtime/engine.js.map +1 -1
  940. package/dist/runtime/frame-time.d.ts +4 -15
  941. package/dist/runtime/frame-time.d.ts.map +1 -1
  942. package/dist/runtime/frame-time.js +5 -12
  943. package/dist/runtime/frame-time.js.map +1 -1
  944. package/dist/runtime/index.d.ts +0 -1
  945. package/dist/runtime/index.d.ts.map +1 -1
  946. package/dist/runtime/index.js +0 -1
  947. package/dist/runtime/index.js.map +1 -1
  948. package/dist/runtime/node-picking.d.ts +59 -139
  949. package/dist/runtime/node-picking.d.ts.map +1 -1
  950. package/dist/runtime/node-picking.js +87 -157
  951. package/dist/runtime/node-picking.js.map +1 -1
  952. package/dist/runtime/node-picking3d.d.ts +39 -96
  953. package/dist/runtime/node-picking3d.d.ts.map +1 -1
  954. package/dist/runtime/node-picking3d.js +98 -141
  955. package/dist/runtime/node-picking3d.js.map +1 -1
  956. package/dist/runtime/placement.d.ts +8 -17
  957. package/dist/runtime/placement.d.ts.map +1 -1
  958. package/dist/runtime/placement.js +7 -16
  959. package/dist/runtime/placement.js.map +1 -1
  960. package/dist/runtime/playback-controller.d.ts +78 -207
  961. package/dist/runtime/playback-controller.d.ts.map +1 -1
  962. package/dist/runtime/playback-controller.js +111 -226
  963. package/dist/runtime/playback-controller.js.map +1 -1
  964. package/dist/runtime/playback.d.ts +6 -14
  965. package/dist/runtime/playback.d.ts.map +1 -1
  966. package/dist/runtime/playback.js +6 -14
  967. package/dist/runtime/playback.js.map +1 -1
  968. package/dist/runtime/project-assets.d.ts +6 -14
  969. package/dist/runtime/project-assets.d.ts.map +1 -1
  970. package/dist/runtime/project-assets.js +7 -16
  971. package/dist/runtime/project-assets.js.map +1 -1
  972. package/dist/runtime/session.d.ts +22 -45
  973. package/dist/runtime/session.d.ts.map +1 -1
  974. package/dist/runtime/session.js +26 -46
  975. package/dist/runtime/session.js.map +1 -1
  976. package/dist/runtime/settle.d.ts +4 -10
  977. package/dist/runtime/settle.d.ts.map +1 -1
  978. package/dist/runtime/settle.js +4 -10
  979. package/dist/runtime/settle.js.map +1 -1
  980. package/dist/runtime/state-evaluator.d.ts +15 -37
  981. package/dist/runtime/state-evaluator.d.ts.map +1 -1
  982. package/dist/runtime/state-evaluator.js +27 -44
  983. package/dist/runtime/state-evaluator.js.map +1 -1
  984. package/dist/runtime/text-geometry.d.ts +18 -47
  985. package/dist/runtime/text-geometry.d.ts.map +1 -1
  986. package/dist/runtime/text-geometry.js +13 -27
  987. package/dist/runtime/text-geometry.js.map +1 -1
  988. package/dist/sdk/index.d.ts +2 -7
  989. package/dist/sdk/index.d.ts.map +1 -1
  990. package/dist/sdk/index.js +30 -138
  991. package/dist/sdk/index.js.map +1 -1
  992. package/dist/tween/command-decorator.d.ts +6 -26
  993. package/dist/tween/command-decorator.d.ts.map +1 -1
  994. package/dist/tween/command-decorator.js +1 -6
  995. package/dist/tween/command-decorator.js.map +1 -1
  996. package/dist/tween/command.d.ts +6 -53
  997. package/dist/tween/command.d.ts.map +1 -1
  998. package/dist/tween/command.js +5 -40
  999. package/dist/tween/command.js.map +1 -1
  1000. package/dist/tween/ease/curve.d.ts +2 -17
  1001. package/dist/tween/ease/curve.d.ts.map +1 -1
  1002. package/dist/tween/ease/curve.js +1 -6
  1003. package/dist/tween/ease/curve.js.map +1 -1
  1004. package/dist/tween/ease/describe.d.ts +0 -11
  1005. package/dist/tween/ease/describe.d.ts.map +1 -1
  1006. package/dist/tween/ease/describe.js +0 -23
  1007. package/dist/tween/ease/describe.js.map +1 -1
  1008. package/dist/tween/ease/spec.d.ts +2 -18
  1009. package/dist/tween/ease/spec.d.ts.map +1 -1
  1010. package/dist/tween/ease/spec.js.map +1 -1
  1011. package/dist/tween/inert.d.ts +1 -14
  1012. package/dist/tween/inert.d.ts.map +1 -1
  1013. package/dist/tween/inert.js +1 -14
  1014. package/dist/tween/inert.js.map +1 -1
  1015. package/dist/tween/lerp.d.ts +2 -26
  1016. package/dist/tween/lerp.d.ts.map +1 -1
  1017. package/dist/tween/lerp.js +2 -26
  1018. package/dist/tween/lerp.js.map +1 -1
  1019. package/dist/tween/loop.d.ts +9 -50
  1020. package/dist/tween/loop.d.ts.map +1 -1
  1021. package/dist/tween/loop.js +6 -31
  1022. package/dist/tween/loop.js.map +1 -1
  1023. package/dist/tween/prepare.d.ts +2 -30
  1024. package/dist/tween/prepare.d.ts.map +1 -1
  1025. package/dist/tween/prepare.js +2 -30
  1026. package/dist/tween/prepare.js.map +1 -1
  1027. package/dist/tween/stepper.d.ts +4 -25
  1028. package/dist/tween/stepper.d.ts.map +1 -1
  1029. package/dist/tween/stepper.js.map +1 -1
  1030. package/dist/tween/to-command.d.ts +1 -8
  1031. package/dist/tween/to-command.d.ts.map +1 -1
  1032. package/dist/tween/to-command.js +2 -25
  1033. package/dist/tween/to-command.js.map +1 -1
  1034. package/dist/util/context.d.ts +4 -29
  1035. package/dist/util/context.d.ts.map +1 -1
  1036. package/dist/util/context.js +3 -15
  1037. package/dist/util/context.js.map +1 -1
  1038. package/dist/util/csv.d.ts +4 -29
  1039. package/dist/util/csv.d.ts.map +1 -1
  1040. package/dist/util/csv.js +3 -22
  1041. package/dist/util/csv.js.map +1 -1
  1042. package/dist/util/metrics.d.ts +2 -26
  1043. package/dist/util/metrics.d.ts.map +1 -1
  1044. package/dist/util/metrics.js +2 -26
  1045. package/dist/util/metrics.js.map +1 -1
  1046. package/dist/util/random.d.ts +20 -87
  1047. package/dist/util/random.d.ts.map +1 -1
  1048. package/dist/util/random.js +20 -87
  1049. package/dist/util/random.js.map +1 -1
  1050. package/dist/util/reference.d.ts +6 -35
  1051. package/dist/util/reference.d.ts.map +1 -1
  1052. package/dist/util/reference.js +1 -4
  1053. package/dist/util/reference.js.map +1 -1
  1054. package/dist/util/scheduler.d.ts +6 -27
  1055. package/dist/util/scheduler.d.ts.map +1 -1
  1056. package/dist/util/scheduler.js +8 -35
  1057. package/dist/util/scheduler.js.map +1 -1
  1058. package/package.json +1 -1
  1059. package/dist/browser/chunks/chunk-4BDLFEOC.js.map +0 -7
  1060. package/dist/browser/chunks/chunk-CCGVIR4F.js.map +0 -7
  1061. package/dist/browser/chunks/chunk-N4WSN5WY.js +0 -13
  1062. package/dist/browser/chunks/chunk-N4WSN5WY.js.map +0 -7
  1063. package/dist/browser/chunks/chunk-WZSI3GSK.js +0 -6
  1064. package/dist/browser/chunks/chunk-WZSI3GSK.js.map +0 -7
  1065. package/dist/renamed-scene-names.d.ts +0 -17
  1066. package/dist/renamed-scene-names.d.ts.map +0 -1
  1067. package/dist/renamed-scene-names.js +0 -9
  1068. package/dist/renamed-scene-names.js.map +0 -1
  1069. package/dist/runtime/precompisition.d.ts +0 -24
  1070. package/dist/runtime/precompisition.d.ts.map +0 -1
  1071. package/dist/runtime/precompisition.js +0 -7
  1072. package/dist/runtime/precompisition.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../src/attributes/audio/request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAChF,OAAO,EAAY,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAiB,KAAK,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEpF;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,YAAY;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,2FAA2F;IAC3F,MAAM,EAAE,KAAK,CAAC;IACd,oCAAoC;IACpC,GAAG,EAAE,KAAK,CAAC;IACX,IAAI,EAAE,OAAO,CAAC;IACd,6DAA6D;IAC7D,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B,aAAa,CAAC,EAAE,eAAe,CAAC;IAChC;;;;;OAKG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAErD;AAED,MAAM,WAAW,WAAW;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,IAAI,CAAC,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AEhC,+LAA+L;IAC/L,GAAG,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;IAE9B,wMAAwM;IACxM,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,oLAAoL;IACpL,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB"}
@@ -1,10 +1,7 @@
1
1
  import { effectsKey } from "../../attributes/audio/effects/union.js";
2
2
  import { paramKey } from "../../attributes/audio/ramp.js";
3
3
  import { transitionKey } from "../../attributes/audio/transition.js";
4
- /**
5
- * Everything about a stop that changes what passes through it, as a string — so
6
- * a device can tell an edited bus from the one it already built.
7
- */
4
+ /** Everything about a stop that changes what passes through it, as a string, so a device can tell an edited bus from the one it built. */
8
5
  export function busStopKey(stop) {
9
6
  return `${stop.id}:${paramKey(stop.volume)}:${paramKey(stop.pan)}:${stop.mute ? 1 : 0}:${effectsKey(stop.effects)}:${transitionKey(stop.transitionIn)}:${transitionKey(stop.transitionOut)}:${stop.startAt}:${stop.endAt}`;
10
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/attributes/audio/request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAoB,MAAM,kCAAkC,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAc,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAwB,MAAM,+BAA+B,CAAC;AAmCpF;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,IAAkB;IACzC,OAAO,GAAG,IAAI,CAAC,EAAE,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;AAC/N,CAAC","sourcesContent":["import { effectsKey, type AudioEffect } from \"@/attributes/audio/effects/union\";\nimport { paramKey, type Param } from \"@/attributes/audio/ramp\";\nimport { transitionKey, type AudioTransition } from \"@/attributes/audio/transition\";\n\n/**\n * One bus a clip's signal passes through on its way to the master.\n *\n * A flattened snapshot of an {@link AudioBus} node, not a reference to it: core\n * describes what the graph should be and a platform builds it, so what crosses\n * that seam has to be plain data.\n *\n * {@link id} is what makes it a *bus* rather than per-clip processing — two\n * clips naming the same id share one live chain, so a reverb on a bus is a\n * single tail fed by both, which is not the same sound as that reverb applied\n * to each clip separately.\n */\nexport interface AudioBusStop {\n id: string;\n /** Linear gain. A {@link Param}, so a bus fade is a ramp rather than a per-frame write. */\n volume: Param;\n /** -1 hard left … +1 hard right. */\n pan: Param;\n mute: boolean;\n /** Applied in array order, index 0 closest to the source. */\n effects?: AudioEffect[];\n transitionIn?: AudioTransition;\n transitionOut?: AudioTransition;\n /**\n * When the bus is present, in the same seconds as the request carrying the\n * stop: what a ramp in {@link volume} or {@link effects}, and its\n * transitions, run over, as a clip's run over the clip. Not the clip's span, because one bus\n * feeds many clips and its fade has to mean one thing to all of them.\n */\n startAt: number;\n endAt: number;\n}\n\n/**\n * Everything about a stop that changes what passes through it, as a string — so\n * a device can tell an edited bus from the one it already built.\n */\nexport function busStopKey(stop: AudioBusStop): string {\n return `${stop.id}:${paramKey(stop.volume)}:${paramKey(stop.pan)}:${stop.mute ? 1 : 0}:${effectsKey(stop.effects)}:${transitionKey(stop.transitionIn)}:${transitionKey(stop.transitionOut)}:${stop.startAt}:${stop.endAt}`;\n}\n\nexport interface AudioParams {\n src: string;\n volume?: Param;\n loop?: boolean;\n trimStart?: number; // in seconds\n trimEnd?: number; // in seconds\n effects?: AudioEffect[];\n}\n\nexport interface AudioRequest {\n id: string;\n /** The asset path or URL. ('src' is standard for media) */\n src: string;\n\n // --- Timeline Synchronization (Clip Time) ---\n\n /** The clip timestamp when the audio should START playing. */\n startAt: number; // in seconds\n\n /**\n * The clip timestamp when the audio should STOP playing.\n *\n * Always a number, and **`Infinity` is the open/unbounded sentinel** — never\n * `null` or `undefined`. An unstopped clip carries `Infinity` until\n * {@link open} resolution pins it to the project end.\n *\n * So test it with `Number.isFinite(endAt)`. A `?? Infinity` or `!== null`\n * guard is dead code that reads as if the field were nullable.\n */\n endAt: number; // in seconds\n\n /**\n * True when this request was started and left running at its scene's end —\n * neither explicitly stopped nor finite-trimmed. Open requests\n * are exempt from the per-scene audio clamp and instead **continue across scene\n * boundaries**: `assembleTimeline` shifts them to absolute time and resolves\n * `endAt = min(startAt + mediaDuration, projectTotalDuration)` (a looped open\n * request runs to the project end). Bounded requests are unaffected.\n */\n open?: boolean;\n\n /**\n * Source media length in seconds, carried on **open** requests so the\n * cross-scene end can be resolved at assembly time without re-reading the\n * asset catalog. Ignored for bounded requests.\n */\n mediaDuration?: number;\n\n // --- Media Trimming (Local Audio Time) ---\n\n /** Offset in seconds to skip ahead in the audio file. Default: 0 */\n trimStart: number;\n\n /**\n * Out-point inside the source, in seconds, carried **only by a looping\n * request that has one** (`trimEnd` greater than {@link trimStart}). A device\n * loops the region `[trimStart, trimEnd)` rather than the whole buffer; for a\n * request that does not loop, {@link endAt} already ends playback at the\n * out-point and this is absent.\n */\n trimEnd?: number;\n\n // --- Playback Settings ---\n\n /** Linear gain over the clip's own seconds. Default 1. */\n volume: Param;\n /** Playback rate, default 1. A ramp runs over the first {@link sourceLength} source seconds after `trimStart`. */\n speed?: Param;\n /** The source seconds a speed ramp is placed on; carried only with one, so the device and the timeline place it alike. */\n sourceLength?: number;\n loop: boolean; // Default: false\n\n // --- Processing ---\n\n /** Audio effects applied in array order (index 0 closest to the source). */\n effects?: AudioEffect[];\n /** A gain over the clip's first and last seconds, on top of {@link volume}. */\n transitionIn?: AudioTransition;\n transitionOut?: AudioTransition;\n\n /**\n * The buses this clip feeds, **source-adjacent first** — the same ordering\n * convention {@link effects} uses, so the whole chain reads in signal order:\n * the clip's own effects, then each stop in turn, then the master.\n *\n * Absent means the clip goes straight to the master, which is what every\n * request did before buses existed.\n */\n bus?: readonly AudioBusStop[];\n\n // --- Timeline attribution (display only) ---\n\n /**\n * The owner key of the node that declared this request: its document row's\n * id, plus the path below that row for a node a composite built. Lets a\n * timeline draw the waveform on that node's bar. Never affects playback.\n */\n ownerId?: string;\n\n /**\n * The sound of something that is also a picture — a video's own track. A\n * source only such requests want is silence when it holds no audio, where\n * for a request without this it is a failure to report. Never part of the\n * request's identity: it changes nothing a device plays.\n */\n optional?: boolean;\n}"]}
1
+ {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/attributes/audio/request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAoB,MAAM,kCAAkC,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAc,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAwB,MAAM,+BAA+B,CAAC;AAmBpF,0IAA0I;AAC1I,MAAM,UAAU,UAAU,CAAC,IAAkB;IACzC,OAAO,GAAG,IAAI,CAAC,EAAE,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;AAC/N,CAAC","sourcesContent":["import { effectsKey, type AudioEffect } from \"@/attributes/audio/effects/union\";\nimport { paramKey, type Param } from \"@/attributes/audio/ramp\";\nimport { transitionKey, type AudioTransition } from \"@/attributes/audio/transition\";\n\n/** One bus a clip's signal passes through to the master: a flattened snapshot of an {@link AudioBus} node (core describes the graph, a platform builds it). {@link id} makes it a *bus* rather than per-clip processing: clips naming the same id share one live chain, so a bus reverb is one tail fed by both. */\nexport interface AudioBusStop {\n id: string;\n /** Linear gain. A {@link Param}, so a bus fade is a ramp rather than a per-frame write. */\n volume: Param;\n /** -1 hard left … +1 hard right. */\n pan: Param;\n mute: boolean;\n /** Applied in array order, index 0 closest to the source. */\n effects?: AudioEffect[];\n transitionIn?: AudioTransition;\n transitionOut?: AudioTransition;\n /** When the bus is present, in the same seconds as the request carrying the stop: what ramps in {@link volume} or {@link effects} (and their transitions) run over. Not the clip's span, because one bus feeds many clips and its fade must mean one thing to all. */\n startAt: number;\n endAt: number;\n}\n\n/** Everything about a stop that changes what passes through it, as a string, so a device can tell an edited bus from the one it built. */\nexport function busStopKey(stop: AudioBusStop): string {\n return `${stop.id}:${paramKey(stop.volume)}:${paramKey(stop.pan)}:${stop.mute ? 1 : 0}:${effectsKey(stop.effects)}:${transitionKey(stop.transitionIn)}:${transitionKey(stop.transitionOut)}:${stop.startAt}:${stop.endAt}`;\n}\n\nexport interface AudioRequest {\n id: string;\n src: string;\n\n /** The clip timestamp when the audio should START playing. */\n startAt: number; // in seconds\n\n /** The clip timestamp when the audio STOPS. Always a number: **`Infinity` is the open sentinel**, never null/undefined (an unstopped clip carries it until {@link open} resolution pins it to the project end). Test with `Number.isFinite(endAt)`; a `?? Infinity` guard is dead code. */\n endAt: number; // in seconds\n\n /** True when started and left running at its scene's end (neither stopped nor finite-trimmed). Open requests skip the per-scene audio clamp and **continue across scene boundaries**: `assembleTimeline` shifts them to absolute time and resolves `endAt = min(startAt + mediaDuration, projectTotalDuration)`. */\n open?: boolean;\n\n /** Source media length, carried on **open** requests so the cross-scene end resolves at assembly without re-reading the catalog. Ignored for bounded requests. */\n mediaDuration?: number;\n\n /** Offset in seconds to skip ahead in the audio file. Default: 0 */\n trimStart: number;\n\n /** Out-point inside the source in seconds, carried **only by a looping request that has one**: a device loops `[trimStart, trimEnd)` instead of the whole buffer. Otherwise {@link endAt} already ends playback there and this is absent. */\n trimEnd?: number;\n\n /** Linear gain over the clip's own seconds. Default 1. */\n volume: Param;\n /** Playback rate, default 1. A ramp runs over the first {@link sourceLength} source seconds after `trimStart`. */\n speed?: Param;\n /** The source seconds a speed ramp is placed on; carried only with one, so the device and the timeline place it alike. */\n sourceLength?: number;\n loop: boolean; // Default: false\n\n /** Audio effects applied in array order (index 0 closest to the source). */\n effects?: AudioEffect[];\n /** A gain over the clip's first and last seconds, on top of {@link volume}. */\n transitionIn?: AudioTransition;\n transitionOut?: AudioTransition;\n\n /** The buses this clip feeds, **source-adjacent first** like {@link effects}, so the chain reads in signal order: clip effects, each stop, then master. Absent goes straight to the master. */\n bus?: readonly AudioBusStop[];\n\n /** The owner key of the declaring node (its document row's id, plus the path below that row for a composite's node), so a timeline can draw the waveform on that node's bar. Never affects playback. */\n ownerId?: string;\n\n /** The sound of something that is also a picture (a video's own track): a source with no audio is silence for such a request, not a failure. Not part of the request's identity. */\n optional?: boolean;\n}"]}
@@ -6,7 +6,6 @@ import type { AudioBusStop, AudioRequest } from "./request.js";
6
6
  /** One clip a command's sound plays, in its clip's seconds. */
7
7
  export interface AudioClip {
8
8
  src: string;
9
- /** When it starts. */
10
9
  at?: number;
11
10
  /** When it is cut, however much of it is left. */
12
11
  until?: number;
@@ -26,11 +25,7 @@ export interface AudioClip {
26
25
  /** Sound nobody asked for by name — see {@link AudioRequest.optional}. */
27
26
  optional?: boolean;
28
27
  }
29
- /**
30
- * Clip seconds spent playing the first `sourceElapsed` of `sourceLength` source
31
- * seconds at `speed`. Must match the device's `playbackRate` schedule, or a
32
- * request ends before or after its sound does.
33
- */
28
+ /** Clip seconds spent playing the first `sourceElapsed` of `sourceLength` source seconds at `speed`; must match the device's `playbackRate` schedule or a request ends before or after its sound. */
34
29
  export declare function clipTimeAtSource(speed: Param, sourceLength: number, sourceElapsed?: number): number;
35
30
  /** Inverse of {@link clipTimeAtSource}: the source seconds reached `clipElapsed` clip seconds in. */
36
31
  export declare function sourceTimeAtClip(speed: Param, sourceLength: number, clipElapsed: number): number;
@@ -40,11 +35,6 @@ export declare function clipDurationOf(clip: {
40
35
  readonly trimEnd?: number;
41
36
  readonly speed?: Param;
42
37
  }, mediaDuration: number): number;
43
- /**
44
- * The request `clip` schedules.
45
- *
46
- * Bounded when it has an end — a trim, or an `until` — and **open** otherwise, so
47
- * a bed nothing cuts continues across later tracks; see `AudioRequest.open`.
48
- */
38
+ /** The request `clip` schedules: bounded with an end (a trim or `until`), **open** otherwise so a bed nothing cuts continues across later tracks (see `AudioRequest.open`). */
49
39
  export declare function requestOf(clip: AudioClip, catalog: AssetCatalog, ownerKey: string, n: number): AudioRequest;
50
40
  //# sourceMappingURL=schedule.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schedule.d.ts","sourceRoot":"","sources":["../../../src/attributes/audio/schedule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAuB,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAA0E,KAAK,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC5G,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE5D,+DAA+D;AAC/D,MAAM,WAAW,SAAS;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,sBAAsB;IACtB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qEAAqE;IACrE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,KAAK,CAAC;IAC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,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,YAAY,CA2D3G"}
@@ -3,11 +3,7 @@ import { integrateSpeedToClipTime, isRamp, sourceTimeAtClipElapsed, staticValue
3
3
  function scalarSpeed(speed) {
4
4
  return Number.isFinite(speed) && speed > 0 ? speed : 1;
5
5
  }
6
- /**
7
- * Clip seconds spent playing the first `sourceElapsed` of `sourceLength` source
8
- * seconds at `speed`. Must match the device's `playbackRate` schedule, or a
9
- * request ends before or after its sound does.
10
- */
6
+ /** Clip seconds spent playing the first `sourceElapsed` of `sourceLength` source seconds at `speed`; must match the device's `playbackRate` schedule or a request ends before or after its sound. */
11
7
  export function clipTimeAtSource(speed, sourceLength, sourceElapsed = sourceLength) {
12
8
  if (isRamp(speed))
13
9
  return integrateSpeedToClipTime(speed, sourceLength, sourceElapsed);
@@ -24,12 +20,7 @@ export function clipDurationOf(clip, mediaDuration) {
24
20
  const length = Math.max(0, (clip.trimEnd ?? mediaDuration) - (clip.trimStart ?? 0));
25
21
  return clipTimeAtSource(clip.speed ?? 1, length);
26
22
  }
27
- /**
28
- * The request `clip` schedules.
29
- *
30
- * Bounded when it has an end — a trim, or an `until` — and **open** otherwise, so
31
- * a bed nothing cuts continues across later tracks; see `AudioRequest.open`.
32
- */
23
+ /** The request `clip` schedules: bounded with an end (a trim or `until`), **open** otherwise so a bed nothing cuts continues across later tracks (see `AudioRequest.open`). */
33
24
  export function requestOf(clip, catalog, ownerKey, n) {
34
25
  const at = clip.at ?? 0;
35
26
  const until = clip.until ?? Infinity;
@@ -1 +1 @@
1
- {"version":3,"file":"schedule.js","sourceRoot":"","sources":["../../../src/attributes/audio/schedule.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAA0B,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAAE,wBAAwB,EAAE,MAAM,EAAE,uBAAuB,EAAE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C;SAAM,CAAC;QACJ,MAAM,OAAO,GAAG,gBAAgB,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;QACtD,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,GAAG,OAAO,CAAC,CAAC;QAClD,CAAC;aAAM,CAAC;YACJ,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;YACpB,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC;QACpC,CAAC;IACL,CAAC;IACD,OAAO,OAAO,CAAC;AACnB,CAAC","sourcesContent":["import type { AssetCatalog } from \"@/assets/catalog\";\nimport { resolveAudioEffects, type AudioEffectsInput } from \"./effects/chain\";\nimport { integrateSpeedToClipTime, isRamp, sourceTimeAtClipElapsed, staticValue, type Param } from \"./ramp\";\nimport type { AudioTransition } from \"./transition\";\nimport type { AudioBusStop, AudioRequest } from \"./request\";\n\n/** One clip a command's sound plays, in its clip's seconds. */\nexport interface AudioClip {\n src: string;\n /** When it starts. */\n at?: number;\n /** When it is cut, however much of it is left. */\n until?: number;\n /** In-point inside the source, in seconds. */\n trimStart?: number;\n /** Out-point inside the source. Absent plays to the source's end. */\n trimEnd?: number;\n loop?: boolean;\n volume?: Param;\n /** Playback rate; a ramp runs over source seconds after `trimStart`. */\n speed?: Param;\n effects?: AudioEffectsInput;\n transitionIn?: AudioTransition;\n transitionOut?: AudioTransition;\n /** Source-adjacent first — see {@link AudioRequest.bus}. */\n bus?: readonly AudioBusStop[];\n /** Sound nobody asked for by name — see {@link AudioRequest.optional}. */\n optional?: boolean;\n}\n\nfunction scalarSpeed(speed: number): number {\n return Number.isFinite(speed) && speed > 0 ? speed : 1;\n}\n\n/**\n * Clip seconds spent playing the first `sourceElapsed` of `sourceLength` source\n * seconds at `speed`. Must match the device's `playbackRate` schedule, or a\n * request ends before or after its sound does.\n */\nexport function clipTimeAtSource(speed: Param, sourceLength: number, sourceElapsed: number = sourceLength): number {\n if (isRamp(speed)) return integrateSpeedToClipTime(speed, sourceLength, sourceElapsed);\n return Math.max(0, Math.min(sourceElapsed, sourceLength)) / scalarSpeed(speed);\n}\n\n/** Inverse of {@link clipTimeAtSource}: the source seconds reached `clipElapsed` clip seconds in. */\nexport function sourceTimeAtClip(speed: Param, sourceLength: number, clipElapsed: number): number {\n if (isRamp(speed)) return sourceTimeAtClipElapsed(speed, sourceLength, clipElapsed);\n return Math.max(0, Math.min(sourceLength, clipElapsed * scalarSpeed(speed)));\n}\n\n/** How long a clip lasts on the timeline: its trimmed source at its speed. `trimEnd` absent plays to `mediaDuration`. */\nexport function clipDurationOf(clip: { readonly trimStart?: number; readonly trimEnd?: number; readonly speed?: Param }, mediaDuration: number): number {\n const length = Math.max(0, (clip.trimEnd ?? mediaDuration) - (clip.trimStart ?? 0));\n return clipTimeAtSource(clip.speed ?? 1, length);\n}\n\n/**\n * The request `clip` schedules.\n *\n * Bounded when it has an end — a trim, or an `until` — and **open** otherwise, so\n * a bed nothing cuts continues across later tracks; see `AudioRequest.open`.\n */\nexport function requestOf(clip: AudioClip, catalog: AssetCatalog, ownerKey: string, n: number): AudioRequest {\n const at = clip.at ?? 0;\n const until = clip.until ?? Infinity;\n const trimStart = clip.trimStart ?? 0;\n const trimEnd = clip.trimEnd ?? Infinity;\n const loop = clip.loop ?? false;\n const effects = resolveAudioEffects(clip.effects);\n // Read even when the length goes unused: a missing file throws here, as a\n // build error, rather than playing silence.\n const mediaDuration = catalog.getMediaDuration(clip.src);\n\n let speed = clip.speed ?? 1;\n if (loop && isRamp(speed)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(`[motionscript] A speed ramp on a looping clip (${clip.src}) has no one source axis to run over; it plays at its start value.`);\n }\n speed = staticValue(speed, 1);\n }\n const sourceLength = Math.max(0, (Number.isFinite(trimEnd) ? trimEnd : mediaDuration) - trimStart);\n\n const request: AudioRequest = {\n id: `${ownerKey}|${clip.src}|${at}|${n}`,\n src: clip.src,\n startAt: at,\n endAt: Infinity,\n trimStart,\n volume: clip.volume ?? 1,\n speed,\n loop,\n ownerId: ownerKey,\n };\n if (isRamp(speed)) request.sourceLength = sourceLength;\n if (effects.length > 0) request.effects = effects;\n if (clip.transitionIn) request.transitionIn = clip.transitionIn;\n if (clip.transitionOut) request.transitionOut = clip.transitionOut;\n if (clip.bus) request.bus = clip.bus;\n if (clip.optional) request.optional = true;\n\n // A loop repeats the trimmed region, so a `trimEnd` bounds one pass and says\n // nothing about when the clip stops: only a cut (`until`) ends it, and with\n // none it runs open to the project end like any other bed.\n if (loop && trimEnd > trimStart && Number.isFinite(trimEnd)) request.trimEnd = trimEnd;\n\n if (loop && Number.isFinite(until)) {\n request.endAt = until;\n } else if (loop) {\n request.open = true;\n } else if (Number.isFinite(trimEnd)) {\n request.endAt = Math.min(until, at + clipTimeAtSource(speed, sourceLength));\n } else {\n const natural = clipTimeAtSource(speed, sourceLength);\n if (Number.isFinite(until)) {\n request.endAt = Math.min(until, at + natural);\n } else {\n request.open = true;\n request.mediaDuration = natural;\n }\n }\n return request;\n}\n"]}
1
+ {"version":3,"file":"schedule.js","sourceRoot":"","sources":["../../../src/attributes/audio/schedule.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAA0B,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAAE,wBAAwB,EAAE,MAAM,EAAE,uBAAuB,EAAE,WAAW,EAAc,MAAM,QAAQ,CAAC;AA2B5G,SAAS,WAAW,CAAC,KAAa;IAC9B,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED,qMAAqM;AACrM,MAAM,UAAU,gBAAgB,CAAC,KAAY,EAAE,YAAoB,EAAE,gBAAwB,YAAY;IACrG,IAAI,MAAM,CAAC,KAAK,CAAC;QAAE,OAAO,wBAA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AC;QACpC,CAAC;IACL,CAAC;IACD,OAAO,OAAO,CAAC;AACnB,CAAC","sourcesContent":["import type { AssetCatalog } from \"@/assets/catalog\";\nimport { resolveAudioEffects, type AudioEffectsInput } from \"./effects/chain\";\nimport { integrateSpeedToClipTime, isRamp, sourceTimeAtClipElapsed, staticValue, type Param } from \"./ramp\";\nimport type { AudioTransition } from \"./transition\";\nimport type { AudioBusStop, AudioRequest } from \"./request\";\n\n/** One clip a command's sound plays, in its clip's seconds. */\nexport interface AudioClip {\n src: string;\n at?: number;\n /** When it is cut, however much of it is left. */\n until?: number;\n /** In-point inside the source, in seconds. */\n trimStart?: number;\n /** Out-point inside the source. Absent plays to the source's end. */\n trimEnd?: number;\n loop?: boolean;\n volume?: Param;\n /** Playback rate; a ramp runs over source seconds after `trimStart`. */\n speed?: Param;\n effects?: AudioEffectsInput;\n transitionIn?: AudioTransition;\n transitionOut?: AudioTransition;\n /** Source-adjacent first — see {@link AudioRequest.bus}. */\n bus?: readonly AudioBusStop[];\n /** Sound nobody asked for by name — see {@link AudioRequest.optional}. */\n optional?: boolean;\n}\n\nfunction scalarSpeed(speed: number): number {\n return Number.isFinite(speed) && speed > 0 ? speed : 1;\n}\n\n/** Clip seconds spent playing the first `sourceElapsed` of `sourceLength` source seconds at `speed`; must match the device's `playbackRate` schedule or a request ends before or after its sound. */\nexport function clipTimeAtSource(speed: Param, sourceLength: number, sourceElapsed: number = sourceLength): number {\n if (isRamp(speed)) return integrateSpeedToClipTime(speed, sourceLength, sourceElapsed);\n return Math.max(0, Math.min(sourceElapsed, sourceLength)) / scalarSpeed(speed);\n}\n\n/** Inverse of {@link clipTimeAtSource}: the source seconds reached `clipElapsed` clip seconds in. */\nexport function sourceTimeAtClip(speed: Param, sourceLength: number, clipElapsed: number): number {\n if (isRamp(speed)) return sourceTimeAtClipElapsed(speed, sourceLength, clipElapsed);\n return Math.max(0, Math.min(sourceLength, clipElapsed * scalarSpeed(speed)));\n}\n\n/** How long a clip lasts on the timeline: its trimmed source at its speed. `trimEnd` absent plays to `mediaDuration`. */\nexport function clipDurationOf(clip: { readonly trimStart?: number; readonly trimEnd?: number; readonly speed?: Param }, mediaDuration: number): number {\n const length = Math.max(0, (clip.trimEnd ?? mediaDuration) - (clip.trimStart ?? 0));\n return clipTimeAtSource(clip.speed ?? 1, length);\n}\n\n/** The request `clip` schedules: bounded with an end (a trim or `until`), **open** otherwise so a bed nothing cuts continues across later tracks (see `AudioRequest.open`). */\nexport function requestOf(clip: AudioClip, catalog: AssetCatalog, ownerKey: string, n: number): AudioRequest {\n const at = clip.at ?? 0;\n const until = clip.until ?? Infinity;\n const trimStart = clip.trimStart ?? 0;\n const trimEnd = clip.trimEnd ?? Infinity;\n const loop = clip.loop ?? false;\n const effects = resolveAudioEffects(clip.effects);\n // Read even when the length goes unused: a missing file throws here, as a\n // build error, rather than playing silence.\n const mediaDuration = catalog.getMediaDuration(clip.src);\n\n let speed = clip.speed ?? 1;\n if (loop && isRamp(speed)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(`[motionscript] A speed ramp on a looping clip (${clip.src}) has no one source axis to run over; it plays at its start value.`);\n }\n speed = staticValue(speed, 1);\n }\n const sourceLength = Math.max(0, (Number.isFinite(trimEnd) ? trimEnd : mediaDuration) - trimStart);\n\n const request: AudioRequest = {\n id: `${ownerKey}|${clip.src}|${at}|${n}`,\n src: clip.src,\n startAt: at,\n endAt: Infinity,\n trimStart,\n volume: clip.volume ?? 1,\n speed,\n loop,\n ownerId: ownerKey,\n };\n if (isRamp(speed)) request.sourceLength = sourceLength;\n if (effects.length > 0) request.effects = effects;\n if (clip.transitionIn) request.transitionIn = clip.transitionIn;\n if (clip.transitionOut) request.transitionOut = clip.transitionOut;\n if (clip.bus) request.bus = clip.bus;\n if (clip.optional) request.optional = true;\n\n // A loop repeats the trimmed region, so a `trimEnd` bounds one pass and says\n // nothing about when the clip stops: only a cut (`until`) ends it, and with\n // none it runs open to the project end like any other bed.\n if (loop && trimEnd > trimStart && Number.isFinite(trimEnd)) request.trimEnd = trimEnd;\n\n if (loop && Number.isFinite(until)) {\n request.endAt = until;\n } else if (loop) {\n request.open = true;\n } else if (Number.isFinite(trimEnd)) {\n request.endAt = Math.min(until, at + clipTimeAtSource(speed, sourceLength));\n } else {\n const natural = clipTimeAtSource(speed, sourceLength);\n if (Number.isFinite(until)) {\n request.endAt = Math.min(until, at + natural);\n } else {\n request.open = true;\n request.mediaDuration = natural;\n }\n }\n return request;\n}\n"]}
@@ -10,16 +10,7 @@ interface SoundPropsBase {
10
10
  /** Audio effects applied to the clip (gain, eq, tremolo, echo). */
11
11
  effects?: AudioEffectsInput;
12
12
  }
13
- /**
14
- * Author-facing sound props. Two mutually-exclusive ways to bound the clip:
15
- *
16
- * - `{ trimStart?, trimEnd? }` — explicit in/out points into the source file.
17
- * - `{ duration? }` — syntax sugar for a clip that runs `duration` seconds from
18
- * the start (equivalent to `trimStart: 0, trimEnd: duration`).
19
- *
20
- * When neither `trimEnd` nor `duration` is given, the clip runs to the source's
21
- * full length (resolved from the asset catalog). `trimStart` defaults to 0.
22
- */
13
+ /** Author-facing sound props with two mutually exclusive bounds: `{ trimStart?, trimEnd? }` (explicit in/out points into the source) or `{ duration? }` (sugar for `trimStart: 0, trimEnd: duration`). With neither `trimEnd` nor `duration` the clip runs to the source's full length (from the asset catalog); `trimStart` defaults to 0. */
23
14
  export type SoundProps = (SoundPropsBase & {
24
15
  trimStart?: number;
25
16
  trimEnd?: number;
@@ -29,20 +20,7 @@ export type SoundProps = (SoundPropsBase & {
29
20
  trimStart?: undefined;
30
21
  trimEnd?: undefined;
31
22
  });
32
- /** Canonical, fully-resolved sound props. `trimEnd` is resolved against the catalog. */
33
- export interface ResolvedSoundProps {
34
- src: string;
35
- volume?: Param;
36
- speed?: Param;
37
- loop?: boolean;
38
- trimStart?: number;
39
- trimEnd?: number;
40
- effects?: AudioEffect[];
41
- }
42
- /**
43
- * A clip's resolved props, and how long it runs. What a node plays is declared
44
- * through `declareAudio`; this is only the arithmetic over one clip.
45
- */
23
+ /** A clip's resolved props and how long it runs; what a node plays is declared through `declareAudio`, this is only the arithmetic over one clip. */
46
24
  export declare class Sound {
47
25
  readonly src: string;
48
26
  volume: Param;
@@ -54,8 +32,6 @@ export declare class Sound {
54
32
  constructor(props: SoundProps);
55
33
  /** Clip seconds `trimmedSourceLength` source seconds take at this clip's speed. */
56
34
  clipDurationFor(trimmedSourceLength: number): number;
57
- /** @deprecated Renamed to {@link clipDurationFor}; kept until 1.0. */
58
- sceneDurationFor(trimmedSourceLength: number): number;
59
35
  /** Clip seconds, speed profile applied; `undefined` when nothing bounds the clip. */
60
36
  get clipDuration(): number | undefined;
61
37
  }
@@ -1 +1 @@
1
- {"version":3,"file":"sound.d.ts","sourceRoot":"","sources":["../../../src/attributes/audio/sound.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,KAAK,iBAAiB,EAAuB,MAAM,kCAAkC,CAAC;AAC/F,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAGrD,UAAU,cAAc;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,wEAAwE;IACxE,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,mEAAmE;IACnE,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC/B;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,UAAU,GAChB,CAAC,cAAc,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,CAAC,GACjF,CAAC,cAAc,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,SAAS,CAAC;IAAC,OAAO,CAAC,EAAE,SAA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CAAC;IACf,mEAAmE;IACnE,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC/B;AAED,+UAA+U;AAC/U,MAAM,MAAM,UAAU,GAChB,CAAC,cAAc,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,CAAC,GACjF,CAAC,cAAc,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,SAAS,CAAC;IAAC,OAAO,CAAC,EAAE,SAAS,CAAA;CAAE,CAAC,CAAC;AAE3F,qJAAqJ;AACrJ,qBAAa,KAAK;IACd,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,KAAK,CAAC;IACd,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,WAAW,EAAE,CAAC;gBAEX,KAAK,EAAE,UAAU;IAU7B,mFAAmF;IACnF,eAAe,CAAC,mBAAmB,EAAE,MAAM,GAAG,MAAM;IAIpD,qFAAqF;IACrF,IAAI,YAAY,IAAI,MAAM,GAAG,SAAS,CAIrC;CACJ"}
@@ -1,9 +1,6 @@
1
1
  import { resolveAudioEffects } from "../../attributes/audio/effects/chain.js";
2
2
  import { clipTimeAtSource } from "../../attributes/audio/schedule.js";
3
- /**
4
- * A clip's resolved props, and how long it runs. What a node plays is declared
5
- * through `declareAudio`; this is only the arithmetic over one clip.
6
- */
3
+ /** A clip's resolved props and how long it runs; what a node plays is declared through `declareAudio`, this is only the arithmetic over one clip. */
7
4
  export class Sound {
8
5
  src;
9
6
  volume;
@@ -17,7 +14,6 @@ export class Sound {
17
14
  this.volume = props.volume ?? 1;
18
15
  this.speed = props.speed ?? 1;
19
16
  this.loop = props.loop ?? false;
20
- // `duration` is sugar for `trimStart: 0, trimEnd: duration`.
21
17
  this.trimStart = props.trimStart ?? 0;
22
18
  this.trimEnd = props.trimEnd ?? props.duration ?? Infinity;
23
19
  this.effects = resolveAudioEffects(props.effects);
@@ -26,10 +22,6 @@ export class Sound {
26
22
  clipDurationFor(trimmedSourceLength) {
27
23
  return clipTimeAtSource(this.speed, trimmedSourceLength);
28
24
  }
29
- /** @deprecated Renamed to {@link clipDurationFor}; kept until 1.0. */
30
- sceneDurationFor(trimmedSourceLength) {
31
- return this.clipDurationFor(trimmedSourceLength);
32
- }
33
25
  /** Clip seconds, speed profile applied; `undefined` when nothing bounds the clip. */
34
26
  get clipDuration() {
35
27
  return this.trimEnd !== Infinity
@@ -1 +1 @@
1
- {"version":3,"file":"sound.js","sourceRoot":"","sources":["../../../src/attributes/audio/sound.ts"],"names":[],"mappings":"AACA,OAAO,EAA0B,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAE/F,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAqC/D;;;GAGG;AACH,MAAM,OAAO,KAAK;IACL,GAAG,CAAS;IACrB,MAAM,CAAQ;IACd,KAAK,CAAQ;IACb,IAAI,CAAU;IACd,SAAS,CAAS;IAClB,OAAO,CAAS;IAChB,OAAO,CAAgB;IAEvB,YAAY,KAAiB;QACzB,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC;QAChC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC;QAC9B,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC;QAChC,6DAA6D;QAC7D,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,IAAI,CAAC,CAAC;QACtC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,QAAQ,IAAI,QAAQ,CAAC;QAC3D,IAAI,CAAC,OAAO,GAAG,mBAAmB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACtD,CAAC;IAED,mFAAmF;IACnF,eAAe,CAAC,mBAA2B;QACvC,OAAO,gBAAgB,CAAC,IAAI,CAAC,KAAK,EAAE,mBAAmB,CAAC,CAAC;IAC7D,CAAC;IAED,sEAAsE;IACtE,gBAAgB,CAAC,mBAA2B;QACxC,OAAO,IAAI,CAAC,eAAe,CAAC,mBAAmB,CAAC,CAAC;IACrD,CAAC;IAED,qFAAqF;IACrF,IAAI,YAAY;QACZ,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ;YAC5B,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC;YACrD,CAAC,CAAC,SAAS,CAAC;IACpB,CAAC;CACJ","sourcesContent":["import type { AudioEffect } from \"@/attributes/audio/effects/union\";\nimport { type AudioEffectsInput, resolveAudioEffects } from \"@/attributes/audio/effects/chain\";\nimport type { Param } from \"@/attributes/audio/ramp\";\nimport { clipTimeAtSource } from \"@/attributes/audio/schedule\";\n\ninterface SoundPropsBase {\n src: string;\n volume?: Param;\n /** Playback rate; a ramp runs over source seconds after `trimStart`. */\n speed?: Param;\n loop?: boolean;\n /** Audio effects applied to the clip (gain, eq, tremolo, echo). */\n effects?: AudioEffectsInput;\n}\n\n/**\n * Author-facing sound props. Two mutually-exclusive ways to bound the clip:\n *\n * - `{ trimStart?, trimEnd? }` — explicit in/out points into the source file.\n * - `{ duration? }` — syntax sugar for a clip that runs `duration` seconds from\n * the start (equivalent to `trimStart: 0, trimEnd: duration`).\n *\n * When neither `trimEnd` nor `duration` is given, the clip runs to the source's\n * full length (resolved from the asset catalog). `trimStart` defaults to 0.\n */\nexport type SoundProps =\n | (SoundPropsBase & { trimStart?: number; trimEnd?: number; duration?: undefined })\n | (SoundPropsBase & { duration?: number; trimStart?: undefined; trimEnd?: undefined });\n\n/** Canonical, fully-resolved sound props. `trimEnd` is resolved against the catalog. */\nexport interface ResolvedSoundProps {\n src: string;\n volume?: Param;\n speed?: Param;\n loop?: boolean;\n trimStart?: number;\n trimEnd?: number;\n effects?: AudioEffect[];\n}\n\n/**\n * A clip's resolved props, and how long it runs. What a node plays is declared\n * through `declareAudio`; this is only the arithmetic over one clip.\n */\nexport class Sound {\n readonly src: string;\n volume: Param;\n speed: Param;\n loop: boolean;\n trimStart: number;\n trimEnd: number;\n effects: AudioEffect[];\n\n constructor(props: SoundProps) {\n this.src = props.src;\n this.volume = props.volume ?? 1;\n this.speed = props.speed ?? 1;\n this.loop = props.loop ?? false;\n // `duration` is sugar for `trimStart: 0, trimEnd: duration`.\n this.trimStart = props.trimStart ?? 0;\n this.trimEnd = props.trimEnd ?? props.duration ?? Infinity;\n this.effects = resolveAudioEffects(props.effects);\n }\n\n /** Clip seconds `trimmedSourceLength` source seconds take at this clip's speed. */\n clipDurationFor(trimmedSourceLength: number): number {\n return clipTimeAtSource(this.speed, trimmedSourceLength);\n }\n\n /** @deprecated Renamed to {@link clipDurationFor}; kept until 1.0. */\n sceneDurationFor(trimmedSourceLength: number): number {\n return this.clipDurationFor(trimmedSourceLength);\n }\n\n /** Clip seconds, speed profile applied; `undefined` when nothing bounds the clip. */\n get clipDuration(): number | undefined {\n return this.trimEnd !== Infinity\n ? this.clipDurationFor(this.trimEnd - this.trimStart)\n : undefined;\n }\n}\n"]}
1
+ {"version":3,"file":"sound.js","sourceRoot":"","sources":["../../../src/attributes/audio/sound.ts"],"names":[],"mappings":"AACA,OAAO,EAA0B,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAE/F,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAiB/D,qJAAqJ;AACrJ,MAAM,OAAO,KAAK;IACL,GAAG,CAAS;IACrB,MAAM,CAAQ;IACd,KAAK,CAAQ;IACb,IAAI,CAAU;IACd,SAAS,CAAS;IAClB,OAAO,CAAS;IAChB,OAAO,CAAgB;IAEvB,YAAY,KAAiB;QACzB,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC;QAChC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC;QAC9B,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC;QAChC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,IAAI,CAAC,CAAC;QACtC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,QAAQ,IAAI,QAAQ,CAAC;QAC3D,IAAI,CAAC,OAAO,GAAG,mBAAmB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACtD,CAAC;IAED,mFAAmF;IACnF,eAAe,CAAC,mBAA2B;QACvC,OAAO,gBAAgB,CAAC,IAAI,CAAC,KAAK,EAAE,mBAAmB,CAAC,CAAC;IAC7D,CAAC;IAED,qFAAqF;IACrF,IAAI,YAAY;QACZ,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ;YAC5B,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC;YACrD,CAAC,CAAC,SAAS,CAAC;IACpB,CAAC;CACJ","sourcesContent":["import type { AudioEffect } from \"@/attributes/audio/effects/union\";\nimport { type AudioEffectsInput, resolveAudioEffects } from \"@/attributes/audio/effects/chain\";\nimport type { Param } from \"@/attributes/audio/ramp\";\nimport { clipTimeAtSource } from \"@/attributes/audio/schedule\";\n\ninterface SoundPropsBase {\n src: string;\n volume?: Param;\n /** Playback rate; a ramp runs over source seconds after `trimStart`. */\n speed?: Param;\n loop?: boolean;\n /** Audio effects applied to the clip (gain, eq, tremolo, echo). */\n effects?: AudioEffectsInput;\n}\n\n/** Author-facing sound props with two mutually exclusive bounds: `{ trimStart?, trimEnd? }` (explicit in/out points into the source) or `{ duration? }` (sugar for `trimStart: 0, trimEnd: duration`). With neither `trimEnd` nor `duration` the clip runs to the source's full length (from the asset catalog); `trimStart` defaults to 0. */\nexport type SoundProps =\n | (SoundPropsBase & { trimStart?: number; trimEnd?: number; duration?: undefined })\n | (SoundPropsBase & { duration?: number; trimStart?: undefined; trimEnd?: undefined });\n\n/** A clip's resolved props and how long it runs; what a node plays is declared through `declareAudio`, this is only the arithmetic over one clip. */\nexport class Sound {\n readonly src: string;\n volume: Param;\n speed: Param;\n loop: boolean;\n trimStart: number;\n trimEnd: number;\n effects: AudioEffect[];\n\n constructor(props: SoundProps) {\n this.src = props.src;\n this.volume = props.volume ?? 1;\n this.speed = props.speed ?? 1;\n this.loop = props.loop ?? false;\n this.trimStart = props.trimStart ?? 0;\n this.trimEnd = props.trimEnd ?? props.duration ?? Infinity;\n this.effects = resolveAudioEffects(props.effects);\n }\n\n /** Clip seconds `trimmedSourceLength` source seconds take at this clip's speed. */\n clipDurationFor(trimmedSourceLength: number): number {\n return clipTimeAtSource(this.speed, trimmedSourceLength);\n }\n\n /** Clip seconds, speed profile applied; `undefined` when nothing bounds the clip. */\n get clipDuration(): number | undefined {\n return this.trimEnd !== Infinity\n ? this.clipDurationFor(this.trimEnd - this.trimStart)\n : undefined;\n }\n}\n"]}
@@ -1,12 +1,5 @@
1
1
  import { type EaseSpec } from "../../tween/ease/spec.js";
2
- /**
3
- * What happens as a clip enters (`transitionIn`) or leaves (`transitionOut`):
4
- * today, a fade over its first or last `duration` clip seconds.
5
- *
6
- * A cross-fade is two clips that overlap, the first carrying a `transitionOut`
7
- * and the second a `transitionIn` as long as the overlap; equal-power shapes
8
- * are complementary, so the pair needs no link between them.
9
- */
2
+ /** What happens as a clip enters (`transitionIn`) or leaves (`transitionOut`): a fade over its first or last `duration` clip seconds. A cross-fade is two overlapping clips, the first with a `transitionOut` and the second a `transitionIn` as long as the overlap; equal-power shapes are complementary, so the pair needs no link. */
10
3
  export interface AudioTransition {
11
4
  readonly duration: number;
12
5
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"transition.d.ts","sourceRoot":"","sources":["../../../src/attributes/audio/transition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAG9D;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,YAAY,GAAG,QAAQ,CAAC;CAC5C;AAaD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,eAAe,EAAE,aAAa,CAAC,EAAE,eAAe,GAAG;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAU9J;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,eAAe,EAAE,aAAa,CAAC,EAAE,eAAe,GAAG,MAAM,CAMnI;AAED,wBAAgB,aAAa,CAAC,UAAU,EAAE,eAAe,GAAG,SAAS,GAAG,MAAM,CAG7E"}
1
+ {"version":3,"file":"transition.d.ts","sourceRoot":"","sources":["../../../src/attributes/audio/transition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAG9D,0UAA0U;AAC1U,MAAM,WAAW,eAAe;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,YAAY,GAAG,QAAQ,CAAC;CAC5C;AAaD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,eAAe,EAAE,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IAAI,CAAC,GAAG,KAAK,CAAC,EAAE;QAAE,IAAI,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;IACxH,IAAI,aAAa,IAAI,KAAK,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,MAAM,GAAG,KAAK,CAAC,GAAG;QAAE,IAAI,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/I,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,UAAuC;IACjE,IAAI,CAAC,UAAU;QAAE,OAAO,GAAG,CAAC;IAC5B,OAAO,GAAG,UAAU,CAAC,QAAQ,IAAI,OAAO,UAAU,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,IAAI,YAAY,EAAE,CAAC;AAClJ,CAAC","sourcesContent":["import { easeOfSpec, type EaseSpec } from \"@/tween/ease/spec\";\nimport type { EasingFunction } from \"@/tween/ease/type\";\n\n/**\n * What happens as a clip enters (`transitionIn`) or leaves (`transitionOut`):\n * today, a fade over its first or last `duration` clip seconds.\n *\n * A cross-fade is two clips that overlap, the first carrying a `transitionOut`\n * and the second a `transitionIn` as long as the overlap; equal-power shapes\n * are complementary, so the pair needs no link between them.\n */\nexport interface AudioTransition {\n readonly duration: number;\n /**\n * Progress through the transition (x, 0→1) to how far it has come (y, the\n * gain for a fade), read as entering; a `transitionOut` plays it backwards.\n * Default `\"equalPower\"`, sin(πx/2).\n */\n readonly curve?: \"equalPower\" | EaseSpec;\n}\n\nconst EQUAL_POWER: EasingFunction = (x) => Math.sin((Math.max(0, Math.min(1, x)) * Math.PI) / 2);\nconst shapes = new WeakMap<EaseSpec, EasingFunction>();\n\nfunction shapeOf(transition: AudioTransition): EasingFunction {\n const curve = transition.curve;\n if (curve === undefined || curve === \"equalPower\") return EQUAL_POWER;\n let shape = shapes.get(curve);\n if (!shape) shapes.set(curve, (shape = easeOfSpec(curve)));\n return shape;\n}\n\n/**\n * The two transitions' durations on a clip `length` seconds long: shrunk in\n * proportion when together they would overrun it.\n */\nexport function transitionSpans(length: number, transitionIn?: AudioTransition, transitionOut?: AudioTransition): { readonly in: number; readonly out: number } {\n const wanted = { in: Math.max(0, transitionIn?.duration ?? 0), out: Math.max(0, transitionOut?.duration ?? 0) };\n if (!Number.isFinite(length)) return { in: wanted.in, out: 0 };\n const total = wanted.in + wanted.out;\n if (total <= length || total === 0) return wanted;\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(`[motionscript] Transitions of ${total.toFixed(3)}s overrun a ${length.toFixed(3)}s clip; both are shortened to fit.`);\n }\n const scale = Math.max(0, length) / total;\n return { in: wanted.in * scale, out: wanted.out * scale };\n}\n\n/**\n * The gain the transitions put on a clip at `t` of its `length` seconds: 1\n * outside both. An open clip (`length` not finite) has no end to leave from.\n */\nexport function transitionGainAt(t: number, length: number, transitionIn?: AudioTransition, transitionOut?: AudioTransition): number {\n const spans = transitionSpans(length, transitionIn, transitionOut);\n let gain = 1;\n if (transitionIn && spans.in > 0 && t < spans.in) gain *= Math.max(0, shapeOf(transitionIn)(Math.max(0, t) / spans.in));\n if (transitionOut && spans.out > 0 && t > length - spans.out) gain *= Math.max(0, shapeOf(transitionOut)(Math.max(0, length - t) / spans.out));\n return gain;\n}\n\nexport function transitionKey(transition: AudioTransition | undefined): string {\n if (!transition) return \"_\";\n return `${transition.duration}:${typeof transition.curve === \"object\" ? JSON.stringify(transition.curve) : transition.curve ?? \"equalP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,OAAO,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/I,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,UAAuC;IACjE,IAAI,CAAC,UAAU;QAAE,OAAO,GAAG,CAAC;IAC5B,OAAO,GAAG,UAAU,CAAC,QAAQ,IAAI,OAAO,UAAU,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,IAAI,YAAY,EAAE,CAAC;AAClJ,CAAC","sourcesContent":["import { easeOfSpec, type EaseSpec } from \"@/tween/ease/spec\";\nimport type { EasingFunction } from \"@/tween/ease/type\";\n\n/** What happens as a clip enters (`transitionIn`) or leaves (`transitionOut`): a fade over its first or last `duration` clip seconds. A cross-fade is two overlapping clips, the first with a `transitionOut` and the second a `transitionIn` as long as the overlap; equal-power shapes are complementary, so the pair needs no link. */\nexport interface AudioTransition {\n readonly duration: number;\n /**\n * Progress through the transition (x, 0→1) to how far it has come (y, the\n * gain for a fade), read as entering; a `transitionOut` plays it backwards.\n * Default `\"equalPower\"`, sin(πx/2).\n */\n readonly curve?: \"equalPower\" | EaseSpec;\n}\n\nconst EQUAL_POWER: EasingFunction = (x) => Math.sin((Math.max(0, Math.min(1, x)) * Math.PI) / 2);\nconst shapes = new WeakMap<EaseSpec, EasingFunction>();\n\nfunction shapeOf(transition: AudioTransition): EasingFunction {\n const curve = transition.curve;\n if (curve === undefined || curve === \"equalPower\") return EQUAL_POWER;\n let shape = shapes.get(curve);\n if (!shape) shapes.set(curve, (shape = easeOfSpec(curve)));\n return shape;\n}\n\n/**\n * The two transitions' durations on a clip `length` seconds long: shrunk in\n * proportion when together they would overrun it.\n */\nexport function transitionSpans(length: number, transitionIn?: AudioTransition, transitionOut?: AudioTransition): { readonly in: number; readonly out: number } {\n const wanted = { in: Math.max(0, transitionIn?.duration ?? 0), out: Math.max(0, transitionOut?.duration ?? 0) };\n if (!Number.isFinite(length)) return { in: wanted.in, out: 0 };\n const total = wanted.in + wanted.out;\n if (total <= length || total === 0) return wanted;\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(`[motionscript] Transitions of ${total.toFixed(3)}s overrun a ${length.toFixed(3)}s clip; both are shortened to fit.`);\n }\n const scale = Math.max(0, length) / total;\n return { in: wanted.in * scale, out: wanted.out * scale };\n}\n\n/**\n * The gain the transitions put on a clip at `t` of its `length` seconds: 1\n * outside both. An open clip (`length` not finite) has no end to leave from.\n */\nexport function transitionGainAt(t: number, length: number, transitionIn?: AudioTransition, transitionOut?: AudioTransition): number {\n const spans = transitionSpans(length, transitionIn, transitionOut);\n let gain = 1;\n if (transitionIn && spans.in > 0 && t < spans.in) gain *= Math.max(0, shapeOf(transitionIn)(Math.max(0, t) / spans.in));\n if (transitionOut && spans.out > 0 && t > length - spans.out) gain *= Math.max(0, shapeOf(transitionOut)(Math.max(0, length - t) / spans.out));\n return gain;\n}\n\nexport function transitionKey(transition: AudioTransition | undefined): string {\n if (!transition) return \"_\";\n return `${transition.duration}:${typeof transition.curve === \"object\" ? JSON.stringify(transition.curve) : transition.curve ?? \"equalPower\"}`;\n}\n"]}
@@ -1,57 +1,25 @@
1
1
  import { Vector2 } from "./vector2.js";
2
2
  import { BoxBounds } from "../../layout/bounds.js";
3
3
  import type { AttributeOps } from "../../attributes/shared/operators.js";
4
- /**
5
- * Named positions inside a box: the nine alignment keys (`center`, `topLeft`, …).
6
- * Each maps to a per-axis point in `[-1, 1]`: x is -1 (left) … +1 (right), y is
7
- * -1 (bottom) … +1 (top) — the y-up convention used throughout layout.
8
- */
4
+ /** The nine named positions inside a box (`center`, `topLeft`, …), each a per-axis point in `[-1, 1]` (x -1 left … +1 right, y -1 bottom … +1 top: layout's y-up convention). */
9
5
  export type AlignmentKey = "center" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "topCenter" | "bottomCenter" | "centerLeft" | "centerRight";
10
- /**
11
- * A normalised point inside a box — the single value type behind every "which
12
- * point of this thing" prop: `Node2D.pivot` (what it rotates about), a container's
13
- * `align` (where children sit), a gradient's `center` (where it emits from) and
14
- * an image fill's `anchor` (which point of the source meets the box).
15
- *
16
- * Those props keep distinct names because they position *different things*; what
17
- * they share is this type, this `[-1, 1]` y-up space, and this vocabulary — so a
18
- * value read off one can be handed to another and mean the same place.
19
- *
20
- * Accepts a named position (`'center'`) or an explicit {@link Vector2}.
21
- */
6
+ /** A normalised point inside a box: the one type behind every "which point of this thing" prop (`Node2D.pivot`, a container's `align`, a gradient's `center`, an image fill's `anchor`). They keep distinct names because they position different things, but share this `[-1, 1]` y-up space so a value read off one can be handed to another. A named position or a {@link Vector2}. */
22
7
  export type Alignment = AlignmentKey | Vector2;
23
- /**
24
- * The alignment attribute's op set: `pivot`, `align`, `center` and `anchor` all
25
- * use `resolve`/`lerp`. The rest is the shared alignment-*positioning* math for
26
- * `Node2D` — used by both the constructor (reactive binding form) and a `to()`
27
- * step (one-shot form): a named alignment (`'topRight'`, `'centerLeft'`, …)
28
- * resolves to a normalised pivot `a` in `[-1, 1]` (y-up), and landing that
29
- * alignment on a target scene-space point means the node's centre sits at
30
- * `target - a·(size/2)` — the inverse of the offset from centre to the
31
- * alignment. Kept here rather than duplicated between `Node2D`'s constructor
32
- * and `_prepareStep`.
33
- */
8
+ /** The alignment attribute's op set: `resolve`/`lerp` for `pivot`, `align`, `center` and `anchor`, plus the shared alignment-*positioning* math for `Node2D` (constructor binding and one-shot `to()`): landing a named alignment (pivot `a`, y-up) on a target scene-space point puts the node's centre at `target - a·(size/2)`. */
34
9
  export type AlignmentOps = {
35
10
  /** The nine named keys in reading order, top-left to bottom-right. */
36
11
  readonly keys: readonly AlignmentKey[];
37
- /** Whether `value` is one of the nine named keys — the strings `resolve` accepts. */
38
12
  isKey(value: unknown): value is AlignmentKey;
39
- /** Validate a node's alignment-positioning props: at most one named alignment, and an
40
- * alignment cannot be combined with an explicit `pivot` (the alignment derives one). */
13
+ /** Validates a node's alignment props: at most one named alignment, never combined with an explicit `pivot` (the alignment derives one). */
41
14
  validateProps(props: Record<string, unknown>): void;
42
- /** The first named alignment key present in `props`, or `undefined` if none. */
43
15
  findKey(props: Record<string, unknown>): AlignmentKey | undefined;
44
- /** Resolve a named alignment + the centre offset that lands it on `target`, given a
45
- * concrete layout rect. Used by the one-shot `to()` path: returns the pivot to
46
- * apply plus the absolute `x`/`y` the node's centre must move to. */
16
+ /** Resolves a named alignment and the centre offset that lands it on `target` for a concrete layout rect (one-shot `to()`): the pivot plus the absolute `x`/`y` the centre moves to. */
47
17
  resolveTargetOnce(alignmentKey: AlignmentKey, rect: BoxBounds, target: Vector2): {
48
18
  pivot: Vector2;
49
19
  x: number;
50
20
  y: number;
51
21
  };
52
- /** Reactive binding form used by the constructor: given a (possibly dynamic) target
53
- * accessor and a live layout-rect accessor, returns the pivot to write plus `x`/`y`
54
- * binding callbacks that re-evaluate whenever the target or the node's layout changes. */
22
+ /** Reactive form for the constructor: returns the pivot to write plus `x`/`y` binding callbacks that re-evaluate when the target or the node's layout changes. */
55
23
  bindTarget(alignmentKey: AlignmentKey, getTarget: () => Vector2, getRect: () => BoxBounds): {
56
24
  pivot: Vector2;
57
25
  x: () => number;
@@ -1 +1 @@
1
- {"version":3,"file":"alignment.d.ts","sourceRoot":"","sources":["../../../src/attributes/layout/alignment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAe,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAElE;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAClB,QAAQ,GACR,SAAS,GACT,UAAU,GACV,YAAY,GACZ,aAAa,GACb,WAAW,GACX,c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AC;QACnC,OAAO;YACH,KAAK,EAAE,CAAC;YACR,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;YACpC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;SACxC,CAAC;IACN,CAAC;IAED,UAAU,CAAC,YAAY,EAAE,SAAS,EAAE,OAAO;QACvC,MAAM,CAAC,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;QACnC,OAAO;YACH,KAAK,EAAE,CAAC;YACR,CAAC,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,KAAK,GAAG,CAAC,CAAC;YACpD,CAAC,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;SACxD,CAAC;IACN,CAAC;CACJ,CAAC","sourcesContent":["import { Vector2, lerpVector2 } from \"./vector2\";\nimport { BoxBounds } from \"@/layout/bounds\";\nimport type { AttributeOps } from \"@/attributes/shared/operators\";\n\n/**\n * Named positions inside a box: the nine alignment keys (`center`, `topLeft`, …).\n * Each maps to a per-axis point in `[-1, 1]`: x is -1 (left) … +1 (right), y is\n * -1 (bottom) … +1 (top) — the y-up convention used throughout layout.\n */\nexport type AlignmentKey =\n | \"center\"\n | \"topLeft\"\n | \"topRight\"\n | \"bottomLeft\"\n | \"bottomRight\"\n | \"topCenter\"\n | \"bottomCenter\"\n | \"centerLeft\"\n | \"centerRight\";\n\n/**\n * A normalised point inside a box — the single value type behind every \"which\n * point of this thing\" prop: `Node2D.pivot` (what it rotates about), a container's\n * `align` (where children sit), a gradient's `center` (where it emits from) and\n * an image fill's `anchor` (which point of the source meets the box).\n *\n * Those props keep distinct names because they position *different things*; what\n * they share is this type, this `[-1, 1]` y-up space, and this vocabulary — so a\n * value read off one can be handed to another and mean the same place.\n *\n * Accepts a named position (`'center'`) or an explicit {@link Vector2}.\n */\nexport type Alignment = AlignmentKey | Vector2;\n\nconst ALIGNMENTS: Record<AlignmentKey, Vector2> = {\n topLeft: { x: -1, y: 1 },\n topCenter: { x: 0, y: 1 },\n topRight: { x: 1, y: 1 },\n centerLeft: { x: -1, y: 0 },\n center: { x: 0, y: 0 },\n centerRight: { x: 1, y: 0 },\n bottomLeft: { x: -1, y: -1 },\n bottomCenter: { x: 0, y: -1 },\n bottomRight: { x: 1, y: -1 },\n};\n\n/** The nine named alignment keys in reading order: top row left to right, then\n * the middle row, then the bottom row. */\nconst ALIGNMENT_KEYS: readonly AlignmentKey[] = Object.keys(ALIGNMENTS) as AlignmentKey[];\n\n// `resolve`'s own logic, pulled out only so the alignment-positioning helpers\n// below can reach it without going through a `this`-bound method call.\nfunction resolveOne(value: Alignment): Vector2 {\n if (typeof value === \"string\") {\n const named = Object.hasOwn(ALIGNMENTS, value) ? ALIGNMENTS[value] : undefined;\n if (!named) {\n throw new Error(`Unknown alignment value: '${value}'`);\n }\n return { ...named };\n }\n return { x: value.x, y: value.y };\n}\n\n/**\n * The alignment attribute's op set: `pivot`, `align`, `center` and `anchor` all\n * use `resolve`/`lerp`. The rest is the shared alignment-*positioning* math for\n * `Node2D` — used by both the constructor (reactive binding form) and a `to()`\n * step (one-shot form): a named alignment (`'topRight'`, `'centerLeft'`, …)\n * resolves to a normalised pivot `a` in `[-1, 1]` (y-up), and landing that\n * alignment on a target scene-space point means the node's centre sits at\n * `target - a·(size/2)` — the inverse of the offset from centre to the\n * alignment. Kept here rather than duplicated between `Node2D`'s constructor\n * and `_prepareStep`.\n */\n\nexport type AlignmentOps = {\n /** The nine named keys in reading order, top-left to bottom-right. */\n readonly keys: readonly AlignmentKey[];\n /** Whether `value` is one of the nine named keys — the strings `resolve` accepts. */\n isKey(value: unknown): value is AlignmentKey;\n /** Validate a node's alignment-positioning props: at most one named alignment, and an\n * alignment cannot be combined with an explicit `pivot` (the alignment derives one). */\n validateProps(props: Record<string, unknown>): void;\n /** The first named alignment key present in `props`, or `undefined` if none. */\n findKey(props: Record<string, unknown>): AlignmentKey | undefined;\n /** Resolve a named alignment + the centre offset that lands it on `target`, given a\n * concrete layout rect. Used by the one-shot `to()` path: returns the pivot to\n * apply plus the absolute `x`/`y` the node's centre must move to. */\n resolveTargetOnce(alignmentKey: AlignmentKey, rect: BoxBounds, target: Vector2): { pivot: Vector2; x: number; y: number };\n /** Reactive binding form used by the constructor: given a (possibly dynamic) target\n * accessor and a live layout-rect accessor, returns the pivot to write plus `x`/`y`\n * binding callbacks that re-evaluate whenever the target or the node's layout changes. */\n bindTarget(alignmentKey: AlignmentKey, getTarget: () => Vector2, getRect: () => BoxBounds): { pivot: Vector2; x: () => number; y: () => number };\n}\nexport const alignmentOps: AttributeOps<Alignment, Vector2> & AlignmentOps = {\n resolve: resolveOne,\n lerp: lerpVector2,\n keys: ALIGNMENT_KEYS,\n\n isKey(value): value is AlignmentKey {\n return typeof value === \"string\" && Object.hasOwn(ALIGNMENTS, value);\n },\n\n validateProps(props) {\n const present = ALIGNMENT_KEYS.filter(k => props[k] !== undefined);\n if (present.length > 1) {\n throw new Error(`Cannot set multiple alignment props at once: ${present.join(', ')}`);\n }\n if (present.length === 1 && props['pivot'] !== undefined) {\n throw new Error(`Cannot set both alignment prop '${present[0]}' and 'pivot' at the same time`);\n }\n },\n\n findKey(props) {\n return ALIGNMENT_KEYS.find(k => props[k] !== undefined);\n },\n\n resolveTargetOnce(alignmentKey, rect, target) {\n const a = resolveOne(alignmentKey);\n return {\n pivot: a,\n x: target.x - a.x * (rect.width / 2),\n y: target.y - a.y * (rect.height / 2),\n };\n },\n\n bindTarget(alignmentKey, getTarget, getRect) {\n const a = resolveOne(alignmentKey);\n return {\n pivot: a,\n x: () => getTarget().x - a.x * (getRect().width / 2),\n y: () => getTarget().y - a.y * (getRect().height / 2),\n };\n },\n};\n"]}
1
+ {"version":3,"file":"alignment.js","sourceRoot":"","sources":["../../../src/attributes/layout/alignment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,WAAW,EAAE,MAAM,WAAW,CAAC;AAmBjD,MAAM,UAAU,GAAkC;IAC9C,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;IACxB,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;IACzB,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;IACxB,UAAU,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;IAC3B,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;IACtB,WAAW,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;IAC3B,UAAU,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE;IAC5B,YAAY,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE;IAC7B,WAAW,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE;CAC/B,CAAC;AAEF;0CAC0C;AAC1C,MAAM,cAAc,GAA4B,MAAM,CAAC,IAAI,CAAC,UAAU,CAAmB,CAAC;AAE1F,8EAA8E;AAC9E,uEAAuE;AACvE,SAAS,UAAU,CAAC,KAAgB;IAChC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC5B,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC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AAE,MAAM;QACxC,MAAM,CAAC,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;QACnC,OAAO;YACH,KAAK,EAAE,CAAC;YACR,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;YACpC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;SACxC,CAAC;IACN,CAAC;IAED,UAAU,CAAC,YAAY,EAAE,SAAS,EAAE,OAAO;QACvC,MAAM,CAAC,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;QACnC,OAAO;YACH,KAAK,EAAE,CAAC;YACR,CAAC,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,KAAK,GAAG,CAAC,CAAC;YACpD,CAAC,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;SACxD,CAAC;IACN,CAAC;CACJ,CAAC","sourcesContent":["import { Vector2, lerpVector2 } from \"./vector2\";\nimport { BoxBounds } from \"@/layout/bounds\";\nimport type { AttributeOps } from \"@/attributes/shared/operators\";\n\n/** The nine named positions inside a box (`center`, `topLeft`, …), each a per-axis point in `[-1, 1]` (x -1 left … +1 right, y -1 bottom … +1 top: layout's y-up convention). */\nexport type AlignmentKey =\n | \"center\"\n | \"topLeft\"\n | \"topRight\"\n | \"bottomLeft\"\n | \"bottomRight\"\n | \"topCenter\"\n | \"bottomCenter\"\n | \"centerLeft\"\n | \"centerRight\";\n\n/** A normalised point inside a box: the one type behind every \"which point of this thing\" prop (`Node2D.pivot`, a container's `align`, a gradient's `center`, an image fill's `anchor`). They keep distinct names because they position different things, but share this `[-1, 1]` y-up space so a value read off one can be handed to another. A named position or a {@link Vector2}. */\nexport type Alignment = AlignmentKey | Vector2;\n\nconst ALIGNMENTS: Record<AlignmentKey, Vector2> = {\n topLeft: { x: -1, y: 1 },\n topCenter: { x: 0, y: 1 },\n topRight: { x: 1, y: 1 },\n centerLeft: { x: -1, y: 0 },\n center: { x: 0, y: 0 },\n centerRight: { x: 1, y: 0 },\n bottomLeft: { x: -1, y: -1 },\n bottomCenter: { x: 0, y: -1 },\n bottomRight: { x: 1, y: -1 },\n};\n\n/** The nine named alignment keys in reading order: top row left to right, then\n * the middle row, then the bottom row. */\nconst ALIGNMENT_KEYS: readonly AlignmentKey[] = Object.keys(ALIGNMENTS) as AlignmentKey[];\n\n// `resolve`'s own logic, pulled out only so the alignment-positioning helpers\n// below can reach it without going through a `this`-bound method call.\nfunction resolveOne(value: Alignment): Vector2 {\n if (typeof value === \"string\") {\n const named = Object.hasOwn(ALIGNMENTS, value) ? ALIGNMENTS[value] : undefined;\n if (!named) {\n throw new Error(`Unknown alignment value: '${value}'`);\n }\n return { ...named };\n }\n return { x: value.x, y: value.y };\n}\n\n/** The alignment attribute's op set: `resolve`/`lerp` for `pivot`, `align`, `center` and `anchor`, plus the shared alignment-*positioning* math for `Node2D` (constructor binding and one-shot `to()`): landing a named alignment (pivot `a`, y-up) on a target scene-space point puts the node's centre at `target - a·(size/2)`. */\n\nexport type AlignmentOps = {\n /** The nine named keys in reading order, top-left to bottom-right. */\n readonly keys: readonly AlignmentKey[];\n isKey(value: unknown): value is AlignmentKey;\n /** Validates a node's alignment props: at most one named alignment, never combined with an explicit `pivot` (the alignment derives one). */\n validateProps(props: Record<string, unknown>): void;\n findKey(props: Record<string, unknown>): AlignmentKey | undefined;\n /** Resolves a named alignment and the centre offset that lands it on `target` for a concrete layout rect (one-shot `to()`): the pivot plus the absolute `x`/`y` the centre moves to. */\n resolveTargetOnce(alignmentKey: AlignmentKey, rect: BoxBounds, target: Vector2): { pivot: Vector2; x: number; y: number };\n /** Reactive form for the constructor: returns the pivot to write plus `x`/`y` binding callbacks that re-evaluate when the target or the node's layout changes. */\n bindTarget(alignmentKey: AlignmentKey, getTarget: () => Vector2, getRect: () => BoxBounds): { pivot: Vector2; x: () => number; y: () => number };\n}\nexport const alignmentOps: AttributeOps<Alignment, Vector2> & AlignmentOps = {\n resolve: resolveOne,\n lerp: lerpVector2,\n keys: ALIGNMENT_KEYS,\n\n isKey(value): value is AlignmentKey {\n return typeof value === \"string\" && Object.hasOwn(ALIGNMENTS, value);\n },\n\n validateProps(props) {\n const present = ALIGNMENT_KEYS.filter(k => props[k] !== undefined);\n if (present.length > 1) {\n throw new Error(`Cannot set multiple alignment props at once: ${present.join(', ')}`);\n }\n if (present.length === 1 && props['pivot'] !== undefined) {\n throw new Error(`Cannot set both alignment prop '${present[0]}' and 'pivot' at the same time`);\n }\n },\n\n findKey(props) {\n return ALIGNMENT_KEYS.find(k => props[k] !== undefined);\n },\n\n resolveTargetOnce(alignmentKey, rect, target) {\n const a = resolveOne(alignmentKey);\n return {\n pivot: a,\n x: target.x - a.x * (rect.width / 2),\n y: target.y - a.y * (rect.height / 2),\n };\n },\n\n bindTarget(alignmentKey, getTarget, getRect) {\n const a = resolveOne(alignmentKey);\n return {\n pivot: a,\n x: () => getTarget().x - a.x * (getRect().width / 2),\n y: () => getTarget().y - a.y * (getRect().height / 2),\n };\n },\n};\n"]}
@@ -12,34 +12,9 @@ export type InsetsProps = number | Partial<InsetsResolved> & {
12
12
  horizontal?: number;
13
13
  vertical?: number;
14
14
  };
15
- /**
16
- * Accepted shapes for a four-sided inset prop.
17
- *
18
- * The type is named for the shape (four edge insets), not for one use of it:
19
- * `Node2D.padding` insets a layout box in pixels, an image fill's `crop` insets a
20
- * source in fractions. Same value, same shorthands, same tween — different roles,
21
- * and each prop names its own.
22
- *
23
- * Mirrors {@link Fill}: the loose author-facing {@link InsetsProps} (a number or
24
- * per-side/symmetric object) plus the strict {@link InsetsResolved} — a read-back
25
- * resolved value structurally satisfies `InsetsProps`, so it passes through
26
- * `insetsOps.resolve` idempotently and can be assigned straight back.
27
- *
28
- * node.padding = 3 // uniform
29
- * node.padding = { horizontal: 8, top: 4 } // mixed
30
- * node.padding = otherNode.padding // resolved passes through
31
- */
15
+ /** Accepted shapes for a four-sided inset prop, named for the shape, not one use (`Node2D.padding` insets a layout box in px, an image fill's `crop` a source in fractions). The loose {@link InsetsProps} (a number or per-side/symmetric object) plus the strict {@link InsetsResolved}; a read-back resolved value satisfies `InsetsProps`, so it passes through `insetsOps.resolve` idempotently. */
32
16
  export type Insets = InsetsProps | InsetsResolved;
33
- /**
34
- * The insets attribute's op set — used by `insetsProperty` and anywhere else a
35
- * four-sided inset (padding, an image fill's `crop`, …) resolves and tweens.
36
- *
37
- * `insetBounds` computes the inner content area produced by subtracting a
38
- * resolved inset from an outer size — pure, works for any width/height pair,
39
- * with `x`/`y` carrying the offset of the inner-area center relative to the
40
- * outer-area center. `outsetSize` is its inverse: adds padding back onto
41
- * an inner size to get the outer size that contains it.
42
- */
17
+ /** The insets attribute's op set (padding, an image fill's `crop`, …). `insetBounds` subtracts a resolved inset from an outer size, with `x`/`y` the offset of the inner centre from the outer centre; `outsetSize` is its inverse. */
43
18
  export interface InsetsOps {
44
19
  insetBounds(outerWidth: number, outerHeight: number, pad: InsetsResolved): BoxBounds;
45
20
  outsetSize(innerWidth: number, innerHeight: number, pad: InsetsResolved): Size2D;
@@ -1 +1 @@
1
- {"version":3,"file":"insets.d.ts","sourceRoot":"","sources":["../../../src/attributes/layout/insets.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,2CAA2C;AAC3C,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CA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["import { lerpNumber } from \"@/tween/lerp\";\nimport type { AttributeOps } from \"@/attributes/shared/operators\";\nimport type { BoxBounds } from \"@/layout/bounds\";\nimport { Size2D } from \"./size\";\n\n/** Fully resolved per-side edge insets. */\nexport interface InsetsResolved {\n left: number;\n right: number;\n top: number;\n bottom: number;\n}\n\n\nexport type InsetsProps = number | Partial<InsetsResolved> & {\n horizontal?: number;\n vertical?: number;\n};\n\n/**\n * Accepted shapes for a four-sided inset prop.\n *\n * The type is named for the shape (four edge insets), not for one use of it:\n * `Node2D.padding` insets a layout box in pixels, an image fill's `crop` insets a\n * source in fractions. Same value, same shorthands, same tween — different roles,\n * and each prop names its own.\n *\n * Mirrors {@link Fill}: the loose author-facing {@link InsetsProps} (a number or\n * per-side/symmetric object) plus the strict {@link InsetsResolved} — a read-back\n * resolved value structurally satisfies `InsetsProps`, so it passes through\n * `insetsOps.resolve` idempotently and can be assigned straight back.\n *\n * node.padding = 3 // uniform\n * node.padding = { horizontal: 8, top: 4 } // mixed\n * node.padding = otherNode.padding // resolved passes through\n */\nexport type Insets = InsetsProps | InsetsResolved;\n\n\n/**\n * The insets attribute's op set — used by `insetsProperty` and anywhere else a\n * four-sided inset (padding, an image fill's `crop`, …) resolves and tweens.\n *\n * `insetBounds` computes the inner content area produced by subtracting a\n * resolved inset from an outer size — pure, works for any width/height pair,\n * with `x`/`y` carrying the offset of the inner-area center relative to the\n * outer-area center. `outsetSize` is its inverse: adds padding back onto\n * an inner size to get the outer size that contains it.\n */\n\nexport interface InsetsOps {\n\n insetBounds(outerWidth: number, outerHeight: number, pad: InsetsResolved): BoxBounds;\n outsetSize(innerWidth: number, innerHeight: number, pad: InsetsResolved): Size2D;\n}\n\nexport const insetsOps: AttributeOps<InsetsProps, InsetsResolved> & InsetsOps = {\n resolve: (value: InsetsProps, previous?: InsetsResolved): InsetsResolved => {\n if (typeof value === \"number\") {\n return { left: value, right: value, top: value, bottom: value };\n }\n\n // Fallback resolution order: Specific side -> Symmetric shortcut -> Previous fallback -> Default 0\n return {\n left: value.left ?? value.horizontal ?? previous?.left ?? 0,\n right: value.right ?? value.horizontal ?? previous?.right ?? 0,\n top: value.top ?? value.vertical ?? previous?.top ?? 0,\n bottom: value.bottom ?? value.vertical ?? previous?.bottom ?? 0,\n };\n },\n lerp: (from: InsetsResolved, to: InsetsResolved, t: number): InsetsResolved => {\n return {\n left: lerpNumber(from.left, to.left, t),\n right: lerpNumber(from.right, to.right, t),\n top: lerpNumber(from.top, to.top, t),\n bottom: lerpNumber(from.bottom, to.bottom, t),\n };\n },\n insetBounds: (outerWidth, outerHeight, pad) => ({\n width: Math.max(0, outerWidth - pad.left - pad.right),\n height: Math.max(0, outerHeight - pad.top - pad.bottom),\n x: (pad.left - pad.right) / 2,\n y: (pad.top - pad.bottom) / 2,\n }),\n outsetSize: (innerWidth, innerHeight, pad) => ({\n width: innerWidth + pad.left + pad.right,\n height: innerHeight + pad.top + pad.bottom,\n }),\n};\n"]}
1
+ {"version":3,"file":"insets.js","sourceRoot":"","sources":["../../../src/attributes/layout/insets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA+B1C,MAAM,CAAC,MAAM,SAAS,GAA0D;IAC5E,OAAO,EAAE,CAAC,KAAkB,EAAE,QAAyB,EAAkB,EAAE;QACvE,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC5B,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;QACpE,CAAC;QAED,mGAAmG;QACnG,OAAO;YACH,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,UAAU,IAAI,QAAQ,EAAE,IAAI,IAAI,CAAC;YAC3D,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,UAAU,IAAI,QAAQ,EAAE,KAAK,IAAI,CAAC;YAC9D,GAAG,E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CAAC;QAC3C,KAAK,EAAE,UAAU,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,KAAK;QACxC,MAAM,EAAE,WAAW,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,MAAM;KAC7C,CAAC;CACL,CAAC","sourcesContent":["import { lerpNumber } from \"@/tween/lerp\";\nimport type { AttributeOps } from \"@/attributes/shared/operators\";\nimport type { BoxBounds } from \"@/layout/bounds\";\nimport { Size2D } from \"./size\";\n\n/** Fully resolved per-side edge insets. */\nexport interface InsetsResolved {\n left: number;\n right: number;\n top: number;\n bottom: number;\n}\n\n\nexport type InsetsProps = number | Partial<InsetsResolved> & {\n horizontal?: number;\n vertical?: number;\n};\n\n/** Accepted shapes for a four-sided inset prop, named for the shape, not one use (`Node2D.padding` insets a layout box in px, an image fill's `crop` a source in fractions). The loose {@link InsetsProps} (a number or per-side/symmetric object) plus the strict {@link InsetsResolved}; a read-back resolved value satisfies `InsetsProps`, so it passes through `insetsOps.resolve` idempotently. */\nexport type Insets = InsetsProps | InsetsResolved;\n\n\n/** The insets attribute's op set (padding, an image fill's `crop`, …). `insetBounds` subtracts a resolved inset from an outer size, with `x`/`y` the offset of the inner centre from the outer centre; `outsetSize` is its inverse. */\n\nexport interface InsetsOps {\n\n insetBounds(outerWidth: number, outerHeight: number, pad: InsetsResolved): BoxBounds;\n outsetSize(innerWidth: number, innerHeight: number, pad: InsetsResolved): Size2D;\n}\n\nexport const insetsOps: AttributeOps<InsetsProps, InsetsResolved> & InsetsOps = {\n resolve: (value: InsetsProps, previous?: InsetsResolved): InsetsResolved => {\n if (typeof value === \"number\") {\n return { left: value, right: value, top: value, bottom: value };\n }\n\n // Fallback resolution order: Specific side -> Symmetric shortcut -> Previous fallback -> Default 0\n return {\n left: value.left ?? value.horizontal ?? previous?.left ?? 0,\n right: value.right ?? value.horizontal ?? previous?.right ?? 0,\n top: value.top ?? value.vertical ?? previous?.top ?? 0,\n bottom: value.bottom ?? value.vertical ?? previous?.bottom ?? 0,\n };\n },\n lerp: (from: InsetsResolved, to: InsetsResolved, t: number): InsetsResolved => {\n return {\n left: lerpNumber(from.left, to.left, t),\n right: lerpNumber(from.right, to.right, t),\n top: lerpNumber(from.top, to.top, t),\n bottom: lerpNumber(from.bottom, to.bottom, t),\n };\n },\n insetBounds: (outerWidth, outerHeight, pad) => ({\n width: Math.max(0, outerWidth - pad.left - pad.right),\n height: Math.max(0, outerHeight - pad.top - pad.bottom),\n x: (pad.left - pad.right) / 2,\n y: (pad.top - pad.bottom) / 2,\n }),\n outsetSize: (innerWidth, innerHeight, pad) => ({\n width: innerWidth + pad.left + pad.right,\n height: innerHeight + pad.top + pad.bottom,\n }),\n};\n"]}