framer-motion 7.5.0 → 7.5.1

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
@@ -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.0";
2248
+ this.version = "7.5.1";
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.0", `Attempting to mix Framer Motion versions ${nextValue.version} with 7.5.0 may not work as expected.`);
4224
+ warnOnce(nextValue.version === "7.5.1", `Attempting to mix Framer Motion versions ${nextValue.version} with 7.5.1 may not work as expected.`);
4225
4225
  }
4226
4226
  }
4227
4227
  else if (isMotionValue(prevValue)) {
@@ -7598,10 +7598,13 @@ function useOnChange(value, callback) {
7598
7598
  return value.onChange(callback);
7599
7599
  }, [callback]);
7600
7600
  }
7601
- function useMultiOnChange(values, handler) {
7601
+ function useMultiOnChange(values, handler, cleanup) {
7602
7602
  useIsomorphicLayoutEffect(() => {
7603
7603
  const subscriptions = values.map((value) => value.onChange(handler));
7604
- return () => subscriptions.forEach((unsubscribe) => unsubscribe());
7604
+ return () => {
7605
+ subscriptions.forEach((unsubscribe) => unsubscribe());
7606
+ cleanup();
7607
+ };
7605
7608
  });
7606
7609
  }
7607
7610
 
@@ -7626,7 +7629,7 @@ function useCombineMotionValues(values, combineValues) {
7626
7629
  * Subscribe to all motion values found within the template. Whenever any of them change,
7627
7630
  * schedule an update.
7628
7631
  */
7629
- useMultiOnChange(values, () => sync__default["default"].update(updateValue, false, true));
7632
+ useMultiOnChange(values, () => sync__default["default"].update(updateValue, false, true), () => sync.cancelSync.update(updateValue));
7630
7633
  return value;
7631
7634
  }
7632
7635
 
@@ -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.0", `Attempting to mix Framer Motion versions ${nextValue.version} with 7.5.0 may not work as expected.`);
25
+ warnOnce(nextValue.version === "7.5.1", `Attempting to mix Framer Motion versions ${nextValue.version} with 7.5.1 may not work as expected.`);
26
26
  }
27
27
  }
28
28
  else if (isMotionValue(prevValue)) {
@@ -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.0";
27
+ this.version = "7.5.1";
28
28
  /**
29
29
  * Duration, in milliseconds, since last updating frame.
30
30
  *
@@ -1,6 +1,6 @@
1
1
  import { useMotionValue } from './use-motion-value.mjs';
2
2
  import { useMultiOnChange } from './use-on-change.mjs';
3
- import sync from 'framesync';
3
+ import sync, { cancelSync } from 'framesync';
4
4
 
5
5
  function useCombineMotionValues(values, combineValues) {
6
6
  /**
@@ -23,7 +23,7 @@ function useCombineMotionValues(values, combineValues) {
23
23
  * Subscribe to all motion values found within the template. Whenever any of them change,
24
24
  * schedule an update.
25
25
  */
26
- useMultiOnChange(values, () => sync.update(updateValue, false, true));
26
+ useMultiOnChange(values, () => sync.update(updateValue, false, true), () => cancelSync.update(updateValue));
27
27
  return value;
28
28
  }
29
29
 
@@ -7,10 +7,13 @@ function useOnChange(value, callback) {
7
7
  return value.onChange(callback);
8
8
  }, [callback]);
9
9
  }
10
- function useMultiOnChange(values, handler) {
10
+ function useMultiOnChange(values, handler, cleanup) {
11
11
  useIsomorphicLayoutEffect(() => {
12
12
  const subscriptions = values.map((value) => value.onChange(handler));
13
- return () => subscriptions.forEach((unsubscribe) => unsubscribe());
13
+ return () => {
14
+ subscriptions.forEach((unsubscribe) => unsubscribe());
15
+ cleanup();
16
+ };
14
17
  });
15
18
  }
16
19
 
@@ -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.0";
3416
+ this.version = "7.5.1";
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.0", `Attempting to mix Framer Motion versions ${nextValue.version} with 7.5.0 may not work as expected.`);
5392
+ warnOnce(nextValue.version === "7.5.1", `Attempting to mix Framer Motion versions ${nextValue.version} with 7.5.1 may not work as expected.`);
5393
5393
  }
5394
5394
  }
5395
5395
  else if (isMotionValue(prevValue)) {
@@ -8766,10 +8766,13 @@
8766
8766
  return value.onChange(callback);
8767
8767
  }, [callback]);
8768
8768
  }
8769
- function useMultiOnChange(values, handler) {
8769
+ function useMultiOnChange(values, handler, cleanup) {
8770
8770
  useIsomorphicLayoutEffect(() => {
8771
8771
  const subscriptions = values.map((value) => value.onChange(handler));
8772
- return () => subscriptions.forEach((unsubscribe) => unsubscribe());
8772
+ return () => {
8773
+ subscriptions.forEach((unsubscribe) => unsubscribe());
8774
+ cleanup();
8775
+ };
8773
8776
  });
8774
8777
  }
8775
8778
 
@@ -8794,7 +8797,7 @@
8794
8797
  * Subscribe to all motion values found within the template. Whenever any of them change,
8795
8798
  * schedule an update.
8796
8799
  */
8797
- useMultiOnChange(values, () => sync.update(updateValue, false, true));
8800
+ useMultiOnChange(values, () => sync.update(updateValue, false, true), () => cancelSync.update(updateValue));
8798
8801
  return value;
8799
8802
  }
8800
8803