motionary 10.1.0 → 10.3.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 +61 -0
- package/CHANGELOG.md +36 -0
- package/README.md +69 -0
- package/dist/chunks/{keyframes-CyH_abhI.js → keyframes-DVAC5sQI.js} +2 -2
- package/dist/chunks/{keyframes-CyH_abhI.js.map → keyframes-DVAC5sQI.js.map} +1 -1
- package/dist/chunks/{keyframes-cUdsXSXQ.cjs → keyframes-Dw9zwVQa.cjs} +2 -2
- package/dist/chunks/{keyframes-cUdsXSXQ.cjs.map → keyframes-Dw9zwVQa.cjs.map} +1 -1
- package/dist/chunks/{registry-jF8VIA_9.js → registry-46AAzyeC.js} +2 -2
- package/dist/chunks/{registry-jF8VIA_9.js.map → registry-46AAzyeC.js.map} +1 -1
- package/dist/chunks/{registry-C0xLNq3-.cjs → registry-CSVil2qJ.cjs} +2 -2
- package/dist/chunks/{registry-C0xLNq3-.cjs.map → registry-CSVil2qJ.cjs.map} +1 -1
- package/dist/chunks/ticker-COOYAyQy.js +70 -0
- package/dist/chunks/ticker-COOYAyQy.js.map +1 -0
- package/dist/chunks/ticker-gHv6pNfx.cjs +72 -0
- package/dist/chunks/ticker-gHv6pNfx.cjs.map +1 -0
- package/dist/chunks/{tween-JEthWrjo.cjs → tween-CFN0WcOb.cjs} +16 -73
- package/dist/chunks/tween-CFN0WcOb.cjs.map +1 -0
- package/dist/chunks/{tween-DDObu9iA.js → tween-CGyolmzB.js} +16 -72
- package/dist/chunks/tween-CGyolmzB.js.map +1 -0
- package/dist/components/core.cjs +106 -0
- package/dist/components/core.cjs.map +1 -1
- package/dist/components/core.d.cts +44 -2
- package/dist/components/core.d.ts +44 -2
- package/dist/components/core.js +105 -1
- package/dist/components/core.js.map +1 -1
- package/dist/components/widgets.cjs +602 -198
- package/dist/components/widgets.cjs.map +1 -1
- package/dist/components/widgets.d.cts +186 -2
- package/dist/components/widgets.d.ts +186 -2
- package/dist/components/widgets.js +598 -199
- package/dist/components/widgets.js.map +1 -1
- package/dist/llms-full.txt +194 -1
- package/dist/llms.txt +10 -2
- package/dist/manifest.json +492 -1
- package/dist/runtime/format-css.cjs +4 -3
- package/dist/runtime/format-css.cjs.map +1 -1
- package/dist/runtime/format-css.js +4 -3
- package/dist/runtime/format-css.js.map +1 -1
- package/dist/runtime/format-motion.cjs +4 -3
- package/dist/runtime/format-motion.cjs.map +1 -1
- package/dist/runtime/format-motion.js +4 -3
- package/dist/runtime/format-motion.js.map +1 -1
- package/dist/runtime/format-sprite.cjs +225 -0
- package/dist/runtime/format-sprite.cjs.map +1 -0
- package/dist/runtime/format-sprite.d.cts +224 -0
- package/dist/runtime/format-sprite.d.ts +224 -0
- package/dist/runtime/format-sprite.iife.js +2 -0
- package/dist/runtime/format-sprite.iife.js.map +1 -0
- package/dist/runtime/format-sprite.js +215 -0
- package/dist/runtime/format-sprite.js.map +1 -0
- package/dist/runtime/format-svg.cjs +457 -0
- package/dist/runtime/format-svg.cjs.map +1 -0
- package/dist/runtime/format-svg.d.cts +214 -0
- package/dist/runtime/format-svg.d.ts +214 -0
- package/dist/runtime/format-svg.iife.js +2 -0
- package/dist/runtime/format-svg.iife.js.map +1 -0
- package/dist/runtime/format-svg.js +446 -0
- package/dist/runtime/format-svg.js.map +1 -0
- package/dist/runtime/scroll.cjs +301 -0
- package/dist/runtime/scroll.cjs.map +1 -0
- package/dist/runtime/scroll.d.cts +236 -0
- package/dist/runtime/scroll.d.ts +236 -0
- package/dist/runtime/scroll.iife.js +2 -0
- package/dist/runtime/scroll.iife.js.map +1 -0
- package/dist/runtime/scroll.js +292 -0
- package/dist/runtime/scroll.js.map +1 -0
- package/dist/runtime/text.cjs +147 -0
- package/dist/runtime/text.cjs.map +1 -0
- package/dist/runtime/text.d.cts +65 -0
- package/dist/runtime/text.d.ts +65 -0
- package/dist/runtime/text.iife.js +2 -0
- package/dist/runtime/text.iife.js.map +1 -0
- package/dist/runtime/text.js +143 -0
- package/dist/runtime/text.js.map +1 -0
- package/dist/runtime.cjs +5 -4
- package/dist/runtime.cjs.map +1 -1
- package/dist/runtime.d.cts +9 -2
- package/dist/runtime.d.ts +9 -2
- package/dist/runtime.iife.js +1 -1
- package/dist/runtime.iife.js.map +1 -1
- package/dist/runtime.js +5 -4
- package/dist/runtime.js.map +1 -1
- package/dist/widgets.umd.js +1 -1
- package/dist/widgets.umd.js.map +1 -1
- package/docs/ROADMAP.md +2 -2
- package/docs/ai-prompt-guide.md +54 -0
- package/docs/components/README.md +255 -0
- package/docs/components/usa-accordion.md +38 -0
- package/docs/components/usa-acrylic.md +38 -0
- package/docs/components/usa-add-to-cart.md +40 -0
- package/docs/components/usa-ambient.md +32 -0
- package/docs/components/usa-anim-icon.md +34 -0
- package/docs/components/usa-audio.md +38 -0
- package/docs/components/usa-aurora.md +36 -0
- package/docs/components/usa-auto-animate.md +44 -0
- package/docs/components/usa-auto-skeleton.md +38 -0
- package/docs/components/usa-avatar-stack.md +38 -0
- package/docs/components/usa-back-to-top.md +32 -0
- package/docs/components/usa-badge-wall.md +39 -0
- package/docs/components/usa-badge.md +36 -0
- package/docs/components/usa-bar-chart.md +33 -0
- package/docs/components/usa-bg-generator.md +32 -0
- package/docs/components/usa-blobs.md +32 -0
- package/docs/components/usa-bottom-sheet.md +32 -0
- package/docs/components/usa-button.md +78 -0
- package/docs/components/usa-card-stack.md +40 -0
- package/docs/components/usa-card.md +94 -0
- package/docs/components/usa-carousel-3d.md +40 -0
- package/docs/components/usa-carousel.md +40 -0
- package/docs/components/usa-cart-drawer.md +33 -0
- package/docs/components/usa-chapter-nav.md +40 -0
- package/docs/components/usa-chat-composer.md +33 -0
- package/docs/components/usa-check.md +32 -0
- package/docs/components/usa-checkbox.md +32 -0
- package/docs/components/usa-click.md +36 -0
- package/docs/components/usa-clock-control.md +37 -0
- package/docs/components/usa-code-export.md +36 -0
- package/docs/components/usa-color-picker.md +32 -0
- package/docs/components/usa-command-palette.md +39 -0
- package/docs/components/usa-compare.md +38 -0
- package/docs/components/usa-countdown.md +32 -0
- package/docs/components/usa-counter.md +32 -0
- package/docs/components/usa-cube-gallery.md +40 -0
- package/docs/components/usa-cube.md +36 -0
- package/docs/components/usa-cursor.md +32 -0
- package/docs/components/usa-date-picker.md +32 -0
- package/docs/components/usa-depth.md +44 -0
- package/docs/components/usa-dialog.md +40 -0
- package/docs/components/usa-disclosure.md +38 -0
- package/docs/components/usa-distort.md +36 -0
- package/docs/components/usa-dock.md +40 -0
- package/docs/components/usa-dot-network.md +32 -0
- package/docs/components/usa-double-tap.md +36 -0
- package/docs/components/usa-draggable.md +38 -0
- package/docs/components/usa-draw.md +36 -0
- package/docs/components/usa-drawer.md +34 -0
- package/docs/components/usa-equalizer.md +33 -0
- package/docs/components/usa-fab.md +40 -0
- package/docs/components/usa-festival-banner.md +32 -0
- package/docs/components/usa-field.md +34 -0
- package/docs/components/usa-file-drop.md +35 -0
- package/docs/components/usa-fullpage.md +38 -0
- package/docs/components/usa-fx.md +851 -0
- package/docs/components/usa-gauge.md +32 -0
- package/docs/components/usa-gen-art.md +32 -0
- package/docs/components/usa-gesture-fx.md +36 -0
- package/docs/components/usa-gesture-sticker.md +36 -0
- package/docs/components/usa-glitch.md +32 -0
- package/docs/components/usa-globe.md +33 -0
- package/docs/components/usa-gradient-text.md +32 -0
- package/docs/components/usa-grain.md +36 -0
- package/docs/components/usa-grid-glow.md +36 -0
- package/docs/components/usa-gyro-card.md +38 -0
- package/docs/components/usa-handwriting.md +32 -0
- package/docs/components/usa-hero-video.md +38 -0
- package/docs/components/usa-hold.md +32 -0
- package/docs/components/usa-hud-panel.md +38 -0
- package/docs/components/usa-hydrate.md +42 -0
- package/docs/components/usa-icon-morph.md +34 -0
- package/docs/components/usa-install-button.md +32 -0
- package/docs/components/usa-kanban.md +46 -0
- package/docs/components/usa-keyframe-editor.md +37 -0
- package/docs/components/usa-kpi.md +32 -0
- package/docs/components/usa-leaderboard.md +41 -0
- package/docs/components/usa-like.md +32 -0
- package/docs/components/usa-liquid-nav.md +36 -0
- package/docs/components/usa-liquid.md +36 -0
- package/docs/components/usa-loading-bar.md +35 -0
- package/docs/components/usa-location-card.md +34 -0
- package/docs/components/usa-lottie-icon.md +34 -0
- package/docs/components/usa-lottie.md +32 -0
- package/docs/components/usa-lyrics.md +38 -0
- package/docs/components/usa-magnetic.md +32 -0
- package/docs/components/usa-marquee.md +38 -0
- package/docs/components/usa-mask-reveal.md +36 -0
- package/docs/components/usa-masonry-flow.md +42 -0
- package/docs/components/usa-masonry.md +38 -0
- package/docs/components/usa-menu-toggle.md +34 -0
- package/docs/components/usa-menu.md +44 -0
- package/docs/components/usa-message-list.md +39 -0
- package/docs/components/usa-milestones.md +40 -0
- package/docs/components/usa-modal.md +42 -0
- package/docs/components/usa-morph.md +34 -0
- package/docs/components/usa-motion-inspector.md +32 -0
- package/docs/components/usa-motion-prefs.md +32 -0
- package/docs/components/usa-motion-spec.md +32 -0
- package/docs/components/usa-motion-switch.md +34 -0
- package/docs/components/usa-motion-theme.md +40 -0
- package/docs/components/usa-motion.md +42 -0
- package/docs/components/usa-music-player.md +36 -0
- package/docs/components/usa-native-preview.md +36 -0
- package/docs/components/usa-nav-morph.md +40 -0
- package/docs/components/usa-navbar.md +36 -0
- package/docs/components/usa-notification-bell.md +37 -0
- package/docs/components/usa-odometer.md +34 -0
- package/docs/components/usa-organic-card.md +36 -0
- package/docs/components/usa-otp.md +33 -0
- package/docs/components/usa-overscroll.md +36 -0
- package/docs/components/usa-pack.md +111 -0
- package/docs/components/usa-pagination.md +32 -0
- package/docs/components/usa-panorama.md +32 -0
- package/docs/components/usa-particles.md +32 -0
- package/docs/components/usa-pause-all.md +32 -0
- package/docs/components/usa-perf-monitor.md +32 -0
- package/docs/components/usa-pinch-zoom.md +36 -0
- package/docs/components/usa-player.md +38 -0
- package/docs/components/usa-plugin-card.md +61 -0
- package/docs/components/usa-plugin-store.md +36 -0
- package/docs/components/usa-popover.md +38 -0
- package/docs/components/usa-post-fx.md +36 -0
- package/docs/components/usa-presence.md +36 -0
- package/docs/components/usa-press.md +32 -0
- package/docs/components/usa-prize-wheel.md +32 -0
- package/docs/components/usa-product-gallery.md +40 -0
- package/docs/components/usa-progress-ring.md +38 -0
- package/docs/components/usa-progress.md +34 -0
- package/docs/components/usa-prop-panel.md +34 -0
- package/docs/components/usa-pull-cord.md +32 -0
- package/docs/components/usa-pull-refresh.md +37 -0
- package/docs/components/usa-radar.md +32 -0
- package/docs/components/usa-reactions.md +32 -0
- package/docs/components/usa-red-envelope.md +32 -0
- package/docs/components/usa-retro-button.md +34 -0
- package/docs/components/usa-reveal.md +36 -0
- package/docs/components/usa-ripple.md +32 -0
- package/docs/components/usa-route-transition.md +38 -0
- package/docs/components/usa-scene.md +38 -0
- package/docs/components/usa-scramble.md +32 -0
- package/docs/components/usa-scroll-highlight.md +34 -0
- package/docs/components/usa-scroll-progress.md +36 -0
- package/docs/components/usa-scroll-scene.md +66 -0
- package/docs/components/usa-scrolly.md +40 -0
- package/docs/components/usa-segmented.md +40 -0
- package/docs/components/usa-shader.md +74 -0
- package/docs/components/usa-sheet.md +42 -0
- package/docs/components/usa-shimmer-text.md +32 -0
- package/docs/components/usa-shortcut.md +34 -0
- package/docs/components/usa-skeleton-reveal.md +42 -0
- package/docs/components/usa-skeleton.md +36 -0
- package/docs/components/usa-sketch-chart.md +32 -0
- package/docs/components/usa-slider.md +32 -0
- package/docs/components/usa-sparkline.md +32 -0
- package/docs/components/usa-spatial-card.md +40 -0
- package/docs/components/usa-spinner.md +34 -0
- package/docs/components/usa-splash.md +36 -0
- package/docs/components/usa-split-text.md +32 -0
- package/docs/components/usa-spotlight.md +40 -0
- package/docs/components/usa-spring.md +42 -0
- package/docs/components/usa-stagger.md +40 -0
- package/docs/components/usa-star-rating.md +34 -0
- package/docs/components/usa-stepper.md +42 -0
- package/docs/components/usa-sticky-stack.md +40 -0
- package/docs/components/usa-sticky-wall.md +40 -0
- package/docs/components/usa-stories.md +38 -0
- package/docs/components/usa-story.md +80 -0
- package/docs/components/usa-suggestion-chips.md +32 -0
- package/docs/components/usa-swipe-deck.md +40 -0
- package/docs/components/usa-swipeable.md +36 -0
- package/docs/components/usa-switch.md +32 -0
- package/docs/components/usa-tab-bar.md +46 -0
- package/docs/components/usa-tabs.md +40 -0
- package/docs/components/usa-terminal.md +38 -0
- package/docs/components/usa-text-rotate.md +32 -0
- package/docs/components/usa-text-splitter.md +60 -0
- package/docs/components/usa-theme-surface.md +36 -0
- package/docs/components/usa-theme-switcher.md +32 -0
- package/docs/components/usa-tilt.md +36 -0
- package/docs/components/usa-timeline.md +40 -0
- package/docs/components/usa-tip.md +44 -0
- package/docs/components/usa-toast-stack.md +36 -0
- package/docs/components/usa-toaster.md +36 -0
- package/docs/components/usa-typewriter.md +32 -0
- package/docs/components/usa-upload-progress.md +33 -0
- package/docs/components/usa-video-card.md +40 -0
- package/docs/components/usa-view-switch.md +38 -0
- package/docs/components/usa-voice-button.md +33 -0
- package/docs/components/usa-volume-knob.md +32 -0
- package/docs/components/usa-water-ripple.md +36 -0
- package/docs/components/usa-wave-text.md +32 -0
- package/docs/components/usa-weather-card.md +32 -0
- package/docs/components/usa-worker-canvas.md +32 -0
- package/docs/components/usa-xp-bar.md +33 -0
- package/docs/components.md +95 -0
- package/docs/runtime/format-sprite.md +60 -0
- package/docs/runtime/format-svg.md +62 -0
- package/docs/runtime/scroll.md +61 -0
- package/docs/runtime/text.md +59 -0
- package/package.json +45 -3
- package/dist/chunks/tween-DDObu9iA.js.map +0 -1
- package/dist/chunks/tween-JEthWrjo.cjs.map +0 -1
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { R as RUNTIME_VERSION } from '../chunks/registry-46AAzyeC.js';
|
|
2
|
+
import { P as Playable } from '../chunks/tween-CGyolmzB.js';
|
|
3
|
+
import '../chunks/ticker-COOYAyQy.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* `motionary/runtime/format-sprite` (10.3) — sprite sheets and image
|
|
7
|
+
* sequences on the runtime timeline (original implementation).
|
|
8
|
+
*
|
|
9
|
+
* - `parseSpriteSheet(json)` — TexturePacker JSON (hash and array), Aseprite
|
|
10
|
+
* JSON (hash and array, per-frame `duration`, `meta.frameTags` with
|
|
11
|
+
* `forward` / `reverse` / `pingpong` directions) and the generic
|
|
12
|
+
* `{ frames: [{ x, y, w, h }] }` shape; trimmed frames (`spriteSourceSize` /
|
|
13
|
+
* `sourceSize`) and rotated frames are supported.
|
|
14
|
+
* - `gridSheet(cols, rows, w, h, n?)` — a plain grid sheet.
|
|
15
|
+
* - `frameOrder(sheet, tag?)` — the playback order of a tag (pingpong without repeating the ends).
|
|
16
|
+
* - `spritePlayer(target, sheet, image, { tag, fps })` — a runtime `Playable`
|
|
17
|
+
* that draws frames onto a `<canvas>` or moves the background of an element.
|
|
18
|
+
* - `imageSequence('frame_{0001}.webp', { start, end })`, `preloadImages(urls)`,
|
|
19
|
+
* `sequencePlayer(canvas, images, { fps })` — numbered image sequences,
|
|
20
|
+
* scrubbable (`player.progress = p`, e.g. from a scroll scene).
|
|
21
|
+
* Parsing works without the DOM (SSR / workers); players need a canvas / element.
|
|
22
|
+
*/
|
|
23
|
+
const num = (v, d = 0) => (typeof v === 'number' && Number.isFinite(v) ? v : d);
|
|
24
|
+
/** Parse a sprite-sheet JSON (object or string). */
|
|
25
|
+
function parseSpriteSheet(input) {
|
|
26
|
+
const j = typeof input === 'string' ? JSON.parse(input) : input;
|
|
27
|
+
if (!j || !j.frames)
|
|
28
|
+
throw new Error('[motionary] format-sprite: no "frames" in the sprite sheet JSON');
|
|
29
|
+
const meta = j.meta || {};
|
|
30
|
+
const aseprite = /aseprite/i.test(meta.app || '') || Array.isArray(meta.frameTags);
|
|
31
|
+
const entries = Array.isArray(j.frames) ? j.frames.map((f, i) => [f.filename ?? f.name ?? String(i), f]) : Object.entries(j.frames);
|
|
32
|
+
const frames = entries.map(([name, f]) => {
|
|
33
|
+
const r = f.frame || f;
|
|
34
|
+
const rotated = !!f.rotated;
|
|
35
|
+
const sss = f.spriteSourceSize || { x: 0, y: 0 };
|
|
36
|
+
const ss = f.sourceSize || { w: r.w, h: r.h };
|
|
37
|
+
const out = { name, x: num(r.x), y: num(r.y), w: num(r.w), h: num(r.h), rotated, offsetX: num(sss.x), offsetY: num(sss.y), sourceW: num(ss.w, r.w), sourceH: num(ss.h, r.h) };
|
|
38
|
+
if (typeof f.duration === 'number')
|
|
39
|
+
out.duration = f.duration;
|
|
40
|
+
return out;
|
|
41
|
+
});
|
|
42
|
+
if (!Array.isArray(j.frames) && !aseprite)
|
|
43
|
+
frames.sort((a, b) => a.name.localeCompare(b.name, undefined, { numeric: true }));
|
|
44
|
+
const tags = (meta.frameTags || []).map((t) => ({ name: t.name, from: num(t.from), to: num(t.to), direction: t.direction || 'forward' }));
|
|
45
|
+
return { frames, tags, image: meta.image, size: meta.size, format: aseprite ? 'aseprite' : meta.app || j.meta ? 'texturepacker' : 'generic' };
|
|
46
|
+
}
|
|
47
|
+
/** A grid sheet: `cols × rows` cells of `w × h` (first `n` cells). */
|
|
48
|
+
function gridSheet(cols, rows, w, h, n = cols * rows) {
|
|
49
|
+
const frames = [];
|
|
50
|
+
for (let i = 0; i < n; i++)
|
|
51
|
+
frames.push({ name: String(i), x: (i % cols) * w, y: Math.floor(i / cols) * h, w, h, rotated: false, offsetX: 0, offsetY: 0, sourceW: w, sourceH: h });
|
|
52
|
+
return { frames, tags: [], format: 'generic' };
|
|
53
|
+
}
|
|
54
|
+
/** Frame indices for a tag (or the whole sheet). */
|
|
55
|
+
function frameOrder(sheet, tag) {
|
|
56
|
+
const t = tag ? sheet.tags.find((x) => x.name === tag) : undefined;
|
|
57
|
+
if (tag && !t)
|
|
58
|
+
throw new Error(`[motionary] format-sprite: unknown tag "${tag}" (have: ${sheet.tags.map((x) => x.name).join(', ') || 'none'})`);
|
|
59
|
+
const from = t ? t.from : 0, to = t ? t.to : sheet.frames.length - 1;
|
|
60
|
+
const fwd = Array.from({ length: to - from + 1 }, (_, i) => from + i);
|
|
61
|
+
const dir = t?.direction || 'forward';
|
|
62
|
+
if (dir === 'reverse')
|
|
63
|
+
return fwd.reverse();
|
|
64
|
+
if (dir === 'pingpong')
|
|
65
|
+
return [...fwd, ...fwd.slice(1, -1).reverse()];
|
|
66
|
+
if (dir === 'pingpong_reverse') {
|
|
67
|
+
const r = fwd.reverse();
|
|
68
|
+
return [...r, ...r.slice(1, -1).reverse()];
|
|
69
|
+
}
|
|
70
|
+
return fwd;
|
|
71
|
+
}
|
|
72
|
+
/** Draw one frame onto a 2D context at (dx, dy), honouring trim offsets and rotation. */
|
|
73
|
+
function drawFrame(ctx, image, f, dx = 0, dy = 0, scale = 1) {
|
|
74
|
+
ctx.save();
|
|
75
|
+
ctx.translate(dx + f.offsetX * scale, dy + f.offsetY * scale);
|
|
76
|
+
if (f.rotated) {
|
|
77
|
+
// TexturePacker stores rotated frames 90° clockwise: w/h are the unrotated size
|
|
78
|
+
ctx.rotate(-Math.PI / 2);
|
|
79
|
+
ctx.drawImage(image, f.x, f.y, f.h, f.w, -f.h * scale, 0, f.h * scale, f.w * scale);
|
|
80
|
+
}
|
|
81
|
+
else
|
|
82
|
+
ctx.drawImage(image, f.x, f.y, f.w, f.h, 0, 0, f.w * scale, f.h * scale);
|
|
83
|
+
ctx.restore();
|
|
84
|
+
}
|
|
85
|
+
/** Plays a list of frames (by index) with per-frame durations. */
|
|
86
|
+
class FramePlayable extends Playable {
|
|
87
|
+
constructor() {
|
|
88
|
+
super(...arguments);
|
|
89
|
+
this.times = [0];
|
|
90
|
+
this.order = [];
|
|
91
|
+
this.current = -1;
|
|
92
|
+
}
|
|
93
|
+
setOrder(order, dur) {
|
|
94
|
+
this.order = order;
|
|
95
|
+
this.times = [0];
|
|
96
|
+
for (const i of order)
|
|
97
|
+
this.times.push(this.times[this.times.length - 1] + dur(i));
|
|
98
|
+
}
|
|
99
|
+
get duration() {
|
|
100
|
+
return this.times[this.times.length - 1];
|
|
101
|
+
}
|
|
102
|
+
/** Index into `order` at a local time. */
|
|
103
|
+
indexAt(ms) {
|
|
104
|
+
let lo = 0, hi = this.order.length - 1;
|
|
105
|
+
while (lo < hi) {
|
|
106
|
+
const mid = (lo + hi + 1) >> 1;
|
|
107
|
+
if (this.times[mid] <= ms)
|
|
108
|
+
lo = mid;
|
|
109
|
+
else
|
|
110
|
+
hi = mid - 1;
|
|
111
|
+
}
|
|
112
|
+
return Math.min(lo, this.order.length - 1);
|
|
113
|
+
}
|
|
114
|
+
renderLocal(ms) {
|
|
115
|
+
const k = this.order[this.indexAt(Math.min(ms, this.duration - 0.001))];
|
|
116
|
+
if (k === this.current)
|
|
117
|
+
return;
|
|
118
|
+
this.current = k;
|
|
119
|
+
this.show(k);
|
|
120
|
+
}
|
|
121
|
+
/** The frame index currently shown. */
|
|
122
|
+
get frame() {
|
|
123
|
+
return this.current;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
class SpritePlayer extends FramePlayable {
|
|
127
|
+
constructor(target, sheet, image, o) {
|
|
128
|
+
super({ repeat: o.repeat ?? -1, yoyo: o.yoyo });
|
|
129
|
+
this.target = target;
|
|
130
|
+
this.sheet = sheet;
|
|
131
|
+
this.image = image;
|
|
132
|
+
const fps = o.fps || 12;
|
|
133
|
+
this.setOrder(frameOrder(sheet, o.tag), (i) => sheet.frames[i].duration ?? 1000 / fps);
|
|
134
|
+
this.scale = o.scale;
|
|
135
|
+
if (!o.paused)
|
|
136
|
+
this.play();
|
|
137
|
+
}
|
|
138
|
+
show(i) {
|
|
139
|
+
const f = this.sheet.frames[i];
|
|
140
|
+
const t = this.target;
|
|
141
|
+
if (typeof t.getContext === 'function' && typeof this.image !== 'string') {
|
|
142
|
+
const ctx = t.getContext('2d');
|
|
143
|
+
if (!ctx)
|
|
144
|
+
return;
|
|
145
|
+
const s = this.scale ?? t.width / (f.sourceW || f.w || 1);
|
|
146
|
+
ctx.clearRect(0, 0, t.width, t.height);
|
|
147
|
+
drawFrame(ctx, this.image, f, 0, 0, s);
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
const el = this.target;
|
|
151
|
+
if (typeof this.image === 'string')
|
|
152
|
+
el.style.backgroundImage = `url("${this.image}")`;
|
|
153
|
+
el.style.backgroundPosition = `${-f.x}px ${-f.y}px`;
|
|
154
|
+
el.style.width = `${f.w}px`;
|
|
155
|
+
el.style.height = `${f.h}px`;
|
|
156
|
+
el.style.backgroundRepeat = 'no-repeat';
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
/** Play a sprite sheet on a canvas (image = loaded image / bitmap) or an element's background (image = URL). */
|
|
161
|
+
function spritePlayer(target, sheet, image, o = {}) {
|
|
162
|
+
return new SpritePlayer(target, sheet, image, o);
|
|
163
|
+
}
|
|
164
|
+
/** 'frame_{0001}.webp' + { start: 1, end: 3 } → frame_0001.webp, frame_0002.webp, frame_0003.webp ('{1}' = no padding). */
|
|
165
|
+
function imageSequence(pattern, o) {
|
|
166
|
+
const m = /\{(\d+)\}/.exec(pattern);
|
|
167
|
+
if (!m)
|
|
168
|
+
throw new Error('[motionary] format-sprite: the pattern needs a {0001}-style placeholder');
|
|
169
|
+
const pad = m[1].length;
|
|
170
|
+
const out = [];
|
|
171
|
+
for (let i = o.start ?? (+m[1] || 0); i <= o.end; i += o.step || 1)
|
|
172
|
+
out.push(pattern.replace(m[0], String(i).padStart(pad, '0')));
|
|
173
|
+
return out;
|
|
174
|
+
}
|
|
175
|
+
/** Load images (resolves when all are decoded; rejects with the failing URL). */
|
|
176
|
+
function preloadImages(urls) {
|
|
177
|
+
return Promise.all(urls.map((u) => new Promise((ok, bad) => {
|
|
178
|
+
const img = new Image();
|
|
179
|
+
img.decoding = 'async';
|
|
180
|
+
img.onload = () => ok(img);
|
|
181
|
+
img.onerror = () => bad(new Error(`[motionary] format-sprite: could not load ${u}`));
|
|
182
|
+
img.src = u;
|
|
183
|
+
})));
|
|
184
|
+
}
|
|
185
|
+
class SequencePlayer extends FramePlayable {
|
|
186
|
+
constructor(canvas, images, o) {
|
|
187
|
+
super({ repeat: o.repeat ?? 0, yoyo: o.yoyo });
|
|
188
|
+
this.canvas = canvas;
|
|
189
|
+
this.images = images;
|
|
190
|
+
const fps = o.fps || 24;
|
|
191
|
+
this.setOrder(images.map((_, i) => i), () => 1000 / fps);
|
|
192
|
+
if (!o.paused)
|
|
193
|
+
this.play();
|
|
194
|
+
}
|
|
195
|
+
show(i) {
|
|
196
|
+
const ctx = this.canvas.getContext('2d');
|
|
197
|
+
const img = this.images[i];
|
|
198
|
+
if (!ctx || !img)
|
|
199
|
+
return;
|
|
200
|
+
const w = this.canvas.width, h = this.canvas.height;
|
|
201
|
+
const iw = img.naturalWidth || img.width || w, ih = img.naturalHeight || img.height || h;
|
|
202
|
+
const s = Math.max(w / iw, h / ih); // cover
|
|
203
|
+
ctx.clearRect(0, 0, w, h);
|
|
204
|
+
ctx.drawImage(img, (w - iw * s) / 2, (h - ih * s) / 2, iw * s, ih * s);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
/** Play (or scrub, via `progress`) an image sequence on a canvas, `object-fit: cover` style. */
|
|
208
|
+
function sequencePlayer(canvas, images, o = {}) {
|
|
209
|
+
return new SequencePlayer(canvas, images, o);
|
|
210
|
+
}
|
|
211
|
+
/** The module object for `use(formatSprite)`. */
|
|
212
|
+
const formatSprite = { id: 'format-sprite', version: RUNTIME_VERSION, requires: ['core'], api: { parseSpriteSheet, gridSheet, frameOrder, drawFrame, spritePlayer, imageSequence, preloadImages, sequencePlayer } };
|
|
213
|
+
|
|
214
|
+
export { drawFrame, formatSprite, frameOrder, gridSheet, imageSequence, parseSpriteSheet, preloadImages, sequencePlayer, spritePlayer };
|
|
215
|
+
//# sourceMappingURL=format-sprite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-sprite.js","sources":["../../src/runtime/format-sprite.ts"],"sourcesContent":["/**\n * `motionary/runtime/format-sprite` (10.3) — sprite sheets and image\n * sequences on the runtime timeline (original implementation).\n *\n * - `parseSpriteSheet(json)` — TexturePacker JSON (hash and array), Aseprite\n * JSON (hash and array, per-frame `duration`, `meta.frameTags` with\n * `forward` / `reverse` / `pingpong` directions) and the generic\n * `{ frames: [{ x, y, w, h }] }` shape; trimmed frames (`spriteSourceSize` /\n * `sourceSize`) and rotated frames are supported.\n * - `gridSheet(cols, rows, w, h, n?)` — a plain grid sheet.\n * - `frameOrder(sheet, tag?)` — the playback order of a tag (pingpong without repeating the ends).\n * - `spritePlayer(target, sheet, image, { tag, fps })` — a runtime `Playable`\n * that draws frames onto a `<canvas>` or moves the background of an element.\n * - `imageSequence('frame_{0001}.webp', { start, end })`, `preloadImages(urls)`,\n * `sequencePlayer(canvas, images, { fps })` — numbered image sequences,\n * scrubbable (`player.progress = p`, e.g. from a scroll scene).\n * Parsing works without the DOM (SSR / workers); players need a canvas / element.\n */\nimport { RUNTIME_VERSION, type RuntimeModule } from './registry';\nimport { Playable } from './tween';\n\nexport interface SpriteFrame {\n name: string;\n x: number;\n y: number;\n w: number;\n h: number;\n rotated: boolean;\n /** Offset of the trimmed frame inside the original (untrimmed) size. */\n offsetX: number;\n offsetY: number;\n sourceW: number;\n sourceH: number;\n /** ms (Aseprite), or undefined (use the player's fps). */\n duration?: number;\n}\nexport interface SpriteTag {\n name: string;\n from: number;\n to: number;\n direction: 'forward' | 'reverse' | 'pingpong' | 'pingpong_reverse';\n}\nexport interface SpriteSheet {\n frames: SpriteFrame[];\n tags: SpriteTag[];\n image?: string;\n size?: { w: number; h: number };\n format: 'texturepacker' | 'aseprite' | 'generic';\n}\n\nconst num = (v: unknown, d = 0) => (typeof v === 'number' && Number.isFinite(v) ? v : d);\n\n/** Parse a sprite-sheet JSON (object or string). */\nexport function parseSpriteSheet(input: string | Record<string, any>): SpriteSheet {\n const j = typeof input === 'string' ? JSON.parse(input) : input;\n if (!j || !j.frames) throw new Error('[motionary] format-sprite: no \"frames\" in the sprite sheet JSON');\n const meta = j.meta || {};\n const aseprite = /aseprite/i.test(meta.app || '') || Array.isArray(meta.frameTags);\n const entries: [string, any][] = Array.isArray(j.frames) ? j.frames.map((f: any, i: number) => [f.filename ?? f.name ?? String(i), f]) : Object.entries(j.frames);\n const frames = entries.map(([name, f]) => {\n const r = f.frame || f;\n const rotated = !!f.rotated;\n const sss = f.spriteSourceSize || { x: 0, y: 0 };\n const ss = f.sourceSize || { w: r.w, h: r.h };\n const out: SpriteFrame = { name, x: num(r.x), y: num(r.y), w: num(r.w), h: num(r.h), rotated, offsetX: num(sss.x), offsetY: num(sss.y), sourceW: num(ss.w, r.w), sourceH: num(ss.h, r.h) };\n if (typeof f.duration === 'number') out.duration = f.duration;\n return out;\n });\n if (!Array.isArray(j.frames) && !aseprite) frames.sort((a, b) => a.name.localeCompare(b.name, undefined, { numeric: true }));\n const tags: SpriteTag[] = (meta.frameTags || []).map((t: any) => ({ name: t.name, from: num(t.from), to: num(t.to), direction: t.direction || 'forward' }));\n return { frames, tags, image: meta.image, size: meta.size, format: aseprite ? 'aseprite' : meta.app || j.meta ? 'texturepacker' : 'generic' };\n}\n\n/** A grid sheet: `cols × rows` cells of `w × h` (first `n` cells). */\nexport function gridSheet(cols: number, rows: number, w: number, h: number, n = cols * rows): SpriteSheet {\n const frames: SpriteFrame[] = [];\n for (let i = 0; i < n; i++) frames.push({ name: String(i), x: (i % cols) * w, y: Math.floor(i / cols) * h, w, h, rotated: false, offsetX: 0, offsetY: 0, sourceW: w, sourceH: h });\n return { frames, tags: [], format: 'generic' };\n}\n\n/** Frame indices for a tag (or the whole sheet). */\nexport function frameOrder(sheet: SpriteSheet, tag?: string): number[] {\n const t = tag ? sheet.tags.find((x) => x.name === tag) : undefined;\n if (tag && !t) throw new Error(`[motionary] format-sprite: unknown tag \"${tag}\" (have: ${sheet.tags.map((x) => x.name).join(', ') || 'none'})`);\n const from = t ? t.from : 0, to = t ? t.to : sheet.frames.length - 1;\n const fwd = Array.from({ length: to - from + 1 }, (_, i) => from + i);\n const dir = t?.direction || 'forward';\n if (dir === 'reverse') return fwd.reverse();\n if (dir === 'pingpong') return [...fwd, ...fwd.slice(1, -1).reverse()];\n if (dir === 'pingpong_reverse') { const r = fwd.reverse(); return [...r, ...r.slice(1, -1).reverse()]; }\n return fwd;\n}\n\n/** Draw one frame onto a 2D context at (dx, dy), honouring trim offsets and rotation. */\nexport function drawFrame(ctx: CanvasRenderingContext2D, image: CanvasImageSource, f: SpriteFrame, dx = 0, dy = 0, scale = 1): void {\n ctx.save();\n ctx.translate(dx + f.offsetX * scale, dy + f.offsetY * scale);\n if (f.rotated) {\n // TexturePacker stores rotated frames 90° clockwise: w/h are the unrotated size\n ctx.rotate(-Math.PI / 2);\n ctx.drawImage(image, f.x, f.y, f.h, f.w, -f.h * scale, 0, f.h * scale, f.w * scale);\n } else ctx.drawImage(image, f.x, f.y, f.w, f.h, 0, 0, f.w * scale, f.h * scale);\n ctx.restore();\n}\n\n/** Plays a list of frames (by index) with per-frame durations. */\nabstract class FramePlayable extends Playable {\n protected times: number[] = [0];\n protected order: number[] = [];\n protected current = -1;\n protected setOrder(order: number[], dur: (i: number) => number): void {\n this.order = order;\n this.times = [0];\n for (const i of order) this.times.push(this.times[this.times.length - 1] + dur(i));\n }\n get duration(): number {\n return this.times[this.times.length - 1];\n }\n /** Index into `order` at a local time. */\n protected indexAt(ms: number): number {\n let lo = 0, hi = this.order.length - 1;\n while (lo < hi) {\n const mid = (lo + hi + 1) >> 1;\n if (this.times[mid] <= ms) lo = mid;\n else hi = mid - 1;\n }\n return Math.min(lo, this.order.length - 1);\n }\n protected renderLocal(ms: number): void {\n const k = this.order[this.indexAt(Math.min(ms, this.duration - 0.001))];\n if (k === this.current) return;\n this.current = k;\n this.show(k);\n }\n /** The frame index currently shown. */\n get frame(): number {\n return this.current;\n }\n protected abstract show(index: number): void;\n}\n\nexport interface SpritePlayerOptions {\n tag?: string;\n /** Frames per second for frames without their own duration (default 12). */\n fps?: number;\n repeat?: number;\n yoyo?: boolean;\n paused?: boolean;\n /** Canvas only: draw scale (default: fit the canvas width). */\n scale?: number;\n}\n\nclass SpritePlayer extends FramePlayable {\n constructor(private target: HTMLCanvasElement | HTMLElement, private sheet: SpriteSheet, private image: CanvasImageSource | string, o: SpritePlayerOptions) {\n super({ repeat: o.repeat ?? -1, yoyo: o.yoyo });\n const fps = o.fps || 12;\n this.setOrder(frameOrder(sheet, o.tag), (i) => sheet.frames[i].duration ?? 1000 / fps);\n this.scale = o.scale;\n if (!o.paused) this.play();\n }\n private scale?: number;\n protected show(i: number): void {\n const f = this.sheet.frames[i];\n const t = this.target as HTMLCanvasElement;\n if (typeof t.getContext === 'function' && typeof this.image !== 'string') {\n const ctx = t.getContext('2d');\n if (!ctx) return;\n const s = this.scale ?? t.width / (f.sourceW || f.w || 1);\n ctx.clearRect(0, 0, t.width, t.height);\n drawFrame(ctx, this.image, f, 0, 0, s);\n } else {\n const el = this.target as HTMLElement;\n if (typeof this.image === 'string') el.style.backgroundImage = `url(\"${this.image}\")`;\n el.style.backgroundPosition = `${-f.x}px ${-f.y}px`;\n el.style.width = `${f.w}px`;\n el.style.height = `${f.h}px`;\n el.style.backgroundRepeat = 'no-repeat';\n }\n }\n}\n\n/** Play a sprite sheet on a canvas (image = loaded image / bitmap) or an element's background (image = URL). */\nexport function spritePlayer(target: HTMLCanvasElement | HTMLElement, sheet: SpriteSheet, image: CanvasImageSource | string, o: SpritePlayerOptions = {}): Playable & { readonly frame: number } {\n return new SpritePlayer(target, sheet, image, o);\n}\n\n/** 'frame_{0001}.webp' + { start: 1, end: 3 } → frame_0001.webp, frame_0002.webp, frame_0003.webp ('{1}' = no padding). */\nexport function imageSequence(pattern: string, o: { start?: number; end: number; step?: number }): string[] {\n const m = /\\{(\\d+)\\}/.exec(pattern);\n if (!m) throw new Error('[motionary] format-sprite: the pattern needs a {0001}-style placeholder');\n const pad = m[1].length;\n const out: string[] = [];\n for (let i = o.start ?? (+m[1] || 0); i <= o.end; i += o.step || 1) out.push(pattern.replace(m[0], String(i).padStart(pad, '0')));\n return out;\n}\n\n/** Load images (resolves when all are decoded; rejects with the failing URL). */\nexport function preloadImages(urls: string[]): Promise<HTMLImageElement[]> {\n return Promise.all(urls.map((u) => new Promise<HTMLImageElement>((ok, bad) => {\n const img = new Image();\n img.decoding = 'async';\n img.onload = () => ok(img);\n img.onerror = () => bad(new Error(`[motionary] format-sprite: could not load ${u}`));\n img.src = u;\n })));\n}\n\nclass SequencePlayer extends FramePlayable {\n constructor(private canvas: HTMLCanvasElement, private images: CanvasImageSource[], o: { fps?: number; repeat?: number; yoyo?: boolean; paused?: boolean }) {\n super({ repeat: o.repeat ?? 0, yoyo: o.yoyo });\n const fps = o.fps || 24;\n this.setOrder(images.map((_, i) => i), () => 1000 / fps);\n if (!o.paused) this.play();\n }\n protected show(i: number): void {\n const ctx = this.canvas.getContext('2d');\n const img = this.images[i] as any;\n if (!ctx || !img) return;\n const w = this.canvas.width, h = this.canvas.height;\n const iw = img.naturalWidth || img.width || w, ih = img.naturalHeight || img.height || h;\n const s = Math.max(w / iw, h / ih); // cover\n ctx.clearRect(0, 0, w, h);\n ctx.drawImage(img, (w - iw * s) / 2, (h - ih * s) / 2, iw * s, ih * s);\n }\n}\n\n/** Play (or scrub, via `progress`) an image sequence on a canvas, `object-fit: cover` style. */\nexport function sequencePlayer(canvas: HTMLCanvasElement, images: CanvasImageSource[], o: { fps?: number; repeat?: number; yoyo?: boolean; paused?: boolean } = {}): Playable & { readonly frame: number } {\n return new SequencePlayer(canvas, images, o);\n}\n\nexport interface FormatSpriteApi {\n parseSpriteSheet: typeof parseSpriteSheet;\n gridSheet: typeof gridSheet;\n frameOrder: typeof frameOrder;\n drawFrame: typeof drawFrame;\n spritePlayer: typeof spritePlayer;\n imageSequence: typeof imageSequence;\n preloadImages: typeof preloadImages;\n sequencePlayer: typeof sequencePlayer;\n}\n\n/** The module object for `use(formatSprite)`. */\nexport const formatSprite: RuntimeModule<FormatSpriteApi> = { id: 'format-sprite', version: RUNTIME_VERSION, requires: ['core'], api: { parseSpriteSheet, gridSheet, frameOrder, drawFrame, spritePlayer, imageSequence, preloadImages, sequencePlayer } };\n"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;;;;AAiBG;AAiCH,MAAM,GAAG,GAAG,CAAC,CAAU,EAAE,CAAC,GAAG,CAAC,MAAM,OAAO,CAAC,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAExF;AACM,SAAU,gBAAgB,CAAC,KAAmC,EAAA;AAClE,IAAA,MAAM,CAAC,GAAG,OAAO,KAAK,KAAK,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,KAAK;AAC/D,IAAA,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM;AAAE,QAAA,MAAM,IAAI,KAAK,CAAC,iEAAiE,CAAC;AACvG,IAAA,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,IAAI,EAAE;IACzB,MAAM,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC;IAClF,MAAM,OAAO,GAAoB,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,CAAS,KAAK,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;AACjK,IAAA,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,KAAI;AACvC,QAAA,MAAM,CAAC,GAAG,CAAC,CAAC,KAA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