@tamagui/animate 2.7.7 → 3.0.0-beta.637.1

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.
@@ -1,77 +1,60 @@
1
+
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
6
  var __export = (target, all) => {
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: true
9
- });
7
+ for (var name in all) __defProp(target, name, {
8
+ get: all[name],
9
+ enumerable: true
10
+ });
10
11
  };
11
12
  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, {
14
- get: () => from[key],
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- return to;
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
15
+ get: () => from[key],
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
18
+ }
19
+ return to;
19
20
  };
20
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
- value: true
22
- }), mod);
21
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
22
  var Animate_exports = {};
24
- __export(Animate_exports, {
25
- Animate: () => Animate
26
- });
23
+ __export(Animate_exports, { Animate: () => Animate });
27
24
  module.exports = __toCommonJS(Animate_exports);
28
25
  var import_animate_presence = require("@tamagui/animate-presence");
29
26
  var import_react = require("react");
30
27
  var import_jsx_runtime = require("react/jsx-runtime");
31
- function Animate({
32
- children,
33
- lazyMount,
34
- type,
35
- present,
36
- passThrough,
37
- ...props
38
- }) {
39
- const [lazyMounted, setLazyMounted] = (0, import_react.useState)(lazyMount ? false : present);
40
- (0, import_react.useEffect)(() => {
41
- if (passThrough) return;
42
- if (!lazyMount) return;
43
- if (!present) return;
44
- (0, import_react.startTransition)(() => {
45
- setLazyMounted(present);
46
- });
47
- }, [lazyMount, present]);
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, {
75
- children
76
- });
77
- }
28
+ function Animate({ children, lazyMount, type, present, passThrough, ...props }) {
29
+ const [lazyMounted, setLazyMounted] = (0, import_react.useState)(lazyMount ? false : present);
30
+ (0, import_react.useEffect)(() => {
31
+ if (passThrough) return;
32
+ if (!lazyMount) return;
33
+ if (!present) return;
34
+ (0, import_react.startTransition)(() => {
35
+ setLazyMounted(present);
36
+ });
37
+ }, [lazyMount, present]);
38
+ const mounted = !present ? false : lazyMount ? lazyMounted : present;
39
+ if (type === "presence") {
40
+ if (props.keepChildrenMounted) {
41
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.PresenceChild, {
42
+ isPresent: true,
43
+ ...!passThrough && {
44
+ initial: props.initial ? void 0 : false,
45
+ onExitComplete: props.onExitComplete,
46
+ presenceAffectsLayout: false,
47
+ isPresent: present,
48
+ custom: props.custom
49
+ },
50
+ children
51
+ });
52
+ }
53
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.AnimatePresence, {
54
+ passThrough,
55
+ ...props,
56
+ children: mounted || passThrough ? children : null
57
+ });
58
+ }
59
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children });
60
+ }
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+
3
+
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all) __defProp(target, name, {
10
+ get: all[name],
11
+ enumerable: true
12
+ });
13
+ };
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
+ get: () => from[key],
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ }
21
+ return to;
22
+ };
23
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
24
+ var Animate_exports = {};
25
+ __export(Animate_exports, { Animate: () => Animate });
26
+ module.exports = __toCommonJS(Animate_exports);
27
+ var import_jsx_runtime = require("react/jsx-runtime");
28
+ var import_animate_presence = require("@tamagui/animate-presence");
29
+ var import_react = require("react");
30
+ function Animate(param) {
31
+ var { children, lazyMount, type, present, passThrough, ...props } = param;
32
+ var [lazyMounted, setLazyMounted] = (0, import_react.useState)(lazyMount ? false : present);
33
+ (0, import_react.useEffect)(function() {
34
+ if (passThrough) return;
35
+ if (!lazyMount) return;
36
+ if (!present) return;
37
+ (0, import_react.startTransition)(function() {
38
+ setLazyMounted(present);
39
+ });
40
+ }, [lazyMount, present]);
41
+ var mounted = !present ? false : lazyMount ? lazyMounted : present;
42
+ if (type === "presence") {
43
+ if (props.keepChildrenMounted) {
44
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.PresenceChild, {
45
+ isPresent: true,
46
+ ...!passThrough && {
47
+ initial: props.initial ? void 0 : false,
48
+ onExitComplete: props.onExitComplete,
49
+ presenceAffectsLayout: false,
50
+ isPresent: present,
51
+ custom: props.custom
52
+ },
53
+ children
54
+ });
55
+ }
56
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.AnimatePresence, {
57
+ passThrough,
58
+ ...props,
59
+ children: mounted || passThrough ? children : null
60
+ });
61
+ }
62
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children });
63
+ }
@@ -1,81 +1,65 @@
1
1
  "use strict";
