@tamagui/animate 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.
@@ -3,29 +3,31 @@ 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 Animate_exports = {};
22
24
  __export(Animate_exports, {
23
25
  Animate: () => Animate
24
26
  });
25
27
  module.exports = __toCommonJS(Animate_exports);
26
- var import_animate_presence = require("@tamagui/animate-presence"),
27
- import_react = require("react"),
28
- import_jsx_runtime = require("react/jsx-runtime");
28
+ var import_animate_presence = require("@tamagui/animate-presence");
29
+ var import_react = require("react");
30
+ var import_jsx_runtime = require("react/jsx-runtime");
29
31
  function Animate({
30
32
  children,
31
33
  lazyMount,
@@ -34,33 +36,42 @@ function Animate({
34
36
  passThrough,
35
37
  ...props
36
38
  }) {
37
- const [lazyMounted, setLazyMounted] = (0, import_react.useState)(lazyMount ? !1 : present);
39
+ const [lazyMounted, setLazyMounted] = (0, import_react.useState)(lazyMount ? false : present);
38
40
  (0, import_react.useEffect)(() => {
39
- passThrough || lazyMount && present && (0, import_react.startTransition)(() => {
41
+ if (passThrough) return;
42
+ if (!lazyMount) return;
43
+ if (!present) return;
44
+ (0, import_react.startTransition)(() => {
40
45
  setLazyMounted(present);
41
46
  });
42
47
  }, [lazyMount, present]);
43
- const mounted = present ? lazyMount ? lazyMounted : present : !1;
44
- return type === "presence" ? props.keepChildrenMounted ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_animate_presence.PresenceChild, {
45
- isPresent: !0,
46
- ...(!passThrough && {
47
- initial: props.initial ? void 0 : !1,
48
- onExitComplete: props.onExitComplete,
49
- enterVariant: props.enterVariant,
50
- exitVariant: props.exitVariant,
51
- enterExitVariant: props.enterExitVariant,
52
- // BUGFIX: this causes continous re-renders if keepChildrenMounted is true, see HeaderMenu
53
- // but since we always re-render this component on open changes this should be fine to leave off?
54
- presenceAffectsLayout: !1,
55
- isPresent: present,
56
- custom: props.custom
57
- }),
58
- children
59
- }) : /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_animate_presence.AnimatePresence, {
60
- passThrough,
61
- ...props,
62
- children: mounted || passThrough ? children : null
63
- }) : /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
48
+ const mounted = !present ? false : lazyMount ? lazyMounted : present;
49
+ if (type === "presence") {
50
+ if (props.keepChildrenMounted) {
51
+ return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_animate_presence.PresenceChild, {
52
+ isPresent: true,
53
+ ...(!passThrough && {
54
+ initial: props.initial ? void 0 : false,
55
+ onExitComplete: props.onExitComplete,
56
+ enterVariant: props.enterVariant,
57
+ exitVariant: props.exitVariant,
58
+ enterExitVariant: props.enterExitVariant,
59
+ // BUGFIX: this causes continous re-renders if keepChildrenMounted is true, see HeaderMenu
60
+ // but since we always re-render this component on open changes this should be fine to leave off?
61
+ presenceAffectsLayout: false,
62
+ isPresent: present,
63
+ custom: props.custom
64
+ }),
65
+ children
66
+ });
67
+ }
68
+ return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_animate_presence.AnimatePresence, {
69
+ passThrough,
70
+ ...props,
71
+ children: mounted || passThrough ? children : null
72
+ });
73
+ }
74
+ return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
64
75
  children
65
76
  });
66
77
  }
@@ -5,65 +5,76 @@ 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 Animate_exports = {};
24
26
  __export(Animate_exports, {
25
27
  Animate: () => Animate
26
28
  });
27
29
  module.exports = __toCommonJS(Animate_exports);
28
- var import_jsx_runtime = require("react/jsx-runtime"),
29
- import_animate_presence = require("@tamagui/animate-presence"),
30
- import_react = require("react");
30
+ var import_jsx_runtime = require("react/jsx-runtime");
31
+ var import_animate_presence = require("@tamagui/animate-presence");
32
+ var import_react = require("react");
31
33
  function Animate(param) {
32
34
  var {
33
- children,
34
- lazyMount,
35
- type,
36
- present,
37
- passThrough,
38
- ...props
39
- } = param,
40
- [lazyMounted, setLazyMounted] = (0, import_react.useState)(lazyMount ? !1 : present);
35
+ children,
36
+ lazyMount,
37
+ type,
38
+ present,
39
+ passThrough,
40
+ ...props
41
+ } = param;
42
+ var [lazyMounted, setLazyMounted] = (0, import_react.useState)(lazyMount ? false : present);
41
43
  (0, import_react.useEffect)(function () {
42
- passThrough || lazyMount && present && (0, import_react.startTransition)(function () {
44
+ if (passThrough) return;
45
+ if (!lazyMount) return;
46
+ if (!present) return;
47
+ (0, import_react.startTransition)(function () {
43
48
  setLazyMounted(present);
44
49
  });
45
50
  }, [lazyMount, present]);
46
- var mounted = present ? lazyMount ? lazyMounted : present : !1;
47
- return type === "presence" ? props.keepChildrenMounted ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_animate_presence.PresenceChild, {
48
- isPresent: !0,
49
- ...(!passThrough && {
50
- initial: props.initial ? void 0 : !1,
51
- onExitComplete: props.onExitComplete,
52
- enterVariant: props.enterVariant,
53
- exitVariant: props.exitVariant,
54
- enterExitVariant: props.enterExitVariant,
55
- // BUGFIX: this causes continous re-renders if keepChildrenMounted is true, see HeaderMenu
56
- // but since we always re-render this component on open changes this should be fine to leave off?
57
- presenceAffectsLayout: !1,
58
- isPresent: present,
59
- custom: props.custom
60
- }),
61
- children
62
- }) : /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_animate_presence.AnimatePresence, {
63
- passThrough,
64
- ...props,
65
- children: mounted || passThrough ? children : null
66
- }) : /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
51
+ var mounted = !present ? false : lazyMount ? lazyMounted : present;
52
+ if (type === "presence") {
53
+ if (props.keepChildrenMounted) {
54
+ return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_animate_presence.PresenceChild, {
55
+ isPresent: true,
56
+ ...(!passThrough && {
57
+ initial: props.initial ? void 0 : false,
58
+ onExitComplete: props.onExitComplete,
59
+ enterVariant: props.enterVariant,
60
+ exitVariant: props.exitVariant,
61
+ enterExitVariant: props.enterExitVariant,
62
+ // BUGFIX: this causes continous re-renders if keepChildrenMounted is true, see HeaderMenu
63
+ // but since we always re-render this component on open changes this should be fine to leave off?
64
+ presenceAffectsLayout: false,
65
+ isPresent: present,
66
+ custom: props.custom
67
+ }),
68
+ children
69
+ });
70
+ }
71
+ return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_animate_presence.AnimatePresence, {
72
+ passThrough,
73
+ ...props,
74
+ children: mounted || passThrough ? children : null
75
+ });
76
+ }
77
+ return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
67
78
  children
