@tamagui/animate-presence 2.0.0-rc.4 → 2.0.0-rc.40

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.
Files changed (49) hide show
  1. package/dist/cjs/AnimatePresence.cjs +112 -87
  2. package/dist/cjs/AnimatePresence.native.js +134 -104
  3. package/dist/cjs/AnimatePresence.native.js.map +1 -1
  4. package/dist/cjs/LayoutGroupContext.cjs +24 -22
  5. package/dist/cjs/LayoutGroupContext.native.js +26 -24
  6. package/dist/cjs/LayoutGroupContext.native.js.map +1 -1
  7. package/dist/cjs/PresenceChild.cjs +58 -45
  8. package/dist/cjs/PresenceChild.native.js +103 -91
  9. package/dist/cjs/PresenceChild.native.js.map +1 -1
  10. package/dist/cjs/index.cjs +7 -5
  11. package/dist/cjs/index.native.js +7 -5
  12. package/dist/cjs/index.native.js.map +1 -1
  13. package/dist/cjs/types.cjs +7 -5
  14. package/dist/cjs/types.native.js +7 -5
  15. package/dist/cjs/types.native.js.map +1 -1
  16. package/dist/esm/AnimatePresence.mjs +96 -73
  17. package/dist/esm/AnimatePresence.mjs.map +1 -1
  18. package/dist/esm/AnimatePresence.native.js +117 -89
  19. package/dist/esm/AnimatePresence.native.js.map +1 -1
  20. package/dist/esm/PresenceChild.mjs +29 -18
  21. package/dist/esm/PresenceChild.mjs.map +1 -1
  22. package/dist/esm/PresenceChild.native.js +60 -50
  23. package/dist/esm/PresenceChild.native.js.map +1 -1
  24. package/dist/esm/index.js +3 -3
  25. package/dist/esm/index.js.map +1 -6
  26. package/package.json +11 -14
  27. package/src/AnimatePresence.tsx +164 -143
  28. package/src/types.ts +10 -9
  29. package/types/AnimatePresence.d.ts.map +1 -1
  30. package/types/types.d.ts +9 -9
  31. package/types/types.d.ts.map +1 -1
  32. package/dist/cjs/AnimatePresence.js +0 -118
  33. package/dist/cjs/AnimatePresence.js.map +0 -6
  34. package/dist/cjs/LayoutGroupContext.js +0 -30
  35. package/dist/cjs/LayoutGroupContext.js.map +0 -6
  36. package/dist/cjs/PresenceChild.js +0 -77
  37. package/dist/cjs/PresenceChild.js.map +0 -6
  38. package/dist/cjs/index.js +0 -18
  39. package/dist/cjs/index.js.map +0 -6
  40. package/dist/cjs/types.js +0 -14
  41. package/dist/cjs/types.js.map +0 -6
  42. package/dist/esm/AnimatePresence.js +0 -107
  43. package/dist/esm/AnimatePresence.js.map +0 -6
  44. package/dist/esm/LayoutGroupContext.js +0 -6
  45. package/dist/esm/LayoutGroupContext.js.map +0 -6
  46. package/dist/esm/PresenceChild.js +0 -57
  47. package/dist/esm/PresenceChild.js.map +0 -6
  48. package/dist/esm/types.js +0 -1
  49. package/dist/esm/types.js.map +0 -6
@@ -3,122 +3,147 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
5
  var __export = (target, all) => {
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: !0
9
- });
10
- },
11
- __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
13
14
  get: () => from[key],
14
15
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
16
  });
16
- return to;
17
- };
17
+ }
18
+ return to;
19
+ };
18
20
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
- value: !0
21
+ value: true
20
22
  }), mod);
21
23
  var AnimatePresence_exports = {};
22
24
  __export(AnimatePresence_exports, {
23
25
  AnimatePresence: () => AnimatePresence
24
26
  });
25
27
  module.exports = __toCommonJS(AnimatePresence_exports);