2
2
 
3
+
3
4
  var __defProp = Object.defineProperty;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
8
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true
11
- });
9
+ for (var name in all) __defProp(target, name, {
10
+ get: all[name],
11
+ enumerable: true
12
+ });
12
13
  };
13
14
  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, {
16
- get: () => from[key],
17
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
- });
19
- }
20
- return to;
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
+ get: () => from[key],
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ }
21
+ return to;
21
22
  };
22
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
23
- value: true
24
- }), mod);
23
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
24
  var Animate_exports = {};
26
- __export(Animate_exports, {
27
- Animate: () => Animate
28
- });
25
+ __export(Animate_exports, { Animate: () => Animate });
29
26
  module.exports = __toCommonJS(Animate_exports);
30
27
  var import_jsx_runtime = require("react/jsx-runtime");
31
28
  var import_animate_presence = require("@tamagui/animate-presence");
32
29
  var import_react = require("react");
33
30
  function Animate(param) {
34
- var {
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);
43
- (0, import_react.useEffect)(function () {
44
- if (passThrough) return;
45
- if (!lazyMount) return;
46
- if (!present) return;
47
- (0, import_react.startTransition)(function () {
48
- setLazyMounted(present);
49
- });
50
- }, [lazyMount, present]);
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, {
78
- children
79
- });
31
+ var { children, lazyMount, type, present, passThrough, ...props } = param;
32
+ var [lazyMounted, setLazyMounted] = (0, import_react.useState)(lazyMount ? false : present);
33
+ (0, import_react.useEffect)(function() {
34
+ if (passThrough) return;
35
+ if (!lazyMount) return;
36
+ if (!present) return;
37
+ (0, import_react.startTransition)(function() {
38
+ setLazyMounted(present);
39
+ });
40
+ }, [lazyMount, present]);
41
+ var mounted = !present ? false : lazyMount ? lazyMounted : present;
42
+ if (type === "presence") {
43
+ if (props.keepChildrenMounted) {
44
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.PresenceChild, {
45
+ isPresent: true,
46
+ ...!passThrough && {
47
+ initial: props.initial ? void 0 : false,
48
+ onExitComplete: props.onExitComplete,
49
+ presenceAffectsLayout: false,
50
+ isPresent: present,
51
+ custom: props.custom
52
+ },
53
+ children
54
+ });
55
+ }
56
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.AnimatePresence, {
57
+ passThrough,
58
+ ...props,
59
+ children: mounted || passThrough ? children : null
60
+ });
61
+ }
62
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children });
80
63
  }
64
+
81
65
  //# sourceMappingURL=Animate.native.js.map
