@tamagui/animate-presence 2.0.0-rc.3 → 2.0.0-rc.30
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 +54 -67
- package/dist/cjs/AnimatePresence.native.js +69 -76
- package/dist/cjs/AnimatePresence.native.js.map +1 -1
- package/dist/cjs/index.js +13 -10
- package/dist/esm/AnimatePresence.mjs +52 -65
- package/dist/esm/AnimatePresence.mjs.map +1 -1
- package/dist/esm/AnimatePresence.native.js +65 -72
- package/dist/esm/AnimatePresence.native.js.map +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/index.js.map +1 -6
- package/package.json +11 -14
- package/src/AnimatePresence.tsx +164 -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 -118
- 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/types.js +0 -14
- package/dist/cjs/types.js.map +0 -6
- package/dist/esm/AnimatePresence.js +0 -107
- 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
|
@@ -23,23 +23,22 @@ __export(AnimatePresence_exports, {
|
|
|
23
23
|
AnimatePresence: () => AnimatePresence
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(AnimatePresence_exports);
|
|
26
|
-
var
|
|
26
|
+
var import_react = require("react"),
|
|
27
|
+
import_use_constant = require("@tamagui/use-constant"),
|
|
27
28
|
import_use_force_update = require("@tamagui/use-force-update"),
|
|
28
|
-
|
|
29
|
+
import_react2 = require("react"),
|
|
29
30
|
import_LayoutGroupContext = require("./LayoutGroupContext.cjs"),
|
|
30
31
|
import_PresenceChild = require("./PresenceChild.cjs"),
|
|
31
32
|
import_jsx_runtime = require("react/jsx-runtime");
|
|
32
|
-
const getChildKey = child => child.key ||
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
});
|
|
38
|
-
}
|
|
33
|
+
const getChildKey = child => child.key || (() => {
|
|
34
|
+
const ct = child.type,
|
|
35
|
+
defaultName = ct.displayName || ct.name || "";
|
|
36
|
+
return ct && typeof ct == "object" && "staticConfig" in ct && ct.staticConfig.componentName || defaultName;
|
|
37
|
+
})();
|
|
39
38
|
function onlyElements(children) {
|
|
40
39
|
const filtered = [];
|
|
41
|
-
return
|
|
42
|
-
(0,
|
|
40
|
+
return import_react2.Children.forEach(children, child => {
|
|
41
|
+
(0, import_react2.isValidElement)(child) && filtered.push(child);
|
|
43
42
|
}), filtered;
|
|
44
43
|
}
|
|
45
44
|
const AnimatePresence = ({
|
|
@@ -50,75 +49,63 @@ const AnimatePresence = ({
|
|
|
50
49
|
initial = !0,
|
|
51
50
|
onExitComplete,
|
|
52
51
|
exitBeforeEnter,
|
|
52
|
+
mode,
|
|
53
53
|
presenceAffectsLayout = !0,
|
|
54
54
|
custom,
|
|
55
55
|
passThrough
|
|
56
56
|
}) => {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
57
|
+
const effectiveMode = mode ?? (exitBeforeEnter ? "wait" : "sync"),
|
|
58
|
+
presentChildren = (0, import_react2.useMemo)(() => onlyElements(children), [children]),
|
|
59
|
+
presentKeys = presentChildren.map(getChildKey),
|
|
60
|
+
isInitialRender = (0, import_react2.useRef)(!0),
|
|
61
|
+
frozenCustomRef = (0, import_react2.useRef)(/* @__PURE__ */new Map()),
|
|
62
|
+
pendingPresentChildren = (0, import_react2.useRef)(presentChildren),
|
|
63
|
+
exitComplete = (0, import_use_constant.useConstant)(() => /* @__PURE__ */new Map()),
|
|
64
|
+
[diffedChildren, setDiffedChildren] = (0, import_react2.useState)(presentChildren),
|
|
65
|
+
[renderedChildren, setRenderedChildren] = (0, import_react2.useState)(presentChildren),
|
|
66
|
+
forceRender = (0, import_react2.useContext)(import_LayoutGroupContext.LayoutGroupContext).forceRender ?? (0, import_use_force_update.useForceUpdate)();
|
|
64
67
|
if (passThrough) return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
65
68
|
children
|
|
66
69
|
});
|
|
67
|
-
if ((0,
|
|
68
|
-
isInitialRender.current = !1;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
const presentKeys = presentChildren.current.map(getChildKey),
|
|
83
|
-
targetKeys = filteredChildren.map(getChildKey),
|
|
84
|
-
numPresent = presentKeys.length;
|
|
85
|
-
for (let i = 0; i < numPresent; i++) {
|
|
86
|
-
const key = presentKeys[i];
|
|
87
|
-
targetKeys.indexOf(key) === -1 ? exiting.add(key) : exiting.delete(key);
|
|
70
|
+
if ((0, import_react.useInsertionEffect)(() => {
|
|
71
|
+
isInitialRender.current = !1, pendingPresentChildren.current = presentChildren;
|
|
72
|
+
for (let i = 0; i < renderedChildren.length; i++) {
|
|
73
|
+
const key = getChildKey(renderedChildren[i]);
|
|
74
|
+
presentKeys.includes(key) ? (exitComplete.delete(key), frozenCustomRef.current.delete(key)) : exitComplete.get(key) !== !0 && exitComplete.set(key, !1);
|
|
75
|
+
}
|
|
76
|
+
}, [renderedChildren, presentKeys.length, presentKeys.join("-")]), presentChildren !== diffedChildren) {
|
|
77
|
+
let nextChildren = [...presentChildren];
|
|
78
|
+
for (let i = 0; i < renderedChildren.length; i++) {
|
|
79
|
+
const child = renderedChildren[i],
|
|
80
|
+
key = getChildKey(child);
|
|
81
|
+
presentKeys.includes(key) || (nextChildren.splice(i, 0, child), frozenCustomRef.current.has(key) || frozenCustomRef.current.set(key, custom));
|
|
82
|
+
}
|
|
83
|
+
const exitingChildren = renderedChildren.filter(child => !presentKeys.includes(getChildKey(child)));
|
|
84
|
+
return effectiveMode === "wait" && exitingChildren.length && (nextChildren = exitingChildren), setRenderedChildren(onlyElements(nextChildren)), setDiffedChildren(presentChildren), null;
|
|
88
85
|
}
|
|
89
|
-
return
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
86
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
87
|
+
children: renderedChildren.map(child => {
|
|
88
|
+
const key = getChildKey(child),
|
|
89
|
+
isPresent = presentChildren === renderedChildren || presentKeys.includes(key),
|
|
90
|
+
onExit = () => {
|
|
91
|
+
if (exitComplete.has(key)) exitComplete.set(key, !0);else return;
|
|
92
|
+
let isEveryExitComplete = !0;
|
|
93
|
+
exitComplete.forEach(isExitComplete => {
|
|
94
|
+
isExitComplete || (isEveryExitComplete = !1);
|
|
95
|
+
}), isEveryExitComplete && (forceRender?.(), setRenderedChildren(pendingPresentChildren.current), onExitComplete?.());
|
|
96
|
+
};
|
|
97
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_PresenceChild.PresenceChild, {
|
|
98
|
+
isPresent,
|
|
99
|
+
initial: !isInitialRender.current || initial ? void 0 : !1,
|
|
100
|
+
custom: isPresent ? custom : frozenCustomRef.current.get(key) ?? custom,
|
|
101
101
|
presenceAffectsLayout,
|
|
102
102
|
enterExitVariant,
|
|
103
103
|
enterVariant,
|
|
104
104
|
exitVariant,
|
|
105
|
-
|
|
105
|
+
onExitComplete: isPresent ? void 0 : onExit,
|
|
106
106
|
children: child
|
|
107
|
-
},
|
|
108
|
-
|
|
109
|
-
}), childrenToRender = childrenToRender.map(child => {
|
|
110
|
-
const key = child.key;
|
|
111
|
-
return exiting.has(key) ? child : /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_PresenceChild.PresenceChild, {
|
|
112
|
-
isPresent: !0,
|
|
113
|
-
exitVariant,
|
|
114
|
-
enterVariant,
|
|
115
|
-
enterExitVariant,
|
|
116
|
-
presenceAffectsLayout,
|
|
117
|
-
custom,
|
|
118
|
-
children: child
|
|
119
|
-
}, getChildKey(child));
|
|
120
|
-
}), presentChildren.current = childrenToRender, /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
121
|
-
children: exiting.size ? childrenToRender : childrenToRender.map(child => (0, import_react.cloneElement)(child))
|
|
107
|
+
}, key);
|
|
108
|
+
})
|
|
122
109
|
});
|
|
123
110
|
};
|
|
124
111
|
AnimatePresence.displayName = "AnimatePresence";
|
|
@@ -26,24 +26,28 @@ __export(AnimatePresence_exports, {
|
|
|
26
26
|
});
|
|
27
27
|
module.exports = __toCommonJS(AnimatePresence_exports);
|
|
28
28
|
var import_jsx_runtime = require("react/jsx-runtime"),
|
|
29
|
-
import_constants = require("@tamagui/constants"),
|
|
30
|
-
import_use_force_update = require("@tamagui/use-force-update"),
|
|
31
29
|
import_react = require("react"),
|
|
30
|
+
import_use_constant = require("@tamagui/use-constant"),
|
|
31
|
+
import_use_force_update = require("@tamagui/use-force-update"),
|
|
32
|
+
import_react2 = require("react"),
|
|
32
33
|
import_LayoutGroupContext = require("./LayoutGroupContext.native.js"),
|
|
33
|
-
import_PresenceChild = require("./PresenceChild.native.js")
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
children.forEach(function (child) {
|
|
39
|
-
var key = getChildKey(child);
|
|
40
|
-
allChildren.set(key, child);
|
|
41
|
-
});
|
|
34
|
+
import_PresenceChild = require("./PresenceChild.native.js");
|
|
35
|
+
function _type_of(obj) {
|
|
36
|
+
"@swc/helpers - typeof";
|
|
37
|
+
|
|
38
|
+
return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
42
39
|
}
|
|
40
|
+
var getChildKey = function (child) {
|
|
41
|
+
return child.key || function () {
|
|
42
|
+
var ct = child.type,
|
|
43
|
+
defaultName = ct.displayName || ct.name || "";
|
|
44
|
+
return ct && (typeof ct > "u" ? "undefined" : _type_of(ct)) === "object" && "staticConfig" in ct && ct.staticConfig.componentName || defaultName;
|
|
45
|
+
}();
|
|
46
|
+
};
|
|
43
47
|
function onlyElements(children) {
|
|
44
48
|
var filtered = [];
|
|
45
|
-
return
|
|
46
|
-
/* @__PURE__ */(0,
|
|
49
|
+
return import_react2.Children.forEach(children, function (child) {
|
|
50
|
+
/* @__PURE__ */(0, import_react2.isValidElement)(child) && filtered.push(child);
|
|
47
51
|
}), filtered;
|
|
48
52
|
}
|
|
49
53
|
var AnimatePresence = function (param) {
|
|
@@ -55,80 +59,69 @@ var AnimatePresence = function (param) {
|
|
|
55
59
|
initial = !0,
|
|
56
60
|
onExitComplete,
|
|
57
61
|
exitBeforeEnter,
|
|
62
|
+
mode,
|
|
58
63
|
presenceAffectsLayout = !0,
|
|
59
64
|
custom,
|
|
60
65
|
passThrough
|
|
61
66
|
} = param,
|
|
67
|
+
effectiveMode = mode ?? (exitBeforeEnter ? "wait" : "sync"),
|
|
68
|
+
presentChildren = (0, import_react2.useMemo)(function () {
|
|
69
|
+
return onlyElements(children);
|
|
70
|
+
}, [children]),
|
|
71
|
+
presentKeys = presentChildren.map(getChildKey),
|
|
72
|
+
isInitialRender = (0, import_react2.useRef)(!0),
|
|
73
|
+
frozenCustomRef = (0, import_react2.useRef)(/* @__PURE__ */new Map()),
|
|
74
|
+
pendingPresentChildren = (0, import_react2.useRef)(presentChildren),
|
|
75
|
+
exitComplete = (0, import_use_constant.useConstant)(function () {
|
|
76
|
+
return /* @__PURE__ */new Map();
|
|
77
|
+
}),
|
|
78
|
+
[diffedChildren, setDiffedChildren] = (0, import_react2.useState)(presentChildren),
|
|
79
|
+
[renderedChildren, setRenderedChildren] = (0, import_react2.useState)(presentChildren),
|
|
62
80
|
_useContext_forceRender,
|
|
63
|
-
forceRender = (_useContext_forceRender = (0,
|
|
64
|
-
filteredChildren = onlyElements(children),
|
|
65
|
-
presentChildren = (0, import_react.useRef)(filteredChildren),
|
|
66
|
-
allChildren = (0, import_react.useRef)(/* @__PURE__ */new Map()).current,
|
|
67
|
-
exiting = (0, import_react.useRef)(/* @__PURE__ */new Set()).current;
|
|
68
|
-
updateChildLookup(filteredChildren, allChildren);
|
|
69
|
-
var isInitialRender = (0, import_react.useRef)(!0);
|
|
81
|
+
forceRender = (_useContext_forceRender = (0, import_react2.useContext)(import_LayoutGroupContext.LayoutGroupContext).forceRender) !== null && _useContext_forceRender !== void 0 ? _useContext_forceRender : (0, import_use_force_update.useForceUpdate)();
|
|
70
82
|
if (passThrough) return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
71
83
|
children
|
|
72
84
|
});
|
|
73
|
-
if ((0,
|
|
74
|
-
isInitialRender.current = !1;
|
|
75
|
-
|
|
76
|
-
|
|
85
|
+
if ((0, import_react.useInsertionEffect)(function () {
|
|
86
|
+
isInitialRender.current = !1, pendingPresentChildren.current = presentChildren;
|
|
87
|
+
for (var i2 = 0; i2 < renderedChildren.length; i2++) {
|
|
88
|
+
var key2 = getChildKey(renderedChildren[i2]);
|
|
89
|
+
presentKeys.includes(key2) ? (exitComplete.delete(key2), frozenCustomRef.current.delete(key2)) : exitComplete.get(key2) !== !0 && exitComplete.set(key2, !1);
|
|
90
|
+
}
|
|
91
|
+
}, [renderedChildren, presentKeys.length, presentKeys.join("-")]), presentChildren !== diffedChildren) {
|
|
92
|
+
for (var nextChildren = [...presentChildren], i = 0; i < renderedChildren.length; i++) {
|
|
93
|
+
var child = renderedChildren[i],
|
|
94
|
+
key = getChildKey(child);
|
|
95
|
+
presentKeys.includes(key) || (nextChildren.splice(i, 0, child), frozenCustomRef.current.has(key) || frozenCustomRef.current.set(key, custom));
|
|
96
|
+
}
|
|
97
|
+
var exitingChildren = renderedChildren.filter(function (child2) {
|
|
98
|
+
return !presentKeys.includes(getChildKey(child2));
|
|
99
|
+
});
|
|
100
|
+
return effectiveMode === "wait" && exitingChildren.length && (nextChildren = exitingChildren), setRenderedChildren(onlyElements(nextChildren)), setDiffedChildren(presentChildren), null;
|
|
101
|
+
}
|
|
102
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
103
|
+
children: renderedChildren.map(function (child2) {
|
|
104
|
+
var key2 = getChildKey(child2),
|
|
105
|
+
isPresent = presentChildren === renderedChildren || presentKeys.includes(key2),
|
|
106
|
+
onExit = function () {
|
|
107
|
+
if (exitComplete.has(key2)) exitComplete.set(key2, !0);else return;
|
|
108
|
+
var isEveryExitComplete = !0;
|
|
109
|
+
exitComplete.forEach(function (isExitComplete) {
|
|
110
|
+
isExitComplete || (isEveryExitComplete = !1);
|
|
111
|
+
}), isEveryExitComplete && (forceRender?.(), setRenderedChildren(pendingPresentChildren.current), onExitComplete?.());
|
|
112
|
+
},
|
|
113
|
+
_frozenCustomRef_current_get;
|
|
77
114
|
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_PresenceChild.PresenceChild, {
|
|
78
|
-
isPresent
|
|
115
|
+
isPresent,
|
|
116
|
+
initial: !isInitialRender.current || initial ? void 0 : !1,
|
|
117
|
+
custom: isPresent ? custom : (_frozenCustomRef_current_get = frozenCustomRef.current.get(key2)) !== null && _frozenCustomRef_current_get !== void 0 ? _frozenCustomRef_current_get : custom,
|
|
118
|
+
presenceAffectsLayout,
|
|
79
119
|
enterExitVariant,
|
|
80
|
-
exitVariant,
|
|
81
120
|
enterVariant,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}, getChildKey(child));
|
|
87
|
-
})
|
|
88
|
-
});
|
|
89
|
-
for (var childrenToRender = [...filteredChildren], presentKeys = presentChildren.current.map(getChildKey), targetKeys = filteredChildren.map(getChildKey), numPresent = presentKeys.length, i = 0; i < numPresent; i++) {
|
|
90
|
-
var key = presentKeys[i];
|
|
91
|
-
targetKeys.indexOf(key) === -1 ? exiting.add(key) : exiting.delete(key);
|
|
92
|
-
}
|
|
93
|
-
return exitBeforeEnter && exiting.size && (childrenToRender = []), exiting.forEach(function (key2) {
|
|
94
|
-
if (targetKeys.indexOf(key2) === -1) {
|
|
95
|
-
var child = allChildren.get(key2);
|
|
96
|
-
if (child) {
|
|
97
|
-
var insertionIndex = presentKeys.indexOf(key2),
|
|
98
|
-
onExit = function () {
|
|
99
|
-
allChildren.delete(key2), exiting.delete(key2);
|
|
100
|
-
var removeIndex = presentChildren.current.findIndex(function (presentChild) {
|
|
101
|
-
return presentChild.key === key2;
|
|
102
|
-
});
|
|
103
|
-
presentChildren.current.splice(removeIndex, 1), exiting.size || (presentChildren.current = filteredChildren, forceRender(), onExitComplete?.());
|
|
104
|
-
},
|
|
105
|
-
exitingComponent = /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_PresenceChild.PresenceChild, {
|
|
106
|
-
isPresent: !1,
|
|
107
|
-
onExitComplete: onExit,
|
|
108
|
-
presenceAffectsLayout,
|
|
109
|
-
enterExitVariant,
|
|
110
|
-
enterVariant,
|
|
111
|
-
exitVariant,
|
|
112
|
-
custom,
|
|
113
|
-
children: child
|
|
114
|
-
}, getChildKey(child));
|
|
115
|
-
childrenToRender.splice(insertionIndex, 0, exitingComponent);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}), childrenToRender = childrenToRender.map(function (child) {
|
|
119
|
-
var key2 = child.key;
|
|
120
|
-
return exiting.has(key2) ? child : /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_PresenceChild.PresenceChild, {
|
|
121
|
-
isPresent: !0,
|
|
122
|
-
exitVariant,
|
|
123
|
-
enterVariant,
|
|
124
|
-
enterExitVariant,
|
|
125
|
-
presenceAffectsLayout,
|
|
126
|
-
custom,
|
|
127
|
-
children: child
|
|
128
|
-
}, getChildKey(child));
|
|
129
|
-
}), presentChildren.current = childrenToRender, /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
130
|
-
children: exiting.size ? childrenToRender : childrenToRender.map(function (child) {
|
|
131
|
-
return /* @__PURE__ */(0, import_react.cloneElement)(child);
|
|
121
|
+
exitVariant,
|
|
122
|
+
onExitComplete: isPresent ? void 0 : onExit,
|
|
123
|
+
children: child2
|
|
124
|
+
}, key2);
|
|
132
125
|
})
|
|
133
126
|
});
|
|
134
127
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","AnimatePresence_exports","__export","AnimatePresence","module","exports","import_jsx_runtime","require","
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","AnimatePresence_exports","__export","AnimatePresence","module","exports","import_jsx_runtime","require","import_react","import_use_constant","import_use_force_update","import_react2","import_LayoutGroupContext","import_PresenceChild","_type_of","obj","Symbol","constructor","getChildKey","child","key","ct","type","defaultName","displayName","name","staticConfig","componentName","onlyElements","children","filtered","Children","forEach","isValidElement","push","param","enterVariant","exitVariant","enterExitVariant","initial","onExitComplete","exitBeforeEnter","mode","presenceAffectsLayout","custom","passThrough","effectiveMode","presentChildren","useMemo","presentKeys","map","isInitialRender","useRef","frozenCustomRef","Map","pendingPresentChildren","exitComplete","useConstant","diffedChildren","setDiffedChildren","useState","renderedChildren","setRenderedChildren","_useContext_forceRender","forceRender","useContext","LayoutGroupContext","useForceUpdate","jsx","Fragment","useInsertionEffect","current","i2","length","key2","includes","delete","get","set","join","nextChildren","i","splice","has","exitingChildren","filter","child2","isPresent","onExit","isEvery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AAK,iBAAgB,EAAAzC,kBAAA,CAAA8D,GAAsB,EAAA9D,kBAAA,CAAA+D,QAAA;IAAAxC,QAGzC,EAAAgC,gBAAA,CAAAX,GACF,WAAAoC,MAAc,EACd;MAGJ,IAAAZ,IAAA,GAAAxD,WAAA,CAAAoE,MAAA;QAAAC,SAAA,GAAAxC,eAAA,KAAAc,gBAAA,IAAAZ,WAAA,CAAA0B,QAAA,CAAAD,IAAA;QAAAc,MAAA,YAAAA,CAAA;UAEA,IACEhC,YAAA,CAAA2B,GAAA,CAAAT,IAAA,GAAClB,YAAA,CAAAsB,GAAA,CAAAJ,IAAA,WAEC;UACA,IAAAe,mBAAU,GAAgB;UAC1BjC,YAAQ,CAAAxB,OAAY,WAAU0D,cAAA,EAAgB;YAC9CA,cAAA,KAAAD,mBAAA;UACA,IAAAA,mBAAA,KAAAzB,WAAA,MAAAF,mBAAA,CAAAP,sBAAA,CAAAgB,OAAA,GAAA/B,cAAA;QAAA;QACAmD,4BAAA;MAAA,OACA,mBAAArF,kBAAA,CAAA8D,GAAA,EAAAvD,oBAAA,CAAA+E,aAAA;QACAL,SAAA;QAEChD,OAAA,GAAAY,eAAA,CAAAoB,OAAA,IAAAhC,OAAA;QAAAK,MAAA,EAAA2C,SAAA,GAAA3C,MAAA,IAAA+C,4BAAA,GAAAtC,eAAA,CAAAkB,OAAA,CAAAM,GAAA,CAAAH,IAAA,eAAAiB,4BAAA,cAAAA,4BAAA,GAAA/C,MAAA;QAVID,qBAAA;QAWPL,gBAAA;QAGNF,YAAA;QAEJC,WAAA;QAEAG,cAAgB,EAAA+C,SAAc,YAAAC,MAAA","ignoreList":[]}
|
package/dist/cjs/index.js
CHANGED
|
@@ -3,16 +3,19 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
5
|
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
7
|
+
get: () => from[key],
|
|
8
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
9
|
+
});
|
|
10
|
+
return to;
|
|
11
|
+
},
|
|
12
|
+
__reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
13
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
14
|
+
value: !0
|
|
15
|
+
}), mod);
|
|
12
16
|
var index_exports = {};
|
|
13
17
|
module.exports = __toCommonJS(index_exports);
|
|
14
|
-
__reExport(index_exports, require("./AnimatePresence"), module.exports);
|
|
18
|
+
__reExport(index_exports, require("./AnimatePresence.cjs"), module.exports);
|
|
15
19
|
__reExport(index_exports, require("@tamagui/use-presence"), module.exports);
|
|
16
|
-
__reExport(index_exports, require("./types"), module.exports);
|
|
17
|
-
__reExport(index_exports, require("./PresenceChild"), module.exports);
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
|
20
|
+
__reExport(index_exports, require("./types.cjs"), module.exports);
|
|
21
|
+
__reExport(index_exports, require("./PresenceChild.cjs"), module.exports);
|
|
@@ -1,16 +1,15 @@
|
|
|
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 => child.key ||
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
});
|
|
13
|
-
}
|
|
8
|
+
const getChildKey = child => child.key || (() => {
|
|
9
|
+
const ct = child.type,
|
|
10
|
+
defaultName = ct.displayName || ct.name || "";
|
|
11
|
+
return ct && typeof ct == "object" && "staticConfig" in ct && ct.staticConfig.componentName || defaultName;
|
|
12
|
+
})();
|
|
14
13
|
function onlyElements(children) {
|
|
15
14
|
const filtered = [];
|
|
16
15
|
return Children.forEach(children, child => {
|
|
@@ -25,75 +24,63 @@ const AnimatePresence = ({
|
|
|
25
24
|
initial = !0,
|
|
26
25
|
onExitComplete,
|
|
27
26
|
exitBeforeEnter,
|
|
27
|
+
mode,
|
|
28
28
|
presenceAffectsLayout = !0,
|
|
29
29
|
custom,
|
|
30
30
|
passThrough
|
|
31
31
|
}) => {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
const effectiveMode = mode ?? (exitBeforeEnter ? "wait" : "sync"),
|
|
33
|
+
presentChildren = useMemo(() => onlyElements(children), [children]),
|
|
34
|
+
presentKeys = presentChildren.map(getChildKey),
|
|
35
|
+
isInitialRender = useRef(!0),
|
|
36
|
+
frozenCustomRef = useRef(/* @__PURE__ */new Map()),
|
|
37
|
+
pendingPresentChildren = useRef(presentChildren),
|
|
38
|
+
exitComplete = useConstant(() => /* @__PURE__ */new Map()),
|
|
39
|
+
[diffedChildren, setDiffedChildren] = useState(presentChildren),
|
|
40
|
+
[renderedChildren, setRenderedChildren] = useState(presentChildren),
|
|
41
|
+
forceRender = useContext(LayoutGroupContext).forceRender ?? useForceUpdate();
|
|
39
42
|
if (passThrough) return /* @__PURE__ */jsx(Fragment, {
|
|
40
43
|
children
|
|
41
44
|
});
|
|
42
|
-
if (
|
|
43
|
-
isInitialRender.current = !1;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const presentKeys = presentChildren.current.map(getChildKey),
|
|
58
|
-
targetKeys = filteredChildren.map(getChildKey),
|
|
59
|
-
numPresent = presentKeys.length;
|
|
60
|
-
for (let i = 0; i < numPresent; i++) {
|
|
61
|
-
const key = presentKeys[i];
|
|
62
|
-
targetKeys.indexOf(key) === -1 ? exiting.add(key) : exiting.delete(key);
|
|
45
|
+
if (useInsertionEffect(() => {
|
|
46
|
+
isInitialRender.current = !1, pendingPresentChildren.current = presentChildren;
|
|
47
|
+
for (let i = 0; i < renderedChildren.length; i++) {
|
|
48
|
+
const key = getChildKey(renderedChildren[i]);
|
|
49
|
+
presentKeys.includes(key) ? (exitComplete.delete(key), frozenCustomRef.current.delete(key)) : exitComplete.get(key) !== !0 && exitComplete.set(key, !1);
|
|
50
|
+
}
|
|
51
|
+
}, [renderedChildren, presentKeys.length, presentKeys.join("-")]), presentChildren !== diffedChildren) {
|
|
52
|
+
let nextChildren = [...presentChildren];
|
|
53
|
+
for (let i = 0; i < renderedChildren.length; i++) {
|
|
54
|
+
const child = renderedChildren[i],
|
|
55
|
+
key = getChildKey(child);
|
|
56
|
+
presentKeys.includes(key) || (nextChildren.splice(i, 0, child), frozenCustomRef.current.has(key) || frozenCustomRef.current.set(key, custom));
|
|
57
|
+
}
|
|
58
|
+
const exitingChildren = renderedChildren.filter(child => !presentKeys.includes(getChildKey(child)));
|
|
59
|
+
return effectiveMode === "wait" && exitingChildren.length && (nextChildren = exitingChildren), setRenderedChildren(onlyElements(nextChildren)), setDiffedChildren(presentChildren), null;
|
|
63
60
|
}
|
|
64
|
-
return
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
61
|
+
return /* @__PURE__ */jsx(Fragment, {
|
|
62
|
+
children: renderedChildren.map(child => {
|
|
63
|
+
const key = getChildKey(child),
|
|
64
|
+
isPresent = presentChildren === renderedChildren || presentKeys.includes(key),
|
|
65
|
+
onExit = () => {
|
|
66
|
+
if (exitComplete.has(key)) exitComplete.set(key, !0);else return;
|
|
67
|
+
let isEveryExitComplete = !0;
|
|
68
|
+
exitComplete.forEach(isExitComplete => {
|
|
69
|
+
isExitComplete || (isEveryExitComplete = !1);
|
|
70
|
+
}), isEveryExitComplete && (forceRender?.(), setRenderedChildren(pendingPresentChildren.current), onExitComplete?.());
|
|
71
|
+
};
|
|
72
|
+
return /* @__PURE__ */jsx(PresenceChild, {
|
|
73
|
+
isPresent,
|
|
74
|
+
initial: !isInitialRender.current || initial ? void 0 : !1,
|
|
75
|
+
custom: isPresent ? custom : frozenCustomRef.current.get(key) ?? custom,
|
|
76
76
|
presenceAffectsLayout,
|
|
77
77
|
enterExitVariant,
|
|
78
78
|
enterVariant,
|
|
79
79
|
exitVariant,
|
|
80
|
-
|
|
80
|
+
onExitComplete: isPresent ? void 0 : onExit,
|
|
81
81
|
children: child
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
}), childrenToRender = childrenToRender.map(child => {
|
|
85
|
-
const key = child.key;
|
|
86
|
-
return exiting.has(key) ? child : /* @__PURE__ */jsx(PresenceChild, {
|
|
87
|
-
isPresent: !0,
|
|
88
|
-
exitVariant,
|
|
89
|
-
enterVariant,
|
|
90
|
-
enterExitVariant,
|
|
91
|
-
presenceAffectsLayout,
|
|
92
|
-
custom,
|
|
93
|
-
children: child
|
|
94
|
-
}, getChildKey(child));
|
|
95
|
-
}), presentChildren.current = childrenToRender, /* @__PURE__ */jsx(Fragment, {
|
|
96
|
-
children: exiting.size ? childrenToRender : childrenToRender.map(child => cloneElement(child))
|
|
82
|
+
}, key);
|
|
83
|
+
})
|
|
97
84
|
});
|
|
98
85
|
};
|
|
99
86
|
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","displayName","name","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","delete","get","set","join","nextChildren","splice","has","exitingChildren","filter","isPresent","onExit","isEveryExitComplete","isExitComplete"],"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,IAEjBA,KAAA,CAAMC,GAAA,KACL,MAAM;EAEL,MAAMC,EAAA,GAAKF,KAAA,CAAMG,IAAA;IACXC,WAAA,GAAcF,EAAA,CAAGG,WAAA,IAAkBH,EAAA,CAAGI,IAAA,IAAW;EACvD,OAAIJ,EAAA,IAAM,OAAOA,EAAA,IAAO,YAAY,kBAAkBA,EAAA,IAE7CA,EAAA,CAAGK,YAAA,CAAaC,aAAA,IAAiBJ,WAAA;AAG5C,GAAG;AAIP,SAASK,aAAaC,QAAA,EAA0C;EAC9D,MAAMC,QAAA,GAAgC,EAAC;E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