motionary 10.3.0 → 10.5.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 (421) hide show
  1. package/AGENTS.md +4 -0
  2. package/CHANGELOG.md +31 -0
  3. package/README.md +72 -0
  4. package/bin/motionary-mcp.mjs +265 -0
  5. package/dist/chunks/anim-image-BlNPv4JG.js +166 -0
  6. package/dist/chunks/anim-image-BlNPv4JG.js.map +1 -0
  7. package/dist/chunks/anim-image-DuxvYhq6.cjs +174 -0
  8. package/dist/chunks/anim-image-DuxvYhq6.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-B8ITIAVa.js} +3 -2
  43. package/dist/chunks/keyframes-B8ITIAVa.js.map +1 -0
  44. package/dist/chunks/{keyframes-Dw9zwVQa.cjs → keyframes-Ce1s05n3.cjs} +4 -3
  45. package/dist/chunks/keyframes-Ce1s05n3.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-DXdFb2fJ.js} +3 -3
  57. package/dist/chunks/{registry-46AAzyeC.js.map → registry-DXdFb2fJ.js.map} +1 -1
  58. package/dist/chunks/{registry-CSVil2qJ.cjs → registry-VhfPSI0v.cjs} +2 -2
  59. package/dist/chunks/{registry-CSVil2qJ.cjs.map → registry-VhfPSI0v.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-C5RMHMW7.js} +2 -2
  69. package/dist/chunks/{ticker-COOYAyQy.js.map → ticker-C5RMHMW7.js.map} +1 -1
  70. package/dist/chunks/{ticker-gHv6pNfx.cjs → ticker-DvmC6WLS.cjs} +2 -2
  71. package/dist/chunks/{ticker-gHv6pNfx.cjs.map → ticker-DvmC6WLS.cjs.map} +1 -1
  72. package/dist/chunks/{tween-CGyolmzB.js → tween-CPtm-EdT.js} +4 -90
  73. package/dist/chunks/tween-CPtm-EdT.js.map +1 -0
  74. package/dist/chunks/{tween-CFN0WcOb.cjs → tween-_BGIl6hK.cjs} +4 -94
  75. package/dist/chunks/tween-_BGIl6hK.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 +1102 -216
  283. package/dist/components/widgets.cjs.map +1 -1
  284. package/dist/components/widgets.d.cts +367 -2
  285. package/dist/components/widgets.d.ts +367 -2
  286. package/dist/components/widgets.js +1100 -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 +303 -1
  297. package/dist/llms.txt +16 -2
  298. package/dist/manifest.json +806 -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-gltf.cjs +207 -0
  324. package/dist/runtime/format-gltf.cjs.map +1 -0
  325. package/dist/runtime/format-gltf.d.cts +251 -0
  326. package/dist/runtime/format-gltf.d.ts +251 -0
  327. package/dist/runtime/format-gltf.iife.js +2 -0
  328. package/dist/runtime/format-gltf.iife.js.map +1 -0
  329. package/dist/runtime/format-gltf.js +200 -0
  330. package/dist/runtime/format-gltf.js.map +1 -0
  331. package/dist/runtime/format-motion.cjs +9 -8
  332. package/dist/runtime/format-motion.cjs.map +1 -1
  333. package/dist/runtime/format-motion.js +5 -4
  334. package/dist/runtime/format-motion.js.map +1 -1
  335. package/dist/runtime/format-obj.cjs +181 -0
  336. package/dist/runtime/format-obj.cjs.map +1 -0
  337. package/dist/runtime/format-obj.d.cts +176 -0
  338. package/dist/runtime/format-obj.d.ts +176 -0
  339. package/dist/runtime/format-obj.iife.js +2 -0
  340. package/dist/runtime/format-obj.iife.js.map +1 -0
  341. package/dist/runtime/format-obj.js +174 -0
  342. package/dist/runtime/format-obj.js.map +1 -0
  343. package/dist/runtime/format-sprite.cjs +4 -3
  344. package/dist/runtime/format-sprite.cjs.map +1 -1
  345. package/dist/runtime/format-sprite.js +4 -3
  346. package/dist/runtime/format-sprite.js.map +1 -1
  347. package/dist/runtime/format-svg.cjs +5 -4
  348. package/dist/runtime/format-svg.cjs.map +1 -1
  349. package/dist/runtime/format-svg.js +4 -3
  350. package/dist/runtime/format-svg.js.map +1 -1
  351. package/dist/runtime/format-webp.cjs +123 -0
  352. package/dist/runtime/format-webp.cjs.map +1 -0
  353. package/dist/runtime/format-webp.d.cts +245 -0
  354. package/dist/runtime/format-webp.d.ts +245 -0
  355. package/dist/runtime/format-webp.iife.js +2 -0
  356. package/dist/runtime/format-webp.iife.js.map +1 -0
  357. package/dist/runtime/format-webp.js +115 -0
  358. package/dist/runtime/format-webp.js.map +1 -0
  359. package/dist/runtime/gl.cjs +763 -0
  360. package/dist/runtime/gl.cjs.map +1 -0
  361. package/dist/runtime/gl.d.cts +260 -0
  362. package/dist/runtime/gl.d.ts +260 -0
  363. package/dist/runtime/gl.iife.js +2 -0
  364. package/dist/runtime/gl.iife.js.map +1 -0
  365. package/dist/runtime/gl.js +739 -0
  366. package/dist/runtime/gl.js.map +1 -0
  367. package/dist/runtime/scroll.cjs +2 -2
  368. package/dist/runtime/scroll.cjs.map +1 -1
  369. package/dist/runtime/scroll.js +2 -2
  370. package/dist/runtime/scroll.js.map +1 -1
  371. package/dist/runtime/smooth.cjs +284 -0
  372. package/dist/runtime/smooth.cjs.map +1 -0
  373. package/dist/runtime/smooth.d.cts +137 -0
  374. package/dist/runtime/smooth.d.ts +137 -0
  375. package/dist/runtime/smooth.iife.js +2 -0
  376. package/dist/runtime/smooth.iife.js.map +1 -0
  377. package/dist/runtime/smooth.js +279 -0
  378. package/dist/runtime/smooth.js.map +1 -0
  379. package/dist/runtime/text.cjs +1 -1
  380. package/dist/runtime/text.cjs.map +1 -1
  381. package/dist/runtime/text.js +1 -1
  382. package/dist/runtime/text.js.map +1 -1
  383. package/dist/runtime.cjs +9 -8
  384. package/dist/runtime.cjs.map +1 -1
  385. package/dist/runtime.d.cts +1 -1
  386. package/dist/runtime.d.ts +1 -1
  387. package/dist/runtime.iife.js +1 -1
  388. package/dist/runtime.iife.js.map +1 -1
  389. package/dist/runtime.js +6 -5
  390. package/dist/runtime.js.map +1 -1
  391. package/dist/solid.cjs.map +1 -1
  392. package/dist/solid.js.map +1 -1
  393. package/dist/svelte.cjs.map +1 -1
  394. package/dist/svelte.js.map +1 -1
  395. package/dist/vue.cjs.map +1 -1
  396. package/dist/vue.js.map +1 -1
  397. package/dist/widgets.umd.js +1 -1
  398. package/dist/widgets.umd.js.map +1 -1
  399. package/docs/ROADMAP.md +2 -2
  400. package/docs/components/README.md +17 -7
  401. package/docs/components/usa-gl-scene.md +66 -0
  402. package/docs/components/usa-gpu-particles.md +32 -0
  403. package/docs/components/usa-parallax-layers.md +38 -0
  404. package/docs/components/usa-scroll-ring.md +32 -0
  405. package/docs/components/usa-shader-backdrop.md +36 -0
  406. package/docs/components/usa-smooth-scroll.md +60 -0
  407. package/docs/components/usa-three-scene.md +20 -0
  408. package/docs/components.md +97 -0
  409. package/docs/mcp.md +50 -0
  410. package/docs/runtime/format-apng.md +59 -0
  411. package/docs/runtime/format-gif.md +60 -0
  412. package/docs/runtime/format-gltf.md +63 -0
  413. package/docs/runtime/format-obj.md +59 -0
  414. package/docs/runtime/format-webp.md +58 -0
  415. package/docs/runtime/gl.md +62 -0
  416. package/docs/runtime/smooth.md +60 -0
  417. package/package.json +75 -3
  418. package/dist/chunks/keyframes-DVAC5sQI.js.map +0 -1
  419. package/dist/chunks/keyframes-Dw9zwVQa.cjs.map +0 -1
  420. package/dist/chunks/tween-CFN0WcOb.cjs.map +0 -1
  421. package/dist/chunks/tween-CGyolmzB.js.map +0 -1
