framer-motion 12.7.2 → 12.7.4
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/client.js +1 -1
- package/dist/cjs/{create-ZjelqmfD.js → create-BErHrlzf.js} +1 -1
- package/dist/cjs/dom.js +1 -1
- package/dist/cjs/index.js +26 -23
- package/dist/dom-mini.js +1 -1
- package/dist/dom.js +1 -1
- package/dist/es/components/AnimatePresence/PresenceChild.mjs +26 -23
- package/dist/es/render/utils/motion-values.mjs +1 -1
- package/dist/framer-motion.dev.js +31 -26
- package/dist/framer-motion.js +1 -1
- package/dist/mini.js +1 -1
- package/dist/size-rollup-animate.js +1 -1
- 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-rollup-waapi-animate.js +1 -1
- package/package.json +3 -3
|
@@ -170,33 +170,36 @@
|
|
|
170
170
|
const PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode, anchorX, }) => {
|
|
171
171
|
const presenceChildren = useConstant(newChildrenMap);
|
|
172
172
|
const id = React$1.useId();
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
173
|
+
let isReusedContext = true;
|
|
174
|
+
let context = React$1.useMemo(() => {
|
|
175
|
+
isReusedContext = false;
|
|
176
|
+
return {
|
|
177
|
+
id,
|
|
178
|
+
initial,
|
|
179
|
+
isPresent,
|
|
180
|
+
custom,
|
|
181
|
+
onExitComplete: (childId) => {
|
|
182
|
+
presenceChildren.set(childId, true);
|
|
183
|
+
for (const isComplete of presenceChildren.values()) {
|
|
184
|
+
if (!isComplete)
|
|
185
|
+
return; // can stop searching when any is incomplete
|
|
186
|
+
}
|
|
187
|
+
onExitComplete && onExitComplete();
|
|
188
|
+
},
|
|
189
|
+
register: (childId) => {
|
|
190
|
+
presenceChildren.set(childId, false);
|
|
191
|
+
return () => presenceChildren.delete(childId);
|
|
192
|
+
},
|
|
193
|
+
};
|
|
194
|
+
}, [isPresent, presenceChildren, onExitComplete]);
|
|
192
195
|
/**
|
|
193
196
|
* If the presence of a child affects the layout of the components around it,
|
|
194
197
|
* we want to make a new context value to ensure they get re-rendered
|
|
195
198
|
* so they can detect that layout change.
|
|
196
199
|
*/
|
|
197
|
-
presenceAffectsLayout
|
|
198
|
-
|
|
199
|
-
|
|
200
|
+
if (presenceAffectsLayout && isReusedContext) {
|
|
201
|
+
context = { ...context };
|
|
202
|
+
}
|
|
200
203
|
React$1.useMemo(() => {
|
|
201
204
|
presenceChildren.forEach((_, key) => presenceChildren.set(key, false));
|
|
202
205
|
}, [isPresent]);
|
|
@@ -911,6 +914,7 @@
|
|
|
911
914
|
}
|
|
912
915
|
const { element, name, keyframes: unresolvedKeyframes, pseudoElement, allowFlatten = false, } = options;
|
|
913
916
|
let { transition } = options;
|
|
917
|
+
this.isPseudoElement = Boolean(pseudoElement);
|
|
914
918
|
this.allowFlatten = allowFlatten;
|
|
915
919
|
/**
|
|
916
920
|
* Stop any existing animations on the element before reading existing keyframes.
|
|
@@ -982,10 +986,11 @@
|
|
|
982
986
|
* while deferring the commit until the next animation frame.
|
|
983
987
|
*/
|
|
984
988
|
commitStyles() {
|
|
985
|
-
this.
|
|
989
|
+
if (!this.isPseudoElement) {
|
|
990
|
+
this.animation.commitStyles?.();
|
|
991
|
+
}
|
|
986
992
|
}
|
|
987
993
|
get duration() {
|
|
988
|
-
console.log(this.animation.effect?.getComputedTiming());
|
|
989
994
|
const duration = this.animation.effect?.getComputedTiming().duration || 0;
|
|
990
995
|
return millisecondsToSeconds(Number(duration));
|
|
991
996
|
}
|
|
@@ -1560,7 +1565,7 @@
|
|
|
1560
1565
|
* This will be replaced by the build step with the latest version number.
|
|
1561
1566
|
* When MotionValues are provided to motion components, warn if versions are mixed.
|
|
1562
1567
|
*/
|
|
1563
|
-
this.version = "12.7.
|
|
1568
|
+
this.version = "12.7.4";
|
|
1564
1569
|
/**
|
|
1565
1570
|
* Tracks whether this value can output a velocity. Currently this is only true
|
|
1566
1571
|
* if the value is numerical, but we might be able to widen the scope here and support
|
|
@@ -7149,7 +7154,7 @@
|
|
|
7149
7154
|
* and warn against mismatches.
|
|
7150
7155
|
*/
|
|
7151
7156
|
{
|
|
7152
|
-
warnOnce(nextValue.version === "12.7.
|
|
7157
|
+
warnOnce(nextValue.version === "12.7.4", `Attempting to mix Motion versions ${nextValue.version} with 12.7.4 may not work as expected.`);
|
|
7153
7158
|
}
|
|
7154
7159
|
}
|
|
7155
7160
|
else if (isMotionValue(prevValue)) {
|