@fluentui/react-portal 0.0.0-nightly-20230103-0425.1 → 0.0.0-nightly-20230105-0425.1

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/CHANGELOG.json CHANGED
@@ -2,9 +2,9 @@
2
2
  "name": "@fluentui/react-portal",
3
3
  "entries": [
4
4
  {
5
- "date": "Tue, 03 Jan 2023 04:32:29 GMT",
6
- "tag": "@fluentui/react-portal_v0.0.0-nightly-20230103-0425.1",
7
- "version": "0.0.0-nightly-20230103-0425.1",
5
+ "date": "Thu, 05 Jan 2023 04:32:39 GMT",
6
+ "tag": "@fluentui/react-portal_v0.0.0-nightly-20230105-0425.1",
7
+ "version": "0.0.0-nightly-20230105-0425.1",
8
8
  "comments": {
9
9
  "prerelease": [
10
10
  {
@@ -16,20 +16,67 @@
16
16
  {
17
17
  "author": "beachball",
18
18
  "package": "@fluentui/react-portal",
19
- "comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230103-0425.1",
20
- "commit": "d7e1f6c30ae21edb31e3e6ca9662e31576f625bb"
19
+ "comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230105-0425.1",
20
+ "commit": "9505130bff7ee9348792ea30d4f770e8fd21f336"
21
21
  },
22
22
  {
23
23
  "author": "beachball",
24
24
  "package": "@fluentui/react-portal",
25
- "comment": "Bump @fluentui/react-tabster to v0.0.0-nightly-20230103-0425.1",
26
- "commit": "d7e1f6c30ae21edb31e3e6ca9662e31576f625bb"
25
+ "comment": "Bump @fluentui/react-tabster to v0.0.0-nightly-20230105-0425.1",
26
+ "commit": "9505130bff7ee9348792ea30d4f770e8fd21f336"
27
27
  },
28
28
  {
29
29
  "author": "beachball",
30
30
  "package": "@fluentui/react-portal",
31
- "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20230103-0425.1",
32
- "commit": "d7e1f6c30ae21edb31e3e6ca9662e31576f625bb"
31
+ "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20230105-0425.1",
32
+ "commit": "9505130bff7ee9348792ea30d4f770e8fd21f336"
33
+ }
34
+ ]
35
+ }
36
+ },
37
+ {
38
+ "date": "Wed, 04 Jan 2023 01:40:17 GMT",
39
+ "tag": "@fluentui/react-portal_v9.0.15",
40
+ "version": "9.0.15",
41
+ "comments": {
42
+ "none": [
43
+ {
44
+ "author": "martinhochel@microsoft.com",
45
+ "package": "@fluentui/react-portal",
46
+ "commit": "194b0cf0cc27c1c1233aa945f09b3ad29778d8ca",
47
+ "comment": "chore(scripts): use for @fluentui/scripts version within all package.json"
48
+ },
49
+ {
50
+ "author": "martinhochel@microsoft.com",
51
+ "package": "@fluentui/react-portal",
52
+ "commit": "4ec2b998b294d6d9c3196d3d82893bdd97d0c105",
53
+ "comment": "chore(scripts): move index.ts to to follow sub-folder domain packaging"
54
+ }
55
+ ],
56
+ "patch": [
57
+ {
58
+ "author": "lingfangao@hotmail.com",
59
+ "package": "@fluentui/react-portal",
60
+ "commit": "7cfaf78c93f1408c633c612939bf1a1305d7fc76",
61
+ "comment": "fix: Portals should render correctly in strict mode"
62
+ },
63
+ {
64
+ "author": "olfedias@microsoft.com",
65
+ "package": "@fluentui/react-portal",
66
+ "commit": "2c38f1e4ae07b2b60df596efe11015a68f166dbf",
67
+ "comment": "chore: Update Griffel to latest version"
68
+ },
69
+ {
70
+ "author": "beachball",
71
+ "package": "@fluentui/react-portal",
72
+ "comment": "Bump @fluentui/react-tabster to v9.3.5",
73
+ "commit": "3e322d15529451be153e97298873253e21af4082"
74
+ },
75
+ {
76
+ "author": "beachball",
77
+ "package": "@fluentui/react-portal",
78
+ "comment": "Bump @fluentui/react-utilities to v9.3.1",
79
+ "commit": "3e322d15529451be153e97298873253e21af4082"
33
80
  }
34
81
  ]
35
82
  }
package/CHANGELOG.md CHANGED
@@ -1,20 +1,32 @@
1
1
  # Change Log - @fluentui/react-portal
2
2
 
3
- This log was last generated on Tue, 03 Jan 2023 04:32:29 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 05 Jan 2023 04:32:39 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [0.0.0-nightly-20230103-0425.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal_v0.0.0-nightly-20230103-0425.1)
7
+ ## [0.0.0-nightly-20230105-0425.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal_v0.0.0-nightly-20230105-0425.1)
8
8
 
9
- Tue, 03 Jan 2023 04:32:29 GMT
10
- [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-portal_v9.0.14..@fluentui/react-portal_v0.0.0-nightly-20230103-0425.1)
9
+ Thu, 05 Jan 2023 04:32:39 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-portal_v9.0.15..@fluentui/react-portal_v0.0.0-nightly-20230105-0425.1)
11
11
 
12
12
  ### Changes
13
13
 
14
14
  - Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
15
- - Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230103-0425.1 ([commit](https://github.com/microsoft/fluentui/commit/d7e1f6c30ae21edb31e3e6ca9662e31576f625bb) by beachball)
16
- - Bump @fluentui/react-tabster to v0.0.0-nightly-20230103-0425.1 ([commit](https://github.com/microsoft/fluentui/commit/d7e1f6c30ae21edb31e3e6ca9662e31576f625bb) by beachball)
17
- - Bump @fluentui/react-utilities to v0.0.0-nightly-20230103-0425.1 ([commit](https://github.com/microsoft/fluentui/commit/d7e1f6c30ae21edb31e3e6ca9662e31576f625bb) by beachball)
15
+ - Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230105-0425.1 ([commit](https://github.com/microsoft/fluentui/commit/9505130bff7ee9348792ea30d4f770e8fd21f336) by beachball)
16
+ - Bump @fluentui/react-tabster to v0.0.0-nightly-20230105-0425.1 ([commit](https://github.com/microsoft/fluentui/commit/9505130bff7ee9348792ea30d4f770e8fd21f336) by beachball)
17
+ - Bump @fluentui/react-utilities to v0.0.0-nightly-20230105-0425.1 ([commit](https://github.com/microsoft/fluentui/commit/9505130bff7ee9348792ea30d4f770e8fd21f336) by beachball)
18
+
19
+ ## [9.0.15](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal_v9.0.15)
20
+
21
+ Wed, 04 Jan 2023 01:40:17 GMT
22
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-portal_v9.0.14..@fluentui/react-portal_v9.0.15)
23
+
24
+ ### Patches
25
+
26
+ - fix: Portals should render correctly in strict mode ([PR #25956](https://github.com/microsoft/fluentui/pull/25956) by lingfangao@hotmail.com)
27
+ - chore: Update Griffel to latest version ([PR #26045](https://github.com/microsoft/fluentui/pull/26045) by olfedias@microsoft.com)
28
+ - Bump @fluentui/react-tabster to v9.3.5 ([PR #26114](https://github.com/microsoft/fluentui/pull/26114) by beachball)
29
+ - Bump @fluentui/react-utilities to v9.3.1 ([PR #26114](https://github.com/microsoft/fluentui/pull/26114) by beachball)
18
30
 
19
31
  ## [9.0.14](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal_v9.0.14)
20
32
 
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@ import * as React_2 from 'react';
6
6
  *
7
7
  * @returns true if the child can find the parent in its virtual hierarchy
8
8
  */
9
- export declare function elementContains(parent: HTMLElement | null, child: HTMLElement | null): boolean;
9
+ export declare function elementContains(parent: Node | null, child: Node | null): boolean;
10
10
 
11
11
  /**
12
12
  * A portal provides a way to render children into a DOM node
@@ -45,7 +45,7 @@ export declare const renderPortal_unstable: (state: PortalState) => React_2.Reac
45
45
  * @param child - Theme element to set the virtual parent
46
46
  * @param parent - The virtual parent, use `undefined` to remove a virtual parent relationship
47
47
  */
48
- export declare function setVirtualParent(child: HTMLElement, parent?: HTMLElement): void;
48
+ export declare function setVirtualParent(child: Node, parent?: Node): void;
49
49
 
50
50
  /**
51
51
  * Create the state required to render Portal.
@@ -7,12 +7,12 @@ import { useIsomorphicLayoutEffect } from '@fluentui/react-utilities';
7
7
  // String concatenation is used to prevent bundlers to complain with older versions of React
8
8
  const useInsertionEffect = React['useInsertion' + 'Effect'] ? React['useInsertion' + 'Effect'] : useIsomorphicLayoutEffect;
9
9
  const useStyles = /*#__PURE__*/__styles({
10
- "root": {
11
- "qhf8xq": "f10pi13n",
12
- "Bj3rh1h": "f494woh"
10
+ root: {
11
+ qhf8xq: "f10pi13n",
12
+ Bj3rh1h: "f494woh"
13
13
  }
14
14
  }, {
15
- "d": [".f10pi13n{position:relative;}", ".f494woh{z-index:1000000;}"]
15
+ d: [".f10pi13n{position:relative;}", ".f494woh{z-index:1000000;}"]
16
16
  });
17
17
  /**
18
18
  * Creates a new element on a document.body to mount portals
@@ -1 +1 @@
1
- {"version":3,"mappings":"AAAA,SAASA,SAAS,QAAQ,aAAa;AACvC;;;;;;AAMA,OAAM,SAAUC,eAAe,CAACC,MAA0B,EAAEC,KAAyB;EACnF,IAAI,CAACD,MAAM,IAAI,CAACC,KAAK,EAAE;IACrB,OAAO,KAAK;;EAGd,IAAID,MAAM,KAAKC,KAAK,EAAE;IACpB,OAAO,IAAI;GACZ,MAAM;IACL,OAAOA,KAAK,EAAE;MACZ,MAAMC,UAAU,GAAuBJ,SAAS,CAACG,KAAK,CAAC;MAEvD,IAAIC,UAAU,KAAKF,MAAM,EAAE;QACzB,OAAO,IAAI;;MAGbC,KAAK,GAAGC,UAAU;;;EAItB,OAAO,KAAK;AACd","names":["getParent","elementContains","parent","child","nextParent"],"sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-portal/src/virtualParent/elementContains.ts"],"sourcesContent":["import { getParent } from './getParent';\n/**\n * Similar functionality to `element.contains` DOM API for use with out of order DOM elements that\n * checks the virtual parent hierarchy. If a virtual parents exists, it is chosen over the actual parent\n *\n * @returns true if the child can find the parent in its virtual hierarchy\n */\nexport function elementContains(parent: HTMLElement | null, child: HTMLElement | null): boolean {\n if (!parent || !child) {\n return false;\n }\n\n if (parent === child) {\n return true;\n } else {\n while (child) {\n const nextParent: HTMLElement | null = getParent(child);\n\n if (nextParent === parent) {\n return true;\n }\n\n child = nextParent;\n }\n }\n\n return false;\n}\n"]}
1
+ {"version":3,"mappings":"AAAA,SAASA,SAAS,QAAQ,aAAa;AACvC;;;;;;AAMA,OAAM,SAAUC,eAAe,CAACC,MAAmB,EAAEC,KAAkB;EACrE,IAAI,CAACD,MAAM,IAAI,CAACC,KAAK,EAAE;IACrB,OAAO,KAAK;;EAGd,IAAID,MAAM,KAAKC,KAAK,EAAE;IACpB,OAAO,IAAI;GACZ,MAAM;IACL,OAAOA,KAAK,EAAE;MACZ,MAAMC,UAAU,GAAGJ,SAAS,CAACG,KAAK,CAAC;MAEnC,IAAIC,UAAU,KAAKF,MAAM,EAAE;QACzB,OAAO,IAAI;;MAGbC,KAAK,GAAGC,UAAU;;;EAItB,OAAO,KAAK;AACd","names":["getParent","elementContains","parent","child","nextParent"],"sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-portal/src/virtualParent/elementContains.ts"],"sourcesContent":["import { getParent } from './getParent';\n/**\n * Similar functionality to `element.contains` DOM API for use with out of order DOM elements that\n * checks the virtual parent hierarchy. If a virtual parents exists, it is chosen over the actual parent\n *\n * @returns true if the child can find the parent in its virtual hierarchy\n */\nexport function elementContains(parent: Node | null, child: Node | null): boolean {\n if (!parent || !child) {\n return false;\n }\n\n if (parent === child) {\n return true;\n } else {\n while (child) {\n const nextParent = getParent(child);\n\n if (nextParent === parent) {\n return true;\n }\n\n child = nextParent;\n }\n }\n\n return false;\n}\n"]}
@@ -4,6 +4,7 @@ import { getVirtualParent } from './getVirtualParent';
4
4
  * This method prefers the virtual parent over real DOM parent when present.
5
5
  */
6
6
  export function getParent(child) {
7
- return child && getVirtualParent(child) || (child === null || child === void 0 ? void 0 : child.parentNode);
7
+ var _a;
8
+ return (_a = child && getVirtualParent(child) || (child === null || child === void 0 ? void 0 : child.parentNode)) !== null && _a !== void 0 ? _a : null;
8
9
  }
9
10
  //# sourceMappingURL=getParent.js.map
@@ -1 +1 @@
1
- {"version":3,"mappings":"AAAA,SAASA,gBAAgB,QAAQ,oBAAoB;AAErD;;;;AAIA,OAAM,SAAUC,SAAS,CAACC,KAAyB;EACjD,OAAQA,KAAK,IAAIF,gBAAgB,CAACE,KAAK,CAAC,KAAMA,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEC,UAAiC;AACxF","names":["getVirtualParent","getParent","child","parentNode"],"sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-portal/src/virtualParent/getParent.ts"],"sourcesContent":["import { getVirtualParent } from './getVirtualParent';\n\n/**\n * Gets the element which is the parent of a given element.\n * This method prefers the virtual parent over real DOM parent when present.\n */\nexport function getParent(child: HTMLElement | null): HTMLElement | null {\n return (child && getVirtualParent(child)) || (child?.parentNode as HTMLElement | null);\n}\n"]}
1
+ {"version":3,"mappings":"AAAA,SAASA,gBAAgB,QAAQ,oBAAoB;AAErD;;;;AAIA,OAAM,SAAUC,SAAS,CAACC,KAAkB;;EAC1C,OAAO,MAAEA,KAAK,IAAIF,gBAAgB,CAACE,KAAK,CAAC,KAAKA,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEC,UAAU,CAAC,mCAAI,IAAI;AAC1E","names":["getVirtualParent","getParent","child","parentNode"],"sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-portal/src/virtualParent/getParent.ts"],"sourcesContent":["import { getVirtualParent } from './getVirtualParent';\n\n/**\n * Gets the element which is the parent of a given element.\n * This method prefers the virtual parent over real DOM parent when present.\n */\nexport function getParent(child: Node | null): Node | null {\n return ((child && getVirtualParent(child)) || child?.parentNode) ?? null;\n}\n"]}
@@ -3,10 +3,6 @@ import { isVirtualElement } from './isVirtualElement';
3
3
  * Gets the virtual parent given the child element, if it exists.
4
4
  */
5
5
  export function getVirtualParent(child) {
6
- let parent;
7
- if (isVirtualElement(child)) {
8
- parent = child._virtual.parent;
9
- }
10
- return parent;
6
+ return isVirtualElement(child) ? child._virtual.parent : undefined;
11
7
  }
12
8
  //# sourceMappingURL=getVirtualParent.js.map
@@ -1 +1 @@
1
- {"version":3,"mappings":"AAAA,SAASA,gBAAgB,QAAQ,oBAAoB;AACrD;;;AAGA,OAAM,SAAUC,gBAAgB,CAACC,KAAkB;EACjD,IAAIC,MAA+B;EACnC,IAAIH,gBAAgB,CAACE,KAAK,CAAC,EAAE;IAC3BC,MAAM,GAAGD,KAAK,CAACE,QAAQ,CAACD,MAAM;;EAEhC,OAAOA,MAAM;AACf","names":["isVirtualElement","getVirtualParent","child","parent","_virtual"],"sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-portal/src/virtualParent/getVirtualParent.ts"],"sourcesContent":["import { isVirtualElement } from './isVirtualElement';\n/**\n * Gets the virtual parent given the child element, if it exists.\n */\nexport function getVirtualParent(child: HTMLElement): HTMLElement | undefined {\n let parent: HTMLElement | undefined;\n if (isVirtualElement(child)) {\n parent = child._virtual.parent;\n }\n return parent;\n}\n"]}
1
+ {"version":3,"mappings":"AAAA,SAASA,gBAAgB,QAAQ,oBAAoB;AACrD;;;AAGA,OAAM,SAAUC,gBAAgB,CAACC,KAAW;EAC1C,OAAOF,gBAAgB,CAACE,KAAK,CAAC,GAAGA,KAAK,CAACC,QAAQ,CAACC,MAAM,GAAGC,SAAS;AACpE","names":["isVirtualElement","getVirtualParent","child","_virtual","parent","undefined"],"sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-portal/src/virtualParent/getVirtualParent.ts"],"sourcesContent":["import { isVirtualElement } from './isVirtualElement';\n/**\n * Gets the virtual parent given the child element, if it exists.\n */\nexport function getVirtualParent(child: Node): Node | undefined {\n return isVirtualElement(child) ? child._virtual.parent : undefined;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"mappings":"AAEA;;;AAGA,OAAM,SAAUA,gBAAgB,CAACC,OAAqC;EACpE,OAAOA,OAAO,IAAI,CAAC,CAAkBA,OAAQ,CAACC,QAAQ;AACxD","names":["isVirtualElement","element","_virtual"],"sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-portal/src/virtualParent/isVirtualElement.ts"],"sourcesContent":["import type { VirtualElement } from './types';\n\n/**\n * Determines whether or not an element has the virtual hierarchy extension.\n */\nexport function isVirtualElement(element: HTMLElement | VirtualElement): element is VirtualElement {\n return element && !!(<VirtualElement>element)._virtual;\n}\n"]}
1
+ {"version":3,"mappings":"AAEA;;;AAGA,OAAM,SAAUA,gBAAgB,CAACC,OAA8B;EAC7D,OAAOA,OAAO,IAAI,CAAC,CAAkBA,OAAQ,CAACC,QAAQ;AACxD","names":["isVirtualElement","element","_virtual"],"sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-portal/src/virtualParent/isVirtualElement.ts"],"sourcesContent":["import type { VirtualElement } from './types';\n\n/**\n * Determines whether or not an element has the virtual hierarchy extension.\n */\nexport function isVirtualElement(element: Node | VirtualElement): element is VirtualElement {\n return element && !!(<VirtualElement>element)._virtual;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"mappings":"AAEA;;;;;;AAMA,OAAM,SAAUA,gBAAgB,CAACC,KAAkB,EAAEC,MAAoB;EACvE,IAAI,CAACD,KAAK,EAAE;IACV;;EAGF,MAAME,YAAY,GAAmBF,KAAK;EAE1C,IAAI,CAACE,YAAY,CAACC,QAAQ,EAAE;IAC1BD,YAAY,CAACC,QAAQ,GAAG,EAAE;;EAG5BD,YAAY,CAACC,QAAQ,CAACF,MAAM,GAAGA,MAAM,IAAIG,SAAS;AACpD","names":["setVirtualParent","child","parent","virtualChild","_virtual","undefined"],"sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-portal/src/virtualParent/setVirtualParent.ts"],"sourcesContent":["import type { VirtualElement } from './types';\n\n/**\n * Sets the virtual parent of an element.\n *\n * @param child - Theme element to set the virtual parent\n * @param parent - The virtual parent, use `undefined` to remove a virtual parent relationship\n */\nexport function setVirtualParent(child: HTMLElement, parent?: HTMLElement): void {\n if (!child) {\n return;\n }\n\n const virtualChild = <VirtualElement>child;\n\n if (!virtualChild._virtual) {\n virtualChild._virtual = {};\n }\n\n virtualChild._virtual.parent = parent || undefined;\n}\n"]}
1
+ {"version":3,"mappings":"AAEA;;;;;;AAMA,OAAM,SAAUA,gBAAgB,CAACC,KAAW,EAAEC,MAAa;EACzD,IAAI,CAACD,KAAK,EAAE;IACV;;EAGF,MAAME,YAAY,GAAGF,KAAuB;EAE5C,IAAI,CAACE,YAAY,CAACC,QAAQ,EAAE;IAC1BD,YAAY,CAACC,QAAQ,GAAG,EAAE;;EAG5BD,YAAY,CAACC,QAAQ,CAACF,MAAM,GAAGA,MAAM,IAAIG,SAAS;AACpD","names":["setVirtualParent","child","parent","virtualChild","_virtual","undefined"],"sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-portal/src/virtualParent/setVirtualParent.ts"],"sourcesContent":["import type { VirtualElement } from './types';\n\n/**\n * Sets the virtual parent of an element.\n *\n * @param child - Theme element to set the virtual parent\n * @param parent - The virtual parent, use `undefined` to remove a virtual parent relationship\n */\nexport function setVirtualParent(child: Node, parent?: Node): void {\n if (!child) {\n return;\n }\n\n const virtualChild = child as VirtualElement;\n\n if (!virtualChild._virtual) {\n virtualChild._virtual = {};\n }\n\n virtualChild._virtual.parent = parent || undefined;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-portal/src/virtualParent/types.ts"],"names":[],"mappings":"","sourcesContent":["export interface VirtualElement extends HTMLElement {\n _virtual: {\n parent?: HTMLElement;\n };\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-portal/src/virtualParent/types.ts"],"names":[],"mappings":"","sourcesContent":["export interface VirtualElement extends Node {\n _virtual: {\n parent?: Node;\n };\n}\n"]}
@@ -13,12 +13,12 @@ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
13
13
  // String concatenation is used to prevent bundlers to complain with older versions of React
14
14
  const useInsertionEffect = React['useInsertion' + 'Effect'] ? React['useInsertion' + 'Effect'] : react_utilities_1.useIsomorphicLayoutEffect;
15
15
  const useStyles = /*#__PURE__*/react_1.__styles({
16
- "root": {
17
- "qhf8xq": "f10pi13n",
18
- "Bj3rh1h": "f494woh"
16
+ root: {
17
+ qhf8xq: "f10pi13n",
18
+ Bj3rh1h: "f494woh"
19
19
  }
20
20
  }, {
21
- "d": [".f10pi13n{position:relative;}", ".f494woh{z-index:1000000;}"]
21
+ d: [".f10pi13n{position:relative;}", ".f494woh{z-index:1000000;}"]
22
22
  });
23
23
  /**
24
24
  * Creates a new element on a document.body to mount portals
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAAA;AACA;;;;;;AAMA,SAAgBA,eAAe,CAACC,MAA0B,EAAEC,KAAyB;EACnF,IAAI,CAACD,MAAM,IAAI,CAACC,KAAK,EAAE;IACrB,OAAO,KAAK;;EAGd,IAAID,MAAM,KAAKC,KAAK,EAAE;IACpB,OAAO,IAAI;GACZ,MAAM;IACL,OAAOA,KAAK,EAAE;MACZ,MAAMC,UAAU,GAAuBC,qBAAS,CAACF,KAAK,CAAC;MAEvD,IAAIC,UAAU,KAAKF,MAAM,EAAE;QACzB,OAAO,IAAI;;MAGbC,KAAK,GAAGC,UAAU;;;EAItB,OAAO,KAAK;AACd;AApBAE","names":["elementContains","parent","child","nextParent","getParent_1","exports"],"sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-portal/src/virtualParent/elementContains.ts"],"sourcesContent":["import { getParent } from './getParent';\n/**\n * Similar functionality to `element.contains` DOM API for use with out of order DOM elements that\n * checks the virtual parent hierarchy. If a virtual parents exists, it is chosen over the actual parent\n *\n * @returns true if the child can find the parent in its virtual hierarchy\n */\nexport function elementContains(parent: HTMLElement | null, child: HTMLElement | null): boolean {\n if (!parent || !child) {\n return false;\n }\n\n if (parent === child) {\n return true;\n } else {\n while (child) {\n const nextParent: HTMLElement | null = getParent(child);\n\n if (nextParent === parent) {\n return true;\n }\n\n child = nextParent;\n }\n }\n\n return false;\n}\n"]}
1
+ {"version":3,"mappings":";;;;;;AAAA;AACA;;;;;;AAMA,SAAgBA,eAAe,CAACC,MAAmB,EAAEC,KAAkB;EACrE,IAAI,CAACD,MAAM,IAAI,CAACC,KAAK,EAAE;IACrB,OAAO,KAAK;;EAGd,IAAID,MAAM,KAAKC,KAAK,EAAE;IACpB,OAAO,IAAI;GACZ,MAAM;IACL,OAAOA,KAAK,EAAE;MACZ,MAAMC,UAAU,GAAGC,qBAAS,CAACF,KAAK,CAAC;MAEnC,IAAIC,UAAU,KAAKF,MAAM,EAAE;QACzB,OAAO,IAAI;;MAGbC,KAAK,GAAGC,UAAU;;;EAItB,OAAO,KAAK;AACd;AApBAE","names":["elementContains","parent","child","nextParent","getParent_1","exports"],"sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-portal/src/virtualParent/elementContains.ts"],"sourcesContent":["import { getParent } from './getParent';\n/**\n * Similar functionality to `element.contains` DOM API for use with out of order DOM elements that\n * checks the virtual parent hierarchy. If a virtual parents exists, it is chosen over the actual parent\n *\n * @returns true if the child can find the parent in its virtual hierarchy\n */\nexport function elementContains(parent: Node | null, child: Node | null): boolean {\n if (!parent || !child) {\n return false;\n }\n\n if (parent === child) {\n return true;\n } else {\n while (child) {\n const nextParent = getParent(child);\n\n if (nextParent === parent) {\n return true;\n }\n\n child = nextParent;\n }\n }\n\n return false;\n}\n"]}
@@ -10,7 +10,8 @@ const getVirtualParent_1 = /*#__PURE__*/require("./getVirtualParent");
10
10
  * This method prefers the virtual parent over real DOM parent when present.
11
11
  */
12
12
  function getParent(child) {
13
- return child && getVirtualParent_1.getVirtualParent(child) || (child === null || child === void 0 ? void 0 : child.parentNode);
13
+ var _a;
14
+ return (_a = child && getVirtualParent_1.getVirtualParent(child) || (child === null || child === void 0 ? void 0 : child.parentNode)) !== null && _a !== void 0 ? _a : null;
14
15
  }
15
16
  exports.getParent = getParent;
16
17
  //# sourceMappingURL=getParent.js.map
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAAA;AAEA;;;;AAIA,SAAgBA,SAAS,CAACC,KAAyB;EACjD,OAAQA,KAAK,IAAIC,mCAAgB,CAACD,KAAK,CAAC,KAAMA,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEE,UAAiC;AACxF;AAFAC","names":["getParent","child","getVirtualParent_1","parentNode","exports"],"sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-portal/src/virtualParent/getParent.ts"],"sourcesContent":["import { getVirtualParent } from './getVirtualParent';\n\n/**\n * Gets the element which is the parent of a given element.\n * This method prefers the virtual parent over real DOM parent when present.\n */\nexport function getParent(child: HTMLElement | null): HTMLElement | null {\n return (child && getVirtualParent(child)) || (child?.parentNode as HTMLElement | null);\n}\n"]}
1
+ {"version":3,"mappings":";;;;;;AAAA;AAEA;;;;AAIA,SAAgBA,SAAS,CAACC,KAAkB;;EAC1C,OAAO,MAAEA,KAAK,IAAIC,mCAAgB,CAACD,KAAK,CAAC,KAAKA,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEE,UAAU,CAAC,mCAAI,IAAI;AAC1E;AAFAC","names":["getParent","child","getVirtualParent_1","parentNode","exports"],"sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-portal/src/virtualParent/getParent.ts"],"sourcesContent":["import { getVirtualParent } from './getVirtualParent';\n\n/**\n * Gets the element which is the parent of a given element.\n * This method prefers the virtual parent over real DOM parent when present.\n */\nexport function getParent(child: Node | null): Node | null {\n return ((child && getVirtualParent(child)) || child?.parentNode) ?? null;\n}\n"]}
@@ -9,11 +9,7 @@ const isVirtualElement_1 = /*#__PURE__*/require("./isVirtualElement");
9
9
  * Gets the virtual parent given the child element, if it exists.
10
10
  */
11
11
  function getVirtualParent(child) {
12
- let parent;
13
- if (isVirtualElement_1.isVirtualElement(child)) {
14
- parent = child._virtual.parent;
15
- }
16
- return parent;
12
+ return isVirtualElement_1.isVirtualElement(child) ? child._virtual.parent : undefined;
17
13
  }
18
14
  exports.getVirtualParent = getVirtualParent;
19
15
  //# sourceMappingURL=getVirtualParent.js.map
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAAA;AACA;;;AAGA,SAAgBA,gBAAgB,CAACC,KAAkB;EACjD,IAAIC,MAA+B;EACnC,IAAIC,mCAAgB,CAACF,KAAK,CAAC,EAAE;IAC3BC,MAAM,GAAGD,KAAK,CAACG,QAAQ,CAACF,MAAM;;EAEhC,OAAOA,MAAM;AACf;AANAG","names":["getVirtualParent","child","parent","isVirtualElement_1","_virtual","exports"],"sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-portal/src/virtualParent/getVirtualParent.ts"],"sourcesContent":["import { isVirtualElement } from './isVirtualElement';\n/**\n * Gets the virtual parent given the child element, if it exists.\n */\nexport function getVirtualParent(child: HTMLElement): HTMLElement | undefined {\n let parent: HTMLElement | undefined;\n if (isVirtualElement(child)) {\n parent = child._virtual.parent;\n }\n return parent;\n}\n"]}
1
+ {"version":3,"mappings":";;;;;;AAAA;AACA;;;AAGA,SAAgBA,gBAAgB,CAACC,KAAW;EAC1C,OAAOC,mCAAgB,CAACD,KAAK,CAAC,GAAGA,KAAK,CAACE,QAAQ,CAACC,MAAM,GAAGC,SAAS;AACpE;AAFAC","names":["getVirtualParent","child","isVirtualElement_1","_virtual","parent","undefined","exports"],"sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-portal/src/virtualParent/getVirtualParent.ts"],"sourcesContent":["import { isVirtualElement } from './isVirtualElement';\n/**\n * Gets the virtual parent given the child element, if it exists.\n */\nexport function getVirtualParent(child: Node): Node | undefined {\n return isVirtualElement(child) ? child._virtual.parent : undefined;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAEA;;;AAGA,SAAgBA,gBAAgB,CAACC,OAAqC;EACpE,OAAOA,OAAO,IAAI,CAAC,CAAkBA,OAAQ,CAACC,QAAQ;AACxD;AAFAC","names":["isVirtualElement","element","_virtual","exports"],"sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-portal/src/virtualParent/isVirtualElement.ts"],"sourcesContent":["import type { VirtualElement } from './types';\n\n/**\n * Determines whether or not an element has the virtual hierarchy extension.\n */\nexport function isVirtualElement(element: HTMLElement | VirtualElement): element is VirtualElement {\n return element && !!(<VirtualElement>element)._virtual;\n}\n"]}
1
+ {"version":3,"mappings":";;;;;;AAEA;;;AAGA,SAAgBA,gBAAgB,CAACC,OAA8B;EAC7D,OAAOA,OAAO,IAAI,CAAC,CAAkBA,OAAQ,CAACC,QAAQ;AACxD;AAFAC","names":["isVirtualElement","element","_virtual","exports"],"sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-portal/src/virtualParent/isVirtualElement.ts"],"sourcesContent":["import type { VirtualElement } from './types';\n\n/**\n * Determines whether or not an element has the virtual hierarchy extension.\n */\nexport function isVirtualElement(element: Node | VirtualElement): element is VirtualElement {\n return element && !!(<VirtualElement>element)._virtual;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAEA;;;;;;AAMA,SAAgBA,gBAAgB,CAACC,KAAkB,EAAEC,MAAoB;EACvE,IAAI,CAACD,KAAK,EAAE;IACV;;EAGF,MAAME,YAAY,GAAmBF,KAAK;EAE1C,IAAI,CAACE,YAAY,CAACC,QAAQ,EAAE;IAC1BD,YAAY,CAACC,QAAQ,GAAG,EAAE;;EAG5BD,YAAY,CAACC,QAAQ,CAACF,MAAM,GAAGA,MAAM,IAAIG,SAAS;AACpD;AAZAC","names":["setVirtualParent","child","parent","virtualChild","_virtual","undefined","exports"],"sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-portal/src/virtualParent/setVirtualParent.ts"],"sourcesContent":["import type { VirtualElement } from './types';\n\n/**\n * Sets the virtual parent of an element.\n *\n * @param child - Theme element to set the virtual parent\n * @param parent - The virtual parent, use `undefined` to remove a virtual parent relationship\n */\nexport function setVirtualParent(child: HTMLElement, parent?: HTMLElement): void {\n if (!child) {\n return;\n }\n\n const virtualChild = <VirtualElement>child;\n\n if (!virtualChild._virtual) {\n virtualChild._virtual = {};\n }\n\n virtualChild._virtual.parent = parent || undefined;\n}\n"]}
1
+ {"version":3,"mappings":";;;;;;AAEA;;;;;;AAMA,SAAgBA,gBAAgB,CAACC,KAAW,EAAEC,MAAa;EACzD,IAAI,CAACD,KAAK,EAAE;IACV;;EAGF,MAAME,YAAY,GAAGF,KAAuB;EAE5C,IAAI,CAACE,YAAY,CAACC,QAAQ,EAAE;IAC1BD,YAAY,CAACC,QAAQ,GAAG,EAAE;;EAG5BD,YAAY,CAACC,QAAQ,CAACF,MAAM,GAAGA,MAAM,IAAIG,SAAS;AACpD;AAZAC","names":["setVirtualParent","child","parent","virtualChild","_virtual","undefined","exports"],"sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-portal/src/virtualParent/setVirtualParent.ts"],"sourcesContent":["import type { VirtualElement } from './types';\n\n/**\n * Sets the virtual parent of an element.\n *\n * @param child - Theme element to set the virtual parent\n * @param parent - The virtual parent, use `undefined` to remove a virtual parent relationship\n */\nexport function setVirtualParent(child: Node, parent?: Node): void {\n if (!child) {\n return;\n }\n\n const virtualChild = child as VirtualElement;\n\n if (!virtualChild._virtual) {\n virtualChild._virtual = {};\n }\n\n virtualChild._virtual.parent = parent || undefined;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-portal",
3
- "version": "0.0.0-nightly-20230103-0425.1",
3
+ "version": "0.0.0-nightly-20230105-0425.1",
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",
@@ -30,10 +30,10 @@
30
30
  "@fluentui/scripts": "*"
31
31
  },
32
32
  "dependencies": {
33
- "@fluentui/react-shared-contexts": "0.0.0-nightly-20230103-0425.1",
34
- "@fluentui/react-tabster": "0.0.0-nightly-20230103-0425.1",
35
- "@fluentui/react-utilities": "0.0.0-nightly-20230103-0425.1",
36
- "@griffel/react": "^1.4.2",
33
+ "@fluentui/react-shared-contexts": "0.0.0-nightly-20230105-0425.1",
34
+ "@fluentui/react-tabster": "0.0.0-nightly-20230105-0425.1",
35
+ "@fluentui/react-utilities": "0.0.0-nightly-20230105-0425.1",
36
+ "@griffel/react": "^1.5.2",
37
37
  "tslib": "^2.1.0",
38
38
  "use-disposable": "^1.0.1"
39
39
  },