@tamagui/portal 1.0.1-beta.75 → 1.0.1-beta.78
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/esm/Portal.js +19 -4
- package/dist/esm/Portal.js.map +1 -1
- package/package.json +3 -3
package/dist/esm/Portal.js
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
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
|
+
};
|
|
1
17
|
import "@tamagui/polyfill-dev";
|
|
2
18
|
import { isWeb, useIsomorphicLayoutEffect } from "@tamagui/core";
|
|
3
19
|
import { YStack } from "@tamagui/stacks";
|
|
@@ -5,11 +21,10 @@ import * as React from "react";
|
|
|
5
21
|
import { createPortal } from "react-dom";
|
|
6
22
|
import { Modal } from "react-native";
|
|
7
23
|
const Portal = (props) => {
|
|
8
|
-
const contents = /* @__PURE__ */ React.createElement(YStack, {
|
|
24
|
+
const contents = /* @__PURE__ */ React.createElement(YStack, __spreadValues({
|
|
9
25
|
pointerEvents: "none",
|
|
10
|
-
fullscreen: true
|
|
11
|
-
|
|
12
|
-
});
|
|
26
|
+
fullscreen: true
|
|
27
|
+
}, props));
|
|
13
28
|
if (!isWeb) {
|
|
14
29
|
return /* @__PURE__ */ React.createElement(Modal, {
|
|
15
30
|
visible: true,
|
package/dist/esm/Portal.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Portal.tsx"],
|
|
4
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,
|
|
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
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/portal",
|
|
3
|
-
"version": "1.0.1-beta.
|
|
3
|
+
"version": "1.0.1-beta.78",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"types": "./types/index.d.ts",
|
|
6
6
|
"main": "dist/cjs",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"clean:build": "tamagui-build clean:build"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@tamagui/stacks": "^1.0.1-beta.
|
|
21
|
+
"@tamagui/stacks": "^1.0.1-beta.78"
|
|
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.1-beta.
|
|
29
|
+
"@tamagui/build": "^1.0.1-beta.78",
|
|
30
30
|
"@types/react-native": "^0.67.3",
|
|
31
31
|
"react": "*",
|
|
32
32
|
"react-dom": "*",
|