framer-motion 12.23.1 → 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/index.js +2 -2
- package/dist/cjs/m.js +2 -2
- package/dist/es/components/Reorder/Group.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 +15 -15
- 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/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) => {
|
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) {
|
|
@@ -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) => {
|
|
@@ -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) {
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
{
|
|
117
117
|
const formatMessage = (message, errorCode) => {
|
|
118
118
|
return errorCode
|
|
119
|
-
? `${message}. For more information and steps for solving, visit https://motion.dev/
|
|
119
|
+
? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}`
|
|
120
120
|
: message;
|
|
121
121
|
};
|
|
122
122
|
exports.warning = (check, message, errorCode) => {
|
|
@@ -375,13 +375,13 @@
|
|
|
375
375
|
const easingDefinitionToFunction = (definition) => {
|
|
376
376
|
if (isBezierDefinition(definition)) {
|
|
377
377
|
// If cubic bezier definition, create bezier curve
|
|
378
|
-
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");
|
|
379
379
|
const [x1, y1, x2, y2] = definition;
|
|
380
380
|
return cubicBezier(x1, y1, x2, y2);
|
|
381
381
|
}
|
|
382
382
|
else if (isValidEasing(definition)) {
|
|
383
383
|
// Else lookup from table
|
|
384
|
-
exports.invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'
|
|
384
|
+
exports.invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'`, "invalid-easing-type");
|
|
385
385
|
return easingLookup[definition];
|
|
386
386
|
}
|
|
387
387
|
return definition;
|
|
@@ -941,7 +941,7 @@
|
|
|
941
941
|
const getColorType = (v) => colorTypes.find((type) => type.test(v));
|
|
942
942
|
function asRGBA(color) {
|
|
943
943
|
const type = getColorType(color);
|
|
944
|
-
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");
|
|
945
945
|
if (!Boolean(type))
|
|
946
946
|
return false;
|
|
947
947
|
let model = type.parse(color);
|
|
@@ -1059,7 +1059,7 @@
|
|
|
1059
1059
|
return pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template);
|
|
1060
1060
|
}
|
|
1061
1061
|
else {
|
|
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
|
|
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");
|
|
1063
1063
|
return mixImmediate(origin, target);
|
|
1064
1064
|
}
|
|
1065
1065
|
};
|
|
@@ -1165,7 +1165,7 @@
|
|
|
1165
1165
|
function findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass, }) {
|
|
1166
1166
|
let envelope;
|
|
1167
1167
|
let derivative;
|
|
1168
|
-
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");
|
|
1169
1169
|
let dampingRatio = 1 - bounce;
|
|
1170
1170
|
/**
|
|
1171
1171
|
* Restrict dampingRatio and duration to within acceptable ranges.
|
|
@@ -1525,7 +1525,7 @@
|
|
|
1525
1525
|
*/
|
|
1526
1526
|
function interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) {
|
|
1527
1527
|
const inputLength = input.length;
|
|
1528
|
-
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");
|
|
1529
1529
|
/**
|
|
1530
1530
|
* If we're only provided a single input, we can just make a function
|
|
1531
1531
|
* that returns the output.
|
|
@@ -2418,7 +2418,7 @@
|
|
|
2418
2418
|
this.isPseudoElement = Boolean(pseudoElement);
|
|
2419
2419
|
this.allowFlatten = allowFlatten;
|
|
2420
2420
|
this.options = options;
|
|
2421
|
-
exports.invariant(typeof options.type !== "string", `
|
|
2421
|
+
exports.invariant(typeof options.type !== "string", `Mini animate() doesn't support "type" as a string.`, "mini-spring");
|
|
2422
2422
|
const transition = applyGeneratorOptions(options);
|
|
2423
2423
|
this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement);
|
|
2424
2424
|
if (transition.autoplay === false) {
|
|
@@ -2634,7 +2634,7 @@
|
|
|
2634
2634
|
* @internal
|
|
2635
2635
|
*/
|
|
2636
2636
|
const isAnimatable = (value, name) => {
|
|
2637
|
-
// If the list of keys
|
|
2637
|
+
// If the list of keys that might be non-animatable grows, replace with Set
|
|
2638
2638
|
if (name === "zIndex")
|
|
2639
2639
|
return false;
|
|
2640
2640
|
// If it's a number or a keyframes array, we can animate it. We might at some point
|
|
@@ -2679,7 +2679,7 @@
|
|
|
2679
2679
|
const targetKeyframe = keyframes[keyframes.length - 1];
|
|
2680
2680
|
const isOriginAnimatable = isAnimatable(originKeyframe, name);
|
|
2681
2681
|
const isTargetAnimatable = isAnimatable(targetKeyframe, name);
|
|
2682
|
-
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");
|
|
2683
2683
|
// Always skip if any of these are true
|
|
2684
2684
|
if (!isOriginAnimatable || !isTargetAnimatable) {
|
|
2685
2685
|
return false;
|
|
@@ -3009,7 +3009,7 @@
|
|
|
3009
3009
|
}
|
|
3010
3010
|
const maxDepth = 4;
|
|
3011
3011
|
function getVariableValue(current, element, depth = 1) {
|
|
3012
|
-
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");
|
|
3013
3013
|
const [token, fallback] = parseCSSVariable(current);
|
|
3014
3014
|
// No CSS variable detected
|
|
3015
3015
|
if (!token)
|
|
@@ -10330,7 +10330,7 @@
|
|
|
10330
10330
|
if (!constraints || !isRefObject(constraints))
|
|
10331
10331
|
return false;
|
|
10332
10332
|
const constraintsElement = constraints.current;
|
|
10333
|
-
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");
|
|
10334
10334
|
const { projection } = this.visualElement;
|
|
10335
10335
|
// TODO
|
|
10336
10336
|
if (!projection || !projection.layout)
|
|
@@ -11254,8 +11254,8 @@
|
|
|
11254
11254
|
isStrict) {
|
|
11255
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.";
|
|
11256
11256
|
configAndProps.ignoreStrict
|
|
11257
|
-
? exports.warning(false, strictMessage)
|
|
11258
|
-
: exports.invariant(false, strictMessage);
|
|
11257
|
+
? exports.warning(false, strictMessage, "lazy-strict-mode")
|
|
11258
|
+
: exports.invariant(false, strictMessage, "lazy-strict-mode");
|
|
11259
11259
|
}
|
|
11260
11260
|
}
|
|
11261
11261
|
function getProjectionFunctionality(props) {
|
|
@@ -11741,7 +11741,7 @@
|
|
|
11741
11741
|
const Component = useConstant(() => motion[as]);
|
|
11742
11742
|
const order = [];
|
|
11743
11743
|
const isReordering = React$1.useRef(false);
|
|
11744
|
-
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");
|
|
11745
11745
|
const context = {
|
|
11746
11746
|
axis,
|
|
11747
11747
|
registerItem: (value, layout) => {
|
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.23.
|
|
91
|
-
"motion-utils": "^12.23.
|
|
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
|
}
|