framer-motion 12.7.3 → 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-DwAwaNot.js → create-BErHrlzf.js} +1 -1
- package/dist/cjs/dom.js +1 -1
- package/dist/cjs/index.js +26 -23
- 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 +27 -24
- package/dist/framer-motion.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/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]);
|
|
@@ -1562,7 +1565,7 @@
|
|
|
1562
1565
|
* This will be replaced by the build step with the latest version number.
|
|
1563
1566
|
* When MotionValues are provided to motion components, warn if versions are mixed.
|
|
1564
1567
|
*/
|
|
1565
|
-
this.version = "12.7.
|
|
1568
|
+
this.version = "12.7.4";
|
|
1566
1569
|
/**
|
|
1567
1570
|
* Tracks whether this value can output a velocity. Currently this is only true
|
|
1568
1571
|
* if the value is numerical, but we might be able to widen the scope here and support
|
|
@@ -7151,7 +7154,7 @@
|
|
|
7151
7154
|
* and warn against mismatches.
|
|
7152
7155
|
*/
|
|
7153
7156
|
{
|
|
7154
|
-
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.`);
|
|
7155
7158
|
}
|
|
7156
7159
|
}
|
|
7157
7160
|
else if (isMotionValue(prevValue)) {
|