framer-motion 12.23.0 → 12.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/dom-mini.js +2 -2
- package/dist/cjs/dom.js +3 -3
- package/dist/cjs/index.js +4 -4
- 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/Item.mjs +1 -1
- package/dist/framer-motion.dev.js +14 -9
- package/package.json +4 -4
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
|
@@ -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/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];
|
|
@@ -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;
|
|
@@ -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/error/${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
|
}
|
|
@@ -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") {
|
|
@@ -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.1",
|
|
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.1",
|
|
91
|
+
"motion-utils": "^12.23.1",
|
|
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": "6cd3f6ce7b40efb7d50d95f252ec44a31edceee7"
|
|
146
146
|
}
|