framer-motion 7.0.0 → 7.0.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
@@ -1929,18 +1929,6 @@ var gestureAnimations = {
1929
1929
  hover: makeRenderlessComponent(useHoverGesture),
1930
1930
  };
1931
1931
 
1932
- var counter = 0;
1933
- var incrementId = function () { return counter++; };
1934
- var useId = function () { return useConstant(incrementId); };
1935
- /**
1936
- * Ideally we'd use the following code to support React 18 optionally.
1937
- * But this fairly fails in Webpack (otherwise treeshaking wouldn't work at all).
1938
- * Need to come up with a different way of figuring this out.
1939
- */
1940
- // export const useId = (React as any).useId
1941
- // ? (React as any).useId
1942
- // : () => useConstant(incrementId)
1943
-
1944
1932
  /**
1945
1933
  * When a component is the child of `AnimatePresence`, it can use `usePresence`
1946
1934
  * to access information about whether it's still present in the React tree.
@@ -1972,7 +1960,7 @@ function usePresence() {
1972
1960
  // It's safe to call the following hooks conditionally (after an early return) because the context will always
1973
1961
  // either be null or non-null for the lifespan of the component.
1974
1962
  // Replace with useId when released in React
1975
- var id = useId();
1963
+ var id = React.useId();
1976
1964
  React.useEffect(function () { return register(id); }, []);
1977
1965
  var safeToRemove = function () { return onExitComplete === null || onExitComplete === void 0 ? void 0 : onExitComplete(id); };
1978
1966
  return !isPresent && onExitComplete ? [false, safeToRemove] : [true];
@@ -2449,7 +2437,7 @@ var MotionValue = /** @class */ (function () {
2449
2437
  * This will be replaced by the build step with the latest version number.
2450
2438
  * When MotionValues are provided to motion components, warn if versions are mixed.
2451
2439
  */
2452
- this.version = "7.0.0";
2440
+ this.version = "7.0.1";
2453
2441
  /**
2454
2442
  * Duration, in milliseconds, since last updating frame.
2455
2443
  *
@@ -4419,7 +4407,7 @@ function updateMotionValuesFromProps(element, next, prev) {
4419
4407
  * and warn against mismatches.
4420
4408
  */
4421
4409
  if (process.env.NODE_ENV === "development") {
4422
- warnOnce(nextValue.version === "7.0.0", "Attempting to mix Framer Motion versions ".concat(nextValue.version, " with 7.0.0 may not work as expected."));
4410
+ warnOnce(nextValue.version === "7.0.1", "Attempting to mix Framer Motion versions ".concat(nextValue.version, " with 7.0.1 may not work as expected."));
4423
4411
  }
4424
4412
  }
4425
4413
  else if (isMotionValue(prevValue)) {
@@ -7190,7 +7178,7 @@ function useForceUpdate() {
7190
7178
  var PresenceChild = function (_a) {
7191
7179
  var children = _a.children, initial = _a.initial, isPresent = _a.isPresent, onExitComplete = _a.onExitComplete, custom = _a.custom, presenceAffectsLayout = _a.presenceAffectsLayout;
7192
7180
  var presenceChildren = useConstant(newChildrenMap);
7193
- var id = useId();
7181
+ var id = React.useId();
7194
7182
  var context = React.useMemo(function () { return ({
7195
7183
  id: id,
7196
7184
  initial: initial,
@@ -1,9 +1,8 @@
1
1
  import { __values } from 'tslib';
2
2
  import * as React from 'react';
3
- import { useMemo } from 'react';
3
+ import { useId, useMemo } from 'react';
4
4
  import { PresenceContext } from '../../context/PresenceContext.mjs';
5
5
  import { useConstant } from '../../utils/use-constant.mjs';
6
- import { useId } from '../../utils/use-id.mjs';
7
6
 
8
7
  var PresenceChild = function (_a) {
9
8
  var children = _a.children, initial = _a.initial, isPresent = _a.isPresent, onExitComplete = _a.onExitComplete, custom = _a.custom, presenceAffectsLayout = _a.presenceAffectsLayout;
@@ -1,6 +1,5 @@
1
- import { useContext, useEffect } from 'react';
1
+ import { useContext, useId, useEffect } from 'react';
2
2
  import { PresenceContext } from '../../context/PresenceContext.mjs';
3
- import { useId } from '../../utils/use-id.mjs';
4
3
 
5
4
  /**
6
5
  * When a component is the child of `AnimatePresence`, it can use `usePresence`
@@ -18,7 +18,7 @@ function updateMotionValuesFromProps(element, next, prev) {
18
18
  * and warn against mismatches.
19
19
  */
20
20
  if (process.env.NODE_ENV === "development") {
21
- warnOnce(nextValue.version === "7.0.0", "Attempting to mix Framer Motion versions ".concat(nextValue.version, " with 7.0.0 may not work as expected."));
21
+ warnOnce(nextValue.version === "7.0.1", "Attempting to mix Framer Motion versions ".concat(nextValue.version, " with 7.0.1 may not work as expected."));
22
22
  }
23
23
  }
24
24
  else if (isMotionValue(prevValue)) {
@@ -25,7 +25,7 @@ var MotionValue = /** @class */ (function () {
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 = "7.0.0";
28
+ this.version = "7.0.1";
29
29
  /**
30
30
  * Duration, in milliseconds, since last updating frame.
31
31
  *
@@ -3339,18 +3339,6 @@
3339
3339
  hover: makeRenderlessComponent(useHoverGesture),
3340
3340
  };
3341
3341
 
3342
- var counter = 0;
3343
- var incrementId = function () { return counter++; };
3344
- var useId = function () { return useConstant(incrementId); };
3345
- /**
3346
- * Ideally we'd use the following code to support React 18 optionally.
3347
- * But this fairly fails in Webpack (otherwise treeshaking wouldn't work at all).
3348
- * Need to come up with a different way of figuring this out.
3349
- */
3350
- // export const useId = (React as any).useId
3351
- // ? (React as any).useId
3352
- // : () => useConstant(incrementId)
3353
-
3354
3342
  /**
3355
3343
  * When a component is the child of `AnimatePresence`, it can use `usePresence`
3356
3344
  * to access information about whether it's still present in the React tree.
@@ -3382,7 +3370,7 @@
3382
3370
  // It's safe to call the following hooks conditionally (after an early return) because the context will always
3383
3371
  // either be null or non-null for the lifespan of the component.
3384
3372
  // Replace with useId when released in React
3385
- var id = useId();
3373
+ var id = React.useId();
3386
3374
  React.useEffect(function () { return register(id); }, []);
3387
3375
  var safeToRemove = function () { return onExitComplete === null || onExitComplete === void 0 ? void 0 : onExitComplete(id); };
3388
3376
  return !isPresent && onExitComplete ? [false, safeToRemove] : [true];
@@ -3859,7 +3847,7 @@
3859
3847
  * This will be replaced by the build step with the latest version number.
3860
3848
  * When MotionValues are provided to motion components, warn if versions are mixed.
3861
3849
  */
3862
- this.version = "7.0.0";
3850
+ this.version = "7.0.1";
3863
3851
  /**
3864
3852
  * Duration, in milliseconds, since last updating frame.
3865
3853
  *
@@ -5829,7 +5817,7 @@
5829
5817
  * and warn against mismatches.
5830
5818
  */
5831
5819
  {
5832
- warnOnce(nextValue.version === "7.0.0", "Attempting to mix Framer Motion versions ".concat(nextValue.version, " with 7.0.0 may not work as expected."));
5820
+ warnOnce(nextValue.version === "7.0.1", "Attempting to mix Framer Motion versions ".concat(nextValue.version, " with 7.0.1 may not work as expected."));
5833
5821
  }
5834
5822
  }
5835
5823
  else if (isMotionValue(prevValue)) {
@@ -8600,7 +8588,7 @@
8600
8588
  var PresenceChild = function (_a) {
8601
8589
  var children = _a.children, initial = _a.initial, isPresent = _a.isPresent, onExitComplete = _a.onExitComplete, custom = _a.custom, presenceAffectsLayout = _a.presenceAffectsLayout;
8602
8590
  var presenceChildren = useConstant(newChildrenMap);
8603
- var id = useId();
8591
+ var id = React.useId();
8604
8592
  var context = React.useMemo(function () { return ({
8605
8593
  id: id,
8606
8594
  initial: initial,