68
79
  });
69
80
  }
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","Animate_exports","__export","Animate","module","exports","import_jsx_runtime","require","import_animate_presence","import_react","param","children","lazyMount","type","present","passThrough","props","lazyMounted","setLazyMounted","useState","useEffect","startTransition","mounted","keepChildrenMounted","jsx","PresenceChild","isPresent","initial","onExitComplete","enterVariant","exitVariant","enterExitVariant","presenceAffectsLayout","custom","AnimatePresence","Fragment"],"sources":["../../src/Animate.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,eAAA;AAAAC,QAAA,CAAAD,eAAA;EAAAE,OAAA,EAAAA,CAAA,KAAAA;AAAA;AACAC,MAAA,CAAAC,OAAA,GAAAT,YAAA,CAA+CK,eAAA;AAoCxC,IAAAK,kBAAiB,GAAAC,OAAA;EAAAC,uBAAA,GAAAD,OAAA;EAAAE,YAAA,GAAAF,OAAA;AAAA,SACtBJ,QAAAO,KAAA;EACA;MAAAC,QAAA;MAAAC,SAAA;MAAAC,IAAA;MAAAC,OAAA;MAAAC,WAAA;MAAA,GAAAC;IAAA,IAAAN,KAAA;IAAA,CAAAO,WAAA,EAAAC,cAAA,QAAAT,YAAA,CAAAU,QAAA,EAAAP,SAAA,QAAAE,OAAA;EACA,IAAAL,YAAA,CAAAW,SAAA;IACAL,WAAA,IAAAH,SAAA,IAAAE,OAAA,QAAAL,YAAA,CAAAY,eAAA;MACAH,cAAA,CAAAJ,OAAA;IACA,CAAG;EACL,CAAkC,GAChCF,SAAO,EAEPE,OAAA,CACE,CAAI;EAIF,IAAAQ,OAAA,GAAAR,OAAe,GAAAF,SAAO,GAAAK,WAAA,GAAAH,OAAA;EAAA,OACvBD,IAAA,kBAAAG,KAAA,CAAAO,mBAAA,sBAAAjB,kBAAA,CAAAkB,GAAA,EAAAhB,uBAAA,CAAAiB,aAAA;IACHC,SAAI,IAAW;IAGf,KAAMX,WAAW;MAEjBY,OAAI,EAAAX,KAAS,CAAAW,OAAA,GACP,MAAM;MAELC,cAAA,EAAAZ,KAAA,CAAAY,cAAA;MAAAC,YAAA,EAAAb,KAAA,CAAAa,YAAA;MACCC,WAAS,EAAAd,KAAA,CAAAc,WAAA;MACRC,gBAAK,EAAAf,KAAe,CAAAe,gBAAA;MAAA;MACkB;MACfC,qBACR,EAAM;MAAAN,SACpB,EAAAZ,OAAa;MAAMmB,MACnB,EAAAjB,KAAA,CAAAiB;IAAwB;IAAAtB;EAAA,oBAGxB,IAAAL,kBAAuB,CAAAkB,GAAA,EAAAhB,uBAAA,CAAA0B,eAAA;IAAAnB,WACvB;IAAW,GAAAC,KACX;IAAcL,QAChB,EAAAW,OAAA,IAAAP,WAAA,GAAAJ,QAAA;EAAA,KAEC,mBAAAL,kBAAA,CAAAkB,GAAA,EAAAlB,kBAAA,CAAA6B,QAAA;IAAAxB;EACH;AAYR","ignoreList":[]}
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","Animate_exports","__export","Animate","module","exports","import_jsx_runtime","require","import_animate_presence","import_react","param","children","lazyMount","type","present","passThrough","props","lazyMounted","setLazyMounted","useState","useEffect","startTransition","mounted","keepChildrenMounted","jsx","PresenceChild","isPresent","initial","onExitComplete","enterVariant","exitVariant","enterExitVariant","presenceAffectsLayout","custom","AnimatePresence","Fragment"],"sources":["../../src/Animate.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,eAAA;AAAAC,QAAA,CAAAD,eAAA;EAAAE,OAAA,EAAAA,CAAA,KAAAA;AAAA;AACAC,MAAA,CAAAC,OAAA,GAAAT,YAAA,CAA+CK,eAAA;AAC/C,IAAAK,kBAAqD,GAAAC,OAAA;AA4D7C,IAAAC,uBAAA,GAAAD,OAAA;AAzBD,IAAAE,YAAS,GAAQF,OAAA;AAAA,SACtBJ,QAAAO,KAAA;EACA;IAAAC,QAAA;IAAAC,SAAA;IAAAC,IAAA;IAAAC,OAAA;IAAAC,WAAA;IAAA,GAAAC;EAAA,IAAAN,KAAA;EACA,KAAAO,WAAA,EAAAC,cAAA,QAAAT,YAAA,CAAAU,QAAA,EAAAP,SAAA,WAAAE,OAAA;EACA,IAAAL,YAAA,CAAAW,SAAA;IACA,IAAAL,WAAA;IACA,IAAG,CAAAH,SAAA;IAC6B,KAAAE,OAAA;IAChC,IAAML,YAAC,CAAAY,eAA2B,cAAI;MAEtCH,cAAA,CAAAJ,OAAA;IACE;EACA,IACAF,SAAK,EACLE,OAAA,CACE;EAAsB,IACvBQ,OAAA,IAAAR,OAAA,WAAAF,SAAA,GAAAK,WAAA,GAAAH,OAAA;EACH,IAAID,IAAA,eAAmB;IAGvB,IAAMG,KAAA,CAAAO,mBAAqB;MAEvB,sBAAqB,IAAAjB,kBAAA,CAAAkB,GAAA,EAAAhB,uBAAA,CAAAiB,aAAA;QACnBC,SAAM;QACR,KAAAX,WACE;UAACY,OAAA,EAAAX,KAAA,CAAAW,OAAA;UAAAC,cAAA,EAAAZ,KAAA,CAAAY,cAAA;UACCC,YAAS,EAAAb,KAAA,CAAAa,YAAA;UACRC,WAAK,EAAAd,KAAA,CAAec,WAAA;UAAAC,gBACV,EAAMf,KAAA,CAAAe,gBAAsB;UAAA;UACf;UACFC,qBACD;UAAAN,SACnB,EAAAZ,OAAA;UAAwBmB,MAAA,EAAAjB,KAAA,CAAAiB;QAAA;QAAAtB;MAGD;IACZ;IACG,OAChB,mBAAAL,kBAAA,CAAAkB,GAAA,EAAAhB,uBAAA,CAAA0B,eAAA;MAAAnB,WAEC;MAAA,GAAAC,KAAA;MACHL,QAAA,EAAAW,OAAA,IAAAP,WAAA,GAAAJ,QAAA;IAEJ;EAEA;EAKF,0BAAAL,kBAAA,CAAAkB,GAAA,EAAAlB,kBAAA,CAAA6B,QAAA;IAEAxB;EACF","ignoreList":[]}
@@ -3,15 +3,17 @@ 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
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
7
8
  get: () => from[key],