@@ -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;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":[]}
1
+ {"version":3,"file":"Animate.native.js","names":[],"sources":["cjs/Animate.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Animate_exports = {};\n__export(Animate_exports, {\n Animate: () => Animate\n});\nmodule.exports = __toCommonJS(Animate_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_animate_presence = require(\"@tamagui/animate-presence\");\nvar import_react = require(\"react\");\nfunction Animate(param) {\n var { children, lazyMount, type, present, passThrough, ...props } = param;\n var [lazyMounted, setLazyMounted] = (0, import_react.useState)(lazyMount ? false : present);\n (0, import_react.useEffect)(function() {\n if (passThrough) return;\n if (!lazyMount) return;\n if (!present) return;\n (0, import_react.startTransition)(function() {\n setLazyMounted(present);\n });\n }, [\n lazyMount,\n present\n ]);\n var mounted = !present ? false : lazyMount ? lazyMounted : present;\n if (type === \"presence\") {\n if (props.keepChildrenMounted) {\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.PresenceChild, {\n isPresent: true,\n ...!passThrough && {\n initial: props.initial ? void 0 : false,\n onExitComplete: props.onExitComplete,\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 children\n });\n }\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.AnimatePresence, {\n passThrough,\n ...props,\n children: mounted || passThrough ? children : null\n });\n }\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {\n children\n });\n}\n//# sourceMappingURL=Animate.js.map\n"],"mappings":";;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,kBAAkB,CAAC;AACvB,SAAS,iBAAiB,EACxB,eAAe,QACjB,CAAC;AACD,OAAO,UAAU,aAAa,eAAe;AAC7C,IAAI,qBAAqB,QAAQ,mBAAmB;AACpD,IAAI,0BAA0B,QAAQ,2BAA2B;AACjE,IAAI,eAAe,QAAQ,OAAO;AAClC,SAAS,QAAQ,OAAO;CACtB,IAAI,EAAE,UAAU,WAAW,MAAM,SAAS,aAAa,GAAG,UAAU;CACpE,IAAI,CAAC,aAAa,mBAAmB,GAAG,aAAa,UAAU,YAAY,QAAQ,OAAO;CAC1F,CAAC,GAAG,aAAa,WAAW,WAAW;EACrC,IAAI,aAAa;EACjB,IAAI,CAAC,WAAW;EAChB,IAAI,CAAC,SAAS;EACd,CAAC,GAAG,aAAa,iBAAiB,WAAW;GAC3C,eAAe,OAAO;EACxB,CAAC;CACH,GAAG,CACD,WACA,OACF,CAAC;CACD,IAAI,UAAU,CAAC,UAAU,QAAQ,YAAY,cAAc;CAC3D,IAAI,SAAS,YAAY;EACvB,IAAI,MAAM,qBAAqB;GAC7B,OAAuB,iBAAC,GAAG,mBAAmB,KAAK,wBAAwB,eAAe;IACxF,WAAW;IACX,GAAG,CAAC,eAAe;KACjB,SAAS,MAAM,UAAU,KAAK,IAAI;KAClC,gBAAgB,MAAM;KAGtB,uBAAuB;KACvB,WAAW;KACX,QAAQ,MAAM;IAChB;IACA;GACF,CAAC;EACH;EACA,OAAuB,iBAAC,GAAG,mBAAmB,KAAK,wBAAwB,iBAAiB;GAC1F;GACA,GAAG;GACH,UAAU,WAAW,cAAc,WAAW;EAChD,CAAC;CACH;CACA,OAAuB,iBAAC,GAAG,mBAAmB,KAAK,mBAAmB,UAAU,EAC9E,SACF,CAAC;AACH"}
@@ -1,20 +1,19 @@
1
+
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
6
  var __copyProps = (to, from, except, desc) => {
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, {
8
- get: () => from[key],
9
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
10
- });
11
- }
12
- return to;
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
9
+ get: () => from[key],
10
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
11
+ });
12
+ }
13
+ return to;
13
14
  };
14
15
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
16
- value: true
17
- }), mod);
16
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
17
  var index_exports = {};
19
18
  module.exports = __toCommonJS(index_exports);
20
- __reExport(index_exports, require("./Animate.cjs"), module.exports);
19
+ __reExport(index_exports, require("./Animate.cjs"), module.exports);
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
11
+ get: () => from[key],
12
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
13
+ });
14
+ }
15
+ return to;
16
+ };
17
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var index_exports = {};
20
+ module.exports = __toCommonJS(index_exports);
21
+ __reExport(index_exports, require("./Animate.native.js"), module.exports);
@@ -1,23 +1,23 @@
1
1
  "use strict";
2
2
 
3
+
3
4
  var __defProp = Object.defineProperty;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
8
  var __copyProps = (to, from, except, desc) => {
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, {
10
- get: () => from[key],
11
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
12
- });
13
- }
14
- return to;
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
11
+ get: () => from[key],
12
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
13
+ });
14
+ }
15
+ return to;
15
16
  };
16
17
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
17
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
18
- value: true
19
- }), mod);
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
19
  var index_exports = {};
21
20
  module.exports = __toCommonJS(index_exports);
22
21
  __reExport(index_exports, require("./Animate.native.js"), module.exports);
22
+
23
23
  //# sourceMappingURL=index.native.js.map
