motion-dom 12.28.2 → 12.29.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 +24 -11
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/projection/shared/stack.mjs +24 -11
- package/dist/es/projection/shared/stack.mjs.map +1 -1
- package/dist/es/render/svg/SVGVisualElement.mjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/motion-dom.dev.js +24 -11
- package/dist/motion-dom.js +1 -1
- package/package.json +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -7340,17 +7340,30 @@ class NodeStack {
|
|
|
7340
7340
|
if (prevLead) {
|
|
7341
7341
|
prevLead.instance && prevLead.scheduleRender();
|
|
7342
7342
|
node.scheduleRender();
|
|
7343
|
-
|
|
7344
|
-
|
|
7345
|
-
|
|
7346
|
-
|
|
7347
|
-
|
|
7348
|
-
|
|
7349
|
-
|
|
7350
|
-
|
|
7351
|
-
|
|
7352
|
-
|
|
7353
|
-
|
|
7343
|
+
/**
|
|
7344
|
+
* If both the new and previous lead have the same defined layoutDependency,
|
|
7345
|
+
* skip the shared layout animation. This allows components with layoutId
|
|
7346
|
+
* to opt-out of animations when their layoutDependency hasn't changed,
|
|
7347
|
+
* even when the component unmounts and remounts in a different location.
|
|
7348
|
+
*/
|
|
7349
|
+
const prevDep = prevLead.options.layoutDependency;
|
|
7350
|
+
const nextDep = node.options.layoutDependency;
|
|
7351
|
+
const dependencyMatches = prevDep !== undefined &&
|
|
7352
|
+
nextDep !== undefined &&
|
|
7353
|
+
prevDep === nextDep;
|
|
7354
|
+
if (!dependencyMatches) {
|
|
7355
|
+
node.resumeFrom = prevLead;
|
|
7356
|
+
if (preserveFollowOpacity) {
|
|
7357
|
+
node.resumeFrom.preserveOpacity = true;
|
|
7358
|
+
}
|
|
7359
|
+
if (prevLead.snapshot) {
|
|
7360
|
+
node.snapshot = prevLead.snapshot;
|
|
7361
|
+
node.snapshot.latestValues =
|
|
7362
|
+
prevLead.animationValues || prevLead.latestValues;
|
|
7363
|
+
}
|
|
7364
|
+
if (node.root && node.root.isUpdating) {
|
|
7365
|
+
node.isLayoutDirty = true;
|
|
7366
|
+
}
|
|
7354
7367
|
}
|
|
7355
7368
|
const { crossfade } = node.options;
|
|
7356
7369
|
if (crossfade === false) {
|