motion 12.6.5 → 12.7.0

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
@@ -4788,7 +4788,7 @@ function updateMotionValuesFromProps(element, next, prev) {
4788
4788
  * and warn against mismatches.
4789
4789
  */
4790
4790
  if (process.env.NODE_ENV === "development") {
4791
- warnOnce(nextValue.version === "12.6.5", `Attempting to mix Motion versions ${nextValue.version} with 12.6.5 may not work as expected.`);
4791
+ warnOnce(nextValue.version === "12.7.0", `Attempting to mix Motion versions ${nextValue.version} with 12.7.0 may not work as expected.`);
4792
4792
  }
4793
4793
  }
4794
4794
  else if (isMotionValue(prevValue)) {
@@ -6086,13 +6086,11 @@ const asNumber = (value) => typeof value === "string" ? parseFloat(value) : valu
6086
6086
  const isPx = (value) => typeof value === "number" || px.test(value);
6087
6087
  function mixValues(target, follow, lead, progress, shouldCrossfadeOpacity, isOnlyMember) {
6088
6088
  if (shouldCrossfadeOpacity) {
6089
- target.opacity = mixNumber$1(0,
6090
- // TODO Reinstate this if only child
6091
- lead.opacity !== undefined ? lead.opacity : 1, easeCrossfadeIn(progress));
6092
- target.opacityExit = mixNumber$1(follow.opacity !== undefined ? follow.opacity : 1, 0, easeCrossfadeOut(progress));
6089
+ target.opacity = mixNumber$1(0, lead.opacity ?? 1, easeCrossfadeIn(progress));
6090
+ target.opacityExit = mixNumber$1(follow.opacity ?? 1, 0, easeCrossfadeOut(progress));
6093
6091
  }
6094
6092
  else if (isOnlyMember) {
6095
- target.opacity = mixNumber$1(follow.opacity !== undefined ? follow.opacity : 1, lead.opacity !== undefined ? lead.opacity : 1, progress);
6093
+ target.opacity = mixNumber$1(follow.opacity ?? 1, lead.opacity ?? 1, progress);
6096
6094
  }
6097
6095
  /**
6098
6096
  * Mix border radius
@@ -8434,7 +8432,7 @@ function useVisualElement(Component, visualState, props, createVisualElement, Pr
8434
8432
  return visualElement;
8435
8433
  }
8436
8434
  function createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) {
8437
- const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, } = props;
8435
+ const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, layoutCrossfade, } = props;
8438
8436
  visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props["data-framer-portal-id"]
8439
8437
  ? undefined
8440
8438
  : getClosestProjectingNode(visualElement.parent));
@@ -8452,6 +8450,7 @@ function createProjectionNode(visualElement, props, ProjectionNodeConstructor, i
8452
8450
  */
8453
8451
  animationType: typeof layout === "string" ? layout : "both",
8454
8452
  initialPromotionConfig,
8453
+ crossfade: layoutCrossfade,
8455
8454
  layoutScroll,
8456
8455
  layoutRoot,
8457
8456
  });
@@ -9345,7 +9344,7 @@ function updateMotionValuesFromProps(element, next, prev) {
9345
9344
  * and warn against mismatches.
9346
9345
  */
9347
9346
  if (process.env.NODE_ENV === "development") {
9348
- warnOnce(nextValue.version === "12.6.5", `Attempting to mix Motion versions ${nextValue.version} with 12.6.5 may not work as expected.`);
9347
+ warnOnce(nextValue.version === "12.7.0", `Attempting to mix Motion versions ${nextValue.version} with 12.7.0 may not work as expected.`);
9349
9348
  }
9350
9349
  }
9351
9350
  else if (isMotionValue(prevValue)) {
@@ -462,7 +462,7 @@ function useVisualElement(Component, visualState, props, createVisualElement, Pr
462
462
  return visualElement;
463
463
  }
464
464
  function createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) {
465
- const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, } = props;
465
+ const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, layoutCrossfade, } = props;
466
466
  visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props["data-framer-portal-id"]
467
467
  ? undefined
468
468
  : getClosestProjectingNode(visualElement.parent));
@@ -480,6 +480,7 @@ function createProjectionNode(visualElement, props, ProjectionNodeConstructor, i
480
480
  */
481
481
  animationType: typeof layout === "string" ? layout : "both",
482
482
  initialPromotionConfig,
483
+ crossfade: layoutCrossfade,
483
484
  layoutScroll,
484
485
  layoutRoot,
485
486
  });
