motionary 11.2.0 → 11.4.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/CHANGELOG.md +26 -0
- package/README.md +4 -0
- package/dist/chunks/{anim-image-DMFe0wGd.cjs → anim-image-Bjmc17ZU.cjs} +2 -2
- package/dist/chunks/{anim-image-CigwAy10.js → anim-image-CSrYZ3ZY.js} +2 -2
- package/dist/chunks/audio-Dc4JT_0D.cjs +1 -1
- package/dist/chunks/audio-Ds5ppQVV.js +1 -1
- package/dist/chunks/badge-wall-CHvTcDpR.cjs +1 -1
- package/dist/chunks/badge-wall-fWlK0AtX.js +1 -1
- package/dist/chunks/base-B3me2y0o.cjs +1 -1
- package/dist/chunks/base-zSGb8ujt.js +1 -1
- package/dist/chunks/bg-generator-C-T8N2CW.cjs +1 -1
- package/dist/chunks/bg-generator-CVHPNzl6.js +1 -1
- package/dist/chunks/bind-B_CTL6Qn.js +1 -1
- package/dist/chunks/bind-Ui43-n2d.cjs +1 -1
- package/dist/chunks/builtins-Cz3iufK6.cjs +1 -1
- package/dist/chunks/builtins-Simwbnqg.js +1 -1
- package/dist/chunks/carousel-CUEAF4k3.cjs +1 -1
- package/dist/chunks/carousel-Ca5FiNvL.js +1 -1
- package/dist/chunks/cart-drawer-BMth2aMo.cjs +1 -1
- package/dist/chunks/cart-drawer-CDBjWN5-.js +1 -1
- package/dist/chunks/code-export-B6NVzEhx.js +1 -1
- package/dist/chunks/code-export-BUcIsaA0.cjs +1 -1
- package/dist/chunks/color-picker-DFvcXhEq.js +1 -1
- package/dist/chunks/color-picker-Dmr2b2J4.cjs +1 -1
- package/dist/chunks/command-palette-BSTQQK3b.js +1 -1
- package/dist/chunks/command-palette-CNnX1Qlx.cjs +1 -1
- package/dist/chunks/core-BOCM9zD5.js +1 -1
- package/dist/chunks/core-BcQb_f91.js +1 -1
- package/dist/chunks/core-BdLFN0RS.cjs +1 -1
- package/dist/chunks/core-BjcOCpJt.cjs +1 -1
- package/dist/chunks/core-Dj6iomdc.js +1 -1
- package/dist/chunks/core-KIvPGg0c.cjs +1 -1
- package/dist/chunks/countdown-COaDvsTK.cjs +1 -1
- package/dist/chunks/countdown-CeOzDrkE.js +1 -1
- package/dist/chunks/date-picker-DJ5URMsx.cjs +1 -1
- package/dist/chunks/date-picker-DKv1uKYq.js +1 -1
- package/dist/chunks/ease-HwYZnZat.cjs +1 -1
- package/dist/chunks/ease-XN8_0sXu.js +1 -1
- package/dist/chunks/equalizer-C6cz1y_2.js +1 -1
- package/dist/chunks/equalizer-GY-Qul0f.cjs +1 -1
- package/dist/chunks/festival-banner-BYn-HCza.js +1 -1
- package/dist/chunks/festival-banner-Dx7QAmxt.cjs +1 -1
- package/dist/chunks/field-BlWcKLcW.js +1 -1
- package/dist/chunks/field-CLbSJL_S.cjs +1 -1
- package/dist/chunks/fx-BaPAanPW.cjs +1 -1
- package/dist/chunks/fx-DUteojZx.js +1 -1
- package/dist/chunks/generative-2LhxG5BJ.js +1 -1
- package/dist/chunks/generative-BHIj-NU0.cjs +1 -1
- package/dist/chunks/{gl-scene-DOtF83ek.js → gl-scene-DsfDIyzr.js} +2 -2
- package/dist/chunks/{gl-scene-BZ-Tm38b.cjs → gl-scene-y_vtXfho.cjs} +2 -2
- package/dist/chunks/globe-C5waX_Bv.cjs +1 -1
- package/dist/chunks/globe-DAdScNVh.js +1 -1
- package/dist/chunks/gpu-Dw1udOJW.cjs +1 -1
- package/dist/chunks/gpu-ML0i9eNv.js +1 -1
- package/dist/chunks/gpu-particles-BVMXKtdI.cjs +1 -1
- package/dist/chunks/gpu-particles-BafFhVwB.js +1 -1
- package/dist/chunks/index-tags-B-JBecYg.js +1 -1
- package/dist/chunks/index-tags-hLIF2Clq.cjs +1 -1
- package/dist/chunks/{keyframes-Cbj4m_Y3.cjs → keyframes-CA4ON22i.cjs} +2 -2
- package/dist/chunks/{keyframes-AcVaNJ4U.js → keyframes-_50j1RoO.js} +2 -2
- package/dist/chunks/leaderboard-BReEpUTf.js +1 -1
- package/dist/chunks/leaderboard-DYRLL45b.cjs +1 -1
- package/dist/chunks/location-card-CLR05EP-.cjs +1 -1
- package/dist/chunks/location-card-D-jdyQge.js +1 -1
- package/dist/chunks/lottie-icon-BfG8_n32.cjs +1 -1
- package/dist/chunks/lottie-icon-kOzTlEj1.js +1 -1
- package/dist/chunks/{lottie-player-BYWndDoz.js → lottie-player-CMDfMeKd.js} +2 -2
- package/dist/chunks/{lottie-player-B7MZM9v3.cjs → lottie-player-Duv92v1E.cjs} +2 -2
- package/dist/chunks/lyrics-CtKFEFtI.cjs +1 -1
- package/dist/chunks/lyrics-DHri0dBh.js +1 -1
- package/dist/chunks/manifest-Bcz6rQ20.cjs +1 -1
- package/dist/chunks/manifest-pFJWahGJ.js +1 -1
- package/dist/chunks/menu-BTGBkd2U.js +1 -1
- package/dist/chunks/menu-BgO53POm.cjs +1 -1
- package/dist/chunks/menu-toggle-CLteQORa.js +1 -1
- package/dist/chunks/menu-toggle-lGl4Jvae.cjs +1 -1
- package/dist/chunks/nav-morph-BDnCH13j.cjs +1 -1
- package/dist/chunks/nav-morph-Cn8rkJgZ.js +1 -1
- package/dist/chunks/otp-CD87vVt6.js +1 -1
- package/dist/chunks/otp-tQy0gMPq.cjs +1 -1
- package/dist/chunks/pagination-6QHulvKI.js +1 -1
- package/dist/chunks/pagination-DD2oqXhh.cjs +1 -1
- package/dist/chunks/{physics-playground-YVxNGnUK.cjs → physics-playground-8x5S9Wos.cjs} +2 -2
- package/dist/chunks/{physics-playground-mjFAeNWn.js → physics-playground-U3RY-aG3.js} +2 -2
- package/dist/chunks/player-BYwLXSuJ.js +1 -1
- package/dist/chunks/player-DZe-cHvD.cjs +1 -1
- package/dist/chunks/presence-230b12uw.cjs +1 -1
- package/dist/chunks/presence-CPc3nH2E.js +1 -1
- package/dist/chunks/presets-BYBVJVeP.js +1 -1
- package/dist/chunks/presets-CUHys3sK.cjs +1 -1
- package/dist/chunks/prize-wheel-BzYWrEvu.js +1 -1
- package/dist/chunks/prize-wheel-DuS1Ud_o.cjs +1 -1
- package/dist/chunks/product-gallery-CTswLWBk.cjs +1 -1
- package/dist/chunks/product-gallery-DuUVpQGx.js +1 -1
- package/dist/chunks/progress-ring-CDJnN8et.js +1 -1
- package/dist/chunks/progress-ring-TnacbuYB.cjs +1 -1
- package/dist/chunks/prop-panel-B4SaLelu.cjs +1 -1
- package/dist/chunks/prop-panel-CYTkWP9Y.js +1 -1
- package/dist/chunks/radar-B7ZGs9Ca.js +1 -1
- package/dist/chunks/radar-BWjX0-2G.cjs +1 -1
- package/dist/chunks/reactions-BCX05Z6_.js +1 -1
- package/dist/chunks/reactions-BNpZ7cPy.cjs +1 -1
- package/dist/chunks/registry-BB1oO-lR.cjs +1 -1
- package/dist/chunks/registry-CYojuxi5.js +1 -1
- package/dist/chunks/{registry-DZMe2rVp.js → registry-CorBCE7b.js} +40 -3
- package/dist/chunks/{registry-BIhHroDh.cjs → registry-VITvgTNc.cjs} +43 -2
- package/dist/chunks/retro-button-CNbQ4ph9.cjs +1 -1
- package/dist/chunks/retro-button-dVmLtNmb.js +1 -1
- package/dist/chunks/rive-CfWKBIa5.cjs +1 -1
- package/dist/chunks/rive-CtYlVrH0.js +1 -1
- package/dist/chunks/{runtime-link-Bne5p2tj.cjs → runtime-link-BGsMpzx4.cjs} +2 -2
- package/dist/chunks/{runtime-link-BiyHzDSA.js → runtime-link-LolrEAJv.js} +2 -2
- package/dist/chunks/scroll-driven-CQbwzCdn.cjs +1 -1
- package/dist/chunks/scroll-driven-LghshrWq.js +1 -1
- package/dist/chunks/{scroll-scene-CDW4Cmqg.js → scroll-scene-C6cUC6eR.js} +3 -3
- package/dist/chunks/{scroll-scene-Bxigz4ju.cjs → scroll-scene-CAlNu16C.cjs} +3 -3
- package/dist/chunks/segmented-CRHXT6gm.js +1 -1
- package/dist/chunks/segmented-Can8wI4p.cjs +1 -1
- package/dist/chunks/shader-backdrop-Tnlj5ag3.cjs +1 -1
- package/dist/chunks/shader-backdrop-jJaiqu2T.js +1 -1
- package/dist/chunks/shared-BxK1D7EZ.cjs +1 -1
- package/dist/chunks/shared-C8Pi6tuh.js +1 -1
- package/dist/chunks/shared-CkKHWrtJ.js +1 -1
- package/dist/chunks/shared-jkgRH-Hx.cjs +1 -1
- package/dist/chunks/sheet-BHvZA7rD.js +1 -1
- package/dist/chunks/sheet-BfH5vWIW.cjs +1 -1
- package/dist/chunks/sign-DvZ1jHxE.js +1 -1
- package/dist/chunks/sign-RAkQIWrM.cjs +1 -1
- package/dist/chunks/skeleton-reveal-Dwm8Z6Iv.js +1 -1
- package/dist/chunks/skeleton-reveal-n4L3iur-.cjs +1 -1
- package/dist/chunks/sparkline-BhB1Mi-1.js +1 -1
- package/dist/chunks/sparkline-CEF92PsW.cjs +1 -1
- package/dist/chunks/spring-CznnvQCN.js +1 -1
- package/dist/chunks/spring-DcM7pQgx.cjs +1 -1
- package/dist/chunks/stagger-B9sKPwQB.js +1 -1
- package/dist/chunks/stagger-DFKwqOQG.cjs +1 -1
- package/dist/chunks/suggestion-chips-BVt6aSMC.cjs +1 -1
- package/dist/chunks/suggestion-chips-CtgmWPtH.js +1 -1
- package/dist/chunks/switch-0mn-fRmX.cjs +1 -1
- package/dist/chunks/switch-CP2i0RlH.js +1 -1
- package/dist/chunks/tab-bar-CZLz8oVX.cjs +1 -1
- package/dist/chunks/tab-bar-Du_iYdCI.js +1 -1
- package/dist/chunks/{ticker-Cq2SmYNJ.js → ticker-CZisW9Nb.js} +2 -2
- package/dist/chunks/{ticker--1A-E9Vg.cjs → ticker-DwRa5hIu.cjs} +2 -2
- package/dist/chunks/tip-Txz4rnqn.cjs +1 -1
- package/dist/chunks/tip-c0HIMPnO.js +1 -1
- package/dist/chunks/toast-stack-Cylun3Yf.js +1 -1
- package/dist/chunks/toast-stack-DanHRGwO.cjs +1 -1
- package/dist/chunks/{tween-MhtysD-Y.js → tween-BHDOFhXX.js} +2 -2
- package/dist/chunks/{tween-BqL2cEKf.cjs → tween-ookpV7jR.cjs} +2 -2
- package/dist/chunks/upload-progress-CkfDSMr-.js +1 -1
- package/dist/chunks/upload-progress-DmywVhec.cjs +1 -1
- package/dist/chunks/variants-DRi3tBJf.js +1 -1
- package/dist/chunks/variants-cVfgIaXa.cjs +1 -1
- package/dist/chunks/voice-button-CZ5cpeWN.cjs +1 -1
- package/dist/chunks/voice-button-DVovZYBR.js +1 -1
- package/dist/chunks/weather-card-DCzxr5T4.cjs +1 -1
- package/dist/chunks/weather-card-pF9sSKuI.js +1 -1
- package/dist/chunks/worker-canvas-CDc2aIKC.cjs +1 -1
- package/dist/chunks/worker-canvas-Hl3quLAh.js +1 -1
- package/dist/chunks/xp-bar-D4Yq5Dpv.cjs +1 -1
- package/dist/chunks/xp-bar-j1FsL32r.js +1 -1
- package/dist/components/a11y.cjs +1 -1
- package/dist/components/a11y.js +1 -1
- package/dist/components/ai.cjs +1 -1
- package/dist/components/ai.js +1 -1
- package/dist/components/angular.cjs +1 -1
- package/dist/components/angular.js +1 -1
- package/dist/components/background.cjs +1 -1
- package/dist/components/background.js +1 -1
- package/dist/components/bridge.cjs +1 -1
- package/dist/components/bridge.js +1 -1
- package/dist/components/cards.cjs +1 -1
- package/dist/components/cards.js +1 -1
- package/dist/components/click.cjs +1 -1
- package/dist/components/click.js +1 -1
- package/dist/components/core.cjs +1 -1
- package/dist/components/core.js +1 -1
- package/dist/components/depth.cjs +1 -1
- package/dist/components/depth.js +1 -1
- package/dist/components/design.cjs +1 -1
- package/dist/components/design.js +1 -1
- package/dist/components/dotlottie.cjs +4 -4
- package/dist/components/dotlottie.js +4 -4
- package/dist/components/dsl.cjs +1 -1
- package/dist/components/dsl.js +1 -1
- package/dist/components/effects.cjs +1 -1
- package/dist/components/effects.js +1 -1
- package/dist/components/engine.cjs +1 -1
- package/dist/components/engine.js +1 -1
- package/dist/components/feedback.cjs +1 -1
- package/dist/components/feedback.js +1 -1
- package/dist/components/fx-3d.cjs +1 -1
- package/dist/components/fx-3d.js +1 -1
- package/dist/components/fx-ai.cjs +1 -1
- package/dist/components/fx-ai.js +1 -1
- package/dist/components/fx-chart.cjs +1 -1
- package/dist/components/fx-chart.js +1 -1
- package/dist/components/fx-cinema.cjs +1 -1
- package/dist/components/fx-cinema.js +1 -1
- package/dist/components/fx-cyber.cjs +1 -1
- package/dist/components/fx-cyber.js +1 -1
- package/dist/components/fx-festival.cjs +1 -1
- package/dist/components/fx-festival.js +1 -1
- package/dist/components/fx-focus.cjs +1 -1
- package/dist/components/fx-focus.js +1 -1
- package/dist/components/fx-form.cjs +1 -1
- package/dist/components/fx-form.js +1 -1
- package/dist/components/fx-game.cjs +1 -1
- package/dist/components/fx-game.js +1 -1
- package/dist/components/fx-genart.cjs +1 -1
- package/dist/components/fx-genart.js +1 -1
- package/dist/components/fx-geo.cjs +1 -1
- package/dist/components/fx-geo.js +1 -1
- package/dist/components/fx-gesture.cjs +1 -1
- package/dist/components/fx-gesture.js +1 -1
- package/dist/components/fx-gpu.cjs +1 -1
- package/dist/components/fx-gpu.js +1 -1
- package/dist/components/fx-light.cjs +1 -1
- package/dist/components/fx-light.js +1 -1
- package/dist/components/fx-lottie.cjs +1 -1
- package/dist/components/fx-lottie.js +1 -1
- package/dist/components/fx-morph.cjs +1 -1
- package/dist/components/fx-morph.js +1 -1
- package/dist/components/fx-music.cjs +1 -1
- package/dist/components/fx-music.js +1 -1
- package/dist/components/fx-organic.cjs +1 -1
- package/dist/components/fx-organic.js +1 -1
- package/dist/components/fx-paper.cjs +1 -1
- package/dist/components/fx-paper.js +1 -1
- package/dist/components/fx-perf.cjs +1 -1
- package/dist/components/fx-perf.js +1 -1
- package/dist/components/fx-physics.cjs +1 -1
- package/dist/components/fx-physics.js +1 -1
- package/dist/components/fx-retro.cjs +1 -1
- package/dist/components/fx-retro.js +1 -1
- package/dist/components/fx-safe.cjs +1 -1
- package/dist/components/fx-safe.js +1 -1
- package/dist/components/fx-shop.cjs +1 -1
- package/dist/components/fx-shop.js +1 -1
- package/dist/components/fx-social.cjs +1 -1
- package/dist/components/fx-social.js +1 -1
- package/dist/components/fx-spatial.cjs +1 -1
- package/dist/components/fx-spatial.js +1 -1
- package/dist/components/fx-surface.cjs +1 -1
- package/dist/components/fx-surface.js +1 -1
- package/dist/components/fx-text.cjs +1 -1
- package/dist/components/fx-text.js +1 -1
- package/dist/components/fx-transitions.cjs +1 -1
- package/dist/components/fx-transitions.js +1 -1
- package/dist/components/fx-video.cjs +1 -1
- package/dist/components/fx-video.js +1 -1
- package/dist/components/fx-weather.cjs +1 -1
- package/dist/components/fx-weather.js +1 -1
- package/dist/components/fx.cjs +1 -1
- package/dist/components/fx.js +1 -1
- package/dist/components/fx2.cjs +1 -1
- package/dist/components/fx2.js +1 -1
- package/dist/components/gesture.cjs +1 -1
- package/dist/components/gesture.js +1 -1
- package/dist/components/gl-model.cjs +4 -4
- package/dist/components/gl-model.js +4 -4
- package/dist/components/interaction.cjs +1 -1
- package/dist/components/interaction.js +1 -1
- package/dist/components/jsx.cjs +1 -1
- package/dist/components/jsx.js +1 -1
- package/dist/components/layout.cjs +1 -1
- package/dist/components/layout.js +1 -1
- package/dist/components/lazy.cjs +1 -1
- package/dist/components/lazy.js +1 -1
- package/dist/components/lite.cjs +1 -1
- package/dist/components/lite.js +1 -1
- package/dist/components/marketplace.cjs +1 -1
- package/dist/components/marketplace.js +1 -1
- package/dist/components/native.cjs +1 -1
- package/dist/components/native.js +1 -1
- package/dist/components/packs.cjs +1 -1
- package/dist/components/packs.js +1 -1
- package/dist/components/page.cjs +1 -1
- package/dist/components/page.js +1 -1
- package/dist/components/perf.cjs +1 -1
- package/dist/components/perf.js +1 -1
- package/dist/components/physics.cjs +1 -1
- package/dist/components/physics.js +1 -1
- package/dist/components/plugins.cjs +1 -1
- package/dist/components/plugins.js +1 -1
- package/dist/components/react.cjs +1 -1
- package/dist/components/react.js +1 -1
- package/dist/components/reveal.cjs +1 -1
- package/dist/components/reveal.js +1 -1
- package/dist/components/snap-carousel.cjs +3 -3
- package/dist/components/snap-carousel.js +3 -3
- package/dist/components/solid.cjs +1 -1
- package/dist/components/solid.js +1 -1
- package/dist/components/svelte.cjs +1 -1
- package/dist/components/svelte.js +1 -1
- package/dist/components/svg.cjs +1 -1
- package/dist/components/svg.js +1 -1
- package/dist/components/text.cjs +1 -1
- package/dist/components/text.js +1 -1
- package/dist/components/timeline.cjs +1 -1
- package/dist/components/timeline.js +1 -1
- package/dist/components/tokens.cjs +1 -1
- package/dist/components/tokens.js +1 -1
- package/dist/components/transitions.cjs +1 -1
- package/dist/components/transitions.js +1 -1
- package/dist/components/ui.cjs +1 -1
- package/dist/components/ui.js +1 -1
- package/dist/components/vue.cjs +1 -1
- package/dist/components/vue.js +1 -1
- package/dist/components/webgl.cjs +1 -1
- package/dist/components/webgl.js +1 -1
- package/dist/components/widgets.cjs +7 -7
- package/dist/components/widgets.js +9 -9
- package/dist/components.cjs +1 -1
- package/dist/components.js +1 -1
- package/dist/components.umd.js +1 -1
- package/dist/effects/achievement-unlock.cjs +1 -1
- package/dist/effects/achievement-unlock.js +1 -1
- package/dist/effects/aurora-veil.cjs +1 -1
- package/dist/effects/aurora-veil.js +1 -1
- package/dist/effects/badge-pop.cjs +1 -1
- package/dist/effects/badge-pop.js +1 -1
- package/dist/effects/bars-grow.cjs +1 -1
- package/dist/effects/bars-grow.js +1 -1
- package/dist/effects/beat-bounce.cjs +1 -1
- package/dist/effects/beat-bounce.js +1 -1
- package/dist/effects/blob-button.cjs +1 -1
- package/dist/effects/blob-button.js +1 -1
- package/dist/effects/bloom.cjs +1 -1
- package/dist/effects/bloom.js +1 -1
- package/dist/effects/breathe.cjs +1 -1
- package/dist/effects/breathe.js +1 -1
- package/dist/effects/brushed-metal.cjs +1 -1
- package/dist/effects/brushed-metal.js +1 -1
- package/dist/effects/camera-dolly.cjs +1 -1
- package/dist/effects/camera-dolly.js +1 -1
- package/dist/effects/card-flip-3d.cjs +1 -1
- package/dist/effects/card-flip-3d.js +1 -1
- package/dist/effects/chest-open.cjs +1 -1
- package/dist/effects/chest-open.js +1 -1
- package/dist/effects/cloth.cjs +1 -1
- package/dist/effects/cloth.js +1 -1
- package/dist/effects/coin-burst.cjs +1 -1
- package/dist/effects/coin-burst.js +1 -1
- package/dist/effects/color-pulse.cjs +1 -1
- package/dist/effects/color-pulse.js +1 -1
- package/dist/effects/crt-power.cjs +1 -1
- package/dist/effects/crt-power.js +1 -1
- package/dist/effects/crumple.cjs +1 -1
- package/dist/effects/crumple.js +1 -1
- package/dist/effects/data-decode.cjs +1 -1
- package/dist/effects/data-decode.js +1 -1
- package/dist/effects/day-cycle.cjs +1 -1
- package/dist/effects/day-cycle.js +1 -1
- package/dist/effects/depth-in.cjs +1 -1
- package/dist/effects/depth-in.js +1 -1
- package/dist/effects/depth-pop.cjs +1 -1
- package/dist/effects/depth-pop.js +1 -1
- package/dist/effects/depth-stack.cjs +1 -1
- package/dist/effects/depth-stack.js +1 -1
- package/dist/effects/dolly-in.cjs +1 -1
- package/dist/effects/dolly-in.js +1 -1
- package/dist/effects/dots-pop.cjs +1 -1
- package/dist/effects/dots-pop.js +1 -1
- package/dist/effects/field-shake.cjs +1 -1
- package/dist/effects/field-shake.js +1 -1
- package/dist/effects/field-success.cjs +1 -1
- package/dist/effects/field-success.js +1 -1
- package/dist/effects/film-burn.cjs +1 -1
- package/dist/effects/film-burn.js +1 -1
- package/dist/effects/fire.cjs +1 -1
- package/dist/effects/fire.js +1 -1
- package/dist/effects/fireflies.cjs +1 -1
- package/dist/effects/fireflies.js +1 -1
- package/dist/effects/firework-burst.cjs +1 -1
- package/dist/effects/firework-burst.js +1 -1
- package/dist/effects/flip-chars.cjs +1 -1
- package/dist/effects/flip-chars.js +1 -1
- package/dist/effects/fluid.cjs +1 -1
- package/dist/effects/fluid.js +1 -1
- package/dist/effects/fly-to-cart.cjs +1 -1
- package/dist/effects/fly-to-cart.js +1 -1
- package/dist/effects/focus-draw.cjs +1 -1
- package/dist/effects/focus-draw.js +1 -1
- package/dist/effects/focus-glow.cjs +1 -1
- package/dist/effects/focus-glow.js +1 -1
- package/dist/effects/fog.cjs +1 -1
- package/dist/effects/fog.js +1 -1
- package/dist/effects/font-breathe.cjs +1 -1
- package/dist/effects/font-breathe.js +1 -1
- package/dist/effects/form-cascade.cjs +1 -1
- package/dist/effects/form-cascade.js +1 -1
- package/dist/effects/gen-skeleton.cjs +1 -1
- package/dist/effects/gen-skeleton.js +1 -1
- package/dist/effects/glass-frost.cjs +1 -1
- package/dist/effects/glass-frost.js +1 -1
- package/dist/effects/glitch-text.cjs +1 -1
- package/dist/effects/glitch-text.js +1 -1
- package/dist/effects/globe-spin.cjs +1 -1
- package/dist/effects/globe-spin.js +1 -1
- package/dist/effects/god-rays.cjs +1 -1
- package/dist/effects/god-rays.js +1 -1
- package/dist/effects/gpu-lift.cjs +1 -1
- package/dist/effects/gpu-lift.js +1 -1
- package/dist/effects/grain-flicker.cjs +1 -1
- package/dist/effects/grain-flicker.js +1 -1
- package/dist/effects/halftone-in.cjs +1 -1
- package/dist/effects/halftone-in.js +1 -1
- package/dist/effects/highlight-sweep.cjs +1 -1
- package/dist/effects/highlight-sweep.js +1 -1
- package/dist/effects/hologram.cjs +1 -1
- package/dist/effects/hologram.js +1 -1
- package/dist/effects/hud-frame.cjs +1 -1
- package/dist/effects/hud-frame.js +1 -1
- package/dist/effects/icon-pop.cjs +1 -1
- package/dist/effects/icon-pop.js +1 -1
- package/dist/effects/icon-swap.cjs +1 -1
- package/dist/effects/icon-swap.js +1 -1
- package/dist/effects/idle-reveal.cjs +1 -1
- package/dist/effects/idle-reveal.js +1 -1
- package/dist/effects/ink.cjs +1 -1
- package/dist/effects/ink.js +1 -1
- package/dist/effects/jump-cut.cjs +1 -1
- package/dist/effects/jump-cut.js +1 -1
- package/dist/effects/kaleido.cjs +1 -1
- package/dist/effects/kaleido.js +1 -1
- package/dist/effects/label-float.cjs +1 -1
- package/dist/effects/label-float.js +1 -1
- package/dist/effects/lantern-rise.cjs +1 -1
- package/dist/effects/lantern-rise.js +1 -1
- package/dist/effects/leaves.cjs +1 -1
- package/dist/effects/leaves.js +1 -1
- package/dist/effects/letterbox.cjs +1 -1
- package/dist/effects/letterbox.js +1 -1
- package/dist/effects/level-up.cjs +1 -1
- package/dist/effects/level-up.js +1 -1
- package/dist/effects/light-follow.cjs +1 -1
- package/dist/effects/light-follow.js +1 -1
- package/dist/effects/lightning.cjs +1 -1
- package/dist/effects/lightning.js +1 -1
- package/dist/effects/line-draw.cjs +1 -1
- package/dist/effects/line-draw.js +1 -1
- package/dist/effects/liquid-text.cjs +1 -1
- package/dist/effects/liquid-text.js +1 -1
- package/dist/effects/liquid-wipe.cjs +1 -1
- package/dist/effects/liquid-wipe.js +1 -1
- package/dist/effects/lottie-play.cjs +1 -1
- package/dist/effects/lottie-play.js +1 -1
- package/dist/effects/magnet.cjs +1 -1
- package/dist/effects/magnet.js +1 -1
- package/dist/effects/marching-ants.cjs +1 -1
- package/dist/effects/marching-ants.js +1 -1
- package/dist/effects/marker-pulse.cjs +1 -1
- package/dist/effects/marker-pulse.js +1 -1
- package/dist/effects/mention-glow.cjs +1 -1
- package/dist/effects/mention-glow.js +1 -1
- package/dist/effects/mesh-drift.cjs +1 -1
- package/dist/effects/mesh-drift.js +1 -1
- package/dist/effects/message-in.cjs +1 -1
- package/dist/effects/message-in.js +1 -1
- package/dist/effects/mosaic-flip.cjs +1 -1
- package/dist/effects/mosaic-flip.js +1 -1
- package/dist/effects/neon-ignite.cjs +1 -1
- package/dist/effects/neon-ignite.js +1 -1
- package/dist/effects/neon-pulse.cjs +1 -1
- package/dist/effects/neon-pulse.js +1 -1
- package/dist/effects/neon-write.cjs +1 -1
- package/dist/effects/neon-write.js +1 -1
- package/dist/effects/neu-press.cjs +1 -1
- package/dist/effects/neu-press.js +1 -1
- package/dist/effects/noise-reveal.cjs +1 -1
- package/dist/effects/noise-reveal.js +1 -1
- package/dist/effects/number-roll.cjs +1 -1
- package/dist/effects/number-roll.js +1 -1
- package/dist/effects/orbit-camera.cjs +1 -1
- package/dist/effects/orbit-camera.js +1 -1
- package/dist/effects/orbit-in.cjs +1 -1
- package/dist/effects/orbit-in.js +1 -1
- package/dist/effects/origami.cjs +1 -1
- package/dist/effects/origami.js +1 -1
- package/dist/effects/page-curl.cjs +1 -1
- package/dist/effects/page-curl.js +1 -1
- package/dist/effects/pan-reveal.cjs +1 -1
- package/dist/effects/pan-reveal.js +1 -1
- package/dist/effects/paper-unfold.cjs +1 -1
- package/dist/effects/paper-unfold.js +1 -1
- package/dist/effects/particle-text.cjs +1 -1
- package/dist/effects/particle-text.js +1 -1
- package/dist/effects/path-morph.cjs +1 -1
- package/dist/effects/path-morph.js +1 -1
- package/dist/effects/pearlescent.cjs +1 -1
- package/dist/effects/pearlescent.js +1 -1
- package/dist/effects/pencil-sketch.cjs +1 -1
- package/dist/effects/pencil-sketch.js +1 -1
- package/dist/effects/pin-drop.cjs +1 -1
- package/dist/effects/pin-drop.js +1 -1
- package/dist/effects/pinball.cjs +1 -1
- package/dist/effects/pinball.js +1 -1
- package/dist/effects/pinch-hint.cjs +1 -1
- package/dist/effects/pinch-hint.js +1 -1
- package/dist/effects/pixelate-in.cjs +1 -1
- package/dist/effects/pixelate-in.js +1 -1
- package/dist/effects/pointer-shadow.cjs +1 -1
- package/dist/effects/pointer-shadow.js +1 -1
- package/dist/effects/portal-open.cjs +1 -1
- package/dist/effects/portal-open.js +1 -1
- package/dist/effects/price-flip.cjs +1 -1
- package/dist/effects/price-flip.js +1 -1
- package/dist/effects/product-spin.cjs +1 -1
- package/dist/effects/product-spin.js +1 -1
- package/dist/effects/rack-focus.cjs +1 -1
- package/dist/effects/rack-focus.js +1 -1
- package/dist/effects/radial-spectrum.cjs +1 -1
- package/dist/effects/radial-spectrum.js +1 -1
- package/dist/effects/rain-glass.cjs +1 -1
- package/dist/effects/rain-glass.js +1 -1
- package/dist/effects/reaction-burst.cjs +1 -1
- package/dist/effects/reaction-burst.js +1 -1
- package/dist/effects/read-receipt.cjs +1 -1
- package/dist/effects/read-receipt.js +1 -1
- package/dist/effects/refraction.cjs +1 -1
- package/dist/effects/refraction.js +1 -1
- package/dist/effects/ring-sweep.cjs +1 -1
- package/dist/effects/ring-sweep.js +1 -1
- package/dist/effects/ripple-dissolve.cjs +1 -1
- package/dist/effects/ripple-dissolve.js +1 -1
- package/dist/effects/rope.cjs +1 -1
- package/dist/effects/rope.js +1 -1
- package/dist/effects/route-draw.cjs +1 -1
- package/dist/effects/route-draw.js +1 -1
- package/dist/effects/safe-fade.cjs +1 -1
- package/dist/effects/safe-fade.js +1 -1
- package/dist/effects/sakura.cjs +1 -1
- package/dist/effects/sakura.js +1 -1
- package/dist/effects/sale-shine.cjs +1 -1
- package/dist/effects/sale-shine.js +1 -1
- package/dist/effects/sankey-flow.cjs +1 -1
- package/dist/effects/sankey-flow.js +1 -1
- package/dist/effects/scanline-sweep.cjs +1 -1
- package/dist/effects/scanline-sweep.js +1 -1
- package/dist/effects/shatter.cjs +1 -1
- package/dist/effects/shatter.js +1 -1
- package/dist/effects/smoke.cjs +1 -1
- package/dist/effects/smoke.js +1 -1
- package/dist/effects/snowfall.cjs +1 -1
- package/dist/effects/snowfall.js +1 -1
- package/dist/effects/soft-body.cjs +1 -1
- package/dist/effects/soft-body.js +1 -1
- package/dist/effects/sound-particles.cjs +1 -1
- package/dist/effects/sound-particles.js +1 -1
- package/dist/effects/spatial-float.cjs +1 -1
- package/dist/effects/spatial-float.js +1 -1
- package/dist/effects/spectrum-mirror.cjs +1 -1
- package/dist/effects/spectrum-mirror.js +1 -1
- package/dist/effects/splash.cjs +1 -1
- package/dist/effects/splash.js +1 -1
- package/dist/effects/spooky-float.cjs +1 -1
- package/dist/effects/spooky-float.js +1 -1
- package/dist/effects/stock-pulse.cjs +1 -1
- package/dist/effects/stock-pulse.js +1 -1
- package/dist/effects/stream-text.cjs +1 -1
- package/dist/effects/stream-text.js +1 -1
- package/dist/effects/stroke-draw.cjs +1 -1
- package/dist/effects/stroke-draw.js +1 -1
- package/dist/effects/success-check.cjs +1 -1
- package/dist/effects/success-check.js +1 -1
- package/dist/effects/swipe-hint.cjs +1 -1
- package/dist/effects/swipe-hint.js +1 -1
- package/dist/effects/text-trail.cjs +1 -1
- package/dist/effects/text-trail.js +1 -1
- package/dist/effects/thinking-glow.cjs +1 -1
- package/dist/effects/thinking-glow.js +1 -1
- package/dist/effects/tilt-wobble.cjs +1 -1
- package/dist/effects/tilt-wobble.js +1 -1
- package/dist/effects/typing-dots.cjs +1 -1
- package/dist/effects/typing-dots.js +1 -1
- package/dist/effects/underline-sweep.cjs +1 -1
- package/dist/effects/underline-sweep.js +1 -1
- package/dist/effects/vhs-glitch.cjs +1 -1
- package/dist/effects/vhs-glitch.js +1 -1
- package/dist/effects/vine-grow.cjs +1 -1
- package/dist/effects/vine-grow.js +1 -1
- package/dist/effects/vinyl-spin.cjs +1 -1
- package/dist/effects/vinyl-spin.js +1 -1
- package/dist/effects/voice-wave.cjs +1 -1
- package/dist/effects/voice-wave.js +1 -1
- package/dist/effects/water-drop.cjs +1 -1
- package/dist/effects/water-drop.js +1 -1
- package/dist/effects/watercolor.cjs +1 -1
- package/dist/effects/watercolor.js +1 -1
- package/dist/effects/waveform-scope.cjs +1 -1
- package/dist/effects/waveform-scope.js +1 -1
- package/dist/effects/xmas-snow.cjs +1 -1
- package/dist/effects/xmas-snow.js +1 -1
- package/dist/effects/xp-gain.cjs +1 -1
- package/dist/effects/xp-gain.js +1 -1
- package/dist/effects/y2k-shine.cjs +1 -1
- package/dist/effects/y2k-shine.js +1 -1
- package/dist/element.cjs +1 -1
- package/dist/element.js +1 -1
- package/dist/element.umd.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/llms-full.txt +1 -1
- package/dist/llms.txt +1 -1
- package/dist/manifest.json +234 -1
- package/dist/manifest.schema.json +16 -0
- package/dist/presets/extended.cjs +1 -1
- package/dist/presets/extended.js +1 -1
- package/dist/presets-extended.umd.js +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.js +1 -1
- package/dist/runtime/drag-snap.cjs +3 -3
- package/dist/runtime/drag-snap.d.cts +8 -0
- package/dist/runtime/drag-snap.d.ts +8 -0
- package/dist/runtime/drag-snap.iife.js +2 -2
- package/dist/runtime/drag-snap.js +3 -3
- package/dist/runtime/format-apng.cjs +6 -6
- package/dist/runtime/format-apng.d.cts +8 -0
- package/dist/runtime/format-apng.d.ts +8 -0
- package/dist/runtime/format-apng.iife.js +2 -2
- package/dist/runtime/format-apng.js +6 -6
- package/dist/runtime/format-css.cjs +6 -6
- package/dist/runtime/format-css.d.cts +8 -0
- package/dist/runtime/format-css.d.ts +8 -0
- package/dist/runtime/format-css.iife.js +2 -2
- package/dist/runtime/format-css.js +6 -6
- package/dist/runtime/format-gif.cjs +6 -6
- package/dist/runtime/format-gif.d.cts +8 -0
- package/dist/runtime/format-gif.d.ts +8 -0
- package/dist/runtime/format-gif.iife.js +2 -2
- package/dist/runtime/format-gif.js +6 -6
- package/dist/runtime/format-gltf.cjs +3 -3
- package/dist/runtime/format-gltf.d.cts +8 -0
- package/dist/runtime/format-gltf.d.ts +8 -0
- package/dist/runtime/format-gltf.iife.js +2 -2
- package/dist/runtime/format-gltf.js +3 -3
- package/dist/runtime/format-motion.cjs +6 -6
- package/dist/runtime/format-motion.d.cts +8 -0
- package/dist/runtime/format-motion.d.ts +8 -0
- package/dist/runtime/format-motion.iife.js +2 -2
- package/dist/runtime/format-motion.js +6 -6
- package/dist/runtime/format-obj.cjs +3 -3
- package/dist/runtime/format-obj.d.cts +8 -0
- package/dist/runtime/format-obj.d.ts +8 -0
- package/dist/runtime/format-obj.iife.js +2 -2
- package/dist/runtime/format-obj.js +3 -3
- package/dist/runtime/format-scene.cjs +3 -3
- package/dist/runtime/format-scene.d.cts +8 -0
- package/dist/runtime/format-scene.d.ts +8 -0
- package/dist/runtime/format-scene.iife.js +2 -2
- package/dist/runtime/format-scene.js +3 -3
- package/dist/runtime/format-sprite.cjs +5 -5
- package/dist/runtime/format-sprite.d.cts +8 -0
- package/dist/runtime/format-sprite.d.ts +8 -0
- package/dist/runtime/format-sprite.iife.js +2 -2
- package/dist/runtime/format-sprite.js +5 -5
- package/dist/runtime/format-svg.cjs +5 -5
- package/dist/runtime/format-svg.d.cts +8 -0
- package/dist/runtime/format-svg.d.ts +8 -0
- package/dist/runtime/format-svg.iife.js +2 -2
- package/dist/runtime/format-svg.js +5 -5
- package/dist/runtime/format-webp.cjs +6 -6
- package/dist/runtime/format-webp.d.cts +8 -0
- package/dist/runtime/format-webp.d.ts +8 -0
- package/dist/runtime/format-webp.iife.js +2 -2
- package/dist/runtime/format-webp.js +6 -6
- package/dist/runtime/gl.cjs +3 -2
- package/dist/runtime/gl.d.cts +8 -0
- package/dist/runtime/gl.d.ts +8 -0
- package/dist/runtime/gl.iife.js +2 -2
- package/dist/runtime/gl.js +3 -2
- package/dist/runtime/gltf-anim.cjs +3 -3
- package/dist/runtime/gltf-anim.d.cts +8 -0
- package/dist/runtime/gltf-anim.d.ts +8 -0
- package/dist/runtime/gltf-anim.iife.js +2 -2
- package/dist/runtime/gltf-anim.js +3 -3
- package/dist/runtime/gltf-decoders.cjs +3 -3
- package/dist/runtime/gltf-decoders.d.cts +8 -0
- package/dist/runtime/gltf-decoders.d.ts +8 -0
- package/dist/runtime/gltf-decoders.iife.js +2 -2
- package/dist/runtime/gltf-decoders.js +3 -3
- package/dist/runtime/lottie-state.cjs +3 -3
- package/dist/runtime/lottie-state.d.cts +8 -0
- package/dist/runtime/lottie-state.d.ts +8 -0
- package/dist/runtime/lottie-state.iife.js +2 -2
- package/dist/runtime/lottie-state.js +3 -3
- package/dist/runtime/physics.cjs +3 -3
- package/dist/runtime/physics.d.cts +8 -0
- package/dist/runtime/physics.d.ts +8 -0
- package/dist/runtime/physics.iife.js +2 -2
- package/dist/runtime/physics.js +3 -3
- package/dist/runtime/scroll.cjs +4 -4
- package/dist/runtime/scroll.d.cts +8 -0
- package/dist/runtime/scroll.d.ts +8 -0
- package/dist/runtime/scroll.iife.js +2 -2
- package/dist/runtime/scroll.js +4 -4
- package/dist/runtime/smooth.cjs +3 -3
- package/dist/runtime/smooth.d.cts +8 -0
- package/dist/runtime/smooth.d.ts +8 -0
- package/dist/runtime/smooth.iife.js +2 -2
- package/dist/runtime/smooth.js +3 -3
- package/dist/runtime/text.cjs +3 -3
- package/dist/runtime/text.d.cts +8 -0
- package/dist/runtime/text.d.ts +8 -0
- package/dist/runtime/text.iife.js +2 -2
- package/dist/runtime/text.js +3 -3
- package/dist/runtime/vector.cjs +5 -5
- package/dist/runtime/vector.d.cts +8 -0
- package/dist/runtime/vector.d.ts +8 -0
- package/dist/runtime/vector.iife.js +2 -2
- package/dist/runtime/vector.js +5 -5
- package/dist/runtime.cjs +9 -4
- package/dist/runtime.d.cts +18 -3
- package/dist/runtime.d.ts +18 -3
- package/dist/runtime.iife.js +2 -2
- package/dist/runtime.js +7 -6
- package/dist/solid.cjs +1 -1
- package/dist/solid.js +1 -1
- package/dist/svelte.cjs +1 -1
- package/dist/svelte.js +1 -1
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +1 -1
- package/dist/widgets/add-to-cart.cjs +1 -1
- package/dist/widgets/add-to-cart.js +1 -1
- package/dist/widgets/badge-wall.cjs +1 -1
- package/dist/widgets/badge-wall.js +1 -1
- package/dist/widgets/bar-chart.cjs +1 -1
- package/dist/widgets/bar-chart.js +1 -1
- package/dist/widgets/bg-generator.cjs +1 -1
- package/dist/widgets/bg-generator.js +1 -1
- package/dist/widgets/carousel.cjs +1 -1
- package/dist/widgets/carousel.js +1 -1
- package/dist/widgets/cart-drawer.cjs +1 -1
- package/dist/widgets/cart-drawer.js +1 -1
- package/dist/widgets/chapter-nav.cjs +1 -1
- package/dist/widgets/chapter-nav.js +1 -1
- package/dist/widgets/chat-composer.cjs +1 -1
- package/dist/widgets/chat-composer.js +1 -1
- package/dist/widgets/clock-control.cjs +1 -1
- package/dist/widgets/clock-control.js +1 -1
- package/dist/widgets/code-export.cjs +1 -1
- package/dist/widgets/code-export.js +1 -1
- package/dist/widgets/color-picker.cjs +1 -1
- package/dist/widgets/color-picker.js +1 -1
- package/dist/widgets/command-palette.cjs +1 -1
- package/dist/widgets/command-palette.js +1 -1
- package/dist/widgets/compare.cjs +1 -1
- package/dist/widgets/compare.js +1 -1
- package/dist/widgets/countdown.cjs +1 -1
- package/dist/widgets/countdown.js +1 -1
- package/dist/widgets/cube-gallery.cjs +1 -1
- package/dist/widgets/cube-gallery.js +1 -1
- package/dist/widgets/date-picker.cjs +1 -1
- package/dist/widgets/date-picker.js +1 -1
- package/dist/widgets/disclosure.cjs +1 -1
- package/dist/widgets/disclosure.js +1 -1
- package/dist/widgets/dock.cjs +1 -1
- package/dist/widgets/dock.js +1 -1
- package/dist/widgets/dotlottie.cjs +4 -4
- package/dist/widgets/dotlottie.js +4 -4
- package/dist/widgets/equalizer.cjs +1 -1
- package/dist/widgets/equalizer.js +1 -1
- package/dist/widgets/festival-banner.cjs +1 -1
- package/dist/widgets/festival-banner.js +1 -1
- package/dist/widgets/field.cjs +1 -1
- package/dist/widgets/field.js +1 -1
- package/dist/widgets/file-drop.cjs +1 -1
- package/dist/widgets/file-drop.js +1 -1
- package/dist/widgets/gauge.cjs +1 -1
- package/dist/widgets/gauge.js +1 -1
- package/dist/widgets/gen-art.cjs +1 -1
- package/dist/widgets/gen-art.js +1 -1
- package/dist/widgets/gesture-sticker.cjs +1 -1
- package/dist/widgets/gesture-sticker.js +1 -1
- package/dist/widgets/gl-model.cjs +4 -4
- package/dist/widgets/gl-model.js +4 -4
- package/dist/widgets/gl-scene.cjs +4 -4
- package/dist/widgets/gl-scene.js +4 -4
- package/dist/widgets/globe.cjs +1 -1
- package/dist/widgets/globe.js +1 -1
- package/dist/widgets/gpu-particles.cjs +1 -1
- package/dist/widgets/gpu-particles.js +1 -1
- package/dist/widgets/gyro-card.cjs +1 -1
- package/dist/widgets/gyro-card.js +1 -1
- package/dist/widgets/hero-video.cjs +1 -1
- package/dist/widgets/hero-video.js +1 -1
- package/dist/widgets/hud-panel.cjs +1 -1
- package/dist/widgets/hud-panel.js +1 -1
- package/dist/widgets/hydrate.cjs +1 -1
- package/dist/widgets/hydrate.js +1 -1
- package/dist/widgets/install-button.cjs +1 -1
- package/dist/widgets/install-button.js +1 -1
- package/dist/widgets/kanban.cjs +1 -1
- package/dist/widgets/kanban.js +1 -1
- package/dist/widgets/keyframe-editor.cjs +1 -1
- package/dist/widgets/keyframe-editor.js +1 -1
- package/dist/widgets/kpi.cjs +1 -1
- package/dist/widgets/kpi.js +1 -1
- package/dist/widgets/leaderboard.cjs +1 -1
- package/dist/widgets/leaderboard.js +1 -1
- package/dist/widgets/liquid-nav.cjs +1 -1
- package/dist/widgets/liquid-nav.js +1 -1
- package/dist/widgets/location-card.cjs +1 -1
- package/dist/widgets/location-card.js +1 -1
- package/dist/widgets/lottie-icon.cjs +1 -1
- package/dist/widgets/lottie-icon.js +1 -1
- package/dist/widgets/lottie-player.cjs +4 -4
- package/dist/widgets/lottie-player.js +4 -4
- package/dist/widgets/lottie.cjs +1 -1
- package/dist/widgets/lottie.js +1 -1
- package/dist/widgets/lyrics.cjs +1 -1
- package/dist/widgets/lyrics.js +1 -1
- package/dist/widgets/masonry-flow.cjs +1 -1
- package/dist/widgets/masonry-flow.js +1 -1
- package/dist/widgets/menu-toggle.cjs +1 -1
- package/dist/widgets/menu-toggle.js +1 -1
- package/dist/widgets/menu.cjs +1 -1
- package/dist/widgets/menu.js +1 -1
- package/dist/widgets/message-list.cjs +1 -1
- package/dist/widgets/message-list.js +1 -1
- package/dist/widgets/milestones.cjs +1 -1
- package/dist/widgets/milestones.js +1 -1
- package/dist/widgets/modal.cjs +1 -1
- package/dist/widgets/modal.js +1 -1
- package/dist/widgets/motion-inspector.cjs +2 -2
- package/dist/widgets/motion-inspector.js +2 -2
- package/dist/widgets/motion-prefs.cjs +1 -1
- package/dist/widgets/motion-prefs.js +1 -1
- package/dist/widgets/motion-prompt.cjs +1 -1
- package/dist/widgets/motion-prompt.js +1 -1
- package/dist/widgets/motion-spec.cjs +1 -1
- package/dist/widgets/motion-spec.js +1 -1
- package/dist/widgets/motion.cjs +1 -1
- package/dist/widgets/motion.js +1 -1
- package/dist/widgets/music-player.cjs +1 -1
- package/dist/widgets/music-player.js +1 -1
- package/dist/widgets/native-preview.cjs +1 -1
- package/dist/widgets/native-preview.js +1 -1
- package/dist/widgets/nav-morph.cjs +1 -1
- package/dist/widgets/nav-morph.js +1 -1
- package/dist/widgets/notification-bell.cjs +1 -1
- package/dist/widgets/notification-bell.js +1 -1
- package/dist/widgets/odometer.cjs +1 -1
- package/dist/widgets/odometer.js +1 -1
- package/dist/widgets/organic-card.cjs +1 -1
- package/dist/widgets/organic-card.js +1 -1
- package/dist/widgets/otp.cjs +1 -1
- package/dist/widgets/otp.js +1 -1
- package/dist/widgets/pagination.cjs +1 -1
- package/dist/widgets/pagination.js +1 -1
- package/dist/widgets/panorama.cjs +1 -1
- package/dist/widgets/panorama.js +1 -1
- package/dist/widgets/parallax-layers.cjs +1 -1
- package/dist/widgets/parallax-layers.js +1 -1
- package/dist/widgets/pause-all.cjs +1 -1
- package/dist/widgets/pause-all.js +1 -1
- package/dist/widgets/perf-monitor.cjs +1 -1
- package/dist/widgets/perf-monitor.js +1 -1
- package/dist/widgets/physics-playground.cjs +4 -4
- package/dist/widgets/physics-playground.js +4 -4
- package/dist/widgets/plugin-card.cjs +3 -3
- package/dist/widgets/plugin-card.js +3 -3
- package/dist/widgets/plugin-store.cjs +1 -1
- package/dist/widgets/plugin-store.js +1 -1
- package/dist/widgets/presence.cjs +1 -1
- package/dist/widgets/presence.js +1 -1
- package/dist/widgets/prize-wheel.cjs +1 -1
- package/dist/widgets/prize-wheel.js +1 -1
- package/dist/widgets/product-gallery.cjs +1 -1
- package/dist/widgets/product-gallery.js +1 -1
- package/dist/widgets/progress-ring.cjs +1 -1
- package/dist/widgets/progress-ring.js +1 -1
- package/dist/widgets/prop-panel.cjs +1 -1
- package/dist/widgets/prop-panel.js +1 -1
- package/dist/widgets/pull-cord.cjs +1 -1
- package/dist/widgets/pull-cord.js +1 -1
- package/dist/widgets/radar.cjs +1 -1
- package/dist/widgets/radar.js +1 -1
- package/dist/widgets/reactions.cjs +1 -1
- package/dist/widgets/reactions.js +1 -1
- package/dist/widgets/red-envelope.cjs +1 -1
- package/dist/widgets/red-envelope.js +1 -1
- package/dist/widgets/retro-button.cjs +1 -1
- package/dist/widgets/retro-button.js +1 -1
- package/dist/widgets/rive.cjs +1 -1
- package/dist/widgets/rive.js +1 -1
- package/dist/widgets/route-transition.cjs +1 -1
- package/dist/widgets/route-transition.js +1 -1
- package/dist/widgets/scene.cjs +1 -1
- package/dist/widgets/scene.js +1 -1
- package/dist/widgets/scroll-ring.cjs +1 -1
- package/dist/widgets/scroll-ring.js +1 -1
- package/dist/widgets/scroll-scene.cjs +4 -4
- package/dist/widgets/scroll-scene.js +4 -4
- package/dist/widgets/segmented.cjs +1 -1
- package/dist/widgets/segmented.js +1 -1
- package/dist/widgets/shader-backdrop.cjs +1 -1
- package/dist/widgets/shader-backdrop.js +1 -1
- package/dist/widgets/sheet.cjs +1 -1
- package/dist/widgets/sheet.js +1 -1
- package/dist/widgets/shortcut.cjs +1 -1
- package/dist/widgets/shortcut.js +1 -1
- package/dist/widgets/skeleton-reveal.cjs +1 -1
- package/dist/widgets/skeleton-reveal.js +1 -1
- package/dist/widgets/sketch-chart.cjs +1 -1
- package/dist/widgets/sketch-chart.js +1 -1
- package/dist/widgets/smooth-scroll.cjs +3 -3
- package/dist/widgets/smooth-scroll.js +3 -3
- package/dist/widgets/snap-carousel.cjs +3 -3
- package/dist/widgets/snap-carousel.js +3 -3
- package/dist/widgets/sparkline.cjs +1 -1
- package/dist/widgets/sparkline.js +1 -1
- package/dist/widgets/spatial-card.cjs +1 -1
- package/dist/widgets/spatial-card.js +1 -1
- package/dist/widgets/star-rating.cjs +1 -1
- package/dist/widgets/star-rating.js +1 -1
- package/dist/widgets/stepper.cjs +1 -1
- package/dist/widgets/stepper.js +1 -1
- package/dist/widgets/sticky-wall.cjs +1 -1
- package/dist/widgets/sticky-wall.js +1 -1
- package/dist/widgets/stories.cjs +1 -1
- package/dist/widgets/stories.js +1 -1
- package/dist/widgets/suggestion-chips.cjs +1 -1
- package/dist/widgets/suggestion-chips.js +1 -1
- package/dist/widgets/swipe-deck.cjs +1 -1
- package/dist/widgets/swipe-deck.js +1 -1
- package/dist/widgets/switch.cjs +1 -1
- package/dist/widgets/switch.js +1 -1
- package/dist/widgets/tab-bar.cjs +1 -1
- package/dist/widgets/tab-bar.js +1 -1
- package/dist/widgets/terminal.cjs +1 -1
- package/dist/widgets/terminal.js +1 -1
- package/dist/widgets/text-splitter.cjs +3 -3
- package/dist/widgets/text-splitter.js +3 -3
- package/dist/widgets/theme-surface.cjs +1 -1
- package/dist/widgets/theme-surface.js +1 -1
- package/dist/widgets/theme-switcher.cjs +1 -1
- package/dist/widgets/theme-switcher.js +1 -1
- package/dist/widgets/tip.cjs +1 -1
- package/dist/widgets/tip.js +1 -1
- package/dist/widgets/toast-stack.cjs +1 -1
- package/dist/widgets/toast-stack.js +1 -1
- package/dist/widgets/token-editor.cjs +1 -1
- package/dist/widgets/token-editor.js +1 -1
- package/dist/widgets/upload-progress.cjs +1 -1
- package/dist/widgets/upload-progress.js +1 -1
- package/dist/widgets/video-card.cjs +1 -1
- package/dist/widgets/video-card.js +1 -1
- package/dist/widgets/voice-button.cjs +1 -1
- package/dist/widgets/voice-button.js +1 -1
- package/dist/widgets/volume-knob.cjs +1 -1
- package/dist/widgets/volume-knob.js +1 -1
- package/dist/widgets/weather-card.cjs +1 -1
- package/dist/widgets/weather-card.js +1 -1
- package/dist/widgets/worker-canvas.cjs +1 -1
- package/dist/widgets/worker-canvas.js +1 -1
- package/dist/widgets/xp-bar.cjs +1 -1
- package/dist/widgets/xp-bar.js +1 -1
- package/dist/widgets.umd.js +2 -2
- package/docs/ROADMAP.md +2 -2
- package/docs/perf-ci.md +36 -0
- package/docs/performance.md +2 -0
- package/docs/runtime/basis-transcoder.md +2 -0
- package/docs/runtime/core.md +2 -0
- package/docs/runtime/draco3d.md +2 -0
- package/docs/runtime/drag-snap.md +2 -0
- package/docs/runtime/format-apng.md +2 -0
- package/docs/runtime/format-css.md +2 -0
- package/docs/runtime/format-gif.md +2 -0
- package/docs/runtime/format-gltf.md +2 -0
- package/docs/runtime/format-motion.md +2 -0
- package/docs/runtime/format-obj.md +2 -0
- package/docs/runtime/format-scene.md +2 -0
- package/docs/runtime/format-sprite.md +2 -0
- package/docs/runtime/format-svg.md +2 -0
- package/docs/runtime/format-webp.md +2 -0
- package/docs/runtime/gl.md +2 -0
- package/docs/runtime/gltf-anim.md +2 -0
- package/docs/runtime/gltf-decoders.md +2 -0
- package/docs/runtime/lottie-state.md +2 -0
- package/docs/runtime/physics.md +2 -0
- package/docs/runtime/rive.md +2 -0
- package/docs/runtime/scroll.md +2 -0
- package/docs/runtime/smooth.md +2 -0
- package/docs/runtime/text.md +2 -0
- package/docs/runtime/vector.md +2 -0
- package/docs/runtime-tiers.md +37 -0
- package/package.json +4 -2
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 11.4: runtime tiers. **basic** — ticker, tween, timeline, scroll, text, CSS / WAAPI keyframes; **standard** — smooth
|
|
3
|
+
* scrolling, drag-snap, SVG, sprites, GIF / APNG / WebP, Lottie; **advanced** — WebGL, 3D file parsing and decoders,
|
|
4
|
+
* physics. A page that only uses basic modules never downloads standard or advanced code.
|
|
5
|
+
*/
|
|
6
|
+
type RuntimeTier = 'basic' | 'standard' | 'advanced';
|
|
1
7
|
/** A runtime module: `{ id, version, api }`, registered with `use()`. */
|
|
2
8
|
interface RuntimeModule<A = unknown> {
|
|
3
9
|
/** Module id: 'core', 'format-css', 'scroll', … (import path `motionary/runtime/<id>`). */
|
|
@@ -5,6 +11,8 @@ interface RuntimeModule<A = unknown> {
|
|
|
5
11
|
version: string;
|
|
6
12
|
/** Other modules this one needs (registered first by `use()` callers). */
|
|
7
13
|
requires?: string[];
|
|
14
|
+
/** 11.4: runtime tier — basic · standard · advanced (docs/runtime-tiers.md). */
|
|
15
|
+
tier?: RuntimeTier;
|
|
8
16
|
/** The module's public API (what `requireModule(id)` returns). */
|
|
9
17
|
api: A;
|
|
10
18
|
/** Optional one-time setup, called on first registration. */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t,r){"use strict";const s=(e,t=0)=>"number"==typeof e&&Number.isFinite(e)?e:t;function a(e){const t="string"==typeof e?JSON.parse(e):e;if(!t||!t.frames)throw new Error('[motionary] format-sprite: no "frames" in the sprite sheet JSON');const r=t.meta||{},a=/aseprite/i.test(r.app||"")||Array.isArray(r.frameTags),i=(Array.isArray(t.frames)?t.frames.map((e,t)=>[e.filename??e.name??String(t),e]):Object.entries(t.frames)).map(([e,t])=>{const r=t.frame||t,a=!!t.rotated,i=t.spriteSourceSize||{x:0,y:0},n=t.sourceSize||{w:r.w,h:r.h},o={name:e,x:s(r.x),y:s(r.y),w:s(r.w),h:s(r.h),rotated:a,offsetX:s(i.x),offsetY:s(i.y),sourceW:s(n.w,r.w),sourceH:s(n.h,r.h)};return"number"==typeof t.duration&&(o.duration=t.duration),o});Array.isArray(t.frames)||a||i.sort((e,t)=>e.name.localeCompare(t.name,void 0,{numeric:!0}));return{frames:i,tags:(r.frameTags||[]).map(e=>({name:e.name,from:s(e.from),to:s(e.to),direction:e.direction||"forward"})),image:r.image,size:r.size,format:a?"aseprite":r.app||t.meta?"texturepacker":"generic"}}function i(e,t,r,s,a=e*t){const i=[];for(let t=0;t<a;t++)i.push({name:String(t),x:t%e*r,y:Math.floor(t/e)*s,w:r,h:s,rotated:!1,offsetX:0,offsetY:0,sourceW:r,sourceH:s});return{frames:i,tags:[],format:"generic"}}function n(e,t){const r=t?e.tags.find(e=>e.name===t):void 0;if(t&&!r)throw new Error(`[motionary] format-sprite: unknown tag "${t}" (have: ${e.tags.map(e=>e.name).join(", ")||"none"})`);const s=r?r.from:0,a=r?r.to:e.frames.length-1,i=Array.from({length:a-s+1},(e,t)=>s+t),n=r?.direction||"forward";if("reverse"===n)return i.reverse();if("pingpong"===n)return[...i,...i.slice(1,-1).reverse()];if("pingpong_reverse"===n){const e=i.reverse();return[...e,...e.slice(1,-1).reverse()]}return i}function o(e,t,r,s=0,a=0,i=1){e.save(),e.translate(s+r.offsetX*i,a+r.offsetY*i),r.rotated?(e.rotate(-Math.PI/2),e.drawImage(t,r.x,r.y,r.h,r.w,-r.h*i,0,r.h*i,r.w*i)):e.drawImage(t,r.x,r.y,r.w,r.h,0,0,r.w*i,r.h*i),e.restore()}class h extends r.Playable{constructor(){super(...arguments),this.times=[0],this.order=[],this.current=-1}setOrder(e,t){this.order=e,this.times=[0];for(const r of e)this.times.push(this.times[this.times.length-1]+t(r))}get duration(){return this.times[this.times.length-1]}indexAt(e){let t=0,r=this.order.length-1;for(;t<r;){const s=t+r+1>>1;this.times[s]<=e?t=s:r=s-1}return Math.min(t,this.order.length-1)}renderLocal(e){const t=this.order[this.indexAt(Math.min(e,this.duration-.001))];t!==this.current&&(this.current=t,this.show(t))}get frame(){return this.current}}class m extends h{constructor(e,t,r,s){super({repeat:s.repeat??-1,yoyo:s.yoyo}),this.target=e,this.sheet=t,this.image=r;const a=s.fps||12;this.setOrder(n(t,s.tag),e=>t.frames[e].duration??1e3/a),this.scale=s.scale,s.paused||this.play()}show(e){const t=this.sheet.frames[e],r=this.target;if("function"==typeof r.getContext&&"string"!=typeof this.image){const e=r.getContext("2d");if(!e)return;const s=this.scale??r.width/(t.sourceW||t.w||1);e.clearRect(0,0,r.width,r.height),o(e,this.image,t,0,0,s)}else{const e=this.target;"string"==typeof this.image&&(e.style.backgroundImage=`url("${this.image}")`),e.style.backgroundPosition=`${-t.x}px ${-t.y}px`,e.style.width=`${t.w}px`,e.style.height=`${t.h}px`,e.style.backgroundRepeat="no-repeat"}}}function c(e,t,r,s={}){return new m(e,t,r,s)}function f(e,t){const r=/\{(\d+)\}/.exec(e);if(!r)throw new Error("[motionary] format-sprite: the pattern needs a {0001}-style placeholder");const s=r[1].length,a=[];for(let i=t.start??(+r[1]||0);i<=t.end;i+=t.step||1)a.push(e.replace(r[0],String(i).padStart(s,"0")));return a}function u(e){return Promise.all(e.map(e=>new Promise((t,r)=>{const s=new Image;s.decoding="async",s.onload=()=>t(s),s.onerror=()=>r(new Error(`[motionary] format-sprite: could not load ${e}`)),s.src=e})))}class
|
|
2
|
-
//# sourceMappingURL=https://raw.githubusercontent.com/HarrisonCN/Motionary/v11.
|
|
1
|
+
!function(e,t,r){"use strict";const s=(e,t=0)=>"number"==typeof e&&Number.isFinite(e)?e:t;function a(e){const t="string"==typeof e?JSON.parse(e):e;if(!t||!t.frames)throw new Error('[motionary] format-sprite: no "frames" in the sprite sheet JSON');const r=t.meta||{},a=/aseprite/i.test(r.app||"")||Array.isArray(r.frameTags),i=(Array.isArray(t.frames)?t.frames.map((e,t)=>[e.filename??e.name??String(t),e]):Object.entries(t.frames)).map(([e,t])=>{const r=t.frame||t,a=!!t.rotated,i=t.spriteSourceSize||{x:0,y:0},n=t.sourceSize||{w:r.w,h:r.h},o={name:e,x:s(r.x),y:s(r.y),w:s(r.w),h:s(r.h),rotated:a,offsetX:s(i.x),offsetY:s(i.y),sourceW:s(n.w,r.w),sourceH:s(n.h,r.h)};return"number"==typeof t.duration&&(o.duration=t.duration),o});Array.isArray(t.frames)||a||i.sort((e,t)=>e.name.localeCompare(t.name,void 0,{numeric:!0}));return{frames:i,tags:(r.frameTags||[]).map(e=>({name:e.name,from:s(e.from),to:s(e.to),direction:e.direction||"forward"})),image:r.image,size:r.size,format:a?"aseprite":r.app||t.meta?"texturepacker":"generic"}}function i(e,t,r,s,a=e*t){const i=[];for(let t=0;t<a;t++)i.push({name:String(t),x:t%e*r,y:Math.floor(t/e)*s,w:r,h:s,rotated:!1,offsetX:0,offsetY:0,sourceW:r,sourceH:s});return{frames:i,tags:[],format:"generic"}}function n(e,t){const r=t?e.tags.find(e=>e.name===t):void 0;if(t&&!r)throw new Error(`[motionary] format-sprite: unknown tag "${t}" (have: ${e.tags.map(e=>e.name).join(", ")||"none"})`);const s=r?r.from:0,a=r?r.to:e.frames.length-1,i=Array.from({length:a-s+1},(e,t)=>s+t),n=r?.direction||"forward";if("reverse"===n)return i.reverse();if("pingpong"===n)return[...i,...i.slice(1,-1).reverse()];if("pingpong_reverse"===n){const e=i.reverse();return[...e,...e.slice(1,-1).reverse()]}return i}function o(e,t,r,s=0,a=0,i=1){e.save(),e.translate(s+r.offsetX*i,a+r.offsetY*i),r.rotated?(e.rotate(-Math.PI/2),e.drawImage(t,r.x,r.y,r.h,r.w,-r.h*i,0,r.h*i,r.w*i)):e.drawImage(t,r.x,r.y,r.w,r.h,0,0,r.w*i,r.h*i),e.restore()}class h extends r.Playable{constructor(){super(...arguments),this.times=[0],this.order=[],this.current=-1}setOrder(e,t){this.order=e,this.times=[0];for(const r of e)this.times.push(this.times[this.times.length-1]+t(r))}get duration(){return this.times[this.times.length-1]}indexAt(e){let t=0,r=this.order.length-1;for(;t<r;){const s=t+r+1>>1;this.times[s]<=e?t=s:r=s-1}return Math.min(t,this.order.length-1)}renderLocal(e){const t=this.order[this.indexAt(Math.min(e,this.duration-.001))];t!==this.current&&(this.current=t,this.show(t))}get frame(){return this.current}}class m extends h{constructor(e,t,r,s){super({repeat:s.repeat??-1,yoyo:s.yoyo}),this.target=e,this.sheet=t,this.image=r;const a=s.fps||12;this.setOrder(n(t,s.tag),e=>t.frames[e].duration??1e3/a),this.scale=s.scale,s.paused||this.play()}show(e){const t=this.sheet.frames[e],r=this.target;if("function"==typeof r.getContext&&"string"!=typeof this.image){const e=r.getContext("2d");if(!e)return;const s=this.scale??r.width/(t.sourceW||t.w||1);e.clearRect(0,0,r.width,r.height),o(e,this.image,t,0,0,s)}else{const e=this.target;"string"==typeof this.image&&(e.style.backgroundImage=`url("${this.image}")`),e.style.backgroundPosition=`${-t.x}px ${-t.y}px`,e.style.width=`${t.w}px`,e.style.height=`${t.h}px`,e.style.backgroundRepeat="no-repeat"}}}function c(e,t,r,s={}){return new m(e,t,r,s)}function f(e,t){const r=/\{(\d+)\}/.exec(e);if(!r)throw new Error("[motionary] format-sprite: the pattern needs a {0001}-style placeholder");const s=r[1].length,a=[];for(let i=t.start??(+r[1]||0);i<=t.end;i+=t.step||1)a.push(e.replace(r[0],String(i).padStart(s,"0")));return a}function u(e){return Promise.all(e.map(e=>new Promise((t,r)=>{const s=new Image;s.decoding="async",s.onload=()=>t(s),s.onerror=()=>r(new Error(`[motionary] format-sprite: could not load ${e}`)),s.src=e})))}class d extends h{constructor(e,t,r){super({repeat:r.repeat??0,yoyo:r.yoyo}),this.canvas=e,this.images=t;const s=r.fps||24;this.setOrder(t.map((e,t)=>t),()=>1e3/s),r.paused||this.play()}show(e){const t=this.canvas.getContext("2d"),r=this.images[e];if(!t||!r)return;const s=this.canvas.width,a=this.canvas.height,i=r.naturalWidth||r.width||s,n=r.naturalHeight||r.height||a,o=Math.max(s/i,a/n);t.clearRect(0,0,s,a),t.drawImage(r,(s-i*o)/2,(a-n*o)/2,i*o,n*o)}}function p(e,t,r={}){return new d(e,t,r)}const g={id:"format-sprite",version:t.RUNTIME_VERSION,tier:"standard",requires:["core"],api:{parseSpriteSheet:a,gridSheet:i,frameOrder:n,drawFrame:o,spritePlayer:c,imageSequence:f,preloadImages:u,sequencePlayer:p}};t.register(g),e.drawFrame=o,e.formatSprite=g,e.frameOrder=n,e.gridSheet=i,e.imageSequence=f,e.parseSpriteSheet=a,e.preloadImages=u,e.sequencePlayer=p,e.spritePlayer=c}(this.MotionaryRuntime=this.MotionaryRuntime||{},MotionaryRuntime,MotionaryRuntime);
|
|
2
|
+
//# sourceMappingURL=https://raw.githubusercontent.com/HarrisonCN/Motionary/v11.4.0/dist/runtime/format-sprite.iife.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { R as RUNTIME_VERSION } from '../chunks/registry-
|
|
2
|
-
import { P as Playable } from '../chunks/tween-
|
|
3
|
-
import '../chunks/ticker-
|
|
1
|
+
import { R as RUNTIME_VERSION } from '../chunks/registry-CorBCE7b.js';
|
|
2
|
+
import { P as Playable } from '../chunks/tween-BHDOFhXX.js';
|
|
3
|
+
import '../chunks/ticker-CZisW9Nb.js';
|
|
4
4
|
import '../chunks/ease-XN8_0sXu.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -210,7 +210,7 @@ function sequencePlayer(canvas, images, o = {}) {
|
|
|
210
210
|
return new SequencePlayer(canvas, images, o);
|
|
211
211
|
}
|
|
212
212
|
/** The module object for `use(formatSprite)`. */
|
|
213
|
-
const formatSprite = { id: 'format-sprite', version: RUNTIME_VERSION, requires: ['core'], api: { parseSpriteSheet, gridSheet, frameOrder, drawFrame, spritePlayer, imageSequence, preloadImages, sequencePlayer } };
|
|
213
|
+
const formatSprite = { id: 'format-sprite', version: RUNTIME_VERSION, tier: 'standard', requires: ['core'], api: { parseSpriteSheet, gridSheet, frameOrder, drawFrame, spritePlayer, imageSequence, preloadImages, sequencePlayer } };
|
|
214
214
|
|
|
215
215
|
export { drawFrame, formatSprite, frameOrder, gridSheet, imageSequence, parseSpriteSheet, preloadImages, sequencePlayer, spritePlayer };
|
|
216
|
-
//# sourceMappingURL=https://raw.githubusercontent.com/HarrisonCN/Motionary/v11.
|
|
216
|
+
//# sourceMappingURL=https://raw.githubusercontent.com/HarrisonCN/Motionary/v11.4.0/dist/runtime/format-sprite.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var registry = require('../chunks/registry-
|
|
4
|
-
var tween = require('../chunks/tween-
|
|
3
|
+
var registry = require('../chunks/registry-VITvgTNc.cjs');
|
|
4
|
+
var tween = require('../chunks/tween-ookpV7jR.cjs');
|
|
5
5
|
var ease = require('../chunks/ease-HwYZnZat.cjs');
|
|
6
|
-
require('../chunks/ticker
|
|
6
|
+
require('../chunks/ticker-DwRa5hIu.cjs');
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* `motionary/runtime/format-svg` (10.2) — SVG animation with the runtime
|
|
@@ -443,7 +443,7 @@ function playSmil(svg, o = {}) {
|
|
|
443
443
|
};
|
|
444
444
|
}
|
|
445
445
|
/** The module object for `use(formatSvg)`. */
|
|
446
|
-
const formatSvg = { id: 'format-svg', version: registry.RUNTIME_VERSION, requires: ['core'], api: { parsePath, flattenPath, pathLength, pointAtLength, samplePath, morphPath, readSmil, playSmil, smilTime } };
|
|
446
|
+
const formatSvg = { id: 'format-svg', version: registry.RUNTIME_VERSION, tier: 'standard', requires: ['core'], api: { parsePath, flattenPath, pathLength, pointAtLength, samplePath, morphPath, readSmil, playSmil, smilTime } };
|
|
447
447
|
|
|
448
448
|
exports.flattenPath = flattenPath;
|
|
449
449
|
exports.formatSvg = formatSvg;
|
|
@@ -455,4 +455,4 @@ exports.pointAtLength = pointAtLength;
|
|
|
455
455
|
exports.readSmil = readSmil;
|
|
456
456
|
exports.samplePath = samplePath;
|
|
457
457
|
exports.smilTime = smilTime;
|
|
458
|
-
//# sourceMappingURL=https://raw.githubusercontent.com/HarrisonCN/Motionary/v11.
|
|
458
|
+
//# sourceMappingURL=https://raw.githubusercontent.com/HarrisonCN/Motionary/v11.4.0/dist/runtime/format-svg.cjs.map
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 11.4: runtime tiers. **basic** — ticker, tween, timeline, scroll, text, CSS / WAAPI keyframes; **standard** — smooth
|
|
3
|
+
* scrolling, drag-snap, SVG, sprites, GIF / APNG / WebP, Lottie; **advanced** — WebGL, 3D file parsing and decoders,
|
|
4
|
+
* physics. A page that only uses basic modules never downloads standard or advanced code.
|
|
5
|
+
*/
|
|
6
|
+
type RuntimeTier = 'basic' | 'standard' | 'advanced';
|
|
1
7
|
/** A runtime module: `{ id, version, api }`, registered with `use()`. */
|
|
2
8
|
interface RuntimeModule<A = unknown> {
|
|
3
9
|
/** Module id: 'core', 'format-css', 'scroll', … (import path `motionary/runtime/<id>`). */
|
|
@@ -5,6 +11,8 @@ interface RuntimeModule<A = unknown> {
|
|
|
5
11
|
version: string;
|
|
6
12
|
/** Other modules this one needs (registered first by `use()` callers). */
|
|
7
13
|
requires?: string[];
|
|
14
|
+
/** 11.4: runtime tier — basic · standard · advanced (docs/runtime-tiers.md). */
|
|
15
|
+
tier?: RuntimeTier;
|
|
8
16
|
/** The module's public API (what `requireModule(id)` returns). */
|
|
9
17
|
api: A;
|
|
10
18
|
/** Optional one-time setup, called on first registration. */
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 11.4: runtime tiers. **basic** — ticker, tween, timeline, scroll, text, CSS / WAAPI keyframes; **standard** — smooth
|
|
3
|
+
* scrolling, drag-snap, SVG, sprites, GIF / APNG / WebP, Lottie; **advanced** — WebGL, 3D file parsing and decoders,
|
|
4
|
+
* physics. A page that only uses basic modules never downloads standard or advanced code.
|
|
5
|
+
*/
|
|
6
|
+
type RuntimeTier = 'basic' | 'standard' | 'advanced';
|
|
1
7
|
/** A runtime module: `{ id, version, api }`, registered with `use()`. */
|
|
2
8
|
interface RuntimeModule<A = unknown> {
|
|
3
9
|
/** Module id: 'core', 'format-css', 'scroll', … (import path `motionary/runtime/<id>`). */
|
|
@@ -5,6 +11,8 @@ interface RuntimeModule<A = unknown> {
|
|
|
5
11
|
version: string;
|
|
6
12
|
/** Other modules this one needs (registered first by `use()` callers). */
|
|
7
13
|
requires?: string[];
|
|
14
|
+
/** 11.4: runtime tier — basic · standard · advanced (docs/runtime-tiers.md). */
|
|
15
|
+
tier?: RuntimeTier;
|
|
8
16
|
/** The module's public API (what `requireModule(id)` returns). */
|
|
9
17
|
api: A;
|
|
10
18
|
/** Optional one-time setup, called on first registration. */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t,e,r,n){"use strict";const i={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0};function a(t){const e=t.match(/[a-zA-Z]|[-+]?(?:\d*\.\d+|\d+\.?)(?:[eE][-+]?\d+)?/g)||[],r=[];let n=0,a="",s=0,o=0,u=0,l=0,h=null,c=null;const m=()=>parseFloat(e[n++]);for(;n<e.length;){if(/[a-zA-Z]/.test(e[n]))a=e[n++];else if(!a)throw new Error("[motionary] format-svg: path must start with a command");const t=a.toUpperCase(),p=a!==t,f=i[t];if(void 0===f)throw new Error(`[motionary] format-svg: unknown path command "${a}"`);if("Z"===t){r.push(["Z"]),s=u,o=l,h=c=null;continue}const g=[];for(let t=0;t<f;t++)g.push(m());if(g.some(t=>Number.isNaN(t)))break;const b=p?s:0,d=p?o:0;switch(t){case"M":s=g[0]+b,o=g[1]+d,u=s,l=o,r.push(["M",s,o]),a=p?"l":"L",h=c=null;break;case"L":s=g[0]+b,o=g[1]+d,r.push(["L",s,o]),h=c=null;break;case"H":s=g[0]+b,r.push(["L",s,o]),h=c=null;break;case"V":o=g[0]+(p?o:0),r.push(["L",s,o]),h=c=null;break;case"C":{const t=[g[0]+b,g[1]+d,g[2]+b,g[3]+d,g[4]+b,g[5]+d];r.push(["C",...t]),h=[t[2],t[3]],s=t[4],o=t[5],c=null;break}case"S":{const t=h?[2*s-h[0],2*o-h[1]]:[s,o],e=[g[0]+b,g[1]+d,g[2]+b,g[3]+d];r.push(["C",t[0],t[1],...e]),h=[e[0],e[1]],s=e[2],o=e[3],c=null;break}case"Q":{const t=[g[0]+b,g[1]+d,g[2]+b,g[3]+d];r.push(["Q",...t]),c=[t[0],t[1]],s=t[2],o=t[3],h=null;break}case"T":{const t=c?[2*s-c[0],2*o-c[1]]:[s,o];s=g[0]+b,o=g[1]+d,r.push(["Q",t[0],t[1],s,o]),c=t,h=null;break}case"A":s=g[5]+b,o=g[6]+d,r.push(["A",g[0],g[1],g[2],g[3],g[4],s,o]),h=c=null}}return r}function s(t,e,r,n,i,a,s,o,u,l){if(!r||!n)return[[o,u]];r=Math.abs(r),n=Math.abs(n);const h=i*Math.PI/180,c=Math.cos(h),m=Math.sin(h),p=(t-o)/2,f=(e-u)/2,g=c*p+m*f,b=-m*p+c*f,d=g*g/(r*r)+b*b/(n*n);d>1&&(r*=Math.sqrt(d),n*=Math.sqrt(d));const M=r*r*n*n-r*r*b*b-n*n*g*g,A=r*r*b*b+n*n*g*g;let y=Math.sqrt(Math.max(0,M/A));a===s&&(y=-y);const k=y*r*b/n,S=-y*n*g/r,v=c*k-m*S+(t+o)/2,$=m*k+c*S+(e+u)/2,N=(t,e,r,n)=>Math.atan2(t*n-e*r,t*r+e*n),T=N(1,0,(g-k)/r,(b-S)/n);let w=N((g-k)/r,(b-S)/n,(-g-k)/r,(-b-S)/n);!s&&w>0&&(w-=2*Math.PI),s&&w<0&&(w+=2*Math.PI);const x=Math.max(2,Math.ceil(Math.abs(w)/(Math.PI/2)*l)),P=[];for(let t=1;t<=x;t++){const e=T+w*t/x;P.push([v+r*Math.cos(e)*c-n*Math.sin(e)*m,$+r*Math.cos(e)*m+n*Math.sin(e)*c])}return P}function o(t,e=16){const r="string"==typeof t?a(t):t,n=[];let i=[],o=0,u=0;for(const t of r){const[r,...a]=t;if("M"===r){i.length&&n.push(i),i=[[a[0],a[1]]],o=a[0],u=a[1];continue}if(i.length||(i=[[o,u]]),"L"===r)i.push([a[0],a[1]]);else if("C"===r)for(let t=1;t<=e;t++){const r=t/e,n=1-r;i.push([n*n*n*o+3*n*n*r*a[0]+3*n*r*r*a[2]+r*r*r*a[4],n*n*n*u+3*n*n*r*a[1]+3*n*r*r*a[3]+r*r*r*a[5]])}else if("Q"===r)for(let t=1;t<=e;t++){const r=t/e,n=1-r;i.push([n*n*o+2*n*r*a[0]+r*r*a[2],n*n*u+2*n*r*a[1]+r*r*a[3]])}else if("A"===r)i.push(...s(o,u,a[0],a[1],a[2],a[3],a[4],a[5],a[6],e/4));else if("Z"===r){i.push([i[0][0],i[0][1]]),n.push(i),o=i[0][0],u=i[0][1],i=[];continue}const l=i[i.length-1];o=l[0],u=l[1]}return i.length&&n.push(i),n}const u=(t,e)=>Math.hypot(e[0]-t[0],e[1]-t[1]);function l(t){return o(t,48).reduce((t,e)=>t+e.slice(1).reduce((t,r,n)=>t+u(e[n],r),0),0)}function h(t,e){const r=o(t,48).flat();let n=0;for(let t=1;t<r.length;t++){const i=u(r[t-1],r[t]);if(n+i>=e||t===r.length-1){const a=i?Math.min(1,Math.max(0,(e-n)/i)):0;return{x:r[t-1][0]+(r[t][0]-r[t-1][0])*a,y:r[t-1][1]+(r[t][1]-r[t-1][1])*a,angle:180*Math.atan2(r[t][1]-r[t-1][1],r[t][0]-r[t-1][0])/Math.PI}}n+=i}return{x:r[0]?.[0]??0,y:r[0]?.[1]??0,angle:0}}function c(t,e=64){const r=l(t);return Array.from({length:e},(n,i)=>{const a=h(t,r*i/(e-1||1));return[a.x,a.y]})}const m=t=>Math.round(1e3*t)/1e3,p=t=>/z\s*$/i.test(t.trim());function f(t,e,r={}){const n=r.points??64,i=c(t,n);let a=c(e,n);const s=p(t)&&p(e);if(s){let t=0,e=1/0;for(let r=0;r<n;r++){let s=0;for(let t=0;t<n;t+=4)s+=u(i[t],a[(t+r)%n]);s<e&&(e=s,t=r)}a=a.map((e,r)=>a[(r+t)%n])}return r=>r<=0?t:r>=1?e:"M"+i.map((t,e)=>`${m(t[0]+(a[e][0]-t[0])*r)} ${m(t[1]+(a[e][1]-t[1])*r)}`).join("L")+(s?"Z":"")}function g(t){if(!t)return NaN;const e=t.trim(),r=/^(-?[\d.]+)(ms|s|min|h)?$/.exec(e);if(!r){const t=/^(?:(\d+):)?(\d+):(\d+(?:\.\d+)?)$/.exec(e);return t?1e3*(60*(60*+(t[1]||0)+ +t[2])+ +t[3]):NaN}const n=parseFloat(r[1]);return"ms"===r[2]?n:"min"===r[2]?6e4*n:"h"===r[2]?36e5*n:1e3*n}const b=t=>t.trim().split(/[\s,]+/).filter(Boolean).map(Number),d=(t,e,r)=>{const n=b(t),i=b(e);return n.map((t,e)=>m(t+((i[e]??t)-t)*r)).join(" ")},M=(t,e,n)=>{try{const i=r.parseValue(t),a=r.parseValue(e);if("str"===i.kind||"str"===a.kind)throw 0;if("col"===i.kind||"col"===a.kind){const t="col"===i.kind?i.c:[0,0,0,1],e="col"===a.kind?a.c:[0,0,0,1],r=t.map((t,r)=>t+(e[r]-t)*n);return`rgba(${Math.round(r[0])},${Math.round(r[1])},${Math.round(r[2])},${m(r[3])})`}return`${m(i.v+(a.v-i.v)*n)}${a.u||i.u}`}catch{return/^[-\d.\s,e]+$/i.test(t)&&/^[-\d.\s,e]+$/i.test(e)?d(t,e,n):n<.5?t:e}};function A(t){const e=[];return t.querySelectorAll("animate, set, animateTransform, animateMotion").forEach(r=>{const n=r.localName,i=r.getAttribute("href")||r.getAttribute("xlink:href"),a=i?t.querySelector(i):r.parentElement;if(!a)return;const s=g((r.getAttribute("begin")||"0").split(";")[0]),o="set"===n?g(r.getAttribute("dur"))||0:g(r.getAttribute("dur")),u=r.getAttribute("repeatCount"),l=g(r.getAttribute("repeatDur"));let h="indefinite"===u||"indefinite"===r.getAttribute("repeatDur")?-1:u?Math.max(0,Math.ceil(parseFloat(u))-1):0;!u&&l>0&&o>0&&(h=Math.ceil(l/o)-1);const c="animateTransform"===n||"animateMotion"===n?"transform":r.getAttribute("attributeName")||"";let m;const p=r.getAttribute("values");if("set"===n)m=[r.getAttribute("to")||""];else if("animateMotion"===n){const e=r.querySelector("mpath"),n=e&&(e.getAttribute("href")||e.getAttribute("xlink:href"));m=[n&&t.querySelector(n)?.getAttribute("d")||r.getAttribute("path")||""]}else if(p)m=p.split(";").map(t=>t.trim()).filter(t=>""!==t);else{const t=a.getAttribute(c)||("opacity"===c?"1":"0"),e=r.getAttribute("from")??t,n=r.getAttribute("by");m=[e,r.getAttribute("to")??(null!==n?b(e).map((t,e)=>t+(b(n)[e]??0)).join(" "):t)]}const f=r.getAttribute("keyTimes");e.push({kind:n,target:a,attribute:c,begin:Number.isFinite(s)?s:0,dur:Number.isFinite(o)?o:0,repeat:h,freeze:"freeze"===r.getAttribute("fill")||"set"===n&&!r.getAttribute("dur"),values:m,keyTimes:f?f.split(";").map(Number):[],calcMode:r.getAttribute("calcMode")||("animateMotion"===n?"paced":"linear"),type:r.getAttribute("type")||void 0,...r.getAttribute("rotate")?{rotate:r.getAttribute("rotate")}:{},...r.getAttribute("keySplines")?{keySplines:r.getAttribute("keySplines")}:{}})}),e}class y extends r.Playable{constructor(t){super({repeat:t.repeat}),this.info=t,this.morphs=[],this.base=t.target.getAttribute(t.attribute),this.interp="d"===t.attribute?(t,e,r)=>this.morph(t,e)(r):"animateTransform"===t.kind?d:M,this.splines=(t.keySplines||"").split(";").filter(t=>t.trim()).map(t=>{const e=b(t);return n.cubicBezier(e[0],e[1],e[2],e[3])})}morph(t,e){const r=t+"|"+e;return this.morphs[r]||(this.morphs[r]=f(t,e))}get duration(){return this.info.dur}write(t){const{kind:e,target:r,type:n}=this.info;"animateTransform"===e?r.setAttribute("transform",`${n||"translate"}(${t})`):r.setAttribute(this.info.attribute,t)}renderLocal(t,e){const r=this.info;if(e&&t>=r.dur&&!r.freeze&&this.repeat>=0)return void(null===this.base?r.target.removeAttribute(r.attribute):r.target.setAttribute(r.attribute,this.base));const n=r.dur?Math.min(1,t/r.dur):1;if("set"===r.kind)return this.write(r.values[0]);if("animateMotion"===r.kind){const t=r.values[0],e=h(t,l(t)*n),i=r.rotate,a="auto"===i?e.angle:"auto-reverse"===i?e.angle+180:parseFloat(i)||0;return void r.target.setAttribute("transform",`translate(${m(e.x)} ${m(e.y)})${a?` rotate(${m(a)})`:""}`)}const i=r.values;if(1===i.length)return this.write(i[0]);const a=r.keyTimes.length===i.length?r.keyTimes:i.map((t,e)=>e/(i.length-1));if("discrete"===r.calcMode){const t=r.keyTimes.length===i.length?r.keyTimes:i.map((t,e)=>e/i.length);let e=0;for(;e<t.length-1&&n>=t[e+1];)e++;return this.write(i[e])}let s=0;for(;s<a.length-2&&n>a[s+1];)s++;const o=a[s+1]-a[s]||1;let u=Math.min(1,Math.max(0,(n-a[s])/o));"spline"===r.calcMode&&this.splines[s]&&(u=this.splines[s](u)),this.write(this.interp(i[s],i[s+1],u))}}function k(t,e={}){const n=A(t),i=Array.from(t.querySelectorAll("animate, set, animateTransform, animateMotion")),a=i.map(t=>[t,t.parentNode,t.nextSibling]);i.forEach(t=>t.remove());const s=new r.Timeline({});for(const t of n)s.add(new y(t),t.begin);return e.timeScale&&(s.timeScale=e.timeScale),e.paused||s.play(),{timeline:s,animations:n,restore(){s.kill(),a.forEach(([t,e,r])=>e?.insertBefore(t,r&&r.parentNode===e?r:null))}}}const S={id:"format-svg",version:e.RUNTIME_VERSION,requires:["core"],api:{parsePath:a,flattenPath:o,pathLength:l,pointAtLength:h,samplePath:c,morphPath:f,readSmil:A,playSmil:k,smilTime:g}};e.register(S),t.flattenPath=o,t.formatSvg=S,t.morphPath=f,t.parsePath=a,t.pathLength=l,t.playSmil=k,t.pointAtLength=h,t.readSmil=A,t.samplePath=c,t.smilTime=g}(this.MotionaryRuntime=this.MotionaryRuntime||{},MotionaryRuntime,MotionaryRuntime,MotionaryRuntime);
|
|
2
|
-
//# sourceMappingURL=https://raw.githubusercontent.com/HarrisonCN/Motionary/v11.
|
|
1
|
+
!function(t,e,r,n){"use strict";const i={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0};function a(t){const e=t.match(/[a-zA-Z]|[-+]?(?:\d*\.\d+|\d+\.?)(?:[eE][-+]?\d+)?/g)||[],r=[];let n=0,a="",s=0,o=0,u=0,l=0,h=null,c=null;const m=()=>parseFloat(e[n++]);for(;n<e.length;){if(/[a-zA-Z]/.test(e[n]))a=e[n++];else if(!a)throw new Error("[motionary] format-svg: path must start with a command");const t=a.toUpperCase(),p=a!==t,f=i[t];if(void 0===f)throw new Error(`[motionary] format-svg: unknown path command "${a}"`);if("Z"===t){r.push(["Z"]),s=u,o=l,h=c=null;continue}const g=[];for(let t=0;t<f;t++)g.push(m());if(g.some(t=>Number.isNaN(t)))break;const b=p?s:0,d=p?o:0;switch(t){case"M":s=g[0]+b,o=g[1]+d,u=s,l=o,r.push(["M",s,o]),a=p?"l":"L",h=c=null;break;case"L":s=g[0]+b,o=g[1]+d,r.push(["L",s,o]),h=c=null;break;case"H":s=g[0]+b,r.push(["L",s,o]),h=c=null;break;case"V":o=g[0]+(p?o:0),r.push(["L",s,o]),h=c=null;break;case"C":{const t=[g[0]+b,g[1]+d,g[2]+b,g[3]+d,g[4]+b,g[5]+d];r.push(["C",...t]),h=[t[2],t[3]],s=t[4],o=t[5],c=null;break}case"S":{const t=h?[2*s-h[0],2*o-h[1]]:[s,o],e=[g[0]+b,g[1]+d,g[2]+b,g[3]+d];r.push(["C",t[0],t[1],...e]),h=[e[0],e[1]],s=e[2],o=e[3],c=null;break}case"Q":{const t=[g[0]+b,g[1]+d,g[2]+b,g[3]+d];r.push(["Q",...t]),c=[t[0],t[1]],s=t[2],o=t[3],h=null;break}case"T":{const t=c?[2*s-c[0],2*o-c[1]]:[s,o];s=g[0]+b,o=g[1]+d,r.push(["Q",t[0],t[1],s,o]),c=t,h=null;break}case"A":s=g[5]+b,o=g[6]+d,r.push(["A",g[0],g[1],g[2],g[3],g[4],s,o]),h=c=null}}return r}function s(t,e,r,n,i,a,s,o,u,l){if(!r||!n)return[[o,u]];r=Math.abs(r),n=Math.abs(n);const h=i*Math.PI/180,c=Math.cos(h),m=Math.sin(h),p=(t-o)/2,f=(e-u)/2,g=c*p+m*f,b=-m*p+c*f,d=g*g/(r*r)+b*b/(n*n);d>1&&(r*=Math.sqrt(d),n*=Math.sqrt(d));const M=r*r*n*n-r*r*b*b-n*n*g*g,A=r*r*b*b+n*n*g*g;let y=Math.sqrt(Math.max(0,M/A));a===s&&(y=-y);const k=y*r*b/n,S=-y*n*g/r,v=c*k-m*S+(t+o)/2,$=m*k+c*S+(e+u)/2,N=(t,e,r,n)=>Math.atan2(t*n-e*r,t*r+e*n),T=N(1,0,(g-k)/r,(b-S)/n);let w=N((g-k)/r,(b-S)/n,(-g-k)/r,(-b-S)/n);!s&&w>0&&(w-=2*Math.PI),s&&w<0&&(w+=2*Math.PI);const x=Math.max(2,Math.ceil(Math.abs(w)/(Math.PI/2)*l)),P=[];for(let t=1;t<=x;t++){const e=T+w*t/x;P.push([v+r*Math.cos(e)*c-n*Math.sin(e)*m,$+r*Math.cos(e)*m+n*Math.sin(e)*c])}return P}function o(t,e=16){const r="string"==typeof t?a(t):t,n=[];let i=[],o=0,u=0;for(const t of r){const[r,...a]=t;if("M"===r){i.length&&n.push(i),i=[[a[0],a[1]]],o=a[0],u=a[1];continue}if(i.length||(i=[[o,u]]),"L"===r)i.push([a[0],a[1]]);else if("C"===r)for(let t=1;t<=e;t++){const r=t/e,n=1-r;i.push([n*n*n*o+3*n*n*r*a[0]+3*n*r*r*a[2]+r*r*r*a[4],n*n*n*u+3*n*n*r*a[1]+3*n*r*r*a[3]+r*r*r*a[5]])}else if("Q"===r)for(let t=1;t<=e;t++){const r=t/e,n=1-r;i.push([n*n*o+2*n*r*a[0]+r*r*a[2],n*n*u+2*n*r*a[1]+r*r*a[3]])}else if("A"===r)i.push(...s(o,u,a[0],a[1],a[2],a[3],a[4],a[5],a[6],e/4));else if("Z"===r){i.push([i[0][0],i[0][1]]),n.push(i),o=i[0][0],u=i[0][1],i=[];continue}const l=i[i.length-1];o=l[0],u=l[1]}return i.length&&n.push(i),n}const u=(t,e)=>Math.hypot(e[0]-t[0],e[1]-t[1]);function l(t){return o(t,48).reduce((t,e)=>t+e.slice(1).reduce((t,r,n)=>t+u(e[n],r),0),0)}function h(t,e){const r=o(t,48).flat();let n=0;for(let t=1;t<r.length;t++){const i=u(r[t-1],r[t]);if(n+i>=e||t===r.length-1){const a=i?Math.min(1,Math.max(0,(e-n)/i)):0;return{x:r[t-1][0]+(r[t][0]-r[t-1][0])*a,y:r[t-1][1]+(r[t][1]-r[t-1][1])*a,angle:180*Math.atan2(r[t][1]-r[t-1][1],r[t][0]-r[t-1][0])/Math.PI}}n+=i}return{x:r[0]?.[0]??0,y:r[0]?.[1]??0,angle:0}}function c(t,e=64){const r=l(t);return Array.from({length:e},(n,i)=>{const a=h(t,r*i/(e-1||1));return[a.x,a.y]})}const m=t=>Math.round(1e3*t)/1e3,p=t=>/z\s*$/i.test(t.trim());function f(t,e,r={}){const n=r.points??64,i=c(t,n);let a=c(e,n);const s=p(t)&&p(e);if(s){let t=0,e=1/0;for(let r=0;r<n;r++){let s=0;for(let t=0;t<n;t+=4)s+=u(i[t],a[(t+r)%n]);s<e&&(e=s,t=r)}a=a.map((e,r)=>a[(r+t)%n])}return r=>r<=0?t:r>=1?e:"M"+i.map((t,e)=>`${m(t[0]+(a[e][0]-t[0])*r)} ${m(t[1]+(a[e][1]-t[1])*r)}`).join("L")+(s?"Z":"")}function g(t){if(!t)return NaN;const e=t.trim(),r=/^(-?[\d.]+)(ms|s|min|h)?$/.exec(e);if(!r){const t=/^(?:(\d+):)?(\d+):(\d+(?:\.\d+)?)$/.exec(e);return t?1e3*(60*(60*+(t[1]||0)+ +t[2])+ +t[3]):NaN}const n=parseFloat(r[1]);return"ms"===r[2]?n:"min"===r[2]?6e4*n:"h"===r[2]?36e5*n:1e3*n}const b=t=>t.trim().split(/[\s,]+/).filter(Boolean).map(Number),d=(t,e,r)=>{const n=b(t),i=b(e);return n.map((t,e)=>m(t+((i[e]??t)-t)*r)).join(" ")},M=(t,e,n)=>{try{const i=r.parseValue(t),a=r.parseValue(e);if("str"===i.kind||"str"===a.kind)throw 0;if("col"===i.kind||"col"===a.kind){const t="col"===i.kind?i.c:[0,0,0,1],e="col"===a.kind?a.c:[0,0,0,1],r=t.map((t,r)=>t+(e[r]-t)*n);return`rgba(${Math.round(r[0])},${Math.round(r[1])},${Math.round(r[2])},${m(r[3])})`}return`${m(i.v+(a.v-i.v)*n)}${a.u||i.u}`}catch{return/^[-\d.\s,e]+$/i.test(t)&&/^[-\d.\s,e]+$/i.test(e)?d(t,e,n):n<.5?t:e}};function A(t){const e=[];return t.querySelectorAll("animate, set, animateTransform, animateMotion").forEach(r=>{const n=r.localName,i=r.getAttribute("href")||r.getAttribute("xlink:href"),a=i?t.querySelector(i):r.parentElement;if(!a)return;const s=g((r.getAttribute("begin")||"0").split(";")[0]),o="set"===n?g(r.getAttribute("dur"))||0:g(r.getAttribute("dur")),u=r.getAttribute("repeatCount"),l=g(r.getAttribute("repeatDur"));let h="indefinite"===u||"indefinite"===r.getAttribute("repeatDur")?-1:u?Math.max(0,Math.ceil(parseFloat(u))-1):0;!u&&l>0&&o>0&&(h=Math.ceil(l/o)-1);const c="animateTransform"===n||"animateMotion"===n?"transform":r.getAttribute("attributeName")||"";let m;const p=r.getAttribute("values");if("set"===n)m=[r.getAttribute("to")||""];else if("animateMotion"===n){const e=r.querySelector("mpath"),n=e&&(e.getAttribute("href")||e.getAttribute("xlink:href"));m=[n&&t.querySelector(n)?.getAttribute("d")||r.getAttribute("path")||""]}else if(p)m=p.split(";").map(t=>t.trim()).filter(t=>""!==t);else{const t=a.getAttribute(c)||("opacity"===c?"1":"0"),e=r.getAttribute("from")??t,n=r.getAttribute("by");m=[e,r.getAttribute("to")??(null!==n?b(e).map((t,e)=>t+(b(n)[e]??0)).join(" "):t)]}const f=r.getAttribute("keyTimes");e.push({kind:n,target:a,attribute:c,begin:Number.isFinite(s)?s:0,dur:Number.isFinite(o)?o:0,repeat:h,freeze:"freeze"===r.getAttribute("fill")||"set"===n&&!r.getAttribute("dur"),values:m,keyTimes:f?f.split(";").map(Number):[],calcMode:r.getAttribute("calcMode")||("animateMotion"===n?"paced":"linear"),type:r.getAttribute("type")||void 0,...r.getAttribute("rotate")?{rotate:r.getAttribute("rotate")}:{},...r.getAttribute("keySplines")?{keySplines:r.getAttribute("keySplines")}:{}})}),e}class y extends r.Playable{constructor(t){super({repeat:t.repeat}),this.info=t,this.morphs=[],this.base=t.target.getAttribute(t.attribute),this.interp="d"===t.attribute?(t,e,r)=>this.morph(t,e)(r):"animateTransform"===t.kind?d:M,this.splines=(t.keySplines||"").split(";").filter(t=>t.trim()).map(t=>{const e=b(t);return n.cubicBezier(e[0],e[1],e[2],e[3])})}morph(t,e){const r=t+"|"+e;return this.morphs[r]||(this.morphs[r]=f(t,e))}get duration(){return this.info.dur}write(t){const{kind:e,target:r,type:n}=this.info;"animateTransform"===e?r.setAttribute("transform",`${n||"translate"}(${t})`):r.setAttribute(this.info.attribute,t)}renderLocal(t,e){const r=this.info;if(e&&t>=r.dur&&!r.freeze&&this.repeat>=0)return void(null===this.base?r.target.removeAttribute(r.attribute):r.target.setAttribute(r.attribute,this.base));const n=r.dur?Math.min(1,t/r.dur):1;if("set"===r.kind)return this.write(r.values[0]);if("animateMotion"===r.kind){const t=r.values[0],e=h(t,l(t)*n),i=r.rotate,a="auto"===i?e.angle:"auto-reverse"===i?e.angle+180:parseFloat(i)||0;return void r.target.setAttribute("transform",`translate(${m(e.x)} ${m(e.y)})${a?` rotate(${m(a)})`:""}`)}const i=r.values;if(1===i.length)return this.write(i[0]);const a=r.keyTimes.length===i.length?r.keyTimes:i.map((t,e)=>e/(i.length-1));if("discrete"===r.calcMode){const t=r.keyTimes.length===i.length?r.keyTimes:i.map((t,e)=>e/i.length);let e=0;for(;e<t.length-1&&n>=t[e+1];)e++;return this.write(i[e])}let s=0;for(;s<a.length-2&&n>a[s+1];)s++;const o=a[s+1]-a[s]||1;let u=Math.min(1,Math.max(0,(n-a[s])/o));"spline"===r.calcMode&&this.splines[s]&&(u=this.splines[s](u)),this.write(this.interp(i[s],i[s+1],u))}}function k(t,e={}){const n=A(t),i=Array.from(t.querySelectorAll("animate, set, animateTransform, animateMotion")),a=i.map(t=>[t,t.parentNode,t.nextSibling]);i.forEach(t=>t.remove());const s=new r.Timeline({});for(const t of n)s.add(new y(t),t.begin);return e.timeScale&&(s.timeScale=e.timeScale),e.paused||s.play(),{timeline:s,animations:n,restore(){s.kill(),a.forEach(([t,e,r])=>e?.insertBefore(t,r&&r.parentNode===e?r:null))}}}const S={id:"format-svg",version:e.RUNTIME_VERSION,tier:"standard",requires:["core"],api:{parsePath:a,flattenPath:o,pathLength:l,pointAtLength:h,samplePath:c,morphPath:f,readSmil:A,playSmil:k,smilTime:g}};e.register(S),t.flattenPath=o,t.formatSvg=S,t.morphPath=f,t.parsePath=a,t.pathLength=l,t.playSmil=k,t.pointAtLength=h,t.readSmil=A,t.samplePath=c,t.smilTime=g}(this.MotionaryRuntime=this.MotionaryRuntime||{},MotionaryRuntime,MotionaryRuntime,MotionaryRuntime);
|
|
2
|
+
//# sourceMappingURL=https://raw.githubusercontent.com/HarrisonCN/Motionary/v11.4.0/dist/runtime/format-svg.iife.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { R as RUNTIME_VERSION } from '../chunks/registry-
|
|
2
|
-
import { T as Timeline, P as Playable, p as parseValue } from '../chunks/tween-
|
|
1
|
+
import { R as RUNTIME_VERSION } from '../chunks/registry-CorBCE7b.js';
|
|
2
|
+
import { T as Timeline, P as Playable, p as parseValue } from '../chunks/tween-BHDOFhXX.js';
|
|
3
3
|
import { c as cubicBezier } from '../chunks/ease-XN8_0sXu.js';
|
|
4
|
-
import '../chunks/ticker-
|
|
4
|
+
import '../chunks/ticker-CZisW9Nb.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* `motionary/runtime/format-svg` (10.2) — SVG animation with the runtime
|
|
@@ -441,7 +441,7 @@ function playSmil(svg, o = {}) {
|
|
|
441
441
|
};
|
|
442
442
|
}
|
|
443
443
|
/** The module object for `use(formatSvg)`. */
|
|
444
|
-
const formatSvg = { id: 'format-svg', version: RUNTIME_VERSION, requires: ['core'], api: { parsePath, flattenPath, pathLength, pointAtLength, samplePath, morphPath, readSmil, playSmil, smilTime } };
|
|
444
|
+
const formatSvg = { id: 'format-svg', version: RUNTIME_VERSION, tier: 'standard', requires: ['core'], api: { parsePath, flattenPath, pathLength, pointAtLength, samplePath, morphPath, readSmil, playSmil, smilTime } };
|
|
445
445
|
|
|
446
446
|
export { flattenPath, formatSvg, morphPath, parsePath, pathLength, playSmil, pointAtLength, readSmil, samplePath, smilTime };
|
|
447
|
-
//# sourceMappingURL=https://raw.githubusercontent.com/HarrisonCN/Motionary/v11.
|
|
447
|
+
//# sourceMappingURL=https://raw.githubusercontent.com/HarrisonCN/Motionary/v11.4.0/dist/runtime/format-svg.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var registry = require('../chunks/registry-
|
|
4
|
-
var animImage = require('../chunks/anim-image-
|
|
5
|
-
require('../chunks/tween-
|
|
6
|
-
require('../chunks/ticker
|
|
3
|
+
var registry = require('../chunks/registry-VITvgTNc.cjs');
|
|
4
|
+
var animImage = require('../chunks/anim-image-Bjmc17ZU.cjs');
|
|
5
|
+
require('../chunks/tween-ookpV7jR.cjs');
|
|
6
|
+
require('../chunks/ticker-DwRa5hIu.cjs');
|
|
7
7
|
require('../chunks/ease-HwYZnZat.cjs');
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -111,7 +111,7 @@ async function loadWebp(src, o = {}) {
|
|
|
111
111
|
return decodeWebp(await animImage.bytesOf(src), o);
|
|
112
112
|
}
|
|
113
113
|
/** The module object for `use(formatWebp)`. */
|
|
114
|
-
const formatWebp = { id: 'format-webp', version: registry.RUNTIME_VERSION, requires: ['core'], api: { parseWebp, webpFrameFiles, decodeWebp, loadWebp, animatedImagePlayer: animImage.animatedImagePlayer } };
|
|
114
|
+
const formatWebp = { id: 'format-webp', version: registry.RUNTIME_VERSION, tier: 'standard', requires: ['core'], api: { parseWebp, webpFrameFiles, decodeWebp, loadWebp, animatedImagePlayer: animImage.animatedImagePlayer } };
|
|
115
115
|
|
|
116
116
|
exports.animatedImagePlayer = animImage.animatedImagePlayer;
|
|
117
117
|
exports.decodeWebp = decodeWebp;
|
|
@@ -120,4 +120,4 @@ exports.loadWebp = loadWebp;
|
|
|
120
120
|
exports.parseWebp = parseWebp;
|
|
121
121
|
exports.riffChunks = riffChunks;
|
|
122
122
|
exports.webpFrameFiles = webpFrameFiles;
|
|
123
|
-
//# sourceMappingURL=https://raw.githubusercontent.com/HarrisonCN/Motionary/v11.
|
|
123
|
+
//# sourceMappingURL=https://raw.githubusercontent.com/HarrisonCN/Motionary/v11.4.0/dist/runtime/format-webp.cjs.map
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 11.4: runtime tiers. **basic** — ticker, tween, timeline, scroll, text, CSS / WAAPI keyframes; **standard** — smooth
|
|
3
|
+
* scrolling, drag-snap, SVG, sprites, GIF / APNG / WebP, Lottie; **advanced** — WebGL, 3D file parsing and decoders,
|
|
4
|
+
* physics. A page that only uses basic modules never downloads standard or advanced code.
|
|
5
|
+
*/
|
|
6
|
+
type RuntimeTier = 'basic' | 'standard' | 'advanced';
|
|
1
7
|
/** A runtime module: `{ id, version, api }`, registered with `use()`. */
|
|
2
8
|
interface RuntimeModule<A = unknown> {
|
|
3
9
|
/** Module id: 'core', 'format-css', 'scroll', … (import path `motionary/runtime/<id>`). */
|
|
@@ -5,6 +11,8 @@ interface RuntimeModule<A = unknown> {
|
|
|
5
11
|
version: string;
|
|
6
12
|
/** Other modules this one needs (registered first by `use()` callers). */
|
|
7
13
|
requires?: string[];
|
|
14
|
+
/** 11.4: runtime tier — basic · standard · advanced (docs/runtime-tiers.md). */
|
|
15
|
+
tier?: RuntimeTier;
|
|
8
16
|
/** The module's public API (what `requireModule(id)` returns). */
|
|
9
17
|
api: A;
|
|
10
18
|
/** Optional one-time setup, called on first registration. */
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 11.4: runtime tiers. **basic** — ticker, tween, timeline, scroll, text, CSS / WAAPI keyframes; **standard** — smooth
|
|
3
|
+
* scrolling, drag-snap, SVG, sprites, GIF / APNG / WebP, Lottie; **advanced** — WebGL, 3D file parsing and decoders,
|
|
4
|
+
* physics. A page that only uses basic modules never downloads standard or advanced code.
|
|
5
|
+
*/
|
|
6
|
+
type RuntimeTier = 'basic' | 'standard' | 'advanced';
|
|
1
7
|
/** A runtime module: `{ id, version, api }`, registered with `use()`. */
|
|
2
8
|
interface RuntimeModule<A = unknown> {
|
|
3
9
|
/** Module id: 'core', 'format-css', 'scroll', … (import path `motionary/runtime/<id>`). */
|
|
@@ -5,6 +11,8 @@ interface RuntimeModule<A = unknown> {
|
|
|
5
11
|
version: string;
|
|
6
12
|
/** Other modules this one needs (registered first by `use()` callers). */
|
|
7
13
|
requires?: string[];
|
|
14
|
+
/** 11.4: runtime tier — basic · standard · advanced (docs/runtime-tiers.md). */
|
|
15
|
+
tier?: RuntimeTier;
|
|
8
16
|
/** The module's public API (what `requireModule(id)` returns). */
|
|
9
17
|
api: A;
|
|
10
18
|
/** Optional one-time setup, called on first registration. */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t,e,a){"use strict";function n(t,e,a,n){const i=new Uint8ClampedArray(t*e*4),r=[];for(const n of a){const a="previous"===n.dispose?i.slice():null,{width:s,height:o,data:h}=n.image;for(let a=0;a<o;a++){const r=n.y+a;if(!(r<0||r>=e))for(let e=0;e<s;e++){const o=n.x+e;if(o<0||o>=t)continue;const
|
|
2
|
-
//# sourceMappingURL=https://raw.githubusercontent.com/HarrisonCN/Motionary/v11.
|
|
1
|
+
!function(t,e,a){"use strict";function n(t,e,a,n){const i=new Uint8ClampedArray(t*e*4),r=[];for(const n of a){const a="previous"===n.dispose?i.slice():null,{width:s,height:o,data:h}=n.image;for(let a=0;a<o;a++){const r=n.y+a;if(!(r<0||r>=e))for(let e=0;e<s;e++){const o=n.x+e;if(o<0||o>=t)continue;const d=4*(a*s+e),f=4*(r*t+o),c=h[d+3];if("source"===n.blend||255===c)i[f]=h[d],i[f+1]=h[d+1],i[f+2]=h[d+2],i[f+3]=c;else if(c){const t=i[f+3]/255,e=c/255,a=e+t*(1-e);for(let n=0;n<3;n++)i[f+n]=(h[d+n]*e+i[f+n]*t*(1-e))/a;i[f+3]=255*a}}}if(r.push({delay:n.delay,image:{width:t,height:e,data:i.slice()}}),"background"===n.dispose)for(let a=Math.max(0,n.y);a<Math.min(e,n.y+o);a++)for(let e=Math.max(0,n.x);e<Math.min(t,n.x+s);e++)i.set([0,0,0,0],4*(a*t+e));else a&&i.set(a)}return r}const i=async(t,e)=>{const a=globalThis;if("function"!=typeof a.createImageBitmap)throw new Error("[motionary] no image decoder here (createImageBitmap is missing) — pass { decode } to the loader");const n=await a.createImageBitmap(new Blob([t],{type:e})),i=n.width,r=n.height,s=("function"==typeof a.OffscreenCanvas?new a.OffscreenCanvas(i,r):Object.assign(document.createElement("canvas"),{width:i,height:r})).getContext("2d",{willReadFrequently:!0});s.drawImage(n,0,0),n.close?.();const o=s.getImageData(0,0,i,r);return{width:o.width,height:o.height,data:o.data}};class r extends a.Playable{constructor(t,e,a){super({repeat:a.repeat??(0===e.plays?-1:Math.max(0,e.plays-1)),yoyo:a.yoyo}),this.canvas=t,this.anim=e,this.times=[0],this.cur=-1,this.timeScale=a.speed||1;for(const t of e.frames)this.times.push(this.times[this.times.length-1]+t.delay);t.width!==e.width&&(t.width=e.width),t.height!==e.height&&(t.height=e.height),this.ctx=t.getContext("2d"),this.datas=e.frames.map(()=>null),this.show(0),a.paused||this.play()}get duration(){return this.times[this.times.length-1]}get frame(){return this.cur}get frameCount(){return this.anim.frames.length}renderLocal(t){const e=Math.min(t,this.duration-.001);let a=0,n=this.anim.frames.length-1;for(;a<n;){const t=a+n+1>>1;this.times[t]<=e?a=t:n=t-1}this.show(a)}show(t){if(t===this.cur||!this.ctx)return;this.cur=t;const e=this.anim.frames[t];if(!e)return;let a=this.datas[t];a||"function"!=typeof ImageData||(a=this.datas[t]=new ImageData(new Uint8ClampedArray(e.image.data),e.image.width,e.image.height)),a&&this.ctx.putImageData(a,0,0)}}function s(t,e,a={}){if(!e.frames.length)throw new Error("[motionary] animatedImagePlayer: the animation has no frames");return new r(t,e,a)}const o=(t,e)=>t[e]|t[e+1]<<8|t[e+2]<<16,h=(t,e)=>(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0,d=(t,e)=>String.fromCharCode(t[e],t[e+1],t[e+2],t[e+3]);function f(t,e=12,a=t.length){const n=[];let i=e;for(;i+8<=a;){const e=h(t,i+4);n.push({type:d(t,i),data:t.subarray(i+8,i+8+e)}),i+=8+e+(1&e)}return n}function c(t){const e=(t=>t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength))(t);if("RIFF"!==d(e,0)||"WEBP"!==d(e,8))throw new Error("[motionary] format-webp: not a WebP file");const a=f(e,12,Math.min(e.length,8+h(e,4))),n=a.find(t=>"VP8X"===t.type),i=a.find(t=>"ANIM"===t.type),r=a.filter(t=>"ANMF"===t.type);if(n&&i&&r.length){const t=o(n.data,4)+1,e=o(n.data,7)+1,a=i.data,s=r.map(t=>{const e=t.data,a=e[15];return{x:2*o(e,0),y:2*o(e,3),width:o(e,6)+1,height:o(e,9)+1,delay:(n=o(e,12),n<=10?100:n),blend:2&a?"source":"over",dispose:1&a?"background":"none",chunks:f(e,16,e.length).filter(t=>/^(ALPH|VP8 |VP8L)$/.test(t.type))};var n});return{width:t,height:e,animated:!0,plays:a[4]|a[5]<<8,background:[a[2],a[1],a[0],a[3]],frames:s}}const s=a.filter(t=>/^(ALPH|VP8 |VP8L)$/.test(t.type)),c=s.find(t=>"ALPH"!==t.type);if(!c)throw new Error("[motionary] format-webp: no image data");const[m,u]=n?[o(n.data,4)+1,o(n.data,7)+1]:function(t){const e=t.data;if("VP8L"===t.type){const t=h(e,1);return[1+(16383&t),1+(t>>14&16383)]}return[16383&(e[6]|e[7]<<8),16383&(e[8]|e[9]<<8)]}(c);return{width:m,height:u,animated:!1,plays:1,background:[0,0,0,0],frames:[{x:0,y:0,width:m,height:u,delay:100,blend:"source",dispose:"none",chunks:s}]}}function m(t){const e=t.reduce((t,e)=>t+8+e.data.length+(1&e.data.length),4),a=new Uint8Array(8+e),n=new DataView(a.buffer),i=(t,e)=>{for(let n=0;n<4;n++)a[e+n]=t.charCodeAt(n)};i("RIFF",0),n.setUint32(4,e,!0),i("WEBP",8);let r=12;for(const e of t)i(e.type,r),n.setUint32(r+4,e.data.length,!0),a.set(e.data,r+8),r+=8+e.data.length+(1&e.data.length);return a}function u(t){return t.frames.map(t=>{if(!t.chunks.some(t=>"ALPH"===t.type))return m(t.chunks.filter(t=>"ALPH"!==t.type));const e=new Uint8Array(10);e[0]=16;const a=t.width-1,n=t.height-1;return e.set([255&a,a>>8&255,a>>16&255,255&n,n>>8&255,n>>16&255],4),m([{type:"VP8X",data:e},...t.chunks])})}async function l(t,e={}){const a=c(t),r=e.decode||i,s=await Promise.all(u(a).map(t=>r(t,"image/webp"))),o=a.frames.map((t,e)=>({x:t.x,y:t.y,image:s[e],delay:t.delay,blend:t.blend,dispose:t.dispose}));return{format:"webp",width:a.width,height:a.height,plays:a.plays,frames:n(a.width,a.height,o),info:a}}async function y(t,e={}){return l(await async function(t){if("string"==typeof t){const e=await fetch(t);if(!e.ok)throw new Error(`[motionary] could not load ${t} (${e.status})`);return new Uint8Array(await e.arrayBuffer())}return t instanceof ArrayBuffer?new Uint8Array(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(await t.arrayBuffer())}(t),e)}const g={id:"format-webp",version:e.RUNTIME_VERSION,tier:"standard",requires:["core"],api:{parseWebp:c,webpFrameFiles:u,decodeWebp:l,loadWebp:y,animatedImagePlayer:s}};e.register(g),t.animatedImagePlayer=s,t.decodeWebp=l,t.formatWebp=g,t.loadWebp=y,t.parseWebp=c,t.riffChunks=f,t.webpFrameFiles=u}(this.MotionaryRuntime=this.MotionaryRuntime||{},MotionaryRuntime,MotionaryRuntime);
|
|
2
|
+
//# sourceMappingURL=https://raw.githubusercontent.com/HarrisonCN/Motionary/v11.4.0/dist/runtime/format-webp.iife.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { R as RUNTIME_VERSION } from '../chunks/registry-
|
|
2
|
-
import { a as animatedImagePlayer, b as browserDecode, c as composeFrames, d as bytesOf, u as u8, f as fixDelay } from '../chunks/anim-image-
|
|
3
|
-
import '../chunks/tween-
|
|
4
|
-
import '../chunks/ticker-
|
|
1
|
+
import { R as RUNTIME_VERSION } from '../chunks/registry-CorBCE7b.js';
|
|
2
|
+
import { a as animatedImagePlayer, b as browserDecode, c as composeFrames, d as bytesOf, u as u8, f as fixDelay } from '../chunks/anim-image-CSrYZ3ZY.js';
|
|
3
|
+
import '../chunks/tween-BHDOFhXX.js';
|
|
4
|
+
import '../chunks/ticker-CZisW9Nb.js';
|
|
5
5
|
import '../chunks/ease-XN8_0sXu.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -109,7 +109,7 @@ async function loadWebp(src, o = {}) {
|
|
|
109
109
|
return decodeWebp(await bytesOf(src), o);
|
|
110
110
|
}
|
|
111
111
|
/** The module object for `use(formatWebp)`. */
|
|
112
|
-
const formatWebp = { id: 'format-webp', version: RUNTIME_VERSION, requires: ['core'], api: { parseWebp, webpFrameFiles, decodeWebp, loadWebp, animatedImagePlayer } };
|
|
112
|
+
const formatWebp = { id: 'format-webp', version: RUNTIME_VERSION, tier: 'standard', requires: ['core'], api: { parseWebp, webpFrameFiles, decodeWebp, loadWebp, animatedImagePlayer } };
|
|
113
113
|
|
|
114
114
|
export { animatedImagePlayer, decodeWebp, formatWebp, loadWebp, parseWebp, riffChunks, webpFrameFiles };
|
|
115
|
-
//# sourceMappingURL=https://raw.githubusercontent.com/HarrisonCN/Motionary/v11.
|
|
115
|
+
//# sourceMappingURL=https://raw.githubusercontent.com/HarrisonCN/Motionary/v11.4.0/dist/runtime/format-webp.js.map
|
package/dist/runtime/gl.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var registry = require('../chunks/registry-
|
|
3
|
+
var registry = require('../chunks/registry-VITvgTNc.cjs');
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* `motionary/runtime/gl` (10.5) — a small WebGL2 scene renderer written for
|
|
@@ -746,6 +746,7 @@ function orbitControls(camera, el, o = {}) {
|
|
|
746
746
|
const gl = {
|
|
747
747
|
id: 'gl',
|
|
748
748
|
version: registry.RUNTIME_VERSION,
|
|
749
|
+
tier: 'advanced',
|
|
749
750
|
requires: ['core'],
|
|
750
751
|
api: { mat4, quatFromEuler, quatMultiply, quatSlerp, box, plane, sphere, torus, computeNormals, standardMaterial, unlitMaterial, shaderMaterial, color, texture, GlNode, Camera, Scene, bounds, frameNode, scrubVideo, createRenderer, orbitControls },
|
|
751
752
|
};
|
|
@@ -773,4 +774,4 @@ exports.standardMaterial = standardMaterial;
|
|
|
773
774
|
exports.texture = texture;
|
|
774
775
|
exports.torus = torus;
|
|
775
776
|
exports.unlitMaterial = unlitMaterial;
|
|
776
|
-
//# sourceMappingURL=https://raw.githubusercontent.com/HarrisonCN/Motionary/v11.
|
|
777
|
+
//# sourceMappingURL=https://raw.githubusercontent.com/HarrisonCN/Motionary/v11.4.0/dist/runtime/gl.cjs.map
|
package/dist/runtime/gl.d.cts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 11.4: runtime tiers. **basic** — ticker, tween, timeline, scroll, text, CSS / WAAPI keyframes; **standard** — smooth
|
|
3
|
+
* scrolling, drag-snap, SVG, sprites, GIF / APNG / WebP, Lottie; **advanced** — WebGL, 3D file parsing and decoders,
|
|
4
|
+
* physics. A page that only uses basic modules never downloads standard or advanced code.
|
|
5
|
+
*/
|
|
6
|
+
type RuntimeTier = 'basic' | 'standard' | 'advanced';
|
|
1
7
|
/** A runtime module: `{ id, version, api }`, registered with `use()`. */
|
|
2
8
|
interface RuntimeModule<A = unknown> {
|
|
3
9
|
/** Module id: 'core', 'format-css', 'scroll', … (import path `motionary/runtime/<id>`). */
|
|
@@ -5,6 +11,8 @@ interface RuntimeModule<A = unknown> {
|
|
|
5
11
|
version: string;
|
|
6
12
|
/** Other modules this one needs (registered first by `use()` callers). */
|
|
7
13
|
requires?: string[];
|
|
14
|
+
/** 11.4: runtime tier — basic · standard · advanced (docs/runtime-tiers.md). */
|
|
15
|
+
tier?: RuntimeTier;
|
|
8
16
|
/** The module's public API (what `requireModule(id)` returns). */
|
|
9
17
|
api: A;
|
|
10
18
|
/** Optional one-time setup, called on first registration. */
|
package/dist/runtime/gl.d.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 11.4: runtime tiers. **basic** — ticker, tween, timeline, scroll, text, CSS / WAAPI keyframes; **standard** — smooth
|
|
3
|
+
* scrolling, drag-snap, SVG, sprites, GIF / APNG / WebP, Lottie; **advanced** — WebGL, 3D file parsing and decoders,
|
|
4
|
+
* physics. A page that only uses basic modules never downloads standard or advanced code.
|
|
5
|
+
*/
|
|
6
|
+
type RuntimeTier = 'basic' | 'standard' | 'advanced';
|
|
1
7
|
/** A runtime module: `{ id, version, api }`, registered with `use()`. */
|
|
2
8
|
interface RuntimeModule<A = unknown> {
|
|
3
9
|
/** Module id: 'core', 'format-css', 'scroll', … (import path `motionary/runtime/<id>`). */
|
|
@@ -5,6 +11,8 @@ interface RuntimeModule<A = unknown> {
|
|
|
5
11
|
version: string;
|
|
6
12
|
/** Other modules this one needs (registered first by `use()` callers). */
|
|
7
13
|
requires?: string[];
|
|
14
|
+
/** 11.4: runtime tier — basic · standard · advanced (docs/runtime-tiers.md). */
|
|
15
|
+
tier?: RuntimeTier;
|
|
8
16
|
/** The module's public API (what `requireModule(id)` returns). */
|
|
9
17
|
api: A;
|
|
10
18
|
/** Optional one-time setup, called on first registration. */
|
package/dist/runtime/gl.iife.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"use strict";const r={identity:()=>new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),multiply(e,t,r=new Float32Array(16)){for(let n=0;n<4;n++)for(let o=0;o<4;o++)r[4*n+o]=e[o]*t[4*n]+e[4+o]*t[4*n+1]+e[8+o]*t[4*n+2]+e[12+o]*t[4*n+3];return r},perspective(e,t,r,n){const o=1/Math.tan(e/2),a=1/(r-n);return new Float32Array([o/t,0,0,0,0,o,0,0,0,0,(n+r)*a,-1,0,0,2*n*r*a,0])},lookAt(e,t,r=[0,1,0]){let s=n(e,t);s=i(s.some(e=>e)?s:[0,0,1]);let u=a(r,s);u.some(e=>Math.abs(e)>1e-9)||(u=a([0,0,1],s)),u=i(u);const c=a(s,u);return new Float32Array([u[0],c[0],s[0],0,u[1],c[1],s[1],0,u[2],c[2],s[2],0,-o(u,e),-o(c,e),-o(s,e),1])},compose(e,t,r){const[n,o,a,i]=t,s=n+n,u=o+o,c=a+a,l=n*s,h=n*u,m=n*c,f=o*u,d=o*c,p=a*c,v=i*s,_=i*u,g=i*c;return new Float32Array([(1-(f+p))*r[0],(h+g)*r[0],(m-_)*r[0],0,(h-g)*r[1],(1-(l+p))*r[1],(d+v)*r[1],0,(m+_)*r[2],(d-v)*r[2],(1-(l+f))*r[2],0,e[0],e[1],e[2],1])},invert(e){const t=new Float32Array(16),[r,n,o,a,i,s,u,c,l,h,m,f,d,p,v,_]=e,g=r*s-n*i,M=r*u-o*i,A=r*c-a*i,b=n*u-o*s,E=n*c-a*s,y=o*c-a*u,R=l*p-h*d,w=l*v-m*d,x=l*_-f*d,T=h*v-m*p,F=h*_-f*p,N=m*_-f*v;let I=g*N-M*F+A*T+b*x-E*w+y*R;return I?(I=1/I,t[0]=(s*N-u*F+c*T)*I,t[1]=(o*F-n*N-a*T)*I,t[2]=(p*y-v*E+_*b)*I,t[3]=(m*E-h*y-f*b)*I,t[4]=(u*x-i*N-c*w)*I,t[5]=(r*N-o*x+a*w)*I,t[6]=(v*A-d*y-_*M)*I,t[7]=(l*y-m*A+f*M)*I,t[8]=(i*F-s*x+c*R)*I,t[9]=(n*x-r*F-a*R)*I,t[10]=(d*E-p*A+_*g)*I,t[11]=(h*A-l*E-f*g)*I,t[12]=(s*w-i*T-u*R)*I,t[13]=(r*T-n*w+o*R)*I,t[14]=(p*M-d*b-v*g)*I,t[15]=(l*b-h*M+m*g)*I,t):null},normal(e){const t=r.invert(e)||r.identity();return new Float32Array([t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]])},transformPoint(e,t){const r=e[3]*t[0]+e[7]*t[1]+e[11]*t[2]+e[15]||1;return[(e[0]*t[0]+e[4]*t[1]+e[8]*t[2]+e[12])/r,(e[1]*t[0]+e[5]*t[1]+e[9]*t[2]+e[13])/r,(e[2]*t[0]+e[6]*t[1]+e[10]*t[2]+e[14])/r]}},n=(e,t)=>[e[0]-t[0],e[1]-t[1],e[2]-t[2]],o=(e,t)=>e[0]*t[0]+e[1]*t[1]+e[2]*t[2],a=(e,t)=>[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]],i=e=>{const t=Math.hypot(e[0],e[1],e[2])||1;return[e[0]/t,e[1]/t,e[2]/t]};function s(e,t,r){const n=Math.cos(e/2),o=Math.sin(e/2),a=Math.cos(t/2),i=Math.sin(t/2),s=Math.cos(r/2),u=Math.sin(r/2);return[o*a*s+n*i*u,n*i*s-o*a*u,n*a*u+o*i*s,n*a*s-o*i*u]}function u(e,t){return[e[3]*t[0]+e[0]*t[3]+e[1]*t[2]-e[2]*t[1],e[3]*t[1]-e[0]*t[2]+e[1]*t[3]+e[2]*t[0],e[3]*t[2]+e[0]*t[1]-e[1]*t[0]+e[2]*t[3],e[3]*t[3]-e[0]*t[0]-e[1]*t[1]-e[2]*t[2]]}function c(e,t,r){let n=e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3];const o=n<0?t.map(e=>-e):t;if(n=Math.abs(n),n>.9995){const t=e.map((e,t)=>e+(o[t]-e)*r),n=Math.hypot(...t)||1;return t.map(e=>e/n)}const a=Math.acos(n),i=Math.sin(a),s=Math.sin((1-r)*a)/i,u=Math.sin(r*a)/i;return e.map((e,t)=>e*s+o[t]*u)}const l=(e,t,r,n)=>({positions:new Float32Array(e),normals:new Float32Array(t),uvs:new Float32Array(r),indices:e.length/3>65535?new Uint32Array(n):new Uint16Array(n)});function h(e=1,t=1,r=1){const n=[],o=[],a=[],i=[],s=[[[1,0,0],[0,0,-1],[0,1,0]],[[-1,0,0],[0,0,1],[0,1,0]],[[0,1,0],[1,0,0],[0,0,-1]],[[0,-1,0],[1,0,0],[0,0,1]],[[0,0,1],[1,0,0],[0,1,0]],[[0,0,-1],[-1,0,0],[0,1,0]]],u=[e/2,t/2,r/2];for(const[e,t,r]of s){const s=n.length/3;for(const[i,s]of[[-1,-1],[1,-1],[1,1],[-1,1]]){for(let o=0;o<3;o++)n.push((e[o]+t[o]*i+r[o]*s)*u[o]);o.push(...e),a.push((i+1)/2,(1-s)/2)}i.push(s,s+1,s+2,s,s+2,s+3)}return l(n,o,a,i)}function m(e=1,t=1,r=1,n=1){const o=[],a=[],i=[],s=[];for(let s=0;s<=n;s++)for(let u=0;u<=r;u++)o.push((u/r-.5)*e,(s/n-.5)*t,0),a.push(0,0,1),i.push(u/r,1-s/n);for(let e=0;e<n;e++)for(let t=0;t<r;t++){const n=e*(r+1)+t,o=n+1,a=n+r+1,i=a+1;s.push(n,o,i,n,i,a)}return l(o,a,i,s)}function f(e=.5,t=32,r=16){const n=[],o=[],a=[],i=[];for(let i=0;i<=r;i++){const s=i/r,u=s*Math.PI;for(let r=0;r<=t;r++){const i=r/t,c=i*Math.PI*2,l=-Math.cos(c)*Math.sin(u),h=Math.cos(u),m=Math.sin(c)*Math.sin(u);n.push(l*e,h*e,m*e),o.push(l,h,m),a.push(i,s)}}for(let e=0;e<r;e++)for(let n=0;n<t;n++){const o=e*(t+1)+n,a=o+t+1;e&&i.push(o,a,o+1),e<r-1&&i.push(o+1,a,a+1)}return l(n,o,a,i)}function d(e=.5,t=.18,r=48,n=16){const o=[],a=[],s=[],u=[];for(let u=0;u<=n;u++)for(let c=0;c<=r;c++){const l=c/r*Math.PI*2,h=u/n*Math.PI*2,m=e*Math.cos(l),f=e*Math.sin(l),d=(e+t*Math.cos(h))*Math.cos(l),p=(e+t*Math.cos(h))*Math.sin(l),v=t*Math.sin(h);o.push(d,p,v);const _=i([d-m,p-f,v]);a.push(..._),s.push(c/r,u/n)}for(let e=1;e<=n;e++)for(let t=1;t<=r;t++){const n=(r+1)*e+t-1,o=(r+1)*(e-1)+t-1,a=(r+1)*(e-1)+t,i=(r+1)*e+t;u.push(n,o,i,o,a,i)}return l(o,a,s,u)}function p(e){const t=e.positions,r=e.indices,o=r?r.length:t.length/3,s=new Float32Array(3*o),u=new Float32Array(3*o),c=e.uvs?new Float32Array(2*o):void 0;for(let l=0;l<o;l+=3){const o=[0,1,2].map(e=>r?r[l+e]:l+e),h=[t[3*o[0]],t[3*o[0]+1],t[3*o[0]+2]],m=[t[3*o[1]],t[3*o[1]+1],t[3*o[1]+2]],f=[t[3*o[2]],t[3*o[2]+1],t[3*o[2]+2]],d=i(a(n(m,h),n(f,h)));o.forEach((r,n)=>{s.set(t.subarray(3*r,3*r+3),3*(l+n)),u.set(d,3*(l+n)),c&&e.uvs&&c.set(e.uvs.subarray(2*r,2*r+2),2*(l+n))})}return{positions:s,normals:u,uvs:c,mode:e.mode}}function v(e={}){return{type:"standard",color:[1,1,1,1],metallic:0,roughness:.6,emissive:[0,0,0],...e}}function _(e={}){return{...v(e),type:"unlit"}}function g(e,t={},r={}){return{...v(r),type:"shader",fragment:e,uniforms:t}}function M(e,t=1){if(Array.isArray(e))return[e[0],e[1],e[2],e[3]??t];const r=/^#([0-9a-f]{3,8})$/i.exec(e.trim());if(r){let e=r[1];e.length<=4&&(e=e.split("").map(e=>e+e).join(""));const n=parseInt(e.slice(0,6),16);return[(n>>16&255)/255,(n>>8&255)/255,(255&n)/255,8===e.length?parseInt(e.slice(6),16)/255:t]}const n=/rgba?\(([^)]+)\)/.exec(e);if(n){const e=n[1].split(/[\s,/]+/).filter(Boolean).map(Number);return[e[0]/255,e[1]/255,e[2]/255,e[3]??t]}return[1,1,1,t]}function A(e,t={}){return{source:e,srgb:!0,repeat:!0,flipY:!1,video:"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement,needsUpdate:!0,...t}}class b{constructor(e="",t=null){this.name="",this.position=[0,0,0],this.rotation=[0,0,0,1],this.scale=[1,1,1],this.matrix=null,this.children=[],this.parent=null,this.mesh=null,this.visible=!0,this.extras={},this.world=r.identity(),this.name=e,this.mesh=t}add(...e){for(const t of e)t.parent?.remove(t),t.parent=this,this.children.push(t);return this}remove(e){const t=this.children.indexOf(e);t>=0&&this.children.splice(t,1),e.parent=null}setEuler(e,t,r){return this.rotation=s(e,t,r),this}local(){return this.matrix||r.compose(this.position,this.rotation,this.scale)}updateWorld(e){const t=e?r.multiply(e,this.local()):this.local();this.world.set(t);for(const e of this.children)e.updateWorld(this.world)}traverse(e){e(this);for(const t of this.children)t.traverse(e)}find(e){let t=null;return this.traverse(r=>{t||r.name!==e||(t=r)}),t}}class E extends b{constructor(e={}){super("camera"),this.fov=45*Math.PI/180,this.near=.05,this.far=500,this.aspect=1,this.target=[0,0,0],this.up=[0,1,0],e.fov&&(this.fov=e.fov*Math.PI/180),e.near&&(this.near=e.near),e.far&&(this.far=e.far),e.position&&(this.position=[...e.position]),e.target&&(this.target=[...e.target])}view(){return r.lookAt(this.position,this.target,this.up)}projection(){return r.perspective(this.fov,this.aspect,this.near,this.far)}}class y{constructor(){this.root=new b("scene"),this.ambient=[.35,.35,.4],this.lights=[{type:"directional",vector:[-.4,-1,-.6],color:[1,1,1],intensity:2.2}],this.background=null,this.exposure=1}add(...e){return this.root.add(...e),this}}function R(e){e.updateWorld(e.parent?e.parent.world:void 0);const t=[1/0,1/0,1/0],n=[-1/0,-1/0,-1/0];if(e.traverse(e=>{const o=e.mesh?Array.isArray(e.mesh)?e.mesh:[e.mesh]:[];for(const a of o){const o=a.geometry.positions;for(let a=0;a<o.length;a+=3){const i=r.transformPoint(e.world,[o[a],o[a+1],o[a+2]]);for(let e=0;e<3;e++)i[e]<t[e]&&(t[e]=i[e]),i[e]>n[e]&&(n[e]=i[e])}}}),t[0]===1/0)return{min:[0,0,0],max:[0,0,0],center:[0,0,0],radius:0};const o=[(t[0]+n[0])/2,(t[1]+n[1])/2,(t[2]+n[2])/2];return{min:t,max:n,center:o,radius:Math.hypot(n[0]-o[0],n[1]-o[1],n[2]-o[2])}}function w(e,t,r=1.25){const o=R(t),a=(o.radius||1)*r/Math.sin(e.fov/2),s=i(n(e.position,e.target).some(e=>e)?n(e.position,e.target):[.6,.4,1]);e.target=o.center,e.position=[o.center[0]+s[0]*a,o.center[1]+s[1]*a,o.center[2]+s[2]*a],e.near=Math.max(.01,a/100),e.far=10*a+2*o.radius}function x(e,t){if(!e.duration||!isFinite(e.duration))return;e.pause();const r=Math.min(e.duration-.001,Math.max(0,t*e.duration));"fastSeek"in e&&Math.abs(e.currentTime-r)>1?e.fastSeek(r):e.currentTime=r}const T="#version 300 es\nprecision highp float;in vec3 v_pos,v_nrm;in vec2 v_uv;out vec4 o;\nuniform vec4 u_color;uniform vec3 u_emissive,u_camPos,u_ambient;uniform float u_metal,u_rough,u_exposure,u_time;uniform vec2 u_res;\nuniform sampler2D u_map;uniform int u_hasMap,u_nl,u_unlit;uniform vec4 u_lvec[4];uniform vec3 u_lcol[4];\nvec3 lin(vec3 c){return pow(c,vec3(2.2));}vec3 srgb(vec3 c){return pow(c,vec3(1.0/2.2));}\n",F=`${T}void main(){vec4 base=vec4(lin(u_color.rgb),u_color.a);if(u_hasMap==1){vec4 t=texture(u_map,v_uv);base*=vec4(lin(t.rgb),t.a);}\nif(u_unlit==1){o=vec4(srgb(base.rgb),base.a);return;}\nvec3 N=normalize(v_nrm);if(!gl_FrontFacing)N=-N;vec3 V=normalize(u_camPos-v_pos);float r=clamp(u_rough,0.04,1.0),m=clamp(u_metal,0.0,1.0);\nvec3 F0=mix(vec3(0.04),base.rgb,m);vec3 c=u_ambient*base.rgb*(1.0-0.6*m)+u_ambient*F0*0.4;\nfor(int i=0;i<4;i++){if(i>=u_nl)break;vec3 L;float at=1.0;if(u_lvec[i].w>0.5){vec3 d=u_lvec[i].xyz-v_pos;float l=length(d);L=d/l;at=1.0/(1.0+0.09*l*l);}else L=normalize(-u_lvec[i].xyz);\nvec3 H=normalize(L+V);float NL=max(dot(N,L),0.0),NH=max(dot(N,H),0.0),NV=max(dot(N,V),1e-3),a=r*r,a2=a*a,dd=NH*NH*(a2-1.0)+1.0,D=a2/(3.14159*dd*dd),k=(r+1.0)*(r+1.0)/8.0;\nfloat G=NL/(NL*(1.0-k)+k)*NV/(NV*(1.0-k)+k);vec3 F=F0+(1.0-F0)*pow(1.0-max(dot(H,V),0.0),5.0);vec3 S=D*G*F/(4.0*NL*NV+1e-3);\nc+=((1.0-F)*(1.0-m)*base.rgb/3.14159+S)*u_lcol[i]*NL*at;}\nc=(c+u_emissive)*u_exposure;c=c/(c+1.0);o=vec4(srgb(c),base.a);}`;function N(e,t={}){const n=e.getContext("webgl2",{alpha:t.alpha??!0,antialias:t.antialias??!0,premultipliedAlpha:!1,preserveDrawingBuffer:!!t.preserveDrawingBuffer});if(!n)throw new Error("[motionary] runtime/gl: WebGL2 is not available in this browser / context");const o=new Map,a=[];let i=0;const s=(e,t)=>{let r=o.get(e);if(r)return r;const i=(e,t)=>{const r=n.createShader(e);if(n.shaderSource(r,t),n.compileShader(r),!n.getShaderParameter(r,n.COMPILE_STATUS))throw new Error("[motionary] runtime/gl shader: "+n.getShaderInfoLog(r));return r},s=n.createProgram();if(n.attachShader(s,i(n.VERTEX_SHADER,"#version 300 es\nlayout(location=0) in vec3 a_pos;layout(location=1) in vec3 a_nrm;layout(location=2) in vec2 a_uv;\nuniform mat4 u_model,u_view,u_proj;uniform mat3 u_nmat;out vec3 v_pos,v_nrm;out vec2 v_uv;\nvoid main(){vec4 w=u_model*vec4(a_pos,1.0);v_pos=w.xyz;v_nrm=normalize(u_nmat*a_nrm);v_uv=a_uv;gl_Position=u_proj*u_view*w;gl_PointSize=2.0;}")),n.attachShader(s,i(n.FRAGMENT_SHADER,t)),n.linkProgram(s),!n.getProgramParameter(s,n.LINK_STATUS))throw new Error("[motionary] runtime/gl link: "+n.getProgramInfoLog(s));return r={p:s,u:new Map},o.set(e,r),a.push({del:()=>n.deleteProgram(s)}),r},u=(e,t)=>(e.u.has(t)||e.u.set(t,n.getUniformLocation(e.p,t)),e.u.get(t)),c=e=>{const t=e._gpu;if(t)return t.v!==e.version&&(t.v=e.version,[e.positions,e.normals].forEach((e,r)=>{e&&t.b[r]&&(n.bindBuffer(n.ARRAY_BUFFER,t.b[r]),n.bufferData(n.ARRAY_BUFFER,e,n.DYNAMIC_DRAW))})),t;const r=[],o=n.createVertexArray();n.bindVertexArray(o);const i=(e,t,o,i)=>{if(!t)return n.disableVertexAttribArray(e),void(3===o?n.vertexAttrib3f(e,i[0],i[1],i[2]):n.vertexAttrib2f(e,i[0],i[1]));const s=n.createBuffer();a.push({del:()=>n.deleteBuffer(s)}),r[e]=s,n.bindBuffer(n.ARRAY_BUFFER,s),n.bufferData(n.ARRAY_BUFFER,t,n.STATIC_DRAW),n.enableVertexAttribArray(e),n.vertexAttribPointer(e,o,n.FLOAT,!1,0,0)};i(0,e.positions,3,[0,0,0]),i(1,e.normals,3,[0,0,1]),i(2,e.uvs,2,[0,0]);let s=e.positions.length/3,u=0;if(e.indices){const t=n.createBuffer();a.push({del:()=>n.deleteBuffer(t)}),n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t),n.bufferData(n.ELEMENT_ARRAY_BUFFER,e.indices,n.STATIC_DRAW),s=e.indices.length,u=e.indices instanceof Uint32Array?n.UNSIGNED_INT:n.UNSIGNED_SHORT}return n.bindVertexArray(null),a.push({del:()=>n.deleteVertexArray(o)}),e._gpu={vao:o,count:s,type:u,indexed:!!e.indices,v:e.version,b:r}},l=(e,t)=>{let r=e._gpu;if(n.activeTexture(n.TEXTURE0+t),!r&&(r=n.createTexture(),e._gpu=r,a.push({del:()=>n.deleteTexture(r)}),e.needsUpdate=!0,e.video)){const t=e.source,r=()=>{e.needsUpdate=!0,t.requestVideoFrameCallback?.(r)};t.requestVideoFrameCallback&&t.requestVideoFrameCallback(r)}n.bindTexture(n.TEXTURE_2D,r);const o=e.video?e.source:null,i=!o||o.readyState>=2;if((e.needsUpdate||o&&!o.requestVideoFrameCallback&&!o.paused)&&i){n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!!e.flipY);const t=e.source;!t||!t.data||t instanceof ImageData?n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t):n.texImage2D(n.TEXTURE_2D,0,n.RGBA,t.width,t.height,0,n.RGBA,n.UNSIGNED_BYTE,new Uint8Array(t.data.buffer,t.data.byteOffset,t.data.byteLength));const r=e=>!(e&e-1),a=t.videoWidth||t.naturalWidth||t.width,i=t.videoHeight||t.naturalHeight||t.height,s=!o&&r(a)&&r(i);s&&n.generateMipmap(n.TEXTURE_2D),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,s?n.LINEAR_MIPMAP_LINEAR:n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR);const u=e.repeat&&r(a)&&r(i)?n.REPEAT:n.CLAMP_TO_EDGE;n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,u),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,u),e.needsUpdate=!1}};return{gl:n,canvas:e,get drawCalls(){return i},resize(r,n){const o=e,a=Math.min(t.maxDpr??2,"number"==typeof devicePixelRatio&&devicePixelRatio||1),i=Math.max(1,Math.round((r??o.clientWidth??o.width)*a)),s=Math.max(1,Math.round((n??o.clientHeight??o.height)*a));return(o.width!==i||o.height!==s)&&(o.width=i,o.height=s,!0)},render(e,t,o=0){i=0;const a=n.drawingBufferWidth,h=n.drawingBufferHeight;n.viewport(0,0,a,h),t.aspect=a/h||1;const m=e.background;n.clearColor(m?m[0]:0,m?m[1]:0,m?m[2]:0,m?m[3]:0),n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT),n.enable(n.DEPTH_TEST),e.root.updateWorld();const f=t.view(),d=t.projection(),p=new Float32Array(16),v=new Float32Array(12);e.lights.slice(0,4).forEach((e,t)=>{p.set([...e.vector,"point"===e.type?1:0],4*t),v.set(e.color.map(t=>t*e.intensity),3*t)});const _=[],g=[];e.root.traverse(e=>{if(e.visible&&e.mesh)for(const t of Array.isArray(e.mesh)?e.mesh:[e.mesh])(t.material.transparent||t.material.color[3]<1?g:_).push([e,t])});for(const[m,M]of[..._,...g]){const _=M.material,g="shader"===_.type?"shader:"+_.fragment:"std",A=s(g,"shader"===_.type?`${T}${Object.entries(_.uniforms||{}).map(([e,t])=>`uniform ${"number"==typeof t?"float":t.source?"sampler2D":`vec${t.length}`} ${e};`).join("")}\n${_.fragment}\nvoid main(){o=shade();}`:F);n.useProgram(A.p);const b=e=>u(A,e);n.uniformMatrix4fv(b("u_model"),!1,m.world),n.uniformMatrix4fv(b("u_view"),!1,f),n.uniformMatrix4fv(b("u_proj"),!1,d),n.uniformMatrix3fv(b("u_nmat"),!1,r.normal(m.world)),n.uniform4fv(b("u_color"),_.color),n.uniform3fv(b("u_emissive"),_.emissive),n.uniform3fv(b("u_camPos"),t.position),n.uniform3fv(b("u_ambient"),e.ambient),n.uniform1f(b("u_metal"),_.metallic),n.uniform1f(b("u_rough"),_.roughness),n.uniform1f(b("u_exposure"),e.exposure),n.uniform1f(b("u_time"),o/1e3),n.uniform2f(b("u_res"),a,h),n.uniform1i(b("u_unlit"),"unlit"===_.type?1:0),n.uniform1i(b("u_nl"),Math.min(4,e.lights.length)),n.uniform4fv(b("u_lvec"),p),n.uniform3fv(b("u_lcol"),v);let E=0;_.map&&(l(_.map,E),n.uniform1i(b("u_map"),E++)),n.uniform1i(b("u_hasMap"),_.map?1:0);for(const[e,t]of Object.entries(_.uniforms||{}))if("number"==typeof t)n.uniform1f(b(e),t);else if(t.source)l(t,E),n.uniform1i(b(e),E++);else{const r=t;(2===r.length?n.uniform2fv:3===r.length?n.uniform3fv:n.uniform4fv).call(n,b(e),r)}_.doubleSided?n.disable(n.CULL_FACE):n.enable(n.CULL_FACE),_.transparent||_.color[3]<1?(n.enable(n.BLEND),n.blendFunc(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA),n.depthMask(!1)):(n.disable(n.BLEND),n.depthMask(!0));const y=c(M.geometry);n.bindVertexArray(y.vao);const R="lines"===M.geometry.mode||_.wireframe?n.LINES:"points"===M.geometry.mode?n.POINTS:n.TRIANGLES;y.indexed?n.drawElements(R,y.count,y.type,0):n.drawArrays(R,0,y.count),i++}n.bindVertexArray(null),n.depthMask(!0)},dispose(){a.splice(0).forEach(e=>e.del()),o.clear()}}}function I(e,t,r={}){const o=n(e.position,e.target);let a=Math.hypot(...o),i=Math.atan2(o[0],o[2]),s=Math.acos(Math.min(1,Math.max(-1,o[1]/(a||1)))),u=0,c=0,l=0,h=!1,m=0,f=0;const d=new Map;let p=0;const v=r.damping??.12,_={autoRotate:"function"==typeof matchMedia&&matchMedia("(prefers-reduced-motion: reduce)").matches?0:r.autoRotate??0,update:function(t){const n=Math.abs(u)+Math.abs(c)+Math.abs(l)>1e-5||_.autoRotate;i+=u+(_.autoRotate&&!h?_.autoRotate*t/1e3:0),s=Math.min(Math.PI-.05,Math.max(.05,s+c)),a=Math.min(r.maxDistance??1/0,Math.max(r.minDistance??.01,a*(1+l)));const o=Math.pow(1-v,t/16.7);u*=o,c*=o,l*=o;const m=e.target;return e.position=[m[0]+a*Math.sin(s)*Math.sin(i),m[1]+a*Math.cos(s),m[2]+a*Math.sin(s)*Math.cos(i)],!!n},dispose:function(){M.forEach(e=>e())}},g=(e,t,r,n)=>(e.addEventListener(t,r,n),()=>e.removeEventListener(t,r,n)),M=[g(t,"pointerdown",e=>{d.set(e.pointerId,[e.clientX,e.clientY]),h=!0,m=e.clientX,f=e.clientY,t.setPointerCapture?.(e.pointerId)}),g(t,"pointermove",e=>{if(d.has(e.pointerId)){if(d.set(e.pointerId,[e.clientX,e.clientY]),2===d.size&&!1!==r.zoom){const[e,t]=Array.from(d.values()),r=Math.hypot(e[0]-t[0],e[1]-t[1]);return p&&(l+=.004*(p-r)),void(p=r)}h&&(u-=.005*(e.clientX-m),c-=.005*(e.clientY-f),m=e.clientX,f=e.clientY)}}),g(t,"pointerup",e=>{d.delete(e.pointerId),p=0,h=d.size>0}),g(t,"pointercancel",e=>{d.delete(e.pointerId),h=!1}),g(t,"wheel",e=>{!1!==r.zoom&&(e.preventDefault(),l+=.08*Math.sign(e.deltaY))},{passive:!1}),g(t,"keydown",e=>{const t={ArrowLeft:[.1,0,0],ArrowRight:[-.1,0,0],ArrowUp:[0,.1,0],ArrowDown:[0,-.1,0],"+":[0,0,-.1],"-":[0,0,.1]}[e.key];t&&(e.preventDefault(),u+=t[0],c+=t[1],l+=t[2])})];return _}const L={id:"gl",version:t.RUNTIME_VERSION,requires:["core"],api:{mat4:r,quatFromEuler:s,quatMultiply:u,quatSlerp:c,box:h,plane:m,sphere:f,torus:d,computeNormals:p,standardMaterial:v,unlitMaterial:_,shaderMaterial:g,color:M,texture:A,GlNode:b,Camera:E,Scene:y,bounds:R,frameNode:w,scrubVideo:x,createRenderer:N,orbitControls:I}};t.register(L),e.Camera=E,e.GlNode=b,e.Scene=y,e.bounds=R,e.box=h,e.color=M,e.computeNormals=p,e.createRenderer=N,e.frameNode=w,e.gl=L,e.mat4=r,e.orbitControls=I,e.plane=m,e.quatFromEuler=s,e.quatMultiply=u,e.quatSlerp=c,e.scrubVideo=x,e.shaderMaterial=g,e.sphere=f,e.standardMaterial=v,e.texture=A,e.torus=d,e.unlitMaterial=_}(this.MotionaryRuntime=this.MotionaryRuntime||{},MotionaryRuntime);
|
|
2
|
-
//# sourceMappingURL=https://raw.githubusercontent.com/HarrisonCN/Motionary/v11.
|
|
1
|
+
!function(e,t){"use strict";const r={identity:()=>new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),multiply(e,t,r=new Float32Array(16)){for(let n=0;n<4;n++)for(let o=0;o<4;o++)r[4*n+o]=e[o]*t[4*n]+e[4+o]*t[4*n+1]+e[8+o]*t[4*n+2]+e[12+o]*t[4*n+3];return r},perspective(e,t,r,n){const o=1/Math.tan(e/2),a=1/(r-n);return new Float32Array([o/t,0,0,0,0,o,0,0,0,0,(n+r)*a,-1,0,0,2*n*r*a,0])},lookAt(e,t,r=[0,1,0]){let s=n(e,t);s=i(s.some(e=>e)?s:[0,0,1]);let u=a(r,s);u.some(e=>Math.abs(e)>1e-9)||(u=a([0,0,1],s)),u=i(u);const c=a(s,u);return new Float32Array([u[0],c[0],s[0],0,u[1],c[1],s[1],0,u[2],c[2],s[2],0,-o(u,e),-o(c,e),-o(s,e),1])},compose(e,t,r){const[n,o,a,i]=t,s=n+n,u=o+o,c=a+a,l=n*s,h=n*u,m=n*c,f=o*u,d=o*c,p=a*c,v=i*s,_=i*u,g=i*c;return new Float32Array([(1-(f+p))*r[0],(h+g)*r[0],(m-_)*r[0],0,(h-g)*r[1],(1-(l+p))*r[1],(d+v)*r[1],0,(m+_)*r[2],(d-v)*r[2],(1-(l+f))*r[2],0,e[0],e[1],e[2],1])},invert(e){const t=new Float32Array(16),[r,n,o,a,i,s,u,c,l,h,m,f,d,p,v,_]=e,g=r*s-n*i,M=r*u-o*i,A=r*c-a*i,b=n*u-o*s,E=n*c-a*s,y=o*c-a*u,R=l*p-h*d,w=l*v-m*d,x=l*_-f*d,T=h*v-m*p,F=h*_-f*p,N=m*_-f*v;let I=g*N-M*F+A*T+b*x-E*w+y*R;return I?(I=1/I,t[0]=(s*N-u*F+c*T)*I,t[1]=(o*F-n*N-a*T)*I,t[2]=(p*y-v*E+_*b)*I,t[3]=(m*E-h*y-f*b)*I,t[4]=(u*x-i*N-c*w)*I,t[5]=(r*N-o*x+a*w)*I,t[6]=(v*A-d*y-_*M)*I,t[7]=(l*y-m*A+f*M)*I,t[8]=(i*F-s*x+c*R)*I,t[9]=(n*x-r*F-a*R)*I,t[10]=(d*E-p*A+_*g)*I,t[11]=(h*A-l*E-f*g)*I,t[12]=(s*w-i*T-u*R)*I,t[13]=(r*T-n*w+o*R)*I,t[14]=(p*M-d*b-v*g)*I,t[15]=(l*b-h*M+m*g)*I,t):null},normal(e){const t=r.invert(e)||r.identity();return new Float32Array([t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]])},transformPoint(e,t){const r=e[3]*t[0]+e[7]*t[1]+e[11]*t[2]+e[15]||1;return[(e[0]*t[0]+e[4]*t[1]+e[8]*t[2]+e[12])/r,(e[1]*t[0]+e[5]*t[1]+e[9]*t[2]+e[13])/r,(e[2]*t[0]+e[6]*t[1]+e[10]*t[2]+e[14])/r]}},n=(e,t)=>[e[0]-t[0],e[1]-t[1],e[2]-t[2]],o=(e,t)=>e[0]*t[0]+e[1]*t[1]+e[2]*t[2],a=(e,t)=>[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]],i=e=>{const t=Math.hypot(e[0],e[1],e[2])||1;return[e[0]/t,e[1]/t,e[2]/t]};function s(e,t,r){const n=Math.cos(e/2),o=Math.sin(e/2),a=Math.cos(t/2),i=Math.sin(t/2),s=Math.cos(r/2),u=Math.sin(r/2);return[o*a*s+n*i*u,n*i*s-o*a*u,n*a*u+o*i*s,n*a*s-o*i*u]}function u(e,t){return[e[3]*t[0]+e[0]*t[3]+e[1]*t[2]-e[2]*t[1],e[3]*t[1]-e[0]*t[2]+e[1]*t[3]+e[2]*t[0],e[3]*t[2]+e[0]*t[1]-e[1]*t[0]+e[2]*t[3],e[3]*t[3]-e[0]*t[0]-e[1]*t[1]-e[2]*t[2]]}function c(e,t,r){let n=e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3];const o=n<0?t.map(e=>-e):t;if(n=Math.abs(n),n>.9995){const t=e.map((e,t)=>e+(o[t]-e)*r),n=Math.hypot(...t)||1;return t.map(e=>e/n)}const a=Math.acos(n),i=Math.sin(a),s=Math.sin((1-r)*a)/i,u=Math.sin(r*a)/i;return e.map((e,t)=>e*s+o[t]*u)}const l=(e,t,r,n)=>({positions:new Float32Array(e),normals:new Float32Array(t),uvs:new Float32Array(r),indices:e.length/3>65535?new Uint32Array(n):new Uint16Array(n)});function h(e=1,t=1,r=1){const n=[],o=[],a=[],i=[],s=[[[1,0,0],[0,0,-1],[0,1,0]],[[-1,0,0],[0,0,1],[0,1,0]],[[0,1,0],[1,0,0],[0,0,-1]],[[0,-1,0],[1,0,0],[0,0,1]],[[0,0,1],[1,0,0],[0,1,0]],[[0,0,-1],[-1,0,0],[0,1,0]]],u=[e/2,t/2,r/2];for(const[e,t,r]of s){const s=n.length/3;for(const[i,s]of[[-1,-1],[1,-1],[1,1],[-1,1]]){for(let o=0;o<3;o++)n.push((e[o]+t[o]*i+r[o]*s)*u[o]);o.push(...e),a.push((i+1)/2,(1-s)/2)}i.push(s,s+1,s+2,s,s+2,s+3)}return l(n,o,a,i)}function m(e=1,t=1,r=1,n=1){const o=[],a=[],i=[],s=[];for(let s=0;s<=n;s++)for(let u=0;u<=r;u++)o.push((u/r-.5)*e,(s/n-.5)*t,0),a.push(0,0,1),i.push(u/r,1-s/n);for(let e=0;e<n;e++)for(let t=0;t<r;t++){const n=e*(r+1)+t,o=n+1,a=n+r+1,i=a+1;s.push(n,o,i,n,i,a)}return l(o,a,i,s)}function f(e=.5,t=32,r=16){const n=[],o=[],a=[],i=[];for(let i=0;i<=r;i++){const s=i/r,u=s*Math.PI;for(let r=0;r<=t;r++){const i=r/t,c=i*Math.PI*2,l=-Math.cos(c)*Math.sin(u),h=Math.cos(u),m=Math.sin(c)*Math.sin(u);n.push(l*e,h*e,m*e),o.push(l,h,m),a.push(i,s)}}for(let e=0;e<r;e++)for(let n=0;n<t;n++){const o=e*(t+1)+n,a=o+t+1;e&&i.push(o,a,o+1),e<r-1&&i.push(o+1,a,a+1)}return l(n,o,a,i)}function d(e=.5,t=.18,r=48,n=16){const o=[],a=[],s=[],u=[];for(let u=0;u<=n;u++)for(let c=0;c<=r;c++){const l=c/r*Math.PI*2,h=u/n*Math.PI*2,m=e*Math.cos(l),f=e*Math.sin(l),d=(e+t*Math.cos(h))*Math.cos(l),p=(e+t*Math.cos(h))*Math.sin(l),v=t*Math.sin(h);o.push(d,p,v);const _=i([d-m,p-f,v]);a.push(..._),s.push(c/r,u/n)}for(let e=1;e<=n;e++)for(let t=1;t<=r;t++){const n=(r+1)*e+t-1,o=(r+1)*(e-1)+t-1,a=(r+1)*(e-1)+t,i=(r+1)*e+t;u.push(n,o,i,o,a,i)}return l(o,a,s,u)}function p(e){const t=e.positions,r=e.indices,o=r?r.length:t.length/3,s=new Float32Array(3*o),u=new Float32Array(3*o),c=e.uvs?new Float32Array(2*o):void 0;for(let l=0;l<o;l+=3){const o=[0,1,2].map(e=>r?r[l+e]:l+e),h=[t[3*o[0]],t[3*o[0]+1],t[3*o[0]+2]],m=[t[3*o[1]],t[3*o[1]+1],t[3*o[1]+2]],f=[t[3*o[2]],t[3*o[2]+1],t[3*o[2]+2]],d=i(a(n(m,h),n(f,h)));o.forEach((r,n)=>{s.set(t.subarray(3*r,3*r+3),3*(l+n)),u.set(d,3*(l+n)),c&&e.uvs&&c.set(e.uvs.subarray(2*r,2*r+2),2*(l+n))})}return{positions:s,normals:u,uvs:c,mode:e.mode}}function v(e={}){return{type:"standard",color:[1,1,1,1],metallic:0,roughness:.6,emissive:[0,0,0],...e}}function _(e={}){return{...v(e),type:"unlit"}}function g(e,t={},r={}){return{...v(r),type:"shader",fragment:e,uniforms:t}}function M(e,t=1){if(Array.isArray(e))return[e[0],e[1],e[2],e[3]??t];const r=/^#([0-9a-f]{3,8})$/i.exec(e.trim());if(r){let e=r[1];e.length<=4&&(e=e.split("").map(e=>e+e).join(""));const n=parseInt(e.slice(0,6),16);return[(n>>16&255)/255,(n>>8&255)/255,(255&n)/255,8===e.length?parseInt(e.slice(6),16)/255:t]}const n=/rgba?\(([^)]+)\)/.exec(e);if(n){const e=n[1].split(/[\s,/]+/).filter(Boolean).map(Number);return[e[0]/255,e[1]/255,e[2]/255,e[3]??t]}return[1,1,1,t]}function A(e,t={}){return{source:e,srgb:!0,repeat:!0,flipY:!1,video:"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement,needsUpdate:!0,...t}}class b{constructor(e="",t=null){this.name="",this.position=[0,0,0],this.rotation=[0,0,0,1],this.scale=[1,1,1],this.matrix=null,this.children=[],this.parent=null,this.mesh=null,this.visible=!0,this.extras={},this.world=r.identity(),this.name=e,this.mesh=t}add(...e){for(const t of e)t.parent?.remove(t),t.parent=this,this.children.push(t);return this}remove(e){const t=this.children.indexOf(e);t>=0&&this.children.splice(t,1),e.parent=null}setEuler(e,t,r){return this.rotation=s(e,t,r),this}local(){return this.matrix||r.compose(this.position,this.rotation,this.scale)}updateWorld(e){const t=e?r.multiply(e,this.local()):this.local();this.world.set(t);for(const e of this.children)e.updateWorld(this.world)}traverse(e){e(this);for(const t of this.children)t.traverse(e)}find(e){let t=null;return this.traverse(r=>{t||r.name!==e||(t=r)}),t}}class E extends b{constructor(e={}){super("camera"),this.fov=45*Math.PI/180,this.near=.05,this.far=500,this.aspect=1,this.target=[0,0,0],this.up=[0,1,0],e.fov&&(this.fov=e.fov*Math.PI/180),e.near&&(this.near=e.near),e.far&&(this.far=e.far),e.position&&(this.position=[...e.position]),e.target&&(this.target=[...e.target])}view(){return r.lookAt(this.position,this.target,this.up)}projection(){return r.perspective(this.fov,this.aspect,this.near,this.far)}}class y{constructor(){this.root=new b("scene"),this.ambient=[.35,.35,.4],this.lights=[{type:"directional",vector:[-.4,-1,-.6],color:[1,1,1],intensity:2.2}],this.background=null,this.exposure=1}add(...e){return this.root.add(...e),this}}function R(e){e.updateWorld(e.parent?e.parent.world:void 0);const t=[1/0,1/0,1/0],n=[-1/0,-1/0,-1/0];if(e.traverse(e=>{const o=e.mesh?Array.isArray(e.mesh)?e.mesh:[e.mesh]:[];for(const a of o){const o=a.geometry.positions;for(let a=0;a<o.length;a+=3){const i=r.transformPoint(e.world,[o[a],o[a+1],o[a+2]]);for(let e=0;e<3;e++)i[e]<t[e]&&(t[e]=i[e]),i[e]>n[e]&&(n[e]=i[e])}}}),t[0]===1/0)return{min:[0,0,0],max:[0,0,0],center:[0,0,0],radius:0};const o=[(t[0]+n[0])/2,(t[1]+n[1])/2,(t[2]+n[2])/2];return{min:t,max:n,center:o,radius:Math.hypot(n[0]-o[0],n[1]-o[1],n[2]-o[2])}}function w(e,t,r=1.25){const o=R(t),a=(o.radius||1)*r/Math.sin(e.fov/2),s=i(n(e.position,e.target).some(e=>e)?n(e.position,e.target):[.6,.4,1]);e.target=o.center,e.position=[o.center[0]+s[0]*a,o.center[1]+s[1]*a,o.center[2]+s[2]*a],e.near=Math.max(.01,a/100),e.far=10*a+2*o.radius}function x(e,t){if(!e.duration||!isFinite(e.duration))return;e.pause();const r=Math.min(e.duration-.001,Math.max(0,t*e.duration));"fastSeek"in e&&Math.abs(e.currentTime-r)>1?e.fastSeek(r):e.currentTime=r}const T="#version 300 es\nprecision highp float;in vec3 v_pos,v_nrm;in vec2 v_uv;out vec4 o;\nuniform vec4 u_color;uniform vec3 u_emissive,u_camPos,u_ambient;uniform float u_metal,u_rough,u_exposure,u_time;uniform vec2 u_res;\nuniform sampler2D u_map;uniform int u_hasMap,u_nl,u_unlit;uniform vec4 u_lvec[4];uniform vec3 u_lcol[4];\nvec3 lin(vec3 c){return pow(c,vec3(2.2));}vec3 srgb(vec3 c){return pow(c,vec3(1.0/2.2));}\n",F=`${T}void main(){vec4 base=vec4(lin(u_color.rgb),u_color.a);if(u_hasMap==1){vec4 t=texture(u_map,v_uv);base*=vec4(lin(t.rgb),t.a);}\nif(u_unlit==1){o=vec4(srgb(base.rgb),base.a);return;}\nvec3 N=normalize(v_nrm);if(!gl_FrontFacing)N=-N;vec3 V=normalize(u_camPos-v_pos);float r=clamp(u_rough,0.04,1.0),m=clamp(u_metal,0.0,1.0);\nvec3 F0=mix(vec3(0.04),base.rgb,m);vec3 c=u_ambient*base.rgb*(1.0-0.6*m)+u_ambient*F0*0.4;\nfor(int i=0;i<4;i++){if(i>=u_nl)break;vec3 L;float at=1.0;if(u_lvec[i].w>0.5){vec3 d=u_lvec[i].xyz-v_pos;float l=length(d);L=d/l;at=1.0/(1.0+0.09*l*l);}else L=normalize(-u_lvec[i].xyz);\nvec3 H=normalize(L+V);float NL=max(dot(N,L),0.0),NH=max(dot(N,H),0.0),NV=max(dot(N,V),1e-3),a=r*r,a2=a*a,dd=NH*NH*(a2-1.0)+1.0,D=a2/(3.14159*dd*dd),k=(r+1.0)*(r+1.0)/8.0;\nfloat G=NL/(NL*(1.0-k)+k)*NV/(NV*(1.0-k)+k);vec3 F=F0+(1.0-F0)*pow(1.0-max(dot(H,V),0.0),5.0);vec3 S=D*G*F/(4.0*NL*NV+1e-3);\nc+=((1.0-F)*(1.0-m)*base.rgb/3.14159+S)*u_lcol[i]*NL*at;}\nc=(c+u_emissive)*u_exposure;c=c/(c+1.0);o=vec4(srgb(c),base.a);}`;function N(e,t={}){const n=e.getContext("webgl2",{alpha:t.alpha??!0,antialias:t.antialias??!0,premultipliedAlpha:!1,preserveDrawingBuffer:!!t.preserveDrawingBuffer});if(!n)throw new Error("[motionary] runtime/gl: WebGL2 is not available in this browser / context");const o=new Map,a=[];let i=0;const s=(e,t)=>{let r=o.get(e);if(r)return r;const i=(e,t)=>{const r=n.createShader(e);if(n.shaderSource(r,t),n.compileShader(r),!n.getShaderParameter(r,n.COMPILE_STATUS))throw new Error("[motionary] runtime/gl shader: "+n.getShaderInfoLog(r));return r},s=n.createProgram();if(n.attachShader(s,i(n.VERTEX_SHADER,"#version 300 es\nlayout(location=0) in vec3 a_pos;layout(location=1) in vec3 a_nrm;layout(location=2) in vec2 a_uv;\nuniform mat4 u_model,u_view,u_proj;uniform mat3 u_nmat;out vec3 v_pos,v_nrm;out vec2 v_uv;\nvoid main(){vec4 w=u_model*vec4(a_pos,1.0);v_pos=w.xyz;v_nrm=normalize(u_nmat*a_nrm);v_uv=a_uv;gl_Position=u_proj*u_view*w;gl_PointSize=2.0;}")),n.attachShader(s,i(n.FRAGMENT_SHADER,t)),n.linkProgram(s),!n.getProgramParameter(s,n.LINK_STATUS))throw new Error("[motionary] runtime/gl link: "+n.getProgramInfoLog(s));return r={p:s,u:new Map},o.set(e,r),a.push({del:()=>n.deleteProgram(s)}),r},u=(e,t)=>(e.u.has(t)||e.u.set(t,n.getUniformLocation(e.p,t)),e.u.get(t)),c=e=>{const t=e._gpu;if(t)return t.v!==e.version&&(t.v=e.version,[e.positions,e.normals].forEach((e,r)=>{e&&t.b[r]&&(n.bindBuffer(n.ARRAY_BUFFER,t.b[r]),n.bufferData(n.ARRAY_BUFFER,e,n.DYNAMIC_DRAW))})),t;const r=[],o=n.createVertexArray();n.bindVertexArray(o);const i=(e,t,o,i)=>{if(!t)return n.disableVertexAttribArray(e),void(3===o?n.vertexAttrib3f(e,i[0],i[1],i[2]):n.vertexAttrib2f(e,i[0],i[1]));const s=n.createBuffer();a.push({del:()=>n.deleteBuffer(s)}),r[e]=s,n.bindBuffer(n.ARRAY_BUFFER,s),n.bufferData(n.ARRAY_BUFFER,t,n.STATIC_DRAW),n.enableVertexAttribArray(e),n.vertexAttribPointer(e,o,n.FLOAT,!1,0,0)};i(0,e.positions,3,[0,0,0]),i(1,e.normals,3,[0,0,1]),i(2,e.uvs,2,[0,0]);let s=e.positions.length/3,u=0;if(e.indices){const t=n.createBuffer();a.push({del:()=>n.deleteBuffer(t)}),n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t),n.bufferData(n.ELEMENT_ARRAY_BUFFER,e.indices,n.STATIC_DRAW),s=e.indices.length,u=e.indices instanceof Uint32Array?n.UNSIGNED_INT:n.UNSIGNED_SHORT}return n.bindVertexArray(null),a.push({del:()=>n.deleteVertexArray(o)}),e._gpu={vao:o,count:s,type:u,indexed:!!e.indices,v:e.version,b:r}},l=(e,t)=>{let r=e._gpu;if(n.activeTexture(n.TEXTURE0+t),!r&&(r=n.createTexture(),e._gpu=r,a.push({del:()=>n.deleteTexture(r)}),e.needsUpdate=!0,e.video)){const t=e.source,r=()=>{e.needsUpdate=!0,t.requestVideoFrameCallback?.(r)};t.requestVideoFrameCallback&&t.requestVideoFrameCallback(r)}n.bindTexture(n.TEXTURE_2D,r);const o=e.video?e.source:null,i=!o||o.readyState>=2;if((e.needsUpdate||o&&!o.requestVideoFrameCallback&&!o.paused)&&i){n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!!e.flipY);const t=e.source;!t||!t.data||t instanceof ImageData?n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t):n.texImage2D(n.TEXTURE_2D,0,n.RGBA,t.width,t.height,0,n.RGBA,n.UNSIGNED_BYTE,new Uint8Array(t.data.buffer,t.data.byteOffset,t.data.byteLength));const r=e=>!(e&e-1),a=t.videoWidth||t.naturalWidth||t.width,i=t.videoHeight||t.naturalHeight||t.height,s=!o&&r(a)&&r(i);s&&n.generateMipmap(n.TEXTURE_2D),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,s?n.LINEAR_MIPMAP_LINEAR:n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR);const u=e.repeat&&r(a)&&r(i)?n.REPEAT:n.CLAMP_TO_EDGE;n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,u),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,u),e.needsUpdate=!1}};return{gl:n,canvas:e,get drawCalls(){return i},resize(r,n){const o=e,a=Math.min(t.maxDpr??2,"number"==typeof devicePixelRatio&&devicePixelRatio||1),i=Math.max(1,Math.round((r??o.clientWidth??o.width)*a)),s=Math.max(1,Math.round((n??o.clientHeight??o.height)*a));return(o.width!==i||o.height!==s)&&(o.width=i,o.height=s,!0)},render(e,t,o=0){i=0;const a=n.drawingBufferWidth,h=n.drawingBufferHeight;n.viewport(0,0,a,h),t.aspect=a/h||1;const m=e.background;n.clearColor(m?m[0]:0,m?m[1]:0,m?m[2]:0,m?m[3]:0),n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT),n.enable(n.DEPTH_TEST),e.root.updateWorld();const f=t.view(),d=t.projection(),p=new Float32Array(16),v=new Float32Array(12);e.lights.slice(0,4).forEach((e,t)=>{p.set([...e.vector,"point"===e.type?1:0],4*t),v.set(e.color.map(t=>t*e.intensity),3*t)});const _=[],g=[];e.root.traverse(e=>{if(e.visible&&e.mesh)for(const t of Array.isArray(e.mesh)?e.mesh:[e.mesh])(t.material.transparent||t.material.color[3]<1?g:_).push([e,t])});for(const[m,M]of[..._,...g]){const _=M.material,g="shader"===_.type?"shader:"+_.fragment:"std",A=s(g,"shader"===_.type?`${T}${Object.entries(_.uniforms||{}).map(([e,t])=>`uniform ${"number"==typeof t?"float":t.source?"sampler2D":`vec${t.length}`} ${e};`).join("")}\n${_.fragment}\nvoid main(){o=shade();}`:F);n.useProgram(A.p);const b=e=>u(A,e);n.uniformMatrix4fv(b("u_model"),!1,m.world),n.uniformMatrix4fv(b("u_view"),!1,f),n.uniformMatrix4fv(b("u_proj"),!1,d),n.uniformMatrix3fv(b("u_nmat"),!1,r.normal(m.world)),n.uniform4fv(b("u_color"),_.color),n.uniform3fv(b("u_emissive"),_.emissive),n.uniform3fv(b("u_camPos"),t.position),n.uniform3fv(b("u_ambient"),e.ambient),n.uniform1f(b("u_metal"),_.metallic),n.uniform1f(b("u_rough"),_.roughness),n.uniform1f(b("u_exposure"),e.exposure),n.uniform1f(b("u_time"),o/1e3),n.uniform2f(b("u_res"),a,h),n.uniform1i(b("u_unlit"),"unlit"===_.type?1:0),n.uniform1i(b("u_nl"),Math.min(4,e.lights.length)),n.uniform4fv(b("u_lvec"),p),n.uniform3fv(b("u_lcol"),v);let E=0;_.map&&(l(_.map,E),n.uniform1i(b("u_map"),E++)),n.uniform1i(b("u_hasMap"),_.map?1:0);for(const[e,t]of Object.entries(_.uniforms||{}))if("number"==typeof t)n.uniform1f(b(e),t);else if(t.source)l(t,E),n.uniform1i(b(e),E++);else{const r=t;(2===r.length?n.uniform2fv:3===r.length?n.uniform3fv:n.uniform4fv).call(n,b(e),r)}_.doubleSided?n.disable(n.CULL_FACE):n.enable(n.CULL_FACE),_.transparent||_.color[3]<1?(n.enable(n.BLEND),n.blendFunc(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA),n.depthMask(!1)):(n.disable(n.BLEND),n.depthMask(!0));const y=c(M.geometry);n.bindVertexArray(y.vao);const R="lines"===M.geometry.mode||_.wireframe?n.LINES:"points"===M.geometry.mode?n.POINTS:n.TRIANGLES;y.indexed?n.drawElements(R,y.count,y.type,0):n.drawArrays(R,0,y.count),i++}n.bindVertexArray(null),n.depthMask(!0)},dispose(){a.splice(0).forEach(e=>e.del()),o.clear()}}}function I(e,t,r={}){const o=n(e.position,e.target);let a=Math.hypot(...o),i=Math.atan2(o[0],o[2]),s=Math.acos(Math.min(1,Math.max(-1,o[1]/(a||1)))),u=0,c=0,l=0,h=!1,m=0,f=0;const d=new Map;let p=0;const v=r.damping??.12,_={autoRotate:"function"==typeof matchMedia&&matchMedia("(prefers-reduced-motion: reduce)").matches?0:r.autoRotate??0,update:function(t){const n=Math.abs(u)+Math.abs(c)+Math.abs(l)>1e-5||_.autoRotate;i+=u+(_.autoRotate&&!h?_.autoRotate*t/1e3:0),s=Math.min(Math.PI-.05,Math.max(.05,s+c)),a=Math.min(r.maxDistance??1/0,Math.max(r.minDistance??.01,a*(1+l)));const o=Math.pow(1-v,t/16.7);u*=o,c*=o,l*=o;const m=e.target;return e.position=[m[0]+a*Math.sin(s)*Math.sin(i),m[1]+a*Math.cos(s),m[2]+a*Math.sin(s)*Math.cos(i)],!!n},dispose:function(){M.forEach(e=>e())}},g=(e,t,r,n)=>(e.addEventListener(t,r,n),()=>e.removeEventListener(t,r,n)),M=[g(t,"pointerdown",e=>{d.set(e.pointerId,[e.clientX,e.clientY]),h=!0,m=e.clientX,f=e.clientY,t.setPointerCapture?.(e.pointerId)}),g(t,"pointermove",e=>{if(d.has(e.pointerId)){if(d.set(e.pointerId,[e.clientX,e.clientY]),2===d.size&&!1!==r.zoom){const[e,t]=Array.from(d.values()),r=Math.hypot(e[0]-t[0],e[1]-t[1]);return p&&(l+=.004*(p-r)),void(p=r)}h&&(u-=.005*(e.clientX-m),c-=.005*(e.clientY-f),m=e.clientX,f=e.clientY)}}),g(t,"pointerup",e=>{d.delete(e.pointerId),p=0,h=d.size>0}),g(t,"pointercancel",e=>{d.delete(e.pointerId),h=!1}),g(t,"wheel",e=>{!1!==r.zoom&&(e.preventDefault(),l+=.08*Math.sign(e.deltaY))},{passive:!1}),g(t,"keydown",e=>{const t={ArrowLeft:[.1,0,0],ArrowRight:[-.1,0,0],ArrowUp:[0,.1,0],ArrowDown:[0,-.1,0],"+":[0,0,-.1],"-":[0,0,.1]}[e.key];t&&(e.preventDefault(),u+=t[0],c+=t[1],l+=t[2])})];return _}const L={id:"gl",version:t.RUNTIME_VERSION,tier:"advanced",requires:["core"],api:{mat4:r,quatFromEuler:s,quatMultiply:u,quatSlerp:c,box:h,plane:m,sphere:f,torus:d,computeNormals:p,standardMaterial:v,unlitMaterial:_,shaderMaterial:g,color:M,texture:A,GlNode:b,Camera:E,Scene:y,bounds:R,frameNode:w,scrubVideo:x,createRenderer:N,orbitControls:I}};t.register(L),e.Camera=E,e.GlNode=b,e.Scene=y,e.bounds=R,e.box=h,e.color=M,e.computeNormals=p,e.createRenderer=N,e.frameNode=w,e.gl=L,e.mat4=r,e.orbitControls=I,e.plane=m,e.quatFromEuler=s,e.quatMultiply=u,e.quatSlerp=c,e.scrubVideo=x,e.shaderMaterial=g,e.sphere=f,e.standardMaterial=v,e.texture=A,e.torus=d,e.unlitMaterial=_}(this.MotionaryRuntime=this.MotionaryRuntime||{},MotionaryRuntime);
|
|
2
|
+
//# sourceMappingURL=https://raw.githubusercontent.com/HarrisonCN/Motionary/v11.4.0/dist/runtime/gl.iife.js.map
|
package/dist/runtime/gl.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as RUNTIME_VERSION } from '../chunks/registry-
|
|
1
|
+
import { R as RUNTIME_VERSION } from '../chunks/registry-CorBCE7b.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* `motionary/runtime/gl` (10.5) — a small WebGL2 scene renderer written for
|
|
@@ -744,9 +744,10 @@ function orbitControls(camera, el, o = {}) {
|
|
|
744
744
|
const gl = {
|
|
745
745
|
id: 'gl',
|
|
746
746
|
version: RUNTIME_VERSION,
|
|
747
|
+
tier: 'advanced',
|
|
747
748
|
requires: ['core'],
|
|
748
749
|
api: { mat4, quatFromEuler, quatMultiply, quatSlerp, box, plane, sphere, torus, computeNormals, standardMaterial, unlitMaterial, shaderMaterial, color, texture, GlNode, Camera, Scene, bounds, frameNode, scrubVideo, createRenderer, orbitControls },
|
|
749
750
|
};
|
|
750
751
|
|
|
751
752
|
export { Camera, GlNode, Scene, bounds, box, color, computeNormals, createRenderer, frameNode, gl, mat4, orbitControls, plane, quatFromEuler, quatMultiply, quatSlerp, scrubVideo, shaderMaterial, sphere, standardMaterial, texture, torus, unlitMaterial };
|
|
752
|
-
//# sourceMappingURL=https://raw.githubusercontent.com/HarrisonCN/Motionary/v11.
|
|
753
|
+
//# sourceMappingURL=https://raw.githubusercontent.com/HarrisonCN/Motionary/v11.4.0/dist/runtime/gl.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var registry = require('../chunks/registry-
|
|
3
|
+
var registry = require('../chunks/registry-VITvgTNc.cjs');
|
|
4
4
|
var runtime_gl = require('./gl.cjs');
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -239,7 +239,7 @@ function gltfAnimator(root, o = {}) {
|
|
|
239
239
|
pose();
|
|
240
240
|
return a;
|
|
241
241
|
}
|
|
242
|
-
const gltfAnim = { id: 'gltf-anim', version: registry.RUNTIME_VERSION, requires: ['core', 'gl', 'format-gltf'], api: { gltfClips, sampleChannel, applyClip, deformModel, deformGeometry, gltfAnimator } };
|
|
242
|
+
const gltfAnim = { id: 'gltf-anim', version: registry.RUNTIME_VERSION, tier: 'advanced', requires: ['core', 'gl', 'format-gltf'], api: { gltfClips, sampleChannel, applyClip, deformModel, deformGeometry, gltfAnimator } };
|
|
243
243
|
|
|
244
244
|
exports.applyClip = applyClip;
|
|
245
245
|
exports.deformGeometry = deformGeometry;
|
|
@@ -248,4 +248,4 @@ exports.gltfAnim = gltfAnim;
|
|
|
248
248
|
exports.gltfAnimator = gltfAnimator;
|
|
249
249
|
exports.gltfClips = gltfClips;
|
|
250
250
|
exports.sampleChannel = sampleChannel;
|
|
251
|
-
//# sourceMappingURL=https://raw.githubusercontent.com/HarrisonCN/Motionary/v11.
|
|
251
|
+
//# sourceMappingURL=https://raw.githubusercontent.com/HarrisonCN/Motionary/v11.4.0/dist/runtime/gltf-anim.cjs.map
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 11.4: runtime tiers. **basic** — ticker, tween, timeline, scroll, text, CSS / WAAPI keyframes; **standard** — smooth
|
|
3
|
+
* scrolling, drag-snap, SVG, sprites, GIF / APNG / WebP, Lottie; **advanced** — WebGL, 3D file parsing and decoders,
|
|
4
|
+
* physics. A page that only uses basic modules never downloads standard or advanced code.
|
|
5
|
+
*/
|
|
6
|
+
type RuntimeTier = 'basic' | 'standard' | 'advanced';
|
|
1
7
|
/** A runtime module: `{ id, version, api }`, registered with `use()`. */
|
|
2
8
|
interface RuntimeModule<A = unknown> {
|
|
3
9
|
/** Module id: 'core', 'format-css', 'scroll', … (import path `motionary/runtime/<id>`). */
|
|
@@ -5,6 +11,8 @@ interface RuntimeModule<A = unknown> {
|
|
|
5
11
|
version: string;
|
|
6
12
|
/** Other modules this one needs (registered first by `use()` callers). */
|
|
7
13
|
requires?: string[];
|
|
14
|
+
/** 11.4: runtime tier — basic · standard · advanced (docs/runtime-tiers.md). */
|
|
15
|
+
tier?: RuntimeTier;
|
|
8
16
|
/** The module's public API (what `requireModule(id)` returns). */
|
|
9
17
|
api: A;
|
|
10
18
|
/** Optional one-time setup, called on first registration. */
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 11.4: runtime tiers. **basic** — ticker, tween, timeline, scroll, text, CSS / WAAPI keyframes; **standard** — smooth
|
|
3
|
+
* scrolling, drag-snap, SVG, sprites, GIF / APNG / WebP, Lottie; **advanced** — WebGL, 3D file parsing and decoders,
|
|
4
|
+
* physics. A page that only uses basic modules never downloads standard or advanced code.
|
|
5
|
+
*/
|
|
6
|
+
type RuntimeTier = 'basic' | 'standard' | 'advanced';
|
|
1
7
|
/** A runtime module: `{ id, version, api }`, registered with `use()`. */
|
|
2
8
|
interface RuntimeModule<A = unknown> {
|
|
3
9
|
/** Module id: 'core', 'format-css', 'scroll', … (import path `motionary/runtime/<id>`). */
|
|
@@ -5,6 +11,8 @@ interface RuntimeModule<A = unknown> {
|
|
|
5
11
|
version: string;
|
|
6
12
|
/** Other modules this one needs (registered first by `use()` callers). */
|
|
7
13
|
requires?: string[];
|
|
14
|
+
/** 11.4: runtime tier — basic · standard · advanced (docs/runtime-tiers.md). */
|
|
15
|
+
tier?: RuntimeTier;
|
|
8
16
|
/** The module's public API (what `requireModule(id)` returns). */
|
|
9
17
|
api: A;
|
|
10
18
|
/** Optional one-time setup, called on first registration. */
|