@@ -0,0 +1,251 @@
1
+ /** A runtime module: `{ id, version, api }`, registered with `use()`. */
2
+ interface RuntimeModule<A = unknown> {
3
+ /** Module id: 'core', 'format-css', 'scroll', … (import path `motionary/runtime/<id>`). */
4
+ id: string;
5
+ version: string;
6
+ /** Other modules this one needs (registered first by `use()` callers). */
7
+ requires?: string[];
8
+ /** The module's public API (what `requireModule(id)` returns). */
9
+ api: A;
10
+ /** Optional one-time setup, called on first registration. */
11
+ setup?(registry: RuntimeRegistry): void;
12
+ }
13
+ interface RuntimeRegistry {
14
+ version: string;
15
+ modules: Map<string, RuntimeModule>;
16
+ /** Shared per-page state slots (the ticker lives here). */
17
+ slots: Record<string, unknown>;
18
+ }
19
+
20
+ /**
21
+ * `motionary/runtime/gl` (10.5) — a small WebGL2 scene renderer written for
22
+ * Motionary (not a Three.js clone; own API, own shaders):
23
+ *
24
+ * - **math** (`mat4`, quaternions — column-major `Float32Array`s), pure;
25
+ * - **scene graph**: `GlNode` (position / rotation quaternion / scale,
26
+ * children, optional mesh), `Camera` (perspective, `lookAt`), lights
27
+ * (`ambient`, up to 4 directional / point), `bounds()` + `frameNode()`;
28
+ * - **geometry** builders (`box`, `plane`, `sphere`, `torus`) and custom
29
+ * geometry from typed arrays (indexed 16 / 32-bit or not);
30
+ * - **materials**: `standard` (metallic-roughness PBR approximation, base
31
+ * colour texture, emissive, ACES-free Reinhard tone mapping, sRGB),
32
+ * `unlit`, and `shader` (your GLSL ES 3.00 fragment with the standard
33
+ * varyings + your uniforms);
34
+ * - **textures** from images, canvases, bitmaps and **videos** (updated per
35
+ * decoded frame with `requestVideoFrameCallback`; `scrubVideo()` seeks a
36
+ * video from a 0–1 progress, e.g. a scroll scene);
37
+ * - `orbitControls()` — drag / wheel / pinch / arrow keys, damping, optional
38
+ * auto-rotate (off under reduced motion).
39
+ *
40
+ * Math, geometry and the scene graph are pure (SSR / workers); rendering
41
+ * needs WebGL2 (`createRenderer()` throws a clear error without it). Model
42
+ * loaders live in `motionary/runtime/format-gltf` and `format-obj`.
43
+ */
44
+
45
+ type Vec3 = [number, number, number];
46
+ type Quat = [number, number, number, number];
47
+ type Mat4 = Float32Array;
48
+ interface Geometry {
49
+ positions: Float32Array;
50
+ normals?: Float32Array;
51
+ uvs?: Float32Array;
52
+ indices?: Uint16Array | Uint32Array;
53
+ /** 'triangles' (default), 'lines', 'points'. */
54
+ mode?: 'triangles' | 'lines' | 'points';
55
+ /** Renderer cache. */
56
+ _gpu?: unknown;
57
+ }
58
+ interface GlTexture {
59
+ source: TexImageSource | {
60
+ width: number;
61
+ height: number;
62
+ data: Uint8Array | Uint8ClampedArray;
63
+ };
64
+ /** sRGB colour data (default true for colour maps). */
65
+ srgb?: boolean;
66
+ repeat?: boolean;
67
+ flipY?: boolean;
68
+ /** Re-upload every frame a new video frame is ready. */
69
+ video?: boolean;
70
+ needsUpdate?: boolean;
71
+ _gpu?: unknown;
72
+ }
73
+ interface Material {
74
+ type: 'standard' | 'unlit' | 'shader';
75
+ /** Linear RGBA multiplier (sRGB input converted by the shader). */
76
+ color: [number, number, number, number];
77
+ map?: GlTexture | null;
78
+ metallic: number;
79
+ roughness: number;
80
+ emissive: Vec3;
81
+ doubleSided?: boolean;
82
+ transparent?: boolean;
83
+ wireframe?: boolean;
84
+ /** 'shader' materials: GLSL ES 3.00 fragment body + uniforms. */
85
+ fragment?: string;
86
+ uniforms?: Record<string, number | number[] | Float32Array | GlTexture>;
87
+ _gpu?: unknown;
88
+ }
89
+ interface Mesh {
90
+ geometry: Geometry;
91
+ material: Material;
92
+ }
93
+ declare class GlNode {
94
+ name: string;
95
+ position: Vec3;
96
+ rotation: Quat;
97
+ scale: Vec3;
98
+ /** Set to use a fixed local matrix instead of position / rotation / scale (glTF `matrix`). */
99
+ matrix: Mat4 | null;
100
+ children: GlNode[];
101
+ parent: GlNode | null;
102
+ mesh: Mesh | Mesh[] | null;
103
+ visible: boolean;
104
+ /** Free-form data (loaders put source info here). */
105
+ extras: Record<string, unknown>;
106
+ readonly world: Mat4;
107
+ constructor(name?: string, mesh?: Mesh | Mesh[] | null);
108
+ add(...nodes: GlNode[]): this;
109
+ remove(n: GlNode): void;
110
+ setEuler(x: number, y: number, z: number): this;
111
+ local(): Mat4;
112
+ /** Recompute world matrices of this subtree. */
113
+ updateWorld(parent?: Mat4): void;
114
+ traverse(fn: (n: GlNode) => void): void;
115
+ find(name: string): GlNode | null;
116
+ }
117
+
118
+ /**
119
+ * `motionary/runtime/format-gltf` (10.5) — glTF 2.0 / GLB loader for
120
+ * `motionary/runtime/gl` (own implementation):
121
+ *
122
+ * - `.gltf` (JSON + external or `data:` buffers / images) and `.glb`
123
+ * (binary container: JSON + BIN chunks);
124
+ * - scenes and the node hierarchy (TRS or `matrix`), meshes with several
125
+ * primitives (POSITION, NORMAL, TEXCOORD_0, indices; any component type,
126
+ * normalised integers, interleaved `byteStride`; modes points, lines,
127
+ * triangles, strips, fans);
128
+ * - PBR metallic-roughness materials (base colour factor + texture,
129
+ * metallic / roughness factors, emissive factor, alpha modes, double-sided);
130
+ * images from buffer views or URIs (decoded with `createImageBitmap`);
131
+ * - files that *require* an extension we do not implement (e.g. Draco /
132
+ * KTX2 compression) fail with a clear error naming it.
133
+ *
134
+ * Skins, morph targets and animations arrive in 10.8. `parseGlb()` /
135
+ * `gltfToNode()` with an `images` override are pure (SSR / workers).
136
+ */
137
+
138
+ interface GltfJson {
139
+ asset: {
140
+ version: string;
141
+ generator?: string;
142
+ };
143
+ scene?: number;
144
+ scenes?: {
145
+ nodes?: number[];
146
+ name?: string;
147
+ }[];
148
+ nodes?: {
149
+ name?: string;
150
+ children?: number[];
151
+ mesh?: number;
152
+ matrix?: number[];
153
+ translation?: number[];
154
+ rotation?: number[];
155
+ scale?: number[];
156
+ skin?: number;
157
+ camera?: number;
158
+ }[];
159
+ meshes?: {
160
+ name?: string;
161
+ primitives: {
162
+ attributes: Record<string, number>;
163
+ indices?: number;
164
+ material?: number;
165
+ mode?: number;
166
+ targets?: Record<string, number>[];
167
+ }[];
168
+ weights?: number[];
169
+ }[];
170
+ accessors?: {
171
+ bufferView?: number;
172
+ byteOffset?: number;
173
+ componentType: number;
174
+ normalized?: boolean;
175
+ count: number;
176
+ type: string;
177
+ min?: number[];
178
+ max?: number[];
179
+ sparse?: unknown;
180
+ }[];
181
+ bufferViews?: {
182
+ buffer: number;
183
+ byteOffset?: number;
184
+ byteLength: number;
185
+ byteStride?: number;
186
+ }[];
187
+ buffers?: {
188
+ uri?: string;
189
+ byteLength: number;
190
+ }[];
191
+ materials?: {
192
+ name?: string;
193
+ pbrMetallicRoughness?: {
194
+ baseColorFactor?: number[];
195
+ baseColorTexture?: {
196
+ index: number;
197
+ };
198
+ metallicFactor?: number;
199
+ roughnessFactor?: number;
200
+ };
201
+ emissiveFactor?: number[];
202
+ alphaMode?: string;
203
+ doubleSided?: boolean;
204
+ extensions?: Record<string, any>;
205
+ }[];
206
+ textures?: {
207
+ source?: number;
208
+ sampler?: number;
209
+ }[];
210
+ images?: {
211
+ uri?: string;
212
+ bufferView?: number;
213
+ mimeType?: string;
214
+ }[];
215
+ extensionsUsed?: string[];
216
+ extensionsRequired?: string[];
217
+ animations?: unknown[];
218
+ skins?: unknown[];
219
+ }
220
+ /** Extensions this loader understands (others that a file *requires* make it fail clearly). */
221
+ declare const SUPPORTED_EXTENSIONS: string[];
222
+ /** Split a GLB container into its JSON and BIN chunk (pure). */
223
+ declare function parseGlb(input: ArrayBuffer | Uint8Array): {
224
+ json: GltfJson;
225
+ bin: Uint8Array | null;
226
+ };
227
+ /** Read an accessor into a flat typed array (floats are de-interleaved; normalised ints become floats). */
228
+ declare function readAccessor(json: GltfJson, buffers: Uint8Array[], index: number, asFloat?: boolean): Float32Array | Uint16Array | Uint32Array | Uint8Array;
229
+ interface GltfImages {
230
+ /** Decoded images by glTF image index (pass your own for SSR / tests). */
231
+ [index: number]: TexImageSource | undefined;
232
+ }
233
+ /** Build a runtime/gl node tree from parsed glTF (pure, given buffers and decoded images). */
234
+ declare function gltfToNode(json: GltfJson, buffers: Uint8Array[], images?: GltfImages, sceneIndex?: number): GlNode;
235
+ /** Load a `.gltf` / `.glb` (URL or bytes) with its buffers and images and build a node tree. */
236
+ declare function loadGltf(src: string | ArrayBuffer | Uint8Array, o?: {
237
+ baseUrl?: string;
238
+ scene?: number;
239
+ }): Promise<GlNode>;
240
+ interface FormatGltfApi {
241
+ parseGlb: typeof parseGlb;
242
+ readAccessor: typeof readAccessor;
243
+ gltfToNode: typeof gltfToNode;
244
+ loadGltf: typeof loadGltf;
245
+ SUPPORTED_EXTENSIONS: typeof SUPPORTED_EXTENSIONS;
246
+ }
247
+ /** The module object for `use(formatGltf)` (needs `gl`). */
248
+ declare const formatGltf: RuntimeModule<FormatGltfApi>;
249
+
250
+ export { SUPPORTED_EXTENSIONS, formatGltf, gltfToNode, loadGltf, parseGlb, readAccessor };
251
+ export type { FormatGltfApi, GltfImages, GltfJson };
@@ -0,0 +1,251 @@
1
+ /** A runtime module: `{ id, version, api }`, registered with `use()`. */
2
+ interface RuntimeModule<A = unknown> {
3
+ /** Module id: 'core', 'format-css', 'scroll', … (import path `motionary/runtime/<id>`). */
4
+ id: string;
5
+ version: string;
6
+ /** Other modules this one needs (registered first by `use()` callers). */
7
+ requires?: string[];
8
+ /** The module's public API (what `requireModule(id)` returns). */
9
+ api: A;
10
+ /** Optional one-time setup, called on first registration. */
11
+ setup?(registry: RuntimeRegistry): void;
12
+ }
13
+ interface RuntimeRegistry {
14
+ version: string;
15
+ modules: Map<string, RuntimeModule>;
16
+ /** Shared per-page state slots (the ticker lives here). */
17
+ slots: Record<string, unknown>;
18
+ }
19
+
20
+ /**
21
+ * `motionary/runtime/gl` (10.5) — a small WebGL2 scene renderer written for
22
+ * Motionary (not a Three.js clone; own API, own shaders):
23
+ *
24
+ * - **math** (`mat4`, quaternions — column-major `Float32Array`s), pure;
25
+ * - **scene graph**: `GlNode` (position / rotation quaternion / scale,
26
+ * children, optional mesh), `Camera` (perspective, `lookAt`), lights
27
+ * (`ambient`, up to 4 directional / point), `bounds()` + `frameNode()`;
28
+ * - **geometry** builders (`box`, `plane`, `sphere`, `torus`) and custom
29
+ * geometry from typed arrays (indexed 16 / 32-bit or not);
30
+ * - **materials**: `standard` (metallic-roughness PBR approximation, base
31
+ * colour texture, emissive, ACES-free Reinhard tone mapping, sRGB),
32
+ * `unlit`, and `shader` (your GLSL ES 3.00 fragment with the standard
33
+ * varyings + your uniforms);
34
+ * - **textures** from images, canvases, bitmaps and **videos** (updated per
35
+ * decoded frame with `requestVideoFrameCallback`; `scrubVideo()` seeks a
36
+ * video from a 0–1 progress, e.g. a scroll scene);
37
+ * - `orbitControls()` — drag / wheel / pinch / arrow keys, damping, optional
38
+ * auto-rotate (off under reduced motion).
39
+ *
40
+ * Math, geometry and the scene graph are pure (SSR / workers); rendering
41
+ * needs WebGL2 (`createRenderer()` throws a clear error without it). Model
42
+ * loaders live in `motionary/runtime/format-gltf` and `format-obj`.
43
+ */
44
+
45
+ type Vec3 = [number, number, number];
46
+ type Quat = [number, number, number, number];
47
+ type Mat4 = Float32Array;
48
+ interface Geometry {
49
+ positions: Float32Array;
50
+ normals?: Float32Array;
51
+ uvs?: Float32Array;
52
+ indices?: Uint16Array | Uint32Array;
53
+ /** 'triangles' (default), 'lines', 'points'. */
54
+ mode?: 'triangles' | 'lines' | 'points';
55
+ /** Renderer cache. */
56
+ _gpu?: unknown;
57
+ }
58
+ interface GlTexture {
59
+ source: TexImageSource | {
60
+ width: number;
61
+ height: number;
62
+ data: Uint8Array | Uint8ClampedArray;
63
+ };
64
+ /** sRGB colour data (default true for colour maps). */
65
+ srgb?: boolean;
66
+ repeat?: boolean;
67
+ flipY?: boolean;
68
+ /** Re-upload every frame a new video frame is ready. */
69
+ video?: boolean;
70
+ needsUpdate?: boolean;
71
+ _gpu?: unknown;
72
+ }
73
+ interface Material {
74
+ type: 'standard' | 'unlit' | 'shader';
75
+ /** Linear RGBA multiplier (sRGB input converted by the shader). */
76
+ color: [number, number, number, number];
77
+ map?: GlTexture | null;
78
+ metallic: number;
79
+ roughness: number;
80
+ emissive: Vec3;
81
+ doubleSided?: boolean;
82
+ transparent?: boolean;
83
+ wireframe?: boolean;
84
+ /** 'shader' materials: GLSL ES 3.00 fragment body + uniforms. */
85
+ fragment?: string;
86
+ uniforms?: Record<string, number | number[] | Float32Array | GlTexture>;
87
+ _gpu?: unknown;
88
+ }
89
+ interface Mesh {
90
+ geometry: Geometry;
91
+ material: Material;
92
+ }
93
+ declare class GlNode {
94
+ name: string;
95
+ position: Vec3;
96
+ rotation: Quat;
97
+ scale: Vec3;
98
+ /** Set to use a fixed local matrix instead of position / rotation / scale (glTF `matrix`). */
99
+ matrix: Mat4 | null;
100
+ children: GlNode[];
101
+ parent: GlNode | null;
102
+ mesh: Mesh | Mesh[] | null;
103
+ visible: boolean;
104
+ /** Free-form data (loaders put source info here). */
105
+ extras: Record<string, unknown>;
106
+ readonly world: Mat4;
107
+ constructor(name?: string, mesh?: Mesh | Mesh[] | null);
108
+ add(...nodes: GlNode[]): this;
109
+ remove(n: GlNode): void;
110
+ setEuler(x: number, y: number, z: number): this;
111
+ local(): Mat4;
112
+ /** Recompute world matrices of this subtree. */
113
+ updateWorld(parent?: Mat4): void;
114
+ traverse(fn: (n: GlNode) => void): void;
115
+ find(name: string): GlNode | null;
116
+ }
117
+
118
+ /**
119
+ * `motionary/runtime/format-gltf` (10.5) — glTF 2.0 / GLB loader for
120
+ * `motionary/runtime/gl` (own implementation):
121
+ *
122
+ * - `.gltf` (JSON + external or `data:` buffers / images) and `.glb`
123
+ * (binary container: JSON + BIN chunks);
124
+ * - scenes and the node hierarchy (TRS or `matrix`), meshes with several
125
+ * primitives (POSITION, NORMAL, TEXCOORD_0, indices; any component type,
126
+ * normalised integers, interleaved `byteStride`; modes points, lines,
127
+ * triangles, strips, fans);
128
+ * - PBR metallic-roughness materials (base colour factor + texture,
129
+ * metallic / roughness factors, emissive factor, alpha modes, double-sided);
130
+ * images from buffer views or URIs (decoded with `createImageBitmap`);
131
+ * - files that *require* an extension we do not implement (e.g. Draco /
132
+ * KTX2 compression) fail with a clear error naming it.
133
+ *
134
+ * Skins, morph targets and animations arrive in 10.8. `parseGlb()` /
135
+ * `gltfToNode()` with an `images` override are pure (SSR / workers).
136
+ */
137
+
138
+ interface GltfJson {
139
+ asset: {
140
+ version: string;
141
+ generator?: string;
142
+ };
143
+ scene?: number;
144
+ scenes?: {
145
+ nodes?: number[];
146
+ name?: string;
147
+ }[];
148
+ nodes?: {
149
+ name?: string;
150
+ children?: number[];
151
+ mesh?: number;
152
+ matrix?: number[];
153
+ translation?: number[];
154
+ rotation?: number[];
155
+ scale?: number[];
156
+ skin?: number;
157
+ camera?: number;
158
+ }[];
159
+ meshes?: {
160
+ name?: string;
161
+ primitives: {
162
+ attributes: Record<string, number>;
163
+ indices?: number;
164
+ material?: number;
165
+ mode?: number;
166
+ targets?: Record<string, number>[];
167
+ }[];
168
+ weights?: number[];
169
+ }[];
170
+ accessors?: {
171
+ bufferView?: number;
172
+ byteOffset?: number;
173
+ componentType: number;
174
+ normalized?: boolean;
175
+ count: number;
176
+ type: string;
177
+ min?: number[];
178
+ max?: number[];
179
+ sparse?: unknown;
180
+ }[];
181
+ bufferViews?: {
182
+ buffer: number;
183
+ byteOffset?: number;
184
+ byteLength: number;
185
+ byteStride?: number;
186
+ }[];
187
+ buffers?: {
188
+ uri?: string;
189
+ byteLength: number;
190
+ }[];
191
+ materials?: {
192
+ name?: string;
193
+ pbrMetallicRoughness?: {
194
+ baseColorFactor?: number[];
195
+ baseColorTexture?: {
196
+ index: number;
197
+ };
198
+ metallicFactor?: number;
199
+ roughnessFactor?: number;
200
+ };
201
+ emissiveFactor?: number[];
202
+ alphaMode?: string;
203
+ doubleSided?: boolean;
204
+ extensions?: Record<string, any>;
205
+ }[];
206
+ textures?: {
207
+ source?: number;
208
+ sampler?: number;
209
+ }[];
210
+ images?: {
211
+ uri?: string;
212
+ bufferView?: number;
213
+ mimeType?: string;
214
+ }[];
215
+ extensionsUsed?: string[];
216
+ extensionsRequired?: string[];
217
+ animations?: unknown[];
218
+ skins?: unknown[];
219
+ }
220
+ /** Extensions this loader understands (others that a file *requires* make it fail clearly). */
221
+ declare const SUPPORTED_EXTENSIONS: string[];
222
+ /** Split a GLB container into its JSON and BIN chunk (pure). */
223
+ declare function parseGlb(input: ArrayBuffer | Uint8Array): {
224
+ json: GltfJson;
225
+ bin: Uint8Array | null;
226
+ };
227
+ /** Read an accessor into a flat typed array (floats are de-interleaved; normalised ints become floats). */
228
+ declare function readAccessor(json: GltfJson, buffers: Uint8Array[], index: number, asFloat?: boolean): Float32Array | Uint16Array | Uint32Array | Uint8Array;
229
+ interface GltfImages {
230
+ /** Decoded images by glTF image index (pass your own for SSR / tests). */
231
+ [index: number]: TexImageSource | undefined;
232
+ }
233
+ /** Build a runtime/gl node tree from parsed glTF (pure, given buffers and decoded images). */
234
+ declare function gltfToNode(json: GltfJson, buffers: Uint8Array[], images?: GltfImages, sceneIndex?: number): GlNode;
235
+ /** Load a `.gltf` / `.glb` (URL or bytes) with its buffers and images and build a node tree. */
236
+ declare function loadGltf(src: string | ArrayBuffer | Uint8Array, o?: {
237
+ baseUrl?: string;
238
+ scene?: number;
239
+ }): Promise<GlNode>;
240
+ interface FormatGltfApi {
241
+ parseGlb: typeof parseGlb;
242
+ readAccessor: typeof readAccessor;
243
+ gltfToNode: typeof gltfToNode;
244
+ loadGltf: typeof loadGltf;
245
+ SUPPORTED_EXTENSIONS: typeof SUPPORTED_EXTENSIONS;
246
+ }
247
+ /** The module object for `use(formatGltf)` (needs `gl`). */
248
+ declare const formatGltf: RuntimeModule<FormatGltfApi>;
249
+
250
+ export { SUPPORTED_EXTENSIONS, formatGltf, gltfToNode, loadGltf, parseGlb, readAccessor };
251
+ export type { FormatGltfApi, GltfImages, GltfJson };
@@ -0,0 +1,2 @@
1
+ !function(t,e){"use strict";const r={identity:()=>new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),multiply(t,e,r=new Float32Array(16)){for(let o=0;o<4;o++)for(let n=0;n<4;n++)r[4*o+n]=t[n]*e[4*o]+t[4+n]*e[4*o+1]+t[8+n]*e[4*o+2]+t[12+n]*e[4*o+3];return r},perspective(t,e,r,o){const n=1/Math.tan(t/2),i=1/(r-o);return new Float32Array([n/e,0,0,0,0,n,0,0,0,0,(o+r)*i,-1,0,0,2*o*r*i,0])},lookAt(t,e,r=[0,1,0]){let a=o(t,e);a=s(a.some(t=>t)?a:[0,0,1]);let l=i(r,a);l.some(t=>Math.abs(t)>1e-9)||(l=i([0,0,1],a)),l=s(l);const c=i(a,l);return new Float32Array([l[0],c[0],a[0],0,l[1],c[1],a[1],0,l[2],c[2],a[2],0,-n(l,t),-n(c,t),-n(a,t),1])},compose(t,e,r){const[o,n,i,s]=e,a=o+o,l=n+n,c=i+i,f=o*a,u=o*l,m=o*c,d=n*l,h=n*c,y=i*c,p=s*a,w=s*l,g=s*c;return new Float32Array([(1-(d+y))*r[0],(u+g)*r[0],(m-w)*r[0],0,(u-g)*r[1],(1-(f+y))*r[1],(h+p)*r[1],0,(m+w)*r[2],(h-p)*r[2],(1-(f+d))*r[2],0,t[0],t[1],t[2],1])},invert(t){const e=new Float32Array(16),[r,o,n,i,s,a,l,c,f,u,m,d,h,y,p,w]=t,g=r*a-o*s,b=r*l-n*s,A=r*c-i*s,v=o*l-n*a,E=o*c-i*a,U=n*c-i*l,M=f*y-u*h,x=f*p-m*h,T=f*w-d*h,O=u*p-m*y,R=u*w-d*y,F=m*w-d*p;let _=g*F-b*R+A*O+v*T-E*x+U*M;return _?(_=1/_,e[0]=(a*F-l*R+c*O)*_,e[1]=(n*R-o*F-i*O)*_,e[2]=(y*U-p*E+w*v)*_,e[3]=(m*E-u*U-d*v)*_,e[4]=(l*T-s*F-c*x)*_,e[5]=(r*F-n*T+i*x)*_,e[6]=(p*A-h*U-w*b)*_,e[7]=(f*U-m*A+d*b)*_,e[8]=(s*R-a*T+c*M)*_,e[9]=(o*T-r*R-i*M)*_,e[10]=(h*E-y*A+w*g)*_,e[11]=(u*A-f*E-d*g)*_,e[12]=(a*x-s*O-l*M)*_,e[13]=(r*O-o*x+n*M)*_,e[14]=(y*b-h*v-p*g)*_,e[15]=(f*v-u*b+m*g)*_,e):null},normal(t){const e=r.invert(t)||r.identity();return new Float32Array([e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]])},transformPoint(t,e){const r=t[3]*e[0]+t[7]*e[1]+t[11]*e[2]+t[15]||1;return[(t[0]*e[0]+t[4]*e[1]+t[8]*e[2]+t[12])/r,(t[1]*e[0]+t[5]*e[1]+t[9]*e[2]+t[13])/r,(t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14])/r]}},o=(t,e)=>[t[0]-e[0],t[1]-e[1],t[2]-e[2]],n=(t,e)=>t[0]*e[0]+t[1]*e[1]+t[2]*e[2],i=(t,e)=>[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]],s=t=>{const e=Math.hypot(t[0],t[1],t[2])||1;return[t[0]/e,t[1]/e,t[2]/e]};function a(t={}){return{type:"standard",color:[1,1,1,1],metallic:0,roughness:.6,emissive:[0,0,0],...t}}class l{constructor(t="",e=null){this.name="",this.position=[0,0,0],this.rotation=[0,0,0,1],this.scale=[1,1,1],this.matrix=null,this.children=[],this.parent=null,this.mesh=null,this.visible=!0,this.extras={},this.world=r.identity(),this.name=t,this.mesh=e}add(...t){for(const e of t)e.parent?.remove(e),e.parent=this,this.children.push(e);return this}remove(t){const e=this.children.indexOf(t);e>=0&&this.children.splice(e,1),t.parent=null}setEuler(t,e,r){return this.rotation=function(t,e,r){const o=Math.cos(t/2),n=Math.sin(t/2),i=Math.cos(e/2),s=Math.sin(e/2),a=Math.cos(r/2),l=Math.sin(r/2);return[n*i*a+o*s*l,o*s*a-n*i*l,o*i*l+n*s*a,o*i*a-n*s*l]}(t,e,r),this}local(){return this.matrix||r.compose(this.position,this.rotation,this.scale)}updateWorld(t){const e=t?r.multiply(t,this.local()):this.local();this.world.set(e);for(const t of this.children)t.updateWorld(this.world)}traverse(t){t(this);for(const e of this.children)e.traverse(t)}find(t){let e=null;return this.traverse(r=>{e||r.name!==t||(e=r)}),e}}const c=["KHR_materials_emissive_strength","KHR_materials_unlit"];function f(t){const e=t instanceof Uint8Array?t:new Uint8Array(t),r=new DataView(e.buffer,e.byteOffset,e.byteLength);if(1179937895!==r.getUint32(0,!0))throw new Error("[motionary] format-gltf: not a GLB file");if(2!==r.getUint32(4,!0))throw new Error("[motionary] format-gltf: only glTF 2.0 GLB is supported");const o=Math.min(r.getUint32(8,!0),e.byteLength);let n=12,i=null,s=null;for(;n+8<=o;){const t=r.getUint32(n,!0),o=r.getUint32(n+4,!0),a=e.subarray(n+8,n+8+t);1313821514===o?i=JSON.parse((new TextDecoder).decode(a)):5130562!==o||s||(s=a),n+=8+t}if(!i)throw new Error("[motionary] format-gltf: GLB without a JSON chunk");return{json:i,bin:s}}const u={5120:[1,Int8Array,127],5121:[1,Uint8Array,255],5122:[2,Int16Array,32767],5123:[2,Uint16Array,65535],5125:[4,Uint32Array,0],5126:[4,Float32Array,0]},m={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16};function d(t,e,r,o=!0){const n=t.accessors?.[r];if(!n)throw new Error(`[motionary] format-gltf: accessor ${r} missing`);const[i,s,a]=u[n.componentType]||[];if(!s)throw new Error(`[motionary] format-gltf: component type ${n.componentType} unsupported`);const l=m[n.type],c=n.count*l,f=s===Float32Array,d=o||f?new Float32Array(c):new s(c);if(void 0===n.bufferView)return d;const h=t.bufferViews[n.bufferView],y=e[h.buffer],p=(h.byteOffset||0)+(n.byteOffset||0),w=h.byteStride||i*l,g=new DataView(y.buffer,y.byteOffset,y.byteLength),b=t=>4===i?f?g.getFloat32(t,!0):g.getUint32(t,!0):2===i?s===Int16Array?g.getInt16(t,!0):g.getUint16(t,!0):s===Int8Array?g.getInt8(t):g.getUint8(t);for(let t=0;t<n.count;t++)for(let e=0;e<l;e++){let r=b(p+t*w+e*i);n.normalized&&a&&(r=Math.max(r/a,-1)),d[t*l+e]=r}return d}function h(t,e){const r=[];if(5===e)for(let e=0;e+2<t.length;e++)r.push(...e%2?[t[e+1],t[e],t[e+2]]:[t[e],t[e+1],t[e+2]]);else for(let e=1;e+1<t.length;e++)r.push(t[0],t[e],t[e+1]);return new Uint32Array(r)}function y(t,e,r={},n){if(!t.asset||!/^2\./.test(t.asset.version))throw new Error("[motionary] format-gltf: only glTF 2.0 is supported");const f=(t.extensionsRequired||[]).filter(t=>!c.includes(t));if(f.length)throw new Error(`[motionary] format-gltf: this file requires ${f.join(", ")}, which motionary/runtime/format-gltf does not implement${f.some(t=>/draco|KHR_texture_basisu|meshopt/i.test(t))?" (compressed geometry / textures need the official decoders — re-export the model without compression, or use the decoder hooks planned for 10.9)":""}`);const u=(t.materials||[]).map(e=>{const o=e.pbrMetallicRoughness||{},n=o.baseColorFactor||[1,1,1,1],i=t=>Math.pow(Math.max(0,t),1/2.2),s=e.extensions?.KHR_materials_emissive_strength?.emissiveStrength??1,l=a({color:[i(n[0]),i(n[1]),i(n[2]),n[3]??1],metallic:o.metallicFactor??1,roughness:o.roughnessFactor??1,emissive:(e.emissiveFactor||[0,0,0]).map(t=>t*s),doubleSided:!!e.doubleSided,transparent:"BLEND"===e.alphaMode});e.extensions?.KHR_materials_unlit&&(l.type="unlit");const c=o.baseColorTexture?.index,f=void 0!==c?t.textures?.[c]?.source:void 0;return void 0!==f&&r[f]&&(l.map=function(t,e={}){return{source:t,srgb:!0,repeat:!0,flipY:!1,video:"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement,needsUpdate:!0,...e}}(r[f])),l}),m=(t.meshes||[]).map(r=>r.primitives.map(r=>{const n=r.mode??4;let l={positions:d(t,e,r.attributes.POSITION),normals:void 0!==r.attributes.NORMAL?d(t,e,r.attributes.NORMAL):void 0,uvs:void 0!==r.attributes.TEXCOORD_0?d(t,e,r.attributes.TEXCOORD_0):void 0,mode:0===n?"points":n>=1&&n<=3?"lines":"triangles"};if(void 0!==r.indices){let o=d(t,e,r.indices,!1);5!==n&&6!==n||(o=h(Uint32Array.from(o),n)),l.indices=o instanceof Uint8Array||o instanceof Uint32Array&&l.positions.length/3<=65535?Uint16Array.from(o):o}else 5!==n&&6!==n||(l.indices=h(Uint32Array.from({length:l.positions.length/3},(t,e)=>e),n));return l.normals||"triangles"!==l.mode||(l=function(t){const e=t.positions,r=t.indices,n=r?r.length:e.length/3,a=new Float32Array(3*n),l=new Float32Array(3*n),c=t.uvs?new Float32Array(2*n):void 0;for(let f=0;f<n;f+=3){const n=[0,1,2].map(t=>r?r[f+t]:f+t),u=[e[3*n[0]],e[3*n[0]+1],e[3*n[0]+2]],m=[e[3*n[1]],e[3*n[1]+1],e[3*n[1]+2]],d=[e[3*n[2]],e[3*n[2]+1],e[3*n[2]+2]],h=s(i(o(m,u),o(d,u)));n.forEach((r,o)=>{a.set(e.subarray(3*r,3*r+3),3*(f+o)),l.set(h,3*(f+o)),c&&t.uvs&&c.set(t.uvs.subarray(2*r,2*r+2),2*(f+o))})}return{positions:a,normals:l,uvs:c,mode:t.mode}}(l)),{geometry:l,material:void 0!==r.material?u[r.material]:a({metallic:0,roughness:.6})}})),y=(t.nodes||[]).map((t,e)=>{const r=new l(t.name||`node${e}`,void 0!==t.mesh?m[t.mesh]:null);return t.matrix&&(r.matrix=new Float32Array(t.matrix)),t.translation&&(r.position=t.translation.slice(0,3)),t.rotation&&(r.rotation=t.rotation.slice(0,4)),t.scale&&(r.scale=t.scale.slice(0,3)),r.extras.gltfIndex=e,r});(t.nodes||[]).forEach((t,e)=>(t.children||[]).forEach(t=>y[e].add(y[t])));const p=new l("gltf"),w=t.scenes?.[n??t.scene??0];return(w?.nodes??y.map((t,e)=>e).filter(t=>!y[t].parent)).forEach(t=>p.add(y[t])),p.extras={gltf:t,nodes:y},p}async function p(t,e={}){const r=e.baseUrl||("string"==typeof t?new URL(t,"undefined"!=typeof location?location.href:"file:///").href:"undefined"!=typeof location?location.href:"file:///"),o=async t=>{if(t.startsWith("data:"))return(t=>{const[,e,r]=/^data:([^,]*),(.*)$/s.exec(t)||[];if(void 0===e)throw new Error("[motionary] format-gltf: bad data URI");if(/;base64/.test(e)){const t=atob(r);return Uint8Array.from(t,t=>t.charCodeAt(0))}return(new TextEncoder).encode(decodeURIComponent(r))})(t);const e=await fetch(new URL(t,r).href);if(!e.ok)throw new Error(`[motionary] format-gltf: could not load ${t} (${e.status})`);return new Uint8Array(await e.arrayBuffer())},n="string"==typeof t?await o(t):t instanceof Uint8Array?t:new Uint8Array(t);let i,s=null;103===n[0]&&108===n[1]&&84===n[2]&&70===n[3]?({json:i,bin:s}=f(n)):i=JSON.parse((new TextDecoder).decode(n));const a=await Promise.all((i.buffers||[]).map((t,e)=>t.uri?o(t.uri):0===e&&s?Promise.resolve(s):Promise.reject(new Error("[motionary] format-gltf: buffer without data")))),l={};return await Promise.all((i.images||[]).map(async(t,e)=>{let r;if(void 0!==t.bufferView){const e=i.bufferViews[t.bufferView];r=a[e.buffer].subarray(e.byteOffset||0,(e.byteOffset||0)+e.byteLength)}else{if(!t.uri)return;r=await o(t.uri)}l[e]=await createImageBitmap(new Blob([r],{type:t.mimeType||(t.uri&&/\.jpe?g$/i.test(t.uri)?"image/jpeg":"image/png")}))})),y(i,a,l,e.scene)}const w={id:"format-gltf",version:e.RUNTIME_VERSION,requires:["core","gl"],api:{parseGlb:f,readAccessor:d,gltfToNode:y,loadGltf:p,SUPPORTED_EXTENSIONS:c}};e.register(w),t.SUPPORTED_EXTENSIONS=c,t.formatGltf=w,t.gltfToNode=y,t.loadGltf=p,t.parseGlb=f,t.readAccessor=d}(this.MotionaryRuntime=this.MotionaryRuntime||{},MotionaryRuntime);
2
+ //# sourceMappingURL=format-gltf.iife.js.map