@motionscript/core 0.1.0-alpha.7 → 0.1.0-alpha.9

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 (1133) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/LICENSE +201 -201
  3. package/NOTICE +49 -48
  4. package/README.md +91 -91
  5. package/dist/assets/asset-index.js.map +1 -1
  6. package/dist/assets/catalog.js.map +1 -1
  7. package/dist/assets/errors.js.map +1 -1
  8. package/dist/assets/index.js.map +1 -1
  9. package/dist/assets/manager.d.ts.map +1 -1
  10. package/dist/assets/manager.js +7 -5
  11. package/dist/assets/manager.js.map +1 -1
  12. package/dist/assets/manifest.js.map +1 -1
  13. package/dist/assets/record.js.map +1 -1
  14. package/dist/assets/scope.js.map +1 -1
  15. package/dist/attributes/audio/effects/chain.d.ts +73 -0
  16. package/dist/attributes/audio/effects/chain.d.ts.map +1 -0
  17. package/dist/attributes/audio/effects/chain.js +67 -0
  18. package/dist/attributes/audio/effects/chain.js.map +1 -0
  19. package/dist/attributes/audio/effects/implementations/echo.d.ts +14 -0
  20. package/dist/attributes/audio/effects/implementations/echo.d.ts.map +1 -0
  21. package/dist/attributes/audio/{filters → effects}/implementations/echo.js +2 -2
  22. package/dist/attributes/audio/effects/implementations/echo.js.map +1 -0
  23. package/dist/attributes/audio/effects/implementations/gain.d.ts +10 -0
  24. package/dist/attributes/audio/effects/implementations/gain.d.ts.map +1 -0
  25. package/dist/attributes/audio/{filters → effects}/implementations/gain.js +2 -2
  26. package/dist/attributes/audio/effects/implementations/gain.js.map +1 -0
  27. package/dist/attributes/audio/effects/implementations/highpass.d.ts +12 -0
  28. package/dist/attributes/audio/effects/implementations/highpass.d.ts.map +1 -0
  29. package/dist/attributes/audio/{filters → effects}/implementations/highpass.js +2 -2
  30. package/dist/attributes/audio/effects/implementations/highpass.js.map +1 -0
  31. package/dist/attributes/audio/effects/implementations/lowpass.d.ts +12 -0
  32. package/dist/attributes/audio/effects/implementations/lowpass.d.ts.map +1 -0
  33. package/dist/attributes/audio/{filters → effects}/implementations/lowpass.js +2 -2
  34. package/dist/attributes/audio/effects/implementations/lowpass.js.map +1 -0
  35. package/dist/attributes/audio/effects/implementations/tremolo.d.ts +12 -0
  36. package/dist/attributes/audio/effects/implementations/tremolo.d.ts.map +1 -0
  37. package/dist/attributes/audio/{filters → effects}/implementations/tremolo.js +2 -2
  38. package/dist/attributes/audio/effects/implementations/tremolo.js.map +1 -0
  39. package/dist/attributes/audio/effects/index.d.ts +12 -0
  40. package/dist/attributes/audio/effects/index.d.ts.map +1 -0
  41. package/dist/attributes/audio/effects/index.js +4 -0
  42. package/dist/attributes/audio/effects/index.js.map +1 -0
  43. package/dist/attributes/audio/effects/registry.d.ts +36 -0
  44. package/dist/attributes/audio/effects/registry.d.ts.map +1 -0
  45. package/dist/attributes/audio/effects/registry.js +80 -0
  46. package/dist/attributes/audio/effects/registry.js.map +1 -0
  47. package/dist/attributes/audio/effects/union.d.ts +14 -0
  48. package/dist/attributes/audio/effects/union.d.ts.map +1 -0
  49. package/dist/attributes/audio/effects/union.js +24 -0
  50. package/dist/attributes/audio/effects/union.js.map +1 -0
  51. package/dist/attributes/audio/ramp.d.ts +103 -0
  52. package/dist/attributes/audio/ramp.d.ts.map +1 -0
  53. package/dist/attributes/audio/ramp.js +246 -0
  54. package/dist/attributes/audio/ramp.js.map +1 -0
  55. package/dist/attributes/audio/request.d.ts +24 -13
  56. package/dist/attributes/audio/request.d.ts.map +1 -1
  57. package/dist/attributes/audio/request.js +4 -3
  58. package/dist/attributes/audio/request.js.map +1 -1
  59. package/dist/attributes/audio/schedule.d.ts +21 -13
  60. package/dist/attributes/audio/schedule.d.ts.map +1 -1
  61. package/dist/attributes/audio/schedule.js +42 -28
  62. package/dist/attributes/audio/schedule.js.map +1 -1
  63. package/dist/attributes/audio/sound.d.ts +15 -12
  64. package/dist/attributes/audio/sound.d.ts.map +1 -1
  65. package/dist/attributes/audio/sound.js +8 -10
  66. package/dist/attributes/audio/sound.js.map +1 -1
  67. package/dist/attributes/audio/transition.d.ts +33 -0
  68. package/dist/attributes/audio/transition.d.ts.map +1 -0
  69. package/dist/attributes/audio/transition.js +48 -0
  70. package/dist/attributes/audio/transition.js.map +1 -0
  71. package/dist/attributes/index.d.ts +4 -3
  72. package/dist/attributes/index.d.ts.map +1 -1
  73. package/dist/attributes/index.js +4 -7
  74. package/dist/attributes/index.js.map +1 -1
  75. package/dist/attributes/layout/alignment.js.map +1 -1
  76. package/dist/attributes/layout/index.js.map +1 -1
  77. package/dist/attributes/layout/insets.js.map +1 -1
  78. package/dist/attributes/layout/matrix2d.d.ts +2 -2
  79. package/dist/attributes/layout/matrix2d.js.map +1 -1
  80. package/dist/attributes/layout/size.js.map +1 -1
  81. package/dist/attributes/layout/space3d.js +1 -1
  82. package/dist/attributes/layout/space3d.js.map +1 -1
  83. package/dist/attributes/layout/transform3d.js.map +1 -1
  84. package/dist/attributes/layout/vector2.js.map +1 -1
  85. package/dist/attributes/layout/world-transform.js.map +1 -1
  86. package/dist/attributes/mask/boolean.js.map +1 -1
  87. package/dist/attributes/mask/mask.js.map +1 -1
  88. package/dist/attributes/properties/decorator.js.map +1 -1
  89. package/dist/attributes/properties/inputs.js.map +1 -1
  90. package/dist/attributes/properties/typed.d.ts +7 -7
  91. package/dist/attributes/properties/typed.d.ts.map +1 -1
  92. package/dist/attributes/properties/typed.js +6 -6
  93. package/dist/attributes/properties/typed.js.map +1 -1
  94. package/dist/attributes/render3d/orbit.js.map +1 -1
  95. package/dist/attributes/shape/corners/corner-radius.d.ts +1 -2
  96. package/dist/attributes/shape/corners/corner-radius.d.ts.map +1 -1
  97. package/dist/attributes/shape/corners/corner-radius.js +1 -2
  98. package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
  99. package/dist/attributes/shape/corners/corner-style.js.map +1 -1
  100. package/dist/attributes/shape/corners/corners.js.map +1 -1
  101. package/dist/attributes/shape/corners/index.js.map +1 -1
  102. package/dist/attributes/shape/effects/backdrop.js.map +1 -1
  103. package/dist/attributes/shape/effects/chain.d.ts +96 -409
  104. package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
  105. package/dist/attributes/shape/effects/chain.js +93 -283
  106. package/dist/attributes/shape/effects/chain.js.map +1 -1
  107. package/dist/attributes/shape/effects/effect-data.d.ts +1 -1
  108. package/dist/attributes/shape/effects/effect-data.js.map +1 -1
  109. package/dist/attributes/shape/effects/implementations/ascii.d.ts +45 -13
  110. package/dist/attributes/shape/effects/implementations/ascii.d.ts.map +1 -1
  111. package/dist/attributes/shape/effects/implementations/ascii.js +29 -23
  112. package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
  113. package/dist/attributes/shape/effects/implementations/bit-crush.d.ts +32 -7
  114. package/dist/attributes/shape/effects/implementations/bit-crush.d.ts.map +1 -1
  115. package/dist/attributes/shape/effects/implementations/bit-crush.js +17 -15
  116. package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
  117. package/dist/attributes/shape/effects/implementations/block-displace.d.ts +46 -10
  118. package/dist/attributes/shape/effects/implementations/block-displace.d.ts.map +1 -1
  119. package/dist/attributes/shape/effects/implementations/block-displace.js +21 -19
  120. package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
  121. package/dist/attributes/shape/effects/implementations/bloom.d.ts +32 -7
  122. package/dist/attributes/shape/effects/implementations/bloom.d.ts.map +1 -1
  123. package/dist/attributes/shape/effects/implementations/bloom.js +17 -11
  124. package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
  125. package/dist/attributes/shape/effects/implementations/blur.d.ts +16 -3
  126. package/dist/attributes/shape/effects/implementations/blur.d.ts.map +1 -1
  127. package/dist/attributes/shape/effects/implementations/blur.js +13 -5
  128. package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
  129. package/dist/attributes/shape/effects/implementations/bulge.d.ts +28 -9
  130. package/dist/attributes/shape/effects/implementations/bulge.d.ts.map +1 -1
  131. package/dist/attributes/shape/effects/implementations/bulge.js +15 -14
  132. package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
  133. package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts +21 -5
  134. package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts.map +1 -1
  135. package/dist/attributes/shape/effects/implementations/chromatic-aberration.js +15 -10
  136. package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
  137. package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +96 -26
  138. package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts.map +1 -1
  139. package/dist/attributes/shape/effects/implementations/color-adjustment.js +29 -26
  140. package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
  141. package/dist/attributes/shape/effects/implementations/curves.d.ts +20 -6
  142. package/dist/attributes/shape/effects/implementations/curves.d.ts.map +1 -1
  143. package/dist/attributes/shape/effects/implementations/curves.js +26 -23
  144. package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
  145. package/dist/attributes/shape/effects/implementations/directional-blur.d.ts +26 -5
  146. package/dist/attributes/shape/effects/implementations/directional-blur.d.ts.map +1 -1
  147. package/dist/attributes/shape/effects/implementations/directional-blur.js +15 -10
  148. package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
  149. package/dist/attributes/shape/effects/implementations/dither.d.ts +58 -11
  150. package/dist/attributes/shape/effects/implementations/dither.d.ts.map +1 -1
  151. package/dist/attributes/shape/effects/implementations/dither.js +26 -20
  152. package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
  153. package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts +46 -14
  154. package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts.map +1 -1
  155. package/dist/attributes/shape/effects/implementations/drop-shadow.js +24 -29
  156. package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
  157. package/dist/attributes/shape/effects/implementations/duotone.d.ts +26 -7
  158. package/dist/attributes/shape/effects/implementations/duotone.d.ts.map +1 -1
  159. package/dist/attributes/shape/effects/implementations/duotone.js +17 -16
  160. package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
  161. package/dist/attributes/shape/effects/implementations/edges.d.ts +29 -7
  162. package/dist/attributes/shape/effects/implementations/edges.d.ts.map +1 -1
  163. package/dist/attributes/shape/effects/implementations/edges.js +17 -14
  164. package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
  165. package/dist/attributes/shape/effects/implementations/glass.d.ts +76 -19
  166. package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
  167. package/dist/attributes/shape/effects/implementations/glass.js +28 -22
  168. package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
  169. package/dist/attributes/shape/effects/implementations/glow.d.ts +149 -42
  170. package/dist/attributes/shape/effects/implementations/glow.d.ts.map +1 -1
  171. package/dist/attributes/shape/effects/implementations/glow.js +74 -72
  172. package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
  173. package/dist/attributes/shape/effects/implementations/grain.d.ts +43 -11
  174. package/dist/attributes/shape/effects/implementations/grain.d.ts.map +1 -1
  175. package/dist/attributes/shape/effects/implementations/grain.js +21 -18
  176. package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
  177. package/dist/attributes/shape/effects/implementations/grayscale.d.ts +17 -3
  178. package/dist/attributes/shape/effects/implementations/grayscale.d.ts.map +1 -1
  179. package/dist/attributes/shape/effects/implementations/grayscale.js +13 -5
  180. package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
  181. package/dist/attributes/shape/effects/implementations/halftone.d.ts +40 -9
  182. package/dist/attributes/shape/effects/implementations/halftone.d.ts.map +1 -1
  183. package/dist/attributes/shape/effects/implementations/halftone.js +20 -16
  184. package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
  185. package/dist/attributes/shape/effects/implementations/invert.d.ts +23 -5
  186. package/dist/attributes/shape/effects/implementations/invert.d.ts.map +1 -1
  187. package/dist/attributes/shape/effects/implementations/invert.js +15 -10
  188. package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
  189. package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts +57 -18
  190. package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts.map +1 -1
  191. package/dist/attributes/shape/effects/implementations/kaleidoscope.js +25 -22
  192. package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
  193. package/dist/attributes/shape/effects/implementations/lut.d.ts +34 -7
  194. package/dist/attributes/shape/effects/implementations/lut.d.ts.map +1 -1
  195. package/dist/attributes/shape/effects/implementations/lut.js +20 -16
  196. package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
  197. package/dist/attributes/shape/effects/implementations/magnify.d.ts +27 -9
  198. package/dist/attributes/shape/effects/implementations/magnify.d.ts.map +1 -1
  199. package/dist/attributes/shape/effects/implementations/magnify.js +17 -14
  200. package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
  201. package/dist/attributes/shape/effects/implementations/motion-blur.d.ts +54 -19
  202. package/dist/attributes/shape/effects/implementations/motion-blur.d.ts.map +1 -1
  203. package/dist/attributes/shape/effects/implementations/motion-blur.js +42 -20
  204. package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
  205. package/dist/attributes/shape/effects/implementations/oil-paint.d.ts +17 -3
  206. package/dist/attributes/shape/effects/implementations/oil-paint.d.ts.map +1 -1
  207. package/dist/attributes/shape/effects/implementations/oil-paint.js +13 -9
  208. package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
  209. package/dist/attributes/shape/effects/implementations/outline.d.ts +28 -8
  210. package/dist/attributes/shape/effects/implementations/outline.d.ts.map +1 -1
  211. package/dist/attributes/shape/effects/implementations/outline.js +18 -17
  212. package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
  213. package/dist/attributes/shape/effects/implementations/pixelate.d.ts +25 -6
  214. package/dist/attributes/shape/effects/implementations/pixelate.d.ts.map +1 -1
  215. package/dist/attributes/shape/effects/implementations/pixelate.js +16 -14
  216. package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
  217. package/dist/attributes/shape/effects/implementations/posterize.d.ts +14 -3
  218. package/dist/attributes/shape/effects/implementations/posterize.d.ts.map +1 -1
  219. package/dist/attributes/shape/effects/implementations/posterize.js +13 -9
  220. package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
  221. package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts +91 -26
  222. package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts.map +1 -1
  223. package/dist/attributes/shape/effects/implementations/progressive-blur.js +27 -28
  224. package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
  225. package/dist/attributes/shape/effects/implementations/radial-blur.d.ts +49 -10
  226. package/dist/attributes/shape/effects/implementations/radial-blur.d.ts.map +1 -1
  227. package/dist/attributes/shape/effects/implementations/radial-blur.js +19 -20
  228. package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
  229. package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts +36 -6
  230. package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts.map +1 -1
  231. package/dist/attributes/shape/effects/implementations/rgb-shift.js +16 -15
  232. package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
  233. package/dist/attributes/shape/effects/implementations/scanlines.d.ts +52 -11
  234. package/dist/attributes/shape/effects/implementations/scanlines.d.ts.map +1 -1
  235. package/dist/attributes/shape/effects/implementations/scanlines.js +21 -18
  236. package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
  237. package/dist/attributes/shape/effects/implementations/scatter.d.ts +23 -9
  238. package/dist/attributes/shape/effects/implementations/scatter.d.ts.map +1 -1
  239. package/dist/attributes/shape/effects/implementations/scatter.js +15 -12
  240. package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
  241. package/dist/attributes/shape/effects/implementations/shader.d.ts +90 -34
  242. package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
  243. package/dist/attributes/shape/effects/implementations/shader.js +42 -26
  244. package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
  245. package/dist/attributes/shape/effects/implementations/sharpen.d.ts +23 -5
  246. package/dist/attributes/shape/effects/implementations/sharpen.d.ts.map +1 -1
  247. package/dist/attributes/shape/effects/implementations/sharpen.js +16 -11
  248. package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
  249. package/dist/attributes/shape/effects/implementations/streak.d.ts +40 -9
  250. package/dist/attributes/shape/effects/implementations/streak.d.ts.map +1 -1
  251. package/dist/attributes/shape/effects/implementations/streak.js +19 -16
  252. package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
  253. package/dist/attributes/shape/effects/implementations/threshold.d.ts +24 -5
  254. package/dist/attributes/shape/effects/implementations/threshold.d.ts.map +1 -1
  255. package/dist/attributes/shape/effects/implementations/threshold.js +17 -11
  256. package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
  257. package/dist/attributes/shape/effects/implementations/twirl.d.ts +35 -8
  258. package/dist/attributes/shape/effects/implementations/twirl.d.ts.map +1 -1
  259. package/dist/attributes/shape/effects/implementations/twirl.js +17 -16
  260. package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
  261. package/dist/attributes/shape/effects/implementations/vignette.d.ts +37 -7
  262. package/dist/attributes/shape/effects/implementations/vignette.d.ts.map +1 -1
  263. package/dist/attributes/shape/effects/implementations/vignette.js +19 -18
  264. package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
  265. package/dist/attributes/shape/effects/implementations/vintage.d.ts +24 -5
  266. package/dist/attributes/shape/effects/implementations/vintage.d.ts.map +1 -1
  267. package/dist/attributes/shape/effects/implementations/vintage.js +15 -10
  268. package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
  269. package/dist/attributes/shape/effects/implementations/wave.d.ts +61 -14
  270. package/dist/attributes/shape/effects/implementations/wave.d.ts.map +1 -1
  271. package/dist/attributes/shape/effects/implementations/wave.js +26 -23
  272. package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
  273. package/dist/attributes/shape/effects/index.d.ts +4 -2
  274. package/dist/attributes/shape/effects/index.d.ts.map +1 -1
  275. package/dist/attributes/shape/effects/index.js +1 -1
  276. package/dist/attributes/shape/effects/index.js.map +1 -1
  277. package/dist/attributes/shape/effects/registry.d.ts +11 -0
  278. package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
  279. package/dist/attributes/shape/effects/registry.js +113 -102
  280. package/dist/attributes/shape/effects/registry.js.map +1 -1
  281. package/dist/attributes/shape/effects/spec.d.ts +229 -0
  282. package/dist/attributes/shape/effects/spec.d.ts.map +1 -0
  283. package/dist/attributes/shape/effects/spec.js +178 -0
  284. package/dist/attributes/shape/effects/spec.js.map +1 -0
  285. package/dist/attributes/shape/effects/union.js.map +1 -1
  286. package/dist/attributes/shape/fill/blend.js.map +1 -1
  287. package/dist/attributes/shape/fill/chain.d.ts +7 -9
  288. package/dist/attributes/shape/fill/chain.d.ts.map +1 -1
  289. package/dist/attributes/shape/fill/chain.js +9 -11
  290. package/dist/attributes/shape/fill/chain.js.map +1 -1
  291. package/dist/attributes/shape/fill/coerce.js.map +1 -1
  292. package/dist/attributes/shape/fill/color/constants.js.map +1 -1
  293. package/dist/attributes/shape/fill/color/parser.js.map +1 -1
  294. package/dist/attributes/shape/fill/gradient-stops.js.map +1 -1
  295. package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
  296. package/dist/attributes/shape/fill/implementations/color.js.map +1 -1
  297. package/dist/attributes/shape/fill/implementations/conic-gradient.js.map +1 -1
  298. package/dist/attributes/shape/fill/implementations/dot-grid.js.map +1 -1
  299. package/dist/attributes/shape/fill/implementations/fractal-noise.js.map +1 -1
  300. package/dist/attributes/shape/fill/implementations/grid.js.map +1 -1
  301. package/dist/attributes/shape/fill/implementations/image.js.map +1 -1
  302. package/dist/attributes/shape/fill/implementations/linear-gradient.js.map +1 -1
  303. package/dist/attributes/shape/fill/implementations/noise.js.map +1 -1
  304. package/dist/attributes/shape/fill/implementations/radial-gradient.js.map +1 -1
  305. package/dist/attributes/shape/fill/implementations/shader.d.ts +27 -26
  306. package/dist/attributes/shape/fill/implementations/shader.d.ts.map +1 -1
  307. package/dist/attributes/shape/fill/implementations/shader.js +20 -14
  308. package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
  309. package/dist/attributes/shape/fill/implementations/stripe.js.map +1 -1
  310. package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
  311. package/dist/attributes/shape/fill/index.d.ts +1 -1
  312. package/dist/attributes/shape/fill/index.d.ts.map +1 -1
  313. package/dist/attributes/shape/fill/index.js.map +1 -1
  314. package/dist/attributes/shape/fill/lerp.js.map +1 -1
  315. package/dist/attributes/shape/fill/media-preset.js.map +1 -1
  316. package/dist/attributes/shape/fill/registry.d.ts +1 -2
  317. package/dist/attributes/shape/fill/registry.d.ts.map +1 -1
  318. package/dist/attributes/shape/fill/registry.js +1 -2
  319. package/dist/attributes/shape/fill/registry.js.map +1 -1
  320. package/dist/attributes/shape/fill/union.js.map +1 -1
  321. package/dist/attributes/shape/filters/chain.d.ts +2 -6
  322. package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
  323. package/dist/attributes/shape/filters/chain.js +1 -5
  324. package/dist/attributes/shape/filters/chain.js.map +1 -1
  325. package/dist/attributes/shape/filters/implementations/alpha.js.map +1 -1
  326. package/dist/attributes/shape/filters/implementations/blur.js.map +1 -1
  327. package/dist/attributes/shape/filters/implementations/color-adjustment.js.map +1 -1
  328. package/dist/attributes/shape/filters/implementations/color-matrix.d.ts +2 -2
  329. package/dist/attributes/shape/filters/implementations/color-matrix.d.ts.map +1 -1
  330. package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
  331. package/dist/attributes/shape/filters/implementations/curves.js.map +1 -1
  332. package/dist/attributes/shape/filters/implementations/echo.js.map +1 -1
  333. package/dist/attributes/shape/filters/implementations/exposure.js.map +1 -1
  334. package/dist/attributes/shape/filters/implementations/grayscale.js.map +1 -1
  335. package/dist/attributes/shape/filters/implementations/posterize-time.js.map +1 -1
  336. package/dist/attributes/shape/filters/index.js.map +1 -1
  337. package/dist/attributes/shape/filters/registry.d.ts +1 -1
  338. package/dist/attributes/shape/filters/registry.d.ts.map +1 -1
  339. package/dist/attributes/shape/filters/registry.js +3 -3
  340. package/dist/attributes/shape/filters/registry.js.map +1 -1
  341. package/dist/attributes/shape/filters/union.d.ts +2 -3
  342. package/dist/attributes/shape/filters/union.d.ts.map +1 -1
  343. package/dist/attributes/shape/filters/union.js.map +1 -1
  344. package/dist/attributes/shape/path/anchors.js.map +1 -1
  345. package/dist/attributes/shape/path/bezier.js.map +1 -1
  346. package/dist/attributes/shape/path/index.js.map +1 -1
  347. package/dist/attributes/shape/path/measure.js.map +1 -1
  348. package/dist/attributes/shape/path/morph.js.map +1 -1
  349. package/dist/attributes/shape/path/ops.js.map +1 -1
  350. package/dist/attributes/shape/path/types.js.map +1 -1
  351. package/dist/attributes/shape/path/walk.js.map +1 -1
  352. package/dist/attributes/shape/shaders/index.d.ts +2 -0
  353. package/dist/attributes/shape/shaders/index.d.ts.map +1 -1
  354. package/dist/attributes/shape/shaders/index.js +2 -0
  355. package/dist/attributes/shape/shaders/index.js.map +1 -1
  356. package/dist/attributes/shape/shaders/language.d.ts +26 -0
  357. package/dist/attributes/shape/shaders/language.d.ts.map +1 -0
  358. package/dist/attributes/shape/shaders/language.js +20 -0
  359. package/dist/attributes/shape/shaders/language.js.map +1 -0
  360. package/dist/attributes/shape/shaders/pack.d.ts +25 -11
  361. package/dist/attributes/shape/shaders/pack.d.ts.map +1 -1
  362. package/dist/attributes/shape/shaders/pack.js +9 -4
  363. package/dist/attributes/shape/shaders/pack.js.map +1 -1
  364. package/dist/attributes/shape/shaders/resolve.d.ts +4 -5
  365. package/dist/attributes/shape/shaders/resolve.d.ts.map +1 -1
  366. package/dist/attributes/shape/shaders/resolve.js +3 -6
  367. package/dist/attributes/shape/shaders/resolve.js.map +1 -1
  368. package/dist/attributes/shape/shaders/uniforms.d.ts +41 -0
  369. package/dist/attributes/shape/shaders/uniforms.d.ts.map +1 -0
  370. package/dist/attributes/shape/shaders/uniforms.js +0 -0
  371. package/dist/attributes/shape/shaders/uniforms.js.map +1 -0
  372. package/dist/attributes/shape/shadow/index.js.map +1 -1
  373. package/dist/attributes/shape/shadow/shadow.js.map +1 -1
  374. package/dist/attributes/shape/stroke/index.js.map +1 -1
  375. package/dist/attributes/shape/stroke/stroke.js.map +1 -1
  376. package/dist/attributes/shared/operators.js.map +1 -1
  377. package/dist/attributes/text/index.js.map +1 -1
  378. package/dist/attributes/text/ops.js.map +1 -1
  379. package/dist/attributes/text/types.js.map +1 -1
  380. package/dist/browser/chunks/{chunk-LKUYVFU3.js → chunk-4BDLFEOC.js} +1 -1
  381. package/dist/browser/chunks/chunk-4BDLFEOC.js.map +7 -0
  382. package/dist/browser/chunks/chunk-7DB6BI27.js +6 -0
  383. package/dist/browser/chunks/chunk-7DB6BI27.js.map +7 -0
  384. package/dist/browser/chunks/chunk-IX53IFBD.js +13 -0
  385. package/dist/browser/chunks/chunk-IX53IFBD.js.map +7 -0
  386. package/dist/browser/chunks/{chunk-ZRPZPWZU.js → chunk-Q55UPA3E.js} +1 -1
  387. package/dist/browser/chunks/chunk-Q55UPA3E.js.map +7 -0
  388. package/dist/browser/component.js +1 -1
  389. package/dist/browser/experimental.js +1 -1
  390. package/dist/browser/experimental.js.map +4 -4
  391. package/dist/browser/index.js +1 -1
  392. package/dist/browser/index.js.map +2 -2
  393. package/dist/browser/manifest.json +1 -1
  394. package/dist/browser/sdk.js +1 -1
  395. package/dist/component.js.map +1 -1
  396. package/dist/components/builtins/audio/audio.d.ts +14 -5
  397. package/dist/components/builtins/audio/audio.d.ts.map +1 -1
  398. package/dist/components/builtins/audio/audio.js +10 -13
  399. package/dist/components/builtins/audio/audio.js.map +1 -1
  400. package/dist/components/builtins/geometry/composite.d.ts +3 -3
  401. package/dist/components/builtins/geometry/composite.js.map +1 -1
  402. package/dist/components/builtins/geometry/geometry.js.map +1 -1
  403. package/dist/components/builtins/geometry/shape-outline.js.map +1 -1
  404. package/dist/components/builtins/layout/layout.js.map +1 -1
  405. package/dist/components/builtins/media/media.d.ts +7 -7
  406. package/dist/components/builtins/media/media.d.ts.map +1 -1
  407. package/dist/components/builtins/media/media.js +4 -10
  408. package/dist/components/builtins/media/media.js.map +1 -1
  409. package/dist/components/builtins/providers/providers.js.map +1 -1
  410. package/dist/components/builtins/text/number-format.js.map +1 -1
  411. package/dist/components/builtins/text/number-pattern.js.map +1 -1
  412. package/dist/components/builtins/text/text-defaults.js.map +1 -1
  413. package/dist/components/builtins/text/text-layout.js.map +1 -1
  414. package/dist/components/builtins/text/text.d.ts +9 -9
  415. package/dist/components/builtins/text/text.d.ts.map +1 -1
  416. package/dist/components/builtins/text/text.js +3 -0
  417. package/dist/components/builtins/text/text.js.map +1 -1
  418. package/dist/components/builtins/three/canvas3d.js.map +1 -1
  419. package/dist/components/builtins/three/grid-geometry3d.js.map +1 -1
  420. package/dist/components/builtins/three/three.js.map +1 -1
  421. package/dist/components/factory/api.d.ts +38 -11
  422. package/dist/components/factory/api.d.ts.map +1 -1
  423. package/dist/components/factory/api.js.map +1 -1
  424. package/dist/components/factory/clip-of.js.map +1 -1
  425. package/dist/components/factory/commands-for.js.map +1 -1
  426. package/dist/components/factory/component-audio.js.map +1 -1
  427. package/dist/components/factory/component2d.js.map +1 -1
  428. package/dist/components/factory/component3d.d.ts.map +1 -1
  429. package/dist/components/factory/component3d.js +11 -3
  430. package/dist/components/factory/component3d.js.map +1 -1
  431. package/dist/components/factory/factory.d.ts +3 -0
  432. package/dist/components/factory/factory.d.ts.map +1 -1
  433. package/dist/components/factory/factory.js +39 -5
  434. package/dist/components/factory/factory.js.map +1 -1
  435. package/dist/components/factory/timeline.js.map +1 -1
  436. package/dist/components/factory/type-def.js.map +1 -1
  437. package/dist/components/factory/types.js.map +1 -1
  438. package/dist/components/factory/views.js.map +1 -1
  439. package/dist/components/modules/aim.js.map +1 -1
  440. package/dist/components/modules/corners.js.map +1 -1
  441. package/dist/components/modules/flow.js.map +1 -1
  442. package/dist/components/modules/material.js.map +1 -1
  443. package/dist/components/modules/paint.js.map +1 -1
  444. package/dist/components/modules/shapes.js.map +1 -1
  445. package/dist/components/modules/text-layout.js.map +1 -1
  446. package/dist/components/modules/text-style.js.map +1 -1
  447. package/dist/components/modules/three-entries.js.map +1 -1
  448. package/dist/components/modules/view3d.js.map +1 -1
  449. package/dist/components/trees/2d/group-bounds.js.map +1 -1
  450. package/dist/components/trees/2d/node-lifecycle.js.map +1 -1
  451. package/dist/components/trees/2d/node-motion.js.map +1 -1
  452. package/dist/components/trees/2d/node-render.d.ts +1 -1
  453. package/dist/components/trees/2d/node-render.js +1 -1
  454. package/dist/components/trees/2d/node-render.js.map +1 -1
  455. package/dist/components/trees/2d/node-space.js.map +1 -1
  456. package/dist/components/trees/2d/node-transform.js.map +1 -1
  457. package/dist/components/trees/2d/node2d.d.ts +1 -1
  458. package/dist/components/trees/2d/node2d.js +1 -1
  459. package/dist/components/trees/2d/node2d.js.map +1 -1
  460. package/dist/components/trees/audio/index.js.map +1 -1
  461. package/dist/components/trees/audio/node-audio.d.ts +16 -9
  462. package/dist/components/trees/audio/node-audio.d.ts.map +1 -1
  463. package/dist/components/trees/audio/node-audio.js +15 -11
  464. package/dist/components/trees/audio/node-audio.js.map +1 -1
  465. package/dist/components/trees/index.js.map +1 -1
  466. package/dist/components/trees/node/node-editor-state.js.map +1 -1
  467. package/dist/components/trees/node/node-reactive.js.map +1 -1
  468. package/dist/components/trees/node/node-time.js.map +1 -1
  469. package/dist/components/trees/node/node-walk.js.map +1 -1
  470. package/dist/components/trees/node/node.js.map +1 -1
  471. package/dist/components/trees/root/canvas2d-node.js.map +1 -1
  472. package/dist/components/trees/three/node3d.js.map +1 -1
  473. package/dist/document/audio.js.map +1 -1
  474. package/dist/document/builtins.js.map +1 -1
  475. package/dist/document/command-traits.d.ts +12 -2
  476. package/dist/document/command-traits.d.ts.map +1 -1
  477. package/dist/document/command-traits.js +34 -6
  478. package/dist/document/command-traits.js.map +1 -1
  479. package/dist/document/deny-globals.js.map +1 -1
  480. package/dist/document/diff.js.map +1 -1
  481. package/dist/document/doc-index.js.map +1 -1
  482. package/dist/document/expression/compile.js.map +1 -1
  483. package/dist/document/expression/index.js.map +1 -1
  484. package/dist/document/expression/ops.js.map +1 -1
  485. package/dist/document/expression/parse.js.map +1 -1
  486. package/dist/document/expression/refs.js.map +1 -1
  487. package/dist/document/expression/types.js.map +1 -1
  488. package/dist/document/expression/walk.js.map +1 -1
  489. package/dist/document/index.d.ts +8 -0
  490. package/dist/document/index.d.ts.map +1 -1
  491. package/dist/document/index.js +4 -0
  492. package/dist/document/index.js.map +1 -1
  493. package/dist/document/migrate.d.ts +70 -0
  494. package/dist/document/migrate.d.ts.map +1 -0
  495. package/dist/document/migrate.js +202 -0
  496. package/dist/document/migrate.js.map +1 -0
  497. package/dist/document/missing-node.d.ts +27 -0
  498. package/dist/document/missing-node.d.ts.map +1 -0
  499. package/dist/document/missing-node.js +48 -0
  500. package/dist/document/missing-node.js.map +1 -0
  501. package/dist/document/node-decorator.js.map +1 -1
  502. package/dist/document/node-descriptor.d.ts +4 -0
  503. package/dist/document/node-descriptor.d.ts.map +1 -1
  504. package/dist/document/node-descriptor.js.map +1 -1
  505. package/dist/document/placement.d.ts +2 -1
  506. package/dist/document/placement.d.ts.map +1 -1
  507. package/dist/document/placement.js.map +1 -1
  508. package/dist/document/project.d.ts +2 -0
  509. package/dist/document/project.d.ts.map +1 -1
  510. package/dist/document/project.js +1 -0
  511. package/dist/document/project.js.map +1 -1
  512. package/dist/document/prop-evolution.d.ts +51 -0
  513. package/dist/document/prop-evolution.d.ts.map +1 -0
  514. package/dist/document/prop-evolution.js +83 -0
  515. package/dist/document/prop-evolution.js.map +1 -0
  516. package/dist/document/registry.d.ts +16 -0
  517. package/dist/document/registry.d.ts.map +1 -1
  518. package/dist/document/registry.js +30 -4
  519. package/dist/document/registry.js.map +1 -1
  520. package/dist/document/settled-index.d.ts +2 -0
  521. package/dist/document/settled-index.d.ts.map +1 -1
  522. package/dist/document/settled-index.js +5 -5
  523. package/dist/document/settled-index.js.map +1 -1
  524. package/dist/document/timeline-patch.d.ts +4 -0
  525. package/dist/document/timeline-patch.d.ts.map +1 -1
  526. package/dist/document/timeline-patch.js +28 -3
  527. package/dist/document/timeline-patch.js.map +1 -1
  528. package/dist/document/timeline.d.ts +45 -1
  529. package/dist/document/timeline.d.ts.map +1 -1
  530. package/dist/document/timeline.js +172 -42
  531. package/dist/document/timeline.js.map +1 -1
  532. package/dist/document/types.d.ts +14 -28
  533. package/dist/document/types.d.ts.map +1 -1
  534. package/dist/document/types.js.map +1 -1
  535. package/dist/document/validate.d.ts +17 -5
  536. package/dist/document/validate.d.ts.map +1 -1
  537. package/dist/document/validate.js +158 -21
  538. package/dist/document/validate.js.map +1 -1
  539. package/dist/document/vocabulary.d.ts +28 -0
  540. package/dist/document/vocabulary.d.ts.map +1 -0
  541. package/dist/document/vocabulary.js +42 -0
  542. package/dist/document/vocabulary.js.map +1 -0
  543. package/dist/experimental.d.ts +68 -8
  544. package/dist/experimental.d.ts.map +1 -1
  545. package/dist/experimental.js +22 -8
  546. package/dist/experimental.js.map +1 -1
  547. package/dist/index.js.map +1 -1
  548. package/dist/layout/bounds.js.map +1 -1
  549. package/dist/layout/constraints.js.map +1 -1
  550. package/dist/layout/flex.js.map +1 -1
  551. package/dist/layout/freeform.js.map +1 -1
  552. package/dist/layout/grid.js.map +1 -1
  553. package/dist/layout/index.js.map +1 -1
  554. package/dist/layout/item.js.map +1 -1
  555. package/dist/layout/ops.js.map +1 -1
  556. package/dist/layout/types.js.map +1 -1
  557. package/dist/platform/audio-sink.js.map +1 -1
  558. package/dist/platform/exporter.d.ts +13 -0
  559. package/dist/platform/exporter.d.ts.map +1 -1
  560. package/dist/platform/exporter.js.map +1 -1
  561. package/dist/platform/index.js.map +1 -1
  562. package/dist/platform/stepped-clock.js.map +1 -1
  563. package/dist/platform/storage-adapter.js.map +1 -1
  564. package/dist/platform/ticker.js.map +1 -1
  565. package/dist/project/config.js.map +1 -1
  566. package/dist/project/index.js.map +1 -1
  567. package/dist/project/tree.js.map +1 -1
  568. package/dist/props/host.js.map +1 -1
  569. package/dist/props/index.js.map +1 -1
  570. package/dist/props/observer.js.map +1 -1
  571. package/dist/props/slot.js.map +1 -1
  572. package/dist/renamed-scene-names.d.ts +1 -1
  573. package/dist/renamed-scene-names.d.ts.map +1 -1
  574. package/dist/renamed-scene-names.js +1 -1
  575. package/dist/renamed-scene-names.js.map +1 -1
  576. package/dist/render/canvas-render-context2d.d.ts +9 -0
  577. package/dist/render/canvas-render-context2d.d.ts.map +1 -1
  578. package/dist/render/canvas-render-context2d.js +10 -0
  579. package/dist/render/canvas-render-context2d.js.map +1 -1
  580. package/dist/render/clip-contains.js +1 -1
  581. package/dist/render/clip-contains.js.map +1 -1
  582. package/dist/render/clip.js.map +1 -1
  583. package/dist/render/descriptors/ellipse.js.map +1 -1
  584. package/dist/render/descriptors/line.js.map +1 -1
  585. package/dist/render/descriptors/path-builder.js.map +1 -1
  586. package/dist/render/descriptors/path.js.map +1 -1
  587. package/dist/render/descriptors/polygon.js.map +1 -1
  588. package/dist/render/descriptors/polygram.js.map +1 -1
  589. package/dist/render/descriptors/rect.js.map +1 -1
  590. package/dist/render/descriptors/richtext.js.map +1 -1
  591. package/dist/render/descriptors/shape.js.map +1 -1
  592. package/dist/render/descriptors/text.d.ts +2 -2
  593. package/dist/render/descriptors/text.js +2 -2
  594. package/dist/render/descriptors/text.js.map +1 -1
  595. package/dist/render/descriptors/transform.js.map +1 -1
  596. package/dist/render/graphics2d.js.map +1 -1
  597. package/dist/render/index.d.ts +2 -0
  598. package/dist/render/index.d.ts.map +1 -1
  599. package/dist/render/index.js +1 -0
  600. package/dist/render/index.js.map +1 -1
  601. package/dist/render/measure-context.js.map +1 -1
  602. package/dist/render/null-render-context.js.map +1 -1
  603. package/dist/render/render-context2d.d.ts +1 -1
  604. package/dist/render/render-context2d.js.map +1 -1
  605. package/dist/render/render-issue.d.ts +39 -0
  606. package/dist/render/render-issue.d.ts.map +1 -0
  607. package/dist/render/render-issue.js +29 -0
  608. package/dist/render/render-issue.js.map +1 -0
  609. package/dist/render/surface.d.ts +2 -2
  610. package/dist/render/surface.js.map +1 -1
  611. package/dist/render/text-defaults.js.map +1 -1
  612. package/dist/render/text-layout.js.map +1 -1
  613. package/dist/render3d/bounds3d.js.map +1 -1
  614. package/dist/render3d/builders.js.map +1 -1
  615. package/dist/render3d/camera.js.map +1 -1
  616. package/dist/render3d/fill3d.js.map +1 -1
  617. package/dist/render3d/geometry.js.map +1 -1
  618. package/dist/render3d/graphics3d.d.ts.map +1 -1
  619. package/dist/render3d/graphics3d.js +54 -5
  620. package/dist/render3d/graphics3d.js.map +1 -1
  621. package/dist/render3d/index.js.map +1 -1
  622. package/dist/render3d/inert.js.map +1 -1
  623. package/dist/render3d/light.js.map +1 -1
  624. package/dist/render3d/material.js.map +1 -1
  625. package/dist/render3d/matrix4.js.map +1 -1
  626. package/dist/render3d/render-context3d.js.map +1 -1
  627. package/dist/render3d/resources.js.map +1 -1
  628. package/dist/render3d/rounded-box.js.map +1 -1
  629. package/dist/render3d/scene-settings.js.map +1 -1
  630. package/dist/render3d/scene3d.js.map +1 -1
  631. package/dist/render3d/segments.js.map +1 -1
  632. package/dist/render3d/texture.js.map +1 -1
  633. package/dist/render3d/tracking.js.map +1 -1
  634. package/dist/render3d/transform.js.map +1 -1
  635. package/dist/render3d/vector3.js.map +1 -1
  636. package/dist/render3d/walk.js.map +1 -1
  637. package/dist/runtime/asset-refine.js +2 -1
  638. package/dist/runtime/asset-refine.js.map +1 -1
  639. package/dist/runtime/asset-timeline.d.ts +10 -0
  640. package/dist/runtime/asset-timeline.d.ts.map +1 -1
  641. package/dist/runtime/asset-timeline.js.map +1 -1
  642. package/dist/runtime/asset-update.d.ts.map +1 -1
  643. package/dist/runtime/asset-update.js +7 -0
  644. package/dist/runtime/asset-update.js.map +1 -1
  645. package/dist/runtime/audio-index.js.map +1 -1
  646. package/dist/runtime/builtin-context.js.map +1 -1
  647. package/dist/runtime/clip-instance.d.ts +3 -1
  648. package/dist/runtime/clip-instance.d.ts.map +1 -1
  649. package/dist/runtime/clip-instance.js +4 -0
  650. package/dist/runtime/clip-instance.js.map +1 -1
  651. package/dist/runtime/clip-store.d.ts.map +1 -1
  652. package/dist/runtime/clip-store.js +17 -2
  653. package/dist/runtime/clip-store.js.map +1 -1
  654. package/dist/runtime/engine.d.ts +5 -3
  655. package/dist/runtime/engine.d.ts.map +1 -1
  656. package/dist/runtime/engine.js +2 -1
  657. package/dist/runtime/engine.js.map +1 -1
  658. package/dist/runtime/frame-time.js.map +1 -1
  659. package/dist/runtime/index.js.map +1 -1
  660. package/dist/runtime/node-picking.js.map +1 -1
  661. package/dist/runtime/node-picking3d.js.map +1 -1
  662. package/dist/runtime/placement.js.map +1 -1
  663. package/dist/runtime/playback-controller.d.ts.map +1 -1
  664. package/dist/runtime/playback-controller.js +14 -4
  665. package/dist/runtime/playback-controller.js.map +1 -1
  666. package/dist/runtime/playback.js.map +1 -1
  667. package/dist/runtime/precompisition.js.map +1 -1
  668. package/dist/runtime/project-assets.js.map +1 -1
  669. package/dist/runtime/session.d.ts +7 -3
  670. package/dist/runtime/session.d.ts.map +1 -1
  671. package/dist/runtime/session.js +11 -4
  672. package/dist/runtime/session.js.map +1 -1
  673. package/dist/runtime/settle.js.map +1 -1
  674. package/dist/runtime/state-evaluator.js.map +1 -1
  675. package/dist/runtime/text-geometry.d.ts +1 -1
  676. package/dist/runtime/text-geometry.js.map +1 -1
  677. package/dist/sdk/index.d.ts +8 -6
  678. package/dist/sdk/index.d.ts.map +1 -1
  679. package/dist/sdk/index.js +10 -3
  680. package/dist/sdk/index.js.map +1 -1
  681. package/dist/tween/command-decorator.d.ts +7 -0
  682. package/dist/tween/command-decorator.d.ts.map +1 -1
  683. package/dist/tween/command-decorator.js +1 -0
  684. package/dist/tween/command-decorator.js.map +1 -1
  685. package/dist/tween/command.js.map +1 -1
  686. package/dist/tween/ease/constants.js.map +1 -1
  687. package/dist/tween/ease/curve.js.map +1 -1
  688. package/dist/tween/ease/describe.d.ts +2 -0
  689. package/dist/tween/ease/describe.d.ts.map +1 -1
  690. package/dist/tween/ease/describe.js +4 -0
  691. package/dist/tween/ease/describe.js.map +1 -1
  692. package/dist/tween/ease/spec.d.ts +31 -0
  693. package/dist/tween/ease/spec.d.ts.map +1 -0
  694. package/dist/tween/ease/spec.js +51 -0
  695. package/dist/tween/ease/spec.js.map +1 -0
  696. package/dist/tween/ease/type.js.map +1 -1
  697. package/dist/tween/index.d.ts +1 -0
  698. package/dist/tween/index.d.ts.map +1 -1
  699. package/dist/tween/index.js +1 -0
  700. package/dist/tween/index.js.map +1 -1
  701. package/dist/tween/inert.js.map +1 -1
  702. package/dist/tween/lerp.js.map +1 -1
  703. package/dist/tween/loop.js.map +1 -1
  704. package/dist/tween/prepare.js.map +1 -1
  705. package/dist/tween/stepper.js.map +1 -1
  706. package/dist/tween/to-command.js.map +1 -1
  707. package/dist/util/clamp.js.map +1 -1
  708. package/dist/util/context.js.map +1 -1
  709. package/dist/util/csv.js.map +1 -1
  710. package/dist/util/generateList.js.map +1 -1
  711. package/dist/util/index.js.map +1 -1
  712. package/dist/util/metrics.js.map +1 -1
  713. package/dist/util/random.js.map +1 -1
  714. package/dist/util/reference.js.map +1 -1
  715. package/dist/util/scheduler.js.map +1 -1
  716. package/package.json +2 -2
  717. package/dist/attributes/audio/filters/chain.d.ts +0 -113
  718. package/dist/attributes/audio/filters/chain.d.ts.map +0 -1
  719. package/dist/attributes/audio/filters/chain.js +0 -104
  720. package/dist/attributes/audio/filters/chain.js.map +0 -1
  721. package/dist/attributes/audio/filters/curve.d.ts +0 -152
  722. package/dist/attributes/audio/filters/curve.d.ts.map +0 -1
  723. package/dist/attributes/audio/filters/curve.js +0 -250
  724. package/dist/attributes/audio/filters/curve.js.map +0 -1
  725. package/dist/attributes/audio/filters/implementations/echo.d.ts +0 -14
  726. package/dist/attributes/audio/filters/implementations/echo.d.ts.map +0 -1
  727. package/dist/attributes/audio/filters/implementations/echo.js.map +0 -1
  728. package/dist/attributes/audio/filters/implementations/gain.d.ts +0 -10
  729. package/dist/attributes/audio/filters/implementations/gain.d.ts.map +0 -1
  730. package/dist/attributes/audio/filters/implementations/gain.js.map +0 -1
  731. package/dist/attributes/audio/filters/implementations/highpass.d.ts +0 -12
  732. package/dist/attributes/audio/filters/implementations/highpass.d.ts.map +0 -1
  733. package/dist/attributes/audio/filters/implementations/highpass.js.map +0 -1
  734. package/dist/attributes/audio/filters/implementations/lowpass.d.ts +0 -12
  735. package/dist/attributes/audio/filters/implementations/lowpass.d.ts.map +0 -1
  736. package/dist/attributes/audio/filters/implementations/lowpass.js.map +0 -1
  737. package/dist/attributes/audio/filters/implementations/speed.d.ts +0 -18
  738. package/dist/attributes/audio/filters/implementations/speed.d.ts.map +0 -1
  739. package/dist/attributes/audio/filters/implementations/speed.js +0 -6
  740. package/dist/attributes/audio/filters/implementations/speed.js.map +0 -1
  741. package/dist/attributes/audio/filters/implementations/tremolo.d.ts +0 -12
  742. package/dist/attributes/audio/filters/implementations/tremolo.d.ts.map +0 -1
  743. package/dist/attributes/audio/filters/implementations/tremolo.js.map +0 -1
  744. package/dist/attributes/audio/filters/index.d.ts +0 -22
  745. package/dist/attributes/audio/filters/index.d.ts.map +0 -1
  746. package/dist/attributes/audio/filters/index.js +0 -8
  747. package/dist/attributes/audio/filters/index.js.map +0 -1
  748. package/dist/attributes/audio/filters/registry.d.ts +0 -36
  749. package/dist/attributes/audio/filters/registry.d.ts.map +0 -1
  750. package/dist/attributes/audio/filters/registry.js +0 -82
  751. package/dist/attributes/audio/filters/registry.js.map +0 -1
  752. package/dist/attributes/audio/filters/union.d.ts +0 -18
  753. package/dist/attributes/audio/filters/union.d.ts.map +0 -1
  754. package/dist/attributes/audio/filters/union.js +0 -28
  755. package/dist/attributes/audio/filters/union.js.map +0 -1
  756. package/dist/attributes/shape/sksl-uniforms.d.ts +0 -146
  757. package/dist/attributes/shape/sksl-uniforms.d.ts.map +0 -1
  758. package/dist/attributes/shape/sksl-uniforms.js +0 -0
  759. package/dist/attributes/shape/sksl-uniforms.js.map +0 -1
  760. package/dist/browser/chunks/chunk-D4FSTPML.js +0 -14
  761. package/dist/browser/chunks/chunk-D4FSTPML.js.map +0 -7
  762. package/dist/browser/chunks/chunk-LKUYVFU3.js.map +0 -7
  763. package/dist/browser/chunks/chunk-RTNATFWX.js +0 -5
  764. package/dist/browser/chunks/chunk-RTNATFWX.js.map +0 -7
  765. package/dist/browser/chunks/chunk-ZRPZPWZU.js.map +0 -7
  766. package/dist/component/api.d.ts +0 -508
  767. package/dist/component/api.d.ts.map +0 -1
  768. package/dist/component/api.js +0 -4
  769. package/dist/component/api.js.map +0 -1
  770. package/dist/component/builtins/audio.d.ts +0 -26
  771. package/dist/component/builtins/audio.d.ts.map +0 -1
  772. package/dist/component/builtins/audio.js +0 -41
  773. package/dist/component/builtins/audio.js.map +0 -1
  774. package/dist/component/builtins/canvas3d.d.ts +0 -98
  775. package/dist/component/builtins/canvas3d.d.ts.map +0 -1
  776. package/dist/component/builtins/canvas3d.js +0 -21
  777. package/dist/component/builtins/canvas3d.js.map +0 -1
  778. package/dist/component/builtins/composite.d.ts +0 -56
  779. package/dist/component/builtins/composite.d.ts.map +0 -1
  780. package/dist/component/builtins/composite.js +0 -25
  781. package/dist/component/builtins/composite.js.map +0 -1
  782. package/dist/component/builtins/geometry.d.ts +0 -505
  783. package/dist/component/builtins/geometry.d.ts.map +0 -1
  784. package/dist/component/builtins/geometry.js +0 -107
  785. package/dist/component/builtins/geometry.js.map +0 -1
  786. package/dist/component/builtins/layout.d.ts +0 -88
  787. package/dist/component/builtins/layout.d.ts.map +0 -1
  788. package/dist/component/builtins/layout.js +0 -84
  789. package/dist/component/builtins/layout.js.map +0 -1
  790. package/dist/component/builtins/media.d.ts +0 -95
  791. package/dist/component/builtins/media.d.ts.map +0 -1
  792. package/dist/component/builtins/media.js +0 -149
  793. package/dist/component/builtins/media.js.map +0 -1
  794. package/dist/component/builtins/providers.d.ts +0 -23
  795. package/dist/component/builtins/providers.d.ts.map +0 -1
  796. package/dist/component/builtins/providers.js +0 -30
  797. package/dist/component/builtins/providers.js.map +0 -1
  798. package/dist/component/builtins/text.d.ts +0 -193
  799. package/dist/component/builtins/text.d.ts.map +0 -1
  800. package/dist/component/builtins/text.js +0 -113
  801. package/dist/component/builtins/text.js.map +0 -1
  802. package/dist/component/builtins/three.d.ts +0 -1085
  803. package/dist/component/builtins/three.d.ts.map +0 -1
  804. package/dist/component/builtins/three.js +0 -265
  805. package/dist/component/builtins/three.js.map +0 -1
  806. package/dist/component/clip-of.d.ts +0 -5
  807. package/dist/component/clip-of.d.ts.map +0 -1
  808. package/dist/component/clip-of.js +0 -33
  809. package/dist/component/clip-of.js.map +0 -1
  810. package/dist/component/commands-for.d.ts +0 -19
  811. package/dist/component/commands-for.d.ts.map +0 -1
  812. package/dist/component/commands-for.js +0 -5
  813. package/dist/component/commands-for.js.map +0 -1
  814. package/dist/component/component-audio.d.ts +0 -9
  815. package/dist/component/component-audio.d.ts.map +0 -1
  816. package/dist/component/component-audio.js +0 -18
  817. package/dist/component/component-audio.js.map +0 -1
  818. package/dist/component/component2d.d.ts +0 -9
  819. package/dist/component/component2d.d.ts.map +0 -1
  820. package/dist/component/component2d.js +0 -239
  821. package/dist/component/component2d.js.map +0 -1
  822. package/dist/component/component3d.d.ts +0 -9
  823. package/dist/component/component3d.d.ts.map +0 -1
  824. package/dist/component/component3d.js +0 -99
  825. package/dist/component/component3d.js.map +0 -1
  826. package/dist/component/factory.d.ts +0 -63
  827. package/dist/component/factory.d.ts.map +0 -1
  828. package/dist/component/factory.js +0 -313
  829. package/dist/component/factory.js.map +0 -1
  830. package/dist/component/modules/aim.d.ts +0 -30
  831. package/dist/component/modules/aim.d.ts.map +0 -1
  832. package/dist/component/modules/aim.js +0 -39
  833. package/dist/component/modules/aim.js.map +0 -1
  834. package/dist/component/modules/corners.d.ts +0 -13
  835. package/dist/component/modules/corners.d.ts.map +0 -1
  836. package/dist/component/modules/corners.js +0 -12
  837. package/dist/component/modules/corners.js.map +0 -1
  838. package/dist/component/modules/flow.d.ts +0 -26
  839. package/dist/component/modules/flow.d.ts.map +0 -1
  840. package/dist/component/modules/flow.js +0 -55
  841. package/dist/component/modules/flow.js.map +0 -1
  842. package/dist/component/modules/material.d.ts +0 -40
  843. package/dist/component/modules/material.d.ts.map +0 -1
  844. package/dist/component/modules/material.js +0 -75
  845. package/dist/component/modules/material.js.map +0 -1
  846. package/dist/component/modules/paint.d.ts +0 -71
  847. package/dist/component/modules/paint.d.ts.map +0 -1
  848. package/dist/component/modules/paint.js +0 -106
  849. package/dist/component/modules/paint.js.map +0 -1
  850. package/dist/component/modules/shapes.d.ts +0 -31
  851. package/dist/component/modules/shapes.d.ts.map +0 -1
  852. package/dist/component/modules/shapes.js +0 -43
  853. package/dist/component/modules/shapes.js.map +0 -1
  854. package/dist/component/modules/text-layout.d.ts +0 -26
  855. package/dist/component/modules/text-layout.d.ts.map +0 -1
  856. package/dist/component/modules/text-layout.js +0 -57
  857. package/dist/component/modules/text-layout.js.map +0 -1
  858. package/dist/component/modules/text-style.d.ts +0 -48
  859. package/dist/component/modules/text-style.d.ts.map +0 -1
  860. package/dist/component/modules/text-style.js +0 -63
  861. package/dist/component/modules/text-style.js.map +0 -1
  862. package/dist/component/modules/three-entries.d.ts +0 -23
  863. package/dist/component/modules/three-entries.d.ts.map +0 -1
  864. package/dist/component/modules/three-entries.js +0 -41
  865. package/dist/component/modules/three-entries.js.map +0 -1
  866. package/dist/component/modules/view3d.d.ts +0 -55
  867. package/dist/component/modules/view3d.d.ts.map +0 -1
  868. package/dist/component/modules/view3d.js +0 -160
  869. package/dist/component/modules/view3d.js.map +0 -1
  870. package/dist/component/timeline.d.ts +0 -22
  871. package/dist/component/timeline.d.ts.map +0 -1
  872. package/dist/component/timeline.js +0 -128
  873. package/dist/component/timeline.js.map +0 -1
  874. package/dist/component/type-def.d.ts +0 -26
  875. package/dist/component/type-def.d.ts.map +0 -1
  876. package/dist/component/type-def.js +0 -16
  877. package/dist/component/type-def.js.map +0 -1
  878. package/dist/component/types.d.ts +0 -91
  879. package/dist/component/types.d.ts.map +0 -1
  880. package/dist/component/types.js +0 -88
  881. package/dist/component/types.js.map +0 -1
  882. package/dist/component/views.d.ts +0 -121
  883. package/dist/component/views.d.ts.map +0 -1
  884. package/dist/component/views.js +0 -413
  885. package/dist/component/views.js.map +0 -1
  886. package/dist/document/withdraw.d.ts +0 -28
  887. package/dist/document/withdraw.d.ts.map +0 -1
  888. package/dist/document/withdraw.js +0 -61
  889. package/dist/document/withdraw.js.map +0 -1
  890. package/dist/jsx/jsx-dev-runtime.d.ts +0 -3
  891. package/dist/jsx/jsx-dev-runtime.d.ts.map +0 -1
  892. package/dist/jsx/jsx-dev-runtime.js +0 -3
  893. package/dist/jsx/jsx-dev-runtime.js.map +0 -1
  894. package/dist/jsx/jsx-runtime.d.ts +0 -27
  895. package/dist/jsx/jsx-runtime.d.ts.map +0 -1
  896. package/dist/jsx/jsx-runtime.js +0 -26
  897. package/dist/jsx/jsx-runtime.js.map +0 -1
  898. package/dist/nodes/2d/node-lifecycle.d.ts +0 -46
  899. package/dist/nodes/2d/node-lifecycle.d.ts.map +0 -1
  900. package/dist/nodes/2d/node-lifecycle.js +0 -264
  901. package/dist/nodes/2d/node-lifecycle.js.map +0 -1
  902. package/dist/nodes/2d/node-motion.d.ts +0 -56
  903. package/dist/nodes/2d/node-motion.d.ts.map +0 -1
  904. package/dist/nodes/2d/node-motion.js +0 -86
  905. package/dist/nodes/2d/node-motion.js.map +0 -1
  906. package/dist/nodes/2d/node-render.d.ts +0 -44
  907. package/dist/nodes/2d/node-render.d.ts.map +0 -1
  908. package/dist/nodes/2d/node-render.js +0 -80
  909. package/dist/nodes/2d/node-render.js.map +0 -1
  910. package/dist/nodes/2d/node-space.d.ts +0 -63
  911. package/dist/nodes/2d/node-space.d.ts.map +0 -1
  912. package/dist/nodes/2d/node-space.js +0 -131
  913. package/dist/nodes/2d/node-space.js.map +0 -1
  914. package/dist/nodes/2d/node-transform.d.ts +0 -55
  915. package/dist/nodes/2d/node-transform.d.ts.map +0 -1
  916. package/dist/nodes/2d/node-transform.js +0 -73
  917. package/dist/nodes/2d/node-transform.js.map +0 -1
  918. package/dist/nodes/2d/node2d.d.ts +0 -1111
  919. package/dist/nodes/2d/node2d.d.ts.map +0 -1
  920. package/dist/nodes/2d/node2d.js +0 -1665
  921. package/dist/nodes/2d/node2d.js.map +0 -1
  922. package/dist/nodes/2d/paint-node.d.ts +0 -142
  923. package/dist/nodes/2d/paint-node.d.ts.map +0 -1
  924. package/dist/nodes/2d/paint-node.js +0 -232
  925. package/dist/nodes/2d/paint-node.js.map +0 -1
  926. package/dist/nodes/audio/audio-bus.d.ts +0 -28
  927. package/dist/nodes/audio/audio-bus.d.ts.map +0 -1
  928. package/dist/nodes/audio/audio-bus.js +0 -33
  929. package/dist/nodes/audio/audio-bus.js.map +0 -1
  930. package/dist/nodes/audio/index.d.ts +0 -4
  931. package/dist/nodes/audio/index.d.ts.map +0 -1
  932. package/dist/nodes/audio/index.js +0 -2
  933. package/dist/nodes/audio/index.js.map +0 -1
  934. package/dist/nodes/audio/node-audio.d.ts +0 -107
  935. package/dist/nodes/audio/node-audio.d.ts.map +0 -1
  936. package/dist/nodes/audio/node-audio.js +0 -179
  937. package/dist/nodes/audio/node-audio.js.map +0 -1
  938. package/dist/nodes/audio/sound-node.d.ts +0 -41
  939. package/dist/nodes/audio/sound-node.d.ts.map +0 -1
  940. package/dist/nodes/audio/sound-node.js +0 -71
  941. package/dist/nodes/audio/sound-node.js.map +0 -1
  942. package/dist/nodes/geometry/boolean-node.d.ts +0 -28
  943. package/dist/nodes/geometry/boolean-node.d.ts.map +0 -1
  944. package/dist/nodes/geometry/boolean-node.js +0 -81
  945. package/dist/nodes/geometry/boolean-node.js.map +0 -1
  946. package/dist/nodes/geometry/bounds-shape-node.d.ts +0 -149
  947. package/dist/nodes/geometry/bounds-shape-node.d.ts.map +0 -1
  948. package/dist/nodes/geometry/bounds-shape-node.js +0 -181
  949. package/dist/nodes/geometry/bounds-shape-node.js.map +0 -1
  950. package/dist/nodes/geometry/box-path-node.d.ts +0 -89
  951. package/dist/nodes/geometry/box-path-node.d.ts.map +0 -1
  952. package/dist/nodes/geometry/box-path-node.js +0 -116
  953. package/dist/nodes/geometry/box-path-node.js.map +0 -1
  954. package/dist/nodes/geometry/ellipse-node.d.ts +0 -18
  955. package/dist/nodes/geometry/ellipse-node.d.ts.map +0 -1
  956. package/dist/nodes/geometry/ellipse-node.js +0 -45
  957. package/dist/nodes/geometry/ellipse-node.js.map +0 -1
  958. package/dist/nodes/geometry/group-bounds.d.ts +0 -56
  959. package/dist/nodes/geometry/group-bounds.d.ts.map +0 -1
  960. package/dist/nodes/geometry/group-bounds.js +0 -87
  961. package/dist/nodes/geometry/group-bounds.js.map +0 -1
  962. package/dist/nodes/geometry/mask-node.d.ts +0 -33
  963. package/dist/nodes/geometry/mask-node.d.ts.map +0 -1
  964. package/dist/nodes/geometry/mask-node.js +0 -66
  965. package/dist/nodes/geometry/mask-node.js.map +0 -1
  966. package/dist/nodes/geometry/path-node.d.ts +0 -26
  967. package/dist/nodes/geometry/path-node.d.ts.map +0 -1
  968. package/dist/nodes/geometry/path-node.js +0 -58
  969. package/dist/nodes/geometry/path-node.js.map +0 -1
  970. package/dist/nodes/geometry/polygon-node.d.ts +0 -26
  971. package/dist/nodes/geometry/polygon-node.d.ts.map +0 -1
  972. package/dist/nodes/geometry/polygon-node.js +0 -47
  973. package/dist/nodes/geometry/polygon-node.js.map +0 -1
  974. package/dist/nodes/geometry/polygram-node.d.ts +0 -33
  975. package/dist/nodes/geometry/polygram-node.d.ts.map +0 -1
  976. package/dist/nodes/geometry/polygram-node.js +0 -52
  977. package/dist/nodes/geometry/polygram-node.js.map +0 -1
  978. package/dist/nodes/geometry/rect-node.d.ts +0 -38
  979. package/dist/nodes/geometry/rect-node.d.ts.map +0 -1
  980. package/dist/nodes/geometry/rect-node.js +0 -56
  981. package/dist/nodes/geometry/rect-node.js.map +0 -1
  982. package/dist/nodes/geometry/shape-node.d.ts +0 -71
  983. package/dist/nodes/geometry/shape-node.d.ts.map +0 -1
  984. package/dist/nodes/geometry/shape-node.js +0 -140
  985. package/dist/nodes/geometry/shape-node.js.map +0 -1
  986. package/dist/nodes/geometry/shape-outline.d.ts +0 -93
  987. package/dist/nodes/geometry/shape-outline.d.ts.map +0 -1
  988. package/dist/nodes/geometry/shape-outline.js +0 -470
  989. package/dist/nodes/geometry/shape-outline.js.map +0 -1
  990. package/dist/nodes/index.d.ts +0 -53
  991. package/dist/nodes/index.d.ts.map +0 -1
  992. package/dist/nodes/index.js +0 -35
  993. package/dist/nodes/index.js.map +0 -1
  994. package/dist/nodes/layout/camera-node.d.ts +0 -80
  995. package/dist/nodes/layout/camera-node.d.ts.map +0 -1
  996. package/dist/nodes/layout/camera-node.js +0 -153
  997. package/dist/nodes/layout/camera-node.js.map +0 -1
  998. package/dist/nodes/layout/orbit-camera-node.d.ts +0 -80
  999. package/dist/nodes/layout/orbit-camera-node.d.ts.map +0 -1
  1000. package/dist/nodes/layout/orbit-camera-node.js +0 -118
  1001. package/dist/nodes/layout/orbit-camera-node.js.map +0 -1
  1002. package/dist/nodes/layout/rotated-box.d.ts +0 -20
  1003. package/dist/nodes/layout/rotated-box.d.ts.map +0 -1
  1004. package/dist/nodes/layout/rotated-box.js +0 -76
  1005. package/dist/nodes/layout/rotated-box.js.map +0 -1
  1006. package/dist/nodes/media/video-node.d.ts +0 -229
  1007. package/dist/nodes/media/video-node.d.ts.map +0 -1
  1008. package/dist/nodes/media/video-node.js +0 -350
  1009. package/dist/nodes/media/video-node.js.map +0 -1
  1010. package/dist/nodes/node/declare-paints.d.ts +0 -19
  1011. package/dist/nodes/node/declare-paints.d.ts.map +0 -1
  1012. package/dist/nodes/node/declare-paints.js +0 -27
  1013. package/dist/nodes/node/declare-paints.js.map +0 -1
  1014. package/dist/nodes/node/node-editor-state.d.ts +0 -53
  1015. package/dist/nodes/node/node-editor-state.d.ts.map +0 -1
  1016. package/dist/nodes/node/node-editor-state.js +0 -23
  1017. package/dist/nodes/node/node-editor-state.js.map +0 -1
  1018. package/dist/nodes/node/node-reactive.d.ts +0 -89
  1019. package/dist/nodes/node/node-reactive.d.ts.map +0 -1
  1020. package/dist/nodes/node/node-reactive.js +0 -135
  1021. package/dist/nodes/node/node-reactive.js.map +0 -1
  1022. package/dist/nodes/node/node-time.d.ts +0 -39
  1023. package/dist/nodes/node/node-time.d.ts.map +0 -1
  1024. package/dist/nodes/node/node-time.js +0 -14
  1025. package/dist/nodes/node/node-time.js.map +0 -1
  1026. package/dist/nodes/node/node-walk.d.ts +0 -46
  1027. package/dist/nodes/node/node-walk.d.ts.map +0 -1
  1028. package/dist/nodes/node/node-walk.js +0 -74
  1029. package/dist/nodes/node/node-walk.js.map +0 -1
  1030. package/dist/nodes/node/node.d.ts +0 -445
  1031. package/dist/nodes/node/node.d.ts.map +0 -1
  1032. package/dist/nodes/node/node.js +0 -745
  1033. package/dist/nodes/node/node.js.map +0 -1
  1034. package/dist/nodes/node/text-defaults.d.ts +0 -32
  1035. package/dist/nodes/node/text-defaults.d.ts.map +0 -1
  1036. package/dist/nodes/node/text-defaults.js +0 -37
  1037. package/dist/nodes/node/text-defaults.js.map +0 -1
  1038. package/dist/nodes/root/canvas2d-node.d.ts +0 -163
  1039. package/dist/nodes/root/canvas2d-node.d.ts.map +0 -1
  1040. package/dist/nodes/root/canvas2d-node.js +0 -264
  1041. package/dist/nodes/root/canvas2d-node.js.map +0 -1
  1042. package/dist/nodes/root/provider-node.d.ts +0 -47
  1043. package/dist/nodes/root/provider-node.d.ts.map +0 -1
  1044. package/dist/nodes/root/provider-node.js +0 -63
  1045. package/dist/nodes/root/provider-node.js.map +0 -1
  1046. package/dist/nodes/root/theme-provider-node.d.ts +0 -29
  1047. package/dist/nodes/root/theme-provider-node.d.ts.map +0 -1
  1048. package/dist/nodes/root/theme-provider-node.js +0 -43
  1049. package/dist/nodes/root/theme-provider-node.js.map +0 -1
  1050. package/dist/nodes/text/default-text-style-node.d.ts +0 -103
  1051. package/dist/nodes/text/default-text-style-node.d.ts.map +0 -1
  1052. package/dist/nodes/text/default-text-style-node.js +0 -146
  1053. package/dist/nodes/text/default-text-style-node.js.map +0 -1
  1054. package/dist/nodes/text/number-format.d.ts +0 -66
  1055. package/dist/nodes/text/number-format.d.ts.map +0 -1
  1056. package/dist/nodes/text/number-format.js +0 -227
  1057. package/dist/nodes/text/number-format.js.map +0 -1
  1058. package/dist/nodes/text/number-node.d.ts +0 -94
  1059. package/dist/nodes/text/number-node.d.ts.map +0 -1
  1060. package/dist/nodes/text/number-node.js +0 -86
  1061. package/dist/nodes/text/number-node.js.map +0 -1
  1062. package/dist/nodes/text/number-pattern.d.ts +0 -51
  1063. package/dist/nodes/text/number-pattern.d.ts.map +0 -1
  1064. package/dist/nodes/text/number-pattern.js +0 -77
  1065. package/dist/nodes/text/number-pattern.js.map +0 -1
  1066. package/dist/nodes/text/richtext-node.d.ts +0 -68
  1067. package/dist/nodes/text/richtext-node.d.ts.map +0 -1
  1068. package/dist/nodes/text/richtext-node.js +0 -78
  1069. package/dist/nodes/text/richtext-node.js.map +0 -1
  1070. package/dist/nodes/text/text-base.d.ts +0 -118
  1071. package/dist/nodes/text/text-base.d.ts.map +0 -1
  1072. package/dist/nodes/text/text-base.js +0 -153
  1073. package/dist/nodes/text/text-base.js.map +0 -1
  1074. package/dist/nodes/text/text-layout.d.ts +0 -87
  1075. package/dist/nodes/text/text-layout.d.ts.map +0 -1
  1076. package/dist/nodes/text/text-layout.js +0 -368
  1077. package/dist/nodes/text/text-layout.js.map +0 -1
  1078. package/dist/nodes/text/text-node.d.ts +0 -84
  1079. package/dist/nodes/text/text-node.d.ts.map +0 -1
  1080. package/dist/nodes/text/text-node.js +0 -188
  1081. package/dist/nodes/text/text-node.js.map +0 -1
  1082. package/dist/nodes/text/text-selection.d.ts +0 -125
  1083. package/dist/nodes/text/text-selection.d.ts.map +0 -1
  1084. package/dist/nodes/text/text-selection.js +0 -209
  1085. package/dist/nodes/text/text-selection.js.map +0 -1
  1086. package/dist/nodes/three/camera-nodes.d.ts +0 -109
  1087. package/dist/nodes/three/camera-nodes.d.ts.map +0 -1
  1088. package/dist/nodes/three/camera-nodes.js +0 -112
  1089. package/dist/nodes/three/camera-nodes.js.map +0 -1
  1090. package/dist/nodes/three/canvas3d-node.d.ts +0 -295
  1091. package/dist/nodes/three/canvas3d-node.d.ts.map +0 -1
  1092. package/dist/nodes/three/canvas3d-node.js +0 -486
  1093. package/dist/nodes/three/canvas3d-node.js.map +0 -1
  1094. package/dist/nodes/three/drawable-nodes.d.ts +0 -173
  1095. package/dist/nodes/three/drawable-nodes.d.ts.map +0 -1
  1096. package/dist/nodes/three/drawable-nodes.js +0 -284
  1097. package/dist/nodes/three/drawable-nodes.js.map +0 -1
  1098. package/dist/nodes/three/environment-nodes.d.ts +0 -106
  1099. package/dist/nodes/three/environment-nodes.d.ts.map +0 -1
  1100. package/dist/nodes/three/environment-nodes.js +0 -134
  1101. package/dist/nodes/three/environment-nodes.js.map +0 -1
  1102. package/dist/nodes/three/geometry-nodes.d.ts +0 -197
  1103. package/dist/nodes/three/geometry-nodes.d.ts.map +0 -1
  1104. package/dist/nodes/three/geometry-nodes.js +0 -322
  1105. package/dist/nodes/three/geometry-nodes.js.map +0 -1
  1106. package/dist/nodes/three/grid-geometry3d.d.ts +0 -62
  1107. package/dist/nodes/three/grid-geometry3d.d.ts.map +0 -1
  1108. package/dist/nodes/three/grid-geometry3d.js +0 -114
  1109. package/dist/nodes/three/grid-geometry3d.js.map +0 -1
  1110. package/dist/nodes/three/group3d.d.ts +0 -23
  1111. package/dist/nodes/three/group3d.d.ts.map +0 -1
  1112. package/dist/nodes/three/group3d.js +0 -21
  1113. package/dist/nodes/three/group3d.js.map +0 -1
  1114. package/dist/nodes/three/light-nodes.d.ts +0 -120
  1115. package/dist/nodes/three/light-nodes.d.ts.map +0 -1
  1116. package/dist/nodes/three/light-nodes.js +0 -173
  1117. package/dist/nodes/three/light-nodes.js.map +0 -1
  1118. package/dist/nodes/three/mesh3d.d.ts +0 -117
  1119. package/dist/nodes/three/mesh3d.d.ts.map +0 -1
  1120. package/dist/nodes/three/mesh3d.js +0 -147
  1121. package/dist/nodes/three/mesh3d.js.map +0 -1
  1122. package/dist/nodes/three/node3d.d.ts +0 -230
  1123. package/dist/nodes/three/node3d.d.ts.map +0 -1
  1124. package/dist/nodes/three/node3d.js +0 -337
  1125. package/dist/nodes/three/node3d.js.map +0 -1
  1126. package/dist/render/descriptors/latex.d.ts +0 -6
  1127. package/dist/render/descriptors/latex.d.ts.map +0 -1
  1128. package/dist/render/descriptors/latex.js +0 -2
  1129. package/dist/render/descriptors/latex.js.map +0 -1
  1130. package/dist/tween/seekable.d.ts +0 -81
  1131. package/dist/tween/seekable.d.ts.map +0 -1
  1132. package/dist/tween/seekable.js +0 -137
  1133. package/dist/tween/seekable.js.map +0 -1
