@fluentui/react-provider 9.10.3 → 9.10.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.json CHANGED
@@ -2,7 +2,40 @@
2
2
  "name": "@fluentui/react-provider",
3
3
  "entries": [
4
4
  {
5
- "date": "Wed, 04 Oct 2023 08:41:55 GMT",
5
+ "date": "Thu, 05 Oct 2023 15:17:59 GMT",
6
+ "tag": "@fluentui/react-provider_v9.10.4",
7
+ "version": "9.10.4",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "bernardo.sunderhus@gmail.com",
12
+ "package": "@fluentui/react-provider",
13
+ "commit": "86dd76990e3da5af1f2b6b04a3aec46141d5a653",
14
+ "comment": "chore: migrate from getNativeElementProps to getIntrinsicElementProps"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@fluentui/react-provider",
19
+ "comment": "Bump @fluentui/react-tabster to v9.13.4",
20
+ "commit": "690590449dc3d65cd40b2b06a990fd920180919d"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@fluentui/react-provider",
25
+ "comment": "Bump @fluentui/react-utilities to v9.14.1",
26
+ "commit": "690590449dc3d65cd40b2b06a990fd920180919d"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@fluentui/react-provider",
31
+ "comment": "Bump @fluentui/react-jsx-runtime to v9.0.14",
32
+ "commit": "690590449dc3d65cd40b2b06a990fd920180919d"
33
+ }
34
+ ]
35
+ }
36
+ },
37
+ {
38
+ "date": "Wed, 04 Oct 2023 08:45:47 GMT",
6
39
  "tag": "@fluentui/react-provider_v9.10.3",
7
40
  "version": "9.10.3",
8
41
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,24 @@
1
1
  # Change Log - @fluentui/react-provider
2
2
 
3
- This log was last generated on Wed, 04 Oct 2023 08:41:55 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 05 Oct 2023 15:17:59 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.10.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-provider_v9.10.4)
8
+
9
+ Thu, 05 Oct 2023 15:17:59 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-provider_v9.10.3..@fluentui/react-provider_v9.10.4)
11
+
12
+ ### Patches
13
+
14
+ - chore: migrate from getNativeElementProps to getIntrinsicElementProps ([PR #29387](https://github.com/microsoft/fluentui/pull/29387) by bernardo.sunderhus@gmail.com)
15
+ - Bump @fluentui/react-tabster to v9.13.4 ([PR #29412](https://github.com/microsoft/fluentui/pull/29412) by beachball)
16
+ - Bump @fluentui/react-utilities to v9.14.1 ([PR #29412](https://github.com/microsoft/fluentui/pull/29412) by beachball)
17
+ - Bump @fluentui/react-jsx-runtime to v9.0.14 ([PR #29412](https://github.com/microsoft/fluentui/pull/29412) by beachball)
18
+
7
19
  ## [9.10.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-provider_v9.10.3)
8
20
 
9
- Wed, 04 Oct 2023 08:41:55 GMT
21
+ Wed, 04 Oct 2023 08:45:47 GMT
10
22
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-provider_v9.10.2..@fluentui/react-provider_v9.10.3)
11
23
 
12
24
  ### Patches
@@ -1,7 +1,7 @@
1
1
  import { useRenderer_unstable } from '@griffel/react';
2
2
  import { useFocusVisible } from '@fluentui/react-tabster';
3
3
  import { ThemeContext_unstable as ThemeContext, useFluent_unstable as useFluent, useOverrides_unstable as useOverrides, CustomStyleHooksContext_unstable as CustomStyleHooksContext } from '@fluentui/react-shared-contexts';
4
- import { getNativeElementProps, useMergedRefs, slot } from '@fluentui/react-utilities';
4
+ import { getIntrinsicElementProps, useMergedRefs, slot } from '@fluentui/react-utilities';
5
5
  import * as React from 'react';
6
6
  import { useFluentProviderThemeStyleTag } from './useFluentProviderThemeStyleTag';
7
7
  /**
@@ -59,9 +59,12 @@ import { useFluentProviderThemeStyleTag } from './useFluentProviderThemeStyleTag
59
59
  components: {
60
60
  root: 'div'
61
61
  },
62
- root: slot.always(getNativeElementProps('div', {
62
+ root: slot.always(getIntrinsicElementProps('div', {
63
63
  ...props,
64
64
  dir,
65
+ // FIXME:
66
+ // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
67
+ // but since it would be a breaking change to fix it, we are casting ref to it's proper type
65
68
  ref: useMergedRefs(ref, useFocusVisible({
66
69
  targetDocument
67
70
  }))
@@ -1 +1 @@
1
- {"version":3,"sources":["useFluentProvider.ts"],"sourcesContent":["import { useRenderer_unstable } from '@griffel/react';\nimport { useFocusVisible } from '@fluentui/react-tabster';\nimport {\n ThemeContext_unstable as ThemeContext,\n useFluent_unstable as useFluent,\n useOverrides_unstable as useOverrides,\n CustomStyleHooksContext_unstable as CustomStyleHooksContext,\n} from '@fluentui/react-shared-contexts';\nimport type {\n CustomStyleHooksContextValue_unstable as CustomStyleHooksContextValue,\n ThemeContextValue_unstable as ThemeContextValue,\n} from '@fluentui/react-shared-contexts';\nimport { getNativeElementProps, useMergedRefs, slot } from '@fluentui/react-utilities';\nimport * as React from 'react';\n\nimport { useFluentProviderThemeStyleTag } from './useFluentProviderThemeStyleTag';\nimport type { FluentProviderProps, FluentProviderState } from './FluentProvider.types';\n\n/**\n * Create the state required to render FluentProvider.\n *\n * The returned state can be modified with hooks such as useFluentProviderStyles_unstable,\n * before being passed to renderFluentProvider_unstable.\n *\n * @param props - props from this instance of FluentProvider\n * @param ref - reference to root HTMLElement of FluentProvider\n */\nexport const useFluentProvider_unstable = (\n props: FluentProviderProps,\n ref: React.Ref<HTMLElement>,\n): FluentProviderState => {\n const parentContext = useFluent();\n const parentTheme = useTheme();\n const parentOverrides = useOverrides();\n const parentCustomStyleHooks: CustomStyleHooksContextValue = React.useContext(CustomStyleHooksContext) || {};\n\n /**\n * TODO: add merge functions to \"dir\" merge,\n * nesting providers with the same \"dir\" should not add additional attributes to DOM\n * see https://github.com/microsoft/fluentui/blob/0dc74a19f3aa5a058224c20505016fbdb84db172/packages/fluentui/react-northstar/src/utils/mergeProviderContexts.ts#L89-L93\n */\n const {\n applyStylesToPortals = true,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n customStyleHooks_unstable,\n dir = parentContext.dir,\n targetDocument = parentContext.targetDocument,\n theme,\n overrides_unstable: overrides = {},\n } = props;\n\n const mergedTheme = shallowMerge(parentTheme, theme);\n const mergedOverrides = shallowMerge(parentOverrides, overrides);\n\n const mergedCustomStyleHooks = shallowMerge(\n parentCustomStyleHooks,\n customStyleHooks_unstable,\n ) as CustomStyleHooksContextValue;\n\n const renderer = useRenderer_unstable();\n const { styleTagId, rule } = useFluentProviderThemeStyleTag({\n theme: mergedTheme,\n targetDocument,\n rendererAttributes: renderer.styleElementAttributes ?? {},\n });\n\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (mergedTheme === undefined) {\n // eslint-disable-next-line no-console\n console.warn(\n [\n '@fluentui/react-provider: FluentProvider does not have your \"theme\" defined.',\n \"Make sure that your top-level FluentProvider has set a `theme` prop or you're setting the theme in your child FluentProvider.\",\n ].join(' '),\n );\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n }\n\n return {\n applyStylesToPortals,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n customStyleHooks_unstable: mergedCustomStyleHooks,\n dir,\n targetDocument,\n theme: mergedTheme,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n overrides_unstable: mergedOverrides,\n themeClassName: styleTagId,\n\n components: {\n root: 'div',\n },\n\n root: slot.always(\n getNativeElementProps('div', {\n ...props,\n dir,\n ref: useMergedRefs(ref, useFocusVisible<HTMLDivElement>({ targetDocument })),\n }),\n { elementType: 'div' },\n ),\n\n serverStyleProps: {\n cssRule: rule,\n attributes: {\n ...renderer.styleElementAttributes,\n id: styleTagId,\n },\n },\n };\n};\n\nfunction shallowMerge<T>(a: T, b: T): T {\n // Merge impacts perf: we should like to avoid it if it's possible\n if (a && b) {\n return { ...a, ...b };\n }\n\n if (a) {\n return a;\n }\n\n return b;\n}\n\nfunction useTheme(): ThemeContextValue {\n return React.useContext(ThemeContext);\n}\n"],"names":["useRenderer_unstable","useFocusVisible","ThemeContext_unstable","ThemeContext","useFluent_unstable","useFluent","useOverrides_unstable","useOverrides","CustomStyleHooksContext_unstable","CustomStyleHooksContext","getNativeElementProps","useMergedRefs","slot","React","useFluentProviderThemeStyleTag","useFluentProvider_unstable","props","ref","parentContext","parentTheme","useTheme","parentOverrides","parentCustomStyleHooks","useContext","applyStylesToPortals","customStyleHooks_unstable","dir","targetDocument","theme","overrides_unstable","overrides","mergedTheme","shallowMerge","mergedOverrides","mergedCustomStyleHooks","renderer","styleTagId","rule","rendererAttributes","styleElementAttributes","process","env","NODE_ENV","useEffect","undefined","console","warn","join","themeClassName","components","root","always","elementType","serverStyleProps","cssRule","attributes","id","a","b"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,iBAAiB;AACtD,SAASC,eAAe,QAAQ,0BAA0B;AAC1D,SACEC,yBAAyBC,YAAY,EACrCC,sBAAsBC,SAAS,EAC/BC,yBAAyBC,YAAY,EACrCC,oCAAoCC,uBAAuB,QACtD,kCAAkC;AAKzC,SAASC,qBAAqB,EAAEC,aAAa,EAAEC,IAAI,QAAQ,4BAA4B;AACvF,YAAYC,WAAW,QAAQ;AAE/B,SAASC,8BAA8B,QAAQ,mCAAmC;AAGlF;;;;;;;;CAQC,GACD,OAAO,MAAMC,6BAA6B,CACxCC,OACAC;IAEA,MAAMC,gBAAgBb;IACtB,MAAMc,cAAcC;IACpB,MAAMC,kBAAkBd;IACxB,MAAMe,yBAAuDT,MAAMU,UAAU,CAACd,4BAA4B,CAAC;IAE3G;;;;GAIC,GACD,MAAM,EACJe,uBAAuB,IAAI,EAC3B,gEAAgE;IAChEC,yBAAyB,EACzBC,MAAMR,cAAcQ,GAAG,EACvBC,iBAAiBT,cAAcS,c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AAOA;IACT;IAEA,OAAOC;AACT;AAEA,SAAStC;IACP,OAAOP,MAAMU,UAAU,CAACpB;AAC1B"}
1
+ {"version":3,"sources":["useFluentProvider.ts"],"sourcesContent":["import { useRenderer_unstable } from '@griffel/react';\nimport { useFocusVisible } from '@fluentui/react-tabster';\nimport {\n ThemeContext_unstable as ThemeContext,\n useFluent_unstable as useFluent,\n useOverrides_unstable as useOverrides,\n CustomStyleHooksContext_unstable as CustomStyleHooksContext,\n} from '@fluentui/react-shared-contexts';\nimport type {\n CustomStyleHooksContextValue_unstable as CustomStyleHooksContextValue,\n ThemeContextValue_unstable as ThemeContextValue,\n} from '@fluentui/react-shared-contexts';\nimport { getIntrinsicElementProps, useMergedRefs, slot } from '@fluentui/react-utilities';\nimport * as React from 'react';\n\nimport { useFluentProviderThemeStyleTag } from './useFluentProviderThemeStyleTag';\nimport type { FluentProviderProps, FluentProviderState } from './FluentProvider.types';\n\n/**\n * Create the state required to render FluentProvider.\n *\n * The returned state can be modified with hooks such as useFluentProviderStyles_unstable,\n * before being passed to renderFluentProvider_unstable.\n *\n * @param props - props from this instance of FluentProvider\n * @param ref - reference to root HTMLElement of FluentProvider\n */\nexport const useFluentProvider_unstable = (\n props: FluentProviderProps,\n ref: React.Ref<HTMLElement>,\n): FluentProviderState => {\n const parentContext = useFluent();\n const parentTheme = useTheme();\n const parentOverrides = useOverrides();\n const parentCustomStyleHooks: CustomStyleHooksContextValue = React.useContext(CustomStyleHooksContext) || {};\n\n /**\n * TODO: add merge functions to \"dir\" merge,\n * nesting providers with the same \"dir\" should not add additional attributes to DOM\n * see https://github.com/microsoft/fluentui/blob/0dc74a19f3aa5a058224c20505016fbdb84db172/packages/fluentui/react-northstar/src/utils/mergeProviderContexts.ts#L89-L93\n */\n const {\n applyStylesToPortals = true,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n customStyleHooks_unstable,\n dir = parentContext.dir,\n targetDocument = parentContext.targetDocument,\n theme,\n overrides_unstable: overrides = {},\n } = props;\n\n const mergedTheme = shallowMerge(parentTheme, theme);\n const mergedOverrides = shallowMerge(parentOverrides, overrides);\n\n const mergedCustomStyleHooks = shallowMerge(\n parentCustomStyleHooks,\n customStyleHooks_unstable,\n ) as CustomStyleHooksContextValue;\n\n const renderer = useRenderer_unstable();\n const { styleTagId, rule } = useFluentProviderThemeStyleTag({\n theme: mergedTheme,\n targetDocument,\n rendererAttributes: renderer.styleElementAttributes ?? {},\n });\n\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (mergedTheme === undefined) {\n // eslint-disable-next-line no-console\n console.warn(\n [\n '@fluentui/react-provider: FluentProvider does not have your \"theme\" defined.',\n \"Make sure that your top-level FluentProvider has set a `theme` prop or you're setting the theme in your child FluentProvider.\",\n ].join(' '),\n );\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n }\n\n return {\n applyStylesToPortals,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n customStyleHooks_unstable: mergedCustomStyleHooks,\n dir,\n targetDocument,\n theme: mergedTheme,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n overrides_unstable: mergedOverrides,\n themeClassName: styleTagId,\n\n components: {\n root: 'div',\n },\n\n root: slot.always(\n getIntrinsicElementProps('div', {\n ...props,\n dir,\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: useMergedRefs(ref, useFocusVisible<HTMLDivElement>({ targetDocument })) as React.Ref<HTMLDivElement>,\n }),\n { elementType: 'div' },\n ),\n\n serverStyleProps: {\n cssRule: rule,\n attributes: {\n ...renderer.styleElementAttributes,\n id: styleTagId,\n },\n },\n };\n};\n\nfunction shallowMerge<T>(a: T, b: T): T {\n // Merge impacts perf: we should like to avoid it if it's possible\n if (a && b) {\n return { ...a, ...b };\n }\n\n if (a) {\n return a;\n }\n\n return b;\n}\n\nfunction useTheme(): ThemeContextValue {\n return React.useContext(ThemeContext);\n}\n"],"names":["useRenderer_unstable","useFocusVisible","ThemeContext_unstable","ThemeContext","useFluent_unstable","useFluent","useOverrides_unstable","useOverrides","CustomStyleHooksContext_unstable","CustomStyleHooksContext","getIntrinsicElementProps","useMergedRefs","slot","React","useFluentProviderThemeStyleTag","useFluentProvider_unstable","props","ref","parentContext","parentTheme","useTheme","parentOverrides","parentCustomStyleHooks","useContext","applyStylesToPortals","customStyleHooks_unstable","dir","targetDocument","theme","overrides_unstable","overrides","mergedTheme","shallowMerge","mergedOverrides","mergedCustomStyleHooks","renderer","styleTagId","rule","rendererAttributes","styleElementAttributes","process","env","NODE_ENV","useEffect","undefined","console","warn","join","themeClassName","components","root","always","elementType","serverStyleProps","cssRule","attributes","id","a","b"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,iBAAiB;AACtD,SAASC,eAAe,QAAQ,0BAA0B;AAC1D,SACEC,yBAAyBC,YAAY,EACrCC,sBAAsBC,SAAS,EAC/BC,yBAAyBC,YAAY,EACrCC,oCAAoCC,uBAAuB,QACtD,kCAAkC;AAKzC,SAASC,wBAAwB,EAAEC,aAAa,EAAEC,IAAI,QAAQ,4BAA4B;AAC1F,YAAYC,WAAW,QAAQ;AAE/B,SAASC,8BAA8B,QAAQ,mCAAmC;AAGlF;;;;;;;;CAQC,GACD,OAAO,MAAMC,6BAA6B,CACxCC,OACAC;IAEA,MAAMC,gBAAgBb;IACtB,MAAMc,cAAcC;IACpB,MAAMC,kBAAkBd;IACxB,MAAMe,yBAAuDT,MAAMU,UAAU,CAACd,4BAA4B,CAAC;IAE3G;;;;GAIC,GACD,MAAM,EACJe,uBAAuB,IAAI,EAC3B,gEAAgE;IAChEC,yBAAyB,EACzBC,MAAMR,cAAcQ,GAAG,EACvBC,iBAAiBT,cAAcS,cAAc,EAC7CC,KAAK,EACLC,oBAAoBC,YAAY,CAAC,CAAC,EACnC,GAAGd;IAEJ,MAAMe,cAAcC,aAAab,aAAaS;IAC9C,MA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AACpB;AAC1B"}
@@ -61,9 +61,12 @@ const useFluentProvider_unstable = (props, ref)=>{
61
61
  components: {
62
62
  root: 'div'
63
63
  },
64
- root: _reactutilities.slot.always((0, _reactutilities.getNativeElementProps)('div', {
64
+ root: _reactutilities.slot.always((0, _reactutilities.getIntrinsicElementProps)('div', {
65
65
  ...props,
66
66
  dir,
67
+ // FIXME:
68
+ // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
69
+ // but since it would be a breaking change to fix it, we are casting ref to it's proper type
67
70
  ref: (0, _reactutilities.useMergedRefs)(ref, (0, _reacttabster.useFocusVisible)({
68
71
  targetDocument
69
72
  }))
@@ -1 +1 @@
1
- {"version":3,"sources":["useFluentProvider.js"],"sourcesContent":["import { useRenderer_unstable } from '@griffel/react';\nimport { useFocusVisible } from '@fluentui/react-tabster';\nimport { ThemeContext_unstable as ThemeContext, useFluent_unstable as useFluent, useOverrides_unstable as useOverrides, CustomStyleHooksContext_unstable as CustomStyleHooksContext } from '@fluentui/react-shared-contexts';\nimport { getNativeElementProps, useMergedRefs, slot } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport { useFluentProviderThemeStyleTag } from './useFluentProviderThemeStyleTag';\n/**\n * Create the state required to render FluentProvider.\n *\n * The returned state can be modified with hooks such as useFluentProviderStyles_unstable,\n * before being passed to renderFluentProvider_unstable.\n *\n * @param props - props from this instance of FluentProvider\n * @param ref - reference to root HTMLElement of FluentProvider\n */ export const useFluentProvider_unstable = (props, ref)=>{\n const parentContext = useFluent();\n const parentTheme = useTheme();\n const parentOverrides = useOverrides();\n const parentCustomStyleHooks = React.useContext(CustomStyleHooksContext) || {};\n /**\n * TODO: add merge functions to \"dir\" merge,\n * nesting providers with the same \"dir\" should not add additional attributes to DOM\n * see https://github.com/microsoft/fluentui/blob/0dc74a19f3aa5a058224c20505016fbdb84db172/packages/fluentui/react-northstar/src/utils/mergeProviderContexts.ts#L89-L93\n */ const { applyStylesToPortals = true, // eslint-disable-next-line @typescript-eslint/naming-convention\n customStyleHooks_unstable, dir = parentContext.dir, targetDocument = parentContext.targetDocument, theme, overrides_unstable: overrides = {} } = props;\n const mergedTheme = shallowMerge(parentTheme, theme);\n const mergedOverrides = shallowMerge(parentOverrides, overrides);\n const mergedCustomStyleHooks = shallowMerge(parentCustomStyleHooks, customStyleHooks_unstable);\n const renderer = useRenderer_unstable();\n var _renderer_styleElementAttributes;\n const { styleTagId, rule } = useFluentProviderThemeStyleTag({\n theme: mergedTheme,\n targetDocument,\n rendererAttributes: (_renderer_styleElementAttributes = renderer.styleElementAttributes) !== null && _renderer_styleElementAttributes !== void 0 ? _renderer_styleElementAttributes : {}\n });\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(()=>{\n if (mergedTheme === undefined) {\n // eslint-disable-next-line no-console\n console.warn([\n '@fluentui/react-provider: FluentProvider does not have your \"theme\" defined.',\n \"Make sure that your top-level FluentProvider has set a `theme` prop or you're setting the theme in your child FluentProvider.\"\n ].join(' '));\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n }\n return {\n applyStylesToPortals,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n customStyleHooks_unstable: mergedCustomStyleHooks,\n dir,\n targetDocument,\n theme: mergedTheme,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n overrides_unstable: mergedOverrides,\n themeClassName: styleTagId,\n components: {\n root: 'div'\n },\n root: slot.always(getNativeElementProps('div', {\n ...props,\n dir,\n ref: useMergedRefs(ref, useFocusVisible({\n targetDocument\n }))\n }), {\n elementType: 'div'\n }),\n serverStyleProps: {\n cssRule: rule,\n attributes: {\n ...renderer.styleElementAttributes,\n id: styleTagId\n }\n }\n };\n};\nfunction shallowMerge(a, b) {\n // Merge impacts perf: we should like to avoid it if it's possible\n if (a && b) {\n return {\n ...a,\n ...b\n };\n }\n if (a) {\n return a;\n }\n return b;\n}\nfunction useTheme() {\n return React.useContext(ThemeContext);\n}\n"],"names":["useFluentProvider_unstable","props","ref","parentContext","useFluent","parentTheme","useTheme","parentOverrides","useOverrides","parentCustomStyleHooks","React","useContext","CustomStyleHooksContext","applyStylesToPortals","customStyleHooks_unstable","dir","targetDocument","theme","overrides_unstable","overrides","mergedTheme","shallowMerge","mergedOverrides","mergedCustomStyleHooks","renderer","useRenderer_unstable","_renderer_styleElementAttributes","styleTagId","rule","useFluentProviderThemeStyleTag","rendererAttributes","styleElementAttributes","process","env","NODE_ENV","useEffect","undefined","console","warn","join","themeClassName","components","root","slot","always","getNativeElementProps","useMergedRefs","useFocusVisible","elementType","serverStyleProps","cssRule","attributes","id","a","b","ThemeContext"],"mappings":";;;;+BAciBA;;;eAAAA;;;;uBAdoB;8BACL;qCAC2J;gCAChI;kEACpC;gDACwB;AASpC,MAAMA,6BAA6B,CAACC,OAAOC;IAClD,MAAMC,gBAAgBC,IAAAA,uCAAS;IAC/B,MAAMC,cAAcC;IACpB,MAAMC,kBAAkBC,IAAAA,0CAAY;IACpC,MAAMC,yBAAyBC,QAAMC,UAAU,CAACC,qDAAuB,KAAK,CAAC;IAC7E;;;;GAID,GAAG,MAAM,EAAEC,uBAAuB,IAAI,EACrCC,yBAAyB,EAAEC,MAAMZ,cAAcY,GAAG,EAAEC,iBAAiBb,cAAca,cAAc,EAAEC,KAAK,EAAEC,oBAAoBC,YAAY,CAAC,CAAC,EAAE,GAAGlB;IACjJ,MAAMmB,cAAcC,aAAahB,aAAaY;IAC9C,MAAMK,kBAAkBD,aAAad,iBAAiBY;IACtD,MAAMI,yBAAyBF,aAAaZ,wBAAwBK;IACpE,MAAMU,WAAWC,IAAAA,2BAAoB;IACrC,IAAIC;IACJ,MAAM,EAAEC,UAAU,EAAEC,IAAI,EAAE,GAAGC,IAAAA,8DAA8B,EAAC;QACxDZ,OAAOG;QACPJ;QACAc,oBAAoB,AAACJ,CAAAA,mCAAmCF,SAASO,sBAAsB,AAAD,MAAO,QAAQL,qCAAqC,KAAK,IAAIA,mCAAmC,CAAC;IAC3L;IACA,IAAIM,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACvC,sDAAsD;QACtDxB,QAAMyB,SAAS,CAAC;YACZ,IAAIf,gBAAgBgB,WAAW;gBAC3B,sCAAsC;gBACtCC,QAAQC,IAAI,CAAC;oBACT;oBACA;iBACH,CAACC,IAAI,CAAC;YACX;QACJ,uDAAuD;QACvD,GAAG,EAAE;IACT;IACA,OAAO;QACH1B;QACA,gEAAgE;QAChEC,2BAA2BS;QAC3BR;QACAC;QACAC,OAAOG;QACP,gEAAgE;QAChEF,oBAAoBI;QACpBkB,gBAAgBb;QAChBc,YAAY;YACRC,MAAM;QACV;QACAA,MAAMC,oBAAI,CAACC,MAAM,CAACC,IAAAA,qCAAqB,EAAC,OAAO;YAC3C,GAAG5C,KAAK;YACRc;YACAb,KAAK4C,IAAAA,6BAAa,EAAC5C,KAAK6C,IAAAA,6BAAe,EAAC;gBACpC/B;YACJ;QACJ,IAAI;YACAgC,aAAa;QACjB;QACAC,kBAAkB;YACdC,SAAStB;YACTuB,YAAY;gBACR,GAAG3B,SAASO,sBAAsB;gBAClCqB,IAAIzB;YACR;QACJ;IACJ;AACJ;AACA,SAASN,aAAagC,CAAC,EAAEC,CAAC;IACtB,kEAAkE;IAClE,IAAID,KAAKC,GAAG;QACR,OAAO;YACH,GAAGD,CAAC;YACJ,GAAGC,CAAC;QACR;IACJ;IACA,IAAID,GAAG;QACH,OAAOA;IACX;IACA,OAAOC;AACX;AACA,SAAShD;IACL,OAAOI,QAAMC,UAAU,CAAC4C,0CAAY;AACxC"}
1
+ {"version":3,"sources":["useFluentProvider.js"],"sourcesContent":["import { useRenderer_unstable } from '@griffel/react';\nimport { useFocusVisible } from '@fluentui/react-tabster';\nimport { ThemeContext_unstable as ThemeContext, useFluent_unstable as useFluent, useOverrides_unstable as useOverrides, CustomStyleHooksContext_unstable as CustomStyleHooksContext } from '@fluentui/react-shared-contexts';\nimport { getIntrinsicElementProps, useMergedRefs, slot } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport { useFluentProviderThemeStyleTag } from './useFluentProviderThemeStyleTag';\n/**\n * Create the state required to render FluentProvider.\n *\n * The returned state can be modified with hooks such as useFluentProviderStyles_unstable,\n * before being passed to renderFluentProvider_unstable.\n *\n * @param props - props from this instance of FluentProvider\n * @param ref - reference to root HTMLElement of FluentProvider\n */ export const useFluentProvider_unstable = (props, ref)=>{\n const parentContext = useFluent();\n const parentTheme = useTheme();\n const parentOverrides = useOverrides();\n const parentCustomStyleHooks = React.useContext(CustomStyleHooksContext) || {};\n /**\n * TODO: add merge functions to \"dir\" merge,\n * nesting providers with the same \"dir\" should not add additional attributes to DOM\n * see https://github.com/microsoft/fluentui/blob/0dc74a19f3aa5a058224c20505016fbdb84db172/packages/fluentui/react-northstar/src/utils/mergeProviderContexts.ts#L89-L93\n */ const { applyStylesToPortals = true, // eslint-disable-next-line @typescript-eslint/naming-convention\n customStyleHooks_unstable, dir = parentContext.dir, targetDocument = parentContext.targetDocument, theme, overrides_unstable: overrides = {} } = props;\n const mergedTheme = shallowMerge(parentTheme, theme);\n const mergedOverrides = shallowMerge(parentOverrides, overrides);\n const mergedCustomStyleHooks = shallowMerge(parentCustomStyleHooks, customStyleHooks_unstable);\n const renderer = useRenderer_unstable();\n var _renderer_styleElementAttributes;\n const { styleTagId, rule } = useFluentProviderThemeStyleTag({\n theme: mergedTheme,\n targetDocument,\n rendererAttributes: (_renderer_styleElementAttributes = renderer.styleElementAttributes) !== null && _renderer_styleElementAttributes !== void 0 ? _renderer_styleElementAttributes : {}\n });\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(()=>{\n if (mergedTheme === undefined) {\n // eslint-disable-next-line no-console\n console.warn([\n '@fluentui/react-provider: FluentProvider does not have your \"theme\" defined.',\n \"Make sure that your top-level FluentProvider has set a `theme` prop or you're setting the theme in your child FluentProvider.\"\n ].join(' '));\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n }\n return {\n applyStylesToPortals,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n customStyleHooks_unstable: mergedCustomStyleHooks,\n dir,\n targetDocument,\n theme: mergedTheme,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n overrides_unstable: mergedOverrides,\n themeClassName: styleTagId,\n components: {\n root: 'div'\n },\n root: slot.always(getIntrinsicElementProps('div', {\n ...props,\n dir,\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: useMergedRefs(ref, useFocusVisible({\n targetDocument\n }))\n }), {\n elementType: 'div'\n }),\n serverStyleProps: {\n cssRule: rule,\n attributes: {\n ...renderer.styleElementAttributes,\n id: styleTagId\n }\n }\n };\n};\nfunction shallowMerge(a, b) {\n // Merge impacts perf: we should like to avoid it if it's possible\n if (a && b) {\n return {\n ...a,\n ...b\n };\n }\n if (a) {\n return a;\n }\n return b;\n}\nfunction useTheme() {\n return React.useContext(ThemeContext);\n}\n"],"names":["useFluentProvider_unstable","props","ref","parentContext","useFluent","parentTheme","useTheme","parentOverrides","useOverrides","parentCustomStyleHooks","React","useContext","CustomStyleHooksContext","applyStylesToPortals","customStyleHooks_unstable","dir","targetDocument","theme","overrides_unstable","overrides","mergedTheme","shallowMerge","mergedOverrides","mergedCustomStyleHooks","renderer","useRenderer_unstable","_renderer_styleElementAttributes","styleTagId","rule","useFluentProviderThemeStyleTag","rendererAttributes","styleElementAttributes","process","env","NODE_ENV","useEffect","undefined","console","warn","join","themeClassName","components","root","slot","always","getIntrinsicElementProps","useMergedRefs","useFocusVisible","elementType","serverStyleProps","cssRule","attributes","id","a","b","ThemeContext"],"mappings":";;;;+BAciBA;;;eAAAA;;;;uBAdoB;8BACL;qCAC2J;gCAC7H;kEACvC;gDACwB;AASpC,MAAMA,6BAA6B,CAACC,OAAOC;IAClD,MAAMC,gBAAgBC,IAAAA,uCAAS;IAC/B,MAAMC,cAA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a,EAAC5C,KAAK6C,IAAAA,6BAAe,EAAC;gBACpC/B;YACJ;QACJ,IAAI;YACAgC,aAAa;QACjB;QACAC,kBAAkB;YACdC,SAAStB;YACTuB,YAAY;gBACR,GAAG3B,SAASO,sBAAsB;gBAClCqB,IAAIzB;YACR;QACJ;IACJ;AACJ;AACA,SAASN,aAAagC,CAAC,EAAEC,CAAC;IACtB,kEAAkE;IAClE,IAAID,KAAKC,GAAG;QACR,OAAO;YACH,GAAGD,CAAC;YACJ,GAAGC,CAAC;QACR;IACJ;IACA,IAAID,GAAG;QACH,OAAOA;IACX;IACA,OAAOC;AACX;AACA,SAAShD;IACL,OAAOI,QAAMC,UAAU,CAAC4C,0CAAY;AACxC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-provider",
3
- "version": "9.10.3",
3
+ "version": "9.10.4",
4
4
  "description": "Fluent UI React provider component",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -35,10 +35,10 @@
35
35
  "dependencies": {
36
36
  "@fluentui/react-icons": "^2.0.217",
37
37
  "@fluentui/react-shared-contexts": "^9.9.2",
38
- "@fluentui/react-tabster": "^9.13.3",
38
+ "@fluentui/react-tabster": "^9.13.4",
39
39
  "@fluentui/react-theme": "^9.1.14",
40
- "@fluentui/react-utilities": "^9.14.0",
41
- "@fluentui/react-jsx-runtime": "^9.0.13",
40
+ "@fluentui/react-utilities": "^9.14.1",
41
+ "@fluentui/react-jsx-runtime": "^9.0.14",
42
42
  "@griffel/core": "^1.14.1",
43
43
  "@griffel/react": "^1.5.14",
44
44
  "@swc/helpers": "^0.5.1"