@tamagui/portal 1.14.0 → 1.14.2
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/GorhomPortal.js +270 -1
- package/dist/cjs/GorhomPortal.js.map +2 -2
- package/dist/cjs/Portal.js +65 -1
- package/dist/cjs/Portal.js.map +2 -2
- package/dist/cjs/Portal.native.js +69 -1
- package/dist/cjs/Portal.native.js.map +2 -2
- package/dist/cjs/PortalProps.js +16 -1
- package/dist/cjs/PortalProps.js.map +2 -2
- package/dist/cjs/index.js +20 -1
- package/dist/cjs/index.js.map +2 -2
- package/dist/esm/GorhomPortal.js +241 -1
- package/dist/esm/GorhomPortal.js.map +2 -2
- package/dist/esm/GorhomPortal.mjs +241 -1
- package/dist/esm/GorhomPortal.mjs.map +2 -2
- package/dist/esm/Portal.js +31 -1
- package/dist/esm/Portal.js.map +2 -2
- package/dist/esm/Portal.mjs +31 -1
- package/dist/esm/Portal.mjs.map +2 -2
- package/dist/esm/Portal.native.js +35 -1
- package/dist/esm/Portal.native.js.map +2 -2
- package/dist/esm/Portal.native.mjs +35 -1
- package/dist/esm/Portal.native.mjs.map +2 -2
- package/dist/esm/index.js +3 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +3 -1
- package/dist/esm/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/esm/Portal.js
CHANGED
|
@@ -1,2 +1,32 @@
|
|
|
1
|
-
import{jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@tamagui/polyfill-dev";
|
|
3
|
+
import { isWeb, useIsomorphicLayoutEffect } from "@tamagui/core";
|
|
4
|
+
import { YStack } from "@tamagui/stacks";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { createPortal } from "react-dom";
|
|
7
|
+
const Portal = ({ host = ((_a) => (_a = globalThis.document) == null ? void 0 : _a.body)(), ...props }) => {
|
|
8
|
+
const contents = /* @__PURE__ */ jsx(
|
|
9
|
+
YStack,
|
|
10
|
+
{
|
|
11
|
+
contain: "strict",
|
|
12
|
+
fullscreen: true,
|
|
13
|
+
position: isWeb ? "fixed" : "absolute",
|
|
14
|
+
maxWidth: isWeb ? "100vw" : "100%",
|
|
15
|
+
maxHeight: isWeb ? "100vh" : "100%",
|
|
16
|
+
pointerEvents: "none",
|
|
17
|
+
...props
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
const [hostElement, setHostElement] = React.useState(null);
|
|
21
|
+
useIsomorphicLayoutEffect(() => {
|
|
22
|
+
setHostElement(host);
|
|
23
|
+
}, [host]);
|
|
24
|
+
if (hostElement) {
|
|
25
|
+
return createPortal(contents, hostElement);
|
|
26
|
+
}
|
|
27
|
+
return null;
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
Portal
|
|
31
|
+
};
|
|
2
32
|
//# sourceMappingURL=Portal.js.map
|
package/dist/esm/Portal.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Portal.tsx"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable react-hooks/rules-of-hooks */\nimport '@tamagui/polyfill-dev'\n\nimport { isWeb, useIsomorphicLayoutEffect } from '@tamagui/core'\nimport { YStack } from '@tamagui/stacks'\nimport * as React from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { PortalProps } from './PortalProps'\n\nexport const Portal = ({ host = globalThis.document?.body, ...props }: PortalProps) => {\n const contents = (\n <YStack\n contain=\"strict\"\n fullscreen\n // @ts-expect-error ok on web\n position={isWeb ? 'fixed' : 'absolute'}\n maxWidth={isWeb ? '100vw' : '100%'}\n maxHeight={isWeb ? '100vh' : '100%'}\n pointerEvents=\"none\"\n {...props}\n />\n )\n\n const [hostElement, setHostElement] = React.useState<any>(null)\n\n useIsomorphicLayoutEffect(() => {\n setHostElement(host)\n }, [host])\n\n if (hostElement) {\n return createPortal(contents, hostElement)\n }\n\n // ssr return null\n return null\n}\n"],
|
|
5
|
-
"mappings": "AAYI,
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAYI;AAXJ,OAAO;AAEP,SAAS,OAAO,iCAAiC;AACjD,SAAS,cAAc;AACvB,YAAY,WAAW;AACvB,SAAS,oBAAoB;AAItB,MAAM,SAAS,CAAC,EAAE,QAAO,yBAAW,aAAX,mBAAqB,SAAM,GAAG,MAAM,MAAmB;AACrF,QAAM,WACJ;AAAA,IAAC;AAAA;AAAA,MACC,SAAQ;AAAA,MACR,YAAU;AAAA,MAEV,UAAU,QAAQ,UAAU;AAAA,MAC5B,UAAU,QAAQ,UAAU;AAAA,MAC5B,WAAW,QAAQ,UAAU;AAAA,MAC7B,eAAc;AAAA,MACb,GAAG;AAAA;AAAA,EACN;AAGF,QAAM,CAAC,aAAa,cAAc,IAAI,MAAM,SAAc,IAAI;AAE9D,4BAA0B,MAAM;AAC9B,mBAAe,IAAI;AAAA,EACrB,GAAG,CAAC,IAAI,CAAC;AAET,MAAI,aAAa;AACf,WAAO,aAAa,UAAU,WAAW;AAAA,EAC3C;AAGA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
package/dist/esm/Portal.mjs
CHANGED
|
@@ -1,2 +1,32 @@
|
|
|
1
|
-
import{jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@tamagui/polyfill-dev";
|
|
3
|
+
import { isWeb, useIsomorphicLayoutEffect } from "@tamagui/core";
|
|
4
|
+
import { YStack } from "@tamagui/stacks";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { createPortal } from "react-dom";
|
|
7
|
+
const Portal = ({ host = ((_a) => (_a = globalThis.document) == null ? void 0 : _a.body)(), ...props }) => {
|
|
8
|
+
const contents = /* @__PURE__ */ jsx(
|
|
9
|
+
YStack,
|
|
10
|
+
{
|
|
11
|
+
contain: "strict",
|
|
12
|
+
fullscreen: true,
|
|
13
|
+
position: isWeb ? "fixed" : "absolute",
|
|
14
|
+
maxWidth: isWeb ? "100vw" : "100%",
|
|
15
|
+
maxHeight: isWeb ? "100vh" : "100%",
|
|
16
|
+
pointerEvents: "none",
|
|
17
|
+
...props
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
const [hostElement, setHostElement] = React.useState(null);
|
|
21
|
+
useIsomorphicLayoutEffect(() => {
|
|
22
|
+
setHostElement(host);
|
|
23
|
+
}, [host]);
|
|
24
|
+
if (hostElement) {
|
|
25
|
+
return createPortal(contents, hostElement);
|
|
26
|
+
}
|
|
27
|
+
return null;
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
Portal
|
|
31
|
+
};
|
|
2
32
|
//# sourceMappingURL=Portal.mjs.map
|
package/dist/esm/Portal.mjs.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Portal.tsx"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable react-hooks/rules-of-hooks */\nimport '@tamagui/polyfill-dev'\n\nimport { isWeb, useIsomorphicLayoutEffect } from '@tamagui/core'\nimport { YStack } from '@tamagui/stacks'\nimport * as React from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { PortalProps } from './PortalProps'\n\nexport const Portal = ({ host = globalThis.document?.body, ...props }: PortalProps) => {\n const contents = (\n <YStack\n contain=\"strict\"\n fullscreen\n // @ts-expect-error ok on web\n position={isWeb ? 'fixed' : 'absolute'}\n maxWidth={isWeb ? '100vw' : '100%'}\n maxHeight={isWeb ? '100vh' : '100%'}\n pointerEvents=\"none\"\n {...props}\n />\n )\n\n const [hostElement, setHostElement] = React.useState<any>(null)\n\n useIsomorphicLayoutEffect(() => {\n setHostElement(host)\n }, [host])\n\n if (hostElement) {\n return createPortal(contents, hostElement)\n }\n\n // ssr return null\n return null\n}\n"],
|
|
5
|
-
"mappings": "AAYI,
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAYI;AAXJ,OAAO;AAEP,SAAS,OAAO,iCAAiC;AACjD,SAAS,cAAc;AACvB,YAAY,WAAW;AACvB,SAAS,oBAAoB;AAItB,MAAM,SAAS,CAAC,EAAE,QAAO,yBAAW,aAAX,mBAAqB,SAAM,GAAG,MAAM,MAAmB;AACrF,QAAM,WACJ;AAAA,IAAC;AAAA;AAAA,MACC,SAAQ;AAAA,MACR,YAAU;AAAA,MAEV,UAAU,QAAQ,UAAU;AAAA,MAC5B,UAAU,QAAQ,UAAU;AAAA,MAC5B,WAAW,QAAQ,UAAU;AAAA,MAC7B,eAAc;AAAA,MACb,GAAG;AAAA;AAAA,EACN;AAGF,QAAM,CAAC,aAAa,cAAc,IAAI,MAAM,SAAc,IAAI;AAE9D,4BAA0B,MAAM;AAC9B,mBAAe,IAAI;AAAA,EACrB,GAAG,CAAC,IAAI,CAAC;AAET,MAAI,aAAa;AACf,WAAO,aAAa,UAAU,WAAW;AAAA,EAC3C;AAGA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,36 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { YStack } from "@tamagui/stacks";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Platform, RootTagContext } from "react-native";
|
|
5
|
+
import { createPortal } from "react-native/Libraries/Renderer/shims/ReactNative";
|
|
6
|
+
import { PortalItem } from "./GorhomPortal";
|
|
7
|
+
const Portal = (props) => {
|
|
8
|
+
const rootTag = React.useContext(RootTagContext);
|
|
9
|
+
const contents = /* @__PURE__ */ jsx(
|
|
10
|
+
YStack,
|
|
11
|
+
{
|
|
12
|
+
pointerEvents: "box-none",
|
|
13
|
+
fullscreen: true,
|
|
14
|
+
position: "absolute",
|
|
15
|
+
maxWidth: "100%",
|
|
16
|
+
zIndex: 1e5,
|
|
17
|
+
...props
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
if (Platform.OS === "android") {
|
|
21
|
+
return /* @__PURE__ */ jsx(PortalItem, { hostName: "root", children: contents });
|
|
22
|
+
}
|
|
23
|
+
if (rootTag) {
|
|
24
|
+
return createPortal(contents, rootTag);
|
|
25
|
+
}
|
|
26
|
+
if (process.env.NODE_ENV === "development") {
|
|
27
|
+
console.warn(
|
|
28
|
+
`Missing rootTag, this is a bug - you may need a different React Native version, or to avoid using "modal" on native.`
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
return null;
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
Portal
|
|
35
|
+
};
|
|
2
36
|
//# sourceMappingURL=Portal.native.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Portal.native.tsx"],
|
|
4
4
|
"sourcesContent": ["import { YStack } from '@tamagui/stacks'\nimport * as React from 'react'\n// @ts-ignore\nimport { Platform, RootTagContext } from 'react-native'\nimport { createPortal } from 'react-native/Libraries/Renderer/shims/ReactNative'\n\nimport { PortalItem } from './GorhomPortal'\nimport { PortalProps } from './PortalProps'\n\nexport const Portal = (props: PortalProps) => {\n const rootTag = React.useContext(RootTagContext)\n\n const contents = (\n <YStack\n pointerEvents=\"box-none\"\n fullscreen\n position=\"absolute\"\n maxWidth=\"100%\"\n zIndex={100000}\n {...props}\n />\n )\n\n if (Platform.OS === 'android') {\n return <PortalItem hostName=\"root\">{contents}</PortalItem>\n }\n\n if (rootTag) {\n return createPortal(contents, rootTag)\n }\n\n if (process.env.NODE_ENV === 'development') {\n // eslint-disable-next-line no-console\n console.warn(\n `Missing rootTag, this is a bug - you may need a different React Native version, or to avoid using \"modal\" on native.`\n )\n }\n\n return null\n}\n"],
|
|
5
|
-
"mappings": "AAaI,
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAaI;AAbJ,SAAS,cAAc;AACvB,YAAY,WAAW;AAEvB,SAAS,UAAU,sBAAsB;AACzC,SAAS,oBAAoB;AAE7B,SAAS,kBAAkB;AAGpB,MAAM,SAAS,CAAC,UAAuB;AAC5C,QAAM,UAAU,MAAM,WAAW,cAAc;AAE/C,QAAM,WACJ;AAAA,IAAC;AAAA;AAAA,MACC,eAAc;AAAA,MACd,YAAU;AAAA,MACV,UAAS;AAAA,MACT,UAAS;AAAA,MACT,QAAQ;AAAA,MACP,GAAG;AAAA;AAAA,EACN;AAGF,MAAI,SAAS,OAAO,WAAW;AAC7B,WAAO,oBAAC,cAAW,UAAS,QAAQ,oBAAS;AAAA,EAC/C;AAEA,MAAI,SAAS;AACX,WAAO,aAAa,UAAU,OAAO;AAAA,EACvC;AAEA,MAAI,QAAQ,IAAI,aAAa,eAAe;AAE1C,YAAQ;AAAA,MACN;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,36 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { YStack } from "@tamagui/stacks";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Platform, RootTagContext } from "react-native";
|
|
5
|
+
import { createPortal } from "react-native/Libraries/Renderer/shims/ReactNative";
|
|
6
|
+
import { PortalItem } from "./GorhomPortal";
|
|
7
|
+
const Portal = (props) => {
|
|
8
|
+
const rootTag = React.useContext(RootTagContext);
|
|
9
|
+
const contents = /* @__PURE__ */ jsx(
|
|
10
|
+
YStack,
|
|
11
|
+
{
|
|
12
|
+
pointerEvents: "box-none",
|
|
13
|
+
fullscreen: true,
|
|
14
|
+
position: "absolute",
|
|
15
|
+
maxWidth: "100%",
|
|
16
|
+
zIndex: 1e5,
|
|
17
|
+
...props
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
if (Platform.OS === "android") {
|
|
21
|
+
return /* @__PURE__ */ jsx(PortalItem, { hostName: "root", children: contents });
|
|
22
|
+
}
|
|
23
|
+
if (rootTag) {
|
|
24
|
+
return createPortal(contents, rootTag);
|
|
25
|
+
}
|
|
26
|
+
if (process.env.NODE_ENV === "development") {
|
|
27
|
+
console.warn(
|
|
28
|
+
`Missing rootTag, this is a bug - you may need a different React Native version, or to avoid using "modal" on native.`
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
return null;
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
Portal
|
|
35
|
+
};
|
|
2
36
|
//# sourceMappingURL=Portal.native.mjs.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Portal.native.tsx"],
|
|
4
4
|
"sourcesContent": ["import { YStack } from '@tamagui/stacks'\nimport * as React from 'react'\n// @ts-ignore\nimport { Platform, RootTagContext } from 'react-native'\nimport { createPortal } from 'react-native/Libraries/Renderer/shims/ReactNative'\n\nimport { PortalItem } from './GorhomPortal'\nimport { PortalProps } from './PortalProps'\n\nexport const Portal = (props: PortalProps) => {\n const rootTag = React.useContext(RootTagContext)\n\n const contents = (\n <YStack\n pointerEvents=\"box-none\"\n fullscreen\n position=\"absolute\"\n maxWidth=\"100%\"\n zIndex={100000}\n {...props}\n />\n )\n\n if (Platform.OS === 'android') {\n return <PortalItem hostName=\"root\">{contents}</PortalItem>\n }\n\n if (rootTag) {\n return createPortal(contents, rootTag)\n }\n\n if (process.env.NODE_ENV === 'development') {\n // eslint-disable-next-line no-console\n console.warn(\n `Missing rootTag, this is a bug - you may need a different React Native version, or to avoid using \"modal\" on native.`\n )\n }\n\n return null\n}\n"],
|
|
5
|
-
"mappings": "AAaI,
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAaI;AAbJ,SAAS,cAAc;AACvB,YAAY,WAAW;AAEvB,SAAS,UAAU,sBAAsB;AACzC,SAAS,oBAAoB;AAE7B,SAAS,kBAAkB;AAGpB,MAAM,SAAS,CAAC,UAAuB;AAC5C,QAAM,UAAU,MAAM,WAAW,cAAc;AAE/C,QAAM,WACJ;AAAA,IAAC;AAAA;AAAA,MACC,eAAc;AAAA,MACd,YAAU;AAAA,MACV,UAAS;AAAA,MACT,UAAS;AAAA,MACT,QAAQ;AAAA,MACP,GAAG;AAAA;AAAA,EACN;AAGF,MAAI,SAAS,OAAO,WAAW;AAC7B,WAAO,oBAAC,cAAW,UAAS,QAAQ,oBAAS;AAAA,EAC/C;AAEA,MAAI,SAAS;AACX,WAAO,aAAa,UAAU,OAAO;AAAA,EACvC;AAEA,MAAI,QAAQ,IAAI,aAAa,eAAe;AAE1C,YAAQ;AAAA,MACN;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
package/dist/esm/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.tsx"],
|
|
4
4
|
"sourcesContent": ["export * from './Portal'\nexport * from './PortalProps'\nexport * from './GorhomPortal'\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
5
|
+
"mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.mjs
CHANGED
package/dist/esm/index.mjs.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.tsx"],
|
|
4
4
|
"sourcesContent": ["export * from './Portal'\nexport * from './PortalProps'\nexport * from './GorhomPortal'\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
5
|
+
"mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/portal",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.2",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"types": "./types/index.d.ts",
|
|
6
6
|
"main": "dist/cjs",
|
|
@@ -27,16 +27,16 @@
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@tamagui/core": "1.14.
|
|
31
|
-
"@tamagui/stacks": "1.14.
|
|
32
|
-
"@tamagui/use-event": "1.14.
|
|
30
|
+
"@tamagui/core": "1.14.2",
|
|
31
|
+
"@tamagui/stacks": "1.14.2",
|
|
32
|
+
"@tamagui/use-event": "1.14.2"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"react": "*",
|
|
36
36
|
"react-native": "*"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@tamagui/build": "1.14.
|
|
39
|
+
"@tamagui/build": "1.14.2",
|
|
40
40
|
"react": "^18.2.0",
|
|
41
41
|
"react-native": "^0.71.4"
|
|
42
42
|
},
|