framer-motion 12.23.0 → 12.23.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/client.js +1 -1
- package/dist/cjs/{create-C-c1JfhA.js → create-Ch9BUY4E.js} +3 -3
- package/dist/cjs/dom-mini.js +2 -2
- package/dist/cjs/dom.js +3 -3
- package/dist/cjs/index.js +6 -6
- package/dist/cjs/m.js +2 -2
- package/dist/cjs/mini.js +1 -1
- package/dist/es/animation/animate/subject.mjs +1 -1
- package/dist/es/animation/animators/waapi/animate-elements.mjs +1 -1
- package/dist/es/animation/sequence/create.mjs +1 -1
- package/dist/es/components/Reorder/Group.mjs +1 -1
- package/dist/es/components/Reorder/Item.mjs +1 -1
- package/dist/es/gestures/drag/VisualElementDragControls.mjs +1 -1
- package/dist/es/motion/index.mjs +2 -2
- package/dist/framer-motion.dev.js +28 -23
- package/package.json +4 -4
package/dist/cjs/client.js
CHANGED
|
@@ -4827,7 +4827,7 @@ class VisualElementDragControls {
|
|
|
4827
4827
|
if (!constraints || !isRefObject(constraints))
|
|
4828
4828
|
return false;
|
|
4829
4829
|
const constraintsElement = constraints.current;
|
|
4830
|
-
motionUtils.invariant(constraintsElement !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");
|
|
4830
|
+
motionUtils.invariant(constraintsElement !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.", "drag-constraints-ref");
|
|
4831
4831
|
const { projection } = this.visualElement;
|
|
4832
4832
|
// TODO
|
|
4833
4833
|
if (!projection || !projection.layout)
|
|
@@ -5752,8 +5752,8 @@ function useStrictMode(configAndProps, preloadedFeatures) {
|
|
|
5752
5752
|
isStrict) {
|
|
5753
5753
|
const strictMessage = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";
|
|
5754
5754
|
configAndProps.ignoreStrict
|
|
5755
|
-
? motionUtils.warning(false, strictMessage)
|
|
5756
|
-
: motionUtils.invariant(false, strictMessage);
|
|
5755
|
+
? motionUtils.warning(false, strictMessage, "lazy-strict-mode")
|
|
5756
|
+
: motionUtils.invariant(false, strictMessage, "lazy-strict-mode");
|
|
5757
5757
|
}
|
|
5758
5758
|
}
|
|
5759
5759
|
function getProjectionFunctionality(props) {
|
package/dist/cjs/dom-mini.js
CHANGED
|
@@ -205,7 +205,7 @@ function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...seq
|
|
|
205
205
|
* Handle repeat options
|
|
206
206
|
*/
|
|
207
207
|
if (repeat) {
|
|
208
|
-
motionUtils.invariant(repeat < MAX_REPEAT, "Repeat count too high, must be less than 20");
|
|
208
|
+
motionUtils.invariant(repeat < MAX_REPEAT, "Repeat count too high, must be less than 20", "repeat-count-high");
|
|
209
209
|
duration = calculateRepeatDuration(duration, repeat);
|
|
210
210
|
const originalKeyframes = [...valueKeyframesAsList];
|
|
211
211
|
const originalTimes = [...times];
|
|
@@ -343,7 +343,7 @@ const isNumberKeyframesArray = (keyframes) => keyframes.every(isNumber);
|
|
|
343
343
|
function animateElements(elementOrSelector, keyframes, options, scope) {
|
|
344
344
|
const elements = motionDom.resolveElements(elementOrSelector, scope);
|
|
345
345
|
const numElements = elements.length;
|
|
346
|
-
motionUtils.invariant(Boolean(numElements), "No valid
|
|
346
|
+
motionUtils.invariant(Boolean(numElements), "No valid elements provided.", "no-valid-elements");
|
|
347
347
|
/**
|
|
348
348
|
* WAAPI doesn't support interrupting animations.
|
|
349
349
|
*
|
package/dist/cjs/dom.js
CHANGED
|
@@ -205,7 +205,7 @@ function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...seq
|
|
|
205
205
|
* Handle repeat options
|
|
206
206
|
*/
|
|
207
207
|
if (repeat) {
|
|
208
|
-
motionUtils.invariant(repeat < MAX_REPEAT, "Repeat count too high, must be less than 20");
|
|
208
|
+
motionUtils.invariant(repeat < MAX_REPEAT, "Repeat count too high, must be less than 20", "repeat-count-high");
|
|
209
209
|
duration = calculateRepeatDuration(duration, repeat);
|
|
210
210
|
const originalKeyframes = [...valueKeyframesAsList];
|
|
211
211
|
const originalTimes = [...times];
|
|
@@ -1781,7 +1781,7 @@ function animateSubject(subject, keyframes, options, scope) {
|
|
|
1781
1781
|
else {
|
|
1782
1782
|
const subjects = resolveSubjects(subject, keyframes, scope);
|
|
1783
1783
|
const numSubjects = subjects.length;
|
|
1784
|
-
motionUtils.invariant(Boolean(numSubjects), "No valid elements provided.");
|
|
1784
|
+
motionUtils.invariant(Boolean(numSubjects), "No valid elements provided.", "no-valid-elements");
|
|
1785
1785
|
for (let i = 0; i < numSubjects; i++) {
|
|
1786
1786
|
const thisSubject = subjects[i];
|
|
1787
1787
|
const createVisualElement = thisSubject instanceof Element
|
|
@@ -1849,7 +1849,7 @@ const animate = createScopedAnimate();
|
|
|
1849
1849
|
function animateElements(elementOrSelector, keyframes, options, scope) {
|
|
1850
1850
|
const elements = motionDom.resolveElements(elementOrSelector, scope);
|
|
1851
1851
|
const numElements = elements.length;
|
|
1852
|
-
motionUtils.invariant(Boolean(numElements), "No valid
|
|
1852
|
+
motionUtils.invariant(Boolean(numElements), "No valid elements provided.", "no-valid-elements");
|
|
1853
1853
|
/**
|
|
1854
1854
|
* WAAPI doesn't support interrupting animations.
|
|
1855
1855
|
*
|
package/dist/cjs/index.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var React = require('react');
|
|
7
|
-
var create = require('./create-
|
|
7
|
+
var create = require('./create-Ch9BUY4E.js');
|
|
8
8
|
var motionDom = require('motion-dom');
|
|
9
9
|
var motionUtils = require('motion-utils');
|
|
10
10
|
|
|
@@ -571,7 +571,7 @@ function ReorderGroupComponent({ children, as = "ul", axis = "y", onReorder, val
|
|
|
571
571
|
const Component = create.useConstant(() => motion[as]);
|
|
572
572
|
const order = [];
|
|
573
573
|
const isReordering = React.useRef(false);
|
|
574
|
-
motionUtils.invariant(Boolean(values), "Reorder.Group must be provided a values prop");
|
|
574
|
+
motionUtils.invariant(Boolean(values), "Reorder.Group must be provided a values prop", "reorder-values");
|
|
575
575
|
const context = {
|
|
576
576
|
axis,
|
|
577
577
|
registerItem: (value, layout) => {
|
|
@@ -723,7 +723,7 @@ function ReorderItemComponent({ children, style = {}, value, as = "li", onDrag,
|
|
|
723
723
|
y: useDefaultMotionValue(style.y),
|
|
724
724
|
};
|
|
725
725
|
const zIndex = useTransform([point.x, point.y], ([latestX, latestY]) => latestX || latestY ? 1 : "unset");
|
|
726
|
-
motionUtils.invariant(Boolean(context), "Reorder.Item must be a child of Reorder.Group");
|
|
726
|
+
motionUtils.invariant(Boolean(context), "Reorder.Item must be a child of Reorder.Group", "reorder-item-child");
|
|
727
727
|
const { axis, registerItem, updateOrder } = context;
|
|
728
728
|
return (jsxRuntime.jsx(Component, { drag: axis, ...props, dragSnapToOrigin: true, style: { ...style, x: point.x, y: point.y, zIndex }, layout: layout, onDrag: (event, gesturePoint) => {
|
|
729
729
|
const { velocity } = gesturePoint;
|
|
@@ -940,7 +940,7 @@ function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...seq
|
|
|
940
940
|
* Handle repeat options
|
|
941
941
|
*/
|
|
942
942
|
if (repeat) {
|
|
943
|
-
motionUtils.invariant(repeat < MAX_REPEAT, "Repeat count too high, must be less than 20");
|
|
943
|
+
motionUtils.invariant(repeat < MAX_REPEAT, "Repeat count too high, must be less than 20", "repeat-count-high");
|
|
944
944
|
duration = calculateRepeatDuration(duration, repeat);
|
|
945
945
|
const originalKeyframes = [...valueKeyframesAsList];
|
|
946
946
|
const originalTimes = [...times];
|
|
@@ -1167,7 +1167,7 @@ function animateSubject(subject, keyframes, options, scope) {
|
|
|
1167
1167
|
else {
|
|
1168
1168
|
const subjects = resolveSubjects(subject, keyframes, scope);
|
|
1169
1169
|
const numSubjects = subjects.length;
|
|
1170
|
-
motionUtils.invariant(Boolean(numSubjects), "No valid elements provided.");
|
|
1170
|
+
motionUtils.invariant(Boolean(numSubjects), "No valid elements provided.", "no-valid-elements");
|
|
1171
1171
|
for (let i = 0; i < numSubjects; i++) {
|
|
1172
1172
|
const thisSubject = subjects[i];
|
|
1173
1173
|
const createVisualElement = thisSubject instanceof Element
|
|
@@ -1235,7 +1235,7 @@ const animate = createScopedAnimate();
|
|
|
1235
1235
|
function animateElements(elementOrSelector, keyframes, options, scope) {
|
|
1236
1236
|
const elements = motionDom.resolveElements(elementOrSelector, scope);
|
|
1237
1237
|
const numElements = elements.length;
|
|
1238
|
-
motionUtils.invariant(Boolean(numElements), "No valid
|
|
1238
|
+
motionUtils.invariant(Boolean(numElements), "No valid elements provided.", "no-valid-elements");
|
|
1239
1239
|
/**
|
|
1240
1240
|
* WAAPI doesn't support interrupting animations.
|
|
1241
1241
|
*
|
package/dist/cjs/m.js
CHANGED
|
@@ -364,8 +364,8 @@ function useStrictMode(configAndProps, preloadedFeatures) {
|
|
|
364
364
|
isStrict) {
|
|
365
365
|
const strictMessage = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";
|
|
366
366
|
configAndProps.ignoreStrict
|
|
367
|
-
? motionUtils.warning(false, strictMessage)
|
|
368
|
-
: motionUtils.invariant(false, strictMessage);
|
|
367
|
+
? motionUtils.warning(false, strictMessage, "lazy-strict-mode")
|
|
368
|
+
: motionUtils.invariant(false, strictMessage, "lazy-strict-mode");
|
|
369
369
|
}
|
|
370
370
|
}
|
|
371
371
|
function getProjectionFunctionality(props) {
|
package/dist/cjs/mini.js
CHANGED
|
@@ -28,7 +28,7 @@ function useUnmountEffect(callback) {
|
|
|
28
28
|
function animateElements(elementOrSelector, keyframes, options, scope) {
|
|
29
29
|
const elements = motionDom.resolveElements(elementOrSelector, scope);
|
|
30
30
|
const numElements = elements.length;
|
|
31
|
-
motionUtils.invariant(Boolean(numElements), "No valid
|
|
31
|
+
motionUtils.invariant(Boolean(numElements), "No valid elements provided.", "no-valid-elements");
|
|
32
32
|
/**
|
|
33
33
|
* WAAPI doesn't support interrupting animations.
|
|
34
34
|
*
|
|
@@ -25,7 +25,7 @@ function animateSubject(subject, keyframes, options, scope) {
|
|
|
25
25
|
else {
|
|
26
26
|
const subjects = resolveSubjects(subject, keyframes, scope);
|
|
27
27
|
const numSubjects = subjects.length;
|
|
28
|
-
invariant(Boolean(numSubjects), "No valid elements provided.");
|
|
28
|
+
invariant(Boolean(numSubjects), "No valid elements provided.", "no-valid-elements");
|
|
29
29
|
for (let i = 0; i < numSubjects; i++) {
|
|
30
30
|
const thisSubject = subjects[i];
|
|
31
31
|
const createVisualElement = thisSubject instanceof Element
|
|
@@ -4,7 +4,7 @@ import { invariant, secondsToMilliseconds } from 'motion-utils';
|
|
|
4
4
|
function animateElements(elementOrSelector, keyframes, options, scope) {
|
|
5
5
|
const elements = resolveElements(elementOrSelector, scope);
|
|
6
6
|
const numElements = elements.length;
|
|
7
|
-
invariant(Boolean(numElements), "No valid
|
|
7
|
+
invariant(Boolean(numElements), "No valid elements provided.", "no-valid-elements");
|
|
8
8
|
/**
|
|
9
9
|
* WAAPI doesn't support interrupting animations.
|
|
10
10
|
*
|
|
@@ -111,7 +111,7 @@ function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...seq
|
|
|
111
111
|
* Handle repeat options
|
|
112
112
|
*/
|
|
113
113
|
if (repeat) {
|
|
114
|
-
invariant(repeat < MAX_REPEAT, "Repeat count too high, must be less than 20");
|
|
114
|
+
invariant(repeat < MAX_REPEAT, "Repeat count too high, must be less than 20", "repeat-count-high");
|
|
115
115
|
duration = calculateRepeatDuration(duration, repeat);
|
|
116
116
|
const originalKeyframes = [...valueKeyframesAsList];
|
|
117
117
|
const originalTimes = [...times];
|
|
@@ -11,7 +11,7 @@ function ReorderGroupComponent({ children, as = "ul", axis = "y", onReorder, val
|
|
|
11
11
|
const Component = useConstant(() => motion[as]);
|
|
12
12
|
const order = [];
|
|
13
13
|
const isReordering = useRef(false);
|
|
14
|
-
invariant(Boolean(values), "Reorder.Group must be provided a values prop");
|
|
14
|
+
invariant(Boolean(values), "Reorder.Group must be provided a values prop", "reorder-values");
|
|
15
15
|
const context = {
|
|
16
16
|
axis,
|
|
17
17
|
registerItem: (value, layout) => {
|
|
@@ -20,7 +20,7 @@ function ReorderItemComponent({ children, style = {}, value, as = "li", onDrag,
|
|
|
20
20
|
y: useDefaultMotionValue(style.y),
|
|
21
21
|
};
|
|
22
22
|
const zIndex = useTransform([point.x, point.y], ([latestX, latestY]) => latestX || latestY ? 1 : "unset");
|
|
23
|
-
invariant(Boolean(context), "Reorder.Item must be a child of Reorder.Group");
|
|
23
|
+
invariant(Boolean(context), "Reorder.Item must be a child of Reorder.Group", "reorder-item-child");
|
|
24
24
|
const { axis, registerItem, updateOrder } = context;
|
|
25
25
|
return (jsx(Component, { drag: axis, ...props, dragSnapToOrigin: true, style: { ...style, x: point.x, y: point.y, zIndex }, layout: layout, onDrag: (event, gesturePoint) => {
|
|
26
26
|
const { velocity } = gesturePoint;
|
|
@@ -251,7 +251,7 @@ class VisualElementDragControls {
|
|
|
251
251
|
if (!constraints || !isRefObject(constraints))
|
|
252
252
|
return false;
|
|
253
253
|
const constraintsElement = constraints.current;
|
|
254
|
-
invariant(constraintsElement !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");
|
|
254
|
+
invariant(constraintsElement !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.", "drag-constraints-ref");
|
|
255
255
|
const { projection } = this.visualElement;
|
|
256
256
|
// TODO
|
|
257
257
|
if (!projection || !projection.layout)
|
package/dist/es/motion/index.mjs
CHANGED
|
@@ -81,8 +81,8 @@ function useStrictMode(configAndProps, preloadedFeatures) {
|
|
|
81
81
|
isStrict) {
|
|
82
82
|
const strictMessage = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";
|
|
83
83
|
configAndProps.ignoreStrict
|
|
84
|
-
? warning(false, strictMessage)
|
|
85
|
-
: invariant(false, strictMessage);
|
|
84
|
+
? warning(false, strictMessage, "lazy-strict-mode")
|
|
85
|
+
: invariant(false, strictMessage, "lazy-strict-mode");
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
function getProjectionFunctionality(props) {
|
|
@@ -114,14 +114,19 @@
|
|
|
114
114
|
exports.warning = () => { };
|
|
115
115
|
exports.invariant = () => { };
|
|
116
116
|
{
|
|
117
|
-
|
|
117
|
+
const formatMessage = (message, errorCode) => {
|
|
118
|
+
return errorCode
|
|
119
|
+
? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}`
|
|
120
|
+
: message;
|
|
121
|
+
};
|
|
122
|
+
exports.warning = (check, message, errorCode) => {
|
|
118
123
|
if (!check && typeof console !== "undefined") {
|
|
119
|
-
console.warn(message);
|
|
124
|
+
console.warn(formatMessage(message, errorCode));
|
|
120
125
|
}
|
|
121
126
|
};
|
|
122
|
-
exports.invariant = (check, message) => {
|
|
127
|
+
exports.invariant = (check, message, errorCode) => {
|
|
123
128
|
if (!check) {
|
|
124
|
-
throw new Error(message);
|
|
129
|
+
throw new Error(formatMessage(message, errorCode));
|
|
125
130
|
}
|
|
126
131
|
};
|
|
127
132
|
}
|
|
@@ -370,13 +375,13 @@
|
|
|
370
375
|
const easingDefinitionToFunction = (definition) => {
|
|
371
376
|
if (isBezierDefinition(definition)) {
|
|
372
377
|
// If cubic bezier definition, create bezier curve
|
|
373
|
-
exports.invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values
|
|
378
|
+
exports.invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`, "cubic-bezier-length");
|
|
374
379
|
const [x1, y1, x2, y2] = definition;
|
|
375
380
|
return cubicBezier(x1, y1, x2, y2);
|
|
376
381
|
}
|
|
377
382
|
else if (isValidEasing(definition)) {
|
|
378
383
|
// Else lookup from table
|
|
379
|
-
exports.invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'
|
|
384
|
+
exports.invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'`, "invalid-easing-type");
|
|
380
385
|
return easingLookup[definition];
|
|
381
386
|
}
|
|
382
387
|
return definition;
|
|
@@ -936,7 +941,7 @@
|
|
|
936
941
|
const getColorType = (v) => colorTypes.find((type) => type.test(v));
|
|
937
942
|
function asRGBA(color) {
|
|
938
943
|
const type = getColorType(color);
|
|
939
|
-
exports.warning(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead
|
|
944
|
+
exports.warning(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`, "color-not-animatable");
|
|
940
945
|
if (!Boolean(type))
|
|
941
946
|
return false;
|
|
942
947
|
let model = type.parse(color);
|
|
@@ -1054,7 +1059,7 @@
|
|
|
1054
1059
|
return pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template);
|
|
1055
1060
|
}
|
|
1056
1061
|
else {
|
|
1057
|
-
exports.warning(true, `Complex values '${origin}' and '${target}' 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
|
|
1062
|
+
exports.warning(true, `Complex values '${origin}' and '${target}' 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.`, "complex-values-different");
|
|
1058
1063
|
return mixImmediate(origin, target);
|
|
1059
1064
|
}
|
|
1060
1065
|
};
|
|
@@ -1160,7 +1165,7 @@
|
|
|
1160
1165
|
function findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass, }) {
|
|
1161
1166
|
let envelope;
|
|
1162
1167
|
let derivative;
|
|
1163
|
-
exports.warning(duration <= secondsToMilliseconds(springDefaults.maxDuration), "Spring duration must be 10 seconds or less");
|
|
1168
|
+
exports.warning(duration <= secondsToMilliseconds(springDefaults.maxDuration), "Spring duration must be 10 seconds or less", "spring-duration-limit");
|
|
1164
1169
|
let dampingRatio = 1 - bounce;
|
|
1165
1170
|
/**
|
|
1166
1171
|
* Restrict dampingRatio and duration to within acceptable ranges.
|
|
@@ -1520,7 +1525,7 @@
|
|
|
1520
1525
|
*/
|
|
1521
1526
|
function interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) {
|
|
1522
1527
|
const inputLength = input.length;
|
|
1523
|
-
exports.invariant(inputLength === output.length, "Both input and output ranges must be the same length");
|
|
1528
|
+
exports.invariant(inputLength === output.length, "Both input and output ranges must be the same length", "range-length");
|
|
1524
1529
|
/**
|
|
1525
1530
|
* If we're only provided a single input, we can just make a function
|
|
1526
1531
|
* that returns the output.
|
|
@@ -1712,7 +1717,7 @@
|
|
|
1712
1717
|
let { keyframes: keyframes$1 } = options;
|
|
1713
1718
|
const generatorFactory = type || keyframes;
|
|
1714
1719
|
if (generatorFactory !== keyframes) {
|
|
1715
|
-
exports.invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}
|
|
1720
|
+
exports.invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`, "spring-two-frames");
|
|
1716
1721
|
}
|
|
1717
1722
|
if (generatorFactory !== keyframes &&
|
|
1718
1723
|
typeof keyframes$1[0] !== "number") {
|
|
@@ -2413,7 +2418,7 @@
|
|
|
2413
2418
|
this.isPseudoElement = Boolean(pseudoElement);
|
|
2414
2419
|
this.allowFlatten = allowFlatten;
|
|
2415
2420
|
this.options = options;
|
|
2416
|
-
exports.invariant(typeof options.type !== "string", `
|
|
2421
|
+
exports.invariant(typeof options.type !== "string", `Mini animate() doesn't support "type" as a string.`, "mini-spring");
|
|
2417
2422
|
const transition = applyGeneratorOptions(options);
|
|
2418
2423
|
this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement);
|
|
2419
2424
|
if (transition.autoplay === false) {
|
|
@@ -2629,7 +2634,7 @@
|
|
|
2629
2634
|
* @internal
|
|
2630
2635
|
*/
|
|
2631
2636
|
const isAnimatable = (value, name) => {
|
|
2632
|
-
// If the list of keys
|
|
2637
|
+
// If the list of keys that might be non-animatable grows, replace with Set
|
|
2633
2638
|
if (name === "zIndex")
|
|
2634
2639
|
return false;
|
|
2635
2640
|
// If it's a number or a keyframes array, we can animate it. We might at some point
|
|
@@ -2674,7 +2679,7 @@
|
|
|
2674
2679
|
const targetKeyframe = keyframes[keyframes.length - 1];
|
|
2675
2680
|
const isOriginAnimatable = isAnimatable(originKeyframe, name);
|
|
2676
2681
|
const isTargetAnimatable = isAnimatable(targetKeyframe, name);
|
|
2677
|
-
exports.warning(isOriginAnimatable === isTargetAnimatable, `You are trying to animate ${name} from "${originKeyframe}" to "${targetKeyframe}". ${originKeyframe} is not an animatable value -
|
|
2682
|
+
exports.warning(isOriginAnimatable === isTargetAnimatable, `You are trying to animate ${name} from "${originKeyframe}" to "${targetKeyframe}". "${isOriginAnimatable ? targetKeyframe : originKeyframe}" is not an animatable value.`, "value-not-animatable");
|
|
2678
2683
|
// Always skip if any of these are true
|
|
2679
2684
|
if (!isOriginAnimatable || !isTargetAnimatable) {
|
|
2680
2685
|
return false;
|
|
@@ -3004,7 +3009,7 @@
|
|
|
3004
3009
|
}
|
|
3005
3010
|
const maxDepth = 4;
|
|
3006
3011
|
function getVariableValue(current, element, depth = 1) {
|
|
3007
|
-
exports.invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property "${current}". This may indicate a circular fallback dependency
|
|
3012
|
+
exports.invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property "${current}". This may indicate a circular fallback dependency.`, "max-css-var-depth");
|
|
3008
3013
|
const [token, fallback] = parseCSSVariable(current);
|
|
3009
3014
|
// No CSS variable detected
|
|
3010
3015
|
if (!token)
|
|
@@ -10325,7 +10330,7 @@
|
|
|
10325
10330
|
if (!constraints || !isRefObject(constraints))
|
|
10326
10331
|
return false;
|
|
10327
10332
|
const constraintsElement = constraints.current;
|
|
10328
|
-
exports.invariant(constraintsElement !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");
|
|
10333
|
+
exports.invariant(constraintsElement !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.", "drag-constraints-ref");
|
|
10329
10334
|
const { projection } = this.visualElement;
|
|
10330
10335
|
// TODO
|
|
10331
10336
|
if (!projection || !projection.layout)
|
|
@@ -11249,8 +11254,8 @@
|
|
|
11249
11254
|
isStrict) {
|
|
11250
11255
|
const strictMessage = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";
|
|
11251
11256
|
configAndProps.ignoreStrict
|
|
11252
|
-
? exports.warning(false, strictMessage)
|
|
11253
|
-
: exports.invariant(false, strictMessage);
|
|
11257
|
+
? exports.warning(false, strictMessage, "lazy-strict-mode")
|
|
11258
|
+
: exports.invariant(false, strictMessage, "lazy-strict-mode");
|
|
11254
11259
|
}
|
|
11255
11260
|
}
|
|
11256
11261
|
function getProjectionFunctionality(props) {
|
|
@@ -11736,7 +11741,7 @@
|
|
|
11736
11741
|
const Component = useConstant(() => motion[as]);
|
|
11737
11742
|
const order = [];
|
|
11738
11743
|
const isReordering = React$1.useRef(false);
|
|
11739
|
-
exports.invariant(Boolean(values), "Reorder.Group must be provided a values prop");
|
|
11744
|
+
exports.invariant(Boolean(values), "Reorder.Group must be provided a values prop", "reorder-values");
|
|
11740
11745
|
const context = {
|
|
11741
11746
|
axis,
|
|
11742
11747
|
registerItem: (value, layout) => {
|
|
@@ -11888,7 +11893,7 @@
|
|
|
11888
11893
|
y: useDefaultMotionValue(style.y),
|
|
11889
11894
|
};
|
|
11890
11895
|
const zIndex = useTransform([point.x, point.y], ([latestX, latestY]) => latestX || latestY ? 1 : "unset");
|
|
11891
|
-
exports.invariant(Boolean(context), "Reorder.Item must be a child of Reorder.Group");
|
|
11896
|
+
exports.invariant(Boolean(context), "Reorder.Item must be a child of Reorder.Group", "reorder-item-child");
|
|
11892
11897
|
const { axis, registerItem, updateOrder } = context;
|
|
11893
11898
|
return (jsx(Component, { drag: axis, ...props, dragSnapToOrigin: true, style: { ...style, x: point.x, y: point.y, zIndex }, layout: layout, onDrag: (event, gesturePoint) => {
|
|
11894
11899
|
const { velocity } = gesturePoint;
|
|
@@ -12105,7 +12110,7 @@
|
|
|
12105
12110
|
* Handle repeat options
|
|
12106
12111
|
*/
|
|
12107
12112
|
if (repeat) {
|
|
12108
|
-
exports.invariant(repeat < MAX_REPEAT, "Repeat count too high, must be less than 20");
|
|
12113
|
+
exports.invariant(repeat < MAX_REPEAT, "Repeat count too high, must be less than 20", "repeat-count-high");
|
|
12109
12114
|
duration = calculateRepeatDuration(duration, repeat);
|
|
12110
12115
|
const originalKeyframes = [...valueKeyframesAsList];
|
|
12111
12116
|
const originalTimes = [...times];
|
|
@@ -12332,7 +12337,7 @@
|
|
|
12332
12337
|
else {
|
|
12333
12338
|
const subjects = resolveSubjects(subject, keyframes, scope);
|
|
12334
12339
|
const numSubjects = subjects.length;
|
|
12335
|
-
exports.invariant(Boolean(numSubjects), "No valid elements provided.");
|
|
12340
|
+
exports.invariant(Boolean(numSubjects), "No valid elements provided.", "no-valid-elements");
|
|
12336
12341
|
for (let i = 0; i < numSubjects; i++) {
|
|
12337
12342
|
const thisSubject = subjects[i];
|
|
12338
12343
|
const createVisualElement = thisSubject instanceof Element
|
|
@@ -12400,7 +12405,7 @@
|
|
|
12400
12405
|
function animateElements(elementOrSelector, keyframes, options, scope) {
|
|
12401
12406
|
const elements = resolveElements(elementOrSelector, scope);
|
|
12402
12407
|
const numElements = elements.length;
|
|
12403
|
-
exports.invariant(Boolean(numElements), "No valid
|
|
12408
|
+
exports.invariant(Boolean(numElements), "No valid elements provided.", "no-valid-elements");
|
|
12404
12409
|
/**
|
|
12405
12410
|
* WAAPI doesn't support interrupting animations.
|
|
12406
12411
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "framer-motion",
|
|
3
|
-
"version": "12.23.
|
|
3
|
+
"version": "12.23.2",
|
|
4
4
|
"description": "A simple and powerful JavaScript animation library",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/es/index.mjs",
|
|
@@ -87,8 +87,8 @@
|
|
|
87
87
|
"measure": "rollup -c ./rollup.size.config.mjs"
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
|
-
"motion-dom": "^12.
|
|
91
|
-
"motion-utils": "^12.
|
|
90
|
+
"motion-dom": "^12.23.2",
|
|
91
|
+
"motion-utils": "^12.23.2",
|
|
92
92
|
"tslib": "^2.4.0"
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
@@ -142,5 +142,5 @@
|
|
|
142
142
|
"maxSize": "2.26 kB"
|
|
143
143
|
}
|
|
144
144
|
],
|
|
145
|
-
"gitHead": "
|
|
145
|
+
"gitHead": "17e0e4150c125139bb41f16e2db297683b9e6513"
|
|
146
146
|
}
|