motionary 10.7.0 → 10.8.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 (129) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +42 -3
  3. package/dist/chunks/{anim-image-CFGpUX7t.cjs → anim-image-BzTQa2k3.cjs} +2 -2
  4. package/dist/chunks/{anim-image-CFGpUX7t.cjs.map → anim-image-BzTQa2k3.cjs.map} +1 -1
  5. package/dist/chunks/{anim-image-CXDD19FH.js → anim-image-iD646Q7i.js} +2 -2
  6. package/dist/chunks/{anim-image-CXDD19FH.js.map → anim-image-iD646Q7i.js.map} +1 -1
  7. package/dist/chunks/{keyframes-DwR6GPej.js → keyframes-B4zefz0k.js} +2 -2
  8. package/dist/chunks/{keyframes-DwR6GPej.js.map → keyframes-B4zefz0k.js.map} +1 -1
  9. package/dist/chunks/{keyframes-DdwGY1gr.cjs → keyframes-BlOyB1PP.cjs} +2 -2
  10. package/dist/chunks/{keyframes-DdwGY1gr.cjs.map → keyframes-BlOyB1PP.cjs.map} +1 -1
  11. package/dist/chunks/{registry-DhKZCitb.cjs → registry-BZxDVL3h.cjs} +2 -2
  12. package/dist/chunks/{registry-DhKZCitb.cjs.map → registry-BZxDVL3h.cjs.map} +1 -1
  13. package/dist/chunks/{registry-D87dP_aR.js → registry-Bkt3-3ET.js} +3 -3
  14. package/dist/chunks/{registry-D87dP_aR.js.map → registry-Bkt3-3ET.js.map} +1 -1
  15. package/dist/chunks/runtime-link-CUiZ8lbE.cjs +38 -0
  16. package/dist/chunks/runtime-link-CUiZ8lbE.cjs.map +1 -0
  17. package/dist/chunks/runtime-link-c13gskBZ.js +36 -0
  18. package/dist/chunks/runtime-link-c13gskBZ.js.map +1 -0
  19. package/dist/chunks/{ticker-jD9_A9Rh.cjs → ticker-BfxAECfO.cjs} +2 -2
  20. package/dist/chunks/{ticker-jD9_A9Rh.cjs.map → ticker-BfxAECfO.cjs.map} +1 -1
  21. package/dist/chunks/{ticker-CJYI5Pxc.js → ticker-ZtweD3U4.js} +2 -2
  22. package/dist/chunks/{ticker-CJYI5Pxc.js.map → ticker-ZtweD3U4.js.map} +1 -1
  23. package/dist/chunks/{tween-Dk0QmNe9.cjs → tween--MD-39y0.cjs} +2 -2
  24. package/dist/chunks/{tween-Dk0QmNe9.cjs.map → tween--MD-39y0.cjs.map} +1 -1
  25. package/dist/chunks/{tween-_Lld1MsF.js → tween-DACdkLyO.js} +2 -2
  26. package/dist/chunks/{tween-_Lld1MsF.js.map → tween-DACdkLyO.js.map} +1 -1
  27. package/dist/components/snap-carousel.cjs +216 -0
  28. package/dist/components/snap-carousel.cjs.map +1 -0
  29. package/dist/components/snap-carousel.d.cts +80 -0
  30. package/dist/components/snap-carousel.d.ts +80 -0
  31. package/dist/components/snap-carousel.js +214 -0
  32. package/dist/components/snap-carousel.js.map +1 -0
  33. package/dist/components/widgets.cjs +32 -46
  34. package/dist/components/widgets.cjs.map +1 -1
  35. package/dist/components/widgets.d.cts +77 -4
  36. package/dist/components/widgets.d.ts +77 -4
  37. package/dist/components/widgets.js +22 -36
  38. package/dist/components/widgets.js.map +1 -1
  39. package/dist/llms-full.txt +94 -6
  40. package/dist/llms.txt +6 -3
  41. package/dist/manifest.json +260 -19
  42. package/dist/runtime/drag-snap.cjs +269 -0
  43. package/dist/runtime/drag-snap.cjs.map +1 -0
  44. package/dist/runtime/drag-snap.d.cts +109 -0
  45. package/dist/runtime/drag-snap.d.ts +109 -0
  46. package/dist/runtime/drag-snap.iife.js +2 -0
  47. package/dist/runtime/drag-snap.iife.js.map +1 -0
  48. package/dist/runtime/drag-snap.js +261 -0
  49. package/dist/runtime/drag-snap.js.map +1 -0
  50. package/dist/runtime/format-apng.cjs +4 -4
  51. package/dist/runtime/format-apng.js +4 -4
  52. package/dist/runtime/format-css.cjs +4 -4
  53. package/dist/runtime/format-css.js +4 -4
  54. package/dist/runtime/format-gif.cjs +4 -4
  55. package/dist/runtime/format-gif.js +4 -4
  56. package/dist/runtime/format-gltf.cjs +37 -18
  57. package/dist/runtime/format-gltf.cjs.map +1 -1
  58. package/dist/runtime/format-gltf.d.cts +18 -2
  59. package/dist/runtime/format-gltf.d.ts +18 -2
  60. package/dist/runtime/format-gltf.iife.js +1 -1
  61. package/dist/runtime/format-gltf.iife.js.map +1 -1
  62. package/dist/runtime/format-gltf.js +37 -18
  63. package/dist/runtime/format-gltf.js.map +1 -1
  64. package/dist/runtime/format-motion.cjs +4 -4
  65. package/dist/runtime/format-motion.js +4 -4
  66. package/dist/runtime/format-obj.cjs +1 -1
  67. package/dist/runtime/format-obj.d.cts +2 -0
  68. package/dist/runtime/format-obj.d.ts +2 -0
  69. package/dist/runtime/format-obj.iife.js.map +1 -1
  70. package/dist/runtime/format-obj.js +1 -1
  71. package/dist/runtime/format-scene.cjs +1 -1
  72. package/dist/runtime/format-scene.js +1 -1
  73. package/dist/runtime/format-sprite.cjs +3 -3
  74. package/dist/runtime/format-sprite.js +3 -3
  75. package/dist/runtime/format-svg.cjs +3 -3
  76. package/dist/runtime/format-svg.js +3 -3
  77. package/dist/runtime/format-webp.cjs +4 -4
  78. package/dist/runtime/format-webp.js +4 -4
  79. package/dist/runtime/gl.cjs +17 -4
  80. package/dist/runtime/gl.cjs.map +1 -1
  81. package/dist/runtime/gl.d.cts +2 -0
  82. package/dist/runtime/gl.d.ts +2 -0
  83. package/dist/runtime/gl.iife.js +1 -1
  84. package/dist/runtime/gl.iife.js.map +1 -1
  85. package/dist/runtime/gl.js +17 -4
  86. package/dist/runtime/gl.js.map +1 -1
  87. package/dist/runtime/gltf-anim.cjs +251 -0
  88. package/dist/runtime/gltf-anim.cjs.map +1 -0
  89. package/dist/runtime/gltf-anim.d.cts +216 -0
  90. package/dist/runtime/gltf-anim.d.ts +216 -0
  91. package/dist/runtime/gltf-anim.iife.js +2 -0
  92. package/dist/runtime/gltf-anim.iife.js.map +1 -0
  93. package/dist/runtime/gltf-anim.js +243 -0
  94. package/dist/runtime/gltf-anim.js.map +1 -0
  95. package/dist/runtime/physics.cjs +1 -1
  96. package/dist/runtime/physics.js +1 -1
  97. package/dist/runtime/scroll.cjs +2 -2
  98. package/dist/runtime/scroll.js +2 -2
  99. package/dist/runtime/smooth.cjs +1 -1
  100. package/dist/runtime/smooth.js +1 -1
  101. package/dist/runtime/text.cjs +1 -1
  102. package/dist/runtime/text.js +1 -1
  103. package/dist/runtime/vector.cjs +421 -11
  104. package/dist/runtime/vector.cjs.map +1 -1
  105. package/dist/runtime/vector.d.cts +20 -4
  106. package/dist/runtime/vector.d.ts +20 -4
  107. package/dist/runtime/vector.iife.js +1 -1
  108. package/dist/runtime/vector.iife.js.map +1 -1
  109. package/dist/runtime/vector.js +421 -12
  110. package/dist/runtime/vector.js.map +1 -1
  111. package/dist/runtime.cjs +3 -3
  112. package/dist/runtime.d.cts +1 -1
  113. package/dist/runtime.d.ts +1 -1
  114. package/dist/runtime.iife.js +1 -1
  115. package/dist/runtime.iife.js.map +1 -1
  116. package/dist/runtime.js +5 -5
  117. package/dist/widgets.umd.js +1 -1
  118. package/dist/widgets.umd.js.map +1 -1
  119. package/docs/ROADMAP.md +1 -1
  120. package/docs/components/README.md +3 -2
  121. package/docs/components/usa-gl-scene.md +27 -6
  122. package/docs/components/usa-lottie-player.md +18 -0
  123. package/docs/components/usa-snap-carousel.md +68 -0
  124. package/docs/components.md +51 -3
  125. package/docs/runtime/drag-snap.md +60 -0
  126. package/docs/runtime/format-gltf.md +3 -2
  127. package/docs/runtime/gltf-anim.md +62 -0
  128. package/docs/runtime/vector.md +3 -2
  129. package/package.json +31 -1
