motionary 10.0.0 → 10.1.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 (63) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +45 -0
  3. package/bin/create-motionary-plugin.mjs +124 -0
  4. package/dist/chunks/keyframes-CyH_abhI.js +183 -0
  5. package/dist/chunks/keyframes-CyH_abhI.js.map +1 -0
  6. package/dist/chunks/keyframes-cUdsXSXQ.cjs +187 -0
  7. package/dist/chunks/keyframes-cUdsXSXQ.cjs.map +1 -0
  8. package/dist/chunks/registry-C0xLNq3-.cjs +81 -0
  9. package/dist/chunks/registry-C0xLNq3-.cjs.map +1 -0
  10. package/dist/chunks/registry-jF8VIA_9.js +69 -0
  11. package/dist/chunks/registry-jF8VIA_9.js.map +1 -0
  12. package/dist/chunks/tween-DDObu9iA.js +542 -0
  13. package/dist/chunks/tween-DDObu9iA.js.map +1 -0
  14. package/dist/chunks/tween-JEthWrjo.cjs +554 -0
  15. package/dist/chunks/tween-JEthWrjo.cjs.map +1 -0
  16. package/dist/components/marketplace.cjs +104 -0
  17. package/dist/components/marketplace.cjs.map +1 -1
  18. package/dist/components/marketplace.d.cts +33 -2
  19. package/dist/components/marketplace.d.ts +33 -2
  20. package/dist/components/marketplace.js +101 -1
  21. package/dist/components/marketplace.js.map +1 -1
  22. package/dist/components/widgets.cjs +420 -199
  23. package/dist/components/widgets.cjs.map +1 -1
  24. package/dist/components/widgets.d.cts +42 -2
  25. package/dist/components/widgets.d.ts +42 -2
  26. package/dist/components/widgets.js +420 -201
  27. package/dist/components/widgets.js.map +1 -1
  28. package/dist/llms-full.txt +3018 -0
  29. package/dist/llms.txt +207 -0
  30. package/dist/manifest.json +7562 -0
  31. package/dist/manifest.schema.json +85 -0
  32. package/dist/runtime/format-css.cjs +184 -0
  33. package/dist/runtime/format-css.cjs.map +1 -0
  34. package/dist/runtime/format-css.d.cts +174 -0
  35. package/dist/runtime/format-css.d.ts +174 -0
  36. package/dist/runtime/format-css.iife.js +2 -0
  37. package/dist/runtime/format-css.iife.js.map +1 -0
  38. package/dist/runtime/format-css.js +176 -0
  39. package/dist/runtime/format-css.js.map +1 -0
  40. package/dist/runtime/format-motion.cjs +138 -0
  41. package/dist/runtime/format-motion.cjs.map +1 -0
  42. package/dist/runtime/format-motion.d.cts +208 -0
  43. package/dist/runtime/format-motion.d.ts +208 -0
  44. package/dist/runtime/format-motion.iife.js +2 -0
  45. package/dist/runtime/format-motion.iife.js.map +1 -0
  46. package/dist/runtime/format-motion.js +132 -0
  47. package/dist/runtime/format-motion.js.map +1 -0
  48. package/dist/runtime.cjs +78 -0
  49. package/dist/runtime.cjs.map +1 -0
  50. package/dist/runtime.d.cts +236 -0
  51. package/dist/runtime.d.ts +236 -0
  52. package/dist/runtime.iife.js +2 -0
  53. package/dist/runtime.iife.js.map +1 -0
  54. package/dist/runtime.js +54 -0
  55. package/dist/runtime.js.map +1 -0
  56. package/dist/widgets.umd.js +1 -1
  57. package/dist/widgets.umd.js.map +1 -1
  58. package/docs/ROADMAP.md +69 -38
  59. package/docs/components.md +55 -0
  60. package/docs/runtime/core.md +55 -0
  61. package/docs/runtime/format-css.md +59 -0
  62. package/docs/runtime/format-motion.md +56 -0
  63. package/package.json +48 -6
package/docs/ROADMAP.md CHANGED
@@ -1,54 +1,85 @@
1
1
  # Motionary 路线图(10.0 之后)
2
2
 
3
- 10.0 已发布:全新架构 —— 零依赖核心 `motionary/core`(gzip 后不到 10 KB,实测约 2 KB:`createMotion()`、入场预设、`play` / `bind` / `reveal`、统一暂停与倍速)、所有特效插件化(`motionary/plugins`,按需 `createMotion().use(retro, cinema)`,每个插件只引入自己的特效包)、GPU 特效默认使用 WebGPU(不支持时回退 WebGL2 → Canvas);移除 9.9 弃用的 `registerEffectPacks()`(改用 `registerAllPlugins()`,`npx usa-codemod-10 --write src` 自动改写);`motionary` 与 `use-scroll-animate` 同时成为 npm `latest`。
3
+ 10.0 已发布:全新架构 —— 零依赖核心 `motionary/core`(gzip 后不到 10 KB,实测约 2 KB:`createMotion()`、入场预设、`play` / `bind` / `reveal`、统一暂停与倍速)、所有特效插件化(`motionary/plugins`,按需 `createMotion().use(retro, cinema)`)、GPU 特效默认使用 WebGPU(不支持时回退 WebGL2 → Canvas);移除 9.9 弃用的 `registerEffectPacks()`;`motionary` 与 `use-scroll-animate` 同时成为 npm `latest`。
4
4
 
