@fluentui/react-provider 0.0.0-nightly-20230424-0419.1 → 0.0.0-nightly-20230426-0420.1
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 +36 -15
- package/CHANGELOG.md +20 -10
- package/dist/index.d.ts +87 -3
- package/lib/components/FluentProvider/FluentProvider.types.js.map +1 -1
- package/lib/components/FluentProvider/useFluentProvider.js +2 -3
- package/lib/components/FluentProvider/useFluentProvider.js.map +1 -1
- package/lib-commonjs/components/FluentProvider/useFluentProvider.js +1 -2
- package/lib-commonjs/components/FluentProvider/useFluentProvider.js.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.json
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
"name": "@fluentui/react-provider",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "
|
6
|
-
"tag": "@fluentui/react-provider_v0.0.0-nightly-
|
7
|
-
"version": "0.0.0-nightly-
|
5
|
+
"date": "Wed, 26 Apr 2023 04:27:04 GMT",
|
6
|
+
"tag": "@fluentui/react-provider_v0.0.0-nightly-20230426-0420.1",
|
7
|
+
"version": "0.0.0-nightly-20230426-0420.1",
|
8
8
|
"comments": {
|
9
9
|
"prerelease": [
|
10
10
|
{
|
@@ -16,38 +16,59 @@
|
|
16
16
|
{
|
17
17
|
"author": "beachball",
|
18
18
|
"package": "@fluentui/react-provider",
|
19
|
-
"comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-
|
20
|
-
"commit": "
|
19
|
+
"comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230426-0420.1",
|
20
|
+
"commit": "0bf57d44764cd2220ffb39eaa3256f208e17fc9c"
|
21
21
|
},
|
22
22
|
{
|
23
23
|
"author": "beachball",
|
24
24
|
"package": "@fluentui/react-provider",
|
25
|
-
"comment": "Bump @fluentui/react-tabster to v0.0.0-nightly-
|
26
|
-
"commit": "
|
25
|
+
"comment": "Bump @fluentui/react-tabster to v0.0.0-nightly-20230426-0420.1",
|
26
|
+
"commit": "0bf57d44764cd2220ffb39eaa3256f208e17fc9c"
|
27
27
|
},
|
28
28
|
{
|
29
29
|
"author": "beachball",
|
30
30
|
"package": "@fluentui/react-provider",
|
31
|
-
"comment": "Bump @fluentui/react-theme to v0.0.0-nightly-
|
32
|
-
"commit": "
|
31
|
+
"comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20230426-0420.1",
|
32
|
+
"commit": "0bf57d44764cd2220ffb39eaa3256f208e17fc9c"
|
33
33
|
},
|
34
34
|
{
|
35
35
|
"author": "beachball",
|
36
36
|
"package": "@fluentui/react-provider",
|
37
|
-
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-
|
38
|
-
"commit": "
|
37
|
+
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20230426-0420.1",
|
38
|
+
"commit": "0bf57d44764cd2220ffb39eaa3256f208e17fc9c"
|
39
39
|
},
|
40
40
|
{
|
41
41
|
"author": "beachball",
|
42
42
|
"package": "@fluentui/react-provider",
|
43
|
-
"comment": "Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-
|
44
|
-
"commit": "
|
43
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20230426-0420.1",
|
44
|
+
"commit": "0bf57d44764cd2220ffb39eaa3256f208e17fc9c"
|
45
45
|
},
|
46
46
|
{
|
47
47
|
"author": "beachball",
|
48
48
|
"package": "@fluentui/react-provider",
|
49
|
-
"comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-
|
50
|
-
"commit": "
|
49
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230426-0420.1",
|
50
|
+
"commit": "0bf57d44764cd2220ffb39eaa3256f208e17fc9c"
|
51
|
+
}
|
52
|
+
]
|
53
|
+
}
|
54
|
+
},
|
55
|
+
{
|
56
|
+
"date": "Mon, 24 Apr 2023 08:12:40 GMT",
|
57
|
+
"tag": "@fluentui/react-provider_v9.5.4",
|
58
|
+
"version": "9.5.4",
|
59
|
+
"comments": {
|
60
|
+
"patch": [
|
61
|
+
{
|
62
|
+
"author": "bernardo.sunderhus@gmail.com",
|
63
|
+
"package": "@fluentui/react-provider",
|
64
|
+
"commit": "85c36e249b33b0bad79be4edd1a943dfc5233b11",
|
65
|
+
"comment": "bugfix: remove caret from react-jsx-runtime prerelease dependency"
|
66
|
+
},
|
67
|
+
{
|
68
|
+
"author": "beachball",
|
69
|
+
"package": "@fluentui/react-provider",
|
70
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.2",
|
71
|
+
"commit": "505433ac64f144c9cca456097413d6af4582e5ee"
|
51
72
|
}
|
52
73
|
]
|
53
74
|
}
|
package/CHANGELOG.md
CHANGED
@@ -1,23 +1,33 @@
|
|
1
1
|
# Change Log - @fluentui/react-provider
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Wed, 26 Apr 2023 04:27:04 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
-
## [0.0.0-nightly-
|
7
|
+
## [0.0.0-nightly-20230426-0420.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-provider_v0.0.0-nightly-20230426-0420.1)
|
8
8
|
|
9
|
-
|
10
|
-
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-provider_v9.5.
|
9
|
+
Wed, 26 Apr 2023 04:27:04 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-provider_v9.5.4..@fluentui/react-provider_v0.0.0-nightly-20230426-0420.1)
|
11
11
|
|
12
12
|
### Changes
|
13
13
|
|
14
14
|
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
|
15
|
-
- Bump @fluentui/react-shared-contexts to v0.0.0-nightly-
|
16
|
-
- Bump @fluentui/react-tabster to v0.0.0-nightly-
|
17
|
-
- Bump @fluentui/react-theme to v0.0.0-nightly-
|
18
|
-
- Bump @fluentui/react-utilities to v0.0.0-nightly-
|
19
|
-
- Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-
|
20
|
-
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-
|
15
|
+
- Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230426-0420.1 ([commit](https://github.com/microsoft/fluentui/commit/0bf57d44764cd2220ffb39eaa3256f208e17fc9c) by beachball)
|
16
|
+
- Bump @fluentui/react-tabster to v0.0.0-nightly-20230426-0420.1 ([commit](https://github.com/microsoft/fluentui/commit/0bf57d44764cd2220ffb39eaa3256f208e17fc9c) by beachball)
|
17
|
+
- Bump @fluentui/react-theme to v0.0.0-nightly-20230426-0420.1 ([commit](https://github.com/microsoft/fluentui/commit/0bf57d44764cd2220ffb39eaa3256f208e17fc9c) by beachball)
|
18
|
+
- Bump @fluentui/react-utilities to v0.0.0-nightly-20230426-0420.1 ([commit](https://github.com/microsoft/fluentui/commit/0bf57d44764cd2220ffb39eaa3256f208e17fc9c) by beachball)
|
19
|
+
- Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20230426-0420.1 ([commit](https://github.com/microsoft/fluentui/commit/0bf57d44764cd2220ffb39eaa3256f208e17fc9c) by beachball)
|
20
|
+
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230426-0420.1 ([commit](https://github.com/microsoft/fluentui/commit/0bf57d44764cd2220ffb39eaa3256f208e17fc9c) by beachball)
|
21
|
+
|
22
|
+
## [9.5.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-provider_v9.5.4)
|
23
|
+
|
24
|
+
Mon, 24 Apr 2023 08:12:40 GMT
|
25
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-provider_v9.5.3..@fluentui/react-provider_v9.5.4)
|
26
|
+
|
27
|
+
### Patches
|
28
|
+
|
29
|
+
- bugfix: remove caret from react-jsx-runtime prerelease dependency ([PR #27588](https://github.com/microsoft/fluentui/pull/27588) by bernardo.sunderhus@gmail.com)
|
30
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.2 ([commit](https://github.com/microsoft/fluentui/commit/505433ac64f144c9cca456097413d6af4582e5ee) by beachball)
|
21
31
|
|
22
32
|
## [9.5.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-provider_v9.5.3)
|
23
33
|
|
package/dist/index.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { ComponentProps } from '@fluentui/react-utilities';
|
2
2
|
import type { ComponentState } from '@fluentui/react-utilities';
|
3
|
-
import { CustomStyleHooksContextValue_unstable } from '@fluentui/react-shared-contexts';
|
3
|
+
import type { CustomStyleHooksContextValue_unstable } from '@fluentui/react-shared-contexts';
|
4
4
|
import { OverridesContextValue_unstable } from '@fluentui/react-shared-contexts';
|
5
5
|
import type { PartialTheme } from '@fluentui/react-theme';
|
6
6
|
import type { ProviderContextValue_unstable } from '@fluentui/react-shared-contexts';
|
@@ -14,7 +14,91 @@ import type { TooltipVisibilityContextValue_unstable } from '@fluentui/react-sha
|
|
14
14
|
|
15
15
|
export declare const FluentProvider: React_2.ForwardRefExoticComponent<Omit<ComponentProps<FluentProviderSlots, "root">, "dir"> & {
|
16
16
|
applyStylesToPortals?: boolean | undefined;
|
17
|
-
customStyleHooks_unstable?: Partial<
|
17
|
+
customStyleHooks_unstable?: Partial<{
|
18
|
+
useAccordionHeaderStyles_unstable: (state: unknown) => void;
|
19
|
+
useAccordionItemStyles_unstable: (state: unknown) => void;
|
20
|
+
useAccordionPanelStyles_unstable: (state: unknown) => void;
|
21
|
+
useAccordionStyles_unstable: (state: unknown) => void;
|
22
|
+
useAvatarStyles_unstable: (state: unknown) => void;
|
23
|
+
useAvatarGroupStyles_unstable: (state: unknown) => void;
|
24
|
+
useAvatarGroupItemStyles_unstable: (state: unknown) => void;
|
25
|
+
useAvatarGroupPopoverStyles_unstable: (state: unknown) => void;
|
26
|
+
useBadgeStyles_unstable: (state: unknown) => void;
|
27
|
+
useCounterBadgeStyles_unstable: (state: unknown) => void;
|
28
|
+
useCardHeaderStyles_unstable: (state: unknown) => void;
|
29
|
+
useCardStyles_unstable: (state: unknown) => void;
|
30
|
+
useCardFooterStyles_unstable: (state: unknown) => void;
|
31
|
+
useCardPreviewStyles_unstable: (state: unknown) => void;
|
32
|
+
usePresenceBadgeStyles_unstable: (state: unknown) => void;
|
33
|
+
useButtonStyles_unstable: (state: unknown) => void;
|
34
|
+
useCompoundButtonStyles_unstable: (state: unknown) => void;
|
35
|
+
useMenuButtonStyles_unstable: (state: unknown) => void;
|
36
|
+
useSplitButtonStyles_unstable: (state: unknown) => void;
|
37
|
+
useToggleButtonStyles_unstable: (state: unknown) => void;
|
38
|
+
useCheckboxStyles_unstable: (state: unknown) => void;
|
39
|
+
useComboboxStyles_unstable: (state: unknown) => void;
|
40
|
+
useDropdownStyles_unstable: (state: unknown) => void;
|
41
|
+
useListboxStyles_unstable: (state: unknown) => void;
|
42
|
+
useOptionStyles_unstable: (state: unknown) => void;
|
43
|
+
useOptionGroupStyles_unstable: (state: unknown) => void;
|
44
|
+
useDividerStyles_unstable: (state: unknown) => void;
|
45
|
+
useInputStyles_unstable: (state: unknown) => void;
|
46
|
+
useImageStyles_unstable: (state: unknown) => void;
|
47
|
+
useLabelStyles_unstable: (state: unknown) => void;
|
48
|
+
useLinkStyles_unstable: (state: unknown) => void;
|
49
|
+
useMenuDividerStyles_unstable: (state: unknown) => void;
|
50
|
+
useMenuGroupHeaderStyles_unstable: (state: unknown) => void;
|
51
|
+
useMenuGroupStyles_unstable: (state: unknown) => void;
|
52
|
+
useMenuItemCheckboxStyles_unstable: (state: unknown) => void;
|
53
|
+
useMenuItemRadioStyles_unstable: (state: unknown) => void;
|
54
|
+
useMenuItemStyles_unstable: (state: unknown) => void;
|
55
|
+
useMenuListStyles_unstable: (state: unknown) => void;
|
56
|
+
useMenuPopoverStyles_unstable: (state: unknown) => void;
|
57
|
+
useMenuSplitGroupStyles_unstable: (state: unknown) => void;
|
58
|
+
usePersonaStyles_unstable: (state: unknown) => void;
|
59
|
+
usePopoverSurfaceStyles_unstable: (state: unknown) => void;
|
60
|
+
useRadioGroupStyles_unstable: (state: unknown) => void;
|
61
|
+
useRadioStyles_unstable: (state: unknown) => void;
|
62
|
+
useSelectStyles_unstable: (state: unknown) => void;
|
63
|
+
useSliderStyles_unstable: (state: unknown) => void;
|
64
|
+
useSpinButtonStyles_unstable: (state: unknown) => void;
|
65
|
+
useSpinnerStyles_unstable: (state: unknown) => void;
|
66
|
+
useSwitchStyles_unstable: (state: unknown) => void;
|
67
|
+
useTabStyles_unstable: (state: unknown) => void;
|
68
|
+
useTabListStyles_unstable: (state: unknown) => void;
|
69
|
+
useTextStyles_unstable: (state: unknown) => void;
|
70
|
+
useTextareaStyles_unstable: (state: unknown) => void;
|
71
|
+
useTooltipStyles_unstable: (state: unknown) => void;
|
72
|
+
useDialogTitleStyles_unstable: (state: unknown) => void;
|
73
|
+
useDialogBodyStyles_unstable: (state: unknown) => void;
|
74
|
+
useDialogActionsStyles_unstable: (state: unknown) => void;
|
75
|
+
useDialogSurfaceStyles_unstable: (state: unknown) => void;
|
76
|
+
useDialogContentStyles_unstable: (state: unknown) => void;
|
77
|
+
useProgressBarStyles_unstable: (state: unknown) => void;
|
78
|
+
useToolbarButtonStyles_unstable: (state: unknown) => void;
|
79
|
+
useToolbarRadioButtonStyles_unstable: (state: unknown) => void;
|
80
|
+
useToolbarGroupStyles_unstable: (state: unknown) => void;
|
81
|
+
useToolbarToggleButtonStyles_unstable: (state: unknown) => void;
|
82
|
+
useToolbarDividerStyles_unstable: (state: unknown) => void;
|
83
|
+
useToolbarStyles_unstable: (state: unknown) => void;
|
84
|
+
useTableCellStyles_unstable: (state: unknown) => void;
|
85
|
+
useTableRowStyles_unstable: (state: unknown) => void;
|
86
|
+
useTableBodyStyles_unstable: (state: unknown) => void;
|
87
|
+
useTableStyles_unstable: (state: unknown) => void;
|
88
|
+
useTableHeaderStyles_unstable: (state: unknown) => void;
|
89
|
+
useTableHeaderCellStyles_unstable: (state: unknown) => void;
|
90
|
+
useTableResizeHandleStyles_unstable: (state: unknown) => void;
|
91
|
+
useTableSelectionCellStyles_unstable: (state: unknown) => void;
|
92
|
+
useTableCellActionsStyles_unstable: (state: unknown) => void;
|
93
|
+
useTableCellLayoutStyles_unstable: (state: unknown) => void;
|
94
|
+
useDataGridCellStyles_unstable: (state: unknown) => void;
|
95
|
+
useDataGridRowStyles_unstable: (state: unknown) => void;
|
96
|
+
useDataGridBodyStyles_unstable: (state: unknown) => void;
|
97
|
+
useDataGridStyles_unstable: (state: unknown) => void;
|
98
|
+
useDataGridHeaderStyles_unstable: (state: unknown) => void;
|
99
|
+
useDataGridHeaderCellStyles_unstable: (state: unknown) => void;
|
100
|
+
useDataGridSelectionCellStyles_unstable: (state: unknown) => void;
|
101
|
+
}> | undefined;
|
18
102
|
dir?: "ltr" | "rtl" | undefined;
|
19
103
|
targetDocument?: Document | undefined;
|
20
104
|
theme?: Partial<Theme> | undefined;
|
@@ -30,7 +114,7 @@ export declare type FluentProviderContextValues = Pick<FluentProviderState, 'cus
|
|
30
114
|
tooltip: TooltipVisibilityContextValue_unstable;
|
31
115
|
};
|
32
116
|
|
33
|
-
export declare type FluentProviderCustomStyleHooks =
|
117
|
+
export declare type FluentProviderCustomStyleHooks = CustomStyleHooksContextValue_unstable;
|
34
118
|
|
35
119
|
export declare type FluentProviderProps = Omit<ComponentProps<FluentProviderSlots>, 'dir'> & {
|
36
120
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../src/components/FluentProvider/FluentProvider.types.ts"],"sourcesContent":["import type {\n OverridesContextValue_unstable as OverridesContextValue,\n ProviderContextValue_unstable as ProviderContextValue,\n TooltipVisibilityContextValue_unstable as TooltipVisibilityContextValue,\n ThemeClassNameContextValue_unstable as ThemeClassNameContextValue,\n ThemeContextValue_unstable as ThemeContextValue,\n CustomStyleHooksContextValue_unstable as CustomStyleHooksContextValue,\n} from '@fluentui/react-shared-contexts';\nimport type { PartialTheme } from '@fluentui/react-theme';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type FluentProviderSlots = {\n root: Slot<'div'>;\n};\n\n// exported for callers to avoid referencing react-shared-context\n// and applying Partial<> when passing custom style hooks.\nexport type FluentProviderCustomStyleHooks =
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/components/FluentProvider/FluentProvider.types.ts"],"sourcesContent":["import type {\n OverridesContextValue_unstable as OverridesContextValue,\n ProviderContextValue_unstable as ProviderContextValue,\n TooltipVisibilityContextValue_unstable as TooltipVisibilityContextValue,\n ThemeClassNameContextValue_unstable as ThemeClassNameContextValue,\n ThemeContextValue_unstable as ThemeContextValue,\n CustomStyleHooksContextValue_unstable as CustomStyleHooksContextValue,\n} from '@fluentui/react-shared-contexts';\nimport type { PartialTheme } from '@fluentui/react-theme';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type FluentProviderSlots = {\n root: Slot<'div'>;\n};\n\n// exported for callers to avoid referencing react-shared-context\n// and applying Partial<> when passing custom style hooks.\nexport type FluentProviderCustomStyleHooks = CustomStyleHooksContextValue;\n\nexport type FluentProviderProps = Omit<ComponentProps<FluentProviderSlots>, 'dir'> & {\n /**\n * Passes styles applied to a component down to portals if enabled.\n * @default true\n */\n applyStylesToPortals?: boolean;\n\n /** Sets the hooks for custom styling components. */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n customStyleHooks_unstable?: FluentProviderCustomStyleHooks;\n\n /** Sets the direction of text & generated styles. */\n dir?: 'ltr' | 'rtl';\n\n /** Provides the document, can be undefined during SSR render. */\n targetDocument?: Document;\n\n /** Sets the theme used in a scope. */\n theme?: PartialTheme;\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n overrides_unstable?: OverridesContextValue;\n};\n\nexport type FluentProviderState = ComponentState<FluentProviderSlots> &\n Pick<FluentProviderProps, 'targetDocument'> &\n Required<\n Pick<FluentProviderProps, 'applyStylesToPortals' | 'customStyleHooks_unstable' | 'dir' | 'overrides_unstable'>\n > & {\n theme: ThemeContextValue;\n themeClassName: string;\n /**\n * Props used to render SSR theme variables style element\n */\n serverStyleProps: {\n /**\n * CSS rule containing CSS variables\n */\n cssRule: string;\n /**\n * Additional attributes applied to the style element\n */\n attributes: Record<string, string>;\n };\n };\n\nexport type FluentProviderContextValues = Pick<\n FluentProviderState,\n 'customStyleHooks_unstable' | 'theme' | 'overrides_unstable'\n> & {\n provider: ProviderContextValue;\n themeClassName: ThemeClassNameContextValue;\n textDirection: 'ltr' | 'rtl';\n tooltip: TooltipVisibilityContextValue;\n};\n"],"mappings":"AAAA"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { useFocusVisible } from '@fluentui/react-tabster';
|
2
|
-
import { ThemeContext_unstable as ThemeContext, useFluent_unstable as useFluent, useOverrides_unstable as useOverrides,
|
2
|
+
import { ThemeContext_unstable as ThemeContext, useFluent_unstable as useFluent, useOverrides_unstable as useOverrides, CustomStyleHooksContext_unstable as CustomStyleHooksContext } from '@fluentui/react-shared-contexts';
|
3
3
|
import { getNativeElementProps, useMergedRefs } from '@fluentui/react-utilities';
|
4
4
|
import * as React from 'react';
|
5
5
|
import { useFluentProviderThemeStyleTag } from './useFluentProviderThemeStyleTag';
|
@@ -17,7 +17,7 @@ export const useFluentProvider_unstable = (props, ref) => {
|
|
17
17
|
const parentContext = useFluent();
|
18
18
|
const parentTheme = useTheme();
|
19
19
|
const parentOverrides = useOverrides();
|
20
|
-
const parentCustomStyleHooks =
|
20
|
+
const parentCustomStyleHooks = React.useContext(CustomStyleHooksContext) || {};
|
21
21
|
/**
|
22
22
|
* TODO: add merge functions to "dir" merge,
|
23
23
|
* nesting providers with the same "dir" should not add additional attributes to DOM
|
@@ -34,7 +34,6 @@ export const useFluentProvider_unstable = (props, ref) => {
|
|
34
34
|
} = props;
|
35
35
|
const mergedTheme = shallowMerge(parentTheme, theme);
|
36
36
|
const mergedOverrides = shallowMerge(parentOverrides, overrides);
|
37
|
-
// parentCustomStyleHooks will not be a partial
|
38
37
|
const mergedCustomStyleHooks = shallowMerge(parentCustomStyleHooks, customStyleHooks_unstable);
|
39
38
|
React.useEffect(() => {
|
40
39
|
if (process.env.NODE_ENV !== 'production' && mergedTheme === undefined) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["useFocusVisible","ThemeContext_unstable","ThemeContext","useFluent_unstable","useFluent","useOverrides_unstable","useOverrides","
|
1
|
+
{"version":3,"names":["useFocusVisible","ThemeContext_unstable","ThemeContext","useFluent_unstable","useFluent","useOverrides_unstable","useOverrides","CustomStyleHooksContext_unstable","CustomStyleHooksContext","getNativeElementProps","useMergedRefs","React","useFluentProviderThemeStyleTag","useRenderer_unstable","useFluentProvider_unstable","props","ref","parentContext","parentTheme","useTheme","parentOverrides","parentCustomStyleHooks","useContext","applyStylesToPortals","customStyleHooks_unstable","dir","targetDocument","theme","overrides_unstable","overrides","mergedTheme","shallowMerge","mergedOverrides","mergedCustomStyleHooks","useEffect","process","env","NODE_ENV","undefined","console","warn","renderer","_renderer_styleElementAttributes","styleTagId","rule","rendererAttributes","styleElementAttributes","themeClassName","components","root","serverStyleProps","cssRule","attributes","id","a","b"],"sources":["../../../src/components/FluentProvider/useFluentProvider.ts"],"sourcesContent":["import { 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';\n\nimport { getNativeElementProps, useMergedRefs } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport { useFluentProviderThemeStyleTag } from './useFluentProviderThemeStyleTag';\nimport type { FluentProviderProps, FluentProviderState } from './FluentProvider.types';\nimport { useRenderer_unstable } from '@griffel/react';\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 const mergedTheme = shallowMerge(parentTheme, theme);\n\n const mergedOverrides = shallowMerge(parentOverrides, overrides);\n\n const mergedCustomStyleHooks = shallowMerge(\n parentCustomStyleHooks,\n customStyleHooks_unstable,\n ) as CustomStyleHooksContextValue;\n\n React.useEffect(() => {\n if (process.env.NODE_ENV !== 'production' && mergedTheme === undefined) {\n // eslint-disable-next-line no-console\n console.warn(`\n FluentProvider: your \"theme\" is not defined !\n =============================================\n Make sure your root FluentProvider has set a theme or you're setting the theme in your child FluentProvider.\n `);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const renderer = useRenderer_unstable();\n const { styleTagId, rule } = useFluentProviderThemeStyleTag({\n theme: mergedTheme,\n targetDocument,\n rendererAttributes: renderer.styleElementAttributes ?? {},\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: getNativeElementProps('div', {\n ...props,\n dir,\n ref: useMergedRefs(ref, useFocusVisible<HTMLDivElement>({ targetDocument })),\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"],"mappings":"AAAA,SAASA,eAAe,QAAQ;AAChC,SACEC,qBAAA,IAAyBC,YAAY,EACrCC,kBAAA,IAAsBC,SAAS,EAC/BC,qBAAA,IAAyBC,YAAY,EACrCC,gCAAA,IAAoCC,uBAAuB,QACtD;AAMP,SAASC,qBAAqB,EAAEC,aAAa,QAAQ;AACrD,YAAYC,KAAA,MAAW;AACvB,SAASC,8BAA8B,QAAQ;AAE/C,SAASC,oBAAoB,QAAQ;AAErC;;;;;;;;;AASA,OAAO,MAAMC,0BAAA,GAA6BA,CACxCC,KAAA,EACAC,GAAA,KACwB;EACxB,MAAMC,aAAA,GAAgBb,SAAA;EACtB,MAAMc,WAAA,GAAcC,QAAA;EACpB,MAAMC,eAAA,GAAkBd,YAAA;EACxB,MAAMe,sBAAA,GAAuDV,KAAA,CAAMW,UAAU,CAACd,uBAAA,KAA4B,CAAC;EAE3G;;;;;EAKA,MAAM;IACJe,oBAAA,GAAuB,IAAI;IAC3B;IACAC,yBAAA;IACAC,GAAA,GAAMR,aAAA,CAAcQ,GAAG;IACvBC,cAAA,GAAiBT,aAAA,CAAcS,cAAc;IAC7CC,KAAA;IACAC,kBAAA,EAAoBC,SAAA,GAAY,CAAC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C,CAAI,EAAK;EACtC;EACA,IAAID,CAAA,IAAKC,CAAA,EAAG;IACV,OAAO;MAAE,GAAGD,CAAC;MAAE,GAAGC;IAAE;EACtB;EAEA,IAAID,CAAA,EAAG;IACL,OAAOA,CAAA;EACT;EAEA,OAAOC,CAAA;AACT;AAEA,SAASpC,SAAA,EAA8B;EACrC,OAAOR,KAAA,CAAMW,UAAU,CAACpB,YAAA;AAC1B"}
|
@@ -17,7 +17,7 @@ const useFluentProvider_unstable = (props, ref)=>{
|
|
17
17
|
const parentContext = (0, _reactSharedContexts.useFluent_unstable)();
|
18
18
|
const parentTheme = useTheme();
|
19
19
|
const parentOverrides = (0, _reactSharedContexts.useOverrides_unstable)();
|
20
|
-
const parentCustomStyleHooks = (
|
20
|
+
const parentCustomStyleHooks = _react.useContext(_reactSharedContexts.CustomStyleHooksContext_unstable) || {};
|
21
21
|
/**
|
22
22
|
* TODO: add merge functions to "dir" merge,
|
23
23
|
* nesting providers with the same "dir" should not add additional attributes to DOM
|
@@ -26,7 +26,6 @@ const useFluentProvider_unstable = (props, ref)=>{
|
|
26
26
|
customStyleHooks_unstable , dir =parentContext.dir , targetDocument =parentContext.targetDocument , theme , overrides_unstable: overrides = {} } = props;
|
27
27
|
const mergedTheme = shallowMerge(parentTheme, theme);
|
28
28
|
const mergedOverrides = shallowMerge(parentOverrides, overrides);
|
29
|
-
// parentCustomStyleHooks will not be a partial
|
30
29
|
const mergedCustomStyleHooks = shallowMerge(parentCustomStyleHooks, customStyleHooks_unstable);
|
31
30
|
_react.useEffect(()=>{
|
32
31
|
if (process.env.NODE_ENV !== 'production' && mergedTheme === undefined) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/FluentProvider/useFluentProvider.js"],"sourcesContent":["import { useFocusVisible } from '@fluentui/react-tabster';\nimport { ThemeContext_unstable as ThemeContext, useFluent_unstable as useFluent, useOverrides_unstable as useOverrides,
|
1
|
+
{"version":3,"sources":["../../../lib/components/FluentProvider/useFluentProvider.js"],"sourcesContent":["import { 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 } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport { useFluentProviderThemeStyleTag } from './useFluentProviderThemeStyleTag';\nimport { useRenderer_unstable } from '@griffel/react';\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 = (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 */\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 const mergedTheme = shallowMerge(parentTheme, theme);\n const mergedOverrides = shallowMerge(parentOverrides, overrides);\n const mergedCustomStyleHooks = shallowMerge(parentCustomStyleHooks, customStyleHooks_unstable);\n React.useEffect(() => {\n if (process.env.NODE_ENV !== 'production' && mergedTheme === undefined) {\n // eslint-disable-next-line no-console\n console.warn(`\n FluentProvider: your \"theme\" is not defined !\n =============================================\n Make sure your root FluentProvider has set a theme or you're setting the theme in your child FluentProvider.\n `);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n const renderer = useRenderer_unstable();\n var _renderer_styleElementAttributes;\n const {\n styleTagId,\n rule\n } = useFluentProviderThemeStyleTag({\n theme: mergedTheme,\n targetDocument,\n rendererAttributes: (_renderer_styleElementAttributes = renderer.styleElementAttributes) !== null && _renderer_styleElementAttributes !== void 0 ? _renderer_styleElementAttributes : {}\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: getNativeElementProps('div', {\n ...props,\n dir,\n ref: useMergedRefs(ref, useFocusVisible({\n targetDocument\n }))\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//# sourceMappingURL=useFluentProvider.js.map"],"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","useEffect","process","env","NODE_ENV","undefined","console","warn","renderer","useRenderer_unstable","_renderer_styleElementAttributes","styleTagId","rule","useFluentProviderThemeStyleTag","rendererAttributes","styleElementAttributes","themeClassName","components","root","getNativeElementProps","useMergedRefs","useFocusVisible","serverStyleProps","cssRule","attributes","id","a","b","ThemeContext"],"mappings":";;;;+BAeaA;;aAAAA;;;8BAfmB;qCAC2J;gCACtI;6DAC9B;gDACwB;wBACV;AAU9B,MAAMA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Ab,KAAKyC,IAAAA,6BAAa,EAACzC,KAAK0C,IAAAA,6BAAe,EAAC;gBACtC5B;YACF;QACF;QACA6B,kBAAkB;YAChBC,SAASX;YACTY,YAAY;gBACV,GAAGhB,SAASO,sBAAsB;gBAClCU,IAAId;YACN;QACF;IACF;AACF;AACA,SAASb,aAAa4B,CAAC,EAAEC,CAAC,EAAE;IAC1B,kEAAkE;IAClE,IAAID,KAAKC,GAAG;QACV,OAAO;YACL,GAAGD,CAAC;YACJ,GAAGC,CAAC;QACN;IACF,CAAC;IACD,IAAID,GAAG;QACL,OAAOA;IACT,CAAC;IACD,OAAOC;AACT;AACA,SAAS5C,WAAW;IAClB,OAAOI,OAAMC,UAAU,CAACwC,0CAAY;AACtC,EACA,6CAA6C"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-provider",
|
3
|
-
"version": "0.0.0-nightly-
|
3
|
+
"version": "0.0.0-nightly-20230426-0420.1",
|
4
4
|
"description": "Fluent UI React provider component",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -27,18 +27,18 @@
|
|
27
27
|
"devDependencies": {
|
28
28
|
"@fluentui/eslint-plugin": "*",
|
29
29
|
"@fluentui/react-conformance": "*",
|
30
|
-
"@fluentui/react-conformance-griffel": "0.0.0-nightly-
|
30
|
+
"@fluentui/react-conformance-griffel": "0.0.0-nightly-20230426-0420.1",
|
31
31
|
"@fluentui/scripts-api-extractor": "*",
|
32
32
|
"@fluentui/scripts-tasks": "*"
|
33
33
|
},
|
34
34
|
"dependencies": {
|
35
35
|
"@griffel/core": "^1.9.0",
|
36
36
|
"@griffel/react": "^1.5.2",
|
37
|
-
"@fluentui/react-shared-contexts": "0.0.0-nightly-
|
38
|
-
"@fluentui/react-tabster": "0.0.0-nightly-
|
39
|
-
"@fluentui/react-theme": "0.0.0-nightly-
|
40
|
-
"@fluentui/react-utilities": "0.0.0-nightly-
|
41
|
-
"@fluentui/react-jsx-runtime": "0.0.0-nightly-
|
37
|
+
"@fluentui/react-shared-contexts": "0.0.0-nightly-20230426-0420.1",
|
38
|
+
"@fluentui/react-tabster": "0.0.0-nightly-20230426-0420.1",
|
39
|
+
"@fluentui/react-theme": "0.0.0-nightly-20230426-0420.1",
|
40
|
+
"@fluentui/react-utilities": "0.0.0-nightly-20230426-0420.1",
|
41
|
+
"@fluentui/react-jsx-runtime": "0.0.0-nightly-20230426-0420.1",
|
42
42
|
"@swc/helpers": "^0.4.14"
|
43
43
|
},
|
44
44
|
"peerDependencies": {
|