@tamagui/animate 2.0.0-rc.3 → 2.0.0-rc.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -3,13 +3,16 @@ 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")
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);
6
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
7
+ get: () => from[key],
8
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
9
+ });
10
+ return to;
11
+ },
12
+ __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
13
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
14
+ value: !0
15
+ }), mod);
12
16
  var index_exports = {};
13
17
  module.exports = __toCommonJS(index_exports);
14
- __reExport(index_exports, require("./Animate"), module.exports);
15
- //# sourceMappingURL=index.js.map
18
+ __reExport(index_exports, require("./Animate.cjs"), module.exports);
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.3",
3
+ "version": "2.0.0-rc.30",
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.3"
40
+ "@tamagui/animate-presence": "2.0.0-rc.30"
44
41
  },
45
42
  "devDependencies": {
46
- "@tamagui/build": "2.0.0-rc.3",
43
+ "@tamagui/build": "2.0.0-rc.30",
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
- }
@@ -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
- }