@fluentui/react-portal 9.0.15 → 9.1.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +57 -1
- package/CHANGELOG.md +23 -2
- package/dist/index.d.ts +2 -2
- package/lib/virtualParent/elementContains.js.map +1 -1
- package/lib/virtualParent/getParent.js +2 -1
- package/lib/virtualParent/getParent.js.map +1 -1
- package/lib/virtualParent/getVirtualParent.js +1 -5
- package/lib/virtualParent/getVirtualParent.js.map +1 -1
- package/lib/virtualParent/isVirtualElement.js.map +1 -1
- package/lib/virtualParent/setVirtualParent.js.map +1 -1
- package/lib/virtualParent/types.js.map +1 -1
- package/lib-amd/virtualParent/elementContains.js.map +1 -1
- package/lib-amd/virtualParent/getParent.js +2 -1
- package/lib-amd/virtualParent/getParent.js.map +1 -1
- package/lib-amd/virtualParent/getVirtualParent.js +1 -5
- package/lib-amd/virtualParent/getVirtualParent.js.map +1 -1
- package/lib-amd/virtualParent/isVirtualElement.js.map +1 -1
- package/lib-amd/virtualParent/setVirtualParent.js.map +1 -1
- package/lib-amd/virtualParent/types.js.map +1 -1
- package/lib-commonjs/virtualParent/elementContains.js.map +1 -1
- package/lib-commonjs/virtualParent/getParent.js +2 -1
- package/lib-commonjs/virtualParent/getParent.js.map +1 -1
- package/lib-commonjs/virtualParent/getVirtualParent.js +1 -5
- package/lib-commonjs/virtualParent/getVirtualParent.js.map +1 -1
- package/lib-commonjs/virtualParent/isVirtualElement.js.map +1 -1
- package/lib-commonjs/virtualParent/setVirtualParent.js.map +1 -1
- package/package.json +6 -5
package/CHANGELOG.json
CHANGED
@@ -2,7 +2,63 @@
|
|
2
2
|
"name": "@fluentui/react-portal",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "
|
5
|
+
"date": "Mon, 16 Jan 2023 08:35:43 GMT",
|
6
|
+
"tag": "@fluentui/react-portal_v9.1.1",
|
7
|
+
"version": "9.1.1",
|
8
|
+
"comments": {
|
9
|
+
"none": [
|
10
|
+
{
|
11
|
+
"author": "martinhochel@microsoft.com",
|
12
|
+
"package": "@fluentui/react-portal",
|
13
|
+
"commit": "64bb45980d68de1219c6b36a7db5363f0a9cff9f",
|
14
|
+
"comment": "chore: migrate to packaged scripts"
|
15
|
+
}
|
16
|
+
],
|
17
|
+
"patch": [
|
18
|
+
{
|
19
|
+
"author": "beachball",
|
20
|
+
"package": "@fluentui/react-portal",
|
21
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.1.5",
|
22
|
+
"commit": "a870d8360e47f3ea03358c4e75e89e08a74845d7"
|
23
|
+
},
|
24
|
+
{
|
25
|
+
"author": "beachball",
|
26
|
+
"package": "@fluentui/react-portal",
|
27
|
+
"comment": "Bump @fluentui/react-tabster to v9.3.7",
|
28
|
+
"commit": "a870d8360e47f3ea03358c4e75e89e08a74845d7"
|
29
|
+
}
|
30
|
+
]
|
31
|
+
}
|
32
|
+
},
|
33
|
+
{
|
34
|
+
"date": "Mon, 09 Jan 2023 14:34:59 GMT",
|
35
|
+
"tag": "@fluentui/react-portal_v9.1.0",
|
36
|
+
"version": "9.1.0",
|
37
|
+
"comments": {
|
38
|
+
"minor": [
|
39
|
+
{
|
40
|
+
"author": "email not defined",
|
41
|
+
"package": "@fluentui/react-portal",
|
42
|
+
"commit": "a62c525a002fe1eed5c40aec4c041d1f850b7beb",
|
43
|
+
"comment": "feat: elementContains supports Node types"
|
44
|
+
},
|
45
|
+
{
|
46
|
+
"author": "beachball",
|
47
|
+
"package": "@fluentui/react-portal",
|
48
|
+
"comment": "Bump @fluentui/react-tabster to v9.3.6",
|
49
|
+
"commit": "d246e70eba59a37ec311dbf933b0745d34cb700d"
|
50
|
+
},
|
51
|
+
{
|
52
|
+
"author": "beachball",
|
53
|
+
"package": "@fluentui/react-portal",
|
54
|
+
"comment": "Bump @fluentui/react-utilities to v9.4.0",
|
55
|
+
"commit": "d246e70eba59a37ec311dbf933b0745d34cb700d"
|
56
|
+
}
|
57
|
+
]
|
58
|
+
}
|
59
|
+
},
|
60
|
+
{
|
61
|
+
"date": "Wed, 04 Jan 2023 01:40:17 GMT",
|
6
62
|
"tag": "@fluentui/react-portal_v9.0.15",
|
7
63
|
"version": "9.0.15",
|
8
64
|
"comments": {
|
package/CHANGELOG.md
CHANGED
@@ -1,12 +1,33 @@
|
|
1
1
|
# Change Log - @fluentui/react-portal
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Mon, 16 Jan 2023 08:35:43 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
+
## [9.1.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal_v9.1.1)
|
8
|
+
|
9
|
+
Mon, 16 Jan 2023 08:35:43 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-portal_v9.1.0..@fluentui/react-portal_v9.1.1)
|
11
|
+
|
12
|
+
### Patches
|
13
|
+
|
14
|
+
- Bump @fluentui/react-shared-contexts to v9.1.5 ([commit](https://github.com/microsoft/fluentui/commit/a870d8360e47f3ea03358c4e75e89e08a74845d7) by beachball)
|
15
|
+
- Bump @fluentui/react-tabster to v9.3.7 ([commit](https://github.com/microsoft/fluentui/commit/a870d8360e47f3ea03358c4e75e89e08a74845d7) by beachball)
|
16
|
+
|
17
|
+
## [9.1.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal_v9.1.0)
|
18
|
+
|
19
|
+
Mon, 09 Jan 2023 14:34:59 GMT
|
20
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-portal_v9.0.15..@fluentui/react-portal_v9.1.0)
|
21
|
+
|
22
|
+
### Minor changes
|
23
|
+
|
24
|
+
- feat: elementContains supports Node types ([PR #26158](https://github.com/microsoft/fluentui/pull/26158) by email not defined)
|
25
|
+
- Bump @fluentui/react-tabster to v9.3.6 ([PR #26255](https://github.com/microsoft/fluentui/pull/26255) by beachball)
|
26
|
+
- Bump @fluentui/react-utilities to v9.4.0 ([PR #26255](https://github.com/microsoft/fluentui/pull/26255) by beachball)
|
27
|
+
|
7
28
|
## [9.0.15](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal_v9.0.15)
|
8
29
|
|
9
|
-
Wed, 04 Jan 2023 01:
|
30
|
+
Wed, 04 Jan 2023 01:40:17 GMT
|
10
31
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-portal_v9.0.14..@fluentui/react-portal_v9.0.15)
|
11
32
|
|
12
33
|
### Patches
|
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:
|
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:
|
48
|
+
export declare function setVirtualParent(child: Node, parent?: Node): void;
|
49
49
|
|
50
50
|
/**
|
51
51
|
* Create the state required to render Portal.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"mappings":"AAAA,SAASA,SAAS,QAAQ,aAAa;AACvC;;;;;;AAMA,OAAM,SAAUC,eAAe,CAACC,
|
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":"../src/","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
|
-
|
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,
|
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":"../src/","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
|
-
|
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,
|
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":"../src/","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,
|
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":"../src/","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,
|
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":"../src/","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":"../src/","sources":["packages/react-components/react-portal/src/virtualParent/types.ts"],"names":[],"mappings":"","sourcesContent":["export interface VirtualElement extends
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"../src/","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"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"elementContains.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-portal/src/virtualParent/elementContains.ts"],"names":[],"mappings":";;;;IACA;;;;;OAKG;IACH,SAAgB,eAAe,CAAC,
|
1
|
+
{"version":3,"file":"elementContains.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-portal/src/virtualParent/elementContains.ts"],"names":[],"mappings":";;;;IACA;;;;;OAKG;IACH,SAAgB,eAAe,CAAC,MAAmB,EAAE,KAAkB;QACrE,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE;YACrB,OAAO,KAAK,CAAC;SACd;QAED,IAAI,MAAM,KAAK,KAAK,EAAE;YACpB,OAAO,IAAI,CAAC;SACb;aAAM;YACL,OAAO,KAAK,EAAE;gBACZ,IAAM,UAAU,GAAG,qBAAS,CAAC,KAAK,CAAC,CAAC;gBAEpC,IAAI,UAAU,KAAK,MAAM,EAAE;oBACzB,OAAO,IAAI,CAAC;iBACb;gBAED,KAAK,GAAG,UAAU,CAAC;aACpB;SACF;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IApBD,0CAoBC","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"]}
|
@@ -7,7 +7,8 @@ define(["require", "exports", "./getVirtualParent"], function (require, exports,
|
|
7
7
|
* This method prefers the virtual parent over real DOM parent when present.
|
8
8
|
*/
|
9
9
|
function getParent(child) {
|
10
|
-
|
10
|
+
var _a;
|
11
|
+
return (_a = ((child && getVirtualParent_1.getVirtualParent(child)) || (child === null || child === void 0 ? void 0 : child.parentNode))) !== null && _a !== void 0 ? _a : null;
|
11
12
|
}
|
12
13
|
exports.getParent = getParent;
|
13
14
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getParent.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-portal/src/virtualParent/getParent.ts"],"names":[],"mappings":";;;;IAEA;;;OAGG;IACH,SAAgB,SAAS,CAAC,
|
1
|
+
{"version":3,"file":"getParent.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-portal/src/virtualParent/getParent.ts"],"names":[],"mappings":";;;;IAEA;;;OAGG;IACH,SAAgB,SAAS,CAAC,KAAkB;;QAC1C,OAAO,MAAA,CAAC,CAAC,KAAK,IAAI,mCAAgB,CAAC,KAAK,CAAC,CAAC,KAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,UAAU,CAAA,CAAC,mCAAI,IAAI,CAAC;IAC3E,CAAC;IAFD,8BAEC","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"]}
|
@@ -6,11 +6,7 @@ define(["require", "exports", "./isVirtualElement"], function (require, exports,
|
|
6
6
|
* Gets the virtual parent given the child element, if it exists.
|
7
7
|
*/
|
8
8
|
function getVirtualParent(child) {
|
9
|
-
|
10
|
-
if (isVirtualElement_1.isVirtualElement(child)) {
|
11
|
-
parent = child._virtual.parent;
|
12
|
-
}
|
13
|
-
return parent;
|
9
|
+
return isVirtualElement_1.isVirtualElement(child) ? child._virtual.parent : undefined;
|
14
10
|
}
|
15
11
|
exports.getVirtualParent = getVirtualParent;
|
16
12
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getVirtualParent.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-portal/src/virtualParent/getVirtualParent.ts"],"names":[],"mappings":";;;;IACA;;OAEG;IACH,SAAgB,gBAAgB,CAAC,
|
1
|
+
{"version":3,"file":"getVirtualParent.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-portal/src/virtualParent/getVirtualParent.ts"],"names":[],"mappings":";;;;IACA;;OAEG;IACH,SAAgB,gBAAgB,CAAC,KAAW;QAC1C,OAAO,mCAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IACrE,CAAC;IAFD,4CAEC","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,"file":"isVirtualElement.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-portal/src/virtualParent/isVirtualElement.ts"],"names":[],"mappings":";;;;IAEA;;OAEG;IACH,SAAgB,gBAAgB,CAAC,
|
1
|
+
{"version":3,"file":"isVirtualElement.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-portal/src/virtualParent/isVirtualElement.ts"],"names":[],"mappings":";;;;IAEA;;OAEG;IACH,SAAgB,gBAAgB,CAAC,OAA8B;QAC7D,OAAO,OAAO,IAAI,CAAC,CAAkB,OAAQ,CAAC,QAAQ,CAAC;IACzD,CAAC;IAFD,4CAEC","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,"file":"setVirtualParent.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-portal/src/virtualParent/setVirtualParent.ts"],"names":[],"mappings":";;;;IAEA;;;;;OAKG;IACH,SAAgB,gBAAgB,CAAC,
|
1
|
+
{"version":3,"file":"setVirtualParent.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-portal/src/virtualParent/setVirtualParent.ts"],"names":[],"mappings":";;;;IAEA;;;;;OAKG;IACH,SAAgB,gBAAgB,CAAC,KAAW,EAAE,MAAa;QACzD,IAAI,CAAC,KAAK,EAAE;YACV,OAAO;SACR;QAED,IAAM,YAAY,GAAG,KAAuB,CAAC;QAE7C,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE;YAC1B,YAAY,CAAC,QAAQ,GAAG,EAAE,CAAC;SAC5B;QAED,YAAY,CAAC,QAAQ,CAAC,MAAM,GAAG,MAAM,IAAI,SAAS,CAAC;IACrD,CAAC;IAZD,4CAYC","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
|
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"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"mappings":";;;;;;AAAA;AACA;;;;;;AAMA,SAAgBA,eAAe,CAACC,
|
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":"../src/","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
|
-
|
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,
|
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":"../src/","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
|
-
|
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,
|
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":"../src/","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,
|
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":"../src/","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,
|
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":"../src/","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": "9.
|
3
|
+
"version": "9.1.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",
|
@@ -27,12 +27,13 @@
|
|
27
27
|
"devDependencies": {
|
28
28
|
"@fluentui/eslint-plugin": "*",
|
29
29
|
"@fluentui/react-conformance": "*",
|
30
|
-
"@fluentui/scripts": "*"
|
30
|
+
"@fluentui/scripts-api-extractor": "*",
|
31
|
+
"@fluentui/scripts-tasks": "*"
|
31
32
|
},
|
32
33
|
"dependencies": {
|
33
|
-
"@fluentui/react-shared-contexts": "^9.1.
|
34
|
-
"@fluentui/react-tabster": "^9.3.
|
35
|
-
"@fluentui/react-utilities": "^9.
|
34
|
+
"@fluentui/react-shared-contexts": "^9.1.5",
|
35
|
+
"@fluentui/react-tabster": "^9.3.7",
|
36
|
+
"@fluentui/react-utilities": "^9.4.0",
|
36
37
|
"@griffel/react": "^1.5.2",
|
37
38
|
"tslib": "^2.1.0",
|
38
39
|
"use-disposable": "^1.0.1"
|