@@ -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,"file":"index.native.js","names":[],"sources":["cjs/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_exports = {};\nmodule.exports = __toCommonJS(index_exports);\n__reExport(index_exports, require(\"./Animate\"), module.exports);\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,cAAc,QAAQ,KAAK,kBAAkB,YAAY,QAAQ,KAAK,SAAS,GAAG,gBAAgB,YAAY,cAAc,KAAK,SAAS;AAC9I,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,gBAAgB,CAAC;AACrB,OAAO,UAAU,aAAa,aAAa;AAC3C,WAAW,eAAe,QAAQ,qBAAW,GAAG,OAAO,OAAO"}
@@ -1,52 +1,40 @@
1
1
  import { AnimatePresence, PresenceChild } from "@tamagui/animate-presence";
2
2
  import { startTransition, useEffect, useState } from "react";
3
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 ? false : present);
13
- useEffect(() => {
14
- if (passThrough) return;
15
- if (!lazyMount) return;
16
- if (!present) return;
17
- startTransition(() => {
18
- setLazyMounted(present);
19
- });
20
- }, [lazyMount, present]);
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, {
48
- children
49
- });
4
+
5
+ function Animate({ children, lazyMount, type, present, passThrough, ...props }) {
6
+ const [lazyMounted, setLazyMounted] = useState(lazyMount ? false : present);
7
+ useEffect(() => {
8
+ if (passThrough) return;
9
+ if (!lazyMount) return;
10
+ if (!present) return;
11
+ startTransition(() => {
12
+ setLazyMounted(present);
13
+ });
14
+ }, [lazyMount, present]);
15
+ const mounted = !present ? false : lazyMount ? lazyMounted : present;
16
+ if (type === "presence") {
17
+ if (props.keepChildrenMounted) {
18
+ return /* @__PURE__ */ jsx(PresenceChild, {
19
+ isPresent: true,
20
+ ...!passThrough && {
21
+ initial: props.initial ? void 0 : false,
22
+ onExitComplete: props.onExitComplete,
23
+ presenceAffectsLayout: false,
24
+ isPresent: present,
25
+ custom: props.custom
26
+ },
27
+ children
28
+ });
29
+ }
30
+ return /* @__PURE__ */ jsx(AnimatePresence, {
31
+ passThrough,
32
+ ...props,
33
+ children: mounted || passThrough ? children : null
34
+ });
35
+ }
36
+ return /* @__PURE__ */ jsx(Fragment, { children });
50
37
  }
38
+
51
39
  export { Animate };
52
40
  //# sourceMappingURL=Animate.mjs.map
@@ -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,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":[]}
1
+ {"version":3,"file":"Animate.js","names":[],"sources":["esm/Animate.js"],"sourcesContent":["import { AnimatePresence, PresenceChild } from \"@tamagui/animate-presence\";\nimport { startTransition, useEffect, useState } from \"react\";\nimport { Fragment, jsx } from \"react/jsx-runtime\";\nfunction Animate({\n children,\n lazyMount,\n type,\n present,\n passThrough,\n ...props\n}) {\n const [lazyMounted, setLazyMounted] = useState(lazyMount ? false : present);\n useEffect(() => {\n if (passThrough) return;\n if (!lazyMount) return;\n if (!present) return;\n startTransition(() => {\n setLazyMounted(present);\n });\n }, [lazyMount, present]);\n const mounted = !present ? false : lazyMount ? lazyMounted : present;\n if (type === \"presence\") {\n if (props.keepChildrenMounted) {\n return /* @__PURE__ */ jsx(\n PresenceChild,\n {\n isPresent: true,\n ...!passThrough && {\n initial: props.initial ? void 0 : false,\n onExitComplete: props.onExitComplete,\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 children\n }\n );\n }\n return /* @__PURE__ */ jsx(AnimatePresence, { passThrough, ...props, children: mounted || passThrough ? children : null });\n }\n return /* @__PURE__ */ jsx(Fragment, { children });\n}\nexport {\n Animate\n};\n//# sourceMappingURL=Animate.js.map\n"],"mappings":";;;;;AAGA,SAAS,QAAQ,EACf,UACA,WACA,MACA,SACA,aACA,GAAG,SACF;CACD,MAAM,CAAC,aAAa,kBAAkB,SAAS,YAAY,QAAQ,OAAO;CAC1E,gBAAgB;EACd,IAAI,aAAa;EACjB,IAAI,CAAC,WAAW;EAChB,IAAI,CAAC,SAAS;EACd,sBAAsB;GACpB,eAAe,OAAO;EACxB,CAAC;CACH,GAAG,CAAC,WAAW,OAAO,CAAC;CACvB,MAAM,UAAU,CAAC,UAAU,QAAQ,YAAY,cAAc;CAC7D,IAAI,SAAS,YAAY;EACvB,IAAI,MAAM,qBAAqB;GAC7B,OAAuB,oBACrB,eACA;IACE,WAAW;IACX,GAAG,CAAC,eAAe;KACjB,SAAS,MAAM,UAAU,KAAK,IAAI;KAClC,gBAAgB,MAAM;KAGtB,uBAAuB;KACvB,WAAW;KACX,QAAQ,MAAM;IAChB;IACA;GACF,CACF;EACF;EACA,OAAuB,oBAAI,iBAAiB;GAAE;GAAa,GAAG;GAAO,UAAU,WAAW,cAAc,WAAW;EAAK,CAAC;CAC3H;CACA,OAAuB,oBAAI,UAAU,EAAE,SAAS,CAAC;AACnD"}
@@ -1,53 +1,41 @@
1
- import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { Fragment, jsx } from "react/jsx-runtime";
2
2
  import { AnimatePresence, PresenceChild } from "@tamagui/animate-presence";
