@fluentui/react-portal-compat 9.0.84 → 9.0.86
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 +61 -1
- package/CHANGELOG.md +25 -2
- package/lib/PortalCompatProvider.js +1 -1
- package/lib/PortalCompatProvider.js.map +1 -1
- package/lib-amd/PortalCompatProvider.js +11 -10
- package/lib-amd/PortalCompatProvider.js.map +1 -1
- package/lib-amd/index.js +4 -2
- package/lib-amd/index.js.map +1 -1
- package/lib-commonjs/PortalCompatProvider.js +13 -11
- package/lib-commonjs/PortalCompatProvider.js.map +1 -1
- package/lib-commonjs/index.js +4 -2
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,67 @@
|
|
|
2
2
|
"name": "@fluentui/react-portal-compat",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Tue, 05 Sep 2023 13:23:03 GMT",
|
|
6
|
+
"tag": "@fluentui/react-portal-compat_v9.0.86",
|
|
7
|
+
"version": "9.0.86",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "bernardo.sunderhus@gmail.com",
|
|
12
|
+
"package": "@fluentui/react-portal-compat",
|
|
13
|
+
"commit": "eea6d93a62249ba4fba3347fb291c67ee1a3fb24",
|
|
14
|
+
"comment": "bumps react peer dependencies to v16.14.0"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "bernardo.sunderhus@gmail.com",
|
|
18
|
+
"package": "@fluentui/react-portal-compat",
|
|
19
|
+
"commit": "b93c2ac22355b6cb6f33dd509c6cd9c21f4fffc8",
|
|
20
|
+
"comment": "bumps @swc/helpers version to 0.5.1"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "beachball",
|
|
24
|
+
"package": "@fluentui/react-portal-compat",
|
|
25
|
+
"comment": "Bump @fluentui/react-portal-compat-context to v9.0.7",
|
|
26
|
+
"commit": "0bf811dbcaaa6b78743537d142fe4d348b457045"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"author": "beachball",
|
|
30
|
+
"package": "@fluentui/react-portal-compat",
|
|
31
|
+
"comment": "Bump @fluentui/react-tabster to v9.12.6",
|
|
32
|
+
"commit": "0bf811dbcaaa6b78743537d142fe4d348b457045"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"author": "beachball",
|
|
36
|
+
"package": "@fluentui/react-portal-compat",
|
|
37
|
+
"comment": "Bump @fluentui/react-components to v9.30.2",
|
|
38
|
+
"commit": "0bf811dbcaaa6b78743537d142fe4d348b457045"
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"date": "Tue, 29 Aug 2023 12:57:36 GMT",
|
|
45
|
+
"tag": "@fluentui/react-portal-compat_v9.0.85",
|
|
46
|
+
"version": "9.0.85",
|
|
47
|
+
"comments": {
|
|
48
|
+
"patch": [
|
|
49
|
+
{
|
|
50
|
+
"author": "beachball",
|
|
51
|
+
"package": "@fluentui/react-portal-compat",
|
|
52
|
+
"comment": "Bump @fluentui/react-tabster to v9.12.5",
|
|
53
|
+
"commit": "f40ca42c8392904750bf1ef24826d273d1a5b4d5"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"author": "beachball",
|
|
57
|
+
"package": "@fluentui/react-portal-compat",
|
|
58
|
+
"comment": "Bump @fluentui/react-components to v9.30.1",
|
|
59
|
+
"commit": "f40ca42c8392904750bf1ef24826d273d1a5b4d5"
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"date": "Thu, 24 Aug 2023 10:26:35 GMT",
|
|
6
66
|
"tag": "@fluentui/react-portal-compat_v9.0.84",
|
|
7
67
|
"version": "9.0.84",
|
|
8
68
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,35 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-portal-compat
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Tue, 05 Sep 2023 13:23:03 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.0.86](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal-compat_v9.0.86)
|
|
8
|
+
|
|
9
|
+
Tue, 05 Sep 2023 13:23:03 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-portal-compat_v9.0.85..@fluentui/react-portal-compat_v9.0.86)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- bumps react peer dependencies to v16.14.0 ([PR #28959](https://github.com/microsoft/fluentui/pull/28959) by bernardo.sunderhus@gmail.com)
|
|
15
|
+
- bumps @swc/helpers version to 0.5.1 ([PR #28989](https://github.com/microsoft/fluentui/pull/28989) by bernardo.sunderhus@gmail.com)
|
|
16
|
+
- Bump @fluentui/react-portal-compat-context to v9.0.7 ([PR #27840](https://github.com/microsoft/fluentui/pull/27840) by beachball)
|
|
17
|
+
- Bump @fluentui/react-tabster to v9.12.6 ([PR #27840](https://github.com/microsoft/fluentui/pull/27840) by beachball)
|
|
18
|
+
- Bump @fluentui/react-components to v9.30.2 ([PR #27840](https://github.com/microsoft/fluentui/pull/27840) by beachball)
|
|
19
|
+
|
|
20
|
+
## [9.0.85](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal-compat_v9.0.85)
|
|
21
|
+
|
|
22
|
+
Tue, 29 Aug 2023 12:57:36 GMT
|
|
23
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-portal-compat_v9.0.84..@fluentui/react-portal-compat_v9.0.85)
|
|
24
|
+
|
|
25
|
+
### Patches
|
|
26
|
+
|
|
27
|
+
- Bump @fluentui/react-tabster to v9.12.5 ([PR #29005](https://github.com/microsoft/fluentui/pull/29005) by beachball)
|
|
28
|
+
- Bump @fluentui/react-components to v9.30.1 ([PR #29005](https://github.com/microsoft/fluentui/pull/29005) by beachball)
|
|
29
|
+
|
|
7
30
|
## [9.0.84](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal-compat_v9.0.84)
|
|
8
31
|
|
|
9
|
-
Thu, 24 Aug 2023 10:
|
|
32
|
+
Thu, 24 Aug 2023 10:26:35 GMT
|
|
10
33
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-portal-compat_v9.0.83..@fluentui/react-portal-compat_v9.0.84)
|
|
11
34
|
|
|
12
35
|
### Patches
|
|
@@ -4,7 +4,7 @@ import { PortalCompatContextProvider } from '@fluentui/react-portal-compat-conte
|
|
|
4
4
|
import { applyFocusVisiblePolyfill } from '@fluentui/react-tabster';
|
|
5
5
|
const CLASS_NAME_REGEX = new RegExp(`([^\\s]*${fluentProviderClassNames.root}\\w+)`);
|
|
6
6
|
export const PortalCompatProvider = (props)=>{
|
|
7
|
-
const { children
|
|
7
|
+
const { children } = props;
|
|
8
8
|
const themeClassName = useThemeClassName();
|
|
9
9
|
const cssVariablesClassName = React.useMemo(// "themeClassName" may contain multiple classes while we want to add only a class that hosts CSS variables
|
|
10
10
|
// Keep in sync with "packages/react-provider/src/components/FluentProvider/useFluentProviderThemeStyleTag.ts"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["PortalCompatProvider.tsx"],"sourcesContent":["import * as React from 'react';\nimport { fluentProviderClassNames, useThemeClassName } from '@fluentui/react-components';\nimport { PortalCompatContextProvider } from '@fluentui/react-portal-compat-context';\nimport { applyFocusVisiblePolyfill } from '@fluentui/react-tabster';\n\nimport type { RegisterPortalFn } from '@fluentui/react-portal-compat-context';\n\nconst CLASS_NAME_REGEX = new RegExp(`([^\\\\s]*${fluentProviderClassNames.root}\\\\w+)`);\n\nexport const PortalCompatProvider: React.FC<{ children?: React.ReactNode }> = props => {\n const { children } = props;\n\n const themeClassName = useThemeClassName();\n const cssVariablesClassName = React.useMemo<string | undefined>(\n // \"themeClassName\" may contain multiple classes while we want to add only a class that hosts CSS variables\n // Keep in sync with \"packages/react-provider/src/components/FluentProvider/useFluentProviderThemeStyleTag.ts\"\n () => themeClassName.match(CLASS_NAME_REGEX)?.[1],\n [themeClassName],\n );\n\n const registerPortalEl = React.useCallback<RegisterPortalFn>(\n element => {\n let disposeFocusVisiblePolyfill: () => void = () => undefined;\n if (cssVariablesClassName) {\n element.classList.add(cssVariablesClassName);\n if (element.ownerDocument.defaultView) {\n disposeFocusVisiblePolyfill = applyFocusVisiblePolyfill(element, element.ownerDocument.defaultView);\n }\n }\n\n return () => {\n if (cssVariablesClassName) {\n element.classList.remove(cssVariablesClassName);\n }\n disposeFocusVisiblePolyfill();\n };\n },\n [cssVariablesClassName],\n );\n\n if (process.env.NODE_ENV !== 'production') {\n // This if statement technically breaks the rules of hooks, but ENV variables never change during app lifecycle\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (themeClassName === '') {\n // eslint-disable-next-line no-console\n console.warn(`\n PortalCompatProvider: \"useThemeClassName()\" hook returned an empty string\n =============================================\n Make sure that PortalCompatProvider is rendered inside FluentProvider as a child.\n `);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n }\n\n return <PortalCompatContextProvider value={registerPortalEl}>{children}</PortalCompatContextProvider>;\n};\n"],"names":["React","fluentProviderClassNames","useThemeClassName","PortalCompatContextProvider","applyFocusVisiblePolyfill","CLASS_NAME_REGEX","RegExp","root","PortalCompatProvider","props","children","themeClassName","cssVariablesClassName","useMemo","match","registerPortalEl","useCallback","element","disposeFocusVisiblePolyfill","undefined","classList","add","ownerDocument","defaultView","remove","process","env","NODE_ENV","useEffect","console","warn","value"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,iBAAiB,QAAQ,6BAA6B;AACzF,SAASC,2BAA2B,QAAQ,wCAAwC;AACpF,SAASC,yBAAyB,QAAQ,0BAA0B;AAIpE,MAAMC,mBAAmB,IAAIC,OAAO,CAAC,QAAQ,EAAEL,yBAAyBM,IAAI,CAAC,KAAK,CAAC;AAEnF,OAAO,MAAMC,uBAAiEC,CAAAA
|
|
1
|
+
{"version":3,"sources":["PortalCompatProvider.tsx"],"sourcesContent":["import * as React from 'react';\nimport { fluentProviderClassNames, useThemeClassName } from '@fluentui/react-components';\nimport { PortalCompatContextProvider } from '@fluentui/react-portal-compat-context';\nimport { applyFocusVisiblePolyfill } from '@fluentui/react-tabster';\n\nimport type { RegisterPortalFn } from '@fluentui/react-portal-compat-context';\n\nconst CLASS_NAME_REGEX = new RegExp(`([^\\\\s]*${fluentProviderClassNames.root}\\\\w+)`);\n\nexport const PortalCompatProvider: React.FC<{ children?: React.ReactNode }> = props => {\n const { children } = props;\n\n const themeClassName = useThemeClassName();\n const cssVariablesClassName = React.useMemo<string | undefined>(\n // \"themeClassName\" may contain multiple classes while we want to add only a class that hosts CSS variables\n // Keep in sync with \"packages/react-provider/src/components/FluentProvider/useFluentProviderThemeStyleTag.ts\"\n () => themeClassName.match(CLASS_NAME_REGEX)?.[1],\n [themeClassName],\n );\n\n const registerPortalEl = React.useCallback<RegisterPortalFn>(\n element => {\n let disposeFocusVisiblePolyfill: () => void = () => undefined;\n if (cssVariablesClassName) {\n element.classList.add(cssVariablesClassName);\n if (element.ownerDocument.defaultView) {\n disposeFocusVisiblePolyfill = applyFocusVisiblePolyfill(element, element.ownerDocument.defaultView);\n }\n }\n\n return () => {\n if (cssVariablesClassName) {\n element.classList.remove(cssVariablesClassName);\n }\n disposeFocusVisiblePolyfill();\n };\n },\n [cssVariablesClassName],\n );\n\n if (process.env.NODE_ENV !== 'production') {\n // This if statement technically breaks the rules of hooks, but ENV variables never change during app lifecycle\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (themeClassName === '') {\n // eslint-disable-next-line no-console\n console.warn(`\n PortalCompatProvider: \"useThemeClassName()\" hook returned an empty string\n =============================================\n Make sure that PortalCompatProvider is rendered inside FluentProvider as a child.\n `);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n }\n\n return <PortalCompatContextProvider value={registerPortalEl}>{children}</PortalCompatContextProvider>;\n};\n"],"names":["React","fluentProviderClassNames","useThemeClassName","PortalCompatContextProvider","applyFocusVisiblePolyfill","CLASS_NAME_REGEX","RegExp","root","PortalCompatProvider","props","children","themeClassName","cssVariablesClassName","useMemo","match","registerPortalEl","useCallback","element","disposeFocusVisiblePolyfill","undefined","classList","add","ownerDocument","defaultView","remove","process","env","NODE_ENV","useEffect","console","warn","value"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,iBAAiB,QAAQ,6BAA6B;AACzF,SAASC,2BAA2B,QAAQ,wCAAwC;AACpF,SAASC,yBAAyB,QAAQ,0BAA0B;AAIpE,MAAMC,mBAAmB,IAAIC,OAAO,CAAC,QAAQ,EAAEL,yBAAyBM,IAAI,CAAC,KAAK,CAAC;AAEnF,OAAO,MAAMC,uBAAiEC,CAAAA;IAC5E,MAAM,EAAEC,QAAQ,EAAE,GAAGD;IAErB,MAAME,iBAAiBT;IACvB,MAAMU,wBAAwBZ,MAAMa,OAAO,CACzC,2GAA2G;IAC3G,8GAA8G;IAC9G;YAAMF;gBAAAA,wBAAAA,eAAeG,KAAK,CAACT,+BAArBM,4CAAAA,qBAAwC,CAAC,EAAE;OACjD;QAACA;KAAe;IAGlB,MAAMI,mBAAmBf,MAAMgB,WAAW,CACxCC,CAAAA;QACE,IAAIC,8BAA0C,IAAMC;QACpD,IAAIP,uBAAuB;YACzBK,QAAQG,SAAS,CAACC,GAAG,CAACT;YACtB,IAAIK,QAAQK,aAAa,CAACC,WAAW,EAAE;gBACrCL,8BAA8Bd,0BAA0Ba,SAASA,QAAQK,aAAa,CAACC,WAAW;YACpG;QACF;QAEA,OAAO;YACL,IAAIX,uBAAuB;gBACzBK,QAAQG,SAAS,CAACI,MAAM,CAACZ;YAC3B;YACAM;QACF;IACF,GACA;QAACN;KAAsB;IAGzB,IAAIa,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,+GAA+G;QAC/G,sDAAsD;QACtD3B,MAAM4B,SAAS,CAAC;YACd,IAAIjB,mBAAmB,IAAI;gBACzB,sCAAsC;gBACtCkB,QAAQC,IAAI,CAAC,CAAC;;;;MAIhB,CAAC;YACD;QACA,uDAAuD;QACzD,GAAG,EAAE;IACP;IAEA,qBAAO,oBAAC3B;QAA4B4B,OAAOhB;OAAmBL;AAChE,EAAE"}
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
define([
|
|
2
2
|
"require",
|
|
3
3
|
"exports",
|
|
4
|
-
"@swc/helpers/
|
|
4
|
+
"@swc/helpers/_/_interop_require_wildcard",
|
|
5
5
|
"react",
|
|
6
6
|
"@fluentui/react-components",
|
|
7
7
|
"@fluentui/react-portal-compat-context",
|
|
8
8
|
"@fluentui/react-tabster"
|
|
9
|
-
], function(require, exports,
|
|
9
|
+
], function(require, exports, _interop_require_wildcard, _react, _reactcomponents, _reactportalcompatcontext, _reacttabster) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", {
|
|
12
12
|
value: true
|
|
13
13
|
});
|
|
14
14
|
Object.defineProperty(exports, "PortalCompatProvider", {
|
|
15
15
|
enumerable: true,
|
|
16
|
-
get: ()
|
|
16
|
+
get: function() {
|
|
17
|
+
return PortalCompatProvider;
|
|
18
|
+
}
|
|
17
19
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const CLASS_NAME_REGEX = new RegExp(`([^\\s]*${_reactComponents.fluentProviderClassNames.root}\\w+)`);
|
|
20
|
+
_react = /*#__PURE__*/ _interop_require_wildcard._(_react);
|
|
21
|
+
const CLASS_NAME_REGEX = new RegExp(`([^\\s]*${_reactcomponents.fluentProviderClassNames.root}\\w+)`);
|
|
21
22
|
const PortalCompatProvider = (props)=>{
|
|
22
|
-
const { children
|
|
23
|
-
const themeClassName = (0,
|
|
23
|
+
const { children } = props;
|
|
24
|
+
const themeClassName = (0, _reactcomponents.useThemeClassName)();
|
|
24
25
|
const cssVariablesClassName = _react.useMemo(// Keep in sync with "packages/react-provider/src/components/FluentProvider/useFluentProviderThemeStyleTag.ts"
|
|
25
26
|
()=>{
|
|
26
27
|
var _themeClassName_match;
|
|
@@ -33,7 +34,7 @@ define([
|
|
|
33
34
|
if (cssVariablesClassName) {
|
|
34
35
|
element.classList.add(cssVariablesClassName);
|
|
35
36
|
if (element.ownerDocument.defaultView) {
|
|
36
|
-
disposeFocusVisiblePolyfill = (0,
|
|
37
|
+
disposeFocusVisiblePolyfill = (0, _reacttabster.applyFocusVisiblePolyfill)(element, element.ownerDocument.defaultView);
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
return ()=>{
|
|
@@ -60,7 +61,7 @@ define([
|
|
|
60
61
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
61
62
|
}, []);
|
|
62
63
|
}
|
|
63
|
-
return /*#__PURE__*/ _react.createElement(
|
|
64
|
+
return /*#__PURE__*/ _react.createElement(_reactportalcompatcontext.PortalCompatContextProvider, {
|
|
64
65
|
value: registerPortalEl
|
|
65
66
|
}, children);
|
|
66
67
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["PortalCompatProvider.js"],"sourcesContent":["import * as React from 'react';\nimport { fluentProviderClassNames, useThemeClassName } from '@fluentui/react-components';\nimport { PortalCompatContextProvider } from '@fluentui/react-portal-compat-context';\nimport { applyFocusVisiblePolyfill } from '@fluentui/react-tabster';\nconst CLASS_NAME_REGEX = new RegExp(`([^\\\\s]*${fluentProviderClassNames.root}\\\\w+)`);\nexport const PortalCompatProvider = (props)=>{\n const { children
|
|
1
|
+
{"version":3,"sources":["PortalCompatProvider.js"],"sourcesContent":["import * as React from 'react';\nimport { fluentProviderClassNames, useThemeClassName } from '@fluentui/react-components';\nimport { PortalCompatContextProvider } from '@fluentui/react-portal-compat-context';\nimport { applyFocusVisiblePolyfill } from '@fluentui/react-tabster';\nconst CLASS_NAME_REGEX = new RegExp(`([^\\\\s]*${fluentProviderClassNames.root}\\\\w+)`);\nexport const PortalCompatProvider = (props)=>{\n const { children } = props;\n const themeClassName = useThemeClassName();\n const cssVariablesClassName = React.useMemo(// \"themeClassName\" may contain multiple classes while we want to add only a class that hosts CSS variables\n // Keep in sync with \"packages/react-provider/src/components/FluentProvider/useFluentProviderThemeStyleTag.ts\"\n ()=>{\n var _themeClassName_match;\n return (_themeClassName_match = themeClassName.match(CLASS_NAME_REGEX)) === null || _themeClassName_match === void 0 ? void 0 : _themeClassName_match[1];\n }, [\n themeClassName\n ]);\n const registerPortalEl = React.useCallback((element)=>{\n let disposeFocusVisiblePolyfill = ()=>undefined;\n if (cssVariablesClassName) {\n element.classList.add(cssVariablesClassName);\n if (element.ownerDocument.defaultView) {\n disposeFocusVisiblePolyfill = applyFocusVisiblePolyfill(element, element.ownerDocument.defaultView);\n }\n }\n return ()=>{\n if (cssVariablesClassName) {\n element.classList.remove(cssVariablesClassName);\n }\n disposeFocusVisiblePolyfill();\n };\n }, [\n cssVariablesClassName\n ]);\n if (process.env.NODE_ENV !== 'production') {\n // This if statement technically breaks the rules of hooks, but ENV variables never change during app lifecycle\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(()=>{\n if (themeClassName === '') {\n // eslint-disable-next-line no-console\n console.warn(`\n PortalCompatProvider: \"useThemeClassName()\" hook returned an empty string\n =============================================\n Make sure that PortalCompatProvider is rendered inside FluentProvider as a child.\n `);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n }\n return /*#__PURE__*/ React.createElement(PortalCompatContextProvider, {\n value: registerPortalEl\n }, children);\n};\n"],"names":["PortalCompatProvider","CLASS_NAME_REGEX","RegExp","fluentProviderClassNames","root","props","children","themeClassName","useThemeClassName","cssVariablesClassName","React","useMemo","_themeClassName_match","match","registerPortalEl","useCallback","element","disposeFocusVisiblePolyfill","undefined","classList","add","ownerDocument","defaultView","applyFocusVisiblePolyfill","remove","process","env","NODE_ENV","useEffect","console","warn","createElement","PortalCompatContextProvider","value"],"mappings":";;;;IAAuB;IACqC;IAChB;IACF;;;;;;mCAE7BA;;;mBAAAA;;;;IADb,MAAMC,mBAAmB,IAAIC,OAAO,CAAC,QAAQ,EAAEC,yCAAwB,CAACC,IAAI,CAAC,KAAK,CAAC;IAC5E,MAAMJ,uBAAuB,CAACK;QACjC,MAAM,EAAEC,QAAQ,EAAE,GAAGD;QACrB,MAAME,iBAAiBC,IAAAA,kCAAiB;QACxC,MAAMC,wBAAwBC,OAAMC,OAAO,CAC3C,8GAA8G;QAC9G;YACI,IAAIC;YACJ,OAAO,AAACA,CAAAA,wBAAwBL,eAAeM,KAAK,CAACZ,iBAAgB,MAAO,QAAQW,0BAA0B,KAAK,IAAI,KAAK,IAAIA,qBAAqB,CAAC,EAAE;QAC5J,GAAG;YACCL;SACH;QACD,MAAMO,mBAAmBJ,OAAMK,WAAW,CAAC,CAACC;YACxC,IAAIC,8BAA8B,IAAIC;YACtC,IAAIT,uBAAuB;gBACvBO,QAAQG,SAAS,CAACC,GAAG,CAACX;gBACtB,IAAIO,QAAQK,aAAa,CAACC,WAAW,EAAE;oBACnCL,8BAA8BM,IAAAA,uCAAyB,EAACP,SAASA,QAAQK,aAAa,CAACC,WAAW;gBACtG;YACJ;YACA,OAAO;gBACH,IAAIb,uBAAuB;oBACvBO,QAAQG,SAAS,CAACK,MAAM,CAACf;gBAC7B;gBACAQ;YACJ;QACJ,GAAG;YACCR;SACH;QACD,IAAIgB,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;YACvC,+GAA+G;YAC/G,sDAAsD;YACtDjB,OAAMkB,SAAS,CAAC;gBACZ,IAAIrB,mBAAmB,IAAI;oBACvB,sCAAsC;oBACtCsB,QAAQC,IAAI,CAAC,CAAC;;;;MAIxB,CAAC;gBACK;YACJ,uDAAuD;YACvD,GAAG,EAAE;QACT;QACA,OAAO,WAAW,GAAGpB,OAAMqB,aAAa,CAACC,qDAA2B,EAAE;YAClEC,OAAOnB;QACX,GAAGR;IACP"}
|
package/lib-amd/index.js
CHANGED
|
@@ -2,13 +2,15 @@ define([
|
|
|
2
2
|
"require",
|
|
3
3
|
"exports",
|
|
4
4
|
"./PortalCompatProvider"
|
|
5
|
-
], function(require, exports,
|
|
5
|
+
], function(require, exports, _PortalCompatProvider) {
|
|
6
6
|
"use strict";
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
10
|
Object.defineProperty(exports, "PortalCompatProvider", {
|
|
11
11
|
enumerable: true,
|
|
12
|
-
get: ()
|
|
12
|
+
get: function() {
|
|
13
|
+
return _PortalCompatProvider.PortalCompatProvider;
|
|
14
|
+
}
|
|
13
15
|
});
|
|
14
16
|
});
|
package/lib-amd/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.js"],"sourcesContent":["export { PortalCompatProvider } from './PortalCompatProvider';\n"],"names":["PortalCompatProvider"],"mappings":";;;IAAqC;;;;;;mCAA5BA
|
|
1
|
+
{"version":3,"sources":["index.js"],"sourcesContent":["export { PortalCompatProvider } from './PortalCompatProvider';\n"],"names":["PortalCompatProvider"],"mappings":";;;IAAqC;;;;;;mCAA5BA;;;mBAAAA,0CAAoB"}
|
|
@@ -4,17 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "PortalCompatProvider", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return PortalCompatProvider;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const
|
|
10
|
-
const _react = /*#__PURE__*/
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const CLASS_NAME_REGEX = new RegExp(`([^\\s]*${
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
14
|
+
const _reactportalcompatcontext = require("@fluentui/react-portal-compat-context");
|
|
15
|
+
const _reacttabster = require("@fluentui/react-tabster");
|
|
16
|
+
const CLASS_NAME_REGEX = new RegExp(`([^\\s]*${_reactcomponents.fluentProviderClassNames.root}\\w+)`);
|
|
15
17
|
const PortalCompatProvider = (props)=>{
|
|
16
|
-
const { children
|
|
17
|
-
const themeClassName = (0,
|
|
18
|
+
const { children } = props;
|
|
19
|
+
const themeClassName = (0, _reactcomponents.useThemeClassName)();
|
|
18
20
|
const cssVariablesClassName = _react.useMemo(// Keep in sync with "packages/react-provider/src/components/FluentProvider/useFluentProviderThemeStyleTag.ts"
|
|
19
21
|
()=>{
|
|
20
22
|
var _themeClassName_match;
|
|
@@ -27,7 +29,7 @@ const PortalCompatProvider = (props)=>{
|
|
|
27
29
|
if (cssVariablesClassName) {
|
|
28
30
|
element.classList.add(cssVariablesClassName);
|
|
29
31
|
if (element.ownerDocument.defaultView) {
|
|
30
|
-
disposeFocusVisiblePolyfill = (0,
|
|
32
|
+
disposeFocusVisiblePolyfill = (0, _reacttabster.applyFocusVisiblePolyfill)(element, element.ownerDocument.defaultView);
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
35
|
return ()=>{
|
|
@@ -54,7 +56,7 @@ const PortalCompatProvider = (props)=>{
|
|
|
54
56
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
55
57
|
}, []);
|
|
56
58
|
}
|
|
57
|
-
return /*#__PURE__*/ _react.createElement(
|
|
59
|
+
return /*#__PURE__*/ _react.createElement(_reactportalcompatcontext.PortalCompatContextProvider, {
|
|
58
60
|
value: registerPortalEl
|
|
59
61
|
}, children);
|
|
60
62
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["PortalCompatProvider.js"],"sourcesContent":["import * as React from 'react';\nimport { fluentProviderClassNames, useThemeClassName } from '@fluentui/react-components';\nimport { PortalCompatContextProvider } from '@fluentui/react-portal-compat-context';\nimport { applyFocusVisiblePolyfill } from '@fluentui/react-tabster';\nconst CLASS_NAME_REGEX = new RegExp(`([^\\\\s]*${fluentProviderClassNames.root}\\\\w+)`);\nexport const PortalCompatProvider = (props)=>{\n const { children
|
|
1
|
+
{"version":3,"sources":["PortalCompatProvider.js"],"sourcesContent":["import * as React from 'react';\nimport { fluentProviderClassNames, useThemeClassName } from '@fluentui/react-components';\nimport { PortalCompatContextProvider } from '@fluentui/react-portal-compat-context';\nimport { applyFocusVisiblePolyfill } from '@fluentui/react-tabster';\nconst CLASS_NAME_REGEX = new RegExp(`([^\\\\s]*${fluentProviderClassNames.root}\\\\w+)`);\nexport const PortalCompatProvider = (props)=>{\n const { children } = props;\n const themeClassName = useThemeClassName();\n const cssVariablesClassName = React.useMemo(// \"themeClassName\" may contain multiple classes while we want to add only a class that hosts CSS variables\n // Keep in sync with \"packages/react-provider/src/components/FluentProvider/useFluentProviderThemeStyleTag.ts\"\n ()=>{\n var _themeClassName_match;\n return (_themeClassName_match = themeClassName.match(CLASS_NAME_REGEX)) === null || _themeClassName_match === void 0 ? void 0 : _themeClassName_match[1];\n }, [\n themeClassName\n ]);\n const registerPortalEl = React.useCallback((element)=>{\n let disposeFocusVisiblePolyfill = ()=>undefined;\n if (cssVariablesClassName) {\n element.classList.add(cssVariablesClassName);\n if (element.ownerDocument.defaultView) {\n disposeFocusVisiblePolyfill = applyFocusVisiblePolyfill(element, element.ownerDocument.defaultView);\n }\n }\n return ()=>{\n if (cssVariablesClassName) {\n element.classList.remove(cssVariablesClassName);\n }\n disposeFocusVisiblePolyfill();\n };\n }, [\n cssVariablesClassName\n ]);\n if (process.env.NODE_ENV !== 'production') {\n // This if statement technically breaks the rules of hooks, but ENV variables never change during app lifecycle\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(()=>{\n if (themeClassName === '') {\n // eslint-disable-next-line no-console\n console.warn(`\n PortalCompatProvider: \"useThemeClassName()\" hook returned an empty string\n =============================================\n Make sure that PortalCompatProvider is rendered inside FluentProvider as a child.\n `);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n }\n return /*#__PURE__*/ React.createElement(PortalCompatContextProvider, {\n value: registerPortalEl\n }, children);\n};\n"],"names":["PortalCompatProvider","CLASS_NAME_REGEX","RegExp","fluentProviderClassNames","root","props","children","themeClassName","useThemeClassName","cssVariablesClassName","React","useMemo","_themeClassName_match","match","registerPortalEl","useCallback","element","disposeFocusVisiblePolyfill","undefined","classList","add","ownerDocument","defaultView","applyFocusVisiblePolyfill","remove","process","env","NODE_ENV","useEffect","console","warn","createElement","PortalCompatContextProvider","value"],"mappings":";;;;+BAKaA;;;eAAAA;;;;iEALU;iCACqC;0CAChB;8BACF;AAC1C,MAAMC,mBAAmB,IAAIC,OAAO,CAAC,QAAQ,EAAEC,yCAAwB,CAACC,IAAI,CAAC,KAAK,CAAC;AAC5E,MAAMJ,uBAAuB,CAACK;IACjC,MAAM,EAAEC,QAAQ,EAAE,GAAGD;IACrB,MAAME,iBAAiBC,IAAAA,kCAAiB;IACxC,MAAMC,wBAAwBC,OAAMC,OAAO,CAC3C,8GAA8G;IAC9G;QACI,IAAIC;QACJ,OAAO,AAACA,CAAAA,wBAAwBL,eAAeM,KAAK,CAACZ,iBAAgB,MAAO,QAAQW,0BAA0B,KAAK,IAAI,KAAK,IAAIA,qBAAqB,CAAC,EAAE;IAC5J,GAAG;QACCL;KACH;IACD,MAAMO,mBAAmBJ,OAAMK,WAAW,CAAC,CAACC;QACxC,IAAIC,8BAA8B,IAAIC;QACtC,IAAIT,uBAAuB;YACvBO,QAAQG,SAAS,CAACC,GAAG,CAACX;YACtB,IAAIO,QAAQK,aAAa,CAACC,WAAW,EAAE;gBACnCL,8BAA8BM,IAAAA,uCAAyB,EAACP,SAASA,QAAQK,aAAa,CAACC,WAAW;YACtG;QACJ;QACA,OAAO;YACH,IAAIb,uBAAuB;gBACvBO,QAAQG,SAAS,CAACK,MAAM,CAACf;YAC7B;YACAQ;QACJ;IACJ,GAAG;QACCR;KACH;IACD,IAAIgB,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACvC,+GAA+G;QAC/G,sDAAsD;QACtDjB,OAAMkB,SAAS,CAAC;YACZ,IAAIrB,mBAAmB,IAAI;gBACvB,sCAAsC;gBACtCsB,QAAQC,IAAI,CAAC,CAAC;;;;MAIxB,CAAC;YACK;QACJ,uDAAuD;QACvD,GAAG,EAAE;IACT;IACA,OAAO,WAAW,GAAGpB,OAAMqB,aAAa,CAACC,qDAA2B,EAAE;QAClEC,OAAOnB;IACX,GAAGR;AACP"}
|
package/lib-commonjs/index.js
CHANGED
|
@@ -4,6 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "PortalCompatProvider", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return _PortalCompatProvider.PortalCompatProvider;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const
|
|
11
|
+
const _PortalCompatProvider = require("./PortalCompatProvider");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.js"],"sourcesContent":["export { PortalCompatProvider } from './PortalCompatProvider';\n"],"names":["PortalCompatProvider"],"mappings":";;;;+BAASA
|
|
1
|
+
{"version":3,"sources":["index.js"],"sourcesContent":["export { PortalCompatProvider } from './PortalCompatProvider';\n"],"names":["PortalCompatProvider"],"mappings":";;;;+BAASA;;;eAAAA,0CAAoB;;;sCAAQ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-portal-compat",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.86",
|
|
4
4
|
"description": "A package that contains compatibility layer for React Portals",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
"@fluentui/scripts-tasks": "*"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@fluentui/react-portal-compat-context": "^9.0.
|
|
38
|
-
"@fluentui/react-tabster": "^9.12.
|
|
39
|
-
"@swc/helpers": "^0.
|
|
37
|
+
"@fluentui/react-portal-compat-context": "^9.0.7",
|
|
38
|
+
"@fluentui/react-tabster": "^9.12.6",
|
|
39
|
+
"@swc/helpers": "^0.5.1"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@fluentui/react-components": "^9.30.
|
|
43
|
-
"@types/react": ">=16.
|
|
44
|
-
"react": ">=16.
|
|
42
|
+
"@fluentui/react-components": "^9.30.2",
|
|
43
|
+
"@types/react": ">=16.14.0 <19.0.0",
|
|
44
|
+
"react": ">=16.14.0 <19.0.0"
|
|
45
45
|
},
|
|
46
46
|
"beachball": {
|
|
47
47
|
"disallowedChangeTypes": [
|