@@ -38,12 +38,19 @@ export interface CommandMeta {
38
38
  * (`data`/`duration`/`easing`, not `index` or `wobble`).
39
39
  */
40
40
  args?: readonly CommandArg[];
41
+ /**
42
+ * Brings its target in: a timeline holds its first frame from the moment
43
+ * the target could first show it, so the resting node never flashes up
44
+ * ahead of it. The hold window is in `docs/timeline.md`.
45
+ */
46
+ entrance?: boolean;
41
47
  }
42
48
  export interface CommandOptions {
43
49
  /** Publishes the method under another key, for a name the method cannot take (a prop, an inherited method). */
44
50
  key?: string;
45
51
  name?: string;
46
52
  args?: readonly CommandArg[];
53
+ entrance?: boolean;
47
54
  }
48
55
  /**
49
56
  * Every `command` on an instance's class, inherited included, base → subclass.
@@ -1 +1 @@
1
- {"version":3,"file":"command-decorator.d.ts","sourceRoot":"","sources":["../../src/tween/command-decorator.ts"],"names":[],"mapp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AC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,oBAAoB,CAAC;AAEvD,2EAA2E;AAC3E,eAAO,MAAM,YAAY,eAAwB,CAAC;AAElD,MAAM,WAAW,WAAW;IACxB,qGAAqG;IACrG,GAAG,EAAE,MAAM,CAAC;IACZ,uDAAuD;IACvD,MAAM,EAAE,MAAM,CAAC;IACf,oFAAoF;IACpF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,IAAI,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC3B,+GAA+G;IAC/G,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,EAAE,CAE9D;AAED,+BAA+B;AAC/B,wBAAgB,OAAO,CAAC,OAAO,CAAC,EAAE,cAAc,IAC3B,QAAQ,MAAM,EAAE,aAAa,MAAM,GAAG,MAAM,KAAG,IAAI,CAgBvE"}
@@ -25,6 +25,7 @@ export function command(options) {
25
25
  method,
26
26
  ...(options?.name ? { name: options.name } : {}),
27
27
  ...(options?.args ? { args: options.args } : {}),
28
+ ...(options?.entrance ? { entrance: true } : {}),
28
29
  });
29
30
  };
30
31
  }
@@ -1 +1 @@
1
- {"version":3,"file":"command-decorator.js","sourceRoot":"","sources":["../../src/tween/command-decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAuB,MAAM,mCAAmC,CAAC;AA4BrF,2EAA2E;AAC3E,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AAyBlD;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,QAAgB;IAC3C,OAAO,WAAW,CAAc,QAAQ,EAAE,YAAY,CAAC,CAAC;AAC5D,CAAC;AAED,+BAA+B;AAC/B,MAAM,UAAU,OAAO,CAAC,OAAwB;IAC5C,OAAO,UAAU,MAAc,EAAE,WAA4B;QACzD,MAAM,MAAM,GAAG,WAAqB,CAAC;QACrC,MAAM,GAAG,GAAG,OAAO,EAAE,GAAG,IAAI,MAAM,CAAC;QACnC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC;YAC7D,MAAkC,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC;QAC3D,CAAC;QACD,MAAM,IAAI,GAAI,MAAkC,CAAC,YAAY,CAAkB,CAAC;QAChF,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC;YAAE,OAAO;QAC1C,IAAI,CAAC,IAAI,CAAC;YACN,GAAG;YACH,MAAM;YACN,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAChD,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACnD,CAAC,CAAC;IACP,CAAC,CAAC;AACN,CAAC","sourcesContent":["import { mostDerived, type PropertyEditor } from \"@/attributes/properties/decorator\";\r\n\r\n/**\r\n * Marks a method as a command: a named, parameterised animation a host can\r\n * offer, place on a timeline and store by name. Metadata only.\r\n *\r\n * ```ts\r\n * class Chart extends Node2D<ChartProps> {\r\n * showSeries({ data, duration = 1, easing }: CommandArgs<{ index: number }>): Command<ChartProps> { … }\r\n * }\r\n * declareMembers(Chart, { showSeries: command({ args: [\"index\"] }) });\r\n * ```\r\n *\r\n * `args` maps a stored command's `params` object onto `data`'s keys — see\r\n * {@link CommandMeta.args}. Every command takes one {@link CommandArgs}\r\n * argument rather than positional params, so a manifest can read its shape\r\n * off `T` directly.\r\n */\r\n\r\n/** One argument a command takes, in the same vocabulary a property uses ({@link PropertyEditor}) — a range, an enum, a unit. A bare string is a name with nothing else to say. */\r\nexport interface CommandArgDescriptor extends PropertyEditor {\r\n /** The key under a `CommandSpec`'s `params` this is read from. */\r\n key: string;\r\n default?: unknown;\r\n}\r\n\r\nexport type CommandArg = string | CommandArgDescriptor;\r\n\r\n/** Symbol under which `command` metadata is stored on class prototypes. */\r\nexport const COMMAND_META = Symbol(\"commandMeta\");\r\n\r\nexport interface CommandMeta {\r\n /** The key a host stores and dispatches on: the method name unless `command({ key })` renamed it. */\r\n key: string;\r\n /** The method, which dispatching {@link key} calls. */\r\n method: string;\r\n /** Display name; built-ins leave this unset and localize by {@link key} instead. */\r\n name?: string;\r\n /**\r\n * Keys of `params` that become `data`'s fields, in a document. Written here\r\n * rather than derived from the method's own parameter names, which a\r\n * minifier mangles and which don't match the document vocabulary anyway\r\n * (`data`/`duration`/`easing`, not `index` or `wobble`).\r\n */\r\n args?: readonly CommandArg[];\r\n}\r\n\r\nexport interface CommandOptions {\r\n /** Publishes the method under another key, for a name the method cannot take (a prop, an inherited method). */\r\n key?: string;\r\n name?: string;\r\n args?: readonly CommandArg[];\r\n}\r\n\r\n/**\r\n * Every `command` on an instance's class, inherited included, base → subclass.\r\n * A subclass that redeclares a key replaces the inherited declaration — method,\r\n * name and args — at the position the base gave it.\r\n */\r\nexport function getCommandMeta(instance: object): CommandMeta[] {\r\n return mostDerived<CommandMeta>(instance, COMMAND_META);\r\n}\r\n\r\n/** See the module docblock. */\r\nexport function command(options?: CommandOptions) {\r\n return function (target: object, propertyKey: string | symbol): void {\r\n const method = propertyKey as string;\r\n const key = options?.key ?? method;\r\n if (!Object.prototype.hasOwnProperty.call(target, COMMAND_META)) {\r\n (target as Record<symbol, unknown>)[COMMAND_META] = [];\r\n }\r\n const list = (target as Record<symbol, unknown>)[COMMAND_META] as CommandMeta[];\r\n if (list.some(m => m.key === key)) return;\r\n list.push({\r\n key,\r\n method,\r\n ...(options?.name ? { name: options.name } : {}),\r\n ...(options?.args ? { args: options.args } : {}),\r\n });\r\n };\r\n}\r\n"]}
1
+ {"version":3,"file":"command-decorator.js","sourceRoot":"","sources":["../../src/tween/command-decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAuB,MAAM,mCAAmC,CAAC;AA4BrF,2EAA2E;AAC3E,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AAgClD;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,QAAgB;IAC3C,OAAO,WAAW,CAAc,QAAQ,EAAE,YAAY,CAAC,CAAC;AAC5D,CAAC;AAED,+BAA+B;AAC/B,MAAM,UAAU,OAAO,CAAC,OAAwB;IAC5C,OAAO,UAAU,MAAc,EAAE,WAA4B;QACzD,MAAM,MAAM,GAAG,WAAqB,CAAC;QACrC,MAAM,GAAG,GAAG,OAAO,EAAE,GAAG,IAAI,MAAM,CAAC;QACnC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC;YAC7D,MAAkC,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC;QAC3D,CAAC;QACD,MAAM,IAAI,GAAI,MAAkC,CAAC,YAAY,CAAkB,CAAC;QAChF,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC;YAAE,OAAO;QAC1C,IAAI,CAAC,IAAI,CAAC;YACN,GAAG;YACH,MAAM;YACN,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAChD,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAChD,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACnD,CAAC,CAAC;IACP,CAAC,CAAC;AACN,CAAC","sourcesContent":["import { mostDerived, type PropertyEditor } from \"@/attributes/properties/decorator\";\n\n/**\n * Marks a method as a command: a named, parameterised animation a host can\n * offer, place on a timeline and store by name. Metadata only.\n *\n * ```ts\n * class Chart extends Node2D<ChartProps> {\n * showSeries({ data, duration = 1, easing }: CommandArgs<{ index: number }>): Command<ChartProps> { … }\n * }\n * declareMembers(Chart, { showSeries: command({ args: [\"index\"] }) });\n * ```\n *\n * `args` maps a stored command's `params` object onto `data`'s keys — see\n * {@link CommandMeta.args}. Every command takes one {@link CommandArgs}\n * argument rather than positional params, so a manifest can read its shape\n * off `T` directly.\n */\n\n/** One argument a command takes, in the same vocabulary a property uses ({@link PropertyEditor}) — a range, an enum, a unit. A bare string is a name with nothing else to say. */\nexport interface CommandArgDescriptor extends PropertyEditor {\n /** The key under a `CommandSpec`'s `params` this is read from. */\n key: string;\n default?: unknown;\n}\n\nexport type CommandArg = string | CommandArgDescriptor;\n\n/** Symbol under which `command` metadata is stored on class prototypes. */\nexport const COMMAND_META = Symbol(\"commandMeta\");\n\nexport interface CommandMeta {\n /** The key a host stores and dispatches on: the method name unless `command({ key })` renamed it. */\n key: string;\n /** The method, which dispatching {@link key} calls. */\n method: string;\n /** Display name; built-ins leave this unset and localize by {@link key} instead. */\n name?: string;\n /**\n * Keys of `params` that become `data`'s fields, in a document. Written here\n * rather than derived from the method's own parameter names, which a\n * minifier mangles and which don't match the document vocabulary anyway\n * (`data`/`duration`/`easing`, not `index` or `wobble`).\n */\n args?: readonly CommandArg[];\n /**\n * Brings its target in: a timeline holds its first frame from the moment\n * the target could first show it, so the resting node never flashes up\n * ahead of it. The hold window is in `docs/timeline.md`.\n */\n entrance?: boolean;\n}\n\nexport interface CommandOptions {\n /** Publishes the method under another key, for a name the method cannot take (a prop, an inherited method). */\n key?: string;\n name?: string;\n args?: readonly CommandArg[];\n entrance?: boolean;\n}\n\n/**\n * Every `command` on an instance's class, inherited included, base → subclass.\n * A subclass that redeclares a key replaces the inherited declaration — method,\n * name and args — at the position the base gave it.\n */\nexport function getCommandMeta(instance: object): CommandMeta[] {\n return mostDerived<CommandMeta>(instance, COMMAND_META);\n}\n\n/** See the module docblock. */\nexport function command(options?: CommandOptions) {\n return function (target: object, propertyKey: string | symbol): void {\n const method = propertyKey as string;\n const key = options?.key ?? method;\n if (!Object.prototype.hasOwnProperty.call(target, COMMAND_META)) {\n (target as Record<symbol, unknown>)[COMMAND_META] = [];\n }\n const list = (target as Record<symbol, unknown>)[COMMAND_META] as CommandMeta[];\n if (list.some(m => m.key === key)) return;\n list.push({\n key,\n method,\n ...(options?.name ? { name: options.name } : {}),\n ...(options?.args ? { args: options.args } : {}),\n ...(options?.entrance ? { entrance: true } : {}),\n });\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"command.js","sourceRoot":"","sources":["../../src/tween/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAiB,MAAM,QAAQ,CAAC;AAmCxE,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AAElC;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAuC,OAAU;IACpE,OAA8C,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;IAChE,OAAO,OAAO,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,OAAmC;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AgB,EAChB,KAAgC;IAEhC,MAAM,QAAQ,GAAG,CAAC,OAAe,EAAU,EAAE,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEtF,OAAO;QACH,QAAQ;QACR,wEAAwE;QACxE,yEAAyE;QACzE,sEAAsE;QACtE,kEAAkE;QAClE,iEAAiE;QACjE,EAAE,CAAC,CAAS;YACR,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;YACvB,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YAClB,OAAO,KAAK,CAAC;QACjB,CAAC;QAED,QAAQ;YACJ,IAAI,OAAO,GAAG,CAAC,CAAC;YAChB,OAAO;gBACH,IAAI,EAAE,CAAC,CAAS,EAAE,EAAE;oBAChB,OAAO,GAAG,CAAC,CAAC;oBACZ,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACnC,CAAC;gBACD,OAAO,EAAE,CAAC,EAAU,EAAW,EAAE;oBAC7B,OAAO,IAAI,EAAE,CAAC;oBACd,MAAM,IAAI,GAAG,OAAO,IAAI,QAAQ,CAAC;oBACjC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;oBAChD,OAAO,IAAI,CAAC;gBAChB,CAAC;aACJ,CAAC;QACN,CAAC;KACJ,CAAC;AACN,CAAC","sourcesContent":["import { clamp01 } from \"@/util/clamp\";\r\nimport { EasingFunction } from \"./ease/type\";\r\nimport { loopPasses, loopPhase, loopSpan, type LoopSpec } from \"./loop\";\r\nimport { LerpFunction } from \"./lerp\";\r\nimport { Steppable, TweenStepper } from \"./stepper\";\r\n\r\n/**\r\n * A named animation, as a value: `at(t)` is a pure function of normalized time,\r\n * so a host can ask what frame N looks like without replaying frames 0..N-1.\r\n *\r\n * `at` is only pure once *built* — a factory reads the node's current props to\r\n * fix its start value, so a host evaluating out of order must build commands in\r\n * timeline order, leaving each node in the state the previous command left it.\r\n */\r\nexport interface Command<P = Record<string, unknown>> extends Steppable {\r\n readonly duration: number;\r\n at(t: number): Partial<P>;\r\n}\r\n\r\n/**\r\n * The single argument a `command()` method takes: its own params under `data`,\r\n * plus shared timing. One object (not positional args) so a manifest can read a\r\n * command's shape off `T` directly.\r\n *\r\n * `duration`/`data` are optional for a command with a synchronous mode\r\n * (`restore`, `addChildAt`) or nothing to carry (`restore`).\r\n *\r\n * `R` differs from `T` when `data` is loose author input (`Fill`) but `lerp`\r\n * operates on its resolved form (`FillResolved[]`).\r\n */\r\nexport interface CommandArgs<T = Record<string, unknown>, R = T> {\r\n data?: T;\r\n duration?: number;\r\n easing?: EasingFunction;\r\n lerp?: LerpFunction<R>;\r\n}\r\n\r\nconst SETTLES = Symbol(\"settles\");\r\n\r\n/**\r\n * Mark a command whose `at` reads nothing but what it captured when it was built\r\n * and does nothing but write prop slots, its end values all at `at(1)`. A\r\n * timeline may then hold it finished by writing those end values instead of\r\n * running it — see `document/settled-index`.\r\n */\r\nexport function settling<C extends { at(t: number): unknown }>(command: C): C {\r\n (command as unknown as Record<symbol, boolean>)[SETTLES] = true;\r\n return command;\r\n}\r\n\r\nexport function settles(command: { at(t: number): unknown }): boolean {\r\n return (command as unknown as Record<symbol, boolean>)[SETTLES] === true;\r\n}\r\n\r\n/** True when `x` is a {@link Command} rather than a plain object. */\r\nexport function isCommand(x: unknown): x is Command {\r\n return typeof (x as Command)?.at === \"function\"\r\n && typeof (x as Command)?.duration === \"number\";\r\n}\r\n\r\n/** What a {@link Command} writes its evaluated props onto. */\r\nexport interface CommandTarget<P> {\r\n set(props: Partial<P>): void;\r\n}\r\n\r\n/** Build a {@link Command} from a pure `t → props` function. `easing` is applied inside, so `at` itself takes raw normalized time. */\r\nexport function makeCommand<P>(\r\n target: CommandTarget<P>,\r\n at: (t: number) => Partial<P>,\r\n duration: number,\r\n easing?: EasingFunction,\r\n): Command<P> {\r\n const value = (t: number): Partial<P> => at(easing ? easing(clamp01(t)) : clamp01(t));\r\n return fromValue(target, duration, value);\r\n}\r\n\r\n/**\r\n * A {@link Command} whose product is a side effect rather than props — for state\r\n * a `set()` can't reach (a private field, an array element).\r\n *\r\n * `apply` must be a pure function of `t`: it can run for any `t`, any number of\r\n * times, in any order. Accumulating (`x += …`) instead of assigning from `t`\r\n * looks right forwards and drifts the instant anything scrubs.\r\n */\r\nexport function driveCommand(\r\n duration: number,\r\n apply: (t: number) => void,\r\n easing?: EasingFunction,\r\n): Command<Record<string, never>> {\r\n const sink: CommandTarget<Record<string, never>> = { set: () => { } };\r\n return makeCommand(sink, (t) => {\r\n apply(t);\r\n return {};\r\n }, duration, easing);\r\n}\r\n\r\n/**\r\n * Repeat `command`, as one seekable {@link Command} that lasts for every pass.\r\n *\r\n * Wrapping rather than a parameter on each command is what makes this work for\r\n * every command there is: the inner one is asked for the frame at a pass-local\r\n * `t`, so it never learns it is being repeated, and its easing applies per pass\r\n * — which is what \"three bounces\" means, rather than one ease stretched over\r\n * three of them.\r\n *\r\n * `fill` is the seconds an unlimited loop (`count: null`) may cover; it defaults\r\n * to a single pass, since a command built outside a timeline has no clip to fill.\r\n * A stamp (`duration === 0`) is returned untouched: there is no pass to repeat.\r\n */\r\nexport function loopCommand<P>(command: Command<P>, loop: LoopSpec, fill?: number): Command<P> {\r\n const one = command.duration;\r\n if (one <= 0 || loopPasses(loop) <= 1) return command;\r\n const duration = loopSpan(loop, one, fill);\r\n const value = (t: number): Partial<P> => command.at(loopPhase(loop, clamp01(t) * duration, one));\r\n\r\n return {\r\n duration,\r\n at: value,\r\n _stepper(): TweenStepper {\r\n let elapsed = 0;\r\n return {\r\n seek: (e: number) => {\r\n elapsed = e;\r\n value(e / duration);\r\n },\r\n advance: (dt: number): boolean => {\r\n elapsed += dt;\r\n const done = elapsed >= duration;\r\n value(done ? 1 : elapsed / duration);\r\n return done;\r\n },\r\n };\r\n },\r\n };\r\n}\r\n\r\n/**\r\n * Run `commands` one after another as a single seekable {@link Command}.\r\n *\r\n * A finished child holds at `at(1)` rather than being dropped, so a prop\r\n * written early keeps its value once its step ends.\r\n */\r\nexport function commandSequence<P>(\r\n target: CommandTarget<P>,\r\n ...commands: Command<P>[]\r\n): Command<P> {\r\n const duration = commands.reduce((sum, c) => sum + c.duration, 0);\r\n\r\n return fromValue(target, duration, (t) => {\r\n const elapsed = t * duration;\r\n const props: Partial<P> = {};\r\n let cursor = 0;\r\n for (const command of commands) {\r\n if (elapsed < cursor) break;\r\n const local = command.duration > 0 ? (elapsed - cursor) / command.duration : 1;\r\n Object.assign(props, command.at(clamp01(local)));\r\n cursor += command.duration;\r\n }\r\n return props;\r\n });\r\n}\r\n\r\n/** Run `commands` together as one {@link Command}, ending when the longest does. Later commands win on a shared prop. */\r\nexport function commandParallel<P>(\r\n target: CommandTarget<P>,\r\n ...commands: Command<P>[]\r\n): Command<P> {\r\n const duration = commands.reduce((max, c) => Math.max(max, c.duration), 0);\r\n\r\n return fromValue(target, duration, (t) => {\r\n const elapsed = t * duration;\r\n const props: Partial<P> = {};\r\n for (const command of commands) {\r\n const local = command.duration > 0 ? elapsed / command.duration : 1;\r\n Object.assign(props, command.at(clamp01(local)));\r\n }\r\n return props;\r\n });\r\n}\r\n\r\n/** Wrap a pure `t → props` function into the full {@link Command} surface. */\r\nfunction fromValue<P>(\r\n target: CommandTarget<P>,\r\n duration: number,\r\n value: (t: number) => Partial<P>,\r\n): Command<P> {\r\n const progress = (elapsed: number): number => (duration > 0 ? elapsed / duration : 1);\r\n\r\n return {\r\n duration,\r\n // Writes as well as returns. A host evaluating a timeline calls `at(t)`\r\n // and discards what comes back — `ToCommand` has always applied its step\r\n // as a side effect, and a `Command` built from a `t → props` function\r\n // that only *described* its frame was silently inert everywhere a\r\n // document is seeked, while behaving correctly under `_stepper`.\r\n at(t: number): Partial<P> {\r\n const props = value(t);\r\n target.set(props);\r\n return props;\r\n },\r\n\r\n _stepper(): TweenStepper {\r\n let elapsed = 0;\r\n return {\r\n seek: (e: number) => {\r\n elapsed = e;\r\n target.set(value(progress(e)));\r\n },\r\n advance: (dt: number): boolean => {\r\n elapsed += dt;\r\n const done = elapsed >= duration;\r\n target.set(value(done ? 1 : progress(elapsed)));\r\n return done;\r\n },\r\n };\r\n },\r\n };\r\n}\r\n"]}
1
+ {"version":3,"file":"command.js","sourceRoot":"","sources":["../../src/tween/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAiB,MAAM,QAAQ,CAAC;AAmCxE,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AAElC;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAuC,OAAU;IACpE,OAA8C,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;IAChE,OAAO,OAAO,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,OAAmC;IACvD,OAAQ,OAA8C,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;AAC7E,CAAC;AAED,qEAAqE;AACrE,MAAM,UAAU,SAAS,CAAC,CAAU;IAChC,OAAO,OAAQ,CAAa,EAAE,EAAE,KAAK,UAAU;WACxC,OAAQ,CAAa,EAAE,QAAQ,KAAK,QAAQ,CAAC;AACxD,CAAC;AAOD,sIAAsI;AACtI,MAAM,UAAU,WAAW,CACvB,MAAwB,EACxB,EAA6B,EAC7B,QAAgB,EAChB,MAAuB;IAEvB,MAAM,KAAK,GAAG,CAAC,CAAS,EAAc,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAC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CAAS,EAAE,EAAE;oBAChB,OAAO,GAAG,CAAC,CAAC;oBACZ,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACnC,CAAC;gBACD,OAAO,EAAE,CAAC,EAAU,EAAW,EAAE;oBAC7B,OAAO,IAAI,EAAE,CAAC;oBACd,MAAM,IAAI,GAAG,OAAO,IAAI,QAAQ,CAAC;oBACjC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;oBAChD,OAAO,IAAI,CAAC;gBAChB,CAAC;aACJ,CAAC;QACN,CAAC;KACJ,CAAC;AACN,CAAC","sourcesContent":["import { clamp01 } from \"@/util/clamp\";\nimport { EasingFunction } from \"./ease/type\";\nimport { loopPasses, loopPhase, loopSpan, type LoopSpec } from \"./loop\";\nimport { LerpFunction } from \"./lerp\";\nimport { Steppable, TweenStepper } from \"./stepper\";\n\n/**\n * A named animation, as a value: `at(t)` is a pure function of normalized time,\n * so a host can ask what frame N looks like without replaying frames 0..N-1.\n *\n * `at` is only pure once *built* — a factory reads the node's current props to\n * fix its start value, so a host evaluating out of order must build commands in\n * timeline order, leaving each node in the state the previous command left it.\n */\nexport interface Command<P = Record<string, unknown>> extends Steppable {\n readonly duration: number;\n at(t: number): Partial<P>;\n}\n\n/**\n * The single argument a `command()` method takes: its own params under `data`,\n * plus shared timing. One object (not positional args) so a manifest can read a\n * command's shape off `T` directly.\n *\n * `duration`/`data` are optional for a command with a synchronous mode\n * (`restore`, `addChildAt`) or nothing to carry (`restore`).\n *\n * `R` differs from `T` when `data` is loose author input (`Fill`) but `lerp`\n * operates on its resolved form (`FillResolved[]`).\n */\nexport interface CommandArgs<T = Record<string, unknown>, R = T> {\n data?: T;\n duration?: number;\n easing?: EasingFunction;\n lerp?: LerpFunction<R>;\n}\n\nconst SETTLES = Symbol(\"settles\");\n\n/**\n * Mark a command whose `at` reads nothing but what it captured when it was built\n * and does nothing but write prop slots, its end values all at `at(1)`. A\n * timeline may then hold it finished by writing those end values instead of\n * running it — see `document/settled-index`.\n */\nexport function settling<C extends { at(t: number): unknown }>(command: C): C {\n (command as unknown as Record<symbol, boolean>)[SETTLES] = true;\n return command;\n}\n\nexport function settles(command: { at(t: number): unknown }): boolean {\n return (command as unknown as Record<symbol, boolean>)[SETTLES] === true;\n}\n\n/** True when `x` is a {@link Command} rather than a plain object. */\nexport function isCommand(x: unknown): x is Command {\n return typeof (x as Command)?.at === \"function\"\n && typeof (x as Command)?.duration === \"number\";\n}\n\n/** What a {@link Command} writes its evaluated props onto. */\nexport interface CommandTarget<P> {\n set(props: Partial<P>): void;\n}\n\n/** Build a {@link Command} from a pure `t → props` function. `easing` is applied inside, so `at` itself takes raw normalized time. */\nexport function makeCommand<P>(\n target: CommandTarget<P>,\n at: (t: number) => Partial<P>,\n duration: number,\n easing?: EasingFunction,\n): Command<P> {\n const value = (t: number): Partial<P> => at(easing ? easing(clamp01(t)) : clamp01(t));\n return fromValue(target, duration, value);\n}\n\n/**\n * A {@link Command} whose product is a side effect rather than props — for state\n * a `set()` can't reach (a private field, an array element).\n *\n * `apply` must be a pure function of `t`: it can run for any `t`, any number of\n * times, in any order. Accumulating (`x += …`) instead of assigning from `t`\n * looks right forwards and drifts the instant anything scrubs.\n */\nexport function driveCommand(\n duration: number,\n apply: (t: number) => void,\n easing?: EasingFunction,\n): Command<Record<string, never>> {\n const sink: CommandTarget<Record<string, never>> = { set: () => { } };\n return makeCommand(sink, (t) => {\n apply(t);\n return {};\n }, duration, easing);\n}\n\n/**\n * Repeat `command`, as one seekable {@link Command} that lasts for every pass.\n *\n * Wrapping rather than a parameter on each command is what makes this work for\n * every command there is: the inner one is asked for the frame at a pass-local\n * `t`, so it never learns it is being repeated, and its easing applies per pass\n * — which is what \"three bounces\" means, rather than one ease stretched over\n * three of them.\n *\n * `fill` is the seconds an unlimited loop (`count: null`) may cover; it defaults\n * to a single pass, since a command built outside a timeline has no clip to fill.\n * A stamp (`duration === 0`) is returned untouched: there is no pass to repeat.\n */\nexport function loopCommand<P>(command: Command<P>, loop: LoopSpec, fill?: number): Command<P> {\n const one = command.duration;\n if (one <= 0 || loopPasses(loop) <= 1) return command;\n const duration = loopSpan(loop, one, fill);\n const value = (t: number): Partial<P> => command.at(loopPhase(loop, clamp01(t) * duration, one));\n\n return {\n duration,\n at: value,\n _stepper(): TweenStepper {\n let elapsed = 0;\n return {\n seek: (e: number) => {\n elapsed = e;\n value(e / duration);\n },\n advance: (dt: number): boolean => {\n elapsed += dt;\n const done = elapsed >= duration;\n value(done ? 1 : elapsed / duration);\n return done;\n },\n };\n },\n };\n}\n\n/**\n * Run `commands` one after another as a single seekable {@link Command}.\n *\n * A finished child holds at `at(1)` rather than being dropped, so a prop\n * written early keeps its value once its step ends.\n */\nexport function commandSequence<P>(\n target: CommandTarget<P>,\n ...commands: Command<P>[]\n): Command<P> {\n const duration = commands.reduce((sum, c) => sum + c.duration, 0);\n\n return fromValue(target, duration, (t) => {\n const elapsed = t * duration;\n const props: Partial<P> = {};\n let cursor = 0;\n for (const command of commands) {\n if (elapsed < cursor) break;\n const local = command.duration > 0 ? (elapsed - cursor) / command.duration : 1;\n Object.assign(props, command.at(clamp01(local)));\n cursor += command.duration;\n }\n return props;\n });\n}\n\n/** Run `commands` together as one {@link Command}, ending when the longest does. Later commands win on a shared prop. */\nexport function commandParallel<P>(\n target: CommandTarget<P>,\n ...commands: Command<P>[]\n): Command<P> {\n const duration = commands.reduce((max, c) => Math.max(max, c.duration), 0);\n\n return fromValue(target, duration, (t) => {\n const elapsed = t * duration;\n const props: Partial<P> = {};\n for (const command of commands) {\n const local = command.duration > 0 ? elapsed / command.duration : 1;\n Object.assign(props, command.at(clamp01(local)));\n }\n return props;\n });\n}\n\n/** Wrap a pure `t → props` function into the full {@link Command} surface. */\nfunction fromValue<P>(\n target: CommandTarget<P>,\n duration: number,\n value: (t: number) => Partial<P>,\n): Command<P> {\n const progress = (elapsed: number): number => (duration > 0 ? elapsed / duration : 1);\n\n return {\n duration,\n // Writes as well as returns. A host evaluating a timeline calls `at(t)`\n // and discards what comes back — `ToCommand` has always applied its step\n // as a side effect, and a `Command` built from a `t → props` function\n // that only *described* its frame was silently inert everywhere a\n // document is seeked, while behaving correctly under `_stepper`.\n at(t: number): Partial<P> {\n const props = value(t);\n target.set(props);\n return props;\n },\n\n _stepper(): TweenStepper {\n let elapsed = 0;\n return {\n seek: (e: number) => {\n elapsed = e;\n target.set(value(progress(e)));\n },\n advance: (dt: number): boolean => {\n elapsed += dt;\n const done = elapsed >= duration;\n target.set(value(done ? 1 : progress(elapsed)));\n return done;\n },\n };\n },\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/tween/ease/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAM1C,4DAA4D;AAC5D,MAAM,CAAC,MAAM,YAAY,GAAiB,MAAM,CAAC;AAejD,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;AAInB,MAAM,WAAW,GAAG,CAAC,MAAmB,EAAkB,EAAE;IACxD,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;IACxD,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IACxD,OAAO,EAAE,GAAG,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,YAAY,EAAE,CAAC;AAC5D,CAAC,CAAC;AAEF,4EAA4E;AAC5E,uEAAuE;AACvE,+BAA+B;AAC/B,MAAM,MAAM,GAAoE;IAC5E,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAA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AAC,EAAE,GAAG,MAAM,EAAE,SAAS,EAAE,CAAC,MAAM,CAAC,SAAS,IAAI,OAAO,CAAC,GAAG,KAAK,EAAE;QACjE,CAAC,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS;YACvB,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,IAAI,EAAE;YAC9C,CAAC,CAAC,MAAM,CAAC;IACjB,OAAO,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE;QACtB,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QACf,OAAO,CAAC,GAAG,GAAG;YACV,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC;YAClD,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;IACrE,CAAC,EAAE,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;AACxC,CAAC,CAAC","sourcesContent":["import { clamp01 } from \"@/util/clamp\";\r\nimport { EasingFunction } from \"./type\";\r\nimport { describeEase } from \"./describe\";\r\n\r\nexport type StandardEase =\r\n | 'sine' | 'quad' | 'cubic' | 'quart' | 'quint'\r\n | 'expo' | 'circ' | 'back' | 'elastic' | 'bounce';\r\n\r\n/** Default ease family used when no `type` is specified. */\r\nexport const DEFAULT_EASE: StandardEase = 'quad';\r\n\r\nexport interface EaseConfig {\r\n /** Standard ease family (default: 'quad'). */\r\n type?: StandardEase;\r\n /** Used by 'back' (default: 1.70158). */\r\n overshoot?: number;\r\n /** Used by 'elastic' (default: 1). */\r\n amplitude?: number;\r\n /** Used by 'elastic' (default: 0.3). */\r\n period?: number;\r\n}\r\n\r\nexport type EaseParams = StandardEase | EaseConfig;\r\n\r\nconst PI = Math.PI;\r\n\r\ntype ResolvedConfig = EaseConfig & { type: StandardEase };\r\n\r\nconst parseConfig = (params?: EaseParams): ResolvedConfig => {\r\n if (params === undefined) return { type: DEFAULT_EASE };\r\n if (typeof params === 'string') return { type: params };\r\n return { ...params, type: params.type ?? DEFAULT_EASE };\r\n};\r\n\r\n// \"Ease in\" curve for each standard family, parameterized by an EaseConfig.\r\n// easeOut/easeInOut are derived from this via reflection, matching the\r\n// classic Penner construction.\r\nconst inMath: Record<StandardEase, (t: number, config: EaseConfig) => number> = {\r\n sine: (t) => 1 - Math.cos((t * PI) / 2),\r\n quad: (t) => t * t,\r\n cubic: (t) => t * t * t,\r\n quart: (t) => t * t * t * t,\r\n quint: (t) => t * t * t * t * t,\r\n expo: (t) => (t === 0 ? 0 : Math.pow(2, 10 * (t - 1))),\r\n circ: (t) => 1 - Math.sqrt(1 - t * t),\r\n back: (t, config) => {\r\n const s = config.overshoot ?? 1.70158;\r\n return t * t * ((s + 1) * t - s);\r\n },\r\n elastic: (t, config) => {\r\n if (t === 0 || t === 1) return t;\r\n const a = config.amplitude ?? 1;\r\n const p = config.period ?? 0.3;\r\n const s = (p / (2 * PI)) * Math.asin(1 / a);\r\n return -(a * Math.pow(2, 10 * (t - 1)) * Math.sin(((t - 1 - s) * 2 * PI) / p));\r\n },\r\n bounce: (t) => {\r\n const bounceOut = (x: number) => {\r\n const n1 = 7.5625;\r\n const d1 = 2.75;\r\n if (x < 1 / d1) return n1 * x * x;\r\n if (x < 2 / d1) return n1 * (x -= 1.5 / d1) * x + 0.75;\r\n if (x < 2.5 / d1) return n1 * (x -= 2.25 / d1) * x + 0.9375;\r\n return n1 * (x -= 2.625 / d1) * x + 0.984375;\r\n };\r\n return 1 - bounceOut(1 - t);\r\n },\r\n};\r\n\r\n/** A key-ready description of a standard ease: its direction, family and every tuning value. */\r\nconst describeConfig = (direction: 'in' | 'out' | 'inOut', config: ResolvedConfig): string =>\r\n `${direction}:${config.type}:${config.overshoot ?? '_'}:${config.amplitude ?? '_'}:${config.period ?? '_'}`;\r\n\r\nexport const linear = (): EasingFunction => describeEase((t) => clamp01(t), 'lin');\r\n\r\nexport const easeIn = (params?: EaseParams): EasingFunction => {\r\n const config = parseConfig(params);\r\n return describeEase((t) => inMath[config.type](clamp01(t), config), describeConfig('in', config));\r\n};\r\n\r\nexport const easeOut = (params?: EaseParams): EasingFunction => {\r\n const config = parseConfig(params);\r\n return describeEase((t) => 1 - inMath[config.type](1 - clamp01(t), config), describeConfig('out', config));\r\n};\r\n\r\nexport const easeInOut = (params?: EaseParams): EasingFunction => {\r\n const config = parseConfig(params);\r\n // 'back' and 'elastic' need different default tuning at the midpoint than\r\n // their easeIn/easeOut counterparts (the classic Penner in-out variants\r\n // scale overshoot and default period differently), so resolve those here\r\n // rather than reusing the easeIn/easeOut defaults verbatim.\r\n const inOutConfig: ResolvedConfig = config.type === 'back'\r\n ? { ...config, overshoot: (config.overshoot ?? 1.70158) * 1.525 }\r\n : config.type === 'elastic'\r\n ? { ...config, period: config.period ?? 0.45 }\r\n : config;\r\n return describeEase((t) => {\r\n t = clamp01(t);\r\n return t < 0.5\r\n ? inMath[inOutConfig.type](2 * t, inOutConfig) / 2\r\n : 1 - inMath[inOutConfig.type](2 * (1 - t), inOutConfig) / 2;\r\n }, describeConfig('inOut', config));\r\n};\r\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/tween/ease/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAM1C,4DAA4D;AAC5D,MAAM,CAAC,MAAM,YAAY,GAAiB,MAAM,CAAC;AAejD,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;AAInB,MAAM,WAAW,GAAG,CAAC,MAAmB,EAAkB,EAAE;IACxD,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,EAAE,IAAI,EAAE,YAAY,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AAM,CAAC,EAAE,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;AAC/G,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,MAAmB,EAAkB,EAAE;IAC7D,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IACnC,0EAA0E;IAC1E,wEAAwE;IACxE,yEAAyE;IACzE,4DAA4D;IAC5D,MAAM,WAAW,GAAmB,MAAM,CAAC,IAAI,KAAK,MAAM;QACtD,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,SAAS,EAAE,CAAC,MAAM,CAAC,SAAS,IAAI,OAAO,CAAC,GAAG,KAAK,EAAE;QACjE,CAAC,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS;YACvB,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,IAAI,EAAE;YAC9C,CAAC,CAAC,MAAM,CAAC;IACjB,OAAO,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE;QACtB,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QACf,OAAO,CAAC,GAAG,GAAG;YACV,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC;YAClD,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;IACrE,CAAC,EAAE,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;AACxC,CAAC,CAAC","sourcesContent":["import { clamp01 } from \"@/util/clamp\";\nimport { EasingFunction } from \"./type\";\nimport { describeEase } from \"./describe\";\n\nexport type StandardEase =\n | 'sine' | 'quad' | 'cubic' | 'quart' | 'quint'\n | 'expo' | 'circ' | 'back' | 'elastic' | 'bounce';\n\n/** Default ease family used when no `type` is specified. */\nexport const DEFAULT_EASE: StandardEase = 'quad';\n\nexport interface EaseConfig {\n /** Standard ease family (default: 'quad'). */\n type?: StandardEase;\n /** Used by 'back' (default: 1.70158). */\n overshoot?: number;\n /** Used by 'elastic' (default: 1). */\n amplitude?: number;\n /** Used by 'elastic' (default: 0.3). */\n period?: number;\n}\n\nexport type EaseParams = StandardEase | EaseConfig;\n\nconst PI = Math.PI;\n\ntype ResolvedConfig = EaseConfig & { type: StandardEase };\n\nconst parseConfig = (params?: EaseParams): ResolvedConfig => {\n if (params === undefined) return { type: DEFAULT_EASE };\n if (typeof params === 'string') return { type: params };\n return { ...params, type: params.type ?? DEFAULT_EASE };\n};\n\n// \"Ease in\" curve for each standard family, parameterized by an EaseConfig.\n// easeOut/easeInOut are derived from this via reflection, matching the\n// classic Penner construction.\nconst inMath: Record<StandardEase, (t: number, config: EaseConfig) => number> = {\n sine: (t) => 1 - Math.cos((t * PI) / 2),\n quad: (t) => t * t,\n cubic: (t) => t * t * t,\n quart: (t) => t * t * t * t,\n quint: (t) => t * t * t * t * t,\n expo: (t) => (t === 0 ? 0 : Math.pow(2, 10 * (t - 1))),\n circ: (t) => 1 - Math.sqrt(1 - t * t),\n back: (t, config) => {\n const s = config.overshoot ?? 1.70158;\n return t * t * ((s + 1) * t - s);\n },\n elastic: (t, config) => {\n if (t === 0 || t === 1) return t;\n const a = config.amplitude ?? 1;\n const p = config.period ?? 0.3;\n const s = (p / (2 * PI)) * Math.asin(1 / a);\n return -(a * Math.pow(2, 10 * (t - 1)) * Math.sin(((t - 1 - s) * 2 * PI) / p));\n },\n bounce: (t) => {\n const bounceOut = (x: number) => {\n const n1 = 7.5625;\n const d1 = 2.75;\n if (x < 1 / d1) return n1 * x * x;\n if (x < 2 / d1) return n1 * (x -= 1.5 / d1) * x + 0.75;\n if (x < 2.5 / d1) return n1 * (x -= 2.25 / d1) * x + 0.9375;\n return n1 * (x -= 2.625 / d1) * x + 0.984375;\n };\n return 1 - bounceOut(1 - t);\n },\n};\n\n/** A key-ready description of a standard ease: its direction, family and every tuning value. */\nconst describeConfig = (direction: 'in' | 'out' | 'inOut', config: ResolvedConfig): string =>\n `${direction}:${config.type}:${config.overshoot ?? '_'}:${config.amplitude ?? '_'}:${config.period ?? '_'}`;\n\nexport const linear = (): EasingFunction => describeEase((t) => clamp01(t), 'lin');\n\nexport const easeIn = (params?: EaseParams): EasingFunction => {\n const config = parseConfig(params);\n return describeEase((t) => inMath[config.type](clamp01(t), config), describeConfig('in', config));\n};\n\nexport const easeOut = (params?: EaseParams): EasingFunction => {\n const config = parseConfig(params);\n return describeEase((t) => 1 - inMath[config.type](1 - clamp01(t), config), describeConfig('out', config));\n};\n\nexport const easeInOut = (params?: EaseParams): EasingFunction => {\n const config = parseConfig(params);\n // 'back' and 'elastic' need different default tuning at the midpoint than\n // their easeIn/easeOut counterparts (the classic Penner in-out variants\n // scale overshoot and default period differently), so resolve those here\n // rather than reusing the easeIn/easeOut defaults verbatim.\n const inOutConfig: ResolvedConfig = config.type === 'back'\n ? { ...config, overshoot: (config.overshoot ?? 1.70158) * 1.525 }\n : config.type === 'elastic'\n ? { ...config, period: config.period ?? 0.45 }\n : config;\n return describeEase((t) => {\n t = clamp01(t);\n return t < 0.5\n ? inMath[inOutConfig.type](2 * t, inOutConfig) / 2\n : 1 - inMath[inOutConfig.type](2 * (1 - t), inOutConfig) / 2;\n }, describeConfig('inOut', config));\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"curve.js","sourceRoot":"","sources":["../../../src/tween/ease/curve.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAsC1C,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW,EAAU,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;AAEvG,g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C,MAAM,CAAC,CAAC;IACvC,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IAEhE,OAAO,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE;QACtB,IAAI,CAAC,IAAI,CAAC;YAAE,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACpC,MAAM,IAAI,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC3C,IAAI,CAAC,IAAI,CAAC;YAAE,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;QAE7B,IAAI,OAAO,GAAG,IAAI,CAAC;QACnB,KAAK,MAAM,SAAS,IAAI,QAAQ,EAAE,CAAC;YAC/B,IAAI,CAAC,IAAI,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;gBACtB,OAAO,GAAG,SAAS,CAAC;gBACpB,MAAM;YACV,CAAC;QACL,CAAC;QACD,MAAM,CAAC,GAAG,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QACpC,OAAO,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC7E,CAAC,EAAE,SAAS,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["import type { EasingFunction } from \"./type\";\r\nimport { describeEase } from \"./describe\";\r\n\r\n/**\r\n * A hand-drawn timing function: a chain of cubic Bézier segments from (0, 0)\r\n * to (1, 1), where x is progress through the duration and y how far along the\r\n * animation is. This is what an `EaseSpec` of `kind: \"custom\"` carries inline\r\n * in its `args`, so a drawn curve travels with the document rather than\r\n * needing a host to register a function under a key. Two things keep the\r\n * drawing a function of x, and both are enforced here rather than trusted: a\r\n * control point is clamped into its own segment's x span, and an absent handle\r\n * resolves to the Catmull-Rom tangent. y is deliberately not clamped to [0, 1]\r\n * — overshooting the target and settling back is a real move.\r\n */\r\n\r\n/** A point in curve space, or a handle offset within it. */\r\nexport interface CurveVector {\r\n x: number;\r\n y: number;\r\n}\r\n\r\n/** One control point of a custom easing curve. */\r\nexport interface CurvePoint {\r\n x: number;\r\n y: number;\r\n /** The handle steering the segment leaving this point. Absent = auto. */\r\n out?: CurveVector;\r\n /** The handle steering the segment arriving at it. Absent = auto. */\r\n in?: CurveVector;\r\n}\r\n\r\n/** One cubic Bézier segment of the curve, in absolute curve space. */\r\nexport interface EaseCurveSegment {\r\n p0: CurveVector;\r\n c1: CurveVector;\r\n c2: CurveVector;\r\n p3: CurveVector;\r\n}\r\n\r\nconst clamp = (value: number, min: number, max: number): number => Math.min(max, Math.max(min, value));\r\n\r\n/** The curve as Bézier segments, every auto handle and every clamp resolved. */\r\nexport function curveSegments(points: readonly CurvePoint[]): EaseCurveSegment[] {\r\n const segments: EaseCurveSegment[] = [];\r\n for (let i = 0; i < points.length - 1; i++) {\r\n const p0 = points[i];\r\n const p3 = points[i + 1];\r\n const before = points[i - 1] ?? p0;\r\n const after = points[i + 2] ?? p3;\r\n\r\n const c1 = p0.out\r\n ? { x: p0.x + p0.out.x, y: p0.y + p0.out.y }\r\n : { x: p0.x + (p3.x - before.x) / 6, y: p0.y + (p3.y - before.y) / 6 };\r\n const c2 = p3.in\r\n ? { x: p3.x + p3.in.x, y: p3.y + p3.in.y }\r\n : { x: p3.x - (after.x - p0.x) / 6, y: p3.y - (after.y - p0.y) / 6 };\r\n\r\n segments.push({\r\n p0: { x: p0.x, y: p0.y },\r\n c1: { x: clamp(c1.x, p0.x, p3.x), y: c1.y },\r\n c2: { x: clamp(c2.x, p0.x, p3.x), y: c2.y },\r\n p3: { x: p3.x, y: p3.y },\r\n });\r\n }\r\n return segments;\r\n}\r\n\r\n/** A cubic Bézier evaluated on one axis. */\r\nfunction bezier(a: number, b: number, c: number, d: number, t: number): number {\r\n const mt = 1 - t;\r\n return mt * mt * mt * a + 3 * mt * mt * t * b + 3 * mt * t * t * c + t * t * t * d;\r\n}\r\n\r\n/**\r\n * The curve parameter at which a segment reaches `x`. Bisection rather than\r\n * Newton: x is monotonic along the segment, so halving converges, where Newton\r\n * needs a derivative that goes to zero exactly at the flat ends an ease-in-out\r\n * is made of.\r\n */\r\nexport function curveSegmentT(segment: EaseCurveSegment, x: number): number {\r\n let low = 0;\r\n let high = 1;\r\n for (let i = 0; i < 30; i++) {\r\n const mid = (low + high) / 2;\r\n const at = bezier(segment.p0.x, segment.c1.x, segment.c2.x, segment.p3.x, mid);\r\n if (at < x) low = mid;\r\n else high = mid;\r\n }\r\n return (low + high) / 2;\r\n}\r\n\r\n/** Whether `value` is a drawable curve: two or more finite points. */\r\nexport function isEaseCurve(value: unknown): value is CurvePoint[] {\r\n return Array.isArray(value) && value.length >= 2 && value.every(isFinitePoint);\r\n}\r\n\r\nfunction isFinitePoint(value: unknown): value is CurveVector {\r\n if (typeof value !== \"object\" || value === null) return false;\r\n const { x, y } = value as Partial<CurveVector>;\r\n return typeof x === \"number\" && Number.isFinite(x) && typeof y === \"number\" && Number.isFinite(y);\r\n}\r\n\r\n/** The easing a curve runs as: progress in, eased progress out. */\r\nexport function curveEase(points: readonly CurvePoint[]): EasingFunction {\r\n const segments = curveSegments(points);\r\n if (segments.length === 0) return describeEase((x) => x, 'lin');\r\n\r\n return describeEase((x) => {\r\n if (x <= 0) return segments[0].p0.y;\r\n const last = segments[segments.length - 1];\r\n if (x >= 1) return last.p3.y;\r\n\r\n let segment = last;\r\n for (const candidate of segments) {\r\n if (x <= candidate.p3.x) {\r\n segment = candidate;\r\n break;\r\n }\r\n }\r\n const t = curveSegmentT(segment, x);\r\n return bezier(segment.p0.y, segment.c1.y, segment.c2.y, segment.p3.y, t);\r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EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC7E,CAAC,EAAE,SAAS,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["import type { EasingFunction } from \"./type\";\nimport { describeEase } from \"./describe\";\n\n/**\n * A hand-drawn timing function: a chain of cubic Bézier segments from (0, 0)\n * to (1, 1), where x is progress through the duration and y how far along the\n * animation is. This is what an `EaseSpec` of `kind: \"custom\"` carries inline\n * in its `args`, so a drawn curve travels with the document rather than\n * needing a host to register a function under a key. Two things keep the\n * drawing a function of x, and both are enforced here rather than trusted: a\n * control point is clamped into its own segment's x span, and an absent handle\n * resolves to the Catmull-Rom tangent. y is deliberately not clamped to [0, 1]\n * — overshooting the target and settling back is a real move.\n */\n\n/** A point in curve space, or a handle offset within it. */\nexport interface CurveVector {\n x: number;\n y: number;\n}\n\n/** One control point of a custom easing curve. */\nexport interface CurvePoint {\n x: number;\n y: number;\n /** The handle steering the segment leaving this point. Absent = auto. */\n out?: CurveVector;\n /** The handle steering the segment arriving at it. Absent = auto. */\n in?: CurveVector;\n}\n\n/** One cubic Bézier segment of the curve, in absolute curve space. */\nexport interface EaseCurveSegment {\n p0: CurveVector;\n c1: CurveVector;\n c2: CurveVector;\n p3: CurveVector;\n}\n\nconst clamp = (value: number, min: number, max: number): number => Math.min(max, Math.max(min, value));\n\n/** The curve as Bézier segments, every auto handle and every clamp resolved. */\nexport function curveSegments(points: readonly CurvePoint[]): EaseCurveSegment[] {\n const segments: EaseCurveSegment[] = [];\n for (let i = 0; i < points.length - 1; i++) {\n const p0 = points[i];\n const p3 = points[i + 1];\n const before = points[i - 1] ?? p0;\n const after = points[i + 2] ?? p3;\n\n const c1 = p0.out\n ? { x: p0.x + p0.out.x, y: p0.y + p0.out.y }\n : { x: p0.x + (p3.x - before.x) / 6, y: p0.y + (p3.y - before.y) / 6 };\n const c2 = p3.in\n ? { x: p3.x + p3.in.x, y: p3.y + p3.in.y }\n : { x: p3.x - (after.x - p0.x) / 6, y: p3.y - (after.y - p0.y) / 6 };\n\n segments.push({\n p0: { x: p0.x, y: p0.y },\n c1: { x: clamp(c1.x, p0.x, p3.x), y: c1.y },\n c2: { x: clamp(c2.x, p0.x, p3.x), y: c2.y },\n p3: { x: p3.x, y: p3.y },\n });\n }\n return segments;\n}\n\n/** A cubic Bézier evaluated on one axis. */\nfunction bezier(a: number, b: number, c: number, d: number, t: number): number {\n const mt = 1 - t;\n return mt * mt * mt * a + 3 * mt * mt * t * b + 3 * mt * t * t * c + t * t * t * d;\n}\n\n/**\n * The curve parameter at which a segment reaches `x`. Bisection rather than\n * Newton: x is monotonic along the segment, so halving converges, where Newton\n * needs a derivative that goes to zero exactly at the flat ends an ease-in-out\n * is made of.\n */\nexport function curveSegmentT(segment: EaseCurveSegment, x: number): number {\n let low = 0;\n let high = 1;\n for (let i = 0; i < 30; i++) {\n const mid = (low + high) / 2;\n const at = bezier(segment.p0.x, segment.c1.x, segment.c2.x, segment.p3.x, mid);\n if (at < x) low = mid;\n else high = mid;\n }\n return (low + high) / 2;\n}\n\n/** Whether `value` is a drawable curve: two or more finite points. */\nexport function isEaseCurve(value: unknown): value is CurvePoint[] {\n return Array.isArray(value) && value.length >= 2 && value.every(isFinitePoint);\n}\n\nfunction isFinitePoint(value: unknown): value is CurveVector {\n if (typeof value !== \"object\" || value === null) return false;\n const { x, y } = value as Partial<CurveVector>;\n return typeof x === \"number\" && Number.isFinite(x) && typeof y === \"number\" && Number.isFinite(y);\n}\n\n/** The easing a curve runs as: progress in, eased progress out. */\nexport function curveEase(points: readonly CurvePoint[]): EasingFunction {\n const segments = curveSegments(points);\n if (segments.length === 0) return describeEase((x) => x, 'lin');\n\n return describeEase((x) => {\n if (x <= 0) return segments[0].p0.y;\n const last = segments[segments.length - 1];\n if (x >= 1) return last.p3.y;\n\n let segment = last;\n for (const candidate of segments) {\n if (x <= candidate.p3.x) {\n segment = candidate;\n break;\n }\n }\n const t = curveSegmentT(segment, x);\n return bezier(segment.p0.y, segment.c1.y, segment.c2.y, segment.p3.y, t);\n }, `curve:${JSON.stringify(points)}`);\n}\n"]}
@@ -1,6 +1,8 @@
1
1
  import type { EasingFunction } from "./type.js";
2
2
  /** Record what `ease` is, and hand it back. @internal */
3
3
  export declare function describeEase<F extends EasingFunction>(ease: F, description: string): F;
4
+ /** What an engine-built ease was recorded as, or `undefined` for any other function. @internal */
5
+ export declare function easeDescription(ease: EasingFunction): string | undefined;
4
6
  /**
5
7
  * A string that is equal for two easings exactly when they are the same ease.
6
8
  *
@@ -1 +1 @@
1
- {"version":3,"file":"describe.d.ts","sourceRoot":"","sources":["../../../src/tween/ease/describe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAa7C,yDAAyD;AACzD,wBAAgB,YAAY,CAAC,CAAC,SAAS,cAAc,EAAE,IAAI,EAAE,CAAC,EAAE,WAAW,EAAE,MAAM,GAAG,CAAC,CAGtF;AAED;;;;;;;;;GASG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CASpD"}
1
+ {"version":3,"file":"describe.d.ts","sourceRoot":"","sources":["../../../src/tween/ease/describe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAa7C,yDAAyD;AACzD,wBAAgB,YAAY,CAAC,CAAC,SAAS,cAAc,EAAE,IAAI,EAAE,CAAC,EAAE,WAAW,EAAE,MAAM,GAAG,CAAC,CAGtF;AAED,kGAAkG;AAClG,wBAAgB,eAAe,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS,CAExE;AAED;;;;;;;;;GASG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CASpD"}
@@ -13,6 +13,10 @@ export function describeEase(ease, description) {
13
13
  descriptions.set(ease, description);
14
14
  return ease;
15
15
  }
16
+ /** What an engine-built ease was recorded as, or `undefined` for any other function. @internal */
17
+ export function easeDescription(ease) {
18
+ return descriptions.get(ease);
19
+ }
16
20
  /**
17
21
  * A string that is equal for two easings exactly when they are the same ease.
18
22
  *
@@ -1 +1 @@
1
- {"version":3,"file":"describe.js","sourceRoot":"","sources":["../../../src/tween/ease/describe.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,YAAY,GAAG,IAAI,OAAO,EAA0B,CAAC;AAC3D,MAAM,UAAU,GAAG,IAAI,OAAO,EAA0B,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,CAAC;AAExB,yDAAyD;AACzD,MAAM,UAAU,YAAY,CAA2B,IAAO,EAAE,WAAmB;IAC/E,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IACpC,OAAO,IAAI,CAAC;AAChB,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,OAAO,CAAC,IAAoB;IACxC,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACzC,IAAI,SAAS,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC9C,IAAI,EAAE,GAAG,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC9B,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;QACnB,EAAE,GAAG,MAAM,eAAe,EAAE,EAAE,CAAC;QAC/B,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC7B,CAAC;IACD,OAAO,EAAE,CAAC;AACd,CAAC","sourcesContent":["import type { EasingFunction } from \"./type\";\r\n\r\n/**\r\n * Descriptions of engine-built easings, by function.\r\n *\r\n * Every engine easing is an anonymous closure, so `fn.name` is `\"\"` and cannot\r\n * tell two of them apart. A constructor that knows what it built records a short,\r\n * deterministic description here, which is what a cache key can be built from.\r\n */\r\nconst descriptions = new WeakMap<EasingFunction, string>();\r\nconst identities = new WeakMap<EasingFunction, string>();\r\nlet identityCounter = 0;\r\n\r\n/** Record what `ease` is, and hand it back. @internal */\r\nexport function describeEase<F extends EasingFunction>(ease: F, description: string): F {\r\n descriptions.set(ease, description);\r\n return ease;\r\n}\r\n\r\n/**\r\n * A string that is equal for two easings exactly when they are the same ease.\r\n *\r\n * An engine easing keys by its description, so building the same one twice (a\r\n * document rebuilt from the same row) gives the same key. A function the engine\r\n * did not build keys by its own identity: a different function is always a\r\n * different key, which may over-report a change but never hides one.\r\n *\r\n * @internal\r\n */\r\nexport function easeKey(ease: EasingFunction): string {\r\n const described = descriptions.get(ease);\r\n if (described !== undefined) return described;\r\n let id = identities.get(ease);\r\n if (id === undefined) {\r\n id = `fn#${identityCounter++}`;\r\n identities.set(ease, id);\r\n }\r\n return id;\r\n}\r\n"]}
1
+ {"version":3,"file":"describe.js","sourceRoot":"","sources":["../../../src/tween/ease/describe.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,YAAY,GAAG,IAAI,OAAO,EAA0B,CAAC;AAC3D,MAAM,UAAU,GAAG,IAAI,OAAO,EAA0B,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,CAAC;AAExB,yDAAyD;AACzD,MAAM,UAAU,YAAY,CAA2B,IAAO,EAAE,WAAmB;IAC/E,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IACpC,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,kGAAkG;AAClG,MAAM,UAAU,eAAe,CAAC,IAAoB;IAChD,OAAO,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,OAAO,CAAC,IAAoB;IACxC,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACzC,IAAI,SAAS,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC9C,IAAI,EAAE,GAAG,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC9B,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;QACnB,EAAE,GAAG,MAAM,eAAe,EAAE,EAAE,CAAC;QAC/B,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC7B,CAAC;IACD,OAAO,EAAE,CAAC;AACd,CAAC","sourcesContent":["import type { EasingFunction } from \"./type\";\n\n/**\n * Descriptions of engine-built easings, by function.\n *\n * Every engine easing is an anonymous closure, so `fn.name` is `\"\"` and cannot\n * tell two of them apart. A constructor that knows what it built records a short,\n * deterministic description here, which is what a cache key can be built from.\n */\nconst descriptions = new WeakMap<EasingFunction, string>();\nconst identities = new WeakMap<EasingFunction, string>();\nlet identityCounter = 0;\n\n/** Record what `ease` is, and hand it back. @internal */\nexport function describeEase<F extends EasingFunction>(ease: F, description: string): F {\n descriptions.set(ease, description);\n return ease;\n}\n\n/** What an engine-built ease was recorded as, or `undefined` for any other function. @internal */\nexport function easeDescription(ease: EasingFunction): string | undefined {\n return descriptions.get(ease);\n}\n\n/**\n * A string that is equal for two easings exactly when they are the same ease.\n *\n * An engine easing keys by its description, so building the same one twice (a\n * document rebuilt from the same row) gives the same key. A function the engine\n * did not build keys by its own identity: a different function is always a\n * different key, which may over-report a change but never hides one.\n *\n * @internal\n */\nexport function easeKey(ease: EasingFunction): string {\n const described = descriptions.get(ease);\n if (described !== undefined) return described;\n let id = identities.get(ease);\n if (id === undefined) {\n id = `fn#${identityCounter++}`;\n identities.set(ease, id);\n }\n return id;\n}\n"]}
@@ -0,0 +1,31 @@
1
+ import { type EaseParams } from "./constants.js";
2
+ import { type CurvePoint } from "./curve.js";
3
+ import type { EasingFunction } from "./type.js";
4
+ /**
5
+ * How something eases, as data.
6
+ *
7
+ * Mirrors the `linear`/`easeIn`/`easeOut`/`easeInOut` families in
8
+ * `tween/ease/constants.ts` — `kind` picks the direction, `args` picks the
9
+ * family and its knobs.
10
+ *
11
+ * `kind: "custom"` takes a drawn curve in `args`, or the key a host passed to
12
+ * `Registry.addEase`/`RegistryOptions.eases` for an ease no standard family
13
+ * expresses.
14
+ */
15
+ export interface EaseSpec {
16
+ kind: "linear" | "in" | "out" | "inOut" | "custom";
17
+ /**
18
+ * Family and its parameters (`"quad"`, or `{ type: "back", overshoot: 2 }`)
19
+ * for every `kind` but `"custom"`, whose `args` is instead the drawn curve
20
+ * itself — a {@link CurvePoint} chain from (0, 0) to (1, 1), so the timing
21
+ * travels with the document — or the `Registry.addEase` key of a function
22
+ * the host registered.
23
+ */
24
+ args?: EaseParams | CurvePoint[] | string;
25
+ }
26
+ export declare const EASE_KINDS: ReadonlySet<string>;
27
+ /** The function `spec` runs as. A registry key resolves through `lookup`, and throws without one. */
28
+ export declare function easeOfSpec(spec: EaseSpec, lookup?: (key: string) => EasingFunction | undefined, known?: () => readonly string[]): EasingFunction;
29
+ /** The spec an engine-built ease was made from, or `undefined` for a function the engine did not build. */
30
+ export declare function specOfEase(ease: EasingFunction): EaseSpec | undefined;
31
+ //# sourceMappingURL=spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spec.d.ts","sourceRoot":"","sources":["../../../src/tween/ease/spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,UAAU,EAAqB,MAAM,aAAa,CAAC;AACrG,OAAO,EAA0B,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAElE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAE7C;;;;;;;;;;GAUG;AACH,MAAM,WAAW,QAAQ;IACrB,IAAI,EAAE,QAAQ,GAAG,IAAI,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;IACnD;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,UAAU,GAAG,UAAU,EAAE,GAAG,MAAM,CAAC;CAC7C;AAED,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC,MAAM,CAAyE,CAAC;AAErH,qGAAqG;AACrG,wBAAgB,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,cAAc,GAAG,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,SAAS,MAAM,EAAE,GAAG,cAAc,CAsBhJ;AAID,2GAA2G;AAC3G,wBAAgB,UAAU,CAAC,IAAI,EAAE,cAAc,GAAG,QAAQ,GAAG,SAAS,CAarE"}
@@ -0,0 +1,51 @@
1
+ import { easeIn, easeInOut, easeOut, linear } from "./constants.js";
2
+ import { curveEase, isEaseCurve } from "./curve.js";
3
+ import { easeDescription } from "./describe.js";
4
+ export const EASE_KINDS = new Set(["linear", "in", "out", "inOut", "custom"]);
5
+ /** The function `spec` runs as. A registry key resolves through `lookup`, and throws without one. */
6
+ export function easeOfSpec(spec, lookup, known) {
7
+ switch (spec.kind) {
8
+ case "linear": return linear();
9
+ case "in": return easeIn(spec.args);
10
+ case "out": return easeOut(spec.args);
11
+ case "inOut": return easeInOut(spec.args);
12
+ case "custom": {
13
+ const key = spec.args;
14
+ if (isEaseCurve(key))
15
+ return curveEase(key);
16
+ if (typeof key !== "string") {
17
+ throw new Error(`A "custom" ease needs a curve or its Registry.addEase key in \`args\` (got ${JSON.stringify(spec.args)}).`);
18
+ }
19
+ const fn = lookup?.(key);
20
+ if (!fn) {
21
+ const registered = known?.().join(", ") || "none";
22
+ throw new Error(lookup
23
+ ? `No ease registered under "${key}". Registered: ${registered}.`
24
+ : `The ease "${key}" names a Registry entry, which nothing here can resolve; use a standard ease or a drawn curve.`);
25
+ }
26
+ return fn;
27
+ }
28
+ }
29
+ }
30
+ const STANDARD = new Set(["sine", "quad", "cubic", "quart", "quint", "expo", "circ", "back", "elastic", "bounce"]);
31
+ /** The spec an engine-built ease was made from, or `undefined` for a function the engine did not build. */
32
+ export function specOfEase(ease) {
33
+ const description = easeDescription(ease);
34
+ if (description === undefined)
35
+ return undefined;
36
+ if (description === "lin")
37
+ return { kind: "linear" };
38
+ if (description.startsWith("curve:"))
39
+ return { kind: "custom", args: JSON.parse(description.slice(6)) };
40
+ const [direction, type, overshoot, amplitude, period] = description.split(":");
41
+ if ((direction !== "in" && direction !== "out" && direction !== "inOut") || !STANDARD.has(type))
42
+ return undefined;
43
+ const tuning = { overshoot, amplitude, period };
44
+ const config = { type };
45
+ for (const [name, value] of Object.entries(tuning)) {
46
+ if (value !== undefined && value !== "_")
47
+ config[name] = Number(value);
48
+ }
49
+ return { kind: direction, args: Object.keys(config).length === 1 ? type : config };
50
+ }
51
+ //# sourceMappingURL=spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spec.js","sourceRoot":"","sources":["../../../src/tween/ease/spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAsC,MAAM,aAAa,CAAC;AACrG,OAAO,EAAE,SAAS,EAAE,WAAW,EAAmB,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AA0B7C,MAAM,CAAC,MAAM,UAAU,GAAwB,IAAI,GAAG,CAAmB,CAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;AAErH,qGAAqG;AACrG,MAAM,UAAU,UAAU,CAAC,IAAc,EAAE,MAAoD,EAAE,KAA+B;IAC5H,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QAChB,KAAK,QAAQ,CAAC,CAAC,OAAO,MAAM,EAAE,CAAC;QAC/B,KAAK,IAAI,CAAC,CAAC,OAAO,MAAM,CAAC,IAAI,CAAC,IAA8B,CAAC,CAAC;QAC9D,KAAK,KAAK,CAAC,CAAC,OAAO,OAAO,CAAC,IAAI,CAAC,IAA8B,CAAC,CAAC;QAChE,KAAK,OAAO,CAAC,CAAC,OAAO,SAAS,CAAC,IAAI,CAAC,IAA8B,CAAC,CAAC;QACpE,KAAK,QAAQ,CAAC,CAAC,CAAC;YACZ,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI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C,CAAC,CAAC,CAAiB,EAAE,CAAC;IACxH,MAAM,CAAC,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC/E,IAAI,CAAC,SAAS,KAAK,IAAI,IAAI,SAAS,KAAK,KAAK,IAAI,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC;QAAE,OAAO,SAAS,CAAC;IAClH,MAAM,MAAM,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;IAChD,MAAM,MAAM,GAA4B,EAAE,IAAI,EAAE,CAAC;IACjD,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACjD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,GAAG;YAAE,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC3E,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAE,IAAqB,CAAC,CAAC,CAAE,MAAqB,EAAE,CAAC;AACzH,CAAC","sourcesContent":["import { easeIn, easeInOut, easeOut, linear, type EaseParams, type StandardEase } from \"./constants\";\nimport { curveEase, isEaseCurve, type CurvePoint } from \"./curve\";\nimport { easeDescription } from \"./describe\";\nimport type { EasingFunction } from \"./type\";\n\n/**\n * How something eases, as data.\n *\n * Mirrors the `linear`/`easeIn`/`easeOut`/`easeInOut` families in\n * `tween/ease/constants.ts` — `kind` picks the direction, `args` picks the\n * family and its knobs.\n *\n * `kind: \"custom\"` takes a drawn curve in `args`, or the key a host passed to\n * `Registry.addEase`/`RegistryOptions.eases` for an ease no standard family\n * expresses.\n */\nexport interface EaseSpec {\n kind: \"linear\" | \"in\" | \"out\" | \"inOut\" | \"custom\";\n /**\n * Family and its parameters (`\"quad\"`, or `{ type: \"back\", overshoot: 2 }`)\n * for every `kind` but `\"custom\"`, whose `args` is instead the drawn curve\n * itself — a {@link CurvePoint} chain from (0, 0) to (1, 1), so the timing\n * travels with the document — or the `Registry.addEase` key of a function\n * the host registered.\n */\n args?: EaseParams | CurvePoint[] | string;\n}\n\nexport const EASE_KINDS: ReadonlySet<string> = new Set<EaseSpec[\"kind\"]>([\"linear\", \"in\", \"out\", \"inOut\", \"custom\"]);\n\n/** The function `spec` runs as. A registry key resolves through `lookup`, and throws without one. */\nexport function easeOfSpec(spec: EaseSpec, lookup?: (key: string) => EasingFunction | undefined, known?: () => readonly string[]): EasingFunction {\n switch (spec.kind) {\n case \"linear\": return linear();\n case \"in\": return easeIn(spec.args as EaseParams | undefined);\n case \"out\": return easeOut(spec.args as EaseParams | undefined);\n case \"inOut\": return easeInOut(spec.args as EaseParams | undefined);\n case \"custom\": {\n const key = spec.args;\n if (isEaseCurve(key)) return curveEase(key);\n if (typeof key !== \"string\") {\n throw new Error(`A \"custom\" ease needs a curve or its Registry.addEase key in \\`args\\` (got ${JSON.stringify(spec.args)}).`);\n }\n const fn = lookup?.(key);\n if (!fn) {\n const registered = known?.().join(\", \") || \"none\";\n throw new Error(lookup\n ? `No ease registered under \"${key}\". Registered: ${registered}.`\n : `The ease \"${key}\" names a Registry entry, which nothing here can resolve; use a standard ease or a drawn curve.`);\n }\n return fn;\n }\n }\n}\n\nconst STANDARD: ReadonlySet<string> = new Set<StandardEase>([\"sine\", \"quad\", \"cubic\", \"quart\", \"quint\", \"expo\", \"circ\", \"back\", \"elastic\", \"bounce\"]);\n\n/** The spec an engine-built ease was made from, or `undefined` for a function the engine did not build. */\nexport function specOfEase(ease: EasingFunction): EaseSpec | undefined {\n const description = easeDescription(ease);\n if (description === undefined) return undefined;\n if (description === \"lin\") return { kind: \"linear\" };\n if (description.startsWith(\"curve:\")) return { kind: \"custom\", args: JSON.parse(description.slice(6)) as CurvePoint[] };\n const [direction, type, overshoot, amplitude, period] = description.split(\":\");\n if ((direction !== \"in\" && direction !== \"out\" && direction !== \"inOut\") || !STANDARD.has(type)) return undefined;\n const tuning = { overshoot, amplitude, period };\n const config: Record<string, unknown> = { type };\n for (const [name, value] of Object.entries(tuning)) {\n if (value !== undefined && value !== \"_\") config[name] = Number(value);\n }\n return { kind: direction, args: Object.keys(config).length === 1 ? (type as StandardEase) : (config as EaseParams) };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"type.js","sourceRoot":"","sources":["../../../src/tween/ease/type.ts"],"names":[],"mappings":"","sourcesContent":["export type EasingFunction = (t: number) => number;\r\n\r\n"]}
1
+ {"version":3,"file":"type.js","sourceRoot":"","sources":["../../../src/tween/ease/type.ts"],"names":[],"mappings":"","sourcesContent":["export type EasingFunction = (t: number) => number;\n\n"]}
@@ -9,4 +9,5 @@ export type { CommandArg, CommandArgDescriptor, CommandMeta, CommandOptions } fr
9
9
  export * from './prepare.js';
10
10
  export * from './stepper.js';
11
11
  export * from './lerp.js';
12
+ export { easeOfSpec, specOfEase } from './ease/spec.js';
12
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tween/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAE7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACnE,YAAY,EAAE,UAAU,EAAE,oBAAoB,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAEzG,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tween/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAE7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACnE,YAAY,EAAE,UAAU,EAAE,oBAAoB,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAEzG,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC"}
@@ -8,4 +8,5 @@ export { COMMAND_META, getCommandMeta } from './command-decorator.js';
8
8
  export * from './prepare.js';
9
9
  export * from './stepper.js';
10
10
  export * from './lerp.js';
11
+ export { easeOfSpec, specOfEase } from './ease/spec.js';
11
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tween/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAE7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGnE,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC","sourcesContent":["export * from './ease/type';\r\nexport * from './ease/constants';\r\nexport * from './ease/curve';\r\n\r\nexport * from './to-command';\r\nexport * from './command';\r\nexport * from './loop';\r\nexport { COMMAND_META, getCommandMeta } from './command-decorator';\r\nexport type { CommandArg, CommandArgDescriptor, CommandMeta, CommandOptions } from './command-decorator';\r\n\r\nexport * from './prepare';\r\nexport * from './stepper';\r\nexport * from './lerp';\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tween/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAE7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGnE,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export * from './ease/type';\nexport * from './ease/constants';\nexport * from './ease/curve';\n\nexport * from './to-command';\nexport * from './command';\nexport * from './loop';\nexport { COMMAND_META, getCommandMeta } from './command-decorator';\nexport type { CommandArg, CommandArgDescriptor, CommandMeta, CommandOptions } from './command-decorator';\n\nexport * from './prepare';\nexport * from './stepper';\nexport * from './lerp';\nexport { easeOfSpec, specOfEase } from './ease/spec';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"inert.js","sourceRoot":"","sources":["../../src/tween/inert.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,YAAY,CAAI,MAAc,EAAE,QAAgB;IAC5D,KAAK,MAAM,CAAC;IACZ,OAAO;QACH,QAAQ;QACR,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAe;QAC5B,QAAQ,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC;KACzC,CAAC;AACN,CAAC;AAED,6FAA6F;AAC7F,MAAM,UAAU,YAAY,CAAC,QAAgB;IACzC,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,OAAO;QACH,IAAI,EAAE,CAAC,CAAS,EAAE,EAAE,GAAG,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC;QACrC,OAAO,EAAE,CAAC,EAAU,EAAW,EAAE;YAC7B,OAAO,IAAI,EAAE,CAAC;YACd,OAAO,OAAO,IAAI,QAAQ,CAAC;QAC/B,CAAC;KACJ,CAAC;AACN,CAAC","sourcesContent":["import { TweenStepper } from \"./stepper\";\r\nimport type { Command } from \"./command\";\r\n\r\n/**\r\n * An animation that occupies its duration and writes nothing.\r\n *\r\n * What a command on an **unmounted** node becomes. A node that is not in the\r\n * tree has no box, no surface and no timeline, so a tween on it has nothing to\r\n * be a tween *of* — but it still has a duration, and the timeline slot it was\r\n * placed in is entitled to have that duration pass. Returning a real command of\r\n * the right length keeps the scene's timing intact where throwing would abort\r\n * the pass and where returning nothing would silently shorten it.\r\n *\r\n * The failure this turns into a no-op is a real one — animating a node the\r\n * author forgot to `add` — and it reads as \"nothing moved\", which is what the\r\n * author sees on screen anyway.\r\n */\r\nexport function inertCommand<P>(target: object, duration: number): Command<P> {\r\n void target;\r\n return {\r\n duration,\r\n at: () => ({}) as Partial<P>,\r\n _stepper: () => inertStepper(duration),\r\n };\r\n}\r\n\r\n/** The {@link TweenStepper} half of {@link inertCommand}: runs its clock, writes nothing. */\r\nexport function inertStepper(duration: number): TweenStepper {\r\n let elapsed = 0;\r\n return {\r\n seek: (e: number) => { elapsed = e; },\r\n advance: (dt: number): boolean => {\r\n elapsed += dt;\r\n return elapsed >= duration;\r\n },\r\n };\r\n}\r\n"]}
1
+ {"version":3,"file":"inert.js","sourceRoot":"","sources":["../../src/tween/inert.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,YAAY,CAAI,MAAc,EAAE,QAAgB;IAC5D,KAAK,MAAM,CAAC;IACZ,OAAO;QACH,QAAQ;QACR,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAe;QAC5B,QAAQ,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC;KACzC,CAAC;AACN,CAAC;AAED,6FAA6F;AAC7F,MAAM,UAAU,YAAY,CAAC,QAAgB;IACzC,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,OAAO;QACH,IAAI,EAAE,CAAC,CAAS,EAAE,EAAE,GAAG,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC;QACrC,OAAO,EAAE,CAAC,EAAU,EAAW,EAAE;YAC7B,OAAO,IAAI,EAAE,CAAC;YACd,OAAO,OAAO,IAAI,QAAQ,CAAC;QAC/B,CAAC;KACJ,CAAC;AACN,CAAC","sourcesContent":["import { TweenStepper } from \"./stepper\";\nimport type { Command } from \"./command\";\n\n/**\n * An animation that occupies its duration and writes nothing.\n *\n * What a command on an **unmounted** node becomes. A node that is not in the\n * tree has no box, no surface and no timeline, so a tween on it has nothing to\n * be a tween *of* — but it still has a duration, and the timeline slot it was\n * placed in is entitled to have that duration pass. Returning a real command of\n * the right length keeps the scene's timing intact where throwing would abort\n * the pass and where returning nothing would silently shorten it.\n *\n * The failure this turns into a no-op is a real one — animating a node the\n * author forgot to `add` — and it reads as \"nothing moved\", which is what the\n * author sees on screen anyway.\n */\nexport function inertCommand<P>(target: object, duration: number): Command<P> {\n void target;\n return {\n duration,\n at: () => ({}) as Partial<P>,\n _stepper: () => inertStepper(duration),\n };\n}\n\n/** The {@link TweenStepper} half of {@link inertCommand}: runs its clock, writes nothing. */\nexport function inertStepper(duration: number): TweenStepper {\n let elapsed = 0;\n return {\n seek: (e: number) => { elapsed = e; },\n advance: (dt: number): boolean => {\n elapsed += dt;\n return elapsed >= duration;\n },\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"lerp.js","sourceRoot":"","sources":["../../src/tween/lerp.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,EAAU,EAAE,CAAS;IAC1D,OAAO,IAAI,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;AAClC,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY,EAAE,EAAU,EAAE,CAAS;IAC/D,MAAM,OAAO,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C,MAAM,KAAK,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACpC,MAAM,GAAG,GAAG,OAAO,GAAG,CAAC,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAC5C,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACnC,CAAC","sourcesContent":["import { EasingFunction } from \"./ease/type\";\r\n\r\n/**\r\n * Linearly interpolates between two numbers.\r\n *\r\n * @param from - Start value at `t = 0`.\r\n * @param to - End value at `t = 1`.\r\n * @param t - Normalized progress in [0, 1]. Values outside this range\r\n * extrapolate beyond the endpoints.\r\n * @returns The interpolated value: `from + (to - from) * t`.\r\n */\r\nexport function lerpNumber(from: number, to: number, t: number): number {\r\n return from + (to - from) * t;\r\n}\r\n\r\n/**\r\n * Interpolates a CSS-style perspective distance (viewer-to-plane, in px, where\r\n * `0` means \"no perspective\" — a parallel projection).\r\n *\r\n * Perspective enters the projection matrix as its reciprocal — a point at depth\r\n * `z` lands at `x / (1 - z/perspective)` — so `1/perspective` (not the raw\r\n * distance) is the quantity that varies smoothly with the visual strength of\r\n * the effect. Lerping the raw px value linearly sweeps through the small\r\n * positive numbers next to `0` on the way between \"off\" and any finite\r\n * distance, and `1/perspective` diverges there: a `0 → 800` tween would flash\r\n * through a wildly exaggerated, near-degenerate projection right at the start\r\n * before settling down to the mild depth `800` actually asks for. Lerping the\r\n * reciprocal instead — with `0` standing in for a reciprocal of `0`, matching\r\n * the renderer's own convention (see `isProjective`/`invP` in `matrix2d.ts`) —\r\n * keeps that quantity monotonic and bounded between the two endpoints, so the\r\n * effect builds or settles smoothly instead of spiking.\r\n */\r\nexport function lerpPerspective(from: number, to: number, t: number): number {\r\n const invFrom = from !== 0 ? 1 / from : 0;\r\n const invTo = to !== 0 ? 1 / to : 0;\r\n const inv = invFrom + (invTo - invFrom) * t;\r\n return inv !== 0 ? 1 / inv : 0;\r\n}\r\n\r\nexport type LerpFunction<T> = (from: T, to: T, t: number) => T;\r\nexport type TweenOptions<T> = { ease?: EasingFunction, lerp?: LerpFunction<T> };"]}
1
+ {"version":3,"file":"lerp.js","sourceRoot":"","sources":["../../src/tween/lerp.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,EAAU,EAAE,CAAS;IAC1D,OAAO,IAAI,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;AAClC,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY,EAAE,EAAU,EAAE,CAAS;IAC/D,MAAM,OAAO,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C,MAAM,KAAK,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACpC,MAAM,GAAG,GAAG,OAAO,GAAG,CAAC,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAC5C,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACnC,CAAC","sourcesContent":["import { EasingFunction } from \"./ease/type\";\n\n/**\n * Linearly interpolates between two numbers.\n *\n * @param from - Start value at `t = 0`.\n * @param to - End value at `t = 1`.\n * @param t - Normalized progress in [0, 1]. Values outside this range\n * extrapolate beyond the endpoints.\n * @returns The interpolated value: `from + (to - from) * t`.\n */\nexport function lerpNumber(from: number, to: number, t: number): number {\n return from + (to - from) * t;\n}\n\n/**\n * Interpolates a CSS-style perspective distance (viewer-to-plane, in px, where\n * `0` means \"no perspective\" — a parallel projection).\n *\n * Perspective enters the projection matrix as its reciprocal — a point at depth\n * `z` lands at `x / (1 - z/perspective)` — so `1/perspective` (not the raw\n * distance) is the quantity that varies smoothly with the visual strength of\n * the effect. Lerping the raw px value linearly sweeps through the small\n * positive numbers next to `0` on the way between \"off\" and any finite\n * distance, and `1/perspective` diverges there: a `0 → 800` tween would flash\n * through a wildly exaggerated, near-degenerate projection right at the start\n * before settling down to the mild depth `800` actually asks for. Lerping the\n * reciprocal instead — with `0` standing in for a reciprocal of `0`, matching\n * the renderer's own convention (see `isProjective`/`invP` in `matrix2d.ts`) —\n * keeps that quantity monotonic and bounded between the two endpoints, so the\n * effect builds or settles smoothly instead of spiking.\n */\nexport function lerpPerspective(from: number, to: number, t: number): number {\n const invFrom = from !== 0 ? 1 / from : 0;\n const invTo = to !== 0 ? 1 / to : 0;\n const inv = invFrom + (invTo - invFrom) * t;\n return inv !== 0 ? 1 / inv : 0;\n}\n\nexport type LerpFunction<T> = (from: T, to: T, t: number) => T;\nexport type TweenOptions<T> = { ease?: EasingFunction, lerp?: LerpFunction<T> };"]}
@@ -1 +1 @@
1
- {"version":3,"file":"loop.js","sourceRoot":"","sources":["../../src/tween/loop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AA6BvC,qFAAqF;AACrF,MAAM,UAAU,UAAU,CAAC,IAAc;IACrC,OAAO,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KA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,GAAG,CAAC,CAAC;QAC7B,KAAK,WAAW,CAAC,CAAC,OAAO,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACrD,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC;IACtB,CAAC;AACL,CAAC","sourcesContent":["/**\r\n * Repetition, as data: how many times a command runs and which way each pass\r\n * goes.\r\n *\r\n * A loop is a **placement** property, the same kind of thing as `at` and\r\n * `duration` — it says when the command is running, never what it does. That is\r\n * why it lives out here rather than in any one command's args: the wrapper goes\r\n * *around* a built `Command`, so `to`, `fillTo`, `countTo` and a custom\r\n * `command()` nobody has written yet all loop by the same code, with nothing to\r\n * forward and nothing to forget.\r\n *\r\n * And it stays seekable. A looped command is still a pure function of its own\r\n * normalized time — `at(t)` maps `t` onto a pass and asks the inner command for\r\n * that pass's frame — so scrubbing into the fourth repetition costs the same as\r\n * scrubbing into the first, which is the whole reason commands are values here.\r\n */\r\n\r\nimport { clamp01 } from \"@/util/clamp\";\r\n\r\n/**\r\n * Which way a pass runs.\r\n *\r\n * `alternate` is the reason this is three values rather than a boolean: a\r\n * bounce — out and back — is one command with two passes, not two commands whose\r\n * `at`s have to be kept in step by hand.\r\n */\r\nexport type LoopDirection = \"normal\" | \"reverse\" | \"alternate\";\r\n\r\n/**\r\n * How a command repeats. Absent on a command is \"runs once\".\r\n */\r\nexport interface LoopSpec {\r\n /** Absent is `\"normal\"`. */\r\n direction?: LoopDirection;\r\n /**\r\n * How many times to repeat **after** the first pass: `0` is no repeat (the\r\n * same as no loop at all), `3` plays four passes, and `null` repeats for as\r\n * long as there is clip left to fill.\r\n *\r\n * Repeats rather than total passes so that the value reads as what the word\r\n * says — \"repeat twice\" is `2` — and so that the no-op is `0` rather than a\r\n * `1` that looks like it should do something.\r\n */\r\n count: number | null;\r\n}\r\n\r\n/** Total passes: repeats plus the first one, or `Infinity` for an unlimited loop. */\r\nexport function loopPasses(loop: LoopSpec): number {\r\n return loop.count === null ? Infinity : Math.max(0, Math.floor(loop.count)) + 1;\r\n}\r\n\r\n/** Whether a loop changes anything: an unlimited one always does, a counted one only past zero. */\r\nexport function loopRepeats(loop: LoopSpec | undefined): loop is LoopSpec {\r\n return loop !== undefined && (loop.count === null || loop.count >= 1);\r\n}\r\n\r\n/**\r\n * Seconds a looped command occupies.\r\n *\r\n * `fill` is what an unlimited loop is given to cover — the clip's remaining time,\r\n * where a timeline places one. An unlimited loop does not *define* a length the\r\n * way a counted one does: a background that turns forever should fill the scene\r\n * it is in, not stretch it, so `documentDuration` counts one pass of it and this\r\n * stretches it to whatever that came to.\r\n */\r\nexport function loopSpan(loop: LoopSpec, duration: number, fill = duration): number {\r\n if (duration <= 0) return duration;\r\n if (loop.count === null) return Math.max(duration, fill);\r\n return duration * loopPasses(loop);\r\n}\r\n\r\n/**\r\n * Where in one pass `elapsed` lands, as normalized time for the inner command.\r\n *\r\n * Past the last pass of a counted loop it holds at that pass's end rather than\r\n * wrapping to the start — the same rule a finished command follows everywhere\r\n * else, and what keeps the value a loop leaves behind the value the next command\r\n * tweens from.\r\n */\r\nexport function loopPhase(loop: LoopSpec, elapsed: number, duration: number): number {\r\n if (duration <= 0) return 1;\r\n const passes = loopPasses(loop);\r\n const capped = Math.min(Math.max(elapsed, 0) / duration, passes);\r\n // `passes - 1` holds the final pass at its end instead of rolling over to a\r\n // pass that does not exist. `Infinity - 1` is still `Infinity`, so an\r\n // unlimited loop is never capped.\r\n const index = Math.min(Math.floor(capped), passes - 1);\r\n const t = clamp01(capped - index);\r\n switch (loop.direction ?? \"normal\") {\r\n case \"reverse\": return 1 - t;\r\n case \"alternate\": return index % 2 === 0 ? t : 1 - t;\r\n default: return t;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"loop.js","sourceRoot":"","sources":["../../src/tween/loop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,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,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC;IACvD,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC;IAClC,QAAQ,IAAI,CAAC,SAAS,IAAI,QAAQ,EAAE,CAAC;QACjC,KAAK,SAAS,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC7B,KAAK,WAAW,CAAC,CAAC,OAAO,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACrD,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC;IACtB,CAAC;AACL,CAAC","sourcesContent":["/**\n * Repetition, as data: how many times a command runs and which way each pass\n * goes.\n *\n * A loop is a **placement** property, the same kind of thing as `at` and\n * `duration` — it says when the command is running, never what it does. That is\n * why it lives out here rather than in any one command's args: the wrapper goes\n * *around* a built `Command`, so `to`, `fillTo`, `countTo` and a custom\n * `command()` nobody has written yet all loop by the same code, with nothing to\n * forward and nothing to forget.\n *\n * And it stays seekable. A looped command is still a pure function of its own\n * normalized time — `at(t)` maps `t` onto a pass and asks the inner command for\n * that pass's frame — so scrubbing into the fourth repetition costs the same as\n * scrubbing into the first, which is the whole reason commands are values here.\n */\n\nimport { clamp01 } from \"@/util/clamp\";\n\n/**\n * Which way a pass runs.\n *\n * `alternate` is the reason this is three values rather than a boolean: a\n * bounce — out and back — is one command with two passes, not two commands whose\n * `at`s have to be kept in step by hand.\n */\nexport type LoopDirection = \"normal\" | \"reverse\" | \"alternate\";\n\n/**\n * How a command repeats. Absent on a command is \"runs once\".\n */\nexport interface LoopSpec {\n /** Absent is `\"normal\"`. */\n direction?: LoopDirection;\n /**\n * How many times to repeat **after** the first pass: `0` is no repeat (the\n * same as no loop at all), `3` plays four passes, and `null` repeats for as\n * long as there is clip left to fill.\n *\n * Repeats rather than total passes so that the value reads as what the word\n * says — \"repeat twice\" is `2` — and so that the no-op is `0` rather than a\n * `1` that looks like it should do something.\n */\n count: number | null;\n}\n\n/** Total passes: repeats plus the first one, or `Infinity` for an unlimited loop. */\nexport function loopPasses(loop: LoopSpec): number {\n return loop.count === null ? Infinity : Math.max(0, Math.floor(loop.count)) + 1;\n}\n\n/** Whether a loop changes anything: an unlimited one always does, a counted one only past zero. */\nexport function loopRepeats(loop: LoopSpec | undefined): loop is LoopSpec {\n return loop !== undefined && (loop.count === null || loop.count >= 1);\n}\n\n/**\n * Seconds a looped command occupies.\n *\n * `fill` is what an unlimited loop is given to cover — the clip's remaining time,\n * where a timeline places one. An unlimited loop does not *define* a length the\n * way a counted one does: a background that turns forever should fill the scene\n * it is in, not stretch it, so `documentDuration` counts one pass of it and this\n * stretches it to whatever that came to.\n */\nexport function loopSpan(loop: LoopSpec, duration: number, fill = duration): number {\n if (duration <= 0) return duration;\n if (loop.count === null) return Math.max(duration, fill);\n return duration * loopPasses(loop);\n}\n\n/**\n * Where in one pass `elapsed` lands, as normalized time for the inner command.\n *\n * Past the last pass of a counted loop it holds at that pass's end rather than\n * wrapping to the start — the same rule a finished command follows everywhere\n * else, and what keeps the value a loop leaves behind the value the next command\n * tweens from.\n */\nexport function loopPhase(loop: LoopSpec, elapsed: number, duration: number): number {\n if (duration <= 0) return 1;\n const passes = loopPasses(loop);\n const capped = Math.min(Math.max(elapsed, 0) / duration, passes);\n // `passes - 1` holds the final pass at its end instead of rolling over to a\n // pass that does not exist. `Infinity - 1` is still `Infinity`, so an\n // unlimited loop is never capped.\n const index = Math.min(Math.floor(capped), passes - 1);\n const t = clamp01(capped - index);\n switch (loop.direction ?? \"normal\") {\n case \"reverse\": return 1 - t;\n case \"alternate\": return index % 2 === 0 ? t : 1 - t;\n default: return t;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"prepare.js","sourceRoot":"","sources":["../../src/tween/prepare.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,gBAAgB;AAChB,MAAM,UAAU,mBAAmB,CAC/B,M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AG,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACnD,CAAC;IACL,CAAC,CAAC;AACN,CAAC","sourcesContent":["import type { PropSlot } from \"@/props/slot\";\r\n\r\n/**\r\n * Snapshots the current numeric property values on `target` for the keys\r\n * present in `to`, then returns a lerp callback that writes interpolated values\r\n * back each frame.\r\n *\r\n * The snapshot is taken at call time, so invoke this immediately before the\r\n * animation starts (not lazily) to capture the correct `from` state.\r\n *\r\n * @param target - The object whose properties will be animated.\r\n * @param to - Desired end values keyed by property name. Keys with\r\n * `undefined` values are ignored.\r\n * @returns A function `(t: number) => void` that writes `lerp(from, to, t)`\r\n * for each key. `t` must already be eased by the caller.\r\n */\r\n/** @internal */\r\nexport function prepareNumericTween<T extends object>(\r\n target: T,\r\n to: Partial<Record<keyof T, number>>,\r\n): (t: number) => void {\r\n const keys = (Object.keys(to) as (keyof T)[]).filter((k) => to[k] !== undefined);\r\n const from = new Array<number>(keys.length);\r\n const end = new Array<number>(keys.length);\r\n for (let i = 0; i < keys.length; i++) {\r\n from[i] = (target as any)[keys[i]] as number;\r\n end[i] = to[keys[i]] as number;\r\n }\r\n return (t: number) => {\r\n for (let i = 0; i < keys.length; i++) {\r\n (target as any)[keys[i]] = from[i] + (end[i] - from[i]) * t;\r\n }\r\n };\r\n}\r\n\r\n/**\r\n * Like {@link prepareNumericTween}, but bypasses property setters and writes\r\n * directly to the backing {@link PropSlot}s.\r\n *\r\n * Skipping the setter avoids the mapper-lookup and `_writeProp` indirection on\r\n * every frame step. Only valid for numeric properties whose `end` is already in\r\n * stored space — the caller is responsible for resolving the slots, mapping the\r\n * destination and capturing the `from`/`end` values before calling this.\r\n *\r\n * - `cells[i]` — the slot for the i-th animated property.\r\n * - `from[i]` — start value for that property.\r\n * - `end[i]` — end value for that property.\r\n *\r\n * The arrays are captured by the returned closure and reused each step, so the\r\n * per-frame cost is one `slot.set(number)` per property with no allocation.\r\n */\r\n/** @internal */\r\nexport function prepareNumericCellTween(\r\n cells: PropSlot<number>[],\r\n from: number[],\r\n end: number[],\r\n): (t: number) => void {\r\n return (t: number) => {\r\n for (let i = 0; i < cells.length; i++) {\r\n cells[i].set(from[i] + (end[i] - from[i]) * t);\r\n }\r\n };\r\n}\r\n"]}
1
+ {"version":3,"file":"prepare.js","sourceRoot":"","sources":["../../src/tween/prepare.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,gBAAgB;AAChB,MAAM,UAAU,mBAAmB,CAC/B,MAAS,EACT,EAAoC;IAEpC,MAAM,IAAI,GAAI,MAAM,CAAC,IAAI,CAAC,EAAE,CAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC;IACjF,MAAM,IAAI,GAAG,IAAI,KAAK,CAAS,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5C,MAAM,GAAG,GAAG,IAAI,KAAK,CAAS,IAAI,CAAC,MAAM,CAAC,CAAC;IAC3C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACnC,IAAI,CAAC,CAAC,CAAC,GAAI,MAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAW,CAAC;QAC7C,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAW,CAAC;IACnC,CAAC;IACD,OAAO,CAAC,CAAS,EAAE,EAAE;QACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAClC,MAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QAChE,CAAC;IACL,CAAC,CAAC;AACN,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,gBAAgB;AAChB,MAAM,UAAU,uBAAuB,CACnC,KAAyB,EACzB,IAAc,EACd,GAAa;IAEb,OAAO,CAAC,CAAS,EAAE,EAAE;QACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACpC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACnD,CAAC;IACL,CAAC,CAAC;AACN,CAAC","sourcesContent":["import type { PropSlot } from \"@/props/slot\";\n\n/**\n * Snapshots the current numeric property values on `target` for the keys\n * present in `to`, then returns a lerp callback that writes interpolated values\n * back each frame.\n *\n * The snapshot is taken at call time, so invoke this immediately before the\n * animation starts (not lazily) to capture the correct `from` state.\n *\n * @param target - The object whose properties will be animated.\n * @param to - Desired end values keyed by property name. Keys with\n * `undefined` values are ignored.\n * @returns A function `(t: number) => void` that writes `lerp(from, to, t)`\n * for each key. `t` must already be eased by the caller.\n */\n/** @internal */\nexport function prepareNumericTween<T extends object>(\n target: T,\n to: Partial<Record<keyof T, number>>,\n): (t: number) => void {\n const keys = (Object.keys(to) as (keyof T)[]).filter((k) => to[k] !== undefined);\n const from = new Array<number>(keys.length);\n const end = new Array<number>(keys.length);\n for (let i = 0; i < keys.length; i++) {\n from[i] = (target as any)[keys[i]] as number;\n end[i] = to[keys[i]] as number;\n }\n return (t: number) => {\n for (let i = 0; i < keys.length; i++) {\n (target as any)[keys[i]] = from[i] + (end[i] - from[i]) * t;\n }\n };\n}\n\n/**\n * Like {@link prepareNumericTween}, but bypasses property setters and writes\n * directly to the backing {@link PropSlot}s.\n *\n * Skipping the setter avoids the mapper-lookup and `_writeProp` indirection on\n * every frame step. Only valid for numeric properties whose `end` is already in\n * stored space — the caller is responsible for resolving the slots, mapping the\n * destination and capturing the `from`/`end` values before calling this.\n *\n * - `cells[i]` — the slot for the i-th animated property.\n * - `from[i]` — start value for that property.\n * - `end[i]` — end value for that property.\n *\n * The arrays are captured by the returned closure and reused each step, so the\n * per-frame cost is one `slot.set(number)` per property with no allocation.\n */\n/** @internal */\nexport function prepareNumericCellTween(\n cells: PropSlot<number>[],\n from: number[],\n end: number[],\n): (t: number) => void {\n return (t: number) => {\n for (let i = 0; i < cells.length; i++) {\n cells[i].set(from[i] + (end[i] - from[i]) * t);\n }\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"stepper.js","sourceRoot":"","sources":["../../src/tween/stepper.ts"],"names":[],"mappings":"AAmCA,MAAM,UAAU,WAAW,CAAC,CAAU;IAClC,OAAO,OAAQ,CAAe,EAAE,QAAQ,KAAK,UAAU,CAAC;AAC5D,CAAC","sourcesContent":["/**\r\n * A flat animation driver. `advance(dt)` moves the animation forward by `dt`\r\n * seconds and returns `true` once it has completed (and applied its final\r\n * value). It must be primed at t=0 before the first `advance` so the starting\r\n * frame is correct — callers apply the initial value via `seek(0)`.\r\n *\r\n * `seek(elapsed)` is the absolute-time half, and is what a {@link Command}'s\r\n * `at` is built on: a stepper can be asked for any time, in any order, which is\r\n * what lets a timeline evaluate a frame without having played the ones before\r\n * it.\r\n */\r\n/** @internal */\r\nexport interface TweenStepper {\r\n /**\r\n * Jump to the value corresponding to `elapsed` seconds from the start.\r\n * Call with `0` to prime the stepper before the first {@link advance}.\r\n */\r\n seek(elapsed: number): void;\r\n /**\r\n * Advance the animation by `dt` seconds.\r\n * @returns `true` when the animation has finished and its final value has\r\n * been applied; `false` if it is still running.\r\n */\r\n advance(dt: number): boolean;\r\n}\r\n\r\n/**\r\n * Implemented by anything that can produce a {@link TweenStepper} — a\r\n * {@link Command}, and anything a host drives directly.\r\n */\r\nexport interface Steppable {\r\n /** Return a fresh stepper for a single playthrough of this animation. */\r\n _stepper(): TweenStepper;\r\n}\r\n\r\nexport function isSteppable(x: unknown): x is Steppable {\r\n return typeof (x as Steppable)?._stepper === \"function\";\r\n}\r\n"]}
1
+ {"version":3,"file":"stepper.js","sourceRoot":"","sources":["../../src/tween/stepper.ts"],"names":[],"mappings":"AAmCA,MAAM,UAAU,WAAW,CAAC,CAAU;IAClC,OAAO,OAAQ,CAAe,EAAE,QAAQ,KAAK,UAAU,CAAC;AAC5D,CAAC","sourcesContent":["/**\n * A flat animation driver. `advance(dt)` moves the animation forward by `dt`\n * seconds and returns `true` once it has completed (and applied its final\n * value). It must be primed at t=0 before the first `advance` so the starting\n * frame is correct — callers apply the initial value via `seek(0)`.\n *\n * `seek(elapsed)` is the absolute-time half, and is what a {@link Command}'s\n * `at` is built on: a stepper can be asked for any time, in any order, which is\n * what lets a timeline evaluate a frame without having played the ones before\n * it.\n */\n/** @internal */\nexport interface TweenStepper {\n /**\n * Jump to the value corresponding to `elapsed` seconds from the start.\n * Call with `0` to prime the stepper before the first {@link advance}.\n */\n seek(elapsed: number): void;\n /**\n * Advance the animation by `dt` seconds.\n * @returns `true` when the animation has finished and its final value has\n * been applied; `false` if it is still running.\n */\n advance(dt: number): boolean;\n}\n\n/**\n * Implemented by anything that can produce a {@link TweenStepper} — a\n * {@link Command}, and anything a host drives directly.\n */\nexport interface Steppable {\n /** Return a fresh stepper for a single playthrough of this animation. */\n _stepper(): TweenStepper;\n}\n\nexport function isSteppable(x: unknown): x is Steppable {\n return typeof (x as Steppable)?._stepper === \"function\";\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"to-command.js","sourceRoot":"","sources":["../../src/tween/to-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAgBvC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,SAAS;IAIU;IACA;IACR;IACQ;IANb,UAAU,GAAwB,IAAI,CAAC;IAE/C,YACqB,MAA0B,EAC1B,KAAiB,EACzB,QAAgB,EACR,MAAuB;QAHvB,WAAM,GAAN,MAAM,CAAoB;QAC1B,UAAK,GAAL,KAAK,CAAY;QACzB,aAAQ,GAAR,QAAQ,CAAQ;QACR,WAAM,GAAN,MAAM,CAAiB;IACxC,CAAC;IAEL;;;;;;OAMG;IACH,EAAE,CAAC,CAAS;QACR,IAAI,CAAC,IAAI,CAAC,UAAU;YAAE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QACvD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;QACjD,OAAO,EAAE,CAAC;IACd,CAAC;IAED,QAAQ;QACJ,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IAC1B,CAAC;IAEO,OAAO;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5E,CAAC;CACJ;AAED,wDAAwD;AACxD,MAAM,UAAU,SAAS,CACrB,MAA0B,EAC1B,KAAiB,EACjB,QAAgB,EAChB,MAAuB;IAEvB,OAAO,IAAI,SAAS,CAAI,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAC7D,CAAC","sourcesContent":["import { clamp01 } from \"@/util/clamp\";\r\nimport { EasingFunction } from \"@/tween/ease/type\";\r\nimport { Steppable, TweenStepper } from \"@/tween/stepper\";\r\nimport { Command } from \"./command\";\r\n\r\n/**\r\n * Interface a node (or other host) implements to be driven by {@link toCommand}.\r\n *\r\n * `_prepareStep` resolves one tween into a flat, mutation-driving\r\n * {@link TweenStepper} — the same primitive both the flat `parallel` fast path\r\n * and the command's own evaluation are built from.\r\n */\r\nexport interface AnimationTarget<P> {\r\n _prepareStep(props: Partial<P>, duration: number, easing?: EasingFunction): TweenStepper;\r\n}\r\n\r\n/**\r\n * The {@link Command} `node.to(...)` returns: one tween on one target, and\r\n * nothing else.\r\n *\r\n * **Single, not chainable.** `to()` used to return a builder whose own `to()`\r\n * appended another step and returned `this`, so `node.to(a, 1).to(b, 1)` read as\r\n * a sequence. Sequencing is now a property of the timeline — a command carries\r\n * its own `at`, so \"after this one\" is `at + duration` — and one command shape\r\n * means a host reading a `Command` off a node knows exactly what it holds.\r\n *\r\n * Implements {@link Command} (a host can ask what it looks like at a time) and\r\n * {@link Steppable} (the flat driver).\r\n *\r\n * `at` and `_stepper` each keep their **own** prepared stepper: preparing is\r\n * what snapshots the tween's `from` (it reads the live target), so two drivers\r\n * must never fight over one mutable stepper.\r\n */\r\nclass ToCommand<P> implements Command<P>, Steppable {\r\n private atPrepared: TweenStepper | null = null;\r\n\r\n constructor(\r\n private readonly target: AnimationTarget<P>,\r\n private readonly props: Partial<P>,\r\n readonly duration: number,\r\n private readonly easing?: EasingFunction,\r\n ) { }\r\n\r\n /**\r\n * The props this command writes at normalized `t`. Applied as a side effect\r\n * (direct cell writes through the prepared stepper, exactly like\r\n * `driveCommand`) rather than returned — a tween may carry a custom tween\r\n * function or a mapped prop, and only the target's own `_prepareStep` knows\r\n * how to apply those correctly.\r\n */\r\n at(t: number): Partial<P> {\r\n if (!this.atPrepared) this.atPrepared = this.prepare();\r\n this.atPrepared.seek(clamp01(t) * this.duration);\r\n return {};\r\n }\r\n\r\n _stepper(): TweenStepper {\r\n return this.prepare();\r\n }\r\n\r\n private prepare(): TweenStepper {\r\n return this.target._prepareStep(this.props, this.duration, this.easing);\r\n }\r\n}\r\n\r\n/** Build the {@link Command} `node.to(...)` returns. */\r\nexport function toCommand<P>(\r\n target: AnimationTarget<P>,\r\n props: Partial<P>,\r\n duration: number,\r\n easing?: EasingFunction,\r\n): Command<P> {\r\n return new ToCommand<P>(target, props, duration, easing);\r\n}\r\n"]}
1
+ {"version":3,"file":"to-command.js","sourceRoot":"","sources":["../../src/tween/to-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAgBvC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,SAAS;IAIU;IACA;IACR;IACQ;IANb,UAAU,GAAwB,IAAI,CAAC;IAE/C,YACqB,MAA0B,EAC1B,KAAiB,EACzB,QAAgB,EACR,MAAuB;QAHvB,WAAM,GAAN,MAAM,CAAoB;QAC1B,UAAK,GAAL,KAAK,CAAY;QACzB,aAAQ,GAAR,QAAQ,CAAQ;QACR,WAAM,GAAN,MAAM,CAAiB;IACxC,CAAC;IAEL;;;;;;OAMG;IACH,EAAE,CAAC,CAAS;QACR,IAAI,CAAC,IAAI,CAAC,UAAU;YAAE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QACvD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;QACjD,OAAO,EAAE,CAAC;IACd,CAAC;IAED,QAAQ;QACJ,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IAC1B,CAAC;IAEO,OAAO;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5E,CAAC;CACJ;AAED,wDAAwD;AACxD,MAAM,UAAU,SAAS,CACrB,MAA0B,EAC1B,KAAiB,EACjB,QAAgB,EAChB,MAAuB;IAEvB,OAAO,IAAI,SAAS,CAAI,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAC7D,CAAC","sourcesContent":["import { clamp01 } from \"@/util/clamp\";\nimport { EasingFunction } from \"@/tween/ease/type\";\nimport { Steppable, TweenStepper } from \"@/tween/stepper\";\nimport { Command } from \"./command\";\n\n/**\n * Interface a node (or other host) implements to be driven by {@link toCommand}.\n *\n * `_prepareStep` resolves one tween into a flat, mutation-driving\n * {@link TweenStepper} — the same primitive both the flat `parallel` fast path\n * and the command's own evaluation are built from.\n */\nexport interface AnimationTarget<P> {\n _prepareStep(props: Partial<P>, duration: number, easing?: EasingFunction): TweenStepper;\n}\n\n/**\n * The {@link Command} `node.to(...)` returns: one tween on one target, and\n * nothing else.\n *\n * **Single, not chainable.** `to()` used to return a builder whose own `to()`\n * appended another step and returned `this`, so `node.to(a, 1).to(b, 1)` read as\n * a sequence. Sequencing is now a property of the timeline — a command carries\n * its own `at`, so \"after this one\" is `at + duration` — and one command shape\n * means a host reading a `Command` off a node knows exactly what it holds.\n *\n * Implements {@link Command} (a host can ask what it looks like at a time) and\n * {@link Steppable} (the flat driver).\n *\n * `at` and `_stepper` each keep their **own** prepared stepper: preparing is\n * what snapshots the tween's `from` (it reads the live target), so two drivers\n * must never fight over one mutable stepper.\n */\nclass ToCommand<P> implements Command<P>, Steppable {\n private atPrepared: TweenStepper | null = null;\n\n constructor(\n private readonly target: AnimationTarget<P>,\n private readonly props: Partial<P>,\n readonly duration: number,\n private readonly easing?: EasingFunction,\n ) { }\n\n /**\n * The props this command writes at normalized `t`. Applied as a side effect\n * (direct cell writes through the prepared stepper, exactly like\n * `driveCommand`) rather than returned — a tween may carry a custom tween\n * function or a mapped prop, and only the target's own `_prepareStep` knows\n * how to apply those correctly.\n */\n at(t: number): Partial<P> {\n if (!this.atPrepared) this.atPrepared = this.prepare();\n this.atPrepared.seek(clamp01(t) * this.duration);\n return {};\n }\n\n _stepper(): TweenStepper {\n return this.prepare();\n }\n\n private prepare(): TweenStepper {\n return this.target._prepareStep(this.props, this.duration, this.easing);\n }\n}\n\n/** Build the {@link Command} `node.to(...)` returns. */\nexport function toCommand<P>(\n target: AnimationTarget<P>,\n props: Partial<P>,\n duration: number,\n easing?: EasingFunction,\n): Command<P> {\n return new ToCommand<P>(target, props, duration, easing);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"clamp.js","sourceRoot":"","sources":["../../src/util/clamp.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW,EAAU,EAAE;IACvE,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;AAC7C,CAAC,CAAC;AAEF,iFAAiF;AACjF,MAAM,UAAU,OAAO,CAAC,CAAS;IAC7B,OAAO,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAC1B,CAAC","sourcesContent":["/**\r\n * Clamps a number between a minimum and maximum value.\r\n *\r\n * @param value - The number to clamp.\r\n * @param min - The lower bound.\r\n * @param max - The upper bound.\r\n * @returns The clamped number.\r\n */\r\nexport const clamp = (value: number, min: number, max: number): number => {\r\n return Math.max(min, Math.min(value, max));\r\n};\r\n\r\n/** Shorthand for `clamp(t, 0, 1)`, commonly used to normalize tween progress. */\r\nexport function clamp01(t: number) {\r\n return clamp(t, 0, 1);\r\n}\r\n"]}
1
+ {"version":3,"file":"clamp.js","sourceRoot":"","sources":["../../src/util/clamp.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW,EAAU,EAAE;IACvE,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;AAC7C,CAAC,CAAC;AAEF,iFAAiF;AACjF,MAAM,UAAU,OAAO,CAAC,CAAS;IAC7B,OAAO,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAC1B,CAAC","sourcesContent":["/**\n * Clamps a number between a minimum and maximum value.\n *\n * @param value - The number to clamp.\n * @param min - The lower bound.\n * @param max - The upper bound.\n * @returns The clamped number.\n */\nexport const clamp = (value: number, min: number, max: number): number => {\n return Math.max(min, Math.min(value, max));\n};\n\n/** Shorthand for `clamp(t, 0, 1)`, commonly used to normalize tween progress. */\nexport function clamp01(t: number) {\n return clamp(t, 0, 1);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/util/context.ts"],"names":[],"mappings":"AAsBA;;;;;;;;;GASG;AACH,MAAM,UAAU,aAAa,CAAI,YAAe,EAAE,IAAa;IAC3D,OAAO,EAAE,EAAE,EAAE,MAAM,CAAC,IAAI,IAAI,SAAS,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;AACjE,CAAC;AAED;;;;;GAKG;AACH,MAAM,OAAO,UAAU;IACkB;IAArC,YAAqC,OAAqC;QAArC,YAAO,GAAP,OAAO,CAA8B;IAAI,CAAC;IAE/E,+DAA+D;IAC/D,MAAM,CAAU,KAAK,GAAG,IAAI,UAAU,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC;IAElD,4EAA4E;IAC5E,IAAI,CAAI,GAAe,EAAE,KAAQ;QAC7B,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QACxB,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAED,qEAAqE;IACrE,GAAG,CAAI,GAAe;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAO,CAAC,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC;IACzF,CAAC","sourcesContent":["/**\r\n * Typed context tokens for passing inherited data down the node tree —\r\n * analogous to React's `createContext` / `useContext`, but resolved over the\r\n * scene-node tree rather than a render tree.\r\n *\r\n * A {@link Context} is an opaque token carrying a phantom type `T` and a\r\n * default value. Providers attach a value for a token to the {@link ContextMap}\r\n * pushed to their descendants; a descendant reads the nearest ancestor's value\r\n * (or the token's default) via `node.useContext(token)`.\r\n *\r\n * Mirrors the {@link createRef} factory style: a small typed helper rather than\r\n * a class the author has to instantiate.\r\n */\r\nexport interface Context<T> {\r\n /** Identity used as the map key. Unique per `createContext` call. */\r\n readonly id: symbol;\r\n /** Value returned by `useContext` when no ancestor provides this token. */\r\n readonly defaultValue: T;\r\n /** Optional label, surfaced on the symbol for debugging. */\r\n readonly name?: string;\r\n}\r\n\r\n/**\r\n * Create a typed context token.\r\n *\r\n * @example\r\n * ```ts\r\n * const Money = createContext<number>(0, \"money\");\r\n * // provide: <Provider context={Money} value={500}>…</Provider>\r\n * // consume: init() { const m = this.useContext(Money); } // m: number\r\n * ```\r\n */\r\nexport function createContext<T>(defaultValue: T, name?: string): Context<T> {\r\n return { id: Symbol(name ?? \"context\"), defaultValue, name };\r\n}\r\n\r\n/**\r\n * An immutable, layered token→value map carried down the node tree. Each\r\n * provider derives a child map from its parent's via {@link with}, overriding a\r\n * single token — so a deeper provider naturally shadows a shallower one\r\n * (nearest-ancestor-wins) without any stack bookkeeping.\r\n */\r\nexport class ContextMap {\r\n private constructor(private readonly entries: ReadonlyMap<symbol, unknown>) { }\r\n\r\n /** The empty map — every token resolves to its own default. */\r\n static readonly EMPTY = new ContextMap(new Map());\r\n\r\n /** Return a new map identical to this one but with `ctx` set to `value`. */\r\n with<T>(ctx: Context<T>, value: T): ContextMap {\r\n const next = new Map(this.entries);\r\n next.set(ctx.id, value);\r\n return new ContextMap(next);\r\n }\r\n\r\n /** Resolve `ctx`'s value, falling back to its default when unset. */\r\n get<T>(ctx: Context<T>): T {\r\n return this.entries.has(ctx.id) ? (this.entries.get(ctx.id) as T) : ctx.defaultValue;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/util/context.ts"],"names":[],"mappings":"AAsBA;;;;;;;;;GASG;AACH,MAAM,UAAU,aAAa,CAAI,YAAe,EAAE,IAAa;IAC3D,OAAO,EAAE,EAAE,EAAE,MAAM,CAAC,IAAI,IAAI,SAAS,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;AACjE,CAAC;AAED;;;;;GAKG;AACH,MAAM,OAAO,UAAU;IACkB;IAArC,YAAqC,OAAqC;QAArC,YAAO,GAAP,OAAO,CAA8B;IAAI,CAAC;IAE/E,+DAA+D;IAC/D,MAAM,CAAU,KAAK,GAAG,IAAI,UAAU,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC;IAElD,4EAA4E;IAC5E,IAAI,CAAI,GAAe,EAAE,KAAQ;QAC7B,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QACxB,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAED,qEAAqE;IACrE,GAAG,CAAI,GAAe;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAO,CAAC,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC;IACzF,CAAC","sourcesContent":["/**\n * Typed context tokens for passing inherited data down the node tree —\n * analogous to React's `createContext` / `useContext`, but resolved over the\n * scene-node tree rather than a render tree.\n *\n * A {@link Context} is an opaque token carrying a phantom type `T` and a\n * default value. Providers attach a value for a token to the {@link ContextMap}\n * pushed to their descendants; a descendant reads the nearest ancestor's value\n * (or the token's default) via `node.useContext(token)`.\n *\n * Mirrors the {@link createRef} factory style: a small typed helper rather than\n * a class the author has to instantiate.\n */\nexport interface Context<T> {\n /** Identity used as the map key. Unique per `createContext` call. */\n readonly id: symbol;\n /** Value returned by `useContext` when no ancestor provides this token. */\n readonly defaultValue: T;\n /** Optional label, surfaced on the symbol for debugging. */\n readonly name?: string;\n}\n\n/**\n * Create a typed context token.\n *\n * @example\n * ```ts\n * const Money = createContext<number>(0, \"money\");\n * // provide: <Provider context={Money} value={500}>…</Provider>\n * // consume: init() { const m = this.useContext(Money); } // m: number\n * ```\n */\nexport function createContext<T>(defaultValue: T, name?: string): Context<T> {\n return { id: Symbol(name ?? \"context\"), defaultValue, name };\n}\n\n/**\n * An immutable, layered token→value map carried down the node tree. Each\n * provider derives a child map from its parent's via {@link with}, overriding a\n * single token — so a deeper provider naturally shadows a shallower one\n * (nearest-ancestor-wins) without any stack bookkeeping.\n */\nexport class ContextMap {\n private constructor(private readonly entries: ReadonlyMap<symbol, unknown>) { }\n\n /** The empty map — every token resolves to its own default. */\n static readonly EMPTY = new ContextMap(new Map());\n\n /** Return a new map identical to this one but with `ctx` set to `value`. */\n with<T>(ctx: Context<T>, value: T): ContextMap {\n const next = new Map(this.entries);\n next.set(ctx.id, value);\n return new ContextMap(next);\n }\n\n /** Resolve `ctx`'s value, falling back to its default when unset. */\n get<T>(ctx: Context<T>): T {\n return this.entries.has(ctx.id) ? (this.entries.get(ctx.id) as T) : ctx.defaultValue;\n }\n}\n"]}