3
3
  import { startTransition, useEffect, useState } from "react";
4
+
4
5
  function Animate(param) {
5
- var {
6
- children,
7
- lazyMount,
8
- type,
9
- present,
10
- passThrough,
11
- ...props
12
- } = param;
13
- var [lazyMounted, setLazyMounted] = useState(lazyMount ? false : present);
14
- useEffect(function () {
15
- if (passThrough) return;
16
- if (!lazyMount) return;
17
- if (!present) return;
18
- startTransition(function () {
19
- setLazyMounted(present);
20
- });
21
- }, [lazyMount, present]);
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, {
49
- children
50
- });
6
+ var { children, lazyMount, type, present, passThrough, ...props } = param;
7
+ var [lazyMounted, setLazyMounted] = useState(lazyMount ? false : present);
8
+ useEffect(function() {
9
+ if (passThrough) return;
10
+ if (!lazyMount) return;
11
+ if (!present) return;
12
+ startTransition(function() {
13
+ setLazyMounted(present);
14
+ });
15
+ }, [lazyMount, present]);
16
+ var mounted = !present ? false : lazyMount ? lazyMounted : present;
17
+ if (type === "presence") {
18
+ if (props.keepChildrenMounted) {
19
+ return /* @__PURE__ */ jsx(PresenceChild, {
20
+ isPresent: true,
21
+ ...!passThrough && {
22
+ initial: props.initial ? void 0 : false,
23
+ onExitComplete: props.onExitComplete,
24
+ presenceAffectsLayout: false,
25
+ isPresent: present,
26
+ custom: props.custom
27
+ },
28
+ children
29
+ });
30
+ }
31
+ return /* @__PURE__ */ jsx(AnimatePresence, {
32
+ passThrough,
33
+ ...props,
34
+ children: mounted || passThrough ? children : null
35
+ });
36
+ }
37
+ return /* @__PURE__ */ jsx(Fragment, { children });
51
38
  }
39
+
52
40
  export { Animate };
53
41
  //# sourceMappingURL=Animate.native.js.map
