framer-motion 7.0.0 → 7.0.3-beta.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
@@ -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.3-beta.0";
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.3-beta.0", "Attempting to mix Framer Motion versions ".concat(nextValue.version, " with 7.0.3-beta.0 may not work as expected."));
4423
4411
  }
4424
4412
  }
4425
4413
  else if (isMotionValue(prevValue)) {
@@ -5209,9 +5197,11 @@ var htmlConfig = {
5209
5197
  }
5210
5198
  else {
5211
5199
  var computedStyle = getComputedStyle$1(domElement);
5212
- return ((isCSSVariable$1(key)
5200
+ var value = (isCSSVariable$1(key)
5213
5201
  ? computedStyle.getPropertyValue(key)
5214
- : computedStyle[key]) || 0);
5202
+ : computedStyle[key]) || 0;
5203
+ console.log(value);
5204
+ return value; //typeof value === "string" ? value.trim() : value
5215
5205
  }
5216
5206
  },
5217
5207
  sortNodePosition: function (a, b) {
@@ -7190,7 +7180,7 @@ function useForceUpdate() {
7190
7180
  var PresenceChild = function (_a) {
7191
7181
  var children = _a.children, initial = _a.initial, isPresent = _a.isPresent, onExitComplete = _a.onExitComplete, custom = _a.custom, presenceAffectsLayout = _a.presenceAffectsLayout;
7192
7182
  var presenceChildren = useConstant(newChildrenMap);
7193
- var id = useId();
7183
+ var id = React.useId();
7194
7184
  var context = React.useMemo(function () { return ({
7195
7185
  id: id,
7196
7186
  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`
@@ -22,9 +22,11 @@ var htmlConfig = {
22
22
  }
23
23
  else {
24
24
  var computedStyle = getComputedStyle(domElement);
25
- return ((isCSSVariable(key)
25
+ var value = (isCSSVariable(key)
26
26
  ? computedStyle.getPropertyValue(key)
27
- : computedStyle[key]) || 0);
27
+ : computedStyle[key]) || 0;
28
+ console.log(value);
29
+ return value; //typeof value === "string" ? value.trim() : value
28
30
  }
29
31
  },
30
32
  sortNodePosition: function (a, b) {
@@ -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.3-beta.0", "Attempting to mix Framer Motion versions ".concat(nextValue.version, " with 7.0.3-beta.0 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.3-beta.0";
29
29
  /**
30
30
  * Duration, in milliseconds, since last updating frame.
31
31
  *