@uifabricshared/theming-react-native 0.20.20 → 0.21.0
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 +97 -3
- package/README.md +1 -1
- package/etc/theming-react-native.api.md +12 -11
- package/lib/BaselinePlatformDefaults.d.ts +1 -1
- package/lib/BaselinePlatformDefaults.js +2 -2
- package/lib/BaselinePlatformDefaults.js.map +1 -1
- package/lib/Global.d.ts +1 -1
- package/lib/Global.js +11 -11
- package/lib/Global.js.map +1 -1
- package/lib/NativeModule/ThemingModule.d.ts +2 -2
- package/lib/NativeModule/ThemingModule.js +1 -1
- package/lib/NativeModule/ThemingModule.types.d.ts +13 -13
- package/lib/NativeModule/ThemingModule.types.js +1 -1
- package/lib/NativeModule/ThemingModuleHelpers.d.ts +8 -3
- package/lib/NativeModule/ThemingModuleHelpers.d.ts.map +1 -1
- package/lib/NativeModule/ThemingModuleHelpers.js +36 -36
- package/lib/NativeModule/ThemingModuleHelpers.js.map +1 -1
- package/lib/NativeModule/getHostSettings.d.ts +1 -1
- package/lib/NativeModule/getHostSettings.js +2 -2
- package/lib/NativeModule/getHostSettings.js.map +1 -1
- package/lib/NativeModule/index.d.ts +1 -1
- package/lib/NativeModule/index.js +1 -1
- package/lib/Theme.types.d.ts +1 -1
- package/lib/Theme.types.js +1 -1
- package/lib/ThemeContext.d.ts +1 -1
- package/lib/ThemeContext.js +1 -1
- package/lib/ThemeLayer.d.ts +25 -24
- package/lib/ThemeLayer.d.ts.map +1 -1
- package/lib/ThemeLayer.js +42 -39
- package/lib/ThemeLayer.js.map +1 -1
- package/lib/ThemeProvider.d.ts +1 -1
- package/lib/ThemeProvider.js +21 -20
- package/lib/ThemeProvider.js.map +1 -1
- package/lib/ThemeProvider.types.d.ts +3 -3
- package/lib/ThemeProvider.types.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/platform/PlatformDefaults.d.ts +8 -2
- package/lib/platform/PlatformDefaults.d.ts.map +1 -1
- package/lib/platform/PlatformDefaults.js +2 -2
- package/lib/platform/PlatformDefaults.js.map +1 -1
- package/lib/platform/PlatformDefaults.native.d.ts +8 -2
- package/lib/platform/PlatformDefaults.native.d.ts.map +1 -1
- package/lib/platform/PlatformDefaults.native.js +6 -6
- package/lib/platform/PlatformDefaults.native.js.map +1 -1
- package/lib/platform/index.d.ts +1 -1
- package/lib/platform/index.js +1 -1
- package/lib-commonjs/BaselinePlatformDefaults.d.ts +1 -1
- package/lib-commonjs/BaselinePlatformDefaults.js +6 -7
- package/lib-commonjs/BaselinePlatformDefaults.js.map +1 -1
- package/lib-commonjs/Global.d.ts +1 -1
- package/lib-commonjs/Global.js +21 -22
- package/lib-commonjs/Global.js.map +1 -1
- package/lib-commonjs/NativeModule/ThemingModule.d.ts +2 -2
- package/lib-commonjs/NativeModule/ThemingModule.js +5 -5
- package/lib-commonjs/NativeModule/ThemingModule.types.d.ts +13 -13
- package/lib-commonjs/NativeModule/ThemingModule.types.js +3 -3
- package/lib-commonjs/NativeModule/ThemingModuleHelpers.d.ts +8 -3
- package/lib-commonjs/NativeModule/ThemingModuleHelpers.js +46 -44
- package/lib-commonjs/NativeModule/ThemingModuleHelpers.js.map +1 -1
- package/lib-commonjs/NativeModule/getHostSettings.d.ts +1 -1
- package/lib-commonjs/NativeModule/getHostSettings.js +5 -6
- package/lib-commonjs/NativeModule/getHostSettings.js.map +1 -1
- package/lib-commonjs/NativeModule/index.d.ts +1 -1
- package/lib-commonjs/NativeModule/index.js +17 -7
- package/lib-commonjs/NativeModule/index.js.map +1 -1
- package/lib-commonjs/Theme.types.d.ts +1 -1
- package/lib-commonjs/Theme.types.js +3 -3
- package/lib-commonjs/ThemeContext.d.ts +1 -1
- package/lib-commonjs/ThemeContext.js +67 -30
- package/lib-commonjs/ThemeContext.js.map +1 -1
- package/lib-commonjs/ThemeLayer.d.ts +25 -24
- package/lib-commonjs/ThemeLayer.d.ts.map +1 -1
- package/lib-commonjs/ThemeLayer.js +97 -67
- package/lib-commonjs/ThemeLayer.js.map +1 -1
- package/lib-commonjs/ThemeProvider.d.ts +1 -1
- package/lib-commonjs/ThemeProvider.js +79 -49
- package/lib-commonjs/ThemeProvider.js.map +1 -1
- package/lib-commonjs/ThemeProvider.types.d.ts +3 -3
- package/lib-commonjs/ThemeProvider.types.js +3 -3
- package/lib-commonjs/index.d.ts +1 -1
- package/lib-commonjs/index.js +108 -24
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/platform/PlatformDefaults.d.ts +8 -2
- package/lib-commonjs/platform/PlatformDefaults.js +11 -9
- package/lib-commonjs/platform/PlatformDefaults.js.map +1 -1
- package/lib-commonjs/platform/PlatformDefaults.native.d.ts +8 -2
- package/lib-commonjs/platform/PlatformDefaults.native.js +15 -13
- package/lib-commonjs/platform/PlatformDefaults.native.js.map +1 -1
- package/lib-commonjs/platform/index.d.ts +1 -1
- package/lib-commonjs/platform/index.js +29 -18
- package/package.json +58 -62
- package/src/ThemeLayer.tsx +3 -2
- package/babel.config.js +0 -1
|
@@ -5,7 +5,7 @@ import type { ITheme, IPartialTheme, OfficePalette as IOfficePalette } from '@ui
|
|
|
5
5
|
* @deprecated
|
|
6
6
|
*/
|
|
7
7
|
export interface IEventEmitter {
|
|
8
|
-
|
|
8
|
+
addListener: (event: string, PlatformDefaultsChangedCallback: any) => void;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* @deprecated
|
|
@@ -15,21 +15,21 @@ export type IPlatformThemeDefinition = IPartialTheme | IProcessTheme<ITheme, IPa
|
|
|
15
15
|
* @deprecated
|
|
16
16
|
*/
|
|
17
17
|
export interface IThemingModuleHelper {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Gets a complete platform theme suitable for using with a Theme Registry
|
|
20
|
+
*/
|
|
21
|
+
getPlatformDefaults: (themeId?: string) => ITheme;
|
|
22
|
+
/**
|
|
23
|
+
* Gets a theme definition to register with a Theme Registry & use with the theme context to create a subtree with the
|
|
24
|
+
* look & feel of a platform theme.
|
|
25
|
+
*/
|
|
26
|
+
getPlatformThemeDefinition: (themeId?: string) => IPlatformThemeDefinition;
|
|
27
|
+
addListener: (listener: PlatformDefaultsChangedCallback) => void;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* @deprecated
|
|
31
31
|
*/
|
|
32
32
|
export type IHostSettingsWin32 = {
|
|
33
|
-
|
|
33
|
+
palette: IOfficePalette;
|
|
34
34
|
};
|
|
35
|
-
//# sourceMappingURL=ThemingModule.types.d.ts.map
|
|
35
|
+
//# sourceMappingURL=ThemingModule.types.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
//# sourceMappingURL=ThemingModule.types.js.map
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
|
+
//# sourceMappingURL=ThemingModule.types.js.map
|
|
@@ -2,15 +2,20 @@ import type { OfficeThemingModule } from '@fluentui-react-native/win32-theme';
|
|
|
2
2
|
import type { OfficePalette } from '@uifabricshared/theming-ramp';
|
|
3
3
|
import type { IThemingModuleHelper, IEventEmitter } from './ThemingModule.types';
|
|
4
4
|
type PaletteCache = {
|
|
5
|
-
|
|
5
|
+
[key: string]: OfficePalette;
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
8
8
|
* @deprecated
|
|
9
9
|
*/
|
|
10
|
-
export declare function translateOfficeTheme(
|
|
10
|
+
export declare function translateOfficeTheme(
|
|
11
|
+
module: OfficeThemingModule,
|
|
12
|
+
cache: PaletteCache,
|
|
13
|
+
id?: string,
|
|
14
|
+
themeName?: string,
|
|
15
|
+
): import('@uifabricshared/theming-ramp').IPartialTheme;
|
|
11
16
|
/**
|
|
12
17
|
* @deprecated
|
|
13
18
|
*/
|
|
14
19
|
export declare function createThemingModuleHelper(themingModule?: OfficeThemingModule, emitter?: IEventEmitter): IThemingModuleHelper;
|
|
15
20
|
export {};
|
|
16
|
-
//# sourceMappingURL=ThemingModuleHelpers.d.ts.map
|
|
21
|
+
//# sourceMappingURL=ThemingModuleHelpers.d.ts.map
|
|
@@ -1,62 +1,64 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
|
+
exports.translateOfficeTheme = translateOfficeTheme;
|
|
4
|
+
exports.createThemingModuleHelper = createThemingModuleHelper;
|
|
5
|
+
const win32_theme_1 = require('@fluentui-react-native/win32-theme');
|
|
6
|
+
const theming_ramp_1 = require('@uifabricshared/theming-ramp');
|
|
7
|
+
const BaselinePlatformDefaults_1 = require('../BaselinePlatformDefaults');
|
|
7
8
|
function isException(palette) {
|
|
8
|
-
|
|
9
|
+
return palette.message !== undefined;
|
|
9
10
|
}
|
|
10
11
|
function updatePaletteInCache(module, cache, palette) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const paletteValue = module.getPalette(palette);
|
|
13
|
+
if (!isException(paletteValue)) {
|
|
14
|
+
cache[palette] = paletteValue;
|
|
15
|
+
}
|
|
15
16
|
}
|
|
16
17
|
const getPaletteCacheKey = (palette) => {
|
|
17
|
-
|
|
18
|
+
return palette || 'WhiteColors';
|
|
18
19
|
};
|
|
19
20
|
function ensurePalette(module, paletteCache, palette) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
const key = getPaletteCacheKey(palette);
|
|
22
|
+
if (!paletteCache[key]) {
|
|
23
|
+
updatePaletteInCache(module, paletteCache, key);
|
|
24
|
+
}
|
|
25
|
+
return paletteCache[key] || {};
|
|
25
26
|
}
|
|
26
27
|
/**
|
|
27
28
|
* @deprecated
|
|
28
29
|
*/
|
|
29
30
|
function translateOfficeTheme(module, cache, id, themeName) {
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
const palette = ensurePalette(module, cache, id);
|
|
32
|
+
return (0, win32_theme_1.createPartialOfficeTheme)(module, themeName, palette);
|
|
32
33
|
}
|
|
33
|
-
exports.translateOfficeTheme = translateOfficeTheme;
|
|
34
34
|
/**
|
|
35
35
|
* @deprecated
|
|
36
36
|
*/
|
|
37
37
|
function createThemingModuleHelper(themingModule, emitter) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
38
|
+
themingModule || console.error('No NativeModule for Theming found');
|
|
39
|
+
const paletteCache = {};
|
|
40
|
+
let _hostTheme = themingModule.getConstants().initialHostThemeSetting || '';
|
|
41
|
+
emitter &&
|
|
42
|
+
emitter.addListener('onPlatformDefaultsChanged', (args) => {
|
|
43
|
+
_hostTheme = (args && args.hostThemeSetting) || _hostTheme;
|
|
44
|
+
Object.keys(paletteCache).forEach((key) => delete paletteCache[key]);
|
|
45
|
+
});
|
|
46
|
+
return {
|
|
47
|
+
getPlatformDefaults: (themeId) => {
|
|
48
|
+
return (0, theming_ramp_1.resolvePartialTheme)(
|
|
49
|
+
(0, BaselinePlatformDefaults_1.getBaselinePlatformTheme)(),
|
|
50
|
+
translateOfficeTheme(themingModule, paletteCache, themeId, _hostTheme),
|
|
51
|
+
);
|
|
52
|
+
},
|
|
53
|
+
getPlatformThemeDefinition: (themeId) => {
|
|
54
|
+
return (_parent) => {
|
|
55
|
+
updatePaletteInCache(themingModule, paletteCache, themeId);
|
|
56
|
+
return translateOfficeTheme(themingModule, paletteCache, themeId);
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
addListener: (callback) => {
|
|
60
|
+
emitter && emitter.addListener('onPlatformDefaultsChanged', callback);
|
|
61
|
+
},
|
|
62
|
+
};
|
|
60
63
|
}
|
|
61
|
-
|
|
62
|
-
//# sourceMappingURL=ThemingModuleHelpers.js.map
|
|
64
|
+
//# sourceMappingURL=ThemingModuleHelpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemingModuleHelpers.js","sourceRoot":"","sources":["../../src/NativeModule/ThemingModuleHelpers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ThemingModuleHelpers.js","sourceRoot":"","sources":["../../src/NativeModule/ThemingModuleHelpers.ts"],"names":[],"mappings":";;;;AAMA,oEAA8E;AAE9E,+DAAmE;AAGnE,0EAAuE;AAIvE,SAAS,WAAW,CAAC,OAAqC,EAA2B;IACnF,OAAQ,OAAwB,CAAC,OAAO,KAAK,SAAS,CAAC;AAAA,CACxD;AAED,SAAS,oBAAoB,CAAC,MAA2B,EAAE,KAAmB,EAAE,OAAe,EAAE;IAC/F,MAAM,YAAY,GAAG,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAChD,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,EAAE,CAAC;QAC/B,KAAK,CAAC,OAAO,CAAC,GAAG,YAAY,CAAC;IAChC,CAAC;AAAA,CACF;AAED,MAAM,kBAAkB,GAAG,CAAC,OAAgB,EAAE,EAAE,CAAC;IAC/C,OAAO,OAAO,IAAI,aAAa,CAAC;AAAA,CACjC,CAAC;AAEF,SAAS,aAAa,CAAC,MAA2B,EAAE,YAA0B,EAAE,OAAgB,EAAiB;IAC/G,MAAM,GAAG,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACxC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC;QACvB,oBAAoB,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,YAAY,CAAC,GAAG,CAAC,IAAK,EAAoB,CAAC;AAAA,CACnD;AAED;;GAEG;AACH,8BAAqC,MAA2B,EAAE,KAAmB,EAAE,EAAW,EAAE,SAAkB,EAAE;IACtH,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;IACjD,OAAO,IAAA,sCAAwB,EAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;AAAA,CAC7D;AAED;;GAEG;AACH,mCAA0C,aAAmC,EAAE,OAAuB,EAAwB;IAC5H,aAAa,IAAI,OAAO,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;IACpE,MAAM,YAAY,GAAiB,EAAE,CAAC;IACtC,IAAI,UAAU,GAAG,aAAa,CAAC,YAAY,EAAE,CAAC,uBAAuB,IAAI,EAAE,CAAC;IAC5E,OAAO;QACL,OAAO,CAAC,WAAW,CAAC,2BAA2B,EAAE,CAAC,IAAiC,EAAE,EAAE,CAAC;YACtF,UAAU,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,gBAAgB,CAAC,IAAI,UAAU,CAAC;YAC3D,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,GAAW,EAAE,EAAE,CAAC,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;QAAA,CAC9E,CAAC,CAAC;IACL,OAAO;QACL,mBAAmB,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC;YACzC,OAAO,IAAA,kCAAmB,EAAC,IAAA,mDAAwB,GAAE,EAAE,oBAAoB,CAAC,aAAa,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC;QAAA,CAChI;QACD,0BAA0B,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC;YAChD,OAAO,CAAC,OAAe,EAAE,EAAE,CAAC;gBAC1B,oBAAoB,CAAC,aAAa,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;gBAC3D,OAAO,oBAAoB,CAAC,aAAa,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;YAAA,CACnE,CAAC;QAAA,CACH;QACD,WAAW,EAAE,CAAC,QAAyC,EAAE,EAAE,CAAC;YAC1D,OAAO,IAAI,OAAO,CAAC,WAAW,CAAC,2BAA2B,EAAE,QAAQ,CAAC,CAAC;QAAA,CACvE;KACF,CAAC;AAAA,CACH"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
exports.getHostSettingsWin32 =
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
|
+
exports.getHostSettingsWin32 = getHostSettingsWin32;
|
|
4
4
|
/**
|
|
5
5
|
* @deprecated
|
|
6
6
|
*/
|
|
7
7
|
function getHostSettingsWin32(theme) {
|
|
8
|
-
|
|
8
|
+
return theme.host?.palette ? theme.host : undefined;
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
//# sourceMappingURL=getHostSettings.js.map
|
|
10
|
+
//# sourceMappingURL=getHostSettings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getHostSettings.js","sourceRoot":"","sources":["../../src/NativeModule/getHostSettings.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"getHostSettings.js","sourceRoot":"","sources":["../../src/NativeModule/getHostSettings.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH,8BAAqC,KAAa,EAA8B;IAC9E,OAAO,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AAAA,CACrD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { ThemingModuleHelper } from './ThemingModule';
|
|
2
2
|
export type { IEventEmitter, IPlatformThemeDefinition, IThemingModuleHelper, IHostSettingsWin32 } from './ThemingModule.types';
|
|
3
3
|
export { getHostSettingsWin32 } from './getHostSettings';
|
|
4
|
-
//# sourceMappingURL=index.d.ts.map
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,8 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
3
|
exports.getHostSettingsWin32 = exports.ThemingModuleHelper = void 0;
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
const ThemingModule_1 = require('./ThemingModule');
|
|
5
|
+
Object.defineProperty(exports, 'ThemingModuleHelper', {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function () {
|
|
8
|
+
return ThemingModule_1.ThemingModuleHelper;
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
const getHostSettings_1 = require('./getHostSettings');
|
|
12
|
+
Object.defineProperty(exports, 'getHostSettingsWin32', {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return getHostSettings_1.getHostSettingsWin32;
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/NativeModule/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/NativeModule/index.ts"],"names":[],"mappings":";;;AAAA,mDAAsD;AAA7C,oHAAA,mBAAmB,OAAA;AAE5B,uDAAyD;AAAhD,uHAAA,oBAAoB,OAAA"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
//# sourceMappingURL=Theme.types.js.map
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
|
+
//# sourceMappingURL=Theme.types.js.map
|
|
@@ -1,36 +1,73 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
var __createBinding =
|
|
3
|
+
(this && this.__createBinding) ||
|
|
4
|
+
(Object.create
|
|
5
|
+
? function (o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () {
|
|
12
|
+
return m[k];
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
Object.defineProperty(o, k2, desc);
|
|
17
|
+
}
|
|
18
|
+
: function (o, m, k, k2) {
|
|
19
|
+
if (k2 === undefined) k2 = k;
|
|
20
|
+
o[k2] = m[k];
|
|
21
|
+
});
|
|
22
|
+
var __setModuleDefault =
|
|
23
|
+
(this && this.__setModuleDefault) ||
|
|
24
|
+
(Object.create
|
|
25
|
+
? function (o, v) {
|
|
26
|
+
Object.defineProperty(o, 'default', { enumerable: true, value: v });
|
|
27
|
+
}
|
|
28
|
+
: function (o, v) {
|
|
29
|
+
o['default'] = v;
|
|
30
|
+
});
|
|
31
|
+
var __importStar =
|
|
32
|
+
(this && this.__importStar) ||
|
|
33
|
+
(function () {
|
|
34
|
+
var ownKeys = function (o) {
|
|
35
|
+
ownKeys =
|
|
36
|
+
Object.getOwnPropertyNames ||
|
|
37
|
+
function (o) {
|
|
38
|
+
var ar = [];
|
|
39
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
40
|
+
return ar;
|
|
41
|
+
};
|
|
42
|
+
return ownKeys(o);
|
|
43
|
+
};
|
|
44
|
+
return function (mod) {
|
|
45
|
+
if (mod && mod.__esModule) return mod;
|
|
46
|
+
var result = {};
|
|
47
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== 'default') __createBinding(result, mod, k[i]);
|
|
48
|
+
__setModuleDefault(result, mod);
|
|
49
|
+
return result;
|
|
50
|
+
};
|
|
51
|
+
})();
|
|
52
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
26
53
|
exports.useThemeRegistry = exports.ThemeRegistryContext = exports.useTheme = exports.ThemeContext = void 0;
|
|
27
|
-
const React = __importStar(require(
|
|
54
|
+
const React = __importStar(require('react'));
|
|
28
55
|
/**
|
|
29
56
|
* @deprecated
|
|
30
57
|
*/
|
|
31
|
-
|
|
32
|
-
Object.defineProperty(exports,
|
|
33
|
-
|
|
58
|
+
const theming_ramp_1 = require('@uifabricshared/theming-ramp');
|
|
59
|
+
Object.defineProperty(exports, 'ThemeContext', {
|
|
60
|
+
enumerable: true,
|
|
61
|
+
get: function () {
|
|
62
|
+
return theming_ramp_1.ThemeContext;
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
Object.defineProperty(exports, 'useTheme', {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
get: function () {
|
|
68
|
+
return theming_ramp_1.useTheme;
|
|
69
|
+
},
|
|
70
|
+
});
|
|
34
71
|
/**
|
|
35
72
|
* @deprecated
|
|
36
73
|
*/
|
|
@@ -40,4 +77,4 @@ exports.ThemeRegistryContext = React.createContext(undefined);
|
|
|
40
77
|
*/
|
|
41
78
|
const useThemeRegistry = () => React.useContext(exports.ThemeRegistryContext);
|
|
42
79
|
exports.useThemeRegistry = useThemeRegistry;
|
|
43
|
-
//# sourceMappingURL=ThemeContext.js.map
|
|
80
|
+
//# sourceMappingURL=ThemeContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeContext.js","sourceRoot":"","sources":["../src/ThemeContext.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ThemeContext.js","sourceRoot":"","sources":["../src/ThemeContext.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAY,KAAK,kCAAc;AAG/B;;GAEG;AACH,+DAAsE;AAA7D,4GAAA,YAAY,OAAA;AAAE,wGAAA,QAAQ,OAAA;AAE/B;;GAEG;AACU,QAAA,oBAAoB,GAAG,KAAK,CAAC,aAAa,CAAgB,SAAS,CAAC,CAAC;AAClF;;GAEG;AACI,MAAM,gBAAgB,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,QAAA,oBAAoB,CAAC,CAAC;AAAhE,QAAA,gBAAgB,GAAhB,gBAAgB,CAAgD"}
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { IThemeEventListener } from '@uifabricshared/theme-registry';
|
|
3
3
|
import type { ITheme } from './Theme.types';
|
|
4
|
+
import type { FurnJSX } from '@fluentui-react-native/framework-base';
|
|
4
5
|
/**
|
|
5
6
|
* props for the ThemeLayer
|
|
6
7
|
* @deprecated
|
|
7
8
|
*/
|
|
8
9
|
export interface IThemeLayerProps {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
/**
|
|
11
|
+
* If `themeName` is specified this layer will set that theme as the active theme. Setting the value
|
|
12
|
+
* to '' will explicitly set the default theme as active in the context. If `themeName` is unspecified
|
|
13
|
+
* the theme layer will act as a consumer and pick up the currently active theme in the context
|
|
14
|
+
*/
|
|
15
|
+
themeName?: string;
|
|
16
|
+
/**
|
|
17
|
+
* children function that allows passing of the theme to children. This is a standard pattern for
|
|
18
|
+
* consumers.
|
|
19
|
+
*/
|
|
20
|
+
children: (theme: ITheme) => FurnJSX.Element | null;
|
|
20
21
|
}
|
|
21
22
|
/**
|
|
22
23
|
* Multipurpose theme provider. This can run in provider/consumer mode and pure consumer mode.
|
|
@@ -45,17 +46,17 @@ export interface IThemeLayerProps {
|
|
|
45
46
|
* @deprecated
|
|
46
47
|
*/
|
|
47
48
|
export declare class ThemeLayer extends React.Component<IThemeLayerProps> {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
49
|
+
/**
|
|
50
|
+
* stores the name of the theme if in provider mode. Existence of this string is tied to registration
|
|
51
|
+
* and is used to signal registration and unregistration
|
|
52
|
+
*/
|
|
53
|
+
private _registeredTheme;
|
|
54
|
+
/** handler for theme changes, conditionally will force update */
|
|
55
|
+
onInvalidate: IThemeEventListener['onInvalidate'];
|
|
56
|
+
/** standard cleanup handler to ensure we unregister */
|
|
57
|
+
componentWillUnmount(): void;
|
|
58
|
+
render(): FurnJSX.Element;
|
|
59
|
+
/** helper to register if this is the first time and to update the filter if necessary */
|
|
60
|
+
private _ensureCallbackRegistration;
|
|
60
61
|
}
|
|
61
|
-
//# sourceMappingURL=ThemeLayer.d.ts.map
|
|
62
|
+
//# sourceMappingURL=ThemeLayer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeLayer.d.ts","sourceRoot":"","sources":["../src/ThemeLayer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAI1E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"ThemeLayer.d.ts","sourceRoot":"","sources":["../src/ThemeLayer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAI1E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAErE;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;CACrD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBAAa,UAAW,SAAQ,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC;IAC/D;;;OAGG;IACH,OAAO,CAAC,gBAAgB,CAAqB;IAE7C,iEAAiE;IAC1D,YAAY,EAAE,mBAAmB,CAAC,cAAc,CAAC,CAKtD;IAEF,uDAAuD;IAChD,oBAAoB,IAAI,IAAI,CAKlC;IAEM,MAAM,IAAI,OAAO,CAAC,OAAO,CAkB/B;IAED,yFAAyF;IACzF,OAAO,CAAC,2BAA2B,CAKjC;CACH"}
|