8
9
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
9
10
  });
10
- return to;
11
- },
12
- __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
11
+ }
12
+ return to;
13
+ };
14
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
13
15
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
14
- value: !0
16
+ value: true
15
17
  }), mod);
16
18
  var index_exports = {};
17
19
  module.exports = __toCommonJS(index_exports);
@@ -5,15 +5,17 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __copyProps = (to, from, except, desc) => {
8
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
8
+ if (from && typeof from === "object" || typeof from === "function") {
9
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
9
10
  get: () => from[key],
10
11
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
11
12
  });
12
- return to;
13
- },
14
- __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
13
+ }
14
+ return to;
15
+ };
16
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
17
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
16
- value: !0
18
+ value: true
17
19
  }), mod);
18
20
  var index_exports = {};
19
21
  module.exports = __toCommonJS(index_exports);
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","module","exports"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAP,YAAc,CAAAK,aAAA","ignoreList":[]}
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","module","exports"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAP,YAAc,CAAAK,aAAA","ignoreList":[]}
@@ -9,33 +9,42 @@ function Animate({
9
9
  passThrough,
10
10
  ...props
11
11
  }) {
12
- const [lazyMounted, setLazyMounted] = useState(lazyMount ? !1 : present);
12
+ const [lazyMounted, setLazyMounted] = useState(lazyMount ? false : present);
13
13
  useEffect(() => {
14
- passThrough || lazyMount && present && startTransition(() => {
14
+ if (passThrough) return;
15
+ if (!lazyMount) return;
16
+ if (!present) return;
17
+ startTransition(() => {
15
18
  setLazyMounted(present);
16
19
  });
17
20
  }, [lazyMount, present]);
18
- const mounted = present ? lazyMount ? lazyMounted : present : !1;
19
- return type === "presence" ? props.keepChildrenMounted ? /* @__PURE__ */jsx(PresenceChild, {
20
- isPresent: !0,
21
- ...(!passThrough && {
22
- initial: props.initial ? void 0 : !1,
23
- onExitComplete: props.onExitComplete,
24
- enterVariant: props.enterVariant,
25
- exitVariant: props.exitVariant,
26
- enterExitVariant: props.enterExitVariant,
27
- // BUGFIX: this causes continous re-renders if keepChildrenMounted is true, see HeaderMenu
28
- // but since we always re-render this component on open changes this should be fine to leave off?
29
- presenceAffectsLayout: !1,
30
- isPresent: present,
31
- custom: props.custom
32
- }),
33
- children
34
- }) : /* @__PURE__ */jsx(AnimatePresence, {
35
- passThrough,
36
- ...props,
37
- children: mounted || passThrough ? children : null
38
- }) : /* @__PURE__ */jsx(Fragment, {
21
+ const mounted = !present ? false : lazyMount ? lazyMounted : present;
22
+ if (type === "presence") {
23
+ if (props.keepChildrenMounted) {
24
+ return /* @__PURE__ */jsx(PresenceChild, {
25
+ isPresent: true,
26
+ ...(!passThrough && {
27
+ initial: props.initial ? void 0 : false,
28
+ onExitComplete: props.onExitComplete,
29
+ enterVariant: props.enterVariant,
30
+ exitVariant: props.exitVariant,
31
+ enterExitVariant: props.enterExitVariant,
32
+ // BUGFIX: this causes continous re-renders if keepChildrenMounted is true, see HeaderMenu
33
+ // but since we always re-render this component on open changes this should be fine to leave off?
34
+ presenceAffectsLayout: false,
35
+ isPresent: present,
36
+ custom: props.custom
37
+ }),
38
+ children
39
+ });
40
+ }
41
+ return /* @__PURE__ */jsx(AnimatePresence, {
42
+ passThrough,
43
+ ...props,
44
+ children: mounted || passThrough ? children : null
45
+ });
46
+ }
47
+ return /* @__PURE__ */jsx(Fragment, {
39
48
  children
40
49
  });
41
50
  }
@@ -1 +1 @@
1
- {"version":3,"names":["AnimatePresence","PresenceChild","startTransition","useEffect","useState","Fragment","jsx","Animate","children","lazyMount","type","present","passThrough","props","lazyMounted","setLazyMounted","mounted","keepChildrenMounted","isPresent","initial","onExitComplete","enterVariant","exitVariant","enterExitVariant","presenceAffectsLayout","custom"],"sources":["../../src/Animate.tsx"],"sourcesContent":[null],"mappings":"AACA,SAASA,eAAA,EAAiBC,aAAA,QAAqB;AAC/C,SAASC,eAAA,EAAiBC,SAAA,EAAWC,QAAA,QAAgB;AA4D7C,SA2BCC,QAAA,EA3BDC,GAAA;AAzBD,SAASC,QAAQ;EACtBC,QAAA;EACAC,SAAA;EACAC,IAAA;EACAC,OAAA;EACAC,WAAA;EACA,GAAGC;AACL,GAAkC;EAChC,MAAM,CAACC,WAAA,EAAaC,cAAc,IAAIX,QAAA,CAASK,SAAA,GAAY,KAAQE,OAAO;EAE1ER,SAAA,CAAU,MAAM;IACVS,WAAA,IACCH,SAAA,IACAE,OAAA,IACLT,eAAA,CAAgB,MAAM;MACpBa,cAAA,CAAeJ,OAAO;IACxB,CAAC;EACH,GAAG,CAACF,SAAA,EAAWE,OAAO,CAAC;EAGvB,MAAMK,OAAA,GAAWL,OAAA,GAAkBF,SAAA,GAAYK,WAAA,GAAcH,OAAA,GAAlC;EAE3B,OAAID,IAAA,KAAS,aACPG,KAAA,CAAMI,mBAAA,GAEN,eAAAX,GAAA,CAACL,aAAA;IACCiB,SAAA,EAAS;IACR,IAAI,CAACN,WAAA,IAAe;MACnBO,OAAA,EAASN,KAAA,CAAMM,OAAA,GAAU,SAAY;MACrCC,cAAA,EAAgBP,KAAA,CAAMO,cAAA;MACtBC,YAAA,EAAcR,KAAA,CAAMQ,YAAA;MACpBC,WAAA,EAAaT,KAAA,CAAMS,WAAA;MACnBC,gBAAA,EAAkBV,KAAA,CAAMU,gBAAA;MAAA;MAAA;MAGxBC,qBAAA,EAAuB;MACvBN,SAAA,EAAWP,OAAA;MACXc,MAAA,EAAQZ,KAAA,CAAMY;IAChB;IAECjB;EAAA,CACH,IAKF,eAAAF,GAAA,CAACN,eAAA;IAAgBY,WAAA;IAA2B,GAAGC,KAAA;IAC5CL,QAAA,EAAAQ,OAAA,IAAWJ,WAAA,GAAcJ,QAAA,GAAW;EAAA,CACvC,IAIG,eAAAF,GAAA,CAAAD,QAAA;IAAGG;EAAA,CAAS;AACrB","ignoreList":[]}
1
+ {"version":3,"names":["AnimatePresence","PresenceChild","startTransition","useEffect","useState","Fragment","jsx","Animate","children","lazyMount","type","present","passThrough","props","lazyMounted","setLazyMounted","mounted","keepChildrenMounted","isPresent","initial","onExitComplete","enterVariant","exitVariant","enterExitVariant","presenceAffectsLayout","custom"],"sources":["../../src/Animate.tsx"],"sourcesContent":[null],"mappings":"AACA,SAASA,eAAA,EAAiBC,aAAA,QAAqB;AAC/C,SAASC,eAAA,EAAiBC,SAAA,EAAWC,QAAA,QAAgB;AA4D7C,SA2BCC,QAAA,EA3BDC,GAAA;AAzBD,SAASC,QAAQ;EACtBC,QAAA;EACAC,SAAA;EACAC,IAAA;EACAC,OAAA;EACAC,WAAA;EACA,GAAGC;AACL,GAAkC;EAChC,MAAM,CAACC,WAAA,EAAaC,cAAc,IAAIX,QAAA,CAASK,SAAA,GAAY,QAAQE,OAAO;EAE1ER,SAAA,CAAU,MAAM;IACd,IAAIS,WAAA,EAAa;IACjB,IAAI,CAACH,SAAA,EAAW;IAChB,IAAI,CAACE,OAAA,EAAS;IACdT,eAAA,CAAgB,MAAM;MACpBa,cAAA,CAAeJ,OAAO;IACxB,CAAC;EACH,GAAG,CAACF,SAAA,EAAWE,OAAO,CAAC;EAGvB,MAAMK,OAAA,GAAU,CAACL,OAAA,GAAU,QAAQF,SAAA,GAAYK,WAAA,GAAcH,OAAA;EAE7D,IAAID,IAAA,KAAS,YAAY;IACvB,IAAIG,KAAA,CAAMI,mBAAA,EAAqB;MAC7B,OACE,eAAAX,GAAA,CAACL,aAAA;QACCiB,SAAA,EAAS;QACR,IAAI,CAACN,WAAA,IAAe;UACnBO,OAAA,EAASN,KAAA,CAAMM,OAAA,GAAU,SAAY;UACrCC,cAAA,EAAgBP,KAAA,CAAMO,cAAA;UACtBC,YAAA,EAAcR,KAAA,CAAMQ,YAAA;UACpBC,WAAA,EAAaT,KAAA,CAAMS,WAAA;UACnBC,gBAAA,EAAkBV,KAAA,CAAMU,gBAAA;UAAA;UAAA;UAGxBC,qBAAA,EAAuB;UACvBN,SAAA,EAAWP,OAAA;UACXc,MAAA,EAAQZ,KAAA,CAAMY;QAChB;QAECjB;MAAA,CACH;IAEJ;IAEA,OACE,eAAAF,GAAA,CAACN,eAAA;MAAgBY,WAAA;MAA2B,GAAGC,KAAA;MAC5CL,QAAA,EAAAQ,OAAA,IAAWJ,WAAA,GAAcJ,QAAA,GAAW;IAAA,CACvC;EAEJ;EAEA,OAAO,eAAAF,GAAA,CAAAD,QAAA;IAAGG;EAAA,CAAS;AACrB","ignoreList":[]}
@@ -3,40 +3,49 @@ import { AnimatePresence, PresenceChild } from "@tamagui/animate-presence";
3
3
  import { startTransition, useEffect, useState } from "react";
4
4
  function Animate(param) {
5
5
  var {
6
- children,
7
- lazyMount,
8
- type,
9
- present,
10
- passThrough,
11
- ...props
12
- } = param,
13
- [lazyMounted, setLazyMounted] = useState(lazyMount ? !1 : present);
6
+ children,
7
+ lazyMount,
8
+ type,
9
+ present,
10
+ passThrough,
11
+ ...props
12
+ } = param;
13
+ var [lazyMounted, setLazyMounted] = useState(lazyMount ? false : present);
14
14
  useEffect(function () {
15
- passThrough || lazyMount && present && startTransition(function () {
15
+ if (passThrough) return;
16
+ if (!lazyMount) return;
17
+ if (!present) return;
18
+ startTransition(function () {
16
19
  setLazyMounted(present);
17
20
  });
18
21
  }, [lazyMount, present]);
19
- var mounted = present ? lazyMount ? lazyMounted : present : !1;
20
- return type === "presence" ? props.keepChildrenMounted ? /* @__PURE__ */_jsx(PresenceChild, {
21
- isPresent: !0,
22
- ...(!passThrough && {
23
- initial: props.initial ? void 0 : !1,
24
- onExitComplete: props.onExitComplete,
25
- enterVariant: props.enterVariant,
26
- exitVariant: props.exitVariant,
27
- enterExitVariant: props.enterExitVariant,
28
- // BUGFIX: this causes continous re-renders if keepChildrenMounted is true, see HeaderMenu
29
- // but since we always re-render this component on open changes this should be fine to leave off?
30
- presenceAffectsLayout: !1,
31
- isPresent: present,
32
- custom: props.custom
33
- }),
34
- children
35
- }) : /* @__PURE__ */_jsx(AnimatePresence, {
36
- passThrough,
37
- ...props,
38
- children: mounted || passThrough ? children : null
39
- }) : /* @__PURE__ */_jsx(_Fragment, {
22
+ var mounted = !present ? false : lazyMount ? lazyMounted : present;
23
+ if (type === "presence") {
24
+ if (props.keepChildrenMounted) {
25
+ return /* @__PURE__ */_jsx(PresenceChild, {
26
+ isPresent: true,
27
+ ...(!passThrough && {
28
+ initial: props.initial ? void 0 : false,
29
+ onExitComplete: props.onExitComplete,
30
+ enterVariant: props.enterVariant,
31
+ exitVariant: props.exitVariant,
32
+ enterExitVariant: props.enterExitVariant,
33
+ // BUGFIX: this causes continous re-renders if keepChildrenMounted is true, see HeaderMenu
34
+ // but since we always re-render this component on open changes this should be fine to leave off?
35
+ presenceAffectsLayout: false,
36
+ isPresent: present,
37
+ custom: props.custom
38
+ }),
39
+ children
40
+ });
41
+ }
42
+ return /* @__PURE__ */_jsx(AnimatePresence, {
43
+ passThrough,
44
+ ...props,
45
+ children: mounted || passThrough ? children : null
46
+ });
47
+ }
48
+ return /* @__PURE__ */_jsx(_Fragment, {
40
49
  children
41
50
  });
42
51
  }
@@ -1 +1 @@
1
- {"version":3,"names":["jsx","_jsx","Fragment","_Fragment","AnimatePresence","PresenceChild","startTransition","useEffect","useState","Animate","param","children","lazyMount","type","present","passThrough","props","lazyMounted","setLazyMounted","mounted","keepChildrenMounted","isPresent","initial","onExitComplete","enterVariant","exitVariant","enterExitVariant","presenceAffectsLayout","custom"],"sources":["../../src/Animate.tsx"],"sourcesContent":[null],"mappings":"AACA,SAASA,GAAA,IAAAC,IAAA,EAAAC,QAAiB,IAAAC,SAAA,QAAqB;AAC/C,SAASC,eAAA,EAAiBC,aAAW,mCAAgB;AA4D7C,SA2BCC,eA3BD,EAAAC,SAAA,EAAAC,QAAA;AAzBD,SAASC,QAAQC,KAAA;EACtB;MAAAC,QAAA;MAAAC,SAAA;MAAAC,IAAA;MAAAC,OAAA;MAAAC,WAAA;MAAA,GAAAC;IAAA,IAAAN,KAAA;IAAA,CAAAO,WAAA,EAAAC,cAAA,IAAAV,QAAA,CAAAI,SAAA,QAAAE,OAAA;EACAP,SAAA;IACAQ,WAAA,IAAAH,SAAA,IAAAE,OAAA,IAAAR,eAAA;MACAY,cAAA,CAAAJ,OAAA;IACA;EACA,GAAG,CAC6BF,SAAA,EAChCE,OAAO,CAEP;EACE,IAAIK,OAAA,GAAAL,OACC,GAAAF,SACA,GAAAK,WACL,GAAAH,OAAgB;EACd,OAAAD,IAAA,eAAsB,GAAAG,KAAA,CAAAI,mBAAA,kBAAAnB,IAAA,CAAAI,aAAA;IACxBgB,SAAC;IACH,IAAI,CAAAN,WAAW;MAGfO,OAAM,EAAAN,KAAW,CAAAM,OAAkB,YAAY;MAE/CC,cAAa,EAAAP,KAAA,CAAAO,cACD;MAELC,YAAA,EAAAR,KAAA,CAAAQ,YAAA;MAAAC,WAAA,EAAAT,KAAA,CAAAS,WAAA;MACCC,gBAAS,EAAAV,KAAA,CAAAU,gBAAA;MACR;MAAoB;MACkBC,qBACrB,GAAM;MAAAN,SACtB,EAAAP,OAAc;MAAMc,MACpB,EAAAZ,KAAA,CAAAY;IAAmB;IACKjB;EAAA,oBAAAV,IAAA,CAAAG,eAAA;IAAAW,WAGxB;IAAuB,GAAAC,KACvB;IAAWL,QACX,EAAAQ,OAAQ,IAAMJ,WAAA,GAAAJ,QAAA;EAAA,KAChB,eAAAV,IAAA,CAAAE,SAAA;IAAAQ;EAEC;AAAA;AAaX,S","ignoreList":[]}
1
+ {"version":3,"names":["jsx","_jsx","Fragment","_Fragment","AnimatePresence","PresenceChild","startTransition","useEffect","useState","Animate","param","children","lazyMount","type","present","passThrough","props","lazyMounted","setLazyMounted","mounted","keepChildrenMounted","isPresent","initial","onExitComplete","enterVariant","exitVariant","enterExitVariant","presenceAffectsLayout","custom"],"sources":["../../src/Animate.tsx"],"sourcesContent":[null],"mappings":"AACA,SAASA,GAAA,IAAAC,IAAA,EAAAC,QAAiB,IAAAC,SAAA,QAAqB;AAC/C,SAASC,eAAA,EAAiBC,aAAW,mCAAgB;AA4D7C,SA2BCC,eA3BD,EAAAC,SAAA,EAAAC,QAAA;AAzBD,SAASC,QAAQC,KAAA;EACtB;IAAAC,QAAA;IAAAC,SAAA;IAAAC,IAAA;IAAAC,OAAA;IAAAC,WAAA;IAAA,GAAAC;EAAA,IAAAN,KAAA;EACA,KAAAO,WAAA,EAAAC,cAAA,IAAAV,QAAA,CAAAI,SAAA,WAAAE,OAAA;EACAP,SAAA;IACA,IAAAQ,WAAA;IACA,KAAAH,SAAA;IACA,IAAG,CAAAE,OAAA;IAC6BR,eAAA;MAChCY,cAAO,CAAAJ,OAAa;IAEpB;EACE,IACAF,SAAK,EACLE,OAAK,CACL;EACE,IAAAK,OAAA,IAAAL,OAAe,QAAO,GAAAF,SAAA,GAAAK,WAAA,GAAAH,OAAA;EAAA,IACvBD,IAAA;IACH,IAAIG,KAAA,CAAAI,mBAAmB;MAGvB,OAAM,eAAqBnB,IAAA,CAAAI,aAAQ,EAAY;QAE3CgB,SAAS;QACP,KAAAN,WAAM;UACRO,OACE,EAAAN,KAAA,CAAAM,OAAA;UAACC,cAAA,EAAAP,KAAA,CAAAO,cAAA;UAAAC,YAAA,EAAAR,KAAA,CAAAQ,YAAA;UACCC,WAAS,EAAAT,KAAA,CAAAS,WAAA;UACRC,gBAAK,EAAAV,KAAe,CAAAU,gBAAA;UAAA;UACkB;UACfC,qBACR,EAAM;UAAAN,SACpB,EAAAP,OAAa;UAAMc,MACnB,EAAAZ,KAAA,CAAAY;QAAwB;QAAAjB;MAAA;IAGD;IACZ,sBACGV,IAAA,CAAAG,eAAA;MAAAW,WAChB;MAAA,GAAAC,KAEC;MAAAL,QAAA,EAAAQ,OAAA,IAAAJ,WAAA,GAAAJ,QAAA;IAAA,EACH;EAAA;EAIJ,sBACEV,IAAA,CAAAE,SAAC;IAILQ;EAEA;AACF","ignoreList":[]}
package/dist/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export * from "./Animate";
1
+ export * from "./Animate.mjs";
2
2
  //# sourceMappingURL=index.js.map
@@ -1,6 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index.ts"],
4
- "mappings": "AAAA,cAAc;",
5
- "names": []
6
- }
1
+ {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/animate",
3
- "version": "2.0.0-rc.4",
3
+ "version": "2.0.0-rc.40",
4
4
  "license": "MIT",
5
5
  "source": "src/index.ts",
6
6
  "files": [
@@ -19,15 +19,12 @@
19
19
  "./package.json": "./package.json",
20
20
  ".": {
21
21
  "types": "./types/index.d.ts",
22
- "react-native": {
23
- "module": "./dist/esm/index.native.js",
24
- "import": "./dist/esm/index.native.js",
25
- "require": "./dist/cjs/index.native.js"
26
- },
22
+ "react-native": "./dist/esm/index.native.js",
23
+ "browser": "./dist/esm/index.mjs",
27
24
  "module": "./dist/esm/index.mjs",
28
25
  "import": "./dist/esm/index.mjs",
29
26
  "require": "./dist/cjs/index.cjs",
30
- "default": "./dist/cjs/index.native.js"
27
+ "default": "./dist/esm/index.mjs"
31
28
  }
32
29
  },
33
30
  "publishConfig": {
@@ -40,10 +37,10 @@
40
37
  "clean:build": "tamagui-build clean:build"
41
38
  },
42
39
  "dependencies": {
43
- "@tamagui/animate-presence": "2.0.0-rc.4"
40
+ "@tamagui/animate-presence": "2.0.0-rc.40"
44
41
  },
45
42
  "devDependencies": {
46
- "@tamagui/build": "2.0.0-rc.4",
43
+ "@tamagui/build": "2.0.0-rc.40",
47
44
  "react": ">=19"
48
45
  },
49
46
  "peerDependencies": {
@@ -28,7 +28,7 @@ export type AnimateProps = BaseProps & PresenceProps;
28
28
  *
29
29
  *
30
30
  */
31
- export declare function Animate({ children, lazyMount, type, present, passThrough,...props }: AnimateProps): React.ReactNode;
31
+ export declare function Animate({ children, lazyMount, type, present, passThrough, ...props }: AnimateProps): React.ReactNode;
32
32
  export {};
33
33
 
34
34
  //# sourceMappingURL=Animate.d.ts.map
@@ -1,11 +1,11 @@
1
1
  {
2
- "mappings": "AAAA,cAAc,4BAA4B;KAIrC,YAAY;CACf,UAAU,MAAM;CAChB;;KAGG,gBAAgB,uBAAuB;CAC1C,MAAM;CACN;CACA;CACA;;AAGF,YAAY,eAAe,YAAY;;;;;;;;;;;;;;;;;;;AAqBvC,OAAO,iBAAS,QAAQ,EACtB,UACA,WACA,MACA,SACA,YACA,GAAG,SACF,eAAe,MAAM",
2
+ "mappings": "AAAA,cAAc,4BAA4B;KAIrC,YAAY;CACf,UAAU,MAAM;CAChB;;KAGG,gBAAgB,uBAAuB;CAC1C,MAAM;CACN;CACA;CACA;;AAGF,YAAY,eAAe,YAAY;;;;;;;;;;;;;;;;;;;AAqBvC,OAAO,iBAAS,QAAQ,EACtB,UACA,WACA,MACA,SACA,aACA,GAAG,SACF,eAAe,MAAM",
3
3
  "names": [],
4
4
  "sources": [
5
5
  "src/Animate.tsx"
6
6
  ],
7
+ "version": 3,
7
8
  "sourcesContent": [
8
9
  "import type { AnimatePresenceProps } from '@tamagui/animate-presence'\nimport { AnimatePresence, PresenceChild } from '@tamagui/animate-presence'\nimport { startTransition, useEffect, useState } from 'react'\n\ntype BaseProps = {\n children: React.ReactNode\n passThrough?: boolean\n}\n\ntype PresenceProps = AnimatePresenceProps & {\n type: 'presence'\n present: boolean\n keepChildrenMounted?: boolean\n lazyMount?: boolean\n}\n\nexport type AnimateProps = BaseProps & PresenceProps\n\n/**\n * Because mounting and unmounting children can be expensive, this gives us the\n * option to avoid that.\n *\n * type: 'presence' will act just like AnimatePresence, except you use `present`\n * instead of conditional children.\n * Note that this does avoid reconciling the children even when present={false}\n * so no extra cost to perf over AnimatePresence.\n *\n * type: 'presence' with keepChildrenMounted true *always* render the children so you pay\n * the cost up-front to mount them, but then you avoid the mount cost at the start\n * of the animation.\n *\n * There's no \"right way\" it just depends on the use case, this component just makes\n * it easier to choose the strategy yourself.\n *\n *\n */\n\nexport function Animate({\n children,\n lazyMount,\n type,\n present,\n passThrough,\n ...props\n}: AnimateProps): React.ReactNode {\n const [lazyMounted, setLazyMounted] = useState(lazyMount ? false : present)\n\n useEffect(() => {\n if (passThrough) return\n if (!lazyMount) return\n if (!present) return\n startTransition(() => {\n setLazyMounted(present)\n })\n }, [lazyMount, present])\n\n // always immediately unmount\n const mounted = !present ? false : lazyMount ? lazyMounted : present\n\n if (type === 'presence') {\n if (props.keepChildrenMounted) {\n return (\n <PresenceChild\n isPresent\n {...(!passThrough && {\n initial: props.initial ? undefined : false,\n onExitComplete: props.onExitComplete,\n enterVariant: props.enterVariant,\n exitVariant: props.exitVariant,\n enterExitVariant: props.enterExitVariant,\n // BUGFIX: this causes continous re-renders if keepChildrenMounted is true, see HeaderMenu\n // but since we always re-render this component on open changes this should be fine to leave off?\n presenceAffectsLayout: false,\n isPresent: present,\n custom: props.custom,\n })}\n >\n {children as any}\n </PresenceChild>\n )\n }\n\n return (\n <AnimatePresence passThrough={passThrough} {...props}>\n {mounted || passThrough ? children : null}\n </AnimatePresence>\n )\n }\n\n return <>{children}</>\n}\n"
9
- ],
10
- "version": 3
10
+ ]
11
11
  }
@@ -4,8 +4,8 @@
4
4
  "sources": [
5
5
  "src/index.ts"
6
6
  ],
7
+ "version": 3,
7
8
  "sourcesContent": [
8
9
  "export * from './Animate'\n"
9
- ],
10
- "version": 3
10
+ ]
11
11
  }
@@ -1,56 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: !0 });
8
- }, __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from == "object" || typeof from == "function")
10
- for (let key of __getOwnPropNames(from))
11
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
- var Animate_exports = {};
16
- __export(Animate_exports, {
17
- Animate: () => Animate
18
- });
19
- module.exports = __toCommonJS(Animate_exports);
20
- var import_animate_presence = require("@tamagui/animate-presence"), import_react = require("react"), import_jsx_runtime = require("react/jsx-runtime");
21
- function Animate({
22
- children,
23
- lazyMount,
24
- type,
25
- present,
26
- passThrough,
27
- ...props
28
- }) {
29
- const [lazyMounted, setLazyMounted] = (0, import_react.useState)(lazyMount ? !1 : present);
30
- (0, import_react.useEffect)(() => {
31
- passThrough || lazyMount && present && (0, import_react.startTransition)(() => {
32
- setLazyMounted(present);
33
- });
34
- }, [lazyMount, present]);
35
- const mounted = present ? lazyMount ? lazyMounted : present : !1;
36
- return type === "presence" ? props.keepChildrenMounted ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
37
- import_animate_presence.PresenceChild,
38
- {
39
- isPresent: !0,
40
- ...!passThrough && {
41
- initial: props.initial ? void 0 : !1,
42
- onExitComplete: props.onExitComplete,
43
- enterVariant: props.enterVariant,
44
- exitVariant: props.exitVariant,
45
- enterExitVariant: props.enterExitVariant,
46
- // BUGFIX: this causes continous re-renders if keepChildrenMounted is true, see HeaderMenu
47
- // but since we always re-render this component on open changes this should be fine to leave off?
48
- presenceAffectsLayout: !1,
49
- isPresent: present,
50
- custom: props.custom
51
- },
52
- children
53
- }
54
- ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.AnimatePresence, { passThrough, ...props, children: mounted || passThrough ? children : null }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children });
55
- }
56
- //# sourceMappingURL=Animate.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/Animate.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,8BAA+C,sCAC/C,eAAqD,kBA4D7C;AAzBD,SAAS,QAAQ;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAkC;AAChC,QAAM,CAAC,aAAa,cAAc,QAAI,uBAAS,YAAY,KAAQ,OAAO;AAE1E,8BAAU,MAAM;AACd,IAAI,eACC,aACA,eACL,8BAAgB,MAAM;AACpB,qBAAe,OAAO;AAAA,IACxB,CAAC;AAAA,EACH,GAAG,CAAC,WAAW,OAAO,CAAC;AAGvB,QAAM,UAAW,UAAkB,YAAY,cAAc,UAAlC;AAE3B,SAAI,SAAS,aACP,MAAM,sBAEN;AAAA,IAAC;AAAA;AAAA,MACC,WAAS;AAAA,MACR,GAAI,CAAC,eAAe;AAAA,QACnB,SAAS,MAAM,UAAU,SAAY;AAAA,QACrC,gBAAgB,MAAM;AAAA,QACtB,cAAc,MAAM;AAAA,QACpB,aAAa,MAAM;AAAA,QACnB,kBAAkB,MAAM;AAAA;AAAA;AAAA,QAGxB,uBAAuB;AAAA,QACvB,WAAW;AAAA,QACX,QAAQ,MAAM;AAAA,MAChB;AAAA,MAEC;AAAA;AAAA,EACH,IAKF,4CAAC,2CAAgB,aAA2B,GAAG,OAC5C,qBAAW,cAAc,WAAW,MACvC,IAIG,2EAAG,UAAS;AACrB;",
5
- "names": []
6
- }
package/dist/cjs/index.js DELETED
@@ -1,15 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from == "object" || typeof from == "function")
7
- for (let key of __getOwnPropNames(from))
8
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
- return to;
10
- }, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
11
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
12
- var index_exports = {};
13
- module.exports = __toCommonJS(index_exports);
14
- __reExport(index_exports, require("./Animate"), module.exports);
15
- //# sourceMappingURL=index.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index.ts"],
4
- "mappings": ";;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,sBAAd;",
5
- "names": []
6
- }
@@ -1,42 +0,0 @@
1
- import { AnimatePresence, PresenceChild } from "@tamagui/animate-presence";
2
- import { startTransition, useEffect, useState } from "react";
3
- import { Fragment, jsx } from "react/jsx-runtime";
4
- function Animate({
5
- children,
6
- lazyMount,
7
- type,
8
- present,
9
- passThrough,
10
- ...props
11
- }) {
12
- const [lazyMounted, setLazyMounted] = useState(lazyMount ? !1 : present);
13
- useEffect(() => {
14
- passThrough || lazyMount && present && startTransition(() => {
15
- setLazyMounted(present);
16
- });
17
- }, [lazyMount, present]);
18
- const mounted = present ? lazyMount ? lazyMounted : present : !1;
19
- return type === "presence" ? props.keepChildrenMounted ? /* @__PURE__ */ jsx(
20
- PresenceChild,
21
- {
22
- isPresent: !0,
23
- ...!passThrough && {
24
- initial: props.initial ? void 0 : !1,
25
- onExitComplete: props.onExitComplete,
26
- enterVariant: props.enterVariant,
27
- exitVariant: props.exitVariant,
28
- enterExitVariant: props.enterExitVariant,
29
- // BUGFIX: this causes continous re-renders if keepChildrenMounted is true, see HeaderMenu
30
- // but since we always re-render this component on open changes this should be fine to leave off?
31
- presenceAffectsLayout: !1,
32
- isPresent: present,
33
- custom: props.custom
34
- },
35
- children
36
- }
37
- ) : /* @__PURE__ */ jsx(AnimatePresence, { passThrough, ...props, children: mounted || passThrough ? children : null }) : /* @__PURE__ */ jsx(Fragment, { children });
38
- }
39
- export {
40
- Animate
41
- };
42
- //# sourceMappingURL=Animate.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/Animate.tsx"],
4
- "mappings": "AACA,SAAS,iBAAiB,qBAAqB;AAC/C,SAAS,iBAAiB,WAAW,gBAAgB;AA4D7C,SA2BC,UA3BD;AAzBD,SAAS,QAAQ;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAkC;AAChC,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,YAAY,KAAQ,OAAO;AAE1E,YAAU,MAAM;AACd,IAAI,eACC,aACA,WACL,gBAAgB,MAAM;AACpB,qBAAe,OAAO;AAAA,IACxB,CAAC;AAAA,EACH,GAAG,CAAC,WAAW,OAAO,CAAC;AAGvB,QAAM,UAAW,UAAkB,YAAY,cAAc,UAAlC;AAE3B,SAAI,SAAS,aACP,MAAM,sBAEN;AAAA,IAAC;AAAA;AAAA,MACC,WAAS;AAAA,MACR,GAAI,CAAC,eAAe;AAAA,QACnB,SAAS,MAAM,UAAU,SAAY;AAAA,QACrC,gBAAgB,MAAM;AAAA,QACtB,cAAc,MAAM;AAAA,QACpB,aAAa,MAAM;AAAA,QACnB,kBAAkB,MAAM;AAAA;AAAA;AAAA,QAGxB,uBAAuB;AAAA,QACvB,WAAW;AAAA,QACX,QAAQ,MAAM;AAAA,MAChB;AAAA,MAEC;AAAA;AAAA,EACH,IAKF,oBAAC,mBAAgB,aAA2B,GAAG,OAC5C,qBAAW,cAAc,WAAW,MACvC,IAIG,gCAAG,UAAS;AACrB;",
5
- "names": []
6
- }