motionary 10.5.0 → 10.7.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 (128) hide show
  1. package/AGENTS.md +2 -0
  2. package/CHANGELOG.md +28 -0
  3. package/README.md +95 -1
  4. package/bin/motionary-mcp.mjs +160 -11
  5. package/dist/chunks/{anim-image-DuxvYhq6.cjs → anim-image-CFGpUX7t.cjs} +2 -2
  6. package/dist/chunks/{anim-image-DuxvYhq6.cjs.map → anim-image-CFGpUX7t.cjs.map} +1 -1
  7. package/dist/chunks/{anim-image-BlNPv4JG.js → anim-image-CXDD19FH.js} +2 -2
  8. package/dist/chunks/{anim-image-BlNPv4JG.js.map → anim-image-CXDD19FH.js.map} +1 -1
  9. package/dist/chunks/{keyframes-Ce1s05n3.cjs → keyframes-DdwGY1gr.cjs} +2 -2
  10. package/dist/chunks/{keyframes-Ce1s05n3.cjs.map → keyframes-DdwGY1gr.cjs.map} +1 -1
  11. package/dist/chunks/{keyframes-B8ITIAVa.js → keyframes-DwR6GPej.js} +2 -2
  12. package/dist/chunks/{keyframes-B8ITIAVa.js.map → keyframes-DwR6GPej.js.map} +1 -1
  13. package/dist/chunks/{registry-DXdFb2fJ.js → registry-D87dP_aR.js} +3 -3
  14. package/dist/chunks/{registry-DXdFb2fJ.js.map → registry-D87dP_aR.js.map} +1 -1
  15. package/dist/chunks/{registry-VhfPSI0v.cjs → registry-DhKZCitb.cjs} +2 -2
  16. package/dist/chunks/{registry-VhfPSI0v.cjs.map → registry-DhKZCitb.cjs.map} +1 -1
  17. package/dist/chunks/{ticker-C5RMHMW7.js → ticker-CJYI5Pxc.js} +2 -2
  18. package/dist/chunks/{ticker-C5RMHMW7.js.map → ticker-CJYI5Pxc.js.map} +1 -1
  19. package/dist/chunks/{ticker-DvmC6WLS.cjs → ticker-jD9_A9Rh.cjs} +2 -2
  20. package/dist/chunks/{ticker-DvmC6WLS.cjs.map → ticker-jD9_A9Rh.cjs.map} +1 -1
  21. package/dist/chunks/{tween-_BGIl6hK.cjs → tween-Dk0QmNe9.cjs} +2 -2
  22. package/dist/chunks/{tween-_BGIl6hK.cjs.map → tween-Dk0QmNe9.cjs.map} +1 -1
  23. package/dist/chunks/{tween-CPtm-EdT.js → tween-_Lld1MsF.js} +2 -2
  24. package/dist/chunks/{tween-CPtm-EdT.js.map → tween-_Lld1MsF.js.map} +1 -1
  25. package/dist/components/ai.cjs +314 -0
  26. package/dist/components/ai.cjs.map +1 -0
  27. package/dist/components/ai.d.cts +58 -0
  28. package/dist/components/ai.d.ts +58 -0
  29. package/dist/components/ai.js +311 -0
  30. package/dist/components/ai.js.map +1 -0
  31. package/dist/components/lite.cjs +179 -0
  32. package/dist/components/lite.cjs.map +1 -1
  33. package/dist/components/lite.js +176 -1
  34. package/dist/components/lite.js.map +1 -1
  35. package/dist/components/tokens.cjs +179 -0
  36. package/dist/components/tokens.cjs.map +1 -1
  37. package/dist/components/tokens.d.cts +36 -1
  38. package/dist/components/tokens.d.ts +36 -1
  39. package/dist/components/tokens.js +176 -1
  40. package/dist/components/tokens.js.map +1 -1
  41. package/dist/components/widgets.cjs +985 -221
  42. package/dist/components/widgets.cjs.map +1 -1
  43. package/dist/components/widgets.d.cts +606 -4
  44. package/dist/components/widgets.d.ts +606 -4
  45. package/dist/components/widgets.js +976 -222
  46. package/dist/components/widgets.js.map +1 -1
  47. package/dist/components.cjs +4 -0
  48. package/dist/components.cjs.map +1 -1
  49. package/dist/components.d.cts +36 -1
  50. package/dist/components.d.ts +36 -1
  51. package/dist/components.js +1 -1
  52. package/dist/components.umd.js +2 -2
  53. package/dist/components.umd.js.map +1 -1
  54. package/dist/index.umd.js.map +1 -1
  55. package/dist/llms-full.txt +221 -1
  56. package/dist/llms.txt +11 -2
  57. package/dist/manifest.json +580 -1
  58. package/dist/runtime/format-apng.cjs +4 -4
  59. package/dist/runtime/format-apng.js +4 -4
  60. package/dist/runtime/format-css.cjs +4 -4
  61. package/dist/runtime/format-css.js +4 -4
  62. package/dist/runtime/format-gif.cjs +4 -4
  63. package/dist/runtime/format-gif.js +4 -4
  64. package/dist/runtime/format-gltf.cjs +1 -1
  65. package/dist/runtime/format-gltf.js +1 -1
  66. package/dist/runtime/format-motion.cjs +4 -4
  67. package/dist/runtime/format-motion.js +4 -4
  68. package/dist/runtime/format-obj.cjs +1 -1
  69. package/dist/runtime/format-obj.js +1 -1
  70. package/dist/runtime/format-scene.cjs +241 -0
  71. package/dist/runtime/format-scene.cjs.map +1 -0
  72. package/dist/runtime/format-scene.d.cts +349 -0
  73. package/dist/runtime/format-scene.d.ts +349 -0
  74. package/dist/runtime/format-scene.iife.js +2 -0
  75. package/dist/runtime/format-scene.iife.js.map +1 -0
  76. package/dist/runtime/format-scene.js +233 -0
  77. package/dist/runtime/format-scene.js.map +1 -0
  78. package/dist/runtime/format-sprite.cjs +3 -3
  79. package/dist/runtime/format-sprite.js +3 -3
  80. package/dist/runtime/format-svg.cjs +3 -3
  81. package/dist/runtime/format-svg.js +3 -3
  82. package/dist/runtime/format-webp.cjs +4 -4
  83. package/dist/runtime/format-webp.js +4 -4
  84. package/dist/runtime/gl.cjs +1 -1
  85. package/dist/runtime/gl.js +1 -1
  86. package/dist/runtime/physics.cjs +739 -0
  87. package/dist/runtime/physics.cjs.map +1 -0
  88. package/dist/runtime/physics.d.cts +250 -0
  89. package/dist/runtime/physics.d.ts +250 -0
  90. package/dist/runtime/physics.iife.js +2 -0
  91. package/dist/runtime/physics.iife.js.map +1 -0
  92. package/dist/runtime/physics.js +731 -0
  93. package/dist/runtime/physics.js.map +1 -0
  94. package/dist/runtime/scroll.cjs +2 -2
  95. package/dist/runtime/scroll.js +2 -2
  96. package/dist/runtime/smooth.cjs +1 -1
  97. package/dist/runtime/smooth.js +1 -1
  98. package/dist/runtime/text.cjs +1 -1
  99. package/dist/runtime/text.js +1 -1
  100. package/dist/runtime/vector.cjs +704 -0
  101. package/dist/runtime/vector.cjs.map +1 -0
  102. package/dist/runtime/vector.d.cts +306 -0
  103. package/dist/runtime/vector.d.ts +306 -0
  104. package/dist/runtime/vector.iife.js +2 -0
  105. package/dist/runtime/vector.iife.js.map +1 -0
  106. package/dist/runtime/vector.js +692 -0
  107. package/dist/runtime/vector.js.map +1 -0
  108. package/dist/runtime.cjs +3 -3
  109. package/dist/runtime.d.cts +1 -1
  110. package/dist/runtime.d.ts +1 -1
  111. package/dist/runtime.iife.js +1 -1
  112. package/dist/runtime.iife.js.map +1 -1
  113. package/dist/runtime.js +5 -5
  114. package/dist/widgets.umd.js +1 -1
  115. package/dist/widgets.umd.js.map +1 -1
  116. package/docs/ROADMAP.md +2 -2
  117. package/docs/components/README.md +6 -1
  118. package/docs/components/usa-lottie-player.md +60 -0
  119. package/docs/components/usa-motion-prompt.md +32 -0
  120. package/docs/components/usa-physics-playground.md +63 -0
  121. package/docs/components/usa-rive.md +57 -0
  122. package/docs/components/usa-token-editor.md +32 -0
  123. package/docs/components.md +116 -0
  124. package/docs/runtime/format-scene.md +59 -0
  125. package/docs/runtime/physics.md +61 -0
  126. package/docs/runtime/rive.md +55 -0
  127. package/docs/runtime/vector.md +67 -0
  128. package/package.json +46 -2
