motionary 10.3.0 → 10.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (390) hide show
  1. package/AGENTS.md +4 -0
  2. package/CHANGELOG.md +13 -0
  3. package/README.md +35 -0
  4. package/bin/motionary-mcp.mjs +265 -0
  5. package/dist/chunks/anim-image-DDdb9q3X.js +166 -0
  6. package/dist/chunks/anim-image-DDdb9q3X.js.map +1 -0
  7. package/dist/chunks/anim-image-blQgPFFS.cjs +174 -0
  8. package/dist/chunks/anim-image-blQgPFFS.cjs.map +1 -0
  9. package/dist/chunks/audio-BpU-A1m1.cjs.map +1 -1
  10. package/dist/chunks/{audio-D95jwlOh.js → audio-CWt1xdZB.js} +3 -3
  11. package/dist/chunks/{audio-D95jwlOh.js.map → audio-CWt1xdZB.js.map} +1 -1
  12. package/dist/chunks/{base-BnRyfuyM.js → base-BTev8qxg.js} +2 -2
  13. package/dist/chunks/{base-BnRyfuyM.js.map → base-BTev8qxg.js.map} +1 -1
  14. package/dist/chunks/base-DBheNxJu.cjs.map +1 -1
  15. package/dist/chunks/bind-B_CTL6Qn.js.map +1 -1
  16. package/dist/chunks/bind-Ui43-n2d.cjs.map +1 -1
  17. package/dist/chunks/builtins-CKKZNR95.cjs.map +1 -1
  18. package/dist/chunks/{builtins-CqIq1zBv.js → builtins-CPmS6aDB.js} +3 -3
  19. package/dist/chunks/{builtins-CqIq1zBv.js.map → builtins-CPmS6aDB.js.map} +1 -1
  20. package/dist/chunks/core-B5T0dhFH.cjs.map +1 -1
  21. package/dist/chunks/{core-DsGoL9EY.js → core-BviA7nFa.js} +2 -2
  22. package/dist/chunks/{core-DsGoL9EY.js.map → core-BviA7nFa.js.map} +1 -1
  23. package/dist/chunks/core-D74Fz-dL.cjs.map +1 -1
  24. package/dist/chunks/core-D7cVumUu.js.map +1 -1
  25. package/dist/chunks/{core-XA2yhn1b.js → core-KiM7MXjL.js} +2 -2
  26. package/dist/chunks/{core-XA2yhn1b.js.map → core-KiM7MXjL.js.map} +1 -1
  27. package/dist/chunks/core-MQlXZKUG.cjs.map +1 -1
  28. package/dist/chunks/ease-HwYZnZat.cjs +94 -0
  29. package/dist/chunks/ease-HwYZnZat.cjs.map +1 -0
  30. package/dist/chunks/ease-XN8_0sXu.js +89 -0
  31. package/dist/chunks/ease-XN8_0sXu.js.map +1 -0
  32. package/dist/chunks/fx-B_pbhpDp.cjs.map +1 -1
  33. package/dist/chunks/{fx-CtnrFEg9.js → fx-CgWKqVsn.js} +2 -2
  34. package/dist/chunks/{fx-CtnrFEg9.js.map → fx-CgWKqVsn.js.map} +1 -1
  35. package/dist/chunks/generative-2LhxG5BJ.js.map +1 -1
  36. package/dist/chunks/generative-BHIj-NU0.cjs.map +1 -1
  37. package/dist/chunks/{gpu-CDcXiNA8.js → gpu-BWfgYWMY.js} +2 -2
  38. package/dist/chunks/{gpu-CDcXiNA8.js.map → gpu-BWfgYWMY.js.map} +1 -1
  39. package/dist/chunks/gpu-cUixt7kT.cjs.map +1 -1
  40. package/dist/chunks/index-tags-B-JBecYg.js.map +1 -1
  41. package/dist/chunks/index-tags-hLIF2Clq.cjs.map +1 -1
  42. package/dist/chunks/{keyframes-DVAC5sQI.js → keyframes-B5PWe5bU.js} +3 -2
  43. package/dist/chunks/keyframes-B5PWe5bU.js.map +1 -0
  44. package/dist/chunks/{keyframes-Dw9zwVQa.cjs → keyframes-tC3I7anQ.cjs} +4 -3
  45. package/dist/chunks/keyframes-tC3I7anQ.cjs.map +1 -0
  46. package/dist/chunks/{manifest-D58HXVY-.js → manifest-BHx5yPN6.js} +2 -2
  47. package/dist/chunks/{manifest-D58HXVY-.js.map → manifest-BHx5yPN6.js.map} +1 -1
  48. package/dist/chunks/manifest-PaF9B8Vt.cjs.map +1 -1
  49. package/dist/chunks/{player-48Zy_NBG.js → player-BfHMNtiM.js} +4 -4
  50. package/dist/chunks/{player-48Zy_NBG.js.map → player-BfHMNtiM.js.map} +1 -1
  51. package/dist/chunks/player-C4y4jXSv.cjs.map +1 -1
  52. package/dist/chunks/presets-BYBVJVeP.js.map +1 -1
  53. package/dist/chunks/presets-CUHys3sK.cjs.map +1 -1
  54. package/dist/chunks/{registry-gFJRpPES.js → registry-BKzyg1JV.js} +2 -2
  55. package/dist/chunks/{registry-gFJRpPES.js.map → registry-BKzyg1JV.js.map} +1 -1
  56. package/dist/chunks/{registry-46AAzyeC.js → registry-CT-TT_bx.js} +3 -3
  57. package/dist/chunks/{registry-46AAzyeC.js.map → registry-CT-TT_bx.js.map} +1 -1
  58. package/dist/chunks/{registry-CSVil2qJ.cjs → registry-tzwKkldE.cjs} +2 -2
  59. package/dist/chunks/{registry-CSVil2qJ.cjs.map → registry-tzwKkldE.cjs.map} +1 -1
  60. package/dist/chunks/registry-xQZnSqqV.cjs.map +1 -1
  61. package/dist/chunks/shared-CkKHWrtJ.js.map +1 -1
  62. package/dist/chunks/shared-jkgRH-Hx.cjs.map +1 -1
  63. package/dist/chunks/{spring-CZDNyqWp.js → spring-BHuP55DR.js} +2 -2
  64. package/dist/chunks/{spring-CZDNyqWp.js.map → spring-BHuP55DR.js.map} +1 -1
  65. package/dist/chunks/spring-BlTQD2AV.cjs.map +1 -1
  66. package/dist/chunks/stagger-CCFyhzSw.cjs.map +1 -1
  67. package/dist/chunks/stagger-DtMKo2SK.js.map +1 -1
  68. package/dist/chunks/{ticker-COOYAyQy.js → ticker-C8lSGml9.js} +2 -2
  69. package/dist/chunks/{ticker-COOYAyQy.js.map → ticker-C8lSGml9.js.map} +1 -1
  70. package/dist/chunks/{ticker-gHv6pNfx.cjs → ticker-Un0bvTWR.cjs} +2 -2
  71. package/dist/chunks/{ticker-gHv6pNfx.cjs.map → ticker-Un0bvTWR.cjs.map} +1 -1
  72. package/dist/chunks/{tween-CGyolmzB.js → tween-BcejKpsx.js} +4 -90
  73. package/dist/chunks/tween-BcejKpsx.js.map +1 -0
  74. package/dist/chunks/{tween-CFN0WcOb.cjs → tween-CwLLC3Ko.cjs} +4 -94
  75. package/dist/chunks/tween-CwLLC3Ko.cjs.map +1 -0
  76. package/dist/chunks/variants-CrDDJoYK.cjs.map +1 -1
  77. package/dist/chunks/{variants-GU3yIL4F.js → variants-CsRGUIyA.js} +2 -2
  78. package/dist/chunks/{variants-GU3yIL4F.js.map → variants-CsRGUIyA.js.map} +1 -1
  79. package/dist/components/a11y.cjs.map +1 -1
  80. package/dist/components/a11y.js +2 -2
  81. package/dist/components/a11y.js.map +1 -1
  82. package/dist/components/angular.cjs.map +1 -1
  83. package/dist/components/angular.js +8 -8
  84. package/dist/components/angular.js.map +1 -1
  85. package/dist/components/background.cjs.map +1 -1
  86. package/dist/components/background.js +2 -2
  87. package/dist/components/background.js.map +1 -1
  88. package/dist/components/bridge.cjs.map +1 -1
  89. package/dist/components/bridge.js +1 -1
  90. package/dist/components/bridge.js.map +1 -1
  91. package/dist/components/cards.cjs.map +1 -1
  92. package/dist/components/cards.js +2 -2
  93. package/dist/components/cards.js.map +1 -1
  94. package/dist/components/click.cjs.map +1 -1
  95. package/dist/components/click.js +3 -3
  96. package/dist/components/click.js.map +1 -1
  97. package/dist/components/core.cjs.map +1 -1
  98. package/dist/components/core.js.map +1 -1
  99. package/dist/components/depth.cjs.map +1 -1
  100. package/dist/components/depth.js +3 -3
  101. package/dist/components/depth.js.map +1 -1
  102. package/dist/components/design.cjs.map +1 -1
  103. package/dist/components/design.js +3 -3
  104. package/dist/components/design.js.map +1 -1
  105. package/dist/components/dsl.cjs.map +1 -1
  106. package/dist/components/dsl.js +2 -2
  107. package/dist/components/dsl.js.map +1 -1
  108. package/dist/components/effects.cjs.map +1 -1
  109. package/dist/components/effects.js +9 -9
  110. package/dist/components/effects.js.map +1 -1
  111. package/dist/components/engine.cjs.map +1 -1
  112. package/dist/components/engine.js +2 -2
  113. package/dist/components/engine.js.map +1 -1
  114. package/dist/components/feedback.cjs.map +1 -1
  115. package/dist/components/feedback.js +1 -1
  116. package/dist/components/feedback.js.map +1 -1
  117. package/dist/components/fx-3d.cjs.map +1 -1
  118. package/dist/components/fx-3d.js +2 -2
  119. package/dist/components/fx-3d.js.map +1 -1
  120. package/dist/components/fx-ai.cjs.map +1 -1
  121. package/dist/components/fx-ai.js +2 -2
  122. package/dist/components/fx-ai.js.map +1 -1
  123. package/dist/components/fx-chart.cjs.map +1 -1
  124. package/dist/components/fx-chart.js +2 -2
  125. package/dist/components/fx-chart.js.map +1 -1
  126. package/dist/components/fx-cinema.cjs.map +1 -1
  127. package/dist/components/fx-cinema.js +2 -2
  128. package/dist/components/fx-cinema.js.map +1 -1
  129. package/dist/components/fx-cyber.cjs.map +1 -1
  130. package/dist/components/fx-cyber.js +2 -2
  131. package/dist/components/fx-cyber.js.map +1 -1
  132. package/dist/components/fx-festival.cjs.map +1 -1
  133. package/dist/components/fx-festival.js +2 -2
  134. package/dist/components/fx-festival.js.map +1 -1
  135. package/dist/components/fx-focus.cjs.map +1 -1
  136. package/dist/components/fx-focus.js +2 -2
  137. package/dist/components/fx-focus.js.map +1 -1
  138. package/dist/components/fx-form.cjs.map +1 -1
  139. package/dist/components/fx-form.js +2 -2
  140. package/dist/components/fx-form.js.map +1 -1
  141. package/dist/components/fx-game.cjs.map +1 -1
  142. package/dist/components/fx-game.js +2 -2
  143. package/dist/components/fx-game.js.map +1 -1
  144. package/dist/components/fx-genart.cjs.map +1 -1
  145. package/dist/components/fx-genart.js +2 -2
  146. package/dist/components/fx-genart.js.map +1 -1
  147. package/dist/components/fx-geo.cjs.map +1 -1
  148. package/dist/components/fx-geo.js +2 -2
  149. package/dist/components/fx-geo.js.map +1 -1
  150. package/dist/components/fx-gesture.cjs.map +1 -1
  151. package/dist/components/fx-gesture.js +2 -2
  152. package/dist/components/fx-gesture.js.map +1 -1
  153. package/dist/components/fx-gpu.js +3 -3
  154. package/dist/components/fx-light.cjs.map +1 -1
  155. package/dist/components/fx-light.js +2 -2
  156. package/dist/components/fx-light.js.map +1 -1
  157. package/dist/components/fx-lottie.cjs.map +1 -1
  158. package/dist/components/fx-lottie.js +2 -2
  159. package/dist/components/fx-lottie.js.map +1 -1
  160. package/dist/components/fx-morph.cjs.map +1 -1
  161. package/dist/components/fx-morph.js +2 -2
  162. package/dist/components/fx-morph.js.map +1 -1
  163. package/dist/components/fx-music.cjs.map +1 -1
  164. package/dist/components/fx-music.js +3 -3
  165. package/dist/components/fx-music.js.map +1 -1
  166. package/dist/components/fx-organic.cjs.map +1 -1
  167. package/dist/components/fx-organic.js +2 -2
  168. package/dist/components/fx-organic.js.map +1 -1
  169. package/dist/components/fx-paper.cjs.map +1 -1
  170. package/dist/components/fx-paper.js +2 -2
  171. package/dist/components/fx-paper.js.map +1 -1
  172. package/dist/components/fx-perf.cjs.map +1 -1
  173. package/dist/components/fx-perf.js +2 -2
  174. package/dist/components/fx-perf.js.map +1 -1
  175. package/dist/components/fx-physics.cjs.map +1 -1
  176. package/dist/components/fx-physics.js +2 -2
  177. package/dist/components/fx-physics.js.map +1 -1
  178. package/dist/components/fx-retro.cjs.map +1 -1
  179. package/dist/components/fx-retro.js +2 -2
  180. package/dist/components/fx-retro.js.map +1 -1
  181. package/dist/components/fx-safe.cjs.map +1 -1
  182. package/dist/components/fx-safe.js +2 -2
  183. package/dist/components/fx-safe.js.map +1 -1
  184. package/dist/components/fx-shop.cjs.map +1 -1
  185. package/dist/components/fx-shop.js +2 -2
  186. package/dist/components/fx-shop.js.map +1 -1
  187. package/dist/components/fx-social.cjs.map +1 -1
  188. package/dist/components/fx-social.js +2 -2
  189. package/dist/components/fx-social.js.map +1 -1
  190. package/dist/components/fx-spatial.cjs.map +1 -1
  191. package/dist/components/fx-spatial.js +2 -2
  192. package/dist/components/fx-spatial.js.map +1 -1
  193. package/dist/components/fx-surface.cjs.map +1 -1
  194. package/dist/components/fx-surface.js +2 -2
  195. package/dist/components/fx-surface.js.map +1 -1
  196. package/dist/components/fx-text.cjs.map +1 -1
  197. package/dist/components/fx-text.js +2 -2
  198. package/dist/components/fx-text.js.map +1 -1
  199. package/dist/components/fx-transitions.cjs.map +1 -1
  200. package/dist/components/fx-transitions.js +3 -3
  201. package/dist/components/fx-transitions.js.map +1 -1
  202. package/dist/components/fx-video.cjs.map +1 -1
  203. package/dist/components/fx-video.js +2 -2
  204. package/dist/components/fx-video.js.map +1 -1
  205. package/dist/components/fx-weather.cjs.map +1 -1
  206. package/dist/components/fx-weather.js +2 -2
  207. package/dist/components/fx-weather.js.map +1 -1
  208. package/dist/components/fx.cjs.map +1 -1
  209. package/dist/components/fx.js +6 -6
  210. package/dist/components/fx.js.map +1 -1
  211. package/dist/components/fx2.cjs.map +1 -1
  212. package/dist/components/fx2.js +6 -6
  213. package/dist/components/fx2.js.map +1 -1
  214. package/dist/components/gesture.cjs.map +1 -1
  215. package/dist/components/gesture.js +4 -4
  216. package/dist/components/gesture.js.map +1 -1
  217. package/dist/components/interaction.cjs.map +1 -1
  218. package/dist/components/interaction.js +1 -1
  219. package/dist/components/interaction.js.map +1 -1
  220. package/dist/components/layout.cjs.map +1 -1
  221. package/dist/components/layout.js +1 -1
  222. package/dist/components/layout.js.map +1 -1
  223. package/dist/components/lazy.cjs.map +1 -1
  224. package/dist/components/lazy.js.map +1 -1
  225. package/dist/components/lite.cjs.map +1 -1
  226. package/dist/components/lite.js.map +1 -1
  227. package/dist/components/marketplace.cjs.map +1 -1
  228. package/dist/components/marketplace.js +4 -4
  229. package/dist/components/marketplace.js.map +1 -1
  230. package/dist/components/native.cjs.map +1 -1
  231. package/dist/components/native.js +3 -3
  232. package/dist/components/native.js.map +1 -1
  233. package/dist/components/packs.cjs.map +1 -1
  234. package/dist/components/packs.js +1 -1
  235. package/dist/components/packs.js.map +1 -1
  236. package/dist/components/page.cjs.map +1 -1
  237. package/dist/components/page.js +3 -3
  238. package/dist/components/page.js.map +1 -1
  239. package/dist/components/perf.cjs.map +1 -1
  240. package/dist/components/perf.js +2 -2
  241. package/dist/components/perf.js.map +1 -1
  242. package/dist/components/physics.cjs.map +1 -1
  243. package/dist/components/physics.js +3 -3
  244. package/dist/components/physics.js.map +1 -1
  245. package/dist/components/plugins.cjs.map +1 -1
  246. package/dist/components/plugins.js +4 -4
  247. package/dist/components/plugins.js.map +1 -1
  248. package/dist/components/react.cjs.map +1 -1
  249. package/dist/components/react.js.map +1 -1
  250. package/dist/components/reveal.cjs.map +1 -1
  251. package/dist/components/reveal.js +1 -1
  252. package/dist/components/reveal.js.map +1 -1
  253. package/dist/components/solid.cjs.map +1 -1
  254. package/dist/components/solid.js +8 -8
  255. package/dist/components/solid.js.map +1 -1
  256. package/dist/components/svelte.cjs.map +1 -1
  257. package/dist/components/svelte.js +8 -8
  258. package/dist/components/svelte.js.map +1 -1
  259. package/dist/components/svg.cjs.map +1 -1
  260. package/dist/components/svg.js +1 -1
  261. package/dist/components/svg.js.map +1 -1
  262. package/dist/components/text.cjs.map +1 -1
  263. package/dist/components/text.js +2 -2
  264. package/dist/components/text.js.map +1 -1
  265. package/dist/components/timeline.cjs.map +1 -1
  266. package/dist/components/timeline.js +3 -3
  267. package/dist/components/timeline.js.map +1 -1
  268. package/dist/components/tokens.cjs.map +1 -1
  269. package/dist/components/tokens.js.map +1 -1
  270. package/dist/components/transitions.cjs.map +1 -1
  271. package/dist/components/transitions.js +1 -1
  272. package/dist/components/transitions.js.map +1 -1
  273. package/dist/components/ui.cjs.map +1 -1
  274. package/dist/components/ui.js +4 -4
  275. package/dist/components/ui.js.map +1 -1
  276. package/dist/components/vue.cjs.map +1 -1
  277. package/dist/components/vue.js +8 -8
  278. package/dist/components/vue.js.map +1 -1
  279. package/dist/components/webgl.cjs.map +1 -1
  280. package/dist/components/webgl.js +1 -1
  281. package/dist/components/webgl.js.map +1 -1
  282. package/dist/components/widgets.cjs +569 -216
  283. package/dist/components/widgets.cjs.map +1 -1
  284. package/dist/components/widgets.d.cts +167 -2
  285. package/dist/components/widgets.d.ts +167 -2
  286. package/dist/components/widgets.js +575 -225
  287. package/dist/components/widgets.js.map +1 -1
  288. package/dist/components.cjs.map +1 -1
  289. package/dist/components.js +10 -10
  290. package/dist/components.js.map +1 -1
  291. package/dist/element.cjs.map +1 -1
  292. package/dist/element.js.map +1 -1
  293. package/dist/index.cjs.map +1 -1
  294. package/dist/index.js +2 -2
  295. package/dist/index.js.map +1 -1
  296. package/dist/llms-full.txt +154 -1
  297. package/dist/llms.txt +9 -2
  298. package/dist/manifest.json +413 -1
  299. package/dist/presets/extended.cjs.map +1 -1
  300. package/dist/presets/extended.js.map +1 -1
  301. package/dist/react.cjs.map +1 -1
  302. package/dist/react.js.map +1 -1
  303. package/dist/runtime/format-apng.cjs +131 -0
  304. package/dist/runtime/format-apng.cjs.map +1 -0
  305. package/dist/runtime/format-apng.d.cts +250 -0
  306. package/dist/runtime/format-apng.d.ts +250 -0
  307. package/dist/runtime/format-apng.iife.js +2 -0
  308. package/dist/runtime/format-apng.iife.js.map +1 -0
  309. package/dist/runtime/format-apng.js +123 -0
  310. package/dist/runtime/format-apng.js.map +1 -0
  311. package/dist/runtime/format-css.cjs +5 -4
  312. package/dist/runtime/format-css.cjs.map +1 -1
  313. package/dist/runtime/format-css.js +5 -4
  314. package/dist/runtime/format-css.js.map +1 -1
  315. package/dist/runtime/format-gif.cjs +206 -0
  316. package/dist/runtime/format-gif.cjs.map +1 -0
  317. package/dist/runtime/format-gif.d.cts +223 -0
  318. package/dist/runtime/format-gif.d.ts +223 -0
  319. package/dist/runtime/format-gif.iife.js +2 -0
  320. package/dist/runtime/format-gif.iife.js.map +1 -0
  321. package/dist/runtime/format-gif.js +199 -0
  322. package/dist/runtime/format-gif.js.map +1 -0
  323. package/dist/runtime/format-motion.cjs +9 -8
  324. package/dist/runtime/format-motion.cjs.map +1 -1
  325. package/dist/runtime/format-motion.js +5 -4
  326. package/dist/runtime/format-motion.js.map +1 -1
  327. package/dist/runtime/format-sprite.cjs +4 -3
  328. package/dist/runtime/format-sprite.cjs.map +1 -1
  329. package/dist/runtime/format-sprite.js +4 -3
  330. package/dist/runtime/format-sprite.js.map +1 -1
  331. package/dist/runtime/format-svg.cjs +5 -4
  332. package/dist/runtime/format-svg.cjs.map +1 -1
  333. package/dist/runtime/format-svg.js +4 -3
  334. package/dist/runtime/format-svg.js.map +1 -1
  335. package/dist/runtime/format-webp.cjs +123 -0
  336. package/dist/runtime/format-webp.cjs.map +1 -0
  337. package/dist/runtime/format-webp.d.cts +245 -0
  338. package/dist/runtime/format-webp.d.ts +245 -0
  339. package/dist/runtime/format-webp.iife.js +2 -0
  340. package/dist/runtime/format-webp.iife.js.map +1 -0
  341. package/dist/runtime/format-webp.js +115 -0
  342. package/dist/runtime/format-webp.js.map +1 -0
  343. package/dist/runtime/scroll.cjs +2 -2
  344. package/dist/runtime/scroll.cjs.map +1 -1
  345. package/dist/runtime/scroll.js +2 -2
  346. package/dist/runtime/scroll.js.map +1 -1
  347. package/dist/runtime/smooth.cjs +284 -0
  348. package/dist/runtime/smooth.cjs.map +1 -0
  349. package/dist/runtime/smooth.d.cts +137 -0
  350. package/dist/runtime/smooth.d.ts +137 -0
  351. package/dist/runtime/smooth.iife.js +2 -0
  352. package/dist/runtime/smooth.iife.js.map +1 -0
  353. package/dist/runtime/smooth.js +279 -0
  354. package/dist/runtime/smooth.js.map +1 -0
  355. package/dist/runtime/text.cjs +1 -1
  356. package/dist/runtime/text.cjs.map +1 -1
  357. package/dist/runtime/text.js +1 -1
  358. package/dist/runtime/text.js.map +1 -1
  359. package/dist/runtime.cjs +9 -8
  360. package/dist/runtime.cjs.map +1 -1
  361. package/dist/runtime.d.cts +1 -1
  362. package/dist/runtime.d.ts +1 -1
  363. package/dist/runtime.iife.js +1 -1
  364. package/dist/runtime.iife.js.map +1 -1
  365. package/dist/runtime.js +6 -5
  366. package/dist/runtime.js.map +1 -1
  367. package/dist/solid.cjs.map +1 -1
  368. package/dist/solid.js.map +1 -1
  369. package/dist/svelte.cjs.map +1 -1
  370. package/dist/svelte.js.map +1 -1
  371. package/dist/vue.cjs.map +1 -1
  372. package/dist/vue.js.map +1 -1
  373. package/dist/widgets.umd.js +1 -1
  374. package/dist/widgets.umd.js.map +1 -1
  375. package/docs/ROADMAP.md +1 -1
  376. package/docs/components/README.md +10 -7
  377. package/docs/components/usa-parallax-layers.md +38 -0
  378. package/docs/components/usa-scroll-ring.md +32 -0
  379. package/docs/components/usa-smooth-scroll.md +60 -0
  380. package/docs/components.md +49 -0
  381. package/docs/mcp.md +50 -0
  382. package/docs/runtime/format-apng.md +59 -0
  383. package/docs/runtime/format-gif.md +60 -0
  384. package/docs/runtime/format-webp.md +58 -0
  385. package/docs/runtime/smooth.md +60 -0
  386. package/package.json +44 -2
  387. package/dist/chunks/keyframes-DVAC5sQI.js.map +0 -1
  388. package/dist/chunks/keyframes-Dw9zwVQa.cjs.map +0 -1
  389. package/dist/chunks/tween-CFN0WcOb.cjs.map +0 -1
  390. package/dist/chunks/tween-CGyolmzB.js.map +0 -1
