@fluentui/react-portal 9.0.1 → 9.0.2
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +28 -1
- package/CHANGELOG.md +13 -2
- package/dist/index.d.ts +0 -2
- package/lib/components/Portal/Portal.types.js.map +1 -1
- package/lib/components/Portal/renderPortal.js +1 -1
- package/lib/components/Portal/renderPortal.js.map +1 -1
- package/lib/components/Portal/usePortal.js +0 -2
- package/lib/components/Portal/usePortal.js.map +1 -1
- package/lib-commonjs/components/Portal/renderPortal.js +1 -1
- package/lib-commonjs/components/Portal/renderPortal.js.map +1 -1
- package/lib-commonjs/components/Portal/usePortal.js +0 -3
- package/lib-commonjs/components/Portal/usePortal.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.json
CHANGED
@@ -2,7 +2,34 @@
|
|
2
2
|
"name": "@fluentui/react-portal",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "
|
5
|
+
"date": "Thu, 14 Jul 2022 17:03:30 GMT",
|
6
|
+
"tag": "@fluentui/react-portal_v9.0.2",
|
7
|
+
"version": "9.0.2",
|
8
|
+
"comments": {
|
9
|
+
"patch": [
|
10
|
+
{
|
11
|
+
"author": "lingfangao@hotmail.com",
|
12
|
+
"package": "@fluentui/react-portal",
|
13
|
+
"commit": "6ff3fb3cfb5d81d3db822f675a4ab0fb8be9559a",
|
14
|
+
"comment": "fix: `Portal` does not use useIsSSR hook"
|
15
|
+
},
|
16
|
+
{
|
17
|
+
"author": "beachball",
|
18
|
+
"package": "@fluentui/react-portal",
|
19
|
+
"comment": "Bump @fluentui/react-tabster to v9.0.2",
|
20
|
+
"commit": "fd9308f35ec9b2c7f7fdbfce62f9a94ca00d6536"
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"author": "beachball",
|
24
|
+
"package": "@fluentui/react-portal",
|
25
|
+
"comment": "Bump @fluentui/react-utilities to v9.0.1-0",
|
26
|
+
"commit": "fd9308f35ec9b2c7f7fdbfce62f9a94ca00d6536"
|
27
|
+
}
|
28
|
+
]
|
29
|
+
}
|
30
|
+
},
|
31
|
+
{
|
32
|
+
"date": "Tue, 28 Jun 2022 17:39:50 GMT",
|
6
33
|
"tag": "@fluentui/react-portal_v9.0.1",
|
7
34
|
"version": "9.0.1",
|
8
35
|
"comments": {
|
package/CHANGELOG.md
CHANGED
@@ -1,12 +1,23 @@
|
|
1
1
|
# Change Log - @fluentui/react-portal
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Thu, 14 Jul 2022 17:03:30 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
+
## [9.0.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal_v9.0.2)
|
8
|
+
|
9
|
+
Thu, 14 Jul 2022 17:03:30 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-portal_v9.0.1..@fluentui/react-portal_v9.0.2)
|
11
|
+
|
12
|
+
### Patches
|
13
|
+
|
14
|
+
- fix: `Portal` does not use useIsSSR hook ([PR #23612](https://github.com/microsoft/fluentui/pull/23612) by lingfangao@hotmail.com)
|
15
|
+
- Bump @fluentui/react-tabster to v9.0.2 ([PR #23909](https://github.com/microsoft/fluentui/pull/23909) by beachball)
|
16
|
+
- Bump @fluentui/react-utilities to v9.0.1-0 ([PR #23909](https://github.com/microsoft/fluentui/pull/23909) by beachball)
|
17
|
+
|
7
18
|
## [9.0.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal_v9.0.1)
|
8
19
|
|
9
|
-
Tue, 28 Jun 2022 17:
|
20
|
+
Tue, 28 Jun 2022 17:39:50 GMT
|
10
21
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-portal_v9.0.0..@fluentui/react-portal_v9.0.1)
|
11
22
|
|
12
23
|
### Patches
|
package/dist/index.d.ts
CHANGED
@@ -28,8 +28,6 @@ export declare type PortalProps = {
|
|
28
28
|
};
|
29
29
|
|
30
30
|
export declare type PortalState = Pick<PortalProps, 'children'> & Required<Pick<PortalProps, 'mountNode'>> & {
|
31
|
-
/** Indicates if a Portal should be rendered. */
|
32
|
-
shouldRender: boolean;
|
33
31
|
/**
|
34
32
|
* Ref to the root span element as virtual parent
|
35
33
|
*/
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Portal.types.js","sourceRoot":"../src/","sources":["components/Portal/Portal.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\n\nexport type PortalProps = {\n /**\n * React children\n */\n children?: React.ReactNode;\n\n /**\n * Where the portal children are mounted on DOM\n *\n * @default a new element on document.body without any styling\n */\n mountNode?: HTMLElement | null;\n};\n\nexport type PortalState = Pick<PortalProps, 'children'> &\n Required<Pick<PortalProps, 'mountNode'>> & {\n
|
1
|
+
{"version":3,"file":"Portal.types.js","sourceRoot":"../src/","sources":["components/Portal/Portal.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\n\nexport type PortalProps = {\n /**\n * React children\n */\n children?: React.ReactNode;\n\n /**\n * Where the portal children are mounted on DOM\n *\n * @default a new element on document.body without any styling\n */\n mountNode?: HTMLElement | null;\n};\n\nexport type PortalState = Pick<PortalProps, 'children'> &\n Required<Pick<PortalProps, 'mountNode'>> & {\n /**\n * Ref to the root span element as virtual parent\n */\n virtualParentRootRef: React.MutableRefObject<HTMLSpanElement | null>;\n };\n"]}
|
@@ -8,6 +8,6 @@ export const renderPortal_unstable = state => {
|
|
8
8
|
return /*#__PURE__*/React.createElement("span", {
|
9
9
|
hidden: true,
|
10
10
|
ref: state.virtualParentRootRef
|
11
|
-
}, state.
|
11
|
+
}, state.mountNode && /*#__PURE__*/ReactDOM.createPortal(state.children, state.mountNode));
|
12
12
|
};
|
13
13
|
//# sourceMappingURL=renderPortal.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/Portal/renderPortal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAZ,MAA0B,WAA1B;AACA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAGA;;AAEG;;AACH,OAAO,MAAM,qBAAqB,GAAI,KAAD,IAA2C;EAC9E,oBACE,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA;IAAM,MAAM,EAAA,IAAZ;IAAa,GAAG,EAAE,KAAK,CAAC;EAAxB,CAAA,EACG,KAAK,CAAC,
|
1
|
+
{"version":3,"sources":["components/Portal/renderPortal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAZ,MAA0B,WAA1B;AACA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAGA;;AAEG;;AACH,OAAO,MAAM,qBAAqB,GAAI,KAAD,IAA2C;EAC9E,oBACE,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA;IAAM,MAAM,EAAA,IAAZ;IAAa,GAAG,EAAE,KAAK,CAAC;EAAxB,CAAA,EACG,KAAK,CAAC,SAAN,iBAAmB,QAAQ,CAAC,YAAT,CAAsB,KAAK,CAAC,QAA5B,EAAsC,KAAK,CAAC,SAA5C,CADtB,CADF;AAKD,CANM","sourcesContent":["import * as ReactDOM from 'react-dom';\nimport * as React from 'react';\nimport type { PortalState } from './Portal.types';\n\n/**\n * Render the final JSX of Portal\n */\nexport const renderPortal_unstable = (state: PortalState): React.ReactElement => {\n return (\n <span hidden ref={state.virtualParentRootRef}>\n {state.mountNode && ReactDOM.createPortal(state.children, state.mountNode)}\n </span>\n );\n};\n"],"sourceRoot":"../src/"}
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import { useIsSSR } from '@fluentui/react-utilities';
|
3
2
|
import { usePortalMountNode } from './usePortalMountNode';
|
4
3
|
import { setVirtualParent } from '../../virtualParent/index';
|
5
4
|
/**
|
@@ -22,7 +21,6 @@ export const usePortal_unstable = props => {
|
|
22
21
|
const state = {
|
23
22
|
children,
|
24
23
|
mountNode: mountNode !== null && mountNode !== void 0 ? mountNode : fallbackMountNode,
|
25
|
-
shouldRender: !useIsSSR(),
|
26
24
|
virtualParentRootRef
|
27
25
|
};
|
28
26
|
React.useEffect(() => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/Portal/usePortal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,
|
1
|
+
{"version":3,"sources":["components/Portal/usePortal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,kBAAT,QAAmC,sBAAnC;AACA,SAAS,gBAAT,QAAiC,2BAAjC;AAGA;;;;;;AAMG;;AACH,OAAO,MAAM,kBAAkB,GAAI,KAAD,IAAoC;EACpE,MAAM;IAAE,QAAF;IAAY;EAAZ,IAA0B,KAAhC;EAEA,MAAM,oBAAoB,GAAG,KAAK,CAAC,MAAN,CAA8B,IAA9B,CAA7B;EACA,MAAM,iBAAiB,GAAG,kBAAkB,CAAC;IAAE,QAAQ,EAAE,CAAC,CAAC;EAAd,CAAD,CAA5C;EAEA,MAAM,KAAK,GAAgB;IACzB,QADyB;IAEzB,SAAS,EAAE,SAAS,KAAA,IAAT,IAAA,SAAS,KAAA,KAAA,CAAT,GAAA,SAAA,GAAa,iBAFC;IAGzB;EAHyB,CAA3B;EAMA,KAAK,CAAC,SAAN,CAAgB,MAAK;IACnB,IAAI,KAAK,CAAC,oBAAN,CAA2B,OAA3B,IAAsC,KAAK,CAAC,SAAhD,EAA2D;MACzD,gBAAgB,CAAC,KAAK,CAAC,SAAP,EAAkB,KAAK,CAAC,oBAAN,CAA2B,OAA7C,CAAhB;IACD;EACF,CAJD,EAIG,CAAC,KAAK,CAAC,oBAAP,EAA6B,KAAK,CAAC,SAAnC,CAJH;EAMA,OAAO,KAAP;AACD,CAnBM","sourcesContent":["import * as React from 'react';\nimport { usePortalMountNode } from './usePortalMountNode';\nimport { setVirtualParent } from '../../virtualParent/index';\nimport type { PortalProps, PortalState } from './Portal.types';\n\n/**\n * Create the state required to render Portal.\n *\n * The returned state can be modified with hooks such as usePortalStyles, before being passed to renderPortal_unstable.\n *\n * @param props - props from this instance of Portal\n */\nexport const usePortal_unstable = (props: PortalProps): PortalState => {\n const { children, mountNode } = props;\n\n const virtualParentRootRef = React.useRef<HTMLSpanElement>(null);\n const fallbackMountNode = usePortalMountNode({ disabled: !!mountNode });\n\n const state: PortalState = {\n children,\n mountNode: mountNode ?? fallbackMountNode,\n virtualParentRootRef,\n };\n\n React.useEffect(() => {\n if (state.virtualParentRootRef.current && state.mountNode) {\n setVirtualParent(state.mountNode, state.virtualParentRootRef.current);\n }\n }, [state.virtualParentRootRef, state.mountNode]);\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
@@ -17,7 +17,7 @@ const renderPortal_unstable = state => {
|
|
17
17
|
return React.createElement("span", {
|
18
18
|
hidden: true,
|
19
19
|
ref: state.virtualParentRootRef
|
20
|
-
}, state.
|
20
|
+
}, state.mountNode && ReactDOM.createPortal(state.children, state.mountNode));
|
21
21
|
};
|
22
22
|
|
23
23
|
exports.renderPortal_unstable = renderPortal_unstable;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/Portal/renderPortal.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,QAAA,gBAAA,OAAA,CAAA,WAAA,CAAA;;AACA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,qBAAqB,GAAI,KAAD,IAA2C;EAC9E,OACE,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA;IAAM,MAAM,EAAA,IAAZ;IAAa,GAAG,EAAE,KAAK,CAAC;EAAxB,CAAA,EACG,KAAK,CAAC,
|
1
|
+
{"version":3,"sources":["components/Portal/renderPortal.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,QAAA,gBAAA,OAAA,CAAA,WAAA,CAAA;;AACA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,qBAAqB,GAAI,KAAD,IAA2C;EAC9E,OACE,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA;IAAM,MAAM,EAAA,IAAZ;IAAa,GAAG,EAAE,KAAK,CAAC;EAAxB,CAAA,EACG,KAAK,CAAC,SAAN,IAAmB,QAAQ,CAAC,YAAT,CAAsB,KAAK,CAAC,QAA5B,EAAsC,KAAK,CAAC,SAA5C,CADtB,CADF;AAKD,CANM;;AAAM,OAAA,CAAA,qBAAA,GAAqB,qBAArB","sourcesContent":["import * as ReactDOM from 'react-dom';\nimport * as React from 'react';\nimport type { PortalState } from './Portal.types';\n\n/**\n * Render the final JSX of Portal\n */\nexport const renderPortal_unstable = (state: PortalState): React.ReactElement => {\n return (\n <span hidden ref={state.virtualParentRootRef}>\n {state.mountNode && ReactDOM.createPortal(state.children, state.mountNode)}\n </span>\n );\n};\n"],"sourceRoot":"../src/"}
|
@@ -7,8 +7,6 @@ exports.usePortal_unstable = void 0;
|
|
7
7
|
|
8
8
|
const React = /*#__PURE__*/require("react");
|
9
9
|
|
10
|
-
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
11
|
-
|
12
10
|
const usePortalMountNode_1 = /*#__PURE__*/require("./usePortalMountNode");
|
13
11
|
|
14
12
|
const index_1 = /*#__PURE__*/require("../../virtualParent/index");
|
@@ -33,7 +31,6 @@ const usePortal_unstable = props => {
|
|
33
31
|
const state = {
|
34
32
|
children,
|
35
33
|
mountNode: mountNode !== null && mountNode !== void 0 ? mountNode : fallbackMountNode,
|
36
|
-
shouldRender: !react_utilities_1.useIsSSR(),
|
37
34
|
virtualParentRootRef
|
38
35
|
};
|
39
36
|
React.useEffect(() => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/Portal/usePortal.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,
|
1
|
+
{"version":3,"sources":["components/Portal/usePortal.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,oBAAA,gBAAA,OAAA,CAAA,sBAAA,CAAA;;AACA,MAAA,OAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;;;;;AAMG;;;AACI,MAAM,kBAAkB,GAAI,KAAD,IAAoC;EACpE,MAAM;IAAE,QAAF;IAAY;EAAZ,IAA0B,KAAhC;EAEA,MAAM,oBAAoB,GAAG,KAAK,CAAC,MAAN,CAA8B,IAA9B,CAA7B;EACA,MAAM,iBAAiB,GAAG,oBAAA,CAAA,kBAAA,CAAmB;IAAE,QAAQ,EAAE,CAAC,CAAC;EAAd,CAAnB,CAA1B;EAEA,MAAM,KAAK,GAAgB;IACzB,QADyB;IAEzB,SAAS,EAAE,SAAS,KAAA,IAAT,IAAA,SAAS,KAAA,KAAA,CAAT,GAAA,SAAA,GAAa,iBAFC;IAGzB;EAHyB,CAA3B;EAMA,KAAK,CAAC,SAAN,CAAgB,MAAK;IACnB,IAAI,KAAK,CAAC,oBAAN,CAA2B,OAA3B,IAAsC,KAAK,CAAC,SAAhD,EAA2D;MACzD,OAAA,CAAA,gBAAA,CAAiB,KAAK,CAAC,SAAvB,EAAkC,KAAK,CAAC,oBAAN,CAA2B,OAA7D;IACD;EACF,CAJD,EAIG,CAAC,KAAK,CAAC,oBAAP,EAA6B,KAAK,CAAC,SAAnC,CAJH;EAMA,OAAO,KAAP;AACD,CAnBM;;AAAM,OAAA,CAAA,kBAAA,GAAkB,kBAAlB","sourcesContent":["import * as React from 'react';\nimport { usePortalMountNode } from './usePortalMountNode';\nimport { setVirtualParent } from '../../virtualParent/index';\nimport type { PortalProps, PortalState } from './Portal.types';\n\n/**\n * Create the state required to render Portal.\n *\n * The returned state can be modified with hooks such as usePortalStyles, before being passed to renderPortal_unstable.\n *\n * @param props - props from this instance of Portal\n */\nexport const usePortal_unstable = (props: PortalProps): PortalState => {\n const { children, mountNode } = props;\n\n const virtualParentRootRef = React.useRef<HTMLSpanElement>(null);\n const fallbackMountNode = usePortalMountNode({ disabled: !!mountNode });\n\n const state: PortalState = {\n children,\n mountNode: mountNode ?? fallbackMountNode,\n virtualParentRootRef,\n };\n\n React.useEffect(() => {\n if (state.virtualParentRootRef.current && state.mountNode) {\n setVirtualParent(state.mountNode, state.virtualParentRootRef.current);\n }\n }, [state.virtualParentRootRef, state.mountNode]);\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-portal",
|
3
|
-
"version": "9.0.
|
3
|
+
"version": "9.0.2",
|
4
4
|
"description": "A utility component that creates portals compatible with Fluent UI",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -32,8 +32,8 @@
|
|
32
32
|
},
|
33
33
|
"dependencies": {
|
34
34
|
"@fluentui/react-shared-contexts": "^9.0.0",
|
35
|
-
"@fluentui/react-tabster": "^9.0.
|
36
|
-
"@fluentui/react-utilities": "^9.0.0",
|
35
|
+
"@fluentui/react-tabster": "^9.0.2",
|
36
|
+
"@fluentui/react-utilities": "^9.0.1-0",
|
37
37
|
"@griffel/react": "^1.2.0",
|
38
38
|
"tslib": "^2.1.0"
|
39
39
|
},
|