motionary 10.1.0 → 10.2.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 +14 -0
- package/README.md +37 -0
- package/dist/chunks/{keyframes-CyH_abhI.js → keyframes-W-474DMc.js} +2 -2
- package/dist/chunks/{keyframes-CyH_abhI.js.map → keyframes-W-474DMc.js.map} +1 -1
- package/dist/chunks/{keyframes-cUdsXSXQ.cjs → keyframes-ZheOkpt0.cjs} +2 -2
- package/dist/chunks/{keyframes-cUdsXSXQ.cjs.map → keyframes-ZheOkpt0.cjs.map} +1 -1
- package/dist/chunks/{registry-jF8VIA_9.js → registry-BIEjKngP.js} +2 -2
- package/dist/chunks/{registry-jF8VIA_9.js.map → registry-BIEjKngP.js.map} +1 -1
- package/dist/chunks/{registry-C0xLNq3-.cjs → registry-eJgpFAzI.cjs} +2 -2
- package/dist/chunks/{registry-C0xLNq3-.cjs.map → registry-eJgpFAzI.cjs.map} +1 -1
- package/dist/chunks/ticker-CM_56oVy.js +70 -0
- package/dist/chunks/ticker-CM_56oVy.js.map +1 -0
- package/dist/chunks/ticker-D4o6enH0.cjs +72 -0
- package/dist/chunks/ticker-D4o6enH0.cjs.map +1 -0
- package/dist/chunks/{tween-JEthWrjo.cjs → tween-CBuWYpI-.cjs} +5 -72
- package/dist/chunks/tween-CBuWYpI-.cjs.map +1 -0
- package/dist/chunks/{tween-DDObu9iA.js → tween-CqX1JBuj.js} +5 -71
- package/dist/chunks/tween-CqX1JBuj.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 +401 -198
- package/dist/components/widgets.cjs.map +1 -1
- package/dist/components/widgets.d.cts +146 -2
- package/dist/components/widgets.d.ts +146 -2
- package/dist/components/widgets.js +399 -199
- 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 +259 -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-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.cjs +5 -4
- package/dist/runtime.cjs.map +1 -1
- 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 -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 +1 -1
- package/docs/ai-prompt-guide.md +54 -0
- package/docs/components/README.md +253 -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-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-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 +50 -0
- package/docs/runtime/format-svg.md +62 -0
- package/docs/runtime/scroll.md +61 -0
- package/package.json +25 -3
- package/dist/chunks/tween-DDObu9iA.js.map +0 -1
- package/dist/chunks/tween-JEthWrjo.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.cjs","sources":["../../src/components/core/index.ts"],"sourcesContent":["/**\n * `motionary/core` (10.0) — the zero-dependency core, under 10 KB gzip.\n *\n * Everything else is a plugin: `createMotion().use(retro, cinema)` with the\n * packs from `motionary/plugins` (or your own `{ name, effects }`).\n *\n * - `createMotion({ reducedMotion, rate })` → an instance with `use()`,\n * `play(el, effect, options)`, `bind(el, effect, { trigger })`,\n * `reveal(targets, preset, { stagger, once, threshold })`, `animate()`,\n * `pause()` / `resume()` / `setRate()` for everything it started,\n * `effects()` and `destroy()`.\n * - `PRESETS` — entrance keyframes (fade, fade-up/down/left/right, scale,\n * zoom-in/out, blur-in, flip-up), registered as `enter` effects.\n * - `preferredBackend()` — `webgpu` (default when available) → `webgl2` →\n * `canvas`, the order GPU plugins use.\n *\n * Reduced motion is honoured everywhere (OS setting or `reducedMotion:\n * 'reduce'`): entrances fade, loops / backgrounds / cursors are skipped.\n */\nexport const VERSION = '10.0.0';\n\nexport type CoreEffectKind = 'enter' | 'exit' | 'attention' | 'hover' | 'click' | 'loop' | 'background' | 'cursor' | 'text' | 'scroll' | (string & {});\nexport interface CoreEffectContext {\n reduced: boolean;\n sensitivity: 'full' | 'gentle' | 'minimal' | 'static';\n event?: Event;\n animate(el: Element, keyframes: Keyframe[] | PropertyIndexedKeyframes, options?: number | KeyframeAnimationOptions): Animation | null;\n onCleanup(fn: () => void): void;\n}\nexport interface CoreEffect {\n name: string;\n kind: CoreEffectKind;\n description?: string;\n defaults?: Record<string, unknown>;\n reduced?: 'skip' | 'run';\n run(el: HTMLElement, options: any, ctx: CoreEffectContext): unknown;\n}\nexport interface CorePlugin {\n name: string;\n effects?: CoreEffect[];\n install?(m: MotionInstance): void;\n}\nexport type Trigger = 'click' | 'hover' | 'enter' | 'load' | 'loop' | 'manual';\nexport interface RevealOptions {\n stagger?: number;\n delay?: number;\n duration?: number;\n easing?: string;\n once?: boolean;\n threshold?: number;\n}\nexport interface MotionInstance {\n readonly paused: boolean;\n readonly rate: number;\n use(...plugins: CorePlugin[]): MotionInstance;\n has(effect: string): boolean;\n effects(): string[];\n reduced(): boolean;\n animate(el: Element, keyframes: Keyframe[] | PropertyIndexedKeyframes, options?: number | KeyframeAnimationOptions): Animation | null;\n play(el: HTMLElement, effect: string, options?: Record<string, unknown>, event?: Event): Promise<void>;\n bind(el: HTMLElement, effect: string, options?: Record<string, unknown> & { trigger?: Trigger; once?: boolean }): () => void;\n reveal(targets: string | Element | ArrayLike<Element>, preset?: string, options?: RevealOptions): () => void;\n pause(): void;\n resume(): void;\n setRate(rate: number): void;\n destroy(): void;\n}\n\nconst T = (x: number, y: number, s = 1) => `translate(${x}px,${y}px) scale(${s})`;\n/** Entrance keyframes (10.0). */\nexport const PRESETS: Record<string, Keyframe[]> = {\n fade: [{ opacity: 0 }, { opacity: 1 }],\n 'fade-up': [{ opacity: 0, transform: T(0, 24) }, { opacity: 1, transform: 'none' }],\n 'fade-down': [{ opacity: 0, transform: T(0, -24) }, { opacity: 1, transform: 'none' }],\n 'fade-left': [{ opacity: 0, transform: T(24, 0) }, { opacity: 1, transform: 'none' }],\n 'fade-right': [{ opacity: 0, transform: T(-24, 0) }, { opacity: 1, transform: 'none' }],\n scale: [{ opacity: 0, transform: 'scale(.85)' }, { opacity: 1, transform: 'none' }],\n 'zoom-in': [{ opacity: 0, transform: 'scale(.6)' }, { opacity: 1, transform: 'none' }],\n 'zoom-out': [{ opacity: 0, transform: 'scale(1.2)' }, { opacity: 1, transform: 'none' }],\n 'blur-in': [{ opacity: 0, filter: 'blur(10px)' }, { opacity: 1, filter: 'none' }],\n 'flip-up': [{ opacity: 0, transform: 'perspective(600px) rotateX(-60deg)' }, { opacity: 1, transform: 'none' }],\n};\nconst EASE = 'cubic-bezier(0.22, 1, 0.36, 1)';\nconst SKIP: string[] = ['loop', 'background', 'cursor'];\n\n/** GPU backend order used by GPU plugins: WebGPU by default (10.0). */\nexport function preferredBackend(): 'webgpu' | 'webgl2' | 'canvas' {\n if (typeof navigator !== 'undefined' && (navigator as any).gpu) return 'webgpu';\n try {\n if (typeof document !== 'undefined' && document.createElement('canvas').getContext?.('webgl2')) return 'webgl2';\n } catch {\n /* no GL */\n }\n return 'canvas';\n}\n\nconst list = (t: string | Element | ArrayLike<Element>): HTMLElement[] =>\n typeof t === 'string' ? (typeof document === 'undefined' ? [] : Array.from(document.querySelectorAll<HTMLElement>(t))) : 'length' in (t as ArrayLike<Element>) && !(t instanceof Element) ? (Array.from(t as ArrayLike<Element>) as HTMLElement[]) : [t as HTMLElement];\n\n/** Create a Motionary core instance (10.0). */\nexport function createMotion(config: { reducedMotion?: 'user' | 'reduce'; rate?: number } = {}): MotionInstance {\n const reg = new Map<string, CoreEffect>();\n const plugins = new Set<string>();\n const live = new Set<Animation>();\n const offs = new Set<() => void>();\n let paused = false;\n let rate = config.rate && config.rate > 0 ? config.rate : 1;\n const reduced = () => config.reducedMotion === 'reduce' || (typeof matchMedia === 'function' && matchMedia('(prefers-reduced-motion: reduce)').matches);\n const animate: MotionInstance['animate'] = (el, kf, o) => {\n if (typeof (el as any).animate !== 'function') return null;\n const a = el.animate(kf, o);\n if (!a) return null;\n live.add(a);\n if (rate !== 1) a.playbackRate = rate;\n if (paused) a.pause();\n const done = () => live.delete(a);\n a.finished?.then(done, done);\n return a;\n };\n const ctx = (event?: Event, cleanups: (() => void)[] = []): CoreEffectContext => ({ reduced: reduced(), sensitivity: reduced() ? 'minimal' : 'full', event, animate, onCleanup: (f) => cleanups.push(f) });\n const skip = (d: CoreEffect) => reduced() && (d.reduced ?? (SKIP.includes(d.kind) ? 'skip' : 'run')) === 'skip';\n const m: MotionInstance = {\n get paused() {\n return paused;\n },\n get rate() {\n return rate;\n },\n use(...ps) {\n for (const p of ps) {\n if (!p || plugins.has(p.name)) continue;\n plugins.add(p.name);\n for (const e of p.effects || []) if (!reg.has(e.name)) reg.set(e.name, e);\n p.install?.(m);\n }\n return m;\n },\n has: (n) => reg.has(n),\n effects: () => Array.from(reg.keys()).sort(),\n reduced,\n animate,\n async play(el, name, options = {}, event) {\n const d = reg.get(name);\n if (!d) throw new Error(`[motionary] unknown effect \"${name}\" — add its plugin with use()`);\n if (skip(d)) return;\n const out = d.run(el, { ...(d.defaults || {}), ...options }, ctx(event)) as any;\n if (out?.finished?.then) await out.finished.catch(() => undefined);\n else if (out?.then) await out;\n },\n bind(el, name, options = {}) {\n const { trigger = 'click', once, ...o } = options;\n const d = reg.get(name);\n if (!d) throw new Error(`[motionary] unknown effect \"${name}\"`);\n const stops: (() => void)[] = [];\n let current: (() => void)[] = [];\n const fire = (e?: Event) => {\n if (skip(d)) return;\n current.splice(0).forEach((f) => f());\n const out = d.run(el, { ...(d.defaults || {}), ...o }, ctx(e, current));\n if (typeof out === 'function') current.push(out as () => void);\n };\n const on = (type: string) => {\n const h = (e: Event) => fire(e);\n el.addEventListener(type, h, { once: !!once });\n stops.push(() => el.removeEventListener(type, h));\n };\n if (trigger === 'click') on('click');\n else if (trigger === 'hover') (on('pointerenter'), on('focusin'));\n else if (trigger === 'load' || trigger === 'loop') fire();\n else if (trigger === 'enter' && typeof IntersectionObserver !== 'undefined') {\n const io = new IntersectionObserver((es) =>\n es.forEach((en) => {\n if (!en.isIntersecting) return;\n fire();\n if (once !== false) io.disconnect();\n })\n );\n io.observe(el);\n stops.push(() => io.disconnect());\n }\n const off = () => {\n stops.splice(0).forEach((f) => f());\n current.splice(0).forEach((f) => f());\n offs.delete(off);\n };\n offs.add(off);\n return off;\n },\n reveal(targets, preset = 'fade-up', o = {}) {\n const els = list(targets);\n const kf = PRESETS[preset] || PRESETS.fade;\n const show = (el: HTMLElement, i: number) => {\n el.style.removeProperty('opacity');\n animate(el, reduced() ? PRESETS.fade : kf, { duration: o.duration ?? 600, delay: (o.delay ?? 0) + (o.stagger ?? 0) * i, easing: o.easing || EASE, fill: 'backwards' });\n };\n if (typeof IntersectionObserver === 'undefined') {\n els.forEach(show);\n return () => undefined;\n }\n els.forEach((el) => (el.style.opacity = '0'));\n let batch = 0;\n const io = new IntersectionObserver(\n (es) => {\n batch = 0;\n for (const en of es) {\n if (!en.isIntersecting) continue;\n show(en.target as HTMLElement, batch++);\n if (o.once !== false) io.unobserve(en.target);\n }\n },\n { threshold: o.threshold ?? 0.15 }\n );\n els.forEach((el) => io.observe(el));\n const off = () => {\n io.disconnect();\n els.forEach((el) => el.style.removeProperty('opacity'));\n offs.delete(off);\n };\n offs.add(off);\n return off;\n },\n pause() {\n paused = true;\n live.forEach((a) => a.pause());\n },\n resume() {\n paused = false;\n live.forEach((a) => a.play());\n },\n setRate(r) {\n if (!(r > 0)) return;\n rate = r;\n live.forEach((a) => (a.playbackRate = r));\n },\n destroy() {\n Array.from(offs).forEach((f) => f());\n live.forEach((a) => a.cancel());\n live.clear();\n },\n };\n m.use({ name: 'core/presets', effects: Object.entries(PRESETS).map(([name, frames]) => ({ name, kind: 'enter', defaults: { duration: 600, delay: 0, easing: EASE }, run: (el: HTMLElement, o: any, c: CoreEffectContext) => c.animate(el, c.reduced ? PRESETS.fade : frames, { duration: o.duration, delay: o.delay, easing: o.easing, fill: 'backwards' }) })) });\n return m;\n}\n"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;;;;AAkBG;AACI,MAAM,OAAO,GAAG;AAiDvB,MAAM,C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E,CAAC;AAClW,IAAA,OAAO,CAAC;AACV;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"core.cjs","sources":["../../src/components/core/attributes.ts","../../src/components/core/index.ts"],"sourcesContent":["/**\n * 10.2: declarative `data-motion` in `motionary/core` — no DSL package needed.\n *\n * ```html\n * <h1 data-motion=\"enter: fade-up 600ms\">Hello</h1>\n * <ul data-motion=\"enter: fade-up 500ms stagger 80ms\"> <li>…</li> <li>…</li> </ul>\n * <button data-motion=\"click: pop; hover: lift\">Buy</button>\n * ```\n * ```ts\n * import { createMotion, applyMotionAttributes } from 'motionary/core';\n * const stop = applyMotionAttributes(createMotion(), document, { observe: true });\n * ```\n *\n * Rule grammar (subset of the 9.0 DSL): `trigger: effect [duration] [delay <t>]\n * [stagger <t>] [ease <easing>] [once]`, rules separated by `;`. Triggers:\n * `enter`, `load`, `click`, `hover`, `loop`. Times: `600ms`, `0.6s`, `600`.\n * `stagger` animates the element's children. Effects are core presets or any\n * effect a plugin registered with `use()`.\n */\nimport { PRESETS, type MotionInstance, type Trigger } from './index';\n\nexport interface MotionAttrRule {\n trigger: Trigger;\n effect: string;\n duration?: number;\n delay?: number;\n stagger?: number;\n easing?: string;\n once?: boolean;\n}\n\nconst TRIGGERS = ['enter', 'load', 'click', 'hover', 'loop'];\nconst ms = (t: string): number => (t.endsWith('ms') ? parseFloat(t) : t.endsWith('s') ? parseFloat(t) * 1000 : parseFloat(t));\n\n/** Parse a `data-motion` value. Throws on an unknown trigger or a malformed rule. */\nexport function parseMotionAttr(value: string): MotionAttrRule[] {\n return value\n .split(';')\n .map((r) => r.trim())\n .filter(Boolean)\n .map((r) => {\n const m = /^([a-z]+)\\s*:\\s*(.+)$/i.exec(r);\n if (!m || !TRIGGERS.includes(m[1])) throw new Error(`[motionary] data-motion: bad rule \"${r}\" (use trigger: effect, trigger = ${TRIGGERS.join(' | ')})`);\n const toks = m[2].trim().split(/\\s+/);\n const rule: MotionAttrRule = { trigger: m[1] as Trigger, effect: toks.shift()! };\n for (let i = 0; i < toks.length; i++) {\n const t = toks[i];\n if (t === 'delay' || t === 'stagger') rule[t] = ms(toks[++i] || '0');\n else if (t === 'ease') rule.easing = toks[++i];\n else if (t === 'once') rule.once = true;\n else if (/^[\\d.]+(ms|s)?$/.test(t)) rule.duration = ms(t);\n else rule.easing = t;\n }\n return rule;\n });\n}\n\n/**\n * Wire every `[data-motion]` element under `root` to the motion instance.\n * `observe: true` also wires elements added later (MutationObserver).\n * Returns a function that unbinds everything. No-op without a DOM (SSR).\n */\nexport function applyMotionAttributes(m: MotionInstance, root: ParentNode | null = typeof document !== 'undefined' ? document : null, o: { attribute?: string; observe?: boolean } = {}): () => void {\n if (!root) return () => undefined;\n const attr = o.attribute || 'data-motion';\n const offs = new Map<Element, (() => void)[]>();\n const wire = (el: Element) => {\n if (offs.has(el)) return;\n const value = el.getAttribute(attr);\n if (!value) return;\n const list: (() => void)[] = [];\n for (const r of parseMotionAttr(value)) {\n const opts = { duration: r.duration, delay: r.delay, easing: r.easing };\n for (const k of Object.keys(opts) as (keyof typeof opts)[]) if (opts[k] === undefined) delete opts[k];\n if (r.trigger === 'enter' && r.effect in PRESETS) {\n list.push(m.reveal(r.stagger ? el.children : el, r.effect, { ...opts, stagger: r.stagger, once: r.once ?? true }));\n } else {\n if (!m.has(r.effect)) throw new Error(`[motionary] data-motion: unknown effect \"${r.effect}\" — register its plugin with createMotion().use(…)`);\n list.push(m.bind(el as HTMLElement, r.effect, { ...opts, trigger: r.trigger, once: r.once }));\n }\n }\n offs.set(el, list);\n el.setAttribute('data-motion-ready', '');\n };\n const scan = (n: ParentNode) => {\n if ((n as Element).getAttribute?.(attr)) wire(n as Element);\n n.querySelectorAll?.(`[${attr}]`).forEach(wire);\n };\n scan(root);\n let mo: MutationObserver | null = null;\n if (o.observe && typeof MutationObserver !== 'undefined') {\n mo = new MutationObserver((recs) => recs.forEach((r) => r.addedNodes.forEach((n) => n.nodeType === 1 && scan(n as Element))));\n mo.observe(root as Node, { childList: true, subtree: true });\n }\n return () => {\n mo?.disconnect();\n offs.forEach((l, el) => {\n l.forEach((f) => f());\n el.removeAttribute('data-motion-ready');\n });\n offs.clear();\n };\n}\n\n","/**\n * `motionary/core` (10.0) — the zero-dependency core, under 10 KB gzip.\n *\n * Everything else is a plugin: `createMotion().use(retro, cinema)` with the\n * packs from `motionary/plugins` (or your own `{ name, effects }`).\n *\n * - `createMotion({ reducedMotion, rate })` → an instance with `use()`,\n * `play(el, effect, options)`, `bind(el, effect, { trigger })`,\n * `reveal(targets, preset, { stagger, once, threshold })`, `animate()`,\n * `pause()` / `resume()` / `setRate()` for everything it started,\n * `effects()` and `destroy()`.\n * - `PRESETS` — entrance keyframes (fade, fade-up/down/left/right, scale,\n * zoom-in/out, blur-in, flip-up), registered as `enter` effects.\n * - `preferredBackend()` — `webgpu` (default when available) → `webgl2` →\n * `canvas`, the order GPU plugins use.\n *\n * Reduced motion is honoured everywhere (OS setting or `reducedMotion:\n * 'reduce'`): entrances fade, loops / backgrounds / cursors are skipped.\n */\nexport const VERSION = '10.0.0';\nexport { applyMotionAttributes, parseMotionAttr } from './attributes';\nexport type { MotionAttrRule } from './attributes';\n\nexport type CoreEffectKind = 'enter' | 'exit' | 'attention' | 'hover' | 'click' | 'loop' | 'background' | 'cursor' | 'text' | 'scroll' | (string & {});\nexport interface CoreEffectContext {\n reduced: boolean;\n sensitivity: 'full' | 'gentle' | 'minimal' | 'static';\n event?: Event;\n animate(el: Element, keyframes: Keyframe[] | PropertyIndexedKeyframes, options?: number | KeyframeAnimationOptions): Animation | null;\n onCleanup(fn: () => void): void;\n}\nexport interface CoreEffect {\n name: string;\n kind: CoreEffectKind;\n description?: string;\n defaults?: Record<string, unknown>;\n reduced?: 'skip' | 'run';\n run(el: HTMLElement, options: any, ctx: CoreEffectContext): unknown;\n}\nexport interface CorePlugin {\n name: string;\n effects?: CoreEffect[];\n install?(m: MotionInstance): void;\n}\nexport type Trigger = 'click' | 'hover' | 'enter' | 'load' | 'loop' | 'manual';\nexport interface RevealOptions {\n stagger?: number;\n delay?: number;\n duration?: number;\n easing?: string;\n once?: boolean;\n threshold?: number;\n}\nexport interface MotionInstance {\n readonly paused: boolean;\n readonly rate: number;\n use(...plugins: CorePlugin[]): MotionInstance;\n has(effect: string): boolean;\n effects(): string[];\n reduced(): boolean;\n animate(el: Element, keyframes: Keyframe[] | PropertyIndexedKeyframes, options?: number | KeyframeAnimationOptions): Animation | null;\n play(el: HTMLElement, effect: string, options?: Record<string, unknown>, event?: Event): Promise<void>;\n bind(el: HTMLElement, effect: string, options?: Record<string, unknown> & { trigger?: Trigger; once?: boolean }): () => void;\n reveal(targets: string | Element | ArrayLike<Element>, preset?: string, options?: RevealOptions): () => void;\n pause(): void;\n resume(): void;\n setRate(rate: number): void;\n destroy(): void;\n}\n\nconst T = (x: number, y: number, s = 1) => `translate(${x}px,${y}px) scale(${s})`;\n/** Entrance keyframes (10.0). */\nexport const PRESETS: Record<string, Keyframe[]> = {\n fade: [{ opacity: 0 }, { opacity: 1 }],\n 'fade-up': [{ opacity: 0, transform: T(0, 24) }, { opacity: 1, transform: 'none' }],\n 'fade-down': [{ opacity: 0, transform: T(0, -24) }, { opacity: 1, transform: 'none' }],\n 'fade-left': [{ opacity: 0, transform: T(24, 0) }, { opacity: 1, transform: 'none' }],\n 'fade-right': [{ opacity: 0, transform: T(-24, 0) }, { opacity: 1, transform: 'none' }],\n scale: [{ opacity: 0, transform: 'scale(.85)' }, { opacity: 1, transform: 'none' }],\n 'zoom-in': [{ opacity: 0, transform: 'scale(.6)' }, { opacity: 1, transform: 'none' }],\n 'zoom-out': [{ opacity: 0, transform: 'scale(1.2)' }, { opacity: 1, transform: 'none' }],\n 'blur-in': [{ opacity: 0, filter: 'blur(10px)' }, { opacity: 1, filter: 'none' }],\n 'flip-up': [{ opacity: 0, transform: 'perspective(600px) rotateX(-60deg)' }, { opacity: 1, transform: 'none' }],\n};\nconst EASE = 'cubic-bezier(0.22, 1, 0.36, 1)';\nconst SKIP: string[] = ['loop', 'background', 'cursor'];\n\n/** GPU backend order used by GPU plugins: WebGPU by default (10.0). */\nexport function preferredBackend(): 'webgpu' | 'webgl2' | 'canvas' {\n if (typeof navigator !== 'undefined' && (navigator as any).gpu) return 'webgpu';\n try {\n if (typeof document !== 'undefined' && document.createElement('canvas').getContext?.('webgl2')) return 'webgl2';\n } catch {\n /* no GL */\n }\n return 'canvas';\n}\n\nconst list = (t: string | Element | ArrayLike<Element>): HTMLElement[] =>\n typeof t === 'string' ? (typeof document === 'undefined' ? [] : Array.from(document.querySelectorAll<HTMLElement>(t))) : 'length' in (t as ArrayLike<Element>) && !(t instanceof Element) ? (Array.from(t as ArrayLike<Element>) as HTMLElement[]) : [t as HTMLElement];\n\n/** Create a Motionary core instance (10.0). */\nexport function createMotion(config: { reducedMotion?: 'user' | 'reduce'; rate?: number } = {}): MotionInstance {\n const reg = new Map<string, CoreEffect>();\n const plugins = new Set<string>();\n const live = new Set<Animation>();\n const offs = new Set<() => void>();\n let paused = false;\n let rate = config.rate && config.rate > 0 ? config.rate : 1;\n const reduced = () => config.reducedMotion === 'reduce' || (typeof matchMedia === 'function' && matchMedia('(prefers-reduced-motion: reduce)').matches);\n const animate: MotionInstance['animate'] = (el, kf, o) => {\n if (typeof (el as any).animate !== 'function') return null;\n const a = el.animate(kf, o);\n if (!a) return null;\n live.add(a);\n if (rate !== 1) a.playbackRate = rate;\n if (paused) a.pause();\n const done = () => live.delete(a);\n a.finished?.then(done, done);\n return a;\n };\n const ctx = (event?: Event, cleanups: (() => void)[] = []): CoreEffectContext => ({ reduced: reduced(), sensitivity: reduced() ? 'minimal' : 'full', event, animate, onCleanup: (f) => cleanups.push(f) });\n const skip = (d: CoreEffect) => reduced() && (d.reduced ?? (SKIP.includes(d.kind) ? 'skip' : 'run')) === 'skip';\n const m: MotionInstance = {\n get paused() {\n return paused;\n },\n get rate() {\n return rate;\n },\n use(...ps) {\n for (const p of ps) {\n if (!p || plugins.has(p.name)) continue;\n plugins.add(p.name);\n for (const e of p.effects || []) if (!reg.has(e.name)) reg.set(e.name, e);\n p.install?.(m);\n }\n return m;\n },\n has: (n) => reg.has(n),\n effects: () => Array.from(reg.keys()).sort(),\n reduced,\n animate,\n async play(el, name, options = {}, event) {\n const d = reg.get(name);\n if (!d) throw new Error(`[motionary] unknown effect \"${name}\" — add its plugin with use()`);\n if (skip(d)) return;\n const out = d.run(el, { ...(d.defaults || {}), ...options }, ctx(event)) as any;\n if (out?.finished?.then) await out.finished.catch(() => undefined);\n else if (out?.then) await out;\n },\n bind(el, name, options = {}) {\n const { trigger = 'click', once, ...o } = options;\n const d = reg.get(name);\n if (!d) throw new Error(`[motionary] unknown effect \"${name}\"`);\n const stops: (() => void)[] = [];\n let current: (() => void)[] = [];\n const fire = (e?: Event) => {\n if (skip(d)) return;\n current.splice(0).forEach((f) => f());\n const out = d.run(el, { ...(d.defaults || {}), ...o }, ctx(e, current));\n if (typeof out === 'function') current.push(out as () => void);\n };\n const on = (type: string) => {\n const h = (e: Event) => fire(e);\n el.addEventListener(type, h, { once: !!once });\n stops.push(() => el.removeEventListener(type, h));\n };\n if (trigger === 'click') on('click');\n else if (trigger === 'hover') (on('pointerenter'), on('focusin'));\n else if (trigger === 'load' || trigger === 'loop') fire();\n else if (trigger === 'enter' && typeof IntersectionObserver !== 'undefined') {\n const io = new IntersectionObserver((es) =>\n es.forEach((en) => {\n if (!en.isIntersecting) return;\n fire();\n if (once !== false) io.disconnect();\n })\n );\n io.observe(el);\n stops.push(() => io.disconnect());\n }\n const off = () => {\n stops.splice(0).forEach((f) => f());\n current.splice(0).forEach((f) => f());\n offs.delete(off);\n };\n offs.add(off);\n return off;\n },\n reveal(targets, preset = 'fade-up', o = {}) {\n const els = list(targets);\n const kf = PRESETS[preset] || PRESETS.fade;\n const show = (el: HTMLElement, i: number) => {\n el.style.removeProperty('opacity');\n animate(el, reduced() ? PRESETS.fade : kf, { duration: o.duration ?? 600, delay: (o.delay ?? 0) + (o.stagger ?? 0) * i, easing: o.easing || EASE, fill: 'backwards' });\n };\n if (typeof IntersectionObserver === 'undefined') {\n els.forEach(show);\n return () => undefined;\n }\n els.forEach((el) => (el.style.opacity = '0'));\n let batch = 0;\n const io = new IntersectionObserver(\n (es) => {\n batch = 0;\n for (const en of es) {\n if (!en.isIntersecting) continue;\n show(en.target as HTMLElement, batch++);\n if (o.once !== false) io.unobserve(en.target);\n }\n },\n { threshold: o.threshold ?? 0.15 }\n );\n els.forEach((el) => io.observe(el));\n const off = () => {\n io.disconnect();\n els.forEach((el) => el.style.removeProperty('opacity'));\n offs.delete(off);\n };\n offs.add(off);\n return off;\n },\n pause() {\n paused = true;\n live.forEach((a) => a.pause());\n },\n resume() {\n paused = false;\n live.forEach((a) => a.play());\n },\n setRate(r) {\n if (!(r > 0)) return;\n rate = r;\n live.forEach((a) => (a.playbackRate = r));\n },\n destroy() {\n Array.from(offs).forEach((f) => f());\n live.forEach((a) => a.cancel());\n live.clear();\n },\n };\n m.use({ name: 'core/presets', effects: Object.entries(PRESETS).map(([name, frames]) => ({ name, kind: 'enter', defaults: { duration: 600, delay: 0, easing: EASE }, run: (el: HTMLElement, o: any, c: CoreEffectContext) => c.animate(el, c.reduced ? PRESETS.fade : frames, { duration: o.duration, delay: o.delay, easing: o.easing, fill: 'backwards' }) })) });\n return m;\n}\n"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;;;;AAkBG;AAaH,MAAM,QAAQ,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC;AAC5D,MAAM,EAAE,GAAG,CAAC,CAAS,MAAc,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;AAE7H;AACM,SAAU,eAAe,CAAC,KAAa,EAAA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AAE;QACd,CAAC;KACF;IACD,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC,EAAe,EAAE,CAAM,EAAE,CAAoB,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;AAClW,IAAA,OAAO,CAAC;AACV;;;;;;;;;"}
|
|
@@ -1,3 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 10.2: declarative `data-motion` in `motionary/core` — no DSL package needed.
|
|
3
|
+
*
|
|
4
|
+
* ```html
|
|
5
|
+
* <h1 data-motion="enter: fade-up 600ms">Hello</h1>
|
|
6
|
+
* <ul data-motion="enter: fade-up 500ms stagger 80ms"> <li>…</li> <li>…</li> </ul>
|
|
7
|
+
* <button data-motion="click: pop; hover: lift">Buy</button>
|
|
8
|
+
* ```
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { createMotion, applyMotionAttributes } from 'motionary/core';
|
|
11
|
+
* const stop = applyMotionAttributes(createMotion(), document, { observe: true });
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* Rule grammar (subset of the 9.0 DSL): `trigger: effect [duration] [delay <t>]
|
|
15
|
+
* [stagger <t>] [ease <easing>] [once]`, rules separated by `;`. Triggers:
|
|
16
|
+
* `enter`, `load`, `click`, `hover`, `loop`. Times: `600ms`, `0.6s`, `600`.
|
|
17
|
+
* `stagger` animates the element's children. Effects are core presets or any
|
|
18
|
+
* effect a plugin registered with `use()`.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
interface MotionAttrRule {
|
|
22
|
+
trigger: Trigger;
|
|
23
|
+
effect: string;
|
|
24
|
+
duration?: number;
|
|
25
|
+
delay?: number;
|
|
26
|
+
stagger?: number;
|
|
27
|
+
easing?: string;
|
|
28
|
+
once?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/** Parse a `data-motion` value. Throws on an unknown trigger or a malformed rule. */
|
|
31
|
+
declare function parseMotionAttr(value: string): MotionAttrRule[];
|
|
32
|
+
/**
|
|
33
|
+
* Wire every `[data-motion]` element under `root` to the motion instance.
|
|
34
|
+
* `observe: true` also wires elements added later (MutationObserver).
|
|
35
|
+
* Returns a function that unbinds everything. No-op without a DOM (SSR).
|
|
36
|
+
*/
|
|
37
|
+
declare function applyMotionAttributes(m: MotionInstance, root?: ParentNode | null, o?: {
|
|
38
|
+
attribute?: string;
|
|
39
|
+
observe?: boolean;
|
|
40
|
+
}): () => void;
|
|
41
|
+
|
|
1
42
|
/**
|
|
2
43
|
* `motionary/core` (10.0) — the zero-dependency core, under 10 KB gzip.
|
|
3
44
|
*
|
|
@@ -18,6 +59,7 @@
|
|
|
18
59
|
* 'reduce'`): entrances fade, loops / backgrounds / cursors are skipped.
|
|
19
60
|
*/
|
|
20
61
|
declare const VERSION = "10.0.0";
|
|
62
|
+
|
|
21
63
|
type CoreEffectKind = 'enter' | 'exit' | 'attention' | 'hover' | 'click' | 'loop' | 'background' | 'cursor' | 'text' | 'scroll' | (string & {});
|
|
22
64
|
interface CoreEffectContext {
|
|
23
65
|
reduced: boolean;
|
|
@@ -77,5 +119,5 @@ declare function createMotion(config?: {
|
|
|
77
119
|
rate?: number;
|
|
78
120
|
}): MotionInstance;
|
|
79
121
|
|
|
80
|
-
export { PRESETS, VERSION, createMotion, preferredBackend };
|
|
81
|
-
export type { CoreEffect, CoreEffectContext, CoreEffectKind, CorePlugin, MotionInstance, RevealOptions, Trigger };
|
|
122
|
+
export { PRESETS, VERSION, applyMotionAttributes, createMotion, parseMotionAttr, preferredBackend };
|
|
123
|
+
export type { CoreEffect, CoreEffectContext, CoreEffectKind, CorePlugin, MotionAttrRule, MotionInstance, RevealOptions, Trigger };
|
|
@@ -1,3 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 10.2: declarative `data-motion` in `motionary/core` — no DSL package needed.
|
|
3
|
+
*
|
|
4
|
+
* ```html
|
|
5
|
+
* <h1 data-motion="enter: fade-up 600ms">Hello</h1>
|
|
6
|
+
* <ul data-motion="enter: fade-up 500ms stagger 80ms"> <li>…</li> <li>…</li> </ul>
|
|
7
|
+
* <button data-motion="click: pop; hover: lift">Buy</button>
|
|
8
|
+
* ```
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { createMotion, applyMotionAttributes } from 'motionary/core';
|
|
11
|
+
* const stop = applyMotionAttributes(createMotion(), document, { observe: true });
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* Rule grammar (subset of the 9.0 DSL): `trigger: effect [duration] [delay <t>]
|
|
15
|
+
* [stagger <t>] [ease <easing>] [once]`, rules separated by `;`. Triggers:
|
|
16
|
+
* `enter`, `load`, `click`, `hover`, `loop`. Times: `600ms`, `0.6s`, `600`.
|
|
17
|
+
* `stagger` animates the element's children. Effects are core presets or any
|
|
18
|
+
* effect a plugin registered with `use()`.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
interface MotionAttrRule {
|
|
22
|
+
trigger: Trigger;
|
|
23
|
+
effect: string;
|
|
24
|
+
duration?: number;
|
|
25
|
+
delay?: number;
|
|
26
|
+
stagger?: number;
|
|
27
|
+
easing?: string;
|
|
28
|
+
once?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/** Parse a `data-motion` value. Throws on an unknown trigger or a malformed rule. */
|
|
31
|
+
declare function parseMotionAttr(value: string): MotionAttrRule[];
|
|
32
|
+
/**
|
|
33
|
+
* Wire every `[data-motion]` element under `root` to the motion instance.
|
|
34
|
+
* `observe: true` also wires elements added later (MutationObserver).
|
|
35
|
+
* Returns a function that unbinds everything. No-op without a DOM (SSR).
|
|
36
|
+
*/
|
|
37
|
+
declare function applyMotionAttributes(m: MotionInstance, root?: ParentNode | null, o?: {
|
|
38
|
+
attribute?: string;
|
|
39
|
+
observe?: boolean;
|
|
40
|
+
}): () => void;
|
|
41
|
+
|
|
1
42
|
/**
|
|
2
43
|
* `motionary/core` (10.0) — the zero-dependency core, under 10 KB gzip.
|
|
3
44
|
*
|
|
@@ -18,6 +59,7 @@
|
|
|
18
59
|
* 'reduce'`): entrances fade, loops / backgrounds / cursors are skipped.
|
|
19
60
|
*/
|
|
20
61
|
declare const VERSION = "10.0.0";
|
|
62
|
+
|
|
21
63
|
type CoreEffectKind = 'enter' | 'exit' | 'attention' | 'hover' | 'click' | 'loop' | 'background' | 'cursor' | 'text' | 'scroll' | (string & {});
|
|
22
64
|
interface CoreEffectContext {
|
|
23
65
|
reduced: boolean;
|
|
@@ -77,5 +119,5 @@ declare function createMotion(config?: {
|
|
|
77
119
|
rate?: number;
|
|
78
120
|
}): MotionInstance;
|
|
79
121
|
|
|
80
|
-
export { PRESETS, VERSION, createMotion, preferredBackend };
|
|
81
|
-
export type { CoreEffect, CoreEffectContext, CoreEffectKind, CorePlugin, MotionInstance, RevealOptions, Trigger };
|
|
122
|
+
export { PRESETS, VERSION, applyMotionAttributes, createMotion, parseMotionAttr, preferredBackend };
|
|
123
|
+
export type { CoreEffect, CoreEffectContext, CoreEffectKind, CorePlugin, MotionAttrRule, MotionInstance, RevealOptions, Trigger };
|
package/dist/components/core.js
CHANGED
|
@@ -1,3 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 10.2: declarative `data-motion` in `motionary/core` — no DSL package needed.
|
|
3
|
+
*
|
|
4
|
+
* ```html
|
|
5
|
+
* <h1 data-motion="enter: fade-up 600ms">Hello</h1>
|
|
6
|
+
* <ul data-motion="enter: fade-up 500ms stagger 80ms"> <li>…</li> <li>…</li> </ul>
|
|
7
|
+
* <button data-motion="click: pop; hover: lift">Buy</button>
|
|
8
|
+
* ```
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { createMotion, applyMotionAttributes } from 'motionary/core';
|
|
11
|
+
* const stop = applyMotionAttributes(createMotion(), document, { observe: true });
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* Rule grammar (subset of the 9.0 DSL): `trigger: effect [duration] [delay <t>]
|
|
15
|
+
* [stagger <t>] [ease <easing>] [once]`, rules separated by `;`. Triggers:
|
|
16
|
+
* `enter`, `load`, `click`, `hover`, `loop`. Times: `600ms`, `0.6s`, `600`.
|
|
17
|
+
* `stagger` animates the element's children. Effects are core presets or any
|
|
18
|
+
* effect a plugin registered with `use()`.
|
|
19
|
+
*/
|
|
20
|
+
const TRIGGERS = ['enter', 'load', 'click', 'hover', 'loop'];
|
|
21
|
+
const ms = (t) => (t.endsWith('ms') ? parseFloat(t) : t.endsWith('s') ? parseFloat(t) * 1000 : parseFloat(t));
|
|
22
|
+
/** Parse a `data-motion` value. Throws on an unknown trigger or a malformed rule. */
|
|
23
|
+
function parseMotionAttr(value) {
|
|
24
|
+
return value
|
|
25
|
+
.split(';')
|
|
26
|
+
.map((r) => r.trim())
|
|
27
|
+
.filter(Boolean)
|
|
28
|
+
.map((r) => {
|
|
29
|
+
const m = /^([a-z]+)\s*:\s*(.+)$/i.exec(r);
|
|
30
|
+
if (!m || !TRIGGERS.includes(m[1]))
|
|
31
|
+
throw new Error(`[motionary] data-motion: bad rule "${r}" (use trigger: effect, trigger = ${TRIGGERS.join(' | ')})`);
|
|
32
|
+
const toks = m[2].trim().split(/\s+/);
|
|
33
|
+
const rule = { trigger: m[1], effect: toks.shift() };
|
|
34
|
+
for (let i = 0; i < toks.length; i++) {
|
|
35
|
+
const t = toks[i];
|
|
36
|
+
if (t === 'delay' || t === 'stagger')
|
|
37
|
+
rule[t] = ms(toks[++i] || '0');
|
|
38
|
+
else if (t === 'ease')
|
|
39
|
+
rule.easing = toks[++i];
|
|
40
|
+
else if (t === 'once')
|
|
41
|
+
rule.once = true;
|
|
42
|
+
else if (/^[\d.]+(ms|s)?$/.test(t))
|
|
43
|
+
rule.duration = ms(t);
|
|
44
|
+
else
|
|
45
|
+
rule.easing = t;
|
|
46
|
+
}
|
|
47
|
+
return rule;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Wire every `[data-motion]` element under `root` to the motion instance.
|
|
52
|
+
* `observe: true` also wires elements added later (MutationObserver).
|
|
53
|
+
* Returns a function that unbinds everything. No-op without a DOM (SSR).
|
|
54
|
+
*/
|
|
55
|
+
function applyMotionAttributes(m, root = typeof document !== 'undefined' ? document : null, o = {}) {
|
|
56
|
+
if (!root)
|
|
57
|
+
return () => undefined;
|
|
58
|
+
const attr = o.attribute || 'data-motion';
|
|
59
|
+
const offs = new Map();
|
|
60
|
+
const wire = (el) => {
|
|
61
|
+
if (offs.has(el))
|
|
62
|
+
return;
|
|
63
|
+
const value = el.getAttribute(attr);
|
|
64
|
+
if (!value)
|
|
65
|
+
return;
|
|
66
|
+
const list = [];
|
|
67
|
+
for (const r of parseMotionAttr(value)) {
|
|
68
|
+
const opts = { duration: r.duration, delay: r.delay, easing: r.easing };
|
|
69
|
+
for (const k of Object.keys(opts))
|
|
70
|
+
if (opts[k] === undefined)
|
|
71
|
+
delete opts[k];
|
|
72
|
+
if (r.trigger === 'enter' && r.effect in PRESETS) {
|
|
73
|
+
list.push(m.reveal(r.stagger ? el.children : el, r.effect, { ...opts, stagger: r.stagger, once: r.once ?? true }));
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
if (!m.has(r.effect))
|
|
77
|
+
throw new Error(`[motionary] data-motion: unknown effect "${r.effect}" — register its plugin with createMotion().use(…)`);
|
|
78
|
+
list.push(m.bind(el, r.effect, { ...opts, trigger: r.trigger, once: r.once }));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
offs.set(el, list);
|
|
82
|
+
el.setAttribute('data-motion-ready', '');
|
|
83
|
+
};
|
|
84
|
+
const scan = (n) => {
|
|
85
|
+
if (n.getAttribute?.(attr))
|
|
86
|
+
wire(n);
|
|
87
|
+
n.querySelectorAll?.(`[${attr}]`).forEach(wire);
|
|
88
|
+
};
|
|
89
|
+
scan(root);
|
|
90
|
+
let mo = null;
|
|
91
|
+
if (o.observe && typeof MutationObserver !== 'undefined') {
|
|
92
|
+
mo = new MutationObserver((recs) => recs.forEach((r) => r.addedNodes.forEach((n) => n.nodeType === 1 && scan(n))));
|
|
93
|
+
mo.observe(root, { childList: true, subtree: true });
|
|
94
|
+
}
|
|
95
|
+
return () => {
|
|
96
|
+
mo?.disconnect();
|
|
97
|
+
offs.forEach((l, el) => {
|
|
98
|
+
l.forEach((f) => f());
|
|
99
|
+
el.removeAttribute('data-motion-ready');
|
|
100
|
+
});
|
|
101
|
+
offs.clear();
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
1
105
|
/**
|
|
2
106
|
* `motionary/core` (10.0) — the zero-dependency core, under 10 KB gzip.
|
|
3
107
|
*
|
|
@@ -210,5 +314,5 @@ function createMotion(config = {}) {
|
|
|
210
314
|
return m;
|
|
211
315
|
}
|
|
212
316
|
|
|
213
|
-
export { PRESETS, VERSION, createMotion, preferredBackend };
|
|
317
|
+
export { PRESETS, VERSION, applyMotionAttributes, createMotion, parseMotionAttr, preferredBackend };
|
|
214
318
|
//# sourceMappingURL=core.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.js","sources":["../../src/components/core/index.ts"],"sourcesContent":["/**\n * `motionary/core` (10.0) — the zero-dependency core, under 10 KB gzip.\n *\n * Everything else is a plugin: `createMotion().use(retro, cinema)` with the\n * packs from `motionary/plugins` (or your own `{ name, effects }`).\n *\n * - `createMotion({ reducedMotion, rate })` → an instance with `use()`,\n * `play(el, effect, options)`, `bind(el, effect, { trigger })`,\n * `reveal(targets, preset, { stagger, once, threshold })`, `animate()`,\n * `pause()` / `resume()` / `setRate()` for everything it started,\n * `effects()` and `destroy()`.\n * - `PRESETS` — entrance keyframes (fade, fade-up/down/left/right, scale,\n * zoom-in/out, blur-in, flip-up), registered as `enter` effects.\n * - `preferredBackend()` — `webgpu` (default when available) → `webgl2` →\n * `canvas`, the order GPU plugins use.\n *\n * Reduced motion is honoured everywhere (OS setting or `reducedMotion:\n * 'reduce'`): entrances fade, loops / backgrounds / cursors are skipped.\n */\nexport const VERSION = '10.0.0';\n\nexport type CoreEffectKind = 'enter' | 'exit' | 'attention' | 'hover' | 'click' | 'loop' | 'background' | 'cursor' | 'text' | 'scroll' | (string & {});\nexport interface CoreEffectContext {\n reduced: boolean;\n sensitivity: 'full' | 'gentle' | 'minimal' | 'static';\n event?: Event;\n animate(el: Element, keyframes: Keyframe[] | PropertyIndexedKeyframes, options?: number | KeyframeAnimationOptions): Animation | null;\n onCleanup(fn: () => void): void;\n}\nexport interface CoreEffect {\n name: string;\n kind: CoreEffectKind;\n description?: string;\n defaults?: Record<string, unknown>;\n reduced?: 'skip' | 'run';\n run(el: HTMLElement, options: any, ctx: CoreEffectContext): unknown;\n}\nexport interface CorePlugin {\n name: string;\n effects?: CoreEffect[];\n install?(m: MotionInstance): void;\n}\nexport type Trigger = 'click' | 'hover' | 'enter' | 'load' | 'loop' | 'manual';\nexport interface RevealOptions {\n stagger?: number;\n delay?: number;\n duration?: number;\n easing?: string;\n once?: boolean;\n threshold?: number;\n}\nexport interface MotionInstance {\n readonly paused: boolean;\n readonly rate: number;\n use(...plugins: CorePlugin[]): MotionInstance;\n has(effect: string): boolean;\n effects(): string[];\n reduced(): boolean;\n animate(el: Element, keyframes: Keyframe[] | PropertyIndexedKeyframes, options?: number | KeyframeAnimationOptions): Animation | null;\n play(el: HTMLElement, effect: string, options?: Record<string, unknown>, event?: Event): Promise<void>;\n bind(el: HTMLElement, effect: string, options?: Record<string, unknown> & { trigger?: Trigger; once?: boolean }): () => void;\n reveal(targets: string | Element | ArrayLike<Element>, preset?: string, options?: RevealOptions): () => void;\n pause(): void;\n resume(): void;\n setRate(rate: number): void;\n destroy(): void;\n}\n\nconst T = (x: number, y: number, s = 1) => `translate(${x}px,${y}px) scale(${s})`;\n/** Entrance keyframes (10.0). */\nexport const PRESETS: Record<string, Keyframe[]> = {\n fade: [{ opacity: 0 }, { opacity: 1 }],\n 'fade-up': [{ opacity: 0, transform: T(0, 24) }, { opacity: 1, transform: 'none' }],\n 'fade-down': [{ opacity: 0, transform: T(0, -24) }, { opacity: 1, transform: 'none' }],\n 'fade-left': [{ opacity: 0, transform: T(24, 0) }, { opacity: 1, transform: 'none' }],\n 'fade-right': [{ opacity: 0, transform: T(-24, 0) }, { opacity: 1, transform: 'none' }],\n scale: [{ opacity: 0, transform: 'scale(.85)' }, { opacity: 1, transform: 'none' }],\n 'zoom-in': [{ opacity: 0, transform: 'scale(.6)' }, { opacity: 1, transform: 'none' }],\n 'zoom-out': [{ opacity: 0, transform: 'scale(1.2)' }, { opacity: 1, transform: 'none' }],\n 'blur-in': [{ opacity: 0, filter: 'blur(10px)' }, { opacity: 1, filter: 'none' }],\n 'flip-up': [{ opacity: 0, transform: 'perspective(600px) rotateX(-60deg)' }, { opacity: 1, transform: 'none' }],\n};\nconst EASE = 'cubic-bezier(0.22, 1, 0.36, 1)';\nconst SKIP: string[] = ['loop', 'background', 'cursor'];\n\n/** GPU backend order used by GPU plugins: WebGPU by default (10.0). */\nexport function preferredBackend(): 'webgpu' | 'webgl2' | 'canvas' {\n if (typeof navigator !== 'undefined' && (navigator as any).gpu) return 'webgpu';\n try {\n if (typeof document !== 'undefined' && document.createElement('canvas').getContext?.('webgl2')) return 'webgl2';\n } catch {\n /* no GL */\n }\n return 'canvas';\n}\n\nconst list = (t: string | Element | ArrayLike<Element>): HTMLElement[] =>\n typeof t === 'string' ? (typeof document === 'undefined' ? [] : Array.from(document.querySelectorAll<HTMLElement>(t))) : 'length' in (t as ArrayLike<Element>) && !(t instanceof Element) ? (Array.from(t as ArrayLike<Element>) as HTMLElement[]) : [t as HTMLElement];\n\n/** Create a Motionary core instance (10.0). */\nexport function createMotion(config: { reducedMotion?: 'user' | 'reduce'; rate?: number } = {}): MotionInstance {\n const reg = new Map<string, CoreEffect>();\n const plugins = new Set<string>();\n const live = new Set<Animation>();\n const offs = new Set<() => void>();\n let paused = false;\n let rate = config.rate && config.rate > 0 ? config.rate : 1;\n const reduced = () => config.reducedMotion === 'reduce' || (typeof matchMedia === 'function' && matchMedia('(prefers-reduced-motion: reduce)').matches);\n const animate: MotionInstance['animate'] = (el, kf, o) => {\n if (typeof (el as any).animate !== 'function') return null;\n const a = el.animate(kf, o);\n if (!a) return null;\n live.add(a);\n if (rate !== 1) a.playbackRate = rate;\n if (paused) a.pause();\n const done = () => live.delete(a);\n a.finished?.then(done, done);\n return a;\n };\n const ctx = (event?: Event, cleanups: (() => void)[] = []): CoreEffectContext => ({ reduced: reduced(), sensitivity: reduced() ? 'minimal' : 'full', event, animate, onCleanup: (f) => cleanups.push(f) });\n const skip = (d: CoreEffect) => reduced() && (d.reduced ?? (SKIP.includes(d.kind) ? 'skip' : 'run')) === 'skip';\n const m: MotionInstance = {\n get paused() {\n return paused;\n },\n get rate() {\n return rate;\n },\n use(...ps) {\n for (const p of ps) {\n if (!p || plugins.has(p.name)) continue;\n plugins.add(p.name);\n for (const e of p.effects || []) if (!reg.has(e.name)) reg.set(e.name, e);\n p.install?.(m);\n }\n return m;\n },\n has: (n) => reg.has(n),\n effects: () => Array.from(reg.keys()).sort(),\n reduced,\n animate,\n async play(el, name, options = {}, event) {\n const d = reg.get(name);\n if (!d) throw new Error(`[motionary] unknown effect \"${name}\" — add its plugin with use()`);\n if (skip(d)) return;\n const out = d.run(el, { ...(d.defaults || {}), ...options }, ctx(event)) as any;\n if (out?.finished?.then) await out.finished.catch(() => undefined);\n else if (out?.then) await out;\n },\n bind(el, name, options = {}) {\n const { trigger = 'click', once, ...o } = options;\n const d = reg.get(name);\n if (!d) throw new Error(`[motionary] unknown effect \"${name}\"`);\n const stops: (() => void)[] = [];\n let current: (() => void)[] = [];\n const fire = (e?: Event) => {\n if (skip(d)) return;\n current.splice(0).forEach((f) => f());\n const out = d.run(el, { ...(d.defaults || {}), ...o }, ctx(e, current));\n if (typeof out === 'function') current.push(out as () => void);\n };\n const on = (type: string) => {\n const h = (e: Event) => fire(e);\n el.addEventListener(type, h, { once: !!once });\n stops.push(() => el.removeEventListener(type, h));\n };\n if (trigger === 'click') on('click');\n else if (trigger === 'hover') (on('pointerenter'), on('focusin'));\n else if (trigger === 'load' || trigger === 'loop') fire();\n else if (trigger === 'enter' && typeof IntersectionObserver !== 'undefined') {\n const io = new IntersectionObserver((es) =>\n es.forEach((en) => {\n if (!en.isIntersecting) return;\n fire();\n if (once !== false) io.disconnect();\n })\n );\n io.observe(el);\n stops.push(() => io.disconnect());\n }\n const off = () => {\n stops.splice(0).forEach((f) => f());\n current.splice(0).forEach((f) => f());\n offs.delete(off);\n };\n offs.add(off);\n return off;\n },\n reveal(targets, preset = 'fade-up', o = {}) {\n const els = list(targets);\n const kf = PRESETS[preset] || PRESETS.fade;\n const show = (el: HTMLElement, i: number) => {\n el.style.removeProperty('opacity');\n animate(el, reduced() ? PRESETS.fade : kf, { duration: o.duration ?? 600, delay: (o.delay ?? 0) + (o.stagger ?? 0) * i, easing: o.easing || EASE, fill: 'backwards' });\n };\n if (typeof IntersectionObserver === 'undefined') {\n els.forEach(show);\n return () => undefined;\n }\n els.forEach((el) => (el.style.opacity = '0'));\n let batch = 0;\n const io = new IntersectionObserver(\n (es) => {\n batch = 0;\n for (const en of es) {\n if (!en.isIntersecting) continue;\n show(en.target as HTMLElement, batch++);\n if (o.once !== false) io.unobserve(en.target);\n }\n },\n { threshold: o.threshold ?? 0.15 }\n );\n els.forEach((el) => io.observe(el));\n const off = () => {\n io.disconnect();\n els.forEach((el) => el.style.removeProperty('opacity'));\n offs.delete(off);\n };\n offs.add(off);\n return off;\n },\n pause() {\n paused = true;\n live.forEach((a) => a.pause());\n },\n resume() {\n paused = false;\n live.forEach((a) => a.play());\n },\n setRate(r) {\n if (!(r > 0)) return;\n rate = r;\n live.forEach((a) => (a.playbackRate = r));\n },\n destroy() {\n Array.from(offs).forEach((f) => f());\n live.forEach((a) => a.cancel());\n live.clear();\n },\n };\n m.use({ name: 'core/presets', effects: Object.entries(PRESETS).map(([name, frames]) => ({ name, kind: 'enter', defaults: { duration: 600, delay: 0, easing: EASE }, run: (el: HTMLElement, o: any, c: CoreEffectContext) => c.animate(el, c.reduced ? PRESETS.fade : frames, { duration: o.duration, delay: o.delay, easing: o.easing, fill: 'backwards' }) })) });\n return m;\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;AAkBG;AACI,MAAM,OAAO,GAAG;AAiDvB,MAAM,CAAC,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,CAAC,GAAG,CAAC,KAAK,aAAa,CAAC,CAAA,GAAA,EAAM,CAAC,CAAA,UAAA,EAAa,CAAC,GAAG;AACjF;AACO,MAAM,OAAO,GAA+B;AACjD,IAAA,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IACtC,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;IACnF,WAAW,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,MA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C;KACF;IACD,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC,EAAe,EAAE,CAAM,EAAE,CAAoB,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;AAClW,IAAA,OAAO,CAAC;AACV;;;;"}
|
|
1
|
+
{"version":3,"file":"core.js","sources":["../../src/components/core/attributes.ts","../../src/components/core/index.ts"],"sourcesContent":["/**\n * 10.2: declarative `data-motion` in `motionary/core` — no DSL package needed.\n *\n * ```html\n * <h1 data-motion=\"enter: fade-up 600ms\">Hello</h1>\n * <ul data-motion=\"enter: fade-up 500ms stagger 80ms\"> <li>…</li> <li>…</li> </ul>\n * <button data-motion=\"click: pop; hover: lift\">Buy</button>\n * ```\n * ```ts\n * import { createMotion, applyMotionAttributes } from 'motionary/core';\n * const stop = applyMotionAttributes(createMotion(), document, { observe: true });\n * ```\n *\n * Rule grammar (subset of the 9.0 DSL): `trigger: effect [duration] [delay <t>]\n * [stagger <t>] [ease <easing>] [once]`, rules separated by `;`. Triggers:\n * `enter`, `load`, `click`, `hover`, `loop`. Times: `600ms`, `0.6s`, `600`.\n * `stagger` animates the element's children. Effects are core presets or any\n * effect a plugin registered with `use()`.\n */\nimport { PRESETS, type MotionInstance, type Trigger } from './index';\n\nexport interface MotionAttrRule {\n trigger: Trigger;\n effect: string;\n duration?: number;\n delay?: number;\n stagger?: number;\n easing?: string;\n once?: boolean;\n}\n\nconst TRIGGERS = ['enter', 'load', 'click', 'hover', 'loop'];\nconst ms = (t: string): number => (t.endsWith('ms') ? parseFloat(t) : t.endsWith('s') ? parseFloat(t) * 1000 : parseFloat(t));\n\n/** Parse a `data-motion` value. Throws on an unknown trigger or a malformed rule. */\nexport function parseMotionAttr(value: string): MotionAttrRule[] {\n return value\n .split(';')\n .map((r) => r.trim())\n .filter(Boolean)\n .map((r) => {\n const m = /^([a-z]+)\\s*:\\s*(.+)$/i.exec(r);\n if (!m || !TRIGGERS.includes(m[1])) throw new Error(`[motionary] data-motion: bad rule \"${r}\" (use trigger: effect, trigger = ${TRIGGERS.join(' | ')})`);\n const toks = m[2].trim().split(/\\s+/);\n const rule: MotionAttrRule = { trigger: m[1] as Trigger, effect: toks.shift()! };\n for (let i = 0; i < toks.length; i++) {\n const t = toks[i];\n if (t === 'delay' || t === 'stagger') rule[t] = ms(toks[++i] || '0');\n else if (t === 'ease') rule.easing = toks[++i];\n else if (t === 'once') rule.once = true;\n else if (/^[\\d.]+(ms|s)?$/.test(t)) rule.duration = ms(t);\n else rule.easing = t;\n }\n return rule;\n });\n}\n\n/**\n * Wire every `[data-motion]` element under `root` to the motion instance.\n * `observe: true` also wires elements added later (MutationObserver).\n * Returns a function that unbinds everything. No-op without a DOM (SSR).\n */\nexport function applyMotionAttributes(m: MotionInstance, root: ParentNode | null = typeof document !== 'undefined' ? document : null, o: { attribute?: string; observe?: boolean } = {}): () => void {\n if (!root) return () => undefined;\n const attr = o.attribute || 'data-motion';\n const offs = new Map<Element, (() => void)[]>();\n const wire = (el: Element) => {\n if (offs.has(el)) return;\n const value = el.getAttribute(attr);\n if (!value) return;\n const list: (() => void)[] = [];\n for (const r of parseMotionAttr(value)) {\n const opts = { duration: r.duration, delay: r.delay, easing: r.easing };\n for (const k of Object.keys(opts) as (keyof typeof opts)[]) if (opts[k] === undefined) delete opts[k];\n if (r.trigger === 'enter' && r.effect in PRESETS) {\n list.push(m.reveal(r.stagger ? el.children : el, r.effect, { ...opts, stagger: r.stagger, once: r.once ?? true }));\n } else {\n if (!m.has(r.effect)) throw new Error(`[motionary] data-motion: unknown effect \"${r.effect}\" — register its plugin with createMotion().use(…)`);\n list.push(m.bind(el as HTMLElement, r.effect, { ...opts, trigger: r.trigger, once: r.once }));\n }\n }\n offs.set(el, list);\n el.setAttribute('data-motion-ready', '');\n };\n const scan = (n: ParentNode) => {\n if ((n as Element).getAttribute?.(attr)) wire(n as Element);\n n.querySelectorAll?.(`[${attr}]`).forEach(wire);\n };\n scan(root);\n let mo: MutationObserver | null = null;\n if (o.observe && typeof MutationObserver !== 'undefined') {\n mo = new MutationObserver((recs) => recs.forEach((r) => r.addedNodes.forEach((n) => n.nodeType === 1 && scan(n as Element))));\n mo.observe(root as Node, { childList: true, subtree: true });\n }\n return () => {\n mo?.disconnect();\n offs.forEach((l, el) => {\n l.forEach((f) => f());\n el.removeAttribute('data-motion-ready');\n });\n offs.clear();\n };\n}\n\n","/**\n * `motionary/core` (10.0) — the zero-dependency core, under 10 KB gzip.\n *\n * Everything else is a plugin: `createMotion().use(retro, cinema)` with the\n * packs from `motionary/plugins` (or your own `{ name, effects }`).\n *\n * - `createMotion({ reducedMotion, rate })` → an instance with `use()`,\n * `play(el, effect, options)`, `bind(el, effect, { trigger })`,\n * `reveal(targets, preset, { stagger, once, threshold })`, `animate()`,\n * `pause()` / `resume()` / `setRate()` for everything it started,\n * `effects()` and `destroy()`.\n * - `PRESETS` — entrance keyframes (fade, fade-up/down/left/right, scale,\n * zoom-in/out, blur-in, flip-up), registered as `enter` effects.\n * - `preferredBackend()` — `webgpu` (default when available) → `webgl2` →\n * `canvas`, the order GPU plugins use.\n *\n * Reduced motion is honoured everywhere (OS setting or `reducedMotion:\n * 'reduce'`): entrances fade, loops / backgrounds / cursors are skipped.\n */\nexport const VERSION = '10.0.0';\nexport { applyMotionAttributes, parseMotionAttr } from './attributes';\nexport type { MotionAttrRule } from './attributes';\n\nexport type CoreEffectKind = 'enter' | 'exit' | 'attention' | 'hover' | 'click' | 'loop' | 'background' | 'cursor' | 'text' | 'scroll' | (string & {});\nexport interface CoreEffectContext {\n reduced: boolean;\n sensitivity: 'full' | 'gentle' | 'minimal' | 'static';\n event?: Event;\n animate(el: Element, keyframes: Keyframe[] | PropertyIndexedKeyframes, options?: number | KeyframeAnimationOptions): Animation | null;\n onCleanup(fn: () => void): void;\n}\nexport interface CoreEffect {\n name: string;\n kind: CoreEffectKind;\n description?: string;\n defaults?: Record<string, unknown>;\n reduced?: 'skip' | 'run';\n run(el: HTMLElement, options: any, ctx: CoreEffectContext): unknown;\n}\nexport interface CorePlugin {\n name: string;\n effects?: CoreEffect[];\n install?(m: MotionInstance): void;\n}\nexport type Trigger = 'click' | 'hover' | 'enter' | 'load' | 'loop' | 'manual';\nexport interface RevealOptions {\n stagger?: number;\n delay?: number;\n duration?: number;\n easing?: string;\n once?: boolean;\n threshold?: number;\n}\nexport interface MotionInstance {\n readonly paused: boolean;\n readonly rate: number;\n use(...plugins: CorePlugin[]): MotionInstance;\n has(effect: string): boolean;\n effects(): string[];\n reduced(): boolean;\n animate(el: Element, keyframes: Keyframe[] | PropertyIndexedKeyframes, options?: number | KeyframeAnimationOptions): Animation | null;\n play(el: HTMLElement, effect: string, options?: Record<string, unknown>, event?: Event): Promise<void>;\n bind(el: HTMLElement, effect: string, options?: Record<string, unknown> & { trigger?: Trigger; once?: boolean }): () => void;\n reveal(targets: string | Element | ArrayLike<Element>, preset?: string, options?: RevealOptions): () => void;\n pause(): void;\n resume(): void;\n setRate(rate: number): void;\n destroy(): void;\n}\n\nconst T = (x: number, y: number, s = 1) => `translate(${x}px,${y}px) scale(${s})`;\n/** Entrance keyframes (10.0). */\nexport const PRESETS: Record<string, Keyframe[]> = {\n fade: [{ opacity: 0 }, { opacity: 1 }],\n 'fade-up': [{ opacity: 0, transform: T(0, 24) }, { opacity: 1, transform: 'none' }],\n 'fade-down': [{ opacity: 0, transform: T(0, -24) }, { opacity: 1, transform: 'none' }],\n 'fade-left': [{ opacity: 0, transform: T(24, 0) }, { opacity: 1, transform: 'none' }],\n 'fade-right': [{ opacity: 0, transform: T(-24, 0) }, { opacity: 1, transform: 'none' }],\n scale: [{ opacity: 0, transform: 'scale(.85)' }, { opacity: 1, transform: 'none' }],\n 'zoom-in': [{ opacity: 0, transform: 'scale(.6)' }, { opacity: 1, transform: 'none' }],\n 'zoom-out': [{ opacity: 0, transform: 'scale(1.2)' }, { opacity: 1, transform: 'none' }],\n 'blur-in': [{ opacity: 0, filter: 'blur(10px)' }, { opacity: 1, filter: 'none' }],\n 'flip-up': [{ opacity: 0, transform: 'perspective(600px) rotateX(-60deg)' }, { opacity: 1, transform: 'none' }],\n};\nconst EASE = 'cubic-bezier(0.22, 1, 0.36, 1)';\nconst SKIP: string[] = ['loop', 'background', 'cursor'];\n\n/** GPU backend order used by GPU plugins: WebGPU by default (10.0). */\nexport function preferredBackend(): 'webgpu' | 'webgl2' | 'canvas' {\n if (typeof navigator !== 'undefined' && (navigator as any).gpu) return 'webgpu';\n try {\n if (typeof document !== 'undefined' && document.createElement('canvas').getContext?.('webgl2')) return 'webgl2';\n } catch {\n /* no GL */\n }\n return 'canvas';\n}\n\nconst list = (t: string | Element | ArrayLike<Element>): HTMLElement[] =>\n typeof t === 'string' ? (typeof document === 'undefined' ? [] : Array.from(document.querySelectorAll<HTMLElement>(t))) : 'length' in (t as ArrayLike<Element>) && !(t instanceof Element) ? (Array.from(t as ArrayLike<Element>) as HTMLElement[]) : [t as HTMLElement];\n\n/** Create a Motionary core instance (10.0). */\nexport function createMotion(config: { reducedMotion?: 'user' | 'reduce'; rate?: number } = {}): MotionInstance {\n const reg = new Map<string, CoreEffect>();\n const plugins = new Set<string>();\n const live = new Set<Animation>();\n const offs = new Set<() => void>();\n let paused = false;\n let rate = config.rate && config.rate > 0 ? config.rate : 1;\n const reduced = () => config.reducedMotion === 'reduce' || (typeof matchMedia === 'function' && matchMedia('(prefers-reduced-motion: reduce)').matches);\n const animate: MotionInstance['animate'] = (el, kf, o) => {\n if (typeof (el as any).animate !== 'function') return null;\n const a = el.animate(kf, o);\n if (!a) return null;\n live.add(a);\n if (rate !== 1) a.playbackRate = rate;\n if (paused) a.pause();\n const done = () => live.delete(a);\n a.finished?.then(done, done);\n return a;\n };\n const ctx = (event?: Event, cleanups: (() => void)[] = []): CoreEffectContext => ({ reduced: reduced(), sensitivity: reduced() ? 'minimal' : 'full', event, animate, onCleanup: (f) => cleanups.push(f) });\n const skip = (d: CoreEffect) => reduced() && (d.reduced ?? (SKIP.includes(d.kind) ? 'skip' : 'run')) === 'skip';\n const m: MotionInstance = {\n get paused() {\n return paused;\n },\n get rate() {\n return rate;\n },\n use(...ps) {\n for (const p of ps) {\n if (!p || plugins.has(p.name)) continue;\n plugins.add(p.name);\n for (const e of p.effects || []) if (!reg.has(e.name)) reg.set(e.name, e);\n p.install?.(m);\n }\n return m;\n },\n has: (n) => reg.has(n),\n effects: () => Array.from(reg.keys()).sort(),\n reduced,\n animate,\n async play(el, name, options = {}, event) {\n const d = reg.get(name);\n if (!d) throw new Error(`[motionary] unknown effect \"${name}\" — add its plugin with use()`);\n if (skip(d)) return;\n const out = d.run(el, { ...(d.defaults || {}), ...options }, ctx(event)) as any;\n if (out?.finished?.then) await out.finished.catch(() => undefined);\n else if (out?.then) await out;\n },\n bind(el, name, options = {}) {\n const { trigger = 'click', once, ...o } = options;\n const d = reg.get(name);\n if (!d) throw new Error(`[motionary] unknown effect \"${name}\"`);\n const stops: (() => void)[] = [];\n let current: (() => void)[] = [];\n const fire = (e?: Event) => {\n if (skip(d)) return;\n current.splice(0).forEach((f) => f());\n const out = d.run(el, { ...(d.defaults || {}), ...o }, ctx(e, current));\n if (typeof out === 'function') current.push(out as () => void);\n };\n const on = (type: string) => {\n const h = (e: Event) => fire(e);\n el.addEventListener(type, h, { once: !!once });\n stops.push(() => el.removeEventListener(type, h));\n };\n if (trigger === 'click') on('click');\n else if (trigger === 'hover') (on('pointerenter'), on('focusin'));\n else if (trigger === 'load' || trigger === 'loop') fire();\n else if (trigger === 'enter' && typeof IntersectionObserver !== 'undefined') {\n const io = new IntersectionObserver((es) =>\n es.forEach((en) => {\n if (!en.isIntersecting) return;\n fire();\n if (once !== false) io.disconnect();\n })\n );\n io.observe(el);\n stops.push(() => io.disconnect());\n }\n const off = () => {\n stops.splice(0).forEach((f) => f());\n current.splice(0).forEach((f) => f());\n offs.delete(off);\n };\n offs.add(off);\n return off;\n },\n reveal(targets, preset = 'fade-up', o = {}) {\n const els = list(targets);\n const kf = PRESETS[preset] || PRESETS.fade;\n const show = (el: HTMLElement, i: number) => {\n el.style.removeProperty('opacity');\n animate(el, reduced() ? PRESETS.fade : kf, { duration: o.duration ?? 600, delay: (o.delay ?? 0) + (o.stagger ?? 0) * i, easing: o.easing || EASE, fill: 'backwards' });\n };\n if (typeof IntersectionObserver === 'undefined') {\n els.forEach(show);\n return () => undefined;\n }\n els.forEach((el) => (el.style.opacity = '0'));\n let batch = 0;\n const io = new IntersectionObserver(\n (es) => {\n batch = 0;\n for (const en of es) {\n if (!en.isIntersecting) continue;\n show(en.target as HTMLElement, batch++);\n if (o.once !== false) io.unobserve(en.target);\n }\n },\n { threshold: o.threshold ?? 0.15 }\n );\n els.forEach((el) => io.observe(el));\n const off = () => {\n io.disconnect();\n els.forEach((el) => el.style.removeProperty('opacity'));\n offs.delete(off);\n };\n offs.add(off);\n return off;\n },\n pause() {\n paused = true;\n live.forEach((a) => a.pause());\n },\n resume() {\n paused = false;\n live.forEach((a) => a.play());\n },\n setRate(r) {\n if (!(r > 0)) return;\n rate = r;\n live.forEach((a) => (a.playbackRate = r));\n },\n destroy() {\n Array.from(offs).forEach((f) => f());\n live.forEach((a) => a.cancel());\n live.clear();\n },\n };\n m.use({ name: 'core/presets', effects: Object.entries(PRESETS).map(([name, frames]) => ({ name, kind: 'enter', defaults: { duration: 600, delay: 0, easing: EASE }, run: (el: HTMLElement, o: any, c: CoreEffectContext) => c.animate(el, c.reduced ? PRESETS.fade : frames, { duration: o.duration, delay: o.delay, easing: o.easing, fill: 'backwards' }) })) });\n return m;\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;AAkBG;AAaH,MAAM,QAAQ,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC;AAC5D,MAAM,EAAE,GAAG,CAAC,CAAS,MAAc,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;AAE7H;AACM,SAAU,eAAe,CAAC,KAAa,EAAA;AAC3C,IAAA,OAAO;SACJ,KAAK,CAAC,GAAG;SACT,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE;SACnB,MAAM,CAAC,OAAO;AACd,SAAA,GAAG,CAAC,CAAC,CAAC,KAAI;QACT,MAAM,CAAC,GAAG,wBAAwB,CAAC,IAAI,CAAC,CAAC,CAAC;AAC1C,QAAA,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAAE,YAAA,MAAM,IAAI,KAAK,CAAC,CAAA,mCAAA,EAAsC,CAAC,CAAA,kCAAA,EAAqC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA,CAAA,CAAG,CAAC;AACxJ,QAAA,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC;AACrC,QAAA,MAAM,IAAI,GA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