motion-v 0.2.5 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +1 -0
- package/dist/es/animation/use-animate.mjs +21 -0
- package/dist/es/components/AnimatePresence.vue.mjs +53 -0
- package/dist/es/components/AnimatePresence.vue2.mjs +4 -0
- package/dist/es/components/Motion.vue.mjs +98 -0
- package/dist/es/components/Motion.vue2.mjs +4 -0
- package/dist/es/components/Primitive.mjs +23 -0
- package/dist/es/components/Slot.mjs +27 -0
- package/dist/es/components/context.mjs +6 -0
- package/dist/es/components/presence.mjs +13 -0
- package/dist/es/components/renderSlotFragments.mjs +7 -0
- package/dist/es/constants/index.mjs +19 -0
- package/dist/es/features/events.mjs +53 -0
- package/dist/es/features/feature-manager.mjs +28 -0
- package/dist/es/features/feature.mjs +10 -0
- package/dist/es/features/gestures/base.mjs +14 -0
- package/dist/es/features/gestures/hover.mjs +33 -0
- package/dist/es/features/gestures/in-view.mjs +29 -0
- package/dist/es/features/gestures/press.mjs +28 -0
- package/dist/es/features/svg.mjs +30 -0
- package/dist/es/index.mjs +104 -0
- package/dist/es/node_modules/.pnpm/@vueuse_shared@11.1.0_vue@3.4.38_typescript@5.5.4_/node_modules/@vueuse/shared/index.mjs +6 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/GroupPlaybackControls.mjs +66 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animate/index.mjs +20 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animate/resolve-subjects.mjs +8 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animate/sequence.mjs +12 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animate/single-value.mjs +10 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animate/subject.mjs +30 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/AcceleratedAnimation.mjs +202 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/BaseAnimation.mjs +79 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/MainThreadAnimation.mjs +148 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/drivers/driver-frameloop.mjs +17 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/utils/accelerated-values.mjs +12 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/utils/can-animate.mjs +23 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/waapi/NativeAnimation.mjs +106 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs +24 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs +12 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/waapi/easing.mjs +27 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/waapi/index.mjs +17 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/waapi/utils/attach-timeline.mjs +6 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/waapi/utils/get-final-keyframe.mjs +8 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/waapi/utils/linear.mjs +11 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/waapi/utils/memo-supports.mjs +12 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/waapi/utils/style.mjs +10 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/waapi/utils/supports-flags.mjs +6 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/waapi/utils/supports-linear-easing.mjs +12 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/waapi/utils/supports-partial-keyframes.mjs +12 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/waapi/utils/supports-waapi.mjs +5 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/generators/inertia.mjs +37 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/generators/keyframes.mjs +30 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/generators/spring/find.mjs +55 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/generators/spring/index.mjs +67 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/generators/utils/calc-duration.mjs +13 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/generators/utils/is-generator.mjs +6 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/generators/utils/velocity.mjs +9 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/interfaces/motion-value.mjs +46 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs +45 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/optimized-appear/data-id.mjs +6 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/optimized-appear/get-appear-id.mjs +7 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/sequence/create.mjs +106 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs +7 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/sequence/utils/edit.mjs +22 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/sequence/utils/sort.mjs +6 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/utils/create-visual-element.mjs +39 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/utils/default-transitions.mjs +22 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/utils/get-value-transition.mjs +6 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/utils/is-animatable.mjs +7 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/utils/is-animation-controls.mjs +6 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs +6 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/utils/is-keyframes-target.mjs +4 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/utils/is-none.mjs +7 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/utils/is-transition-defined.mjs +6 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/utils/stagger.mjs +24 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/easing/anticipate.mjs +5 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/easing/back.mjs +9 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/easing/circ.mjs +8 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/easing/cubic-bezier.mjs +18 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/easing/ease.mjs +7 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/easing/modifiers/mirror.mjs +4 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/easing/modifiers/reverse.mjs +4 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/easing/steps.mjs +11 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/easing/utils/create-generator-easing.mjs +13 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/easing/utils/get-easing-for-segment.mjs +8 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/easing/utils/is-bezier-definition.mjs +4 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/easing/utils/is-easing-array.mjs +4 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/easing/utils/map.mjs +32 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/frameloop/batcher.mjs +39 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/frameloop/frame.mjs +9 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/frameloop/index-legacy.mjs +7 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/frameloop/render-step.mjs +41 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/frameloop/sync-time.mjs +15 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/motion/features/definitions.mjs +27 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/motion/utils/is-forced-motion-value.mjs +8 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/projection/geometry/conversion.mjs +21 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/projection/geometry/models.mjs +8 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/projection/styles/scale-correction.mjs +4 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/projection/utils/measure.mjs +7 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/VisualElement.mjs +226 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/DOMKeyframesResolver.mjs +65 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/DOMVisualElement.mjs +19 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/resize/handle-element.mjs +46 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/resize/handle-window.mjs +23 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/resize/index.mjs +8 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/scroll/index.mjs +46 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/scroll/info.mjs +38 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/scroll/observe.mjs +12 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs +17 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs +26 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs +25 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs +9 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs +21 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs +23 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/scroll/supports.mjs +5 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/scroll/track.mjs +40 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/utils/camel-to-dash.mjs +4 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/utils/css-variables-conversion.mjs +31 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/utils/is-css-variable.mjs +5 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-element.mjs +6 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/utils/resolve-element.mjs +12 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/utils/unit-conversion.mjs +52 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/value-types/animatable-none.mjs +10 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/value-types/defaults.mjs +24 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/value-types/dimensions.mjs +9 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/value-types/find.mjs +8 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/value-types/get-as-type.mjs +4 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/value-types/number-browser.mjs +41 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/value-types/number.mjs +18 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/value-types/test.mjs +4 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/value-types/transform.mjs +31 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/value-types/type-auto.mjs +7 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/value-types/type-int.mjs +8 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/viewport/index.mjs +25 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/html/HTMLVisualElement.mjs +46 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/html/utils/build-styles.mjs +29 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/html/utils/build-transform.mjs +31 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/html/utils/make-none-animatable.mjs +16 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/html/utils/render.mjs +8 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/html/utils/scrape-motion-values.mjs +12 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/html/utils/transform.mjs +23 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/object/ObjectVisualElement.mjs +37 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/store.mjs +4 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/svg/SVGVisualElement.mjs +40 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.mjs +26 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/svg/utils/camel-case-attrs.mjs +28 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/svg/utils/is-svg-tag.mjs +4 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/svg/utils/path.mjs +18 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/svg/utils/render.mjs +11 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/svg/utils/scrape-motion-values.mjs +15 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/svg/utils/transform-origin.mjs +11 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/utils/KeyframesResolver.mjs +76 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/utils/is-controlling-variants.mjs +13 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/utils/is-variant-label.mjs +6 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/utils/motion-values.mjs +26 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/utils/resolve-dynamic-variants.mjs +8 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/utils/resolve-variants.mjs +20 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/utils/setters.mjs +18 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/utils/variant-props.mjs +13 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/GlobalConfig.mjs +7 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/array.mjs +11 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/clamp.mjs +4 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/delay.mjs +17 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/distance.mjs +9 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/errors.mjs +12 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/hsla-to-rgba.mjs +22 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/interpolate.mjs +38 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/is-browser.mjs +4 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/is-numerical-string.mjs +4 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/is-zero-value-string.mjs +4 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/memo.mjs +7 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/mix/color.mjs +29 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/mix/complex.mjs +52 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/mix/immediate.mjs +6 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/mix/index.mjs +8 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/mix/number.mjs +4 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/mix/visibility.mjs +8 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/noop.mjs +4 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/offsets/default.mjs +8 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/offsets/fill.mjs +12 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/offsets/time.mjs +6 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/pipe.mjs +4 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/progress.mjs +7 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/reduced-motion/index.mjs +13 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/reduced-motion/state.mjs +5 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/resolve-value.mjs +5 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/subscription-manager.mjs +29 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/time-conversion.mjs +5 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/transform.mjs +12 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/velocity-per-second.mjs +6 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/warn-once.mjs +7 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/wrap.mjs +7 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/value/index.mjs +210 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/value/types/color/hex.mjs +19 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/value/types/color/hsla.mjs +12 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/value/types/color/index.mjs +11 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/value/types/color/rgba.mjs +16 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/value/types/color/utils.mjs +18 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/value/types/complex/filter.mjs +24 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/value/types/complex/index.mjs +49 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/value/types/numbers/index.mjs +17 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/value/types/numbers/units.mjs +17 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/value/types/utils/color-regex.mjs +4 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/value/types/utils/float-regex.mjs +4 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/value/types/utils/is-nullish.mjs +6 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/value/types/utils/sanitize.mjs +4 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/value/types/utils/single-color-regex.mjs +4 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/value/use-will-change/add-will-change.mjs +9 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/value/use-will-change/is.mjs +7 -0
- package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/value/utils/is-motion-value.mjs +4 -0
- package/dist/es/node_modules/.pnpm/hey-listen@1.0.8/node_modules/hey-listen/dist/hey-listen.es.mjs +13 -0
- package/dist/es/state/event.mjs +6 -0
- package/dist/es/state/motion-state.mjs +134 -0
- package/dist/es/state/schedule.mjs +22 -0
- package/dist/es/state/style.mjs +93 -0
- package/dist/es/state/transform.mjs +59 -0
- package/dist/es/state/utils.mjs +113 -0
- package/dist/es/utils/createContext.mjs +17 -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 +14 -0
- package/dist/es/utils/use-in-view.mjs +19 -0
- package/dist/es/value/use-combine-values.mjs +22 -0
- package/dist/es/value/use-computed.mjs +13 -0
- package/dist/es/value/use-motion-template.mjs +19 -0
- package/dist/es/value/use-scroll.mjs +47 -0
- package/dist/es/value/use-spring.mjs +39 -0
- package/dist/es/value/use-time.mjs +9 -0
- package/dist/es/value/use-transform.mjs +25 -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 +4 -4
- 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 +7 -7
- package/dist/index.js +0 -4002
- package/dist/index.umd.cjs +0 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { mixNumber as p } from "./number.mjs";
|
|
2
|
+
import { warning as f } from "../errors.mjs";
|
|
3
|
+
import { hslaToRgba as c } from "../hsla-to-rgba.mjs";
|
|
4
|
+
import { hex as u } from "../../value/types/color/hex.mjs";
|
|
5
|
+
import { rgba as s } from "../../value/types/color/rgba.mjs";
|
|
6
|
+
import { hsla as l } from "../../value/types/color/hsla.mjs";
|
|
7
|
+
import { mixImmediate as d } from "./immediate.mjs";
|
|
8
|
+
const m = (o, e, r) => {
|
|
9
|
+
const t = o * o, n = r * (e * e - t) + t;
|
|
10
|
+
return n < 0 ? 0 : Math.sqrt(n);
|
|
11
|
+
}, b = [u, s, l], h = (o) => b.find((e) => e.test(o));
|
|
12
|
+
function i(o) {
|
|
13
|
+
const e = h(o);
|
|
14
|
+
if (f(!!e, `'${o}' is not an animatable color. Use the equivalent color code instead.`), !e)
|
|
15
|
+
return !1;
|
|
16
|
+
let r = e.parse(o);
|
|
17
|
+
return e === l && (r = c(r)), r;
|
|
18
|
+
}
|
|
19
|
+
const G = (o, e) => {
|
|
20
|
+
const r = i(o), t = i(e);
|
|
21
|
+
if (!r || !t)
|
|
22
|
+
return d(o, e);
|
|
23
|
+
const n = { ...r };
|
|
24
|
+
return (a) => (n.red = m(r.red, t.red, a), n.green = m(r.green, t.green, a), n.blue = m(r.blue, t.blue, a), n.alpha = p(r.alpha, t.alpha, a), s.transform(n));
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
G as mixColor,
|
|
28
|
+
m as mixLinearColor
|
|
29
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { mixNumber as h } from "./number.mjs";
|
|
2
|
+
import { mixColor as u } from "./color.mjs";
|
|
3
|
+
import { pipe as b } from "../pipe.mjs";
|
|
4
|
+
import { warning as y } from "../errors.mjs";
|
|
5
|
+
import { color as m } from "../../value/types/color/index.mjs";
|
|
6
|
+
import { complex as v, analyseComplexValue as a } from "../../value/types/complex/index.mjs";
|
|
7
|
+
import { isCSSVariableToken as g } from "../../render/dom/utils/is-css-variable.mjs";
|
|
8
|
+
import { invisibleValues as c, mixVisibility as V } from "./visibility.mjs";
|
|
9
|
+
import { mixImmediate as l } from "./immediate.mjs";
|
|
10
|
+
function C(e, t) {
|
|
11
|
+
return (r) => h(e, t, r);
|
|
12
|
+
}
|
|
13
|
+
function f(e) {
|
|
14
|
+
return typeof e == "number" ? C : typeof e == "string" ? g(e) ? l : m.test(e) ? u : S : Array.isArray(e) ? p : typeof e == "object" ? m.test(e) ? u : k : l;
|
|
15
|
+
}
|
|
16
|
+
function p(e, t) {
|
|
17
|
+
const r = [...e], o = r.length, n = e.map((i, s) => f(i)(i, t[s]));
|
|
18
|
+
return (i) => {
|
|
19
|
+
for (let s = 0; s < o; s++)
|
|
20
|
+
r[s] = n[s](i);
|
|
21
|
+
return r;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function k(e, t) {
|
|
25
|
+
const r = { ...e, ...t }, o = {};
|
|
26
|
+
for (const n in r)
|
|
27
|
+
e[n] !== void 0 && t[n] !== void 0 && (o[n] = f(e[n])(e[n], t[n]));
|
|
28
|
+
return (n) => {
|
|
29
|
+
for (const i in o)
|
|
30
|
+
r[i] = o[i](n);
|
|
31
|
+
return r;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function I(e, t) {
|
|
35
|
+
var r;
|
|
36
|
+
const o = [], n = { color: 0, var: 0, number: 0 };
|
|
37
|
+
for (let i = 0; i < t.values.length; i++) {
|
|
38
|
+
const s = t.types[i], x = e.indexes[s][n[s]], d = (r = e.values[x]) !== null && r !== void 0 ? r : 0;
|
|
39
|
+
o[i] = d, n[s]++;
|
|
40
|
+
}
|
|
41
|
+
return o;
|
|
42
|
+
}
|
|
43
|
+
const S = (e, t) => {
|
|
44
|
+
const r = v.createTransformer(t), o = a(e), n = a(t);
|
|
45
|
+
return o.indexes.var.length === n.indexes.var.length && o.indexes.color.length === n.indexes.color.length && o.indexes.number.length >= n.indexes.number.length ? c.has(e) && !n.values.length || c.has(t) && !o.values.length ? V(e, t) : b(p(I(o, n), n.values), r) : (y(!0, `Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`), l(e, t));
|
|
46
|
+
};
|
|
47
|
+
export {
|
|
48
|
+
f as getMixer,
|
|
49
|
+
p as mixArray,
|
|
50
|
+
S as mixComplex,
|
|
51
|
+
k as mixObject
|
|
52
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { mixNumber as e } from "../mix/number.mjs";
|
|
2
|
+
import { progress as f } from "../progress.mjs";
|
|
3
|
+
function l(o, t) {
|
|
4
|
+
const s = o[o.length - 1];
|
|
5
|
+
for (let r = 1; r <= t; r++) {
|
|
6
|
+
const m = f(0, t, r);
|
|
7
|
+
o.push(e(s, 1, m));
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
l as fillOffset
|
|
12
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { isBrowser as o } from "../is-browser.mjs";
|
|
2
|
+
import { hasReducedMotionListener as i, prefersReducedMotion as t } from "./state.mjs";
|
|
3
|
+
function c() {
|
|
4
|
+
if (i.current = !0, !!o)
|
|
5
|
+
if (window.matchMedia) {
|
|
6
|
+
const e = window.matchMedia("(prefers-reduced-motion)"), r = () => t.current = e.matches;
|
|
7
|
+
e.addListener(r), r();
|
|
8
|
+
} else
|
|
9
|
+
t.current = !1;
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
c as initPrefersReducedMotion
|
|
13
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { addUniqueItem as e, removeItem as u } from "./array.mjs";
|
|
2
|
+
class h {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.subscriptions = [];
|
|
5
|
+
}
|
|
6
|
+
add(s) {
|
|
7
|
+
return e(this.subscriptions, s), () => u(this.subscriptions, s);
|
|
8
|
+
}
|
|
9
|
+
notify(s, r, n) {
|
|
10
|
+
const i = this.subscriptions.length;
|
|
11
|
+
if (i)
|
|
12
|
+
if (i === 1)
|
|
13
|
+
this.subscriptions[0](s, r, n);
|
|
14
|
+
else
|
|
15
|
+
for (let t = 0; t < i; t++) {
|
|
16
|
+
const o = this.subscriptions[t];
|
|
17
|
+
o && o(s, r, n);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
getSize() {
|
|
21
|
+
return this.subscriptions.length;
|
|
22
|
+
}
|
|
23
|
+
clear() {
|
|
24
|
+
this.subscriptions.length = 0;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
h as SubscriptionManager
|
|
29
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { interpolate as c } from "./interpolate.mjs";
|
|
2
|
+
const p = (t) => t && typeof t == "object" && t.mix, m = (t) => p(t) ? t.mix : void 0;
|
|
3
|
+
function f(...t) {
|
|
4
|
+
const o = !Array.isArray(t[0]), n = o ? 0 : -1, r = t[0 + n], s = t[1 + n], e = t[2 + n], u = t[3 + n], i = c(s, e, {
|
|
5
|
+
mixer: m(e[0]),
|
|
6
|
+
...u
|
|
7
|
+
});
|
|
8
|
+
return o ? i(r) : i;
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
f as transform
|
|
12
|
+
};
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { SubscriptionManager as c } from "../utils/subscription-manager.mjs";
|
|
2
|
+
import { velocityPerSecond as u } from "../utils/velocity-per-second.mjs";
|
|
3
|
+
import { warnOnce as p } from "../utils/warn-once.mjs";
|
|
4
|
+
import { time as n } from "../frameloop/sync-time.mjs";
|
|
5
|
+
import { frame as f } from "../frameloop/frame.mjs";
|
|
6
|
+
const r = 30, d = (s) => !isNaN(parseFloat(s)), a = {
|
|
7
|
+
current: void 0
|
|
8
|
+
};
|
|
9
|
+
class l {
|
|
10
|
+
/**
|
|
11
|
+
* @param init - The initiating value
|
|
12
|
+
* @param config - Optional configuration options
|
|
13
|
+
*
|
|
14
|
+
* - `transformer`: A function to transform incoming values with.
|
|
15
|
+
*
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
constructor(t, e = {}) {
|
|
19
|
+
this.version = "11.11.11", this.canTrackVelocity = null, this.events = {}, this.updateAndNotify = (i, h = !0) => {
|
|
20
|
+
const o = n.now();
|
|
21
|
+
this.updatedAt !== o && this.setPrevFrameValue(), this.prev = this.current, this.setCurrent(i), this.current !== this.prev && this.events.change && this.events.change.notify(this.current), h && this.events.renderRequest && this.events.renderRequest.notify(this.current);
|
|
22
|
+
}, this.hasAnimated = !1, this.setCurrent(t), this.owner = e.owner;
|
|
23
|
+
}
|
|
24
|
+
setCurrent(t) {
|
|
25
|
+
this.current = t, this.updatedAt = n.now(), this.canTrackVelocity === null && t !== void 0 && (this.canTrackVelocity = d(this.current));
|
|
26
|
+
}
|
|
27
|
+
setPrevFrameValue(t = this.current) {
|
|
28
|
+
this.prevFrameValue = t, this.prevUpdatedAt = this.updatedAt;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Adds a function that will be notified when the `MotionValue` is updated.
|
|
32
|
+
*
|
|
33
|
+
* It returns a function that, when called, will cancel the subscription.
|
|
34
|
+
*
|
|
35
|
+
* When calling `onChange` inside a React component, it should be wrapped with the
|
|
36
|
+
* `useEffect` hook. As it returns an unsubscribe function, this should be returned
|
|
37
|
+
* from the `useEffect` function to ensure you don't add duplicate subscribers..
|
|
38
|
+
*
|
|
39
|
+
* ```jsx
|
|
40
|
+
* export const MyComponent = () => {
|
|
41
|
+
* const x = useMotionValue(0)
|
|
42
|
+
* const y = useMotionValue(0)
|
|
43
|
+
* const opacity = useMotionValue(1)
|
|
44
|
+
*
|
|
45
|
+
* useEffect(() => {
|
|
46
|
+
* function updateOpacity() {
|
|
47
|
+
* const maxXY = Math.max(x.get(), y.get())
|
|
48
|
+
* const newOpacity = transform(maxXY, [0, 100], [1, 0])
|
|
49
|
+
* opacity.set(newOpacity)
|
|
50
|
+
* }
|
|
51
|
+
*
|
|
52
|
+
* const unsubscribeX = x.on("change", updateOpacity)
|
|
53
|
+
* const unsubscribeY = y.on("change", updateOpacity)
|
|
54
|
+
*
|
|
55
|
+
* return () => {
|
|
56
|
+
* unsubscribeX()
|
|
57
|
+
* unsubscribeY()
|
|
58
|
+
* }
|
|
59
|
+
* }, [])
|
|
60
|
+
*
|
|
61
|
+
* return <motion.div style={{ x }} />
|
|
62
|
+
* }
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* @param subscriber - A function that receives the latest value.
|
|
66
|
+
* @returns A function that, when called, will cancel this subscription.
|
|
67
|
+
*
|
|
68
|
+
* @deprecated
|
|
69
|
+
*/
|
|
70
|
+
onChange(t) {
|
|
71
|
+
return process.env.NODE_ENV !== "production" && p(!1, 'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'), this.on("change", t);
|
|
72
|
+
}
|
|
73
|
+
on(t, e) {
|
|
74
|
+
this.events[t] || (this.events[t] = new c());
|
|
75
|
+
const i = this.events[t].add(e);
|
|
76
|
+
return t === "change" ? () => {
|
|
77
|
+
i(), f.read(() => {
|
|
78
|
+
this.events.change.getSize() || this.stop();
|
|
79
|
+
});
|
|
80
|
+
} : i;
|
|
81
|
+
}
|
|
82
|
+
clearListeners() {
|
|
83
|
+
for (const t in this.events)
|
|
84
|
+
this.events[t].clear();
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Attaches a passive effect to the `MotionValue`.
|
|
88
|
+
*
|
|
89
|
+
* @internal
|
|
90
|
+
*/
|
|
91
|
+
attach(t, e) {
|
|
92
|
+
this.passiveEffect = t, this.stopPassiveEffect = e;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Sets the state of the `MotionValue`.
|
|
96
|
+
*
|
|
97
|
+
* @remarks
|
|
98
|
+
*
|
|
99
|
+
* ```jsx
|
|
100
|
+
* const x = useMotionValue(0)
|
|
101
|
+
* x.set(10)
|
|
102
|
+
* ```
|
|
103
|
+
*
|
|
104
|
+
* @param latest - Latest value to set.
|
|
105
|
+
* @param render - Whether to notify render subscribers. Defaults to `true`
|
|
106
|
+
*
|
|
107
|
+
* @public
|
|
108
|
+
*/
|
|
109
|
+
set(t, e = !0) {
|
|
110
|
+
!e || !this.passiveEffect ? this.updateAndNotify(t, e) : this.passiveEffect(t, this.updateAndNotify);
|
|
111
|
+
}
|
|
112
|
+
setWithVelocity(t, e, i) {
|
|
113
|
+
this.set(e), this.prev = void 0, this.prevFrameValue = t, this.prevUpdatedAt = this.updatedAt - i;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Set the state of the `MotionValue`, stopping any active animations,
|
|
117
|
+
* effects, and resets velocity to `0`.
|
|
118
|
+
*/
|
|
119
|
+
jump(t, e = !0) {
|
|
120
|
+
this.updateAndNotify(t), this.prev = t, this.prevUpdatedAt = this.prevFrameValue = void 0, e && this.stop(), this.stopPassiveEffect && this.stopPassiveEffect();
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Returns the latest state of `MotionValue`
|
|
124
|
+
*
|
|
125
|
+
* @returns - The latest state of `MotionValue`
|
|
126
|
+
*
|
|
127
|
+
* @public
|
|
128
|
+
*/
|
|
129
|
+
get() {
|
|
130
|
+
return a.current && a.current.push(this), this.current;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* @public
|
|
134
|
+
*/
|
|
135
|
+
getPrevious() {
|
|
136
|
+
return this.prev;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Returns the latest velocity of `MotionValue`
|
|
140
|
+
*
|
|
141
|
+
* @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.
|
|
142
|
+
*
|
|
143
|
+
* @public
|
|
144
|
+
*/
|
|
145
|
+
getVelocity() {
|
|
146
|
+
const t = n.now();
|
|
147
|
+
if (!this.canTrackVelocity || this.prevFrameValue === void 0 || t - this.updatedAt > r)
|
|
148
|
+
return 0;
|
|
149
|
+
const e = Math.min(this.updatedAt - this.prevUpdatedAt, r);
|
|
150
|
+
return u(parseFloat(this.current) - parseFloat(this.prevFrameValue), e);
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Registers a new animation to control this `MotionValue`. Only one
|
|
154
|
+
* animation can drive a `MotionValue` at one time.
|
|
155
|
+
*
|
|
156
|
+
* ```jsx
|
|
157
|
+
* value.start()
|
|
158
|
+
* ```
|
|
159
|
+
*
|
|
160
|
+
* @param animation - A function that starts the provided animation
|
|
161
|
+
*
|
|
162
|
+
* @internal
|
|
163
|
+
*/
|
|
164
|
+
start(t) {
|
|
165
|
+
return this.stop(), new Promise((e) => {
|
|
166
|
+
this.hasAnimated = !0, this.animation = t(e), this.events.animationStart && this.events.animationStart.notify();
|
|
167
|
+
}).then(() => {
|
|
168
|
+
this.events.animationComplete && this.events.animationComplete.notify(), this.clearAnimation();
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Stop the currently active animation.
|
|
173
|
+
*
|
|
174
|
+
* @public
|
|
175
|
+
*/
|
|
176
|
+
stop() {
|
|
177
|
+
this.animation && (this.animation.stop(), this.events.animationCancel && this.events.animationCancel.notify()), this.clearAnimation();
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Returns `true` if this value is currently animating.
|
|
181
|
+
*
|
|
182
|
+
* @public
|
|
183
|
+
*/
|
|
184
|
+
isAnimating() {
|
|
185
|
+
return !!this.animation;
|
|
186
|
+
}
|
|
187
|
+
clearAnimation() {
|
|
188
|
+
delete this.animation;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Destroy and clean up subscribers to this `MotionValue`.
|
|
192
|
+
*
|
|
193
|
+
* The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically
|
|
194
|
+
* handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually
|
|
195
|
+
* created a `MotionValue` via the `motionValue` function.
|
|
196
|
+
*
|
|
197
|
+
* @public
|
|
198
|
+
*/
|
|
199
|
+
destroy() {
|
|
200
|
+
this.clearListeners(), this.stop(), this.stopPassiveEffect && this.stopPassiveEffect();
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
function g(s, t) {
|
|
204
|
+
return new l(s, t);
|
|
205
|
+
}
|
|
206
|
+
export {
|
|
207
|
+
l as MotionValue,
|
|
208
|
+
a as collectMotionValues,
|
|
209
|
+
g as motionValue
|
|
210
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { rgba as i } from "./rgba.mjs";
|
|
2
|
+
import { isColorString as g } from "./utils.mjs";
|
|
3
|
+
function a(r) {
|
|
4
|
+
let t = "", e = "", n = "", s = "";
|
|
5
|
+
return r.length > 5 ? (t = r.substring(1, 3), e = r.substring(3, 5), n = r.substring(5, 7), s = r.substring(7, 9)) : (t = r.substring(1, 2), e = r.substring(2, 3), n = r.substring(3, 4), s = r.substring(4, 5), t += t, e += e, n += n, s += s), {
|
|
6
|
+
red: parseInt(t, 16),
|
|
7
|
+
green: parseInt(e, 16),
|
|
8
|
+
blue: parseInt(n, 16),
|
|
9
|
+
alpha: s ? parseInt(s, 16) / 255 : 1
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
const u = {
|
|
13
|
+
test: /* @__PURE__ */ g("#"),
|
|
14
|
+
parse: a,
|
|
15
|
+
transform: i.transform
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
u as hex
|
|
19
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { alpha as n } from "../numbers/index.mjs";
|
|
2
|
+
import { percent as t } from "../numbers/units.mjs";
|
|
3
|
+
import { sanitize as r } from "../utils/sanitize.mjs";
|
|
4
|
+
import { isColorString as i, splitColor as e } from "./utils.mjs";
|
|
5
|
+
const u = {
|
|
6
|
+
test: /* @__PURE__ */ i("hsl", "hue"),
|
|
7
|
+
parse: /* @__PURE__ */ e("hue", "saturation", "lightness"),
|
|
8
|
+
transform: ({ hue: o, saturation: s, lightness: a, alpha: m = 1 }) => "hsla(" + Math.round(o) + ", " + t.transform(r(s)) + ", " + t.transform(r(a)) + ", " + r(n.transform(m)) + ")"
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
u as hsla
|
|
12
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { hex as s } from "./hex.mjs";
|
|
2
|
+
import { hsla as t } from "./hsla.mjs";
|
|
3
|
+
import { rgba as e } from "./rgba.mjs";
|
|
4
|
+
const p = {
|
|
5
|
+
test: (r) => e.test(r) || s.test(r) || t.test(r),
|
|
6
|
+
parse: (r) => e.test(r) ? e.parse(r) : t.test(r) ? t.parse(r) : s.parse(r),
|
|
7
|
+
transform: (r) => typeof r == "string" ? r : r.hasOwnProperty("red") ? e.transform(r) : t.transform(r)
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
p as color
|
|
11
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { clamp as n } from "../../../utils/clamp.mjs";
|
|
2
|
+
import { number as s, alpha as i } from "../numbers/index.mjs";
|
|
3
|
+
import { sanitize as p } from "../utils/sanitize.mjs";
|
|
4
|
+
import { isColorString as e, splitColor as f } from "./utils.mjs";
|
|
5
|
+
const l = (r) => n(0, 255, r), o = {
|
|
6
|
+
...s,
|
|
7
|
+
transform: (r) => Math.round(l(r))
|
|
8
|
+
}, h = {
|
|
9
|
+
test: /* @__PURE__ */ e("rgb", "red"),
|
|
10
|
+
parse: /* @__PURE__ */ f("red", "green", "blue"),
|
|
11
|
+
transform: ({ red: r, green: t, blue: a, alpha: m = 1 }) => "rgba(" + o.transform(r) + ", " + o.transform(t) + ", " + o.transform(a) + ", " + p(i.transform(m)) + ")"
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
o as rgbUnit,
|
|
15
|
+
h as rgba
|
|
16
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { floatRegex as i } from "../utils/float-regex.mjs";
|
|
2
|
+
import { isNullish as n } from "../utils/is-nullish.mjs";
|
|
3
|
+
import { singleColorRegex as f } from "../utils/single-color-regex.mjs";
|
|
4
|
+
const h = (r, o) => (t) => !!(typeof t == "string" && f.test(t) && t.startsWith(r) || o && !n(t) && Object.prototype.hasOwnProperty.call(t, o)), u = (r, o, t) => (e) => {
|
|
5
|
+
if (typeof e != "string")
|
|
6
|
+
return e;
|
|
7
|
+
const [l, s, p, a] = e.match(i);
|
|
8
|
+
return {
|
|
9
|
+
[r]: parseFloat(l),
|
|
10
|
+
[o]: parseFloat(s),
|
|
11
|
+
[t]: parseFloat(p),
|
|
12
|
+
alpha: a !== void 0 ? parseFloat(a) : 1
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
h as isColorString,
|
|
17
|
+
u as splitColor
|
|
18
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { complex as c } from "./index.mjs";
|
|
2
|
+
import { floatRegex as i } from "../utils/float-regex.mjs";
|
|
3
|
+
const s = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]);
|
|
4
|
+
function u(t) {
|
|
5
|
+
const [e, n] = t.slice(0, -1).split("(");
|
|
6
|
+
if (e === "drop-shadow")
|
|
7
|
+
return t;
|
|
8
|
+
const [o] = n.match(i) || [];
|
|
9
|
+
if (!o)
|
|
10
|
+
return t;
|
|
11
|
+
const r = n.replace(o, "");
|
|
12
|
+
let a = s.has(e) ? 1 : 0;
|
|
13
|
+
return o !== n && (a *= 100), e + "(" + a + r + ")";
|
|
14
|
+
}
|
|
15
|
+
const l = /\b([a-z-]*)\(.*?\)/gu, p = {
|
|
16
|
+
...c,
|
|
17
|
+
getAnimatableNone: (t) => {
|
|
18
|
+
const e = t.match(l);
|
|
19
|
+
return e ? e.map(u).join(" ") : t;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
p as filter
|
|
24
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { color as u } from "../color/index.mjs";
|
|
2
|
+
import { colorRegex as g } from "../utils/color-regex.mjs";
|
|
3
|
+
import { floatRegex as N } from "../utils/float-regex.mjs";
|
|
4
|
+
import { sanitize as b } from "../utils/sanitize.mjs";
|
|
5
|
+
function x(t) {
|
|
6
|
+
var e, o;
|
|
7
|
+
return isNaN(t) && typeof t == "string" && (((e = t.match(N)) === null || e === void 0 ? void 0 : e.length) || 0) + (((o = t.match(g)) === null || o === void 0 ? void 0 : o.length) || 0) > 0;
|
|
8
|
+
}
|
|
9
|
+
const p = "number", m = "color", T = "var", O = "var(", a = "${}", _ = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;
|
|
10
|
+
function f(t) {
|
|
11
|
+
const e = t.toString(), o = [], i = {
|
|
12
|
+
color: [],
|
|
13
|
+
number: [],
|
|
14
|
+
var: []
|
|
15
|
+
}, n = [];
|
|
16
|
+
let s = 0;
|
|
17
|
+
const l = e.replace(_, (c) => (u.test(c) ? (i.color.push(s), n.push(m), o.push(u.parse(c))) : c.startsWith(O) ? (i.var.push(s), n.push(T), o.push(c)) : (i.number.push(s), n.push(p), o.push(parseFloat(c))), ++s, a)).split(a);
|
|
18
|
+
return { values: o, split: l, indexes: i, types: n };
|
|
19
|
+
}
|
|
20
|
+
function h(t) {
|
|
21
|
+
return f(t).values;
|
|
22
|
+
}
|
|
23
|
+
function d(t) {
|
|
24
|
+
const { split: e, types: o } = f(t), i = e.length;
|
|
25
|
+
return (n) => {
|
|
26
|
+
let s = "";
|
|
27
|
+
for (let r = 0; r < i; r++)
|
|
28
|
+
if (s += e[r], n[r] !== void 0) {
|
|
29
|
+
const l = o[r];
|
|
30
|
+
l === p ? s += b(n[r]) : l === m ? s += u.transform(n[r]) : s += n[r];
|
|
31
|
+
}
|
|
32
|
+
return s;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
const R = (t) => typeof t == "number" ? 0 : t;
|
|
36
|
+
function y(t) {
|
|
37
|
+
const e = h(t);
|
|
38
|
+
return d(t)(e.map(R));
|
|
39
|
+
}
|
|
40
|
+
const A = {
|
|
41
|
+
test: x,
|
|
42
|
+
parse: h,
|
|
43
|
+
createTransformer: d,
|
|
44
|
+
getAnimatableNone: y
|
|
45
|
+
};
|
|
46
|
+
export {
|
|
47
|
+
f as analyseComplexValue,
|
|
48
|
+
A as complex
|
|
49
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { clamp as a } from "../../../utils/clamp.mjs";
|
|
2
|
+
const r = {
|
|
3
|
+
test: (t) => typeof t == "number",
|
|
4
|
+
parse: parseFloat,
|
|
5
|
+
transform: (t) => t
|
|
6
|
+
}, e = {
|
|
7
|
+
...r,
|
|
8
|
+
transform: (t) => a(0, 1, t)
|
|
9
|
+
}, s = {
|
|
10
|
+
...r,
|
|
11
|
+
default: 1
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
e as alpha,
|
|
15
|
+
r as number,
|
|
16
|
+
s as scale
|
|
17
|
+
};
|