framer-motion 7.5.2 → 7.5.3
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 +29 -3
- package/dist/es/render/index.mjs +28 -1
- package/dist/es/render/utils/motion-values.mjs +1 -1
- package/dist/es/value/index.mjs +1 -1
- package/dist/framer-motion.dev.js +29 -3
- package/dist/framer-motion.js +1 -1
- package/dist/projection.dev.js +54 -3
- package/dist/size-rollup-dom-animation.js +1 -1
- package/dist/size-rollup-dom-max.js +1 -1
- package/dist/size-rollup-motion.js +1 -1
- package/dist/size-webpack-dom-animation.js +1 -1
- package/dist/size-webpack-dom-max.js +1 -1
- package/package.json +5 -5
package/dist/cjs/index.js
CHANGED
|
@@ -2245,7 +2245,7 @@ class MotionValue {
|
|
|
2245
2245
|
* This will be replaced by the build step with the latest version number.
|
|
2246
2246
|
* When MotionValues are provided to motion components, warn if versions are mixed.
|
|
2247
2247
|
*/
|
|
2248
|
-
this.version = "7.5.
|
|
2248
|
+
this.version = "7.5.3";
|
|
2249
2249
|
/**
|
|
2250
2250
|
* Duration, in milliseconds, since last updating frame.
|
|
2251
2251
|
*
|
|
@@ -4221,7 +4221,7 @@ function updateMotionValuesFromProps(element, next, prev) {
|
|
|
4221
4221
|
* and warn against mismatches.
|
|
4222
4222
|
*/
|
|
4223
4223
|
if (process.env.NODE_ENV === "development") {
|
|
4224
|
-
warnOnce(nextValue.version === "7.5.
|
|
4224
|
+
warnOnce(nextValue.version === "7.5.3", `Attempting to mix Framer Motion versions ${nextValue.version} with 7.5.3 may not work as expected.`);
|
|
4225
4225
|
}
|
|
4226
4226
|
}
|
|
4227
4227
|
else if (isMotionValue(prevValue)) {
|
|
@@ -4300,6 +4300,10 @@ const visualElement = ({ treeType = "", build, getBaseTarget, makeTargetAnimatab
|
|
|
4300
4300
|
const baseTarget = {
|
|
4301
4301
|
...latestValues,
|
|
4302
4302
|
};
|
|
4303
|
+
/**
|
|
4304
|
+
* Create an object of the values we initially animated from (if initial prop present).
|
|
4305
|
+
*/
|
|
4306
|
+
const initialValues = props.initial ? { ...latestValues } : {};
|
|
4303
4307
|
// Internal methods ========================
|
|
4304
4308
|
/**
|
|
4305
4309
|
* On mount, this will be hydrated with a callback to disconnect
|
|
@@ -4646,12 +4650,34 @@ const visualElement = ({ treeType = "", build, getBaseTarget, makeTargetAnimatab
|
|
|
4646
4650
|
* props.
|
|
4647
4651
|
*/
|
|
4648
4652
|
getBaseTarget(key) {
|
|
4653
|
+
var _a;
|
|
4654
|
+
const { initial } = props;
|
|
4655
|
+
const valueFromInitial = typeof initial === "string" || typeof initial === "object"
|
|
4656
|
+
? (_a = resolveVariantFromProps(props, initial)) === null || _a === void 0 ? void 0 : _a[key]
|
|
4657
|
+
: undefined;
|
|
4658
|
+
/**
|
|
4659
|
+
* If this value still exists in the current initial variant, read that.
|
|
4660
|
+
*/
|
|
4661
|
+
if (initial && valueFromInitial !== undefined) {
|
|
4662
|
+
return valueFromInitial;
|
|
4663
|
+
}
|
|
4664
|
+
/**
|
|
4665
|
+
* Alternatively, if this VisualElement config has defined a getBaseTarget
|
|
4666
|
+
* so we can read the value from an alternative source, try that.
|
|
4667
|
+
*/
|
|
4649
4668
|
if (getBaseTarget) {
|
|
4650
4669
|
const target = getBaseTarget(props, key);
|
|
4651
4670
|
if (target !== undefined && !isMotionValue(target))
|
|
4652
4671
|
return target;
|
|
4653
4672
|
}
|
|
4654
|
-
|
|
4673
|
+
/**
|
|
4674
|
+
* If the value was initially defined on initial, but it doesn't any more,
|
|
4675
|
+
* return undefined. Otherwise return the value as initially read from the DOM.
|
|
4676
|
+
*/
|
|
4677
|
+
return initialValues[key] !== undefined &&
|
|
4678
|
+
valueFromInitial === undefined
|
|
4679
|
+
? undefined
|
|
4680
|
+
: baseTarget[key];
|
|
4655
4681
|
},
|
|
4656
4682
|
// Lifecyles ========================
|
|
4657
4683
|
...lifecycles,
|
package/dist/es/render/index.mjs
CHANGED
|
@@ -14,6 +14,7 @@ import { invariant } from 'hey-listen';
|
|
|
14
14
|
import { featureDefinitions } from '../motion/features/definitions.mjs';
|
|
15
15
|
import { createElement } from 'react';
|
|
16
16
|
import { isRefObject } from '../utils/is-ref-object.mjs';
|
|
17
|
+
import { resolveVariantFromProps } from './utils/resolve-variants.mjs';
|
|
17
18
|
|
|
18
19
|
const featureNames = Object.keys(featureDefinitions);
|
|
19
20
|
const numFeatures = featureNames.length;
|
|
@@ -56,6 +57,10 @@ const visualElement = ({ treeType = "", build, getBaseTarget, makeTargetAnimatab
|
|
|
56
57
|
const baseTarget = {
|
|
57
58
|
...latestValues,
|
|
58
59
|
};
|
|
60
|
+
/**
|
|
61
|
+
* Create an object of the values we initially animated from (if initial prop present).
|
|
62
|
+
*/
|
|
63
|
+
const initialValues = props.initial ? { ...latestValues } : {};
|
|
59
64
|
// Internal methods ========================
|
|
60
65
|
/**
|
|
61
66
|
* On mount, this will be hydrated with a callback to disconnect
|
|
@@ -402,12 +407,34 @@ const visualElement = ({ treeType = "", build, getBaseTarget, makeTargetAnimatab
|
|
|
402
407
|
* props.
|
|
403
408
|
*/
|
|
404
409
|
getBaseTarget(key) {
|
|
410
|
+
var _a;
|
|
411
|
+
const { initial } = props;
|
|
412
|
+
const valueFromInitial = typeof initial === "string" || typeof initial === "object"
|
|
413
|
+
? (_a = resolveVariantFromProps(props, initial)) === null || _a === void 0 ? void 0 : _a[key]
|
|
414
|
+
: undefined;
|
|
415
|
+
/**
|
|
416
|
+
* If this value still exists in the current initial variant, read that.
|
|
417
|
+
*/
|
|
418
|
+
if (initial && valueFromInitial !== undefined) {
|
|
419
|
+
return valueFromInitial;
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Alternatively, if this VisualElement config has defined a getBaseTarget
|
|
423
|
+
* so we can read the value from an alternative source, try that.
|
|
424
|
+
*/
|
|
405
425
|
if (getBaseTarget) {
|
|
406
426
|
const target = getBaseTarget(props, key);
|
|
407
427
|
if (target !== undefined && !isMotionValue(target))
|
|
408
428
|
return target;
|
|
409
429
|
}
|
|
410
|
-
|
|
430
|
+
/**
|
|
431
|
+
* If the value was initially defined on initial, but it doesn't any more,
|
|
432
|
+
* return undefined. Otherwise return the value as initially read from the DOM.
|
|
433
|
+
*/
|
|
434
|
+
return initialValues[key] !== undefined &&
|
|
435
|
+
valueFromInitial === undefined
|
|
436
|
+
? undefined
|
|
437
|
+
: baseTarget[key];
|
|
411
438
|
},
|
|
412
439
|
// Lifecyles ========================
|
|
413
440
|
...lifecycles,
|
|
@@ -22,7 +22,7 @@ function updateMotionValuesFromProps(element, next, prev) {
|
|
|
22
22
|
* and warn against mismatches.
|
|
23
23
|
*/
|
|
24
24
|
if (process.env.NODE_ENV === "development") {
|
|
25
|
-
warnOnce(nextValue.version === "7.5.
|
|
25
|
+
warnOnce(nextValue.version === "7.5.3", `Attempting to mix Framer Motion versions ${nextValue.version} with 7.5.3 may not work as expected.`);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
else if (isMotionValue(prevValue)) {
|
package/dist/es/value/index.mjs
CHANGED
|
@@ -24,7 +24,7 @@ class MotionValue {
|
|
|
24
24
|
* This will be replaced by the build step with the latest version number.
|
|
25
25
|
* When MotionValues are provided to motion components, warn if versions are mixed.
|
|
26
26
|
*/
|
|
27
|
-
this.version = "7.5.
|
|
27
|
+
this.version = "7.5.3";
|
|
28
28
|
/**
|
|
29
29
|
* Duration, in milliseconds, since last updating frame.
|
|
30
30
|
*
|
|
@@ -3413,7 +3413,7 @@
|
|
|
3413
3413
|
* This will be replaced by the build step with the latest version number.
|
|
3414
3414
|
* When MotionValues are provided to motion components, warn if versions are mixed.
|
|
3415
3415
|
*/
|
|
3416
|
-
this.version = "7.5.
|
|
3416
|
+
this.version = "7.5.3";
|
|
3417
3417
|
/**
|
|
3418
3418
|
* Duration, in milliseconds, since last updating frame.
|
|
3419
3419
|
*
|
|
@@ -5389,7 +5389,7 @@
|
|
|
5389
5389
|
* and warn against mismatches.
|
|
5390
5390
|
*/
|
|
5391
5391
|
{
|
|
5392
|
-
warnOnce(nextValue.version === "7.5.
|
|
5392
|
+
warnOnce(nextValue.version === "7.5.3", `Attempting to mix Framer Motion versions ${nextValue.version} with 7.5.3 may not work as expected.`);
|
|
5393
5393
|
}
|
|
5394
5394
|
}
|
|
5395
5395
|
else if (isMotionValue(prevValue)) {
|
|
@@ -5468,6 +5468,10 @@
|
|
|
5468
5468
|
const baseTarget = {
|
|
5469
5469
|
...latestValues,
|
|
5470
5470
|
};
|
|
5471
|
+
/**
|
|
5472
|
+
* Create an object of the values we initially animated from (if initial prop present).
|
|
5473
|
+
*/
|
|
5474
|
+
const initialValues = props.initial ? { ...latestValues } : {};
|
|
5471
5475
|
// Internal methods ========================
|
|
5472
5476
|
/**
|
|
5473
5477
|
* On mount, this will be hydrated with a callback to disconnect
|
|
@@ -5814,12 +5818,34 @@
|
|
|
5814
5818
|
* props.
|
|
5815
5819
|
*/
|
|
5816
5820
|
getBaseTarget(key) {
|
|
5821
|
+
var _a;
|
|
5822
|
+
const { initial } = props;
|
|
5823
|
+
const valueFromInitial = typeof initial === "string" || typeof initial === "object"
|
|
5824
|
+
? (_a = resolveVariantFromProps(props, initial)) === null || _a === void 0 ? void 0 : _a[key]
|
|
5825
|
+
: undefined;
|
|
5826
|
+
/**
|
|
5827
|
+
* If this value still exists in the current initial variant, read that.
|
|
5828
|
+
*/
|
|
5829
|
+
if (initial && valueFromInitial !== undefined) {
|
|
5830
|
+
return valueFromInitial;
|
|
5831
|
+
}
|
|
5832
|
+
/**
|
|
5833
|
+
* Alternatively, if this VisualElement config has defined a getBaseTarget
|
|
5834
|
+
* so we can read the value from an alternative source, try that.
|
|
5835
|
+
*/
|
|
5817
5836
|
if (getBaseTarget) {
|
|
5818
5837
|
const target = getBaseTarget(props, key);
|
|
5819
5838
|
if (target !== undefined && !isMotionValue(target))
|
|
5820
5839
|
return target;
|
|
5821
5840
|
}
|
|
5822
|
-
|
|
5841
|
+
/**
|
|
5842
|
+
* If the value was initially defined on initial, but it doesn't any more,
|
|
5843
|
+
* return undefined. Otherwise return the value as initially read from the DOM.
|
|
5844
|
+
*/
|
|
5845
|
+
return initialValues[key] !== undefined &&
|
|
5846
|
+
valueFromInitial === undefined
|
|
5847
|
+
? undefined
|
|
5848
|
+
: baseTarget[key];
|
|
5823
5849
|
},
|
|
5824
5850
|
// Lifecyles ========================
|
|
5825
5851
|
...lifecycles,
|