@fluentui-react-native/win32-theme 0.39.0 → 0.39.3
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 +41 -0
- package/lib/NativeModule/_mocks_/getThemingModule.native.d.ts +1 -1
- package/lib/NativeModule/_mocks_/getThemingModule.native.js +2 -2
- package/lib/NativeModule/fallbackOfficeModule.d.ts +1 -1
- package/lib/NativeModule/fallbackOfficeModule.js +163 -163
- package/lib/NativeModule/getThemingModule.d.ts +1 -1
- package/lib/NativeModule/getThemingModule.js +2 -2
- package/lib/NativeModule/getThemingModule.native.d.ts +1 -1
- package/lib/NativeModule/getThemingModule.native.js +30 -28
- package/lib/NativeModule/hostThemeSetting.d.ts +1 -1
- package/lib/NativeModule/hostThemeSetting.js +3 -3
- package/lib/NativeModule/index.d.ts +2 -10
- package/lib/NativeModule/index.js +1 -1
- package/lib/NativeModule/officeThemingModule.d.ts +21 -21
- package/lib/NativeModule/officeThemingModule.js +1 -1
- package/lib/__tests__/win32-theme.test.d.ts +1 -1
- package/lib/__tests__/win32-theme.test.js +47 -47
- package/lib/createAliasesFromPalette.d.ts +1 -1
- package/lib/createAliasesFromPalette.js +56 -56
- package/lib/createBrandedThemeWithAlias.d.ts +1 -1
- package/lib/createBrandedThemeWithAlias.js +61 -56
- package/lib/createFontAliasTokens.d.ts +1 -1
- package/lib/createFontAliasTokens.js +3 -3
- package/lib/createOfficeAliasTokens.d.ts +1 -1
- package/lib/createOfficeAliasTokens.js +5 -5
- package/lib/createOfficeTheme.d.ts +1 -1
- package/lib/createOfficeTheme.js +46 -53
- package/lib/createPartialOfficeTheme.d.ts +1 -1
- package/lib/createPartialOfficeTheme.js +19 -22
- package/lib/getOfficeTokens.d.ts +227 -229
- package/lib/getOfficeTokens.js +26 -20
- package/lib/getThemeTypography.d.ts +1 -1
- package/lib/getThemeTypography.js +32 -32
- package/lib/highContrast/tokens-alias.d.ts +1 -1
- package/lib/highContrast/tokens-alias.js +11 -11
- package/lib/index.d.ts +2 -10
- package/lib/index.js +1 -1
- package/lib/paletteFromOfficeColors.d.ts +1 -1
- package/lib/paletteFromOfficeColors.js +114 -114
- package/lib-commonjs/NativeModule/_mocks_/getThemingModule.native.d.ts +1 -1
- package/lib-commonjs/NativeModule/_mocks_/getThemingModule.native.js +5 -5
- package/lib-commonjs/NativeModule/fallbackOfficeModule.d.ts +1 -1
- package/lib-commonjs/NativeModule/fallbackOfficeModule.js +165 -165
- package/lib-commonjs/NativeModule/getThemingModule.d.ts +1 -1
- package/lib-commonjs/NativeModule/getThemingModule.js +5 -5
- package/lib-commonjs/NativeModule/getThemingModule.native.d.ts +1 -1
- package/lib-commonjs/NativeModule/getThemingModule.native.js +35 -33
- package/lib-commonjs/NativeModule/hostThemeSetting.d.ts +1 -1
- package/lib-commonjs/NativeModule/hostThemeSetting.js +5 -5
- package/lib-commonjs/NativeModule/index.d.ts +2 -10
- package/lib-commonjs/NativeModule/index.js +8 -23
- package/lib-commonjs/NativeModule/officeThemingModule.d.ts +21 -21
- package/lib-commonjs/NativeModule/officeThemingModule.js +3 -3
- package/lib-commonjs/__tests__/win32-theme.test.d.ts +1 -1
- package/lib-commonjs/__tests__/win32-theme.test.js +57 -57
- package/lib-commonjs/createAliasesFromPalette.d.ts +1 -1
- package/lib-commonjs/createAliasesFromPalette.js +58 -58
- package/lib-commonjs/createBrandedThemeWithAlias.d.ts +1 -1
- package/lib-commonjs/createBrandedThemeWithAlias.js +64 -59
- package/lib-commonjs/createFontAliasTokens.d.ts +1 -1
- package/lib-commonjs/createFontAliasTokens.js +8 -8
- package/lib-commonjs/createOfficeAliasTokens.d.ts +1 -1
- package/lib-commonjs/createOfficeAliasTokens.js +10 -10
- package/lib-commonjs/createOfficeTheme.d.ts +1 -1
- package/lib-commonjs/createOfficeTheme.js +57 -66
- package/lib-commonjs/createPartialOfficeTheme.d.ts +1 -1
- package/lib-commonjs/createPartialOfficeTheme.js +22 -25
- package/lib-commonjs/getOfficeTokens.d.ts +227 -229
- package/lib-commonjs/getOfficeTokens.js +39 -35
- package/lib-commonjs/getThemeTypography.d.ts +1 -1
- package/lib-commonjs/getThemeTypography.js +36 -36
- package/lib-commonjs/highContrast/tokens-alias.d.ts +1 -1
- package/lib-commonjs/highContrast/tokens-alias.js +18 -20
- package/lib-commonjs/index.d.ts +2 -10
- package/lib-commonjs/index.js +23 -89
- package/lib-commonjs/paletteFromOfficeColors.d.ts +1 -1
- package/lib-commonjs/paletteFromOfficeColors.js +116 -116
- package/package.json +26 -25
- package/eslint.config.js +0 -3
|
@@ -1,173 +1,173 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.fallbackOfficeModule = void 0;
|
|
4
4
|
exports.fallbackGetPalette = fallbackGetPalette;
|
|
5
5
|
const whiteColorsPalette = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
6
|
+
Bkg: '#FFFFFF',
|
|
7
|
+
BkgHover: '#D2D2D2',
|
|
8
|
+
BkgPressed: '#B1B1B1',
|
|
9
|
+
BkgSelected: '#C6C6C6',
|
|
10
|
+
BkgSubtle: '#F3F3F3',
|
|
11
|
+
BkgSelectionHighlight: '#737373',
|
|
12
|
+
Text: '#262626',
|
|
13
|
+
TextRest: '#262626',
|
|
14
|
+
TextHover: '#262626',
|
|
15
|
+
TextPressed: '#262626',
|
|
16
|
+
TextSelected: '#262626',
|
|
17
|
+
TextDisabled: '#B1B1B1',
|
|
18
|
+
TextSelectionHighlight: '#FFFFFF',
|
|
19
|
+
TextSecondary: '#666666',
|
|
20
|
+
TextSecondaryRest: '#666666',
|
|
21
|
+
TextSecondaryHover: '#505050',
|
|
22
|
+
TextSecondaryPressed: '#666666',
|
|
23
|
+
TextSecondarySelected: '#666666',
|
|
24
|
+
TextEmphasis: '#D83B01',
|
|
25
|
+
TextEmphasisRest: '#D83B01',
|
|
26
|
+
TextEmphasisHover: '#EA6115',
|
|
27
|
+
TextEmphasisPressed: '#A22C01',
|
|
28
|
+
TextEmphasisSelected: '#D83B01',
|
|
29
|
+
StrokeSelectedHover: '#969696',
|
|
30
|
+
StrokeKeyboard: '#969696',
|
|
31
|
+
StrokeOverRest: '#00000000',
|
|
32
|
+
StrokeOverHover: '#00000000',
|
|
33
|
+
StrokeOverPressed: '#00000000',
|
|
34
|
+
StrokeOverSelectedRest: '#00000000',
|
|
35
|
+
StrokeOverSelectedHover: '#969696',
|
|
36
|
+
StrokeOverSelectedPressed: '#00000000',
|
|
37
|
+
BkgCtl: '#E6E6E6',
|
|
38
|
+
BkgCtlHover: '#FFF7F0',
|
|
39
|
+
BkgCtlPressed: '#FBDFD0',
|
|
40
|
+
BkgCtlSelected: '#E6E6E6',
|
|
41
|
+
BkgCtlDisabled: '#E6E6E6',
|
|
42
|
+
TextCtl: '#262626',
|
|
43
|
+
TextCtlHover: '#262626',
|
|
44
|
+
TextCtlPressed: '#262626',
|
|
45
|
+
TextCtlSelected: '#262626',
|
|
46
|
+
TextCtlDisabled: '#B1B1B1',
|
|
47
|
+
StrokeCtl: '#969696',
|
|
48
|
+
StrokeCtlHover: '#FBDFD0',
|
|
49
|
+
StrokeCtlPressed: '#EA6115',
|
|
50
|
+
StrokeCtlSelected: '#969696',
|
|
51
|
+
StrokeCtlDisabled: '#D2D2D2',
|
|
52
|
+
StrokeCtlKeyboard: '#FBDFD0',
|
|
53
|
+
BkgCtlEmphasis: '#D83B01',
|
|
54
|
+
BkgCtlEmphasisHover: '#F29F71',
|
|
55
|
+
BkgCtlEmphasisPressed: '#A22C01',
|
|
56
|
+
BkgCtlEmphasisDisabled: '#E6E6E6',
|
|
57
|
+
TextCtlEmphasis: '#FFFFFF',
|
|
58
|
+
TextCtlEmphasisHover: '#FFFFFF',
|
|
59
|
+
TextCtlEmphasisPressed: '#FFFFFF',
|
|
60
|
+
TextCtlEmphasisDisabled: '#B1B1B1',
|
|
61
|
+
StrokeCtlEmphasis: '#A22C01',
|
|
62
|
+
StrokeCtlEmphasisHover: '#D83B01',
|
|
63
|
+
StrokeCtlEmphasisPressed: '#A22C01',
|
|
64
|
+
StrokeCtlEmphasisDisabled: '#D2D2D2',
|
|
65
|
+
StrokeCtlEmphasisKeyboard: '#A22C01',
|
|
66
|
+
BkgCtlSubtle: '#FFFFFF',
|
|
67
|
+
BkgCtlSubtleHover: '#FFFFFF',
|
|
68
|
+
BkgCtlSubtlePressed: '#FFFFFF',
|
|
69
|
+
BkgCtlSubtleDisabled: '#F3F3F3',
|
|
70
|
+
TextCtlSubtle: '#262626',
|
|
71
|
+
TextCtlSubtleHover: '#262626',
|
|
72
|
+
TextCtlSubtlePressed: '#262626',
|
|
73
|
+
TextCtlSubtleDisabled: '#B1B1B1',
|
|
74
|
+
StrokeCtlSubtle: '#C6C6C6',
|
|
75
|
+
StrokeCtlSubtleHover: '#969696',
|
|
76
|
+
StrokeCtlSubtlePressed: '#969696',
|
|
77
|
+
StrokeCtlSubtleDisabled: '#C6C6C6',
|
|
78
|
+
StrokeCtlSubtleKeyboard: '#969696',
|
|
79
|
+
TextHyperlink: '#D83B01',
|
|
80
|
+
TextHyperlinkHover: '#A22C01',
|
|
81
|
+
TextHyperlinkPressed: '#6C1E01',
|
|
82
|
+
TextActive: '#262626',
|
|
83
|
+
TextActiveHover: '#EA6115',
|
|
84
|
+
TextActivePressed: '#A22C01',
|
|
85
|
+
TextActiveSelected: '#D83B01',
|
|
86
|
+
StrokeOnlyHover: '#B1B1B1',
|
|
87
|
+
StrokeOnlyPressed: '#737373',
|
|
88
|
+
StrokeOnlySelected: '#969696',
|
|
89
|
+
TextError: '#A50000',
|
|
90
|
+
TextErrorHover: '#A50000',
|
|
91
|
+
TextErrorPressed: '#A50000',
|
|
92
|
+
TextErrorSelected: '#A50000',
|
|
93
|
+
ThumbToggleSwitchOff: '#505050',
|
|
94
|
+
ThumbToggleSwitchOffHover: '#505050',
|
|
95
|
+
ThumbToggleSwitchOffPressed: '#505050',
|
|
96
|
+
ThumbToggleSwitchOffDisabled: '#D2D2D2',
|
|
97
|
+
ThumbToggleSwitchOn: '#FFFFFF',
|
|
98
|
+
ThumbToggleSwitchOnHover: '#FFFFFF',
|
|
99
|
+
ThumbToggleSwitchOnPressed: '#FFFFFF',
|
|
100
|
+
ThumbToggleSwitchOnDisabled: '#FFFFFF',
|
|
101
|
+
BkgToggleSwitchOff: '#FFFFFF',
|
|
102
|
+
BkgToggleSwitchOffHover: '#D2D2D2',
|
|
103
|
+
BkgToggleSwitchOffPressed: '#B1B1B1',
|
|
104
|
+
BkgToggleSwitchOffDisabled: '#FFFFFF',
|
|
105
|
+
BkgToggleSwitchOn: '#D83B01',
|
|
106
|
+
BkgToggleSwitchOnHover: '#EA6115',
|
|
107
|
+
BkgToggleSwitchOnPressed: '#A22C01',
|
|
108
|
+
BkgToggleSwitchOnDisabled: '#D2D2D2',
|
|
109
|
+
StrokeToggleSwitchOff: '#505050',
|
|
110
|
+
StrokeToggleSwitchOffHover: '#505050',
|
|
111
|
+
StrokeToggleSwitchOffPressed: '#505050',
|
|
112
|
+
StrokeToggleSwitchOffDisabled: '#D2D2D2',
|
|
113
|
+
StrokeToggleSwitchOn: '#D83B01',
|
|
114
|
+
StrokeToggleSwitchOnHover: '#EA6115',
|
|
115
|
+
StrokeToggleSwitchOnPressed: '#A22C01',
|
|
116
|
+
StrokeToggleSwitchOnDisabled: '#D2D2D2',
|
|
117
|
+
SliderPrimary: '#444444',
|
|
118
|
+
SliderPrimaryHover: '#D2D2D2',
|
|
119
|
+
SliderPrimaryPressed: '#262626',
|
|
120
|
+
SliderPrimaryDisabled: '#969696',
|
|
121
|
+
SliderSecondary: '#D2D2D2',
|
|
122
|
+
SliderBuffer: '#262626',
|
|
123
|
+
SliderKeyboard: '#444444',
|
|
124
|
+
SliderToolTipBorder: '#C6C6C6',
|
|
125
|
+
SliderToolTipLabel: '#262626',
|
|
126
|
+
SliderToolTipBkg: '#FFFFFF',
|
|
127
|
+
AccentDark: '#C6C6C6',
|
|
128
|
+
AccentLight: '#E6E6E6',
|
|
129
|
+
AccentEmphasis: '#D83B01',
|
|
130
|
+
AccentOutline: '#000000',
|
|
131
|
+
BkgAccentTint: '#D2E0F4',
|
|
132
|
+
TextAccentTint: '#242424',
|
|
133
|
+
TextEmphasis2: '#D83B01',
|
|
134
|
+
BkgCtlSubtleSelected: '#F3F3F3',
|
|
135
|
+
TextCtlSubtleSelected: '#262626',
|
|
136
|
+
BkgCtlEmphasisFocus: '#F3F3F3',
|
|
137
|
+
BkgCtlSubtleFocus: '#F3F3F3',
|
|
138
|
+
BkgCtlSubtleHoverDisabled: '#F3F3F3',
|
|
139
|
+
BkgCtlSubtleSelectedDisabled: '#F3F3F3',
|
|
140
|
+
BkgHeader: '#E6E6E6',
|
|
141
|
+
TextHeader: '#262626',
|
|
142
|
+
TextTextBoxPlaceholder: '#666666',
|
|
143
143
|
};
|
|
144
144
|
function fallbackGetPalette(pal) {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
145
|
+
return pal === 'TaskPane'
|
|
146
|
+
? {
|
|
147
|
+
...whiteColorsPalette,
|
|
148
|
+
Bkg: 'antiquewhite',
|
|
149
|
+
}
|
|
150
|
+
: whiteColorsPalette;
|
|
151
151
|
}
|
|
152
152
|
exports.fallbackOfficeModule = {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
153
|
+
getPalette: fallbackGetPalette,
|
|
154
|
+
getConstants() {
|
|
155
|
+
return {
|
|
156
|
+
ramps: {
|
|
157
|
+
App: ['#F8F8F8', '#EFF6FC', '#BBDAF3', '#55A4E2', '#359EDD', '#0078d7', '#283E4A', '#030C13'],
|
|
158
|
+
FluentGrays: ['#FAF9F8', '#797775', '#11100F'],
|
|
159
|
+
ClassicGrays: ['#FFFFFF', '#737373', '#000000'],
|
|
160
|
+
Sepias: ['#ECE6DE'],
|
|
161
|
+
},
|
|
162
|
+
typography: {},
|
|
163
|
+
fluentTypography: {},
|
|
164
|
+
rampNames: {
|
|
165
|
+
App: ['FakeApp1', 'App2', 'App3', 'App4', 'App5', 'App6', 'App7', 'App8'],
|
|
166
|
+
FluentGrays: ['FakeGray1', 'Gray2', 'Gray3'],
|
|
167
|
+
ClassicGrays: ['FakeGray4', 'Gray5', 'Gray6'],
|
|
168
|
+
Sepias: ['FakeSepia'],
|
|
169
|
+
},
|
|
170
|
+
};
|
|
171
|
+
},
|
|
172
172
|
};
|
|
173
|
-
//# sourceMappingURL=fallbackOfficeModule.js.map
|
|
173
|
+
//# sourceMappingURL=fallbackOfficeModule.js.map
|
|
@@ -4,4 +4,4 @@ import type { OfficeThemingModule } from './officeThemingModule';
|
|
|
4
4
|
* implementations for react-native-web, where the native module will not exist. In this case just use the full fallback implementation
|
|
5
5
|
*/
|
|
6
6
|
export declare function getThemingModule(): [OfficeThemingModule, NativeEventEmitter | undefined];
|
|
7
|
-
//# sourceMappingURL=getThemingModule.d.ts.map
|
|
7
|
+
//# sourceMappingURL=getThemingModule.d.ts.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getThemingModule = getThemingModule;
|
|
4
|
-
const fallbackOfficeModule_1 = require(
|
|
4
|
+
const fallbackOfficeModule_1 = require("./fallbackOfficeModule");
|
|
5
5
|
/**
|
|
6
6
|
* implementations for react-native-web, where the native module will not exist. In this case just use the full fallback implementation
|
|
7
7
|
*/
|
|
8
8
|
function getThemingModule() {
|
|
9
|
-
|
|
9
|
+
return [fallbackOfficeModule_1.fallbackOfficeModule, undefined];
|
|
10
10
|
}
|
|
11
|
-
//# sourceMappingURL=getThemingModule.js.map
|
|
11
|
+
//# sourceMappingURL=getThemingModule.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { NativeEventEmitter } from 'react-native';
|
|
2
2
|
import type { OfficeThemingModule } from './officeThemingModule';
|
|
3
3
|
export declare function getThemingModule(): [OfficeThemingModule, NativeEventEmitter | undefined];
|
|
4
|
-
//# sourceMappingURL=getThemingModule.native.d.ts.map
|
|
4
|
+
//# sourceMappingURL=getThemingModule.native.d.ts.map
|
|
@@ -1,49 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getThemingModule = getThemingModule;
|
|
4
|
-
const react_native_1 = require(
|
|
5
|
-
const fallbackOfficeModule_1 = require(
|
|
6
|
-
const hostThemeSetting_1 = require(
|
|
4
|
+
const react_native_1 = require("react-native");
|
|
5
|
+
const fallbackOfficeModule_1 = require("./fallbackOfficeModule");
|
|
6
|
+
const hostThemeSetting_1 = require("./hostThemeSetting");
|
|
7
7
|
/**
|
|
8
8
|
* If we have a userAgent string, let's assume we're web debugging. __DEV__ is for developer bundles. Currently,
|
|
9
9
|
* react-native only polyfills navigator with { product: 'ReactNative', geolocation: NativeModules.Geolocation }
|
|
10
10
|
*/
|
|
11
11
|
function disableGetPalette() {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const disabled = __DEV__ && typeof globalThis.navigator !== 'undefined' && globalThis.navigator.userAgent !== undefined;
|
|
13
|
+
disabled && console.warn(console.warn('Web Debugging forces Theming Native Module to fallback to fake color values.'));
|
|
14
|
+
return disabled;
|
|
15
15
|
}
|
|
16
16
|
function themeGetConstants() {
|
|
17
|
-
|
|
17
|
+
return themingModuleConstants;
|
|
18
18
|
}
|
|
19
19
|
let themingModule = undefined;
|
|
20
20
|
let themingModuleConstants = undefined;
|
|
21
21
|
let themingModuleEmitter = undefined;
|
|
22
22
|
function getThemingModule() {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
23
|
+
if (!themingModule) {
|
|
24
|
+
const module = react_native_1.TurboModuleRegistry.get('Theming');
|
|
25
|
+
// if the native module exists return the module + an emitter for it
|
|
26
|
+
if (module) {
|
|
27
|
+
if (!isInstantiated) {
|
|
28
|
+
// We need to store the host theme so that when themes are created
|
|
29
|
+
// they can use this information.
|
|
30
|
+
(0, hostThemeSetting_1.setCurrentHostThemeSetting)(module.getConstants().initialHostThemeSetting);
|
|
31
|
+
isInstantiated = true;
|
|
32
|
+
}
|
|
33
|
+
// Cache the result of getConstants to avoid continuous Native->JS marshalling
|
|
34
|
+
themingModuleConstants = module.getConstants();
|
|
35
|
+
// mock getPalette if it should be disabled
|
|
36
|
+
if (disableGetPalette()) {
|
|
37
|
+
themingModule = { ...module, getPalette: fallbackOfficeModule_1.fallbackGetPalette, getConstants: themeGetConstants };
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
themingModule = { ...module, getPalette: module.getPalette, getConstants: themeGetConstants };
|
|
41
|
+
}
|
|
42
|
+
themingModuleEmitter = new react_native_1.NativeEventEmitter(module);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
themingModule = fallbackOfficeModule_1.fallbackOfficeModule;
|
|
46
|
+
}
|
|
44
47
|
}
|
|
45
|
-
|
|
46
|
-
return [themingModule, themingModuleEmitter];
|
|
48
|
+
return [themingModule, themingModuleEmitter];
|
|
47
49
|
}
|
|
48
50
|
let isInstantiated = false;
|
|
49
|
-
//# sourceMappingURL=getThemingModule.native.js.map
|
|
51
|
+
//# sourceMappingURL=getThemingModule.native.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.setCurrentHostThemeSetting = exports.getCurrentHostThemeSetting = void 0;
|
|
4
4
|
// The ThemingModule currently only stores its initial host theme state
|
|
5
5
|
// This state is never updated (it's a constant on the native module)
|
|
@@ -12,11 +12,11 @@ exports.setCurrentHostThemeSetting = exports.getCurrentHostThemeSetting = void 0
|
|
|
12
12
|
// entire lifetime of the instance.
|
|
13
13
|
let currentHostThemeSetting = '';
|
|
14
14
|
const getCurrentHostThemeSetting = () => {
|
|
15
|
-
|
|
15
|
+
return currentHostThemeSetting;
|
|
16
16
|
};
|
|
17
17
|
exports.getCurrentHostThemeSetting = getCurrentHostThemeSetting;
|
|
18
18
|
const setCurrentHostThemeSetting = (newHostThemeSetting) => {
|
|
19
|
-
|
|
19
|
+
currentHostThemeSetting = newHostThemeSetting;
|
|
20
20
|
};
|
|
21
21
|
exports.setCurrentHostThemeSetting = setCurrentHostThemeSetting;
|
|
22
|
-
//# sourceMappingURL=hostThemeSetting.js.map
|
|
22
|
+
//# sourceMappingURL=hostThemeSetting.js.map
|
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
export { fallbackOfficeModule, fallbackGetPalette } from './fallbackOfficeModule';
|
|
2
2
|
export { getThemingModule } from './getThemingModule';
|
|
3
|
-
export type {
|
|
4
|
-
|
|
5
|
-
PlatformDefaultsChangedCallback,
|
|
6
|
-
CxxException,
|
|
7
|
-
NativeColorRamps,
|
|
8
|
-
NativeColorNames,
|
|
9
|
-
OfficeThemingModule,
|
|
10
|
-
IEventEmitter,
|
|
11
|
-
} from './officeThemingModule';
|
|
12
|
-
//# sourceMappingURL=index.d.ts.map
|
|
3
|
+
export type { PlatformDefaultsChangedArgs, PlatformDefaultsChangedCallback, CxxException, NativeColorRamps, NativeColorNames, OfficeThemingModule, IEventEmitter, } from './officeThemingModule';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,24 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getThemingModule = exports.fallbackGetPalette = exports.fallbackOfficeModule = void 0;
|
|
4
|
-
const fallbackOfficeModule_1 = require(
|
|
5
|
-
Object.defineProperty(exports,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
});
|
|
11
|
-
Object.defineProperty(exports, 'fallbackGetPalette', {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: function () {
|
|
14
|
-
return fallbackOfficeModule_1.fallbackGetPalette;
|
|
15
|
-
},
|
|
16
|
-
});
|
|
17
|
-
const getThemingModule_1 = require('./getThemingModule');
|
|
18
|
-
Object.defineProperty(exports, 'getThemingModule', {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return getThemingModule_1.getThemingModule;
|
|
22
|
-
},
|
|
23
|
-
});
|
|
24
|
-
//# sourceMappingURL=index.js.map
|
|
4
|
+
const fallbackOfficeModule_1 = require("./fallbackOfficeModule");
|
|
5
|
+
Object.defineProperty(exports, "fallbackOfficeModule", { enumerable: true, get: function () { return fallbackOfficeModule_1.fallbackOfficeModule; } });
|
|
6
|
+
Object.defineProperty(exports, "fallbackGetPalette", { enumerable: true, get: function () { return fallbackOfficeModule_1.fallbackGetPalette; } });
|
|
7
|
+
const getThemingModule_1 = require("./getThemingModule");
|
|
8
|
+
Object.defineProperty(exports, "getThemingModule", { enumerable: true, get: function () { return getThemingModule_1.getThemingModule; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -2,37 +2,37 @@ import type { NativeModule, ColorValue } from 'react-native';
|
|
|
2
2
|
import type { OfficePalette, Typography } from '@fluentui-react-native/theme-types';
|
|
3
3
|
type ObjectBase = {};
|
|
4
4
|
export type PlatformDefaultsChangedArgs = {
|
|
5
|
-
|
|
5
|
+
hostThemeSetting: string;
|
|
6
6
|
};
|
|
7
7
|
export type PlatformDefaultsChangedCallback = (args?: PlatformDefaultsChangedArgs) => void;
|
|
8
8
|
export interface CxxException {
|
|
9
|
-
|
|
9
|
+
message: string;
|
|
10
10
|
}
|
|
11
11
|
export interface NativeColorRamps {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
FluentGrays: ColorValue[];
|
|
13
|
+
ClassicGrays: ColorValue[];
|
|
14
|
+
App: ColorValue[];
|
|
15
|
+
Sepias: ColorValue[];
|
|
16
|
+
[key: string]: ColorValue[];
|
|
17
17
|
}
|
|
18
18
|
export interface NativeColorNames {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
FluentGrays: string[];
|
|
20
|
+
ClassicGrays: string[];
|
|
21
|
+
App: string[];
|
|
22
|
+
Sepias: string[];
|
|
23
23
|
}
|
|
24
24
|
export interface OfficeThemingModule extends NativeModule {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
getPalette(palette?: string): OfficePalette | CxxException;
|
|
26
|
+
getConstants(): {
|
|
27
|
+
typography: ObjectBase;
|
|
28
|
+
fluentTypography: Typography;
|
|
29
|
+
ramps: NativeColorRamps;
|
|
30
|
+
rampNames: NativeColorNames;
|
|
31
|
+
initialHostThemeSetting?: string;
|
|
32
|
+
};
|
|
33
33
|
}
|
|
34
34
|
export interface IEventEmitter {
|
|
35
|
-
|
|
35
|
+
addListener: (event: string, PlatformDefaultsChangedCallback: any) => void;
|
|
36
36
|
}
|
|
37
37
|
export {};
|
|
38
|
-
//# sourceMappingURL=officeThemingModule.d.ts.map
|
|
38
|
+
//# sourceMappingURL=officeThemingModule.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
//# sourceMappingURL=officeThemingModule.js.map
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
//# sourceMappingURL=officeThemingModule.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=win32-theme.test.d.ts.map
|
|
2
|
+
//# sourceMappingURL=win32-theme.test.d.ts.map
|