@fluentui/react-positioning 9.16.4 → 9.16.6
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.md
CHANGED
@@ -1,12 +1,33 @@
|
|
1
1
|
# Change Log - @fluentui/react-positioning
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Thu, 27 Mar 2025 21:08:38 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
+
## [9.16.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.16.6)
|
8
|
+
|
9
|
+
Thu, 27 Mar 2025 21:08:38 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.16.5..@fluentui/react-positioning_v9.16.6)
|
11
|
+
|
12
|
+
### Patches
|
13
|
+
|
14
|
+
- Bump @fluentui/react-shared-contexts to v9.23.1 ([PR #34034](https://github.com/microsoft/fluentui/pull/34034) by beachball)
|
15
|
+
- Bump @fluentui/react-utilities to v9.18.23 ([PR #34034](https://github.com/microsoft/fluentui/pull/34034) by beachball)
|
16
|
+
|
17
|
+
## [9.16.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.16.5)
|
18
|
+
|
19
|
+
Wed, 19 Mar 2025 15:40:41 GMT
|
20
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.16.4..@fluentui/react-positioning_v9.16.5)
|
21
|
+
|
22
|
+
### Patches
|
23
|
+
|
24
|
+
- fix: don't throw on window.getComputedStyle() ([PR #34016](https://github.com/microsoft/fluentui/pull/34016) by olfedias@microsoft.com)
|
25
|
+
- Bump @fluentui/react-shared-contexts to v9.23.0 ([PR #34032](https://github.com/microsoft/fluentui/pull/34032) by beachball)
|
26
|
+
- Bump @fluentui/react-utilities to v9.18.22 ([PR #34032](https://github.com/microsoft/fluentui/pull/34032) by beachball)
|
27
|
+
|
7
28
|
## [9.16.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.16.4)
|
8
29
|
|
9
|
-
Tue, 11 Mar 2025 18:54
|
30
|
+
Tue, 11 Mar 2025 18:58:54 GMT
|
10
31
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.16.3..@fluentui/react-positioning_v9.16.4)
|
11
32
|
|
12
33
|
### Patches
|
@@ -13,13 +13,16 @@
|
|
13
13
|
* Returns CSS styles of the given node.
|
14
14
|
* @param node - DOM node.
|
15
15
|
* @returns - CSS styles.
|
16
|
-
*/ const getStyleComputedProperty = (node)=>{
|
16
|
+
*/ export const getStyleComputedProperty = (node)=>{
|
17
17
|
var _node_ownerDocument;
|
18
18
|
if (node.nodeType !== 1) {
|
19
19
|
return {};
|
20
20
|
}
|
21
|
-
const
|
22
|
-
|
21
|
+
const targetWindow = (_node_ownerDocument = node.ownerDocument) === null || _node_ownerDocument === void 0 ? void 0 : _node_ownerDocument.defaultView;
|
22
|
+
if (targetWindow) {
|
23
|
+
return targetWindow.getComputedStyle(node, null);
|
24
|
+
}
|
25
|
+
return {};
|
23
26
|
};
|
24
27
|
/**
|
25
28
|
* Returns the first scrollable parent of the given element.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/utils/getScrollParent.ts"],"sourcesContent":["/**\n * Returns the parent node or the host of the node argument.\n * @param node - DOM node.\n * @returns - parent DOM node.\n */\nexport const getParentNode = (node: HTMLElement): HTMLElement => {\n if (node.nodeName === 'HTML') {\n return node;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return node.parentNode || (node as any).host;\n};\n\n/**\n * Returns CSS styles of the given node.\n * @param node - DOM node.\n * @returns - CSS styles.\n */\
|
1
|
+
{"version":3,"sources":["../src/utils/getScrollParent.ts"],"sourcesContent":["/**\n * Returns the parent node or the host of the node argument.\n * @param node - DOM node.\n * @returns - parent DOM node.\n */\nexport const getParentNode = (node: HTMLElement): HTMLElement => {\n if (node.nodeName === 'HTML') {\n return node;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return node.parentNode || (node as any).host;\n};\n\n/**\n * Returns CSS styles of the given node.\n * @param node - DOM node.\n * @returns - CSS styles.\n */\nexport const getStyleComputedProperty = (node: HTMLElement): Partial<CSSStyleDeclaration> => {\n if (node.nodeType !== 1) {\n return {};\n }\n\n const targetWindow = node.ownerDocument?.defaultView;\n\n if (targetWindow) {\n return targetWindow.getComputedStyle(node, null);\n }\n\n return {};\n};\n\n/**\n * Returns the first scrollable parent of the given element.\n * @param node - DOM node.\n * @returns - the first scrollable parent.\n */\nexport const getScrollParent = (node: Document | HTMLElement | null): HTMLElement => {\n // Return body, `getScroll` will take care to get the correct `scrollTop` from it\n const parentNode = node && getParentNode(node as HTMLElement);\n // eslint-disable-next-line\n if (!parentNode) return document.body;\n\n switch (parentNode.nodeName) {\n case 'HTML':\n case 'BODY':\n return parentNode.ownerDocument!.body;\n case '#document':\n return (parentNode as unknown as Document).body;\n }\n\n // If any of the overflow props is defined for the node then we return it as the parent\n const { overflow, overflowX, overflowY } = getStyleComputedProperty(parentNode);\n if (/(auto|scroll|overlay)/.test(overflow! + overflowY! + overflowX)) {\n return parentNode;\n }\n\n return getScrollParent(parentNode);\n};\n\nexport const hasScrollParent = (node: Document | HTMLElement | null): boolean => {\n const scrollParentElement: HTMLElement = getScrollParent(node);\n\n return scrollParentElement ? scrollParentElement !== scrollParentElement.ownerDocument?.body : false;\n};\n"],"names":["getParentNode","node","nodeName","parentNode","host","getStyleComputedProperty","nodeType","targetWindow","ownerDocument","defaultView","getComputedStyle","getScrollParent","document","body","overflow","overflowX","overflowY","test","hasScrollParent","scrollParentElement"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;;;CAIC,GACD,OAAO,MAAMA,gBAAgB,CAACC;IAC5B,IAAIA,KAAKC,QAAQ,KAAK,QAAQ;QAC5B,OAAOD;IACT;IAEA,8DAA8D;IAC9D,OAAOA,KAAKE,UAAU,IAAI,AAACF,KAAaG,IAAI;AAC9C,EAAE;AAEF;;;;CAIC,GACD,OAAO,MAAMC,2BAA2B,CAACJ;QAKlBA;IAJrB,IAAIA,KAAKK,QAAQ,KAAK,GAAG;QACvB,OAAO,CAAC;IACV;IAEA,MAAMC,gBAAeN,sBAAAA,KAAKO,aAAa,cAAlBP,0CAAAA,oBAAoBQ,WAAW;IAEpD,IAAIF,cAAc;QAChB,OAAOA,aAAaG,gBAAgB,CAACT,MAAM;IAC7C;IAEA,OAAO,CAAC;AACV,EAAE;AAEF;;;;CAIC,GACD,OAAO,MAAMU,kBAAkB,CAACV;IAC9B,iFAAiF;IACjF,MAAME,aAAaF,QAAQD,cAAcC;IACzC,2BAA2B;IAC3B,IAAI,CAACE,YAAY,OAAOS,SAASC,IAAI;IAErC,OAAQV,WAAWD,QAAQ;QACzB,KAAK;QACL,KAAK;YACH,OAAOC,WAAWK,aAAa,CAAEK,IAAI;QACvC,KAAK;YACH,OAAO,AAACV,WAAmCU,IAAI;IACnD;IAEA,uFAAuF;IACvF,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,SAAS,EAAE,GAAGX,yBAAyBF;IACpE,IAAI,wBAAwBc,IAAI,CAACH,WAAYE,YAAaD,YAAY;QACpE,OAAOZ;IACT;IAEA,OAAOQ,gBAAgBR;AACzB,EAAE;AAEF,OAAO,MAAMe,kBAAkB,CAACjB;QAGuBkB;IAFrD,MAAMA,sBAAmCR,gBAAgBV;IAEzD,OAAOkB,sBAAsBA,0BAAwBA,qCAAAA,oBAAoBX,aAAa,cAAjCW,yDAAAA,mCAAmCN,IAAI,IAAG;AACjG,EAAE"}
|
@@ -19,6 +19,9 @@ _export(exports, {
|
|
19
19
|
getScrollParent: function() {
|
20
20
|
return getScrollParent;
|
21
21
|
},
|
22
|
+
getStyleComputedProperty: function() {
|
23
|
+
return getStyleComputedProperty;
|
24
|
+
},
|
22
25
|
hasScrollParent: function() {
|
23
26
|
return hasScrollParent;
|
24
27
|
}
|
@@ -30,17 +33,16 @@ const getParentNode = (node)=>{
|
|
30
33
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
31
34
|
return node.parentNode || node.host;
|
32
35
|
};
|
33
|
-
|
34
|
-
* Returns CSS styles of the given node.
|
35
|
-
* @param node - DOM node.
|
36
|
-
* @returns - CSS styles.
|
37
|
-
*/ const getStyleComputedProperty = (node)=>{
|
36
|
+
const getStyleComputedProperty = (node)=>{
|
38
37
|
var _node_ownerDocument;
|
39
38
|
if (node.nodeType !== 1) {
|
40
39
|
return {};
|
41
40
|
}
|
42
|
-
const
|
43
|
-
|
41
|
+
const targetWindow = (_node_ownerDocument = node.ownerDocument) === null || _node_ownerDocument === void 0 ? void 0 : _node_ownerDocument.defaultView;
|
42
|
+
if (targetWindow) {
|
43
|
+
return targetWindow.getComputedStyle(node, null);
|
44
|
+
}
|
45
|
+
return {};
|
44
46
|
};
|
45
47
|
const getScrollParent = (node)=>{
|
46
48
|
// Return body, `getScroll` will take care to get the correct `scrollTop` from it
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/utils/getScrollParent.ts"],"sourcesContent":["/**\n * Returns the parent node or the host of the node argument.\n * @param node - DOM node.\n * @returns - parent DOM node.\n */\nexport const getParentNode = (node: HTMLElement): HTMLElement => {\n if (node.nodeName === 'HTML') {\n return node;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return node.parentNode || (node as any).host;\n};\n\n/**\n * Returns CSS styles of the given node.\n * @param node - DOM node.\n * @returns - CSS styles.\n */\
|
1
|
+
{"version":3,"sources":["../src/utils/getScrollParent.ts"],"sourcesContent":["/**\n * Returns the parent node or the host of the node argument.\n * @param node - DOM node.\n * @returns - parent DOM node.\n */\nexport const getParentNode = (node: HTMLElement): HTMLElement => {\n if (node.nodeName === 'HTML') {\n return node;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return node.parentNode || (node as any).host;\n};\n\n/**\n * Returns CSS styles of the given node.\n * @param node - DOM node.\n * @returns - CSS styles.\n */\nexport const getStyleComputedProperty = (node: HTMLElement): Partial<CSSStyleDeclaration> => {\n if (node.nodeType !== 1) {\n return {};\n }\n\n const targetWindow = node.ownerDocument?.defaultView;\n\n if (targetWindow) {\n return targetWindow.getComputedStyle(node, null);\n }\n\n return {};\n};\n\n/**\n * Returns the first scrollable parent of the given element.\n * @param node - DOM node.\n * @returns - the first scrollable parent.\n */\nexport const getScrollParent = (node: Document | HTMLElement | null): HTMLElement => {\n // Return body, `getScroll` will take care to get the correct `scrollTop` from it\n const parentNode = node && getParentNode(node as HTMLElement);\n // eslint-disable-next-line\n if (!parentNode) return document.body;\n\n switch (parentNode.nodeName) {\n case 'HTML':\n case 'BODY':\n return parentNode.ownerDocument!.body;\n case '#document':\n return (parentNode as unknown as Document).body;\n }\n\n // If any of the overflow props is defined for the node then we return it as the parent\n const { overflow, overflowX, overflowY } = getStyleComputedProperty(parentNode);\n if (/(auto|scroll|overlay)/.test(overflow! + overflowY! + overflowX)) {\n return parentNode;\n }\n\n return getScrollParent(parentNode);\n};\n\nexport const hasScrollParent = (node: Document | HTMLElement | null): boolean => {\n const scrollParentElement: HTMLElement = getScrollParent(node);\n\n return scrollParentElement ? scrollParentElement !== scrollParentElement.ownerDocument?.body : false;\n};\n"],"names":["getParentNode","getScrollParent","getStyleComputedProperty","hasScrollParent","node","nodeName","parentNode","host","nodeType","targetWindow","ownerDocument","defaultView","getComputedStyle","document","body","overflow","overflowX","overflowY","test","scrollParentElement"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;;;CAIC;;;;;;;;;;;IACYA,aAAa;eAAbA;;IAiCAC,eAAe;eAAfA;;IAnBAC,wBAAwB;eAAxBA;;IA0CAC,eAAe;eAAfA;;;AAxDN,MAAMH,gBAAgB,CAACI;IAC5B,IAAIA,KAAKC,QAAQ,KAAK,QAAQ;QAC5B,OAAOD;IACT;IAEA,8DAA8D;IAC9D,OAAOA,KAAKE,UAAU,IAAI,AAACF,KAAaG,IAAI;AAC9C;AAOO,MAAML,2BAA2B,CAACE;QAKlBA;IAJrB,IAAIA,KAAKI,QAAQ,KAAK,GAAG;QACvB,OAAO,CAAC;IACV;IAEA,MAAMC,gBAAeL,sBAAAA,KAAKM,aAAa,cAAlBN,0CAAAA,oBAAoBO,WAAW;IAEpD,IAAIF,cAAc;QAChB,OAAOA,aAAaG,gBAAgB,CAACR,MAAM;IAC7C;IAEA,OAAO,CAAC;AACV;AAOO,MAAMH,kBAAkB,CAACG;IAC9B,iFAAiF;IACjF,MAAME,aAAaF,QAAQJ,cAAcI;IACzC,2BAA2B;IAC3B,IAAI,CAACE,YAAY,OAAOO,SAASC,IAAI;IAErC,OAAQR,WAAWD,QAAQ;QACzB,KAAK;QACL,KAAK;YACH,OAAOC,WAAWI,aAAa,CAAEI,IAAI;QACvC,KAAK;YACH,OAAO,AAACR,WAAmCQ,IAAI;IACnD;IAEA,uFAAuF;IACvF,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,SAAS,EAAE,GAAGf,yBAAyBI;IACpE,IAAI,wBAAwBY,IAAI,CAACH,WAAYE,YAAaD,YAAY;QACpE,OAAOV;IACT;IAEA,OAAOL,gBAAgBK;AACzB;AAEO,MAAMH,kBAAkB,CAACC;QAGuBe;IAFrD,MAAMA,sBAAmClB,gBAAgBG;IAEzD,OAAOe,sBAAsBA,0BAAwBA,qCAAAA,oBAAoBT,aAAa,cAAjCS,yDAAAA,mCAAmCL,IAAI,IAAG;AACjG"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-positioning",
|
3
|
-
"version": "9.16.
|
3
|
+
"version": "9.16.6",
|
4
4
|
"description": "A react wrapper around Popper.js for Fluent UI",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -18,9 +18,9 @@
|
|
18
18
|
"dependencies": {
|
19
19
|
"@floating-ui/dom": "^1.6.12",
|
20
20
|
"@floating-ui/devtools": "0.2.1",
|
21
|
-
"@fluentui/react-shared-contexts": "^9.
|
21
|
+
"@fluentui/react-shared-contexts": "^9.23.1",
|
22
22
|
"@fluentui/react-theme": "^9.1.24",
|
23
|
-
"@fluentui/react-utilities": "^9.18.
|
23
|
+
"@fluentui/react-utilities": "^9.18.23",
|
24
24
|
"@griffel/react": "^1.5.22",
|
25
25
|
"@swc/helpers": "^0.5.1"
|
26
26
|
},
|