@tamagui/portal 1.0.0-beta.9 → 1.0.1-beta.100

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.
@@ -18,7 +18,6 @@ var __spreadValues = (a, b) => {
18
18
  }
19
19
  return a;
20
20
  };
21
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
22
21
  var __export = (target, all) => {
23
22
  for (var name in all)
24
23
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -44,14 +43,16 @@ var import_stacks = require("@tamagui/stacks");
44
43
  var React = __toESM(require("react"));
45
44
  var import_react_dom = require("react-dom");
46
45
  var import_react_native = require("react-native");
47
- const Portal = /* @__PURE__ */ __name((props) => {
46
+ const Portal = (props) => {
48
47
  const contents = /* @__PURE__ */ React.createElement(import_stacks.YStack, __spreadValues({
49
48
  pointerEvents: "none",
50
49
  fullscreen: true
51
50
  }, props));
52
51
  if (!import_core.isWeb) {
53
52
  return /* @__PURE__ */ React.createElement(import_react_native.Modal, {
54
- visible: true
53
+ visible: true,
54
+ transparent: true,
55
+ pointerEvents: "none"
55
56
  }, contents);
56
57
  }
57
58
  const [hostElement, setHostElement] = React.useState(null);
@@ -63,7 +64,7 @@ const Portal = /* @__PURE__ */ __name((props) => {
63
64
  return (0, import_react_dom.createPortal)(contents, hostElement);
64
65
  }
65
66
  return null;
66
- }, "Portal");
67
+ };
67
68
  // Annotate the CommonJS export names for ESM import in node:
68
69
  0 && (module.exports = {
69
70
  Portal
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Portal.tsx"],
4
- "sourcesContent": ["import '@tamagui/polyfill-dev'\n\nimport { isWeb, useIsomorphicLayoutEffect } from '@tamagui/core'\nimport { YStack, YStackProps } from '@tamagui/stacks'\nimport * as React from 'react'\nimport { createPortal } from 'react-dom'\nimport { Modal } from 'react-native'\n\n// todo extract to package\nexport const Portal = (props: YStackProps) => {\n const contents = <YStack pointerEvents=\"none\" fullscreen {...props} />\n if (!isWeb) {\n return <Modal visible>{contents}</Modal>\n }\n const [hostElement, setHostElement] = React.useState<any>(null)\n\n useIsomorphicLayoutEffect(() => {\n setHostElement(globalThis.document?.body)\n }, [])\n\n if (hostElement) {\n return createPortal(contents, hostElement)\n }\n // ssr return null\n return null\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAO;AAEP,kBAAiD;AACjD,oBAAoC;AACpC,YAAuB;AACvB,uBAA6B;AAC7B,0BAAsB;AAGf,MAAM,SAAS,wBAAC,UAAuB;AAC5C,QAAM,WAAW,oCAAC;AAAA,IAAO,eAAc;AAAA,IAAO,YAAU;AAAA,KAAK,MAAO;AACpE,MAAI,CAAC,mBAAO;AACV,WAAO,oCAAC;AAAA,MAAM,SAAO;AAAA,OAAE,QAAS;AAAA,EAClC;AACA,QAAM,CAAC,aAAa,kBAAkB,MAAM,SAAc,IAAI;AAE9D,6CAA0B,MAAM;AAhBlC;AAiBI,mBAAe,iBAAW,aAAX,mBAAqB,IAAI;AAAA,EAC1C,GAAG,CAAC,CAAC;AAEL,MAAI,aAAa;AACf,WAAO,mCAAa,UAAU,WAAW;AAAA,EAC3C;AAEA,SAAO;AACT,GAhBsB;",
4
+ "sourcesContent": ["import '@tamagui/polyfill-dev'\n\nimport { isWeb, useIsomorphicLayoutEffect } from '@tamagui/core'\nimport { YStack, YStackProps } from '@tamagui/stacks'\nimport * as React from 'react'\nimport { createPortal } from 'react-dom'\nimport { Modal } from 'react-native'\n\nexport type PortalProps = YStackProps\n\nexport const Portal = (props: PortalProps) => {\n const contents = <YStack pointerEvents=\"none\" fullscreen {...props} />\n\n if (!isWeb) {\n // check if theme stays in context here\n return (\n <Modal visible transparent pointerEvents=\"none\">\n {contents}\n </Modal>\n )\n }\n\n const [hostElement, setHostElement] = React.useState<any>(null)\n\n useIsomorphicLayoutEffect(() => {\n setHostElement(globalThis.document?.body)\n }, [])\n\n if (hostElement) {\n return createPortal(contents, hostElement)\n }\n\n // ssr return null\n return null\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAO;AAEP,kBAAiD;AACjD,oBAAoC;AACpC,YAAuB;AACvB,uBAA6B;AAC7B,0BAAsB;AAIf,MAAM,SAAS,CAAC,UAAuB;AAC5C,QAAM,WAAW,oCAAC;AAAA,IAAO,eAAc;AAAA,IAAO,YAAU;AAAA,KAAK,MAAO;AAEpE,MAAI,CAAC,mBAAO;AAEV,WACE,oCAAC;AAAA,MAAM,SAAO;AAAA,MAAC,aAAW;AAAA,MAAC,eAAc;AAAA,OACtC,QACH;AAAA,EAEJ;AAEA,QAAM,CAAC,aAAa,kBAAkB,MAAM,SAAc,IAAI;AAE9D,6CAA0B,MAAM;AAxBlC;AAyBI,mBAAe,iBAAW,aAAX,mBAAqB,IAAI;AAAA,EAC1C,GAAG,CAAC,CAAC;AAEL,MAAI,aAAa;AACf,WAAO,mCAAa,UAAU,WAAW;AAAA,EAC3C;AAGA,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -1,20 +1,35 @@
1
1
  var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
3
17
  import "@tamagui/polyfill-dev";
4
18
  import { isWeb, useIsomorphicLayoutEffect } from "@tamagui/core";
5
19
  import { YStack } from "@tamagui/stacks";
6
20
  import * as React from "react";
7
21
  import { createPortal } from "react-dom";
8
22
  import { Modal } from "react-native";
9
- const Portal = /* @__PURE__ */ __name((props) => {
10
- const contents = /* @__PURE__ */ React.createElement(YStack, {
23
+ const Portal = (props) => {
24
+ const contents = /* @__PURE__ */ React.createElement(YStack, __spreadValues({
11
25
  pointerEvents: "none",
12
- fullscreen: true,
13
- ...props
14
- });
26
+ fullscreen: true
27
+ }, props));
15
28
  if (!isWeb) {
16
29
  return /* @__PURE__ */ React.createElement(Modal, {
17
- visible: true
30
+ visible: true,
31
+ transparent: true,
32
+ pointerEvents: "none"
18
33
  }, contents);
19
34
  }
20
35
  const [hostElement, setHostElement] = React.useState(null);
@@ -26,7 +41,7 @@ const Portal = /* @__PURE__ */ __name((props) => {
26
41
  return createPortal(contents, hostElement);
27
42
  }
28
43
  return null;
29
- }, "Portal");
44
+ };
30
45
  export {
31
46
  Portal
32
47
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Portal.tsx"],
4
- "sourcesContent": ["import '@tamagui/polyfill-dev'\n\nimport { isWeb, useIsomorphicLayoutEffect } from '@tamagui/core'\nimport { YStack, YStackProps } from '@tamagui/stacks'\nimport * as React from 'react'\nimport { createPortal } from 'react-dom'\nimport { Modal } from 'react-native'\n\n// todo extract to package\nexport const Portal = (props: YStackProps) => {\n const contents = <YStack pointerEvents=\"none\" fullscreen {...props} />\n if (!isWeb) {\n return <Modal visible>{contents}</Modal>\n }\n const [hostElement, setHostElement] = React.useState<any>(null)\n\n useIsomorphicLayoutEffect(() => {\n setHostElement(globalThis.document?.body)\n }, [])\n\n if (hostElement) {\n return createPortal(contents, hostElement)\n }\n // ssr return null\n return null\n}\n"],
5
- "mappings": ";;AAAA;AAEA;AACA;AACA;AACA;AACA;AAGO,MAAM,SAAS,wBAAC,UAAuB;AAC5C,QAAM,WAAW,oCAAC;AAAA,IAAO,eAAc;AAAA,IAAO,YAAU;AAAA,OAAK;AAAA,GAAO;AACpE,MAAI,CAAC,OAAO;AACV,WAAO,oCAAC;AAAA,MAAM,SAAO;AAAA,OAAE,QAAS;AAAA,EAClC;AACA,QAAM,CAAC,aAAa,kBAAkB,MAAM,SAAc,IAAI;AAE9D,4BAA0B,MAAM;AAhBlC;AAiBI,mBAAe,iBAAW,aAAX,mBAAqB,IAAI;AAAA,EAC1C,GAAG,CAAC,CAAC;AAEL,MAAI,aAAa;AACf,WAAO,aAAa,UAAU,WAAW;AAAA,EAC3C;AAEA,SAAO;AACT,GAhBsB;",
4
+ "sourcesContent": ["import '@tamagui/polyfill-dev'\n\nimport { isWeb, useIsomorphicLayoutEffect } from '@tamagui/core'\nimport { YStack, YStackProps } from '@tamagui/stacks'\nimport * as React from 'react'\nimport { createPortal } from 'react-dom'\nimport { Modal } from 'react-native'\n\nexport type PortalProps = YStackProps\n\nexport const Portal = (props: PortalProps) => {\n const contents = <YStack pointerEvents=\"none\" fullscreen {...props} />\n\n if (!isWeb) {\n // check if theme stays in context here\n return (\n <Modal visible transparent pointerEvents=\"none\">\n {contents}\n </Modal>\n )\n }\n\n const [hostElement, setHostElement] = React.useState<any>(null)\n\n useIsomorphicLayoutEffect(() => {\n setHostElement(globalThis.document?.body)\n }, [])\n\n if (hostElement) {\n return createPortal(contents, hostElement)\n }\n\n // ssr return null\n return null\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AACA;AACA;AACA;AAIO,MAAM,SAAS,CAAC,UAAuB;AAC5C,QAAM,WAAW,oCAAC;AAAA,IAAO,eAAc;AAAA,IAAO,YAAU;AAAA,KAAK,MAAO;AAEpE,MAAI,CAAC,OAAO;AAEV,WACE,oCAAC;AAAA,MAAM,SAAO;AAAA,MAAC,aAAW;AAAA,MAAC,eAAc;AAAA,OACtC,QACH;AAAA,EAEJ;AAEA,QAAM,CAAC,aAAa,kBAAkB,MAAM,SAAc,IAAI;AAE9D,4BAA0B,MAAM;AAxBlC;AAyBI,mBAAe,iBAAW,aAAX,mBAAqB,IAAI;AAAA,EAC1C,GAAG,CAAC,CAAC;AAEL,MAAI,aAAa;AACf,WAAO,aAAa,UAAU,WAAW;AAAA,EAC3C;AAGA,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -1,15 +1,13 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
1
  import "@tamagui/polyfill-dev";
4
2
  import { isWeb, useIsomorphicLayoutEffect } from "@tamagui/core";
5
3
  import { YStack } from "@tamagui/stacks";
6
4
  import * as React from "react";
7
5
  import { createPortal } from "react-dom";
8
6
  import { Modal } from "react-native";
9
- const Portal = /* @__PURE__ */ __name((props) => {
7
+ const Portal = (props) => {
10
8
  const contents = <YStack pointerEvents="none" fullscreen {...props} />;
11
9
  if (!isWeb) {
12
- return <Modal visible>{contents}</Modal>;
10
+ return <Modal visible transparent pointerEvents="none">{contents}</Modal>;
13
11
  }
14
12
  const [hostElement, setHostElement] = React.useState(null);
15
13
  useIsomorphicLayoutEffect(() => {
@@ -20,7 +18,8 @@ const Portal = /* @__PURE__ */ __name((props) => {
20
18
  return createPortal(contents, hostElement);
21
19
  }
22
20
  return null;
23
- }, "Portal");
21
+ };
24
22
  export {
25
23
  Portal
26
24
  };
25
+ //# sourceMappingURL=Portal.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/Portal.tsx"],
4
+ "sourcesContent": ["import '@tamagui/polyfill-dev'\n\nimport { isWeb, useIsomorphicLayoutEffect } from '@tamagui/core'\nimport { YStack, YStackProps } from '@tamagui/stacks'\nimport * as React from 'react'\nimport { createPortal } from 'react-dom'\nimport { Modal } from 'react-native'\n\nexport type PortalProps = YStackProps\n\nexport const Portal = (props: PortalProps) => {\n const contents = <YStack pointerEvents=\"none\" fullscreen {...props} />\n\n if (!isWeb) {\n // check if theme stays in context here\n return (\n <Modal visible transparent pointerEvents=\"none\">\n {contents}\n </Modal>\n )\n }\n\n const [hostElement, setHostElement] = React.useState<any>(null)\n\n useIsomorphicLayoutEffect(() => {\n setHostElement(globalThis.document?.body)\n }, [])\n\n if (hostElement) {\n return createPortal(contents, hostElement)\n }\n\n // ssr return null\n return null\n}\n"],
5
+ "mappings": "AAAA;AAEA;AACA;AACA;AACA;AACA;AAIO,MAAM,SAAS,CAAC,UAAuB;AAC5C,QAAM,WAAW,CAAC,OAAO,cAAc,OAAO,eAAe,OAAO;AAEpE,MAAI,CAAC,OAAO;AAEV,WACE,CAAC,MAAM,QAAQ,YAAY,cAAc,QACtC,SACH,EAFC;AAAA,EAIL;AAEA,QAAM,CAAC,aAAa,kBAAkB,MAAM,SAAc,IAAI;AAE9D,4BAA0B,MAAM;AAxBlC;AAyBI,mBAAe,iBAAW,aAAX,mBAAqB,IAAI;AAAA,EAC1C,GAAG,CAAC,CAAC;AAEL,MAAI,aAAa;AACf,WAAO,aAAa,UAAU,WAAW;AAAA,EAC3C;AAGA,SAAO;AACT;",
6
+ "names": []
7
+ }
package/dist/jsx/index.js CHANGED
@@ -1 +1,2 @@
1
1
  export * from "./Portal";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.tsx"],
4
+ "sourcesContent": ["export * from './Portal'\n"],
5
+ "mappings": "AAAA;",
6
+ "names": []
7
+ }
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@tamagui/portal",
3
- "version": "1.0.0-beta.9",
4
- "sideEffects": true,
3
+ "version": "1.0.1-beta.100",
5
4
  "source": "src/index.ts",
6
- "typings": "types",
5
+ "types": "./types/index.d.ts",
7
6
  "main": "dist/cjs",
8
7
  "module": "dist/esm",
9
8
  "module:jsx": "dist/jsx",
10
9
  "files": [
10
+ "src",
11
11
  "types",
12
12
  "dist"
13
13
  ],
@@ -18,7 +18,7 @@
18
18
  "clean:build": "tamagui-build clean:build"
19
19
  },
20
20
  "dependencies": {
21
- "@tamagui/stacks": "^1.0.0-beta.9"
21
+ "@tamagui/stacks": "^1.0.1-beta.100"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "react": "*",
@@ -26,7 +26,7 @@
26
26
  "react-native": "*"
27
27
  },
28
28
  "devDependencies": {
29
- "@tamagui/build": "^1.0.0-beta.9",
29
+ "@tamagui/build": "^1.0.1-beta.100",
30
30
  "@types/react-native": "^0.67.3",
31
31
  "react": "*",
32
32
  "react-dom": "*",
package/src/Portal.tsx ADDED
@@ -0,0 +1,35 @@
1
+ import '@tamagui/polyfill-dev'
2
+
3
+ import { isWeb, useIsomorphicLayoutEffect } from '@tamagui/core'
4
+ import { YStack, YStackProps } from '@tamagui/stacks'
5
+ import * as React from 'react'
6
+ import { createPortal } from 'react-dom'
7
+ import { Modal } from 'react-native'
8
+
9
+ export type PortalProps = YStackProps
10
+
11
+ export const Portal = (props: PortalProps) => {
12
+ const contents = <YStack pointerEvents="none" fullscreen {...props} />
13
+
14
+ if (!isWeb) {
15
+ // check if theme stays in context here
16
+ return (
17
+ <Modal visible transparent pointerEvents="none">
18
+ {contents}
19
+ </Modal>
20
+ )
21
+ }
22
+
23
+ const [hostElement, setHostElement] = React.useState<any>(null)
24
+
25
+ useIsomorphicLayoutEffect(() => {
26
+ setHostElement(globalThis.document?.body)
27
+ }, [])
28
+
29
+ if (hostElement) {
30
+ return createPortal(contents, hostElement)
31
+ }
32
+
33
+ // ssr return null
34
+ return null
35
+ }
package/src/index.tsx ADDED
@@ -0,0 +1 @@
1
+ export * from './Portal'
package/types/Portal.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import '@tamagui/polyfill-dev';
3
3
  import { YStackProps } from '@tamagui/stacks';
4
- export declare const Portal: (props: YStackProps) => JSX.Element | null;
4
+ export declare type PortalProps = YStackProps;
5
+ export declare const Portal: (props: PortalProps) => JSX.Element | null;
5
6
  //# 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;AAG9B,OAAO,EAAU,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAMrD,eAAO,MAAM,MAAM,UAAW,WAAW,uBAgBxC,CAAA"}
1
+ {"version":3,"file":"Portal.d.ts","sourceRoot":"","sources":["../src/Portal.tsx"],"names":[],"mappings":";AAAA,OAAO,uBAAuB,CAAA;AAG9B,OAAO,EAAU,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAKrD,oBAAY,WAAW,GAAG,WAAW,CAAA;AAErC,eAAO,MAAM,MAAM,UAAW,WAAW,uBAwBxC,CAAA"}
package/types/index.d.ts CHANGED
File without changes
File without changes