@tamagui/portal 1.130.2 → 1.130.4

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.
@@ -36,7 +36,6 @@ __export(Portal_exports, {
36
36
  module.exports = __toCommonJS(Portal_exports);
37
37
  var import_polyfill_dev = require("@tamagui/polyfill-dev"),
38
38
  import_constants = require("@tamagui/constants"),
39
- import_stacks = require("@tamagui/stacks"),
40
39
  import_z_index_stack = require("@tamagui/z-index-stack"),
41
40
  React = __toESM(require("react")),
42
41
  import_react_dom = require("react-dom"),
@@ -44,23 +43,21 @@ var import_polyfill_dev = require("@tamagui/polyfill-dev"),
44
43
  import_jsx_runtime = require("react/jsx-runtime");
45
44
  const Portal = React.memo(propsIn => {
46
45
  if (import_constants.isServer) return null;
46
+ const body = globalThis.document?.body;
47
+ if (!body) return propsIn.children;
47
48
  const {
48
- host = globalThis.document?.body,
49
- stackZIndex,
50
49
  children,
51
- passThrough,
52
- ...props
50
+ passThrough
53
51
  } = propsIn,
54
52
  zIndex = (0, import_z_index_stack.useStackedZIndex)((0, import_helpers.getStackedZIndexProps)(propsIn));
55
- return passThrough ? children : (0, import_react_dom.createPortal)(/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_stacks.YStack, {
56
- contain: "strict",
57
- fullscreen: !0,
58
- position: "fixed",
59
- maxWidth: "100vw",
60
- maxHeight: "100vh",
61
- pointerEvents: "none",
62
- ...props,
63
- zIndex,
53
+ return passThrough ? children : (0, import_react_dom.createPortal)(/* @__PURE__ */(0, import_jsx_runtime.jsx)("span", {
54
+ style: {
55
+ zIndex,
56
+ position: "absolute",
57
+ inset: 0,
58
+ contain: "strict",
59
+ pointerEvents: "none"
60
+ },
64
61
  children
65
- }), host);
62
+ }), body);
66
63
  });
@@ -25,33 +25,29 @@ __export(Portal_exports, {
25
25
  Portal: () => Portal
26
26
  });
27
27
  module.exports = __toCommonJS(Portal_exports);
28
- var import_polyfill_dev = require("@tamagui/polyfill-dev"), import_constants = require("@tamagui/constants"), import_stacks = require("@tamagui/stacks"), import_z_index_stack = require("@tamagui/z-index-stack"), React = __toESM(require("react")), import_react_dom = require("react-dom"), import_helpers = require("./helpers"), import_jsx_runtime = require("react/jsx-runtime");
28
+ var import_polyfill_dev = require("@tamagui/polyfill-dev"), import_constants = require("@tamagui/constants"), import_z_index_stack = require("@tamagui/z-index-stack"), React = __toESM(require("react")), import_react_dom = require("react-dom"), import_helpers = require("./helpers"), import_jsx_runtime = require("react/jsx-runtime");
29
29
  const Portal = React.memo((propsIn) => {
30
30
  if (import_constants.isServer)
31
31
  return null;
32
- const {
33
- host = globalThis.document?.body,
34
- stackZIndex,
35
- children,
36
- passThrough,
37
- ...props
38
- } = propsIn, zIndex = (0, import_z_index_stack.useStackedZIndex)((0, import_helpers.getStackedZIndexProps)(propsIn));
32
+ const body = globalThis.document?.body;
33
+ if (!body)
34
+ return propsIn.children;
35
+ const { children, passThrough } = propsIn, zIndex = (0, import_z_index_stack.useStackedZIndex)((0, import_helpers.getStackedZIndexProps)(propsIn));
39
36
  return passThrough ? children : (0, import_react_dom.createPortal)(
40
37
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
41
- import_stacks.YStack,
38
+ "span",
42
39
  {
43
- contain: "strict",
44
- fullscreen: !0,
45
- position: "fixed",
46
- maxWidth: "100vw",
47
- maxHeight: "100vh",
48
- pointerEvents: "none",
49
- ...props,
50
- zIndex,
40
+ style: {
41
+ zIndex,
42
+ position: "absolute",
43
+ inset: 0,
44
+ contain: "strict",
45
+ pointerEvents: "none"
46
+ },
51
47
  children
52
48
  }
53
49
  ),
54
- host
50
+ body
55
51
  );
56
52
  });
57
53
  //# sourceMappingURL=Portal.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Portal.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAO,kCAEP,mBAAyB,+BACzB,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
  });
28
28
  module.exports = __toCommonJS(Portal_native_exports);
