framer-motion 7.0.3 → 7.1.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/index.js +2090 -2304
- package/dist/es/animation/animate.mjs +4 -5
- package/dist/es/animation/animation-controls.mjs +22 -24
- package/dist/es/animation/use-animated-state.mjs +23 -25
- package/dist/es/animation/use-animation.mjs +2 -2
- package/dist/es/animation/utils/default-transitions.mjs +13 -14
- package/dist/es/animation/utils/easing.mjs +20 -21
- package/dist/es/animation/utils/is-animatable.mjs +1 -1
- package/dist/es/animation/utils/is-keyframes-target.mjs +1 -1
- package/dist/es/animation/utils/transitions.mjs +30 -31
- package/dist/es/components/AnimatePresence/PresenceChild.mjs +18 -31
- package/dist/es/components/AnimatePresence/index.mjs +33 -35
- package/dist/es/components/AnimatePresence/use-presence.mjs +5 -5
- package/dist/es/components/AnimateSharedLayout.mjs +4 -5
- package/dist/es/components/LayoutGroup/index.mjs +12 -16
- package/dist/es/components/LazyMotion/index.mjs +9 -10
- package/dist/es/components/MotionConfig/index.mjs +5 -5
- package/dist/es/components/Reorder/Group.mjs +16 -16
- package/dist/es/components/Reorder/Item.mjs +14 -18
- package/dist/es/components/Reorder/index.mjs +3 -3
- package/dist/es/components/Reorder/utils/check-reorder.mjs +6 -6
- package/dist/es/context/DeprecatedLayoutGroupContext.mjs +1 -1
- package/dist/es/context/LayoutGroupContext.mjs +1 -1
- package/dist/es/context/LazyContext.mjs +1 -1
- package/dist/es/context/MotionConfigContext.mjs +2 -2
- package/dist/es/context/MotionContext/create.mjs +2 -2
- package/dist/es/context/MotionContext/index.mjs +1 -1
- package/dist/es/context/MotionContext/utils.mjs +1 -1
- package/dist/es/context/PresenceContext.mjs +1 -1
- package/dist/es/context/ReorderContext.mjs +1 -1
- package/dist/es/context/SwitchLayoutGroupContext.mjs +1 -1
- package/dist/es/events/event-info.mjs +11 -17
- package/dist/es/events/use-dom-event.mjs +4 -5
- package/dist/es/events/use-pointer-event.mjs +2 -2
- package/dist/es/events/utils.mjs +3 -9
- package/dist/es/gestures/PanSession.mjs +42 -47
- package/dist/es/gestures/drag/VisualElementDragControls.mjs +147 -157
- package/dist/es/gestures/drag/use-drag-controls.mjs +10 -12
- package/dist/es/gestures/drag/use-drag.mjs +4 -4
- package/dist/es/gestures/drag/utils/constraints.mjs +12 -17
- package/dist/es/gestures/drag/utils/lock.mjs +17 -17
- package/dist/es/gestures/use-focus-gesture.mjs +3 -4
- package/dist/es/gestures/use-hover-gesture.mjs +2 -3
- package/dist/es/gestures/use-pan-gesture.mjs +9 -10
- package/dist/es/gestures/use-tap-gesture.mjs +5 -6
- package/dist/es/gestures/utils/event-type.mjs +1 -1
- package/dist/es/gestures/utils/is-node-or-child.mjs +1 -1
- package/dist/es/index.mjs +1 -0
- package/dist/es/motion/features/animations.mjs +9 -11
- package/dist/es/motion/features/definitions.mjs +5 -5
- package/dist/es/motion/features/drag.mjs +1 -1
- package/dist/es/motion/features/gestures.mjs +1 -1
- package/dist/es/motion/features/layout/MeasureLayout.mjs +32 -40
- package/dist/es/motion/features/layout/index.mjs +1 -1
- package/dist/es/motion/features/use-features.mjs +8 -9
- package/dist/es/motion/features/use-projection.mjs +10 -11
- package/dist/es/motion/features/viewport/observers.mjs +12 -12
- package/dist/es/motion/features/viewport/use-viewport.mjs +17 -20
- package/dist/es/motion/index.mjs +13 -16
- package/dist/es/motion/utils/VisualElementHandler.mjs +10 -16
- package/dist/es/motion/utils/is-forced-motion-value.mjs +1 -2
- package/dist/es/motion/utils/make-renderless-component.mjs +2 -2
- package/dist/es/motion/utils/use-motion-ref.mjs +1 -1
- package/dist/es/motion/utils/use-visual-element.mjs +13 -13
- package/dist/es/motion/utils/use-visual-state.mjs +26 -31
- package/dist/es/motion/utils/valid-prop.mjs +1 -1
- package/dist/es/projection/animation/mix-values.mjs +12 -16
- package/dist/es/projection/geometry/conversion.mjs +4 -6
- package/dist/es/projection/geometry/delta-apply.mjs +14 -20
- package/dist/es/projection/geometry/delta-calc.mjs +2 -5
- package/dist/es/projection/geometry/delta-remove.mjs +6 -13
- package/dist/es/projection/geometry/models.mjs +7 -7
- package/dist/es/projection/node/DocumentProjectionNode.mjs +5 -5
- package/dist/es/projection/node/HTMLProjectionNode.mjs +8 -10
- package/dist/es/projection/node/create-projection-node.mjs +283 -307
- package/dist/es/projection/node/group.mjs +6 -8
- package/dist/es/projection/node/id.mjs +2 -2
- package/dist/es/projection/node/state.mjs +1 -1
- package/dist/es/projection/shared/stack.mjs +26 -27
- package/dist/es/projection/styles/scale-border-radius.mjs +5 -5
- package/dist/es/projection/styles/scale-box-shadow.mjs +18 -19
- package/dist/es/projection/styles/scale-correction.mjs +1 -1
- package/dist/es/projection/styles/transform.mjs +12 -12
- package/dist/es/projection/use-reset-projection.mjs +2 -2
- package/dist/es/projection/utils/has-transform.mjs +1 -2
- package/dist/es/projection/utils/measure.mjs +2 -2
- package/dist/es/render/dom/create-visual-element.mjs +1 -1
- package/dist/es/render/dom/features-animation.mjs +1 -2
- package/dist/es/render/dom/features-max.mjs +1 -2
- package/dist/es/render/dom/motion-minimal.mjs +1 -1
- package/dist/es/render/dom/motion-proxy.mjs +3 -4
- package/dist/es/render/dom/motion.mjs +2 -5
- package/dist/es/render/dom/use-render.mjs +6 -9
- package/dist/es/render/dom/utils/camel-to-dash.mjs +3 -5
- package/dist/es/render/dom/utils/create-config.mjs +5 -5
- package/dist/es/render/dom/utils/css-variables-conversion.mjs +19 -20
- package/dist/es/render/dom/utils/filter-props.mjs +4 -6
- package/dist/es/render/dom/utils/parse-dom-variant.mjs +2 -2
- package/dist/es/render/dom/utils/unit-conversion.mjs +68 -99
- package/dist/es/render/dom/value-types/animatable-none.mjs +1 -1
- package/dist/es/render/dom/value-types/defaults.mjs +4 -5
- package/dist/es/render/dom/value-types/dimensions.mjs +2 -4
- package/dist/es/render/dom/value-types/find.mjs +2 -3
- package/dist/es/render/dom/value-types/get-as-type.mjs +1 -1
- package/dist/es/render/dom/value-types/number.mjs +2 -2
- package/dist/es/render/dom/value-types/test.mjs +1 -1
- package/dist/es/render/dom/value-types/type-auto.mjs +3 -3
- package/dist/es/render/dom/value-types/type-int.mjs +1 -2
- package/dist/es/render/html/config-motion.mjs +1 -1
- package/dist/es/render/html/use-props.mjs +11 -13
- package/dist/es/render/html/utils/build-styles.mjs +8 -8
- package/dist/es/render/html/utils/build-transform.mjs +11 -16
- package/dist/es/render/html/utils/create-render-state.mjs +2 -2
- package/dist/es/render/html/utils/render.mjs +2 -3
- package/dist/es/render/html/utils/scrape-motion-values.mjs +3 -3
- package/dist/es/render/html/utils/transform.mjs +6 -10
- package/dist/es/render/html/visual-element.mjs +22 -23
- package/dist/es/render/index.mjs +359 -364
- package/dist/es/render/svg/config-motion.mjs +2 -3
- package/dist/es/render/svg/lowercase-elements.mjs +1 -1
- package/dist/es/render/svg/use-props.mjs +5 -6
- package/dist/es/render/svg/utils/build-attrs.mjs +2 -2
- package/dist/es/render/svg/utils/camel-case-attrs.mjs +1 -1
- package/dist/es/render/svg/utils/create-render-state.mjs +1 -2
- package/dist/es/render/svg/utils/path.mjs +7 -10
- package/dist/es/render/svg/utils/render.mjs +1 -1
- package/dist/es/render/svg/utils/scrape-motion-values.mjs +3 -3
- package/dist/es/render/svg/utils/transform-origin.mjs +3 -3
- package/dist/es/render/svg/visual-element.mjs +6 -4
- package/dist/es/render/utils/animation-state.mjs +71 -87
- package/dist/es/render/utils/animation.mjs +48 -60
- package/dist/es/render/utils/compare-by-depth.mjs +1 -3
- package/dist/es/render/utils/flat-tree.mjs +9 -10
- package/dist/es/render/utils/lifecycles.mjs +12 -19
- package/dist/es/render/utils/motion-values.mjs +16 -8
- package/dist/es/render/utils/setters.mjs +19 -19
- package/dist/es/render/utils/variants.mjs +6 -8
- package/dist/es/utils/array.mjs +9 -10
- package/dist/es/utils/is-browser.mjs +1 -1
- package/dist/es/utils/is-numerical-string.mjs +1 -1
- package/dist/es/utils/is-zero-value-string.mjs +1 -1
- package/dist/es/utils/process.mjs +2 -2
- package/dist/es/utils/resolve-value.mjs +2 -2
- package/dist/es/utils/shallow-compare.mjs +2 -2
- package/dist/es/utils/subscription-manager.mjs +15 -17
- package/dist/es/utils/time-conversion.mjs +1 -1
- package/dist/es/utils/transform.mjs +10 -15
- package/dist/es/utils/use-animation-frame.mjs +5 -6
- package/dist/es/utils/use-constant.mjs +1 -1
- package/dist/es/utils/use-cycle.mjs +9 -10
- package/dist/es/utils/use-force-update.mjs +4 -5
- package/dist/es/utils/use-in-view.mjs +7 -9
- package/dist/es/utils/use-instant-transition-state.mjs +1 -1
- package/dist/es/utils/use-instant-transition.mjs +6 -9
- package/dist/es/utils/use-is-mounted.mjs +3 -3
- package/dist/es/utils/use-isomorphic-effect.mjs +1 -1
- package/dist/es/utils/use-reduced-motion.mjs +8 -11
- package/dist/es/utils/use-unmount-effect.mjs +1 -1
- package/dist/es/utils/warn-once.mjs +1 -1
- package/dist/es/value/index.mjs +53 -59
- package/dist/es/value/use-combine-values.mjs +3 -3
- package/dist/es/value/use-inverted-scale.mjs +9 -11
- package/dist/es/value/use-motion-template.mjs +5 -9
- package/dist/es/value/use-motion-value.mjs +4 -5
- package/dist/es/value/use-on-change.mjs +4 -4
- package/dist/es/value/use-scroll.mjs +9 -11
- package/dist/es/value/use-spring.mjs +8 -10
- package/dist/es/value/use-time.mjs +2 -2
- package/dist/es/value/use-transform.mjs +6 -10
- package/dist/es/value/use-velocity.mjs +3 -3
- package/dist/es/value/use-will-change/index.mjs +50 -0
- package/dist/es/value/use-will-change/is.mjs +7 -0
- package/dist/es/value/utils/is-motion-value.mjs +1 -1
- package/dist/es/value/utils/resolve-motion-value.mjs +1 -1
- package/dist/framer-motion.dev.js +2134 -2414
- package/dist/framer-motion.js +1 -1
- package/dist/index.d.ts +9 -2
- package/dist/projection.dev.js +1154 -1300
- package/dist/size-rollup-dom-animation.js +1 -1
- package/dist/size-rollup-dom-max.js +1 -1
- package/dist/size-rollup-m.js +1 -1
- package/dist/size-webpack-dom-animation.js +1 -1
- package/dist/size-webpack-dom-max.js +1 -1
- package/dist/size-webpack-m.js +1 -1
- package/dist/three-entry.d.ts +0 -1
- package/package.json +12 -12
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { __read } from 'tslib';
|
|
2
1
|
import { useContext, useState, useEffect } from 'react';
|
|
3
2
|
import { motionValue } from './index.mjs';
|
|
4
3
|
import { MotionConfigContext } from '../context/MotionConfigContext.mjs';
|
|
@@ -22,16 +21,16 @@ import { useConstant } from '../utils/use-constant.mjs';
|
|
|
22
21
|
* @public
|
|
23
22
|
*/
|
|
24
23
|
function useMotionValue(initial) {
|
|
25
|
-
|
|
24
|
+
const value = useConstant(() => motionValue(initial));
|
|
26
25
|
/**
|
|
27
26
|
* If this motion value is being used in static mode, like on
|
|
28
27
|
* the Framer canvas, force components to rerender when the motion
|
|
29
28
|
* value is updated.
|
|
30
29
|
*/
|
|
31
|
-
|
|
30
|
+
const { isStatic } = useContext(MotionConfigContext);
|
|
32
31
|
if (isStatic) {
|
|
33
|
-
|
|
34
|
-
useEffect(
|
|
32
|
+
const [, setLatest] = useState(initial);
|
|
33
|
+
useEffect(() => value.onChange(setLatest), []);
|
|
35
34
|
}
|
|
36
35
|
return value;
|
|
37
36
|
}
|
|
@@ -2,15 +2,15 @@ import { isMotionValue } from './utils/is-motion-value.mjs';
|
|
|
2
2
|
import { useIsomorphicLayoutEffect } from '../utils/use-isomorphic-effect.mjs';
|
|
3
3
|
|
|
4
4
|
function useOnChange(value, callback) {
|
|
5
|
-
useIsomorphicLayoutEffect(
|
|
5
|
+
useIsomorphicLayoutEffect(() => {
|
|
6
6
|
if (isMotionValue(value))
|
|
7
7
|
return value.onChange(callback);
|
|
8
8
|
}, [callback]);
|
|
9
9
|
}
|
|
10
10
|
function useMultiOnChange(values, handler) {
|
|
11
|
-
useIsomorphicLayoutEffect(
|
|
12
|
-
|
|
13
|
-
return
|
|
11
|
+
useIsomorphicLayoutEffect(() => {
|
|
12
|
+
const subscriptions = values.map((value) => value.onChange(handler));
|
|
13
|
+
return () => subscriptions.forEach((unsubscribe) => unsubscribe());
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -1,27 +1,25 @@
|
|
|
1
|
-
import { __rest
|
|
1
|
+
import { __rest } from 'tslib';
|
|
2
2
|
import { scroll } from '@motionone/dom';
|
|
3
3
|
import { motionValue } from './index.mjs';
|
|
4
4
|
import { useConstant } from '../utils/use-constant.mjs';
|
|
5
5
|
import { useIsomorphicLayoutEffect } from '../utils/use-isomorphic-effect.mjs';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
const createScrollMotionValues = () => ({
|
|
8
8
|
scrollX: motionValue(0),
|
|
9
9
|
scrollY: motionValue(0),
|
|
10
10
|
scrollXProgress: motionValue(0),
|
|
11
11
|
scrollYProgress: motionValue(0),
|
|
12
|
-
});
|
|
13
|
-
function useScroll(_a) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return scroll(function (_a) {
|
|
19
|
-
var x = _a.x, y = _a.y;
|
|
12
|
+
});
|
|
13
|
+
function useScroll(_a = {}) {
|
|
14
|
+
var { container, target } = _a, options = __rest(_a, ["container", "target"]);
|
|
15
|
+
const values = useConstant(createScrollMotionValues);
|
|
16
|
+
useIsomorphicLayoutEffect(() => {
|
|
17
|
+
return scroll(({ x, y }) => {
|
|
20
18
|
values.scrollX.set(x.current);
|
|
21
19
|
values.scrollXProgress.set(x.progress);
|
|
22
20
|
values.scrollY.set(y.current);
|
|
23
21
|
values.scrollYProgress.set(y.progress);
|
|
24
|
-
},
|
|
22
|
+
}, Object.assign(Object.assign({}, options), { container: (container === null || container === void 0 ? void 0 : container.current) || undefined, target: (target === null || target === void 0 ? void 0 : target.current) || undefined }));
|
|
25
23
|
}, []);
|
|
26
24
|
return values;
|
|
27
25
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { __assign } from 'tslib';
|
|
2
1
|
import { useContext, useRef, useMemo } from 'react';
|
|
3
2
|
import { animate } from 'popmotion';
|
|
4
3
|
import { isMotionValue } from './utils/is-motion-value.mjs';
|
|
@@ -25,13 +24,12 @@ import { MotionConfigContext } from '../context/MotionConfigContext.mjs';
|
|
|
25
24
|
*
|
|
26
25
|
* @public
|
|
27
26
|
*/
|
|
28
|
-
function useSpring(source, config) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return value.attach(function (v, set) {
|
|
27
|
+
function useSpring(source, config = {}) {
|
|
28
|
+
const { isStatic } = useContext(MotionConfigContext);
|
|
29
|
+
const activeSpringAnimation = useRef(null);
|
|
30
|
+
const value = useMotionValue(isMotionValue(source) ? source.get() : source);
|
|
31
|
+
useMemo(() => {
|
|
32
|
+
return value.attach((v, set) => {
|
|
35
33
|
/**
|
|
36
34
|
* A more hollistic approach to this might be to use isStatic to fix VisualElement animations
|
|
37
35
|
* at that level, but this will work for now
|
|
@@ -41,11 +39,11 @@ function useSpring(source, config) {
|
|
|
41
39
|
if (activeSpringAnimation.current) {
|
|
42
40
|
activeSpringAnimation.current.stop();
|
|
43
41
|
}
|
|
44
|
-
activeSpringAnimation.current = animate(
|
|
42
|
+
activeSpringAnimation.current = animate(Object.assign(Object.assign({ from: value.get(), to: v, velocity: value.getVelocity() }, config), { onUpdate: set }));
|
|
45
43
|
return value.get();
|
|
46
44
|
});
|
|
47
45
|
}, [JSON.stringify(config)]);
|
|
48
|
-
useOnChange(source,
|
|
46
|
+
useOnChange(source, (v) => value.set(parseFloat(v)));
|
|
49
47
|
return value;
|
|
50
48
|
}
|
|
51
49
|
|
|
@@ -2,8 +2,8 @@ import { useAnimationFrame } from '../utils/use-animation-frame.mjs';
|
|
|
2
2
|
import { useMotionValue } from './use-motion-value.mjs';
|
|
3
3
|
|
|
4
4
|
function useTime() {
|
|
5
|
-
|
|
6
|
-
useAnimationFrame(
|
|
5
|
+
const time = useMotionValue(0);
|
|
6
|
+
useAnimationFrame((t) => time.set(t));
|
|
7
7
|
return time;
|
|
8
8
|
}
|
|
9
9
|
|
|
@@ -1,25 +1,21 @@
|
|
|
1
|
-
import { __read } from 'tslib';
|
|
2
1
|
import { transform } from '../utils/transform.mjs';
|
|
3
2
|
import { useCombineMotionValues } from './use-combine-values.mjs';
|
|
4
3
|
import { useConstant } from '../utils/use-constant.mjs';
|
|
5
4
|
|
|
6
5
|
function useTransform(input, inputRangeOrTransformer, outputRange, options) {
|
|
7
|
-
|
|
6
|
+
const transformer = typeof inputRangeOrTransformer === "function"
|
|
8
7
|
? inputRangeOrTransformer
|
|
9
8
|
: transform(inputRangeOrTransformer, outputRange, options);
|
|
10
9
|
return Array.isArray(input)
|
|
11
10
|
? useListTransform(input, transformer)
|
|
12
|
-
: useListTransform([input],
|
|
13
|
-
var _b = __read(_a, 1), latest = _b[0];
|
|
14
|
-
return transformer(latest);
|
|
15
|
-
});
|
|
11
|
+
: useListTransform([input], ([latest]) => transformer(latest));
|
|
16
12
|
}
|
|
17
13
|
function useListTransform(values, transformer) {
|
|
18
|
-
|
|
19
|
-
return useCombineMotionValues(values,
|
|
14
|
+
const latest = useConstant(() => []);
|
|
15
|
+
return useCombineMotionValues(values, () => {
|
|
20
16
|
latest.length = 0;
|
|
21
|
-
|
|
22
|
-
for (
|
|
17
|
+
const numValues = values.length;
|
|
18
|
+
for (let i = 0; i < numValues; i++) {
|
|
23
19
|
latest[i] = values[i].get();
|
|
24
20
|
}
|
|
25
21
|
return transformer(latest);
|
|
@@ -13,9 +13,9 @@ import { useMotionValue } from './use-motion-value.mjs';
|
|
|
13
13
|
* @public
|
|
14
14
|
*/
|
|
15
15
|
function useVelocity(value) {
|
|
16
|
-
|
|
17
|
-
useEffect(
|
|
18
|
-
return value.velocityUpdateSubscribers.add(
|
|
16
|
+
const velocity = useMotionValue(value.getVelocity());
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
return value.velocityUpdateSubscribers.add((newVelocity) => {
|
|
19
19
|
velocity.set(newVelocity);
|
|
20
20
|
});
|
|
21
21
|
}, [value]);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { isCSSVariable } from '../../render/dom/utils/is-css-variable.mjs';
|
|
2
|
+
import { isTransformProp, isTransformOriginProp } from '../../render/html/utils/transform.mjs';
|
|
3
|
+
import { addUniqueItem, removeItem } from '../../utils/array.mjs';
|
|
4
|
+
import { useConstant } from '../../utils/use-constant.mjs';
|
|
5
|
+
import { MotionValue } from '../index.mjs';
|
|
6
|
+
import { camelToDash } from '../../render/dom/utils/camel-to-dash.mjs';
|
|
7
|
+
|
|
8
|
+
class WillChangeMotionValue extends MotionValue {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.members = [];
|
|
12
|
+
this.transforms = new Set();
|
|
13
|
+
}
|
|
14
|
+
add(name) {
|
|
15
|
+
let memberName;
|
|
16
|
+
if (isTransformProp(name)) {
|
|
17
|
+
this.transforms.add(name);
|
|
18
|
+
memberName = "transform";
|
|
19
|
+
}
|
|
20
|
+
else if (!isTransformOriginProp(name) &&
|
|
21
|
+
!isCSSVariable(name) &&
|
|
22
|
+
name !== "willChange") {
|
|
23
|
+
memberName = camelToDash(name);
|
|
24
|
+
}
|
|
25
|
+
if (memberName) {
|
|
26
|
+
addUniqueItem(this.members, memberName);
|
|
27
|
+
this.update();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
remove(name) {
|
|
31
|
+
if (isTransformProp(name)) {
|
|
32
|
+
this.transforms.delete(name);
|
|
33
|
+
if (!this.transforms.size) {
|
|
34
|
+
removeItem(this.members, "transform");
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
removeItem(this.members, camelToDash(name));
|
|
39
|
+
}
|
|
40
|
+
this.update();
|
|
41
|
+
}
|
|
42
|
+
update() {
|
|
43
|
+
this.set(this.members.length ? this.members.join(", ") : "auto");
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function useWillChange() {
|
|
47
|
+
return useConstant(() => new WillChangeMotionValue("auto"));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export { WillChangeMotionValue, useWillChange };
|
|
@@ -7,7 +7,7 @@ import { isMotionValue } from './is-motion-value.mjs';
|
|
|
7
7
|
* TODO: Remove and move to library
|
|
8
8
|
*/
|
|
9
9
|
function resolveMotionValue(value) {
|
|
10
|
-
|
|
10
|
+
const unwrappedValue = isMotionValue(value) ? value.get() : value;
|
|
11
11
|
return isCustomValue(unwrappedValue)
|
|
12
12
|
? unwrappedValue.toValue()
|
|
13
13
|
: unwrappedValue;
|