26
- var import_constants = require("@tamagui/constants"),
27
- import_use_force_update = require("@tamagui/use-force-update"),
28
- import_react = require("react"),
29
- import_LayoutGroupContext = require("./LayoutGroupContext.cjs"),
30
- import_PresenceChild = require("./PresenceChild.cjs"),
31
- import_jsx_runtime = require("react/jsx-runtime");
32
- const getChildKey = child => child.key || "";
33
- function updateChildLookup(children, allChildren) {
34
- children.forEach(child => {
35
- const key = getChildKey(child);
36
- allChildren.set(key, child);
37
- });
38
- }
28
+ var import_react = require("react");
29
+ var import_use_constant = require("@tamagui/use-constant");
30
+ var import_use_force_update = require("@tamagui/use-force-update");
31
+ var import_react2 = require("react");
32
+ var import_LayoutGroupContext = require("./LayoutGroupContext.cjs");
33
+ var import_PresenceChild = require("./PresenceChild.cjs");
34
+ var import_jsx_runtime = require("react/jsx-runtime");
35
+ const getChildKey = child => {
36
+ return child.key || (() => {
37
+ const ct = child.type;
38
+ const defaultName = ct["displayName"] || ct["name"] || "";
39
+ if (ct && typeof ct === "object" && "staticConfig" in ct) {
40
+ return ct.staticConfig.componentName || defaultName;
41
+ }
42
+ return defaultName;
43
+ })();
44
+ };
39
45
  function onlyElements(children) {
40
46
  const filtered = [];
41
- return import_react.Children.forEach(children, child => {
42
- (0, import_react.isValidElement)(child) && filtered.push(child);
43
- }), filtered;
47
+ import_react2.Children.forEach(children, child => {
48
+ if ((0, import_react2.isValidElement)(child)) filtered.push(child);
49
+ });
50
+ return filtered;
44
51
  }
45
52
  const AnimatePresence = ({
46
53
  children,
47
54
  enterVariant,
48
55
  exitVariant,
49
56
  enterExitVariant,
50
- initial = !0,
57
+ initial = true,
51
58
  onExitComplete,
52
59
  exitBeforeEnter,
53
- presenceAffectsLayout = !0,
60
+ mode,
61
+ presenceAffectsLayout = true,
54
62
  custom,
55
63
  passThrough
56
64
  }) => {
57
- let forceRender = (0, import_react.useContext)(import_LayoutGroupContext.LayoutGroupContext).forceRender ?? (0, import_use_force_update.useForceUpdate)();
58
- const filteredChildren = onlyElements(children),
59
- presentChildren = (0, import_react.useRef)(filteredChildren),
60
- allChildren = (0, import_react.useRef)(/* @__PURE__ */new Map()).current,
61
- exiting = (0, import_react.useRef)(/* @__PURE__ */new Set()).current;
62
- updateChildLookup(filteredChildren, allChildren);
63
- const isInitialRender = (0, import_react.useRef)(!0);
64
- if (passThrough) return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
65
- children
66
- });
67
- if ((0, import_constants.useIsomorphicLayoutEffect)(() => {
68
- isInitialRender.current = !1;
69
- }, []), isInitialRender.current) return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
70
- children: filteredChildren.map(child => /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_PresenceChild.PresenceChild, {
71
- isPresent: !0,
72
- enterExitVariant,
73
- exitVariant,
74
- enterVariant,
75
- initial: initial ? void 0 : !1,
76
- presenceAffectsLayout,
77
- custom,
78
- children: child
79
- }, getChildKey(child)))
80
- });
81
- let childrenToRender = [...filteredChildren];
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);
65
+ const effectiveMode = mode ?? (exitBeforeEnter ? "wait" : "sync");
66
+ const presentChildren = (0, import_react2.useMemo)(() => onlyElements(children), [children]);
67
+ const presentKeys = presentChildren.map(getChildKey);
68
+ const isInitialRender = (0, import_react2.useRef)(true);
69
+ const frozenCustomRef = (0, import_react2.useRef)(/* @__PURE__ */new Map());
70
+ const pendingPresentChildren = (0, import_react2.useRef)(presentChildren);
71
+ const exitComplete = (0, import_use_constant.useConstant)(() => /* @__PURE__ */new Map());
72
+ const [diffedChildren, setDiffedChildren] = (0, import_react2.useState)(presentChildren);
73
+ const [renderedChildren, setRenderedChildren] = (0, import_react2.useState)(presentChildren);
74
+ const forceRender = (0, import_react2.useContext)(import_LayoutGroupContext.LayoutGroupContext).forceRender ?? (0, import_use_force_update.useForceUpdate)();
75
+ if (passThrough) {
76
+ return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
77
+ children
78
+ });
79
+ }
80
+ (0, import_react.useInsertionEffect)(() => {
81
+ isInitialRender.current = false;
82
+ pendingPresentChildren.current = presentChildren;
83
+ for (let i = 0; i < renderedChildren.length; i++) {
84
+ const key = getChildKey(renderedChildren[i]);
85
+ if (!presentKeys.includes(key)) {
86
+ if (exitComplete.get(key) !== true) {
87
+ exitComplete.set(key, false);
88
+ }
89
+ } else {
90
+ exitComplete.delete(key);
91
+ frozenCustomRef.current.delete(key);
92
+ }
93
+ }
94
+ }, [renderedChildren, presentKeys.length, presentKeys.join("-")]);
95
+ if (presentChildren !== diffedChildren) {
96
+ let nextChildren = [...presentChildren];
97
+ for (let i = 0; i < renderedChildren.length; i++) {
98
+ const child = renderedChildren[i];
99
+ const key = getChildKey(child);
100
+ if (!presentKeys.includes(key)) {
101
+ nextChildren.splice(i, 0, child);
102
+ if (!frozenCustomRef.current.has(key)) {
103
+ frozenCustomRef.current.set(key, custom);
104
+ }
105
+ }
106
+ }
107
+ const exitingChildren = renderedChildren.filter(child => !presentKeys.includes(getChildKey(child)));
108
+ if (effectiveMode === "wait" && exitingChildren.length) {
109
+ nextChildren = exitingChildren;
110
+ }
111
+ setRenderedChildren(onlyElements(nextChildren));
112
+ setDiffedChildren(presentChildren);
113
+ return null;
88
114
  }