29
- var import_jsx_runtime = require("react/jsx-runtime"), import_stacks = require("@tamagui/stacks"), import_z_index_stack = require("@tamagui/z-index-stack"), React = __toESM(require("react")), import_react_native = require("react-native"), import_constants = require("./constants"), import_GorhomPortalItem = require("./GorhomPortalItem"), import_helpers = require("./helpers"), createPortal = function() {
29
+ var import_jsx_runtime = require("react/jsx-runtime"), import_core = require("@tamagui/core"), import_z_index_stack = require("@tamagui/z-index-stack"), React = __toESM(require("react")), import_react_native = require("react-native"), import_constants = require("./constants"), import_GorhomPortalItem = require("./GorhomPortalItem"), import_helpers = require("./helpers"), createPortal = function() {
30
30
  if (import_constants.IS_FABRIC)
31
31
  try {
32
32
  var _ReactFabricShimModule_default, ReactFabricShimModule = require("react-native/Libraries/Renderer/shims/ReactFabric"), _ReactFabricShimModule_default_createPortal;
@@ -41,15 +41,17 @@ var import_jsx_runtime = require("react/jsx-runtime"), import_stacks = require("
41
41
  return console.info("Note: error importing portal, defaulting to non-native portals", err), null;
42
42
  }
43
43
  }(), Portal = function(propsIn) {
44
- var { stackZIndex, ...props } = propsIn, rootTag = React.useContext(import_react_native.RootTagContext), zIndex = (0, import_z_index_stack.useStackedZIndex)((0, import_helpers.getStackedZIndexProps)(propsIn)), contents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stacks.YStack, {
44
+ var rootTag = React.useContext(import_react_native.RootTagContext), zIndex = (0, import_z_index_stack.useStackedZIndex)((0, import_helpers.getStackedZIndexProps)(propsIn)), { children, passThrough } = propsIn, contents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.View, {
45
45
  pointerEvents: "box-none",
46
- fullscreen: !0,
47
46
  position: "absolute",
47
+ inset: 0,
48
48
  maxWidth: "100%",
49
- ...props,
50
- zIndex
49
+ zIndex,
50
+ passThrough,
51
+ children
51
52
  });
52
53
  return !createPortal || !import_constants.USE_NATIVE_PORTAL || !rootTag ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_GorhomPortalItem.GorhomPortalItem, {
54
+ passThrough,
53
55
  hostName: "root",
54
56
  children: contents
55
57
  }) : createPortal(contents, rootTag);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Portal.native.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;uDAAA,gBAAuB,4BACvB,uBAAiC,mCACjC,QAAuB,2BACvB,sBAA+B,yBAC/B,mBAA6C,wBAC7C,0BAAiC,+BACjC,iBAAsC,sBAGhCA,eAAgB,WAAA;AACpB,MAAIC;AACF,QAAI;UAIAC,gCAHIA,wBAAwBC,QAAQ,mDAAA,GAGpCD;AADF,cACEA,8CAAAA,yBAAAA,SAAAA,iCAAAA,sBAAuBE,aAAO,QAA9BF,mCAAAA,SAAAA,SAAAA,+BAAgCF,kBAAY,QAA5CE,gDAAAA,SAAAA,8CAAgDA,sBAAsBF;IAE1E,SAASK,KAAK;AACZC,qBAAQC,KAAK,kEAAkEF,GAAAA,GACxE;IACT;AAEF,MAAI;QAKAG,gCAJIA,wBACJL,QAAQ,mDAAA,GAGRK;AADF,YACEA,8CAAAA,yBAAAA,SAAAA,iCAAAA,sBAAuBJ,aAAO,QAA9BI,mCAAAA,SAAAA,SAAAA,+BAAgCR,kBAAY,QAA5CQ,gDAAAA,SAAAA,8CAAgDA,sBAAsBR;EAE1E,SAASK,KAAK;AACZC,mBAAQC,KAAK,kEAAkEF,GAAAA,GACxE;EACT;AACF,EAAA,GAEaI,SAAS,SAACC,SAAAA;AACrB,MAAM,EAAEC,aAAa,GAAGC,MAAAA,IAAUF,SAE5BG,UAAUC,MAAMC,WAAWC,kCAAAA,GAC3BC,aAASC,2CAAiBC,sCAAsBT,OAAAA,CAAAA,GAEhDU,WACJ,uCAAAC,KAACC,sBAAAA;IACCC,eAAc;IACdC,YAAU;IACVC,UAAS;IACTC,UAAS;IACR,GAAGd;IACJK;;AAIJ,SAAI,CAACjB,gBAAgB,CAAC2B,sCAAqB,CAACd,UACnC,uCAAAQ,KAACO,0CAAAA;IAAiBC,UAAS;cAAQT;OAGrCpB,aAAaoB,UAAUP,OAAAA;AAChC;",
5
- "names": ["createPortal", "IS_FABRIC", "ReactFabricShimModule", "require", "default", "err", "console", "info", "ReactNativeShimModule", "Portal", "propsIn", "stackZIndex", "props", "rootTag", "React", "useContext", "RootTagContext", "zIndex", "useStackedZIndex", "getStackedZIndexProps", "contents", "_jsx", "YStack", "pointerEvents", "fullscreen", "position", "maxWidth", "USE_NATIVE_PORTAL", "GorhomPortalItem", "hostName"]
4
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;uDAAA,cAAqB,0BACrB,uBAAiC,mCACjC,QAAuB,2BACvB,sBAA+B,yBAC/B,mBAA6C,wBAC7C,0BAAiC,+BACjC,iBAAsC,sBAGhCA,eAAgB,WAAA;AACpB,MAAIC;AACF,QAAI;UAIAC,gCAHIA,wBAAwBC,QAAQ,mDAAA,GAGpCD;AADF,cACEA,8CAAAA,yBAAAA,SAAAA,iCAAAA,sBAAuBE,aAAO,QAA9BF,mCAAAA,SAAAA,SAAAA,+BAAgCF,kBAAY,QAA5CE,gDAAAA,SAAAA,8CAAgDA,sBAAsBF;IAE1E,SAASK,KAAK;AACZC,qBAAQC,KAAK,kEAAkEF,GAAAA,GACxE;IACT;AAEF,MAAI;QAKAG,gCAJIA,wBACJL,QAAQ,mDAAA,GAGRK;AADF,YACEA,8CAAAA,yBAAAA,SAAAA,iCAAAA,sBAAuBJ,aAAO,QAA9BI,mCAAAA,SAAAA,SAAAA,+BAAgCR,kBAAY,QAA5CQ,gDAAAA,SAAAA,8CAAgDA,sBAAsBR;EAE1E,SAASK,KAAK;AACZC,mBAAQC,KAAK,kEAAkEF,GAAAA,GACxE;EACT;AACF,EAAA,GAEaI,SAAS,SAACC,SAAAA;AACrB,MAAMC,UAAUC,MAAMC,WAAWC,kCAAAA,GAC3BC,aAASC,2CAAiBC,sCAAsBP,OAAAA,CAAAA,GAEhD,EAAEQ,UAAUC,YAAW,IAAKT,SAE5BU,WACJ,uCAAAC,KAACC,kBAAAA;IACCC,eAAc;IACdC,UAAS;IACTC,OAAO;IACPC,UAAS;IACTX;IACAI;;;AAMJ,SAAI,CAACnB,gBAAgB,CAAC2B,sCAAqB,CAAChB,UAExC,uCAAAU,KAACO,0CAAAA;IAAiBT;IAA0BU,UAAS;cAClDT;OAKApB,aAAaoB,UAAUT,OAAAA;AAChC;",
5
+ "names": ["createPortal", "IS_FABRIC", "ReactFabricShimModule", "require", "default", "err", "console", "info", "ReactNativeShimModule", "Portal", "propsIn", "rootTag", "React", "useContext", "RootTagContext", "zIndex", "useStackedZIndex", "getStackedZIndexProps", "children", "passThrough", "contents", "_jsx", "View", "pointerEvents", "position", "inset", "maxWidth", "USE_NATIVE_PORTAL", "GorhomPortalItem", "hostName"]
6
6
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/PortalProps.tsx"],
4
- "mappings": ";;;;;;;;;;;;AAGA;;",
4
+ "mappings": ";;;;;;;;;;;;AAEA;;",
5
5
  "names": []
6
6
  }
@@ -1,6 +1,5 @@
1
1
  import "@tamagui/polyfill-dev";
2
2
  import { isServer } from "@tamagui/constants";
3
- import { YStack } from "@tamagui/stacks";
4
3
  import { useStackedZIndex } from "@tamagui/z-index-stack";
5
4
  import * as React from "react";
6
5
  import { createPortal } from "react-dom";
@@ -9,29 +8,25 @@ import { jsx } from "react/jsx-runtime";
9
8
  const Portal = React.memo((propsIn) => {
10
9
  if (isServer)
11
10
  return null;
12
- const {
13
- host = globalThis.document?.body,
14
- stackZIndex,
15
- children,
16
- passThrough,
17
- ...props
18
- } = propsIn, zIndex = useStackedZIndex(getStackedZIndexProps(propsIn));
11
+ const body = globalThis.document?.body;
12
+ if (!body)
13
+ return propsIn.children;
14
+ const { children, passThrough } = propsIn, zIndex = useStackedZIndex(getStackedZIndexProps(propsIn));
19
15
  return passThrough ? children : createPortal(
20
16
  /* @__PURE__ */ jsx(
21
- YStack,
17
+ "span",
22
18
  {
23
- contain: "strict",
24
- fullscreen: !0,
25
- position: "fixed",
26
- maxWidth: "100vw",
27
- maxHeight: "100vh",
28
- pointerEvents: "none",
29
- ...props,
30
- zIndex,
19
+ style: {
20
+ zIndex,
21
+ position: "absolute",
22
+ inset: 0,
23
+ contain: "strict",
24
+ pointerEvents: "none"
25
+ },
31
26
  children
32
27
  }
33
28
  ),
34
- host
29
+ body
35
30
  );
36
31
  });
37
32
  export {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Portal.tsx"],
4
- "mappings": "AAAA,OAAO;AAEP,SAAS,gBAAgB;AACzB,SAAS,cAAc;AACvB,SAAS,wBAAwB;AACjC,YAAY,WAAW;AACvB,SAAS,oBAAoB;AAC7B,SAAS,6BAA6B;AAwBlC;AAnBG,MAAM,SAAS,MAAM,KAAK,CAAC,YAAyB;AACzD,MAAI;AACF,WAAO;AAGT,QAAM;AAAA,IACJ,OAAO,WAAW,UAAU;AAAA,IAC5B;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI,SACE,SAAS,iBAAiB,sBAAsB,OAAO,CAAC;AAE9D,SAAI,cACK,WAGF;AAAA,IACL;AAAA,MAAC;AAAA;AAAA,QACC,SAAQ;AAAA,QACR,YAAU;AAAA,QAEV,UAAS;AAAA,QACT,UAAS;AAAA,QACT,WAAU;AAAA,QACV,eAAc;AAAA,QACb,GAAG;AAAA,QACJ;AAAA,QAEC;AAAA;AAAA,IACH;AAAA,IACA;AAAA,EACF;AACF,CAAC;",
4
+ "mappings": "AAAA,OAAO;AAEP,SAAS,gBAAgB;AACzB,SAAS,wBAAwB;AACjC,YAAY,WAAW;AACvB,SAAS,oBAAoB;AAC7B,SAAS,6BAA6B;AAsBlC;AAnBG,MAAM,SAAS,MAAM,KAAK,CAAC,YAAyB;AACzD,MAAI;AACF,WAAO;AAGT,QAAM,OAAO,WAAW,UAAU;AAElC,MAAI,CAAC;AACH,WAAO,QAAQ;AAGjB,QAAM,EAAE,UAAU,YAAY,IAAI,SAC5B,SAAS,iBAAiB,sBAAsB,OAAO,CAAC;AAE9D,SAAI,cACK,WAGF;AAAA,IACL;AAAA,MAAC;AAAA;AAAA,QACC,OAAO;AAAA,UACL;AAAA,UACA,UAAU;AAAA,UACV,OAAO;AAAA,UACP,SAAS;AAAA,UACT,eAAe;AAAA,QACjB;AAAA,QAEC;AAAA;AAAA,IACH;AAAA,IACA;AAAA,EACF;AACF,CAAC;",
5
5
  "names": []
6
6
  }
@@ -1,6 +1,5 @@
1
1
  import "@tamagui/polyfill-dev";
2
2
  import { isServer } from "@tamagui/constants";
3
- import { YStack } from "@tamagui/stacks";
4
3
  import { useStackedZIndex } from "@tamagui/z-index-stack";
5
4
  import * as React from "react";
6
5
  import { createPortal } from "react-dom";
@@ -8,25 +7,23 @@ import { getStackedZIndexProps } from "./helpers.mjs";
8
7
  import { jsx } from "react/jsx-runtime";
9
8
  const Portal = React.memo(propsIn => {
10
9
  if (isServer) return null;
10
+ const body = globalThis.document?.body;
11
+ if (!body) return propsIn.children;
11
12
  const {
12
- host = globalThis.document?.body,
13
- stackZIndex,
14
13
  children,
15
- passThrough,
16
- ...props
14
+ passThrough
17
15
  } = propsIn,
18
16
  zIndex = useStackedZIndex(getStackedZIndexProps(propsIn));
19
- return passThrough ? children : createPortal(/* @__PURE__ */jsx(YStack, {
20
- contain: "strict",
21
- fullscreen: !0,
22
- position: "fixed",
23
- maxWidth: "100vw",
24
- maxHeight: "100vh",
25
- pointerEvents: "none",
26
- ...props,
27
- zIndex,
17
+ return passThrough ? children : createPortal(/* @__PURE__ */jsx("span", {
18
+ style: {
19
+ zIndex,
20
+ position: "absolute",
21
+ inset: 0,
22
+ contain: "strict",
23
+ pointerEvents: "none"
24
+ },
28
25
  children
29
- }), host);
26
+ }), body);
30
27
  });
31
28
  export { Portal };
32
29
  //# sourceMappingURL=Portal.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["isServer","YStack","useStackedZIndex","React","createPortal","getStackedZIndexProps","jsx","Portal","memo","propsIn","host","globalThis","document","body","stackZIndex","children","passThrough","props","zIndex","contain","fullscreen","position","maxWidth","maxHeight","pointerEvents"],"sources":["../../src/Portal.tsx"],"sourcesContent":[null],"mappings":"AAAA,OAAO;AAEP,SAASA,QAAA,QAAgB;AACzB,SAASC,MAAA,QAAc;AACvB,SAASC,gBAAA,QAAwB;AACjC,YAAYC,KAAA,MAAW;AACvB,SAASC,YAAA,QAAoB;AAC7B,SAASC,qBAAA,QAA6B;AAwBlC,SAAAC,GAAA;AAnBG,MAAMC,MAAA,GAASJ,KAAA,CAAMK,IAAA,CAAMC,OAAA,IAAyB;EACzD,IAAIT,QAAA,EACF,OAAO;EAGT,MAAM;MACJU,IAAA,GAAOC,UAAA,CAAWC,QAAA,EAAUC,IAAA;MAC5BC,WAAA;MACAC,QAAA;MACAC,WAAA;MACA,GAAGC;IACL,IAAIR,OAAA;IACES,MAAA,GAAShB,gBAAA,CAAiBG,qBAAA,CAAsBI,OAAO,CAAC;EAE9D,OAAIO,WAAA,GACKD,QAAA,GAGFX,YAAA,CACL,eAAAE,GAAA,CAACL,MAAA;IACCkB,OAAA,EAAQ;IACRC,UAAA,EAAU;IAEVC,QAAA,EAAS;IACTC,QAAA,EAAS;IACTC,SAAA,EAAU;IACVC,aAAA,EAAc;IACb,GAAGP,KAAA;IACJC,MAAA;IAECH;EAAA,CACH,GACAL,IACF;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["isServer","useStackedZIndex","React","createPortal","getStackedZIndexProps","jsx","Portal","memo","propsIn","body","globalThis","document","children","passThrough","zIndex","style","position","inset","contain","pointerEvents"],"sources":["../../src/Portal.tsx"],"sourcesContent":[null],"mappings":"AAAA,OAAO;AAEP,SAASA,QAAA,QAAgB;AACzB,SAASC,gBAAA,QAAwB;AACjC,YAAYC,KAAA,MAAW;AACvB,SAASC,YAAA,QAAoB;AAC7B,SAASC,qBAAA,QAA6B;AAsBlC,SAAAC,GAAA;AAnBG,MAAMC,MAAA,GAASJ,KAAA,CAAMK,IAAA,CAAMC,OAAA,IAAyB;EACzD,IAAIR,QAAA,EACF,OAAO;EAGT,MAAMS,IAAA,GAAOC,UAAA,CAAWC,QAAA,EAAUF,IAAA;EAElC,IAAI,CAACA,IAAA,EACH,OAAOD,OAAA,CAAQI,QAAA;EAGjB,MAAM;MAAEA,QAAA;MAAUC;IAAY,IAAIL,OAAA;IAC5BM,MAAA,GAASb,gBAAA,CAAiBG,qBAAA,CAAsBI,OAAO,CAAC;EAE9D,OAAIK,WAAA,GACKD,QAAA,GAGFT,YAAA,CACL,eAAAE,GAAA,CAAC;IACCU,KAAA,EAAO;MACLD,MAAA;MACAE,QAAA,EAAU;MACVC,KAAA,EAAO;MACPC,OAAA,EAAS;MACTC,aAAA,EAAe;IACjB;IAECP;EAAA,CACH,GACAH,IACF;AACF,CAAC","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { YStack } from "@tamagui/stacks";
2
+ import { View } from "@tamagui/core";
3
3
  import { useStackedZIndex } from "@tamagui/z-index-stack";
4
4
  import * as React from "react";
5
5
  import { RootTagContext } from "react-native";
@@ -25,21 +25,23 @@ var createPortal = function () {
25
25
  }
26
26
  }(),