5
- 下面是 10.1 → 11.0 的计划。每个版本一个主题 + 一组新组件,另外贯穿两条长期主线:
5
+ 下面是 10.1 → 11.0 的计划(2026-10-09 修订)。每个版本一个主题 + 一组新组件,另外贯穿两条长期主线:
6
6
 
7
- - **主线 A · AI 可读组件**:让 AI 模型能自己发现、理解并正确使用每一个组件 —— 机器可读的组件清单、`llms.txt`、逐组件 Markdown 文档、`AGENTS.md` 提示指南,以及 `motionary-mcp` MCP 服务器。
8
- - **主线 B · 依赖第三方插件的组件**:基于 GSAP / ScrollTrigger、SplitType、Lenis、Three.js、lottie-web、Rive、Matter.js、Embla Carousel 等成熟库的组件与特效。这些库一律声明为**可选** `peerDependencies`(`peerDependenciesMeta.optional: true`),核心与其他组件不受影响;组件在首次使用时懒加载对应库,缺失时抛出清晰的错误(例如 `[motionary] <usa-three-scene> 需要 three:npm i three,或通过 CDN 引入后再注册`),而不是静默失败。
7
+ - **主线 A · AI 可读组件**:让 AI 模型能自己发现、理解并正确使用每一个组件 —— 机器可读的组件清单 `components.json`、`llms.txt`、逐组件 Markdown 文档、`AGENTS.md` 提示指南,以及 `motionary-mcp` MCP 服务器。
8
+ - **主线 B · 自研通用前置模块 `motionary/runtime`**:**不再依赖 GSAP、SplitType、Lenis、Three.js、lottie-web、Matter.js、Embla 等第三方库,也不做"全家桶"大包。** Motionary 自己从零实现一个零依赖运行时:共享 ticker / RAF 调度器、tween + timeline 引擎与缓动、模块注册与清晰错误,以及一组按功能 / 格式拆分的模块。每个模块一个子路径(`motionary/runtime/<module>`),可 tree-shake,只为用到的部分付费;可单独通过 CDN 使用(ESM 与自注册 IIFE);导入时不访问 `window`(SSR 安全),能放进 Web Worker 的部分支持 Worker;自带 TypeScript 类型;适用于纯 HTML `<script>`、ESM 打包器、React / Vue / Svelte / Angular。全部为原创实现,不复制、不逆向任何第三方库代码(GSAP 许可证禁止逆向工程)。
9
9
 
10
- ## 主线 B 的统一规则(从 10.1 起对每个依赖插件的组件强制执行)
10
+ ## 主线 B 的统一规则(从 10.1 起强制执行)
11
11
 
12
- 每个依赖第三方库的组件,在以下 **5 处** 都必须写明前置条件:画廊卡片、Store 详情、文档页、README 对应章节、AI 组件清单(manifest)。前置条件固定包含 4 项:
12
+ 需要 runtime 模块(或官方第三方运行时,见下文)的组件,在以下 **5 处** 都必须写明前置条件:画廊卡片、Store 详情、文档页、README 对应章节、AI 组件清单(manifest)。前置条件固定包含:
13
13
 
14
- 1. **安装命令**:如 `npm i gsap`(多个库写在一条命令里);
15
- 2. **CDN 替代方案**:可直接复制的 `<script>` / `import` URL(固定版本号);
16
- 3. **引入顺序与注册代码**:先引入哪个库、是否需要 `gsap.registerPlugin(ScrollTrigger)` 之类的注册、再如何注册 Motionary 组件;
17
- 4. **最小用法示例**:能直接运行的一段 HTML / JS。
14
+ 1. **安装命令**:runtime 模块只需 `npm i motionary` 一次;官方运行时写出确切命令(如 `npm i @rive-app/canvas`);
15
+ 2. **导入路径**:如 `motionary/runtime/scroll`;
16
+ 3. **CDN 地址**:可直接复制的 `<script>`(主版本固定,如 `https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js`)以及 ESM 地址;
17
+ 4. **引入顺序与注册代码**:先 `use(scroll)`(会同时注册核心),再注册组件;CDN 先加载 `runtime.iife.js`,再加载模块 IIFE(自动注册);
18
+ 5. **最小用法示例**。
18
19
 