package/docs/ROADMAP.md CHANGED
@@ -73,7 +73,7 @@ Store 卡片显示 **「Requires: motionary/runtime/<module>」** 徽章(官
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>`。
76
- - **v10.8** — 跨端 3.0:小程序适配、鸿蒙 ArkTS 示例。
76
+ - ✅ **v10.8** — 跨端 3.0:小程序适配、鸿蒙 ArkTS 示例。
77
77
  - 主线 B:**drag-snap 模块** —— 拖拽吸附 / 惯性轮播。
78
78
  - 格式:glTF 蒙皮 / 变形目标 / 动画;Lottie 文本层 + 表达式子集。
79
79
  - 新组件:跨端预览器、`<usa-snap-carousel>`(`<usa-carousel>` 已被 6.2 轮播占用)。
@@ -1,4 +1,4 @@
1
- # Motionary components (207)
1
+ # Motionary components (208)
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
 
@@ -51,7 +51,7 @@ One page per `<usa-*>` element, generated from the source. Machine-readable: `mo
51
51
  - [`<usa-gauge>`](usa-gauge.md) — Spring gauge
52
52
  - [`<usa-gen-art>`](usa-gen-art.md) — Generative artwork
53
53
  - [`<usa-gesture-sticker>`](usa-gesture-sticker.md) — Multi-touch sticker
54
- - [`<usa-gl-scene>`](usa-gl-scene.md) — 3D scene (glTF / OBJ) · Requires: motionary/runtime/gl + motionary/runtime/format-gltf + motionary/runtime/format-obj
54
+ - [`<usa-gl-scene>`](usa-gl-scene.md) — 3D scene (glTF / OBJ) · Requires: motionary/runtime/gl + motionary/runtime/format-gltf + motionary/runtime/format-obj + motionary/runtime/gltf-anim
55
55
  - [`<usa-globe>`](usa-globe.md) — Spinning globe
56
56
  - [`<usa-gpu-particles>`](usa-gpu-particles.md) — GPU particle canvas
57
57
  - [`<usa-gyro-card>`](usa-gyro-card.md) — Gyro 3D card
@@ -104,6 +104,7 @@ One page per `<usa-*>` element, generated from the source. Machine-readable: `mo
104
104
  - [`<usa-shortcut>`](usa-shortcut.md) — Shortcut hint
105
105
  - [`<usa-sketch-chart>`](usa-sketch-chart.md) — Sketch chart
106
106
  - [`<usa-slider>`](usa-slider.md) — Slider
107
+ - [`<usa-snap-carousel>`](usa-snap-carousel.md) — Snap carousel (drag · inertia · snap) · Requires: motionary/runtime/drag-snap
107
108
  - [`<usa-sparkline>`](usa-sparkline.md) — Sparkline
108
109
  - [`<usa-spatial-card>`](usa-spatial-card.md) — Spatial card
109
110
  - [`<usa-stepper>`](usa-stepper.md) — Stepper / wizard
@@ -2,30 +2,31 @@
2
2
 
3
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
4
 
5
- 10.5: a WebGL2 3D viewer on Motionary’s own renderer — glTF 2.0 / GLB and OBJ / MTL models or built-in shapes, PBR-style materials, orbit controls (drag, wheel, pinch, arrow keys), auto-rotate and video textures. Requires motionary/runtime/gl (+ format-gltf for .gltf / .glb, format-obj for .obj) — npm i motionary, then use(gl, formatGltf, formatObj) before it mounts. Alias: <usa-three-scene>.
5
+ 10.5: a WebGL2 3D viewer on Motionary’s own renderer — glTF 2.0 / GLB and OBJ / MTL models or built-in shapes, PBR-style materials, orbit controls (drag, wheel, pinch, arrow keys), auto-rotate and video textures. Requires motionary/runtime/gl (+ format-gltf for .gltf / .glb, format-obj for .obj, gltf-anim for glTF animation — 10.8) — npm i motionary, then use(gl, formatGltf, formatObj, gltfAnim) before it mounts. Alias: <usa-three-scene>.
6
6
 
7
7
  - **Category:** ui · **since** 10.5
8
8
  - **Import:** `import { defineGlScene } from 'motionary/components/widgets'` then `defineGlScene();`
9
9
  - **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
10
- - **Attributes:** `src`, `shape`, `color`, `metallic`, `roughness`, `background`, `exposure`, `controls`, `auto-rotate`, `video`, `video-scrub`, `label`
10
+ - **Attributes:** `src`, `shape`, `color`, `metallic`, `roughness`, `background`, `exposure`, `controls`, `auto-rotate`, `video`, `video-scrub`, `label`, `animation`, `animation-speed`
11
11
  - **Events:** `usa:error`, `usa:load`, `usa:runtime-missing`
12
12
  - **Slots:** —
13
13
  - **Methods:** `reload()`
14
14
  - **Source:** [src/components/widgets/gl-scene.ts](../../src/components/widgets/gl-scene.ts)
15
15
 
16
- ## Prerequisites — Requires: motionary/runtime/gl + motionary/runtime/format-gltf + motionary/runtime/format-obj
16
+ ## Prerequisites — Requires: motionary/runtime/gl + motionary/runtime/format-gltf + motionary/runtime/format-obj + motionary/runtime/gltf-anim
17
17
 
18
18
  1. **Install:** `npm i motionary`
19
- 2. **Import order & registration:** Register the core first, then the module: use(gl) also registers the core. CDN: load runtime.iife.js, then runtime/gl.iife.js (it registers itself). Register the core first, then the module: use(formatGltf) also registers the core. CDN: load runtime.iife.js, then runtime/format-gltf.iife.js (it registers itself). Register the core first, then the module: use(formatObj) also registers the core. CDN: load runtime.iife.js, then runtime/format-obj.iife.js (it registers itself).
19
+ 2. **Import order & registration:** Register the core first, then the module: use(gl) also registers the core. CDN: load runtime.iife.js, then runtime/gl.iife.js (it registers itself). Register the core first, then the module: use(formatGltf) also registers the core. CDN: load runtime.iife.js, then runtime/format-gltf.iife.js (it registers itself). Register the core first, then the module: use(formatObj) also registers the core. CDN: load runtime.iife.js, then runtime/format-obj.iife.js (it registers itself). Register the core first, then the module: use(gltfAnim) also registers the core. CDN: load runtime.iife.js, then runtime/gltf-anim.iife.js (it registers itself).
20
20
 
21
21
  ```js
22
22
  import { use } from 'motionary/runtime';
23
23
  import { gl } from 'motionary/runtime/gl';
24
24
  import { formatGltf } from 'motionary/runtime/format-gltf';
25
25
  import { formatObj } from 'motionary/runtime/format-obj';
26
+ import { gltfAnim } from 'motionary/runtime/gltf-anim';
26
27
  import { defineGlScene } from 'motionary/components/widgets';
27
28
 
28
- use(gl, formatGltf, formatObj);
29
+ use(gl, formatGltf, formatObj, gltfAnim);
29
30
  defineGlScene(); // registers <usa-gl-scene> — after the prerequisites
30
31
  ```
31
32
 
@@ -36,6 +37,7 @@ defineGlScene(); // registers <usa-gl-scene> — after the prerequisites
36
37
  <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/gl.iife.js"></script>
37
38
  <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/format-gltf.iife.js"></script>
38
39
  <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/format-obj.iife.js"></script>
40
+ <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/gltf-anim.iife.js"></script>
39
41
  <!-- then the component bundles -->
40
42
  <script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>
41
43
  <script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>
@@ -54,8 +56,9 @@ import { use } from 'motionary/runtime';
54
56
  import { gl } from 'motionary/runtime/gl';
55
57
  import { formatGltf } from 'motionary/runtime/format-gltf';
56
58
  import { formatObj } from 'motionary/runtime/format-obj';
59
+ import { gltfAnim } from 'motionary/runtime/gltf-anim';
57
60
 
58
- use(gl, formatGltf, formatObj);
61
+ use(gl, formatGltf, formatObj, gltfAnim);
59
62
  import { defineGlScene } from 'motionary/components/widgets';
60
63
 
61
64
  defineGlScene(); // registers <usa-gl-scene>
@@ -64,3 +67,21 @@ defineGlScene(); // registers <usa-gl-scene>
64
67
  <usa-gl-scene src="/models/chair.glb" controls auto-rotate="20" label="Chair"></usa-gl-scene>
65
68
  */
66
69
  ```
70
+
71
+ ## Variants
72
+
73
+ ### 3D scene (glTF / OBJ)
74
+
75
+ 10.5: a WebGL2 3D viewer on Motionary’s own renderer — glTF 2.0 / GLB and OBJ / MTL models or built-in shapes, PBR-style materials, orbit controls (drag, wheel, pinch, arrow keys), auto-rotate and video textures. Requires motionary/runtime/gl (+ format-gltf for .gltf / .glb, format-obj for .obj, gltf-anim for glTF animation — 10.8) — npm i motionary, then use(gl, formatGltf, formatObj, gltfAnim) before it mounts. Alias: <usa-three-scene>.
76
+
77
+ ```html
78
+ <usa-gl-scene src="/models/chair.glb" controls auto-rotate="20" label="Chair"></usa-gl-scene>
79
+ ```
80
+
81
+ ### 3D animation (glTF skin + morph)
82
+
83
+ 10.8: <usa-gl-scene animation> plays glTF animations — skeletal skinning (4 joints per vertex), morph targets and LINEAR / STEP / CUBICSPLINE channels — on Motionary’s own WebGL2 renderer. Pick a clip by name or index, set animation-speed; reduced motion shows the first pose. Requires motionary/runtime/gl + motionary/runtime/format-gltf + motionary/runtime/gltf-anim (+ format-obj for .obj models) — npm i motionary, then use(gl, formatGltf, formatObj, gltfAnim).
84
+
85
+ ```html
86
+ <usa-gl-scene src="/models/robot.glb" animation="walk" controls label="Walking robot"></usa-gl-scene>
87
+ ```
@@ -58,3 +58,21 @@ defineLottiePlayer(); // registers <usa-lottie-player>
58
58
  <usa-lottie-player src="/anim/hero.lottie" autoplay loop label="Hero animation"></usa-lottie-player>
59
59
  */
60
60
  ```
61
+
62
+ ## Variants
63
+
64
+ ### Lottie player (JSON + dotLottie)
65
+
66
+ 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.
67
+
68
+ ```html
69
+ <usa-lottie-player src="/anim/hero.lottie" autoplay loop label="Hero animation"></usa-lottie-player>
70
+ ```
71
+
72
+ ### Lottie text + expressions
73
+
74
+ 10.8: the Lottie player now draws text layers (fonts by family and style, justification, tracking, line height, fill and stroke, wrapping box text, source-text keyframes) and runs an expression subset — time, value, wiggle, loopOut / loopIn, linear / ease, Math — with its own interpreter (no eval, CSP-safe). Requires motionary/runtime/vector — npm i motionary, then use(vector).
75
+
76
+ ```html
77
+ <usa-lottie-player src="/anim/title.json" autoplay loop label="Animated title"></usa-lottie-player>
78
+ ```
@@ -0,0 +1,68 @@
1
+ # `<usa-snap-carousel>` — Snap carousel (drag · inertia · snap)
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.8: drag or swipe with real inertia — a throw keeps gliding, then springs to the nearest slide (a quick flick always moves one); rubber-band edges, arrows, dots, ←/→ / Home / End, optional autoplay that pauses on hover, focus and off screen. Slides keep their own width so the next one peeks in. Requires motionary/runtime/drag-snap — npm i motionary, then use(dragSnap) before it mounts. Its own entry point: motionary/components/snap-carousel (not in the widgets / lite bundles).
6
+
7
+ - **Category:** ui · **since** 10.8
8
+ - **Import:** `import { defineSnapCarousel } from 'motionary/components/snap-carousel'` then `defineSnapCarousel();`
9
+ - **CDN:** `<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>`
10
+ - **Attributes:** `align`, `gap`, `autoplay`, `no-controls`, `no-dots`, `label`
11
+ - **Events:** `usa:change`, `usa:runtime-missing`
12
+ - **Slots:** —
13
+ - **Methods:** `next()`, `prev()`, `goTo()`
14
+ - **Source:** [src/components/widgets/snap-carousel.ts](../../src/components/widgets/snap-carousel.ts)
15
+
16
+ ## Prerequisites — Requires: motionary/runtime/drag-snap
17
+
18
+ 1. **Install:** `npm i motionary`
19
+ 2. **Import order & registration:** Register the core first, then the module: use(dragSnap) also registers the core. CDN: load runtime.iife.js, then runtime/drag-snap.iife.js (it registers itself).
20
+
21
+ ```js
22
+ import { use } from 'motionary/runtime';
23
+ import { dragSnap } from 'motionary/runtime/drag-snap';
24
+ import { defineSnapCarousel } from 'motionary/components/snap-carousel';
25
+
26
+ use(dragSnap);
27
+ defineSnapCarousel(); // registers <usa-snap-carousel> — 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/drag-snap.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-snap-carousel align="center" gap="16" label="Featured">
44
+ <article>…</article>
45
+ <article>…</article>
46
+ <article>…</article>
47
+ </usa-snap-carousel>
48
+ ```
49
+
50
+ ## ES module
51
+
52
+ ```js
53
+ import { use } from 'motionary/runtime';
54
+ import { dragSnap } from 'motionary/runtime/drag-snap';
55
+
56
+ use(dragSnap);
57
+ import { defineSnapCarousel } from 'motionary/components/snap-carousel';
58
+
59
+ defineSnapCarousel(); // registers <usa-snap-carousel>
60
+
61
+ /* then use it in your HTML:
62
+ <usa-snap-carousel align="center" gap="16" label="Featured">
63
+ <article>…</article>
64
+ <article>…</article>
65
+ <article>…</article>
66
+ </usa-snap-carousel>
67
+ */
68
+ ```
@@ -1467,19 +1467,20 @@ defineSmoothScroll(); // registers <usa-smooth-scroll> — after the prerequisit
1467
1467
  <usa-smooth-scroll lerp="0.1" offset="64"></usa-smooth-scroll>
1468
1468
  ```
1469
1469
 
1470
- ### `<usa-gl-scene>` — Requires: motionary/runtime/gl + motionary/runtime/format-gltf + motionary/runtime/format-obj
1470
+ ### `<usa-gl-scene>` — Requires: motionary/runtime/gl + motionary/runtime/format-gltf + motionary/runtime/format-obj + motionary/runtime/gltf-anim
1471
1471
 
1472
1472
  - **Install:** `npm i motionary`
1473
- - **Import order & registration:** Register the core first, then the module: use(gl) also registers the core. CDN: load runtime.iife.js, then runtime/gl.iife.js (it registers itself). Register the core first, then the module: use(formatGltf) also registers the core. CDN: load runtime.iife.js, then runtime/format-gltf.iife.js (it registers itself). Register the core first, then the module: use(formatObj) also registers the core. CDN: load runtime.iife.js, then runtime/format-obj.iife.js (it registers itself).
1473
+ - **Import order & registration:** Register the core first, then the module: use(gl) also registers the core. CDN: load runtime.iife.js, then runtime/gl.iife.js (it registers itself). Register the core first, then the module: use(formatGltf) also registers the core. CDN: load runtime.iife.js, then runtime/format-gltf.iife.js (it registers itself). Register the core first, then the module: use(formatObj) also registers the core. CDN: load runtime.iife.js, then runtime/format-obj.iife.js (it registers itself). Register the core first, then the module: use(gltfAnim) also registers the core. CDN: load runtime.iife.js, then runtime/gltf-anim.iife.js (it registers itself).
1474
1474
 
1475
1475
  ```js
1476
1476
  import { use } from 'motionary/runtime';
1477
1477
  import { gl } from 'motionary/runtime/gl';
1478
1478
  import { formatGltf } from 'motionary/runtime/format-gltf';
1479
1479
  import { formatObj } from 'motionary/runtime/format-obj';
1480
+ import { gltfAnim } from 'motionary/runtime/gltf-anim';
1480
1481
  import { defineGlScene } from 'motionary/components/widgets';
1481
1482
 
1482
- use(gl, formatGltf, formatObj);
1483
+ use(gl, formatGltf, formatObj, gltfAnim);
1483
1484
  defineGlScene(); // registers <usa-gl-scene> — after the prerequisites
1484
1485
  ```
1485
1486
 
@@ -1490,6 +1491,7 @@ defineGlScene(); // registers <usa-gl-scene> — after the prerequisites
1490
1491
  <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/gl.iife.js"></script>
1491
1492
  <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/format-gltf.iife.js"></script>
1492
1493
  <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/format-obj.iife.js"></script>
1494
+ <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/gltf-anim.iife.js"></script>
1493
1495
  <!-- then the component bundles -->
1494
1496
  <script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>
1495
1497
  <script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>
@@ -1591,6 +1593,40 @@ definePhysicsPlayground(); // registers <usa-physics-playground> — after the p
1591
1593
  <usa-physics-playground preset="pyramid" spawn label="Knock the pyramid over"></usa-physics-playground>
1592
1594
  ```
1593
1595
 
1596
+ ### `<usa-snap-carousel>` — Requires: motionary/runtime/drag-snap
1597
+
1598
+ - **Install:** `npm i motionary`
1599
+ - **Import order & registration:** Register the core first, then the module: use(dragSnap) also registers the core. CDN: load runtime.iife.js, then runtime/drag-snap.iife.js (it registers itself).
1600
+
1601
+ ```js
1602
+ import { use } from 'motionary/runtime';
1603
+ import { dragSnap } from 'motionary/runtime/drag-snap';
1604
+ import { defineSnapCarousel } from 'motionary/components/snap-carousel';
1605
+
1606
+ use(dragSnap);
1607
+ defineSnapCarousel(); // registers <usa-snap-carousel> — after the prerequisites
1608
+ ```
1609
+
1610
+ - **CDN:**
1611
+
1612
+ ```html
1613
+ <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js"></script>
1614
+ <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/drag-snap.iife.js"></script>
1615
+ <!-- then the component bundles -->
1616
+ <script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>
1617
+ <script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>
1618
+ ```
1619
+
1620
+ - **Minimal example:**
1621
+
1622
+ ```html
1623
+ <usa-snap-carousel align="center" gap="16" label="Featured">
1624
+ <article>…</article>
1625
+ <article>…</article>
1626
+ <article>…</article>
1627
+ </usa-snap-carousel>
1628
+ ```
1629
+
1594
1630
  <!-- prereqs:end -->
1595
1631
 
1596
1632
  ### v10.2 Scroll scenes (`motionary/runtime/scroll`) + SVG loader + `data-motion` in core: `<usa-scroll-scene>`, `<usa-motion-inspector>` (`components/widgets`)
@@ -1684,6 +1720,18 @@ MCP: `npx -y -p motionary motionary-mcp` — see [docs/mcp.md](docs/mcp.md).
1684
1720
  | `<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
1721
  | `<usa-motion-prompt>` | `value`, `format` (waapi, css, component), `placeholder`, `label` | `intent`, `suggest(text)`; `usa:suggest`, `usa:copy` |
1686
1722
 
1723
+ ### v10.8 drag-snap + `<usa-snap-carousel>`, glTF animation (`motionary/runtime/gltf-anim`), Lottie text + expressions
1724
+
1725
+ ```html
1726
+ <usa-snap-carousel align="center" label="Featured"><article>…</article><article>…</article></usa-snap-carousel>
1727
+ <usa-gl-scene src="/models/robot.glb" animation="walk" controls label="Walking robot"></usa-gl-scene>
1728
+ ```
1729
+
1730
+ | Element | Attributes | Methods / events |
1731
+ |---|---|---|
1732
+ | `<usa-snap-carousel>` (`motionary/components/snap-carousel`; Requires: motionary/runtime/drag-snap) | `align` (center, start), `gap`, `index`, `autoplay`, `no-controls`, `no-dots`, `label` | `index`, `length`, `controller`, `next()`, `prev()`, `goTo(i, animate)`; `usa:change`, `usa:runtime-missing` |
1733
+ | `<usa-gl-scene>` (10.8 additions; animation Requires: motionary/runtime/gltf-anim) | `animation` (clip name / index), `animation-speed` | `animator`; `usa:load` { animations } |
1734
+
1687
1735
  ## Frameworks
1688
1736
 
1689
1737
  Custom elements work in every framework. Register once (e.g. in your entry file), then use the tags.
@@ -0,0 +1,60 @@
1
+ # motionary/runtime/drag-snap — Drag, inertia and snap points
2
+
3
+ > Generated from `showcase/catalog/prereqs.js` by `scripts/gen-runtime-docs.mjs` — edit the data, not this page.
4
+
5
+ Pointer drag along one axis with velocity tracking, inertial throws, rubber-band edges and spring-animated snap points on the shared ticker — the engine of <usa-snap-carousel>, usable for sheets, sliders and pickers (own implementation).
6
+
7
+ Part of Motionary's own zero-dependency runtime. Size budget: **4.0 KB gzip** (enforced in CI).
8
+
9
+ ## Prerequisites
10
+
11
+ 1. **Install:** `npm i motionary`
12
+ 2. **Import path:** `motionary/runtime/drag-snap`
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/drag-snap.iife.js"></script>
18
+ ```
19
+
20
+ ESM from a CDN: `https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/drag-snap.js`
21
+
22
+ 4. **Import order & registration:** Register the core first, then the module: use(dragSnap) also registers the core. CDN: load runtime.iife.js, then runtime/drag-snap.iife.js (it registers itself).
23
+
24
+ ```js
25
+ import { use } from 'motionary/runtime';
26
+ import { dragSnap } from 'motionary/runtime/drag-snap';
27
+ use(dragSnap);
28
+ ```
29
+
30
+ ## Example
31
+
32
+ ```js
33
+ import { use } from 'motionary/runtime';
34
+ import { dragSnap, createDragSnap } from 'motionary/runtime/drag-snap';
35
+ use(dragSnap);
36
+ const track = document.querySelector('.track');
37
+ const ds = createDragSnap(track, { axis: 'x', snap: [0, -320, -640], onUpdate: (x) => (track.style.transform = `translateX(${x}px)`) });
38
+ ds.snapTo(1);
39
+ ```
40
+
41
+ ## Exports
42
+
43
+ `dragSnap` · `createDragSnap` · `projectThrow` · `nearestSnap` · `rubberband` · `springStep` · `velocityTracker`
44
+
45
+ ## Compatibility
46
+
47
+ | Feature | Supported | Notes |
48
+ |---|---|---|
49
+ | pointer, touch and pen (Pointer Events), drag threshold, pointer capture, touch-action for the other axis | ✅ yes | one axis per controller (x or y) |
50
+ | velocity from the last 100 ms, inertial throw with constant deceleration | ✅ yes | off under reduced motion |
51
+ | snap points: nearest to the projected throw, a fast flick moves at least one point | ✅ yes | |
52
+ | critically damped spring to the snap point (shared ticker) | ✅ yes | instant under reduced motion |
53
+ | bounds with rubber-band resistance | ✅ yes | |
54
+ | clicks inside are kept; the click that ends a drag is swallowed | ✅ yes | |
55
+ | free 2D dragging, scroll-linked snapping (CSS scroll-snap) | ✕ no | use two controllers / native scroll-snap |
56
+ | SSR / workers | ◐ partial | the maths (projectThrow, nearestSnap, rubberband, springStep, velocityTracker) is pure |
57
+
58
+ ## Components that need it
59
+
60
+ - `<usa-snap-carousel>` — Snap carousel (drag · inertia · snap)
@@ -53,9 +53,10 @@ const r = createRenderer(canvas); r.resize(); r.render(scene, cam);
53
53
  | POSITION / NORMAL / TEXCOORD_0, indices, all component types, normalised ints, byteStride | ✅ yes | missing normals computed (flat) |
54
54
  | primitive modes points / lines / triangles / strips / fans | ✅ yes | strips and fans converted to triangles |
55
55
  | PBR metallic-roughness factors, base colour texture, emissive, alpha blend, double-sided | ✅ yes | KHR_materials_emissive_strength, KHR_materials_unlit |
56
- | skins, morph targets, animations | ✕ no | arrive in 10.8 |
56
+ | skins, morph targets, animations | ✅ yes | data kept on the nodes / geometry; played by motionary/runtime/gltf-anim (10.8) |
57
+ | sparse accessors | ✅ yes | 10.8 |
57
58
  | Draco / meshopt / KTX2 (Basis) compression | ✕ no | files that require them fail with a clear error; decoder hooks planned for 10.9 |
58
- | sparse accessors, cameras, KHR_lights_punctual, texture transforms | ✕ no | ignored |
59
+ | cameras, KHR_lights_punctual, texture transforms | ✕ no | ignored |
59
60
  | SSR / workers | ◐ partial | parseGlb / gltfToNode are pure; loadGltf decodes images with createImageBitmap |
60
61
 
61
62
  ## Components that need it
@@ -0,0 +1,62 @@
1
+ # motionary/runtime/gltf-anim — glTF animation, skinning and morph targets
2
+
3
+ > Generated from `showcase/catalog/prereqs.js` by `scripts/gen-runtime-docs.mjs` — edit the data, not this page.
4
+
5
+ Plays glTF 2.0 animations on models loaded by motionary/runtime/format-gltf: translation / rotation / scale / weights channels with LINEAR, STEP and CUBICSPLINE samplers, skins (4 joints per vertex) and morph targets, deformed on the CPU and re-uploaded to motionary/runtime/gl (own implementation).
6
+
7
+ Part of Motionary's own zero-dependency runtime. Size budget: **4.5 KB gzip** (enforced in CI).
8
+
9
+ ## Prerequisites
10
+
11
+ 1. **Install:** `npm i motionary`
12
+ 2. **Import path:** `motionary/runtime/gltf-anim`
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/gltf-anim.iife.js"></script>
18
+ ```
19
+
20
+ ESM from a CDN: `https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/gltf-anim.js`
21
+
22
+ 4. **Import order & registration:** Register the core first, then the module: use(gltfAnim) also registers the core. CDN: load runtime.iife.js, then runtime/gltf-anim.iife.js (it registers itself).
23
+
24
+ ```js
25
+ import { use } from 'motionary/runtime';
26
+ import { gltfAnim } from 'motionary/runtime/gltf-anim';
27
+ use(gltfAnim);
28
+ ```
29
+
30
+ ## Example
31
+
32
+ ```js
33
+ import { use } from 'motionary/runtime';
34
+ import { gl } from 'motionary/runtime/gl';
35
+ import { formatGltf, loadGltf } from 'motionary/runtime/format-gltf';
36
+ import { gltfAnim, gltfAnimator } from 'motionary/runtime/gltf-anim';
37
+ use(gl, formatGltf, gltfAnim);
38
+ const model = await loadGltf('/models/robot.glb');
39
+ const anim = gltfAnimator(model, { clip: 'walk' });
40
+ anim.play(); // or anim.update(dt) in your own loop
41
+ ```
42
+
43
+ ## Exports
44
+
45
+ `gltfAnim` · `gltfAnimator` · `gltfClips` · `sampleChannel` · `applyClip` · `deformModel` · `deformGeometry`
46
+
47
+ ## Compatibility
48
+
49
+ | Feature | Supported | Notes |
50
+ |---|---|---|
51
+ | animation channels: translation, rotation, scale, weights | ✅ yes | KHR_animation_pointer is ignored |
52
+ | samplers: LINEAR (quaternions slerped), STEP, CUBICSPLINE (Hermite, in / out tangents) | ✅ yes | |
53
+ | skins: joint hierarchy, inverse bind matrices, JOINTS_0 / WEIGHTS_0 (4 influences) | ✅ yes | CPU skinning; JOINTS_1 / WEIGHTS_1 (8 influences) not used |
54
+ | morph targets: POSITION + NORMAL deltas, mesh / node default weights, animated weights | ✅ yes | TANGENT / TEXCOORD / COLOR targets ignored |
55
+ | sparse accessors (common for morph targets) | ✅ yes | read by format-gltf |
56
+ | clip player: by name or index, loop, speed, seek, update(dt) or the shared ticker | ✅ yes | one clip at a time (no blending) |
57
+ | GPU skinning, animation blending / cross-fades, a mesh shared by several skinned nodes | ✕ no | planned work beyond 11.0 |
58
+ | SSR / workers | ✅ yes | sampling and deformation are pure; play() needs the runtime ticker |
59
+
60
+ ## Components that need it
61
+
62
+ - `<usa-gl-scene>` — 3D scene (glTF / OBJ)
@@ -40,7 +40,7 @@ player.play();
40
40
 
41
41
  ## Exports
42
42
 
43
- `vector` · `loadLottie` · `parseDotLottie` · `unzipEntries` · `lottiePlayer` · `renderLottieFrame` · `inspectLottie` · `propValue` · `transformAt` · `trimContours` · `loadLottieImages`
43
+ `vector` · `evalExpression` · `loadLottie` · `parseDotLottie` · `unzipEntries` · `lottiePlayer` · `renderLottieFrame` · `inspectLottie` · `propValue` · `transformAt` · `trimContours` · `loadLottieImages`
44
44
 
45
45
  ## Compatibility
46
46
 
@@ -57,7 +57,8 @@ player.play();
57
57
  | keyframes: per-dimension bezier easing, hold keyframes, v4 + v5 files | ✅ yes | |
58
58
  | dotLottie (.lottie): stored + deflate entries, manifest v1 / v2, several animations, embedded images | ✅ yes | deflate needs the native DecompressionStream |
59
59
  | markers → named segments | ✅ yes | |
60
- | text layers, expressions | ✕ no | planned for 10.8 (subset) |
60
+ | text layers: fonts by family + style, justification, tracking, line height, fill / stroke, box text (wrapping), source-text keyframes | ✅ yes | 10.8; system / page fonts (glyph outlines in chars are not used); text animators not supported |
61
+ | expressions: time, value, wiggle, loopOut / loopIn (cycle, pingpong, offset, continue), linear / ease, valueAtTime, Math, arithmetic, var / $bm_rt | ✅ yes | 10.8 subset, own interpreter (no eval; CSP-safe); other expressions keep the keyframed value and are listed by inspectLottie() |
61
62
  | 3D layers, layer effects, merge paths, repeaters | ✕ no | listed by inspectLottie() / el.unsupported |
62
63
  | dotLottie themes / state machines | ✕ no | planned for 10.9 (subset) |
63
64
  | SSR / workers | ◐ partial | parsing + unzip are pure; rendering needs a 2D canvas (OffscreenCanvas works) |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "motionary",
3
- "version": "10.7.0",
3
+ "version": "10.8.0",
4
4
  "description": "Motionary (formerly use-scroll-animate): dependency-free scroll animations + 94 animated Web Components — 214 scroll-reveal presets, card/click/button morphs, physics, page transitions, generative & sound-reactive backgrounds, cursor/gesture effects, themes, micro-interactions, <usa-player>, WebGL. React, Vue, Svelte, Solid, Angular or plain HTML.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -1208,6 +1208,16 @@
1208
1208
  "default": "./dist/components/ai.cjs"
1209
1209
  }
