motion-v 0.2.6 → 0.3.1-beta.1
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/dist/cjs/index.js +5858 -0
- package/dist/es/animation/use-animate.mjs +31 -0
- package/dist/es/components/AnimatePresence.vue.mjs +71 -0
- package/dist/es/components/AnimatePresence.vue2.mjs +4 -0
- package/dist/es/components/Motion.vue.mjs +116 -0
- package/dist/es/components/Motion.vue2.mjs +4 -0
- package/dist/es/components/Primitive.mjs +29 -0
- package/dist/es/components/Slot.mjs +36 -0
- package/dist/es/components/context.mjs +6 -0
- package/dist/es/components/presence.mjs +16 -0
- package/dist/es/components/renderSlotFragments.mjs +13 -0
- package/dist/es/constants/index.mjs +20 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/GroupPlaybackControls.mjs +76 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animate/index.mjs +27 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animate/resolve-subjects.mjs +16 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animate/sequence.mjs +14 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animate/single-value.mjs +11 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animate/subject.mjs +38 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/AcceleratedAnimation.mjs +243 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/BaseAnimation.mjs +95 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/MainThreadAnimation.mjs +275 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/drivers/driver-frameloop.mjs +17 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/utils/accelerated-values.mjs +12 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/utils/can-animate.mjs +30 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/waapi/NativeAnimation.mjs +162 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs +31 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs +13 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/waapi/easing.mjs +37 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/waapi/index.mjs +20 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/waapi/utils/attach-timeline.mjs +7 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/waapi/utils/get-final-keyframe.mjs +9 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/waapi/utils/linear.mjs +13 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/waapi/utils/memo-supports.mjs +12 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/waapi/utils/style.mjs +10 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/waapi/utils/supports-flags.mjs +6 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/waapi/utils/supports-linear-easing.mjs +12 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/waapi/utils/supports-partial-keyframes.mjs +12 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/waapi/utils/supports-waapi.mjs +5 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/generators/inertia.mjs +67 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/generators/keyframes.mjs +37 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/generators/spring/find.mjs +83 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/generators/spring/index.mjs +83 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/generators/utils/calc-duration.mjs +15 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/generators/utils/is-generator.mjs +6 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/generators/utils/velocity.mjs +9 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/interfaces/motion-value.mjs +73 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs +59 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/optimized-appear/data-id.mjs +7 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/optimized-appear/get-appear-id.mjs +7 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/sequence/create.mjs +153 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs +15 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/sequence/utils/edit.mjs +26 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/sequence/utils/sort.mjs +14 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/utils/create-visual-element.mjs +43 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/utils/default-transitions.mjs +33 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/utils/get-value-transition.mjs +6 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/utils/is-animatable.mjs +16 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/utils/is-animation-controls.mjs +6 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs +6 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/utils/is-keyframes-target.mjs +6 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/utils/is-none.mjs +13 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/utils/is-transition-defined.mjs +6 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/utils/stagger.mjs +26 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/anticipate.mjs +5 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/back.mjs +11 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/circ.mjs +10 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/cubic-bezier.mjs +28 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/ease.mjs +9 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/modifiers/mirror.mjs +4 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/modifiers/reverse.mjs +4 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/steps.mjs +12 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/utils/create-generator-easing.mjs +14 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/utils/get-easing-for-segment.mjs +8 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/utils/is-bezier-definition.mjs +4 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/utils/is-easing-array.mjs +6 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/utils/map.mjs +35 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/frameloop/batcher.mjs +75 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/frameloop/frame.mjs +9 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/frameloop/index-legacy.mjs +11 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/frameloop/render-step.mjs +63 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/frameloop/sync-time.mjs +21 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/motion/features/definitions.mjs +29 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/motion/utils/is-forced-motion-value.mjs +8 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/projection/geometry/conversion.mjs +22 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/projection/geometry/models.mjs +9 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/projection/styles/scale-correction.mjs +4 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/projection/utils/measure.mjs +7 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/VisualElement.mjs +372 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/DOMKeyframesResolver.mjs +101 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/DOMVisualElement.mjs +21 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/resize/handle-element.mjs +62 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/resize/handle-window.mjs +31 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/resize/index.mjs +8 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/scroll/index.mjs +63 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/scroll/info.mjs +51 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/scroll/observe.mjs +18 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs +33 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs +38 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs +36 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs +23 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs +21 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs +39 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/scroll/supports.mjs +5 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/scroll/track.mjs +67 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/utils/camel-to-dash.mjs +4 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/utils/css-variables-conversion.mjs +31 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/utils/is-css-variable.mjs +14 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/utils/is-svg-element.mjs +6 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/utils/resolve-element.mjs +23 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/utils/unit-conversion.mjs +65 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/value-types/animatable-none.mjs +12 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/value-types/defaults.mjs +25 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/value-types/dimensions.mjs +10 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/value-types/find.mjs +9 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/value-types/get-as-type.mjs +6 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/value-types/number-browser.mjs +41 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/value-types/number.mjs +18 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/value-types/test.mjs +4 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/value-types/transform.mjs +31 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/value-types/type-auto.mjs +7 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/value-types/type-int.mjs +8 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/viewport/index.mjs +37 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/html/HTMLVisualElement.mjs +55 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/html/utils/build-styles.mjs +42 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/html/utils/build-transform.mjs +47 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/html/utils/make-none-animatable.mjs +22 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/html/utils/render.mjs +9 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/html/utils/scrape-motion-values.mjs +16 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/html/utils/transform.mjs +24 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/object/ObjectVisualElement.mjs +41 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/store.mjs +4 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/svg/SVGVisualElement.mjs +45 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/svg/utils/build-attrs.mjs +46 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/svg/utils/camel-case-attrs.mjs +28 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/svg/utils/is-svg-tag.mjs +4 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/svg/utils/path.mjs +20 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/svg/utils/render.mjs +12 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/svg/utils/scrape-motion-values.mjs +16 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/svg/utils/transform-origin.mjs +12 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/utils/KeyframesResolver.mjs +134 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/utils/is-controlling-variants.mjs +13 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/utils/is-variant-label.mjs +6 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/utils/motion-values.mjs +37 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/utils/resolve-dynamic-variants.mjs +8 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/utils/resolve-variants.mjs +25 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/utils/setters.mjs +22 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/utils/variant-props.mjs +14 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/GlobalConfig.mjs +7 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/array.mjs +13 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/clamp.mjs +10 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/delay.mjs +22 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/distance.mjs +10 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/errors.mjs +19 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/hsla-to-rgba.mjs +39 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/interpolate.mjs +49 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/is-browser.mjs +4 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/is-numerical-string.mjs +4 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/is-zero-value-string.mjs +4 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/memo.mjs +11 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/mix/color.mjs +44 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/mix/complex.mjs +84 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/mix/immediate.mjs +6 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/mix/index.mjs +12 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/mix/number.mjs +6 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/mix/visibility.mjs +12 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/noop.mjs +4 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/offsets/default.mjs +9 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/offsets/fill.mjs +12 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/offsets/time.mjs +6 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/pipe.mjs +5 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/progress.mjs +7 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/reduced-motion/index.mjs +18 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/reduced-motion/state.mjs +6 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/resolve-value.mjs +7 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/subscription-manager.mjs +32 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/time-conversion.mjs +6 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/transform.mjs +21 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/velocity-per-second.mjs +6 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/warn-once.mjs +10 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/wrap.mjs +7 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/index.mjs +282 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/types/color/hex.mjs +37 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/types/color/hsla.mjs +14 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/types/color/index.mjs +21 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/types/color/rgba.mjs +18 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/types/color/utils.mjs +21 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/types/complex/filter.mjs +27 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/types/complex/index.mjs +84 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/types/numbers/index.mjs +19 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/types/numbers/units.mjs +23 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/types/utils/color-regex.mjs +4 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/types/utils/float-regex.mjs +4 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/types/utils/is-nullish.mjs +6 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/types/utils/sanitize.mjs +4 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/types/utils/single-color-regex.mjs +4 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/use-will-change/add-will-change.mjs +10 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/use-will-change/is.mjs +7 -0
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/utils/is-motion-value.mjs +4 -0
- package/dist/es/external/.pnpm/hey-listen@1.0.8/external/hey-listen/dist/hey-listen.es.mjs +20 -0
- package/dist/es/features/events.mjs +69 -0
- package/dist/es/features/feature-manager.mjs +29 -0
- package/dist/es/features/feature.mjs +10 -0
- package/dist/es/features/gestures/base.mjs +19 -0
- package/dist/es/features/gestures/hover.mjs +42 -0
- package/dist/es/features/gestures/in-view.mjs +35 -0
- package/dist/es/features/gestures/press.mjs +37 -0
- package/dist/es/features/svg.mjs +31 -0
- package/dist/es/index.mjs +104 -0
- package/dist/es/state/event.mjs +6 -0
- package/dist/es/state/motion-state.mjs +175 -0
- package/dist/es/state/schedule.mjs +30 -0
- package/dist/es/state/style.mjs +117 -0
- package/dist/es/state/transform.mjs +68 -0
- package/dist/es/state/utils.mjs +119 -0
- package/dist/es/utils/createContext.mjs +25 -0
- package/dist/es/utils/events.mjs +8 -0
- package/dist/es/utils/motion-value.mjs +6 -0
- package/dist/es/utils/use-animation-frame.mjs +20 -0
- package/dist/es/utils/use-in-view.mjs +25 -0
- package/dist/es/value/use-combine-values.mjs +27 -0
- package/dist/es/value/use-computed.mjs +20 -0
- package/dist/es/value/use-motion-template.mjs +22 -0
- package/dist/es/value/use-scroll.mjs +56 -0
- package/dist/es/value/use-spring.mjs +59 -0
- package/dist/es/value/use-time.mjs +10 -0
- package/dist/es/value/use-transform.mjs +29 -0
- package/dist/src/animation/index.d.ts +1 -0
- package/dist/src/animation/use-animate.d.ts +8 -0
- package/dist/src/components/Motion.d.ts +3 -3
- package/dist/src/features/events.d.ts +1 -1
- package/dist/src/features/feature-manager.d.ts +9 -0
- package/dist/src/features/feature.d.ts +0 -7
- package/dist/src/features/index.d.ts +2 -1
- package/dist/src/index.d.ts +3 -0
- package/dist/src/state/motion-state.d.ts +1 -1
- package/dist/src/state/utils.d.ts +1 -1
- package/dist/src/types/state.d.ts +3 -2
- package/dist/src/utils/index.d.ts +2 -0
- package/dist/src/utils/use-dom-ref.d.ts +1 -0
- package/dist/src/utils/use-in-view.d.ts +3 -0
- package/package.json +8 -7
- package/dist/index.js +0 -4011
- package/dist/index.umd.cjs +0 -1
- package/dist/src/components/usePrimitiveElement.d.ts +0 -5
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Feature } from "./feature.mjs";
|
|
2
|
+
class EventFeature extends Feature {
|
|
3
|
+
constructor() {
|
|
4
|
+
super(...arguments);
|
|
5
|
+
this.handlers = {};
|
|
6
|
+
}
|
|
7
|
+
mount() {
|
|
8
|
+
const element = this.state.getElement();
|
|
9
|
+
if (!element)
|
|
10
|
+
return;
|
|
11
|
+
this.handlers.motionstart = (event) => {
|
|
12
|
+
var _a, _b;
|
|
13
|
+
const target = event.detail.target;
|
|
14
|
+
(_b = (_a = this.state.getOptions()).onMotionStart) == null ? void 0 : _b.call(_a, target);
|
|
15
|
+
};
|
|
16
|
+
this.handlers.motioncomplete = (event) => {
|
|
17
|
+
var _a, _b;
|
|
18
|
+
const target = event.detail.target;
|
|
19
|
+
(_b = (_a = this.state.getOptions()).onMotionComplete) == null ? void 0 : _b.call(_a, target);
|
|
20
|
+
};
|
|
21
|
+
this.handlers.hoverstart = (event) => {
|
|
22
|
+
var _a, _b;
|
|
23
|
+
const e = event.detail;
|
|
24
|
+
(_b = (_a = this.state.getOptions()).onHoverStart) == null ? void 0 : _b.call(_a, e);
|
|
25
|
+
};
|
|
26
|
+
this.handlers.hoverend = (event) => {
|
|
27
|
+
var _a, _b;
|
|
28
|
+
const e = event.detail;
|
|
29
|
+
(_b = (_a = this.state.getOptions()).onHoverEnd) == null ? void 0 : _b.call(_a, e);
|
|
30
|
+
};
|
|
31
|
+
this.handlers.pressstart = (event) => {
|
|
32
|
+
var _a, _b;
|
|
33
|
+
const e = event.detail;
|
|
34
|
+
(_b = (_a = this.state.getOptions()).onPressStart) == null ? void 0 : _b.call(_a, e);
|
|
35
|
+
};
|
|
36
|
+
this.handlers.pressend = (event) => {
|
|
37
|
+
var _a, _b;
|
|
38
|
+
const e = event.detail;
|
|
39
|
+
(_b = (_a = this.state.getOptions()).onPressEnd) == null ? void 0 : _b.call(_a, e);
|
|
40
|
+
};
|
|
41
|
+
this.handlers.viewenter = (event) => {
|
|
42
|
+
var _a, _b;
|
|
43
|
+
const target = event.detail.target;
|
|
44
|
+
(_b = (_a = this.state.getOptions()).onViewEnter) == null ? void 0 : _b.call(_a, target);
|
|
45
|
+
};
|
|
46
|
+
this.handlers.viewleave = (event) => {
|
|
47
|
+
var _a, _b;
|
|
48
|
+
const target = event.detail.target;
|
|
49
|
+
(_b = (_a = this.state.getOptions()).onViewLeave) == null ? void 0 : _b.call(_a, target);
|
|
50
|
+
};
|
|
51
|
+
Object.entries(this.handlers).forEach(([event, handler]) => {
|
|
52
|
+
element.addEventListener(event, handler);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
unmount() {
|
|
56
|
+
const element = this.state.getElement();
|
|
57
|
+
if (!element)
|
|
58
|
+
return;
|
|
59
|
+
Object.entries(this.handlers).forEach(([event, handler]) => {
|
|
60
|
+
if (handler) {
|
|
61
|
+
element.removeEventListener(event, handler);
|
|
62
|
+
delete this.handlers[event];
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
export {
|
|
68
|
+
EventFeature
|
|
69
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { EventFeature } from "./events.mjs";
|
|
2
|
+
import { SVGFeature } from "./svg.mjs";
|
|
3
|
+
import { HoverGesture } from "./gestures/hover.mjs";
|
|
4
|
+
import { PressGesture } from "./gestures/press.mjs";
|
|
5
|
+
import { InViewGesture } from "./gestures/in-view.mjs";
|
|
6
|
+
class FeatureManager {
|
|
7
|
+
constructor(state) {
|
|
8
|
+
this.features = [];
|
|
9
|
+
this.features = [
|
|
10
|
+
new HoverGesture(state),
|
|
11
|
+
new PressGesture(state),
|
|
12
|
+
new InViewGesture(state),
|
|
13
|
+
new SVGFeature(state),
|
|
14
|
+
new EventFeature(state)
|
|
15
|
+
];
|
|
16
|
+
}
|
|
17
|
+
mount() {
|
|
18
|
+
this.features.forEach((feature) => feature.mount());
|
|
19
|
+
}
|
|
20
|
+
unmount() {
|
|
21
|
+
this.features.forEach((feature) => feature.unmount());
|
|
22
|
+
}
|
|
23
|
+
update() {
|
|
24
|
+
this.features.forEach((feature) => feature.update());
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
FeatureManager
|
|
29
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Feature } from "../feature.mjs";
|
|
2
|
+
class BaseGesture extends Feature {
|
|
3
|
+
updateGestureSubscriptions() {
|
|
4
|
+
const isActive = this.isActive();
|
|
5
|
+
if (isActive && !this.removeGestureSubscriptions) {
|
|
6
|
+
this.removeGestureSubscriptions = this.subscribeEvents();
|
|
7
|
+
} else if (!isActive && this.removeGestureSubscriptions) {
|
|
8
|
+
this.removeGestureSubscriptions();
|
|
9
|
+
this.removeGestureSubscriptions = void 0;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
unmount() {
|
|
13
|
+
var _a;
|
|
14
|
+
(_a = this.removeGestureSubscriptions) == null ? void 0 : _a.call(this);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
BaseGesture
|
|
19
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { dispatchPointerEvent } from "../../utils/events.mjs";
|
|
2
|
+
import { BaseGesture } from "./base.mjs";
|
|
3
|
+
function mouseEvent(element, name, action) {
|
|
4
|
+
return (event) => {
|
|
5
|
+
if (event.pointerType && event.pointerType !== "mouse")
|
|
6
|
+
return;
|
|
7
|
+
action();
|
|
8
|
+
dispatchPointerEvent(element, name, event);
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
class HoverGesture extends BaseGesture {
|
|
12
|
+
isActive() {
|
|
13
|
+
return Boolean(this.state.getOptions().hover);
|
|
14
|
+
}
|
|
15
|
+
constructor(state) {
|
|
16
|
+
super(state);
|
|
17
|
+
this.subscribeEvents = () => {
|
|
18
|
+
const element = this.state.getElement();
|
|
19
|
+
const onEnter = mouseEvent(element, "hoverstart", () => {
|
|
20
|
+
this.state.setActive("hover", true);
|
|
21
|
+
});
|
|
22
|
+
const onLeave = mouseEvent(element, "hoverend", () => {
|
|
23
|
+
this.state.setActive("hover", false);
|
|
24
|
+
});
|
|
25
|
+
element.addEventListener("pointerenter", onEnter);
|
|
26
|
+
element.addEventListener("pointerleave", onLeave);
|
|
27
|
+
return () => {
|
|
28
|
+
element.removeEventListener("pointerenter", onEnter);
|
|
29
|
+
element.removeEventListener("pointerleave", onLeave);
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
mount() {
|
|
34
|
+
this.updateGestureSubscriptions();
|
|
35
|
+
}
|
|
36
|
+
update() {
|
|
37
|
+
this.updateGestureSubscriptions();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
HoverGesture
|
|
42
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { dispatchPointerEvent } from "../../utils/events.mjs";
|
|
2
|
+
import { inView } from "../../external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/viewport/index.mjs";
|
|
3
|
+
import { BaseGesture } from "./base.mjs";
|
|
4
|
+
class InViewGesture extends BaseGesture {
|
|
5
|
+
isActive() {
|
|
6
|
+
return Boolean(this.state.getOptions().inView);
|
|
7
|
+
}
|
|
8
|
+
constructor(state) {
|
|
9
|
+
super(state);
|
|
10
|
+
this.subscribeEvents = () => {
|
|
11
|
+
var _a;
|
|
12
|
+
const element = this.state.getElement();
|
|
13
|
+
const { once, ...viewOptions } = ((_a = this.state.getOptions()) == null ? void 0 : _a.inViewOptions) || {};
|
|
14
|
+
return inView(element, (enterEntry) => {
|
|
15
|
+
this.state.setActive("inView", true);
|
|
16
|
+
dispatchPointerEvent(element, "viewenter", enterEntry);
|
|
17
|
+
if (!once) {
|
|
18
|
+
return (leaveEntry) => {
|
|
19
|
+
this.state.setActive("inView", false);
|
|
20
|
+
dispatchPointerEvent(element, "viewleave", leaveEntry);
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
}, viewOptions);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
mount() {
|
|
27
|
+
this.updateGestureSubscriptions();
|
|
28
|
+
}
|
|
29
|
+
update() {
|
|
30
|
+
this.updateGestureSubscriptions();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
InViewGesture
|
|
35
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { dispatchPointerEvent } from "../../utils/events.mjs";
|
|
2
|
+
import { BaseGesture } from "./base.mjs";
|
|
3
|
+
class PressGesture extends BaseGesture {
|
|
4
|
+
isActive() {
|
|
5
|
+
return Boolean(this.state.getOptions().press);
|
|
6
|
+
}
|
|
7
|
+
constructor(state) {
|
|
8
|
+
super(state);
|
|
9
|
+
this.subscribeEvents = () => {
|
|
10
|
+
const element = this.state.getElement();
|
|
11
|
+
const onPointerUp = (event) => {
|
|
12
|
+
this.state.setActive("press", false);
|
|
13
|
+
dispatchPointerEvent(element, "pressend", event);
|
|
14
|
+
window.removeEventListener("pointerup", onPointerUp);
|
|
15
|
+
};
|
|
16
|
+
const onPointerDown = (event) => {
|
|
17
|
+
this.state.setActive("press", true);
|
|
18
|
+
dispatchPointerEvent(element, "pressstart", event);
|
|
19
|
+
window.addEventListener("pointerup", onPointerUp);
|
|
20
|
+
};
|
|
21
|
+
element.addEventListener("pointerdown", onPointerDown);
|
|
22
|
+
return () => {
|
|
23
|
+
element.removeEventListener("pointerdown", onPointerDown);
|
|
24
|
+
window.removeEventListener("pointerup", onPointerUp);
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
mount() {
|
|
29
|
+
this.updateGestureSubscriptions();
|
|
30
|
+
}
|
|
31
|
+
update() {
|
|
32
|
+
this.updateGestureSubscriptions();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
PressGesture
|
|
37
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Feature } from "./feature.mjs";
|
|
2
|
+
import { frame } from "../external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/frameloop/frame.mjs";
|
|
3
|
+
function isSVGElement(element) {
|
|
4
|
+
return element instanceof SVGElement && element.tagName !== "svg";
|
|
5
|
+
}
|
|
6
|
+
class SVGFeature extends Feature {
|
|
7
|
+
mount() {
|
|
8
|
+
const instance = this.state.getElement();
|
|
9
|
+
if (!isSVGElement(instance)) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const visualElement = this.state.visualElement;
|
|
13
|
+
frame.read(() => {
|
|
14
|
+
try {
|
|
15
|
+
visualElement.renderState.dimensions = typeof instance.getBBox === "function" ? instance.getBBox() : instance.getBoundingClientRect();
|
|
16
|
+
} catch (e) {
|
|
17
|
+
visualElement.renderState.dimensions = {
|
|
18
|
+
x: 0,
|
|
19
|
+
y: 0,
|
|
20
|
+
width: 0,
|
|
21
|
+
height: 0
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
unmount() {
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
SVGFeature
|
|
31
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { default as default2 } from "./components/Motion.vue.mjs";
|
|
2
|
+
import { default as default3 } from "./components/AnimatePresence.vue.mjs";
|
|
3
|
+
import { components, utilities } from "./constants/index.mjs";
|
|
4
|
+
import { MotionValue, motionValue, motionValue as motionValue2 } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/index.mjs";
|
|
5
|
+
import { animate, createScopedAnimate } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animate/index.mjs";
|
|
6
|
+
import { animateMini } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs";
|
|
7
|
+
import { scroll } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/scroll/index.mjs";
|
|
8
|
+
import { scrollInfo } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/scroll/track.mjs";
|
|
9
|
+
import { inView } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/viewport/index.mjs";
|
|
10
|
+
import { anticipate } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/anticipate.mjs";
|
|
11
|
+
import { backIn, backInOut, backOut } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/back.mjs";
|
|
12
|
+
import { circIn, circInOut, circOut } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/circ.mjs";
|
|
13
|
+
import { easeIn, easeInOut, easeOut } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/ease.mjs";
|
|
14
|
+
import { cubicBezier } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/cubic-bezier.mjs";
|
|
15
|
+
import { steps } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/steps.mjs";
|
|
16
|
+
import { mirrorEasing } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/modifiers/mirror.mjs";
|
|
17
|
+
import { reverseEasing } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/modifiers/reverse.mjs";
|
|
18
|
+
import { spring } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/generators/spring/index.mjs";
|
|
19
|
+
import { inertia } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/generators/inertia.mjs";
|
|
20
|
+
import { keyframes } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/generators/keyframes.mjs";
|
|
21
|
+
import { stagger } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/utils/stagger.mjs";
|
|
22
|
+
import { transform } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/transform.mjs";
|
|
23
|
+
import { clamp } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/clamp.mjs";
|
|
24
|
+
import { delayInSeconds } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/delay.mjs";
|
|
25
|
+
import { distance, distance2D } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/distance.mjs";
|
|
26
|
+
import { invariant, warning } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/errors.mjs";
|
|
27
|
+
import { interpolate } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/interpolate.mjs";
|
|
28
|
+
import { mix } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/mix/index.mjs";
|
|
29
|
+
import { pipe } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/pipe.mjs";
|
|
30
|
+
import { progress } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/progress.mjs";
|
|
31
|
+
import { wrap } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/wrap.mjs";
|
|
32
|
+
import { cancelSync, sync } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/frameloop/index-legacy.mjs";
|
|
33
|
+
import { cancelFrame, frame, frameData, frameSteps } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/frameloop/frame.mjs";
|
|
34
|
+
import { useTransform } from "./value/use-transform.mjs";
|
|
35
|
+
import { useTime } from "./value/use-time.mjs";
|
|
36
|
+
import { useMotionTemplate } from "./value/use-motion-template.mjs";
|
|
37
|
+
import { useSpring } from "./value/use-spring.mjs";
|
|
38
|
+
import { useScroll } from "./value/use-scroll.mjs";
|
|
39
|
+
import { useAnimate } from "./animation/use-animate.mjs";
|
|
40
|
+
import { createContext } from "./utils/createContext.mjs";
|
|
41
|
+
import { isMotionValue } from "./utils/motion-value.mjs";
|
|
42
|
+
import { useInView } from "./utils/use-in-view.mjs";
|
|
43
|
+
import { useAnimationFrame } from "./utils/use-animation-frame.mjs";
|
|
44
|
+
export {
|
|
45
|
+
default3 as AnimatePresence,
|
|
46
|
+
default2 as Motion,
|
|
47
|
+
MotionValue,
|
|
48
|
+
animate,
|
|
49
|
+
animateMini,
|
|
50
|
+
anticipate,
|
|
51
|
+
backIn,
|
|
52
|
+
backInOut,
|
|
53
|
+
backOut,
|
|
54
|
+
cancelFrame,
|
|
55
|
+
cancelSync,
|
|
56
|
+
circIn,
|
|
57
|
+
circInOut,
|
|
58
|
+
circOut,
|
|
59
|
+
clamp,
|
|
60
|
+
components,
|
|
61
|
+
createContext,
|
|
62
|
+
createScopedAnimate,
|
|
63
|
+
cubicBezier,
|
|
64
|
+
delayInSeconds as delay,
|
|
65
|
+
distance,
|
|
66
|
+
distance2D,
|
|
67
|
+
easeIn,
|
|
68
|
+
easeInOut,
|
|
69
|
+
easeOut,
|
|
70
|
+
frame,
|
|
71
|
+
frameData,
|
|
72
|
+
frameSteps,
|
|
73
|
+
inView,
|
|
74
|
+
inertia,
|
|
75
|
+
interpolate,
|
|
76
|
+
invariant,
|
|
77
|
+
isMotionValue,
|
|
78
|
+
keyframes,
|
|
79
|
+
mirrorEasing,
|
|
80
|
+
mix,
|
|
81
|
+
motionValue,
|
|
82
|
+
pipe,
|
|
83
|
+
progress,
|
|
84
|
+
reverseEasing,
|
|
85
|
+
scroll,
|
|
86
|
+
scrollInfo,
|
|
87
|
+
spring,
|
|
88
|
+
stagger,
|
|
89
|
+
steps,
|
|
90
|
+
sync,
|
|
91
|
+
transform,
|
|
92
|
+
useAnimate,
|
|
93
|
+
useAnimationFrame,
|
|
94
|
+
useInView,
|
|
95
|
+
useMotionTemplate,
|
|
96
|
+
motionValue2 as useMotionValue,
|
|
97
|
+
useScroll,
|
|
98
|
+
useSpring,
|
|
99
|
+
useTime,
|
|
100
|
+
useTransform,
|
|
101
|
+
utilities,
|
|
102
|
+
warning,
|
|
103
|
+
wrap
|
|
104
|
+
};
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { invariant } from "../external/.pnpm/hey-listen@1.0.8/external/hey-listen/dist/hey-listen.es.mjs";
|
|
2
|
+
import { visualElementStore } from "../external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/store.mjs";
|
|
3
|
+
import { createDOMVisualElement } from "../external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/utils/create-visual-element.mjs";
|
|
4
|
+
import { isDef } from "@vueuse/core";
|
|
5
|
+
import { resolveVariant, getOptions, hasChanged, noop } from "./utils.mjs";
|
|
6
|
+
import { FeatureManager } from "../features/feature-manager.mjs";
|
|
7
|
+
import { style } from "./style.mjs";
|
|
8
|
+
import { transformResetValue } from "./transform.mjs";
|
|
9
|
+
import { scheduleAnimation, unscheduleAnimation } from "./schedule.mjs";
|
|
10
|
+
import { motionEvent } from "./event.mjs";
|
|
11
|
+
import { animate } from "../external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animate/index.mjs";
|
|
12
|
+
const STATE_TYPES = ["initial", "animate", "inView", "hover", "press", "exit", "drag"];
|
|
13
|
+
const mountedStates = /* @__PURE__ */ new WeakMap();
|
|
14
|
+
class MotionState {
|
|
15
|
+
constructor(options, parent) {
|
|
16
|
+
this.element = null;
|
|
17
|
+
this.activeStates = {
|
|
18
|
+
initial: true,
|
|
19
|
+
animate: true
|
|
20
|
+
};
|
|
21
|
+
this._context = null;
|
|
22
|
+
this.options = options;
|
|
23
|
+
this.parent = parent;
|
|
24
|
+
this.depth = (parent == null ? void 0 : parent.depth) + 1 || 0;
|
|
25
|
+
const initialVariantSource = options.initial === false ? "animate" : "initial";
|
|
26
|
+
this.featureManager = new FeatureManager(this);
|
|
27
|
+
this.initTarget(initialVariantSource);
|
|
28
|
+
}
|
|
29
|
+
get context() {
|
|
30
|
+
if (!this._context) {
|
|
31
|
+
const handler = {
|
|
32
|
+
get: (target, prop) => {
|
|
33
|
+
var _a;
|
|
34
|
+
return typeof this.options[prop] === "string" ? this.options[prop] : (_a = this.parent) == null ? void 0 : _a.context[prop];
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
this._context = new Proxy({}, handler);
|
|
38
|
+
}
|
|
39
|
+
return this._context;
|
|
40
|
+
}
|
|
41
|
+
initTarget(initialVariantSource) {
|
|
42
|
+
this.baseTarget = resolveVariant(this.options[initialVariantSource] || this.context[initialVariantSource], this.options.variants) || {};
|
|
43
|
+
this.target = { ...this.baseTarget };
|
|
44
|
+
}
|
|
45
|
+
get initial() {
|
|
46
|
+
return isDef(this.options.initial) ? this.options.initial : this.context.initial;
|
|
47
|
+
}
|
|
48
|
+
mount(element) {
|
|
49
|
+
var _a;
|
|
50
|
+
invariant(
|
|
51
|
+
Boolean(element),
|
|
52
|
+
"Animation state must be mounted with valid Element"
|
|
53
|
+
);
|
|
54
|
+
this.element = element;
|
|
55
|
+
mountedStates.set(element, this);
|
|
56
|
+
if (!visualElementStore.get(element)) {
|
|
57
|
+
createDOMVisualElement(element);
|
|
58
|
+
}
|
|
59
|
+
const visualElement = visualElementStore.get(element);
|
|
60
|
+
this.visualElement = visualElement;
|
|
61
|
+
visualElement.update(this.options, (_a = this.parent) == null ? void 0 : _a.context);
|
|
62
|
+
if (typeof this.initial === "object") {
|
|
63
|
+
for (const key in this.initial) {
|
|
64
|
+
visualElement.setStaticValue(key, this.initial[key]);
|
|
65
|
+
}
|
|
66
|
+
} else if (typeof this.initial === "string" && this.options.variants) {
|
|
67
|
+
for (const key in this.options.variants[this.initial]) {
|
|
68
|
+
visualElement.setStaticValue(key, this.options.variants[this.initial][key]);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
this.featureManager.mount();
|
|
72
|
+
}
|
|
73
|
+
unmount() {
|
|
74
|
+
var _a;
|
|
75
|
+
mountedStates.delete(this.element);
|
|
76
|
+
unscheduleAnimation(this);
|
|
77
|
+
(_a = visualElementStore.get(this.element)) == null ? void 0 : _a.unmount();
|
|
78
|
+
this.featureManager.unmount();
|
|
79
|
+
}
|
|
80
|
+
update(options) {
|
|
81
|
+
var _a;
|
|
82
|
+
this.options = options;
|
|
83
|
+
this.visualElement.update(this.options, (_a = this.parent) == null ? void 0 : _a.context);
|
|
84
|
+
this.featureManager.update();
|
|
85
|
+
scheduleAnimation(this);
|
|
86
|
+
}
|
|
87
|
+
setActive(name, isActive) {
|
|
88
|
+
if (!this.element)
|
|
89
|
+
return;
|
|
90
|
+
this.activeStates[name] = isActive;
|
|
91
|
+
scheduleAnimation(this);
|
|
92
|
+
}
|
|
93
|
+
*animateUpdates() {
|
|
94
|
+
const prevTarget = this.target;
|
|
95
|
+
this.target = {};
|
|
96
|
+
const animationOptions = {};
|
|
97
|
+
for (const name of STATE_TYPES) {
|
|
98
|
+
if (!this.activeStates[name])
|
|
99
|
+
continue;
|
|
100
|
+
const variant = resolveVariant(
|
|
101
|
+
isDef(this.options[name]) ? this.options[name] : this.context[name],
|
|
102
|
+
this.options.variants,
|
|
103
|
+
this.options.custom
|
|
104
|
+
);
|
|
105
|
+
if (!variant)
|
|
106
|
+
continue;
|
|
107
|
+
const allTarget = { ...prevTarget, ...variant };
|
|
108
|
+
for (const key in allTarget) {
|
|
109
|
+
if (key === "transition")
|
|
110
|
+
continue;
|
|
111
|
+
this.target[key] = variant[key];
|
|
112
|
+
animationOptions[key] = getOptions(
|
|
113
|
+
variant.transition ?? this.options.transition ?? {},
|
|
114
|
+
key
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
const allTargetKeys = /* @__PURE__ */ new Set([
|
|
119
|
+
...Object.keys(this.target),
|
|
120
|
+
...Object.keys(prevTarget)
|
|
121
|
+
]);
|
|
122
|
+
const animationFactories = [];
|
|
123
|
+
allTargetKeys.forEach((key) => {
|
|
124
|
+
var _a;
|
|
125
|
+
if (this.target[key] === void 0) {
|
|
126
|
+
this.target[key] = this.baseTarget[key];
|
|
127
|
+
}
|
|
128
|
+
if (hasChanged(prevTarget[key], this.target[key])) {
|
|
129
|
+
(_a = this.baseTarget)[key] ?? (_a[key] = style.get(this.element, key));
|
|
130
|
+
animationFactories.push(
|
|
131
|
+
() => {
|
|
132
|
+
return animate(
|
|
133
|
+
this.element,
|
|
134
|
+
{
|
|
135
|
+
[key]: this.target[key] === "none" ? transformResetValue[key] : this.target[key]
|
|
136
|
+
},
|
|
137
|
+
animationOptions[key] || {}
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
yield;
|
|
144
|
+
const animations = animationFactories.map((factory) => factory()).filter(Boolean);
|
|
145
|
+
if (!animations.length)
|
|
146
|
+
return;
|
|
147
|
+
const animationTarget = this.target;
|
|
148
|
+
this.element.dispatchEvent(motionEvent("motionstart", animationTarget));
|
|
149
|
+
const isExit = this.activeStates.exit;
|
|
150
|
+
Promise.all(animations).then(() => {
|
|
151
|
+
this.element.dispatchEvent(motionEvent("motioncomplete", {
|
|
152
|
+
...animationTarget
|
|
153
|
+
}, isExit));
|
|
154
|
+
}).catch(noop);
|
|
155
|
+
}
|
|
156
|
+
isMounted() {
|
|
157
|
+
return Boolean(this.element);
|
|
158
|
+
}
|
|
159
|
+
getDepth() {
|
|
160
|
+
return this.depth;
|
|
161
|
+
}
|
|
162
|
+
getOptions() {
|
|
163
|
+
return this.options;
|
|
164
|
+
}
|
|
165
|
+
getElement() {
|
|
166
|
+
return this.element;
|
|
167
|
+
}
|
|
168
|
+
getTarget() {
|
|
169
|
+
return this.target;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
export {
|
|
173
|
+
MotionState,
|
|
174
|
+
mountedStates
|
|
175
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { addUniqueItem, removeItem } from "./utils.mjs";
|
|
2
|
+
let scheduled;
|
|
3
|
+
const fireNext = (iterator) => iterator.next();
|
|
4
|
+
const fireAnimateUpdates = (state) => state.animateUpdates();
|
|
5
|
+
function processScheduledAnimations() {
|
|
6
|
+
if (!scheduled)
|
|
7
|
+
return;
|
|
8
|
+
const generators = scheduled.sort(compareByDepth).map(fireAnimateUpdates);
|
|
9
|
+
generators.forEach(fireNext);
|
|
10
|
+
generators.forEach(fireNext);
|
|
11
|
+
scheduled = void 0;
|
|
12
|
+
}
|
|
13
|
+
function scheduleAnimation(state) {
|
|
14
|
+
if (!scheduled) {
|
|
15
|
+
scheduled = [state];
|
|
16
|
+
requestAnimationFrame(processScheduledAnimations);
|
|
17
|
+
} else {
|
|
18
|
+
addUniqueItem(scheduled, state);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function unscheduleAnimation(state) {
|
|
22
|
+
scheduled && removeItem(scheduled, state);
|
|
23
|
+
}
|
|
24
|
+
function compareByDepth(a, b) {
|
|
25
|
+
return a.getDepth() - b.getDepth();
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
scheduleAnimation,
|
|
29
|
+
unscheduleAnimation
|
|
30
|
+
};
|