@fluentui/react-portal-compat 9.0.150 → 9.0.152
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 +22 -2
- package/lib/PortalCompatProvider.js +1 -0
- package/lib/PortalCompatProvider.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib-amd/PortalCompatProvider.js +4 -3
- package/lib-amd/PortalCompatProvider.js.map +1 -1
- package/lib-amd/index.js.map +1 -1
- package/lib-commonjs/PortalCompatProvider.js +4 -3
- package/lib-commonjs/PortalCompatProvider.js.map +1 -1
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,32 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-portal-compat
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 04 Jul 2024 15:13:32 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.0.152](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal-compat_v9.0.152)
|
|
8
|
+
|
|
9
|
+
Thu, 04 Jul 2024 15:13:32 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-portal-compat_v9.0.151..@fluentui/react-portal-compat_v9.0.152)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- Bump @fluentui/react-components to v9.54.4 ([PR #31918](https://github.com/microsoft/fluentui/pull/31918) by beachball)
|
|
15
|
+
|
|
16
|
+
## [9.0.151](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal-compat_v9.0.151)
|
|
17
|
+
|
|
18
|
+
Mon, 01 Jul 2024 20:30:26 GMT
|
|
19
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-portal-compat_v9.0.150..@fluentui/react-portal-compat_v9.0.151)
|
|
20
|
+
|
|
21
|
+
### Patches
|
|
22
|
+
|
|
23
|
+
- chore: add eslint react-compiler ([PR #31457](https://github.com/microsoft/fluentui/pull/31457) by seanmonahan@microsoft.com)
|
|
24
|
+
- Bump @fluentui/react-tabster to v9.22.1 ([PR #31861](https://github.com/microsoft/fluentui/pull/31861) by beachball)
|
|
25
|
+
- Bump @fluentui/react-components to v9.54.3 ([PR #31861](https://github.com/microsoft/fluentui/pull/31861) by beachball)
|
|
26
|
+
|
|
7
27
|
## [9.0.150](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal-compat_v9.0.150)
|
|
8
28
|
|
|
9
|
-
Mon, 17 Jun 2024 07:
|
|
29
|
+
Mon, 17 Jun 2024 07:34:17 GMT
|
|
10
30
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-portal-compat_v9.0.149..@fluentui/react-portal-compat_v9.0.150)
|
|
11
31
|
|
|
12
32
|
### Patches
|
|
@@ -4,6 +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+)`, 'g');
|
|
6
6
|
export function useProviderThemeClasses() {
|
|
7
|
+
'use no memo';
|
|
7
8
|
const themeClassName = useThemeClassName();
|
|
8
9
|
const cssVariablesClasses = React.useMemo(// "themeClassName" may contain multiple classes while we want to add only classes that host CSS variables
|
|
9
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+)`, 'g');\n\nexport function useProviderThemeClasses(): string[] {\n const themeClassName = useThemeClassName();\n const cssVariablesClasses = React.useMemo<string[]>(\n // \"themeClassName\" may contain multiple classes while we want to add only classes that host CSS variables\n // Keep in sync with \"packages/react-provider/src/components/FluentProvider/useFluentProviderThemeStyleTag.ts\"\n () => themeClassName.match(CLASS_NAME_REGEX) ?? [],\n [themeClassName],\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 cssVariablesClasses;\n}\n\nexport const PortalCompatProvider: React.FC<{ children?: React.ReactNode }> = props => {\n const { children } = props;\n const cssVariablesClasses = useProviderThemeClasses();\n\n const registerPortalEl = React.useCallback<RegisterPortalFn>(\n element => {\n let disposeFocusVisiblePolyfill: () => void = () => undefined;\n\n element.classList.add(...cssVariablesClasses);\n if (element.ownerDocument.defaultView) {\n disposeFocusVisiblePolyfill = applyFocusVisiblePolyfill(element, element.ownerDocument.defaultView);\n }\n\n return () => {\n element.classList.remove(...cssVariablesClasses);\n disposeFocusVisiblePolyfill();\n };\n },\n [cssVariablesClasses],\n );\n\n return <PortalCompatContextProvider value={registerPortalEl}>{children}</PortalCompatContextProvider>;\n};\n"],"names":["React","fluentProviderClassNames","useThemeClassName","PortalCompatContextProvider","applyFocusVisiblePolyfill","CLASS_NAME_REGEX","RegExp","root","useProviderThemeClasses","themeClassName","cssVariablesClasses","useMemo","match","process","env","NODE_ENV","useEffect","console","warn","PortalCompatProvider","props","children","registerPortalEl","useCallback","element","disposeFocusVisiblePolyfill","undefined","classList","add","ownerDocument","defaultView","remove","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,EAAE;AAErF,OAAO,SAASC;IACd,MAAMC,iBAAiBP;IACvB,MAAMQ,sBAAsBV,MAAMW,OAAO,CACvC,0GAA0G;IAC1G,8GAA8G;IAC9G;YAAMF;eAAAA,CAAAA,wBAAAA,eAAeG,KAAK,CAACP,+BAArBI,mCAAAA,wBAA0C,EAAE;IAAD,GACjD;QAACA;KAAe;IAGlB,IAAII,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,+GAA+G;QAC/G,sDAAsD;QACtDf,MAAMgB,SAAS,CAAC;YACd,IAAIP,mBAAmB,IAAI;gBACzB,sCAAsC;gBACtCQ,QAAQC,IAAI,CAAC,CAAC;;;;MAIhB,CAAC;YACD;QACA,uDAAuD;QACzD,GAAG,EAAE;IACP;IAEA,OAAOR;AACT;AAEA,OAAO,MAAMS,uBAAiEC,CAAAA;IAC5E,MAAM,EAAEC,QAAQ,EAAE,GAAGD;IACrB,MAAMV,sBAAsBF;IAE5B,MAAMc,mBAAmBtB,MAAMuB,WAAW,CACxCC,CAAAA;QACE,IAAIC,8BAA0C,IAAMC;QAEpDF,QAAQG,SAAS,CAACC,GAAG,IAAIlB;QACzB,IAAIc,QAAQK,aAAa,CAACC,WAAW,EAAE;YACrCL,8BAA8BrB,0BAA0BoB,SAASA,QAAQK,aAAa,CAACC,WAAW;QACpG;QAEA,OAAO;YACLN,QAAQG,SAAS,CAACI,MAAM,IAAIrB;YAC5Be;QACF;IACF,GACA;QAACf;KAAoB;IAGvB,qBAAO,oBAACP;QAA4B6B,OAAOV;OAAmBD;AAChE,EAAE"}
|
|
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+)`, 'g');\n\nexport function useProviderThemeClasses(): string[] {\n 'use no memo';\n\n const themeClassName = useThemeClassName();\n const cssVariablesClasses = React.useMemo<string[]>(\n // \"themeClassName\" may contain multiple classes while we want to add only classes that host CSS variables\n // Keep in sync with \"packages/react-provider/src/components/FluentProvider/useFluentProviderThemeStyleTag.ts\"\n () => themeClassName.match(CLASS_NAME_REGEX) ?? [],\n [themeClassName],\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 cssVariablesClasses;\n}\n\nexport const PortalCompatProvider: React.FC<{ children?: React.ReactNode }> = props => {\n const { children } = props;\n const cssVariablesClasses = useProviderThemeClasses();\n\n const registerPortalEl = React.useCallback<RegisterPortalFn>(\n element => {\n let disposeFocusVisiblePolyfill: () => void = () => undefined;\n\n element.classList.add(...cssVariablesClasses);\n if (element.ownerDocument.defaultView) {\n disposeFocusVisiblePolyfill = applyFocusVisiblePolyfill(element, element.ownerDocument.defaultView);\n }\n\n return () => {\n element.classList.remove(...cssVariablesClasses);\n disposeFocusVisiblePolyfill();\n };\n },\n [cssVariablesClasses],\n );\n\n return <PortalCompatContextProvider value={registerPortalEl}>{children}</PortalCompatContextProvider>;\n};\n"],"names":["React","fluentProviderClassNames","useThemeClassName","PortalCompatContextProvider","applyFocusVisiblePolyfill","CLASS_NAME_REGEX","RegExp","root","useProviderThemeClasses","themeClassName","cssVariablesClasses","useMemo","match","process","env","NODE_ENV","useEffect","console","warn","PortalCompatProvider","props","children","registerPortalEl","useCallback","element","disposeFocusVisiblePolyfill","undefined","classList","add","ownerDocument","defaultView","remove","value"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","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,EAAE;AAErF,OAAO,SAASC;IACd;IAEA,MAAMC,iBAAiBP;IACvB,MAAMQ,sBAAsBV,MAAMW,OAAO,CACvC,0GAA0G;IAC1G,8GAA8G;IAC9G;YAAMF;eAAAA,CAAAA,wBAAAA,eAAeG,KAAK,CAACP,+BAArBI,mCAAAA,wBAA0C,EAAE;IAAD,GACjD;QAACA;KAAe;IAGlB,IAAII,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,+GAA+G;QAC/G,sDAAsD;QACtDf,MAAMgB,SAAS,CAAC;YACd,IAAIP,mBAAmB,IAAI;gBACzB,sCAAsC;gBACtCQ,QAAQC,IAAI,CAAC,CAAC;;;;MAIhB,CAAC;YACD;QACA,uDAAuD;QACzD,GAAG,EAAE;IACP;IAEA,OAAOR;AACT;AAEA,OAAO,MAAMS,uBAAiEC,CAAAA;IAC5E,MAAM,EAAEC,QAAQ,EAAE,GAAGD;IACrB,MAAMV,sBAAsBF;IAE5B,MAAMc,mBAAmBtB,MAAMuB,WAAW,CACxCC,CAAAA;QACE,IAAIC,8BAA0C,IAAMC;QAEpDF,QAAQG,SAAS,CAACC,GAAG,IAAIlB;QACzB,IAAIc,QAAQK,aAAa,CAACC,WAAW,EAAE;YACrCL,8BAA8BrB,0BAA0BoB,SAASA,QAAQK,aAAa,CAACC,WAAW;QACpG;QAEA,OAAO;YACLN,QAAQG,SAAS,CAACI,MAAM,IAAIrB;YAC5Be;QACF;IACF,GACA;QAACf;KAAoB;IAGvB,qBAAO,oBAACP;QAA4B6B,OAAOV;OAAmBD;AAChE,EAAE"}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export { PortalCompatProvider } from './PortalCompatProvider';\n"],"names":["PortalCompatProvider"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,yBAAyB"}
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export { PortalCompatProvider } from './PortalCompatProvider';\n"],"names":["PortalCompatProvider"],"rangeMappings":"","mappings":"AAAA,SAASA,oBAAoB,QAAQ,yBAAyB"}
|
|
@@ -18,16 +18,17 @@ define([
|
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
_export(exports, {
|
|
21
|
-
useProviderThemeClasses: function() {
|
|
22
|
-
return useProviderThemeClasses;
|
|
23
|
-
},
|
|
24
21
|
PortalCompatProvider: function() {
|
|
25
22
|
return PortalCompatProvider;
|
|
23
|
+
},
|
|
24
|
+
useProviderThemeClasses: function() {
|
|
25
|
+
return useProviderThemeClasses;
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
_react = /*#__PURE__*/ _interop_require_wildcard._(_react);
|
|
29
29
|
const CLASS_NAME_REGEX = new RegExp(`([^\\s]*${_reactcomponents.fluentProviderClassNames.root}\\w+)`, 'g');
|
|
30
30
|
function useProviderThemeClasses() {
|
|
31
|
+
'use no memo';
|
|
31
32
|
const themeClassName = (0, _reactcomponents.useThemeClassName)();
|
|
32
33
|
const cssVariablesClasses = _react.useMemo(// Keep in sync with "packages/react-provider/src/components/FluentProvider/useFluentProviderThemeStyleTag.ts"
|
|
33
34
|
()=>{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["PortalCompatProvider.
|
|
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+)`, 'g');\n\nexport function useProviderThemeClasses(): string[] {\n 'use no memo';\n\n const themeClassName = useThemeClassName();\n const cssVariablesClasses = React.useMemo<string[]>(\n // \"themeClassName\" may contain multiple classes while we want to add only classes that host CSS variables\n // Keep in sync with \"packages/react-provider/src/components/FluentProvider/useFluentProviderThemeStyleTag.ts\"\n () => themeClassName.match(CLASS_NAME_REGEX) ?? [],\n [themeClassName],\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 cssVariablesClasses;\n}\n\nexport const PortalCompatProvider: React.FC<{ children?: React.ReactNode }> = props => {\n const { children } = props;\n const cssVariablesClasses = useProviderThemeClasses();\n\n const registerPortalEl = React.useCallback<RegisterPortalFn>(\n element => {\n let disposeFocusVisiblePolyfill: () => void = () => undefined;\n\n element.classList.add(...cssVariablesClasses);\n if (element.ownerDocument.defaultView) {\n disposeFocusVisiblePolyfill = applyFocusVisiblePolyfill(element, element.ownerDocument.defaultView);\n }\n\n return () => {\n element.classList.remove(...cssVariablesClasses);\n disposeFocusVisiblePolyfill();\n };\n },\n [cssVariablesClasses],\n );\n\n return <PortalCompatContextProvider value={registerPortalEl}>{children}</PortalCompatContextProvider>;\n};\n"],"names":["PortalCompatProvider","useProviderThemeClasses","CLASS_NAME_REGEX","RegExp","fluentProviderClassNames","root","themeClassName","useThemeClassName","cssVariablesClasses","React","useMemo","match","process","env","NODE_ENV","useEffect","console","warn","props","children","registerPortalEl","useCallback","element","disposeFocusVisiblePolyfill","undefined","classList","add","ownerDocument","defaultView","applyFocusVisiblePolyfill","remove","createElement","PortalCompatContextProvider","value"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;IAAuB;IACqC;IAChB;IACF;;;;;;;;;;;;;QAoC7BA,oBAAAA;mBAAAA;;QA9BGC,uBAAAA;mBAAAA;;;;IAFhB,MAAMC,mBAAmB,IAAIC,OAAO,CAAC,QAAQ,EAAEC,yCAAAA,CAAyBC,IAAI,CAAC,KAAK,CAAC,EAAE;IAE9E,SAASJ;QACd;QAEA,MAAMK,iBAAiBC,IAAAA,kCAAAA;QACvB,MAAMC,sBAAsBC,OAAMC,OAAO,CAEvC,8GAA8G;QAC9G;gBAAMJ;mBAAAA,CAAAA,wBAAAA,eAAeK,KAAK,CAACT,iBAAAA,MAAAA,QAArBI,0BAAAA,KAAAA,IAAAA,wBAA0C,EAAE;QAAD,GACjD;YAACA;SAAe;QAGlB,IAAIM,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;YACzC,+GAA+G;YAC/G,sDAAsD;YACtDL,OAAMM,SAAS,CAAC;gBACd,IAAIT,mBAAmB,IAAI;oBACzB,sCAAsC;oBACtCU,QAAQC,IAAI,CAAC,CAAC;;;;MAIhB,CAAC;gBACD;YACA,uDAAuD;YACzD,GAAG,EAAE;QACP;QAEA,OAAOT;IACT;IAEO,MAAMR,uBAAiEkB,CAAAA;QAC5E,MAAM,EAAEC,QAAQ,EAAE,GAAGD;QACrB,MAAMV,sBAAsBP;QAE5B,MAAMmB,mBAAmBX,OAAMY,WAAW,CACxCC,CAAAA;YACE,IAAIC,8BAA0C,IAAMC;YAEpDF,QAAQG,SAAS,CAACC,GAAG,IAAIlB;YACzB,IAAIc,QAAQK,aAAa,CAACC,WAAW,EAAE;gBACrCL,8BAA8BM,IAAAA,uCAAAA,EAA0BP,SAASA,QAAQK,aAAa,CAACC,WAAW;YACpG;YAEA,OAAO;gBACLN,QAAQG,SAAS,CAACK,MAAM,IAAItB;gBAC5Be;YACF;QACF,GACA;YAACf;SAAoB;QAGvB,OAAA,WAAA,GAAOC,OAAAsB,aAAA,CAACC,qDAAAA,EAAAA;YAA4BC,OAAOb;WAAmBD;IAChE"}
|
package/lib-amd/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export { PortalCompatProvider } from './PortalCompatProvider';\n"],"names":["PortalCompatProvider"],"rangeMappings":";;;;;;;;;;;;","mappings":";;;IAAqC;;;;;;mCAA5BA;;;mBAAAA,0CAAoB"}
|
|
@@ -9,11 +9,11 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
useProviderThemeClasses: function() {
|
|
13
|
-
return useProviderThemeClasses;
|
|
14
|
-
},
|
|
15
12
|
PortalCompatProvider: function() {
|
|
16
13
|
return PortalCompatProvider;
|
|
14
|
+
},
|
|
15
|
+
useProviderThemeClasses: function() {
|
|
16
|
+
return useProviderThemeClasses;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
@@ -23,6 +23,7 @@ const _reactportalcompatcontext = require("@fluentui/react-portal-compat-context
|
|
|
23
23
|
const _reacttabster = require("@fluentui/react-tabster");
|
|
24
24
|
const CLASS_NAME_REGEX = new RegExp(`([^\\s]*${_reactcomponents.fluentProviderClassNames.root}\\w+)`, 'g');
|
|
25
25
|
function useProviderThemeClasses() {
|
|
26
|
+
'use no memo';
|
|
26
27
|
const themeClassName = (0, _reactcomponents.useThemeClassName)();
|
|
27
28
|
const cssVariablesClasses = _react.useMemo(// Keep in sync with "packages/react-provider/src/components/FluentProvider/useFluentProviderThemeStyleTag.ts"
|
|
28
29
|
()=>{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["PortalCompatProvider.
|
|
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+)`, 'g');\n\nexport function useProviderThemeClasses(): string[] {\n 'use no memo';\n\n const themeClassName = useThemeClassName();\n const cssVariablesClasses = React.useMemo<string[]>(\n // \"themeClassName\" may contain multiple classes while we want to add only classes that host CSS variables\n // Keep in sync with \"packages/react-provider/src/components/FluentProvider/useFluentProviderThemeStyleTag.ts\"\n () => themeClassName.match(CLASS_NAME_REGEX) ?? [],\n [themeClassName],\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 cssVariablesClasses;\n}\n\nexport const PortalCompatProvider: React.FC<{ children?: React.ReactNode }> = props => {\n const { children } = props;\n const cssVariablesClasses = useProviderThemeClasses();\n\n const registerPortalEl = React.useCallback<RegisterPortalFn>(\n element => {\n let disposeFocusVisiblePolyfill: () => void = () => undefined;\n\n element.classList.add(...cssVariablesClasses);\n if (element.ownerDocument.defaultView) {\n disposeFocusVisiblePolyfill = applyFocusVisiblePolyfill(element, element.ownerDocument.defaultView);\n }\n\n return () => {\n element.classList.remove(...cssVariablesClasses);\n disposeFocusVisiblePolyfill();\n };\n },\n [cssVariablesClasses],\n );\n\n return <PortalCompatContextProvider value={registerPortalEl}>{children}</PortalCompatContextProvider>;\n};\n"],"names":["PortalCompatProvider","useProviderThemeClasses","CLASS_NAME_REGEX","RegExp","fluentProviderClassNames","root","themeClassName","useThemeClassName","cssVariablesClasses","React","useMemo","match","process","env","NODE_ENV","useEffect","console","warn","props","children","registerPortalEl","useCallback","element","disposeFocusVisiblePolyfill","undefined","classList","add","ownerDocument","defaultView","applyFocusVisiblePolyfill","remove","createElement","PortalCompatContextProvider","value"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAuCaA,oBAAAA;eAAAA;;IA9BGC,uBAAAA;eAAAA;;;;iEATO;iCACqC;0CAChB;8BACF;AAI1C,MAAMC,mBAAmB,IAAIC,OAAO,CAAC,QAAQ,EAAEC,yCAAAA,CAAyBC,IAAI,CAAC,KAAK,CAAC,EAAE;AAE9E,SAASJ;IACd;IAEA,MAAMK,iBAAiBC,IAAAA,kCAAAA;IACvB,MAAMC,sBAAsBC,OAAMC,OAAO,CAEvC,8GAA8G;IAC9G;YAAMJ;eAAAA,CAAAA,wBAAAA,eAAeK,KAAK,CAACT,iBAAAA,MAAAA,QAArBI,0BAAAA,KAAAA,IAAAA,wBAA0C,EAAE;IAAD,GACjD;QAACA;KAAe;IAGlB,IAAIM,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,+GAA+G;QAC/G,sDAAsD;QACtDL,OAAMM,SAAS,CAAC;YACd,IAAIT,mBAAmB,IAAI;gBACzB,sCAAsC;gBACtCU,QAAQC,IAAI,CAAC,CAAC;;;;MAIhB,CAAC;YACD;QACA,uDAAuD;QACzD,GAAG,EAAE;IACP;IAEA,OAAOT;AACT;AAEO,MAAMR,uBAAiEkB,CAAAA;IAC5E,MAAM,EAAEC,QAAQ,EAAE,GAAGD;IACrB,MAAMV,sBAAsBP;IAE5B,MAAMmB,mBAAmBX,OAAMY,WAAW,CACxCC,CAAAA;QACE,IAAIC,8BAA0C,IAAMC;QAEpDF,QAAQG,SAAS,CAACC,GAAG,IAAIlB;QACzB,IAAIc,QAAQK,aAAa,CAACC,WAAW,EAAE;YACrCL,8BAA8BM,IAAAA,uCAAAA,EAA0BP,SAASA,QAAQK,aAAa,CAACC,WAAW;QACpG;QAEA,OAAO;YACLN,QAAQG,SAAS,CAACK,MAAM,IAAItB;YAC5Be;QACF;IACF,GACA;QAACf;KAAoB;IAGvB,OAAA,WAAA,GAAOC,OAAAsB,aAAA,CAACC,qDAAAA,EAAAA;QAA4BC,OAAOb;OAAmBD;AAChE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export { PortalCompatProvider } from './PortalCompatProvider';\n"],"names":["PortalCompatProvider"],"rangeMappings":";;;;;;;;;;","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.152",
|
|
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",
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@fluentui/react-portal-compat-context": "^9.0.11",
|
|
41
|
-
"@fluentui/react-tabster": "^9.22.
|
|
41
|
+
"@fluentui/react-tabster": "^9.22.1",
|
|
42
42
|
"@swc/helpers": "^0.5.1"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@fluentui/react-components": "^9.54.
|
|
45
|
+
"@fluentui/react-components": "^9.54.4",
|
|
46
46
|
"@types/react": ">=16.14.0 <19.0.0",
|
|
47
47
|
"react": ">=16.14.0 <19.0.0"
|
|
48
48
|
},
|