@@ -101,7 +101,7 @@ function useVisualElement(Component, visualState, props, createVisualElement, Pr
101
101
  return visualElement;
102
102
  }
103
103
  function createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) {
104
- const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, } = props;
104
+ const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, layoutCrossfade, } = props;
105
105
  visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props["data-framer-portal-id"]
106
106
  ? undefined
107
107
  : getClosestProjectingNode(visualElement.parent));
@@ -119,6 +119,7 @@ function createProjectionNode(visualElement, props, ProjectionNodeConstructor, i
119
119
  */
120
120
  animationType: typeof layout === "string" ? layout : "both",
121
121
  initialPromotionConfig,
122
+ crossfade: layoutCrossfade,
122
123
  layoutScroll,
123
124
  layoutRoot,
124
125
  });
@@ -11,13 +11,11 @@ const asNumber = (value) => typeof value === "string" ? parseFloat(value) : valu
11
11
  const isPx = (value) => typeof value === "number" || px.test(value);
12
12
  function mixValues(target, follow, lead, progress, shouldCrossfadeOpacity, isOnlyMember) {
13
13
  if (shouldCrossfadeOpacity) {
14
- target.opacity = mixNumber(0,
15
- // TODO Reinstate this if only child
16
- lead.opacity !== undefined ? lead.opacity : 1, easeCrossfadeIn(progress));
17
- target.opacityExit = mixNumber(follow.opacity !== undefined ? follow.opacity : 1, 0, easeCrossfadeOut(progress));
14
+ target.opacity = mixNumber(0, lead.opacity ?? 1, easeCrossfadeIn(progress));
15
+ target.opacityExit = mixNumber(follow.opacity ?? 1, 0, easeCrossfadeOut(progress));
18
16
  }
19
17
  else if (isOnlyMember) {
20
- target.opacity = mixNumber(follow.opacity !== undefined ? follow.opacity : 1, lead.opacity !== undefined ? lead.opacity : 1, progress);
18
+ target.opacity = mixNumber(follow.opacity ?? 1, lead.opacity ?? 1, progress);
21
19
  }
22
20
  /**
23
21
  * Mix border radius
@@ -19,7 +19,7 @@ function updateMotionValuesFromProps(element, next, prev) {
19
19
  * and warn against mismatches.
20
20
  */
21
21
  if (process.env.NODE_ENV === "development") {
22
- warnOnce(nextValue.version === "12.6.5", `Attempting to mix Motion versions ${nextValue.version} with 12.6.5 may not work as expected.`);
22
+ warnOnce(nextValue.version === "12.7.0", `Attempting to mix Motion versions ${nextValue.version} with 12.7.0 may not work as expected.`);
23
23
  }
24
24
  }
25
25
  else if (isMotionValue(prevValue)) {
@@ -4789,7 +4789,7 @@
4789
4789
  * and warn against mismatches.
4790
4790
  */
4791
4791
  {
4792
- warnOnce(nextValue.version === "12.6.5", `Attempting to mix Motion versions ${nextValue.version} with 12.6.5 may not work as expected.`);
4792
+ warnOnce(nextValue.version === "12.7.0", `Attempting to mix Motion versions ${nextValue.version} with 12.7.0 may not work as expected.`);
4793
4793
  }
4794
4794
  }
4795
4795
  else if (isMotionValue(prevValue)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "motion",
3
- "version": "12.6.5",
3
+ "version": "12.7.0",
4
4
  "description": "An animation library for JavaScript and React.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/es/motion/lib/index.mjs",
@@ -76,7 +76,7 @@
76
76
  "postpublish": "git push --tags"
77
77
  },
78
78
  "dependencies": {
79
- "framer-motion": "^12.6.5",
79
+ "framer-motion": "^12.7.0",
80
80
  "tslib": "^2.4.0"
81
81
  },
82
82
  "peerDependencies": {
@@ -95,5 +95,5 @@
95
95
  "optional": true
96
96
  }
97
97
  },
98
- "gitHead": "419e1cb618ebe701ed0d11d1937a8e4bddeaadc4"
98
+ "gitHead": "8dbef06bcbe7aad6e6a8758f79d619b3d5a11318"
99
99
  }