@@ -1,4 +1,4 @@
1
- # Motionary 10.5.0 — full component reference
1
+ # Motionary 10.7.0 — full component reference
2
2
 
3
3
  Generated from the source. Machine-readable version: https://harrisoncn.github.io/Motionary/components.json (schema https://harrisoncn.github.io/Motionary/components.schema.json).
4
4
 
@@ -319,6 +319,96 @@ const cube = await loadObj('/models/cube.obj'); // + cube.mtl + textures next to
319
319
  new Scene().add(cube);
320
320
  ```
321
321
 
322
+ ### motionary/runtime/vector — Lottie + dotLottie player
323
+
324
+ Plays Lottie (bodymovin JSON) and dotLottie (.lottie) files on Canvas 2D with Motionary’s own renderer (no lottie-web code): shapes, gradients, trim paths, masks, track mattes, precomps, images; a runtime timeline you can seek, reverse and scrub.
325
+
326
+ - Install: `npm i motionary`
327
+ - Import: `motionary/runtime/vector`
328
+ - Register: `use(vector);` — Register the core first, then the module: use(vector) also registers the core. CDN: load runtime.iife.js, then runtime/vector.iife.js (it registers itself).
329
+ - CDN:
330
+
331
+ ```html
332
+ <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js"></script>
333
+ <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/vector.iife.js"></script>
334
+ ```
335
+
336
+ ```js
337
+ import { use } from 'motionary/runtime';
338
+ import { vector, loadLottie, lottiePlayer } from 'motionary/runtime/vector';
339
+ use(vector);
340
+ const { animation } = await loadLottie('/anim/hero.lottie');
341
+ const player = lottiePlayer(canvas, animation, { loop: true });
342
+ player.play();
343
+ ```
344
+
345
+ ### @rive-app/canvas — Official Rive runtime
346
+
347
+ The official MIT-licensed Rive runtime, used by <usa-rive> to play .riv files (artboards, animations, state machines with inputs). Optional peer dependency: lazy-loaded on first use, never bundled into Motionary.
348
+
349
+ - Install: `npm i @rive-app/canvas`
350
+ - Import: `@rive-app/canvas`
351
+ - Register: `provideRiveRuntime(() => import('@rive-app/canvas')); // lazy: fetched when the first <usa-rive> mounts` — Install the official runtime next to motionary, then hand <usa-rive> a lazy loader with provideRiveRuntime(() => import('@rive-app/canvas')) before the element mounts — your bundler splits the runtime into its own chunk, fetched only when the first <usa-rive> appears. Without a bundler: load the official rive.js from a CDN before the component bundles (window.rive), use an import map, or set runtime-src on the element. Missing → a clear message in place + usa:runtime-missing.
352
+ - CDN:
353
+
354
+ ```html
355
+ <script src="https://unpkg.com/@rive-app/canvas@2.44.1/rive.js"></script>
356
+ ```
357
+
358
+ ```js
359
+ // npm i @rive-app/canvas
360
+ import { defineRive } from 'motionary/components/widgets';
361
+ defineRive();
362
+ // <usa-rive src="/anim/icon.riv" state-machine="State Machine 1" autoplay></usa-rive>
363
+ ```
364
+
365
+ ### motionary/runtime/physics — 2D rigid-body physics
366
+
367
+ A small 2D rigid-body engine written for Motionary (own implementation and API — no Matter.js / Box2D code): circles, boxes and convex polygons, mass from density, restitution, friction, sensors, collision groups, sleeping, distance / spring / pin constraints, pointer drag, a fixed time step on the shared ticker.
368
+
369
+ - Install: `npm i motionary`
370
+ - Import: `motionary/runtime/physics`
371
+ - Register: `use(physics);` — Register the core first, then the module: use(physics) also registers the core. CDN: load runtime.iife.js, then runtime/physics.iife.js (it registers itself).
372
+ - CDN:
373
+
374
+ ```html
375
+ <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js"></script>
376
+ <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/physics.iife.js"></script>
377
+ ```
378
+
379
+ ```js
380
+ import { use } from 'motionary/runtime';
381
+ import { physics, createWorld } from 'motionary/runtime/physics';
382
+ use(physics);
383
+ const world = createWorld({ gravity: [0, 980] });
384
+ world.bounds(600, 400);
385
+ const ball = world.body({ shape: 'circle', x: 300, y: 40, radius: 20, restitution: 0.7 });
386
+ world.run(); // steps on the shared ticker
387
+ ```
388
+
389
+ ### motionary/runtime/format-scene — Scene JSON (motionary-scene@1)
390
+
391
+ The versioned motionary-scene@1 format: a JSON description of a 2D physics scene (world, named materials, bodies, constraints, per-body style) — validate, migrate older drafts, load into a physics world and save one back.
392
+
393
+ - Install: `npm i motionary`
394
+ - Import: `motionary/runtime/format-scene`
395
+ - Register: `use(formatScene);` — Register the core first, then the module: use(formatScene) also registers the core. CDN: load runtime.iife.js, then runtime/format-scene.iife.js (it registers itself).
396
+ - CDN:
397
+
398
+ ```html
399
+ <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js"></script>
400
+ <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/format-scene.iife.js"></script>
401
+ ```
402
+
403
+ ```js
404
+ import { use } from 'motionary/runtime';
405
+ import { physics } from 'motionary/runtime/physics';
406
+ import { formatScene, sceneToWorld } from 'motionary/runtime/format-scene';
407
+ use(physics, formatScene);
408
+ const { world, bodies } = sceneToWorld(await (await fetch('/scenes/stack.json')).json());
409
+ world.run();
410
+ ```
411
+
322
412
  ## Components
