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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (804) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/NOTICE +15 -14
  3. package/README.md +5 -7
  4. package/dist/assets/errors.js +4 -5
  5. package/dist/assets/errors.js.map +1 -1
  6. package/dist/assets/manager.d.ts.map +1 -1
  7. package/dist/assets/manager.js +7 -5
  8. package/dist/assets/manager.js.map +1 -1
  9. package/dist/assets/scope.d.ts +1 -1
  10. package/dist/assets/scope.d.ts.map +1 -1
  11. package/dist/assets/scope.js +1 -1
  12. package/dist/assets/scope.js.map +1 -1
  13. package/dist/attributes/audio/effects/chain.d.ts +73 -0
  14. package/dist/attributes/audio/effects/chain.d.ts.map +1 -0
  15. package/dist/attributes/audio/effects/chain.js +67 -0
  16. package/dist/attributes/audio/effects/chain.js.map +1 -0
  17. package/dist/attributes/audio/effects/implementations/echo.d.ts +14 -0
  18. package/dist/attributes/audio/effects/implementations/echo.d.ts.map +1 -0
  19. package/dist/attributes/audio/effects/implementations/echo.js +11 -0
  20. package/dist/attributes/audio/effects/implementations/echo.js.map +1 -0
  21. package/dist/attributes/audio/effects/implementations/gain.d.ts +10 -0
  22. package/dist/attributes/audio/effects/implementations/gain.d.ts.map +1 -0
  23. package/dist/attributes/audio/effects/implementations/gain.js +6 -0
  24. package/dist/attributes/audio/effects/implementations/gain.js.map +1 -0
  25. package/dist/attributes/audio/effects/implementations/highpass.d.ts +12 -0
  26. package/dist/attributes/audio/effects/implementations/highpass.d.ts.map +1 -0
  27. package/dist/attributes/audio/effects/implementations/highpass.js +10 -0
  28. package/dist/attributes/audio/effects/implementations/highpass.js.map +1 -0
  29. package/dist/attributes/audio/effects/implementations/lowpass.d.ts +12 -0
  30. package/dist/attributes/audio/effects/implementations/lowpass.d.ts.map +1 -0
  31. package/dist/attributes/audio/effects/implementations/lowpass.js +10 -0
  32. package/dist/attributes/audio/effects/implementations/lowpass.js.map +1 -0
  33. package/dist/attributes/audio/effects/implementations/tremolo.d.ts +12 -0
  34. package/dist/attributes/audio/effects/implementations/tremolo.d.ts.map +1 -0
  35. package/dist/attributes/audio/effects/implementations/tremolo.js +10 -0
  36. package/dist/attributes/audio/effects/implementations/tremolo.js.map +1 -0
  37. package/dist/attributes/audio/effects/index.d.ts +12 -0
  38. package/dist/attributes/audio/effects/index.d.ts.map +1 -0
  39. package/dist/attributes/audio/effects/index.js +4 -0
  40. package/dist/attributes/audio/effects/index.js.map +1 -0
  41. package/dist/attributes/audio/effects/registry.d.ts +36 -0
  42. package/dist/attributes/audio/effects/registry.d.ts.map +1 -0
  43. package/dist/attributes/audio/effects/registry.js +80 -0
  44. package/dist/attributes/audio/effects/registry.js.map +1 -0
  45. package/dist/attributes/audio/effects/union.d.ts +14 -0
  46. package/dist/attributes/audio/effects/union.d.ts.map +1 -0
  47. package/dist/attributes/audio/effects/union.js +24 -0
  48. package/dist/attributes/audio/effects/union.js.map +1 -0
  49. package/dist/attributes/audio/ramp.d.ts +103 -0
  50. package/dist/attributes/audio/ramp.d.ts.map +1 -0
  51. package/dist/attributes/audio/ramp.js +246 -0
  52. package/dist/attributes/audio/ramp.js.map +1 -0
  53. package/dist/attributes/audio/request.d.ts +24 -13
  54. package/dist/attributes/audio/request.d.ts.map +1 -1
  55. package/dist/attributes/audio/request.js +4 -3
  56. package/dist/attributes/audio/request.js.map +1 -1
  57. package/dist/attributes/audio/schedule.d.ts +24 -31
  58. package/dist/attributes/audio/schedule.d.ts.map +1 -1
  59. package/dist/attributes/audio/schedule.js +42 -28
  60. package/dist/attributes/audio/schedule.js.map +1 -1
  61. package/dist/attributes/audio/sound.d.ts +15 -12
  62. package/dist/attributes/audio/sound.d.ts.map +1 -1
  63. package/dist/attributes/audio/sound.js +8 -10
  64. package/dist/attributes/audio/sound.js.map +1 -1
  65. package/dist/attributes/audio/transition.d.ts +33 -0
  66. package/dist/attributes/audio/transition.d.ts.map +1 -0
  67. package/dist/attributes/audio/transition.js +48 -0
  68. package/dist/attributes/audio/transition.js.map +1 -0
  69. package/dist/attributes/index.d.ts +7 -8
  70. package/dist/attributes/index.d.ts.map +1 -1
  71. package/dist/attributes/index.js +6 -9
  72. package/dist/attributes/index.js.map +1 -1
  73. package/dist/attributes/layout/insets.d.ts +1 -1
  74. package/dist/attributes/layout/insets.js.map +1 -1
  75. package/dist/attributes/layout/matrix2d.d.ts +2 -2
  76. package/dist/attributes/layout/matrix2d.js.map +1 -1
  77. package/dist/attributes/layout/size.d.ts +1 -1
  78. package/dist/attributes/layout/size.js +1 -1
  79. package/dist/attributes/layout/size.js.map +1 -1
  80. package/dist/attributes/layout/space3d.js +1 -1
  81. package/dist/attributes/layout/space3d.js.map +1 -1
  82. package/dist/attributes/properties/decorator.d.ts +44 -11
  83. package/dist/attributes/properties/decorator.d.ts.map +1 -1
  84. package/dist/attributes/properties/decorator.js +37 -9
  85. package/dist/attributes/properties/decorator.js.map +1 -1
  86. package/dist/attributes/properties/inputs.d.ts +1 -1
  87. package/dist/attributes/properties/inputs.js +1 -1
  88. package/dist/attributes/properties/inputs.js.map +1 -1
  89. package/dist/attributes/properties/typed.d.ts +24 -145
  90. package/dist/attributes/properties/typed.d.ts.map +1 -1
  91. package/dist/attributes/properties/typed.js +16 -112
  92. package/dist/attributes/properties/typed.js.map +1 -1
  93. package/dist/attributes/shape/corners/corner-radius.d.ts +2 -3
  94. package/dist/attributes/shape/corners/corner-radius.d.ts.map +1 -1
  95. package/dist/attributes/shape/corners/corner-radius.js +2 -3
  96. package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
  97. package/dist/attributes/shape/effects/chain.d.ts +96 -409
  98. package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
  99. package/dist/attributes/shape/effects/chain.js +93 -283
  100. package/dist/attributes/shape/effects/chain.js.map +1 -1
  101. package/dist/attributes/shape/effects/effect-data.d.ts +1 -1
  102. package/dist/attributes/shape/effects/effect-data.js.map +1 -1
  103. package/dist/attributes/shape/effects/implementations/ascii.d.ts +45 -13
  104. package/dist/attributes/shape/effects/implementations/ascii.d.ts.map +1 -1
  105. package/dist/attributes/shape/effects/implementations/ascii.js +29 -23
  106. package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
  107. package/dist/attributes/shape/effects/implementations/bit-crush.d.ts +32 -7
  108. package/dist/attributes/shape/effects/implementations/bit-crush.d.ts.map +1 -1
  109. package/dist/attributes/shape/effects/implementations/bit-crush.js +17 -15
  110. package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
  111. package/dist/attributes/shape/effects/implementations/block-displace.d.ts +46 -10
  112. package/dist/attributes/shape/effects/implementations/block-displace.d.ts.map +1 -1
  113. package/dist/attributes/shape/effects/implementations/block-displace.js +21 -19
  114. package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
  115. package/dist/attributes/shape/effects/implementations/bloom.d.ts +32 -7
  116. package/dist/attributes/shape/effects/implementations/bloom.d.ts.map +1 -1
  117. package/dist/attributes/shape/effects/implementations/bloom.js +17 -11
  118. package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
  119. package/dist/attributes/shape/effects/implementations/blur.d.ts +16 -3
  120. package/dist/attributes/shape/effects/implementations/blur.d.ts.map +1 -1
  121. package/dist/attributes/shape/effects/implementations/blur.js +13 -5
  122. package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
  123. package/dist/attributes/shape/effects/implementations/bulge.d.ts +28 -9
  124. package/dist/attributes/shape/effects/implementations/bulge.d.ts.map +1 -1
  125. package/dist/attributes/shape/effects/implementations/bulge.js +15 -14
  126. package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
  127. package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts +21 -5
  128. package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts.map +1 -1
  129. package/dist/attributes/shape/effects/implementations/chromatic-aberration.js +15 -10
  130. package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
  131. package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +96 -26
  132. package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts.map +1 -1
  133. package/dist/attributes/shape/effects/implementations/color-adjustment.js +29 -26
  134. package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
  135. package/dist/attributes/shape/effects/implementations/curves.d.ts +20 -6
  136. package/dist/attributes/shape/effects/implementations/curves.d.ts.map +1 -1
  137. package/dist/attributes/shape/effects/implementations/curves.js +26 -23
  138. package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
  139. package/dist/attributes/shape/effects/implementations/directional-blur.d.ts +26 -5
  140. package/dist/attributes/shape/effects/implementations/directional-blur.d.ts.map +1 -1
  141. package/dist/attributes/shape/effects/implementations/directional-blur.js +15 -10
  142. package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
  143. package/dist/attributes/shape/effects/implementations/dither.d.ts +58 -11
  144. package/dist/attributes/shape/effects/implementations/dither.d.ts.map +1 -1
  145. package/dist/attributes/shape/effects/implementations/dither.js +26 -20
  146. package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
  147. package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts +47 -15
  148. package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts.map +1 -1
  149. package/dist/attributes/shape/effects/implementations/drop-shadow.js +24 -29
  150. package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
  151. package/dist/attributes/shape/effects/implementations/duotone.d.ts +26 -7
  152. package/dist/attributes/shape/effects/implementations/duotone.d.ts.map +1 -1
  153. package/dist/attributes/shape/effects/implementations/duotone.js +17 -16
  154. package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
  155. package/dist/attributes/shape/effects/implementations/edges.d.ts +29 -7
  156. package/dist/attributes/shape/effects/implementations/edges.d.ts.map +1 -1
  157. package/dist/attributes/shape/effects/implementations/edges.js +17 -14
  158. package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
  159. package/dist/attributes/shape/effects/implementations/glass.d.ts +76 -19
  160. package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
  161. package/dist/attributes/shape/effects/implementations/glass.js +28 -22
  162. package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
  163. package/dist/attributes/shape/effects/implementations/glow.d.ts +149 -42
  164. package/dist/attributes/shape/effects/implementations/glow.d.ts.map +1 -1
  165. package/dist/attributes/shape/effects/implementations/glow.js +74 -72
  166. package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
  167. package/dist/attributes/shape/effects/implementations/grain.d.ts +43 -11
  168. package/dist/attributes/shape/effects/implementations/grain.d.ts.map +1 -1
  169. package/dist/attributes/shape/effects/implementations/grain.js +21 -18
  170. package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
  171. package/dist/attributes/shape/effects/implementations/grayscale.d.ts +17 -3
  172. package/dist/attributes/shape/effects/implementations/grayscale.d.ts.map +1 -1
  173. package/dist/attributes/shape/effects/implementations/grayscale.js +13 -5
  174. package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
  175. package/dist/attributes/shape/effects/implementations/halftone.d.ts +40 -9
  176. package/dist/attributes/shape/effects/implementations/halftone.d.ts.map +1 -1
  177. package/dist/attributes/shape/effects/implementations/halftone.js +20 -16
  178. package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
  179. package/dist/attributes/shape/effects/implementations/invert.d.ts +23 -5
  180. package/dist/attributes/shape/effects/implementations/invert.d.ts.map +1 -1
  181. package/dist/attributes/shape/effects/implementations/invert.js +15 -10
  182. package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
  183. package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts +57 -18
  184. package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts.map +1 -1
  185. package/dist/attributes/shape/effects/implementations/kaleidoscope.js +25 -22
  186. package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
  187. package/dist/attributes/shape/effects/implementations/lut.d.ts +34 -7
  188. package/dist/attributes/shape/effects/implementations/lut.d.ts.map +1 -1
  189. package/dist/attributes/shape/effects/implementations/lut.js +20 -16
  190. package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
  191. package/dist/attributes/shape/effects/implementations/magnify.d.ts +27 -9
  192. package/dist/attributes/shape/effects/implementations/magnify.d.ts.map +1 -1
  193. package/dist/attributes/shape/effects/implementations/magnify.js +17 -14
  194. package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
  195. package/dist/attributes/shape/effects/implementations/motion-blur.d.ts +54 -19
  196. package/dist/attributes/shape/effects/implementations/motion-blur.d.ts.map +1 -1
  197. package/dist/attributes/shape/effects/implementations/motion-blur.js +42 -20
  198. package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
  199. package/dist/attributes/shape/effects/implementations/oil-paint.d.ts +17 -3
  200. package/dist/attributes/shape/effects/implementations/oil-paint.d.ts.map +1 -1
  201. package/dist/attributes/shape/effects/implementations/oil-paint.js +13 -9
  202. package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
  203. package/dist/attributes/shape/effects/implementations/outline.d.ts +28 -8
  204. package/dist/attributes/shape/effects/implementations/outline.d.ts.map +1 -1
  205. package/dist/attributes/shape/effects/implementations/outline.js +18 -17
  206. package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
  207. package/dist/attributes/shape/effects/implementations/pixelate.d.ts +25 -6
  208. package/dist/attributes/shape/effects/implementations/pixelate.d.ts.map +1 -1
  209. package/dist/attributes/shape/effects/implementations/pixelate.js +16 -14
  210. package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
  211. package/dist/attributes/shape/effects/implementations/posterize.d.ts +14 -3
  212. package/dist/attributes/shape/effects/implementations/posterize.d.ts.map +1 -1
  213. package/dist/attributes/shape/effects/implementations/posterize.js +13 -9
  214. package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
  215. package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts +91 -26
  216. package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts.map +1 -1
  217. package/dist/attributes/shape/effects/implementations/progressive-blur.js +27 -28
  218. package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
  219. package/dist/attributes/shape/effects/implementations/radial-blur.d.ts +49 -10
  220. package/dist/attributes/shape/effects/implementations/radial-blur.d.ts.map +1 -1
  221. package/dist/attributes/shape/effects/implementations/radial-blur.js +19 -20
  222. package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
  223. package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts +36 -6
  224. package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts.map +1 -1
  225. package/dist/attributes/shape/effects/implementations/rgb-shift.js +16 -15
  226. package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
  227. package/dist/attributes/shape/effects/implementations/scanlines.d.ts +52 -11
  228. package/dist/attributes/shape/effects/implementations/scanlines.d.ts.map +1 -1
  229. package/dist/attributes/shape/effects/implementations/scanlines.js +21 -18
  230. package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
  231. package/dist/attributes/shape/effects/implementations/scatter.d.ts +23 -9
  232. package/dist/attributes/shape/effects/implementations/scatter.d.ts.map +1 -1
  233. package/dist/attributes/shape/effects/implementations/scatter.js +15 -12
  234. package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
  235. package/dist/attributes/shape/effects/implementations/shader.d.ts +90 -34
  236. package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
  237. package/dist/attributes/shape/effects/implementations/shader.js +42 -26
  238. package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
  239. package/dist/attributes/shape/effects/implementations/sharpen.d.ts +23 -5
  240. package/dist/attributes/shape/effects/implementations/sharpen.d.ts.map +1 -1
  241. package/dist/attributes/shape/effects/implementations/sharpen.js +16 -11
  242. package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
  243. package/dist/attributes/shape/effects/implementations/streak.d.ts +40 -9
  244. package/dist/attributes/shape/effects/implementations/streak.d.ts.map +1 -1
  245. package/dist/attributes/shape/effects/implementations/streak.js +19 -16
  246. package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
  247. package/dist/attributes/shape/effects/implementations/threshold.d.ts +24 -5
  248. package/dist/attributes/shape/effects/implementations/threshold.d.ts.map +1 -1
  249. package/dist/attributes/shape/effects/implementations/threshold.js +17 -11
  250. package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
  251. package/dist/attributes/shape/effects/implementations/twirl.d.ts +35 -8
  252. package/dist/attributes/shape/effects/implementations/twirl.d.ts.map +1 -1
  253. package/dist/attributes/shape/effects/implementations/twirl.js +17 -16
  254. package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
  255. package/dist/attributes/shape/effects/implementations/vignette.d.ts +37 -7
  256. package/dist/attributes/shape/effects/implementations/vignette.d.ts.map +1 -1
  257. package/dist/attributes/shape/effects/implementations/vignette.js +19 -18
  258. package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
  259. package/dist/attributes/shape/effects/implementations/vintage.d.ts +24 -5
  260. package/dist/attributes/shape/effects/implementations/vintage.d.ts.map +1 -1
  261. package/dist/attributes/shape/effects/implementations/vintage.js +15 -10
  262. package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
  263. package/dist/attributes/shape/effects/implementations/wave.d.ts +61 -14
  264. package/dist/attributes/shape/effects/implementations/wave.d.ts.map +1 -1
  265. package/dist/attributes/shape/effects/implementations/wave.js +26 -23
  266. package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
  267. package/dist/attributes/shape/effects/index.d.ts +4 -2
  268. package/dist/attributes/shape/effects/index.d.ts.map +1 -1
  269. package/dist/attributes/shape/effects/index.js +1 -1
  270. package/dist/attributes/shape/effects/index.js.map +1 -1
  271. package/dist/attributes/shape/effects/registry.d.ts +11 -0
  272. package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
  273. package/dist/attributes/shape/effects/registry.js +113 -102
  274. package/dist/attributes/shape/effects/registry.js.map +1 -1
  275. package/dist/attributes/shape/effects/spec.d.ts +229 -0
  276. package/dist/attributes/shape/effects/spec.d.ts.map +1 -0
  277. package/dist/attributes/shape/effects/spec.js +178 -0
  278. package/dist/attributes/shape/effects/spec.js.map +1 -0
  279. package/dist/attributes/shape/fill/chain.d.ts +7 -9
  280. package/dist/attributes/shape/fill/chain.d.ts.map +1 -1
  281. package/dist/attributes/shape/fill/chain.js +9 -11
  282. package/dist/attributes/shape/fill/chain.js.map +1 -1
  283. package/dist/attributes/shape/fill/color/parser.d.ts +1 -1
  284. package/dist/attributes/shape/fill/color/parser.js +1 -1
  285. package/dist/attributes/shape/fill/color/parser.js.map +1 -1
  286. package/dist/attributes/shape/fill/implementations/canvas3d.d.ts +2 -2
  287. package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
  288. package/dist/attributes/shape/fill/implementations/shader.d.ts +28 -27
  289. package/dist/attributes/shape/fill/implementations/shader.d.ts.map +1 -1
  290. package/dist/attributes/shape/fill/implementations/shader.js +20 -14
  291. package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
  292. package/dist/attributes/shape/fill/implementations/video.d.ts +1 -1
  293. package/dist/attributes/shape/fill/implementations/video.js +1 -1
  294. package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
  295. package/dist/attributes/shape/fill/index.d.ts +1 -1
  296. package/dist/attributes/shape/fill/index.d.ts.map +1 -1
  297. package/dist/attributes/shape/fill/index.js.map +1 -1
  298. package/dist/attributes/shape/fill/lerp.d.ts +1 -1
  299. package/dist/attributes/shape/fill/lerp.js.map +1 -1
  300. package/dist/attributes/shape/fill/registry.d.ts +1 -2
  301. package/dist/attributes/shape/fill/registry.d.ts.map +1 -1
  302. package/dist/attributes/shape/fill/registry.js +1 -2
  303. package/dist/attributes/shape/fill/registry.js.map +1 -1
  304. package/dist/attributes/shape/filters/chain.d.ts +3 -7
  305. package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
  306. package/dist/attributes/shape/filters/chain.js +2 -6
  307. package/dist/attributes/shape/filters/chain.js.map +1 -1
  308. package/dist/attributes/shape/filters/implementations/color-matrix.d.ts +2 -2
  309. package/dist/attributes/shape/filters/implementations/color-matrix.d.ts.map +1 -1
  310. package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
  311. package/dist/attributes/shape/filters/registry.d.ts +1 -1
  312. package/dist/attributes/shape/filters/registry.d.ts.map +1 -1
  313. package/dist/attributes/shape/filters/registry.js +3 -3
  314. package/dist/attributes/shape/filters/registry.js.map +1 -1
  315. package/dist/attributes/shape/filters/union.d.ts +6 -6
  316. package/dist/attributes/shape/filters/union.d.ts.map +1 -1
  317. package/dist/attributes/shape/filters/union.js.map +1 -1
  318. package/dist/attributes/shape/path/ops.d.ts +1 -2
  319. package/dist/attributes/shape/path/ops.d.ts.map +1 -1
  320. package/dist/attributes/shape/path/ops.js.map +1 -1
  321. package/dist/attributes/shape/shaders/index.d.ts +2 -0
  322. package/dist/attributes/shape/shaders/index.d.ts.map +1 -1
  323. package/dist/attributes/shape/shaders/index.js +2 -0
  324. package/dist/attributes/shape/shaders/index.js.map +1 -1
  325. package/dist/attributes/shape/shaders/language.d.ts +26 -0
  326. package/dist/attributes/shape/shaders/language.d.ts.map +1 -0
  327. package/dist/attributes/shape/shaders/language.js +20 -0
  328. package/dist/attributes/shape/shaders/language.js.map +1 -0
  329. package/dist/attributes/shape/shaders/pack.d.ts +25 -11
  330. package/dist/attributes/shape/shaders/pack.d.ts.map +1 -1
  331. package/dist/attributes/shape/shaders/pack.js +9 -4
  332. package/dist/attributes/shape/shaders/pack.js.map +1 -1
  333. package/dist/attributes/shape/shaders/resolve.d.ts +4 -5
  334. package/dist/attributes/shape/shaders/resolve.d.ts.map +1 -1
  335. package/dist/attributes/shape/shaders/resolve.js +3 -6
  336. package/dist/attributes/shape/shaders/resolve.js.map +1 -1
  337. package/dist/attributes/shape/shaders/uniforms.d.ts +41 -0
  338. package/dist/attributes/shape/shaders/uniforms.d.ts.map +1 -0
  339. package/dist/attributes/shape/shaders/uniforms.js +0 -0
  340. package/dist/attributes/shape/shaders/uniforms.js.map +1 -0
  341. package/dist/attributes/shared/operators.d.ts +2 -2
  342. package/dist/attributes/shared/operators.js.map +1 -1
  343. package/dist/attributes/text/types.d.ts +2 -3
  344. package/dist/attributes/text/types.d.ts.map +1 -1
  345. package/dist/attributes/text/types.js.map +1 -1
  346. package/dist/browser/chunks/chunk-AOT33LMS.js +13 -0
  347. package/dist/browser/chunks/chunk-AOT33LMS.js.map +7 -0
  348. package/dist/browser/chunks/chunk-GKM6UZJR.js +6 -0
  349. package/dist/browser/chunks/chunk-GKM6UZJR.js.map +7 -0
  350. package/dist/browser/chunks/chunk-LKUYVFU3.js +2 -0
  351. package/dist/browser/chunks/{chunk-DHB4COFY.js.map → chunk-LKUYVFU3.js.map} +4 -4
  352. package/dist/browser/chunks/chunk-ZRPZPWZU.js +3 -0
  353. package/dist/browser/chunks/chunk-ZRPZPWZU.js.map +7 -0
  354. package/dist/browser/component.js +1 -1
  355. package/dist/browser/component.js.map +4 -4
  356. package/dist/browser/experimental.js +1 -1
  357. package/dist/browser/experimental.js.map +4 -4
  358. package/dist/browser/index.js +1 -1
  359. package/dist/browser/index.js.map +4 -4
  360. package/dist/browser/manifest.json +2 -4
  361. package/dist/browser/sdk.js +1 -1
  362. package/dist/component.d.ts +10 -18
  363. package/dist/component.d.ts.map +1 -1
  364. package/dist/component.js +10 -17
  365. package/dist/component.js.map +1 -1
  366. package/dist/components/builtins/audio/audio.d.ts +62 -0
  367. package/dist/components/builtins/audio/audio.d.ts.map +1 -0
  368. package/dist/components/builtins/audio/audio.js +38 -0
  369. package/dist/components/builtins/audio/audio.js.map +1 -0
  370. package/dist/components/builtins/geometry/composite.d.ts +93 -0
  371. package/dist/components/builtins/geometry/composite.d.ts.map +1 -0
  372. package/dist/components/builtins/geometry/composite.js +25 -0
  373. package/dist/components/builtins/geometry/composite.js.map +1 -0
  374. package/dist/components/builtins/geometry/geometry.d.ts +921 -0
  375. package/dist/components/builtins/geometry/geometry.d.ts.map +1 -0
  376. package/dist/components/builtins/geometry/geometry.js +107 -0
  377. package/dist/components/builtins/geometry/geometry.js.map +1 -0
  378. package/dist/components/builtins/geometry/shape-outline.d.ts +93 -0
  379. package/dist/components/builtins/geometry/shape-outline.d.ts.map +1 -0
  380. package/dist/components/builtins/geometry/shape-outline.js +470 -0
  381. package/dist/components/builtins/geometry/shape-outline.js.map +1 -0
  382. package/dist/components/builtins/layout/layout.d.ts +186 -0
  383. package/dist/components/builtins/layout/layout.d.ts.map +1 -0
  384. package/dist/components/builtins/layout/layout.js +84 -0
  385. package/dist/components/builtins/layout/layout.js.map +1 -0
  386. package/dist/components/builtins/media/media.d.ts +240 -0
  387. package/dist/components/builtins/media/media.d.ts.map +1 -0
  388. package/dist/components/builtins/media/media.js +143 -0
  389. package/dist/components/builtins/media/media.js.map +1 -0
  390. package/dist/components/builtins/providers/providers.d.ts +47 -0
  391. package/dist/components/builtins/providers/providers.d.ts.map +1 -0
  392. package/dist/components/builtins/providers/providers.js +30 -0
  393. package/dist/components/builtins/providers/providers.js.map +1 -0
  394. package/dist/components/builtins/text/number-format.d.ts +66 -0
  395. package/dist/components/builtins/text/number-format.d.ts.map +1 -0
  396. package/dist/components/builtins/text/number-format.js +227 -0
  397. package/dist/components/builtins/text/number-format.js.map +1 -0
  398. package/dist/components/builtins/text/number-pattern.d.ts +51 -0
  399. package/dist/components/builtins/text/number-pattern.d.ts.map +1 -0
  400. package/dist/components/builtins/text/number-pattern.js +77 -0
  401. package/dist/components/builtins/text/number-pattern.js.map +1 -0
  402. package/dist/components/builtins/text/text-defaults.d.ts +32 -0
  403. package/dist/components/builtins/text/text-defaults.d.ts.map +1 -0
  404. package/dist/components/builtins/text/text-defaults.js +37 -0
  405. package/dist/components/builtins/text/text-defaults.js.map +1 -0
  406. package/dist/components/builtins/text/text-layout.d.ts +82 -0
  407. package/dist/components/builtins/text/text-layout.d.ts.map +1 -0
  408. package/dist/components/builtins/text/text-layout.js +331 -0
  409. package/dist/components/builtins/text/text-layout.js.map +1 -0
  410. package/dist/components/builtins/text/text.d.ts +409 -0
  411. package/dist/components/builtins/text/text.d.ts.map +1 -0
  412. package/dist/components/builtins/text/text.js +116 -0
  413. package/dist/components/builtins/text/text.js.map +1 -0
  414. package/dist/components/builtins/three/canvas3d.d.ts +245 -0
  415. package/dist/components/builtins/three/canvas3d.d.ts.map +1 -0
  416. package/dist/components/builtins/three/canvas3d.js +21 -0
  417. package/dist/components/builtins/three/canvas3d.js.map +1 -0
  418. package/dist/components/builtins/three/grid-geometry3d.d.ts +62 -0
  419. package/dist/components/builtins/three/grid-geometry3d.d.ts.map +1 -0
  420. package/dist/components/builtins/three/grid-geometry3d.js +114 -0
  421. package/dist/components/builtins/three/grid-geometry3d.js.map +1 -0
  422. package/dist/components/builtins/three/three.d.ts +1889 -0
  423. package/dist/components/builtins/three/three.d.ts.map +1 -0
  424. package/dist/components/builtins/three/three.js +305 -0
  425. package/dist/components/builtins/three/three.js.map +1 -0
  426. package/dist/components/factory/api.d.ts +543 -0
  427. package/dist/components/factory/api.d.ts.map +1 -0
  428. package/dist/components/factory/api.js +4 -0
  429. package/dist/components/factory/api.js.map +1 -0
  430. package/dist/components/factory/clip-of.d.ts +5 -0
  431. package/dist/components/factory/clip-of.d.ts.map +1 -0
  432. package/dist/components/factory/clip-of.js +33 -0
  433. package/dist/components/factory/clip-of.js.map +1 -0
  434. package/dist/components/factory/commands-for.d.ts +19 -0
  435. package/dist/components/factory/commands-for.d.ts.map +1 -0
  436. package/dist/components/factory/commands-for.js +5 -0
  437. package/dist/components/factory/commands-for.js.map +1 -0
  438. package/dist/components/factory/component-audio.d.ts +9 -0
  439. package/dist/components/factory/component-audio.d.ts.map +1 -0
  440. package/dist/components/factory/component-audio.js +18 -0
  441. package/dist/components/factory/component-audio.js.map +1 -0
  442. package/dist/components/factory/component2d.d.ts +8 -0
  443. package/dist/components/factory/component2d.d.ts.map +1 -0
  444. package/dist/components/factory/component2d.js +240 -0
  445. package/dist/components/factory/component2d.js.map +1 -0
  446. package/dist/components/factory/component3d.d.ts +9 -0
  447. package/dist/components/factory/component3d.d.ts.map +1 -0
  448. package/dist/components/factory/component3d.js +107 -0
  449. package/dist/components/factory/component3d.js.map +1 -0
  450. package/dist/components/factory/factory.d.ts +66 -0
  451. package/dist/components/factory/factory.d.ts.map +1 -0
  452. package/dist/components/factory/factory.js +347 -0
  453. package/dist/components/factory/factory.js.map +1 -0
  454. package/dist/components/factory/timeline.d.ts +22 -0
  455. package/dist/components/factory/timeline.d.ts.map +1 -0
  456. package/dist/components/factory/timeline.js +128 -0
  457. package/dist/components/factory/timeline.js.map +1 -0
  458. package/dist/components/factory/type-def.d.ts +26 -0
  459. package/dist/components/factory/type-def.d.ts.map +1 -0
  460. package/dist/components/factory/type-def.js +16 -0
  461. package/dist/components/factory/type-def.js.map +1 -0
  462. package/dist/components/factory/types.d.ts +91 -0
  463. package/dist/components/factory/types.d.ts.map +1 -0
  464. package/dist/components/factory/types.js +88 -0
  465. package/dist/components/factory/types.js.map +1 -0
  466. package/dist/components/factory/views.d.ts +121 -0
  467. package/dist/components/factory/views.d.ts.map +1 -0
  468. package/dist/components/factory/views.js +413 -0
  469. package/dist/components/factory/views.js.map +1 -0
  470. package/dist/components/modules/aim.d.ts +30 -0
  471. package/dist/components/modules/aim.d.ts.map +1 -0
  472. package/dist/components/modules/aim.js +39 -0
  473. package/dist/components/modules/aim.js.map +1 -0
  474. package/dist/components/modules/corners.d.ts +13 -0
  475. package/dist/components/modules/corners.d.ts.map +1 -0
  476. package/dist/components/modules/corners.js +12 -0
  477. package/dist/components/modules/corners.js.map +1 -0
  478. package/dist/components/modules/flow.d.ts +26 -0
  479. package/dist/components/modules/flow.d.ts.map +1 -0
  480. package/dist/components/modules/flow.js +57 -0
  481. package/dist/components/modules/flow.js.map +1 -0
  482. package/dist/components/modules/material.d.ts +40 -0
  483. package/dist/components/modules/material.d.ts.map +1 -0
  484. package/dist/components/modules/material.js +75 -0
  485. package/dist/components/modules/material.js.map +1 -0
  486. package/dist/components/modules/paint.d.ts +71 -0
  487. package/dist/components/modules/paint.d.ts.map +1 -0
  488. package/dist/components/modules/paint.js +106 -0
  489. package/dist/components/modules/paint.js.map +1 -0
  490. package/dist/components/modules/shapes.d.ts +31 -0
  491. package/dist/components/modules/shapes.d.ts.map +1 -0
  492. package/dist/components/modules/shapes.js +43 -0
  493. package/dist/components/modules/shapes.js.map +1 -0
  494. package/dist/components/modules/text-layout.d.ts +26 -0
  495. package/dist/components/modules/text-layout.d.ts.map +1 -0
  496. package/dist/components/modules/text-layout.js +57 -0
  497. package/dist/components/modules/text-layout.js.map +1 -0
  498. package/dist/components/modules/text-style.d.ts +48 -0
  499. package/dist/components/modules/text-style.d.ts.map +1 -0
  500. package/dist/components/modules/text-style.js +63 -0
  501. package/dist/components/modules/text-style.js.map +1 -0
  502. package/dist/components/modules/three-entries.d.ts +23 -0
  503. package/dist/components/modules/three-entries.d.ts.map +1 -0
  504. package/dist/components/modules/three-entries.js +41 -0
  505. package/dist/components/modules/three-entries.js.map +1 -0
  506. package/dist/components/modules/view3d.d.ts +59 -0
  507. package/dist/components/modules/view3d.d.ts.map +1 -0
  508. package/dist/components/modules/view3d.js +171 -0
  509. package/dist/components/modules/view3d.js.map +1 -0
  510. package/dist/components/trees/2d/group-bounds.d.ts +56 -0
  511. package/dist/components/trees/2d/group-bounds.d.ts.map +1 -0
  512. package/dist/components/trees/2d/group-bounds.js +87 -0
  513. package/dist/components/trees/2d/group-bounds.js.map +1 -0
  514. package/dist/components/trees/2d/node-lifecycle.d.ts +46 -0
  515. package/dist/components/trees/2d/node-lifecycle.d.ts.map +1 -0
  516. package/dist/components/trees/2d/node-lifecycle.js +264 -0
  517. package/dist/components/trees/2d/node-lifecycle.js.map +1 -0
  518. package/dist/components/trees/2d/node-motion.d.ts +56 -0
  519. package/dist/components/trees/2d/node-motion.d.ts.map +1 -0
  520. package/dist/components/trees/2d/node-motion.js +86 -0
  521. package/dist/components/trees/2d/node-motion.js.map +1 -0
  522. package/dist/components/trees/2d/node-render.d.ts +36 -0
  523. package/dist/components/trees/2d/node-render.d.ts.map +1 -0
  524. package/dist/components/trees/2d/node-render.js +67 -0
  525. package/dist/components/trees/2d/node-render.js.map +1 -0
  526. package/dist/components/trees/2d/node-space.d.ts +63 -0
  527. package/dist/components/trees/2d/node-space.d.ts.map +1 -0
  528. package/dist/components/trees/2d/node-space.js +131 -0
  529. package/dist/components/trees/2d/node-space.js.map +1 -0
  530. package/dist/components/trees/2d/node-transform.d.ts +55 -0
  531. package/dist/components/trees/2d/node-transform.d.ts.map +1 -0
  532. package/dist/components/trees/2d/node-transform.js +73 -0
  533. package/dist/components/trees/2d/node-transform.js.map +1 -0
  534. package/dist/components/trees/2d/node2d.d.ts +1020 -0
  535. package/dist/components/trees/2d/node2d.d.ts.map +1 -0
  536. package/dist/components/trees/2d/node2d.js +1481 -0
  537. package/dist/components/trees/2d/node2d.js.map +1 -0
  538. package/dist/components/trees/audio/index.d.ts +2 -0
  539. package/dist/components/trees/audio/index.d.ts.map +1 -0
  540. package/dist/components/trees/audio/index.js +2 -0
  541. package/dist/components/trees/audio/index.js.map +1 -0
  542. package/dist/components/trees/audio/node-audio.d.ts +116 -0
  543. package/dist/components/trees/audio/node-audio.d.ts.map +1 -0
  544. package/dist/components/trees/audio/node-audio.js +171 -0
  545. package/dist/components/trees/audio/node-audio.js.map +1 -0
  546. package/dist/components/trees/index.d.ts +10 -0
  547. package/dist/components/trees/index.d.ts.map +1 -0
  548. package/dist/components/trees/index.js +14 -0
  549. package/dist/components/trees/index.js.map +1 -0
  550. package/dist/components/trees/node/node-editor-state.d.ts +53 -0
  551. package/dist/components/trees/node/node-editor-state.d.ts.map +1 -0
  552. package/dist/components/trees/node/node-editor-state.js +23 -0
  553. package/dist/components/trees/node/node-editor-state.js.map +1 -0
  554. package/dist/components/trees/node/node-reactive.d.ts +89 -0
  555. package/dist/components/trees/node/node-reactive.d.ts.map +1 -0
  556. package/dist/components/trees/node/node-reactive.js +135 -0
  557. package/dist/components/trees/node/node-reactive.js.map +1 -0
  558. package/dist/components/trees/node/node-time.d.ts +39 -0
  559. package/dist/components/trees/node/node-time.d.ts.map +1 -0
  560. package/dist/components/trees/node/node-time.js +14 -0
  561. package/dist/components/trees/node/node-time.js.map +1 -0
  562. package/dist/components/trees/node/node-walk.d.ts +46 -0
  563. package/dist/components/trees/node/node-walk.d.ts.map +1 -0
  564. package/dist/components/trees/node/node-walk.js +74 -0
  565. package/dist/components/trees/node/node-walk.js.map +1 -0
  566. package/dist/components/trees/node/node.d.ts +401 -0
  567. package/dist/components/trees/node/node.d.ts.map +1 -0
  568. package/dist/components/trees/node/node.js +680 -0
  569. package/dist/components/trees/node/node.js.map +1 -0
  570. package/dist/components/trees/root/canvas2d-node.d.ts +163 -0
  571. package/dist/components/trees/root/canvas2d-node.d.ts.map +1 -0
  572. package/dist/components/trees/root/canvas2d-node.js +216 -0
  573. package/dist/components/trees/root/canvas2d-node.js.map +1 -0
  574. package/dist/components/trees/three/node3d.d.ts +222 -0
  575. package/dist/components/trees/three/node3d.d.ts.map +1 -0
  576. package/dist/components/trees/three/node3d.js +289 -0
  577. package/dist/components/trees/three/node3d.js.map +1 -0
  578. package/dist/document/builtins.js +13 -13
  579. package/dist/document/builtins.js.map +1 -1
  580. package/dist/document/command-traits.d.ts +14 -4
  581. package/dist/document/command-traits.d.ts.map +1 -1
  582. package/dist/document/command-traits.js +35 -7
  583. package/dist/document/command-traits.js.map +1 -1
  584. package/dist/document/deny-globals.d.ts +2 -2
  585. package/dist/document/deny-globals.js +2 -2
  586. package/dist/document/deny-globals.js.map +1 -1
  587. package/dist/document/expression/index.d.ts +1 -1
  588. package/dist/document/expression/index.js +1 -1
  589. package/dist/document/expression/index.js.map +1 -1
  590. package/dist/document/expression/ops.js +1 -1
  591. package/dist/document/expression/ops.js.map +1 -1
  592. package/dist/document/index.d.ts +9 -2
  593. package/dist/document/index.d.ts.map +1 -1
  594. package/dist/document/index.js +5 -2
  595. package/dist/document/index.js.map +1 -1
  596. package/dist/document/migrate.d.ts +70 -0
  597. package/dist/document/migrate.d.ts.map +1 -0
  598. package/dist/document/migrate.js +202 -0
  599. package/dist/document/migrate.js.map +1 -0
  600. package/dist/document/missing-node.d.ts +27 -0
  601. package/dist/document/missing-node.d.ts.map +1 -0
  602. package/dist/document/missing-node.js +48 -0
  603. package/dist/document/missing-node.js.map +1 -0
  604. package/dist/document/node-decorator.d.ts +14 -10
  605. package/dist/document/node-decorator.d.ts.map +1 -1
  606. package/dist/document/node-decorator.js +14 -10
  607. package/dist/document/node-decorator.js.map +1 -1
  608. package/dist/document/node-descriptor.d.ts +7 -3
  609. package/dist/document/node-descriptor.d.ts.map +1 -1
  610. package/dist/document/node-descriptor.js.map +1 -1
  611. package/dist/document/placement.d.ts +2 -1
  612. package/dist/document/placement.d.ts.map +1 -1
  613. package/dist/document/placement.js.map +1 -1
  614. package/dist/document/project.d.ts +2 -0
  615. package/dist/document/project.d.ts.map +1 -1
  616. package/dist/document/project.js +1 -0
  617. package/dist/document/project.js.map +1 -1
  618. package/dist/document/prop-evolution.d.ts +51 -0
  619. package/dist/document/prop-evolution.d.ts.map +1 -0
  620. package/dist/document/prop-evolution.js +83 -0
  621. package/dist/document/prop-evolution.js.map +1 -0
  622. package/dist/document/registry.d.ts +39 -25
  623. package/dist/document/registry.d.ts.map +1 -1
  624. package/dist/document/registry.js +41 -21
  625. package/dist/document/registry.js.map +1 -1
  626. package/dist/document/settled-index.d.ts +2 -0
  627. package/dist/document/settled-index.d.ts.map +1 -1
  628. package/dist/document/settled-index.js +5 -5
  629. package/dist/document/settled-index.js.map +1 -1
  630. package/dist/document/timeline-patch.d.ts +4 -0
  631. package/dist/document/timeline-patch.d.ts.map +1 -1
  632. package/dist/document/timeline-patch.js +28 -3
  633. package/dist/document/timeline-patch.js.map +1 -1
  634. package/dist/document/timeline.d.ts +48 -4
  635. package/dist/document/timeline.d.ts.map +1 -1
  636. package/dist/document/timeline.js +174 -44
  637. package/dist/document/timeline.js.map +1 -1
  638. package/dist/document/types.d.ts +18 -32
  639. package/dist/document/types.d.ts.map +1 -1
  640. package/dist/document/types.js.map +1 -1
  641. package/dist/document/validate.d.ts +18 -6
  642. package/dist/document/validate.d.ts.map +1 -1
  643. package/dist/document/validate.js +158 -21
  644. package/dist/document/validate.js.map +1 -1
  645. package/dist/document/vocabulary.d.ts +28 -0
  646. package/dist/document/vocabulary.d.ts.map +1 -0
  647. package/dist/document/vocabulary.js +42 -0
  648. package/dist/document/vocabulary.js.map +1 -0
  649. package/dist/experimental.d.ts +79 -19
  650. package/dist/experimental.d.ts.map +1 -1
  651. package/dist/experimental.js +31 -17
  652. package/dist/experimental.js.map +1 -1
  653. package/dist/index.d.ts +10 -11
  654. package/dist/index.d.ts.map +1 -1
  655. package/dist/index.js +10 -11
  656. package/dist/index.js.map +1 -1
  657. package/dist/layout/types.d.ts +1 -1
  658. package/dist/layout/types.js.map +1 -1
  659. package/dist/platform/exporter.d.ts +13 -0
  660. package/dist/platform/exporter.d.ts.map +1 -1
  661. package/dist/platform/exporter.js.map +1 -1
  662. package/dist/props/host.d.ts +1 -1
  663. package/dist/props/host.js.map +1 -1
  664. package/dist/props/slot.d.ts +1 -1
  665. package/dist/props/slot.js +1 -1
  666. package/dist/props/slot.js.map +1 -1
  667. package/dist/renamed-scene-names.d.ts +1 -1
  668. package/dist/renamed-scene-names.d.ts.map +1 -1
  669. package/dist/renamed-scene-names.js +1 -1
  670. package/dist/renamed-scene-names.js.map +1 -1
  671. package/dist/render/canvas-render-context2d.d.ts +9 -0
  672. package/dist/render/canvas-render-context2d.d.ts.map +1 -1
  673. package/dist/render/canvas-render-context2d.js +10 -0
  674. package/dist/render/canvas-render-context2d.js.map +1 -1
  675. package/dist/render/clip-contains.js +1 -1
  676. package/dist/render/clip-contains.js.map +1 -1
  677. package/dist/render/clip.d.ts +1 -1
  678. package/dist/render/clip.js +1 -1
  679. package/dist/render/clip.js.map +1 -1
  680. package/dist/render/descriptors/rect.js.map +1 -1
  681. package/dist/render/descriptors/text.d.ts +13 -7
  682. package/dist/render/descriptors/text.d.ts.map +1 -1
  683. package/dist/render/descriptors/text.js +9 -3
  684. package/dist/render/descriptors/text.js.map +1 -1
  685. package/dist/render/index.d.ts +2 -0
  686. package/dist/render/index.d.ts.map +1 -1
  687. package/dist/render/index.js +1 -0
  688. package/dist/render/index.js.map +1 -1
  689. package/dist/render/render-context2d.d.ts +3 -3
  690. package/dist/render/render-context2d.js.map +1 -1
  691. package/dist/render/render-issue.d.ts +39 -0
  692. package/dist/render/render-issue.d.ts.map +1 -0
  693. package/dist/render/render-issue.js +29 -0
  694. package/dist/render/render-issue.js.map +1 -0
  695. package/dist/render/surface.d.ts +2 -2
  696. package/dist/render/surface.js.map +1 -1
  697. package/dist/render3d/builders.d.ts +1 -1
  698. package/dist/render3d/builders.js +1 -1
  699. package/dist/render3d/builders.js.map +1 -1
  700. package/dist/render3d/graphics3d.d.ts +13 -19
  701. package/dist/render3d/graphics3d.d.ts.map +1 -1
  702. package/dist/render3d/graphics3d.js +67 -24
  703. package/dist/render3d/graphics3d.js.map +1 -1
  704. package/dist/render3d/scene3d.d.ts +1 -1
  705. package/dist/render3d/scene3d.js +1 -1
  706. package/dist/render3d/scene3d.js.map +1 -1
  707. package/dist/render3d/texture.d.ts +2 -2
  708. package/dist/render3d/texture.d.ts.map +1 -1
  709. package/dist/render3d/texture.js.map +1 -1
  710. package/dist/render3d/vector3.d.ts +2 -2
  711. package/dist/render3d/vector3.js +2 -2
  712. package/dist/render3d/vector3.js.map +1 -1
  713. package/dist/runtime/asset-refine.d.ts +1 -1
  714. package/dist/runtime/asset-refine.d.ts.map +1 -1
  715. package/dist/runtime/asset-refine.js +3 -2
  716. package/dist/runtime/asset-refine.js.map +1 -1
  717. package/dist/runtime/asset-timeline.d.ts +10 -0
  718. package/dist/runtime/asset-timeline.d.ts.map +1 -1
  719. package/dist/runtime/asset-timeline.js.map +1 -1
  720. package/dist/runtime/asset-update.d.ts.map +1 -1
  721. package/dist/runtime/asset-update.js +8 -1
  722. package/dist/runtime/asset-update.js.map +1 -1
  723. package/dist/runtime/audio-index.d.ts +0 -11
  724. package/dist/runtime/audio-index.d.ts.map +1 -1
  725. package/dist/runtime/audio-index.js +0 -25
  726. package/dist/runtime/audio-index.js.map +1 -1
  727. package/dist/runtime/clip-instance.d.ts +6 -4
  728. package/dist/runtime/clip-instance.d.ts.map +1 -1
  729. package/dist/runtime/clip-instance.js +8 -4
  730. package/dist/runtime/clip-instance.js.map +1 -1
  731. package/dist/runtime/clip-store.d.ts +2 -3
  732. package/dist/runtime/clip-store.d.ts.map +1 -1
  733. package/dist/runtime/clip-store.js +34 -37
  734. package/dist/runtime/clip-store.js.map +1 -1
  735. package/dist/runtime/engine.d.ts +8 -6
  736. package/dist/runtime/engine.d.ts.map +1 -1
  737. package/dist/runtime/engine.js +4 -3
  738. package/dist/runtime/engine.js.map +1 -1
  739. package/dist/runtime/node-picking.d.ts +2 -2
  740. package/dist/runtime/node-picking.d.ts.map +1 -1
  741. package/dist/runtime/node-picking.js +3 -3
  742. package/dist/runtime/node-picking.js.map +1 -1
  743. package/dist/runtime/node-picking3d.d.ts +2 -2
  744. package/dist/runtime/node-picking3d.d.ts.map +1 -1
  745. package/dist/runtime/node-picking3d.js +1 -1
  746. package/dist/runtime/node-picking3d.js.map +1 -1
  747. package/dist/runtime/playback-controller.d.ts +2 -2
  748. package/dist/runtime/playback-controller.d.ts.map +1 -1
  749. package/dist/runtime/playback-controller.js +15 -5
  750. package/dist/runtime/playback-controller.js.map +1 -1
  751. package/dist/runtime/session.d.ts +7 -3
  752. package/dist/runtime/session.d.ts.map +1 -1
  753. package/dist/runtime/session.js +11 -4
  754. package/dist/runtime/session.js.map +1 -1
  755. package/dist/runtime/state-evaluator.d.ts +2 -2
  756. package/dist/runtime/state-evaluator.d.ts.map +1 -1
  757. package/dist/runtime/state-evaluator.js.map +1 -1
  758. package/dist/runtime/text-geometry.d.ts +2 -2
  759. package/dist/runtime/text-geometry.d.ts.map +1 -1
  760. package/dist/runtime/text-geometry.js +4 -5
  761. package/dist/runtime/text-geometry.js.map +1 -1
  762. package/dist/sdk/index.d.ts +50 -44
  763. package/dist/sdk/index.d.ts.map +1 -1
  764. package/dist/sdk/index.js +35 -29
  765. package/dist/sdk/index.js.map +1 -1
  766. package/dist/tween/command-decorator.d.ts +14 -9
  767. package/dist/tween/command-decorator.d.ts.map +1 -1
  768. package/dist/tween/command-decorator.js +3 -2
  769. package/dist/tween/command-decorator.js.map +1 -1
  770. package/dist/tween/command.d.ts +1 -1
  771. package/dist/tween/command.js.map +1 -1
  772. package/dist/tween/ease/describe.d.ts +2 -0
  773. package/dist/tween/ease/describe.d.ts.map +1 -1
  774. package/dist/tween/ease/describe.js +4 -0
  775. package/dist/tween/ease/describe.js.map +1 -1
  776. package/dist/tween/ease/spec.d.ts +31 -0
  777. package/dist/tween/ease/spec.d.ts.map +1 -0
  778. package/dist/tween/ease/spec.js +51 -0
  779. package/dist/tween/ease/spec.js.map +1 -0
  780. package/dist/tween/index.d.ts +3 -1
  781. package/dist/tween/index.d.ts.map +1 -1
  782. package/dist/tween/index.js +2 -1
  783. package/dist/tween/index.js.map +1 -1
  784. package/dist/tween/loop.d.ts +1 -1
  785. package/dist/tween/loop.js +1 -1
  786. package/dist/tween/loop.js.map +1 -1
  787. package/dist/util/reference.d.ts +6 -6
  788. package/dist/util/reference.js.map +1 -1
  789. package/package.json +3 -11
  790. package/dist/browser/chunks/chunk-2RIYH36X.js +0 -3
  791. package/dist/browser/chunks/chunk-2RIYH36X.js.map +0 -7
  792. package/dist/browser/chunks/chunk-DDJN3QII.js +0 -15
  793. package/dist/browser/chunks/chunk-DDJN3QII.js.map +0 -7
  794. package/dist/browser/chunks/chunk-DHB4COFY.js +0 -2
  795. package/dist/browser/chunks/chunk-EJDPYDQI.js +0 -5
  796. package/dist/browser/chunks/chunk-EJDPYDQI.js.map +0 -7
  797. package/dist/browser/chunks/chunk-SFNJRPBV.js +0 -2
  798. package/dist/browser/chunks/chunk-SFNJRPBV.js.map +0 -7
  799. package/dist/browser/chunks/chunk-XAWE4EAK.js +0 -2
  800. package/dist/browser/chunks/chunk-XAWE4EAK.js.map +0 -7
  801. package/dist/browser/jsx-jsx-dev-runtime.js +0 -2
  802. package/dist/browser/jsx-jsx-dev-runtime.js.map +0 -7
  803. package/dist/browser/jsx-jsx-runtime.js +0 -2
  804. package/dist/browser/jsx-jsx-runtime.js.map +0 -7