19
- Store 卡片显示 **「Requires: X」** 徽章(如 `Requires: GSAP + ScrollTrigger`),点开详情即可看到上面 4 项。从 10.1 起 CI 增加 `check:peer-docs`,任何一处缺失都会让构建失败。
20
+ Store 卡片显示 **「Requires: motionary/runtime/<module>」** 徽章(官方运行时为 `Requires: @rive-app/canvas` 等)。缺少模块时组件显示并抛出清晰错误(包含上面几项与文档链接)。CI 的 `npm run check:peer-docs` 检查 5 处是否齐全;每个模块有固定的 gzip 体积预算,CI 强制(`size-budget.json`)。
21
+
22
+ ## 格式兼容:每种格式一个独立加载器模块
23
+
24
+ `motionary/runtime` 尽可能兼容常见动画 / 资源格式,全部自研、零依赖,每种格式一个可 tree-shake 的加载器模块,各有体积预算、真实样例文件测试(自制或 CC0 / CC-BY 样例并注明出处)、文档页兼容性表格与 AI 清单条目:
25
+
26
+ - **矢量**:Lottie JSON(形状、预合成、遮罩 / 轨道遮罩、修剪路径、渐变、文本层、表达式子集)+ dotLottie(`.lottie` zip,主题 / 状态机可行子集);SVG(SMIL `animate` / `animateTransform` / `animateMotion` 回放、路径变形、CSS 动画 SVG)。
27
+ - **CSS / Web**:CSS `@keyframes` 与 Web Animations API 关键帧导入 timeline;Motion / Framer 风格关键帧 JSON。
28
+ - **位图 / 序列**:精灵图(TexturePacker / Aseprite JSON)、GIF / APNG / 动画 WebP 拆帧到 canvas、图片序列、视频(MP4 / WebM)纹理与滚动拖动。
29
+ - **3D**:glTF 2.0 / GLB(网格、PBR 基础、蒙皮、变形目标、动画)、OBJ / MTL。
30
+ - **物理 / 数据**:自定义、带版本号的场景 JSON(`motionary-scene@1`)。
31
+
32
+ ### 使用官方第三方运行时的组件(及原因)
33
+
34
+ 只有我们**无法合理自行实现**的格式才使用官方运行时,一律作为**可选** `peerDependencies`(`peerDependenciesMeta.optional: true`),首次使用时懒加载,缺失时清晰报错,并同样满足 5 处前置条件规则 + Requires 徽章:
35
+
36
+ | 组件 / 功能 | 官方运行时 | 原因 |
37
+ |---|---|---|
38
+ | `<usa-rive>`(10.6) | `@rive-app/canvas`(或 `@rive-app/webgl2`) | `.riv` 是 Rive 的专有二进制格式,没有公开的完整规范,自研无法保证正确性 |
39
+ | Lottie 全保真模式(可选,10.6+) | `lottie-web` | 自研播放器只覆盖文档列出的子集;需要子集之外特性(3D 图层、效果等)时可切换到官方播放器 |
40
+ | dotLottie 完整状态机(可选,10.9) | `@lottiefiles/dotlottie-web` | 完整状态机规范庞大且仍在演进,自研只做子集 |
41
+ | glTF Draco / KTX2(Basis) 压缩(可选,10.9) | `draco3d`、`basis_universal` 官方解码器 | 专用压缩解码器(WASM),自研成本与风险过高 |
20
42
 
21
43
  ## 各版本计划
22
44
 
23
- - **v10.1** — 插件生态 + AI 清单 + 第三方插件基础设施:插件开发脚手架(`npm create motionary-plugin`)、插件签名校验与版本兼容检查。
24
- - 主线 A:发布机器可读组件清单 `components.json`(Pages 根目录 + npm 包内 `motionary/manifest.json`,带 JSON Schema),每个组件包含:标签名、属性 / attributes、事件、插槽、导入路径、CDN URL、最小示例、peer 依赖;Pages 根目录提供 `llms.txt`(索引)与 `llms-full.txt`(全部组件的完整说明),均在构建时由源码生成,保证不过期。
25
- - 主线 B:`requirePeer()` 懒加载器与统一错误提示、`peerDependenciesMeta` 规范、Store 「Requires: X」徽章、前置条件区块模板与 `check:peer-docs`(本版先用于新组件)。
26
- - 新组件:插件详情卡、安装按钮(一键复制 npm 命令或 CDN 代码)。
27
- - **v10.2** — 核心 DSL 化:`motionary/core` 直接支持 `data-motion` 声明式语法(无需整个 DSL 包)。
28
- - 主线 A:逐组件 Markdown 文档(`/docs/components/<tag>.md`,由清单生成,与 `llms-full.txt` 同源);仓库根目录新增 `AGENTS.md` 与提示指南(如何让 AI 选组件、写最小示例、避免常见误用)。
29
- - 主线 B:首个依赖插件的组件 —— GSAP + ScrollTrigger 桥接(`motionary/peer/gsap`,把 Motionary 特效挂到 GSAP 时间线上)。
30
- - 新组件:动效检查器面板、`<usa-scroll-scene>`(Requires: GSAP + ScrollTrigger)。
31
- - **v10.3** — View Transitions 2.0:跨文档页面转场、共享元素动画插件。
32
- - 主线 B:文字拆分组件 `<usa-split-text>`(Requires: SplitType),逐字 / 逐词 / 逐行入场。
33
- - 新组件:路由转场容器、`<usa-split-text>`。
45
+ - ✅ **v10.1** — 插件生态 + AI 清单 + runtime 核心:插件开发脚手架(`create-motionary-plugin`)、插件签名校验(SRI 风格 SHA-256 完整性)与版本兼容检查。
46
+ - 主线 A:机器可读组件清单 `components.json`(Pages 根目录 + npm 包内 `motionary/manifest.json`,带 JSON Schema),每个组件包含:标签名、attributes、事件、插槽、方法、导入路径、CDN URL、最小示例、前置条件;Pages 根目录提供 `llms.txt` 与 `llms-full.txt`,均在构建时由源码生成。
47
+ - 主线 B:**runtime 核心** —— 共享 ticker / RAF 调度器、tween + timeline 引擎与缓动、`use()` / `requireModule()` 注册 API 与清晰错误、「Requires: motionary/runtime/…」徽章、前置条件模板、`check:peer-docs`(检查 runtime 模块文档与 5 处前置条件)、清单列出 runtime 模块。
48
+ - 格式:CSS `@keyframes` + WAAPI 关键帧(`motionary/runtime/format-css`)、Motion / Framer 关键帧 JSON(`motionary/runtime/format-motion`)。
49
+ - 新组件:插件详情卡 `<usa-plugin-card>`(Requires: motionary/runtime)、安装按钮 `<usa-install-button>`。
50
+ - **v10.2** — 核心 DSL 化:`motionary/core` 直接支持 `data-motion` 声明式语法。
51
+ - 主线 A:逐组件 Markdown 文档(`/docs/components/<tag>.md`,由清单生成);仓库根目录新增 `AGENTS.md` 与提示指南。
52
+ - 主线 B:**scroll 模块**(`motionary/runtime/scroll`)—— pin、scrub、markers、start / end 规则(自研,功能对标 ScrollTrigger,但不复制其代码或 API)。
53
+ - 格式:SVG SMIL 回放、路径变形、CSS 动画 SVG(`motionary/runtime/format-svg`)。
54
+ - 新组件:动效检查器面板、`<usa-scroll-scene>`(Requires: motionary/runtime/scroll)。
55
+ - **v10.3** — View Transitions 2.0:跨文档页面转场、共享元素动画。
56
+ - 主线 B:**text 模块** —— 逐字 / 逐词 / 逐行拆分(保留可访问文本)。
57
+ - 格式:精灵图(TexturePacker / Aseprite JSON)、图片序列(`motionary/runtime/format-sprite`)。
58
+ - 新组件:路由转场容器、`<usa-text-splitter>`(`<usa-split-text>` 已被 4.x 文本组件占用)。
34
59
  - **v10.4** — 滚动驱动 3.0:原生 `animation-timeline` 优先、JS 回退插件化。
