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
package/docs/ROADMAP.md CHANGED
@@ -65,11 +65,11 @@ Store 卡片显示 **「Requires: motionary/runtime/<module>」** 徽章(官
65
65
  - 主线 B:**gl 模块** —— 迷你 WebGL2 场景(网格 / 基础几何体、相机、灯光、着色器材质;不是 Three.js 克隆)。
66
66
  - 格式:OBJ / MTL、glTF 2.0 / GLB 基础、视频纹理。
67
67
  - 新组件:粒子画布、着色器背景、`<usa-gl-scene>`(保留别名 `<usa-three-scene>`)。
68
- - **v10.6** — 动效设计令牌 2.0:W3C Design Tokens 格式导入导出。
68
+ - ✅ **v10.6** — 动效设计令牌 2.0:W3C Design Tokens 格式导入导出。
69
69
  - 主线 B:**vector 模块** —— 矢量动画播放器,支持文档列出的 Lottie JSON 子集(形状、变换、修剪路径、基础遮罩、预合成、渐变;文档列出不支持的特性)+ dotLottie。
70
70
  - 官方运行时:`<usa-rive>`(Requires: @rive-app/canvas,可选 peer,懒加载)。
71
71
  - 新组件:令牌编辑器、`<usa-lottie-player>`、`<usa-rive>`。
72
- - **v10.7** — AI 辅助动效:自然语言 → 动效描述、动效建议。
72
+ - ✅ **v10.7** — AI 辅助动效:自然语言 → 动效描述、动效建议。
73
73
  - 主线 A:MCP 2.0 —— `suggest_motion`、`validate_snippet`;AI 使用评测集(运行 AI 写的片段检验能否直接工作)。
74
74
  - 主线 B:**physics 模块** —— 2D 刚体(圆 / 盒 / 多边形)、约束;场景 JSON `motionary-scene@1`。
75
75
  - 新组件:动效提示输入框、`<usa-physics-playground>`。
@@ -1,4 +1,4 @@
1
- # Motionary components (202)
1
+ # Motionary components (207)
2
2
 
3
3
  One page per `<usa-*>` element, generated from the source. Machine-readable: `motionary/manifest.json` · Pages `/components.json` · `/llms.txt` · `/llms-full.txt`. How to use these with an AI assistant: [AGENTS.md](../../AGENTS.md) and [the prompt guide](../ai-prompt-guide.md).
4
4
 
@@ -65,11 +65,13 @@ One page per `<usa-*>` element, generated from the source. Machine-readable: `mo
65
65
  - [`<usa-location-card>`](usa-location-card.md) — Location card
66
66
  - [`<usa-lottie>`](usa-lottie.md) — Lottie player
67
67
  - [`<usa-lottie-icon>`](usa-lottie-icon.md) — Animated icon set
68
+ - [`<usa-lottie-player>`](usa-lottie-player.md) — Lottie player (JSON + dotLottie) · Requires: motionary/runtime/vector
68
69
  - [`<usa-menu>`](usa-menu.md) — Dropdown menu
69
70
  - [`<usa-message-list>`](usa-message-list.md) — Chat thread
70
71
  - [`<usa-motion>`](usa-motion.md) — Motion DSL
71
72
  - [`<usa-motion-inspector>`](usa-motion-inspector.md) — Motion inspector
72
73
  - [`<usa-motion-prefs>`](usa-motion-prefs.md) — Motion preference panel
74
+ - [`<usa-motion-prompt>`](usa-motion-prompt.md) — Motion prompt (text → motion)
73
75
  - [`<usa-motion-spec>`](usa-motion-spec.md) — Motion spec sheet
74
76
  - [`<usa-music-player>`](usa-music-player.md) — Music player
75
77
  - [`<usa-native-preview>`](usa-native-preview.md) — Native preview
@@ -82,6 +84,7 @@ One page per `<usa-*>` element, generated from the source. Machine-readable: `mo
82
84
  - [`<usa-panorama>`](usa-panorama.md) — 360° panorama viewer
83
85
  - [`<usa-pause-all>`](usa-pause-all.md) — Pause all motion
84
86
  - [`<usa-perf-monitor>`](usa-perf-monitor.md) — Perf monitor
87
+ - [`<usa-physics-playground>`](usa-physics-playground.md) — Physics playground · Requires: motionary/runtime/physics + motionary/runtime/format-scene
85
88
  - [`<usa-plugin-card>`](usa-plugin-card.md) — Plugin detail card · Requires: motionary/runtime
86
89
  - [`<usa-plugin-store>`](usa-plugin-store.md) — Plugin marketplace
87
90
  - [`<usa-popover>`](usa-popover.md) — Popover
@@ -94,6 +97,7 @@ One page per `<usa-*>` element, generated from the source. Machine-readable: `mo
94
97
  - [`<usa-reactions>`](usa-reactions.md) — Emoji reactions
95
98
  - [`<usa-red-envelope>`](usa-red-envelope.md) — Red envelope (红包)
96
99
  - [`<usa-retro-button>`](usa-retro-button.md) — Retro buttons
100
+ - [`<usa-rive>`](usa-rive.md) — Rive player (official runtime) · Requires: @rive-app/canvas
97
101
  - [`<usa-scene>`](usa-scene.md) — Cinematic scene
98
102
  - [`<usa-segmented>`](usa-segmented.md) — Segmented control
99
103
  - [`<usa-shader-backdrop>`](usa-shader-backdrop.md) — Shader backdrop + post chain
@@ -112,6 +116,7 @@ One page per `<usa-*>` element, generated from the source. Machine-readable: `mo
112
116
  - [`<usa-theme-surface>`](usa-theme-surface.md) — Theme surface
113
117
  - [`<usa-theme-switcher>`](usa-theme-switcher.md) — Theme switcher
114
118
  - [`<usa-tip>`](usa-tip.md) — Tooltip / popover 2.0
119
+ - [`<usa-token-editor>`](usa-token-editor.md) — Motion token editor (W3C DTCG)
115
120
  - [`<usa-upload-progress>`](usa-upload-progress.md) — Upload progress
116
121
  - [`<usa-video-card>`](usa-video-card.md) — Video card
117
122
  - [`<usa-voice-button>`](usa-voice-button.md) — Voice button
@@ -0,0 +1,60 @@
1
+ # `<usa-lottie-player>` — Lottie player (JSON + dotLottie)
2
+
3
+ > Generated from the source and the gallery catalog by `scripts/gen-component-docs.mjs` (same data as [components.json](https://harrisoncn.github.io/Motionary/components.json) and [llms-full.txt](https://harrisoncn.github.io/Motionary/llms-full.txt)).
4
+
5
+ 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.
6
+
7
+ - **Category:** ui · **since** 10.6
8
+ - **Import:** `import { defineLottiePlayer } from 'motionary/components/widgets'` then `defineLottiePlayer();`
9
+ - **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
10
+ - **Attributes:** `src`, `animation`, `autoplay`, `loop`, `speed`, `mode`, `segment`, `hover`, `scrub`, `fit`, `background`, `label`
11
+ - **Events:** `usa:complete`, `usa:load`, `usa:error`, `usa:runtime-missing`
12
+ - **Slots:** —
13
+ - **Methods:** `play()`, `pause()`, `stop()`, `seek()`
14
+ - **Source:** [src/components/widgets/lottie-player.ts](../../src/components/widgets/lottie-player.ts)
15
+
16
+ ## Prerequisites — Requires: motionary/runtime/vector
17
+
18
+ 1. **Install:** `npm i motionary`
19
+ 2. **Import order & registration:** 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).
20
+
21
+ ```js
22
+ import { use } from 'motionary/runtime';
23
+ import { vector } from 'motionary/runtime/vector';
24
+ import { defineLottiePlayer } from 'motionary/components/widgets';
25
+
26
+ use(vector);
27
+ defineLottiePlayer(); // registers <usa-lottie-player> — after the prerequisites
28
+ ```
29
+
30
+ 3. **CDN:**
31
+
32
+ ```html
33
+ <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js"></script>
34
+ <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/vector.iife.js"></script>
35
+ <!-- then the component bundles -->
36
+ <script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>
37
+ <script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>
38
+ ```
39
+
40
+ ## Minimal example
41
+
42
+ ```html
43
+ <usa-lottie-player src="/anim/hero.lottie" autoplay loop label="Hero animation"></usa-lottie-player>
44
+ ```
45
+
46
+ ## ES module
47
+
48
+ ```js
49
+ import { use } from 'motionary/runtime';
50
+ import { vector } from 'motionary/runtime/vector';
51
+
52
+ use(vector);
53
+ import { defineLottiePlayer } from 'motionary/components/widgets';
54
+
55
+ defineLottiePlayer(); // registers <usa-lottie-player>
56
+
57
+ /* then use it in your HTML:
58
+ <usa-lottie-player src="/anim/hero.lottie" autoplay loop label="Hero animation"></usa-lottie-player>
59
+ */
60
+ ```
@@ -0,0 +1,32 @@
1
+ # `<usa-motion-prompt>` — Motion prompt (text → motion)
2
+
3
+ > Generated from the source and the gallery catalog by `scripts/gen-component-docs.mjs` (same data as [components.json](https://harrisoncn.github.io/Motionary/components.json) and [llms-full.txt](https://harrisoncn.github.io/Motionary/llms-full.txt)).
4
+
5
+ 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.
6
+
7
+ - **Category:** ui · **since** 10.7
8
+ - **Import:** `import { defineMotionPrompt } from 'motionary/components/widgets'` then `defineMotionPrompt();`
9
+ - **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
10
+ - **Attributes:** `value`, `format`, `placeholder`, `label`
11
+ - **Events:** `usa:suggest`, `usa:copy`
12
+ - **Slots:** —
13
+ - **Methods:** `suggest()`
14
+ - **Source:** [src/components/widgets/motion-prompt.ts](../../src/components/widgets/motion-prompt.ts)
15
+
16
+ ## Minimal example
17
+
18
+ ```html
19
+ <usa-motion-prompt value="fade the cards up slowly, one after another"></usa-motion-prompt>
20
+ ```
21
+
22
+ ## ES module
23
+
24
+ ```js
25
+ import { defineMotionPrompt } from 'motionary/components/widgets';
26
+
27
+ defineMotionPrompt(); // registers <usa-motion-prompt>
28
+
29
+ /* then use it in your HTML:
30
+ <usa-motion-prompt value="fade the cards up slowly, one after another"></usa-motion-prompt>
31
+ */
32
+ ```
@@ -0,0 +1,63 @@
1
+ # `<usa-physics-playground>` — Physics playground
2
+
3
+ > Generated from the source and the gallery catalog by `scripts/gen-component-docs.mjs` (same data as [components.json](https://harrisoncn.github.io/Motionary/components.json) and [llms-full.txt](https://harrisoncn.github.io/Motionary/llms-full.txt)).
4
+
5
+ 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.
6
+
7
+ - **Category:** ui · **since** 10.7
8
+ - **Import:** `import { definePhysicsPlayground } from 'motionary/components/widgets'` then `definePhysicsPlayground();`
9
+ - **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
10
+ - **Attributes:** `preset`, `src`, `gravity`, `spawn`, `label`
11
+ - **Events:** `usa:collision`, `usa:load`, `usa:error`, `usa:runtime-missing`
12
+ - **Slots:** —
13
+ - **Methods:** `reset()`, `play()`, `pause()`, `toScene()`
14
+ - **Source:** [src/components/widgets/physics-playground.ts](../../src/components/widgets/physics-playground.ts)
15
+
16
+ ## Prerequisites — Requires: motionary/runtime/physics + motionary/runtime/format-scene
17
+
18
+ 1. **Install:** `npm i motionary`
19
+ 2. **Import order & registration:** 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).
20
+
21
+ ```js
22
+ import { use } from 'motionary/runtime';
23
+ import { physics } from 'motionary/runtime/physics';
24
+ import { formatScene } from 'motionary/runtime/format-scene';
25
+ import { definePhysicsPlayground } from 'motionary/components/widgets';
26
+
27
+ use(physics, formatScene);
28
+ definePhysicsPlayground(); // registers <usa-physics-playground> — after the prerequisites
29
+ ```
30
+
31
+ 3. **CDN:**
32
+
33
+ ```html
34
+ <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js"></script>
35
+ <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/physics.iife.js"></script>
36
+ <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/format-scene.iife.js"></script>
37
+ <!-- then the component bundles -->
38
+ <script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>
39
+ <script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>
40
+ ```
41
+
42
+ ## Minimal example
43
+
44
+ ```html
45
+ <usa-physics-playground preset="pyramid" spawn label="Knock the pyramid over"></usa-physics-playground>
46
+ ```
47
+
48
+ ## ES module
49
+
50
+ ```js
51
+ import { use } from 'motionary/runtime';
52
+ import { physics } from 'motionary/runtime/physics';
53
+ import { formatScene } from 'motionary/runtime/format-scene';
54
+
55
+ use(physics, formatScene);
56
+ import { definePhysicsPlayground } from 'motionary/components/widgets';
57
+
58
+ definePhysicsPlayground(); // registers <usa-physics-playground>
59
+
60
+ /* then use it in your HTML:
61
+ <usa-physics-playground preset="pyramid" spawn label="Knock the pyramid over"></usa-physics-playground>
62
+ */
63
+ ```
@@ -0,0 +1,57 @@
1
+ # `<usa-rive>` — Rive player (official runtime)
2
+
3
+ > Generated from the source and the gallery catalog by `scripts/gen-component-docs.mjs` (same data as [components.json](https://harrisoncn.github.io/Motionary/components.json) and [llms-full.txt](https://harrisoncn.github.io/Motionary/llms-full.txt)).
4
+
5
+ 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.
6
+
7
+ - **Category:** ui · **since** 10.6
8
+ - **Import:** `import { defineRive } from 'motionary/components/widgets'` then `defineRive();`
9
+ - **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
10
+ - **Attributes:** `src`, `artboard`, `animation`, `state-machine`, `autoplay`, `fit`, `label`, `runtime-src`
11
+ - **Events:** `usa:load`, `usa:error`, `usa:runtime-missing`
12
+ - **Slots:** —
13
+ - **Methods:** `play()`, `pause()`, `input()`
14
+ - **Source:** [src/components/widgets/rive.ts](../../src/components/widgets/rive.ts)
15
+
16
+ ## Prerequisites — Requires: @rive-app/canvas
17
+
18
+ 1. **Install:** `npm i @rive-app/canvas`
19
+ 2. **Import order & registration:** 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.
20
+
21
+ ```js
22
+ import { provideRiveRuntime } from 'motionary/components/widgets';
23
+ import { defineRive } from 'motionary/components/widgets';
24
+
25
+ provideRiveRuntime(() => import('@rive-app/canvas')); // lazy: fetched when the first <usa-rive> mounts
26
+ defineRive(); // registers <usa-rive> — after the prerequisites
27
+ ```
28
+
29
+ 3. **CDN:**
30
+
31
+ ```html
32
+ <script src="https://unpkg.com/@rive-app/canvas@2.44.1/rive.js"></script>
33
+ <!-- then the component bundles -->
34
+ <script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>
35
+ <script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>
36
+ ```
37
+
38
+ ## Minimal example
39
+
40
+ ```html
41
+ <usa-rive src="/anim/icon.riv" state-machine="State Machine 1" autoplay label="Icon"></usa-rive>
42
+ ```
43
+
44
+ ## ES module
45
+
46
+ ```js
47
+ import { provideRiveRuntime } from 'motionary/components/widgets';
48
+
49
+ provideRiveRuntime(() => import('@rive-app/canvas')); // lazy: fetched when the first <usa-rive> mounts
50
+ import { defineRive } from 'motionary/components/widgets';
51
+
52
+ defineRive(); // registers <usa-rive>
53
+
54
+ /* then use it in your HTML:
55
+ <usa-rive src="/anim/icon.riv" state-machine="State Machine 1" autoplay label="Icon"></usa-rive>
56
+ */
57
+ ```
@@ -0,0 +1,32 @@
1
+ # `<usa-token-editor>` — Motion token editor (W3C DTCG)
2
+
3
+ > Generated from the source and the gallery catalog by `scripts/gen-component-docs.mjs` (same data as [components.json](https://harrisoncn.github.io/Motionary/components.json) and [llms-full.txt](https://harrisoncn.github.io/Motionary/llms-full.txt)).
4
+
5
+ 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.
6
+
7
+ - **Category:** ui · **since** 10.6
8
+ - **Import:** `import { defineTokenEditor } from 'motionary/components/widgets'` then `defineTokenEditor();`
9
+ - **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
10
+ - **Attributes:** `apply`, `format`, `groups`
11
+ - **Events:** `usa:export`, `usa:import`, `usa:change`
12
+ - **Slots:** —
13
+ - **Methods:** `exportJSON()`, `importJSON()`
14
+ - **Source:** [src/components/widgets/token-editor.ts](../../src/components/widgets/token-editor.ts)
15
+
16
+ ## Minimal example
17
+
18
+ ```html
19
+ <usa-token-editor apply format="2025.10"></usa-token-editor>
20
+ ```
21
+
22
+ ## ES module
23
+
24
+ ```js
25
+ import { defineTokenEditor } from 'motionary/components/widgets';
26
+
27
+ defineTokenEditor(); // registers <usa-token-editor>
28
+
29
+ /* then use it in your HTML:
30
+ <usa-token-editor apply format="2025.10"></usa-token-editor>
31
+ */
32
+ ```
@@ -1501,6 +1501,96 @@ defineGlScene(); // registers <usa-gl-scene> — after the prerequisites
1501
1501
  <usa-gl-scene src="/models/chair.glb" controls auto-rotate="20" label="Chair"></usa-gl-scene>
1502
1502
  ```
1503
1503
 
1504
+ ### `<usa-lottie-player>` — Requires: motionary/runtime/vector
1505
+
1506
+ - **Install:** `npm i motionary`
1507
+ - **Import order & registration:** 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).
1508
+
1509
+ ```js
1510
+ import { use } from 'motionary/runtime';
1511
+ import { vector } from 'motionary/runtime/vector';
1512
+ import { defineLottiePlayer } from 'motionary/components/widgets';
1513
+
1514
+ use(vector);
1515
+ defineLottiePlayer(); // registers <usa-lottie-player> — after the prerequisites
1516
+ ```
1517
+
1518
+ - **CDN:**
1519
+
1520
+ ```html
1521
+ <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js"></script>
1522
+ <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/vector.iife.js"></script>
1523
+ <!-- then the component bundles -->
1524
+ <script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>
1525
+ <script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>
1526
+ ```
1527
+
1528
+ - **Minimal example:**
1529
+
1530
+ ```html
1531
+ <usa-lottie-player src="/anim/hero.lottie" autoplay loop label="Hero animation"></usa-lottie-player>
1532
+ ```
1533
+
1534
+ ### `<usa-rive>` — Requires: @rive-app/canvas
1535
+
1536
+ - **Install:** `npm i @rive-app/canvas`
1537
+ - **Import order & registration:** 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.
1538
+
1539
+ ```js
1540
+ import { provideRiveRuntime } from 'motionary/components/widgets';
1541
+ import { defineRive } from 'motionary/components/widgets';
1542
+
1543
+ provideRiveRuntime(() => import('@rive-app/canvas')); // lazy: fetched when the first <usa-rive> mounts
1544
+ defineRive(); // registers <usa-rive> — after the prerequisites
1545
+ ```
1546
+
1547
+ - **CDN:**
1548
+
1549
+ ```html
1550
+ <script src="https://unpkg.com/@rive-app/canvas@2.44.1/rive.js"></script>
1551
+ <!-- then the component bundles -->
1552
+ <script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>
1553
+ <script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>
1554
+ ```
1555
+
1556
+ - **Minimal example:**
1557
+
1558
+ ```html
1559
+ <usa-rive src="/anim/icon.riv" state-machine="State Machine 1" autoplay label="Icon"></usa-rive>
1560
+ ```
1561
+
1562
+ ### `<usa-physics-playground>` — Requires: motionary/runtime/physics + motionary/runtime/format-scene
1563
+
1564
+ - **Install:** `npm i motionary`
1565
+ - **Import order & registration:** 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).
1566
+
1567
+ ```js
1568
+ import { use } from 'motionary/runtime';
1569
+ import { physics } from 'motionary/runtime/physics';
1570
+ import { formatScene } from 'motionary/runtime/format-scene';
1571
+ import { definePhysicsPlayground } from 'motionary/components/widgets';
1572
+
1573
+ use(physics, formatScene);
1574
+ definePhysicsPlayground(); // registers <usa-physics-playground> — after the prerequisites
1575
+ ```
1576
+
1577
+ - **CDN:**
1578
+
1579
+ ```html
1580
+ <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js"></script>
1581
+ <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/physics.iife.js"></script>
1582
+ <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/format-scene.iife.js"></script>
1583
+ <!-- then the component bundles -->
1584
+ <script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>
1585
+ <script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>
1586
+ ```
1587
+
1588
+ - **Minimal example:**
1589
+
1590
+ ```html
1591
+ <usa-physics-playground preset="pyramid" spawn label="Knock the pyramid over"></usa-physics-playground>
1592
+ ```
1593
+
1504
1594
  <!-- prereqs:end -->
1505
1595
 
1506
1596
  ### v10.2 Scroll scenes (`motionary/runtime/scroll`) + SVG loader + `data-motion` in core: `<usa-scroll-scene>`, `<usa-motion-inspector>` (`components/widgets`)
@@ -1568,6 +1658,32 @@ MCP: `npx -y -p motionary motionary-mcp` — see [docs/mcp.md](docs/mcp.md).
1568
1658
  | `<usa-gpu-particles>` | `count`, `mode` (swirl, galaxy, fountain), `colors`, `size`, `speed`, `trail`, `pointer`, `label` | `backend`; `usa:backend` |
1569
1659
  | `<usa-shader-backdrop>` | `preset` (aurora, plasma, waves, nebula), `post` (bloom, vignette, grain, chromatic, pixelate, scanlines), `colors`, `speed`, `intensity`, `label`; child `<script type="x-shader/x-fragment">` | `passes`; `usa:backend` |
1570
1660
 
1661
+ ### v10.6 Lottie / dotLottie (`motionary/runtime/vector`), Rive (official runtime, optional peer) and W3C motion tokens: `<usa-lottie-player>`, `<usa-rive>`, `<usa-token-editor>` (`components/widgets`)
1662
+
1663
+ ```html
1664
+ <usa-lottie-player src="/anim/hero.lottie" autoplay loop label="Hero animation"></usa-lottie-player>
1665
+ <usa-rive src="/anim/icon.riv" state-machine="State Machine 1" autoplay label="Icon"></usa-rive>
1666
+ <usa-token-editor apply format="2025.10"></usa-token-editor>
1667
+ ```
1668
+
1669
+ | Element | Attributes | Methods / events |
1670
+ |---|---|---|
1671
+ | `<usa-lottie-player>` (Requires: motionary/runtime/vector) | `src` (.json, .lottie), `animation`, `autoplay`, `loop`, `speed`, `mode` (normal, bounce), `segment`, `hover`, `scrub`, `fit` (contain, cover, fill), `background`, `label` | `play()`, `pause()`, `stop()`, `seek(frame)`, `player`, `animationData`, `unsupported`; `usa:load`, `usa:complete`, `usa:error`, `usa:runtime-missing` |
1672
+ | `<usa-rive>` (Requires: @rive-app/canvas — official runtime, optional peer) | `src`, `artboard`, `animation`, `state-machine`, `autoplay`, `fit` (contain, cover, fill, fitWidth, fitHeight, none), `runtime-src`, `label` | `rive`, `play()`, `pause()`, `input(name)`; `usa:load`, `usa:error`, `usa:runtime-missing`; `provideRiveRuntime(loader)` |
1673
+ | `<usa-token-editor>` | `apply`, `format` (2025.10, draft), `groups` (duration, easing), `label` | `tokens`, `exportJSON()`, `importJSON(json)`; `usa:change`, `usa:export`, `usa:import` |
1674
+
1675
+ ### v10.7 AI-assisted motion and physics: `<usa-physics-playground>`, `<usa-motion-prompt>` (`components/widgets`), `motionary/components/ai`, `motionary/runtime/physics` + `format-scene`
1676
+
1677
+ ```html
1678
+ <usa-physics-playground preset="pyramid" spawn label="Knock the pyramid over"></usa-physics-playground>
1679
+ <usa-motion-prompt value="fade the cards up slowly, one after another"></usa-motion-prompt>
1680
+ ```
1681
+
1682
+ | Element | Attributes | Methods / events |
1683
+ |---|---|---|
1684
+ | `<usa-physics-playground>` (Requires: motionary/runtime/physics + motionary/runtime/format-scene) | `preset` (balls, pyramid, pendulum, dominoes), `src` (scene JSON) or inline `<script type="application/json">`, `gravity`, `spawn`, `paused`, `label` | `world`, `bodies`, `scene`, `toScene()`, `reset()`, `play()`, `pause()`; `usa:load`, `usa:collision`, `usa:error`, `usa:runtime-missing` |
1685
+ | `<usa-motion-prompt>` | `value`, `format` (waapi, css, component), `placeholder`, `label` | `intent`, `suggest(text)`; `usa:suggest`, `usa:copy` |
1686
+
1571
1687
  ## Frameworks
1572
1688
 
1573
1689
  Custom elements work in every framework. Register once (e.g. in your entry file), then use the tags.
@@ -0,0 +1,59 @@
1
+ # motionary/runtime/format-scene — Scene JSON (motionary-scene@1)
2
+
3
+ > Generated from `showcase/catalog/prereqs.js` by `scripts/gen-runtime-docs.mjs` — edit the data, not this page.
4
+
5
+ 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.
6
+
7
+ Part of Motionary's own zero-dependency runtime. Size budget: **3.0 KB gzip** (enforced in CI).
8
+
9
+ ## Prerequisites
10
+
11
+ 1. **Install:** `npm i motionary`
12
+ 2. **Import path:** `motionary/runtime/format-scene`
13
+ 3. **CDN:**
14
+
15
+ ```html
16
+ <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js"></script>
17
+ <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/format-scene.iife.js"></script>
18
+ ```
19
+
20
+ ESM from a CDN: `https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/format-scene.js`
21
+
22
+ 4. **Import order & registration:** 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).
23
+
24
+ ```js
25
+ import { use } from 'motionary/runtime';
26
+ import { formatScene } from 'motionary/runtime/format-scene';
27
+ use(formatScene);
28
+ ```
29
+
30
+ ## Example
31
+
32
+ ```js
33
+ import { use } from 'motionary/runtime';
34
+ import { physics } from 'motionary/runtime/physics';
35
+ import { formatScene, sceneToWorld } from 'motionary/runtime/format-scene';
36
+ use(physics, formatScene);
37
+ const { world, bodies } = sceneToWorld(await (await fetch('/scenes/stack.json')).json());
38
+ world.run();
39
+ ```
40
+
41
+ ## Exports
42
+
43
+ `formatScene` · `SCENE_FORMAT` · `migrateScene` · `validateScene` · `parseScene` · `sceneToWorld` · `worldToScene`
44
+
45
+ ## Compatibility
46
+
47
+ | Feature | Supported | Notes |
48
+ |---|---|---|
49
+ | world: size, gravity, walls (with or without a top), solver iterations | ✅ yes | |
50
+ | named materials (restitution, friction, density), per-body overrides | ✅ yes | |
51
+ | bodies: circle / box / polygon, static / kinematic, velocity, angle, sensor, style | ✅ yes | |
52
+ | constraints: distance / spring / pin between bodies or to a world point | ✅ yes | |
53
+ | validation (lists every problem, never throws) + parseScene (throws one error) | ✅ yes | |
54
+ | migration: unversioned scenes and the motionary-scene@0 draft → @1, with a change list | ✅ yes | |
55
+ | save: worldToScene() (walls made by bounds() are left out) | ✅ yes | |
56
+
57
+ ## Components that need it
58
+
59
+ - `<usa-physics-playground>` — Physics playground
@@ -0,0 +1,61 @@
1
+ # motionary/runtime/physics — 2D rigid-body physics
2
+
3
+ > Generated from `showcase/catalog/prereqs.js` by `scripts/gen-runtime-docs.mjs` — edit the data, not this page.
4
+
5
+ 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.
6
+
7
+ Part of Motionary's own zero-dependency runtime. Size budget: **10.0 KB gzip** (enforced in CI).
8
+
9
+ ## Prerequisites
10
+
11
+ 1. **Install:** `npm i motionary`
12
+ 2. **Import path:** `motionary/runtime/physics`
13
+ 3. **CDN:**
14
+
15
+ ```html
16
+ <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js"></script>
17
+ <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/physics.iife.js"></script>
18
+ ```
19
+
20
+ ESM from a CDN: `https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/physics.js`
21
+
22
+ 4. **Import order & registration:** 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).
23
+
24
+ ```js
25
+ import { use } from 'motionary/runtime';
26
+ import { physics } from 'motionary/runtime/physics';
27
+ use(physics);
28
+ ```
29
+
30
+ ## Example
31
+
32
+ ```js
33
+ import { use } from 'motionary/runtime';
34
+ import { physics, createWorld } from 'motionary/runtime/physics';
35
+ use(physics);
36
+ const world = createWorld({ gravity: [0, 980] });
37
+ world.bounds(600, 400);
38
+ const ball = world.body({ shape: 'circle', x: 300, y: 40, radius: 20, restitution: 0.7 });
39
+ world.run(); // steps on the shared ticker
40
+ ```
41
+
42
+ ## Exports
43
+
44
+ `physics` · `createWorld` · `World` · `Body` · `Constraint` · `collide` · `dragConstraint`
45
+
46
+ ## Compatibility
47
+
48
+ | Feature | Supported | Notes |
49
+ |---|---|---|
50
+ | bodies: circle, box, convex polygon (any winding, made convex) | ✅ yes | concave shapes: split them into convex parts |
51
+ | static, dynamic and kinematic bodies; density / mass, inertia, fixed rotation | ✅ yes | |
52
+ | collisions: sort-and-sweep broad phase, SAT narrow phase, up to 2 contact points | ✅ yes | no continuous collision detection: very fast small bodies can tunnel |
53
+ | restitution, Coulomb friction, warm-started accumulated impulses | ✅ yes | |
54
+ | constraints: distance (rigid or spring with stiffness / damping), pin, pointer drag | ✅ yes | no revolute motors / joint limits |
55
+ | sensors, collision categories / masks, collision events, sleeping | ✅ yes | |
56
+ | fixed time step + accumulator (same result at any frame rate) | ✅ yes | |
57
+ | SSR / workers | ✅ yes | pure maths; world.run() needs the runtime ticker |
58
+
59
+ ## Components that need it
60
+
61
+ - `<usa-physics-playground>` — Physics playground
@@ -0,0 +1,55 @@
1
+ # @rive-app/canvas — Official Rive runtime
2
+
3
+ > Generated from `showcase/catalog/prereqs.js` by `scripts/gen-runtime-docs.mjs` — edit the data, not this page.
4
+
5
+ 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.
6
+
7
+ **Official third-party runtime** (optional peer dependency, lazy-loaded). Why not our own: .riv is Rive’s proprietary binary format with a state-machine runtime; the official runtime is the only faithful player, so Motionary does not reimplement it.
8
+
9
+ ## Prerequisites
10
+
11
+ 1. **Install:** `npm i @rive-app/canvas`
12
+ 2. **Import path:** `@rive-app/canvas`
13
+ 3. **CDN:**
14
+
15
+ ```html
16
+ <script src="https://unpkg.com/@rive-app/canvas@2.44.1/rive.js"></script>
17
+ ```
18
+
19
+ ESM from a CDN: `https://cdn.jsdelivr.net/npm/@rive-app/canvas@2.44.1/+esm`
20
+
21
+ 4. **Import order & registration:** 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.
22
+
23
+ ```js
24
+ import { provideRiveRuntime } from 'motionary/components/widgets';
25
+ provideRiveRuntime(() => import('@rive-app/canvas')); // lazy: fetched when the first <usa-rive> mounts
26
+ ```
27
+
28
+ ## Example
29
+
30
+ ```js
31
+ // npm i @rive-app/canvas
32
+ import { defineRive } from 'motionary/components/widgets';
33
+ defineRive();
34
+ // <usa-rive src="/anim/icon.riv" state-machine="State Machine 1" autoplay></usa-rive>
35
+ ```
36
+
37
+ ## Exports
38
+
39
+ `provideRiveRuntime` · `loadRiveRuntime` · `RIVE_PEER` · `RIVE_CDN`
40
+
41
+ ## Compatibility
42
+
43
+ | Feature | Supported | Notes |
44
+ |---|---|---|
45
+ | .riv files: artboards, linear animations | ✅ yes | played by the official runtime |
46
+ | state machines + inputs (boolean, number, trigger) | ✅ yes | el.input(name) |
47
+ | fit: contain, cover, fill, fitWidth, fitHeight, none | ✅ yes | |
48
+ | lazy loading, clear error when the runtime is missing | ✅ yes | usa:runtime-missing |
49
+ | reduced motion | ✅ yes | no autoplay (first frame) |
50
+ | WebGL2 renderer (@rive-app/webgl2) | ◐ partial | pass its URL as runtime-src or provideRiveRuntime(() => import('@rive-app/webgl2')) |
51
+ | SSR | ✅ yes | nothing loads until the element mounts in a browser |
52
+
53
+ ## Components that need it
54
+
55
+ - `<usa-rive>` — Rive player (official runtime)