@uifabricshared/theming-react-native 0.21.3 → 0.21.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/.cache/tsconfig.tsbuildinfo +1 -0
- package/CHANGELOG.md +19 -0
- package/config/pre-copy.json +1 -1
- package/jest/setup.js +1 -1
- package/lib/BaselinePlatformDefaults.js.map +1 -1
- package/lib/Global.js.map +1 -1
- package/lib/NativeModule/ThemingModuleHelpers.js.map +1 -1
- package/lib/NativeModule/getHostSettings.js.map +1 -1
- package/lib/ThemeLayer.d.ts.map +1 -1
- package/lib/ThemeLayer.js.map +1 -1
- package/lib/ThemeProvider.js.map +1 -1
- package/lib/platform/PlatformDefaults.js.map +1 -1
- package/lib/platform/PlatformDefaults.native.js.map +1 -1
- package/package.json +13 -19
- package/src/ThemeLayer.tsx +2 -2
- package/lib-commonjs/BaselinePlatformDefaults.d.ts +0 -6
- package/lib-commonjs/BaselinePlatformDefaults.d.ts.map +0 -1
- package/lib-commonjs/BaselinePlatformDefaults.js +0 -11
- package/lib-commonjs/BaselinePlatformDefaults.js.map +0 -1
- package/lib-commonjs/Global.d.ts +0 -56
- package/lib-commonjs/Global.d.ts.map +0 -1
- package/lib-commonjs/Global.js +0 -82
- package/lib-commonjs/Global.js.map +0 -1
- package/lib-commonjs/NativeModule/ThemingModule.d.ts +0 -5
- package/lib-commonjs/NativeModule/ThemingModule.d.ts.map +0 -1
- package/lib-commonjs/NativeModule/ThemingModule.js +0 -10
- package/lib-commonjs/NativeModule/ThemingModule.js.map +0 -1
- package/lib-commonjs/NativeModule/ThemingModule.types.d.ts +0 -35
- package/lib-commonjs/NativeModule/ThemingModule.types.d.ts.map +0 -1
- package/lib-commonjs/NativeModule/ThemingModule.types.js +0 -3
- package/lib-commonjs/NativeModule/ThemingModule.types.js.map +0 -1
- package/lib-commonjs/NativeModule/ThemingModuleHelpers.d.ts +0 -16
- package/lib-commonjs/NativeModule/ThemingModuleHelpers.d.ts.map +0 -1
- package/lib-commonjs/NativeModule/ThemingModuleHelpers.js +0 -61
- package/lib-commonjs/NativeModule/ThemingModuleHelpers.js.map +0 -1
- package/lib-commonjs/NativeModule/getHostSettings.d.ts +0 -6
- package/lib-commonjs/NativeModule/getHostSettings.d.ts.map +0 -1
- package/lib-commonjs/NativeModule/getHostSettings.js +0 -10
- package/lib-commonjs/NativeModule/getHostSettings.js.map +0 -1
- package/lib-commonjs/NativeModule/index.d.ts +0 -4
- package/lib-commonjs/NativeModule/index.d.ts.map +0 -1
- package/lib-commonjs/NativeModule/index.js +0 -8
- package/lib-commonjs/NativeModule/index.js.map +0 -1
- package/lib-commonjs/Theme.types.d.ts +0 -15
- package/lib-commonjs/Theme.types.d.ts.map +0 -1
- package/lib-commonjs/Theme.types.js +0 -3
- package/lib-commonjs/Theme.types.js.map +0 -1
- package/lib-commonjs/ThemeContext.d.ts +0 -15
- package/lib-commonjs/ThemeContext.d.ts.map +0 -1
- package/lib-commonjs/ThemeContext.js +0 -53
- package/lib-commonjs/ThemeContext.js.map +0 -1
- package/lib-commonjs/ThemeLayer.d.ts +0 -62
- package/lib-commonjs/ThemeLayer.d.ts.map +0 -1
- package/lib-commonjs/ThemeLayer.js +0 -111
- package/lib-commonjs/ThemeLayer.js.map +0 -1
- package/lib-commonjs/ThemeProvider.d.ts +0 -8
- package/lib-commonjs/ThemeProvider.d.ts.map +0 -1
- package/lib-commonjs/ThemeProvider.js +0 -68
- package/lib-commonjs/ThemeProvider.js.map +0 -1
- package/lib-commonjs/ThemeProvider.types.d.ts +0 -9
- package/lib-commonjs/ThemeProvider.types.d.ts.map +0 -1
- package/lib-commonjs/ThemeProvider.types.js +0 -4
- package/lib-commonjs/ThemeProvider.types.js.map +0 -1
- package/lib-commonjs/index.d.ts +0 -42
- package/lib-commonjs/index.d.ts.map +0 -1
- package/lib-commonjs/index.js +0 -39
- package/lib-commonjs/index.js.map +0 -1
- package/lib-commonjs/platform/PlatformDefaults.d.ts +0 -6
- package/lib-commonjs/platform/PlatformDefaults.d.ts.map +0 -1
- package/lib-commonjs/platform/PlatformDefaults.js +0 -13
- package/lib-commonjs/platform/PlatformDefaults.js.map +0 -1
- package/lib-commonjs/platform/PlatformDefaults.native.d.ts +0 -6
- package/lib-commonjs/platform/PlatformDefaults.native.d.ts.map +0 -1
- package/lib-commonjs/platform/PlatformDefaults.native.js +0 -17
- package/lib-commonjs/platform/PlatformDefaults.native.js.map +0 -1
- package/lib-commonjs/platform/index.d.ts +0 -2
- package/lib-commonjs/platform/index.d.ts.map +0 -1
- package/lib-commonjs/platform/index.js +0 -6
- package/lib-commonjs/platform/index.js.map +0 -1
package/lib-commonjs/Global.js
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getThemeRegistry = getThemeRegistry;
|
|
4
|
-
exports.setThemeRegistry = setThemeRegistry;
|
|
5
|
-
exports.setTheme = setTheme;
|
|
6
|
-
exports.addThemeRegistryListener = addThemeRegistryListener;
|
|
7
|
-
exports.removeThemeRegistryListener = removeThemeRegistryListener;
|
|
8
|
-
exports.getTheme = getTheme;
|
|
9
|
-
exports.augmentPlatformTheme = augmentPlatformTheme;
|
|
10
|
-
const platform_1 = require("./platform");
|
|
11
|
-
let _registry;
|
|
12
|
-
/**
|
|
13
|
-
* Ensure that `_registry` is set. If not, create it using a native module to
|
|
14
|
-
* provide platform defaults.
|
|
15
|
-
* @deprecated
|
|
16
|
-
*/
|
|
17
|
-
function getThemeRegistry() {
|
|
18
|
-
if (!_registry) {
|
|
19
|
-
_registry = (0, platform_1.createPlatformThemeRegistry)();
|
|
20
|
-
}
|
|
21
|
-
return _registry;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Set the global theme registry.
|
|
25
|
-
*
|
|
26
|
-
* **WARNING**: This is only exported so that internal tests may override it.
|
|
27
|
-
* It should not be part of this library's public interface.
|
|
28
|
-
*
|
|
29
|
-
* The react tree may contain <ThemeLayer> controls which are tightly bound to
|
|
30
|
-
* `_registry`. Changing `_registry` while the app is running will disrupt
|
|
31
|
-
* theming, causing undefined behavior.
|
|
32
|
-
* @deprecated
|
|
33
|
-
*/
|
|
34
|
-
function setThemeRegistry(registry) {
|
|
35
|
-
_registry = registry;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Create or update a theme definition
|
|
39
|
-
* @param definition - partial theme definition or processing function that defines the theme
|
|
40
|
-
* @param name - name of the theme, undefined or '' for default
|
|
41
|
-
* @param parent - parent theme to depend on, if unspecified this will pull from the default theme
|
|
42
|
-
* @deprecated
|
|
43
|
-
*/
|
|
44
|
-
function setTheme(definition, name, parent) {
|
|
45
|
-
return getThemeRegistry().setTheme(definition, name, parent);
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Register a theme event listener
|
|
49
|
-
* @param listener - theme event listener to add
|
|
50
|
-
* @deprecated
|
|
51
|
-
*/
|
|
52
|
-
function addThemeRegistryListener(listener) {
|
|
53
|
-
return getThemeRegistry().addEventListener(listener);
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Unregister a theme event listener
|
|
57
|
-
* @param listener - theme event listener to remove
|
|
58
|
-
* @deprecated
|
|
59
|
-
*/
|
|
60
|
-
function removeThemeRegistryListener(listener) {
|
|
61
|
-
return getThemeRegistry().removeEventListener(listener);
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Get a theme by name
|
|
65
|
-
* @param name - name of the theme. Undefined or '' will resolve to the default theme
|
|
66
|
-
* @deprecated
|
|
67
|
-
*/
|
|
68
|
-
function getTheme(name) {
|
|
69
|
-
return getThemeRegistry().getTheme(name);
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* This will update the platform theme. This is primarily exposed for clients to add custom lookup values to palettes or to
|
|
73
|
-
* add custom typed settings blocks for their own components.
|
|
74
|
-
*
|
|
75
|
-
* @param definition - properties to add to the platform theme. Note that this will invalidate every theme and cause rerenders
|
|
76
|
-
* if this is not done in the boot sequence.
|
|
77
|
-
* @deprecated
|
|
78
|
-
*/
|
|
79
|
-
function augmentPlatformTheme(definition) {
|
|
80
|
-
getThemeRegistry().updatePlatformDefaults(definition);
|
|
81
|
-
}
|
|
82
|
-
//# sourceMappingURL=Global.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Global.js","sourceRoot":"","sources":["../src/Global.ts"],"names":[],"mappings":";;;;;;;;;AAEA,yCAAyD;AAGzD,IAAI,SAAwB,CAAC;AAE7B;;;;GAIG;AACH,4BAAkD;IAChD,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,SAAS,GAAG,IAAA,sCAA2B,GAAE,CAAC;IAC5C,CAAC;IACD,OAAO,SAAS,CAAC;AAAA,CAClB;AAED;;;;;;;;;;GAUG;AACH,0BAAiC,QAAuB,EAAQ;IAC9D,SAAS,GAAG,QAAQ,CAAC;AAAA,CACtB;AAED;;;;;;GAMG;AACH,kBAAyB,UAAgE,EAAE,IAAa,EAAE,MAAe,EAAQ;IAC/H,OAAO,gBAAgB,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAAA,CAC9D;AAED;;;;GAIG;AACH,kCAAyC,QAA6B,EAAQ;IAC5E,OAAO,gBAAgB,EAAE,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;AAAA,CACtD;AAED;;;;GAIG;AACH,qCAA4C,QAA6B,EAAQ;IAC/E,OAAO,gBAAgB,EAAE,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;AAAA,CACzD;AAED;;;;GAIG;AACH,kBAAyB,IAAa,EAAU;IAC9C,OAAO,gBAAgB,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAAA,CAC1C;AAED;;;;;;;GAOG;AACH,8BAAqC,UAAyB,EAAQ;IACpE,gBAAgB,EAAE,CAAC,sBAAsB,CAAC,UAAU,CAAC,CAAC;AAAA,CACvD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ThemingModule.d.ts","sourceRoot":"","sources":["../../src/NativeModule/ThemingModule.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,eAAO,MAAM,mBAAmB,sDAAmD,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ThemingModuleHelper = void 0;
|
|
4
|
-
const win32_theme_1 = require("@fluentui-react-native/win32-theme");
|
|
5
|
-
const ThemingModuleHelpers_1 = require("./ThemingModuleHelpers");
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated
|
|
8
|
-
*/
|
|
9
|
-
exports.ThemingModuleHelper = (0, ThemingModuleHelpers_1.createThemingModuleHelper)(...(0, win32_theme_1.getThemingModule)());
|
|
10
|
-
//# sourceMappingURL=ThemingModule.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ThemingModule.js","sourceRoot":"","sources":["../../src/NativeModule/ThemingModule.ts"],"names":[],"mappings":";;;AAAA,oEAAsE;AAEtE,iEAAmE;AAEnE;;GAEG;AACU,QAAA,mBAAmB,GAAG,IAAA,gDAAyB,EAAC,GAAG,IAAA,8BAAgB,GAAE,CAAC,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { PlatformDefaultsChangedCallback } from '@fluentui-react-native/win32-theme';
|
|
2
|
-
import type { IProcessTheme } from '@uifabricshared/theme-registry';
|
|
3
|
-
import type { ITheme, IPartialTheme, OfficePalette as IOfficePalette } from '@uifabricshared/theming-ramp';
|
|
4
|
-
/**
|
|
5
|
-
* @deprecated
|
|
6
|
-
*/
|
|
7
|
-
export interface IEventEmitter {
|
|
8
|
-
addListener: (event: string, PlatformDefaultsChangedCallback: any) => void;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* @deprecated
|
|
12
|
-
*/
|
|
13
|
-
export type IPlatformThemeDefinition = IPartialTheme | IProcessTheme<ITheme, IPartialTheme>;
|
|
14
|
-
/**
|
|
15
|
-
* @deprecated
|
|
16
|
-
*/
|
|
17
|
-
export interface IThemingModuleHelper {
|
|
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
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* @deprecated
|
|
31
|
-
*/
|
|
32
|
-
export type IHostSettingsWin32 = {
|
|
33
|
-
palette: IOfficePalette;
|
|
34
|
-
};
|
|
35
|
-
//# sourceMappingURL=ThemingModule.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ThemingModule.types.d.ts","sourceRoot":"","sources":["../../src/NativeModule/ThemingModule.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,oCAAoC,CAAC;AAC1F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,aAAa,IAAI,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE3G;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,+BAA+B,KAAA,KAAK,IAAI,CAAC;CACvE;AAED;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,aAAa,GAAG,aAAa,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAE5F;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,mBAAmB,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAClD;;;OAGG;IACH,0BAA0B,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,wBAAwB,CAAC;IAC3E,WAAW,EAAE,CAAC,QAAQ,EAAE,+BAA+B,KAAK,IAAI,CAAC;CAClE;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,cAAc,CAAC;CACzB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ThemingModule.types.js","sourceRoot":"","sources":["../../src/NativeModule/ThemingModule.types.ts"],"names":[],"mappings":""}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { OfficeThemingModule } from '@fluentui-react-native/win32-theme';
|
|
2
|
-
import type { OfficePalette } from '@uifabricshared/theming-ramp';
|
|
3
|
-
import type { IThemingModuleHelper, IEventEmitter } from './ThemingModule.types';
|
|
4
|
-
type PaletteCache = {
|
|
5
|
-
[key: string]: OfficePalette;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated
|
|
9
|
-
*/
|
|
10
|
-
export declare function translateOfficeTheme(module: OfficeThemingModule, cache: PaletteCache, id?: string, themeName?: string): import("@uifabricshared/theming-ramp").IPartialTheme;
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated
|
|
13
|
-
*/
|
|
14
|
-
export declare function createThemingModuleHelper(themingModule?: OfficeThemingModule, emitter?: IEventEmitter): IThemingModuleHelper;
|
|
15
|
-
export {};
|
|
16
|
-
//# sourceMappingURL=ThemingModuleHelpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ThemingModuleHelpers.d.ts","sourceRoot":"","sources":["../../src/NativeModule/ThemingModuleHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EAIpB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,KAAK,EAAU,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAG1E,OAAO,KAAK,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAGjF,KAAK,YAAY,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAA;CAAE,CAAC;AAyBrD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,mBAAmB,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,wDAGrH;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,aAAa,CAAC,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,oBAAoB,CAuB5H"}
|
|
@@ -1,61 +0,0 @@
|
|
|
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");
|
|
8
|
-
function isException(palette) {
|
|
9
|
-
return palette.message !== undefined;
|
|
10
|
-
}
|
|
11
|
-
function updatePaletteInCache(module, cache, palette) {
|
|
12
|
-
const paletteValue = module.getPalette(palette);
|
|
13
|
-
if (!isException(paletteValue)) {
|
|
14
|
-
cache[palette] = paletteValue;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
const getPaletteCacheKey = (palette) => {
|
|
18
|
-
return palette || 'WhiteColors';
|
|
19
|
-
};
|
|
20
|
-
function ensurePalette(module, paletteCache, palette) {
|
|
21
|
-
const key = getPaletteCacheKey(palette);
|
|
22
|
-
if (!paletteCache[key]) {
|
|
23
|
-
updatePaletteInCache(module, paletteCache, key);
|
|
24
|
-
}
|
|
25
|
-
return paletteCache[key] || {};
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* @deprecated
|
|
29
|
-
*/
|
|
30
|
-
function translateOfficeTheme(module, cache, id, themeName) {
|
|
31
|
-
const palette = ensurePalette(module, cache, id);
|
|
32
|
-
return (0, win32_theme_1.createPartialOfficeTheme)(module, themeName, palette);
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* @deprecated
|
|
36
|
-
*/
|
|
37
|
-
function createThemingModuleHelper(themingModule, emitter) {
|
|
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)((0, BaselinePlatformDefaults_1.getBaselinePlatformTheme)(), translateOfficeTheme(themingModule, paletteCache, themeId, _hostTheme));
|
|
49
|
-
},
|
|
50
|
-
getPlatformThemeDefinition: (themeId) => {
|
|
51
|
-
return (_parent) => {
|
|
52
|
-
updatePaletteInCache(themingModule, paletteCache, themeId);
|
|
53
|
-
return translateOfficeTheme(themingModule, paletteCache, themeId);
|
|
54
|
-
};
|
|
55
|
-
},
|
|
56
|
-
addListener: (callback) => {
|
|
57
|
-
emitter && emitter.addListener('onPlatformDefaultsChanged', callback);
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=ThemingModuleHelpers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"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AAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,SAAS,CAE9E"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getHostSettingsWin32 = getHostSettingsWin32;
|
|
4
|
-
/**
|
|
5
|
-
* @deprecated
|
|
6
|
-
*/
|
|
7
|
-
function getHostSettingsWin32(theme) {
|
|
8
|
-
return theme.host?.palette ? theme.host : undefined;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=getHostSettings.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
1
|
-
export { ThemingModuleHelper } from './ThemingModule';
|
|
2
|
-
export type { IEventEmitter, IPlatformThemeDefinition, IThemingModuleHelper, IHostSettingsWin32 } from './ThemingModule.types';
|
|
3
|
-
export { getHostSettingsWin32 } from './getHostSettings';
|
|
4
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/NativeModule/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,YAAY,EAAE,aAAa,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC/H,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getHostSettingsWin32 = exports.ThemingModuleHelper = void 0;
|
|
4
|
-
const ThemingModule_1 = require("./ThemingModule");
|
|
5
|
-
Object.defineProperty(exports, "ThemingModuleHelper", { enumerable: true, get: function () { return ThemingModule_1.ThemingModuleHelper; } });
|
|
6
|
-
const getHostSettings_1 = require("./getHostSettings");
|
|
7
|
-
Object.defineProperty(exports, "getHostSettingsWin32", { enumerable: true, get: function () { return getHostSettings_1.getHostSettingsWin32; } });
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,15 +0,0 @@
|
|
|
1
|
-
import type { IThemeRegistry, IProcessTheme } from '@uifabricshared/theme-registry';
|
|
2
|
-
import type { ITheme, IPartialTheme } from '@uifabricshared/theming-ramp';
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated
|
|
5
|
-
*/
|
|
6
|
-
export type { ITheme, IPartialTheme } from '@uifabricshared/theming-ramp';
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated
|
|
9
|
-
*/
|
|
10
|
-
export type IThemeDefinition = IPartialTheme | IProcessTheme<ITheme, IPartialTheme>;
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated
|
|
13
|
-
*/
|
|
14
|
-
export type ThemeRegistry = IThemeRegistry<ITheme, IPartialTheme>;
|
|
15
|
-
//# sourceMappingURL=Theme.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Theme.types.d.ts","sourceRoot":"","sources":["../src/Theme.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACpF,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE1E;;GAEG;AACH,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE1E;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG,aAAa,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAEpF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Theme.types.js","sourceRoot":"","sources":["../src/Theme.types.ts"],"names":[],"mappings":""}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { ThemeRegistry } from './Theme.types';
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated
|
|
5
|
-
*/
|
|
6
|
-
export { ThemeContext, useTheme } from '@uifabricshared/theming-ramp';
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated
|
|
9
|
-
*/
|
|
10
|
-
export declare const ThemeRegistryContext: React.Context<ThemeRegistry>;
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated
|
|
13
|
-
*/
|
|
14
|
-
export declare const useThemeRegistry: () => ThemeRegistry;
|
|
15
|
-
//# sourceMappingURL=ThemeContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeContext.d.ts","sourceRoot":"","sources":["../src/ThemeContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD;;GAEG;AACH,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAEtE;;GAEG;AACH,eAAO,MAAM,oBAAoB,8BAAgD,CAAC;AAClF;;GAEG;AACH,eAAO,MAAM,gBAAgB,qBAA+C,CAAC"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.useThemeRegistry = exports.ThemeRegistryContext = exports.useTheme = exports.ThemeContext = void 0;
|
|
37
|
-
const React = __importStar(require("react"));
|
|
38
|
-
/**
|
|
39
|
-
* @deprecated
|
|
40
|
-
*/
|
|
41
|
-
const theming_ramp_1 = require("@uifabricshared/theming-ramp");
|
|
42
|
-
Object.defineProperty(exports, "ThemeContext", { enumerable: true, get: function () { return theming_ramp_1.ThemeContext; } });
|
|
43
|
-
Object.defineProperty(exports, "useTheme", { enumerable: true, get: function () { return theming_ramp_1.useTheme; } });
|
|
44
|
-
/**
|
|
45
|
-
* @deprecated
|
|
46
|
-
*/
|
|
47
|
-
exports.ThemeRegistryContext = React.createContext(undefined);
|
|
48
|
-
/**
|
|
49
|
-
* @deprecated
|
|
50
|
-
*/
|
|
51
|
-
const useThemeRegistry = () => React.useContext(exports.ThemeRegistryContext);
|
|
52
|
-
exports.useThemeRegistry = useThemeRegistry;
|
|
53
|
-
//# sourceMappingURL=ThemeContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,62 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { IThemeEventListener } from '@uifabricshared/theme-registry';
|
|
3
|
-
import type { ITheme } from './Theme.types';
|
|
4
|
-
import type { FurnJSX } from '@fluentui-react-native/framework-base';
|
|
5
|
-
/**
|
|
6
|
-
* props for the ThemeLayer
|
|
7
|
-
* @deprecated
|
|
8
|
-
*/
|
|
9
|
-
export interface IThemeLayerProps {
|
|
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;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Multipurpose theme provider. This can run in provider/consumer mode and pure consumer mode.
|
|
24
|
-
*
|
|
25
|
-
* In pure consumer mode the usage is as follows:
|
|
26
|
-
* ```
|
|
27
|
-
* <ThemeLayer>{(theme: ITheme) => {
|
|
28
|
-
* return (<MyComponent style={someStyleFn(theme, 'stylename')}/>);
|
|
29
|
-
* }}</ThemeLayer>
|
|
30
|
-
* ```
|
|
31
|
-
*
|
|
32
|
-
* In provider/consumer mode a themeName will be specified:
|
|
33
|
-
* ```
|
|
34
|
-
* <ThemeLayer themeName='myTheme'>{(theme: ITheme) => {
|
|
35
|
-
* return (
|
|
36
|
-
* <View>
|
|
37
|
-
* <MySmartComponent/>
|
|
38
|
-
* <MyComponent style={someStyleFn(theme, 'stylename')}/>
|
|
39
|
-
* </View>
|
|
40
|
-
* );
|
|
41
|
-
* }}</ThemeLayer>
|
|
42
|
-
* ```
|
|
43
|
-
* The work of registering for updates will be done automatically. The highest level `ThemeLayer` in
|
|
44
|
-
* consumer mode will automatically register and act like a provider to ensure renders happen on theme
|
|
45
|
-
* change
|
|
46
|
-
* @deprecated
|
|
47
|
-
*/
|
|
48
|
-
export declare class ThemeLayer extends React.Component<IThemeLayerProps> {
|
|
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;
|
|
61
|
-
}
|
|
62
|
-
//# sourceMappingURL=ThemeLayer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.ThemeLayer = void 0;
|
|
37
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
-
const React = __importStar(require("react"));
|
|
39
|
-
const theming_ramp_1 = require("@uifabricshared/theming-ramp");
|
|
40
|
-
const Global_1 = require("./Global");
|
|
41
|
-
/**
|
|
42
|
-
* Multipurpose theme provider. This can run in provider/consumer mode and pure consumer mode.
|
|
43
|
-
*
|
|
44
|
-
* In pure consumer mode the usage is as follows:
|
|
45
|
-
* ```
|
|
46
|
-
* <ThemeLayer>{(theme: ITheme) => {
|
|
47
|
-
* return (<MyComponent style={someStyleFn(theme, 'stylename')}/>);
|
|
48
|
-
* }}</ThemeLayer>
|
|
49
|
-
* ```
|
|
50
|
-
*
|
|
51
|
-
* In provider/consumer mode a themeName will be specified:
|
|
52
|
-
* ```
|
|
53
|
-
* <ThemeLayer themeName='myTheme'>{(theme: ITheme) => {
|
|
54
|
-
* return (
|
|
55
|
-
* <View>
|
|
56
|
-
* <MySmartComponent/>
|
|
57
|
-
* <MyComponent style={someStyleFn(theme, 'stylename')}/>
|
|
58
|
-
* </View>
|
|
59
|
-
* );
|
|
60
|
-
* }}</ThemeLayer>
|
|
61
|
-
* ```
|
|
62
|
-
* The work of registering for updates will be done automatically. The highest level `ThemeLayer` in
|
|
63
|
-
* consumer mode will automatically register and act like a provider to ensure renders happen on theme
|
|
64
|
-
* change
|
|
65
|
-
* @deprecated
|
|
66
|
-
*/
|
|
67
|
-
class ThemeLayer extends React.Component {
|
|
68
|
-
/**
|
|
69
|
-
* stores the name of the theme if in provider mode. Existence of this string is tied to registration
|
|
70
|
-
* and is used to signal registration and unregistration
|
|
71
|
-
*/
|
|
72
|
-
_registeredTheme;
|
|
73
|
-
/** handler for theme changes, conditionally will force update */
|
|
74
|
-
onInvalidate = (name) => {
|
|
75
|
-
// only force updates if this theme was the one invalidated
|
|
76
|
-
if (name === this._registeredTheme) {
|
|
77
|
-
this.forceUpdate();
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
/** standard cleanup handler to ensure we unregister */
|
|
81
|
-
componentWillUnmount() {
|
|
82
|
-
if (this._registeredTheme !== undefined) {
|
|
83
|
-
(0, Global_1.removeThemeRegistryListener)(this);
|
|
84
|
-
this._registeredTheme = undefined;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
render() {
|
|
88
|
-
let themeName = this.props.themeName;
|
|
89
|
-
return (jsx_runtime_1.jsx(theming_ramp_1.ThemeContext.Consumer, { children: (theme) => {
|
|
90
|
-
// go to provider mode if a themeName is specified or if this is the first consumer and the context
|
|
91
|
-
// is undefined.
|
|
92
|
-
if (themeName !== undefined || theme === undefined) {
|
|
93
|
-
themeName = themeName || '';
|
|
94
|
-
this._ensureCallbackRegistration(themeName);
|
|
95
|
-
theme = (0, Global_1.getTheme)(themeName);
|
|
96
|
-
return jsx_runtime_1.jsx(theming_ramp_1.ThemeContext.Provider, { value: theme, children: this.props.children(theme) });
|
|
97
|
-
}
|
|
98
|
-
// otherwise in consumer mode just push the current theme to the children
|
|
99
|
-
return this.props.children(theme);
|
|
100
|
-
} }));
|
|
101
|
-
}
|
|
102
|
-
/** helper to register if this is the first time and to update the filter if necessary */
|
|
103
|
-
_ensureCallbackRegistration = (themeName) => {
|
|
104
|
-
if (this._registeredTheme === undefined) {
|
|
105
|
-
(0, Global_1.addThemeRegistryListener)(this);
|
|
106
|
-
}
|
|
107
|
-
this._registeredTheme = themeName;
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
exports.ThemeLayer = ThemeLayer;
|
|
111
|
-
//# sourceMappingURL=ThemeLayer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeLayer.js","sourceRoot":"","sources":["../src/ThemeLayer.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;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,CAAC,KAAK,CAAC,CAAC;YAAA,CACnC,GACqB,CACzB,CAAC;IAAA,CACH;IAED,yFAAyF;IACjF,2BAA2B,GAAG,CAAC,SAAiB,EAAE,EAAE,CAAC;QAC3D,IAAI,IAAI,CAAC,gBAAgB,KAAK,SAAS,EAAE,CAAC;YACxC,IAAA,iCAAwB,EAAC,IAAI,CAAC,CAAC;QACjC,CAAC;QACD,IAAI,CAAC,gBAAgB,GAAG,SAAS,CAAC;IAAA,CACnC,CAAC;CACH"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { IThemeProviderProps } from './ThemeProvider.types';
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated Use ThemeProvider from @fluentui-react-native/theme instead.
|
|
5
|
-
* See https://github.com/microsoft/fluentui-react-native/blob/main/docs/pages/Guides/UpdateThemeProvider.md for details
|
|
6
|
-
*/
|
|
7
|
-
export declare const ThemeProvider: React.FunctionComponent<IThemeProviderProps>;
|
|
8
|
-
//# sourceMappingURL=ThemeProvider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../src/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,iBAAiB,CAAC,mBAAmB,CA6BtE,CAAC"}
|