framer-motion 9.0.0 → 9.0.1-css-var-fix
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 +5 -10
- package/dist/es/gestures/use-tap-gesture.mjs +0 -7
- package/dist/es/render/dom/utils/css-variables-conversion.mjs +3 -1
- package/dist/es/render/utils/motion-values.mjs +1 -1
- package/dist/es/value/index.mjs +1 -1
- package/dist/framer-motion.dev.js +5 -10
- package/dist/framer-motion.js +1 -1
- package/dist/projection.dev.js +5 -3
- package/dist/size-rollup-dom-animation.js +1 -1
- package/dist/size-rollup-dom-max.js +1 -1
- package/dist/size-rollup-motion.js +1 -1
- package/dist/size-webpack-dom-animation.js +1 -1
- package/dist/size-webpack-dom-max.js +1 -1
- package/package.json +3 -32
package/dist/cjs/index.js
CHANGED
|
@@ -1550,7 +1550,6 @@ function useTapGesture({ onTap, onTapStart, onTapCancel, whileTap, visualElement
|
|
|
1550
1550
|
const hasPressListeners = onTap || onTapStart || onTapCancel || whileTap;
|
|
1551
1551
|
const isPressing = React.useRef(false);
|
|
1552
1552
|
const cancelPointerEndListeners = React.useRef(null);
|
|
1553
|
-
const suspendedTabIndex = React.useRef(null);
|
|
1554
1553
|
/**
|
|
1555
1554
|
* Only set listener to passive if there are no external listeners.
|
|
1556
1555
|
*/
|
|
@@ -1571,9 +1570,6 @@ function useTapGesture({ onTap, onTapStart, onTapCancel, whileTap, visualElement
|
|
|
1571
1570
|
if (latestProps.whileTap && visualElement.animationState) {
|
|
1572
1571
|
visualElement.animationState.setActive(exports.AnimationType.Tap, false);
|
|
1573
1572
|
}
|
|
1574
|
-
if (suspendedTabIndex.current !== null) {
|
|
1575
|
-
visualElement.current.setAttribute("tabindex", suspendedTabIndex.current);
|
|
1576
|
-
}
|
|
1577
1573
|
return !isDragActive();
|
|
1578
1574
|
}
|
|
1579
1575
|
function onPointerUp(event, info) {
|
|
@@ -1616,9 +1612,6 @@ function useTapGesture({ onTap, onTapStart, onTapCancel, whileTap, visualElement
|
|
|
1616
1612
|
if (isPressing.current)
|
|
1617
1613
|
return;
|
|
1618
1614
|
isPressing.current = true;
|
|
1619
|
-
suspendedTabIndex.current =
|
|
1620
|
-
visualElement.current.getAttribute("tabindex");
|
|
1621
|
-
visualElement.current.setAttribute("tabindex", "-1");
|
|
1622
1615
|
cancelPointerEndListeners.current = pipe(addPointerEvent(window, "pointerup", onPointerUp, eventOptions), addPointerEvent(window, "pointercancel", onPointerCancel, eventOptions));
|
|
1623
1616
|
onPointerStart(event, info);
|
|
1624
1617
|
}, callbackDependencies);
|
|
@@ -2140,7 +2133,7 @@ class MotionValue {
|
|
|
2140
2133
|
* This will be replaced by the build step with the latest version number.
|
|
2141
2134
|
* When MotionValues are provided to motion components, warn if versions are mixed.
|
|
2142
2135
|
*/
|
|
2143
|
-
this.version = "9.0.
|
|
2136
|
+
this.version = "9.0.1-css-var-fix";
|
|
2144
2137
|
/**
|
|
2145
2138
|
* Duration, in milliseconds, since last updating frame.
|
|
2146
2139
|
*
|
|
@@ -5711,10 +5704,12 @@ function resolveCSSVariables(visualElement, { ...target }, transitionEnd) {
|
|
|
5711
5704
|
continue;
|
|
5712
5705
|
// Clone target if it hasn't already been
|
|
5713
5706
|
target[key] = resolved;
|
|
5707
|
+
if (!transitionEnd)
|
|
5708
|
+
transitionEnd = {};
|
|
5714
5709
|
// If the user hasn't already set this key on `transitionEnd`, set it to the unresolved
|
|
5715
5710
|
// CSS variable. This will ensure that after the animation the component will reflect
|
|
5716
5711
|
// changes in the value of the CSS variable.
|
|
5717
|
-
if (transitionEnd
|
|
5712
|
+
if (transitionEnd[key] === undefined) {
|
|
5718
5713
|
transitionEnd[key] = current;
|
|
5719
5714
|
}
|
|
5720
5715
|
}
|
|
@@ -5989,7 +5984,7 @@ function updateMotionValuesFromProps(element, next, prev) {
|
|
|
5989
5984
|
* and warn against mismatches.
|
|
5990
5985
|
*/
|
|
5991
5986
|
if (process.env.NODE_ENV === "development") {
|
|
5992
|
-
warnOnce(nextValue.version === "9.0.
|
|
5987
|
+
warnOnce(nextValue.version === "9.0.1-css-var-fix", `Attempting to mix Framer Motion versions ${nextValue.version} with 9.0.1-css-var-fix may not work as expected.`);
|
|
5993
5988
|
}
|
|
5994
5989
|
}
|
|
5995
5990
|
else if (isMotionValue(prevValue)) {
|
|
@@ -22,7 +22,6 @@ function useTapGesture({ onTap, onTapStart, onTapCancel, whileTap, visualElement
|
|
|
22
22
|
const hasPressListeners = onTap || onTapStart || onTapCancel || whileTap;
|
|
23
23
|
const isPressing = useRef(false);
|
|
24
24
|
const cancelPointerEndListeners = useRef(null);
|
|
25
|
-
const suspendedTabIndex = useRef(null);
|
|
26
25
|
/**
|
|
27
26
|
* Only set listener to passive if there are no external listeners.
|
|
28
27
|
*/
|
|
@@ -43,9 +42,6 @@ function useTapGesture({ onTap, onTapStart, onTapCancel, whileTap, visualElement
|
|
|
43
42
|
if (latestProps.whileTap && visualElement.animationState) {
|
|
44
43
|
visualElement.animationState.setActive(AnimationType.Tap, false);
|
|
45
44
|
}
|
|
46
|
-
if (suspendedTabIndex.current !== null) {
|
|
47
|
-
visualElement.current.setAttribute("tabindex", suspendedTabIndex.current);
|
|
48
|
-
}
|
|
49
45
|
return !isDragActive();
|
|
50
46
|
}
|
|
51
47
|
function onPointerUp(event, info) {
|
|
@@ -88,9 +84,6 @@ function useTapGesture({ onTap, onTapStart, onTapCancel, whileTap, visualElement
|
|
|
88
84
|
if (isPressing.current)
|
|
89
85
|
return;
|
|
90
86
|
isPressing.current = true;
|
|
91
|
-
suspendedTabIndex.current =
|
|
92
|
-
visualElement.current.getAttribute("tabindex");
|
|
93
|
-
visualElement.current.setAttribute("tabindex", "-1");
|
|
94
87
|
cancelPointerEndListeners.current = pipe(addPointerEvent(window, "pointerup", onPointerUp, eventOptions), addPointerEvent(window, "pointercancel", onPointerCancel, eventOptions));
|
|
95
88
|
onPointerStart(event, info);
|
|
96
89
|
}, callbackDependencies);
|
|
@@ -74,10 +74,12 @@ function resolveCSSVariables(visualElement, { ...target }, transitionEnd) {
|
|
|
74
74
|
continue;
|
|
75
75
|
// Clone target if it hasn't already been
|
|
76
76
|
target[key] = resolved;
|
|
77
|
+
if (!transitionEnd)
|
|
78
|
+
transitionEnd = {};
|
|
77
79
|
// If the user hasn't already set this key on `transitionEnd`, set it to the unresolved
|
|
78
80
|
// CSS variable. This will ensure that after the animation the component will reflect
|
|
79
81
|
// changes in the value of the CSS variable.
|
|
80
|
-
if (transitionEnd
|
|
82
|
+
if (transitionEnd[key] === undefined) {
|
|
81
83
|
transitionEnd[key] = current;
|
|
82
84
|
}
|
|
83
85
|
}
|
|
@@ -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 === "9.0.
|
|
25
|
+
warnOnce(nextValue.version === "9.0.1-css-var-fix", `Attempting to mix Framer Motion versions ${nextValue.version} with 9.0.1-css-var-fix may not work as expected.`);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
else if (isMotionValue(prevValue)) {
|
package/dist/es/value/index.mjs
CHANGED
|
@@ -25,7 +25,7 @@ class MotionValue {
|
|
|
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 = "9.0.
|
|
28
|
+
this.version = "9.0.1-css-var-fix";
|
|
29
29
|
/**
|
|
30
30
|
* Duration, in milliseconds, since last updating frame.
|
|
31
31
|
*
|
|
@@ -1548,7 +1548,6 @@
|
|
|
1548
1548
|
const hasPressListeners = onTap || onTapStart || onTapCancel || whileTap;
|
|
1549
1549
|
const isPressing = React.useRef(false);
|
|
1550
1550
|
const cancelPointerEndListeners = React.useRef(null);
|
|
1551
|
-
const suspendedTabIndex = React.useRef(null);
|
|
1552
1551
|
/**
|
|
1553
1552
|
* Only set listener to passive if there are no external listeners.
|
|
1554
1553
|
*/
|
|
@@ -1569,9 +1568,6 @@
|
|
|
1569
1568
|
if (latestProps.whileTap && visualElement.animationState) {
|
|
1570
1569
|
visualElement.animationState.setActive(exports.AnimationType.Tap, false);
|
|
1571
1570
|
}
|
|
1572
|
-
if (suspendedTabIndex.current !== null) {
|
|
1573
|
-
visualElement.current.setAttribute("tabindex", suspendedTabIndex.current);
|
|
1574
|
-
}
|
|
1575
1571
|
return !isDragActive();
|
|
1576
1572
|
}
|
|
1577
1573
|
function onPointerUp(event, info) {
|
|
@@ -1614,9 +1610,6 @@
|
|
|
1614
1610
|
if (isPressing.current)
|
|
1615
1611
|
return;
|
|
1616
1612
|
isPressing.current = true;
|
|
1617
|
-
suspendedTabIndex.current =
|
|
1618
|
-
visualElement.current.getAttribute("tabindex");
|
|
1619
|
-
visualElement.current.setAttribute("tabindex", "-1");
|
|
1620
1613
|
cancelPointerEndListeners.current = pipe(addPointerEvent(window, "pointerup", onPointerUp, eventOptions), addPointerEvent(window, "pointercancel", onPointerCancel, eventOptions));
|
|
1621
1614
|
onPointerStart(event, info);
|
|
1622
1615
|
}, callbackDependencies);
|
|
@@ -2138,7 +2131,7 @@
|
|
|
2138
2131
|
* This will be replaced by the build step with the latest version number.
|
|
2139
2132
|
* When MotionValues are provided to motion components, warn if versions are mixed.
|
|
2140
2133
|
*/
|
|
2141
|
-
this.version = "9.0.
|
|
2134
|
+
this.version = "9.0.1-css-var-fix";
|
|
2142
2135
|
/**
|
|
2143
2136
|
* Duration, in milliseconds, since last updating frame.
|
|
2144
2137
|
*
|
|
@@ -5724,10 +5717,12 @@
|
|
|
5724
5717
|
continue;
|
|
5725
5718
|
// Clone target if it hasn't already been
|
|
5726
5719
|
target[key] = resolved;
|
|
5720
|
+
if (!transitionEnd)
|
|
5721
|
+
transitionEnd = {};
|
|
5727
5722
|
// If the user hasn't already set this key on `transitionEnd`, set it to the unresolved
|
|
5728
5723
|
// CSS variable. This will ensure that after the animation the component will reflect
|
|
5729
5724
|
// changes in the value of the CSS variable.
|
|
5730
|
-
if (transitionEnd
|
|
5725
|
+
if (transitionEnd[key] === undefined) {
|
|
5731
5726
|
transitionEnd[key] = current;
|
|
5732
5727
|
}
|
|
5733
5728
|
}
|
|
@@ -6002,7 +5997,7 @@
|
|
|
6002
5997
|
* and warn against mismatches.
|
|
6003
5998
|
*/
|
|
6004
5999
|
{
|
|
6005
|
-
warnOnce(nextValue.version === "9.0.
|
|
6000
|
+
warnOnce(nextValue.version === "9.0.1-css-var-fix", `Attempting to mix Framer Motion versions ${nextValue.version} with 9.0.1-css-var-fix may not work as expected.`);
|
|
6006
6001
|
}
|
|
6007
6002
|
}
|
|
6008
6003
|
else if (isMotionValue(prevValue)) {
|