@@ -1 +1 @@
1
- {"version":3,"file":"schedule.js","sourceRoot":"","sources":["../../../src/attributes/audio/schedule.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAoB,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,wBAAwB,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAsCpE;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,OAAmC;IAC9D,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACtB,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,GAAG,CAAC;YAAE,KAAK,IAAI,CAAC,CAAC,KAAK,CAAC;IACjF,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,OAAmC,EAAE,MAAc;IAC/E,MAAM,MAAM,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;IACvC,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACtB,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;YAAE,OAAO,wBAAwB,CAAC,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,MAAM,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IAC3D,IAAI,IAAI,IAAI,OAAO,GAAG,SAAS,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC;QAAE,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC;IAEvF,IAAI,IAAI,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACjC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;IAC1B,CAAC;SAAM,IAAI,IAAI,EAAE,CAAC;QACd,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IACxB,CAAC;SAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QAClC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,GAAG,eAAe,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;IACrG,CAAC;SAAM,CAAC;QACJ,MAAM,OAAO,GAAG,eAAe,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC,CAAC,CAAC;QACjF,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\";\r\nimport type { NodeSpan } from \"@/document/types\";\r\nimport type { Node } from \"@/nodes/node/node\";\r\nimport { resolveAudioFilters, type AudioFilter } from \"./filters/chain\";\r\nimport { integrateSpeedToClipTime, isCurve } from \"./filters/curve\";\r\nimport type { AudioFilterItem } from \"./filters/union\";\r\nimport type { AudioBusStop, AudioRequest } from \"./request\";\r\n\r\n/** One clip a node plays, in its clip's seconds. */\r\nexport interface AudioClip {\r\n src: string;\r\n /** When it starts. Defaults to when its owner enters the tree. */\r\n at?: number;\r\n /** When it is cut, however much of it is left. Defaults to when its owner leaves. */\r\n until?: number;\r\n /** In-point inside the source, in seconds. */\r\n trimStart?: number;\r\n /** Out-point inside the source. Absent plays to the source's end. */\r\n trimEnd?: number;\r\n loop?: boolean;\r\n volume?: number;\r\n filters?: AudioFilter;\r\n /** Source-adjacent first — see {@link AudioRequest.bus}. */\r\n bus?: readonly AudioBusStop[];\r\n /** Sound nobody asked for by name — see {@link AudioRequest.optional}. */\r\n optional?: boolean;\r\n}\r\n\r\n/** What a node's `declareAudio` is handed. */\r\nexport interface AudioScope {\r\n readonly catalog: AssetCatalog;\r\n /** When the node is in the tree, in clip seconds. `end` is `Infinity` for one that never leaves. */\r\n readonly span: Readonly<NodeSpan>;\r\n clip(clip: AudioClip): void;\r\n /**\r\n * When `node` is in the tree, in clip seconds: the span a bus stop carries.\r\n *\r\n * @internal\r\n */\r\n _spanOf(node: Node): Readonly<NodeSpan>;\r\n}\r\n\r\n/**\r\n * The product of every scalar `speed` filter. A curve contributes 1 here — its\r\n * effect on length needs integrating, which {@link clipDurationFor} does.\r\n */\r\nexport function effectiveSpeed(filters: readonly AudioFilterItem[]): number {\r\n let speed = 1;\r\n for (const f of filters) {\r\n if (f.type === \"speed\" && !isCurve(f.value) && f.value > 0) speed *= f.value;\r\n }\r\n return speed;\r\n}\r\n\r\n/**\r\n * Clip seconds consumed by playing `length` seconds of source through `filters`.\r\n * Must match the renderer's `playbackRate` schedule, or the request ends before\r\n * or after the sound does.\r\n */\r\nexport function clipDurationFor(filters: readonly AudioFilterItem[], length: number): number {\r\n const scalar = effectiveSpeed(filters);\r\n for (const f of filters) {\r\n if (f.type === \"speed\" && isCurve(f.value)) return integrateSpeedToClipTime(f.value, length) / scalar;\r\n }\r\n return length / scalar;\r\n}\r\n\r\n/**\r\n * The request `clip` schedules.\r\n *\r\n * Bounded when it has an end — a trim, or an `until` — and **open** otherwise, so\r\n * a bed nothing cuts continues across later tracks; see `AudioRequest.open`.\r\n */\r\nexport function requestOf(clip: AudioClip, catalog: AssetCatalog, ownerKey: string, n: number): AudioRequest {\r\n const at = clip.at ?? 0;\r\n const until = clip.until ?? Infinity;\r\n const trimStart = clip.trimStart ?? 0;\r\n const trimEnd = clip.trimEnd ?? Infinity;\r\n const loop = clip.loop ?? false;\r\n const filters = resolveAudioFilters(clip.filters);\r\n // Read even when the length goes unused: a missing file throws here, as a\r\n // build error, rather than playing silence.\r\n const mediaDuration = catalog.getMediaDuration(clip.src);\r\n\r\n const request: AudioRequest = {\r\n id: `${ownerKey}|${clip.src}|${at}|${n}`,\r\n src: clip.src,\r\n startAt: at,\r\n endAt: Infinity,\r\n trimStart,\r\n volume: clip.volume ?? 1,\r\n loop,\r\n ownerId: ownerKey,\r\n };\r\n if (filters.length > 0) request.filters = filters;\r\n if (clip.bus) request.bus = clip.bus;\r\n if (clip.optional) request.optional = true;\r\n\r\n // A loop repeats the trimmed region, so a `trimEnd` bounds one pass and says\r\n // nothing about when the clip stops: only a cut (`until`) ends it, and with\r\n // none it runs open to the project end like any other bed.\r\n if (loop && trimEnd > trimStart && Number.isFinite(trimEnd)) request.trimEnd = trimEnd;\r\n\r\n if (loop && Number.isFinite(until)) {\r\n request.endAt = until;\r\n } else if (loop) {\r\n request.open = true;\r\n } else if (Number.isFinite(trimEnd)) {\r\n request.endAt = Math.min(until, at + clipDurationFor(filters, Math.max(0, trimEnd - trimStart)));\r\n } else {\r\n const natural = clipDurationFor(filters, Math.max(0, mediaDuration - trimStart));\r\n if (Number.isFinite(until)) {\r\n request.endAt = Math.min(until, at + natural);\r\n } else {\r\n request.open = true;\r\n request.mediaDuration = natural;\r\n }\r\n }\r\n return request;\r\n}\r\n"]}
1
+ {"version":3,"file":"sched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,CAAC,OAAO,CAAC,EAAE,CAAC;QAClC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,GAAG,gBAAgB,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC;IAChF,CAAC;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\";\r\nimport { resolveAudioEffects, type AudioEffectsInput } from \"./effects/chain\";\r\nimport { integrateSpeedToClipTime, isRamp, sourceTimeAtClipElapsed, staticValue, type Param } from \"./ramp\";\r\nimport type { AudioTransition } from \"./transition\";\r\nimport type { AudioBusStop, AudioRequest } from \"./request\";\r\n\r\n/** One clip a command's sound plays, in its clip's seconds. */\r\nexport interface AudioClip {\r\n src: string;\r\n /** When it starts. */\r\n at?: number;\r\n /** When it is cut, however much of it is left. */\r\n until?: number;\r\n /** In-point inside the source, in seconds. */\r\n trimStart?: number;\r\n /** Out-point inside the source. Absent plays to the source's end. */\r\n trimEnd?: number;\r\n loop?: boolean;\r\n volume?: Param;\r\n /** Playback rate; a ramp runs over source seconds after `trimStart`. */\r\n speed?: Param;\r\n effects?: AudioEffectsInput;\r\n transitionIn?: AudioTransition;\r\n transitionOut?: AudioTransition;\r\n /** Source-adjacent first — see {@link AudioRequest.bus}. */\r\n bus?: readonly AudioBusStop[];\r\n /** Sound nobody asked for by name — see {@link AudioRequest.optional}. */\r\n optional?: boolean;\r\n}\r\n\r\nfunction scalarSpeed(speed: number): number {\r\n return Number.isFinite(speed) && speed > 0 ? speed : 1;\r\n}\r\n\r\n/**\r\n * Clip seconds spent playing the first `sourceElapsed` of `sourceLength` source\r\n * seconds at `speed`. Must match the device's `playbackRate` schedule, or a\r\n * request ends before or after its sound does.\r\n */\r\nexport function clipTimeAtSource(speed: Param, sourceLength: number, sourceElapsed: number = sourceLength): number {\r\n if (isRamp(speed)) return integrateSpeedToClipTime(speed, sourceLength, sourceElapsed);\r\n return Math.max(0, Math.min(sourceElapsed, sourceLength)) / scalarSpeed(speed);\r\n}\r\n\r\n/** Inverse of {@link clipTimeAtSource}: the source seconds reached `clipElapsed` clip seconds in. */\r\nexport function sourceTimeAtClip(speed: Param, sourceLength: number, clipElapsed: number): number {\r\n if (isRamp(speed)) return sourceTimeAtClipElapsed(speed, sourceLength, clipElapsed);\r\n return Math.max(0, Math.min(sourceLength, clipElapsed * scalarSpeed(speed)));\r\n}\r\n\r\n/** How long a clip lasts on the timeline: its trimmed source at its speed. `trimEnd` absent plays to `mediaDuration`. */\r\nexport function clipDurationOf(clip: { readonly trimStart?: number; readonly trimEnd?: number; readonly speed?: Param }, mediaDuration: number): number {\r\n const length = Math.max(0, (clip.trimEnd ?? mediaDuration) - (clip.trimStart ?? 0));\r\n return clipTimeAtSource(clip.speed ?? 1, length);\r\n}\r\n\r\n/**\r\n * The request `clip` schedules.\r\n *\r\n * Bounded when it has an end — a trim, or an `until` — and **open** otherwise, so\r\n * a bed nothing cuts continues across later tracks; see `AudioRequest.open`.\r\n */\r\nexport function requestOf(clip: AudioClip, catalog: AssetCatalog, ownerKey: string, n: number): AudioRequest {\r\n const at = clip.at ?? 0;\r\n const until = clip.until ?? Infinity;\r\n const trimStart = clip.trimStart ?? 0;\r\n const trimEnd = clip.trimEnd ?? Infinity;\r\n const loop = clip.loop ?? false;\r\n const effects = resolveAudioEffects(clip.effects);\r\n // Read even when the length goes unused: a missing file throws here, as a\r\n // build error, rather than playing silence.\r\n const mediaDuration = catalog.getMediaDuration(clip.src);\r\n\r\n let speed = clip.speed ?? 1;\r\n if (loop && isRamp(speed)) {\r\n if (process.env.NODE_ENV !== \"production\") {\r\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.`);\r\n }\r\n speed = staticValue(speed, 1);\r\n }\r\n const sourceLength = Math.max(0, (Number.isFinite(trimEnd) ? trimEnd : mediaDuration) - trimStart);\r\n\r\n const request: AudioRequest = {\r\n id: `${ownerKey}|${clip.src}|${at}|${n}`,\r\n src: clip.src,\r\n startAt: at,\r\n endAt: Infinity,\r\n trimStart,\r\n volume: clip.volume ?? 1,\r\n speed,\r\n loop,\r\n ownerId: ownerKey,\r\n };\r\n if (isRamp(speed)) request.sourceLength = sourceLength;\r\n if (effects.length > 0) request.effects = effects;\r\n if (clip.transitionIn) request.transitionIn = clip.transitionIn;\r\n if (clip.transitionOut) request.transitionOut = clip.transitionOut;\r\n if (clip.bus) request.bus = clip.bus;\r\n if (clip.optional) request.optional = true;\r\n\r\n // A loop repeats the trimmed region, so a `trimEnd` bounds one pass and says\r\n // nothing about when the clip stops: only a cut (`until`) ends it, and with\r\n // none it runs open to the project end like any other bed.\r\n if (loop && trimEnd > trimStart && Number.isFinite(trimEnd)) request.trimEnd = trimEnd;\r\n\r\n if (loop && Number.isFinite(until)) {\r\n request.endAt = until;\r\n } else if (loop) {\r\n request.open = true;\r\n } else if (Number.isFinite(trimEnd)) {\r\n request.endAt = Math.min(until, at + clipTimeAtSource(speed, sourceLength));\r\n } else {\r\n const natural = clipTimeAtSource(speed, sourceLength);\r\n if (Number.isFinite(until)) {\r\n request.endAt = Math.min(until, at + natural);\r\n } else {\r\n request.open = true;\r\n request.mediaDuration = natural;\r\n }\r\n }\r\n return request;\r\n}\r\n"]}
@@ -1,11 +1,14 @@
1
- import { AudioFilterItem } from "../../attributes/audio/filters/union.js";
2
- import { AudioFilter } from "../../attributes/audio/filters/chain.js";
1
+ import type { AudioEffect } from "../../attributes/audio/effects/union.js";
2
+ import { type AudioEffectsInput } from "../../attributes/audio/effects/chain.js";
3
+ import type { Param } from "../../attributes/audio/ramp.js";
3
4
  interface SoundPropsBase {
4
5
  src: string;
5
- volume?: number;
6
+ volume?: Param;
7
+ /** Playback rate; a ramp runs over source seconds after `trimStart`. */
8
+ speed?: Param;
6
9
  loop?: boolean;
7
- /** Audio filters applied to the clip (gain, eq, tremolo, speed, echo). */
8
- filters?: AudioFilter;
10
+ /** Audio effects applied to the clip (gain, eq, tremolo, echo). */
11
+ effects?: AudioEffectsInput;
9
12
  }