35
- - 主线 A:发布 `motionary-mcp` MCP 服务器(`npx motionary-mcp`,stdio),工具:`list_components`、`search_components`、`get_component`、`get_example`、`scaffold_snippet`(按框架 / CDN / npm 生成可运行片段,自动带上 peer 前置条件);数据直接读取清单。
36
- - 主线 B:平滑滚动组件(Requires: Lenis)。
60
+ - 主线 A:发布 `motionary-mcp` MCP 服务器(`npx motionary-mcp`,stdio):`list_components`、`search_components`、`get_component`、`get_example`、`scaffold_snippet`(自动带上前置条件)。
61
+ - 主线 B:**smooth 模块** —— 平滑滚动(减少动态效果时停用)。
62
+ - 格式:GIF(自研 LZW)、APNG、动画 WebP 拆帧到 canvas。
37
63
  - 新组件:滚动进度环、视差分层容器、`<usa-smooth-scroll>`。
38
- - **v10.5** — WebGPU 特效 2.0:计算着色器粒子、后处理链(辉光、色差、景深)。
39
- - 主线 B:Three.js 场景组件(Requires: three;加载 glTF 时另需 `three/addons` 的 GLTFLoader,文档写明引入路径)。
40
- - 新组件:粒子画布、着色器背景、`<usa-three-scene>`。
41
- - **v10.6** — 动效设计令牌 2.0:W3C Design Tokens 格式导入导出、主题级动效曲线。
42
- - 主线 B:完整保真的 Lottie / Rive 播放器(Requires: lottie-web / @rive-app/canvas),与 9.2 的内置 `lottieToKeyframes()` 轻量转换并存,文档说明何时选哪个。
64
+ - **v10.5** — WebGPU 特效 2.0:计算着色器粒子、后处理链。
65
+ - 主线 B:**gl 模块** —— 迷你 WebGL2 场景(网格 / 基础几何体、相机、灯光、着色器材质;不是 Three.js 克隆)。
66
+ - 格式:OBJ / MTL、glTF 2.0 / GLB 基础、视频纹理。
67
+ - 新组件:粒子画布、着色器背景、`<usa-gl-scene>`(保留别名 `<usa-three-scene>`)。
68
+ - **v10.6** — 动效设计令牌 2.0:W3C Design Tokens 格式导入导出。
69
+ - 主线 B:**vector 模块** —— 矢量动画播放器,支持文档列出的 Lottie JSON 子集(形状、变换、修剪路径、基础遮罩、预合成、渐变;文档列出不支持的特性)+ dotLottie。
70
+ - 官方运行时:`<usa-rive>`(Requires: @rive-app/canvas,可选 peer,懒加载)。
43
71
  - 新组件:令牌编辑器、`<usa-lottie-player>`、`<usa-rive>`。