323
413
 
324
414
  ### <usa-accordion> — Accordion
@@ -1660,6 +1750,40 @@ A slim NProgress-style bar for route changes and fetches: loadingBar.start() tri
1660
1750
  <usa-lottie-icon name="bell" trigger="hover"></usa-lottie-icon>
1661
1751
  ```
1662
1752
 
1753
+ ### <usa-lottie-player> — Lottie player (JSON + dotLottie)
1754
+
1755
+ 10.6: plays Lottie JSON and dotLottie (.lottie) files with Motionary’s own Canvas 2D renderer — shapes, gradients, trim paths, masks, track mattes, precomps and images; autoplay, loop, bounce, segments / markers, play on hover or scrub with scroll. Requires motionary/runtime/vector — npm i motionary, then use(vector) before it mounts.
1756
+
1757
+ - Import: `import { defineLottiePlayer } from 'motionary/components/widgets'; defineLottiePlayer();`
1758
+ - CDN: https://unpkg.com/motionary@10/dist/widgets.umd.js
1759
+ - Attributes: `src`, `animation`, `autoplay`, `loop`, `speed`, `mode`, `segment`, `hover`, `scrub`, `fit`, `background`, `label`
1760
+ - Events: `usa:complete`, `usa:load`, `usa:error`, `usa:runtime-missing`
1761
+ - Methods: `play()`, `pause()`, `stop()`, `seek()`
1762
+ - Requires: motionary/runtime/vector
1763
+ - Install: `npm i motionary`
1764
+ - Order: Register the core first, then the module: use(vector) also registers the core. CDN: load runtime.iife.js, then runtime/vector.iife.js (it registers itself).
1765
+
1766
+ ```js
1767
+ import { use } from 'motionary/runtime';
1768
+ import { vector } from 'motionary/runtime/vector';
1769
+ import { defineLottiePlayer } from 'motionary/components/widgets';
1770
+
1771
+ use(vector);
1772
+ defineLottiePlayer(); // registers <usa-lottie-player> — after the prerequisites
1773
+ ```
1774
+
1775
+ ```html
1776
+ <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js"></script>
1777
+ <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/vector.iife.js"></script>
1778
+ <!-- then the component bundles -->
1779
+ <script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>
1780
+ <script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>
1781
+ ```
1782
+
1783
+ ```html
1784
+ <usa-lottie-player src="/anim/hero.lottie" autoplay loop label="Hero animation"></usa-lottie-player>
1785
+ ```
1786
+
1663
1787
  ### <usa-lyrics> — Synced karaoke lyrics
1664
1788
 
1665
1789
  7.1: LRC or [data-t] lines; the active line glows, scrolls to the centre and a highlight sweeps across it while past lines dim. Follows an <audio>, <video> or <usa-music-player> via for.
@@ -1901,6 +2025,20 @@ Morph an SVG path through a list of shapes (paths="A | B | C") on click, hover,
1901
2025
  <usa-motion-prefs></usa-motion-prefs>
1902
2026
  ```
