motion 12.7.0 → 12.7.2
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/debug.js +0 -2
- package/dist/cjs/index.js +4 -7
- package/dist/cjs/mini.js +1 -181
- package/dist/cjs/react-client.js +4 -14
- package/dist/cjs/react-m.js +1 -11
- package/dist/cjs/react-mini.js +1 -181
- package/dist/es/framer-motion/dist/es/animation/animate/index.mjs +1 -3
- package/dist/es/framer-motion/dist/es/animation/animate/resolve-subjects.mjs +1 -3
- package/dist/es/framer-motion/dist/es/animation/animate/single-value.mjs +1 -3
- package/dist/es/framer-motion/dist/es/animation/animate/subject.mjs +1 -1
- package/dist/es/framer-motion/dist/es/animation/animators/AcceleratedAnimation.mjs +7 -9
- package/dist/es/framer-motion/dist/es/animation/animators/BaseAnimation.mjs +1 -3
- package/dist/es/framer-motion/dist/es/animation/animators/MainThreadAnimation.mjs +5 -6
- package/dist/es/framer-motion/dist/es/animation/animators/drivers/driver-frameloop.mjs +0 -2
- package/dist/es/framer-motion/dist/es/animation/animators/utils/can-animate.mjs +1 -2
- package/dist/es/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs +3 -4
- package/dist/es/framer-motion/dist/es/animation/animators/waapi/animate-sequence.mjs +1 -3
- package/dist/es/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs +1 -3
- package/dist/es/framer-motion/dist/es/animation/animators/waapi/utils/supports-waapi.mjs +0 -1
- package/dist/es/framer-motion/dist/es/animation/generators/spring/find.mjs +2 -2
- package/dist/es/framer-motion/dist/es/animation/generators/spring/index.mjs +5 -7
- package/dist/es/framer-motion/dist/es/animation/generators/utils/velocity.mjs +0 -1
- package/dist/es/framer-motion/dist/es/animation/hooks/animation-controls.mjs +1 -1
- package/dist/es/framer-motion/dist/es/animation/interfaces/motion-value.mjs +5 -7
- package/dist/es/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs +2 -4
- package/dist/es/framer-motion/dist/es/animation/optimized-appear/start.mjs +2 -4
- package/dist/es/framer-motion/dist/es/animation/sequence/create.mjs +5 -6
- package/dist/es/framer-motion/dist/es/animation/sequence/utils/edit.mjs +1 -2
- package/dist/es/framer-motion/dist/es/components/AnimateSharedLayout.mjs +1 -1
- package/dist/es/framer-motion/dist/es/components/Reorder/Group.mjs +1 -1
- package/dist/es/framer-motion/dist/es/components/Reorder/Item.mjs +1 -1
- package/dist/es/framer-motion/dist/es/components/Reorder/utils/check-reorder.mjs +1 -2
- package/dist/es/framer-motion/dist/es/easing/cubic-bezier.mjs +0 -1
- package/dist/es/framer-motion/dist/es/easing/utils/map.mjs +3 -4
- package/dist/es/framer-motion/dist/es/events/event-info.mjs +0 -2
- package/dist/es/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs +3 -4
- package/dist/es/framer-motion/dist/es/gestures/drag/index.mjs +1 -2
- package/dist/es/framer-motion/dist/es/gestures/drag/utils/constraints.mjs +1 -2
- package/dist/es/framer-motion/dist/es/gestures/hover.mjs +2 -4
- package/dist/es/framer-motion/dist/es/gestures/pan/PanSession.mjs +3 -5
- package/dist/es/framer-motion/dist/es/gestures/pan/index.mjs +2 -4
- package/dist/es/framer-motion/dist/es/gestures/press.mjs +2 -4
- package/dist/es/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs +2 -4
- package/dist/es/framer-motion/dist/es/motion/index.mjs +1 -1
- package/dist/es/framer-motion/dist/es/motion/utils/use-visual-element.mjs +1 -3
- package/dist/es/framer-motion/dist/es/projection/animation/mix-values.mjs +2 -3
- package/dist/es/framer-motion/dist/es/projection/node/create-projection-node.mjs +8 -10
- package/dist/es/framer-motion/dist/es/projection/shared/stack.mjs +0 -1
- package/dist/es/framer-motion/dist/es/render/VisualElement.mjs +5 -7
- package/dist/es/framer-motion/dist/es/render/components/create-proxy.mjs +0 -1
- package/dist/es/framer-motion/dist/es/render/dom/resize/handle-element.mjs +0 -2
- package/dist/es/framer-motion/dist/es/render/dom/scroll/index.mjs +2 -4
- package/dist/es/framer-motion/dist/es/render/dom/scroll/info.mjs +0 -1
- package/dist/es/framer-motion/dist/es/render/dom/scroll/observe.mjs +0 -2
- package/dist/es/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs +1 -2
- package/dist/es/framer-motion/dist/es/render/dom/scroll/track.mjs +1 -3
- package/dist/es/framer-motion/dist/es/render/dom/utils/css-variables-conversion.mjs +1 -1
- package/dist/es/framer-motion/dist/es/render/dom/viewport/index.mjs +0 -2
- package/dist/es/framer-motion/dist/es/render/svg/SVGVisualElement.mjs +1 -3
- package/dist/es/framer-motion/dist/es/render/svg/config-motion.mjs +1 -3
- package/dist/es/framer-motion/dist/es/render/utils/KeyframesResolver.mjs +1 -3
- package/dist/es/framer-motion/dist/es/render/utils/flat-tree.mjs +1 -2
- package/dist/es/framer-motion/dist/es/render/utils/motion-values.mjs +2 -4
- package/dist/es/framer-motion/dist/es/render/utils/setters.mjs +1 -3
- package/dist/es/framer-motion/dist/es/utils/delay.mjs +2 -4
- package/dist/es/framer-motion/dist/es/utils/interpolate.mjs +3 -3
- package/dist/es/framer-motion/dist/es/utils/mix/color.mjs +1 -1
- package/dist/es/framer-motion/dist/es/utils/mix/complex.mjs +1 -1
- package/dist/es/framer-motion/dist/es/utils/offsets/fill.mjs +1 -2
- package/dist/es/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs +1 -2
- package/dist/es/framer-motion/dist/es/utils/use-animation-frame.mjs +1 -3
- package/dist/es/framer-motion/dist/es/utils/use-force-update.mjs +1 -3
- package/dist/es/framer-motion/dist/es/utils/use-instant-transition.mjs +1 -3
- package/dist/es/framer-motion/dist/es/value/scroll/use-element-scroll.mjs +1 -2
- package/dist/es/framer-motion/dist/es/value/scroll/use-viewport-scroll.mjs +1 -2
- package/dist/es/framer-motion/dist/es/value/use-combine-values.mjs +1 -3
- package/dist/es/framer-motion/dist/es/value/use-computed.mjs +1 -3
- package/dist/es/framer-motion/dist/es/value/use-inverted-scale.mjs +1 -1
- package/dist/es/framer-motion/dist/es/value/use-motion-value.mjs +1 -3
- package/dist/es/framer-motion/dist/es/value/use-scroll.mjs +2 -3
- package/dist/es/framer-motion/dist/es/value/use-spring.mjs +2 -4
- package/dist/es/framer-motion/dist/es/value/use-velocity.mjs +1 -3
- package/dist/es/framer-motion/dist/es/value/use-will-change/WillChangeMotionValue.mjs +2 -4
- package/dist/es/framer-motion/dist/es/value/use-will-change/add-will-change.mjs +1 -2
- package/dist/es/motion-dom/dist/es/animation/NativeAnimation.mjs +4 -7
- package/dist/es/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs +1 -2
- package/dist/es/motion-dom/dist/es/animation/waapi/supports/partial-keyframes.mjs +0 -1
- package/dist/es/motion-dom/dist/es/frameloop/batcher.mjs +1 -2
- package/dist/es/motion-dom/dist/es/frameloop/frame.mjs +1 -2
- package/dist/es/motion-dom/dist/es/frameloop/index-legacy.mjs +1 -1
- package/dist/es/motion-dom/dist/es/frameloop/sync-time.mjs +1 -2
- package/dist/es/motion-dom/dist/es/stats/index.mjs +1 -1
- package/dist/es/motion-dom/dist/es/utils/supports/memo.mjs +1 -2
- package/dist/es/motion-dom/dist/es/utils/supports/scroll-timeline.mjs +0 -1
- package/dist/es/motion-dom/dist/es/value/index.mjs +4 -5
- package/dist/motion.dev.js +4 -7
- package/dist/motion.js +1 -1
- package/package.json +3 -3
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import '../../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
-
import { frame } from '../../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
3
|
-
import '../../../../../motion-dom/dist/es/frameloop/index-legacy.mjs';
|
|
4
1
|
import { makeUseVisualState } from '../../motion/utils/use-visual-state.mjs';
|
|
5
2
|
import { transformProps } from '../html/utils/keys-transform.mjs';
|
|
6
3
|
import { buildSVGAttrs } from './utils/build-attrs.mjs';
|
|
@@ -9,6 +6,7 @@ import { isSVGTag } from './utils/is-svg-tag.mjs';
|
|
|
9
6
|
import { updateSVGDimensions } from './utils/measure.mjs';
|
|
10
7
|
import { renderSVG } from './utils/render.mjs';
|
|
11
8
|
import { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';
|
|
9
|
+
import { frame } from '../../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
12
10
|
|
|
13
11
|
const layoutProps = ["x", "y", "width", "height", "cx", "cy", "r"];
|
|
14
12
|
const svgMotionConfig = {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import '../../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
-
import { frame } from '../../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
3
|
-
import '../../../../../motion-dom/dist/es/frameloop/index-legacy.mjs';
|
|
4
1
|
import { removeNonTranslationalTransform } from '../dom/utils/unit-conversion.mjs';
|
|
2
|
+
import { frame } from '../../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
5
3
|
|
|
6
4
|
const toResolve = new Set();
|
|
7
5
|
let isScheduled = false;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { addUniqueItem, removeItem } from '../../../../../motion-utils/dist/es/array.mjs';
|
|
2
|
-
import '../../../../../motion-utils/dist/es/errors.mjs';
|
|
3
1
|
import { compareByDepth } from './compare-by-depth.mjs';
|
|
2
|
+
import { addUniqueItem, removeItem } from '../../../../../motion-utils/dist/es/array.mjs';
|
|
4
3
|
|
|
5
4
|
class FlatTree {
|
|
6
5
|
constructor() {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import '
|
|
1
|
+
import { isMotionValue } from '../../value/utils/is-motion-value.mjs';
|
|
2
2
|
import { warnOnce } from '../../../../../motion-utils/dist/es/warn-once.mjs';
|
|
3
3
|
import { motionValue } from '../../../../../motion-dom/dist/es/value/index.mjs';
|
|
4
|
-
import '../../../../../motion-dom/dist/es/frameloop/index-legacy.mjs';
|
|
5
|
-
import { isMotionValue } from '../../value/utils/is-motion-value.mjs';
|
|
6
4
|
|
|
7
5
|
function updateMotionValuesFromProps(element, next, prev) {
|
|
8
6
|
for (const key in next) {
|
|
@@ -19,7 +17,7 @@ function updateMotionValuesFromProps(element, next, prev) {
|
|
|
19
17
|
* and warn against mismatches.
|
|
20
18
|
*/
|
|
21
19
|
if (process.env.NODE_ENV === "development") {
|
|
22
|
-
warnOnce(nextValue.version === "12.7.
|
|
20
|
+
warnOnce(nextValue.version === "12.7.2", `Attempting to mix Motion versions ${nextValue.version} with 12.7.2 may not work as expected.`);
|
|
23
21
|
}
|
|
24
22
|
}
|
|
25
23
|
else if (isMotionValue(prevValue)) {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import '../../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
-
import { motionValue } from '../../../../../motion-dom/dist/es/value/index.mjs';
|
|
3
|
-
import '../../../../../motion-dom/dist/es/frameloop/index-legacy.mjs';
|
|
4
1
|
import { resolveFinalValueInKeyframes } from '../../utils/resolve-value.mjs';
|
|
5
2
|
import { resolveVariant } from './resolve-dynamic-variants.mjs';
|
|
3
|
+
import { motionValue } from '../../../../../motion-dom/dist/es/value/index.mjs';
|
|
6
4
|
|
|
7
5
|
/**
|
|
8
6
|
* Set VisualElement's MotionValue, creating a new MotionValue for it if
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import '../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
-
import { secondsToMilliseconds } from '../../../../motion-utils/dist/es/time-conversion.mjs';
|
|
3
|
-
import { frame, cancelFrame } from '../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
4
1
|
import { time } from '../../../../motion-dom/dist/es/frameloop/sync-time.mjs';
|
|
5
|
-
import '../../../../motion-dom/dist/es/frameloop/
|
|
2
|
+
import { frame, cancelFrame } from '../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
3
|
+
import { secondsToMilliseconds } from '../../../../motion-utils/dist/es/time-conversion.mjs';
|
|
6
4
|
|
|
7
5
|
/**
|
|
8
6
|
* Timeout defined in ms
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { invariant } from '../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
-
import { noop } from '../../../../motion-utils/dist/es/noop.mjs';
|
|
3
|
-
import { progress } from '../../../../motion-utils/dist/es/progress.mjs';
|
|
4
1
|
import { clamp } from './clamp.mjs';
|
|
5
2
|
import { mix } from './mix/index.mjs';
|
|
6
3
|
import { pipe } from './pipe.mjs';
|
|
4
|
+
import { invariant } from '../../../../motion-utils/dist/es/errors.mjs';
|
|
5
|
+
import { noop } from '../../../../motion-utils/dist/es/noop.mjs';
|
|
6
|
+
import { progress } from '../../../../motion-utils/dist/es/progress.mjs';
|
|
7
7
|
|
|
8
8
|
function createMixers(output, ease, customMixer) {
|
|
9
9
|
const mixers = [];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { mixNumber } from './number.mjs';
|
|
2
|
-
import { warning } from '../../../../../motion-utils/dist/es/errors.mjs';
|
|
3
2
|
import { hslaToRgba } from '../hsla-to-rgba.mjs';
|
|
4
3
|
import { hex } from '../../value/types/color/hex.mjs';
|
|
5
4
|
import { rgba } from '../../value/types/color/rgba.mjs';
|
|
6
5
|
import { hsla } from '../../value/types/color/hsla.mjs';
|
|
7
6
|
import { mixImmediate } from './immediate.mjs';
|
|
7
|
+
import { warning } from '../../../../../motion-utils/dist/es/errors.mjs';
|
|
8
8
|
|
|
9
9
|
// Linear color space blending
|
|
10
10
|
// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { mixNumber as mixNumber$1 } from './number.mjs';
|
|
2
2
|
import { mixColor } from './color.mjs';
|
|
3
3
|
import { pipe } from '../pipe.mjs';
|
|
4
|
-
import { warning } from '../../../../../motion-utils/dist/es/errors.mjs';
|
|
5
4
|
import { color } from '../../value/types/color/index.mjs';
|
|
6
5
|
import { complex, analyseComplexValue } from '../../value/types/complex/index.mjs';
|
|
7
6
|
import { isCSSVariableToken } from '../../render/dom/utils/is-css-variable.mjs';
|
|
8
7
|
import { invisibleValues, mixVisibility } from './visibility.mjs';
|
|
9
8
|
import { mixImmediate } from './immediate.mjs';
|
|
9
|
+
import { warning } from '../../../../../motion-utils/dist/es/errors.mjs';
|
|
10
10
|
|
|
11
11
|
function mixNumber(a, b) {
|
|
12
12
|
return (p) => mixNumber$1(a, b, p);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import '../../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
-
import { progress } from '../../../../../motion-utils/dist/es/progress.mjs';
|
|
3
1
|
import { mixNumber } from '../mix/number.mjs';
|
|
2
|
+
import { progress } from '../../../../../motion-utils/dist/es/progress.mjs';
|
|
4
3
|
|
|
5
4
|
function fillOffset(offset, remaining) {
|
|
6
5
|
const min = offset[offset.length - 1];
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import '../../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
-
import { warnOnce } from '../../../../../motion-utils/dist/es/warn-once.mjs';
|
|
3
1
|
import { useState } from 'react';
|
|
4
2
|
import { initPrefersReducedMotion } from './index.mjs';
|
|
5
3
|
import { hasReducedMotionListener, prefersReducedMotion } from './state.mjs';
|
|
4
|
+
import { warnOnce } from '../../../../../motion-utils/dist/es/warn-once.mjs';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting.
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import '../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
-
import { frame, cancelFrame } from '../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
3
|
-
import '../../../../motion-dom/dist/es/frameloop/index-legacy.mjs';
|
|
4
1
|
import { useRef, useContext, useEffect } from 'react';
|
|
5
2
|
import { MotionConfigContext } from '../context/MotionConfigContext.mjs';
|
|
3
|
+
import { frame, cancelFrame } from '../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
6
4
|
|
|
7
5
|
function useAnimationFrame(callback) {
|
|
8
6
|
const initialTimestamp = useRef(0);
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import '../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
-
import { frame } from '../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
3
|
-
import '../../../../motion-dom/dist/es/frameloop/index-legacy.mjs';
|
|
4
1
|
import { useState, useCallback } from 'react';
|
|
5
2
|
import { useIsMounted } from './use-is-mounted.mjs';
|
|
3
|
+
import { frame } from '../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
6
4
|
|
|
7
5
|
function useForceUpdate() {
|
|
8
6
|
const isMounted = useIsMounted();
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import '../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
-
import { frame } from '../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
3
|
-
import '../../../../motion-dom/dist/es/frameloop/index-legacy.mjs';
|
|
4
1
|
import { useRef, useEffect } from 'react';
|
|
5
2
|
import { useInstantLayoutTransition } from '../projection/use-instant-layout-transition.mjs';
|
|
6
3
|
import { useForceUpdate } from './use-force-update.mjs';
|
|
7
4
|
import { instantAnimationState } from './use-instant-transition-state.mjs';
|
|
5
|
+
import { frame } from '../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
8
6
|
|
|
9
7
|
function useInstantTransition() {
|
|
10
8
|
const [forceUpdate, forcedRenderCount] = useForceUpdate();
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import '../../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
-
import { warnOnce } from '../../../../../motion-utils/dist/es/warn-once.mjs';
|
|
3
1
|
import { useScroll } from '../use-scroll.mjs';
|
|
2
|
+
import { warnOnce } from '../../../../../motion-utils/dist/es/warn-once.mjs';
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* @deprecated useElementScroll is deprecated. Convert to useScroll({ container: ref })
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import '../../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
-
import { warnOnce } from '../../../../../motion-utils/dist/es/warn-once.mjs';
|
|
3
1
|
import { useScroll } from '../use-scroll.mjs';
|
|
2
|
+
import { warnOnce } from '../../../../../motion-utils/dist/es/warn-once.mjs';
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* @deprecated useViewportScroll is deprecated. Convert to useScroll()
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import '../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
-
import { cancelFrame, frame } from '../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
3
|
-
import '../../../../motion-dom/dist/es/frameloop/index-legacy.mjs';
|
|
4
1
|
import { useIsomorphicLayoutEffect } from '../utils/use-isomorphic-effect.mjs';
|
|
5
2
|
import { useMotionValue } from './use-motion-value.mjs';
|
|
3
|
+
import { cancelFrame, frame } from '../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
6
4
|
|
|
7
5
|
function useCombineMotionValues(values, combineValues) {
|
|
8
6
|
/**
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import '../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
-
import { collectMotionValues } from '../../../../motion-dom/dist/es/value/index.mjs';
|
|
3
|
-
import '../../../../motion-dom/dist/es/frameloop/index-legacy.mjs';
|
|
4
1
|
import { useCombineMotionValues } from './use-combine-values.mjs';
|
|
2
|
+
import { collectMotionValues } from '../../../../motion-dom/dist/es/value/index.mjs';
|
|
5
3
|
|
|
6
4
|
function useComputed(compute) {
|
|
7
5
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { invariant, warning } from '../../../../motion-utils/dist/es/errors.mjs';
|
|
2
1
|
import { useContext } from 'react';
|
|
3
2
|
import { MotionContext } from '../context/MotionContext/index.mjs';
|
|
4
3
|
import { useMotionValue } from './use-motion-value.mjs';
|
|
5
4
|
import { useTransform } from './use-transform.mjs';
|
|
5
|
+
import { invariant, warning } from '../../../../motion-utils/dist/es/errors.mjs';
|
|
6
6
|
|
|
7
7
|
// Keep things reasonable and avoid scale: Infinity. In practise we might need
|
|
8
8
|
// to add another value, opacity, that could interpolate scaleX/Y [0,0.01] => [0,1]
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import '../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
-
import { motionValue } from '../../../../motion-dom/dist/es/value/index.mjs';
|
|
3
|
-
import '../../../../motion-dom/dist/es/frameloop/index-legacy.mjs';
|
|
4
1
|
import { useContext, useState, useEffect } from 'react';
|
|
5
2
|
import { MotionConfigContext } from '../context/MotionConfigContext.mjs';
|
|
6
3
|
import { useConstant } from '../utils/use-constant.mjs';
|
|
4
|
+
import { motionValue } from '../../../../motion-dom/dist/es/value/index.mjs';
|
|
7
5
|
|
|
8
6
|
/**
|
|
9
7
|
* Creates a `MotionValue` to track the state and velocity of a value.
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { warning } from '../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
-
import { motionValue } from '../../../../motion-dom/dist/es/value/index.mjs';
|
|
3
|
-
import '../../../../motion-dom/dist/es/frameloop/index-legacy.mjs';
|
|
4
1
|
import { useEffect } from 'react';
|
|
5
2
|
import { scroll } from '../render/dom/scroll/index.mjs';
|
|
6
3
|
import { useConstant } from '../utils/use-constant.mjs';
|
|
7
4
|
import { useIsomorphicLayoutEffect } from '../utils/use-isomorphic-effect.mjs';
|
|
5
|
+
import { warning } from '../../../../motion-utils/dist/es/errors.mjs';
|
|
6
|
+
import { motionValue } from '../../../../motion-dom/dist/es/value/index.mjs';
|
|
8
7
|
|
|
9
8
|
function refWarning(name, ref) {
|
|
10
9
|
warning(Boolean(!ref || ref.current), `You have defined a ${name} options but the provided ref is not yet hydrated, probably because it's defined higher up the tree. Try calling useScroll() in the same component as the ref, or setting its \`layoutEffect: false\` option.`);
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import '../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
-
import { noop } from '../../../../motion-utils/dist/es/noop.mjs';
|
|
3
|
-
import { frame } from '../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
4
|
-
import '../../../../motion-dom/dist/es/frameloop/index-legacy.mjs';
|
|
5
1
|
import { useContext, useRef, useInsertionEffect } from 'react';
|
|
6
2
|
import { animateValue } from '../animation/animators/MainThreadAnimation.mjs';
|
|
7
3
|
import { MotionConfigContext } from '../context/MotionConfigContext.mjs';
|
|
@@ -9,6 +5,8 @@ import { useConstant } from '../utils/use-constant.mjs';
|
|
|
9
5
|
import { useIsomorphicLayoutEffect } from '../utils/use-isomorphic-effect.mjs';
|
|
10
6
|
import { useMotionValue } from './use-motion-value.mjs';
|
|
11
7
|
import { isMotionValue } from './utils/is-motion-value.mjs';
|
|
8
|
+
import { noop } from '../../../../motion-utils/dist/es/noop.mjs';
|
|
9
|
+
import { frame } from '../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
12
10
|
|
|
13
11
|
function useSpring(source, config = {}) {
|
|
14
12
|
const { isStatic } = useContext(MotionConfigContext);
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import '../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
-
import { frame } from '../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
3
|
-
import '../../../../motion-dom/dist/es/frameloop/index-legacy.mjs';
|
|
4
1
|
import { useMotionValueEvent } from '../utils/use-motion-value-event.mjs';
|
|
5
2
|
import { useMotionValue } from './use-motion-value.mjs';
|
|
3
|
+
import { frame } from '../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
6
4
|
|
|
7
5
|
/**
|
|
8
6
|
* Creates a `MotionValue` that updates when the velocity of the provided `MotionValue` changes.
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { addUniqueItem } from '../../../../../motion-utils/dist/es/array.mjs';
|
|
2
|
-
import '../../../../../motion-utils/dist/es/errors.mjs';
|
|
3
|
-
import { MotionValue } from '../../../../../motion-dom/dist/es/value/index.mjs';
|
|
4
|
-
import '../../../../../motion-dom/dist/es/frameloop/index-legacy.mjs';
|
|
5
1
|
import { getWillChangeName } from './get-will-change-name.mjs';
|
|
2
|
+
import { MotionValue } from '../../../../../motion-dom/dist/es/value/index.mjs';
|
|
3
|
+
import { addUniqueItem } from '../../../../../motion-utils/dist/es/array.mjs';
|
|
6
4
|
|
|
7
5
|
class WillChangeMotionValue extends MotionValue {
|
|
8
6
|
constructor() {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import '../../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
-
import { MotionGlobalConfig } from '../../../../../motion-utils/dist/es/global-config.mjs';
|
|
3
1
|
import { isWillChangeMotionValue } from './is.mjs';
|
|
2
|
+
import { MotionGlobalConfig } from '../../../../../motion-utils/dist/es/global-config.mjs';
|
|
4
3
|
|
|
5
4
|
function addValueToWillChange(visualElement, key) {
|
|
6
5
|
const willChange = visualElement.getValue("willChange");
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { invariant } from '../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
-
import { noop } from '../../../../motion-utils/dist/es/noop.mjs';
|
|
3
|
-
import { millisecondsToSeconds, secondsToMilliseconds } from '../../../../motion-utils/dist/es/time-conversion.mjs';
|
|
4
1
|
import { style } from '../render/dom/style.mjs';
|
|
5
2
|
import { getFinalKeyframe } from './keyframes/get-final.mjs';
|
|
6
3
|
import { hydrateKeyframes } from './keyframes/hydrate.mjs';
|
|
7
4
|
import { startWaapiAnimation } from './waapi/start-waapi-animation.mjs';
|
|
8
5
|
import { applyGeneratorOptions } from './waapi/utils/apply-generator.mjs';
|
|
6
|
+
import { invariant } from '../../../../motion-utils/dist/es/errors.mjs';
|
|
7
|
+
import { millisecondsToSeconds, secondsToMilliseconds } from '../../../../motion-utils/dist/es/time-conversion.mjs';
|
|
8
|
+
import { noop } from '../../../../motion-utils/dist/es/noop.mjs';
|
|
9
9
|
|
|
10
10
|
const animationMaps = new WeakMap();
|
|
11
11
|
const animationMapKey = (name, pseudoElement) => `${name}:${pseudoElement}`;
|
|
@@ -55,11 +55,8 @@ class NativeAnimation {
|
|
|
55
55
|
this.animation.onfinish = () => {
|
|
56
56
|
if (!pseudoElement) {
|
|
57
57
|
style.set(element, name, getFinalKeyframe(keyframes, transition));
|
|
58
|
+
this.cancel();
|
|
58
59
|
}
|
|
59
|
-
else {
|
|
60
|
-
this.commitStyles();
|
|
61
|
-
}
|
|
62
|
-
this.cancel();
|
|
63
60
|
};
|
|
64
61
|
/**
|
|
65
62
|
* TODO: Check for VisualElement before using animation state.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import '../../../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
-
import { millisecondsToSeconds } from '../../../../../../motion-utils/dist/es/time-conversion.mjs';
|
|
3
1
|
import { calcGeneratorDuration, maxGeneratorDuration } from './calc-duration.mjs';
|
|
2
|
+
import { millisecondsToSeconds } from '../../../../../../motion-utils/dist/es/time-conversion.mjs';
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* Create a progress => progress easing function from a generator.
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import '../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
-
import { MotionGlobalConfig } from '../../../../motion-utils/dist/es/global-config.mjs';
|
|
3
1
|
import { stepsOrder } from './order.mjs';
|
|
4
2
|
import { createRenderStep } from './render-step.mjs';
|
|
3
|
+
import { MotionGlobalConfig } from '../../../../motion-utils/dist/es/global-config.mjs';
|
|
5
4
|
|
|
6
5
|
const maxElapsed = 40;
|
|
7
6
|
function createRenderBatcher(scheduleNextBatch, allowKeepAlive) {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import '../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
-
import { noop } from '../../../../motion-utils/dist/es/noop.mjs';
|
|
3
1
|
import { createRenderBatcher } from './batcher.mjs';
|
|
2
|
+
import { noop } from '../../../../motion-utils/dist/es/noop.mjs';
|
|
4
3
|
|
|
5
4
|
const { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : noop, true);
|
|
6
5
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import '../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
-
import { MotionGlobalConfig } from '../../../../motion-utils/dist/es/global-config.mjs';
|
|
3
1
|
import { frameData } from './frame.mjs';
|
|
2
|
+
import { MotionGlobalConfig } from '../../../../motion-utils/dist/es/global-config.mjs';
|
|
4
3
|
|
|
5
4
|
let now;
|
|
6
5
|
function clearTime() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { frame, cancelFrame, frameData } from '../frameloop/frame.mjs';
|
|
2
1
|
import { activeAnimations } from './animation-count.mjs';
|
|
3
2
|
import { statsBuffer } from './buffer.mjs';
|
|
3
|
+
import { frame, cancelFrame, frameData } from '../frameloop/frame.mjs';
|
|
4
4
|
|
|
5
5
|
function record() {
|
|
6
6
|
const { value } = statsBuffer;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import '../../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
-
import { memo } from '../../../../../motion-utils/dist/es/memo.mjs';
|
|
3
1
|
import { supportsFlags } from './flags.mjs';
|
|
2
|
+
import { memo } from '../../../../../motion-utils/dist/es/memo.mjs';
|
|
4
3
|
|
|
5
4
|
function memoSupports(callback, supportsFlag) {
|
|
6
5
|
const memoized = memo(callback);
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import '
|
|
1
|
+
import { time } from '../frameloop/sync-time.mjs';
|
|
2
|
+
import { frame } from '../frameloop/frame.mjs';
|
|
3
|
+
import { warnOnce } from '../../../../motion-utils/dist/es/warn-once.mjs';
|
|
2
4
|
import { SubscriptionManager } from '../../../../motion-utils/dist/es/subscription-manager.mjs';
|
|
3
5
|
import { velocityPerSecond } from '../../../../motion-utils/dist/es/velocity-per-second.mjs';
|
|
4
|
-
import { warnOnce } from '../../../../motion-utils/dist/es/warn-once.mjs';
|
|
5
|
-
import { frame } from '../frameloop/frame.mjs';
|
|
6
|
-
import { time } from '../frameloop/sync-time.mjs';
|
|
7
6
|
|
|
8
7
|
/**
|
|
9
8
|
* Maximum time between the value of two frames, beyond which we
|
|
@@ -33,7 +32,7 @@ class MotionValue {
|
|
|
33
32
|
* This will be replaced by the build step with the latest version number.
|
|
34
33
|
* When MotionValues are provided to motion components, warn if versions are mixed.
|
|
35
34
|
*/
|
|
36
|
-
this.version = "12.
|
|
35
|
+
this.version = "12.7.2";
|
|
37
36
|
/**
|
|
38
37
|
* Tracks whether this value can output a velocity. Currently this is only true
|
|
39
38
|
* if the value is numerical, but we might be able to widen the scope here and support
|
package/dist/motion.dev.js
CHANGED
|
@@ -474,11 +474,8 @@
|
|
|
474
474
|
this.animation.onfinish = () => {
|
|
475
475
|
if (!pseudoElement) {
|
|
476
476
|
style.set(element, name, getFinalKeyframe$1(keyframes, transition));
|
|
477
|
+
this.cancel();
|
|
477
478
|
}
|
|
478
|
-
else {
|
|
479
|
-
this.commitStyles();
|
|
480
|
-
}
|
|
481
|
-
this.cancel();
|
|
482
479
|
};
|
|
483
480
|
/**
|
|
484
481
|
* TODO: Check for VisualElement before using animation state.
|
|
@@ -822,7 +819,7 @@
|
|
|
822
819
|
y: false,
|
|
823
820
|
};
|
|
824
821
|
function isDragActive() {
|
|
825
|
-
return isDragging.
|
|
822
|
+
return isDragging.y;
|
|
826
823
|
}
|
|
827
824
|
|
|
828
825
|
function resolveElements(elementOrSelector, scope, selectorCache) {
|
|
@@ -1067,7 +1064,7 @@
|
|
|
1067
1064
|
* This will be replaced by the build step with the latest version number.
|
|
1068
1065
|
* When MotionValues are provided to motion components, warn if versions are mixed.
|
|
1069
1066
|
*/
|
|
1070
|
-
this.version = "12.
|
|
1067
|
+
this.version = "12.7.2";
|
|
1071
1068
|
/**
|
|
1072
1069
|
* Tracks whether this value can output a velocity. Currently this is only true
|
|
1073
1070
|
* if the value is numerical, but we might be able to widen the scope here and support
|
|
@@ -4789,7 +4786,7 @@
|
|
|
4789
4786
|
* and warn against mismatches.
|
|
4790
4787
|
*/
|
|
4791
4788
|
{
|
|
4792
|
-
warnOnce(nextValue.version === "12.7.
|
|
4789
|
+
warnOnce(nextValue.version === "12.7.2", `Attempting to mix Motion versions ${nextValue.version} with 12.7.2 may not work as expected.`);
|
|
4793
4790
|
}
|
|
4794
4791
|
}
|
|
4795
4792
|
else if (isMotionValue(prevValue)) {
|