44
- - **v10.7** — AI 辅助动效:自然语言 → 动效描述(本地规则引擎,可选接入模型)、动效建议。
45
- - 主线 A:MCP 服务器 2.0 —— 新增 `suggest_motion`、`validate_snippet`(检查标签、属性与 peer 前置条件是否齐全);清单覆盖全部特效;加入 AI 使用评测集(给模型一组任务,检验生成代码能否直接运行)。
46
- - 主线 B:物理组件(Requires: matter-js)。
72
+ - **v10.7** — AI 辅助动效:自然语言 → 动效描述、动效建议。
73
+ - 主线 A:MCP 2.0 —— `suggest_motion`、`validate_snippet`;AI 使用评测集(运行 AI 写的片段检验能否直接工作)。
74
+ - 主线 B:**physics 模块** —— 2D 刚体(圆 / 盒 / 多边形)、约束;场景 JSON `motionary-scene@1`。
47
75
  - 新组件:动效提示输入框、`<usa-physics-playground>`。
48
- - **v10.8** — 跨端 3.0:小程序(微信 / 支付宝)适配插件、鸿蒙 ArkTS 示例。
49
- - 主线 B:轮播组件(Requires: embla-carousel),类 Swiper 的手势、循环、自动播放,暂停遵循减少动态效果偏好。
50
- - 新组件:跨端预览器、`<usa-carousel>`。
76
+ - **v10.8** — 跨端 3.0:小程序适配、鸿蒙 ArkTS 示例。
77
+ - 主线 B:**drag-snap 模块** —— 拖拽吸附 / 惯性轮播。
78
+ - 格式:glTF 蒙皮 / 变形目标 / 动画;Lottie 文本层 + 表达式子集。
79
+ - 新组件:跨端预览器、`<usa-snap-carousel>`(`<usa-carousel>` 已被 6.2 轮播占用)。
51
80
  - **v10.9** — 11.0 预备:11.0 弃用警告、`upgrading-11.md` 与 `usa-codemod-11`。
