framer-motion 10.0.0-alpha.1 → 10.0.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
@@ -1987,7 +1987,7 @@ class MotionValue {
1987
1987
  * This will be replaced by the build step with the latest version number.
1988
1988
  * When MotionValues are provided to motion components, warn if versions are mixed.
1989
1989
  */
1990
- this.version = "10.0.0-alpha.1";
1990
+ this.version = "10.0.0";
1991
1991
  /**
1992
1992
  * Duration, in milliseconds, since last updating frame.
1993
1993
  *
@@ -3612,6 +3612,9 @@ const acceleratedValues = new Set([
3612
3612
  * keyframe quantity.
3613
3613
  */
3614
3614
  const sampleDelta = 10; //ms
3615
+ const requiresPregeneratedKeyframes = (valueName, options) => options.type === "spring" ||
3616
+ valueName === "backgroundColor" ||
3617
+ !isWaapiSupportedEasing(options.ease);
3615
3618
  function createAcceleratedAnimation(value, valueName, { onUpdate, onComplete, ...options }) {
3616
3619
  const canAccelerateAnimation = supports.waapi() &&
3617
3620
  acceleratedValues.has(valueName) &&
@@ -3624,9 +3627,7 @@ function createAcceleratedAnimation(value, valueName, { onUpdate, onComplete, ..
3624
3627
  /**
3625
3628
  * If this animation needs pre-generated keyframes then generate.
3626
3629
  */
3627
- if (options.type === "spring" ||
3628
- valueName === "backgroundColor" ||
3629
- !isWaapiSupportedEasing(options.ease)) {
3630
+ if (requiresPregeneratedKeyframes(valueName, options)) {
3630
3631
  const sampleAnimation = animateValue({
3631
3632
  ...options,
3632
3633
  repeat: 0,
@@ -7829,7 +7830,7 @@ function updateMotionValuesFromProps(element, next, prev) {
7829
7830
  * and warn against mismatches.
7830
7831
  */
7831
7832
  if (process.env.NODE_ENV === "development") {
7832
- warnOnce(nextValue.version === "10.0.0-alpha.1", `Attempting to mix Framer Motion versions ${nextValue.version} with 10.0.0-alpha.1 may not work as expected.`);
7833
+ warnOnce(nextValue.version === "10.0.0", `Attempting to mix Framer Motion versions ${nextValue.version} with 10.0.0 may not work as expected.`);
7833
7834
  }
7834
7835
  }
7835
7836
  else if (isMotionValue(prevValue)) {
@@ -21,6 +21,9 @@ const acceleratedValues = new Set([
21
21
  * keyframe quantity.
22
22
  */
23
23
  const sampleDelta = 10; //ms
24
+ const requiresPregeneratedKeyframes = (valueName, options) => options.type === "spring" ||
25
+ valueName === "backgroundColor" ||
26
+ !isWaapiSupportedEasing(options.ease);
24
27
  function createAcceleratedAnimation(value, valueName, { onUpdate, onComplete, ...options }) {
25
28
  const canAccelerateAnimation = supports.waapi() &&
26
29
  acceleratedValues.has(valueName) &&
@@ -33,9 +36,7 @@ function createAcceleratedAnimation(value, valueName, { onUpdate, onComplete, ..
33
36
  /**
34
37
  * If this animation needs pre-generated keyframes then generate.
35
38
  */
36
- if (options.type === "spring" ||
37
- valueName === "backgroundColor" ||
38
- !isWaapiSupportedEasing(options.ease)) {
39
+ if (requiresPregeneratedKeyframes(valueName, options)) {
39
40
  const sampleAnimation = animateValue({
40
41
  ...options,
41
42
  repeat: 0,
@@ -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 === "10.0.0-alpha.1", `Attempting to mix Framer Motion versions ${nextValue.version} with 10.0.0-alpha.1 may not work as expected.`);
25
+ warnOnce(nextValue.version === "10.0.0", `Attempting to mix Framer Motion versions ${nextValue.version} with 10.0.0 may not work as expected.`);
26
26
  }
27
27
  }
28
28
  else if (isMotionValue(prevValue)) {
@@ -26,7 +26,7 @@ class MotionValue {
26
26
  * This will be replaced by the build step with the latest version number.
27
27
  * When MotionValues are provided to motion components, warn if versions are mixed.
28
28
  */
29
- this.version = "10.0.0-alpha.1";
29
+ this.version = "10.0.0";
30
30
  /**
31
31
  * Duration, in milliseconds, since last updating frame.
32
32
  *
@@ -1987,7 +1987,7 @@
1987
1987
  * This will be replaced by the build step with the latest version number.
1988
1988
  * When MotionValues are provided to motion components, warn if versions are mixed.
1989
1989
  */
1990
- this.version = "10.0.0-alpha.1";
1990
+ this.version = "10.0.0";
1991
1991
  /**
1992
1992
  * Duration, in milliseconds, since last updating frame.
1993
1993
  *
@@ -3612,6 +3612,9 @@
3612
3612
  * keyframe quantity.
3613
3613
  */
3614
3614
  const sampleDelta = 10; //ms
3615
+ const requiresPregeneratedKeyframes = (valueName, options) => options.type === "spring" ||
3616
+ valueName === "backgroundColor" ||
3617
+ !isWaapiSupportedEasing(options.ease);
3615
3618
  function createAcceleratedAnimation(value, valueName, { onUpdate, onComplete, ...options }) {
3616
3619
  const canAccelerateAnimation = supports.waapi() &&
3617
3620
  acceleratedValues.has(valueName) &&
@@ -3624,9 +3627,7 @@
3624
3627
  /**
3625
3628
  * If this animation needs pre-generated keyframes then generate.
3626
3629
  */
3627
- if (options.type === "spring" ||
3628
- valueName === "backgroundColor" ||
3629
- !isWaapiSupportedEasing(options.ease)) {
3630
+ if (requiresPregeneratedKeyframes(valueName, options)) {
3630
3631
  const sampleAnimation = animateValue({
3631
3632
  ...options,
3632
3633
  repeat: 0,
@@ -7829,7 +7830,7 @@
7829
7830
  * and warn against mismatches.
7830
7831
  */
7831
7832
  {
7832
- warnOnce(nextValue.version === "10.0.0-alpha.1", `Attempting to mix Framer Motion versions ${nextValue.version} with 10.0.0-alpha.1 may not work as expected.`);
7833
+ warnOnce(nextValue.version === "10.0.0", `Attempting to mix Framer Motion versions ${nextValue.version} with 10.0.0 may not work as expected.`);
7833
7834
  }
7834
7835
  }
7835
7836
  else if (isMotionValue(prevValue)) {