89
- return exitBeforeEnter && exiting.size && (childrenToRender = []), exiting.forEach(key => {
90
- if (targetKeys.indexOf(key) !== -1) return;
91
- const child = allChildren.get(key);
92
- if (!child) return;
93
- const insertionIndex = presentKeys.indexOf(key),
94
- exitingComponent = /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_PresenceChild.PresenceChild, {
95
- isPresent: !1,
96
- onExitComplete: () => {
97
- allChildren.delete(key), exiting.delete(key);
98
- const removeIndex = presentChildren.current.findIndex(presentChild => presentChild.key === key);
99
- presentChildren.current.splice(removeIndex, 1), exiting.size || (presentChildren.current = filteredChildren, forceRender(), onExitComplete?.());
100
- },
115
+ return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
116
+ children: renderedChildren.map(child => {
117
+ const key = getChildKey(child);
118
+ const isPresent = presentChildren === renderedChildren || presentKeys.includes(key);
119
+ const onExit = () => {
120
+ if (exitComplete.has(key)) {
121
+ exitComplete.set(key, true);
122
+ } else {
123
+ return;
124
+ }
125
+ let isEveryExitComplete = true;
126
+ exitComplete.forEach(isExitComplete => {
127
+ if (!isExitComplete) isEveryExitComplete = false;
128
+ });
129
+ if (isEveryExitComplete) {
130
+ forceRender?.();
131
+ setRenderedChildren(pendingPresentChildren.current);
132
+ onExitComplete?.();
133
+ }
134
+ };
135
+ return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_PresenceChild.PresenceChild, {
136
+ isPresent,
137
+ initial: !isInitialRender.current || initial ? void 0 : false,
138
+ custom: isPresent ? custom : frozenCustomRef.current.get(key) ?? custom,
101
139
  presenceAffectsLayout,
102
140
  enterExitVariant,
103
141
  enterVariant,
104
142
  exitVariant,
105
- custom,
143
+ onExitComplete: isPresent ? void 0 : onExit,
106
144
  children: child
107
- }, getChildKey(child));
108
- childrenToRender.splice(insertionIndex, 0, exitingComponent);
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))
145
+ }, key);
146
+ })
122
147
  });