1903
2027
 
2028
+ ### <usa-motion-prompt> — Motion prompt (text → motion)
2029
+
2030
+ 10.7 (AI-assisted motion): describe a motion in English or Chinese and get a live preview plus ready code — Web Animations, CSS (with a reduced-motion guard) or a Motionary component. A small deterministic parser (motionary/components/ai), no model and no network; the same parser powers suggest_motion in motionary-mcp 2.0.
2031
+
2032
+ - Import: `import { defineMotionPrompt } from 'motionary/components/widgets'; defineMotionPrompt();`
2033
+ - CDN: https://unpkg.com/motionary@10/dist/widgets.umd.js
2034
+ - Attributes: `value`, `format`, `placeholder`, `label`
2035
+ - Events: `usa:suggest`, `usa:copy`
2036
+ - Methods: `suggest()`
2037
+
2038
+ ```html
2039
+ <usa-motion-prompt value="fade the cards up slowly, one after another"></usa-motion-prompt>
2040
+ ```
2041
+
1904
2042
  ### <usa-motion-spec> — Motion spec sheet
1905
2043
 
1906
2044
  9.7: a motion spec sheet for design hand-off — each rule of a motion string with its trigger, a duration bar on a shared timeline and the easing curve, a Play playhead and Copy CSS; pairs with the Figma plugin and Framer export of motionary/design.