1210
1210
  },
1211
+ "./components/snap-carousel": {
1212
+ "import": {
1213
+ "types": "./dist/components/snap-carousel.d.ts",
1214
+ "default": "./dist/components/snap-carousel.js"
1215
+ },
1216
+ "require": {
1217
+ "types": "./dist/components/snap-carousel.d.cts",
1218
+ "default": "./dist/components/snap-carousel.cjs"
1219
+ }
1220
+ },
1211
1221
  "./components/lite": {
1212
1222
  "import": {
1213
1223
  "types": "./dist/components/lite.d.ts",
@@ -1388,6 +1398,26 @@
1388
1398
  "default": "./dist/runtime/format-scene.cjs"
1389
1399
  }
1390
1400
  },
1401
+ "./runtime/drag-snap": {
1402
+ "import": {
1403
+ "types": "./dist/runtime/drag-snap.d.ts",
1404
+ "default": "./dist/runtime/drag-snap.js"
1405
+ },
1406
+ "require": {
1407
+ "types": "./dist/runtime/drag-snap.d.cts",
1408
+ "default": "./dist/runtime/drag-snap.cjs"
1409
+ }
1410
+ },
1411
+ "./runtime/gltf-anim": {
1412
+ "import": {
1413
+ "types": "./dist/runtime/gltf-anim.d.ts",
1414
+ "default": "./dist/runtime/gltf-anim.js"
1415
+ },
1416
+ "require": {
1417
+ "types": "./dist/runtime/gltf-anim.d.cts",
1418
+ "default": "./dist/runtime/gltf-anim.cjs"
1419
+ }
1420
+ },
1391
1421
  "./manifest.json": "./dist/manifest.json",
1392
1422
  "./manifest.schema.json": "./dist/manifest.schema.json",
1393
1423
  "./components.css": "./dist/components.css",