@@ -0,0 +1,199 @@
1
+ import { R as RUNTIME_VERSION } from '../chunks/registry-CT-TT_bx.js';
2
+ import { a as animatedImagePlayer, u as u8, c as composeFrames, d as bytesOf, f as fixDelay } from '../chunks/anim-image-DDdb9q3X.js';
3
+ import '../chunks/tween-BcejKpsx.js';
4
+ import '../chunks/ticker-C8lSGml9.js';
5
+ import '../chunks/ease-XN8_0sXu.js';
6
+
7
+ /**
8
+ * `motionary/runtime/format-gif` (10.4) — a complete GIF decoder written for
9
+ * Motionary (own LZW implementation, no dependencies, no DOM): GIF87a / GIF89a,
10
+ * global and local palettes, transparency, interlaced frames, disposal
11
+ * methods 0–3, per-frame delays and the NETSCAPE2.0 loop count. Frames are
12
+ * composited to full-size RGBA, so they can be drawn, scrubbed or reversed
13
+ * with `animatedImagePlayer()` (a runtime timeline).
14
+ *
15
+ * ```ts
16
+ * import { use } from 'motionary/runtime';
17
+ * import { formatGif, loadGif, animatedImagePlayer } from 'motionary/runtime/format-gif';
18
+ * use(formatGif);
19
+ * const gif = await loadGif('/loader.gif');
20
+ * const player = animatedImagePlayer(canvas, gif); // player.pause(); player.progress = 0.5
21
+ * ```
22
+ */
23
+ /** LZW-decode GIF image data into palette indices (exported for tests / tools). */
24
+ function lzwDecode(minCodeSize, data, pixelCount) {
25
+ const out = new Uint8Array(pixelCount);
26
+ const clear = 1 << minCodeSize, eoi = clear + 1;
27
+ const prefix = new Uint16Array(4096), suffix = new Uint8Array(4096), stack = new Uint8Array(4097);
28
+ let size = minCodeSize + 1, mask = (1 << size) - 1, next = eoi + 1;
29
+ let old = -1, first = 0, bits = 0, acc = 0, op = 0, pos = 0;
30
+ for (let i = 0; i < clear; i++)
31
+ suffix[i] = i;
32
+ while (op < pixelCount) {
33
+ while (bits < size) {
34
+ if (pos >= data.length)
35
+ return out; // truncated data: keep what we have
36
+ acc |= data[pos++] << bits;
37
+ bits += 8;
38
+ }
39
+ const code = acc & mask;
40
+ acc >>>= size;
41
+ bits -= size;
42
+ if (code === clear) {
43
+ size = minCodeSize + 1;
44
+ mask = (1 << size) - 1;
45
+ next = eoi + 1;
46
+ old = -1;
47
+ continue;
48
+ }
49
+ if (code === eoi)
50
+ break;
51
+ if (old === -1) {
52
+ out[op++] = suffix[code];
53
+ old = first = code;
54
+ continue;
55
+ }
56
+ let c = code, sp = 0;
57
+ if (code >= next) {
58
+ stack[sp++] = first;
59
+ c = old;
60
+ }
61
+ while (c >= clear) {
62
+ stack[sp++] = suffix[c];
63
+ c = prefix[c];
64
+ }
65
+ first = suffix[c];
66
+ stack[sp++] = first;
67
+ while (sp && op < pixelCount)
68
+ out[op++] = stack[--sp];
69
+ if (next < 4096) {
70
+ prefix[next] = old;
71
+ suffix[next] = first;
72
+ next++;
73
+ if (next > mask && size < 12) {
74
+ size++;
75
+ mask = (1 << size) - 1;
76
+ }
77
+ }
78
+ old = code;
79
+ }
80
+ return out;
81
+ }
82
+ const DISPOSE = ['none', 'none', 'background', 'previous'];
83
+ /** Decode a GIF (bytes) into composited RGBA frames. Pure: no DOM, works in workers / Node. */
84
+ function decodeGif(input) {
85
+ const b = u8(input);
86
+ const sig = String.fromCharCode(...b.subarray(0, 6));
87
+ if (sig !== 'GIF87a' && sig !== 'GIF89a')
88
+ throw new Error('[motionary] format-gif: not a GIF file');
89
+ const width = b[6] | (b[7] << 8), height = b[8] | (b[9] << 8), flags = b[10];
90
+ let p = 13, gct = null;
91
+ if (flags & 0x80) {
92
+ const n = 3 << ((flags & 7) + 1);
93
+ gct = b.subarray(p, p + n);
94
+ p += n;
95
+ }
96
+ const parts = [];
97
+ let loopCount = null, delay = 0, transparent = -1, disposal = 0;
98
+ const blocks = () => {
99
+ const chunks = [];
100
+ let len = 0;
101
+ while (p < b.length) {
102
+ const n = b[p++];
103
+ if (!n)
104
+ break;
105
+ chunks.push(b.subarray(p, p + n));
106
+ len += n;
107
+ p += n;
108
+ }
109
+ const outB = new Uint8Array(len);
110
+ let o = 0;
111
+ for (const c of chunks) {
112
+ outB.set(c, o);
113
+ o += c.length;
114
+ }
115
+ return outB;
116
+ };
117
+ while (p < b.length) {
118
+ const t = b[p++];
119
+ if (t === 0x3b)
120
+ break; // trailer
121
+ if (t === 0x21) {
122
+ const label = b[p++];
123
+ if (label === 0xf9) {
124
+ const d = blocks();
125
+ disposal = (d[0] >> 2) & 7;
126
+ delay = (d[1] | (d[2] << 8)) * 10;
127
+ transparent = d[0] & 1 ? d[3] : -1;
128
+ }
129
+ else if (label === 0xff) {
130
+ const id = String.fromCharCode(...b.subarray(p + 1, p + 12));
131
+ const d = blocks();
132
+ if ((id === 'NETSCAPE2.0' || id === 'ANIMEXTS1.0') && d.length >= 14 && d[11] === 1)
133
+ loopCount = d[12] | (d[13] << 8);
134
+ }
135
+ else
136
+ blocks();
137
+ continue;
138
+ }
139
+ if (t !== 0x2c)
140
+ break; // unknown block: stop (corrupt tail)
141
+ const x = b[p] | (b[p + 1] << 8), y = b[p + 2] | (b[p + 3] << 8), w = b[p + 4] | (b[p + 5] << 8), h = b[p + 6] | (b[p + 7] << 8), f = b[p + 8];
142
+ p += 9;
143
+ let pal = gct;
144
+ if (f & 0x80) {
145
+ const n = 3 << ((f & 7) + 1);
146
+ pal = b.subarray(p, p + n);
147
+ p += n;
148
+ }
149
+ const minCode = b[p++];
150
+ const idx = lzwDecode(minCode, blocks(), w * h);
151
+ const rows = new Uint32Array(h);
152
+ if (f & 0x40) {
153
+ // interlaced: rows come in 4 passes (every 8th from 0, every 8th from 4, every 4th from 2, every 2nd from 1)
154
+ let r = 0;
155
+ for (const [start, step] of [[0, 8], [4, 8], [2, 4], [1, 2]])
156
+ for (let yy = start; yy < h; yy += step)
157
+ rows[r++] = yy;
158
+ }
159
+ else
160
+ for (let yy = 0; yy < h; yy++)
161
+ rows[yy] = yy;
162
+ const data = new Uint8ClampedArray(w * h * 4);
163
+ for (let r = 0; r < h; r++) {
164
+ const dy = rows[r];
165
+ for (let xx = 0; xx < w; xx++) {
166
+ const ci = idx[r * w + xx], o = (dy * w + xx) * 4;
167
+ if (ci === transparent || !pal || ci * 3 + 2 >= pal.length)
168
+ continue;
169
+ data[o] = pal[ci * 3];
170
+ data[o + 1] = pal[ci * 3 + 1];
171
+ data[o + 2] = pal[ci * 3 + 2];
172
+ data[o + 3] = 255;
173
+ }
174
+ }
175
+ parts.push({ x, y, image: { width: w, height: h, data }, delay: fixDelay(delay), blend: 'over', dispose: DISPOSE[disposal] || 'none' });
176
+ delay = 0;
177
+ transparent = -1;
178
+ disposal = 0;
179
+ }
180
+ // like browsers, "restore to background" clears to transparent
181
+ const frames = composeFrames(width, height, parts);
182
+ return {
183
+ format: 'gif',
184
+ width,
185
+ height,
186
+ plays: loopCount === null ? 1 : loopCount === 0 ? 0 : loopCount + 1,
187
+ frames,
188
+ info: { version: sig.slice(3), width, height, loopCount, frameCount: frames.length },
189
+ };
190
+ }
191
+ /** Fetch (URL) or read (ArrayBuffer / Blob / bytes) and decode a GIF. */
192
+ async function loadGif(src) {
193
+ return decodeGif(await bytesOf(src));
194
+ }
195
+ /** The module object for `use(formatGif)`. */
196
+ const formatGif = { id: 'format-gif', version: RUNTIME_VERSION, requires: ['core'], api: { decodeGif, loadGif, lzwDecode, animatedImagePlayer } };
197
+
198
+ export { animatedImagePlayer, composeFrames, decodeGif, formatGif, loadGif, lzwDecode };
199
+ //# sourceMappingURL=format-gif.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-gif.js","sources":["../../src/runtime/format-gif.ts"],"sourcesContent":["/**\n * `motionary/runtime/format-gif` (10.4) — a complete GIF decoder written for\n * Motionary (own LZW implementation, no dependencies, no DOM): GIF87a / GIF89a,\n * global and local palettes, transparency, interlaced frames, disposal\n * methods 0–3, per-frame delays and the NETSCAPE2.0 loop count. Frames are\n * composited to full-size RGBA, so they can be drawn, scrubbed or reversed\n * with `animatedImagePlayer()` (a runtime timeline).\n *\n * ```ts\n * import { use } from 'motionary/runtime';\n * import { formatGif, loadGif, animatedImagePlayer } from 'motionary/runtime/format-gif';\n * use(formatGif);\n * const gif = await loadGif('/loader.gif');\n * const player = animatedImagePlayer(canvas, gif); // player.pause(); player.progress = 0.5\n * ```\n */\nimport { RUNTIME_VERSION, type RuntimeModule } from './registry';\nimport { composeFrames, fixDelay, bytesOf, animatedImagePlayer, u8, type AnimatedImage, type FramePart } from './anim-image';\n\nexport type { AnimatedImage, AnimFrame, Rgba, AnimPlayer, AnimPlayerOptions } from './anim-image';\nexport { animatedImagePlayer, composeFrames } from './anim-image';\n\n/** LZW-decode GIF image data into palette indices (exported for tests / tools). */\nexport function lzwDecode(minCodeSize: number, data: Uint8Array, pixelCount: number): Uint8Array {\n const out = new Uint8Array(pixelCount);\n const clear = 1 << minCodeSize, eoi = clear + 1;\n const prefix = new Uint16Array(4096), suffix = new Uint8Array(4096), stack = new Uint8Array(4097);\n let size = minCodeSize + 1, mask = (1 << size) - 1, next = eoi + 1;\n let old = -1, first = 0, bits = 0, acc = 0, op = 0, pos = 0;\n for (let i = 0; i < clear; i++) suffix[i] = i;\n while (op < pixelCount) {\n while (bits < size) {\n if (pos >= data.length) return out; // truncated data: keep what we have\n acc |= data[pos++] << bits;\n bits += 8;\n }\n const code = acc & mask;\n acc >>>= size;\n bits -= size;\n if (code === clear) {\n size = minCodeSize + 1; mask = (1 << size) - 1; next = eoi + 1; old = -1;\n continue;\n }\n if (code === eoi) break;\n if (old === -1) {\n out[op++] = suffix[code];\n old = first = code;\n continue;\n }\n let c = code, sp = 0;\n if (code >= next) {\n stack[sp++] = first;\n c = old;\n }\n while (c >= clear) {\n stack[sp++] = suffix[c];\n c = prefix[c];\n }\n first = suffix[c];\n stack[sp++] = first;\n while (sp && op < pixelCount) out[op++] = stack[--sp];\n if (next < 4096) {\n prefix[next] = old;\n suffix[next] = first;\n next++;\n if (next > mask && size < 12) {\n size++;\n mask = (1 << size) - 1;\n }\n }\n old = code;\n }\n return out;\n}\n\nexport interface GifInfo {\n version: '87a' | '89a';\n width: number;\n height: number;\n /** NETSCAPE2.0 loop count (0 = forever), or null when the file has none (plays once). */\n loopCount: number | null;\n frameCount: number;\n}\n\nconst DISPOSE: FramePart['dispose'][] = ['none', 'none', 'background', 'previous'];\n\n/** Decode a GIF (bytes) into composited RGBA frames. Pure: no DOM, works in workers / Node. */\nexport function decodeGif(input: Uint8Array | ArrayBuffer): AnimatedImage & { info: GifInfo } {\n const b = u8(input);\n const sig = String.fromCharCode(...b.subarray(0, 6));\n if (sig !== 'GIF87a' && sig !== 'GIF89a') throw new Error('[motionary] format-gif: not a GIF file');\n const width = b[6] | (b[7] << 8), height = b[8] | (b[9] << 8), flags = b[10];\n let p = 13, gct: Uint8Array | null = null;\n if (flags & 0x80) {\n const n = 3 << ((flags & 7) + 1);\n gct = b.subarray(p, p + n);\n p += n;\n }\n const parts: FramePart[] = [];\n let loopCount: number | null = null, delay = 0, transparent = -1, disposal = 0;\n const blocks = (): Uint8Array => {\n const chunks: Uint8Array[] = [];\n let len = 0;\n while (p < b.length) {\n const n = b[p++];\n if (!n) break;\n chunks.push(b.subarray(p, p + n));\n len += n;\n p += n;\n }\n const outB = new Uint8Array(len);\n let o = 0;\n for (const c of chunks) {\n outB.set(c, o);\n o += c.length;\n }\n return outB;\n };\n while (p < b.length) {\n const t = b[p++];\n if (t === 0x3b) break; // trailer\n if (t === 0x21) {\n const label = b[p++];\n if (label === 0xf9) {\n const d = blocks();\n disposal = (d[0] >> 2) & 7;\n delay = (d[1] | (d[2] << 8)) * 10;\n transparent = d[0] & 1 ? d[3] : -1;\n } else if (label === 0xff) {\n const id = String.fromCharCode(...b.subarray(p + 1, p + 12));\n const d = blocks();\n if ((id === 'NETSCAPE2.0' || id === 'ANIMEXTS1.0') && d.length >= 14 && d[11] === 1) loopCount = d[12] | (d[13] << 8);\n } else blocks();\n continue;\n }\n if (t !== 0x2c) break; // unknown block: stop (corrupt tail)\n const x = b[p] | (b[p + 1] << 8), y = b[p + 2] | (b[p + 3] << 8), w = b[p + 4] | (b[p + 5] << 8), h = b[p + 6] | (b[p + 7] << 8), f = b[p + 8];\n p += 9;\n let pal = gct;\n if (f & 0x80) {\n const n = 3 << ((f & 7) + 1);\n pal = b.subarray(p, p + n);\n p += n;\n }\n const minCode = b[p++];\n const idx = lzwDecode(minCode, blocks(), w * h);\n const rows = new Uint32Array(h);\n if (f & 0x40) {\n // interlaced: rows come in 4 passes (every 8th from 0, every 8th from 4, every 4th from 2, every 2nd from 1)\n let r = 0;\n for (const [start, step] of [[0, 8], [4, 8], [2, 4], [1, 2]]) for (let yy = start; yy < h; yy += step) rows[r++] = yy;\n } else for (let yy = 0; yy < h; yy++) rows[yy] = yy;\n const data = new Uint8ClampedArray(w * h * 4);\n for (let r = 0; r < h; r++) {\n const dy = rows[r];\n for (let xx = 0; xx < w; xx++) {\n const ci = idx[r * w + xx], o = (dy * w + xx) * 4;\n if (ci === transparent || !pal || ci * 3 + 2 >= pal.length) continue;\n data[o] = pal[ci * 3]; data[o + 1] = pal[ci * 3 + 1]; data[o + 2] = pal[ci * 3 + 2]; data[o + 3] = 255;\n }\n }\n parts.push({ x, y, image: { width: w, height: h, data }, delay: fixDelay(delay), blend: 'over', dispose: DISPOSE[disposal] || 'none' });\n delay = 0; transparent = -1; disposal = 0;\n }\n // like browsers, \"restore to background\" clears to transparent\n const frames = composeFrames(width, height, parts);\n return {\n format: 'gif',\n width,\n height,\n plays: loopCount === null ? 1 : loopCount === 0 ? 0 : loopCount + 1,\n frames,\n info: { version: sig.slice(3) as '87a' | '89a', width, height, loopCount, frameCount: frames.length },\n };\n}\n\n/** Fetch (URL) or read (ArrayBuffer / Blob / bytes) and decode a GIF. */\nexport async function loadGif(src: string | ArrayBuffer | ArrayBufferView | Blob): Promise<AnimatedImage & { info: GifInfo }> {\n return decodeGif(await bytesOf(src));\n}\n\nexport interface FormatGifApi {\n decodeGif: typeof decodeGif;\n loadGif: typeof loadGif;\n lzwDecode: typeof lzwDecode;\n animatedImagePlayer: typeof animatedImagePlayer;\n}\n\n/** The module object for `use(formatGif)`. */\nexport const formatGif: RuntimeModule<FormatGifApi> = { id: 'format-gif', version: RUNTIME_VERSION, requires: ['core'], api: { decodeGif, loadGif, lzwDecode, animatedImagePlayer } };\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;AAeG;AAOH;SACgB,SAAS,CAAC,WAAmB,EAAE,IAAgB,EAAE,UAAkB,EAAA;AACjF,IAAA,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,UAAU,CAAC;IACtC,MAAM,KAAK,GAAG,CAAC,IAAI,WAAW,EAAE,GAAG,GAAG,KAAK,GAAG,CAAC;IAC/C,MAAM,MAAM,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,KAAK,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC;IACjG,IAAI,IAAI,GAAG,WAAW,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,IAAI,GAAG,GAAG,GAAG,CAAC;IAClE,IAAI,GAAG,GAAG,EAAE,EAAE,KAAK,GAAG,CAAC,EAAE,IAAI,GAAG,CAA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AAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI,MAAM,EAAE,CAAC;QACvI,KAAK,GAAG,CAAC;QAAE,WAAW,GAAG,EAAE;QAAE,QAAQ,GAAG,CAAC;IAC3C;;IAEA,MAAM,MAAM,GAAG,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC;IAClD,OAAO;AACL,QAAA,MAAM,EAAE,KAAK;QACb,KAAK;QACL,MAAM;QACN,KAAK,EAAE,SAAS,KAAK,IAAI,GAAG,CAAC,GAAG,SAAS,KAAK,CAAC,GAAG,CAAC,GAAG,SAAS,GAAG,CAAC;QACnE,MAAM;QACN,IAAI,EAAE,EAAE,OAAO,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAkB,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE;KACtG;AACH;AAEA;AACO,eAAe,OAAO,CAAC,GAAkD,EAAA;IAC9E,OAAO,SAAS,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;AACtC;AASA;AACO,MAAM,SAAS,GAAgC,EAAE,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE;;"}
@@ -1,9 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var registry = require('../chunks/registry-CSVil2qJ.cjs');
4
- var tween = require('../chunks/tween-CFN0WcOb.cjs');
5
- var keyframes = require('../chunks/keyframes-Dw9zwVQa.cjs');
6
- require('../chunks/ticker-gHv6pNfx.cjs');
3
+ var registry = require('../chunks/registry-tzwKkldE.cjs');
4
+ var tween = require('../chunks/tween-CwLLC3Ko.cjs');
5
+ var ease = require('../chunks/ease-HwYZnZat.cjs');
6
+ var keyframes = require('../chunks/keyframes-tC3I7anQ.cjs');
7
+ require('../chunks/ticker-Un0bvTWR.cjs');
7
8
 