@@ -2184,6 +2322,42 @@ A canvas constellation that drifts away from the pointer. Runs only while visibl
2184
2322
  <usa-perf-monitor corner="bottom-right"></usa-perf-monitor>
2185
2323
  ```
2186
2324
 
2325
+ ### <usa-physics-playground> — Physics playground
2326
+
2327
+ 10.7: a 2D rigid-body sandbox on Motionary’s own physics engine — circles, boxes and polygons, friction, restitution, constraints, sleeping — loaded from a versioned motionary-scene@1 JSON (or a preset: balls, pyramid, pendulum, dominoes). Drag bodies, tap to spawn, arrow keys nudge. Requires motionary/runtime/physics + motionary/runtime/format-scene — npm i motionary, then use(physics, formatScene) before it mounts.
2328
+
2329
+ - Import: `import { definePhysicsPlayground } from 'motionary/components/widgets'; definePhysicsPlayground();`
2330
+ - CDN: https://unpkg.com/motionary@10/dist/widgets.umd.js
2331
+ - Attributes: `preset`, `src`, `gravity`, `spawn`, `label`
2332
+ - Events: `usa:collision`, `usa:load`, `usa:error`, `usa:runtime-missing`
2333
+ - Methods: `reset()`, `play()`, `pause()`, `toScene()`
2334
+ - Requires: motionary/runtime/physics + motionary/runtime/format-scene
2335
+ - Install: `npm i motionary`
2336
+ - Order: Register the core first, then the module: use(physics) also registers the core. CDN: load runtime.iife.js, then runtime/physics.iife.js (it registers itself). Register the core first, then the module: use(formatScene) also registers the core. CDN: load runtime.iife.js, then runtime/format-scene.iife.js (it registers itself).
2337
+
2338
+ ```js
2339
+ import { use } from 'motionary/runtime';
2340
+ import { physics } from 'motionary/runtime/physics';
2341
+ import { formatScene } from 'motionary/runtime/format-scene';
2342
+ import { definePhysicsPlayground } from 'motionary/components/widgets';
2343
+
2344
+ use(physics, formatScene);
2345
+ definePhysicsPlayground(); // registers <usa-physics-playground> — after the prerequisites
2346
+ ```
2347
+
2348
+ ```html
2349
+ <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js"></script>
2350
+ <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/physics.iife.js"></script>
2351
+ <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/format-scene.iife.js"></script>
2352
+ <!-- then the component bundles -->
2353
+ <script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>
2354
+ <script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>
2355
+ ```
2356
+
2357
+ ```html
2358
+ <usa-physics-playground preset="pyramid" spawn label="Knock the pyramid over"></usa-physics-playground>
2359
+ ```
2360
+
2187
2361
  ### <usa-pinch-zoom> — Pinch zoom
2188
2362
 
2189
2363
  Pinch with two fingers or Ctrl + wheel / trackpad pinch, pan while zoomed, double-tap to toggle; scale and position spring back inside the bounds.
@@ -2507,6 +2681,38 @@ Ink ripple from the pointer — or from the centre for Space/Enter — on any bu
2507
2681
  <usa-ripple><button>Click me</button></usa-ripple>
2508
2682
  ```
2509
2683
 
2684
+ ### <usa-rive> — Rive player (official runtime)
2685
+
2686
+ 10.6: plays Rive (.riv) files — artboards, animations and state machines with inputs — through the official Rive runtime @rive-app/canvas, an optional peer dependency that is lazy-loaded on first use (Motionary does not reimplement the proprietary .riv format). Requires @rive-app/canvas — npm i @rive-app/canvas, or load its CDN script first; missing → a clear message in place.
2687
+
2688
+ - Import: `import { defineRive } from 'motionary/components/widgets'; defineRive();`
2689
+ - CDN: https://unpkg.com/motionary@10/dist/widgets.umd.js
2690
+ - Attributes: `src`, `artboard`, `animation`, `state-machine`, `autoplay`, `fit`, `label`, `runtime-src`
2691
+ - Events: `usa:load`, `usa:error`, `usa:runtime-missing`
2692
+ - Methods: `play()`, `pause()`, `input()`
2693
+ - Requires: @rive-app/canvas
2694
+ - Install: `npm i @rive-app/canvas`
2695
+ - Order: Install the official runtime next to motionary, then hand <usa-rive> a lazy loader with provideRiveRuntime(() => import('@rive-app/canvas')) before the element mounts — your bundler splits the runtime into its own chunk, fetched only when the first <usa-rive> appears. Without a bundler: load the official rive.js from a CDN before the component bundles (window.rive), use an import map, or set runtime-src on the element. Missing → a clear message in place + usa:runtime-missing.
2696
+
2697
+ ```js
2698
+ import { provideRiveRuntime } from 'motionary/components/widgets';
2699
+ import { defineRive } from 'motionary/components/widgets';
2700
+
2701
+ provideRiveRuntime(() => import('@rive-app/canvas')); // lazy: fetched when the first <usa-rive> mounts
2702
+ defineRive(); // registers <usa-rive> — after the prerequisites
2703
+ ```
2704
+
2705
+ ```html
2706
+ <script src="https://unpkg.com/@rive-app/canvas@2.44.1/rive.js"></script>
2707
+ <!-- then the component bundles -->
2708
+ <script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>
2709
+ <script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>
2710
+ ```
2711
+
2712
+ ```html
2713
+ <usa-rive src="/anim/icon.riv" state-machine="State Machine 1" autoplay label="Icon"></usa-rive>
2714
+ ```
2715
+
2510
2716
  ### <usa-route-transition> — Route transition container
