@tamagui/portal 1.0.1-beta.130 → 1.0.1-beta.133
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/Portal.native.js +3 -9
- package/dist/cjs/Portal.native.js.map +2 -2
- package/dist/esm/Portal.native.js +4 -10
- package/dist/esm/Portal.native.js.map +2 -2
- package/dist/jsx/Portal.native.js +5 -10
- package/dist/jsx/Portal.native.js.map +2 -2
- package/package.json +4 -4
- package/src/Portal.native.tsx +6 -10
- package/types/GorhomPortal.d.ts +1 -1
|
@@ -28,14 +28,8 @@ var import_stacks = require("@tamagui/stacks");
|
|
|
28
28
|
var React = __toESM(require("react"));
|
|
29
29
|
var import_react_native = require("react-native");
|
|
30
30
|
var import_ReactNative = require("react-native/Libraries/Renderer/shims/ReactNative");
|
|
31
|
-
let root = 0;
|
|
32
|
-
const og = import_react_native.AppRegistry.runApplication.bind(import_react_native.AppRegistry);
|
|
33
|
-
import_react_native.AppRegistry.runApplication = function(...args) {
|
|
34
|
-
var _a;
|
|
35
|
-
root = (_a = args[1]) == null ? void 0 : _a.rootTag;
|
|
36
|
-
return og(...args);
|
|
37
|
-
};
|
|
38
31
|
const Portal = (props) => {
|
|
32
|
+
const rootTag = React.useContext(import_react_native.RootTagContext);
|
|
39
33
|
const contents = /* @__PURE__ */ React.createElement(import_stacks.YStack, {
|
|
40
34
|
pointerEvents: "box-none",
|
|
41
35
|
fullscreen: true,
|
|
@@ -44,8 +38,8 @@ const Portal = (props) => {
|
|
|
44
38
|
zIndex: 1e5,
|
|
45
39
|
...props
|
|
46
40
|
});
|
|
47
|
-
if (
|
|
48
|
-
return (0, import_ReactNative.createPortal)(contents,
|
|
41
|
+
if (rootTag) {
|
|
42
|
+
return (0, import_ReactNative.createPortal)(contents, rootTag);
|
|
49
43
|
}
|
|
50
44
|
return null;
|
|
51
45
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Portal.native.tsx"],
|
|
4
|
-
"sourcesContent": ["import { YStack, YStackProps } from '@tamagui/stacks'\nimport * as React from 'react'\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAoC;AACpC,YAAuB;
|
|
4
|
+
"sourcesContent": ["import { YStack, YStackProps } from '@tamagui/stacks'\nimport * as React from 'react'\n// @ts-ignore\nimport { RootTagContext } from 'react-native'\nimport { createPortal } from 'react-native/Libraries/Renderer/shims/ReactNative'\n\nexport type PortalProps = YStackProps\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 (rootTag) {\n return createPortal(contents, rootTag)\n }\n\n return null\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAoC;AACpC,YAAuB;AAEvB,0BAA+B;AAC/B,yBAA6B;AAItB,MAAM,SAAS,CAAC,UAAuB;AAC5C,QAAM,UAAU,MAAM,WAAW,kCAAc;AAE/C,QAAM,WACJ,oCAAC;AAAA,IACC,eAAc;AAAA,IACd,YAAU;AAAA,IACV,UAAS;AAAA,IACT,UAAS;AAAA,IACT,QAAQ;AAAA,IACP,GAAG;AAAA,GACN;AAGF,MAAI,SAAS;AACX,WAAO,qCAAa,UAAU,OAAO;AAAA,EACvC;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
import { YStack } from "@tamagui/stacks";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { RootTagContext } from "react-native";
|
|
4
4
|
import { createPortal } from "react-native/Libraries/Renderer/shims/ReactNative";
|
|
5
|
-
let root = 0;
|
|
6
|
-
const og = AppRegistry.runApplication.bind(AppRegistry);
|
|
7
|
-
AppRegistry.runApplication = function(...args) {
|
|
8
|
-
var _a;
|
|
9
|
-
root = (_a = args[1]) == null ? void 0 : _a.rootTag;
|
|
10
|
-
return og(...args);
|
|
11
|
-
};
|
|
12
5
|
const Portal = (props) => {
|
|
6
|
+
const rootTag = React.useContext(RootTagContext);
|
|
13
7
|
const contents = /* @__PURE__ */ React.createElement(YStack, {
|
|
14
8
|
pointerEvents: "box-none",
|
|
15
9
|
fullscreen: true,
|
|
@@ -18,8 +12,8 @@ const Portal = (props) => {
|
|
|
18
12
|
zIndex: 1e5,
|
|
19
13
|
...props
|
|
20
14
|
});
|
|
21
|
-
if (
|
|
22
|
-
return createPortal(contents,
|
|
15
|
+
if (rootTag) {
|
|
16
|
+
return createPortal(contents, rootTag);
|
|
23
17
|
}
|
|
24
18
|
return null;
|
|
25
19
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Portal.native.tsx"],
|
|
4
|
-
"sourcesContent": ["import { YStack, YStackProps } from '@tamagui/stacks'\nimport * as React from 'react'\nimport {
|
|
5
|
-
"mappings": "AAAA;AACA;
|
|
4
|
+
"sourcesContent": ["import { YStack, YStackProps } from '@tamagui/stacks'\nimport * as React from 'react'\n// @ts-ignore\nimport { RootTagContext } from 'react-native'\nimport { createPortal } from 'react-native/Libraries/Renderer/shims/ReactNative'\n\nexport type PortalProps = YStackProps\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 (rootTag) {\n return createPortal(contents, rootTag)\n }\n\n return null\n}\n"],
|
|
5
|
+
"mappings": "AAAA;AACA;AAEA;AACA;AAIO,MAAM,SAAS,CAAC,UAAuB;AAC5C,QAAM,UAAU,MAAM,WAAW,cAAc;AAE/C,QAAM,WACJ,oCAAC;AAAA,IACC,eAAc;AAAA,IACd,YAAU;AAAA,IACV,UAAS;AAAA,IACT,UAAS;AAAA,IACT,QAAQ;AAAA,IACP,GAAG;AAAA,GACN;AAGF,MAAI,SAAS;AACX,WAAO,aAAa,UAAU,OAAO;AAAA,EACvC;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
import { YStack } from "@tamagui/stacks";
|
|
2
|
-
import
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { RootTagContext } from "react-native";
|
|
3
4
|
import { createPortal } from "react-native/Libraries/Renderer/shims/ReactNative";
|
|
4
|
-
let root = 0;
|
|
5
|
-
const og = AppRegistry.runApplication.bind(AppRegistry);
|
|
6
|
-
AppRegistry.runApplication = function(...args) {
|
|
7
|
-
var _a;
|
|
8
|
-
root = (_a = args[1]) == null ? void 0 : _a.rootTag;
|
|
9
|
-
return og(...args);
|
|
10
|
-
};
|
|
11
5
|
const Portal = (props) => {
|
|
6
|
+
const rootTag = React.useContext(RootTagContext);
|
|
12
7
|
const contents = <YStack pointerEvents="box-none" fullscreen position="absolute" maxWidth="100%" zIndex={1e5} {...props} />;
|
|
13
|
-
if (
|
|
14
|
-
return createPortal(contents,
|
|
8
|
+
if (rootTag) {
|
|
9
|
+
return createPortal(contents, rootTag);
|
|
15
10
|
}
|
|
16
11
|
return null;
|
|
17
12
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Portal.native.tsx"],
|
|
4
|
-
"sourcesContent": ["import { YStack, YStackProps } from '@tamagui/stacks'\nimport * as React from 'react'\nimport {
|
|
5
|
-
"mappings": "AAAA;AAEA;AACA;
|
|
4
|
+
"sourcesContent": ["import { YStack, YStackProps } from '@tamagui/stacks'\nimport * as React from 'react'\n// @ts-ignore\nimport { RootTagContext } from 'react-native'\nimport { createPortal } from 'react-native/Libraries/Renderer/shims/ReactNative'\n\nexport type PortalProps = YStackProps\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 (rootTag) {\n return createPortal(contents, rootTag)\n }\n\n return null\n}\n"],
|
|
5
|
+
"mappings": "AAAA;AACA;AAEA;AACA;AAIO,MAAM,SAAS,CAAC,UAAuB;AAC5C,QAAM,UAAU,MAAM,WAAW,cAAc;AAE/C,QAAM,WACJ,CAAC,OACC,cAAc,WACd,WACA,SAAS,WACT,SAAS,OACT,QAAQ,SACJ,OACN;AAGF,MAAI,SAAS;AACX,WAAO,aAAa,UAAU,OAAO;AAAA,EACvC;AAEA,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.133",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"types": "./types/index.d.ts",
|
|
6
6
|
"main": "dist/cjs",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"clean:build": "tamagui-build clean:build"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@tamagui/core": "^1.0.1-beta.
|
|
22
|
-
"@tamagui/stacks": "^1.0.1-beta.
|
|
21
|
+
"@tamagui/core": "^1.0.1-beta.133",
|
|
22
|
+
"@tamagui/stacks": "^1.0.1-beta.133"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"react": "*",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"react-native": "*"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@tamagui/build": "^1.0.1-beta.
|
|
30
|
+
"@tamagui/build": "^1.0.1-beta.133",
|
|
31
31
|
"@types/react-native": "^0.69.2",
|
|
32
32
|
"react": "*",
|
|
33
33
|
"react-dom": "*",
|
package/src/Portal.native.tsx
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import { YStack, YStackProps } from '@tamagui/stacks'
|
|
2
2
|
import * as React from 'react'
|
|
3
|
-
|
|
3
|
+
// @ts-ignore
|
|
4
|
+
import { RootTagContext } from 'react-native'
|
|
4
5
|
import { createPortal } from 'react-native/Libraries/Renderer/shims/ReactNative'
|
|
5
6
|
|
|
6
7
|
export type PortalProps = YStackProps
|
|
7
8
|
|
|
8
|
-
let root = 0
|
|
9
|
-
const og = AppRegistry.runApplication.bind(AppRegistry)
|
|
10
|
-
AppRegistry.runApplication = function (...args) {
|
|
11
|
-
root = args[1]?.rootTag
|
|
12
|
-
return og(...args)
|
|
13
|
-
}
|
|
14
|
-
|
|
15
9
|
export const Portal = (props: PortalProps) => {
|
|
10
|
+
const rootTag = React.useContext(RootTagContext)
|
|
11
|
+
|
|
16
12
|
const contents = (
|
|
17
13
|
<YStack
|
|
18
14
|
pointerEvents="box-none"
|
|
@@ -24,8 +20,8 @@ export const Portal = (props: PortalProps) => {
|
|
|
24
20
|
/>
|
|
25
21
|
)
|
|
26
22
|
|
|
27
|
-
if (
|
|
28
|
-
return createPortal(contents,
|
|
23
|
+
if (rootTag) {
|
|
24
|
+
return createPortal(contents, rootTag)
|
|
29
25
|
}
|
|
30
26
|
|
|
31
27
|
return null
|
package/types/GorhomPortal.d.ts
CHANGED
|
@@ -53,5 +53,5 @@ export interface PortalItemProps {
|
|
|
53
53
|
handleOnUpdate?: (update: () => void) => void;
|
|
54
54
|
children?: ReactNode | ReactNode[];
|
|
55
55
|
}
|
|
56
|
-
export declare const PortalItem: React.MemoExoticComponent<({ name
|
|
56
|
+
export declare const PortalItem: React.MemoExoticComponent<({ name, hostName, handleOnMount, handleOnUnmount, handleOnUpdate, children, }: PortalItemProps) => null>;
|
|
57
57
|
//# sourceMappingURL=GorhomPortal.d.ts.map
|