10
13
  /**
11
14
  * Author-facing sound props. Two mutually-exclusive ways to bound the clip:
@@ -29,11 +32,12 @@ export type SoundProps = (SoundPropsBase & {
29
32
  /** Canonical, fully-resolved sound props. `trimEnd` is resolved against the catalog. */
30
33
  export interface ResolvedSoundProps {
31
34
  src: string;
32
- volume?: number;
35
+ volume?: Param;
36
+ speed?: Param;
33
37
  loop?: boolean;
34
38
  trimStart?: number;
35
39
  trimEnd?: number;
36
- filters?: AudioFilterItem[];
40
+ effects?: AudioEffect[];
37
41
  }
38
42
  /**
39
43
  * A clip's resolved props, and how long it runs. What a node plays is declared
@@ -41,15 +45,14 @@ export interface ResolvedSoundProps {
41
45
  */
42
46
  export declare class Sound {
43
47
  readonly src: string;
44
- volume: number;
48
+ volume: Param;
49
+ speed: Param;
45
50
  loop: boolean;
46
51
  trimStart: number;
47
52
  trimEnd: number;
48
- filters: AudioFilterItem[];
53
+ effects: AudioEffect[];
49
54
  constructor(props: SoundProps);
50
- /** See `schedule.effectiveSpeed`. */
51
- effectiveSpeed(): number;
52
- /** See `schedule.clipDurationFor`. */
55
+ /** Clip seconds `trimmedSourceLength` source seconds take at this clip's speed. */
53
56
  clipDurationFor(trimmedSourceLength: number): number;
54
57
  /** @deprecated Renamed to {@link clipDurationFor}; kept until 1.0. */
55
58
  sceneDurationFor(trimmedSourceLength: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,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC;CAC3B;AAED;;;GAGG;AACH,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;IAW7B,mFAAmF;IACnF,eAAe,CAAC,mBAAmB,EAAE,MAAM,GAAG,MAAM;IAIpD,sEAAsE;IACtE,gBAAgB,CAAC,mBAAmB,EAAE,MAAM,GAAG,MAAM;IAIrD,qFAAqF;IACrF,IAAI,YAAY,IAAI,MAAM,GAAG,SAAS,CAIrC;CACJ"}
@@ -1,5 +1,5 @@
1
- import { resolveAudioFilters } from "../../attributes/audio/filters/chain.js";
2
- import * as schedule from "../../attributes/audio/schedule.js";
1
+ import { resolveAudioEffects } from "../../attributes/audio/effects/chain.js";
2
+ import { clipTimeAtSource } from "../../attributes/audio/schedule.js";
3
3
  /**
4
4
  * A clip's resolved props, and how long it runs. What a node plays is declared
5
5
  * through `declareAudio`; this is only the arithmetic over one clip.
@@ -7,26 +7,24 @@ import * as schedule from "../../attributes/audio/schedule.js";
7
7
  export class Sound {
8
8
  src;
9
9
  volume;
10
+ speed;
10
11
  loop;
11
12
  trimStart;
12
13
  trimEnd;
13
- filters;
14
+ effects;
14
15
  constructor(props) {
15
16
  this.src = props.src;
16
17
  this.volume = props.volume ?? 1;
18
+ this.speed = props.speed ?? 1;
17
19
  this.loop = props.loop ?? false;
18
20
  // `duration` is sugar for `trimStart: 0, trimEnd: duration`.
19
21
  this.trimStart = props.trimStart ?? 0;
20
22
  this.trimEnd = props.trimEnd ?? props.duration ?? Infinity;
21
- this.filters = resolveAudioFilters(props.filters);
23
+ this.effects = resolveAudioEffects(props.effects);
22
24
  }
23
- /** See `schedule.effectiveSpeed`. */
24
- effectiveSpeed() {
25
- return schedule.effectiveSpeed(this.filters);
26
- }
27
- /** See `schedule.clipDurationFor`. */
25
+ /** Clip seconds `trimmedSourceLength` source seconds take at this clip's speed. */
28
26
  clipDurationFor(trimmedSourceLength) {
29
- return schedule.clipDurationFor(this.filters, trimmedSourceLength);
27
+ return clipTimeAtSource(this.speed, trimmedSourceLength);
30
28
  }
31
29
  /** @deprecated Renamed to {@link clipDurationFor}; kept until 1.0. */
32
30
  sceneDurationFor(trimmedSourceLength) {
@@ -1 +1 @@
1
- {"version":3,"file":"sound.js","sourceRoot":"","sources":["../../../src/attributes/audio/sound.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACpF,OAAO,KAAK,QAAQ,MAAM,6BAA6B,CAAC;AAkCxD;;;GAGG;AACH,MAAM,OAAO,KAAK;IACL,GAAG,CAAS;IACrB,MAAM,CAAS;IACf,IAAI,CAAU;IACd,SAAS,CAAS;IAClB,OAAO,CAAS;IAChB,OAAO,CAAoB;IAE3B,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,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,qCAAqC;IACrC,cAAc;QACV,OAAO,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACjD,CAAC;IAED,sCAAsC;IACtC,eAAe,CAAC,mBAA2B;QACvC,OAAO,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAC;IACvE,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 { AudioFilterItem } from \"@/attributes/audio/filters/union\";\r\nimport { AudioFilter, resolveAudioFilters } from \"@/attributes/audio/filters/chain\";\r\nimport * as schedule from \"@/attributes/audio/schedule\";\r\n\r\ninterface SoundPropsBase {\r\n src: string;\r\n volume?: number;\r\n loop?: boolean;\r\n /** Audio filters applied to the clip (gain, eq, tremolo, speed, echo). */\r\n filters?: AudioFilter;\r\n}\r\n\r\n/**\r\n * Author-facing sound props. Two mutually-exclusive ways to bound the clip:\r\n *\r\n * - `{ trimStart?, trimEnd? }` — explicit in/out points into the source file.\r\n * - `{ duration? }` — syntax sugar for a clip that runs `duration` seconds from\r\n * the start (equivalent to `trimStart: 0, trimEnd: duration`).\r\n *\r\n * When neither `trimEnd` nor `duration` is given, the clip runs to the source's\r\n * full length (resolved from the asset catalog). `trimStart` defaults to 0.\r\n */\r\nexport type SoundProps =\r\n | (SoundPropsBase & { trimStart?: number; trimEnd?: number; duration?: undefined })\r\n | (SoundPropsBase & { duration?: number; trimStart?: undefined; trimEnd?: undefined });\r\n\r\n/** Canonical, fully-resolved sound props. `trimEnd` is resolved against the catalog. */\r\nexport interface ResolvedSoundProps {\r\n src: string;\r\n volume?: number;\r\n loop?: boolean;\r\n trimStart?: number;\r\n trimEnd?: number;\r\n filters?: AudioFilterItem[];\r\n}\r\n\r\n/**\r\n * A clip's resolved props, and how long it runs. What a node plays is declared\r\n * through `declareAudio`; this is only the arithmetic over one clip.\r\n */\r\nexport class Sound {\r\n readonly src: string;\r\n volume: number;\r\n loop: boolean;\r\n trimStart: number;\r\n trimEnd: number;\r\n filters: AudioFilterItem[];\r\n\r\n constructor(props: SoundProps) {\r\n this.src = props.src;\r\n this.volume = props.volume ?? 1;\r\n this.loop = props.loop ?? false;\r\n // `duration` is sugar for `trimStart: 0, trimEnd: duration`.\r\n this.trimStart = props.trimStart ?? 0;\r\n this.trimEnd = props.trimEnd ?? props.duration ?? Infinity;\r\n this.filters = resolveAudioFilters(props.filters);\r\n }\r\n\r\n /** See `schedule.effectiveSpeed`. */\r\n effectiveSpeed(): number {\r\n return schedule.effectiveSpeed(this.filters);\r\n }\r\n\r\n /** See `schedule.clipDurationFor`. */\r\n clipDurationFor(trimmedSourceLength: number): number {\r\n return schedule.clipDurationFor(this.filters, trimmedSourceLength);\r\n }\r\n\r\n /** @deprecated Renamed to {@link clipDurationFor}; kept until 1.0. */\r\n sceneDurationFor(trimmedSourceLength: number): number {\r\n return this.clipDurationFor(trimmedSourceLength);\r\n }\r\n\r\n /** Clip seconds, speed profile applied; `undefined` when nothing bounds the clip. */\r\n get clipDuration(): number | undefined {\r\n return this.trimEnd !== Infinity\r\n ? this.clipDurationFor(this.trimEnd - this.trimStart)\r\n : undefined;\r\n }\r\n}\r\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;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\";\r\nimport { type AudioEffectsInput, resolveAudioEffects } from \"@/attributes/audio/effects/chain\";\r\nimport type { Param } from \"@/attributes/audio/ramp\";\r\nimport { clipTimeAtSource } from \"@/attributes/audio/schedule\";\r\n\r\ninterface SoundPropsBase {\r\n src: string;\r\n volume?: Param;\r\n /** Playback rate; a ramp runs over source seconds after `trimStart`. */\r\n speed?: Param;\r\n loop?: boolean;\r\n /** Audio effects applied to the clip (gain, eq, tremolo, echo). */\r\n effects?: AudioEffectsInput;\r\n}\r\n\r\n/**\r\n * Author-facing sound props. Two mutually-exclusive ways to bound the clip:\r\n *\r\n * - `{ trimStart?, trimEnd? }` — explicit in/out points into the source file.\r\n * - `{ duration? }` — syntax sugar for a clip that runs `duration` seconds from\r\n * the start (equivalent to `trimStart: 0, trimEnd: duration`).\r\n *\r\n * When neither `trimEnd` nor `duration` is given, the clip runs to the source's\r\n * full length (resolved from the asset catalog). `trimStart` defaults to 0.\r\n */\r\nexport type SoundProps =\r\n | (SoundPropsBase & { trimStart?: number; trimEnd?: number; duration?: undefined })\r\n | (SoundPropsBase & { duration?: number; trimStart?: undefined; trimEnd?: undefined });\r\n\r\n/** Canonical, fully-resolved sound props. `trimEnd` is resolved against the catalog. */\r\nexport interface ResolvedSoundProps {\r\n src: string;\r\n volume?: Param;\r\n speed?: Param;\r\n loop?: boolean;\r\n trimStart?: number;\r\n trimEnd?: number;\r\n effects?: AudioEffect[];\r\n}\r\n\r\n/**\r\n * A clip's resolved props, and how long it runs. What a node plays is declared\r\n * through `declareAudio`; this is only the arithmetic over one clip.\r\n */\r\nexport class Sound {\r\n readonly src: string;\r\n volume: Param;\r\n speed: Param;\r\n loop: boolean;\r\n trimStart: number;\r\n trimEnd: number;\r\n effects: AudioEffect[];\r\n\r\n constructor(props: SoundProps) {\r\n this.src = props.src;\r\n this.volume = props.volume ?? 1;\r\n this.speed = props.speed ?? 1;\r\n this.loop = props.loop ?? false;\r\n // `duration` is sugar for `trimStart: 0, trimEnd: duration`.\r\n this.trimStart = props.trimStart ?? 0;\r\n this.trimEnd = props.trimEnd ?? props.duration ?? Infinity;\r\n this.effects = resolveAudioEffects(props.effects);\r\n }\r\n\r\n /** Clip seconds `trimmedSourceLength` source seconds take at this clip's speed. */\r\n clipDurationFor(trimmedSourceLength: number): number {\r\n return clipTimeAtSource(this.speed, trimmedSourceLength);\r\n }\r\n\r\n /** @deprecated Renamed to {@link clipDurationFor}; kept until 1.0. */\r\n sceneDurationFor(trimmedSourceLength: number): number {\r\n return this.clipDurationFor(trimmedSourceLength);\r\n }\r\n\r\n /** Clip seconds, speed profile applied; `undefined` when nothing bounds the clip. */\r\n get clipDuration(): number | undefined {\r\n return this.trimEnd !== Infinity\r\n ? this.clipDurationFor(this.trimEnd - this.trimStart)\r\n : undefined;\r\n }\r\n}\r\n"]}
@@ -0,0 +1,33 @@
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
+ */
10
+ export interface AudioTransition {
11
+ readonly duration: number;
12
+ /**
13
+ * Progress through the transition (x, 0→1) to how far it has come (y, the
14
+ * gain for a fade), read as entering; a `transitionOut` plays it backwards.
15
+ * Default `"equalPower"`, sin(πx/2).
16
+ */
17
+ readonly curve?: "equalPower" | EaseSpec;
18
+ }
19
+ /**
20
+ * The two transitions' durations on a clip `length` seconds long: shrunk in
21
+ * proportion when together they would overrun it.
22
+ */
23
+ export declare function transitionSpans(length: number, transitionIn?: AudioTransition, transitionOut?: AudioTransition): {
24
+ readonly in: number;
25
+ readonly out: number;
26
+ };
27
+ /**
28
+ * The gain the transitions put on a clip at `t` of its `length` seconds: 1
29
+ * outside both. An open clip (`length` not finite) has no end to leave from.
30
+ */
31
+ export declare function transitionGainAt(t: number, length: number, transitionIn?: AudioTransition, transitionOut?: AudioTransition): number;
32
+ export declare function transitionKey(transition: AudioTransition | undefined): string;
33
+ //# sourceMappingURL=transition.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,48 @@
1
+ import { easeOfSpec } from "../../tween/ease/spec.js";
2
+ const EQUAL_POWER = (x) => Math.sin((Math.max(0, Math.min(1, x)) * Math.PI) / 2);
3
+ const shapes = new WeakMap();
4
+ function shapeOf(transition) {
5
+ const curve = transition.curve;
6
+ if (curve === undefined || curve === "equalPower")
7
+ return EQUAL_POWER;
8
+ let shape = shapes.get(curve);
9
+ if (!shape)
10
+ shapes.set(curve, (shape = easeOfSpec(curve)));
11
+ return shape;
12
+ }
13
+ /**
14
+ * The two transitions' durations on a clip `length` seconds long: shrunk in
15
+ * proportion when together they would overrun it.
16
+ */
17
+ export function transitionSpans(length, transitionIn, transitionOut) {
18
+ const wanted = { in: Math.max(0, transitionIn?.duration ?? 0), out: Math.max(0, transitionOut?.duration ?? 0) };
19
+ if (!Number.isFinite(length))
20
+ return { in: wanted.in, out: 0 };
21
+ const total = wanted.in + wanted.out;
22
+ if (total <= length || total === 0)
23
+ return wanted;
24
+ if (process.env.NODE_ENV !== "production") {
25
+ console.warn(`[motionscript] Transitions of ${total.toFixed(3)}s overrun a ${length.toFixed(3)}s clip; both are shortened to fit.`);
26
+ }
27
+ const scale = Math.max(0, length) / total;
28
+ return { in: wanted.in * scale, out: wanted.out * scale };
29
+ }
30
+ /**
31
+ * The gain the transitions put on a clip at `t` of its `length` seconds: 1
32
+ * outside both. An open clip (`length` not finite) has no end to leave from.
33
+ */
34
+ export function transitionGainAt(t, length, transitionIn, transitionOut) {
35
+ const spans = transitionSpans(length, transitionIn, transitionOut);
36
+ let gain = 1;
37
+ if (transitionIn && spans.in > 0 && t < spans.in)
38
+ gain *= Math.max(0, shapeOf(transitionIn)(Math.max(0, t) / spans.in));
39
+ if (transitionOut && spans.out > 0 && t > length - spans.out)
40
+ gain *= Math.max(0, shapeOf(transitionOut)(Math.max(0, length - t) / spans.out));
41
+ return gain;
42
+ }
43
+ export function transitionKey(transition) {
44
+ if (!transition)
45
+ return "_";
46
+ return `${transition.duration}:${typeof transition.curve === "object" ? JSON.stringify(transition.curve) : transition.curve ?? "equalPower"}`;
47
+ }
48
+ //# sourceMappingURL=transition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transition.js","sourceRoot":"","sources":["../../../src/attributes/audio/transition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAiB,MAAM,mBAAmB,CAAC;AAqB9D,MAAM,WAAW,GAAmB,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CA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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\";\r\nimport type { EasingFunction } from \"@/tween/ease/type\";\r\n\r\n/**\r\n * What happens as a clip enters (`transitionIn`) or leaves (`transitionOut`):\r\n * today, a fade over its first or last `duration` clip seconds.\r\n *\r\n * A cross-fade is two clips that overlap, the first carrying a `transitionOut`\r\n * and the second a `transitionIn` as long as the overlap; equal-power shapes\r\n * are complementary, so the pair needs no link between them.\r\n */\r\nexport interface AudioTransition {\r\n readonly duration: number;\r\n /**\r\n * Progress through the transition (x, 0→1) to how far it has come (y, the\r\n * gain for a fade), read as entering; a `transitionOut` plays it backwards.\r\n * Default `\"equalPower\"`, sin(πx/2).\r\n */\r\n readonly curve?: \"equalPower\" | EaseSpec;\r\n}\r\n\r\nconst EQUAL_POWER: EasingFunction = (x) => Math.sin((Math.max(0, Math.min(1, x)) * Math.PI) / 2);\r\nconst shapes = new WeakMap<EaseSpec, EasingFunction>();\r\n\r\nfunction shapeOf(transition: AudioTransition): EasingFunction {\r\n const curve = transition.curve;\r\n if (curve === undefined || curve === \"equalPower\") return EQUAL_POWER;\r\n let shape = shapes.get(curve);\r\n if (!shape) shapes.set(curve, (shape = easeOfSpec(curve)));\r\n return shape;\r\n}\r\n\r\n/**\r\n * The two transitions' durations on a clip `length` seconds long: shrunk in\r\n * proportion when together they would overrun it.\r\n */\r\nexport function transitionSpans(length: number, transitionIn?: AudioTransition, transitionOut?: AudioTransition): { readonly in: number; readonly out: number } {\r\n const wanted = { in: Math.max(0, transitionIn?.duration ?? 0), out: Math.max(0, transitionOut?.duration ?? 0) };\r\n if (!Number.isFinite(length)) return { in: wanted.in, out: 0 };\r\n const total = wanted.in + wanted.out;\r\n if (total <= length || total === 0) return wanted;\r\n if (process.env.NODE_ENV !== \"production\") {\r\n console.warn(`[motionscript] Transitions of ${total.toFixed(3)}s overrun a ${length.toFixed(3)}s clip; both are shortened to fit.`);\r\n }\r\n const scale = Math.max(0, length) / total;\r\n return { in: wanted.in * scale, out: wanted.out * scale };\r\n}\r\n\r\n/**\r\n * The gain the transitions put on a clip at `t` of its `length` seconds: 1\r\n * outside both. An open clip (`length` not finite) has no end to leave from.\r\n */\r\nexport function transitionGainAt(t: number, length: number, transitionIn?: AudioTransition, transitionOut?: AudioTransition): number {\r\n const spans = transitionSpans(length, transitionIn, transitionOut);\r\n let gain = 1;\r\n if (transitionIn && spans.in > 0 && t < spans.in) gain *= Math.max(0, shapeOf(transitionIn)(Math.max(0, t) / spans.in));\r\n if (transitionOut && spans.out > 0 && t > length - spans.out) gain *= Math.max(0, shapeOf(transitionOut)(Math.max(0, length - t) / spans.out));\r\n return gain;\r\n}\r\n\r\nexport function transitionKey(transition: AudioTransition | undefined): string {\r\n if (!transition) return \"_\";\r\n return `${transition.duration}:${typeof transition.curve === \"object\" ? JSON.stringify(transition.curve) : transition.curve ?? \"equalPower\"}`;\r\n}\r\n"]}
@@ -1,8 +1,6 @@
1
1
  export * from './shape/corners/index.js';
2
2
  export * from './shape/effects/index.js';
3
3
  export * from './shape/fill/index.js';
4
- export { normalizeUniforms, lerpUniformValue, lerpUniformRecord, uniformValuesEqual, uniformRecordsEqual, describeUniforms, writeUniforms, coordsMatrix, parseShaderChildren, } from './shape/sksl-uniforms.js';
5
- export type { SkSLUniformRecord, UniformReflect, UniformSlot, UniformBounds, ShaderChildDecl, } from './shape/sksl-uniforms.js';
6
4
  export * from './shape/filters/index.js';
7
5
  export * from './shape/path/index.js';
8
6
  export * from './shape/shadow/index.js';
@@ -10,16 +8,17 @@ export * from './shape/stroke/index.js';
10
8
  export { Sound, SoundProps } from './audio/sound.js';
11
9
  export type { AudioBusStop, AudioRequest } from './audio/request.js';
12
10
  export { busStopKey } from './audio/request.js';
13
- export type { AudioClip, AudioScope } from './audio/schedule.js';
14
- export * from './audio/filters/index.js';
11
+ export type { AudioClip } from './audio/schedule.js';
12
+ export { clipDurationOf, clipTimeAtSource, sourceTimeAtClip } from './audio/schedule.js';
13
+ export * from './audio/effects/index.js';
14
+ export * from './audio/ramp.js';
15
+ export * from './audio/transition.js';
15
16
  export * from './layout/index.js';
16
17
  export * from './mask/boolean.js';
17
18
  export * from './mask/mask.js';
18
19
  export * from './text/index.js';
19
- export { property, getPropertyMeta, PropOptions } from './properties/decorator.js';
20
- export type { PropertyMeta } from './properties/decorator.js';
21
- export { fillProperty, strokeProperty, shadowProperty, effectsProperty, colorProperty, cornerRadiusProperty, cornerStyleProperty, pathProperty, insetsProperty, alignmentProperty, vector2Property, sizeProperty, textProperty, } from './properties/typed.js';
22
- export type { AttributePropOptions } from './properties/typed.js';
20
+ export { getPropertyMeta } from './properties/decorator.js';
21
+ export type { PropertyMeta, PropOptions } from './properties/decorator.js';
23
22
  export * from "./shape/shaders/index.js";
24
23
  export * from './shared/operators.js';
25
24
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/attributes/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAM7B,OAAO,EACH,iBAAiB,EAAE,gBAAgB,EAAE,iBAAiB,EACtD,kBAAkB,EAAE,mBAAmB,EACvC,gBAAgB,EAAE,aAAa,EAAE,YAAY,EAAE,mBAAmB,GACrE,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EACR,iBAAiB,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,eAAe,GACjF,MAAM,uBAAuB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;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CAAC;AAC7C,YAAY,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACtF,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACxE,cAAc,iBAAiB,CAAC;AAEhC,cAAc,oBAAoB,CAAC"}
@@ -1,25 +1,22 @@
1
1
  export * from './shape/corners/index.js';
2
2
  export * from './shape/effects/index.js';
3
3
  export * from './shape/fill/index.js';
4
- // The renderer-facing half of the SkSL plumbing. Surfaced for the same reason
5
- // `resolveVideoTimestamp` is: the marshalling rules are part of the shader fill's
6
- // contract, so the backend consumes core's definition rather than reimplementing
7
- // it. Named rather than wildcard because `SkSLUniform`/`SkSLUniformValue` already
8
- // reach the barrel through `./shape/effects`.
9
- export { normalizeUniforms, lerpUniformValue, lerpUniformRecord, uniformValuesEqual, uniformRecordsEqual, describeUniforms, writeUniforms, coordsMatrix, parseShaderChildren, } from './shape/sksl-uniforms.js';
10
4
  export * from './shape/filters/index.js';
11
5
  export * from './shape/path/index.js';
12
6
  export * from './shape/shadow/index.js';
13
7
  export * from './shape/stroke/index.js';
14
8
  export { Sound } from './audio/sound.js';
15
9
  export { busStopKey } from './audio/request.js';
16
- export * from './audio/filters/index.js';
10
+ export { clipDurationOf, clipTimeAtSource, sourceTimeAtClip } from './audio/schedule.js';
11
+ export * from './audio/effects/index.js';
12
+ export * from './audio/ramp.js';
13
+ export * from './audio/transition.js';
17
14
  export * from './layout/index.js';
18
15
  export * from './mask/boolean.js';
19
16
  export * from './mask/mask.js';
20
17
  export * from './text/index.js';
21
- export { property, getPropertyMeta } from './properties/decorator.js';
22
- export { fillProperty, strokeProperty, shadowProperty, effectsProperty, colorProperty, cornerRadiusProperty, cornerStyleProperty, pathProperty, insetsProperty, alignmentProperty, vector2Property, sizeProperty, textProperty, } from './properties/typed.js';
18
+ // What a host reads to draw an inspector: every property a node type declares.
19
+ export { getPropertyMeta } from './properties/decorator.js';
23
20
  export * from "./shape/shaders/index.js";
24
21
  export * from './shared/operators.js';
25
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/attributes/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,8EAA8E;AAC9E,kFAAkF;AAClF,iFAAiF;AACjF,kFAAkF;AAClF,8CAA8C;AAC9C,OAAO,EACH,iBAAiB,EAAE,gBAAgB,EAAE,iBAAiB,EACtD,kBAAkB,EAAE,mBAAmB,EACvC,gBAAgB,EAAE,aAAa,EAAE,YAAY,EAAE,mBAAmB,GACrE,MAAM,uBAAuB,CAAC;AAI/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAc,MAAM,eAAe,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAe,MAAM,wBAAwB,CAAC;AAEhF,OAAO,EACH,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,aAAa,EAC5E,oBAAoB,EAAE,mBAAmB,EAAE,YAAY,EACvD,cAAc,EAAE,iBAAiB,EAAE,eAAe,EAAE,YAAY,EAChE,YAAY,GACf,MAAM,oBAAoB,CAAC;AAE5B,cAAc,iBAAiB,CAAC;AAEhC,cAAc,oBAAoB,CAAC","sourcesContent":["export * from './shape/corners';\r\nexport * from './shape/effects';\r\nexport * from './shape/fill';\r\n// The renderer-facing half of the SkSL plumbing. Surfaced for the same reason\r\n// `resolveVideoTimestamp` is: the marshalling rules are part of the shader fill's\r\n// contract, so the backend consumes core's definition rather than reimplementing\r\n// it. Named rather than wildcard because `SkSLUniform`/`SkSLUniformValue` already\r\n// reach the barrel through `./shape/effects`.\r\nexport {\r\n normalizeUniforms, lerpUniformValue, lerpUniformRecord,\r\n uniformValuesEqual, uniformRecordsEqual,\r\n describeUniforms, writeUniforms, coordsMatrix, parseShaderChildren,\r\n} from './shape/sksl-uniforms';\r\nexport type {\r\n SkSLUniformRecord, UniformReflect, UniformSlot, UniformBounds, ShaderChildDecl,\r\n} from './shape/sksl-uniforms';\r\nexport * from './shape/filters';\r\nexport * from './shape/path';\r\nexport * from './shape/shadow';\r\nexport * from './shape/stroke';\r\nexport { Sound, SoundProps } from './audio/sound';\r\nexport type { AudioBusStop, AudioRequest } from './audio/request';\r\nexport { busStopKey } from './audio/request';\r\nexport type { AudioClip, AudioScope } from './audio/schedule';\r\nexport * from './audio/filters';\r\nexport * from './layout';\r\nexport * from './mask/boolean';\r\nexport * from './mask/mask';\r\nexport * from './text';\r\nexport { property, getPropertyMeta, PropOptions } from './properties/decorator';\r\nexport type { PropertyMeta } from './properties/decorator';\r\nexport {\r\n fillProperty, strokeProperty, shadowProperty, effectsProperty, colorProperty,\r\n cornerRadiusProperty, cornerStyleProperty, pathProperty,\r\n insetsProperty, alignmentProperty, vector2Property, sizeProperty,\r\n textProperty,\r\n} from './properties/typed';\r\nexport type { AttributePropOptions } from './properties/typed';\r\nexport * from \"./shape/shaders\";\r\n\r\nexport * from './shared/operators';\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/attributes/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAc,MAAM,eAAe,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACtF,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,+EAA+E;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,cAAc,iBAAiB,CAAC;AAEhC,cAAc,oBAAoB,CAAC","sourcesContent":["export * from './shape/corners';\r\nexport * from './shape/effects';\r\nexport * from './shape/fill';\r\nexport * from './shape/filters';\r\nexport * from './shape/path';\r\nexport * from './shape/shadow';\r\nexport * from './shape/stroke';\r\nexport { Sound, SoundProps } from './audio/sound';\r\nexport type { AudioBusStop, AudioRequest } from './audio/request';\r\nexport { busStopKey } from './audio/request';\r\nexport type { AudioClip } from './audio/schedule';\r\nexport { clipDurationOf, clipTimeAtSource, sourceTimeAtClip } from './audio/schedule';\r\nexport * from './audio/effects';\r\nexport * from './audio/ramp';\r\nexport * from './audio/transition';\r\nexport * from './layout';\r\nexport * from './mask/boolean';\r\nexport * from './mask/mask';\r\nexport * from './text';\r\n// What a host reads to draw an inspector: every property a node type declares.\r\nexport { getPropertyMeta } from './properties/decorator';\r\nexport type { PropertyMeta, PropOptions } from './properties/decorator';\r\nexport * from \"./shape/shaders\";\r\n\r\nexport * from './shared/operators';\r\n"]}
@@ -31,7 +31,7 @@ export type InsetsProps = number | Partial<InsetsResolved> & {
31
31
  */
32
32
  export type Insets = InsetsProps | InsetsResolved;
33
33
  /**
34
- * The insets attribute's op set — used by `@insetsProperty` and anywhere else a
34
+ * The insets attribute's op set — used by `insetsProperty` and anywhere else a
35
35
  * four-sided inset (padding, an image fill's `crop`, …) resolves and tweens.
36
36
  *
37
37
  * `insetBounds` computes the inner content area produced by subtracting a
@@ -1 +1 @@
1
- {"version":3,"file":"insets.js","sourceRoot":"","sources":["../../../src/attributes/layout/insets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAwD1C,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,EAAE,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,QAAQ,IAAI,QAAQ,EAAE,GAAG,IAAI,CAAC;YACtD,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,QAAQ,IAAI,QAAQ,EAAE,MAAM,IAAI,CAAC;SAClE,CAAC;IACN,CAAC;IACD,IAAI,EAAE,CAAC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} from \"@/attributes/shared/operators\";\r\nimport type { BoxBounds } from \"@/layout/bounds\";\r\nimport { Size2D } from \"./size\";\r\n\r\n/** Fully resolved per-side edge insets. */\r\nexport interface InsetsResolved {\r\n left: number;\r\n right: number;\r\n top: number;\r\n bottom: number;\r\n}\r\n\r\n\r\nexport type InsetsProps = number | Partial<InsetsResolved> & {\r\n horizontal?: number;\r\n vertical?: number;\r\n};\r\n\r\n/**\r\n * Accepted shapes for a four-sided inset prop.\r\n *\r\n * The type is named for the shape (four edge insets), not for one use of it:\r\n * `Node2D.padding` insets a layout box in pixels, an image fill's `crop` insets a\r\n * source in fractions. Same value, same shorthands, same tween — different roles,\r\n * and each prop names its own.\r\n *\r\n * Mirrors {@link Fill}: the loose author-facing {@link InsetsProps} (a number or\r\n * per-side/symmetric object) plus the strict {@link InsetsResolved} — a read-back\r\n * resolved value structurally satisfies `InsetsProps`, so it passes through\r\n * `insetsOps.resolve` idempotently and can be assigned straight back.\r\n *\r\n * node.padding = 3 // uniform\r\n * node.padding = { horizontal: 8, top: 4 } // mixed\r\n * node.padding = otherNode.padding // resolved passes through\r\n */\r\nexport type Insets = InsetsProps | InsetsResolved;\r\n\r\n\r\n/**\r\n * The insets attribute's op set — used by `@insetsProperty` and anywhere else a\r\n * four-sided inset (padding, an image fill's `crop`, …) resolves and tweens.\r\n *\r\n * `insetBounds` computes the inner content area produced by subtracting a\r\n * resolved inset from an outer size — pure, works for any width/height pair,\r\n * with `x`/`y` carrying the offset of the inner-area center relative to the\r\n * outer-area center. `outsetSize` is its inverse: adds padding back onto\r\n * an inner size to get the outer size that contains it.\r\n */\r\n\r\nexport interface InsetsOps {\r\n\r\n insetBounds(outerWidth: number, outerHeight: number, pad: InsetsResolved): BoxBounds;\r\n outsetSize(innerWidth: number, innerHeight: number, pad: InsetsResolved): Size2D;\r\n}\r\n\r\nexport const insetsOps: AttributeOps<InsetsProps, InsetsResolved> & InsetsOps = {\r\n resolve: (value: InsetsProps, previous?: InsetsResolved): InsetsResolved => {\r\n if (typeof value === \"number\") {\r\n return { left: value, right: value, top: value, bottom: value };\r\n }\r\n\r\n // Fallback resolution order: Specific side -> Symmetric shortcut -> Previous fallback -> Default 0\r\n return {\r\n left: value.left ?? value.horizontal ?? previous?.left ?? 0,\r\n right: value.right ?? value.horizontal ?? previous?.right ?? 0,\r\n top: value.top ?? value.vertical ?? previous?.top ?? 0,\r\n bottom: value.bottom ?? value.vertical ?? previous?.bottom ?? 0,\r\n };\r\n },\r\n lerp: (from: InsetsResolved, to: InsetsResolved, t: number): InsetsResolved => {\r\n return {\r\n left: lerpNumber(from.left, to.left, t),\r\n right: lerpNumber(from.right, to.right, t),\r\n top: lerpNumber(from.top, to.top, t),\r\n bottom: lerpNumber(from.bottom, to.bottom, t),\r\n };\r\n },\r\n insetBounds: (outerWidth, outerHeight, pad) => ({\r\n width: Math.max(0, outerWidth - pad.left - pad.right),\r\n height: Math.max(0, outerHeight - pad.top - pad.bottom),\r\n x: (pad.left - pad.right) / 2,\r\n y: (pad.top - pad.bottom) / 2,\r\n }),\r\n outsetSize: (innerWidth, innerHeight, pad) => ({\r\n width: innerWidth + pad.left + pad.right,\r\n height: innerHeight + pad.top + pad.bottom,\r\n }),\r\n};\r\n"]}
1
+ {"version":3,"file":"insets.js","sourceRoot":"","sources":["../../../src/attributes/layout/insets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAwD1C,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,IAA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C;QAC7B,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC;KAChC,CAAC;IACF,UAAU,EAAE,CAAC,UAAU,EAAE,WAAW,EAAE,GAAG,EAAE,EAAE,CAAC,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\";\r\nimport type { AttributeOps } from \"@/attributes/shared/operators\";\r\nimport type { BoxBounds } from \"@/layout/bounds\";\r\nimport { Size2D } from \"./size\";\r\n\r\n/** Fully resolved per-side edge insets. */\r\nexport interface InsetsResolved {\r\n left: number;\r\n right: number;\r\n top: number;\r\n bottom: number;\r\n}\r\n\r\n\r\nexport type InsetsProps = number | Partial<InsetsResolved> & {\r\n horizontal?: number;\r\n vertical?: number;\r\n};\r\n\r\n/**\r\n * Accepted shapes for a four-sided inset prop.\r\n *\r\n * The type is named for the shape (four edge insets), not for one use of it:\r\n * `Node2D.padding` insets a layout box in pixels, an image fill's `crop` insets a\r\n * source in fractions. Same value, same shorthands, same tween — different roles,\r\n * and each prop names its own.\r\n *\r\n * Mirrors {@link Fill}: the loose author-facing {@link InsetsProps} (a number or\r\n * per-side/symmetric object) plus the strict {@link InsetsResolved} — a read-back\r\n * resolved value structurally satisfies `InsetsProps`, so it passes through\r\n * `insetsOps.resolve` idempotently and can be assigned straight back.\r\n *\r\n * node.padding = 3 // uniform\r\n * node.padding = { horizontal: 8, top: 4 } // mixed\r\n * node.padding = otherNode.padding // resolved passes through\r\n */\r\nexport type Insets = InsetsProps | InsetsResolved;\r\n\r\n\r\n/**\r\n * The insets attribute's op set — used by `insetsProperty` and anywhere else a\r\n * four-sided inset (padding, an image fill's `crop`, …) resolves and tweens.\r\n *\r\n * `insetBounds` computes the inner content area produced by subtracting a\r\n * resolved inset from an outer size — pure, works for any width/height pair,\r\n * with `x`/`y` carrying the offset of the inner-area center relative to the\r\n * outer-area center. `outsetSize` is its inverse: adds padding back onto\r\n * an inner size to get the outer size that contains it.\r\n */\r\n\r\nexport interface InsetsOps {\r\n\r\n insetBounds(outerWidth: number, outerHeight: number, pad: InsetsResolved): BoxBounds;\r\n outsetSize(innerWidth: number, innerHeight: number, pad: InsetsResolved): Size2D;\r\n}\r\n\r\nexport const insetsOps: AttributeOps<InsetsProps, InsetsResolved> & InsetsOps = {\r\n resolve: (value: InsetsProps, previous?: InsetsResolved): InsetsResolved => {\r\n if (typeof value === \"number\") {\r\n return { left: value, right: value, top: value, bottom: value };\r\n }\r\n\r\n // Fallback resolution order: Specific side -> Symmetric shortcut -> Previous fallback -> Default 0\r\n return {\r\n left: value.left ?? value.horizontal ?? previous?.left ?? 0,\r\n right: value.right ?? value.horizontal ?? previous?.right ?? 0,\r\n top: value.top ?? value.vertical ?? previous?.top ?? 0,\r\n bottom: value.bottom ?? value.vertical ?? previous?.bottom ?? 0,\r\n };\r\n },\r\n lerp: (from: InsetsResolved, to: InsetsResolved, t: number): InsetsResolved => {\r\n return {\r\n left: lerpNumber(from.left, to.left, t),\r\n right: lerpNumber(from.right, to.right, t),\r\n top: lerpNumber(from.top, to.top, t),\r\n bottom: lerpNumber(from.bottom, to.bottom, t),\r\n };\r\n },\r\n insetBounds: (outerWidth, outerHeight, pad) => ({\r\n width: Math.max(0, outerWidth - pad.left - pad.right),\r\n height: Math.max(0, outerHeight - pad.top - pad.bottom),\r\n x: (pad.left - pad.right) / 2,\r\n y: (pad.top - pad.bottom) / 2,\r\n }),\r\n outsetSize: (innerWidth, innerHeight, pad) => ({\r\n width: innerWidth + pad.left + pad.right,\r\n height: innerHeight + pad.top + pad.bottom,\r\n }),\r\n};\r\n"]}
@@ -9,8 +9,8 @@ import { Vector2 } from "../../attributes/layout/vector2.js";
9
9
  * ```
10
10
  *
11
11
  * Point mapping is `x' = (a·x + c·y + e) / w`, `y' = (b·x + d·y + f) / w`, with
12
- * `w = g·x + h·y + i`. This is the same column-order convention CanvasKit/DOM
13
- * use, so matrices compose in draw order: `parent.multiply(child)` is the world
12
+ * `w = g·x + h·y + i`. This is the same column-order convention the DOM
13
+ * uses, so matrices compose in draw order: `parent.multiply(child)` is the world
14
14
  * transform of `child`.
15
15
  *
16
16
  * **The bottom row is optional, and leaving it off means `[0 0 1]`** — an
@@ -1 +1 @@
1
- {"version":3,"file":"matrix2d.js","sourceRoot":"","sources":["../../../src/attributes/layout/matrix2d.ts"],"names":[],"mappings":"AAqCA,0FAA0F;AAC1F,MAAM,UAAU,YAAY,CAAC,CAAW;IACpC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC;AACpE,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,KAAK,GAAG,IAAI,CAAC;AACnB,SAAS,KAAK,CAAC,CAAS;IACpB,IAAI,CAAC,GAAG,KAAK,IAAI,CAAC,GAAG,CAAC,KAAK;QAAE,OAAO,CAAC,CAAC;IACtC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;AAClC,CAAC;AAED,qEAAqE;AACrE,MAAM,UAAU,QAAQ;IACpB,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AAClD,CAAC;AAED,8CAA8C;AAC9C,MAAM,UAAU,WAAW,CAAC,EAAU,EAAE,EAAU;IAC9C,OAAO,EAAE,CAAC,EAAE,C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C,CAAC,CAAC;IACnC,OAAO;QACH,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,GAAG,EAAE;QACpB,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,GAAG,EAAE;QACpB,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC;QACtC,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,GAAG,EAAE;QACpB,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,GAAG,EAAE;QACpB,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC;QACtC,CAAC,EAAE,CAAC,GAAG,EAAE;QACT,CAAC,EAAE,CAAC,GAAG,EAAE;QACT,CAAC;KACJ,CAAC;AACN,CAAC","sourcesContent":["import { Vector2 } from \"@/attributes/layout/vector2\";\r\n\r\n/**\r\n * A 2D transform stored as the members of a 3×3 matrix:\r\n *\r\n * ```\r\n * | a c e |\r\n * | b d f |\r\n * | g h i |\r\n * ```\r\n *\r\n * Point mapping is `x' = (a·x + c·y + e) / w`, `y' = (b·x + d·y + f) / w`, with\r\n * `w = g·x + h·y + i`. This is the same column-order convention CanvasKit/DOM\r\n * use, so matrices compose in draw order: `parent.multiply(child)` is the world\r\n * transform of `child`.\r\n *\r\n * **The bottom row is optional, and leaving it off means `[0 0 1]`** — an\r\n * ordinary affine transform, where `w` is 1 everywhere and the divide falls\r\n * away. Every matrix in the engine was exactly that until\r\n * {@link nodeProjectedMatrix} arrived: a node tilted out of its own plane\r\n * projects through a *homography*, and a homography does not fit in six numbers.\r\n * Rather than a second matrix type — with a second `multiply`, `invert` and\r\n * `applyToPoint` beside it, which is precisely how a renderer and a hit test end\r\n * up disagreeing about where a node is — the row lives here, and everything that\r\n * has no use for it simply omits it.\r\n */\r\n/** @internal */\r\nexport interface Matrix2D {\r\n a: number; b: number; c: number; d: number; e: number; f: number;\r\n /** Perspective row, x term. Omitted on an affine transform (means `0`). */\r\n g?: number;\r\n /** Perspective row, y term. Omitted on an affine transform (means `0`). */\r\n h?: number;\r\n /** Perspective row, constant term. Omitted on an affine transform (means `1`). */\r\n i?: number;\r\n}\r\n\r\n/** @internal Whether `m` carries a perspective row — i.e. whether `w` is not always 1. */\r\nexport function isProjective(m: Matrix2D): boolean {\r\n return (m.g ?? 0) !== 0 || (m.h ?? 0) !== 0 || (m.i ?? 1) !== 1;\r\n}\r\n\r\n/**\r\n * Guard the perspective divide. A point on the vanishing line has `w = 0` and\r\n * projects to infinity, which is a real answer no coordinate can hold; clamping\r\n * to a tiny same-signed `w` sends it far off-screen instead, which is where it\r\n * belongs and is a number the caller can keep doing arithmetic with. Without\r\n * this, one degenerate corner turns an anchor set into `Infinity`/`NaN` and\r\n * takes the selection box, the hit test and any layout reading it with it.\r\n */\r\nconst MIN_W = 1e-6;\r\nfunction safeW(w: number): number {\r\n if (w > MIN_W || w < -MIN_W) return w;\r\n return w < 0 ? -MIN_W : MIN_W;\r\n}\r\n\r\n/** @internal The identity transform — maps every point to itself. */\r\nexport function identity(): Matrix2D {\r\n return { a: 1, b: 0, c: 0, d: 1, e: 0, f: 0 };\r\n}\r\n\r\n/** @internal Pure translation by (tx, ty). */\r\nexport function translation(tx: number, ty: number): Matrix2D {\r\n return { a: 1, b: 0, c: 0, d: 1, e: tx, f: ty };\r\n}\r\n\r\n/**\r\n * `m1 · m2` — the transform that applies `m2` first, then `m1`. Composing an\r\n * ancestor with a descendant (`ancestor.multiply(descendant)`) yields the\r\n * descendant's world transform.\r\n *\r\n * Two affine matrices take the six-member path they always did — that is every\r\n * composition in a scene with no 3D in it, once per node per parent per frame —\r\n * and the general 3×3 product runs only when one side actually carries a\r\n * perspective row.\r\n */\r\n/** @internal */\r\nexport function multiply(m1: Matrix2D, m2: Matrix2D): Matrix2D {\r\n if (isProjective(m1) || isProjective(m2)) return multiplyProjective(m1, m2);\r\n return {\r\n a: m1.a * m2.a + m1.c * m2.b,\r\n b: m1.b * m2.a + m1.d * m2.b,\r\n c: m1.a * m2.c + m1.c * m2.d,\r\n d: m1.b * m2.c + m1.d * m2.d,\r\n e: m1.a * m2.e + m1.c * m2.f + m1.e,\r\n f: m1.b * m2.e + m1.d * m2.f + m1.f,\r\n };\r\n}\r\n\r\n/** The full 3×3 product, rows `[a c e] [b d f] [g h i]`. See {@link multiply}. */\r\nfunction multiplyProjective(m1: Matrix2D, m2: Matrix2D): Matrix2D {\r\n const g1 = m1.g ?? 0, h1 = m1.h ?? 0, i1 = m1.i ?? 1;\r\n const g2 = m2.g ?? 0, h2 = m2.h ?? 0, i2 = m2.i ?? 1;\r\n return {\r\n a: m1.a * m2.a + m1.c * m2.b + m1.e * g2,\r\n c: m1.a * m2.c + m1.c * m2.d + m1.e * h2,\r\n e: m1.a * m2.e + m1.c * m2.f + m1.e * i2,\r\n b: m1.b * m2.a + m1.d * m2.b + m1.f * g2,\r\n d: m1.b * m2.c + m1.d * m2.d + m1.f * h2,\r\n f: m1.b * m2.e + m1.d * m2.f + m1.f * i2,\r\n g: g1 * m2.a + h1 * m2.b + i1 * g2,\r\n h: g1 * m2.c + h1 * m2.d + i1 * h2,\r\n i: g1 * m2.e + h1 * m2.f + i1 * i2,\r\n };\r\n}\r\n\r\n/** @internal Map a point through the transform. */\r\nexport function applyToPoint(m: Matrix2D, p: Vector2): Vector2 {\r\n const x = m.a * p.x + m.c * p.y + m.e;\r\n const y = m.b * p.x + m.d * p.y + m.f;\r\n if (!isProjective(m)) return { x, y };\r\n const w = safeW((m.g ?? 0) * p.x + (m.h ?? 0) * p.y + (m.i ?? 1));\r\n return { x: x / w, y: y / w };\r\n}\r\n\r\n/**\r\n * The inverse transform, or `null` when `m` is singular (a zero scale collapses\r\n * the plane, so no inverse exists). Used to map a viewport-space point back into\r\n * a node's local space for hit testing.\r\n */\r\n/** @internal */\r\nexport function invert(m: Matrix2D): Matrix2D | null {\r\n if (isProjective(m)) return invertProjective(m);\r\n const det = m.a * m.d - m.b * m.c;\r\n if (det === 0 || !Number.isFinite(det)) return null;\r\n const inv = 1 / det;\r\n return {\r\n a: m.d * inv,\r\n b: -m.b * inv,\r\n c: -m.c * inv,\r\n d: m.a * inv,\r\n e: (m.c * m.f - m.d * m.e) * inv,\r\n f: (m.b * m.e - m.a * m.f) * inv,\r\n };\r\n}\r\n\r\n/**\r\n * The inverse of a homography — the adjugate over the determinant, written out\r\n * in this module's row naming. A projective inverse is still a homography, which\r\n * is what lets picking keep mapping a viewport point back into a node's local\r\n * space with nothing but {@link applyToPoint} once the node is tilted.\r\n */\r\nfunction invertProjective(m: Matrix2D): Matrix2D | null {\r\n const { a, b, c, d, e, f } = m;\r\n const g = m.g ?? 0, h = m.h ?? 0, i = m.i ?? 1;\r\n // Cofactors of the 3×3 | a c e | / | b d f | / | g h i |.\r\n const A = d * i - f * h;\r\n const C = f * g - b * i;\r\n const E = b * h - d * g;\r\n const det = a * A + c * C + e * E;\r\n if (det === 0 || !Number.isFinite(det)) return null;\r\n const inv = 1 / det;\r\n return {\r\n a: A * inv,\r\n c: (e * h - c * i) * inv,\r\n e: (c * f - e * d) * inv,\r\n b: C * inv,\r\n d: (a * i - e * g) * inv,\r\n f: (e * b - a * f) * inv,\r\n g: E * inv,\r\n h: (c * g - a * h) * inv,\r\n i: (a * d - c * b) * inv,\r\n };\r\n}\r\n\r\n/**\r\n * The viewport transform a camera scope pushes, in canvas (y-down) space — a\r\n * literal transcription of `RenderContext2D.beginCamera`:\r\n *\r\n * translate(vx, vy) · rotate(-heading) · scale(zoom) · translate(-lookAt.x, +lookAt.y)\r\n *\r\n * `lookAt` is a y-up world point, hence the sign flip on its y. `vx`/`vy` are the\r\n * viewport centre the camera's callers pass (`layoutBounds.x`, `-layoutBounds.y`).\r\n * Kept next to {@link nodeLocalMatrix} so the two stay in step with the renderer.\r\n */\r\n/** @internal */\r\nexport function cameraMatrix(\r\n vx: number, vy: number, lookAt: Vector2, zoom: number, heading: number,\r\n): Matrix2D {\r\n const rad = (-heading * Math.PI) / 180;\r\n const cos = Math.cos(rad);\r\n const sin = Math.sin(rad);\r\n // rotate(-heading) · scale(zoom), the same clockwise canvas convention as\r\n // nodeLocalMatrix's R·S block.\r\n const a = zoom * cos;\r\n const b = zoom * sin;\r\n const c = zoom * -sin;\r\n const d = zoom * cos;\r\n // Fold the trailing translate(-lookAt.x, +lookAt.y) into e/f.\r\n const tx = -lookAt.x;\r\n const ty = lookAt.y;\r\n return { a, b, c, d, e: vx + a * tx + c * ty, f: vy + b * tx + d * ty };\r\n}\r\n\r\n/**\r\n * Build the local transform for a node, matching the renderer's\r\n * `RenderContext2D.transform` exactly (canvas y-down space):\r\n * `T(cx + pivotX, cy + pivotY) · R(deg) · S(scale) · T(-pivotX, -pivotY)`.\r\n *\r\n * @param cx Canvas-space x of the node's layout-cell lookAt.\r\n * @param cy Canvas-space y of the node's layout-cell origin (y-down).\r\n * @param rotation Rotation in degrees, clockwise (canvas convention).\r\n * @param scale Uniform scale factor.\r\n * @param pivotX Pivot offset in pixels, x.\r\n * @param pivotY Pivot offset in pixels, y (canvas y-down).\r\n */\r\n/** @internal */\r\nexport function nodeLocalMatrix(\r\n cx: number, cy: number, rotation: number, scale: number, pivotX: number, pivotY: number,\r\n): Matrix2D {\r\n const rad = (rotation * Math.PI) / 180;\r\n const cos = Math.cos(rad);\r\n const sin = Math.sin(rad);\r\n // R(deg) · S(scale): clockwise rotation in canvas (y-down) is\r\n // | cos -sin | · | s 0 | = | s·cos -s·sin |\r\n // | sin cos | | 0 s | | s·sin s·cos |\r\n const a = scale * cos;\r\n const b = scale * sin;\r\n const c = scale * -sin;\r\n const d = scale * cos;\r\n // Fold the pivot translations into e/f:\r\n // T(cx+pivotX, cy+pivotY) · (RS) · T(-pivotX, -pivotY)\r\n return {\r\n a, b, c, d,\r\n e: cx + pivotX - (a * pivotX + c * pivotY),\r\n f: cy + pivotY - (b * pivotX + d * pivotY),\r\n };\r\n}\r\n\r\n/**\r\n * The out-of-plane half of a node's transform — the mirrors, the two extra\r\n * rotation axes, the push along z and the perspective divide that makes them\r\n * read as depth rather than as squashing. See {@link nodeProjectedMatrix}.\r\n */\r\n/** @internal */\r\nexport interface Projection3D {\r\n /** Tilt about the horizontal axis, degrees. Positive tips the top away. */\r\n rotationX: number;\r\n /** Tilt about the vertical axis, degrees. Positive swings the right edge away. */\r\n rotationY: number;\r\n /**\r\n * In-plane rotation belonging to the 3D block, degrees clockwise — the Z axis\r\n * of `Rx · Ry · Rz`.\r\n *\r\n * A prop of its own rather than a second name for the node's `rotation`, and\r\n * that is a deliberate separation: `rotation` is the node's **shape** — it\r\n * turns the box, the selection outline turns with it, and handles follow —\r\n * while this is part of the projection, which is paint. The two compose (a\r\n * Z rotation is a Z rotation, so they add), but they are two independent\r\n * numbers and editing one never moves the other.\r\n */\r\n rotationZ: number;\r\n /** Push along the view axis in px, applied after the rotations. Inert without `perspective`. */\r\n depth: number;\r\n /** Viewer distance in px. `0` is no perspective at all — a parallel projection. */\r\n perspective: number;\r\n /** Mirror across the node's vertical centre line. */\r\n flipHorizontal: boolean;\r\n /** Mirror across the node's horizontal centre line. */\r\n flipVertical: boolean;\r\n}\r\n\r\n/** @internal Every field of a {@link Projection3D} at rest — the plain 2D node. */\r\nexport const NO_PROJECTION_3D: Projection3D = {\r\n rotationX: 0,\r\n rotationY: 0,\r\n rotationZ: 0,\r\n depth: 0,\r\n perspective: 0,\r\n flipHorizontal: false,\r\n flipVertical: false,\r\n};\r\n\r\n/**\r\n * Whether `p` asks for anything {@link nodeLocalMatrix} cannot already express.\r\n * The gate in front of every projective path in the engine: a scene with no 3D\r\n * in it keeps the six-number matrix, the decomposed `translate/rotate/scale`\r\n * render path, and the affine `multiply` it always had.\r\n */\r\n/** @internal */\r\nexport function hasProjection3D(p: Projection3D): boolean {\r\n return (\r\n p.rotationX !== 0 ||\r\n p.rotationY !== 0 ||\r\n p.rotationZ !== 0 ||\r\n p.flipHorizontal ||\r\n p.flipVertical ||\r\n (p.perspective !== 0 && p.depth !== 0)\r\n );\r\n}\r\n\r\n/**\r\n * Whether a plane carrying this projection has turned its back on the viewer —\r\n * the test behind `backfaceVisible`.\r\n *\r\n * Read off the tilt alone. The plane's normal starts at `(0,0,1)` and comes out\r\n * of `Rx·Ry` with a z of `cos(rotationX)·cos(rotationY)`; the in-plane rotation\r\n * can't change which way it points, and neither, deliberately, can a *mirror*.\r\n * CSS derives the answer from the whole accumulated matrix, where a `scaleX(-1)`\r\n * inverts orientation and hides the element — which is a surprising way to lose\r\n * a node you only meant to flip. Here a flip is a flip and a turn is a turn.\r\n */\r\n/** @internal */\r\nexport function facesAway(rotationX: number, rotationY: number): boolean {\r\n const rad = Math.PI / 180;\r\n return Math.cos(rotationX * rad) * Math.cos(rotationY * rad) < 0;\r\n}\r\n\r\n/**\r\n * A node's local transform with the out-of-plane half folded in — the same space\r\n * and the same pivot convention as {@link nodeLocalMatrix}, which this reduces to\r\n * exactly when {@link hasProjection3D} is false.\r\n *\r\n * The composition, innermost first:\r\n *\r\n * `T(pivot) · P(perspective) · Tz(depth) · Rx · Ry · Rz(rotationZ + rotation) · S(scale) · T(-pivot) · F(flip)`\r\n *\r\n * — everything about the pivot except the mirrors, which reflect about the\r\n * node's own centre so that flipping cannot move the node (see `F` below),\r\n *\r\n * which is CSS's own order for `rotateX(a) rotateY(b) rotateZ(c)` — the in-plane\r\n * rotation innermost, so that adding a tilt never changes what the node's own\r\n * `rotation` already meant.\r\n *\r\n * The Z angle is the **sum** of the two in-plane rotations the node carries, and\r\n * they stay two: `rotation` turns the node's *shape* — its box turns with it, and\r\n * so does anything reading that box — while {@link Projection3D.rotationZ} is\r\n * part of the projection, which is paint (see `Node2D._localMatrix`). Summing them\r\n * is not a coupling but the definition of composing two rotations about one axis;\r\n * neither number moves when the other is edited.\r\n *\r\n * The content is planar — every point enters with `z = 0` — so the whole thing\r\n * collapses to a 3×3 homography over `(x, y, 1)` rather than needing a 4×4 and a\r\n * separate divide step. The projected z survives only as the perspective row.\r\n *\r\n * @param cx Canvas-space x of the node's positioned centre.\r\n * @param cy Canvas-space y of the node's positioned centre (y-down).\r\n * @param rotation In-plane rotation in degrees, clockwise (the Z axis).\r\n * @param scale Uniform scale factor.\r\n * @param pivotX Pivot offset from the centre in px, x.\r\n * @param pivotY Pivot offset from the centre in px, y (canvas y-down).\r\n * @param p The out-of-plane fields.\r\n */\r\n/** @internal */\r\nexport function nodeProjectedMatrix(\r\n cx: number, cy: number, rotation: number, scale: number, pivotX: number, pivotY: number,\r\n p: Projection3D,\r\n): Matrix2D {\r\n if (!hasProjection3D(p)) {\r\n return nodeLocalMatrix(cx, cy, rotation, scale, pivotX, pivotY);\r\n }\r\n const rad = Math.PI / 180;\r\n const ca = Math.cos(p.rotationX * rad), sa = Math.sin(p.rotationX * rad);\r\n const cb = Math.cos(p.rotationY * rad), sb = Math.sin(p.rotationY * rad);\r\n // The two in-plane rotations compose into one angle — see the note above.\r\n const cz = (rotation + p.rotationZ) * rad;\r\n const cc = Math.cos(cz), sc = Math.sin(cz);\r\n\r\n // The two columns of Rx·Ry·Rz that a z = 0 point can reach, scaled.\r\n const A = cb * cc * scale;\r\n const C = -cb * sc * scale;\r\n const B = (sa * sb * cc + ca * sc) * scale;\r\n const D = (ca * cc - sa * sb * sc) * scale;\r\n // The row that would have been the projected z, had we kept one.\r\n const G = (sa * sc - ca * sb * cc) * scale;\r\n const H = (ca * sb * sc + sa * cc) * scale;\r\n\r\n // Perspective: a point at depth z lands at x/w with w = 1 - z/perspective.\r\n // No perspective means a parallel projection — z is simply dropped, w stays\r\n // 1, and the result is affine (which is also why `depth` alone does nothing).\r\n const invP = p.perspective !== 0 ? 1 / p.perspective : 0;\r\n const g = -G * invP;\r\n const h = -H * invP;\r\n // The z the pivot itself sits at: -(G·pivotX + H·pivotY) is what the shift to\r\n // pivot-relative coordinates leaves in the z row, and `depth` is the push\r\n // along it, applied after the tilt (so it moves the whole tilted plane).\r\n const i = 1 - (p.depth - (G * pivotX + H * pivotY)) * invP;\r\n\r\n // Numerators about the pivot, then the trailing translate folded in. A\r\n // translate composes onto a homography as `+ t·w`, hence the g/h/i terms.\r\n const tx = cx + pivotX;\r\n const ty = cy + pivotY;\r\n\r\n // The mirrors, applied **innermost and about the node's own centre** — a\r\n // final column negation, which is what `M · diag(fx, fy, 1)` comes to.\r\n //\r\n // Not about the pivot, unlike everything else here, and that is the whole\r\n // point: a flip is an in-place reflection. Composing it with the pivot the\r\n // way CSS's `scaleX(-1)` does means a node hinged anywhere but its middle\r\n // *swings* when you flip it — its position readout changes, its corner\r\n // handles land somewhere else, and the gesture stops meaning \"mirror this\"\r\n // and starts meaning \"mirror this and move it\". Every design tool flips\r\n // about the selection's own centre for that reason. Written as a column\r\n // scale rather than a `T(c)·F·T(-c)` sandwich because that is what one\r\n // reduces to here — the local frame is already centred on the node — which\r\n // leaves `e`/`f`/`i` untouched and makes \"a flip cannot move the node\" a\r\n // property of the arithmetic rather than a thing to remember.\r\n const fx = p.flipHorizontal ? -1 : 1;\r\n const fy = p.flipVertical ? -1 : 1;\r\n return {\r\n a: (A + tx * g) * fx,\r\n c: (C + tx * h) * fy,\r\n e: -(A * pivotX + C * pivotY) + tx * i,\r\n b: (B + ty * g) * fx,\r\n d: (D + ty * h) * fy,\r\n f: -(B * pivotX + D * pivotY) + ty * i,\r\n g: g * fx,\r\n h: h * fy,\r\n i,\r\n };\r\n}\r\n"]}
1
+ {"version":3,"file":"matrix2d.js","sourceRoot":"","sources":["../../../src/attributes/layout/matrix2d.ts"],"names":[],"mappings":"AAqCA,0FAA0F;AAC1F,MAAM,UAAU,YAAY,CAAC,CAAW;IACpC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,C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EAAE;QACT,CAAC;KACJ,CAAC;AACN,CAAC","sourcesContent":["import { Vector2 } from \"@/attributes/layout/vector2\";\r\n\r\n/**\r\n * A 2D transform stored as the members of a 3×3 matrix:\r\n *\r\n * ```\r\n * | a c e |\r\n * | b d f |\r\n * | g h i |\r\n * ```\r\n *\r\n * Point mapping is `x' = (a·x + c·y + e) / w`, `y' = (b·x + d·y + f) / w`, with\r\n * `w = g·x + h·y + i`. This is the same column-order convention the DOM\r\n * uses, so matrices compose in draw order: `parent.multiply(child)` is the world\r\n * transform of `child`.\r\n *\r\n * **The bottom row is optional, and leaving it off means `[0 0 1]`** — an\r\n * ordinary affine transform, where `w` is 1 everywhere and the divide falls\r\n * away. Every matrix in the engine was exactly that until\r\n * {@link nodeProjectedMatrix} arrived: a node tilted out of its own plane\r\n * projects through a *homography*, and a homography does not fit in six numbers.\r\n * Rather than a second matrix type — with a second `multiply`, `invert` and\r\n * `applyToPoint` beside it, which is precisely how a renderer and a hit test end\r\n * up disagreeing about where a node is — the row lives here, and everything that\r\n * has no use for it simply omits it.\r\n */\r\n/** @internal */\r\nexport interface Matrix2D {\r\n a: number; b: number; c: number; d: number; e: number; f: number;\r\n /** Perspective row, x term. Omitted on an affine transform (means `0`). */\r\n g?: number;\r\n /** Perspective row, y term. Omitted on an affine transform (means `0`). */\r\n h?: number;\r\n /** Perspective row, constant term. Omitted on an affine transform (means `1`). */\r\n i?: number;\r\n}\r\n\r\n/** @internal Whether `m` carries a perspective row — i.e. whether `w` is not always 1. */\r\nexport function isProjective(m: Matrix2D): boolean {\r\n return (m.g ?? 0) !== 0 || (m.h ?? 0) !== 0 || (m.i ?? 1) !== 1;\r\n}\r\n\r\n/**\r\n * Guard the perspective divide. A point on the vanishing line has `w = 0` and\r\n * projects to infinity, which is a real answer no coordinate can hold; clamping\r\n * to a tiny same-signed `w` sends it far off-screen instead, which is where it\r\n * belongs and is a number the caller can keep doing arithmetic with. Without\r\n * this, one degenerate corner turns an anchor set into `Infinity`/`NaN` and\r\n * takes the selection box, the hit test and any layout reading it with it.\r\n */\r\nconst MIN_W = 1e-6;\r\nfunction safeW(w: number): number {\r\n if (w > MIN_W || w < -MIN_W) return w;\r\n return w < 0 ? -MIN_W : MIN_W;\r\n}\r\n\r\n/** @internal The identity transform — maps every point to itself. */\r\nexport function identity(): Matrix2D {\r\n return { a: 1, b: 0, c: 0, d: 1, e: 0, f: 0 };\r\n}\r\n\r\n/** @internal Pure translation by (tx, ty). */\r\nexport function translation(tx: number, ty: number): Matrix2D {\r\n return { a: 1, b: 0, c: 0, d: 1, e: tx, f: ty };\r\n}\r\n\r\n/**\r\n * `m1 · m2` — the transform that applies `m2` first, then `m1`. Composing an\r\n * ancestor with a descendant (`ancestor.multiply(descendant)`) yields the\r\n * descendant's world transform.\r\n *\r\n * Two affine matrices take the six-member path they always did — that is every\r\n * composition in a scene with no 3D in it, once per node per parent per frame —\r\n * and the general 3×3 product runs only when one side actually carries a\r\n * perspective row.\r\n */\r\n/** @internal */\r\nexport function multiply(m1: Matrix2D, m2: Matrix2D): Matrix2D {\r\n if (isProjective(m1) || isProjective(m2)) return multiplyProjective(m1, m2);\r\n return {\r\n a: m1.a * m2.a + m1.c * m2.b,\r\n b: m1.b * m2.a + m1.d * m2.b,\r\n c: m1.a * m2.c + m1.c * m2.d,\r\n d: m1.b * m2.c + m1.d * m2.d,\r\n e: m1.a * m2.e + m1.c * m2.f + m1.e,\r\n f: m1.b * m2.e + m1.d * m2.f + m1.f,\r\n };\r\n}\r\n\r\n/** The full 3×3 product, rows `[a c e] [b d f] [g h i]`. See {@link multiply}. */\r\nfunction multiplyProjective(m1: Matrix2D, m2: Matrix2D): Matrix2D {\r\n const g1 = m1.g ?? 0, h1 = m1.h ?? 0, i1 = m1.i ?? 1;\r\n const g2 = m2.g ?? 0, h2 = m2.h ?? 0, i2 = m2.i ?? 1;\r\n return {\r\n a: m1.a * m2.a + m1.c * m2.b + m1.e * g2,\r\n c: m1.a * m2.c + m1.c * m2.d + m1.e * h2,\r\n e: m1.a * m2.e + m1.c * m2.f + m1.e * i2,\r\n b: m1.b * m2.a + m1.d * m2.b + m1.f * g2,\r\n d: m1.b * m2.c + m1.d * m2.d + m1.f * h2,\r\n f: m1.b * m2.e + m1.d * m2.f + m1.f * i2,\r\n g: g1 * m2.a + h1 * m2.b + i1 * g2,\r\n h: g1 * m2.c + h1 * m2.d + i1 * h2,\r\n i: g1 * m2.e + h1 * m2.f + i1 * i2,\r\n };\r\n}\r\n\r\n/** @internal Map a point through the transform. */\r\nexport function applyToPoint(m: Matrix2D, p: Vector2): Vector2 {\r\n const x = m.a * p.x + m.c * p.y + m.e;\r\n const y = m.b * p.x + m.d * p.y + m.f;\r\n if (!isProjective(m)) return { x, y };\r\n const w = safeW((m.g ?? 0) * p.x + (m.h ?? 0) * p.y + (m.i ?? 1));\r\n return { x: x / w, y: y / w };\r\n}\r\n\r\n/**\r\n * The inverse transform, or `null` when `m` is singular (a zero scale collapses\r\n * the plane, so no inverse exists). Used to map a viewport-space point back into\r\n * a node's local space for hit testing.\r\n */\r\n/** @internal */\r\nexport function invert(m: Matrix2D): Matrix2D | null {\r\n if (isProjective(m)) return invertProjective(m);\r\n const det = m.a * m.d - m.b * m.c;\r\n if (det === 0 || !Number.isFinite(det)) return null;\r\n const inv = 1 / det;\r\n return {\r\n a: m.d * inv,\r\n b: -m.b * inv,\r\n c: -m.c * inv,\r\n d: m.a * inv,\r\n e: (m.c * m.f - m.d * m.e) * inv,\r\n f: (m.b * m.e - m.a * m.f) * inv,\r\n };\r\n}\r\n\r\n/**\r\n * The inverse of a homography — the adjugate over the determinant, written out\r\n * in this module's row naming. A projective inverse is still a homography, which\r\n * is what lets picking keep mapping a viewport point back into a node's local\r\n * space with nothing but {@link applyToPoint} once the node is tilted.\r\n */\r\nfunction invertProjective(m: Matrix2D): Matrix2D | null {\r\n const { a, b, c, d, e, f } = m;\r\n const g = m.g ?? 0, h = m.h ?? 0, i = m.i ?? 1;\r\n // Cofactors of the 3×3 | a c e | / | b d f | / | g h i |.\r\n const A = d * i - f * h;\r\n const C = f * g - b * i;\r\n const E = b * h - d * g;\r\n const det = a * A + c * C + e * E;\r\n if (det === 0 || !Number.isFinite(det)) return null;\r\n const inv = 1 / det;\r\n return {\r\n a: A * inv,\r\n c: (e * h - c * i) * inv,\r\n e: (c * f - e * d) * inv,\r\n b: C * inv,\r\n d: (a * i - e * g) * inv,\r\n f: (e * b - a * f) * inv,\r\n g: E * inv,\r\n h: (c * g - a * h) * inv,\r\n i: (a * d - c * b) * inv,\r\n };\r\n}\r\n\r\n/**\r\n * The viewport transform a camera scope pushes, in canvas (y-down) space — a\r\n * literal transcription of `RenderContext2D.beginCamera`:\r\n *\r\n * translate(vx, vy) · rotate(-heading) · scale(zoom) · translate(-lookAt.x, +lookAt.y)\r\n *\r\n * `lookAt` is a y-up world point, hence the sign flip on its y. `vx`/`vy` are the\r\n * viewport centre the camera's callers pass (`layoutBounds.x`, `-layoutBounds.y`).\r\n * Kept next to {@link nodeLocalMatrix} so the two stay in step with the renderer.\r\n */\r\n/** @internal */\r\nexport function cameraMatrix(\r\n vx: number, vy: number, lookAt: Vector2, zoom: number, heading: number,\r\n): Matrix2D {\r\n const rad = (-heading * Math.PI) / 180;\r\n const cos = Math.cos(rad);\r\n const sin = Math.sin(rad);\r\n // rotate(-heading) · scale(zoom), the same clockwise canvas convention as\r\n // nodeLocalMatrix's R·S block.\r\n const a = zoom * cos;\r\n const b = zoom * sin;\r\n const c = zoom * -sin;\r\n const d = zoom * cos;\r\n // Fold the trailing translate(-lookAt.x, +lookAt.y) into e/f.\r\n const tx = -lookAt.x;\r\n const ty = lookAt.y;\r\n return { a, b, c, d, e: vx + a * tx + c * ty, f: vy + b * tx + d * ty };\r\n}\r\n\r\n/**\r\n * Build the local transform for a node, matching the renderer's\r\n * `RenderContext2D.transform` exactly (canvas y-down space):\r\n * `T(cx + pivotX, cy + pivotY) · R(deg) · S(scale) · T(-pivotX, -pivotY)`.\r\n *\r\n * @param cx Canvas-space x of the node's layout-cell lookAt.\r\n * @param cy Canvas-space y of the node's layout-cell origin (y-down).\r\n * @param rotation Rotation in degrees, clockwise (canvas convention).\r\n * @param scale Uniform scale factor.\r\n * @param pivotX Pivot offset in pixels, x.\r\n * @param pivotY Pivot offset in pixels, y (canvas y-down).\r\n */\r\n/** @internal */\r\nexport function nodeLocalMatrix(\r\n cx: number, cy: number, rotation: number, scale: number, pivotX: number, pivotY: number,\r\n): Matrix2D {\r\n const rad = (rotation * Math.PI) / 180;\r\n const cos = Math.cos(rad);\r\n const sin = Math.sin(rad);\r\n // R(deg) · S(scale): clockwise rotation in canvas (y-down) is\r\n // | cos -sin | · | s 0 | = | s·cos -s·sin |\r\n // | sin cos | | 0 s | | s·sin s·cos |\r\n const a = scale * cos;\r\n const b = scale * sin;\r\n const c = scale * -sin;\r\n const d = scale * cos;\r\n // Fold the pivot translations into e/f:\r\n // T(cx+pivotX, cy+pivotY) · (RS) · T(-pivotX, -pivotY)\r\n return {\r\n a, b, c, d,\r\n e: cx + pivotX - (a * pivotX + c * pivotY),\r\n f: cy + pivotY - (b * pivotX + d * pivotY),\r\n };\r\n}\r\n\r\n/**\r\n * The out-of-plane half of a node's transform — the mirrors, the two extra\r\n * rotation axes, the push along z and the perspective divide that makes them\r\n * read as depth rather than as squashing. See {@link nodeProjectedMatrix}.\r\n */\r\n/** @internal */\r\nexport interface Projection3D {\r\n /** Tilt about the horizontal axis, degrees. Positive tips the top away. */\r\n rotationX: number;\r\n /** Tilt about the vertical axis, degrees. Positive swings the right edge away. */\r\n rotationY: number;\r\n /**\r\n * In-plane rotation belonging to the 3D block, degrees clockwise — the Z axis\r\n * of `Rx · Ry · Rz`.\r\n *\r\n * A prop of its own rather than a second name for the node's `rotation`, and\r\n * that is a deliberate separation: `rotation` is the node's **shape** — it\r\n * turns the box, the selection outline turns with it, and handles follow —\r\n * while this is part of the projection, which is paint. The two compose (a\r\n * Z rotation is a Z rotation, so they add), but they are two independent\r\n * numbers and editing one never moves the other.\r\n */\r\n rotationZ: number;\r\n /** Push along the view axis in px, applied after the rotations. Inert without `perspective`. */\r\n depth: number;\r\n /** Viewer distance in px. `0` is no perspective at all — a parallel projection. */\r\n perspective: number;\r\n /** Mirror across the node's vertical centre line. */\r\n flipHorizontal: boolean;\r\n /** Mirror across the node's horizontal centre line. */\r\n flipVertical: boolean;\r\n}\r\n\r\n/** @internal Every field of a {@link Projection3D} at rest — the plain 2D node. */\r\nexport const NO_PROJECTION_3D: Projection3D = {\r\n rotationX: 0,\r\n rotationY: 0,\r\n rotationZ: 0,\r\n depth: 0,\r\n perspective: 0,\r\n flipHorizontal: false,\r\n flipVertical: false,\r\n};\r\n\r\n/**\r\n * Whether `p` asks for anything {@link nodeLocalMatrix} cannot already express.\r\n * The gate in front of every projective path in the engine: a scene with no 3D\r\n * in it keeps the six-number matrix, the decomposed `translate/rotate/scale`\r\n * render path, and the affine `multiply` it always had.\r\n */\r\n/** @internal */\r\nexport function hasProjection3D(p: Projection3D): boolean {\r\n return (\r\n p.rotationX !== 0 ||\r\n p.rotationY !== 0 ||\r\n p.rotationZ !== 0 ||\r\n p.flipHorizontal ||\r\n p.flipVertical ||\r\n (p.perspective !== 0 && p.depth !== 0)\r\n );\r\n}\r\n\r\n/**\r\n * Whether a plane carrying this projection has turned its back on the viewer —\r\n * the test behind `backfaceVisible`.\r\n *\r\n * Read off the tilt alone. The plane's normal starts at `(0,0,1)` and comes out\r\n * of `Rx·Ry` with a z of `cos(rotationX)·cos(rotationY)`; the in-plane rotation\r\n * can't change which way it points, and neither, deliberately, can a *mirror*.\r\n * CSS derives the answer from the whole accumulated matrix, where a `scaleX(-1)`\r\n * inverts orientation and hides the element — which is a surprising way to lose\r\n * a node you only meant to flip. Here a flip is a flip and a turn is a turn.\r\n */\r\n/** @internal */\r\nexport function facesAway(rotationX: number, rotationY: number): boolean {\r\n const rad = Math.PI / 180;\r\n return Math.cos(rotationX * rad) * Math.cos(rotationY * rad) < 0;\r\n}\r\n\r\n/**\r\n * A node's local transform with the out-of-plane half folded in — the same space\r\n * and the same pivot convention as {@link nodeLocalMatrix}, which this reduces to\r\n * exactly when {@link hasProjection3D} is false.\r\n *\r\n * The composition, innermost first:\r\n *\r\n * `T(pivot) · P(perspective) · Tz(depth) · Rx · Ry · Rz(rotationZ + rotation) · S(scale) · T(-pivot) · F(flip)`\r\n *\r\n * — everything about the pivot except the mirrors, which reflect about the\r\n * node's own centre so that flipping cannot move the node (see `F` below),\r\n *\r\n * which is CSS's own order for `rotateX(a) rotateY(b) rotateZ(c)` — the in-plane\r\n * rotation innermost, so that adding a tilt never changes what the node's own\r\n * `rotation` already meant.\r\n *\r\n * The Z angle is the **sum** of the two in-plane rotations the node carries, and\r\n * they stay two: `rotation` turns the node's *shape* — its box turns with it, and\r\n * so does anything reading that box — while {@link Projection3D.rotationZ} is\r\n * part of the projection, which is paint (see `Node2D._localMatrix`). Summing them\r\n * is not a coupling but the definition of composing two rotations about one axis;\r\n * neither number moves when the other is edited.\r\n *\r\n * The content is planar — every point enters with `z = 0` — so the whole thing\r\n * collapses to a 3×3 homography over `(x, y, 1)` rather than needing a 4×4 and a\r\n * separate divide step. The projected z survives only as the perspective row.\r\n *\r\n * @param cx Canvas-space x of the node's positioned centre.\r\n * @param cy Canvas-space y of the node's positioned centre (y-down).\r\n * @param rotation In-plane rotation in degrees, clockwise (the Z axis).\r\n * @param scale Uniform scale factor.\r\n * @param pivotX Pivot offset from the centre in px, x.\r\n * @param pivotY Pivot offset from the centre in px, y (canvas y-down).\r\n * @param p The out-of-plane fields.\r\n */\r\n/** @internal */\r\nexport function nodeProjectedMatrix(\r\n cx: number, cy: number, rotation: number, scale: number, pivotX: number, pivotY: number,\r\n p: Projection3D,\r\n): Matrix2D {\r\n if (!hasProjection3D(p)) {\r\n return nodeLocalMatrix(cx, cy, rotation, scale, pivotX, pivotY);\r\n }\r\n const rad = Math.PI / 180;\r\n const ca = Math.cos(p.rotationX * rad), sa = Math.sin(p.rotationX * rad);\r\n const cb = Math.cos(p.rotationY * rad), sb = Math.sin(p.rotationY * rad);\r\n // The two in-plane rotations compose into one angle — see the note above.\r\n const cz = (rotation + p.rotationZ) * rad;\r\n const cc = Math.cos(cz), sc = Math.sin(cz);\r\n\r\n // The two columns of Rx·Ry·Rz that a z = 0 point can reach, scaled.\r\n const A = cb * cc * scale;\r\n const C = -cb * sc * scale;\r\n const B = (sa * sb * cc + ca * sc) * scale;\r\n const D = (ca * cc - sa * sb * sc) * scale;\r\n // The row that would have been the projected z, had we kept one.\r\n const G = (sa * sc - ca * sb * cc) * scale;\r\n const H = (ca * sb * sc + sa * cc) * scale;\r\n\r\n // Perspective: a point at depth z lands at x/w with w = 1 - z/perspective.\r\n // No perspective means a parallel projection — z is simply dropped, w stays\r\n // 1, and the result is affine (which is also why `depth` alone does nothing).\r\n const invP = p.perspective !== 0 ? 1 / p.perspective : 0;\r\n const g = -G * invP;\r\n const h = -H * invP;\r\n // The z the pivot itself sits at: -(G·pivotX + H·pivotY) is what the shift to\r\n // pivot-relative coordinates leaves in the z row, and `depth` is the push\r\n // along it, applied after the tilt (so it moves the whole tilted plane).\r\n const i = 1 - (p.depth - (G * pivotX + H * pivotY)) * invP;\r\n\r\n // Numerators about the pivot, then the trailing translate folded in. A\r\n // translate composes onto a homography as `+ t·w`, hence the g/h/i terms.\r\n const tx = cx + pivotX;\r\n const ty = cy + pivotY;\r\n\r\n // The mirrors, applied **innermost and about the node's own centre** — a\r\n // final column negation, which is what `M · diag(fx, fy, 1)` comes to.\r\n //\r\n // Not about the pivot, unlike everything else here, and that is the whole\r\n // point: a flip is an in-place reflection. Composing it with the pivot the\r\n // way CSS's `scaleX(-1)` does means a node hinged anywhere but its middle\r\n // *swings* when you flip it — its position readout changes, its corner\r\n // handles land somewhere else, and the gesture stops meaning \"mirror this\"\r\n // and starts meaning \"mirror this and move it\". Every design tool flips\r\n // about the selection's own centre for that reason. Written as a column\r\n // scale rather than a `T(c)·F·T(-c)` sandwich because that is what one\r\n // reduces to here — the local frame is already centred on the node — which\r\n // leaves `e`/`f`/`i` untouched and makes \"a flip cannot move the node\" a\r\n // property of the arithmetic rather than a thing to remember.\r\n const fx = p.flipHorizontal ? -1 : 1;\r\n const fy = p.flipVertical ? -1 : 1;\r\n return {\r\n a: (A + tx * g) * fx,\r\n c: (C + tx * h) * fy,\r\n e: -(A * pivotX + C * pivotY) + tx * i,\r\n b: (B + ty * g) * fx,\r\n d: (D + ty * h) * fy,\r\n f: -(B * pivotX + D * pivotY) + ty * i,\r\n g: g * fx,\r\n h: h * fy,\r\n i,\r\n };\r\n}\r\n"]}
@@ -28,7 +28,7 @@ export type SizeType = "fill" | "hug";
28
28
  /** @internal */
29
29
  export type SizeInput = SizeType | number;
30
30
  /**
31
- * The dimension-keyword `SizeInput` attribute's op set — used by `@sizeProperty`.
31
+ * The dimension-keyword `SizeInput` attribute's op set — `width`/`height`'s.
32
32
  * `lerp` interpolates two numbers; a keyword on either end hard-switches at t=1.
33
33
  * `resolveLayout` turns a `SizeInput` into a concrete number for layout, given
34
34
  * the space available and the size contents would need; `isAuto` reports