27
27
  Portal = function (propsIn) {
28
- var {
29
- stackZIndex,
30
- ...props
31
- } = propsIn,
32
- rootTag = React.useContext(RootTagContext),
28
+ var rootTag = React.useContext(RootTagContext),
33
29
  zIndex = useStackedZIndex(getStackedZIndexProps(propsIn)),
34
- contents = /* @__PURE__ */_jsx(YStack, {
30
+ {
31
+ children,
32
+ passThrough
33
+ } = propsIn,
34
+ contents = /* @__PURE__ */_jsx(View, {
35
35
  pointerEvents: "box-none",
36
- fullscreen: !0,
37
36
  position: "absolute",
37
+ inset: 0,
38
38
  maxWidth: "100%",
39
- ...props,
40
- zIndex
39
+ zIndex,
40
+ passThrough,
41
+ children
41
42
  });
42
43
  return !createPortal || !USE_NATIVE_PORTAL || !rootTag ? /* @__PURE__ */_jsx(GorhomPortalItem, {
44
+ passThrough,
43
45
  hostName: "root",
44
46
  children: contents
45
47
  }) : createPortal(contents, rootTag);
@@ -1 +1 @@
1
- {"version":3,"names":["YStack","useStackedZIndex","React","RootTagContext","IS_FABRIC","USE_NATIVE_PORTAL","GorhomPortalItem","getStackedZIndexProps","createPortal","_ReactFabricShimModule_default","ReactFabricShimModule","require","_ReactFabricShimModule_default_createPortal","default","err","console","info","_ReactNativeShimModule_default","ReactNativeShimModule","_ReactNativeShimModule_default_createPortal","Portal","propsIn","stackZIndex","props","rootTag","useContext","zIndex","contents","_jsx","pointerEvents","fullscreen","position","maxWidth","hostName"],"sources":["../../src/Portal.native.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,MAAA,QAAc;AACvB,SAASC,gBAAA,QAAwB;AACjC,YAAYC,KAAA,MAAW;AACvB,SAASC,cAAA,QAAsB;AAC/B,SAASC,SAAA,EAAWC,iBAAA,QAAyB;AAC7C,SAASC,gBAAA,QAAwB;AACjC,SAASC,qBAAA,QAA6B;AAGtC,IAAMC,YAAA,GAAgB;IACpB,IAAIJ,SAAA,EACF,IAAI;UAIAK,8BAAA;QAHIC,qBAAA,GAAwBC,OAAA,CAAQ;QAGpCC,2CAAA;MADF,QACEA,2CAAA,GAAAF,qBAAA,aAAAD,8BAAA,GAAAC,qBAAA,CAAuBG,OAAA,MAAO,QAA9BJ,8BAAA,uBAAAA,8BAAA,CAAgCD,YAAA,MAAY,QAA5CI,2CAAA,cAAAA,2CAAA,GAAgDF,qBAAA,CAAsBF,YAAA;IAE1E,SAASM,GAAA,EAAK;MACZ,OAAAC,OAAA,CAAQC,IAAA,CAAK,kEAAkEF,GAAA,GACxE;IACT;IAEF,IAAI;UAKAG,8BAAA;QAJIC,qBAAA,GACJP,OAAA,CAAQ;QAGRQ,2CAAA;MADF,QACEA,2CAAA,GAAAD,qBAAA,aAAAD,8BAAA,GAAAC,qBAAA,CAAuBL,OAAA,MAAO,QAA9BI,8BAAA,uBAAAA,8BAAA,CAAgCT,YAAA,MAAY,QAA5CW,2CAAA,cAAAA,2CAAA,GAAgDD,qBAAA,CAAsBV,YAAA;IAE1E,SAASM,GAAA,EAAK;MACZ,OAAAC,OAAA,CAAQC,IAAA,CAAK,kEAAkEF,GAAA,GACxE;IACT;EACF;EAEaM,MAAA,GAAS,SAAAA,CAACC,OAAA;IACrB,IAAM;QAAEC,WAAA;QAAa,GAAGC;MAAA,IAAUF,OAAA;MAE5BG,OAAA,GAAUtB,KAAA,CAAMuB,UAAA,CAAWtB,cAAA;MAC3BuB,MAAA,GAASzB,gBAAA,CAAiBM,qBAAA,CAAsBc,OAAA;MAEhDM,QAAA,GACJ,eAAAC,IAAA,CAAC5B,MAAA;QACC6B,aAAA,EAAc;QACdC,UAAA,EAAU;QACVC,QAAA,EAAS;QACTC,QAAA,EAAS;QACR,GAAGT,KAAA;QACJG;;IAIJ,OAAI,CAAClB,YAAA,IAAgB,CAACH,iBAAA,IAAqB,CAACmB,OAAA,GACnC,eAAAI,IAAA,CAACtB,gBAAA;MAAiB2B,QAAA,EAAS;gBAAQN;SAGrCnB,YAAA,CAAamB,QAAA,EAAUH,OAAA;EAChC","ignoreList":[]}
1
+ {"version":3,"names":["View","useStackedZIndex","React","RootTagContext","IS_FABRIC","USE_NATIVE_PORTAL","GorhomPortalItem","getStackedZIndexProps","createPortal","_ReactFabricShimModule_default","ReactFabricShimModule","require","_ReactFabricShimModule_default_createPortal","default","err","console","info","_ReactNativeShimModule_default","ReactNativeShimModule","_ReactNativeShimModule_default_createPortal","Portal","propsIn","rootTag","useContext","zIndex","children","passThrough","contents","_jsx","pointerEvents","position","inset","maxWidth","hostName"],"sources":["../../src/Portal.native.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,IAAA,QAAY;AACrB,SAASC,gBAAA,QAAwB;AACjC,YAAYC,KAAA,MAAW;AACvB,S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AE,WAAA;;;IAMJ,OAAI,CAAClB,YAAA,IAAgB,CAACH,iBAAA,IAAqB,CAACiB,OAAA,GAExC,eAAAM,IAAA,CAACtB,gBAAA;MAAiBoB,WAAA;MAA0BO,QAAA,EAAS;gBAClDN;SAKAnB,YAAA,CAAamB,QAAA,EAAUL,OAAA;EAChC","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/portal",
3
- "version": "1.130.2",
3
+ "version": "1.130.4",
4
4
  "source": "src/index.ts",
5
5
  "types": "./types/index.d.ts",
6
6
  "main": "dist/cjs",
@@ -32,15 +32,14 @@
32
32
  }
33
33
  },
34
34
  "dependencies": {
35
- "@tamagui/constants": "1.130.2",
36
- "@tamagui/core": "1.130.2",
37
- "@tamagui/stacks": "1.130.2",
38
- "@tamagui/start-transition": "1.130.2",
39
- "@tamagui/use-event": "1.130.2",
40
- "@tamagui/z-index-stack": "1.130.2"
35
+ "@tamagui/constants": "1.130.4",
36
+ "@tamagui/core": "1.130.4",
37
+ "@tamagui/start-transition": "1.130.4",
38
+ "@tamagui/use-event": "1.130.4",
39
+ "@tamagui/z-index-stack": "1.130.4"
41
40
  },
42
41
  "devDependencies": {
43
- "@tamagui/build": "1.130.2",
42
+ "@tamagui/build": "1.130.4",
44
43
  "@types/react-dom": "^19.1.6",
45
44
  "react-native": "^0.79.2"
46
45
  },
@@ -1,4 +1,4 @@
1
- import { YStack } from '@tamagui/stacks'
1
+ import { View } from '@tamagui/core'
2
2
  import { useStackedZIndex } from '@tamagui/z-index-stack'
3
3
  import * as React from 'react'
4
4
  import { RootTagContext } from 'react-native'
@@ -34,24 +34,30 @@ const createPortal = (() => {
34
34
  })()
35
35
 
36
36
  export const Portal = (propsIn: PortalProps) => {
37
- const { stackZIndex, ...props } = propsIn
38
-
39
37
  const rootTag = React.useContext(RootTagContext)
40
38
  const zIndex = useStackedZIndex(getStackedZIndexProps(propsIn))
41
39
 
40
+ const { children, passThrough } = propsIn
41
+
42
42
  const contents = (
43
- <YStack
43
+ <View
44
44
  pointerEvents="box-none"
45
- fullscreen
46
45
  position="absolute"
46
+ inset={0}
47
47
  maxWidth="100%"
48
- {...props}
49
48
  zIndex={zIndex}
50
- />
49
+ passThrough={passThrough}
50
+ >
51
+ {children}
52
+ </View>
51
53
  )
52
54
 
53
55
  if (!createPortal || !USE_NATIVE_PORTAL || !rootTag) {
54
- return <GorhomPortalItem hostName="root">{contents}</GorhomPortalItem>
56
+ return (
57
+ <GorhomPortalItem passThrough={passThrough} hostName="root">
58
+ {contents}
59
+ </GorhomPortalItem>
60
+ )
55
61
  }
56
62
 
57
63
  return createPortal(contents, rootTag)
package/src/Portal.tsx CHANGED
@@ -1,27 +1,24 @@
1
1
  import '@tamagui/polyfill-dev'
2
2
 
3
3
  import { isServer } from '@tamagui/constants'
4
- import { YStack } from '@tamagui/stacks'
5
4
  import { useStackedZIndex } from '@tamagui/z-index-stack'
6
5
  import * as React from 'react'
7
6
  import { createPortal } from 'react-dom'
8
7
  import { getStackedZIndexProps } from './helpers'
9
8
  import type { PortalProps } from './PortalProps'
10
9
 
11
- // web only version
12
-
13
10
  export const Portal = React.memo((propsIn: PortalProps) => {
14
11
  if (isServer) {
15
12
  return null
16
13
  }
17
14
 
18
- const {
19
- host = globalThis.document?.body,
20
- stackZIndex,
21
- children,
22
- passThrough,
23
- ...props
24
- } = propsIn
15
+ const body = globalThis.document?.body
16
+
17
+ if (!body) {
18
+ return propsIn.children
19
+ }
20
+
21
+ const { children, passThrough } = propsIn
25
22
  const zIndex = useStackedZIndex(getStackedZIndexProps(propsIn))
26
23
 
27
24
  if (passThrough) {
@@ -29,19 +26,17 @@ export const Portal = React.memo((propsIn: PortalProps) => {
29
26
  }
30
27
 
31
28
  return createPortal(
32
- <YStack
33
- contain="strict"
34
- fullscreen
35
- // @ts-expect-error ok on web
36
- position="fixed"
37
- maxWidth="100vw"
38
- maxHeight="100vh"
39
- pointerEvents="none"
40
- {...props}
41
- zIndex={zIndex}
29
+ <span
30
+ style={{
31
+ zIndex,
32
+ position: 'absolute',
33
+ inset: 0,
34
+ contain: 'strict',
35
+ pointerEvents: 'none',
36
+ }}
42
37
  >
43
38
  {children}
44
- </YStack>,
45
- host
46
- ) as any
39
+ </span>,
40
+ body
41
+ )
47
42
  })
@@ -1,8 +1,8 @@
1
- import type { YStackProps } from '@tamagui/stacks'
2
- import type { StackZIndexProp } from '@tamagui/z-index-stack/types'
1
+ import type { StackZIndexProp } from '@tamagui/z-index-stack'
3
2
 
4
- export type PortalProps = YStackProps & {
5
- host?: any // element
6
- inactive?: boolean
3
+ export type PortalProps = {
4
+ zIndex?: number
5
+ passThrough?: boolean
7
6
  stackZIndex?: StackZIndexProp
7
+ children?: React.ReactNode
8
8
  }
package/types/Portal.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import '@tamagui/polyfill-dev';
2
2
  import * as React from 'react';
3
3
  import type { PortalProps } from './PortalProps';
4
- export declare const Portal: React.MemoExoticComponent<(propsIn: PortalProps) => any>;
4
+ export declare const Portal: React.MemoExoticComponent<(propsIn: PortalProps) => React.ReactNode>;
5
5
  //# sourceMappingURL=Portal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Portal.d.ts","sourceRoot":"","sources":["../src/Portal.tsx"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,CAAA;AAK9B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAIhD,eAAO,MAAM,MAAM,sCAAwB,WAAW,SAkCpD,CAAA"}
1
+ {"version":3,"file":"Portal.d.ts","sourceRoot":"","sources":["../src/Portal.tsx"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,CAAA;AAI9B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAEhD,eAAO,MAAM,MAAM,sCAAwB,WAAW,qBAgCpD,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Portal.native.d.ts","sourceRoot":"","sources":["../src/Portal.native.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AA4BhD,eAAO,MAAM,MAAM,GAAI,SAAS,WAAW,QAsB1C,CAAA"}
1
+ {"version":3,"file":"Portal.native.d.ts","sourceRoot":"","sources":["../src/Portal.native.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AA4BhD,eAAO,MAAM,MAAM,GAAI,SAAS,WAAW,QA4B1C,CAAA"}
@@ -1,8 +1,8 @@
1
- import type { YStackProps } from '@tamagui/stacks';
2
- import type { StackZIndexProp } from '@tamagui/z-index-stack/types';
3
- export type PortalProps = YStackProps & {
4
- host?: any;
5
- inactive?: boolean;
1
+ import type { StackZIndexProp } from '@tamagui/z-index-stack';
2
+ export type PortalProps = {
3
+ zIndex?: number;
4
+ passThrough?: boolean;
6
5
  stackZIndex?: StackZIndexProp;
6
+ children?: React.ReactNode;
7
7
  };
8
8
  //# sourceMappingURL=PortalProps.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PortalProps.d.ts","sourceRoot":"","sources":["../src/PortalProps.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAEnE,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG;IACtC,IAAI,CAAC,EAAE,GAAG,CAAA;IACV,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,eAAe,CAAA;CAC9B,CAAA"}
1
+ {"version":3,"file":"PortalProps.d.ts","sourceRoot":"","sources":["../src/PortalProps.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAE7D,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,WAAW,CAAC,EAAE,eAAe,CAAA;IAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA"}