motionary 14.2.0 → 14.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 +108 -0
- package/README.md +10 -2
- package/README_ja.md +1 -1
- package/README_zh.md +1 -1
- package/bin/public-paths.mjs +4 -0
- package/dist/chunks/{anim-image-DkioZN9X.js → anim-image-C90aEUEU.js} +2 -2
- package/dist/chunks/{anim-image-CHdhCFU7.cjs → anim-image-Cv3XeE0I.cjs} +2 -2
- package/dist/chunks/audio-D0LwPShE.cjs +1 -1
- package/dist/chunks/audio-D7mfQAUI.js +1 -1
- package/dist/chunks/badge-wall-CITexuW7.cjs +1 -1
- package/dist/chunks/badge-wall-TxNk_TTE.js +1 -1
- package/dist/chunks/base-BvH4nAcv.cjs +1 -1
- package/dist/chunks/base-ByyAdGqz.js +1 -1
- package/dist/chunks/bg-generator-BJ0Obz4R.js +1 -1
- package/dist/chunks/bg-generator-CML8tPN8.cjs +1 -1
- package/dist/chunks/bind-B_CTL6Qn.js +1 -1
- package/dist/chunks/bind-Ui43-n2d.cjs +1 -1
- package/dist/chunks/builtins-CpH2mTyp.js +1 -1
- package/dist/chunks/builtins-DweCp29Z.cjs +1 -1
- package/dist/chunks/carousel-Bdl2DpWW.js +1 -1
- package/dist/chunks/carousel-DU3rHTq0.cjs +1 -1
- package/dist/chunks/cart-drawer-CkFMKMhx.cjs +1 -1
- package/dist/chunks/cart-drawer-S3X_-dcv.js +1 -1
- package/dist/chunks/code-export-DwrlLHA5.js +1 -1
- package/dist/chunks/code-export-PdGSl9WE.cjs +1 -1
- package/dist/chunks/color-picker-B_xWVH8H.cjs +1 -1
- package/dist/chunks/color-picker-C2PH87yD.js +1 -1
- package/dist/chunks/command-palette-7lHRJzV1.js +1 -1
- package/dist/chunks/command-palette-ISetAeX1.cjs +1 -1
- package/dist/chunks/core-BPPcJVGQ.js +1 -1
- package/dist/chunks/core-BjcOCpJt.cjs +1 -1
- package/dist/chunks/core-CfuLPjGf.js +1 -1
- package/dist/chunks/core-DbAYRKnS.cjs +1 -1
- package/dist/chunks/core-Dj6iomdc.js +1 -1
- package/dist/chunks/core-DjjKLmZ6.cjs +1 -1
- package/dist/chunks/countdown-C4M4Ymbd.js +1 -1
- package/dist/chunks/countdown-RQViryt7.cjs +1 -1
- package/dist/chunks/date-picker-BgApzPNn.cjs +1 -1
- package/dist/chunks/date-picker-D1FhYimW.js +1 -1
- package/dist/chunks/ease-HwYZnZat.cjs +1 -1
- package/dist/chunks/ease-XN8_0sXu.js +1 -1
- package/dist/chunks/equalizer-Dxl2dMWN.js +1 -1
- package/dist/chunks/equalizer-_eD_ZdCl.cjs +1 -1
- package/dist/chunks/festival-banner-Bs18K0MJ.cjs +1 -1
- package/dist/chunks/festival-banner-RkIBAUue.js +1 -1
- package/dist/chunks/field-B_JKBZ66.js +1 -1
- package/dist/chunks/field-Dwq8-CLN.cjs +1 -1
- package/dist/chunks/format-DrRrPbjl.cjs +1 -1
- package/dist/chunks/{format-ClNijrhe.js → format-xyZDr-fG.js} +2 -2
- package/dist/chunks/fx-DaVuB89C.cjs +1 -1
- package/dist/chunks/fx-lkOk6ZLK.js +1 -1
- package/dist/chunks/generative-BKoxWOSP.cjs +1 -1
- package/dist/chunks/generative-CbMIaqxn.js +1 -1
- package/dist/chunks/{gl-scene-Btp6k9ym.cjs → gl-scene-BWEuB7Dy.cjs} +2 -2
- package/dist/chunks/{gl-scene-6k5slLJ1.js → gl-scene-CfY6ZPpo.js} +2 -2
- package/dist/chunks/globe-DA0jyb6s.cjs +1 -1
- package/dist/chunks/globe-ejBBHY6v.js +1 -1
- package/dist/chunks/gpu-C0vrwBcn.js +1 -1
- package/dist/chunks/gpu-C2C6iBQC.cjs +1 -1
- package/dist/chunks/gpu-particles-BvUfEndq.js +1 -1
- package/dist/chunks/gpu-particles-wEO_rds1.cjs +1 -1
- package/dist/chunks/history-CLzpNgGy.cjs +470 -0
- package/dist/chunks/history-DYSOAKH5.js +449 -0
- package/dist/chunks/index-C9_FEsfz.cjs +1 -1
- package/dist/chunks/index-gwb-TO6r.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/key-click-BLm3BI8_.js +1 -1
- package/dist/chunks/key-click-v7I4K5Sr.cjs +1 -1
- package/dist/chunks/{keyframes-Dqk1X3Q5.cjs → keyframes-Biqj3_4d.cjs} +2 -2
- package/dist/chunks/{keyframes-BikOcXxh.js → keyframes-Czg-ppwY.js} +2 -2
- package/dist/chunks/leaderboard-BmACkMks.js +1 -1
- package/dist/chunks/leaderboard-DvSSQ8o3.cjs +1 -1
- package/dist/chunks/location-card-9SyNFFc7.js +1 -1
- package/dist/chunks/location-card-DSPTApUe.cjs +1 -1
- package/dist/chunks/lottie-icon-BoxkukMd.cjs +1 -1
- package/dist/chunks/lottie-icon-CGG_tfjT.js +1 -1
- package/dist/chunks/{lottie-player-DbEnSefT.cjs → lottie-player-CadcuqBD.cjs} +2 -2
- package/dist/chunks/{lottie-player-CwD15LsB.js → lottie-player-Cl99nJUM.js} +2 -2
- package/dist/chunks/lyrics-CRB7dA1j.cjs +1 -1
- package/dist/chunks/lyrics-D7iF9I0S.js +1 -1
- package/dist/chunks/manifest-i1lnR0qJ.js +1 -1
- package/dist/chunks/manifest-xr3WET80.cjs +1 -1
- package/dist/chunks/menu-CZ1zHTT9.cjs +1 -1
- package/dist/chunks/menu-DrQfp6bJ.js +1 -1
- package/dist/chunks/menu-toggle-DGXN4VsN.cjs +1 -1
- package/dist/chunks/menu-toggle-DI8fAtZ0.js +1 -1
- package/dist/chunks/nav-morph-C4rD3wrU.cjs +1 -1
- package/dist/chunks/nav-morph-CBZ5HXQo.js +1 -1
- package/dist/chunks/otp-C1l7yq3_.js +1 -1
- package/dist/chunks/otp-DUyEWYMi.cjs +1 -1
- package/dist/chunks/pagination-DHmYZZU9.cjs +1 -1
- package/dist/chunks/pagination-JG7Hw-q-.js +1 -1
- package/dist/chunks/{physics-playground-D4pkMRhy.js → physics-playground-TCy4CZZP.js} +2 -2
- package/dist/chunks/{physics-playground-CxN5MmrO.cjs → physics-playground-emNzCmHD.cjs} +2 -2
- package/dist/chunks/{play-CkjaaN6e.js → play-C0s-Tm6f.js} +2 -2
- package/dist/chunks/play-DCeKlDqE.cjs +1 -1
- package/dist/chunks/{player-DkhZKVZX.js → player-AcMlL3g3.js} +2 -2
- package/dist/chunks/player-BJPVdtzo.cjs +1 -1
- package/dist/chunks/player-core-BGIt5Gzl.js +1 -1
- package/dist/chunks/player-core-BTFa6_IO.cjs +1 -1
- package/dist/chunks/presence-BQ2mRjpt.js +1 -1
- package/dist/chunks/presence-DAthlALi.cjs +1 -1
- package/dist/chunks/presets-BYBVJVeP.js +1 -1
- package/dist/chunks/presets-CUHys3sK.cjs +1 -1
- package/dist/chunks/preview-C0qDmRNm.js +208 -0
- package/dist/chunks/preview-CyTKsXQP.cjs +213 -0
- package/dist/chunks/prize-wheel-B5YpUMgr.js +1 -1
- package/dist/chunks/prize-wheel-emDopI5c.cjs +1 -1
- package/dist/chunks/product-gallery-BpJEGKIw.js +1 -1
- package/dist/chunks/product-gallery-CKtSVhZk.cjs +1 -1
- package/dist/chunks/progress-ring-C75O4MUi.cjs +1 -1
- package/dist/chunks/progress-ring-CRSbrt2I.js +1 -1
- package/dist/chunks/prop-panel-D4DEkdXL.js +1 -1
- package/dist/chunks/prop-panel-DFqga6H5.cjs +1 -1
- package/dist/chunks/radar-D-bZRrgs.cjs +1 -1
- package/dist/chunks/radar-DE_QcCUX.js +1 -1
- package/dist/chunks/reactions-BL2iO8iy.cjs +1 -1
- package/dist/chunks/reactions-BV57Pw0R.js +1 -1
- package/dist/chunks/{registry-BCFobMY2.js → registry-Bf0vrAy1.js} +2 -2
- package/dist/chunks/registry-CibnX7Ui.cjs +1 -1
- package/dist/chunks/registry-RLD_spxR.js +1 -1
- package/dist/chunks/{registry-Cy7Nk97K.cjs → registry-s4yL_aQj.cjs} +2 -2
- package/dist/chunks/retro-button-CrbkhjHv.js +1 -1
- package/dist/chunks/retro-button-DrrBZ6w8.cjs +1 -1
- package/dist/chunks/rive-Bt5R5BjT.js +1 -1
- package/dist/chunks/rive-D6X4J0Mi.cjs +1 -1
- package/dist/chunks/{runtime-link-BWMZB3tC.cjs → runtime-link-CO7s1v7-.cjs} +2 -2
- package/dist/chunks/{runtime-link-3fqOLtwH.js → runtime-link-DY1IVAdN.js} +2 -2
- package/dist/chunks/{scene-Bc03O1V2.js → scene-BlBhOYVs.js} +3 -3
- package/dist/chunks/scene-C4h75wjo.cjs +1 -1
- package/dist/chunks/scroll-driven-CQbwzCdn.cjs +1 -1
- package/dist/chunks/scroll-driven-LghshrWq.js +1 -1
- package/dist/chunks/{scroll-scene-Xk4OKyWQ.cjs → scroll-scene-9q0f0-ry.cjs} +3 -3
- package/dist/chunks/{scroll-scene-CmvOpk6I.js → scroll-scene-fXFb6QAx.js} +3 -3
- package/dist/chunks/segmented-Bqxe4qRo.js +1 -1
- package/dist/chunks/segmented-CpB4mKIn.cjs +1 -1
- package/dist/chunks/shader-backdrop-BodjXMhw.cjs +1 -1
- package/dist/chunks/shader-backdrop-C49tKiU1.js +1 -1
- package/dist/chunks/shared-Bf72wLyt.cjs +1 -1
- package/dist/chunks/shared-CkKHWrtJ.js +1 -1
- package/dist/chunks/shared-jkgRH-Hx.cjs +1 -1
- package/dist/chunks/shared-o9CtwHmi.js +1 -1
- package/dist/chunks/sheet-B38ylIEW.cjs +1 -1
- package/dist/chunks/sheet-DZXot7SV.js +1 -1
- package/dist/chunks/sign-DvZ1jHxE.js +1 -1
- package/dist/chunks/sign-RAkQIWrM.cjs +1 -1
- package/dist/chunks/skeleton-reveal-CMqfJYM2.js +1 -1
- package/dist/chunks/skeleton-reveal-Dsd3Wp0n.cjs +1 -1
- package/dist/chunks/sparkline-3fxOzufX.js +1 -1
- package/dist/chunks/sparkline-DeKhZpVo.cjs +1 -1
- package/dist/chunks/spring-CLwlIQHm.js +1 -1
- package/dist/chunks/spring-XEl_diDJ.cjs +1 -1
- package/dist/chunks/stagger-B9sKPwQB.js +1 -1
- package/dist/chunks/stagger-DFKwqOQG.cjs +1 -1
- package/dist/chunks/suggestion-chips-BwKPsDra.js +1 -1
- package/dist/chunks/suggestion-chips-CAcbFTr4.cjs +1 -1
- package/dist/chunks/switch-CMtM5gqP.js +1 -1
- package/dist/chunks/switch-DiTlApGd.cjs +1 -1
- package/dist/chunks/tab-bar-BBlVAqbq.cjs +1 -1
- package/dist/chunks/tab-bar-COPkxGY6.js +1 -1
- package/dist/chunks/{ticker-DQIpLv48.js → ticker-C7KRT80i.js} +2 -2
- package/dist/chunks/{ticker-crNxbg2p.cjs → ticker-Clrkk12S.cjs} +2 -2
- package/dist/chunks/tip-D4DdDz83.js +1 -1
- package/dist/chunks/tip-VGS3qAUm.cjs +1 -1
- package/dist/chunks/toast-stack-Cx1aTwf5.js +1 -1
- package/dist/chunks/toast-stack-DprisNp_.cjs +1 -1
- package/dist/chunks/{tween-CnVJt41b.cjs → tween-Bnr2kPhW.cjs} +2 -2
- package/dist/chunks/{tween-Bx-UetkK.js → tween-C3K0CIlX.js} +2 -2
- package/dist/chunks/upload-progress-CEAWkP-p.cjs +1 -1
- package/dist/chunks/upload-progress-Px_Zdd9c.js +1 -1
- package/dist/chunks/variants-BV9wFxiP.js +1 -1
- package/dist/chunks/variants-BtqEJuki.cjs +1 -1
- package/dist/chunks/viewport-BAXHhZLV.js +1 -1
- package/dist/chunks/viewport-EFYGqMNa.cjs +1 -1
- package/dist/chunks/voice-button-9UauxvT9.cjs +1 -1
- package/dist/chunks/voice-button-CmbZldLT.js +1 -1
- package/dist/chunks/weather-card-4Eg6e43D.cjs +1 -1
- package/dist/chunks/weather-card-BdvgvAxQ.js +1 -1
- package/dist/chunks/worker-canvas-BLXaLvtq.js +1 -1
- package/dist/chunks/worker-canvas-BMBXAFWp.cjs +1 -1
- package/dist/chunks/xp-bar-CjOalkPm.js +1 -1
- package/dist/chunks/xp-bar-DkWfCTfB.cjs +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/compat-v13.cjs +1 -1
- package/dist/components/compat-v13.js +2 -2
- 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 +3 -3
- package/dist/components/dotlottie.js +3 -3
- 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 +3 -3
- 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 +3 -3
- package/dist/components/gl-model.js +3 -3
- package/dist/components/gl-pool.cjs +1 -1
- package/dist/components/gl-pool.js +1 -1
- 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/motion-layout.cjs +1 -1
- package/dist/components/motion-layout.js +1 -1
- package/dist/components/motion-scene.cjs +1 -1
- package/dist/components/motion-scene.js +2 -2
- package/dist/components/motion-tokens.cjs +1 -1
- package/dist/components/motion-tokens.js +1 -1
- package/dist/components/motion.cjs +1 -1
- package/dist/components/motion.js +1 -1
- package/dist/components/native.cjs +1 -1
- package/dist/components/native.js +1 -1
- package/dist/components/offscreen.cjs +1 -1
- package/dist/components/offscreen.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-tasks.cjs +1 -1
- package/dist/components/perf-tasks.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/scene-v2.cjs +1 -1
- package/dist/components/scene-v2.js +3 -3
- package/dist/components/snap-carousel.cjs +2 -2
- package/dist/components/snap-carousel.js +2 -2
- package/dist/components/solid.cjs +1 -1
- package/dist/components/solid.js +1 -1
- package/dist/components/studio-canvas.cjs +998 -0
- package/dist/components/studio-canvas.d.cts +377 -0
- package/dist/components/studio-canvas.d.ts +377 -0
- package/dist/components/studio-canvas.js +978 -0
- package/dist/components/studio.cjs +1024 -0
- package/dist/components/studio.d.cts +502 -0
- package/dist/components/studio.d.ts +502 -0
- package/dist/components/studio.js +1009 -0
- 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-editor.cjs +27 -674
- package/dist/components/timeline-editor.js +6 -654
- 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 +5 -5
- package/dist/components/widgets.js +7 -7
- 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 +1 -1
- 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 +2 -2
- package/dist/runtime/drag-snap.iife.js +1 -1
- package/dist/runtime/drag-snap.js +2 -2
- package/dist/runtime/format-apng.cjs +3 -3
- package/dist/runtime/format-apng.iife.js +1 -1
- package/dist/runtime/format-apng.js +3 -3
- package/dist/runtime/format-css.cjs +3 -3
- package/dist/runtime/format-css.iife.js +1 -1
- package/dist/runtime/format-css.js +3 -3
- package/dist/runtime/format-gif.cjs +3 -3
- package/dist/runtime/format-gif.iife.js +1 -1
- package/dist/runtime/format-gif.js +3 -3
- package/dist/runtime/format-gltf.cjs +2 -2
- package/dist/runtime/format-gltf.iife.js +1 -1
- package/dist/runtime/format-gltf.js +2 -2
- package/dist/runtime/format-motion.cjs +4 -4
- package/dist/runtime/format-motion.iife.js +1 -1
- package/dist/runtime/format-motion.js +4 -4
- package/dist/runtime/format-obj.cjs +2 -2
- package/dist/runtime/format-obj.iife.js +1 -1
- package/dist/runtime/format-obj.js +2 -2
- package/dist/runtime/format-scene.cjs +2 -2
- package/dist/runtime/format-scene.iife.js +1 -1
- package/dist/runtime/format-scene.js +2 -2
- package/dist/runtime/format-sprite.cjs +3 -3
- package/dist/runtime/format-sprite.iife.js +1 -1
- package/dist/runtime/format-sprite.js +3 -3
- package/dist/runtime/format-svg.cjs +3 -3
- package/dist/runtime/format-svg.iife.js +1 -1
- package/dist/runtime/format-svg.js +3 -3
- package/dist/runtime/format-webp.cjs +3 -3
- package/dist/runtime/format-webp.iife.js +1 -1
- package/dist/runtime/format-webp.js +3 -3
- package/dist/runtime/gl.cjs +2 -2
- package/dist/runtime/gl.iife.js +1 -1
- package/dist/runtime/gl.js +2 -2
- package/dist/runtime/gltf-anim.cjs +2 -2
- package/dist/runtime/gltf-anim.iife.js +1 -1
- package/dist/runtime/gltf-anim.js +2 -2
- package/dist/runtime/gltf-decoders.cjs +2 -2
- package/dist/runtime/gltf-decoders.iife.js +1 -1
- package/dist/runtime/gltf-decoders.js +2 -2
- package/dist/runtime/lottie-state.cjs +2 -2
- package/dist/runtime/lottie-state.iife.js +1 -1
- package/dist/runtime/lottie-state.js +2 -2
- package/dist/runtime/physics.cjs +2 -2
- package/dist/runtime/physics.iife.js +1 -1
- package/dist/runtime/physics.js +2 -2
- package/dist/runtime/scroll.cjs +3 -3
- package/dist/runtime/scroll.iife.js +1 -1
- package/dist/runtime/scroll.js +3 -3
- package/dist/runtime/smooth.cjs +2 -2
- package/dist/runtime/smooth.iife.js +1 -1
- package/dist/runtime/smooth.js +2 -2
- package/dist/runtime/text.cjs +2 -2
- package/dist/runtime/text.iife.js +1 -1
- package/dist/runtime/text.js +2 -2
- package/dist/runtime/vector.cjs +3 -3
- package/dist/runtime/vector.iife.js +1 -1
- package/dist/runtime/vector.js +3 -3
- package/dist/runtime.cjs +4 -4
- package/dist/runtime.d.cts +1 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.iife.js +2 -2
- package/dist/runtime.js +6 -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 +1 -1
- package/dist/widgets/dotlottie.js +1 -1
- 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 +1 -1
- package/dist/widgets/gl-model.js +1 -1
- package/dist/widgets/gl-scene.cjs +2 -2
- package/dist/widgets/gl-scene.js +2 -2
- 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 +2 -2
- package/dist/widgets/lottie-player.js +2 -2
- 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 +2 -2
- package/dist/widgets/physics-playground.js +2 -2
- 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 +2 -2
- package/dist/widgets/scroll-scene.js +2 -2
- 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 +2 -2
- package/dist/widgets/smooth-scroll.js +2 -2
- package/dist/widgets/snap-carousel.cjs +1 -1
- package/dist/widgets/snap-carousel.js +1 -1
- 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 +46 -1
- package/docs/studio-canvas.md +233 -0
- package/docs/studio.md +224 -0
- package/docs/versions.md +1 -1
- package/package.json +41 -1
|
@@ -0,0 +1,978 @@
|
|
|
1
|
+
import { a as addKeyframe, s as setKeyframeProps, u as updateLayers, m as moveLayer, b as bindHistoryKeys, c as uniqueId } from '../chunks/history-DYSOAKH5.js';
|
|
2
|
+
import { i as isLayerLocked, T as TimelineDocError } from '../chunks/format-xyZDr-fG.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* motionary/studio/canvas (14.3) — the foundations of the Studio canvas: visual selection, marquee and multi-select,
|
|
6
|
+
* layer order / lock / hide, guides and snapping (guides, the other layers' edges and centres, a grid), drag / resize /
|
|
7
|
+
* rotate with pointer and touch (pinch-zoom of the canvas), keyboard navigation and nudge, and an accessible selection
|
|
8
|
+
* model (listbox / option, roving focus, live announcements).
|
|
9
|
+
*
|
|
10
|
+
* No new document format: the canvas edits the 13.6 timeline editor model (Scene Format v2's `motionary-timeline`
|
|
11
|
+
* subset) through its own operations and the existing `createTimelineHistory`:
|
|
12
|
+
*
|
|
13
|
+
* - geometry = keyframe props at the edit time — `translate: "Xpx Ypx"`, `rotate: "Ddeg"`, `width` / `height: "Npx"`
|
|
14
|
+
* (the CSS individual transform properties, so `<usa-player>` and `playScene` animate them as they are);
|
|
15
|
+
* - lock = `locked`, hide = `muted` (left out of preview and export), order = the layer order (first = in front).
|
|
16
|
+
*
|
|
17
|
+
* Every edit is also returned as a list of `CanvasOp`s that `applyCanvasOps` replays on a Scene v2 document — the
|
|
18
|
+
* lossless path that keeps what timeline v1 cannot hold (preset / effect layers, tokens, composite, loop).
|
|
19
|
+
*
|
|
20
|
+
* Editor-only: nothing in `motionary`, `motionary/core`, `motionary/motion` or `components/lite` imports it. It never
|
|
21
|
+
* touches `window` / `document` at import (SSR-safe) and never listens on them: the controller listens on its root
|
|
22
|
+
* only, adds the move / up / cancel listeners when a gesture starts and removes them when it ends or on `destroy()`.
|
|
23
|
+
*/
|
|
24
|
+
const STUDIO_CANVAS_VERSION = 1;
|
|
25
|
+
const z0 = (n) => n + 0; // -0 → 0
|
|
26
|
+
const r2 = (n) => z0(Math.round(n * 100) / 100);
|
|
27
|
+
const r4 = (n) => z0(Math.round(n * 1e4) / 1e4);
|
|
28
|
+
const N = '(-?(?:\\d+\\.?\\d*|\\.\\d+)(?:e[-+]?\\d+)?)';
|
|
29
|
+
const PX = /*#__PURE__*/ new RegExp(`^${N}px$`);
|
|
30
|
+
const DEG = /*#__PURE__*/ new RegExp(`^${N}deg$`);
|
|
31
|
+
const TR = /*#__PURE__*/ new RegExp(`^${N}px(?:\\s+${N}px)?$`);
|
|
32
|
+
const GEO = ['translate', 'width', 'height', 'rotate'];
|
|
33
|
+
const FORBIDDEN = ['__proto__', 'constructor', 'prototype'];
|
|
34
|
+
const none = (doc) => ({ doc, ops: [] });
|
|
35
|
+
const bad = (path, message) => new TimelineDocError([{ path, message }]);
|
|
36
|
+
const own = (o, k) => Object.prototype.hasOwnProperty.call(o, k);
|
|
37
|
+
const track = (doc, id) => doc.layers.find((l) => l.id === id && l.type === 'track');
|
|
38
|
+
/** The value of `prop` at `time`: the last keyframe at or before it that sets it, else the first one that does. */
|
|
39
|
+
function held(ks, prop, time) {
|
|
40
|
+
let v;
|
|
41
|
+
for (const k of ks)
|
|
42
|
+
if (own(k.props, prop) && (!v || k.time <= time))
|
|
43
|
+
v = k;
|
|
44
|
+
return v?.props[prop];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* A track's geometry at `time` (held from the last keyframe at or before it). `null` for groups, unknown ids, and
|
|
48
|
+
* values the canvas cannot represent (`10%`, `calc()`, numbers …): such layers stay read-only instead of being rewritten.
|
|
49
|
+
*/
|
|
50
|
+
function readCanvasGeometry(doc, id, time) {
|
|
51
|
+
const l = track(doc, id);
|
|
52
|
+
if (!l)
|
|
53
|
+
return null;
|
|
54
|
+
const g = { x: 0, y: 0, rotation: 0 };
|
|
55
|
+
for (const p of GEO) {
|
|
56
|
+
const v = held(l.keyframes || [], p, time);
|
|
57
|
+
if (v === undefined)
|
|
58
|
+
continue;
|
|
59
|
+
const m = typeof v === 'string' ? (p === 'translate' ? TR : p === 'rotate' ? DEG : PX).exec(v.trim()) : null;
|
|
60
|
+
if (!m)
|
|
61
|
+
return null;
|
|
62
|
+
if (p === 'translate') {
|
|
63
|
+
g.x = z0(+m[1]);
|
|
64
|
+
g.y = z0(+(m[2] ?? 0));
|
|
65
|
+
}
|
|
66
|
+
else if (p === 'rotate')
|
|
67
|
+
g.rotation = z0(+m[1]);
|
|
68
|
+
else
|
|
69
|
+
g[p] = z0(+m[1]);
|
|
70
|
+
}
|
|
71
|
+
return g;
|
|
72
|
+
}
|
|
73
|
+
/** The canvas box: the layer's untransformed layout box (`base`, canvas px) moved by the translate, with size overrides. */
|
|
74
|
+
const canvasBox = (base, g) => ({
|
|
75
|
+
x: base.x + g.x, y: base.y + g.y, width: g.width ?? base.width, height: g.height ?? base.height, rotation: g.rotation,
|
|
76
|
+
});
|
|
77
|
+
/** The axis-aligned bounds of a (rotated) box. */
|
|
78
|
+
function canvasBounds(b) {
|
|
79
|
+
const t = (b.rotation * Math.PI) / 180, c = Math.abs(Math.cos(t)), s = Math.abs(Math.sin(t));
|
|
80
|
+
const w = b.width * c + b.height * s, h = b.width * s + b.height * c;
|
|
81
|
+
return { x: b.x + b.width / 2 - w / 2, y: b.y + b.height / 2 - h / 2, width: w, height: h };
|
|
82
|
+
}
|
|
83
|
+
/** Whether two rects overlap (touching counts). */
|
|
84
|
+
const rectsIntersect = (a, b) => a.x <= b.x + b.width && b.x <= a.x + a.width && a.y <= b.y + b.height && b.y <= a.y + a.height;
|
|
85
|
+
/** Ids whose (rotated) box the marquee touches (`'intersect'`) or fully holds (`'contain'`), in the order given. */
|
|
86
|
+
function marqueeHits(boxes, m, mode = 'intersect') {
|
|
87
|
+
const out = [];
|
|
88
|
+
for (const id of Object.keys(boxes)) {
|
|
89
|
+
const b = canvasBounds(boxes[id]);
|
|
90
|
+
if (mode === 'contain' ? m.x <= b.x && m.y <= b.y && b.x + b.width <= m.x + m.width && b.y + b.height <= m.y + m.height : rectsIntersect(m, b))
|
|
91
|
+
out.push(id);
|
|
92
|
+
}
|
|
93
|
+
return out;
|
|
94
|
+
}
|
|
95
|
+
/** Snap lines: the edges and centres of `rects` plus the guides, sorted, unique. */
|
|
96
|
+
function snapLines(rects, guides = {}) {
|
|
97
|
+
const u = (a) => [...new Set(a.map(r4))].sort((p, q) => p - q);
|
|
98
|
+
return {
|
|
99
|
+
x: u([...rects.flatMap((r) => [r.x, r.x + r.width / 2, r.x + r.width]), ...(guides.x || [])]),
|
|
100
|
+
y: u([...rects.flatMap((r) => [r.y, r.y + r.height / 2, r.y + r.height]), ...(guides.y || [])]),
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
/** The nearest line within `threshold` (a tie goes to the first); none → `{ value }` unchanged. */
|
|
104
|
+
function snapValue(v, lines, threshold) {
|
|
105
|
+
let best;
|
|
106
|
+
for (const l of lines)
|
|
107
|
+
if (Math.abs(l - v) <= threshold && (best === undefined || Math.abs(l - v) < Math.abs(best - v)))
|
|
108
|
+
best = l;
|
|
109
|
+
return best === undefined ? { value: v } : { value: best, line: best };
|
|
110
|
+
}
|
|
111
|
+
/** `v` on a grid of `grid` px (0 = off). */
|
|
112
|
+
const snapToGrid = (v, grid) => (grid > 0 ? z0(Math.round(v / grid) * grid) : v);
|
|
113
|
+
/**
|
|
114
|
+
* How far to move `rect` so its left / centre / right (top / middle / bottom) lands on the nearest line within
|
|
115
|
+
* `threshold`; on an axis with no line the left (top) edge goes to the grid when one is set. `x` / `y` name the line hit.
|
|
116
|
+
*/
|
|
117
|
+
function snapRect(rect, lines, o) {
|
|
118
|
+
const axis = (start, size, ls) => {
|
|
119
|
+
let best;
|
|
120
|
+
for (const v of [start, start + size / 2, start + size]) {
|
|
121
|
+
const s = snapValue(v, ls, o.threshold);
|
|
122
|
+
if (s.line !== undefined && (!best || Math.abs(s.line - v) < Math.abs(best.d)))
|
|
123
|
+
best = { d: s.line - v, line: s.line };
|
|
124
|
+
}
|
|
125
|
+
return best || { d: o.grid ? snapToGrid(start, o.grid) - start : 0 };
|
|
126
|
+
};
|
|
127
|
+
const ax = axis(rect.x, rect.width, lines.x), ay = axis(rect.y, rect.height, lines.y);
|
|
128
|
+
const out = { dx: r4(ax.d), dy: r4(ay.d) };
|
|
129
|
+
if ('line' in ax)
|
|
130
|
+
out.x = ax.line;
|
|
131
|
+
if ('line' in ay)
|
|
132
|
+
out.y = ay.line;
|
|
133
|
+
return out;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Resize `box` by dragging `handle` by (dx, dy) canvas px: the dragged edges follow the pointer in the box's own
|
|
137
|
+
* (rotated) frame and the opposite edges stay where they are. `keepAspect` scales both sides; `min` (default 1) px.
|
|
138
|
+
*/
|
|
139
|
+
function resizeBox(box, handle, dx, dy, o = {}) {
|
|
140
|
+
const hx = handle.includes('e') ? 1 : handle.includes('w') ? -1 : 0;
|
|
141
|
+
const hy = handle.includes('s') ? 1 : handle.includes('n') ? -1 : 0;
|
|
142
|
+
const t = (box.rotation * Math.PI) / 180, c = box.rotation ? Math.cos(t) : 1, s = box.rotation ? Math.sin(t) : 0;
|
|
143
|
+
const min = o.min ?? 1;
|
|
144
|
+
let w = box.width + hx * (dx * c + dy * s);
|
|
145
|
+
let h = box.height + hy * (-dx * s + dy * c);
|
|
146
|
+
if (o.keepAspect && box.width && box.height) {
|
|
147
|
+
const k = hx && hy ? Math.max(w / box.width, h / box.height) : hx ? w / box.width : h / box.height;
|
|
148
|
+
w = box.width * k;
|
|
149
|
+
h = box.height * k;
|
|
150
|
+
}
|
|
151
|
+
w = Math.max(min, w);
|
|
152
|
+
h = Math.max(min, h);
|
|
153
|
+
const lx = (hx * (w - box.width)) / 2, ly = (hy * (h - box.height)) / 2;
|
|
154
|
+
const cx = box.x + box.width / 2 + lx * c - ly * s, cy = box.y + box.height / 2 + lx * s + ly * c;
|
|
155
|
+
return { x: z0(cx - w / 2), y: z0(cy - h / 2), width: w, height: h, rotation: box.rotation };
|
|
156
|
+
}
|
|
157
|
+
/** The rotation after dragging from `start` to `p` around the box centre, from `r0`; `step` snaps (Shift: 15). (-180, 180]. */
|
|
158
|
+
function rotationFromPointer(box, start, p, r0, step = 0) {
|
|
159
|
+
const cx = box.x + box.width / 2, cy = box.y + box.height / 2;
|
|
160
|
+
let a = r0 + ((Math.atan2(p.y - cy, p.x - cx) - Math.atan2(start.y - cy, start.x - cx)) * 180) / Math.PI;
|
|
161
|
+
if (step > 0)
|
|
162
|
+
a = Math.round(a / step) * step;
|
|
163
|
+
a = (((a % 360) + 540) % 360) - 180;
|
|
164
|
+
return z0(a === -180 ? 180 : a);
|
|
165
|
+
}
|
|
166
|
+
// --- ops ------------------------------------------------------------------------------------------------------
|
|
167
|
+
/** Write geometry props on a track at `time`: into the keyframe there, else a new keyframe. */
|
|
168
|
+
function writeProps(doc, layer, time, props) {
|
|
169
|
+
if (!Object.keys(props).length)
|
|
170
|
+
return none(doc);
|
|
171
|
+
const t = r4(Math.max(0, time));
|
|
172
|
+
const ks = track(doc, layer).keyframes || [];
|
|
173
|
+
let k;
|
|
174
|
+
for (const x of ks)
|
|
175
|
+
if (x.time === t)
|
|
176
|
+
k = x;
|
|
177
|
+
if (k)
|
|
178
|
+
return { doc: setKeyframeProps(doc, k.id, props), ops: [{ op: 'set-props', layer, keyframe: k.id, props }] };
|
|
179
|
+
const id = uniqueId(doc, 'k');
|
|
180
|
+
return { doc: addKeyframe(doc, layer, { id, time: t, props }), ops: [{ op: 'add-keyframe', layer, keyframe: { id, time: t, props: { ...props } } }] };
|
|
181
|
+
}
|
|
182
|
+
/** Set a layer's box (any of x / y / width / height / rotation) at `time`; only what changed is written. Locked → no-op. */
|
|
183
|
+
function canvasSetBox(doc, id, time, base, box) {
|
|
184
|
+
const g = isLayerLocked(doc, id) ? null : readCanvasGeometry(doc, id, time);
|
|
185
|
+
if (!g)
|
|
186
|
+
return none(doc);
|
|
187
|
+
const p = {};
|
|
188
|
+
const x = box.x === undefined ? g.x : r2(box.x - base.x), y = box.y === undefined ? g.y : r2(box.y - base.y);
|
|
189
|
+
if (x !== g.x || y !== g.y)
|
|
190
|
+
p.translate = `${x}px ${y}px`;
|
|
191
|
+
for (const k of ['width', 'height'])
|
|
192
|
+
if (box[k] !== undefined && r2(box[k]) !== (g[k] ?? r2(base[k])))
|
|
193
|
+
p[k] = `${r2(box[k])}px`;
|
|
194
|
+
if (box.rotation !== undefined && r2(box.rotation) !== g.rotation)
|
|
195
|
+
p.rotate = `${r2(box.rotation)}deg`;
|
|
196
|
+
return writeProps(doc, id, time, p);
|
|
197
|
+
}
|
|
198
|
+
/** Move layers by (dx, dy) canvas px at `time`. Locked layers, layers in locked groups and read-only geometry stay. */
|
|
199
|
+
function canvasMove(doc, ids, time, bases, dx, dy) {
|
|
200
|
+
let d = doc;
|
|
201
|
+
const ops = [];
|
|
202
|
+
for (const id of [...new Set(ids)]) {
|
|
203
|
+
const g = readCanvasGeometry(d, id, time), b = bases[id];
|
|
204
|
+
if (!g || !b)
|
|
205
|
+
continue;
|
|
206
|
+
const e = canvasSetBox(d, id, time, b, { x: b.x + g.x + dx, y: b.y + g.y + dy });
|
|
207
|
+
d = e.doc;
|
|
208
|
+
ops.push(...e.ops);
|
|
209
|
+
}
|
|
210
|
+
return { doc: d, ops };
|
|
211
|
+
}
|
|
212
|
+
function flag(doc, ids, f, v) {
|
|
213
|
+
const ch = [...new Set(ids)].filter((id) => doc.layers.some((l) => l.id === id && !!l[f] !== v));
|
|
214
|
+
if (!ch.length)
|
|
215
|
+
return none(doc);
|
|
216
|
+
const next = updateLayers(doc, ch, { [f]: v });
|
|
217
|
+
return next === doc ? none(doc) : { doc: next, ops: [{ op: 'update-layers', ids: ch, patch: { [f]: v } }] };
|
|
218
|
+
}
|
|
219
|
+
/** Lock / unlock layers (`locked`; a locked group locks its children). */
|
|
220
|
+
const canvasSetLocked = (doc, ids, locked) => flag(doc, ids, 'locked', locked);
|
|
221
|
+
/** Hide / show layers (`muted`: hidden on the canvas and left out of preview and export). */
|
|
222
|
+
const canvasSetHidden = (doc, ids, hidden) => flag(doc, ids, 'muted', hidden);
|
|
223
|
+
/** Change a layer's place among its siblings: the first layer is in front. Locked layers stay. */
|
|
224
|
+
function canvasReorder(doc, id, to) {
|
|
225
|
+
const l = doc.layers.find((x) => x.id === id);
|
|
226
|
+
if (!l || isLayerLocked(doc, id))
|
|
227
|
+
return none(doc);
|
|
228
|
+
const sib = doc.layers.filter((x) => x.parent === l.parent);
|
|
229
|
+
const i = sib.indexOf(l), n = sib.length;
|
|
230
|
+
const at = to === 'forward' ? i - 1 : to === 'backward' ? i + 1 : to === 'front' ? 0 : n - 1;
|
|
231
|
+
if (at < 0 || at >= n || at === i)
|
|
232
|
+
return none(doc);
|
|
233
|
+
const next = moveLayer(doc, id, at);
|
|
234
|
+
return next === doc ? none(doc) : { doc: next, ops: [{ op: 'move-layer', layer: id, index: at }] };
|
|
235
|
+
}
|
|
236
|
+
function checkProps(props, path) {
|
|
237
|
+
if (!props || typeof props !== 'object')
|
|
238
|
+
throw bad(path, 'expected props');
|
|
239
|
+
for (const k of Object.keys(props)) {
|
|
240
|
+
const v = props[k];
|
|
241
|
+
if (FORBIDDEN.includes(k))
|
|
242
|
+
throw bad(`${path}.${k}`, 'forbidden key');
|
|
243
|
+
if (typeof v !== 'string' || v.length > 2048)
|
|
244
|
+
throw bad(`${path}.${k}`, 'expected a string');
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Replay canvas ops on a Scene v2 document (pure; throws `TimelineDocError` on an op that does not apply). Everything the
|
|
249
|
+
* ops do not name is kept as it is — preset / effect / component layers, tokens, loop, keyframe `composite`.
|
|
250
|
+
*/
|
|
251
|
+
function applyCanvasOps(scene, ops) {
|
|
252
|
+
let d = scene;
|
|
253
|
+
ops.forEach((o, i) => {
|
|
254
|
+
const at = `ops[${i}]`;
|
|
255
|
+
const need = (id, t) => {
|
|
256
|
+
if (!d.layers.some((l) => l.id === id && (!t || l.type === 'track')))
|
|
257
|
+
throw bad(at, `no ${t ? 'track' : 'layer'} "${id}"`);
|
|
258
|
+
if (t && isLayerLocked(d, id))
|
|
259
|
+
throw bad(at, `"${id}" is locked`);
|
|
260
|
+
};
|
|
261
|
+
if (o?.op === 'add-keyframe') {
|
|
262
|
+
need(o.layer, true);
|
|
263
|
+
checkProps(o.keyframe?.props, `${at}.keyframe.props`);
|
|
264
|
+
d = addKeyframe(d, o.layer, { id: o.keyframe.id, time: o.keyframe.time, props: o.keyframe.props });
|
|
265
|
+
}
|
|
266
|
+
else if (o?.op === 'set-props') {
|
|
267
|
+
need(o.layer, true);
|
|
268
|
+
checkProps(o.props, `${at}.props`);
|
|
269
|
+
if (!track(d, o.layer).keyframes?.some((k) => k.id === o.keyframe))
|
|
270
|
+
throw bad(at, `no keyframe "${o.keyframe}"`);
|
|
271
|
+
d = setKeyframeProps(d, o.keyframe, o.props);
|
|
272
|
+
}
|
|
273
|
+
else if (o?.op === 'update-layers') {
|
|
274
|
+
if (!Array.isArray(o.ids))
|
|
275
|
+
throw bad(at, 'expected ids');
|
|
276
|
+
o.ids.forEach((id) => need(id));
|
|
277
|
+
const p = o.patch || {};
|
|
278
|
+
if (Object.keys(p).some((k) => (k !== 'locked' && k !== 'muted') || typeof p[k] !== 'boolean'))
|
|
279
|
+
throw bad(`${at}.patch`, 'only locked / muted');
|
|
280
|
+
d = updateLayers(d, o.ids, p);
|
|
281
|
+
}
|
|
282
|
+
else if (o?.op === 'move-layer') {
|
|
283
|
+
need(o.layer);
|
|
284
|
+
if (isLayerLocked(d, o.layer))
|
|
285
|
+
throw bad(at, `"${o.layer}" is locked`);
|
|
286
|
+
d = moveLayer(d, o.layer, o.index);
|
|
287
|
+
}
|
|
288
|
+
else
|
|
289
|
+
throw bad(`${at}.op`, `unknown op "${o?.op}"`);
|
|
290
|
+
});
|
|
291
|
+
return d;
|
|
292
|
+
}
|
|
293
|
+
const HANDLES = [['nw', 0, 0, 'nwse'], ['n', 50, 0, 'ns'], ['ne', 100, 0, 'nesw'], ['e', 100, 50, 'ew'], ['se', 100, 100, 'nwse'], ['s', 50, 100, 'ns'], ['sw', 0, 100, 'nesw'], ['w', 0, 50, 'ew']];
|
|
294
|
+
const ARROWS = { ArrowLeft: [-1, 0], ArrowRight: [1, 0], ArrowUp: [0, -1], ArrowDown: [0, 1] };
|
|
295
|
+
/** Turn `root` into an editing canvas for the history's document. */
|
|
296
|
+
function createStudioCanvas(root, o) {
|
|
297
|
+
const { history } = o;
|
|
298
|
+
const stage = o.stage || root;
|
|
299
|
+
const doc0 = root.ownerDocument;
|
|
300
|
+
const sn = o.snap === false ? null : { threshold: 6, guides: true, siblings: true, grid: true, ...(typeof o.snap === 'object' ? o.snap : {}) };
|
|
301
|
+
let time = o.time ?? 0, grid = o.grid ?? 0, guides = o.guides || {};
|
|
302
|
+
let zoom = 1, pan = { x: 0, y: 0 };
|
|
303
|
+
const minZ = o.minZoom ?? 0.1, maxZ = o.maxZoom ?? 8;
|
|
304
|
+
let items = [];
|
|
305
|
+
let selection = [];
|
|
306
|
+
let focusId;
|
|
307
|
+
let g = null;
|
|
308
|
+
const pointers = new Map();
|
|
309
|
+
let attached = false, dead = false;
|
|
310
|
+
const coarse = !!doc0.defaultView?.matchMedia?.('(pointer: coarse)').matches;
|
|
311
|
+
// --- DOM bookkeeping: every attribute / inline style we touch is restored on destroy ----------------------------
|
|
312
|
+
const saved = new Map();
|
|
313
|
+
const rec = (el) => {
|
|
314
|
+
let r = saved.get(el);
|
|
315
|
+
if (!r)
|
|
316
|
+
saved.set(el, (r = { a: new Map(), s: new Map(), st: el.getAttribute('style') }));
|
|
317
|
+
return r;
|
|
318
|
+
};
|
|
319
|
+
const attr = (el, n, v) => {
|
|
320
|
+
const r = rec(el);
|
|
321
|
+
if (!r.a.has(n))
|
|
322
|
+
r.a.set(n, el.getAttribute(n));
|
|
323
|
+
if (v === null)
|
|
324
|
+
el.removeAttribute(n);
|
|
325
|
+
else if (el.getAttribute(n) !== v)
|
|
326
|
+
el.setAttribute(n, v);
|
|
327
|
+
};
|
|
328
|
+
const css = (el, p, v) => {
|
|
329
|
+
const r = rec(el);
|
|
330
|
+
if (!r.s.has(p))
|
|
331
|
+
r.s.set(p, [el.style.getPropertyValue(p), el.style.getPropertyPriority(p)]);
|
|
332
|
+
const orig = r.s.get(p);
|
|
333
|
+
if (v === undefined) {
|
|
334
|
+
if (orig[0])
|
|
335
|
+
el.style.setProperty(p, orig[0], orig[1]);
|
|
336
|
+
else
|
|
337
|
+
el.style.removeProperty(p);
|
|
338
|
+
}
|
|
339
|
+
else
|
|
340
|
+
el.style.setProperty(p, v);
|
|
341
|
+
};
|
|
342
|
+
const restore = (el) => {
|
|
343
|
+
const r = saved.get(el);
|
|
344
|
+
if (!r)
|
|
345
|
+
return;
|
|
346
|
+
for (const [p, [v, pr]] of r.s)
|
|
347
|
+
if (v)
|
|
348
|
+
el.style.setProperty(p, v, pr);
|
|
349
|
+
else
|
|
350
|
+
el.style.removeProperty(p);
|
|
351
|
+
for (const [n, v] of r.a)
|
|
352
|
+
if (v === null)
|
|
353
|
+
el.removeAttribute(n);
|
|
354
|
+
else
|
|
355
|
+
el.setAttribute(n, v);
|
|
356
|
+
if (r.st === null) {
|
|
357
|
+
if (el.getAttribute('style') === '')
|
|
358
|
+
el.removeAttribute('style');
|
|
359
|
+
}
|
|
360
|
+
else if (el.getAttribute('style') !== r.st) {
|
|
361
|
+
// same declarations → put the author's exact text back (browsers re-serialize the attribute after setProperty)
|
|
362
|
+
const t = el.cloneNode(false);
|
|
363
|
+
t.setAttribute('style', r.st);
|
|
364
|
+
if (t.style.cssText === el.style.cssText)
|
|
365
|
+
el.setAttribute('style', r.st);
|
|
366
|
+
}
|
|
367
|
+
saved.delete(el);
|
|
368
|
+
};
|
|
369
|
+
const div = (style, parent) => {
|
|
370
|
+
const d = doc0.createElement('div');
|
|
371
|
+
d.style.cssText = style;
|
|
372
|
+
parent.append(d);
|
|
373
|
+
return d;
|
|
374
|
+
};
|
|
375
|
+
attr(root, 'role', 'listbox');
|
|
376
|
+
attr(root, 'aria-multiselectable', 'true');
|
|
377
|
+
if (!root.hasAttribute('aria-label') && !root.hasAttribute('aria-labelledby'))
|
|
378
|
+
attr(root, 'aria-label', o.label || 'Canvas');
|
|
379
|
+
css(root, 'touch-action', 'none');
|
|
380
|
+
css(root, '-webkit-user-select', undefined); // record both before writing: engines alias them (restore order matters)
|
|
381
|
+
css(root, 'user-select', 'none');
|
|
382
|
+
css(root, '-webkit-user-select', 'none');
|
|
383
|
+
if (doc0.defaultView?.getComputedStyle(stage).position === 'static')
|
|
384
|
+
css(stage, 'position', 'relative');
|
|
385
|
+
const overlay = div('position:absolute;left:0;top:0;width:0;height:0;overflow:visible;pointer-events:none;z-index:2147483647', stage);
|
|
386
|
+
overlay.setAttribute('aria-hidden', 'true');
|
|
387
|
+
overlay.setAttribute('data-canvas-overlay', '');
|
|
388
|
+
const status = div('position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap', root);
|
|
389
|
+
status.setAttribute('role', 'status');
|
|
390
|
+
status.setAttribute('aria-live', 'polite');
|
|
391
|
+
const say = (m) => { status.textContent = m; };
|
|
392
|
+
// --- model ------------------------------------------------------------------------------------------------------
|
|
393
|
+
const doc = () => history.doc;
|
|
394
|
+
const layer = (id) => doc().layers.find((l) => l.id === id);
|
|
395
|
+
const nameOf = (id) => layer(id)?.name || id;
|
|
396
|
+
const hidden = (id) => {
|
|
397
|
+
for (let l = layer(id), n = 0; l && n < 64; l = l.parent ? layer(l.parent) : undefined, n++)
|
|
398
|
+
if (l.muted)
|
|
399
|
+
return true;
|
|
400
|
+
return false;
|
|
401
|
+
};
|
|
402
|
+
const item = (id) => items.find((i) => i.id === id);
|
|
403
|
+
const box = (id) => {
|
|
404
|
+
const it = item(id), ge = it && readCanvasGeometry(doc(), id, time);
|
|
405
|
+
return ge ? canvasBox(it.base, ge) : undefined;
|
|
406
|
+
};
|
|
407
|
+
const movable = (ids) => ids.filter((id) => !isLayerLocked(doc(), id) && readCanvasGeometry(doc(), id, time));
|
|
408
|
+
const bases = () => Object.fromEntries(items.map((i) => [i.id, i.base]));
|
|
409
|
+
const visibleBoxes = (skip = []) => {
|
|
410
|
+
const out = {};
|
|
411
|
+
for (const i of items)
|
|
412
|
+
if (!skip.includes(i.id) && !hidden(i.id)) {
|
|
413
|
+
const b = box(i.id);
|
|
414
|
+
if (b)
|
|
415
|
+
out[i.id] = b;
|
|
416
|
+
}
|
|
417
|
+
return out;
|
|
418
|
+
};
|
|
419
|
+
const measure = (el) => {
|
|
420
|
+
if (o.measure)
|
|
421
|
+
return o.measure(el);
|
|
422
|
+
let x = 0, y = 0;
|
|
423
|
+
for (let n = el; n && n !== stage; n = n.offsetParent) {
|
|
424
|
+
x += n.offsetLeft;
|
|
425
|
+
y += n.offsetTop;
|
|
426
|
+
}
|
|
427
|
+
return { x, y, width: el.offsetWidth, height: el.offsetHeight };
|
|
428
|
+
};
|
|
429
|
+
const find = (l) => {
|
|
430
|
+
if (l.type !== 'track' || !l.target || l.target === ':scope')
|
|
431
|
+
return null;
|
|
432
|
+
try {
|
|
433
|
+
const el = stage.querySelector(l.target);
|
|
434
|
+
return el && el !== overlay && !overlay.contains(el) ? el : null;
|
|
435
|
+
}
|
|
436
|
+
catch {
|
|
437
|
+
return null;
|
|
438
|
+
}
|
|
439
|
+
};
|
|
440
|
+
const layerAt = (t) => {
|
|
441
|
+
const el = t?.closest?.('[data-canvas-layer]');
|
|
442
|
+
return el ? items.find((i) => i.el === el)?.id : undefined;
|
|
443
|
+
};
|
|
444
|
+
// --- rendering ----------------------------------------------------------------------------------------------------
|
|
445
|
+
function bind() {
|
|
446
|
+
const next = [];
|
|
447
|
+
for (const l of doc().layers) {
|
|
448
|
+
const el = find(l);
|
|
449
|
+
if (!el || next.some((i) => i.el === el))
|
|
450
|
+
continue;
|
|
451
|
+
const old = items.find((i) => i.id === l.id && i.el === el);
|
|
452
|
+
if (old) {
|
|
453
|
+
next.push(old);
|
|
454
|
+
continue;
|
|
455
|
+
}
|
|
456
|
+
next.push({ id: l.id, el, base: measure(el) });
|
|
457
|
+
}
|
|
458
|
+
for (const i of items)
|
|
459
|
+
if (!next.some((n) => n.el === i.el))
|
|
460
|
+
restore(i.el);
|
|
461
|
+
items = next;
|
|
462
|
+
}
|
|
463
|
+
function render() {
|
|
464
|
+
if (dead)
|
|
465
|
+
return;
|
|
466
|
+
bind();
|
|
467
|
+
const n = items.length;
|
|
468
|
+
const keep = selection.filter((id) => item(id));
|
|
469
|
+
if (keep.length !== selection.length)
|
|
470
|
+
setSel(keep, true);
|
|
471
|
+
if (focusId && !item(focusId))
|
|
472
|
+
focusId = undefined;
|
|
473
|
+
items.forEach((it, i) => {
|
|
474
|
+
const l = layer(it.id), el = it.el, ks = l.keyframes || [];
|
|
475
|
+
for (const p of GEO) {
|
|
476
|
+
const v = held(ks, p, time);
|
|
477
|
+
css(el, p, v === undefined ? undefined : String(v));
|
|
478
|
+
}
|
|
479
|
+
css(el, 'visibility', hidden(it.id) ? 'hidden' : undefined);
|
|
480
|
+
css(el, 'z-index', String(n - i));
|
|
481
|
+
attr(el, 'data-canvas-layer', it.id);
|
|
482
|
+
attr(el, 'role', 'option');
|
|
483
|
+
attr(el, 'aria-selected', String(selection.includes(it.id)));
|
|
484
|
+
attr(el, 'tabindex', it.id === (focusId ?? items[0].id) ? '0' : '-1');
|
|
485
|
+
const r = rec(el);
|
|
486
|
+
if (r.a.has('aria-label') ? r.a.get('aria-label') === null : !el.hasAttribute('aria-label'))
|
|
487
|
+
attr(el, 'aria-label', l.name || null);
|
|
488
|
+
const st = [isLayerLocked(doc(), it.id) && 'locked', hidden(it.id) && 'hidden'].filter(Boolean).join(', ');
|
|
489
|
+
attr(el, 'aria-description', st || null);
|
|
490
|
+
});
|
|
491
|
+
draw();
|
|
492
|
+
}
|
|
493
|
+
function draw() {
|
|
494
|
+
overlay.textContent = '';
|
|
495
|
+
const px = (v) => `${v}px`, lw = 1 / zoom;
|
|
496
|
+
const hs = (coarse ? 22 : 12) / zoom;
|
|
497
|
+
const sel = selection.filter((id) => !hidden(id));
|
|
498
|
+
for (const id of sel) {
|
|
499
|
+
const b = box(id);
|
|
500
|
+
if (!b)
|
|
501
|
+
continue;
|
|
502
|
+
const f = div(`position:absolute;left:${px(b.x)};top:${px(b.y)};width:${px(b.width)};height:${px(b.height)};transform:rotate(${b.rotation}deg);outline:${px(lw)} solid #0a84ff;box-sizing:border-box`, overlay);
|
|
503
|
+
f.setAttribute('data-canvas-box', id);
|
|
504
|
+
if (sel.length !== 1 || selection.length !== 1 || isLayerLocked(doc(), id) || (g && g.mode !== 'pending' && g.mode !== 'resize' && g.mode !== 'rotate'))
|
|
505
|
+
continue;
|
|
506
|
+
const h = (name, l, t, cur) => div(`position:absolute;left:${l};top:${t};width:${px(hs)};height:${px(hs)};margin:${px(-hs / 2)} 0 0 ${px(-hs / 2)};box-sizing:border-box;background:#fff;border:${px(lw)} solid #0a84ff;border-radius:${name === 'rotate' ? '50%' : '2px'};pointer-events:auto;touch-action:none;cursor:${cur}`, f).setAttribute('data-canvas-handle', name);
|
|
507
|
+
for (const [name, x, y, c] of HANDLES)
|
|
508
|
+
h(name, `${x}%`, `${y}%`, `${c}-resize`);
|
|
509
|
+
h('rotate', '50%', px(-24 / zoom), 'grab');
|
|
510
|
+
}
|
|
511
|
+
if (g?.rect)
|
|
512
|
+
div(`position:absolute;left:${px(g.rect.x)};top:${px(g.rect.y)};width:${px(g.rect.width)};height:${px(g.rect.height)};border:${px(lw)} dashed #0a84ff;background:rgba(10,132,255,.08);box-sizing:border-box`, overlay).setAttribute('data-canvas-marquee', '');
|
|
513
|
+
if (g?.gx !== undefined)
|
|
514
|
+
div(`position:absolute;left:${px(g.gx)};top:-100000px;width:0;height:200000px;border-left:${px(lw)} solid #ff2d95`, overlay).setAttribute('data-canvas-guide', 'x');
|
|
515
|
+
if (g?.gy !== undefined)
|
|
516
|
+
div(`position:absolute;top:${px(g.gy)};left:-100000px;height:0;width:200000px;border-top:${px(lw)} solid #ff2d95`, overlay).setAttribute('data-canvas-guide', 'y');
|
|
517
|
+
}
|
|
518
|
+
function setSel(ids, quiet = false) {
|
|
519
|
+
const next = [...new Set(ids)].filter((id) => item(id));
|
|
520
|
+
if (next.length === selection.length && next.every((id, i) => id === selection[i]))
|
|
521
|
+
return;
|
|
522
|
+
selection = next;
|
|
523
|
+
for (const it of items)
|
|
524
|
+
attr(it.el, 'aria-selected', String(selection.includes(it.id)));
|
|
525
|
+
if (!quiet)
|
|
526
|
+
say(selection.length ? `${selection.map(nameOf).join(', ')} selected` : 'Selection cleared');
|
|
527
|
+
draw();
|
|
528
|
+
o.onSelect?.(selection.slice());
|
|
529
|
+
}
|
|
530
|
+
function focusLayer(id) {
|
|
531
|
+
const it = id ? item(id) : undefined;
|
|
532
|
+
if (!it)
|
|
533
|
+
return;
|
|
534
|
+
focusId = it.id;
|
|
535
|
+
for (const i of items)
|
|
536
|
+
attr(i.el, 'tabindex', i === it ? '0' : '-1');
|
|
537
|
+
it.el.focus({ preventScroll: true });
|
|
538
|
+
}
|
|
539
|
+
function view() {
|
|
540
|
+
css(stage, 'transform-origin', zoom === 1 && !pan.x && !pan.y ? undefined : '0 0');
|
|
541
|
+
css(stage, 'transform', zoom === 1 && !pan.x && !pan.y ? undefined : `translate(${r2(pan.x)}px, ${r2(pan.y)}px) scale(${zoom})`);
|
|
542
|
+
draw();
|
|
543
|
+
o.onZoom?.(zoom);
|
|
544
|
+
}
|
|
545
|
+
const clampZ = (z) => r4(Math.min(maxZ, Math.max(minZ, z)));
|
|
546
|
+
const toCanvas = (x, y) => {
|
|
547
|
+
const r = stage.getBoundingClientRect();
|
|
548
|
+
return { x: (x - r.left) / zoom, y: (y - r.top) / zoom };
|
|
549
|
+
};
|
|
550
|
+
function edit(label, e, coalesce) {
|
|
551
|
+
if (!e.ops.length)
|
|
552
|
+
return [];
|
|
553
|
+
history.apply(e.doc, { label, coalesce });
|
|
554
|
+
o.onEdit?.({ label, ops: e.ops });
|
|
555
|
+
return e.ops;
|
|
556
|
+
}
|
|
557
|
+
const moved = (ids) => {
|
|
558
|
+
const b = box(ids[0]);
|
|
559
|
+
if (b)
|
|
560
|
+
say(`${ids.map(nameOf).join(', ')} moved to ${Math.round(b.x)}, ${Math.round(b.y)}`);
|
|
561
|
+
};
|
|
562
|
+
// --- pointer ------------------------------------------------------------------------------------------------------
|
|
563
|
+
const onDown = (ev) => {
|
|
564
|
+
const e = ev;
|
|
565
|
+
if (dead || (e.pointerType === 'mouse' && e.button))
|
|
566
|
+
return;
|
|
567
|
+
pointers.set(e.pointerId, { x: e.clientX, y: e.clientY });
|
|
568
|
+
if (!attached)
|
|
569
|
+
attach();
|
|
570
|
+
try {
|
|
571
|
+
root.setPointerCapture?.(e.pointerId);
|
|
572
|
+
}
|
|
573
|
+
catch { /* synthetic events */ }
|
|
574
|
+
if (pointers.size === 2 && e.pointerType === 'touch' && g?.mode !== 'pinch')
|
|
575
|
+
return pinch();
|
|
576
|
+
if (pointers.size > 1)
|
|
577
|
+
return;
|
|
578
|
+
const c0 = { x: e.clientX, y: e.clientY }, p0 = toCanvas(c0.x, c0.y);
|
|
579
|
+
const h = e.target?.closest?.('[data-canvas-handle]');
|
|
580
|
+
const mod = e.shiftKey || e.ctrlKey || e.metaKey;
|
|
581
|
+
if (h && overlay.contains(h) && selection.length === 1) {
|
|
582
|
+
const id = selection[0], b = box(id);
|
|
583
|
+
const name = h.getAttribute('data-canvas-handle');
|
|
584
|
+
g = b ? { mode: name === 'rotate' ? 'rotate' : 'resize', handle: name, c0, p0, id, box: b, start: doc(), label: name === 'rotate' ? 'Rotate' : 'Resize' } : { mode: 'noop', c0, p0 };
|
|
585
|
+
if (b && name !== 'rotate')
|
|
586
|
+
g.lines = snapLines(Object.values(visibleBoxes([id])).map(canvasBounds), guides);
|
|
587
|
+
}
|
|
588
|
+
else {
|
|
589
|
+
const id = layerAt(e.target);
|
|
590
|
+
if (id) {
|
|
591
|
+
const was = selection.includes(id);
|
|
592
|
+
if (!was)
|
|
593
|
+
setSel(mod ? [...selection, id] : [id]);
|
|
594
|
+
focusLayer(id);
|
|
595
|
+
g = { mode: 'pending', c0, p0, id, toggle: mod && was };
|
|
596
|
+
}
|
|
597
|
+
else
|
|
598
|
+
g = { mode: 'marquee-pending', c0, p0, keep: e.shiftKey ? selection.slice() : [] };
|
|
599
|
+
}
|
|
600
|
+
e.preventDefault();
|
|
601
|
+
};
|
|
602
|
+
const onMove = (ev) => {
|
|
603
|
+
const e = ev;
|
|
604
|
+
if (!pointers.has(e.pointerId) || !g)
|
|
605
|
+
return;
|
|
606
|
+
pointers.set(e.pointerId, { x: e.clientX, y: e.clientY });
|
|
607
|
+
if (g.mode === 'pinch')
|
|
608
|
+
return pinchMove();
|
|
609
|
+
if (g.mode === 'noop' || pointers.size > 1)
|
|
610
|
+
return;
|
|
611
|
+
const p = toCanvas(e.clientX, e.clientY);
|
|
612
|
+
let dx = p.x - g.p0.x, dy = p.y - g.p0.y;
|
|
613
|
+
const far = Math.hypot(e.clientX - g.c0.x, e.clientY - g.c0.y) >= 3;
|
|
614
|
+
const th = sn ? sn.threshold / zoom : 0, snapOn = !!sn && !e.altKey, gr = sn?.grid ? grid : 0;
|
|
615
|
+
if (g.mode === 'pending') {
|
|
616
|
+
if (!far)
|
|
617
|
+
return;
|
|
618
|
+
const ids = movable(selection);
|
|
619
|
+
if (!ids.length) {
|
|
620
|
+
g = { ...g, mode: 'noop' };
|
|
621
|
+
return;
|
|
622
|
+
}
|
|
623
|
+
const bx = ids.map((id) => canvasBounds(box(id)));
|
|
624
|
+
const x = Math.min(...bx.map((b) => b.x)), y = Math.min(...bx.map((b) => b.y));
|
|
625
|
+
const others = Object.values(visibleBoxes(selection)).map(canvasBounds);
|
|
626
|
+
g = { ...g, mode: 'move', ids, start: doc(), label: 'Move', bounds: { x, y, width: Math.max(...bx.map((b) => b.x + b.width)) - x, height: Math.max(...bx.map((b) => b.y + b.height)) - y },
|
|
627
|
+
lines: snapLines(sn?.siblings === false ? [] : others, sn?.guides === false ? {} : guides) };
|
|
628
|
+
}
|
|
629
|
+
if (g.mode === 'marquee-pending') {
|
|
630
|
+
if (!far)
|
|
631
|
+
return;
|
|
632
|
+
g.mode = 'marquee';
|
|
633
|
+
}
|
|
634
|
+
g.gx = g.gy = undefined;
|
|
635
|
+
if (g.mode === 'move') {
|
|
636
|
+
if (snapOn) {
|
|
637
|
+
const s = snapRect({ ...g.bounds, x: g.bounds.x + dx, y: g.bounds.y + dy }, g.lines, { threshold: th, grid: gr });
|
|
638
|
+
dx += s.dx;
|
|
639
|
+
dy += s.dy;
|
|
640
|
+
g.gx = s.x;
|
|
641
|
+
g.gy = s.y;
|
|
642
|
+
}
|
|
643
|
+
const ed = canvasMove(g.start, g.ids, time, bases(), dx, dy);
|
|
644
|
+
begin();
|
|
645
|
+
g.ops = ed.ops;
|
|
646
|
+
history.apply(ed.doc);
|
|
647
|
+
draw();
|
|
648
|
+
}
|
|
649
|
+
else if (g.mode === 'marquee') {
|
|
650
|
+
const r = { x: Math.min(g.p0.x, p.x), y: Math.min(g.p0.y, p.y), width: Math.abs(dx), height: Math.abs(dy) };
|
|
651
|
+
g.rect = r;
|
|
652
|
+
setSel([...g.keep, ...marqueeHits(visibleBoxes(), r)], true);
|
|
653
|
+
draw();
|
|
654
|
+
}
|
|
655
|
+
else if (g.mode === 'resize' || g.mode === 'rotate') {
|
|
656
|
+
const b0 = g.box;
|
|
657
|
+
let nb;
|
|
658
|
+
if (g.mode === 'rotate')
|
|
659
|
+
nb = { rotation: rotationFromPointer(b0, g.p0, p, b0.rotation, e.shiftKey ? 15 : 0) };
|
|
660
|
+
else {
|
|
661
|
+
const r = resizeBox(b0, g.handle, dx, dy, { keepAspect: e.shiftKey });
|
|
662
|
+
if (snapOn && !e.shiftKey && !(b0.rotation % 360)) {
|
|
663
|
+
const se = (v, ls) => { const s = snapValue(v, ls, th); return s.line !== undefined ? s : { value: snapToGrid(v, gr) }; };
|
|
664
|
+
const hx = g.handle.includes('e') ? 1 : g.handle.includes('w') ? -1 : 0, hy = g.handle.includes('s') ? 1 : g.handle.includes('n') ? -1 : 0;
|
|
665
|
+
if (hx > 0) {
|
|
666
|
+
const s = se(r.x + r.width, g.lines.x);
|
|
667
|
+
r.width = Math.max(1, s.value - r.x);
|
|
668
|
+
g.gx = s.line;
|
|
669
|
+
}
|
|
670
|
+
if (hx < 0) {
|
|
671
|
+
const s = se(r.x, g.lines.x);
|
|
672
|
+
r.width = Math.max(1, r.x + r.width - s.value);
|
|
673
|
+
r.x = s.value;
|
|
674
|
+
g.gx = s.line;
|
|
675
|
+
}
|
|
676
|
+
if (hy > 0) {
|
|
677
|
+
const s = se(r.y + r.height, g.lines.y);
|
|
678
|
+
r.height = Math.max(1, s.value - r.y);
|
|
679
|
+
g.gy = s.line;
|
|
680
|
+
}
|
|
681
|
+
if (hy < 0) {
|
|
682
|
+
const s = se(r.y, g.lines.y);
|
|
683
|
+
r.height = Math.max(1, r.y + r.height - s.value);
|
|
684
|
+
r.y = s.value;
|
|
685
|
+
g.gy = s.line;
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
nb = r;
|
|
689
|
+
}
|
|
690
|
+
const ed = canvasSetBox(g.start, g.id, time, item(g.id).base, nb);
|
|
691
|
+
begin();
|
|
692
|
+
g.ops = ed.ops;
|
|
693
|
+
history.apply(ed.doc);
|
|
694
|
+
draw();
|
|
695
|
+
}
|
|
696
|
+
};
|
|
697
|
+
const begin = () => {
|
|
698
|
+
if (g && !g.began) {
|
|
699
|
+
history.begin(g.label);
|
|
700
|
+
g.began = true;
|
|
701
|
+
}
|
|
702
|
+
};
|
|
703
|
+
const end = (commit) => {
|
|
704
|
+
const cur = g;
|
|
705
|
+
g = null;
|
|
706
|
+
if (cur?.began) {
|
|
707
|
+
if (commit) {
|
|
708
|
+
history.commit();
|
|
709
|
+
if (cur.ops?.length) {
|
|
710
|
+
o.onEdit?.({ label: cur.label, ops: cur.ops });
|
|
711
|
+
if (cur.mode === 'move')
|
|
712
|
+
moved(cur.ids);
|
|
713
|
+
else
|
|
714
|
+
say(`${nameOf(cur.id)} ${cur.mode === 'rotate' ? 'rotated' : 'resized'}`);
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
else
|
|
718
|
+
history.cancel();
|
|
719
|
+
}
|
|
720
|
+
if (cur?.mode === 'marquee' && selection.length)
|
|
721
|
+
say(`${selection.map(nameOf).join(', ')} selected`);
|
|
722
|
+
draw();
|
|
723
|
+
};
|
|
724
|
+
const onUp = (ev) => {
|
|
725
|
+
const e = ev;
|
|
726
|
+
if (!pointers.has(e.pointerId))
|
|
727
|
+
return;
|
|
728
|
+
pointers.delete(e.pointerId);
|
|
729
|
+
const cur = g;
|
|
730
|
+
if (cur?.mode === 'pinch') {
|
|
731
|
+
if (pointers.size)
|
|
732
|
+
g = { mode: 'noop', c0: cur.c0, p0: cur.p0 };
|
|
733
|
+
else
|
|
734
|
+
g = null;
|
|
735
|
+
}
|
|
736
|
+
else if (cur && !pointers.size) {
|
|
737
|
+
if (cur.mode === 'pending') {
|
|
738
|
+
if (cur.toggle)
|
|
739
|
+
setSel(selection.filter((id) => id !== cur.id));
|
|
740
|
+
else if (!(e.shiftKey || e.ctrlKey || e.metaKey) && selection.length > 1)
|
|
741
|
+
setSel([cur.id]);
|
|
742
|
+
}
|
|
743
|
+
else if (cur.mode === 'marquee-pending' && !e.shiftKey)
|
|
744
|
+
setSel([]);
|
|
745
|
+
end(true);
|
|
746
|
+
}
|
|
747
|
+
if (!pointers.size)
|
|
748
|
+
detach();
|
|
749
|
+
};
|
|
750
|
+
const onCancel = (ev) => {
|
|
751
|
+
const e = ev;
|
|
752
|
+
if (!pointers.has(e.pointerId))
|
|
753
|
+
return;
|
|
754
|
+
pointers.delete(e.pointerId);
|
|
755
|
+
if (g?.mode !== 'pinch' || !pointers.size)
|
|
756
|
+
end(false);
|
|
757
|
+
if (!pointers.size)
|
|
758
|
+
detach();
|
|
759
|
+
};
|
|
760
|
+
function pinch() {
|
|
761
|
+
if (g?.began)
|
|
762
|
+
history.cancel();
|
|
763
|
+
const [a, b] = [...pointers.values()];
|
|
764
|
+
const m0 = { x: (a.x + b.x) / 2, y: (a.y + b.y) / 2 };
|
|
765
|
+
g = { mode: 'pinch', c0: m0, p0: m0, d0: Math.hypot(a.x - b.x, a.y - b.y) || 1, z0: zoom, m0, pan0: { ...pan }, P: toCanvas(m0.x, m0.y) };
|
|
766
|
+
draw();
|
|
767
|
+
}
|
|
768
|
+
function pinchMove() {
|
|
769
|
+
const [a, b] = [...pointers.values()];
|
|
770
|
+
if (!a || !b || !g)
|
|
771
|
+
return;
|
|
772
|
+
const m = { x: (a.x + b.x) / 2, y: (a.y + b.y) / 2 };
|
|
773
|
+
zoom = clampZ((g.z0 * Math.hypot(a.x - b.x, a.y - b.y)) / g.d0);
|
|
774
|
+
pan = { x: g.pan0.x + m.x - g.m0.x + g.P.x * (g.z0 - zoom), y: g.pan0.y + m.y - g.m0.y + g.P.y * (g.z0 - zoom) };
|
|
775
|
+
view();
|
|
776
|
+
}
|
|
777
|
+
const onWheel = (ev) => {
|
|
778
|
+
const e = ev;
|
|
779
|
+
if (!(e.ctrlKey || e.metaKey))
|
|
780
|
+
return;
|
|
781
|
+
e.preventDefault();
|
|
782
|
+
api.setZoom(zoom * Math.exp(-e.deltaY * 0.01), { x: e.clientX, y: e.clientY });
|
|
783
|
+
};
|
|
784
|
+
function attach() {
|
|
785
|
+
attached = true;
|
|
786
|
+
root.addEventListener('pointermove', onMove);
|
|
787
|
+
root.addEventListener('pointerup', onUp);
|
|
788
|
+
root.addEventListener('pointercancel', onCancel);
|
|
789
|
+
}
|
|
790
|
+
function detach() {
|
|
791
|
+
attached = false;
|
|
792
|
+
root.removeEventListener('pointermove', onMove);
|
|
793
|
+
root.removeEventListener('pointerup', onUp);
|
|
794
|
+
root.removeEventListener('pointercancel', onCancel);
|
|
795
|
+
}
|
|
796
|
+
// --- keyboard -----------------------------------------------------------------------------------------------------
|
|
797
|
+
const onKey = (ev) => {
|
|
798
|
+
const e = ev;
|
|
799
|
+
const t = e.target;
|
|
800
|
+
if (dead || (t && (t.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName || ''))))
|
|
801
|
+
return;
|
|
802
|
+
const mod = e.ctrlKey || e.metaKey, k = e.key, code = e.code;
|
|
803
|
+
const ids = items.map((i) => i.id);
|
|
804
|
+
const cur = layerAt(t) ?? focusId;
|
|
805
|
+
const done = () => e.preventDefault();
|
|
806
|
+
if (k === 'Escape') {
|
|
807
|
+
if (g?.began)
|
|
808
|
+
end(false);
|
|
809
|
+
else
|
|
810
|
+
setSel([]);
|
|
811
|
+
return done();
|
|
812
|
+
}
|
|
813
|
+
if (mod && !e.altKey) {
|
|
814
|
+
if (k.toLowerCase() === 'a' && !e.shiftKey) {
|
|
815
|
+
setSel(ids.filter((id) => !hidden(id)));
|
|
816
|
+
return done();
|
|
817
|
+
}
|
|
818
|
+
const br = code === 'BracketRight' || k === ']' || k === '}' ? 1 : code === 'BracketLeft' || k === '[' || k === '{' ? -1 : 0;
|
|
819
|
+
if (br && selection.length) {
|
|
820
|
+
const to = e.shiftKey ? (br > 0 ? 'front' : 'back') : br > 0 ? 'forward' : 'backward';
|
|
821
|
+
let d = doc();
|
|
822
|
+
const ops = [];
|
|
823
|
+
for (const id of br > 0 ? selection : [...selection].reverse()) {
|
|
824
|
+
const r = canvasReorder(d, id, to);
|
|
825
|
+
d = r.doc;
|
|
826
|
+
ops.push(...r.ops);
|
|
827
|
+
}
|
|
828
|
+
if (edit('Reorder', { doc: d, ops }).length)
|
|
829
|
+
say(`${selection.map(nameOf).join(', ')} moved ${to}`);
|
|
830
|
+
return done();
|
|
831
|
+
}
|
|
832
|
+
if (e.shiftKey && (code === 'KeyL' || k.toLowerCase() === 'l') && selection.length) {
|
|
833
|
+
const v = !selection.every((id) => layer(id)?.locked);
|
|
834
|
+
api.lock(selection, v);
|
|
835
|
+
return done();
|
|
836
|
+
}
|
|
837
|
+
if (e.shiftKey && (code === 'KeyH' || k.toLowerCase() === 'h') && selection.length) {
|
|
838
|
+
api.hide(selection, !selection.every((id) => layer(id)?.muted));
|
|
839
|
+
return done();
|
|
840
|
+
}
|
|
841
|
+
return;
|
|
842
|
+
}
|
|
843
|
+
const at = cur ? ids.indexOf(cur) : -1;
|
|
844
|
+
const go = (i, sel) => {
|
|
845
|
+
const id = ids[Math.max(0, Math.min(ids.length - 1, i))];
|
|
846
|
+
if (id === undefined)
|
|
847
|
+
return;
|
|
848
|
+
focusLayer(id);
|
|
849
|
+
if (sel)
|
|
850
|
+
setSel(e.shiftKey ? [...selection, id] : [id]);
|
|
851
|
+
else
|
|
852
|
+
say(`${nameOf(id)}${selection.includes(id) ? ', selected' : ''}`);
|
|
853
|
+
};
|
|
854
|
+
if (ARROWS[k]) {
|
|
855
|
+
const [x, y] = ARROWS[k];
|
|
856
|
+
if (e.altKey || !selection.length) {
|
|
857
|
+
go(at + (x + y > 0 ? 1 : -1), e.altKey);
|
|
858
|
+
return done();
|
|
859
|
+
}
|
|
860
|
+
const s = e.shiftKey ? 10 : 1;
|
|
861
|
+
const ids2 = movable(selection);
|
|
862
|
+
if (edit('Nudge', canvasMove(doc(), ids2, time, bases(), x * s, y * s), 'nudge').length)
|
|
863
|
+
moved(ids2);
|
|
864
|
+
return done();
|
|
865
|
+
}
|
|
866
|
+
if (k === 'Home' || k === 'End') {
|
|
867
|
+
go(k === 'Home' ? 0 : ids.length - 1, true);
|
|
868
|
+
return done();
|
|
869
|
+
}
|
|
870
|
+
if ((k === ' ' || code === 'Space') && cur) {
|
|
871
|
+
api.select([cur], { toggle: true });
|
|
872
|
+
return done();
|
|
873
|
+
}
|
|
874
|
+
if (k === 'Enter' && cur) {
|
|
875
|
+
setSel([cur]);
|
|
876
|
+
return done();
|
|
877
|
+
}
|
|
878
|
+
};
|
|
879
|
+
const unKeys = bindHistoryKeys(root, history);
|
|
880
|
+
root.addEventListener('pointerdown', onDown);
|
|
881
|
+
root.addEventListener('keydown', onKey);
|
|
882
|
+
root.addEventListener('wheel', onWheel, { passive: false });
|
|
883
|
+
const unsub = history.subscribe(render);
|
|
884
|
+
if (o.zoom && o.zoom !== 1) {
|
|
885
|
+
zoom = clampZ(o.zoom);
|
|
886
|
+
view();
|
|
887
|
+
}
|
|
888
|
+
render();
|
|
889
|
+
const api = {
|
|
890
|
+
root,
|
|
891
|
+
get selection() { return selection.slice(); },
|
|
892
|
+
get focused() { return focusId; },
|
|
893
|
+
get zoom() { return zoom; },
|
|
894
|
+
layers: () => items.map((i) => i.id),
|
|
895
|
+
getBox: (id) => box(id),
|
|
896
|
+
select(ids, s = {}) {
|
|
897
|
+
if (s.toggle) {
|
|
898
|
+
const set = new Set(selection);
|
|
899
|
+
for (const id of ids)
|
|
900
|
+
set.has(id) ? set.delete(id) : set.add(id);
|
|
901
|
+
setSel([...set]);
|
|
902
|
+
}
|
|
903
|
+
else
|
|
904
|
+
setSel(s.add ? [...selection, ...ids] : ids);
|
|
905
|
+
},
|
|
906
|
+
selectAll: () => setSel(items.map((i) => i.id).filter((id) => !hidden(id))),
|
|
907
|
+
clearSelection: () => setSel([]),
|
|
908
|
+
focus: (id) => focusLayer(id),
|
|
909
|
+
move(dx, dy, ids = selection) {
|
|
910
|
+
const m = movable(ids), ops = edit('Move', canvasMove(doc(), m, time, bases(), dx, dy));
|
|
911
|
+
if (ops.length)
|
|
912
|
+
moved(m);
|
|
913
|
+
return ops;
|
|
914
|
+
},
|
|
915
|
+
setBox(id, b) {
|
|
916
|
+
const it = item(id);
|
|
917
|
+
return it ? edit('Transform', canvasSetBox(doc(), id, time, it.base, b)) : [];
|
|
918
|
+
},
|
|
919
|
+
reorder: (id, to) => edit('Reorder', canvasReorder(doc(), id, to)),
|
|
920
|
+
lock(ids = selection, v = true) {
|
|
921
|
+
const ops = edit(v ? 'Lock' : 'Unlock', canvasSetLocked(doc(), ids, v));
|
|
922
|
+
if (ops.length)
|
|
923
|
+
say(`${ids.map(nameOf).join(', ')} ${v ? 'locked' : 'unlocked'}`);
|
|
924
|
+
return ops;
|
|
925
|
+
},
|
|
926
|
+
hide(ids = selection, v = true) {
|
|
927
|
+
const ops = edit(v ? 'Hide' : 'Show', canvasSetHidden(doc(), ids, v));
|
|
928
|
+
if (ops.length)
|
|
929
|
+
say(`${ids.map(nameOf).join(', ')} ${v ? 'hidden' : 'shown'}`);
|
|
930
|
+
return ops;
|
|
931
|
+
},
|
|
932
|
+
setTime(ms) { time = Math.max(0, ms); render(); },
|
|
933
|
+
setZoom(z, origin) {
|
|
934
|
+
const nz = clampZ(z);
|
|
935
|
+
if (origin) {
|
|
936
|
+
const P = toCanvas(origin.x, origin.y);
|
|
937
|
+
pan = { x: pan.x + P.x * (zoom - nz), y: pan.y + P.y * (zoom - nz) };
|
|
938
|
+
}
|
|
939
|
+
zoom = nz;
|
|
940
|
+
view();
|
|
941
|
+
},
|
|
942
|
+
setGrid(px) { grid = Math.max(0, px || 0); },
|
|
943
|
+
setGuides(gd) { guides = gd || {}; },
|
|
944
|
+
refresh() {
|
|
945
|
+
for (const it of items) {
|
|
946
|
+
for (const p of ['translate', 'rotate', 'width', 'height'])
|
|
947
|
+
css(it.el, p, undefined);
|
|
948
|
+
it.base = measure(it.el);
|
|
949
|
+
}
|
|
950
|
+
render();
|
|
951
|
+
},
|
|
952
|
+
destroy() {
|
|
953
|
+
if (dead)
|
|
954
|
+
return;
|
|
955
|
+
if (g?.began)
|
|
956
|
+
history.cancel();
|
|
957
|
+
g = null;
|
|
958
|
+
pointers.clear();
|
|
959
|
+
detach();
|
|
960
|
+
dead = true;
|
|
961
|
+
unsub();
|
|
962
|
+
unKeys();
|
|
963
|
+
root.removeEventListener('pointerdown', onDown);
|
|
964
|
+
root.removeEventListener('keydown', onKey);
|
|
965
|
+
root.removeEventListener('wheel', onWheel, { passive: false });
|
|
966
|
+
overlay.remove();
|
|
967
|
+
status.remove();
|
|
968
|
+
for (const el of [...saved.keys()])
|
|
969
|
+
restore(el);
|
|
970
|
+
items = [];
|
|
971
|
+
selection = [];
|
|
972
|
+
},
|
|
973
|
+
};
|
|
974
|
+
return api;
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
export { STUDIO_CANVAS_VERSION, applyCanvasOps, canvasBounds, canvasBox, canvasMove, canvasReorder, canvasSetBox, canvasSetHidden, canvasSetLocked, createStudioCanvas, marqueeHits, readCanvasGeometry, rectsIntersect, resizeBox, rotationFromPointer, snapLines, snapRect, snapToGrid, snapValue };
|
|
978
|
+
//# sourceMappingURL=https://raw.githubusercontent.com/HarrisonCN/Motionary/v14.4.0/dist/components/studio-canvas.js.map
|