@@ -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;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":[]}
1
+ {"version":3,"file":"Animate.native.js","names":["_Fragment"],"sources":["esm/Animate.native.js"],"sourcesContent":["import { jsx as _jsx, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport { AnimatePresence, PresenceChild } from \"@tamagui/animate-presence\";\nimport { startTransition, useEffect, useState } from \"react\";\nfunction Animate(param) {\n var { children, lazyMount, type, present, passThrough, ...props } = param;\n var [lazyMounted, setLazyMounted] = useState(lazyMount ? false : present);\n useEffect(function() {\n if (passThrough) return;\n if (!lazyMount) return;\n if (!present) return;\n startTransition(function() {\n setLazyMounted(present);\n });\n }, [\n lazyMount,\n present\n ]);\n var mounted = !present ? false : lazyMount ? lazyMounted : present;\n if (type === \"presence\") {\n if (props.keepChildrenMounted) {\n return /* @__PURE__ */ _jsx(PresenceChild, {\n isPresent: true,\n ...!passThrough && {\n initial: props.initial ? void 0 : false,\n onExitComplete: props.onExitComplete,\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 children\n });\n }\n return /* @__PURE__ */ _jsx(AnimatePresence, {\n passThrough,\n ...props,\n children: mounted || passThrough ? children : null\n });\n }\n return /* @__PURE__ */ _jsx(_Fragment, {\n children\n });\n}\nexport {\n Animate\n};\n//# sourceMappingURL=Animate.js.map\n"],"mappings":";;;;;AAGA,SAAS,QAAQ,OAAO;CACtB,IAAI,EAAE,UAAU,WAAW,MAAM,SAAS,aAAa,GAAG,UAAU;CACpE,IAAI,CAAC,aAAa,kBAAkB,SAAS,YAAY,QAAQ,OAAO;CACxE,UAAU,WAAW;EACnB,IAAI,aAAa;EACjB,IAAI,CAAC,WAAW;EAChB,IAAI,CAAC,SAAS;EACd,gBAAgB,WAAW;GACzB,eAAe,OAAO;EACxB,CAAC;CACH,GAAG,CACD,WACA,OACF,CAAC;CACD,IAAI,UAAU,CAAC,UAAU,QAAQ,YAAY,cAAc;CAC3D,IAAI,SAAS,YAAY;EACvB,IAAI,MAAM,qBAAqB;GAC7B,OAAuB,oBAAK,eAAe;IACzC,WAAW;IACX,GAAG,CAAC,eAAe;KACjB,SAAS,MAAM,UAAU,KAAK,IAAI;KAClC,gBAAgB,MAAM;KAGtB,uBAAuB;KACvB,WAAW;KACX,QAAQ,MAAM;IAChB;IACA;GACF,CAAC;EACH;EACA,OAAuB,oBAAK,iBAAiB;GAC3C;GACA,GAAG;GACH,UAAU,WAAW,cAAc,WAAW;EAChD,CAAC;CACH;CACA,OAAuB,oBAAKA,UAAW,EACrC,SACF,CAAC;AACH"}
package/dist/esm/index.js CHANGED
@@ -1,2 +1 @@
1
- export * from "./Animate.mjs";
2
- //# sourceMappingURL=index.js.map
1
+ export * from "./Animate.mjs"
@@ -1,2 +1 @@
1
- export * from "./Animate.mjs";
2
- //# sourceMappingURL=index.mjs.map
1
+ export * from "./Animate.mjs"
@@ -1,2 +1 @@
1
- export * from "./Animate.native.js";
2
- //# sourceMappingURL=index.native.js.map
1
+ export * from "./Animate.native.js"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/animate",
3
- "version": "2.7.7",
3
+ "version": "3.0.0-beta.637.1",
4
4
  "license": "MIT",
5
5
  "source": "src/index.ts",
6
6
  "files": [
@@ -35,10 +35,10 @@
35
35
  "clean:build": "tamagui-build clean:build"
36
36
  },
37
37
  "dependencies": {
38
- "@tamagui/animate-presence": "2.7.7"
38
+ "@tamagui/animate-presence": "3.0.0-beta.637.1"
39
39
  },
40
40
  "devDependencies": {
41
- "@tamagui/build": "2.7.7",
41
+ "@tamagui/build": "3.0.0-beta.637.1",
42
42
  "react": ">=19"
43
43
  },
44
44
  "peerDependencies": {
package/src/Animate.tsx CHANGED
@@ -65,9 +65,6 @@ export function Animate({
65
65
  {...(!passThrough && {
66
66
  initial: props.initial ? undefined : false,
67
67
  onExitComplete: props.onExitComplete,
68
- enterVariant: props.enterVariant,
69
- exitVariant: props.exitVariant,
70
- enterExitVariant: props.enterExitVariant,
71
68
  // BUGFIX: this causes continous re-renders if keepChildrenMounted is true, see HeaderMenu
72
69
  // but since we always re-render this component on open changes this should be fine to leave off?
73
70
  presenceAffectsLayout: false,
@@ -6,6 +6,6 @@
6
6
  ],
7
7
  "version": 3,
8
8
  "sourcesContent": [
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
+ "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 // 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"
10
10
  ]
11
11
  }
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}