8
9
  /**
9
10
  * `motionary/runtime/format-motion` (10.1) — play Motion / Framer-style
@@ -29,13 +30,13 @@ const NAMES = { linear: 'linear', easeIn: 'cubic-in', easeOut: 'cubic-out', ease
29
30
  /** A Motion ease → runtime ease. */
30
31
  function motionEase(e) {
31
32
  if (Array.isArray(e))
32
- return tween.cubicBezier(e[0], e[1], e[2], e[3]);
33
+ return ease.cubicBezier(e[0], e[1], e[2], e[3]);
33
34
  if (!e)
34
- return tween.EASES['cubic-out'];
35
+ return ease.EASES['cubic-out'];
35
36
  const n = NAMES[e] || e;
36
- if (!tween.EASES[n])
37
+ if (!ease.EASES[n])
37
38
  throw new Error(`[motionary] format-motion: unknown ease "${e}"`);
38
- return tween.EASES[n];
39
+ return ease.EASES[n];
39
40
  }
40
41
  /** Simulate a damped spring (unit step) → [ease, duration ms]. */
41
42
  function springEase(o) {
@@ -1 +1 @@
1
- {"version":3,"file":"format-motion.cjs","sources":["../../src/runtime/format-motion.ts"],"sourcesContent":["/**\n * `motionary/runtime/format-motion` (10.1) — play Motion / Framer-style\n * keyframe JSON with the runtime:\n *\n * ```json\n * { \"initial\": { \"opacity\": 0, \"y\": 40 },\n * \"animate\": { \"opacity\": 1, \"y\": [40, -8, 0], \"rotate\": 0 },\n * \"transition\": { \"duration\": 0.6, \"ease\": \"easeOut\", \"times\": [0, 0.7, 1], \"delay\": 0.1,\n * \"repeat\": 1, \"repeatType\": \"reverse\", \"opacity\": { \"duration\": 0.3 } } }\n * ```\n *\n * Supported: `initial` / `animate` (numbers, unit strings, colours, arrays as\n * keyframes), the transform shorthands `x y scale scaleX scaleY rotate skewX skewY`,\n * transition `duration` / `delay` (seconds) / `ease` (names or `[x1, y1, x2, y2]`) /\n * `times` / `repeat` (`Infinity` ok) / `repeatType` (`loop`, `reverse`, `mirror`),\n * per-property transitions, and `type: \"spring\"` (`stiffness`, `damping`, `mass`,\n * or `bounce` + `duration`) simulated into an easing curve.\n * Not supported: `layout`, gestures (`whileHover` …), variants propagation,\n * `staggerChildren` (use the runtime timeline `stagger`).\n */\nimport { RUNTIME_VERSION, type RuntimeModule } from './registry';\nimport { Timeline, type Target } from './tween';\nimport { cubicBezier, type Ease, EASES } from './ease';\nimport { framesToTimeline, type Frame } from './keyframes';\n\ntype V = number | string;\nexport interface MotionTransition {\n duration?: number;\n delay?: number;\n ease?: string | number[] | (string | number[])[];\n times?: number[];\n repeat?: number;\n repeatType?: 'loop' | 'reverse' | 'mirror';\n type?: 'tween' | 'spring' | 'keyframes' | 'inertia';\n stiffness?: number;\n damping?: number;\n mass?: number;\n bounce?: number;\n [prop: string]: unknown;\n}\nexport interface MotionDef {\n initial?: Record<string, V> | false;\n animate: Record<string, V | V[]>;\n transition?: MotionTransition;\n}\n\nconst NAMES: Record<string, string> = { linear: 'linear', easeIn: 'cubic-in', easeOut: 'cubic-out', easeInOut: 'cubic-in-out', circIn: 'circ-in', circOut: 'circ-out', circInOut: 'circ-in-out', backIn: 'back-in', backOut: 'back-out', backInOut: 'back-in-out', anticipate: 'back-in-out' };\n\n/** A Motion ease → runtime ease. */\nexport function motionEase(e: string | number[] | undefined): Ease {\n if (Array.isArray(e)) return cubicBezier(e[0], e[1], e[2], e[3]);\n if (!e) return EASES['cubic-out'];\n const n = NAMES[e] || e;\n if (!EASES[n]) throw new Error(`[motionary] format-motion: unknown ease \"${e}\"`);\n return EASES[n];\n}\n\n/** Simulate a damped spring (unit step) → [ease, duration ms]. */\nexport function springEase(o: { stiffness?: number; damping?: number; mass?: number; bounce?: number; duration?: number }): [Ease, number] {\n let k = o.stiffness ?? 100, c = o.damping ?? 10;\n const m = o.mass ?? 1;\n if (o.bounce !== undefined && o.duration !== undefined) {\n // map bounce + duration to stiffness / damping (critical damping at bounce 0)\n const zeta = 1 - Math.min(0.95, Math.max(0, o.bounce));\n const w = (2 * Math.PI) / Math.max(0.05, o.duration);\n k = m * w * w;\n c = 2 * zeta * Math.sqrt(k * m);\n }\n const dt = 1 / 120;\n const samples: number[] = [0];\n let x = 0, v = 0, t = 0, still = 0;\n while (t < 10) {\n const a = (-k * (x - 1) - c * v) / m;\n v += a * dt;\n x += v * dt;\n t += dt;\n samples.push(x);\n if (Math.abs(x - 1) < 0.001 && Math.abs(v) < 0.01) { if (++still > 12) break; } else still = 0;\n }\n const n = samples.length - 1;\n samples[n] = 1;\n const ease: Ease = (p) => {\n if (p <= 0) return 0;\n if (p >= 1) return 1;\n const f = p * n, i = Math.floor(f);\n return samples[i] + (samples[i + 1] - samples[i]) * (f - i);\n };\n return [ease, Math.round(t * 1000)];\n}\n\n/** Motion def → one keyframe track per transition group (`[frames, transition]`). */\nexport function fromMotion(def: MotionDef): { frames: Frame[]; transition: MotionTransition; props: string[] }[] {\n const base = def.transition || {};\n const groups = new Map<string, string[]>();\n for (const k of Object.keys(def.animate)) {\n const own = base[k] && typeof base[k] === 'object' ? k : '';\n groups.set(own, [...(groups.get(own) || []), k]);\n }\n return Array.from(groups.entries()).map(([g, props]) => {\n const tr: MotionTransition = g ? { ...base, ...(base[g] as MotionTransition) } : base;\n const len = Math.max(...props.map((p) => (Array.isArray(def.animate[p]) ? (def.animate[p] as V[]).length : 1)));\n const n = Math.max(2, len);\n const times = tr.times && tr.times.length === n ? tr.times : Array.from({ length: n }, (_, i) => i / (n - 1));\n const frames: Frame[] = times.map((offset) => ({ offset, props: {} }));\n for (const p of props) {\n const v = def.animate[p];\n const arr = Array.isArray(v) ? v : [def.initial && p in def.initial ? def.initial[p] : undefined, v];\n const list = arr.length === n ? arr : [...Array(n - arr.length).fill(arr[0]), ...arr];\n list.forEach((x, i) => { if (x !== undefined && x !== null) frames[i].props[p] = x as V; });\n }\n if (Array.isArray(tr.ease) && tr.ease.length && (Array.isArray(tr.ease[0]) || typeof tr.ease[0] === 'string')) {\n (tr.ease as (string | number[])[]).forEach((e, i) => { if (frames[i]) frames[i].easing = Array.isArray(e) ? `cubic-bezier(${e.join(',')})` : NAMES[e] || e; });\n }\n return { frames, transition: tr, props };\n });\n}\n\n/**\n * Apply `initial` immediately and play `animate` with the transition.\n * Returns a runtime `Timeline` (one child per transition group), playing unless `paused`.\n */\nexport function playMotion(target: Target, def: MotionDef, o: { paused?: boolean } = {}): Timeline {\n const tl = new Timeline({});\n if (def.initial) for (const [k, v] of Object.entries(def.initial)) framesToTimeline(target, [{ offset: 0, props: { [k]: v } }], { duration: 0 }).seek(0);\n for (const { frames, transition: tr } of fromMotion(def)) {\n let ease: Ease | undefined;\n let dur = (tr.duration ?? 0.3) * 1000;\n if (tr.type === 'spring') [ease, dur] = springEase({ ...tr, duration: tr.duration });\n else if (!Array.isArray(tr.ease) || typeof tr.ease[0] === 'number') ease = motionEase(tr.ease as string | number[] | undefined);\n const rep = tr.repeat === Infinity ? -1 : tr.repeat || 0;\n const child = framesToTimeline(target, frames, { duration: dur, ease, repeat: rep, yoyo: rep !== 0 && tr.repeatType !== 'loop' && !!tr.repeatType });\n tl.add(child, (tr.delay || 0) * 1000);\n }\n if (!o.paused) tl.play();\n return tl;\n}\n\nexport interface FormatMotionApi {\n fromMotion: typeof fromMotion;\n playMotion: typeof playMotion;\n springEase: typeof springEase;\n motionEase: typeof motionEase;\n}\n\n/** The module object for `use(formatMotion)`. */\nexport const formatMotion: RuntimeModule<FormatMotionApi> = { id: 'format-motion', version: RUNTIME_VERSION, requires: ['core'], api: { fromMotion, playMotion, springEase, motionEase } };\n"],"names":["cubicBezier","EASES","Timeline","framesToTimeline","RUNTIME_VERSION"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;;;;;;;AAmBG;AA2BH,MAAM,KAAK,GAA2B,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,E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AAE,EAAE,EAAE,eAAe,EAAE,OAAO,EAAEC,wBAAe,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE;;;;;;;;"}
1
+ {"version":3,"file":"format-motion.cjs","sources":["../../src/runtime/format-motion.ts"],"sourcesContent":["/**\n * `motionary/runtime/format-motion` (10.1) — play Motion / Framer-style\n * keyframe JSON with the runtime:\n *\n * ```json\n * { \"initial\": { \"opacity\": 0, \"y\": 40 },\n * \"animate\": { \"opacity\": 1, \"y\": [40, -8, 0], \"rotate\": 0 },\n * \"transition\": { \"duration\": 0.6, \"ease\": \"easeOut\", \"times\": [0, 0.7, 1], \"delay\": 0.1,\n * \"repeat\": 1, \"repeatType\": \"reverse\", \"opacity\": { \"duration\": 0.3 } } }\n * ```\n *\n * Supported: `initial` / `animate` (numbers, unit strings, colours, arrays as\n * keyframes), the transform shorthands `x y scale scaleX scaleY rotate skewX skewY`,\n * transition `duration` / `delay` (seconds) / `ease` (names or `[x1, y1, x2, y2]`) /\n * `times` / `repeat` (`Infinity` ok) / `repeatType` (`loop`, `reverse`, `mirror`),\n * per-property transitions, and `type: \"spring\"` (`stiffness`, `damping`, `mass`,\n * or `bounce` + `duration`) simulated into an easing curve.\n * Not supported: `layout`, gestures (`whileHover` …), variants propagation,\n * `staggerChildren` (use the runtime timeline `stagger`).\n */\nimport { RUNTIME_VERSION, type RuntimeModule } from './registry';\nimport { Timeline, type Target } from './tween';\nimport { cubicBezier, type Ease, EASES } from './ease';\nimport { framesToTimeline, type Frame } from './keyframes';\n\ntype V = number | string;\nexport interface MotionTransition {\n duration?: number;\n delay?: number;\n ease?: string | number[] | (string | number[])[];\n times?: number[];\n repeat?: number;\n repeatType?: 'loop' | 'reverse' | 'mirror';\n type?: 'tween' | 'spring' | 'keyframes' | 'inertia';\n stiffness?: number;\n damping?: number;\n mass?: number;\n bounce?: number;\n [prop: string]: unknown;\n}\nexport interface MotionDef {\n initial?: Record<string, V> | false;\n animate: Record<string, V | V[]>;\n transition?: MotionTransition;\n}\n\nconst NAMES: Record<string, string> = { linear: 'linear', easeIn: 'cubic-in', easeOut: 'cubic-out', easeInOut: 'cubic-in-out', circIn: 'circ-in', circOut: 'circ-out', circInOut: 'circ-in-out', backIn: 'back-in', backOut: 'back-out', backInOut: 'back-in-out', anticipate: 'back-in-out' };\n\n/** A Motion ease → runtime ease. */\nexport function motionEase(e: string | number[] | undefined): Ease {\n if (Array.isArray(e)) return cubicBezier(e[0], e[1], e[2], e[3]);\n if (!e) return EASES['cubic-out'];\n const n = NAMES[e] || e;\n if (!EASES[n]) throw new Error(`[motionary] format-motion: unknown ease \"${e}\"`);\n return EASES[n];\n}\n\n/** Simulate a damped spring (unit step) → [ease, duration ms]. */\nexport function springEase(o: { stiffness?: number; damping?: number; mass?: number; bounce?: number; duration?: number }): [Ease, number] {\n let k = o.stiffness ?? 100, c = o.damping ?? 10;\n const m = o.mass ?? 1;\n if (o.bounce !== undefined && o.duration !== undefined) {\n // map bounce + duration to stiffness / damping (critical damping at bounce 0)\n const zeta = 1 - Math.min(0.95, Math.max(0, o.bounce));\n const w = (2 * Math.PI) / Math.max(0.05, o.duration);\n k = m * w * w;\n c = 2 * zeta * Math.sqrt(k * m);\n }\n const dt = 1 / 120;\n const samples: number[] = [0];\n let x = 0, v = 0, t = 0, still = 0;\n while (t < 10) {\n const a = (-k * (x - 1) - c * v) / m;\n v += a * dt;\n x += v * dt;\n t += dt;\n samples.push(x);\n if (Math.abs(x - 1) < 0.001 && Math.abs(v) < 0.01) { if (++still > 12) break; } else still = 0;\n }\n const n = samples.length - 1;\n samples[n] = 1;\n const ease: Ease = (p) => {\n if (p <= 0) return 0;\n if (p >= 1) return 1;\n const f = p * n, i = Math.floor(f);\n return samples[i] + (samples[i + 1] - samples[i]) * (f - i);\n };\n return [ease, Math.round(t * 1000)];\n}\n\n/** Motion def → one keyframe track per transition group (`[frames, transition]`). */\nexport function fromMotion(def: MotionDef): { frames: Frame[]; transition: MotionTransition; props: string[] }[] {\n const base = def.transition || {};\n const groups = new Map<string, string[]>();\n for (const k of Object.keys(def.animate)) {\n const own = base[k] && typeof base[k] === 'object' ? k : '';\n groups.set(own, [...(groups.get(own) || []), k]);\n }\n return Array.from(groups.entries()).map(([g, props]) => {\n const tr: MotionTransition = g ? { ...base, ...(base[g] as MotionTransition) } : base;\n const len = Math.max(...props.map((p) => (Array.isArray(def.animate[p]) ? (def.animate[p] as V[]).length : 1)));\n const n = Math.max(2, len);\n const times = tr.times && tr.times.length === n ? tr.times : Array.from({ length: n }, (_, i) => i / (n - 1));\n const frames: Frame[] = times.map((offset) => ({ offset, props: {} }));\n for (const p of props) {\n const v = def.animate[p];\n const arr = Array.isArray(v) ? v : [def.initial && p in def.initial ? def.initial[p] : undefined, v];\n const list = arr.length === n ? arr : [...Array(n - arr.length).fill(arr[0]), ...arr];\n list.forEach((x, i) => { if (x !== undefined && x !== null) frames[i].props[p] = x as V; });\n }\n if (Array.isArray(tr.ease) && tr.ease.length && (Array.isArray(tr.ease[0]) || typeof tr.ease[0] === 'string')) {\n (tr.ease as (string | number[])[]).forEach((e, i) => { if (frames[i]) frames[i].easing = Array.isArray(e) ? `cubic-bezier(${e.join(',')})` : NAMES[e] || e; });\n }\n return { frames, transition: tr, props };\n });\n}\n\n/**\n * Apply `initial` immediately and play `animate` with the transition.\n * Returns a runtime `Timeline` (one child per transition group), playing unless `paused`.\n */\nexport function playMotion(target: Target, def: MotionDef, o: { paused?: boolean } = {}): Timeline {\n const tl = new Timeline({});\n if (def.initial) for (const [k, v] of Object.entries(def.initial)) framesToTimeline(target, [{ offset: 0, props: { [k]: v } }], { duration: 0 }).seek(0);\n for (const { frames, transition: tr } of fromMotion(def)) {\n let ease: Ease | undefined;\n let dur = (tr.duration ?? 0.3) * 1000;\n if (tr.type === 'spring') [ease, dur] = springEase({ ...tr, duration: tr.duration });\n else if (!Array.isArray(tr.ease) || typeof tr.ease[0] === 'number') ease = motionEase(tr.ease as string | number[] | undefined);\n const rep = tr.repeat === Infinity ? -1 : tr.repeat || 0;\n const child = framesToTimeline(target, frames, { duration: dur, ease, repeat: rep, yoyo: rep !== 0 && tr.repeatType !== 'loop' && !!tr.repeatType });\n tl.add(child, (tr.delay || 0) * 1000);\n }\n if (!o.paused) tl.play();\n return tl;\n}\n\nexport interface FormatMotionApi {\n fromMotion: typeof fromMotion;\n playMotion: typeof playMotion;\n springEase: typeof springEase;\n motionEase: typeof motionEase;\n}\n\n/** The module object for `use(formatMotion)`. */\nexport const formatMotion: RuntimeModule<FormatMotionApi> = { id: 'format-motion', version: RUNTIME_VERSION, requires: ['core'], api: { fromMotion, playMotion, springEase, motionEase } };\n"],"names":["cubicBezier","EASES","Timeline","framesToTimeline","RUNTIME_VERSION"],"mappings":";;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;AAmBG;AA2BH,MAAM,KAAK,GAA2B,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,aAAa,EAAE;AAE9R;AACM,SAAU,UAAU,CAAC,CAAgC,EAAA;AACzD,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QAAE,OAAOA,gBAAW,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAChE,IAAA,IAAI,CAAC,CAAC;AAAE,QAAA,OAAOC,UAAK,CAAC,WAAW,CAAC;IACjC,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,CA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AE,YAAA,IAAI,GAAG,UAAU,CAAC,EAAE,CAAC,IAAqC,CAAC;QAC/H,MAAM,GAAG,GAAG,EAAE,CAAC,MAAM,KAAK,QAAQ,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,IAAI,CAAC;AACxD,QAAA,MAAM,KAAK,GAAGA,0BAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,UAAU,KAAK,MAAM,IAAI,CAAC,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC;AACpJ,QAAA,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC,IAAI,IAAI,CAAC;IACvC;IACA,IAAI,CAAC,CAAC,CAAC,MAAM;QAAE,EAAE,CAAC,IAAI,EAAE;AACxB,IAAA,OAAO,EAAE;AACX;AASA;AACO,MAAM,YAAY,GAAmC,EAAE,EAAE,EAAE,eAAe,EAAE,OAAO,EAAEC,wBAAe,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE;;;;;;"}
@@ -1,7 +1,8 @@
1
- import { R as RUNTIME_VERSION } from '../chunks/registry-46AAzyeC.js';
2
- import { c as cubicBezier, E as EASES, T as Timeline } from '../chunks/tween-CGyolmzB.js';
3
- import { f as framesToTimeline } from '../chunks/keyframes-DVAC5sQI.js';
4
- import '../chunks/ticker-COOYAyQy.js';
1
+ import { R as RUNTIME_VERSION } from '../chunks/registry-CT-TT_bx.js';
2
+ import { T as Timeline } from '../chunks/tween-BcejKpsx.js';
3
+ import { c as cubicBezier, E as EASES } from '../chunks/ease-XN8_0sXu.js';
4
+ import { f as framesToTimeline } from '../chunks/keyframes-B5PWe5bU.js';
5
+ import '../chunks/ticker-C8lSGml9.js';
5
6
 
6
7
  /**
7
8
  * `motionary/runtime/format-motion` (10.1) — play Motion / Framer-style
@@ -1 +1 @@
1
- {"version":3,"file":"format-motion.js","sources":["../../src/runtime/format-motion.ts"],"sourcesContent":["/**\n * `motionary/runtime/format-motion` (10.1) — play Motion / Framer-style\n * keyframe JSON with the runtime:\n *\n * ```json\n * { \"initial\": { \"opacity\": 0, \"y\": 40 },\n * \"animate\": { \"opacity\": 1, \"y\": [40, -8, 0], \"rotate\": 0 },\n * \"transition\": { \"duration\": 0.6, \"ease\": \"easeOut\", \"times\": [0, 0.7, 1], \"delay\": 0.1,\n * \"repeat\": 1, \"repeatType\": \"reverse\", \"opacity\": { \"duration\": 0.3 } } }\n * ```\n *\n * Supported: `initial` / `animate` (numbers, unit strings, colours, arrays as\n * keyframes), the transform shorthands `x y scale scaleX scaleY rotate skewX skewY`,\n * transition `duration` / `delay` (seconds) / `ease` (names or `[x1, y1, x2, y2]`) /\n * `times` / `repeat` (`Infinity` ok) / `repeatType` (`loop`, `reverse`, `mirror`),\n * per-property transitions, and `type: \"spring\"` (`stiffness`, `damping`, `mass`,\n * or `bounce` + `duration`) simulated into an easing curve.\n * Not supported: `layout`, gestures (`whileHover` …), variants propagation,\n * `staggerChildren` (use the runtime timeline `stagger`).\n */\nimport { RUNTIME_VERSION, type RuntimeModule } from './registry';\nimport { Timeline, type Target } from './tween';\nimport { cubicBezier, type Ease, EASES } from './ease';\nimport { framesToTimeline, type Frame } from './keyframes';\n\ntype V = number | string;\nexport interface MotionTransition {\n duration?: number;\n delay?: number;\n ease?: string | number[] | (string | number[])[];\n times?: number[];\n repeat?: number;\n repeatType?: 'loop' | 'reverse' | 'mirror';\n type?: 'tween' | 'spring' | 'keyframes' | 'inertia';\n stiffness?: number;\n damping?: number;\n mass?: number;\n bounce?: number;\n [prop: string]: unknown;\n}\nexport interface MotionDef {\n initial?: Record<string, V> | false;\n animate: Record<string, V | V[]>;\n transition?: MotionTransition;\n}\n\nconst NAMES: Record<string, string> = { linear: 'linear', easeIn: 'cubic-in', easeOut: 'cubic-out', easeInOut: 'cubic-in-out', circIn: 'circ-in', circOut: 'circ-out', circInOut: 'circ-in-out', backIn: 'back-in', backOut: 'back-out', backInOut: 'back-in-out', anticipate: 'back-in-out' };\n\n/** A Motion ease → runtime ease. */\nexport function motionEase(e: string | number[] | undefined): Ease {\n if (Array.isArray(e)) return cubicBezier(e[0], e[1], e[2], e[3]);\n if (!e) return EASES['cubic-out'];\n const n = NAMES[e] || e;\n if (!EASES[n]) throw new Error(`[motionary] format-motion: unknown ease \"${e}\"`);\n return EASES[n];\n}\n\n/** Simulate a damped spring (unit step) → [ease, duration ms]. */\nexport function springEase(o: { stiffness?: number; damping?: number; mass?: number; bounce?: number; duration?: number }): [Ease, number] {\n let k = o.stiffness ?? 100, c = o.damping ?? 10;\n const m = o.mass ?? 1;\n if (o.bounce !== undefined && o.duration !== undefined) {\n // map bounce + duration to stiffness / damping (critical damping at bounce 0)\n const zeta = 1 - Math.min(0.95, Math.max(0, o.bounce));\n const w = (2 * Math.PI) / Math.max(0.05, o.duration);\n k = m * w * w;\n c = 2 * zeta * Math.sqrt(k * m);\n }\n const dt = 1 / 120;\n const samples: number[] = [0];\n let x = 0, v = 0, t = 0, still = 0;\n while (t < 10) {\n const a = (-k * (x - 1) - c * v) / m;\n v += a * dt;\n x += v * dt;\n t += dt;\n samples.push(x);\n if (Math.abs(x - 1) < 0.001 && Math.abs(v) < 0.01) { if (++still > 12) break; } else still = 0;\n }\n const n = samples.length - 1;\n samples[n] = 1;\n const ease: Ease = (p) => {\n if (p <= 0) return 0;\n if (p >= 1) return 1;\n const f = p * n, i = Math.floor(f);\n return samples[i] + (samples[i + 1] - samples[i]) * (f - i);\n };\n return [ease, Math.round(t * 1000)];\n}\n\n/** Motion def → one keyframe track per transition group (`[frames, transition]`). */\nexport function fromMotion(def: MotionDef): { frames: Frame[]; transition: MotionTransition; props: string[] }[] {\n const base = def.transition || {};\n const groups = new Map<string, string[]>();\n for (const k of Object.keys(def.animate)) {\n const own = base[k] && typeof base[k] === 'object' ? k : '';\n groups.set(own, [...(groups.get(own) || []), k]);\n }\n return Array.from(groups.entries()).map(([g, props]) => {\n const tr: MotionTransition = g ? { ...base, ...(base[g] as MotionTransition) } : base;\n const len = Math.max(...props.map((p) => (Array.isArray(def.animate[p]) ? (def.animate[p] as V[]).length : 1)));\n const n = Math.max(2, len);\n const times = tr.times && tr.times.length === n ? tr.times : Array.from({ length: n }, (_, i) => i / (n - 1));\n const frames: Frame[] = times.map((offset) => ({ offset, props: {} }));\n for (const p of props) {\n const v = def.animate[p];\n const arr = Array.isArray(v) ? v : [def.initial && p in def.initial ? def.initial[p] : undefined, v];\n const list = arr.length === n ? arr : [...Array(n - arr.length).fill(arr[0]), ...arr];\n list.forEach((x, i) => { if (x !== undefined && x !== null) frames[i].props[p] = x as V; });\n }\n if (Array.isArray(tr.ease) && tr.ease.length && (Array.isArray(tr.ease[0]) || typeof tr.ease[0] === 'string')) {\n (tr.ease as (string | number[])[]).forEach((e, i) => { if (frames[i]) frames[i].easing = Array.isArray(e) ? `cubic-bezier(${e.join(',')})` : NAMES[e] || e; });\n }\n return { frames, transition: tr, props };\n });\n}\n\n/**\n * Apply `initial` immediately and play `animate` with the transition.\n * Returns a runtime `Timeline` (one child per transition group), playing unless `paused`.\n */\nexport function playMotion(target: Target, def: MotionDef, o: { paused?: boolean } = {}): Timeline {\n const tl = new Timeline({});\n if (def.initial) for (const [k, v] of Object.entries(def.initial)) framesToTimeline(target, [{ offset: 0, props: { [k]: v } }], { duration: 0 }).seek(0);\n for (const { frames, transition: tr } of fromMotion(def)) {\n let ease: Ease | undefined;\n let dur = (tr.duration ?? 0.3) * 1000;\n if (tr.type === 'spring') [ease, dur] = springEase({ ...tr, duration: tr.duration });\n else if (!Array.isArray(tr.ease) || typeof tr.ease[0] === 'number') ease = motionEase(tr.ease as string | number[] | undefined);\n const rep = tr.repeat === Infinity ? -1 : tr.repeat || 0;\n const child = framesToTimeline(target, frames, { duration: dur, ease, repeat: rep, yoyo: rep !== 0 && tr.repeatType !== 'loop' && !!tr.repeatType });\n tl.add(child, (tr.delay || 0) * 1000);\n }\n if (!o.paused) tl.play();\n return tl;\n}\n\nexport interface FormatMotionApi {\n fromMotion: typeof fromMotion;\n playMotion: typeof playMotion;\n springEase: typeof springEase;\n motionEase: typeof motionEase;\n}\n\n/** The module object for `use(formatMotion)`. */\nexport const formatMotion: RuntimeModule<FormatMotionApi> = { id: 'format-motion', version: RUNTIME_VERSION, requires: ['core'], api: { fromMotion, playMotion, springEase, motionEase } };\n"],"names":[],"mappings":";;;;;AAAA;;;;;;;;;;;;;;;;;;;AAmBG;AA2BH,MAAM,KAAK,GAA2B,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,aAAa,EAAE;AAE9R;AACM,SAAU,UAAU,CAAC,CAAgC,EAAA;AACzD,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QAAE,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAChE,IAAA,IAAI,CAAC,CAAC;AAAE,QAAA,OAAO,KAAK,CAAC,WAAW,CAAC;IACjC,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;AACvB,IAAA,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;AAAE,QAAA,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAA,CAAA,CAAG,CAAC;AAChF,IAAA,O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C,MAAM,IAAI,CAAC;AACxD,QAAA,MAAM,KAAK,GAAG,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,UAAU,KAAK,MAAM,IAAI,CAAC,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC;AACpJ,QAAA,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC,IAAI,IAAI,CAAC;IACvC;IACA,IAAI,CAAC,CAAC,CAAC,MAAM;QAAE,EAAE,CAAC,IAAI,EAAE;AACxB,IAAA,OAAO,EAAE;AACX;AASA;AACO,MAAM,YAAY,GAAmC,EAAE,EAAE,EAAE,eAAe,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE;;;;"}
1
+ {"version":3,"file":"format-motion.js","sources":["../../src/runtime/format-motion.ts"],"sourcesContent":["/**\n * `motionary/runtime/format-motion` (10.1) — play Motion / Framer-style\n * keyframe JSON with the runtime:\n *\n * ```json\n * { \"initial\": { \"opacity\": 0, \"y\": 40 },\n * \"animate\": { \"opacity\": 1, \"y\": [40, -8, 0], \"rotate\": 0 },\n * \"transition\": { \"duration\": 0.6, \"ease\": \"easeOut\", \"times\": [0, 0.7, 1], \"delay\": 0.1,\n * \"repeat\": 1, \"repeatType\": \"reverse\", \"opacity\": { \"duration\": 0.3 } } }\n * ```\n *\n * Supported: `initial` / `animate` (numbers, unit strings, colours, arrays as\n * keyframes), the transform shorthands `x y scale scaleX scaleY rotate skewX skewY`,\n * transition `duration` / `delay` (seconds) / `ease` (names or `[x1, y1, x2, y2]`) /\n * `times` / `repeat` (`Infinity` ok) / `repeatType` (`loop`, `reverse`, `mirror`),\n * per-property transitions, and `type: \"spring\"` (`stiffness`, `damping`, `mass`,\n * or `bounce` + `duration`) simulated into an easing curve.\n * Not supported: `layout`, gestures (`whileHover` …), variants propagation,\n * `staggerChildren` (use the runtime timeline `stagger`).\n */\nimport { RUNTIME_VERSION, type RuntimeModule } from './registry';\nimport { Timeline, type Target } from './tween';\nimport { cubicBezier, type Ease, EASES } from './ease';\nimport { framesToTimeline, type Frame } from './keyframes';\n\ntype V = number | string;\nexport interface MotionTransition {\n duration?: number;\n delay?: number;\n ease?: string | number[] | (string | number[])[];\n times?: number[];\n repeat?: number;\n repeatType?: 'loop' | 'reverse' | 'mirror';\n type?: 'tween' | 'spring' | 'keyframes' | 'inertia';\n stiffness?: number;\n damping?: number;\n mass?: number;\n bounce?: number;\n [prop: string]: unknown;\n}\nexport interface MotionDef {\n initial?: Record<string, V> | false;\n animate: Record<string, V | V[]>;\n transition?: MotionTransition;\n}\n\nconst NAMES: Record<string, string> = { linear: 'linear', easeIn: 'cubic-in', easeOut: 'cubic-out', easeInOut: 'cubic-in-out', circIn: 'circ-in', circOut: 'circ-out', circInOut: 'circ-in-out', backIn: 'back-in', backOut: 'back-out', backInOut: 'back-in-out', anticipate: 'back-in-out' };\n\n/** A Motion ease → runtime ease. */\nexport function motionEase(e: string | number[] | undefined): Ease {\n if (Array.isArray(e)) return cubicBezier(e[0], e[1], e[2], e[3]);\n if (!e) return EASES['cubic-out'];\n const n = NAMES[e] || e;\n if (!EASES[n]) throw new Error(`[motionary] format-motion: unknown ease \"${e}\"`);\n return EASES[n];\n}\n\n/** Simulate a damped spring (unit step) → [ease, duration ms]. */\nexport function springEase(o: { stiffness?: number; damping?: number; mass?: number; bounce?: number; duration?: number }): [Ease, number] {\n let k = o.stiffness ?? 100, c = o.damping ?? 10;\n const m = o.mass ?? 1;\n if (o.bounce !== undefined && o.duration !== undefined) {\n // map bounce + duration to stiffness / damping (critical damping at bounce 0)\n const zeta = 1 - Math.min(0.95, Math.max(0, o.bounce));\n const w = (2 * Math.PI) / Math.max(0.05, o.duration);\n k = m * w * w;\n c = 2 * zeta * Math.sqrt(k * m);\n }\n const dt = 1 / 120;\n const samples: number[] = [0];\n let x = 0, v = 0, t = 0, still = 0;\n while (t < 10) {\n const a = (-k * (x - 1) - c * v) / m;\n v += a * dt;\n x += v * dt;\n t += dt;\n samples.push(x);\n if (Math.abs(x - 1) < 0.001 && Math.abs(v) < 0.01) { if (++still > 12) break; } else still = 0;\n }\n const n = samples.length - 1;\n samples[n] = 1;\n const ease: Ease = (p) => {\n if (p <= 0) return 0;\n if (p >= 1) return 1;\n const f = p * n, i = Math.floor(f);\n return samples[i] + (samples[i + 1] - samples[i]) * (f - i);\n };\n return [ease, Math.round(t * 1000)];\n}\n\n/** Motion def → one keyframe track per transition group (`[frames, transition]`). */\nexport function fromMotion(def: MotionDef): { frames: Frame[]; transition: MotionTransition; props: string[] }[] {\n const base = def.transition || {};\n const groups = new Map<string, string[]>();\n for (const k of Object.keys(def.animate)) {\n const own = base[k] && typeof base[k] === 'object' ? k : '';\n groups.set(own, [...(groups.get(own) || []), k]);\n }\n return Array.from(groups.entries()).map(([g, props]) => {\n const tr: MotionTransition = g ? { ...base, ...(base[g] as MotionTransition) } : base;\n const len = Math.max(...props.map((p) => (Array.isArray(def.animate[p]) ? (def.animate[p] as V[]).length : 1)));\n const n = Math.max(2, len);\n const times = tr.times && tr.times.length === n ? tr.times : Array.from({ length: n }, (_, i) => i / (n - 1));\n const frames: Frame[] = times.map((offset) => ({ offset, props: {} }));\n for (const p of props) {\n const v = def.animate[p];\n const arr = Array.isArray(v) ? v : [def.initial && p in def.initial ? def.initial[p] : undefined, v];\n const list = arr.length === n ? arr : [...Array(n - arr.length).fill(arr[0]), ...arr];\n list.forEach((x, i) => { if (x !== undefined && x !== null) frames[i].props[p] = x as V; });\n }\n if (Array.isArray(tr.ease) && tr.ease.length && (Array.isArray(tr.ease[0]) || typeof tr.ease[0] === 'string')) {\n (tr.ease as (string | number[])[]).forEach((e, i) => { if (frames[i]) frames[i].easing = Array.isArray(e) ? `cubic-bezier(${e.join(',')})` : NAMES[e] || e; });\n }\n return { frames, transition: tr, props };\n });\n}\n\n/**\n * Apply `initial` immediately and play `animate` with the transition.\n * Returns a runtime `Timeline` (one child per transition group), playing unless `paused`.\n */\nexport function playMotion(target: Target, def: MotionDef, o: { paused?: boolean } = {}): Timeline {\n const tl = new Timeline({});\n if (def.initial) for (const [k, v] of Object.entries(def.initial)) framesToTimeline(target, [{ offset: 0, props: { [k]: v } }], { duration: 0 }).seek(0);\n for (const { frames, transition: tr } of fromMotion(def)) {\n let ease: Ease | undefined;\n let dur = (tr.duration ?? 0.3) * 1000;\n if (tr.type === 'spring') [ease, dur] = springEase({ ...tr, duration: tr.duration });\n else if (!Array.isArray(tr.ease) || typeof tr.ease[0] === 'number') ease = motionEase(tr.ease as string | number[] | undefined);\n const rep = tr.repeat === Infinity ? -1 : tr.repeat || 0;\n const child = framesToTimeline(target, frames, { duration: dur, ease, repeat: rep, yoyo: rep !== 0 && tr.repeatType !== 'loop' && !!tr.repeatType });\n tl.add(child, (tr.delay || 0) * 1000);\n }\n if (!o.paused) tl.play();\n return tl;\n}\n\nexport interface FormatMotionApi {\n fromMotion: typeof fromMotion;\n playMotion: typeof playMotion;\n springEase: typeof springEase;\n motionEase: typeof motionEase;\n}\n\n/** The module object for `use(formatMotion)`. */\nexport const formatMotion: RuntimeModule<FormatMotionApi> = { id: 'format-motion', version: RUNTIME_VERSION, requires: ['core'], api: { fromMotion, playMotion, springEase, motionEase } };\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;AAmBG;AA2BH,MAAM,KAAK,GAA2B,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,SAAS,EAA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,UAAU,EAAE;;"}
@@ -1,8 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var registry = require('../chunks/registry-CSVil2qJ.cjs');
4
- var tween = require('../chunks/tween-CFN0WcOb.cjs');
5
- require('../chunks/ticker-gHv6pNfx.cjs');
3
+ var registry = require('../chunks/registry-tzwKkldE.cjs');
4
+ var tween = require('../chunks/tween-CwLLC3Ko.cjs');
5
+ require('../chunks/ticker-Un0bvTWR.cjs');
6
+ require('../chunks/ease-HwYZnZat.cjs');
6
7
 
7
8
  /**
8
9
  * `motionary/runtime/format-sprite` (10.3) — sprite sheets and image
@@ -1 +1 @@
1
- {"version":3,"file":"format-sprite.cjs","sources":["../../src/runtime/format-sprite.ts"],"sourcesContent":["/**\n * `motionary/runtime/format-sprite` (10.3) — sprite sheets and image\n * sequences on the runtime timeline (original implementation).\n *\n * - `parseSpriteSheet(json)` — TexturePacker JSON (hash and array), Aseprite\n * JSON (hash and array, per-frame `duration`, `meta.frameTags` with\n * `forward` / `reverse` / `pingpong` directions) and the generic\n * `{ frames: [{ x, y, w, h }] }` shape; trimmed frames (`spriteSourceSize` /\n * `sourceSize`) and rotated frames are supported.\n * - `gridSheet(cols, rows, w, h, n?)` — a plain grid sheet.\n * - `frameOrder(sheet, tag?)` — the playback order of a tag (pingpong without repeating the ends).\n * - `spritePlayer(target, sheet, image, { tag, fps })` — a runtime `Playable`\n * that draws frames onto a `<canvas>` or moves the background of an element.\n * - `imageSequence('frame_{0001}.webp', { start, end })`, `preloadImages(urls)`,\n * `sequencePlayer(canvas, images, { fps })` — numbered image sequences,\n * scrubbable (`player.progress = p`, e.g. from a scroll scene).\n * Parsing works without the DOM (SSR / workers); players need a canvas / element.\n */\nimport { RUNTIME_VERSION, type RuntimeModule } from './registry';\nimport { Playable } from './tween';\n\nexport interface SpriteFrame {\n name: string;\n x: number;\n y: number;\n w: number;\n h: number;\n rotated: boolean;\n /** Offset of the trimmed frame inside the original (untrimmed) size. */\n offsetX: number;\n offsetY: number;\n sourceW: number;\n sourceH: number;\n /** ms (Aseprite), or undefined (use the player's fps). */\n duration?: number;\n}\nexport interface SpriteTag {\n name: string;\n from: number;\n to: number;\n direction: 'forward' | 'reverse' | 'pingpong' | 'pingpong_reverse';\n}\nexport interface SpriteSheet {\n frames: SpriteFrame[];\n tags: SpriteTag[];\n image?: string;\n size?: { w: number; h: number };\n format: 'texturepacker' | 'aseprite' | 'generic';\n}\n\nconst num = (v: unknown, d = 0) => (typeof v === 'number' && Number.isFinite(v) ? v : d);\n\n/** Parse a sprite-sheet JSON (object or string). */\nexport function parseSpriteSheet(input: string | Record<string, any>): SpriteSheet {\n const j = typeof input === 'string' ? JSON.parse(input) : input;\n if (!j || !j.frames) throw new Error('[motionary] format-sprite: no \"frames\" in the sprite sheet JSON');\n const meta = j.meta || {};\n const aseprite = /aseprite/i.test(meta.app || '') || Array.isArray(meta.frameTags);\n const entries: [string, any][] = Array.isArray(j.frames) ? j.frames.map((f: any, i: number) => [f.filename ?? f.name ?? String(i), f]) : Object.entries(j.frames);\n const frames = entries.map(([name, f]) => {\n const r = f.frame || f;\n const rotated = !!f.rotated;\n const sss = f.spriteSourceSize || { x: 0, y: 0 };\n const ss = f.sourceSize || { w: r.w, h: r.h };\n const out: SpriteFrame = { name, x: num(r.x), y: num(r.y), w: num(r.w), h: num(r.h), rotated, offsetX: num(sss.x), offsetY: num(sss.y), sourceW: num(ss.w, r.w), sourceH: num(ss.h, r.h) };\n if (typeof f.duration === 'number') out.duration = f.duration;\n return out;\n });\n if (!Array.isArray(j.frames) && !aseprite) frames.sort((a, b) => a.name.localeCompare(b.name, undefined, { numeric: true }));\n const tags: SpriteTag[] = (meta.frameTags || []).map((t: any) => ({ name: t.name, from: num(t.from), to: num(t.to), direction: t.direction || 'forward' }));\n return { frames, tags, image: meta.image, size: meta.size, format: aseprite ? 'aseprite' : meta.app || j.meta ? 'texturepacker' : 'generic' };\n}\n\n/** A grid sheet: `cols × rows` cells of `w × h` (first `n` cells). */\nexport function gridSheet(cols: number, rows: number, w: number, h: number, n = cols * rows): SpriteSheet {\n const frames: SpriteFrame[] = [];\n for (let i = 0; i < n; i++) frames.push({ name: String(i), x: (i % cols) * w, y: Math.floor(i / cols) * h, w, h, rotated: false, offsetX: 0, offsetY: 0, sourceW: w, sourceH: h });\n return { frames, tags: [], format: 'generic' };\n}\n\n/** Frame indices for a tag (or the whole sheet). */\nexport function frameOrder(sheet: SpriteSheet, tag?: string): number[] {\n const t = tag ? sheet.tags.find((x) => x.name === tag) : undefined;\n if (tag && !t) throw new Error(`[motionary] format-sprite: unknown tag \"${tag}\" (have: ${sheet.tags.map((x) => x.name).join(', ') || 'none'})`);\n const from = t ? t.from : 0, to = t ? t.to : sheet.frames.length - 1;\n const fwd = Array.from({ length: to - from + 1 }, (_, i) => from + i);\n const dir = t?.direction || 'forward';\n if (dir === 'reverse') return fwd.reverse();\n if (dir === 'pingpong') return [...fwd, ...fwd.slice(1, -1).reverse()];\n if (dir === 'pingpong_reverse') { const r = fwd.reverse(); return [...r, ...r.slice(1, -1).reverse()]; }\n return fwd;\n}\n\n/** Draw one frame onto a 2D context at (dx, dy), honouring trim offsets and rotation. */\nexport function drawFrame(ctx: CanvasRenderingContext2D, image: CanvasImageSource, f: SpriteFrame, dx = 0, dy = 0, scale = 1): void {\n ctx.save();\n ctx.translate(dx + f.offsetX * scale, dy + f.offsetY * scale);\n if (f.rotated) {\n // TexturePacker stores rotated frames 90° clockwise: w/h are the unrotated size\n ctx.rotate(-Math.PI / 2);\n ctx.drawImage(image, f.x, f.y, f.h, f.w, -f.h * scale, 0, f.h * scale, f.w * scale);\n } else ctx.drawImage(image, f.x, f.y, f.w, f.h, 0, 0, f.w * scale, f.h * scale);\n ctx.restore();\n}\n\n/** Plays a list of frames (by index) with per-frame durations. */\nabstract class FramePlayable extends Playable {\n protected times: number[] = [0];\n protected order: number[] = [];\n protected current = -1;\n protected setOrder(order: number[], dur: (i: number) => number): void {\n this.order = order;\n this.times = [0];\n for (const i of order) this.times.push(this.times[this.times.length - 1] + dur(i));\n }\n get duration(): number {\n return this.times[this.times.length - 1];\n }\n /** Index into `order` at a local time. */\n protected indexAt(ms: number): number {\n let lo = 0, hi = this.order.length - 1;\n while (lo < hi) {\n const mid = (lo + hi + 1) >> 1;\n if (this.times[mid] <= ms) lo = mid;\n else hi = mid - 1;\n }\n return Math.min(lo, this.order.length - 1);\n }\n protected renderLocal(ms: number): void {\n const k = this.order[this.indexAt(Math.min(ms, this.duration - 0.001))];\n if (k === this.current) return;\n this.current = k;\n this.show(k);\n }\n /** The frame index currently shown. */\n get frame(): number {\n return this.current;\n }\n protected abstract show(index: number): void;\n}\n\nexport interface SpritePlayerOptions {\n tag?: string;\n /** Frames per second for frames without their own duration (default 12). */\n fps?: number;\n repeat?: number;\n yoyo?: boolean;\n paused?: boolean;\n /** Canvas only: draw scale (default: fit the canvas width). */\n scale?: number;\n}\n\nclass SpritePlayer extends FramePlayable {\n constructor(private target: HTMLCanvasElement | HTMLElement, private sheet: SpriteSheet, private image: CanvasImageSource | string, o: SpritePlayerOptions) {\n super({ repeat: o.repeat ?? -1, yoyo: o.yoyo });\n const fps = o.fps || 12;\n this.setOrder(frameOrder(sheet, o.tag), (i) => sheet.frames[i].duration ?? 1000 / fps);\n this.scale = o.scale;\n if (!o.paused) this.play();\n }\n private scale?: number;\n protected show(i: number): void {\n const f = this.sheet.frames[i];\n const t = this.target as HTMLCanvasElement;\n if (typeof t.getContext === 'function' && typeof this.image !== 'string') {\n const ctx = t.getContext('2d');\n if (!ctx) return;\n const s = this.scale ?? t.width / (f.sourceW || f.w || 1);\n ctx.clearRect(0, 0, t.width, t.height);\n drawFrame(ctx, this.image, f, 0, 0, s);\n } else {\n const el = this.target as HTMLElement;\n if (typeof this.image === 'string') el.style.backgroundImage = `url(\"${this.image}\")`;\n el.style.backgroundPosition = `${-f.x}px ${-f.y}px`;\n el.style.width = `${f.w}px`;\n el.style.height = `${f.h}px`;\n el.style.backgroundRepeat = 'no-repeat';\n }\n }\n}\n\n/** Play a sprite sheet on a canvas (image = loaded image / bitmap) or an element's background (image = URL). */\nexport function spritePlayer(target: HTMLCanvasElement | HTMLElement, sheet: SpriteSheet, image: CanvasImageSource | string, o: SpritePlayerOptions = {}): Playable & { readonly frame: number } {\n return new SpritePlayer(target, sheet, image, o);\n}\n\n/** 'frame_{0001}.webp' + { start: 1, end: 3 } → frame_0001.webp, frame_0002.webp, frame_0003.webp ('{1}' = no padding). */\nexport function imageSequence(pattern: string, o: { start?: number; end: number; step?: number }): string[] {\n const m = /\\{(\\d+)\\}/.exec(pattern);\n if (!m) throw new Error('[motionary] format-sprite: the pattern needs a {0001}-style placeholder');\n const pad = m[1].length;\n const out: string[] = [];\n for (let i = o.start ?? (+m[1] || 0); i <= o.end; i += o.step || 1) out.push(pattern.replace(m[0], String(i).padStart(pad, '0')));\n return out;\n}\n\n/** Load images (resolves when all are decoded; rejects with the failing URL). */\nexport function preloadImages(urls: string[]): Promise<HTMLImageElement[]> {\n return Promise.all(urls.map((u) => new Promise<HTMLImageElement>((ok, bad) => {\n const img = new Image();\n img.decoding = 'async';\n img.onload = () => ok(img);\n img.onerror = () => bad(new Error(`[motionary] format-sprite: could not load ${u}`));\n img.src = u;\n })));\n}\n\nclass SequencePlayer extends FramePlayable {\n constructor(private canvas: HTMLCanvasElement, private images: CanvasImageSource[], o: { fps?: number; repeat?: number; yoyo?: boolean; paused?: boolean }) {\n super({ repeat: o.repeat ?? 0, yoyo: o.yoyo });\n const fps = o.fps || 24;\n this.setOrder(images.map((_, i) => i), () => 1000 / fps);\n if (!o.paused) this.play();\n }\n protected show(i: number): void {\n const ctx = this.canvas.getContext('2d');\n const img = this.images[i] as any;\n if (!ctx || !img) return;\n const w = this.canvas.width, h = this.canvas.height;\n const iw = img.naturalWidth || img.width || w, ih = img.naturalHeight || img.height || h;\n const s = Math.max(w / iw, h / ih); // cover\n ctx.clearRect(0, 0, w, h);\n ctx.drawImage(img, (w - iw * s) / 2, (h - ih * s) / 2, iw * s, ih * s);\n }\n}\n\n/** Play (or scrub, via `progress`) an image sequence on a canvas, `object-fit: cover` style. */\nexport function sequencePlayer(canvas: HTMLCanvasElement, images: CanvasImageSource[], o: { fps?: number; repeat?: number; yoyo?: boolean; paused?: boolean } = {}): Playable & { readonly frame: number } {\n return new SequencePlayer(canvas, images, o);\n}\n\nexport interface FormatSpriteApi {\n parseSpriteSheet: typeof parseSpriteSheet;\n gridSheet: typeof gridSheet;\n frameOrder: typeof frameOrder;\n drawFrame: typeof drawFrame;\n spritePlayer: typeof spritePlayer;\n imageSequence: typeof imageSequence;\n preloadImages: typeof preloadImages;\n sequencePlayer: typeof sequencePlayer;\n}\n\n/** The module object for `use(formatSprite)`. */\nexport const formatSprite: RuntimeModule<FormatSpriteApi> = { id: 'format-sprite', version: RUNTIME_VERSION, requires: ['core'], api: { parseSpriteSheet, gridSheet, frameOrder, drawFrame, spritePlayer, imageSequence, preloadImages, sequencePlayer } };\n"],"names":["Playable","RUNTIME_VERSION"],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;AAiBG;AAiCH,MAAM,GAAG,GAAG,CAAC,CAAU,EAAE,CAAC,GAAG,CAAC,MAAM,OAAO,CAAC,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAExF;AACM,SAAU,gBAAgB,CAAC,KAAmC,EAAA;AAClE,IAAA,MAAM,CAAC,GAAG,OAAO,KAAK,KAAK,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,KAAK;AAC/D,IAAA,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM;AAAE,QAAA,MAAM,IAAI,KAAK,CAAC,iEAAiE,CAAC;AACvG,IAAA,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,IAAI,EAAE;IACzB,MAAM,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,CAA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,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM;QACnD,MAAM,EAAE,GAAG,GAAG,CAAC,YAAY,IAAI,GAAG,CAAC,KAAK,IAAI,CAAC,EAAE,EAAE,GAAG,GAAG,CAAC,aAAa,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC;AACxF,QAAA,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;QACnC,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AACzB,QAAA,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IACxE;AACD;AAED;AACM,SAAU,cAAc,CAAC,MAAyB,EAAE,MAA2B,EAAE,IAAyE,EAAE,EAAA;IAChK,OAAO,IAAI,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;AAC9C;AAaA;AACO,MAAM,YAAY,GAAmC,EAAE,EAAE,EAAE,eAAe,EAAE,OAAO,EAAEC,wBAAe,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,EAAE,gBAAgB,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE;;;;;;;;;;;;"}
1
+ {"version":3,"file":"format-sprite.cjs","sources":["../../src/runtime/format-sprite.ts"],"sourcesContent":["/**\n * `motionary/runtime/format-sprite` (10.3) — sprite sheets and image\n * sequences on the runtime timeline (original implementation).\n *\n * - `parseSpriteSheet(json)` — TexturePacker JSON (hash and array), Aseprite\n * JSON (hash and array, per-frame `duration`, `meta.frameTags` with\n * `forward` / `reverse` / `pingpong` directions) and the generic\n * `{ frames: [{ x, y, w, h }] }` shape; trimmed frames (`spriteSourceSize` /\n * `sourceSize`) and rotated frames are supported.\n * - `gridSheet(cols, rows, w, h, n?)` — a plain grid sheet.\n * - `frameOrder(sheet, tag?)` — the playback order of a tag (pingpong without repeating the ends).\n * - `spritePlayer(target, sheet, image, { tag, fps })` — a runtime `Playable`\n * that draws frames onto a `<canvas>` or moves the background of an element.\n * - `imageSequence('frame_{0001}.webp', { start, end })`, `preloadImages(urls)`,\n * `sequencePlayer(canvas, images, { fps })` — numbered image sequences,\n * scrubbable (`player.progress = p`, e.g. from a scroll scene).\n * Parsing works without the DOM (SSR / workers); players need a canvas / element.\n */\nimport { RUNTIME_VERSION, type RuntimeModule } from './registry';\nimport { Playable } from './tween';\n\nexport interface SpriteFrame {\n name: string;\n x: number;\n y: number;\n w: number;\n h: number;\n rotated: boolean;\n /** Offset of the trimmed frame inside the original (untrimmed) size. */\n offsetX: number;\n offsetY: number;\n sourceW: number;\n sourceH: number;\n /** ms (Aseprite), or undefined (use the player's fps). */\n duration?: number;\n}\nexport interface SpriteTag {\n name: string;\n from: number;\n to: number;\n direction: 'forward' | 'reverse' | 'pingpong' | 'pingpong_reverse';\n}\nexport interface SpriteSheet {\n frames: SpriteFrame[];\n tags: SpriteTag[];\n image?: string;\n size?: { w: number; h: number };\n format: 'texturepacker' | 'aseprite' | 'generic';\n}\n\nconst num = (v: unknown, d = 0) => (typeof v === 'number' && Number.isFinite(v) ? v : d);\n\n/** Parse a sprite-sheet JSON (object or string). */\nexport function parseSpriteSheet(input: string | Record<string, any>): SpriteSheet {\n const j = typeof input === 'string' ? JSON.parse(input) : input;\n if (!j || !j.frames) throw new Error('[motionary] format-sprite: no \"frames\" in the sprite sheet JSON');\n const meta = j.meta || {};\n const aseprite = /aseprite/i.test(meta.app || '') || Array.isArray(meta.frameTags);\n const entries: [string, any][] = Array.isArray(j.frames) ? j.frames.map((f: any, i: number) => [f.filename ?? f.name ?? String(i), f]) : Object.entries(j.frames);\n const frames = entries.map(([name, f]) => {\n const r = f.frame || f;\n const rotated = !!f.rotated;\n const sss = f.spriteSourceSize || { x: 0, y: 0 };\n const ss = f.sourceSize || { w: r.w, h: r.h };\n const out: SpriteFrame = { name, x: num(r.x), y: num(r.y), w: num(r.w), h: num(r.h), rotated, offsetX: num(sss.x), offsetY: num(sss.y), sourceW: num(ss.w, r.w), sourceH: num(ss.h, r.h) };\n if (typeof f.duration === 'number') out.duration = f.duration;\n return out;\n });\n if (!Array.isArray(j.frames) && !aseprite) frames.sort((a, b) => a.name.localeCompare(b.name, undefined, { numeric: true }));\n const tags: SpriteTag[] = (meta.frameTags || []).map((t: any) => ({ name: t.name, from: num(t.from), to: num(t.to), direction: t.direction || 'forward' }));\n return { frames, tags, image: meta.image, size: meta.size, format: aseprite ? 'aseprite' : meta.app || j.meta ? 'texturepacker' : 'generic' };\n}\n\n/** A grid sheet: `cols × rows` cells of `w × h` (first `n` cells). */\nexport function gridSheet(cols: number, rows: number, w: number, h: number, n = cols * rows): SpriteSheet {\n const frames: SpriteFrame[] = [];\n for (let i = 0; i < n; i++) frames.push({ name: String(i), x: (i % cols) * w, y: Math.floor(i / cols) * h, w, h, rotated: false, offsetX: 0, offsetY: 0, sourceW: w, sourceH: h });\n return { frames, tags: [], format: 'generic' };\n}\n\n/** Frame indices for a tag (or the whole sheet). */\nexport function frameOrder(sheet: SpriteSheet, tag?: string): number[] {\n const t = tag ? sheet.tags.find((x) => x.name === tag) : undefined;\n if (tag && !t) throw new Error(`[motionary] format-sprite: unknown tag \"${tag}\" (have: ${sheet.tags.map((x) => x.name).join(', ') || 'none'})`);\n const from = t ? t.from : 0, to = t ? t.to : sheet.frames.length - 1;\n const fwd = Array.from({ length: to - from + 1 }, (_, i) => from + i);\n const dir = t?.direction || 'forward';\n if (dir === 'reverse') return fwd.reverse();\n if (dir === 'pingpong') return [...fwd, ...fwd.slice(1, -1).reverse()];\n if (dir === 'pingpong_reverse') { const r = fwd.reverse(); return [...r, ...r.slice(1, -1).reverse()]; }\n return fwd;\n}\n\n/** Draw one frame onto a 2D context at (dx, dy), honouring trim offsets and rotation. */\nexport function drawFrame(ctx: CanvasRenderingContext2D, image: CanvasImageSource, f: SpriteFrame, dx = 0, dy = 0, scale = 1): void {\n ctx.save();\n ctx.translate(dx + f.offsetX * scale, dy + f.offsetY * scale);\n if (f.rotated) {\n // TexturePacker stores rotated frames 90° clockwise: w/h are the unrotated size\n ctx.rotate(-Math.PI / 2);\n ctx.drawImage(image, f.x, f.y, f.h, f.w, -f.h * scale, 0, f.h * scale, f.w * scale);\n } else ctx.drawImage(image, f.x, f.y, f.w, f.h, 0, 0, f.w * scale, f.h * scale);\n ctx.restore();\n}\n\n/** Plays a list of frames (by index) with per-frame durations. */\nabstract class FramePlayable extends Playable {\n protected times: number[] = [0];\n protected order: number[] = [];\n protected current = -1;\n protected setOrder(order: number[], dur: (i: number) => number): void {\n this.order = order;\n this.times = [0];\n for (const i of order) this.times.push(this.times[this.times.length - 1] + dur(i));\n }\n get duration(): number {\n return this.times[this.times.length - 1];\n }\n /** Index into `order` at a local time. */\n protected indexAt(ms: number): number {\n let lo = 0, hi = this.order.length - 1;\n while (lo < hi) {\n const mid = (lo + hi + 1) >> 1;\n if (this.times[mid] <= ms) lo = mid;\n else hi = mid - 1;\n }\n return Math.min(lo, this.order.length - 1);\n }\n protected renderLocal(ms: number): void {\n const k = this.order[this.indexAt(Math.min(ms, this.duration - 0.001))];\n if (k === this.current) return;\n this.current = k;\n this.show(k);\n }\n /** The frame index currently shown. */\n get frame(): number {\n return this.current;\n }\n protected abstract show(index: number): void;\n}\n\nexport interface SpritePlayerOptions {\n tag?: string;\n /** Frames per second for frames without their own duration (default 12). */\n fps?: number;\n repeat?: number;\n yoyo?: boolean;\n paused?: boolean;\n /** Canvas only: draw scale (default: fit the canvas width). */\n scale?: number;\n}\n\nclass SpritePlayer extends FramePlayable {\n constructor(private target: HTMLCanvasElement | HTMLElement, private sheet: SpriteSheet, private image: CanvasImageSource | string, o: SpritePlayerOptions) {\n super({ repeat: o.repeat ?? -1, yoyo: o.yoyo });\n const fps = o.fps || 12;\n this.setOrder(frameOrder(sheet, o.tag), (i) => sheet.frames[i].duration ?? 1000 / fps);\n this.scale = o.scale;\n if (!o.paused) this.play();\n }\n private scale?: number;\n protected show(i: number): void {\n const f = this.sheet.frames[i];\n const t = this.target as HTMLCanvasElement;\n if (typeof t.getContext === 'function' && typeof this.image !== 'string') {\n const ctx = t.getContext('2d');\n if (!ctx) return;\n const s = this.scale ?? t.width / (f.sourceW || f.w || 1);\n ctx.clearRect(0, 0, t.width, t.height);\n drawFrame(ctx, this.image, f, 0, 0, s);\n } else {\n const el = this.target as HTMLElement;\n if (typeof this.image === 'string') el.style.backgroundImage = `url(\"${this.image}\")`;\n el.style.backgroundPosition = `${-f.x}px ${-f.y}px`;\n el.style.width = `${f.w}px`;\n el.style.height = `${f.h}px`;\n el.style.backgroundRepeat = 'no-repeat';\n }\n }\n}\n\n/** Play a sprite sheet on a canvas (image = loaded image / bitmap) or an element's background (image = URL). */\nexport function spritePlayer(target: HTMLCanvasElement | HTMLElement, sheet: SpriteSheet, image: CanvasImageSource | string, o: SpritePlayerOptions = {}): Playable & { readonly frame: number } {\n return new SpritePlayer(target, sheet, image, o);\n}\n\n/** 'frame_{0001}.webp' + { start: 1, end: 3 } → frame_0001.webp, frame_0002.webp, frame_0003.webp ('{1}' = no padding). */\nexport function imageSequence(pattern: string, o: { start?: number; end: number; step?: number }): string[] {\n const m = /\\{(\\d+)\\}/.exec(pattern);\n if (!m) throw new Error('[motionary] format-sprite: the pattern needs a {0001}-style placeholder');\n const pad = m[1].length;\n const out: string[] = [];\n for (let i = o.start ?? (+m[1] || 0); i <= o.end; i += o.step || 1) out.push(pattern.replace(m[0], String(i).padStart(pad, '0')));\n return out;\n}\n\n/** Load images (resolves when all are decoded; rejects with the failing URL). */\nexport function preloadImages(urls: string[]): Promise<HTMLImageElement[]> {\n return Promise.all(urls.map((u) => new Promise<HTMLImageElement>((ok, bad) => {\n const img = new Image();\n img.decoding = 'async';\n img.onload = () => ok(img);\n img.onerror = () => bad(new Error(`[motionary] format-sprite: could not load ${u}`));\n img.src = u;\n })));\n}\n\nclass SequencePlayer extends FramePlayable {\n constructor(private canvas: HTMLCanvasElement, private images: CanvasImageSource[], o: { fps?: number; repeat?: number; yoyo?: boolean; paused?: boolean }) {\n super({ repeat: o.repeat ?? 0, yoyo: o.yoyo });\n const fps = o.fps || 24;\n this.setOrder(images.map((_, i) => i), () => 1000 / fps);\n if (!o.paused) this.play();\n }\n protected show(i: number): void {\n const ctx = this.canvas.getContext('2d');\n const img = this.images[i] as any;\n if (!ctx || !img) return;\n const w = this.canvas.width, h = this.canvas.height;\n const iw = img.naturalWidth || img.width || w, ih = img.naturalHeight || img.height || h;\n const s = Math.max(w / iw, h / ih); // cover\n ctx.clearRect(0, 0, w, h);\n ctx.drawImage(img, (w - iw * s) / 2, (h - ih * s) / 2, iw * s, ih * s);\n }\n}\n\n/** Play (or scrub, via `progress`) an image sequence on a canvas, `object-fit: cover` style. */\nexport function sequencePlayer(canvas: HTMLCanvasElement, images: CanvasImageSource[], o: { fps?: number; repeat?: number; yoyo?: boolean; paused?: boolean } = {}): Playable & { readonly frame: number } {\n return new SequencePlayer(canvas, images, o);\n}\n\nexport interface FormatSpriteApi {\n parseSpriteSheet: typeof parseSpriteSheet;\n gridSheet: typeof gridSheet;\n frameOrder: typeof frameOrder;\n drawFrame: typeof drawFrame;\n spritePlayer: typeof spritePlayer;\n imageSequence: typeof imageSequence;\n preloadImages: typeof preloadImages;\n sequencePlayer: typeof sequencePlayer;\n}\n\n/** The module object for `use(formatSprite)`. */\nexport const formatSprite: RuntimeModule<FormatSpriteApi> = { id: 'format-sprite', version: RUNTIME_VERSION, requires: ['core'], api: { parseSpriteSheet, gridSheet, frameOrder, drawFrame, spritePlayer, imageSequence, preloadImages, sequencePlayer } };\n"],"names":["Playable","RU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CAAC;IACxE;AACD;AAED;AACM,SAAU,cAAc,CAAC,MAAyB,EAAE,MAA2B,EAAE,IAAyE,EAAE,EAAA;IAChK,OAAO,IAAI,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;AAC9C;AAaA;AACO,MAAM,YAAY,GAAmC,EAAE,EAAE,EAAE,eAAe,EAAE,OAAO,EAAEC,wBAAe,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,EAAE,gBAAgB,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE;;;;;;;;;;"}
@@ -1,6 +1,7 @@
1
- import { R as RUNTIME_VERSION } from '../chunks/registry-46AAzyeC.js';
2
- import { P as Playable } from '../chunks/tween-CGyolmzB.js';
3
- import '../chunks/ticker-COOYAyQy.js';
1
+ import { R as RUNTIME_VERSION } from '../chunks/registry-CT-TT_bx.js';
2
+ import { P as Playable } from '../chunks/tween-BcejKpsx.js';
3
+ import '../chunks/ticker-C8lSGml9.js';
4
+ import '../chunks/ease-XN8_0sXu.js';
4
5
 
5
6
  /**
6
7
  * `motionary/runtime/format-sprite` (10.3) — sprite sheets and image