123
148
  };
124
149
  AnimatePresence.displayName = "AnimatePresence";
@@ -5,130 +5,160 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: !0
11
- });
12
- },
13
- __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
15
16
  get: () => from[key],
16
17
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
18
  });
18
- return to;
19
- };
19
+ }
20
+ return to;
21
+ };
20
22
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
- value: !0
23
+ value: true
22
24
  }), mod);
23
25
  var AnimatePresence_exports = {};
24
26
  __export(AnimatePresence_exports, {
25
27
  AnimatePresence: () => AnimatePresence
26
28
  });
27
29
  module.exports = __toCommonJS(AnimatePresence_exports);
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
- import_react = require("react"),
32
- import_LayoutGroupContext = require("./LayoutGroupContext.native.js"),
33
- import_PresenceChild = require("./PresenceChild.native.js"),
34
- getChildKey = function (child) {
35
- return child.key || "";
36
- };
37
- function updateChildLookup(children, allChildren) {
38
- children.forEach(function (child) {
39
- var key = getChildKey(child);
40
- allChildren.set(key, child);
41
- });
30
+ var import_jsx_runtime = require("react/jsx-runtime");
31
+ var import_react = require("react");
32
+ var import_use_constant = require("@tamagui/use-constant");
33
+ var import_use_force_update = require("@tamagui/use-force-update");
34
+ var import_react2 = require("react");
35
+ var import_LayoutGroupContext = require("./LayoutGroupContext.native.js");
36
+ var import_PresenceChild = require("./PresenceChild.native.js");
37
+ function _type_of(obj) {
38
+ "@swc/helpers - typeof";
39
+
40
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
42
41
  }
42
+ var getChildKey = function (child) {
43
+ return child.key || function () {
44
+ var ct = child.type;
45
+ var defaultName = ct["displayName"] || ct["name"] || "";
46
+ if (ct && (typeof ct === "undefined" ? "undefined" : _type_of(ct)) === "object" && "staticConfig" in ct) {
47
+ return ct.staticConfig.componentName || defaultName;
48
+ }
49
+ return defaultName;
50
+ }();
51
+ };
43
52
  function onlyElements(children) {
44
53
  var filtered = [];
45
- return import_react.Children.forEach(children, function (child) {
46
- /* @__PURE__ */(0, import_react.isValidElement)(child) && filtered.push(child);
47
- }), filtered;
54
+ import_react2.Children.forEach(children, function (child) {
55
+ if (/* @__PURE__ */(0, import_react2.isValidElement)(child)) filtered.push(child);
56
+ });
57
+ return filtered;
48
58
  }
49
59
  var AnimatePresence = function (param) {
50
60
  var {
51
- children,
52
- enterVariant,
53
- exitVariant,
54
- enterExitVariant,
55
- initial = !0,
56
- onExitComplete,
57
- exitBeforeEnter,
58
- presenceAffectsLayout = !0,
59
- custom,
60
- passThrough
61
- } = param,
62
- _useContext_forceRender,
63
- forceRender = (_useContext_forceRender = (0, import_react.useContext)(import_LayoutGroupContext.LayoutGroupContext).forceRender) !== null && _useContext_forceRender !== void 0 ? _useContext_forceRender : (0, import_use_force_update.useForceUpdate)(),
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);
70
- if (passThrough) return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
71
- children
72
- });
73
- if ((0, import_constants.useIsomorphicLayoutEffect)(function () {
74
- isInitialRender.current = !1;
75
- }, []), isInitialRender.current) return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
76
- children: filteredChildren.map(function (child) {
77
- return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_PresenceChild.PresenceChild, {
78
- isPresent: !0,
79
- enterExitVariant,
80
- exitVariant,
81
- enterVariant,
82
- initial: initial ? void 0 : !1,
83
- presenceAffectsLayout,
84
- custom,
85
- children: child
86
- }, getChildKey(child));
87
- })
61
+ children,
62
+ enterVariant,
63
+ exitVariant,
64
+ enterExitVariant,
65
+ initial = true,
66
+ onExitComplete,
67
+ exitBeforeEnter,
68
+ mode,
69
+ presenceAffectsLayout = true,
70
+ custom,
71
+ passThrough
72
+ } = param;
73
+ var effectiveMode = mode !== null && mode !== void 0 ? mode : exitBeforeEnter ? "wait" : "sync";
74
+ var presentChildren = (0, import_react2.useMemo)(function () {
75
+ return onlyElements(children);
76
+ }, [children]);
77
+ var presentKeys = presentChildren.map(getChildKey);
78
+ var isInitialRender = (0, import_react2.useRef)(true);
79
+ var frozenCustomRef = (0, import_react2.useRef)(/* @__PURE__ */new Map());
80
+ var pendingPresentChildren = (0, import_react2.useRef)(presentChildren);
81
+ var exitComplete = (0, import_use_constant.useConstant)(function () {
82
+ return /* @__PURE__ */new Map();
88
83
  });
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);
84
+ var [diffedChildren, setDiffedChildren] = (0, import_react2.useState)(presentChildren);
85
+ var [renderedChildren, setRenderedChildren] = (0, import_react2.useState)(presentChildren);
86
+ var _useContext_forceRender;
87
+ var forceRender = (_useContext_forceRender = (0, import_react2.useContext)(import_LayoutGroupContext.LayoutGroupContext).forceRender) !== null && _useContext_forceRender !== void 0 ? _useContext_forceRender : (0, import_use_force_update.useForceUpdate)();
88
+ if (passThrough) {
89
+ return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
90
+ children
91
+ });
92
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);
93
+ (0, import_react.useInsertionEffect)(function () {
94
+ isInitialRender.current = false;
95
+ pendingPresentChildren.current = presentChildren;
96
+ for (var i2 = 0; i2 < renderedChildren.length; i2++) {
97
+ var key2 = getChildKey(renderedChildren[i2]);
98
+ if (!presentKeys.includes(key2)) {
99
+ if (exitComplete.get(key2) !== true) {
100
+ exitComplete.set(key2, false);
101
+ }
102
+ } else {
103
+ exitComplete.delete(key2);
104
+ frozenCustomRef.current.delete(key2);
116
105
  }
117
106
  }
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);
107
+ }, [renderedChildren, presentKeys.length, presentKeys.join("-")]);
108
+ if (presentChildren !== diffedChildren) {
109
+ var nextChildren = [...presentChildren];
110
+ for (var i = 0; i < renderedChildren.length; i++) {
111
+ var child = renderedChildren[i];
112
+ var key = getChildKey(child);
113
+ if (!presentKeys.includes(key)) {
114
+ nextChildren.splice(i, 0, child);
115
+ if (!frozenCustomRef.current.has(key)) {
116
+ frozenCustomRef.current.set(key, custom);
117
+ }
118
+ }
119
+ }
120
+ var exitingChildren = renderedChildren.filter(function (child2) {
121
+ return !presentKeys.includes(getChildKey(child2));
122
+ });
123
+ if (effectiveMode === "wait" && exitingChildren.length) {
124
+ nextChildren = exitingChildren;
125
+ }
126
+ setRenderedChildren(onlyElements(nextChildren));
127
+ setDiffedChildren(presentChildren);
128
+ return null;
129
+ }
130
+ return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
131
+ children: renderedChildren.map(function (child2) {
132
+ var key2 = getChildKey(child2);
133
+ var isPresent = presentChildren === renderedChildren || presentKeys.includes(key2);
134
+ var onExit = function () {
135
+ if (exitComplete.has(key2)) {
136
+ exitComplete.set(key2, true);
137
+ } else {
138
+ return;
139
+ }
140
+ var isEveryExitComplete = true;
141
+ exitComplete.forEach(function (isExitComplete) {
142
+ if (!isExitComplete) isEveryExitComplete = false;
143
+ });
144
+ if (isEveryExitComplete) {
145
+ forceRender === null || forceRender === void 0 ? void 0 : forceRender();
146
+ setRenderedChildren(pendingPresentChildren.current);
147
+ onExitComplete === null || onExitComplete === void 0 ? void 0 : onExitComplete();
148
+ }
149
+ };
150
+ var _frozenCustomRef_current_get;
151
+ return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_PresenceChild.PresenceChild, {
152
+ isPresent,
153
+ initial: !isInitialRender.current || initial ? void 0 : false,
154
+ custom: isPresent ? custom : (_frozenCustomRef_current_get = frozenCustomRef.current.get(key2)) !== null && _frozenCustomRef_current_get !== void 0 ? _frozenCustomRef_current_get : custom,
155
+ presenceAffectsLayout,
156
+ enterExitVariant,
157
+ enterVariant,
158
+ exitVariant,
159
+ onExitComplete: isPresent ? void 0 : onExit,
160
+ children: child2
161
+ }, key2);
132
162
  })
