framer-motion 8.2.3 → 8.2.4

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 CHANGED
@@ -2062,7 +2062,7 @@ class MotionValue {
2062
2062
  * This will be replaced by the build step with the latest version number.
2063
2063
  * When MotionValues are provided to motion components, warn if versions are mixed.
2064
2064
  */
2065
- this.version = "8.2.3";
2065
+ this.version = "8.2.4";
2066
2066
  /**
2067
2067
  * Duration, in milliseconds, since last updating frame.
2068
2068
  *
@@ -5918,7 +5918,7 @@ function updateMotionValuesFromProps(element, next, prev) {
5918
5918
  * and warn against mismatches.
5919
5919
  */
5920
5920
  if (process.env.NODE_ENV === "development") {
5921
- warnOnce(nextValue.version === "8.2.3", `Attempting to mix Framer Motion versions ${nextValue.version} with 8.2.3 may not work as expected.`);
5921
+ warnOnce(nextValue.version === "8.2.4", `Attempting to mix Framer Motion versions ${nextValue.version} with 8.2.4 may not work as expected.`);
5922
5922
  }
5923
5923
  }
5924
5924
  else if (isMotionValue(prevValue)) {
@@ -8195,7 +8195,15 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
8195
8195
  if (valuesToRender[key] === undefined)
8196
8196
  continue;
8197
8197
  const { correct, applyTo } = scaleCorrectors[key];
8198
- const corrected = correct(valuesToRender[key], lead);
8198
+ /**
8199
+ * Only apply scale correction to the value if we have an
8200
+ * active projection transform. Otherwise these values become
8201
+ * vulnerable to distortion if the element changes size without
8202
+ * a corresponding layout animation.
8203
+ */
8204
+ const corrected = styles.transform === "none"
8205
+ ? valuesToRender[key]
8206
+ : correct(valuesToRender[key], lead);
8199
8207
  if (applyTo) {
8200
8208
  const num = applyTo.length;
8201
8209
  for (let i = 0; i < num; i++) {
@@ -1101,7 +1101,15 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
1101
1101
  if (valuesToRender[key] === undefined)
1102
1102
  continue;
1103
1103
  const { correct, applyTo } = scaleCorrectors[key];
1104
- const corrected = correct(valuesToRender[key], lead);
1104
+ /**
1105
+ * Only apply scale correction to the value if we have an
1106
+ * active projection transform. Otherwise these values become
1107
+ * vulnerable to distortion if the element changes size without
1108
+ * a corresponding layout animation.
1109
+ */
1110
+ const corrected = styles.transform === "none"
1111
+ ? valuesToRender[key]
1112
+ : correct(valuesToRender[key], lead);
1105
1113
  if (applyTo) {
1106
1114
  const num = applyTo.length;
1107
1115
  for (let i = 0; i < num; i++) {
@@ -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 === "8.2.3", `Attempting to mix Framer Motion versions ${nextValue.version} with 8.2.3 may not work as expected.`);
25
+ warnOnce(nextValue.version === "8.2.4", `Attempting to mix Framer Motion versions ${nextValue.version} with 8.2.4 may not work as expected.`);
26
26
  }
27
27
  }
28
28
  else if (isMotionValue(prevValue)) {
@@ -25,7 +25,7 @@ class MotionValue {
25
25
  * This will be replaced by the build step with the latest version number.
26
26
  * When MotionValues are provided to motion components, warn if versions are mixed.
27
27
  */
28
- this.version = "8.2.3";
28
+ this.version = "8.2.4";
29
29
  /**
30
30
  * Duration, in milliseconds, since last updating frame.
31
31
  *
@@ -2060,7 +2060,7 @@
2060
2060
  * This will be replaced by the build step with the latest version number.
2061
2061
  * When MotionValues are provided to motion components, warn if versions are mixed.
2062
2062
  */
2063
- this.version = "8.2.3";
2063
+ this.version = "8.2.4";
2064
2064
  /**
2065
2065
  * Duration, in milliseconds, since last updating frame.
2066
2066
  *
@@ -5931,7 +5931,7 @@
5931
5931
  * and warn against mismatches.
5932
5932
  */
5933
5933
  {
5934
- warnOnce(nextValue.version === "8.2.3", `Attempting to mix Framer Motion versions ${nextValue.version} with 8.2.3 may not work as expected.`);
5934
+ warnOnce(nextValue.version === "8.2.4", `Attempting to mix Framer Motion versions ${nextValue.version} with 8.2.4 may not work as expected.`);
5935
5935
  }
5936
5936
  }
5937
5937
  else if (isMotionValue(prevValue)) {
@@ -8207,7 +8207,15 @@
8207
8207
  if (valuesToRender[key] === undefined)
8208
8208
  continue;
8209
8209
  const { correct, applyTo } = scaleCorrectors[key];
8210
- const corrected = correct(valuesToRender[key], lead);
8210
+ /**
8211
+ * Only apply scale correction to the value if we have an
8212
+ * active projection transform. Otherwise these values become
8213
+ * vulnerable to distortion if the element changes size without
8214
+ * a corresponding layout animation.
8215
+ */
8216
+ const corrected = styles.transform === "none"
8217
+ ? valuesToRender[key]
8218
+ : correct(valuesToRender[key], lead);
8211
8219
  if (applyTo) {
8212
8220
  const num = applyTo.length;
8213
8221
  for (let i = 0; i < num; i++) {