motionary 10.6.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.
- package/AGENTS.md +2 -0
- package/CHANGELOG.md +16 -0
- package/README.md +35 -1
- package/bin/motionary-mcp.mjs +160 -11
- package/dist/chunks/{anim-image-DECLkPH4.cjs → anim-image-CFGpUX7t.cjs} +2 -2
- package/dist/chunks/{anim-image-DECLkPH4.cjs.map → anim-image-CFGpUX7t.cjs.map} +1 -1
- package/dist/chunks/{anim-image-DNghy017.js → anim-image-CXDD19FH.js} +2 -2
- package/dist/chunks/{anim-image-DNghy017.js.map → anim-image-CXDD19FH.js.map} +1 -1
- package/dist/chunks/{keyframes-CbUZjD_5.cjs → keyframes-DdwGY1gr.cjs} +2 -2
- package/dist/chunks/{keyframes-CbUZjD_5.cjs.map → keyframes-DdwGY1gr.cjs.map} +1 -1
- package/dist/chunks/{keyframes-F6vp6tZZ.js → keyframes-DwR6GPej.js} +2 -2
- package/dist/chunks/{keyframes-F6vp6tZZ.js.map → keyframes-DwR6GPej.js.map} +1 -1
- package/dist/chunks/{registry-D8LAoXI-.js → registry-D87dP_aR.js} +3 -3
- package/dist/chunks/{registry-D8LAoXI-.js.map → registry-D87dP_aR.js.map} +1 -1
- package/dist/chunks/{registry-dr1CPTk1.cjs → registry-DhKZCitb.cjs} +2 -2
- package/dist/chunks/{registry-dr1CPTk1.cjs.map → registry-DhKZCitb.cjs.map} +1 -1
- package/dist/chunks/{ticker-Do9bGsaV.js → ticker-CJYI5Pxc.js} +2 -2
- package/dist/chunks/{ticker-Do9bGsaV.js.map → ticker-CJYI5Pxc.js.map} +1 -1
- package/dist/chunks/{ticker-DaAlEyOd.cjs → ticker-jD9_A9Rh.cjs} +2 -2
- package/dist/chunks/{ticker-DaAlEyOd.cjs.map → ticker-jD9_A9Rh.cjs.map} +1 -1
- package/dist/chunks/{tween-CmkdSyaC.cjs → tween-Dk0QmNe9.cjs} +2 -2
- package/dist/chunks/{tween-CmkdSyaC.cjs.map → tween-Dk0QmNe9.cjs.map} +1 -1
- package/dist/chunks/{tween-BzCGq_Ba.js → tween-_Lld1MsF.js} +2 -2
- package/dist/chunks/{tween-BzCGq_Ba.js.map → tween-_Lld1MsF.js.map} +1 -1
- package/dist/components/ai.cjs +314 -0
- package/dist/components/ai.cjs.map +1 -0
- package/dist/components/ai.d.cts +58 -0
- package/dist/components/ai.d.ts +58 -0
- package/dist/components/ai.js +311 -0
- package/dist/components/ai.js.map +1 -0
- package/dist/components/widgets.cjs +598 -226
- package/dist/components/widgets.cjs.map +1 -1
- package/dist/components/widgets.d.cts +438 -35
- package/dist/components/widgets.d.ts +438 -35
- package/dist/components/widgets.js +596 -227
- package/dist/components/widgets.js.map +1 -1
- package/dist/llms-full.txt +98 -1
- package/dist/llms.txt +6 -2
- package/dist/manifest.json +238 -1
- package/dist/runtime/format-apng.cjs +4 -4
- package/dist/runtime/format-apng.js +4 -4
- package/dist/runtime/format-css.cjs +4 -4
- package/dist/runtime/format-css.js +4 -4
- package/dist/runtime/format-gif.cjs +4 -4
- package/dist/runtime/format-gif.js +4 -4
- package/dist/runtime/format-gltf.cjs +1 -1
- package/dist/runtime/format-gltf.js +1 -1
- package/dist/runtime/format-motion.cjs +4 -4
- package/dist/runtime/format-motion.js +4 -4
- package/dist/runtime/format-obj.cjs +1 -1
- package/dist/runtime/format-obj.js +1 -1
- package/dist/runtime/format-scene.cjs +241 -0
- package/dist/runtime/format-scene.cjs.map +1 -0
- package/dist/runtime/format-scene.d.cts +349 -0
- package/dist/runtime/format-scene.d.ts +349 -0
- package/dist/runtime/format-scene.iife.js +2 -0
- package/dist/runtime/format-scene.iife.js.map +1 -0
- package/dist/runtime/format-scene.js +233 -0
- package/dist/runtime/format-scene.js.map +1 -0
- package/dist/runtime/format-sprite.cjs +3 -3
- package/dist/runtime/format-sprite.js +3 -3
- package/dist/runtime/format-svg.cjs +3 -3
- package/dist/runtime/format-svg.js +3 -3
- package/dist/runtime/format-webp.cjs +4 -4
- package/dist/runtime/format-webp.js +4 -4
- package/dist/runtime/gl.cjs +1 -1
- package/dist/runtime/gl.js +1 -1
- package/dist/runtime/physics.cjs +739 -0
- package/dist/runtime/physics.cjs.map +1 -0
- package/dist/runtime/physics.d.cts +250 -0
- package/dist/runtime/physics.d.ts +250 -0
- package/dist/runtime/physics.iife.js +2 -0
- package/dist/runtime/physics.iife.js.map +1 -0
- package/dist/runtime/physics.js +731 -0
- package/dist/runtime/physics.js.map +1 -0
- package/dist/runtime/scroll.cjs +2 -2
- package/dist/runtime/scroll.js +2 -2
- package/dist/runtime/smooth.cjs +1 -1
- package/dist/runtime/smooth.js +1 -1
- package/dist/runtime/text.cjs +1 -1
- package/dist/runtime/text.js +1 -1
- package/dist/runtime/vector.cjs +3 -3
- package/dist/runtime/vector.js +3 -3
- package/dist/runtime.cjs +3 -3
- package/dist/runtime.d.cts +1 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.iife.js +1 -1
- package/dist/runtime.iife.js.map +1 -1
- package/dist/runtime.js +5 -5
- package/dist/widgets.umd.js +1 -1
- package/dist/widgets.umd.js.map +1 -1
- package/docs/ROADMAP.md +1 -1
- package/docs/components/README.md +3 -1
- package/docs/components/usa-motion-prompt.md +32 -0
- package/docs/components/usa-physics-playground.md +63 -0
- package/docs/components.md +44 -0
- package/docs/runtime/format-scene.md +59 -0
- package/docs/runtime/physics.md +61 -0
- package/package.json +31 -1
package/dist/llms-full.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Motionary 10.
|
|
1
|
+
# Motionary 10.7.0 — full component reference
|
|
2
2
|
|
|
3
3
|
Generated from the source. Machine-readable version: https://harrisoncn.github.io/Motionary/components.json (schema https://harrisoncn.github.io/Motionary/components.schema.json).
|
|
4
4
|
|
|
@@ -362,6 +362,53 @@ defineRive();
|
|
|
362
362
|
// <usa-rive src="/anim/icon.riv" state-machine="State Machine 1" autoplay></usa-rive>
|
|
363
363
|
```
|
|
364
364
|
|
|
365
|
+
### motionary/runtime/physics — 2D rigid-body physics
|
|
366
|
+
|
|
367
|
+
A small 2D rigid-body engine written for Motionary (own implementation and API — no Matter.js / Box2D code): circles, boxes and convex polygons, mass from density, restitution, friction, sensors, collision groups, sleeping, distance / spring / pin constraints, pointer drag, a fixed time step on the shared ticker.
|
|
368
|
+
|
|
369
|
+
- Install: `npm i motionary`
|
|
370
|
+
- Import: `motionary/runtime/physics`
|
|
371
|
+
- Register: `use(physics);` — Register the core first, then the module: use(physics) also registers the core. CDN: load runtime.iife.js, then runtime/physics.iife.js (it registers itself).
|
|
372
|
+
- CDN:
|
|
373
|
+
|
|
374
|
+
```html
|
|
375
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js"></script>
|
|
376
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/physics.iife.js"></script>
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
```js
|
|
380
|
+
import { use } from 'motionary/runtime';
|
|
381
|
+
import { physics, createWorld } from 'motionary/runtime/physics';
|
|
382
|
+
use(physics);
|
|
383
|
+
const world = createWorld({ gravity: [0, 980] });
|
|
384
|
+
world.bounds(600, 400);
|
|
385
|
+
const ball = world.body({ shape: 'circle', x: 300, y: 40, radius: 20, restitution: 0.7 });
|
|
386
|
+
world.run(); // steps on the shared ticker
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
### motionary/runtime/format-scene — Scene JSON (motionary-scene@1)
|
|
390
|
+
|
|
391
|
+
The versioned motionary-scene@1 format: a JSON description of a 2D physics scene (world, named materials, bodies, constraints, per-body style) — validate, migrate older drafts, load into a physics world and save one back.
|
|
392
|
+
|
|
393
|
+
- Install: `npm i motionary`
|
|
394
|
+
- Import: `motionary/runtime/format-scene`
|
|
395
|
+
- Register: `use(formatScene);` — Register the core first, then the module: use(formatScene) also registers the core. CDN: load runtime.iife.js, then runtime/format-scene.iife.js (it registers itself).
|
|
396
|
+
- CDN:
|
|
397
|
+
|
|
398
|
+
```html
|
|
399
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js"></script>
|
|
400
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/format-scene.iife.js"></script>
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
```js
|
|
404
|
+
import { use } from 'motionary/runtime';
|
|
405
|
+
import { physics } from 'motionary/runtime/physics';
|
|
406
|
+
import { formatScene, sceneToWorld } from 'motionary/runtime/format-scene';
|
|
407
|
+
use(physics, formatScene);
|
|
408
|
+
const { world, bodies } = sceneToWorld(await (await fetch('/scenes/stack.json')).json());
|
|
409
|
+
world.run();
|
|
410
|
+
```
|
|
411
|
+
|
|
365
412
|
## Components
|
|
366
413
|
|
|
367
414
|
### <usa-accordion> — Accordion
|
|
@@ -1978,6 +2025,20 @@ Morph an SVG path through a list of shapes (paths="A | B | C") on click, hover,
|
|
|
1978
2025
|
<usa-motion-prefs></usa-motion-prefs>
|
|
1979
2026
|
```
|
|
1980
2027
|
|
|
2028
|
+
### <usa-motion-prompt> — Motion prompt (text → motion)
|
|
2029
|
+
|
|
2030
|
+
10.7 (AI-assisted motion): describe a motion in English or Chinese and get a live preview plus ready code — Web Animations, CSS (with a reduced-motion guard) or a Motionary component. A small deterministic parser (motionary/components/ai), no model and no network; the same parser powers suggest_motion in motionary-mcp 2.0.
|
|
2031
|
+
|
|
2032
|
+
- Import: `import { defineMotionPrompt } from 'motionary/components/widgets'; defineMotionPrompt();`
|
|
2033
|
+
- CDN: https://unpkg.com/motionary@10/dist/widgets.umd.js
|
|
2034
|
+
- Attributes: `value`, `format`, `placeholder`, `label`
|
|
2035
|
+
- Events: `usa:suggest`, `usa:copy`
|
|
2036
|
+
- Methods: `suggest()`
|
|
2037
|
+
|
|
2038
|
+
```html
|
|
2039
|
+
<usa-motion-prompt value="fade the cards up slowly, one after another"></usa-motion-prompt>
|
|
2040
|
+
```
|
|
2041
|
+
|
|
1981
2042
|
### <usa-motion-spec> — Motion spec sheet
|
|
1982
2043
|
|
|
1983
2044
|
9.7: a motion spec sheet for design hand-off — each rule of a motion string with its trigger, a duration bar on a shared timeline and the easing curve, a Play playhead and Copy CSS; pairs with the Figma plugin and Framer export of motionary/design.
|
|
@@ -2261,6 +2322,42 @@ A canvas constellation that drifts away from the pointer. Runs only while visibl
|
|
|
2261
2322
|
<usa-perf-monitor corner="bottom-right"></usa-perf-monitor>
|
|
2262
2323
|
```
|
|
2263
2324
|
|
|
2325
|
+
### <usa-physics-playground> — Physics playground
|
|
2326
|
+
|
|
2327
|
+
10.7: a 2D rigid-body sandbox on Motionary’s own physics engine — circles, boxes and polygons, friction, restitution, constraints, sleeping — loaded from a versioned motionary-scene@1 JSON (or a preset: balls, pyramid, pendulum, dominoes). Drag bodies, tap to spawn, arrow keys nudge. Requires motionary/runtime/physics + motionary/runtime/format-scene — npm i motionary, then use(physics, formatScene) before it mounts.
|
|
2328
|
+
|
|
2329
|
+
- Import: `import { definePhysicsPlayground } from 'motionary/components/widgets'; definePhysicsPlayground();`
|
|
2330
|
+
- CDN: https://unpkg.com/motionary@10/dist/widgets.umd.js
|
|
2331
|
+
- Attributes: `preset`, `src`, `gravity`, `spawn`, `label`
|
|
2332
|
+
- Events: `usa:collision`, `usa:load`, `usa:error`, `usa:runtime-missing`
|
|
2333
|
+
- Methods: `reset()`, `play()`, `pause()`, `toScene()`
|
|
2334
|
+
- Requires: motionary/runtime/physics + motionary/runtime/format-scene
|
|
2335
|
+
- Install: `npm i motionary`
|
|
2336
|
+
- Order: Register the core first, then the module: use(physics) also registers the core. CDN: load runtime.iife.js, then runtime/physics.iife.js (it registers itself). Register the core first, then the module: use(formatScene) also registers the core. CDN: load runtime.iife.js, then runtime/format-scene.iife.js (it registers itself).
|
|
2337
|
+
|
|
2338
|
+
```js
|
|
2339
|
+
import { use } from 'motionary/runtime';
|
|
2340
|
+
import { physics } from 'motionary/runtime/physics';
|
|
2341
|
+
import { formatScene } from 'motionary/runtime/format-scene';
|
|
2342
|
+
import { definePhysicsPlayground } from 'motionary/components/widgets';
|
|
2343
|
+
|
|
2344
|
+
use(physics, formatScene);
|
|
2345
|
+
definePhysicsPlayground(); // registers <usa-physics-playground> — after the prerequisites
|
|
2346
|
+
```
|
|
2347
|
+
|
|
2348
|
+
```html
|
|
2349
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js"></script>
|
|
2350
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/physics.iife.js"></script>
|
|
2351
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/format-scene.iife.js"></script>
|
|
2352
|
+
<!-- then the component bundles -->
|
|
2353
|
+
<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>
|
|
2354
|
+
<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>
|
|
2355
|
+
```
|
|
2356
|
+
|
|
2357
|
+
```html
|
|
2358
|
+
<usa-physics-playground preset="pyramid" spawn label="Knock the pyramid over"></usa-physics-playground>
|
|
2359
|
+
```
|
|
2360
|
+
|
|
2264
2361
|
### <usa-pinch-zoom> — Pinch zoom
|
|
2265
2362
|
|
|
2266
2363
|
Pinch with two fingers or Ctrl + wheel / trackpad pinch, pan while zoomed, double-tap to toggle; scale and position spring back inside the bounds.
|
package/dist/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Motionary 10.
|
|
1
|
+
# Motionary 10.7.0
|
|
2
2
|
|
|
3
|
-
> Motionary is a zero-dependency motion library: scroll animations, 200+ presets and
|
|
3
|
+
> Motionary is a zero-dependency motion library: scroll animations, 200+ presets and 207 animated Web Components (<usa-*>) that work in plain HTML and every framework, plus motionary/runtime — its own tween/timeline engine and format loaders.
|
|
4
4
|
|
|
5
5
|
Install: `npm i motionary` · CDN: https://unpkg.com/motionary@10/dist/components.umd.js (+ https://unpkg.com/motionary@10/dist/widgets.umd.js for 6.x+ widgets) · Manifest: https://harrisoncn.github.io/Motionary/components.json · Full text: https://harrisoncn.github.io/Motionary/llms-full.txt
|
|
6
6
|
|
|
@@ -24,6 +24,8 @@ Rules for using a component: (1) import its define function from `import.path` a
|
|
|
24
24
|
- [motionary/runtime/format-obj](https://github.com/HarrisonCN/Motionary/blob/main/docs/runtime/format-obj.md): Load Wavefront OBJ (+ MTL materials and diffuse textures) into motionary/runtime/gl nodes: polygons triangulated, groups, per-material meshes.
|
|
25
25
|
- [motionary/runtime/vector](https://github.com/HarrisonCN/Motionary/blob/main/docs/runtime/vector.md): Plays Lottie (bodymovin JSON) and dotLottie (.lottie) files on Canvas 2D with Motionary’s own renderer (no lottie-web code): shapes, gradients, trim paths, masks, track mattes, precomps, images; a runtime timeline you can seek, reverse and scrub.
|
|
26
26
|
- [@rive-app/canvas](https://github.com/HarrisonCN/Motionary/blob/main/docs/runtime/rive.md): The official MIT-licensed Rive runtime, used by <usa-rive> to play .riv files (artboards, animations, state machines with inputs). Optional peer dependency: lazy-loaded on first use, never bundled into Motionary.
|
|
27
|
+
- [motionary/runtime/physics](https://github.com/HarrisonCN/Motionary/blob/main/docs/runtime/physics.md): A small 2D rigid-body engine written for Motionary (own implementation and API — no Matter.js / Box2D code): circles, boxes and convex polygons, mass from density, restitution, friction, sensors, collision groups, sleeping, distance / spring / pin constraints, pointer drag, a fixed time step on the shared ticker.
|
|
28
|
+
- [motionary/runtime/format-scene](https://github.com/HarrisonCN/Motionary/blob/main/docs/runtime/format-scene.md): The versioned motionary-scene@1 format: a JSON description of a 2D physics scene (world, named materials, bodies, constraints, per-body style) — validate, migrate older drafts, load into a physics world and save one back.
|
|
27
29
|
|
|
28
30
|
## Components
|
|
29
31
|
|
|
@@ -129,6 +131,7 @@ Rules for using a component: (1) import its define function from `import.path` a
|
|
|
129
131
|
- `<usa-motion>` (motionary/components/widgets): 9.0: the declarative motion DSL — describe motion as one readable string (“enter: fade-up 600ms stagger 80ms; hover: pop”) on <usa-motion> or any element’s data
|
|
130
132
|
- `<usa-motion-inspector>` (motionary/components/widgets): 10.2: a live panel listing the running animations in a scope (CSS animations, transitions, element.animate(), components) with state and progress, plus the moti
|
|
131
133
|
- `<usa-motion-prefs>` (motionary/components/widgets): 9.5: a motion settings panel for your users — motion level (full, gentle, minimal, none), animation speed, pause autoplaying video, no parallax — applied instan
|
|
134
|
+
- `<usa-motion-prompt>` (motionary/components/widgets): 10.7 (AI-assisted motion): describe a motion in English or Chinese and get a live preview plus ready code — Web Animations, CSS (with a reduced-motion guard) or
|
|
132
135
|
- `<usa-motion-spec>` (motionary/components/widgets): 9.7: a motion spec sheet for design hand-off — each rule of a motion string with its trigger, a duration bar on a shared timeline and the easing curve, a Play p
|
|
133
136
|
- `<usa-motion-switch>` (motionary/components/page): Let users pick Off · Low · Normal · High for the whole app; scales every component, persists, and Off equals reduced motion.
|
|
134
137
|
- `<usa-motion-theme>` (motionary/components/effects): 5.8: <usa-motion-theme name> applies a theme pack — design tokens (--usa-theme-*), motion tokens and effect presets per role (enter / hover / click / attention
|
|
@@ -148,6 +151,7 @@ Rules for using a component: (1) import its define function from `import.path` a
|
|
|
148
151
|
- `<usa-particles>` (motionary/components/background): A canvas constellation that drifts away from the pointer. Runs only while visible, DPR ≤ 2, a still frame under reduced motion.
|
|
149
152
|
- `<usa-pause-all>` (motionary/components/widgets): 9.5: one button that pauses all motion on the page (WCAG 2.2.2) — Motionary’s shared clock, every CSS / Web animation and autoplaying media — and resumes it aga
|
|
150
153
|
- `<usa-perf-monitor>` (motionary/components/widgets): 9.6: a live performance overlay for motion work — FPS with a sparkline, active Motionary animations, frame-loop callbacks, long tasks and the shared clock — fla
|
|
154
|
+
- `<usa-physics-playground>` (motionary/components/widgets; requires motionary/runtime/physics + motionary/runtime/format-scene): 10.7: a 2D rigid-body sandbox on Motionary’s own physics engine — circles, boxes and polygons, friction, restitution, constraints, sleeping — loaded from a vers
|
|
151
155
|
- `<usa-pinch-zoom>` (motionary/components/gesture): Pinch with two fingers or Ctrl + wheel / trackpad pinch, pan while zoomed, double-tap to toggle; scale and position spring back inside the bounds.
|
|
152
156
|
- `<usa-player>` (motionary/components/effects): 5.9: <usa-player> plays a JSON animation — timeline presets, your own keyframes and any registered effect on a shared clock; play / pause / seek / rate / loop,
|
|
153
157
|
- `<usa-plugin-card>` (motionary/components/widgets; requires motionary/runtime): 10.1: a plugin’s name, version and author with a Motionary compatibility badge (semver `engine` range), a signature badge (SHA-256 integrity checked with Web Cr
|
package/dist/manifest.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"format": "motionary/components",
|
|
4
4
|
"schemaVersion": 1,
|
|
5
5
|
"package": "motionary",
|
|
6
|
-
"version": "10.
|
|
6
|
+
"version": "10.7.0",
|
|
7
7
|
"homepage": "https://harrisoncn.github.io/Motionary/",
|
|
8
8
|
"llms": "https://harrisoncn.github.io/Motionary/llms.txt",
|
|
9
9
|
"cdn": {
|
|
@@ -1145,6 +1145,137 @@
|
|
|
1145
1145
|
]
|
|
1146
1146
|
],
|
|
1147
1147
|
"example": "// npm i @rive-app/canvas\nimport { defineRive } from 'motionary/components/widgets';\ndefineRive();\n// <usa-rive src=\"/anim/icon.riv\" state-machine=\"State Machine 1\" autoplay></usa-rive>"
|
|
1148
|
+
},
|
|
1149
|
+
{
|
|
1150
|
+
"kind": "runtime",
|
|
1151
|
+
"id": "physics",
|
|
1152
|
+
"label": "motionary/runtime/physics",
|
|
1153
|
+
"title": "2D rigid-body physics",
|
|
1154
|
+
"summary": "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.",
|
|
1155
|
+
"install": "npm i motionary",
|
|
1156
|
+
"importPath": "motionary/runtime/physics",
|
|
1157
|
+
"import": "import { use } from 'motionary/runtime';\nimport { physics } from 'motionary/runtime/physics';",
|
|
1158
|
+
"register": "use(physics);",
|
|
1159
|
+
"cdn": "<script src=\"https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js\"></script>\n<script src=\"https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/physics.iife.js\"></script>",
|
|
1160
|
+
"cdnEsm": "https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/physics.js",
|
|
1161
|
+
"order": "Register the core first, then the module: use(physics) also registers the core. CDN: load runtime.iife.js, then runtime/physics.iife.js (it registers itself).",
|
|
1162
|
+
"docs": "docs/runtime/physics.md",
|
|
1163
|
+
"budget": 10240,
|
|
1164
|
+
"exports": [
|
|
1165
|
+
"physics",
|
|
1166
|
+
"createWorld",
|
|
1167
|
+
"World",
|
|
1168
|
+
"Body",
|
|
1169
|
+
"Constraint",
|
|
1170
|
+
"collide",
|
|
1171
|
+
"dragConstraint"
|
|
1172
|
+
],
|
|
1173
|
+
"compat": [
|
|
1174
|
+
[
|
|
1175
|
+
"bodies: circle, box, convex polygon (any winding, made convex)",
|
|
1176
|
+
"yes",
|
|
1177
|
+
"concave shapes: split them into convex parts"
|
|
1178
|
+
],
|
|
1179
|
+
[
|
|
1180
|
+
"static, dynamic and kinematic bodies; density / mass, inertia, fixed rotation",
|
|
1181
|
+
"yes",
|
|
1182
|
+
""
|
|
1183
|
+
],
|
|
1184
|
+
[
|
|
1185
|
+
"collisions: sort-and-sweep broad phase, SAT narrow phase, up to 2 contact points",
|
|
1186
|
+
"yes",
|
|
1187
|
+
"no continuous collision detection: very fast small bodies can tunnel"
|
|
1188
|
+
],
|
|
1189
|
+
[
|
|
1190
|
+
"restitution, Coulomb friction, warm-started accumulated impulses",
|
|
1191
|
+
"yes",
|
|
1192
|
+
""
|
|
1193
|
+
],
|
|
1194
|
+
[
|
|
1195
|
+
"constraints: distance (rigid or spring with stiffness / damping), pin, pointer drag",
|
|
1196
|
+
"yes",
|
|
1197
|
+
"no revolute motors / joint limits"
|
|
1198
|
+
],
|
|
1199
|
+
[
|
|
1200
|
+
"sensors, collision categories / masks, collision events, sleeping",
|
|
1201
|
+
"yes",
|
|
1202
|
+
""
|
|
1203
|
+
],
|
|
1204
|
+
[
|
|
1205
|
+
"fixed time step + accumulator (same result at any frame rate)",
|
|
1206
|
+
"yes",
|
|
1207
|
+
""
|
|
1208
|
+
],
|
|
1209
|
+
[
|
|
1210
|
+
"SSR / workers",
|
|
1211
|
+
"yes",
|
|
1212
|
+
"pure maths; world.run() needs the runtime ticker"
|
|
1213
|
+
]
|
|
1214
|
+
],
|
|
1215
|
+
"example": "import { use } from 'motionary/runtime';\nimport { physics, createWorld } from 'motionary/runtime/physics';\nuse(physics);\nconst world = createWorld({ gravity: [0, 980] });\nworld.bounds(600, 400);\nconst ball = world.body({ shape: 'circle', x: 300, y: 40, radius: 20, restitution: 0.7 });\nworld.run(); // steps on the shared ticker"
|
|
1216
|
+
},
|
|
1217
|
+
{
|
|
1218
|
+
"kind": "runtime",
|
|
1219
|
+
"id": "format-scene",
|
|
1220
|
+
"label": "motionary/runtime/format-scene",
|
|
1221
|
+
"title": "Scene JSON (motionary-scene@1)",
|
|
1222
|
+
"summary": "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.",
|
|
1223
|
+
"install": "npm i motionary",
|
|
1224
|
+
"importPath": "motionary/runtime/format-scene",
|
|
1225
|
+
"import": "import { use } from 'motionary/runtime';\nimport { formatScene } from 'motionary/runtime/format-scene';",
|
|
1226
|
+
"register": "use(formatScene);",
|
|
1227
|
+
"cdn": "<script src=\"https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js\"></script>\n<script src=\"https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/format-scene.iife.js\"></script>",
|
|
1228
|
+
"cdnEsm": "https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/format-scene.js",
|
|
1229
|
+
"order": "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).",
|
|
1230
|
+
"docs": "docs/runtime/format-scene.md",
|
|
1231
|
+
"budget": 3072,
|
|
1232
|
+
"exports": [
|
|
1233
|
+
"formatScene",
|
|
1234
|
+
"SCENE_FORMAT",
|
|
1235
|
+
"migrateScene",
|
|
1236
|
+
"validateScene",
|
|
1237
|
+
"parseScene",
|
|
1238
|
+
"sceneToWorld",
|
|
1239
|
+
"worldToScene"
|
|
1240
|
+
],
|
|
1241
|
+
"compat": [
|
|
1242
|
+
[
|
|
1243
|
+
"world: size, gravity, walls (with or without a top), solver iterations",
|
|
1244
|
+
"yes",
|
|
1245
|
+
""
|
|
1246
|
+
],
|
|
1247
|
+
[
|
|
1248
|
+
"named materials (restitution, friction, density), per-body overrides",
|
|
1249
|
+
"yes",
|
|
1250
|
+
""
|
|
1251
|
+
],
|
|
1252
|
+
[
|
|
1253
|
+
"bodies: circle / box / polygon, static / kinematic, velocity, angle, sensor, style",
|
|
1254
|
+
"yes",
|
|
1255
|
+
""
|
|
1256
|
+
],
|
|
1257
|
+
[
|
|
1258
|
+
"constraints: distance / spring / pin between bodies or to a world point",
|
|
1259
|
+
"yes",
|
|
1260
|
+
""
|
|
1261
|
+
],
|
|
1262
|
+
[
|
|
1263
|
+
"validation (lists every problem, never throws) + parseScene (throws one error)",
|
|
1264
|
+
"yes",
|
|
1265
|
+
""
|
|
1266
|
+
],
|
|
1267
|
+
[
|
|
1268
|
+
"migration: unversioned scenes and the motionary-scene@0 draft → @1, with a change list",
|
|
1269
|
+
"yes",
|
|
1270
|
+
""
|
|
1271
|
+
],
|
|
1272
|
+
[
|
|
1273
|
+
"save: worldToScene() (walls made by bounds() are left out)",
|
|
1274
|
+
"yes",
|
|
1275
|
+
""
|
|
1276
|
+
]
|
|
1277
|
+
],
|
|
1278
|
+
"example": "import { use } from 'motionary/runtime';\nimport { physics } from 'motionary/runtime/physics';\nimport { formatScene, sceneToWorld } from 'motionary/runtime/format-scene';\nuse(physics, formatScene);\nconst { world, bodies } = sceneToWorld(await (await fetch('/scenes/stack.json')).json());\nworld.run();"
|
|
1148
1279
|
}
|
|
1149
1280
|
],
|
|
1150
1281
|
"components": [
|
|
@@ -5374,6 +5505,47 @@
|
|
|
5374
5505
|
"prerequisites": null,
|
|
5375
5506
|
"source": "src/components/widgets/motion-prefs.ts"
|
|
5376
5507
|
},
|
|
5508
|
+
{
|
|
5509
|
+
"id": "motion-prompt",
|
|
5510
|
+
"tag": "usa-motion-prompt",
|
|
5511
|
+
"title": "Motion prompt (text → motion)",
|
|
5512
|
+
"description": "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.",
|
|
5513
|
+
"category": "ui",
|
|
5514
|
+
"since": "10.7",
|
|
5515
|
+
"keywords": [
|
|
5516
|
+
"ai",
|
|
5517
|
+
"natural language",
|
|
5518
|
+
"prompt",
|
|
5519
|
+
"motion spec",
|
|
5520
|
+
"code generator",
|
|
5521
|
+
"mcp"
|
|
5522
|
+
],
|
|
5523
|
+
"import": {
|
|
5524
|
+
"path": "motionary/components/widgets",
|
|
5525
|
+
"define": "defineMotionPrompt",
|
|
5526
|
+
"register": "defineMotionPrompt();"
|
|
5527
|
+
},
|
|
5528
|
+
"cdn": "https://unpkg.com/motionary@10/dist/widgets.umd.js",
|
|
5529
|
+
"attributes": [
|
|
5530
|
+
"value",
|
|
5531
|
+
"format",
|
|
5532
|
+
"placeholder",
|
|
5533
|
+
"label"
|
|
5534
|
+
],
|
|
5535
|
+
"events": [
|
|
5536
|
+
"usa:suggest",
|
|
5537
|
+
"usa:copy"
|
|
5538
|
+
],
|
|
5539
|
+
"slots": [],
|
|
5540
|
+
"methods": [
|
|
5541
|
+
"suggest"
|
|
5542
|
+
],
|
|
5543
|
+
"example": "<usa-motion-prompt value=\"fade the cards up slowly, one after another\"></usa-motion-prompt>",
|
|
5544
|
+
"esm": "import { defineMotionPrompt } from 'motionary/components/widgets';\n\ndefineMotionPrompt(); // registers <usa-motion-prompt>\n\n/* then use it in your HTML:\n<usa-motion-prompt value=\"fade the cards up slowly, one after another\"></usa-motion-prompt>\n*/",
|
|
5545
|
+
"requires": [],
|
|
5546
|
+
"prerequisites": null,
|
|
5547
|
+
"source": "src/components/widgets/motion-prompt.ts"
|
|
5548
|
+
},
|
|
5377
5549
|
{
|
|
5378
5550
|
"id": "motion-spec",
|
|
5379
5551
|
"tag": "usa-motion-spec",
|
|
@@ -6089,6 +6261,71 @@
|
|
|
6089
6261
|
"prerequisites": null,
|
|
6090
6262
|
"source": "src/components/widgets/perf-monitor.ts"
|
|
6091
6263
|
},
|
|
6264
|
+
{
|
|
6265
|
+
"id": "physics-playground",
|
|
6266
|
+
"tag": "usa-physics-playground",
|
|
6267
|
+
"title": "Physics playground",
|
|
6268
|
+
"description": "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.",
|
|
6269
|
+
"category": "ui",
|
|
6270
|
+
"since": "10.7",
|
|
6271
|
+
"keywords": [
|
|
6272
|
+
"physics",
|
|
6273
|
+
"rigid body",
|
|
6274
|
+
"gravity",
|
|
6275
|
+
"collision",
|
|
6276
|
+
"scene json",
|
|
6277
|
+
"runtime"
|
|
6278
|
+
],
|
|
6279
|
+
"import": {
|
|
6280
|
+
"path": "motionary/components/widgets",
|
|
6281
|
+
"define": "definePhysicsPlayground",
|
|
6282
|
+
"register": "definePhysicsPlayground();"
|
|
6283
|
+
},
|
|
6284
|
+
"cdn": "https://unpkg.com/motionary@10/dist/widgets.umd.js",
|
|
6285
|
+
"attributes": [
|
|
6286
|
+
"preset",
|
|
6287
|
+
"src",
|
|
6288
|
+
"gravity",
|
|
6289
|
+
"spawn",
|
|
6290
|
+
"label"
|
|
6291
|
+
],
|
|
6292
|
+
"events": [
|
|
6293
|
+
"usa:collision",
|
|
6294
|
+
"usa:load",
|
|
6295
|
+
"usa:error",
|
|
6296
|
+
"usa:runtime-missing"
|
|
6297
|
+
],
|
|
6298
|
+
"slots": [],
|
|
6299
|
+
"methods": [
|
|
6300
|
+
"reset",
|
|
6301
|
+
"play",
|
|
6302
|
+
"pause",
|
|
6303
|
+
"toScene"
|
|
6304
|
+
],
|
|
6305
|
+
"example": "<usa-physics-playground preset=\"pyramid\" spawn label=\"Knock the pyramid over\"></usa-physics-playground>",
|
|
6306
|
+
"esm": "import { use } from 'motionary/runtime';\nimport { physics } from 'motionary/runtime/physics';\nimport { formatScene } from 'motionary/runtime/format-scene';\n\nuse(physics, formatScene);\nimport { definePhysicsPlayground } from 'motionary/components/widgets';\n\ndefinePhysicsPlayground(); // registers <usa-physics-playground>\n\n/* then use it in your HTML:\n<usa-physics-playground preset=\"pyramid\" spawn label=\"Knock the pyramid over\"></usa-physics-playground>\n*/",
|
|
6307
|
+
"requires": [
|
|
6308
|
+
"physics",
|
|
6309
|
+
"format-scene"
|
|
6310
|
+
],
|
|
6311
|
+
"prerequisites": {
|
|
6312
|
+
"badge": "Requires: motionary/runtime/physics + motionary/runtime/format-scene",
|
|
6313
|
+
"modules": [
|
|
6314
|
+
"motionary/runtime/physics",
|
|
6315
|
+
"motionary/runtime/format-scene"
|
|
6316
|
+
],
|
|
6317
|
+
"install": "npm i motionary",
|
|
6318
|
+
"importAndRegister": "import { use } from 'motionary/runtime';\nimport { physics } from 'motionary/runtime/physics';\nimport { formatScene } from 'motionary/runtime/format-scene';\nimport { definePhysicsPlayground } from 'motionary/components/widgets';\n\nuse(physics, formatScene);\ndefinePhysicsPlayground(); // registers <usa-physics-playground> — after the prerequisites",
|
|
6319
|
+
"order": "Register the core first, then the module: use(physics) also registers the core. CDN: load runtime.iife.js, then runtime/physics.iife.js (it registers itself). Register the core first, then the module: use(formatScene) also registers the core. CDN: load runtime.iife.js, then runtime/format-scene.iife.js (it registers itself).",
|
|
6320
|
+
"cdn": "<script src=\"https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js\"></script>\n<script src=\"https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/physics.iife.js\"></script>\n<script src=\"https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/format-scene.iife.js\"></script>\n<!-- then the component bundles -->\n<script src=\"https://unpkg.com/motionary@10/dist/components.umd.js\"></script>\n<script src=\"https://unpkg.com/motionary@10/dist/widgets.umd.js\"></script>",
|
|
6321
|
+
"example": "<usa-physics-playground preset=\"pyramid\" spawn label=\"Knock the pyramid over\"></usa-physics-playground>",
|
|
6322
|
+
"docs": [
|
|
6323
|
+
"https://github.com/HarrisonCN/Motionary/blob/main/docs/runtime/physics.md",
|
|
6324
|
+
"https://github.com/HarrisonCN/Motionary/blob/main/docs/runtime/format-scene.md"
|
|
6325
|
+
]
|
|
6326
|
+
},
|
|
6327
|
+
"source": "src/components/widgets/physics-playground.ts"
|
|
6328
|
+
},
|
|
6092
6329
|
{
|
|
6093
6330
|
"id": "pinch-zoom",
|
|
6094
6331
|
"tag": "usa-pinch-zoom",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var registry = require('../chunks/registry-
|
|
4
|
-
var animImage = require('../chunks/anim-image-
|
|
5
|
-
require('../chunks/tween-
|
|
6
|
-
require('../chunks/ticker-
|
|
3
|
+
var registry = require('../chunks/registry-DhKZCitb.cjs');
|
|
4
|
+
var animImage = require('../chunks/anim-image-CFGpUX7t.cjs');
|
|
5
|
+
require('../chunks/tween-Dk0QmNe9.cjs');
|
|
6
|
+
require('../chunks/ticker-jD9_A9Rh.cjs');
|
|
7
7
|
require('../chunks/ease-HwYZnZat.cjs');
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { R as RUNTIME_VERSION } from '../chunks/registry-
|
|
2
|
-
import { a as animatedImagePlayer, b as browserDecode, c as composeFrames, d as bytesOf, u as u8, f as fixDelay, e as crc32 } from '../chunks/anim-image-
|
|
3
|
-
import '../chunks/tween-
|
|
4
|
-
import '../chunks/ticker-
|
|
1
|
+
import { R as RUNTIME_VERSION } from '../chunks/registry-D87dP_aR.js';
|
|
2
|
+
import { a as animatedImagePlayer, b as browserDecode, c as composeFrames, d as bytesOf, u as u8, f as fixDelay, e as crc32 } from '../chunks/anim-image-CXDD19FH.js';
|
|
3
|
+
import '../chunks/tween-_Lld1MsF.js';
|
|
4
|
+
import '../chunks/ticker-CJYI5Pxc.js';
|
|
5
5
|
import '../chunks/ease-XN8_0sXu.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var registry = require('../chunks/registry-
|
|
4
|
-
var keyframes = require('../chunks/keyframes-
|
|
5
|
-
require('../chunks/tween-
|
|
6
|
-
require('../chunks/ticker-
|
|
3
|
+
var registry = require('../chunks/registry-DhKZCitb.cjs');
|
|
4
|
+
var keyframes = require('../chunks/keyframes-DdwGY1gr.cjs');
|
|
5
|
+
require('../chunks/tween-Dk0QmNe9.cjs');
|
|
6
|
+
require('../chunks/ticker-jD9_A9Rh.cjs');
|
|
7
7
|
require('../chunks/ease-HwYZnZat.cjs');
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { R as RUNTIME_VERSION } from '../chunks/registry-
|
|
2
|
-
import { f as framesToTimeline, d as distributeOffsets, c as camelProp } from '../chunks/keyframes-
|
|
3
|
-
import '../chunks/tween-
|
|
4
|
-
import '../chunks/ticker-
|
|
1
|
+
import { R as RUNTIME_VERSION } from '../chunks/registry-D87dP_aR.js';
|
|
2
|
+
import { f as framesToTimeline, d as distributeOffsets, c as camelProp } from '../chunks/keyframes-DwR6GPej.js';
|
|
3
|
+
import '../chunks/tween-_Lld1MsF.js';
|
|
4
|
+
import '../chunks/ticker-CJYI5Pxc.js';
|
|
5
5
|
import '../chunks/ease-XN8_0sXu.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var registry = require('../chunks/registry-
|
|
4
|
-
var animImage = require('../chunks/anim-image-
|
|
5
|
-
require('../chunks/tween-
|
|
6
|
-
require('../chunks/ticker-
|
|
3
|
+
var registry = require('../chunks/registry-DhKZCitb.cjs');
|
|
4
|
+
var animImage = require('../chunks/anim-image-CFGpUX7t.cjs');
|
|
5
|
+
require('../chunks/tween-Dk0QmNe9.cjs');
|
|
6
|
+
require('../chunks/ticker-jD9_A9Rh.cjs');
|
|
7
7
|
require('../chunks/ease-HwYZnZat.cjs');
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { R as RUNTIME_VERSION } from '../chunks/registry-
|
|
2
|
-
import { a as animatedImagePlayer, u as u8, c as composeFrames, d as bytesOf, f as fixDelay } from '../chunks/anim-image-
|
|
3
|
-
import '../chunks/tween-
|
|
4
|
-
import '../chunks/ticker-
|
|
1
|
+
import { R as RUNTIME_VERSION } from '../chunks/registry-D87dP_aR.js';
|
|
2
|
+
import { a as animatedImagePlayer, u as u8, c as composeFrames, d as bytesOf, f as fixDelay } from '../chunks/anim-image-CXDD19FH.js';
|
|
3
|
+
import '../chunks/tween-_Lld1MsF.js';
|
|
4
|
+
import '../chunks/ticker-CJYI5Pxc.js';
|
|
5
5
|
import '../chunks/ease-XN8_0sXu.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var registry = require('../chunks/registry-
|
|
4
|
-
var tween = require('../chunks/tween-
|
|
3
|
+
var registry = require('../chunks/registry-DhKZCitb.cjs');
|
|
4
|
+
var tween = require('../chunks/tween-Dk0QmNe9.cjs');
|
|
5
5
|
var ease = require('../chunks/ease-HwYZnZat.cjs');
|
|
6
|
-
var keyframes = require('../chunks/keyframes-
|
|
7
|
-
require('../chunks/ticker-
|
|
6
|
+
var keyframes = require('../chunks/keyframes-DdwGY1gr.cjs');
|
|
7
|
+
require('../chunks/ticker-jD9_A9Rh.cjs');
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* `motionary/runtime/format-motion` (10.1) — play Motion / Framer-style
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { R as RUNTIME_VERSION } from '../chunks/registry-
|
|
2
|
-
import { T as Timeline } from '../chunks/tween-
|
|
1
|
+
import { R as RUNTIME_VERSION } from '../chunks/registry-D87dP_aR.js';
|
|
2
|
+
import { T as Timeline } from '../chunks/tween-_Lld1MsF.js';
|
|
3
3
|
import { c as cubicBezier, E as EASES } from '../chunks/ease-XN8_0sXu.js';
|
|
4
|
-
import { f as framesToTimeline } from '../chunks/keyframes-
|
|
5
|
-
import '../chunks/ticker-
|
|
4
|
+
import { f as framesToTimeline } from '../chunks/keyframes-DwR6GPej.js';
|
|
5
|
+
import '../chunks/ticker-CJYI5Pxc.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* `motionary/runtime/format-motion` (10.1) — play Motion / Framer-style
|