52
- - 主线 A:清单 Schema v2 定稿(11.0 起冻结),`llms.txt` / 文档 / MCP 全量对齐。
53
- - 主线 B:对全部依赖插件的组件做一次审计 —— `check:peer-docs` 扩展到所有历史组件,peer 版本范围与 CDN 链接统一更新。
54
- - **v11.0** — 下一代:核心继续瘦身(目标 < 5 KB)、插件按需懒加载、移除 10.9 弃用项;组件清单 Schema v2 与 `motionary-mcp` 1.0 稳定版;`motionary/peer/*` 入口转为稳定 API;npm `latest`。
81
+ - 主线 A:清单 Schema v2 定稿(11.0 起冻结)。
82
+ - 主线 B:全部 runtime 模块审计、逐模块体积预算复核;dotLottie 主题 / 状态机子集;Draco / KTX2 官方解码器挂钩。
83
+ - **v11.0** — 下一代:核心继续瘦身(目标 < 5 KB)、移除 10.9 弃用项;清单 Schema v2 与 `motionary-mcp` 1.0 稳定版;`motionary/runtime/*` 转为稳定 API;npm `latest`。
84
+
85
+ 完整的格式兼容性矩阵(格式 / 版本 / 支持特性 / 已知缺口 / 回退方案)见各模块文档页 `docs/runtime/<module>.md`。
@@ -1321,6 +1321,61 @@ motion.bind(button, 'vhs-glitch', { trigger: 'click' });
1321
1321
  ```
1322
1322
  - Zero dependencies, ≈ 2 KB gzip; every effect pack is a plugin; WebGPU is the default GPU backend. `registerEffectPacks()` is removed → `registerAllPlugins()` (`npx usa-codemod-10 --write src`). See docs/core.md and docs/upgrading-10.md.
1323
1323
 
1324
+ ### v10.1 Runtime (`motionary/runtime`) + AI manifest: `<usa-plugin-card>`, `<usa-install-button>` (`components/widgets`)
1325
+
1326
+ `motionary/runtime` is Motionary's own zero-dependency animation runtime (ticker, tween + timeline, easing, module registry) with one tree-shakable module per feature / format — see [docs/runtime/](runtime/). Components that need a module carry a **Requires** badge and list their prerequisites below.
1327
+
1328
+ ```html
1329
+ <usa-plugin-card name="retro" title="Retro" version="1.2.0" author="Motionary" engine="^10.0.0" downloads="12400">
1330
+ <p>Pixel, CRT, VHS and Y2K effects.</p>
1331
+ </usa-plugin-card>
1332
+ <usa-install-button package="motionary" managers="npm pnpm yarn bun cdn" cdn="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js"></usa-install-button>
1333
+ ```
1334
+
1335
+ | Element | Attributes | Methods / events |
1336
+ |---|---|---|
1337
+ | `<usa-plugin-card>` (Requires: motionary/runtime) | `name`, `title`, `version`, `author`, `engine` (semver), `downloads`, `integrity`, `src` | `toggle(open?)`, `verify()`, `compat()`; `usa:toggle`, `usa:verified`, `usa:runtime-missing` |
1338
+ | `<usa-install-button>` | `package`, `managers`, `cdn`, `dev`, `manager` | `command(manager)`, `copy()`; `usa:copy` |
1339
+
1340
+ AI manifest: `motionary/manifest.json` (Pages: `/components.json`, `/llms.txt`, `/llms-full.txt`).
1341
+
1342
+ <!-- prereqs:start -->
1343
+ ## Prerequisites of runtime-powered components
1344
+
1345
+ Generated from `showcase/catalog/prereqs.js`. Runtime modules: see [docs/runtime/](runtime/).
1346
+
1347
+ ### `<usa-plugin-card>` — Requires: motionary/runtime
1348
+
1349
+ - **Install:** `npm i motionary`
1350
+ - **Import order & registration:** Import motionary/runtime and call use() once at start-up, before any runtime-powered component mounts. CDN: the IIFE registers itself (window.MotionaryRuntime).
1351
+
1352
+ ```js
1353
+ import { use } from 'motionary/runtime';
1354
+ import { definePluginCard } from 'motionary/components/widgets';
1355
+
1356
+ use();
1357
+ definePluginCard(); // registers <usa-plugin-card> — after the prerequisites
1358
+ ```
1359
+
1360
+ - **CDN:**
1361
+
1362
+ ```html
1363
+ <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js"></script>
1364
+ <!-- then the component bundles -->
1365
+ <script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>
1366
+ <script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>
1367
+ ```
1368
+
1369
+ - **Minimal example:**
1370
+
1371
+ ```html
1372
+ <usa-plugin-card name="retro" title="Retro" version="1.2.0" author="Motionary" engine="^10.0.0" downloads="12400">
1373
+ <p>Pixel, CRT, VHS and Y2K effects.</p>
1374
+ </usa-plugin-card>
1375
+ ```
1376
+
1377
+ <!-- prereqs:end -->
1378
+
1324
1379
  ## Frameworks
1325
1380
 
1326
1381
  Custom elements work in every framework. Register once (e.g. in your entry file), then use the tags.
@@ -0,0 +1,55 @@
1
+ # motionary/runtime — Runtime core
2
+
3
+ > Generated from `showcase/catalog/prereqs.js` by `scripts/gen-runtime-docs.mjs` — edit the data, not this page.
4
+
5
+ Shared ticker (one rAF loop), tween + timeline engine with easing, module registry with clear errors.
6
+
7
+ Part of Motionary's own zero-dependency runtime. Size budget: **5.5 KB gzip** (enforced in CI).
8
+
9
+ ## Prerequisites
10
+
11
+ 1. **Install:** `npm i motionary`
12
+ 2. **Import path:** `motionary/runtime`
13
+ 3. **CDN:**
14
+
15
+ ```html
16
+ <script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js"></script>
17
+ ```
18
+
19
+ ESM from a CDN: `https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.js`
20
+
21
+ 4. **Import order & registration:** Import motionary/runtime and call use() once at start-up, before any runtime-powered component mounts. CDN: the IIFE registers itself (window.MotionaryRuntime).
22
+
23
+ ```js
24
+ import { use } from 'motionary/runtime';
25
+ use();
26
+ ```
27
+
28
+ ## Example
29
+
30
+ ```js
31
+ import { use, tween, timeline } from 'motionary/runtime';
32
+ use();
33
+ tween('.box', { to: { x: 120, opacity: 1 }, duration: 500, ease: 'back-out' });
34
+ timeline().to('.a', { to: { y: -20 } }).to('.b', { to: { scale: 1.2 } }, '<+=100');
35
+ ```
36
+
37
+ ## Exports
38
+
39
+ `use` · `requireModule` · `hasModule` · `getTicker` · `tween` · `timeline` · `Tween` · `Timeline` · `EASES` · `parseEase` · `cubicBezier` · `steps` · `RuntimeModuleError`
40
+
41
+ ## Compatibility
42
+
43
+ | Feature | Supported | Notes |
44
+ |---|---|---|
45
+ | Plain objects (numeric props) | ✅ yes | any numeric property |
46
+ | Elements: CSS lengths, %, unitless, colours, custom properties | ✅ yes | hex, rgb(), rgba(), transparent |
47
+ | Transform shorthands x y rotate scale scaleX scaleY skewX skewY | ✅ yes | composed in that order |
48
+ | Timeline positions (<, >, +=, -=, labels) | ✅ yes | |
49
+ | repeat / yoyo / reverse / seek / timeScale | ✅ yes | |
50
+ | SSR / Node import | ✅ yes | no window access at import |
51
+ | Web Workers | ✅ yes | ticker falls back to setTimeout without rAF |
52
+
53
+ ## Components that need it
54
+
55
+ - `<usa-plugin-card>` — Plugin detail card
@@ -0,0 +1,59 @@
1
+ # motionary/runtime/format-css — CSS @keyframes & WAAPI keyframes loader
2
+
3
+ > Generated from `showcase/catalog/prereqs.js` by `scripts/gen-runtime-docs.mjs` — edit the data, not this page.
4
+
5
+ Import CSS @keyframes text or live CSSKeyframesRule objects and Web Animations API keyframes (array or property-indexed) into a runtime timeline.
6
+
7
+ Part of Motionary's own zero-dependency runtime. Size budget: **2.5 KB gzip** (enforced in CI).
8
+
9
+ ## Prerequisites
10
+
11
+ 1. **Install:** `npm i motionary`
12
+ 2. **Import path:** `motionary/runtime/format-css`
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-css.iife.js"></script>
18
+ ```
19
+
20
+ ESM from a CDN: `https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/format-css.js`
21
+
22
+ 4. **Import order & registration:** Register the core first, then the module: use(formatCss) also registers the core. CDN: load runtime.iife.js, then runtime/format-css.iife.js (it registers itself).
23
+
24
+ ```js
25
+ import { use } from 'motionary/runtime';
26
+ import { formatCss } from 'motionary/runtime/format-css';
27
+ use(formatCss);
28
+ ```
29
+
30
+ ## Example
31
+
32
+ ```js
33
+ import { use } from 'motionary/runtime';
34
+ import { formatCss, parseKeyframes, playKeyframes } from 'motionary/runtime/format-css';
35
+ use(formatCss);
36
+ const [pulse] = parseKeyframes('@keyframes pulse { from { opacity: .4 } 50% { opacity: 1; transform: scale(1.1) } to { opacity: .4 } }');
37
+ playKeyframes(document.querySelector('.dot'), pulse, { duration: 1200, repeat: -1 });
38
+ ```
39
+
40
+ ## Exports
41
+
42
+ `formatCss` · `parseKeyframes` · `fromCssRule` · `fromWaapi` · `toWaapi` · `playKeyframes`
43
+
44
+ ## Compatibility
45
+
46
+ | Feature | Supported | Notes |
47
+ |---|---|---|
48
+ | @keyframes from / to / percentages / selector lists | ✅ yes | duplicate offsets merged, later wins |
49
+ | -webkit- / -moz- prefixed @keyframes | ✅ yes | |
50
+ | animation-timing-function per keyframe | ✅ yes | names, cubic-bezier(), steps() |
51
+ | transform lists (translate / rotate / scale / skew) | ✅ yes | tweened as shorthands |
52
+ | matrix() / 3D transforms | ◐ partial | switch discretely at the segment midpoint |
53
+ | WAAPI array + property-indexed keyframes, offsets, easing | ✅ yes | offsets distributed like the WAAPI |
54
+ | composite: add / accumulate | ✕ no | ignored (replace) |
55
+ | @property typed interpolation | ✕ no | non-numeric values switch discretely |
56
+
57
+ ## Components that need it
58
+
59
+ _None yet._
@@ -0,0 +1,56 @@
1
+ # motionary/runtime/format-motion — Motion / Framer keyframe JSON loader
2
+
3
+ > Generated from `showcase/catalog/prereqs.js` by `scripts/gen-runtime-docs.mjs` — edit the data, not this page.
4
+
5
+ Play Motion / Framer-style { initial, animate, transition } JSON (arrays as keyframes, times, repeatType, springs) with the runtime.
6
+
7
+ Part of Motionary's own zero-dependency runtime. Size budget: **2.5 KB gzip** (enforced in CI).
8
+
9
+ ## Prerequisites
10
+
11
+ 1. **Install:** `npm i motionary`
12
+ 2. **Import path:** `motionary/runtime/format-motion`
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-motion.iife.js"></script>
18
+ ```
19
+
20
+ ESM from a CDN: `https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/format-motion.js`
21
+
22
+ 4. **Import order & registration:** Register the core first, then the module: use(formatMotion) also registers the core. CDN: load runtime.iife.js, then runtime/format-motion.iife.js (it registers itself).
23
+
24
+ ```js
25
+ import { use } from 'motionary/runtime';
26
+ import { formatMotion } from 'motionary/runtime/format-motion';
27
+ use(formatMotion);
28
+ ```
29
+
30
+ ## Example
31
+
32
+ ```js
33
+ import { use } from 'motionary/runtime';
34
+ import { formatMotion, playMotion } from 'motionary/runtime/format-motion';
35
+ use(formatMotion);
36
+ playMotion(document.querySelector('.card'), { initial: { opacity: 0, y: 40 }, animate: { opacity: 1, y: 0 }, transition: { type: 'spring', stiffness: 180, damping: 14 } });
37
+ ```
38
+
39
+ ## Exports
40
+
41
+ `formatMotion` · `fromMotion` · `playMotion` · `springEase` · `motionEase`
42
+
43
+ ## Compatibility
44
+
45
+ | Feature | Supported | Notes |
46
+ |---|---|---|
47
+ | initial / animate, arrays as keyframes, times | ✅ yes | |
48
+ | transition duration / delay (s), ease names + cubic arrays | ✅ yes | easeIn/Out/InOut, circ*, back*, anticipate≈back-in-out |
49
+ | repeat (Infinity), repeatType loop / reverse / mirror | ✅ yes | mirror = reverse |
50
+ | per-property transitions | ✅ yes | |
51
+ | type: "spring" (stiffness, damping, mass, bounce + duration) | ✅ yes | simulated into an easing curve |
52
+ | variants, gestures (whileHover…), layout animations | ✕ no | out of scope |
53
+
54
+ ## Components that need it
55
+
56
+ _None yet._
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "motionary",
3
- "version": "10.0.0",
3
+ "version": "10.1.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,38 @@
1208
1208
  "default": "./dist/components/lite.cjs"
1209
1209
  }
1210
1210
  },
1211
+ "./runtime": {
1212
+ "import": {
1213
+ "types": "./dist/runtime.d.ts",
1214
+ "default": "./dist/runtime.js"
1215
+ },
1216
+ "require": {
1217
+ "types": "./dist/runtime.d.cts",
1218
+ "default": "./dist/runtime.cjs"
1219
+ }
1220
+ },
1221
+ "./runtime/format-css": {
1222
+ "import": {
1223
+ "types": "./dist/runtime/format-css.d.ts",
1224
+ "default": "./dist/runtime/format-css.js"
1225
+ },
1226
+ "require": {
1227
+ "types": "./dist/runtime/format-css.d.cts",
1228
+ "default": "./dist/runtime/format-css.cjs"
1229
+ }
1230
+ },
1231
+ "./runtime/format-motion": {
1232
+ "import": {
1233
+ "types": "./dist/runtime/format-motion.d.ts",
1234
+ "default": "./dist/runtime/format-motion.js"
1235
+ },
1236
+ "require": {
1237
+ "types": "./dist/runtime/format-motion.d.cts",
1238
+ "default": "./dist/runtime/format-motion.cjs"
1239
+ }
1240
+ },
1241
+ "./manifest.json": "./dist/manifest.json",
1242
+ "./manifest.schema.json": "./dist/manifest.schema.json",
1211
1243
  "./components.css": "./dist/components.css",
1212
1244
  "./components/reveal.css": "./dist/components/reveal.css",
1213
1245
  "./components/text.css": "./dist/components/text.css",
@@ -1248,18 +1280,21 @@
1248
1280
  "./dist/presets-extended.umd.js"
1249
1281
  ],
1250
1282
  "scripts": {
1251
- "build": "npm run clean && node --max-old-space-size=6144 ./node_modules/rollup/dist/bin/rollup -c rollup.config.mjs",
1283
+ "build": "npm run clean && node --max-old-space-size=6144 ./node_modules/rollup/dist/bin/rollup -c rollup.config.mjs && node scripts/gen-manifest.mjs",
1252
1284
  "dev": "rollup -c rollup.config.mjs -w",
1253
1285
  "typecheck": "tsc --noEmit -p .",
1254
1286
  "test": "vitest run",
1255
1287
  "check:exports": "node scripts/check-exports.mjs",
1256
- "lint:package": "publint && attw --pack . --profile node16 --exclude-entrypoints ./components.css ./components/reveal.css ./components/text.css ./components/interaction.css ./components/feedback.css ./components/background.css ./components/transitions.css ./components/physics.css ./components/cards.css ./components/click.css ./components/ui.css ./components/page.css ./components/timeline.css ./components/gesture.css ./components/svg.css ./components/webgl.css ./components/depth.css ./components/layout.css ./components/packs.css ./components/fx.css",
1288
+ "lint:package": "publint && attw --pack . --profile node16 --exclude-entrypoints ./manifest.json ./manifest.schema.json ./components.css ./components/reveal.css ./components/text.css ./components/interaction.css ./components/feedback.css ./components/background.css ./components/transitions.css ./components/physics.css ./components/cards.css ./components/click.css ./components/ui.css ./components/page.css ./components/timeline.css ./components/gesture.css ./components/svg.css ./components/webgl.css ./components/depth.css ./components/layout.css ./components/packs.css ./components/fx.css",
1257
1289
  "size": "node scripts/size.mjs",
1258
1290
  "prepublishOnly": "npm run typecheck && npm test && npm run build && npm run check:exports",
1259
1291
  "size:check": "node scripts/size.mjs --check",
1260
1292
  "sync:exports": "node scripts/sync-exports.mjs",
1261
1293
  "bench": "node scripts/bench.mjs",
1262
- "clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\""
1294
+ "clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"",
1295
+ "manifest": "node scripts/gen-manifest.mjs",
1296
+ "docs:runtime": "node scripts/gen-runtime-docs.mjs",
1297
+ "check:peer-docs": "node scripts/check-peer-docs.mjs"
1263
1298
  },
1264
1299
  "keywords": [
1265
1300
  "motionary",
@@ -1287,7 +1322,13 @@
1287
1322
  "typescript",
1288
1323
  "reduced-motion",
1289
1324
  "electron",
1290
- "webview2"
1325
+ "webview2",
1326
+ "tween",
1327
+ "timeline",
1328
+ "animation-runtime",
1329
+ "lottie-alternative",
1330
+ "llms-txt",
1331
+ "ai-manifest"
1291
1332
  ],
1292
1333
  "author": "HarrisonCN",
1293
1334
  "license": "MIT",
@@ -1334,6 +1375,7 @@
1334
1375
  "usa-codemod-7": "./bin/usa-codemod-7.mjs",
1335
1376
  "usa-codemod-8": "./bin/usa-codemod-8.mjs",
1336
1377
  "usa-codemod-9": "./bin/usa-codemod-9.mjs",
1337
- "usa-codemod-10": "./bin/usa-codemod-10.mjs"
1378
+ "usa-codemod-10": "./bin/usa-codemod-10.mjs",
1379
+ "create-motionary-plugin": "./bin/create-motionary-plugin.mjs"
1338
1380
  }
1339
1381
  }