133
163
  });
134
164
  };
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","AnimatePresence_exports","__export","AnimatePresence","module","exports","import_jsx_runtime","require","import_constants","import_use_force_update","import_react","import_LayoutGroupContext","import_PresenceChild","getChildKey","child","key","updateChildLookup","children","allChildren","forEach","set","onlyElements","filtered","Children","isValidElement","push","param","enterVariant","exitVariant","enterExitVariant","initial","onExitComplete","exitBeforeEnter","presenceAffectsLayout","custom","passThrough","_useContext_forceRender","forceRender","useContext","LayoutGroupContext","useForceUpdate","filteredChildren","presentChildren","useRef","Map","current","exiting","Set","isInitialRender","jsx","Fragment","useIsomorphicLayoutEffect","map","PresenceChild","isPresent","childrenToRender","presentKeys","targetKeys","numPresent","length","i","indexOf","add","delete","size","key2","get","insertionIndex","onExit","removeIndex","findIndex","presentChild","splice","exitingComponent","has","cloneElement","displayName"],"sources":["../../src/AnimatePresence.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,uBAAA;AAAAC,QAAA,CAAAD,uBAAA;EAAAE,eAAA,EAAAA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D,KAAA,sBAAAR,kBAAA,CAAA2C,GAAA,EAAArC,oBAAA,CAAAyC,aAAA;MAAAC,SACA;MAAA1B,WACA;MAAAD,YAEC;MAAAE,gBAAA;MATII,qBAAiB;MAUxBC,MAAA;MAGFjB,QAAA,EAAAH;IACD,GAIDD,WAAA,CAAAC,KAAA,CAAmB;EACjB,IAAA4B,eAAY,CAAMG,OAAA,GAAAU,gBAAA,qBAAAjD,kBAAA,CAAA2C,GAAA,EAAA3C,kBAAA,CAAA4C,QAAA;IAClBjC,QAAO,EAAA6B,OAAQ,CAAAkB,IAAO,GAAAT,gBAGpB,GAAAA,gBAAA,CAAAH,GAAA,WAAAtC,KAAA;MAAC,0BAAAJ,YAAA,CAAAiE,YAAA,EAAA7D,KAAA;IAAA;EAAA;AAEU;AACTX,eACA,CAAAyE,WAAA","ignoreList":[]}
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","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","get","set","delete","join","nextChildren","i","splice","has","exitingChildren","filter","child2","isPresent","onExit","isEveryExitComplete","isExitComplete","_frozenCustomRef_current_get","PresenceChild"],"sources":["../../src/AnimatePresence.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,Y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,33 +2,35 @@ var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf,
6
- __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: !0
11
- });
12
- },
13
- __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
15
16
  get: () => from[key],
16
17
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
18
  });
18
- return to;
19
- };
19
+ }
20
+ return to;
21
+ };
20
22
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
26
- value: mod,
27
- enumerable: !0
28
- }) : target, mod)),
29
- __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
30
- value: !0
31
- }), mod);
23
+ // If the importer is in node compatibility mode or this is not an ESM
24
+ // file that has been converted to a CommonJS file using a Babel-
25
+ // compatible transform (i.e. "__esModule" has not been set), then set
26
+ // "default" to the CommonJS "module.exports" for node compatibility.
27
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
28
+ value: mod,
29
+ enumerable: true
30
+ }) : target, mod));
31
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
32
+ value: true
33
+ }), mod);
32
34
  var LayoutGroupContext_exports = {};
33
35
  __export(LayoutGroupContext_exports, {
34
36
  LayoutGroupContext: () => LayoutGroupContext