2511
2717
 
2512
2718
  10.3: View Transitions 2.0 — link clicks swap the container’s content with the target page (fetched) or an inline <template data-route>, animated with the View Transitions API (Web Animations fallback); data-shared elements morph between routes; cross-document enables native MPA transitions.
@@ -3356,6 +3562,20 @@ toast("Saved") slides a notification in; it pauses on hover, stacks with FLIP an
3356
3562
  </script>
3357
3563
  ```
3358
3564
 
3565
+ ### <usa-token-editor> — Motion token editor (W3C DTCG)
3566
+
3567
+ 10.6 (motion design tokens 2.0): edit duration and cubic-bézier easing tokens with a live preview per token, then export W3C Design Tokens (DTCG 2025.10 or the earlier draft) or import a DTCG file — aliases resolved, problems listed; apply writes the tokens to :root custom properties as you edit.
3568
+
3569
+ - Import: `import { defineTokenEditor } from 'motionary/components/widgets'; defineTokenEditor();`
3570
+ - CDN: https://unpkg.com/motionary@10/dist/widgets.umd.js
3571
+ - Attributes: `apply`, `format`, `groups`
3572
+ - Events: `usa:export`, `usa:import`, `usa:change`
3573
+ - Methods: `exportJSON()`, `importJSON()`
3574
+
3575
+ ```html
3576
+ <usa-token-editor apply format="2025.10"></usa-token-editor>
3577
+ ```
3578
+
3359
3579
  ### <usa-typewriter> — Typewriter
3360
3580
 
3361
3581
  Types text, or cycles through phrases with delete and pause. Full text stays available to screen readers.
package/dist/llms.txt CHANGED
@@ -1,6 +1,6 @@
1
- # Motionary 10.5.0
1
+ # Motionary 10.7.0
2
2
 
3
- > Motionary is a zero-dependency motion library: scroll animations, 200+ presets and 202 animated Web Components (<usa-*>) that work in plain HTML and every framework, plus motionary/runtime — its own tween/timeline engine and format loaders.
3
+ > Motionary is a zero-dependency motion library: scroll animations, 200+ presets and 207 animated Web Components (<usa-*>) that work in plain HTML and every framework, plus motionary/runtime — its own tween/timeline engine and format loaders.
4
4
 
5
5
  Install: `npm i motionary` · CDN: https://unpkg.com/motionary@10/dist/components.umd.js (+ https://unpkg.com/motionary@10/dist/widgets.umd.js for 6.x+ widgets) · Manifest: https://harrisoncn.github.io/Motionary/components.json · Full text: https://harrisoncn.github.io/Motionary/llms-full.txt
6
6
 
@@ -22,6 +22,10 @@ Rules for using a component: (1) import its define function from `import.path` a
22
22
  - [motionary/runtime/gl](https://github.com/HarrisonCN/Motionary/blob/main/docs/runtime/gl.md): A small WebGL2 renderer with its own API: scene graph, camera, lights, box / plane / sphere / torus, PBR-style materials, shader materials, image and video textures, orbit controls — not a Three.js clone.
23
23
  - [motionary/runtime/format-gltf](https://github.com/HarrisonCN/Motionary/blob/main/docs/runtime/format-gltf.md): Load glTF 2.0 (.gltf with external or data: buffers, .glb) into motionary/runtime/gl nodes: node hierarchy, meshes, PBR metallic-roughness materials, embedded / external images.
24
24
  - [motionary/runtime/format-obj](https://github.com/HarrisonCN/Motionary/blob/main/docs/runtime/format-obj.md): Load Wavefront OBJ (+ MTL materials and diffuse textures) into motionary/runtime/gl nodes: polygons triangulated, groups, per-material meshes.
25
+ - [motionary/runtime/vector](https://github.com/HarrisonCN/Motionary/blob/main/docs/runtime/vector.md): Plays Lottie (bodymovin JSON) and dotLottie (.lottie) files on Canvas 2D with Motionary’s own renderer (no lottie-web code): shapes, gradients, trim paths, masks, track mattes, precomps, images; a runtime timeline you can seek, reverse and scrub.
26
+ - [@rive-app/canvas](https://github.com/HarrisonCN/Motionary/blob/main/docs/runtime/rive.md): The official MIT-licensed Rive runtime, used by <usa-rive> to play .riv files (artboards, animations, state machines with inputs). Optional peer dependency: lazy-loaded on first use, never bundled into Motionary.
27
+ - [motionary/runtime/physics](https://github.com/HarrisonCN/Motionary/blob/main/docs/runtime/physics.md): A small 2D rigid-body engine written for Motionary (own implementation and API — no Matter.js / Box2D code): circles, boxes and convex polygons, mass from density, restitution, friction, sensors, collision groups, sleeping, distance / spring / pin constraints, pointer drag, a fixed time step on the shared ticker.
28
+ - [motionary/runtime/format-scene](https://github.com/HarrisonCN/Motionary/blob/main/docs/runtime/format-scene.md): The versioned motionary-scene@1 format: a JSON description of a 2D physics scene (world, named materials, bodies, constraints, per-body style) — validate, migrate older drafts, load into a physics world and save one back.
25
29
 
26
30
  ## Components
27
31
 
@@ -111,6 +115,7 @@ Rules for using a component: (1) import its define function from `import.path` a
111
115
  - `<usa-location-card>` (motionary/components/widgets): 7.6: a place card with a stylised mini map — the route from the origin draws itself, the pin drops in with a bounce and a ring pulses; distance computed with ha
112
116
  - `<usa-lottie>` (motionary/components/widgets): 9.2: plays Lottie (After Effects / bodymovin) files without lottie-web — vector layers render as SVG and their keyframes run as native animations on Motionary’s
113
117
  - `<usa-lottie-icon>` (motionary/components/widgets): 9.2: an animated icon set shipped as tiny Lottie files — heart beat, bell swing, check draw-in, spinner, star twinkle, bolt zap — on click, hover, enter or loop
118
+ - `<usa-lottie-player>` (motionary/components/widgets; requires motionary/runtime/vector): 10.6: plays Lottie JSON and dotLottie (.lottie) files with Motionary’s own Canvas 2D renderer — shapes, gradients, trim paths, masks, track mattes, precomps and
114
119
  - `<usa-lyrics>` (motionary/components/widgets): 7.1: LRC or [data-t] lines; the active line glows, scrolls to the centre and a highlight sweeps across it while past lines dim. Follows an <audio>, <video> or <
115
120
  - `<usa-magnetic>` (motionary/components/interaction): Content leans toward the pointer when it comes near and springs back. Fine pointers only; off under reduced motion.
116
121
  - `<usa-marquee>` (motionary/components/background): A seamless infinite ticker with constant speed, pause on hover, soft edges and vertical mode. Clones are hidden from AT.
@@ -126,6 +131,7 @@ Rules for using a component: (1) import its define function from `import.path` a
126
131
  - `<usa-motion>` (motionary/components/widgets): 9.0: the declarative motion DSL — describe motion as one readable string (“enter: fade-up 600ms stagger 80ms; hover: pop”) on <usa-motion> or any element’s data
127
132
  - `<usa-motion-inspector>` (motionary/components/widgets): 10.2: a live panel listing the running animations in a scope (CSS animations, transitions, element.animate(), components) with state and progress, plus the moti
128
133
  - `<usa-motion-prefs>` (motionary/components/widgets): 9.5: a motion settings panel for your users — motion level (full, gentle, minimal, none), animation speed, pause autoplaying video, no parallax — applied instan
134
+ - `<usa-motion-prompt>` (motionary/components/widgets): 10.7 (AI-assisted motion): describe a motion in English or Chinese and get a live preview plus ready code — Web Animations, CSS (with a reduced-motion guard) or
129
135
  - `<usa-motion-spec>` (motionary/components/widgets): 9.7: a motion spec sheet for design hand-off — each rule of a motion string with its trigger, a duration bar on a shared timeline and the easing curve, a Play p
130
136
  - `<usa-motion-switch>` (motionary/components/page): Let users pick Off · Low · Normal · High for the whole app; scales every component, persists, and Off equals reduced motion.
131
137
  - `<usa-motion-theme>` (motionary/components/effects): 5.8: <usa-motion-theme name> applies a theme pack — design tokens (--usa-theme-*), motion tokens and effect presets per role (enter / hover / click / attention
@@ -145,6 +151,7 @@ Rules for using a component: (1) import its define function from `import.path` a
145
151
  - `<usa-particles>` (motionary/components/background): A canvas constellation that drifts away from the pointer. Runs only while visible, DPR ≤ 2, a still frame under reduced motion.
146
152
  - `<usa-pause-all>` (motionary/components/widgets): 9.5: one button that pauses all motion on the page (WCAG 2.2.2) — Motionary’s shared clock, every CSS / Web animation and autoplaying media — and resumes it aga
147
153
  - `<usa-perf-monitor>` (motionary/components/widgets): 9.6: a live performance overlay for motion work — FPS with a sparkline, active Motionary animations, frame-loop callbacks, long tasks and the shared clock — fla
154
+ - `<usa-physics-playground>` (motionary/components/widgets; requires motionary/runtime/physics + motionary/runtime/format-scene): 10.7: a 2D rigid-body sandbox on Motionary’s own physics engine — circles, boxes and polygons, friction, restitution, constraints, sleeping — loaded from a vers
148
155
  - `<usa-pinch-zoom>` (motionary/components/gesture): Pinch with two fingers or Ctrl + wheel / trackpad pinch, pan while zoomed, double-tap to toggle; scale and position spring back inside the bounds.
149
156
  - `<usa-player>` (motionary/components/effects): 5.9: <usa-player> plays a JSON animation — timeline presets, your own keyframes and any registered effect on a shared clock; play / pause / seek / rate / loop,
150
157
  - `<usa-plugin-card>` (motionary/components/widgets; requires motionary/runtime): 10.1: a plugin’s name, version and author with a Motionary compatibility badge (semver `engine` range), a signature badge (SHA-256 integrity checked with Web Cr
@@ -166,6 +173,7 @@ Rules for using a component: (1) import its define function from `import.path` a
166
173
  - `<usa-retro-button>` (motionary/components/widgets): 8.2: buttons in four eras with matching press motion — 8-bit pixel (stepped press), CRT phosphor (flicker), Y2K chrome pill (bounce) and Windows 95 bevel (sink)
167
174
  - `<usa-reveal>` (motionary/components/reveal): Fade, slide, zoom, blur or flip content in as it enters the viewport. 12 effects, replay on re-entry with repeat.
168
175
  - `<usa-ripple>` (motionary/components/interaction): Ink ripple from the pointer — or from the centre for Space/Enter — on any button, list item or card.
176
+ - `<usa-rive>` (motionary/components/widgets; requires @rive-app/canvas): 10.6: plays Rive (.riv) files — artboards, animations and state machines with inputs — through the official Rive runtime @rive-app/canvas, an optional peer depe
169
177
  - `<usa-route-transition>` (motionary/components/widgets): 10.3: View Transitions 2.0 — link clicks swap the container’s content with the target page (fetched) or an inline <template data-route>, animated with the View
170
178
  - `<usa-scene>` (motionary/components/widgets): 9.1: a scroll-scrubbed cinematic shot — while the scene crosses the screen its image follows a camera move (dolly, pan, tilt, zoom, orbit) and captions fade in
171
179
  - `<usa-scramble>` (motionary/components/text): Decodes text out of random glyphs, left to right. Trigger on view, hover/focus or manually.
@@ -216,6 +224,7 @@ Rules for using a component: (1) import its define function from `import.path` a
216
224
  - `<usa-tip>` (motionary/components/widgets): 6.6: springs out of its trigger with an arrow, flips to stay inside the viewport and shifts along the edge; hover + keyboard focus (Esc closes) or click popover
217
225
  - `<usa-toast-stack>` (motionary/components/widgets): 6.3: toasts pile up into a collapsed stack (newest in front, older ones peeking behind), fan out on hover or focus, auto-dismiss (paused while hovered) and swip
218
226
  - `<usa-toaster>` (motionary/components/feedback): toast("Saved") slides a notification in; it pauses on hover, stacks with FLIP and announces politely (errors assertively).
227
+ - `<usa-token-editor>` (motionary/components/widgets): 10.6 (motion design tokens 2.0): edit duration and cubic-bézier easing tokens with a live preview per token, then export W3C Design Tokens (DTCG 2025.10 or the
219
228
  - `<usa-typewriter>` (motionary/components/text): Types text, or cycles through phrases with delete and pause. Full text stays available to screen readers.
220
229
  - `<usa-upload-progress>` (motionary/components/widgets): 7.7: a file row whose bar eases to value with a running shine; at 100 it turns into a check that draws itself, on error it shakes and offers Retry.
221
230
  - `<usa-video-card>` (motionary/components/widgets): 9.4: a video thumbnail card — hover or focus plays a muted preview with a progress line, a play badge and a duration chip; without a video the poster drifts (Ke