@tamagui/animate-presence 2.0.0-rc.9 → 2.1.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/AnimatePresence.cjs +112 -91
- package/dist/cjs/AnimatePresence.native.js +127 -106
- package/dist/cjs/AnimatePresence.native.js.map +1 -1
- package/dist/cjs/LayoutGroupContext.cjs +24 -22
- package/dist/cjs/LayoutGroupContext.native.js +26 -24
- package/dist/cjs/LayoutGroupContext.native.js.map +1 -1
- package/dist/cjs/PresenceChild.cjs +58 -45
- package/dist/cjs/PresenceChild.native.js +103 -91
- package/dist/cjs/PresenceChild.native.js.map +1 -1
- package/dist/cjs/index.cjs +7 -5
- package/dist/cjs/index.native.js +7 -5
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/types.cjs +7 -5
- package/dist/cjs/types.native.js +7 -5
- package/dist/cjs/types.native.js.map +1 -1
- package/dist/esm/AnimatePresence.mjs +96 -77
- package/dist/esm/AnimatePresence.mjs.map +1 -1
- package/dist/esm/AnimatePresence.native.js +111 -92
- package/dist/esm/AnimatePresence.native.js.map +1 -1
- package/dist/esm/PresenceChild.mjs +29 -18
- package/dist/esm/PresenceChild.mjs.map +1 -1
- package/dist/esm/PresenceChild.native.js +60 -50
- package/dist/esm/PresenceChild.native.js.map +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/index.js.map +1 -6
- package/package.json +10 -9
- package/src/AnimatePresence.tsx +150 -143
- package/src/types.ts +10 -9
- package/types/AnimatePresence.d.ts.map +1 -1
- package/types/types.d.ts +9 -9
- package/types/types.d.ts.map +1 -1
- package/dist/cjs/AnimatePresence.js +0 -121
- package/dist/cjs/AnimatePresence.js.map +0 -6
- package/dist/cjs/LayoutGroupContext.js +0 -30
- package/dist/cjs/LayoutGroupContext.js.map +0 -6
- package/dist/cjs/PresenceChild.js +0 -77
- package/dist/cjs/PresenceChild.js.map +0 -6
- package/dist/cjs/index.js +0 -18
- package/dist/cjs/index.js.map +0 -6
- package/dist/cjs/types.js +0 -14
- package/dist/cjs/types.js.map +0 -6
- package/dist/esm/AnimatePresence.js +0 -110
- package/dist/esm/AnimatePresence.js.map +0 -6
- package/dist/esm/LayoutGroupContext.js +0 -6
- package/dist/esm/LayoutGroupContext.js.map +0 -6
- package/dist/esm/PresenceChild.js +0 -57
- package/dist/esm/PresenceChild.js.map +0 -6
- package/dist/esm/types.js +0 -1
- package/dist/esm/types.js.map +0 -6
|
@@ -1,103 +1,122 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useInsertionEffect } from "react";
|
|
2
|
+
import { useConstant } from "@tamagui/use-constant";
|
|
2
3
|
import { useForceUpdate } from "@tamagui/use-force-update";
|
|
3
|
-
import { Children,
|
|
4
|
+
import { Children, isValidElement, useContext, useMemo, useRef, useState } from "react";
|
|
4
5
|
import { LayoutGroupContext } from "./LayoutGroupContext.mjs";
|
|
5
6
|
import { PresenceChild } from "./PresenceChild.mjs";
|
|
6
7
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
7
|
-
const getChildKey = child =>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
8
|
+
const getChildKey = child => {
|
|
9
|
+
return child.key || (() => {
|
|
10
|
+
const ct = child.type;
|
|
11
|
+
const defaultName = ct["displayName"] || ct["name"] || "";
|
|
12
|
+
if (ct && typeof ct === "object" && "staticConfig" in ct) {
|
|
13
|
+
return ct.staticConfig.componentName || defaultName;
|
|
14
|
+
}
|
|
15
|
+
return defaultName;
|
|
16
|
+
})();
|
|
17
|
+
};
|
|
18
18
|
function onlyElements(children) {
|
|
19
19
|
const filtered = [];
|
|
20
|
-
|
|
21
|
-
isValidElement(child)
|
|
22
|
-
})
|
|
20
|
+
Children.forEach(children, child => {
|
|
21
|
+
if (isValidElement(child)) filtered.push(child);
|
|
22
|
+
});
|
|
23
|
+
return filtered;
|
|
23
24
|
}
|
|
24
25
|
const AnimatePresence = ({
|
|
25
26
|
children,
|
|
26
27
|
enterVariant,
|
|
27
28
|
exitVariant,
|
|
28
29
|
enterExitVariant,
|
|
29
|
-
initial =
|
|
30
|
+
initial = true,
|
|
30
31
|
onExitComplete,
|
|
31
32
|
exitBeforeEnter,
|
|
32
|
-
|
|
33
|
+
mode,
|
|
34
|
+
presenceAffectsLayout = true,
|
|
33
35
|
custom,
|
|
34
36
|
passThrough
|
|
35
37
|
}) => {
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
if (
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
38
|
+
const effectiveMode = mode ?? (exitBeforeEnter ? "wait" : "sync");
|
|
39
|
+
const presentChildren = useMemo(() => onlyElements(children), [children]);
|
|
40
|
+
const presentKeys = presentChildren.map(getChildKey);
|
|
41
|
+
const isInitialRender = useRef(true);
|
|
42
|
+
const frozenCustomRef = useRef(/* @__PURE__ */new Map());
|
|
43
|
+
const pendingPresentChildren = useRef(presentChildren);
|
|
44
|
+
const exitComplete = useConstant(() => /* @__PURE__ */new Map());
|
|
45
|
+
const [diffedChildren, setDiffedChildren] = useState(presentChildren);
|
|
46
|
+
const [renderedChildren, setRenderedChildren] = useState(presentChildren);
|
|
47
|
+
const forceRender = useContext(LayoutGroupContext).forceRender ?? useForceUpdate();
|
|
48
|
+
if (passThrough) {
|
|
49
|
+
return /* @__PURE__ */jsx(Fragment, {
|
|
50
|
+
children
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
useInsertionEffect(() => {
|
|
54
|
+
isInitialRender.current = false;
|
|
55
|
+
pendingPresentChildren.current = presentChildren;
|
|
56
|
+
for (let i = 0; i < renderedChildren.length; i++) {
|
|
57
|
+
const key = getChildKey(renderedChildren[i]);
|
|
58
|
+
if (!presentKeys.includes(key)) {
|
|
59
|
+
if (exitComplete.get(key) !== true) {
|
|
60
|
+
exitComplete.set(key, false);
|
|
61
|
+
}
|
|
62
|
+
} else {
|
|
63
|
+
exitComplete.delete(key);
|
|
64
|
+
frozenCustomRef.current.delete(key);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}, [renderedChildren, presentKeys.length, presentKeys.join("-")]);
|
|
68
|
+
if (presentChildren !== diffedChildren) {
|
|
69
|
+
let nextChildren = [...presentChildren];
|
|
70
|
+
for (let i = 0; i < renderedChildren.length; i++) {
|
|
71
|
+
const child = renderedChildren[i];
|
|
72
|
+
const key = getChildKey(child);
|
|
73
|
+
if (!presentKeys.includes(key)) {
|
|
74
|
+
nextChildren.splice(i, 0, child);
|
|
75
|
+
if (!frozenCustomRef.current.has(key)) {
|
|
76
|
+
frozenCustomRef.current.set(key, custom);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
const exitingChildren = renderedChildren.filter(child => !presentKeys.includes(getChildKey(child)));
|
|
81
|
+
if (effectiveMode === "wait" && exitingChildren.length) {
|
|
82
|
+
nextChildren = exitingChildren;
|
|
83
|
+
}
|
|
84
|
+
setRenderedChildren(onlyElements(nextChildren));
|
|
85
|
+
setDiffedChildren(presentChildren);
|
|
86
|
+
return null;
|
|
67
87
|
}
|
|
68
|
-
return
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
88
|
+
return /* @__PURE__ */jsx(Fragment, {
|
|
89
|
+
children: renderedChildren.map(child => {
|
|
90
|
+
const key = getChildKey(child);
|
|
91
|
+
const isPresent = presentChildren === renderedChildren || presentKeys.includes(key);
|
|
92
|
+
const onExit = () => {
|
|
93
|
+
if (exitComplete.has(key)) {
|
|
94
|
+
exitComplete.set(key, true);
|
|
95
|
+
} else {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
let isEveryExitComplete = true;
|
|
99
|
+
exitComplete.forEach(isExitComplete => {
|
|
100
|
+
if (!isExitComplete) isEveryExitComplete = false;
|
|
101
|
+
});
|
|
102
|
+
if (isEveryExitComplete) {
|
|
103
|
+
forceRender?.();
|
|
104
|
+
setRenderedChildren(pendingPresentChildren.current);
|
|
105
|
+
onExitComplete?.();
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
return /* @__PURE__ */jsx(PresenceChild, {
|
|
109
|
+
isPresent,
|
|
110
|
+
initial: !isInitialRender.current || initial ? void 0 : false,
|
|
111
|
+
custom: isPresent ? custom : frozenCustomRef.current.get(key) ?? custom,
|
|
80
112
|
presenceAffectsLayout,
|
|
81
113
|
enterExitVariant,
|
|
82
114
|
enterVariant,
|
|
83
115
|
exitVariant,
|
|
84
|
-
|
|
116
|
+
onExitComplete: isPresent ? void 0 : onExit,
|
|
85
117
|
children: child
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
}), childrenToRender = childrenToRender.map(child => {
|
|
89
|
-
const key = child.key;
|
|
90
|
-
return exiting.has(key) ? child : /* @__PURE__ */jsx(PresenceChild, {
|
|
91
|
-
isPresent: !0,
|
|
92
|
-
exitVariant,
|
|
93
|
-
enterVariant,
|
|
94
|
-
enterExitVariant,
|
|
95
|
-
presenceAffectsLayout,
|
|
96
|
-
custom,
|
|
97
|
-
children: child
|
|
98
|
-
}, getChildKey(child));
|
|
99
|
-
}), presentChildren.current = childrenToRender, /* @__PURE__ */jsx(Fragment, {
|
|
100
|
-
children: exiting.size ? childrenToRender : childrenToRender.map(child => cloneElement(child))
|
|
118
|
+
}, key);
|
|
119
|
+
})
|
|
101
120
|
});
|
|
102
121
|
};
|
|
103
122
|
AnimatePresence.displayName = "AnimatePresence";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["useInsertionEffect","useConstant","useForceUpdate","Children","isValidElement","useContext","useMemo","useRef","useState","LayoutGroupContext","PresenceChild","Fragment","jsx","getChildKey","child","key","ct","type","defaultName","staticConfig","componentName","onlyElements","children","filtered","forEach","push","AnimatePresence","enterVariant","exitVariant","enterExitVariant","initial","onExitComplete","exitBeforeEnter","mode","presenceAffectsLayout","custom","passThrough","effectiveMode","presentChildren","presentKeys","map","isInitialRender","frozenCustomRef","Map","pendingPresentChildren","exitComplete","diffedChildren","setDiffedChildren","renderedChildren","setRenderedChildren","forceRender","current","i","length","includes","get","set","delete","join","nextChildren","splice","has","exitingChildren","filter","isPresent","onExit","isEveryExitComplete","isExitComplete","displayName"],"sources":["../../src/AnimatePresence.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,kBAAA,QAA0B;AACnC,SAASC,WAAA,QAAmB;AAC5B,SAASC,cAAA,QAAsB;AAE/B,SAASC,QAAA,EAAUC,cAAA,EAAgBC,UAAA,EAAYC,OAAA,EAASC,MAAA,EAAQC,QAAA,QAAgB;AAChF,SAASC,kBAAA,QAA0B;AACnC,SAASC,aAAA,QAAqB;AAiGnB,SAAAC,QAAA,EAAAC,GAAA;AA5FX,MAAMC,WAAA,GAAeC,KAAA,IAA2C;EAC9D,OACEA,KAAA,CAAMC,GAAA,KACL,MAAM;IAEL,MAAMC,EAAA,GAAKF,KAAA,CAAMG,IAAA;IACjB,MAAMC,WAAA,GAAcF,EAAA,CAAG,aAAa,KAAKA,EAAA,CAAG,MAAM,KAAK;IACvD,IAAIA,EAAA,IAAM,OAAOA,EAAA,KAAO,YAAY,kBAAkBA,EAAA,EAAI;MAExD,OAAOA,EAAA,CAAGG,YAAA,CAAaC,aAAA,IA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A,CAAIxC,GAAG,KAAKoB,MAAA;QAClED,qBAAA;QACAL,gBAAA;QACAF,YAAA;QACAC,WAAA;QACAG,cAAA,EAAgBiC,SAAA,GAAY,SAAYC,MAAA;QAEvC3C,QAAA,EAAAR;MAAA,GAVIC,GAWP;IAEJ,CAAC;EAAA,CACH;AAEJ;AAEAW,eAAA,CAAgB0C,WAAA,GAAc","ignoreList":[]}
|
|
@@ -1,116 +1,135 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useInsertionEffect } from "react";
|
|
3
|
+
import { useConstant } from "@tamagui/use-constant";
|
|
3
4
|
import { useForceUpdate } from "@tamagui/use-force-update";
|
|
4
|
-
import { Children,
|
|
5
|
+
import { Children, isValidElement, useContext, useMemo, useRef, useState } from "react";
|
|
5
6
|
import { LayoutGroupContext } from "./LayoutGroupContext.native.js";
|
|
6
7
|
import { PresenceChild } from "./PresenceChild.native.js";
|
|
7
8
|
function _type_of(obj) {
|
|
8
9
|
"@swc/helpers - typeof";
|
|
9
10
|
|
|
10
|
-
return obj && typeof Symbol
|
|
11
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
11
12
|
}
|
|
12
13
|
var getChildKey = function (child) {
|
|
13
14
|
return child.key || function () {
|
|
14
|
-
var ct = child.type
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
var ct = child.type;
|
|
16
|
+
var defaultName = ct["displayName"] || ct["name"] || "";
|
|
17
|
+
if (ct && (typeof ct === "undefined" ? "undefined" : _type_of(ct)) === "object" && "staticConfig" in ct) {
|
|
18
|
+
return ct.staticConfig.componentName || defaultName;
|
|
19
|
+
}
|
|
20
|
+
return defaultName;
|
|
17
21
|
}();
|
|
18
22
|
};
|
|
19
|
-
function updateChildLookup(children, allChildren) {
|
|
20
|
-
children.forEach(function (child) {
|
|
21
|
-
var key = getChildKey(child);
|
|
22
|
-
allChildren.set(key, child);
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
23
|
function onlyElements(children) {
|
|
26
24
|
var filtered = [];
|
|
27
|
-
|
|
28
|
-
/* @__PURE__ */isValidElement(child)
|
|
29
|
-
})
|
|
25
|
+
Children.forEach(children, function (child) {
|
|
26
|
+
if (/* @__PURE__ */isValidElement(child)) filtered.push(child);
|
|
27
|
+
});
|
|
28
|
+
return filtered;
|
|
30
29
|
}
|
|
31
30
|
var AnimatePresence = function (param) {
|
|
32
31
|
var {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
var
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
if (useIsomorphicLayoutEffect(function () {
|
|
56
|
-
isInitialRender.current = !1;
|
|
57
|
-
}, []), isInitialRender.current) return /* @__PURE__ */_jsx(_Fragment, {
|
|
58
|
-
children: filteredChildren.map(function (child) {
|
|
59
|
-
return /* @__PURE__ */_jsx(PresenceChild, {
|
|
60
|
-
isPresent: !0,
|
|
61
|
-
enterExitVariant,
|
|
62
|
-
exitVariant,
|
|
63
|
-
enterVariant,
|
|
64
|
-
initial: initial ? void 0 : !1,
|
|
65
|
-
presenceAffectsLayout,
|
|
66
|
-
custom,
|
|
67
|
-
children: child
|
|
68
|
-
}, getChildKey(child));
|
|
69
|
-
})
|
|
32
|
+
children,
|
|
33
|
+
enterVariant,
|
|
34
|
+
exitVariant,
|
|
35
|
+
enterExitVariant,
|
|
36
|
+
initial = true,
|
|
37
|
+
onExitComplete,
|
|
38
|
+
exitBeforeEnter,
|
|
39
|
+
mode,
|
|
40
|
+
presenceAffectsLayout = true,
|
|
41
|
+
custom,
|
|
42
|
+
passThrough
|
|
43
|
+
} = param;
|
|
44
|
+
var effectiveMode = mode !== null && mode !== void 0 ? mode : exitBeforeEnter ? "wait" : "sync";
|
|
45
|
+
var presentChildren = useMemo(function () {
|
|
46
|
+
return onlyElements(children);
|
|
47
|
+
}, [children]);
|
|
48
|
+
var presentKeys = presentChildren.map(getChildKey);
|
|
49
|
+
var isInitialRender = useRef(true);
|
|
50
|
+
var frozenCustomRef = useRef(/* @__PURE__ */new Map());
|
|
51
|
+
var pendingPresentChildren = useRef(presentChildren);
|
|
52
|
+
var exitComplete = useConstant(function () {
|
|
53
|
+
return /* @__PURE__ */new Map();
|
|
70
54
|
});
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
55
|
+
var [diffedChildren, setDiffedChildren] = useState(presentChildren);
|
|
56
|
+
var [renderedChildren, setRenderedChildren] = useState(presentChildren);
|
|
57
|
+
var _useContext_forceRender;
|
|
58
|
+
var forceRender = (_useContext_forceRender = useContext(LayoutGroupContext).forceRender) !== null && _useContext_forceRender !== void 0 ? _useContext_forceRender : useForceUpdate();
|
|
59
|
+
if (passThrough) {
|
|
60
|
+
return /* @__PURE__ */_jsx(_Fragment, {
|
|
61
|
+
children
|
|
62
|
+
});
|
|
74
63
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
64
|
+
useInsertionEffect(function () {
|
|
65
|
+
isInitialRender.current = false;
|
|
66
|
+
pendingPresentChildren.current = presentChildren;
|
|
67
|
+
for (var i2 = 0; i2 < renderedChildren.length; i2++) {
|
|
68
|
+
var key2 = getChildKey(renderedChildren[i2]);
|
|
69
|
+
if (!presentKeys.includes(key2)) {
|
|
70
|
+
if (exitComplete.get(key2) !== true) {
|
|
71
|
+
exitComplete.set(key2, false);
|
|
72
|
+
}
|
|
73
|
+
} else {
|
|
74
|
+
exitComplete.delete(key2);
|
|
75
|
+
frozenCustomRef.current.delete(key2);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}, [renderedChildren, presentKeys.length, presentKeys.join("-")]);
|
|
79
|
+
if (presentChildren !== diffedChildren) {
|
|
80
|
+
var nextChildren = [...presentChildren];
|
|
81
|
+
for (var i = 0; i < renderedChildren.length; i++) {
|
|
82
|
+
var child = renderedChildren[i];
|
|
83
|
+
var key = getChildKey(child);
|
|
84
|
+
if (!presentKeys.includes(key)) {
|
|
85
|
+
nextChildren.splice(i, 0, child);
|
|
86
|
+
if (!frozenCustomRef.current.has(key)) {
|
|
87
|
+
frozenCustomRef.current.set(key, custom);
|
|
88
|
+
}
|
|
98
89
|
}
|
|
99
90
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
91
|
+
var exitingChildren = renderedChildren.filter(function (child2) {
|
|
92
|
+
return !presentKeys.includes(getChildKey(child2));
|
|
93
|
+
});
|
|
94
|
+
if (effectiveMode === "wait" && exitingChildren.length) {
|
|
95
|
+
nextChildren = exitingChildren;
|
|
96
|
+
}
|
|
97
|
+
setRenderedChildren(onlyElements(nextChildren));
|
|
98
|
+
setDiffedChildren(presentChildren);
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
return /* @__PURE__ */_jsx(_Fragment, {
|
|
102
|
+
children: renderedChildren.map(function (child2) {
|
|
103
|
+
var key2 = getChildKey(child2);
|
|
104
|
+
var isPresent = presentChildren === renderedChildren || presentKeys.includes(key2);
|
|
105
|
+
var onExit = function () {
|
|
106
|
+
if (exitComplete.has(key2)) {
|
|
107
|
+
exitComplete.set(key2, true);
|
|
108
|
+
} else {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
var isEveryExitComplete = true;
|
|
112
|
+
exitComplete.forEach(function (isExitComplete) {
|
|
113
|
+
if (!isExitComplete) isEveryExitComplete = false;
|
|
114
|
+
});
|
|
115
|
+
if (isEveryExitComplete) {
|
|
116
|
+
forceRender === null || forceRender === void 0 ? void 0 : forceRender();
|
|
117
|
+
setRenderedChildren(pendingPresentChildren.current);
|
|
118
|
+
onExitComplete === null || onExitComplete === void 0 ? void 0 : onExitComplete();
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
var _frozenCustomRef_current_get;
|
|
122
|
+
return /* @__PURE__ */_jsx(PresenceChild, {
|
|
123
|
+
isPresent,
|
|
124
|
+
initial: !isInitialRender.current || initial ? void 0 : false,
|
|
125
|
+
custom: isPresent ? custom : (_frozenCustomRef_current_get = frozenCustomRef.current.get(key2)) !== null && _frozenCustomRef_current_get !== void 0 ? _frozenCustomRef_current_get : custom,
|
|
126
|
+
presenceAffectsLayout,
|
|
127
|
+
enterExitVariant,
|
|
128
|
+
enterVariant,
|
|
129
|
+
exitVariant,
|
|
130
|
+
onExitComplete: isPresent ? void 0 : onExit,
|
|
131
|
+
children: child2
|
|
132
|
+
}, key2);
|
|
114
133
|
})
|
|
115
134
|
});
|
|
116
135
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["jsx","_jsx","Fragment","_Fragment","
|
|
1
|
+
{"version":3,"names":["jsx","_jsx","Fragment","_Fragment","useInsertionEffect","useConstant","useForceUpdate","Children","isValidElement","useContext","useMemo","useRef","useState","LayoutGroupContext","PresenceChild","_type_of","obj","Symbol","constructor","getChildKey","child","key","ct","type","defaultName","staticConfig","componentName","onlyElements","children","filtered","forEach","push","AnimatePresence","param","enterVariant","exitVariant","enterExitVariant","initial","onExitComplete","exitBeforeEnter","mode","presenceAffectsLayout","custom","passThrough","effectiveMode","presentChildren","presentKeys","map","isInitialRender","frozenCustomRef","Map","pendingPresentChildren","exitComplete","diffedChildren","setDiffedChildren","renderedChildren","setRenderedChildren","_useContext_forceRender","forceRender","current","i2","length","key2","includes","get","set","delete","join","nextChildren","i","splice","has","exitingChildren","filter","child2","isPresent","onExit","isEveryExitComplete","isExitComplete","_frozenCustomRef_current_get"],"sources":["../../src/AnimatePresence.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAA0B;AACnC,SAASC,kBAAA,QAAmB;AAC5B,SAASC,WAAA,+BAAsB;AAE/B,SAASC,cAAU,mCAAqC;AACxD,SAASC,QAAA,EAAAC,cAAA,EAA0BC,UAAA,EAAAC,OAAA,EAAAC,MAAA,EAAAC,QAAA;AACnC,SAASC,kBAAA,QAAqB;AAiGnB,SAAAC,aAAA;AA5FX,SAAMC,SAAAC,GAAe;EACnB,uBAEG;;EAEC,OAAAA,GAAM,IAAK,OAAMC,MAAA,oBAAAD,GAAA,CAAAE,WAAA,KAAAD,MAAA,qBAAAD,GAAA;AACjB;AACA,IAAAG,WAAU,YAAAA,CAAOC,KAAO;EAEtB,OAAAA,KAAO,CAAAC,GAAG,gBAAa;IACzB,IAAAC,EAAA,GAAAF,KAAA,CAAAG,IAAA;IACA,IAAAC,WAAO,GAAAF,EAAA,mBAAAA,EAAA;IACT,IAAGA,EAAA,YAAAA,EAAA,iCAAAP,QAAA,CAAAO,EAAA,qCAAAA,EAAA;MAEP,OAAAA,EAAA,CAAAG,YAAA,CAAAC,aAAA,IAAAF,WAAA;IAEA;IACE,OAAMA,WAAiC;EAEvC;AACE;AAA8C,SAC/CG,aAAAC,QAAA;EACD,IAAAC,QAAO;EACTtB,QAAA,CAAAuB,OAAA,CAAAF,QAAA,YAAAR,KAAA;IAEO,IAAM,eAETZ,cAAC,CAAAY,KAAA,GAAAS,QAAA,CAAAE,IAAA,CAAAX,KAAA;EACH;EACA,OAAAS,QAAA;AAA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IAAA,CAAAE,SAAA;IAEAyB,QAAI,EAAA2B,gBAAA,CAAAR,GAAsB,WAAA2B,MAAA;MAC1B,IAAAZ,IAAA,GAAA3C,WAAsB,CAAAuD,MAAA;MACpB,IAAAC,SAAK,GAAA9B,eAAgB,KAAAU,gBAAsB,IAAAT,WAAA,CAAAiB,QAAA,CAAAD,IAAA;MAC7C,IAACc,MAAA,YAAAA,CAAA;QAED,IAAIxB,YAAA,CAAAmB,GAAA,CAAAT,IAAqB;UACvBV,YAAc,CAAAa,GAAA,CAAAH,IAAA;QACd;UACA;QACF;QACF,IAAAe,mBAAA;QAEAzB,YACE,CAAAtB,OAAA,WAAAgD,cAAA;UAAC,KAAAA,cAAA,EAAAD,mBAAA;QAAA;QAEC,IAAAA,mBAAA;UACAnB,WAAU,aAAgBA,WAAW,UAAU,SAAY,IAAAA,WAAA;UAC3DF,mBAAoB,CAAAL,sBAAU,CAAgBQ,OAAA,CAAQ;UACtDrB,cAAA,aAAAA,cAAA,uBAAAA,cAAA;QACA;MAAA;MACA,IACAyC,4BAAA;MAAA,OACA,eAAgB9E,IAAA,CAAAa,aAAwB;QAEvC6D,SAAA;QAAAtC,OAAA,GAAAW,eAAA,CAAAW,OAAA,IAAAtB,OAAA;QAVIK,MAAA,EAAAiC,SAAA,GAAAjC,MAAA,IAAAqC,4BAAA,GAAA9B,eAAA,CAAAU,OAAA,CAAAK,GAAA,CAAAF,IAAA,eAAAiB,4BAAA,cAAAA,4BAAA,GAAArC,MAAA;QAWPD,qBAAA;QAGNL,gBAAA;QAEJF,YAAA;QAEAC,WAAgB","ignoreList":[]}
|
|
@@ -14,9 +14,10 @@ const PresenceChild = React.memo(({
|
|
|
14
14
|
presenceAffectsLayout,
|
|
15
15
|
custom
|
|
16
16
|
}) => {
|
|
17
|
-
const presenceChildren = useConstant(newChildrenMap)
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
const presenceChildren = useConstant(newChildrenMap);
|
|
18
|
+
const id = useId() || "";
|
|
19
|
+
const context = React.useMemo(() => {
|
|
20
|
+
return {
|
|
20
21
|
id,
|
|
21
22
|
initial,
|
|
22
23
|
isPresent,
|
|
@@ -25,24 +26,34 @@ const PresenceChild = React.memo(({
|
|
|
25
26
|
enterVariant,
|
|
26
27
|
enterExitVariant,
|
|
27
28
|
onExitComplete: () => {
|
|
28
|
-
presenceChildren.set(id,
|
|
29
|
-
for (const isComplete of presenceChildren.values())
|
|
29
|
+
presenceChildren.set(id, true);
|
|
30
|
+
for (const isComplete of presenceChildren.values()) {
|
|
31
|
+
if (!isComplete) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
30
35
|
onExitComplete?.();
|
|
31
36
|
},
|
|
32
|
-
register: () =>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
register: () => {
|
|
38
|
+
presenceChildren.set(id, false);
|
|
39
|
+
return () => presenceChildren.delete(id);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
/**
|
|
44
|
+
* If the presence of a child affects the layout of the components around it,
|
|
45
|
+
* we want to make a new context value to ensure they get re-rendered
|
|
46
|
+
* so they can detect that layout change.
|
|
47
|
+
*/
|
|
48
|
+
// @ts-expect-error its ok
|
|
49
|
+
presenceAffectsLayout ? void 0 : [isPresent, exitVariant, enterVariant]);
|
|
50
|
+
React.useMemo(() => {
|
|
51
|
+
presenceChildren.forEach((_, key) => presenceChildren.set(key, false));
|
|
52
|
+
}, [isPresent]);
|
|
53
|
+
React.useEffect(() => {
|
|
44
54
|
!isPresent && !presenceChildren.size && onExitComplete?.();
|
|
45
|
-
}, [isPresent])
|
|
55
|
+
}, [isPresent]);
|
|
56
|
+
return /* @__PURE__ */jsx(PresenceContext.Provider, {
|
|
46
57
|
value: context,
|
|
47
58
|
children
|
|
48
59
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useConstant","PresenceContext","React","useId","jsx","PresenceChild","memo","children","initial","isPresent","onExitComplete","exitVariant","enterVariant","enterExitVariant","presenceAffectsLayout","custom","presenceChildren","newChildrenMap","id","context","useMemo","set","isComplete","values","register","delete","forEach","_","key","useEffect","size","Provider","value","Map"],"sources":["../../src/PresenceChild.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,WAAA,QAAmB;AAC5B,SAASC,eAAA,QAAuB;AAEhC,YAAYC,KAAA,MAAW;AACvB,SAASC,KAAA,QAAa;AA+EX,SAAAC,GAAA;AA9DJ,MAAMC,aAAA,GAAgBH,KAAA,CAAMI,IAAA,CACjC,CAAC;EACCC,QAAA;EACAC,OAAA;EACAC,SAAA;EACAC,cAAA;EACAC,WAAA;EACAC,YAAA;EACAC,gBAAA;EACAC,qBAAA;EACAC;AACF,MAA0B;EACxB,MAAMC,gBAAA,GAAmBhB,WAAA,CAAYiB,cAAc;
|
|
1
|
+
{"version":3,"names":["useConstant","PresenceContext","React","useId","jsx","PresenceChild","memo","children","initial","isPresent","onExitComplete","exitVariant","enterVariant","enterExitVariant","presenceAffectsLayout","custom","presenceChildren","newChildrenMap","id","context","useMemo","set","isComplete","values","register","delete","forEach","_","key","useEffect","size","Provider","value","Map"],"sources":["../../src/PresenceChild.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,WAAA,QAAmB;AAC5B,SAASC,eAAA,QAAuB;AAEhC,YAAYC,KAAA,MAAW;AACvB,SAASC,KAAA,QAAa;AA+EX,SAAAC,GAAA;AA9DJ,MAAMC,aAAA,GAAgBH,KAAA,CAAMI,IAAA,CACjC,CAAC;EACCC,QAAA;EACAC,OAAA;EACAC,SAAA;EACAC,cAAA;EACAC,WAAA;EACAC,YAAA;EACAC,gBAAA;EACAC,qBAAA;EACAC;AACF,MAA0B;EACxB,MAAMC,gBAAA,GAAmBhB,WAAA,CAAYiB,cAAc;EACnD,MAAMC,EAAA,GAA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