@uifabricshared/theming-react-native 0.20.6 → 0.20.8
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 +42 -1
- package/CHANGELOG.md +10 -2
- package/eslint.config.js +3 -0
- package/lib/Global.js +1 -1
- package/lib/NativeModule/ThemingModule.js +1 -1
- package/lib/NativeModule/ThemingModule.js.map +1 -1
- package/lib/NativeModule/ThemingModuleHelpers.js +12 -12
- package/lib/NativeModule/ThemingModuleHelpers.js.map +1 -1
- package/lib/NativeModule/getHostSettings.js +1 -2
- package/lib/NativeModule/getHostSettings.js.map +1 -1
- package/lib/ThemeContext.js +2 -2
- package/lib/ThemeContext.js.map +1 -1
- package/lib/ThemeLayer.js +29 -47
- package/lib/ThemeLayer.js.map +1 -1
- package/lib/ThemeProvider.js +10 -10
- package/lib/ThemeProvider.js.map +1 -1
- package/lib/platform/PlatformDefaults.native.js +3 -4
- package/lib/platform/PlatformDefaults.native.js.map +1 -1
- package/lib-commonjs/BaselinePlatformDefaults.js +1 -1
- package/lib-commonjs/BaselinePlatformDefaults.js.map +1 -1
- package/lib-commonjs/Global.js +2 -2
- package/lib-commonjs/Global.js.map +1 -1
- package/lib-commonjs/NativeModule/ThemingModule.js +3 -3
- package/lib-commonjs/NativeModule/ThemingModule.js.map +1 -1
- package/lib-commonjs/NativeModule/ThemingModuleHelpers.js +15 -15
- package/lib-commonjs/NativeModule/ThemingModuleHelpers.js.map +1 -1
- package/lib-commonjs/NativeModule/getHostSettings.js +1 -2
- package/lib-commonjs/NativeModule/getHostSettings.js.map +1 -1
- package/lib-commonjs/ThemeContext.js +2 -2
- package/lib-commonjs/ThemeContext.js.map +1 -1
- package/lib-commonjs/ThemeLayer.js +32 -49
- package/lib-commonjs/ThemeLayer.js.map +1 -1
- package/lib-commonjs/ThemeProvider.js +14 -14
- package/lib-commonjs/ThemeProvider.js.map +1 -1
- package/lib-commonjs/platform/PlatformDefaults.js +3 -3
- package/lib-commonjs/platform/PlatformDefaults.js.map +1 -1
- package/lib-commonjs/platform/PlatformDefaults.native.js +6 -7
- package/lib-commonjs/platform/PlatformDefaults.native.js.map +1 -1
- package/package.json +17 -5
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,48 @@
|
|
|
2
2
|
"name": "@uifabricshared/theming-react-native",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Fri, 11 Jul 2025 19:50:36 GMT",
|
|
6
|
+
"version": "0.20.8",
|
|
7
|
+
"tag": "@uifabricshared/theming-react-native_v0.20.8",
|
|
8
|
+
"comments": {
|
|
9
|
+
"none": [
|
|
10
|
+
{
|
|
11
|
+
"author": "jasonmo@microsoft.com",
|
|
12
|
+
"package": "@uifabricshared/theming-react-native",
|
|
13
|
+
"commit": "54087dca787180bbf34630470cd0d06e88366b30",
|
|
14
|
+
"comment": "update eslint to 9.x and use new flat config format with security rules"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "4123478+tido64@users.noreply.github.com",
|
|
18
|
+
"package": "@uifabricshared/theming-react-native",
|
|
19
|
+
"commit": "79bb06f6bbfd0a36f9d2ef371f4857be9660f027",
|
|
20
|
+
"comment": "Fixed `align-deps` warnings"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "sanajmi@microsoft.com",
|
|
24
|
+
"package": "@uifabricshared/theming-react-native",
|
|
25
|
+
"commit": "405ca368dc3f2963bfc252a1952b1e14ff503499",
|
|
26
|
+
"comment": "fix: run `beachball sync` to sync package versions with NPM"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"author": "ruaraki@microsoft.com",
|
|
30
|
+
"package": "@uifabricshared/theming-react-native",
|
|
31
|
+
"commit": "a245202877ef7f2be9ab5f0e1356b2270957e693",
|
|
32
|
+
"comment": "Run bump-versions"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"patch": [
|
|
36
|
+
{
|
|
37
|
+
"author": "jasonmo@microsoft.com",
|
|
38
|
+
"package": "@uifabricshared/theming-react-native",
|
|
39
|
+
"commit": "479b93cea460a26df70c55b5d3335927ed374713",
|
|
40
|
+
"comment": "update builds to use node16 settings and modern export maps"
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"date": "Thu, 10 Jul 2025 19:20:11 GMT",
|
|
6
47
|
"version": "0.20.6",
|
|
7
48
|
"tag": "@uifabricshared/theming-react-native_v0.20.6",
|
|
8
49
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
# Change Log - @uifabricshared/theming-react-native
|
|
2
2
|
|
|
3
|
-
<!-- This log was last generated on
|
|
3
|
+
<!-- This log was last generated on Fri, 11 Jul 2025 19:50:36 GMT and should not be manually modified. -->
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 0.20.8
|
|
8
|
+
|
|
9
|
+
Fri, 11 Jul 2025 19:50:36 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- update builds to use node16 settings and modern export maps (jasonmo@microsoft.com)
|
|
14
|
+
|
|
7
15
|
## 0.20.6
|
|
8
16
|
|
|
9
|
-
Thu,
|
|
17
|
+
Thu, 10 Jul 2025 19:20:11 GMT
|
|
10
18
|
|
|
11
19
|
### Patches
|
|
12
20
|
|
package/eslint.config.js
ADDED
package/lib/Global.js
CHANGED
|
@@ -3,5 +3,5 @@ import { createThemingModuleHelper } from './ThemingModuleHelpers';
|
|
|
3
3
|
/**
|
|
4
4
|
* @deprecated
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export const ThemingModuleHelper = createThemingModuleHelper(...getThemingModule());
|
|
7
7
|
//# sourceMappingURL=ThemingModule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemingModule.js","sourceRoot":"","sources":["../../src/NativeModule/ThemingModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAEtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAEnE;;GAEG;AACH,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"ThemingModule.js","sourceRoot":"","sources":["../../src/NativeModule/ThemingModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAEtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAEnE;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,yBAAyB,CAAC,GAAG,gBAAgB,EAAE,CAAC,CAAC"}
|
|
@@ -5,16 +5,16 @@ function isException(palette) {
|
|
|
5
5
|
return palette.message !== undefined;
|
|
6
6
|
}
|
|
7
7
|
function updatePaletteInCache(module, cache, palette) {
|
|
8
|
-
|
|
8
|
+
const paletteValue = module.getPalette(palette);
|
|
9
9
|
if (!isException(paletteValue)) {
|
|
10
10
|
cache[palette] = paletteValue;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
const getPaletteCacheKey = (palette) => {
|
|
14
14
|
return palette || 'WhiteColors';
|
|
15
15
|
};
|
|
16
16
|
function ensurePalette(module, paletteCache, palette) {
|
|
17
|
-
|
|
17
|
+
const key = getPaletteCacheKey(palette);
|
|
18
18
|
if (!paletteCache[key]) {
|
|
19
19
|
updatePaletteInCache(module, paletteCache, key);
|
|
20
20
|
}
|
|
@@ -24,7 +24,7 @@ function ensurePalette(module, paletteCache, palette) {
|
|
|
24
24
|
* @deprecated
|
|
25
25
|
*/
|
|
26
26
|
export function translateOfficeTheme(module, cache, id, themeName) {
|
|
27
|
-
|
|
27
|
+
const palette = ensurePalette(module, cache, id);
|
|
28
28
|
return createPartialOfficeTheme(module, themeName, palette);
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
@@ -32,24 +32,24 @@ export function translateOfficeTheme(module, cache, id, themeName) {
|
|
|
32
32
|
*/
|
|
33
33
|
export function createThemingModuleHelper(themingModule, emitter) {
|
|
34
34
|
themingModule || console.error('No NativeModule for Theming found');
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
const paletteCache = {};
|
|
36
|
+
let _hostTheme = themingModule.getConstants().initialHostThemeSetting || '';
|
|
37
37
|
emitter &&
|
|
38
|
-
emitter.addListener('onPlatformDefaultsChanged',
|
|
38
|
+
emitter.addListener('onPlatformDefaultsChanged', (args) => {
|
|
39
39
|
_hostTheme = (args && args.hostThemeSetting) || _hostTheme;
|
|
40
|
-
Object.keys(paletteCache).forEach(
|
|
40
|
+
Object.keys(paletteCache).forEach((key) => delete paletteCache[key]);
|
|
41
41
|
});
|
|
42
42
|
return {
|
|
43
|
-
getPlatformDefaults:
|
|
43
|
+
getPlatformDefaults: (themeId) => {
|
|
44
44
|
return resolvePartialTheme(getBaselinePlatformTheme(), translateOfficeTheme(themingModule, paletteCache, themeId, _hostTheme));
|
|
45
45
|
},
|
|
46
|
-
getPlatformThemeDefinition:
|
|
47
|
-
return
|
|
46
|
+
getPlatformThemeDefinition: (themeId) => {
|
|
47
|
+
return (_parent) => {
|
|
48
48
|
updatePaletteInCache(themingModule, paletteCache, themeId);
|
|
49
49
|
return translateOfficeTheme(themingModule, paletteCache, themeId);
|
|
50
50
|
};
|
|
51
51
|
},
|
|
52
|
-
addListener:
|
|
52
|
+
addListener: (callback) => {
|
|
53
53
|
emitter && emitter.addListener('onPlatformDefaultsChanged', callback);
|
|
54
54
|
},
|
|
55
55
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemingModuleHelpers.js","sourceRoot":"","sources":["../../src/NativeModule/ThemingModuleHelpers.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAE9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA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;QACJ,CAAC;QACD,WAAW,EAAE,CAAC,QAAyC,EAAE,EAAE;YACzD,OAAO,IAAI,OAAO,CAAC,WAAW,CAAC,2BAA2B,EAAE,QAAQ,CAAC,CAAC;QACxE,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* @deprecated
|
|
3
3
|
*/
|
|
4
4
|
export function getHostSettingsWin32(theme) {
|
|
5
|
-
|
|
6
|
-
return ((_a = theme.host) === null || _a === void 0 ? void 0 : _a.palette) ? theme.host : undefined;
|
|
5
|
+
return theme.host?.palette ? theme.host : undefined;
|
|
7
6
|
}
|
|
8
7
|
//# sourceMappingURL=getHostSettings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getHostSettings.js","sourceRoot":"","sources":["../../src/NativeModule/getHostSettings.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAa
|
|
1
|
+
{"version":3,"file":"getHostSettings.js","sourceRoot":"","sources":["../../src/NativeModule/getHostSettings.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAa;IAChD,OAAO,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AACtD,CAAC"}
|
package/lib/ThemeContext.js
CHANGED
|
@@ -6,9 +6,9 @@ export { ThemeContext, useTheme } from '@uifabricshared/theming-ramp';
|
|
|
6
6
|
/**
|
|
7
7
|
* @deprecated
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export const ThemeRegistryContext = React.createContext(undefined);
|
|
10
10
|
/**
|
|
11
11
|
* @deprecated
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export const useThemeRegistry = () => React.useContext(ThemeRegistryContext);
|
|
14
14
|
//# sourceMappingURL=ThemeContext.js.map
|
package/lib/ThemeContext.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeContext.js","sourceRoot":"","sources":["../src/ThemeContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B;;GAEG;AACH,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAEtE;;GAEG;AACH,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"ThemeContext.js","sourceRoot":"","sources":["../src/ThemeContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B;;GAEG;AACH,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAEtE;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC,aAAa,CAAgB,SAAS,CAAC,CAAC;AAClF;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC"}
|
package/lib/ThemeLayer.js
CHANGED
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
if (typeof b !== "function" && b !== null)
|
|
10
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
-
extendStatics(d, b);
|
|
12
|
-
function __() { this.constructor = d; }
|
|
13
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
-
};
|
|
15
|
-
})();
|
|
16
1
|
import * as React from 'react';
|
|
17
2
|
import { ThemeContext } from '@uifabricshared/theming-ramp';
|
|
18
3
|
import { removeThemeRegistryListener, getTheme, addThemeRegistryListener } from './Global';
|
|
@@ -42,50 +27,47 @@ import { removeThemeRegistryListener, getTheme, addThemeRegistryListener } from
|
|
|
42
27
|
* change
|
|
43
28
|
* @deprecated
|
|
44
29
|
*/
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
if (_this._registeredTheme === undefined) {
|
|
59
|
-
addThemeRegistryListener(_this);
|
|
60
|
-
}
|
|
61
|
-
_this._registeredTheme = themeName;
|
|
62
|
-
};
|
|
63
|
-
return _this;
|
|
64
|
-
}
|
|
30
|
+
export class ThemeLayer extends React.Component {
|
|
31
|
+
/**
|
|
32
|
+
* stores the name of the theme if in provider mode. Existence of this string is tied to registration
|
|
33
|
+
* and is used to signal registration and unregistration
|
|
34
|
+
*/
|
|
35
|
+
_registeredTheme;
|
|
36
|
+
/** handler for theme changes, conditionally will force update */
|
|
37
|
+
onInvalidate = (name) => {
|
|
38
|
+
// only force updates if this theme was the one invalidated
|
|
39
|
+
if (name === this._registeredTheme) {
|
|
40
|
+
this.forceUpdate();
|
|
41
|
+
}
|
|
42
|
+
};
|
|
65
43
|
/** standard cleanup handler to ensure we unregister */
|
|
66
|
-
|
|
44
|
+
componentWillUnmount() {
|
|
67
45
|
if (this._registeredTheme !== undefined) {
|
|
68
46
|
removeThemeRegistryListener(this);
|
|
69
47
|
this._registeredTheme = undefined;
|
|
70
48
|
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
return (React.createElement(ThemeContext.Consumer, null, function (theme) {
|
|
49
|
+
}
|
|
50
|
+
render() {
|
|
51
|
+
let themeName = this.props.themeName;
|
|
52
|
+
return (React.createElement(ThemeContext.Consumer, null, (theme) => {
|
|
76
53
|
// go to provider mode if a themeName is specified or if this is the first consumer and the context
|
|
77
54
|
// is undefined.
|
|
78
55
|
if (themeName !== undefined || theme === undefined) {
|
|
79
56
|
themeName = themeName || '';
|
|
80
|
-
|
|
57
|
+
this._ensureCallbackRegistration(themeName);
|
|
81
58
|
theme = getTheme(themeName);
|
|
82
|
-
return React.createElement(ThemeContext.Provider, { value: theme },
|
|
59
|
+
return React.createElement(ThemeContext.Provider, { value: theme }, this.props.children(theme));
|
|
83
60
|
}
|
|
84
61
|
// otherwise in consumer mode just push the current theme to the children
|
|
85
|
-
return
|
|
62
|
+
return this.props.children(theme);
|
|
86
63
|
}));
|
|
64
|
+
}
|
|
65
|
+
/** helper to register if this is the first time and to update the filter if necessary */
|
|
66
|
+
_ensureCallbackRegistration = (themeName) => {
|
|
67
|
+
if (this._registeredTheme === undefined) {
|
|
68
|
+
addThemeRegistryListener(this);
|
|
69
|
+
}
|
|
70
|
+
this._registeredTheme = themeName;
|
|
87
71
|
};
|
|
88
|
-
|
|
89
|
-
}(React.Component));
|
|
90
|
-
export { ThemeLayer };
|
|
72
|
+
}
|
|
91
73
|
//# sourceMappingURL=ThemeLayer.js.map
|
package/lib/ThemeLayer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeLayer.js","sourceRoot":"","sources":["../src/ThemeLayer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ThemeLayer.js","sourceRoot":"","sources":["../src/ThemeLayer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,OAAO,EAAE,2BAA2B,EAAE,QAAQ,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAsB3F;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,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;SAChC;QACD,IAAI,CAAC,gBAAgB,GAAG,SAAS,CAAC;IACpC,CAAC,CAAC;CACH"}
|
package/lib/ThemeProvider.js
CHANGED
|
@@ -6,24 +6,24 @@ import { useThemeRegistry, ThemeRegistryContext } from './ThemeContext';
|
|
|
6
6
|
* @deprecated Use ThemeProvider from @fluentui-react-native/theme instead.
|
|
7
7
|
* See https://github.com/microsoft/fluentui-react-native/blob/main/docs/pages/Guides/UpdateThemeProvider.md for details
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
React.useEffect(
|
|
9
|
+
export const ThemeProvider = (props) => {
|
|
10
|
+
const { registry: registryFromProps, theme: themeName = '', children } = props;
|
|
11
|
+
const defaultRegistry = useThemeRegistry();
|
|
12
|
+
const registryToUse = registryFromProps || defaultRegistry || getThemeRegistry();
|
|
13
|
+
const [theme, setThemeState] = React.useState(registryToUse.getTheme(themeName));
|
|
14
|
+
React.useEffect(() => {
|
|
15
15
|
setThemeState(registryToUse.getTheme(themeName));
|
|
16
|
-
|
|
17
|
-
onInvalidate:
|
|
16
|
+
const themeInvalidater = {
|
|
17
|
+
onInvalidate: (name) => {
|
|
18
18
|
name === themeName && setThemeState(registryToUse.getTheme(themeName));
|
|
19
19
|
},
|
|
20
20
|
};
|
|
21
21
|
registryToUse.addEventListener(themeInvalidater);
|
|
22
|
-
return
|
|
22
|
+
return () => {
|
|
23
23
|
registryToUse.removeEventListener(themeInvalidater);
|
|
24
24
|
};
|
|
25
25
|
}, [registryToUse, themeName, setThemeState]);
|
|
26
|
-
|
|
26
|
+
const themeProvider = React.createElement(ThemeContext.Provider, { value: theme }, children);
|
|
27
27
|
// note `registryFromProps` came from props and it's not the same as `registryToUse`
|
|
28
28
|
return registryFromProps ? (React.createElement(ThemeRegistryContext.Provider, { value: registryFromProps }, themeProvider)) : (themeProvider);
|
|
29
29
|
};
|
package/lib/ThemeProvider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.js","sourceRoot":"","sources":["../src/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAGxE;;;GAGG;AACH,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"ThemeProvider.js","sourceRoot":"","sources":["../src/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAGxE;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAiD,CAAC,KAA0B,EAAE,EAAE;IACxG,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,KAAK,EAAE,SAAS,GAAG,EAAE,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAC/E,MAAM,eAAe,GAAG,gBAAgB,EAAE,CAAC;IAC3C,MAAM,aAAa,GAAG,iBAAiB,IAAI,eAAe,IAAI,gBAAgB,EAAE,CAAC;IACjF,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;IAEjF,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,aAAa,CAAC,aAAa,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;QAEjD,MAAM,gBAAgB,GAAwB;YAC5C,YAAY,EAAE,CAAC,IAAY,EAAE,EAAE;gBAC7B,IAAI,KAAK,SAAS,IAAI,aAAa,CAAC,aAAa,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;YACzE,CAAC;SACF,CAAC;QAEF,aAAa,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;QACjD,OAAO,GAAG,EAAE;YACV,aAAa,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;QACtD,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,aAAa,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC;IAE9C,MAAM,aAAa,GAAG,oBAAC,YAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,IAAG,QAAQ,CAAyB,CAAC;IAE9F,oFAAoF;IACpF,OAAO,iBAAiB,CAAC,CAAC,CAAC,CACzB,oBAAC,oBAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,iBAAiB,IAAG,aAAa,CAAiC,CACzG,CAAC,CAAC,CAAC,CACF,aAAa,CACd,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -4,10 +4,9 @@ import { ThemingModuleHelper } from '../NativeModule';
|
|
|
4
4
|
/**
|
|
5
5
|
* @deprecated
|
|
6
6
|
*/
|
|
7
|
-
export function createPlatformThemeRegistry(platformThemeId, module) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
module.addListener(function () {
|
|
7
|
+
export function createPlatformThemeRegistry(platformThemeId, module = ThemingModuleHelper) {
|
|
8
|
+
const registry = createThemeRegistry(module.getPlatformDefaults(platformThemeId), resolvePartialTheme);
|
|
9
|
+
module.addListener(() => {
|
|
11
10
|
registry.updatePlatformDefaults(module.getPlatformDefaults(platformThemeId));
|
|
12
11
|
});
|
|
13
12
|
return registry;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlatformDefaults.native.js","sourceRoot":"","sources":["../../src/platform/PlatformDefaults.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAGnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD;;GAEG;AACH,MAAM,UAAU,2BAA2B,CAAC,eAAwB,EAAE,
|
|
1
|
+
{"version":3,"file":"PlatformDefaults.native.js","sourceRoot":"","sources":["../../src/platform/PlatformDefaults.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAGnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD;;GAEG;AACH,MAAM,UAAU,2BAA2B,CAAC,eAAwB,EAAE,SAA+B,mBAAmB;IACtH,MAAM,QAAQ,GAAG,mBAAmB,CAAC,MAAM,CAAC,mBAAmB,CAAC,eAAe,CAAC,EAAE,mBAAmB,CAAC,CAAC;IACvG,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE;QACtB,QAAQ,CAAC,sBAAsB,CAAC,MAAM,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAAC,CAAC;IAC/E,CAAC,CAAC,CAAC;IACH,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getBaselinePlatformTheme = void 0;
|
|
4
|
-
|
|
4
|
+
const default_theme_1 = require("@fluentui-react-native/default-theme");
|
|
5
5
|
/**
|
|
6
6
|
* @deprecated
|
|
7
7
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaselinePlatformDefaults.js","sourceRoot":"","sources":["../src/BaselinePlatformDefaults.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"BaselinePlatformDefaults.js","sourceRoot":"","sources":["../src/BaselinePlatformDefaults.ts"],"names":[],"mappings":";;;AAAA,wEAA0E;AAG1E;;GAEG;AACH,SAAgB,wBAAwB;IACtC,OAAO,kCAAkB,CAAC;AAC5B,CAAC;AAFD,4DAEC"}
|
package/lib-commonjs/Global.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.augmentPlatformTheme = exports.getTheme = exports.removeThemeRegistryListener = exports.addThemeRegistryListener = exports.setTheme = exports.setThemeRegistry = exports.getThemeRegistry = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const platform_1 = require("./platform");
|
|
5
|
+
let _registry;
|
|
6
6
|
/**
|
|
7
7
|
* Ensure that `_registry` is set. If not, create it using a native module to
|
|
8
8
|
* provide platform defaults.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Global.js","sourceRoot":"","sources":["../src/Global.ts"],"names":[],"mappings":";;;AAEA,
|
|
1
|
+
{"version":3,"file":"Global.js","sourceRoot":"","sources":["../src/Global.ts"],"names":[],"mappings":";;;AAEA,yCAAyD;AAGzD,IAAI,SAAwB,CAAC;AAE7B;;;;GAIG;AACH,SAAgB,gBAAgB;IAC9B,IAAI,CAAC,SAAS,EAAE;QACd,SAAS,GAAG,IAAA,sCAA2B,GAAE,CAAC;KAC3C;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AALD,4CAKC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,gBAAgB,CAAC,QAAuB;IACtD,SAAS,GAAG,QAAQ,CAAC;AACvB,CAAC;AAFD,4CAEC;AAED;;;;;;GAMG;AACH,SAAgB,QAAQ,CAAC,UAAgE,EAAE,IAAa,EAAE,MAAe;IACvH,OAAO,gBAAgB,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAC/D,CAAC;AAFD,4BAEC;AAED;;;;GAIG;AACH,SAAgB,wBAAwB,CAAC,QAA6B;IACpE,OAAO,gBAAgB,EAAE,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;AACvD,CAAC;AAFD,4DAEC;AAED;;;;GAIG;AACH,SAAgB,2BAA2B,CAAC,QAA6B;IACvE,OAAO,gBAAgB,EAAE,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;AAC1D,CAAC;AAFD,kEAEC;AAED;;;;GAIG;AACH,SAAgB,QAAQ,CAAC,IAAa;IACpC,OAAO,gBAAgB,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC3C,CAAC;AAFD,4BAEC;AAED;;;;;;;GAOG;AACH,SAAgB,oBAAoB,CAAC,UAAyB;IAC5D,gBAAgB,EAAE,CAAC,sBAAsB,CAAC,UAAU,CAAC,CAAC;AACxD,CAAC;AAFD,oDAEC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ThemingModuleHelper = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const win32_theme_1 = require("@fluentui-react-native/win32-theme");
|
|
5
|
+
const ThemingModuleHelpers_1 = require("./ThemingModuleHelpers");
|
|
6
6
|
/**
|
|
7
7
|
* @deprecated
|
|
8
8
|
*/
|
|
9
|
-
exports.ThemingModuleHelper =
|
|
9
|
+
exports.ThemingModuleHelper = (0, ThemingModuleHelpers_1.createThemingModuleHelper)(...(0, win32_theme_1.getThemingModule)());
|
|
10
10
|
//# sourceMappingURL=ThemingModule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemingModule.js","sourceRoot":"","sources":["../../src/NativeModule/ThemingModule.ts"],"names":[],"mappings":";;;AAAA,
|
|
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,23 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createThemingModuleHelper = exports.translateOfficeTheme = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
const win32_theme_1 = require("@fluentui-react-native/win32-theme");
|
|
5
|
+
const theming_ramp_1 = require("@uifabricshared/theming-ramp");
|
|
6
|
+
const BaselinePlatformDefaults_1 = require("../BaselinePlatformDefaults");
|
|
7
7
|
function isException(palette) {
|
|
8
8
|
return palette.message !== undefined;
|
|
9
9
|
}
|
|
10
10
|
function updatePaletteInCache(module, cache, palette) {
|
|
11
|
-
|
|
11
|
+
const paletteValue = module.getPalette(palette);
|
|
12
12
|
if (!isException(paletteValue)) {
|
|
13
13
|
cache[palette] = paletteValue;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
const getPaletteCacheKey = (palette) => {
|
|
17
17
|
return palette || 'WhiteColors';
|
|
18
18
|
};
|
|
19
19
|
function ensurePalette(module, paletteCache, palette) {
|
|
20
|
-
|
|
20
|
+
const key = getPaletteCacheKey(palette);
|
|
21
21
|
if (!paletteCache[key]) {
|
|
22
22
|
updatePaletteInCache(module, paletteCache, key);
|
|
23
23
|
}
|
|
@@ -27,7 +27,7 @@ function ensurePalette(module, paletteCache, palette) {
|
|
|
27
27
|
* @deprecated
|
|
28
28
|
*/
|
|
29
29
|
function translateOfficeTheme(module, cache, id, themeName) {
|
|
30
|
-
|
|
30
|
+
const palette = ensurePalette(module, cache, id);
|
|
31
31
|
return (0, win32_theme_1.createPartialOfficeTheme)(module, themeName, palette);
|
|
32
32
|
}
|
|
33
33
|
exports.translateOfficeTheme = translateOfficeTheme;
|
|
@@ -36,24 +36,24 @@ exports.translateOfficeTheme = translateOfficeTheme;
|
|
|
36
36
|
*/
|
|
37
37
|
function createThemingModuleHelper(themingModule, emitter) {
|
|
38
38
|
themingModule || console.error('No NativeModule for Theming found');
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
const paletteCache = {};
|
|
40
|
+
let _hostTheme = themingModule.getConstants().initialHostThemeSetting || '';
|
|
41
41
|
emitter &&
|
|
42
|
-
emitter.addListener('onPlatformDefaultsChanged',
|
|
42
|
+
emitter.addListener('onPlatformDefaultsChanged', (args) => {
|
|
43
43
|
_hostTheme = (args && args.hostThemeSetting) || _hostTheme;
|
|
44
|
-
Object.keys(paletteCache).forEach(
|
|
44
|
+
Object.keys(paletteCache).forEach((key) => delete paletteCache[key]);
|
|
45
45
|
});
|
|
46
46
|
return {
|
|
47
|
-
getPlatformDefaults:
|
|
47
|
+
getPlatformDefaults: (themeId) => {
|
|
48
48
|
return (0, theming_ramp_1.resolvePartialTheme)((0, BaselinePlatformDefaults_1.getBaselinePlatformTheme)(), translateOfficeTheme(themingModule, paletteCache, themeId, _hostTheme));
|
|
49
49
|
},
|
|
50
|
-
getPlatformThemeDefinition:
|
|
51
|
-
return
|
|
50
|
+
getPlatformThemeDefinition: (themeId) => {
|
|
51
|
+
return (_parent) => {
|
|
52
52
|
updatePaletteInCache(themingModule, paletteCache, themeId);
|
|
53
53
|
return translateOfficeTheme(themingModule, paletteCache, themeId);
|
|
54
54
|
};
|
|
55
55
|
},
|
|
56
|
-
addListener:
|
|
56
|
+
addListener: (callback) => {
|
|
57
57
|
emitter && emitter.addListener('onPlatformDefaultsChanged', callback);
|
|
58
58
|
},
|
|
59
59
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemingModuleHelpers.js","sourceRoot":"","sources":["../../src/NativeModule/ThemingModuleHelpers.ts"],"names":[],"mappings":";;;AAMA,
|
|
1
|
+
{"version":3,"file":"ThemingModuleHelpers.js","sourceRoot":"","sources":["../../src/NativeModule/ThemingModuleHelpers.ts"],"names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,UAAU,GAAG,aAAa,CAAC,YAAY,EAAE,CAAC,uBAAuB,IAAI,EAAE,CAAC;IAC5E,OAAO;QACL,OAAO,CAAC,WAAW,CAAC,2BAA2B,EAAE,CAAC,IAAiC,EAAE,EAAE;YACrF,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;QAC/E,CAAC,CAAC,CAAC;IACL,OAAO;QACL,mBAAmB,EAAE,CAAC,OAAgB,EAAE,EAAE;YACxC,OAAO,IAAA,kCAAmB,EAAC,IAAA,mDAAwB,GAAE,EAAE,oBAAoB,CAAC,aAAa,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC;QACjI,CAAC;QACD,0BAA0B,EAAE,CAAC,OAAgB,EAAE,EAAE;YAC/C,OAAO,CAAC,OAAe,EAAE,EAAE;gBACzB,oBAAoB,CAAC,aAAa,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;gBAC3D,OAAO,oBAAoB,CAAC,aAAa,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;YACpE,CAAC,CAAC;QACJ,CAAC;QACD,WAAW,EAAE,CAAC,QAAyC,EAAE,EAAE;YACzD,OAAO,IAAI,OAAO,CAAC,WAAW,CAAC,2BAA2B,EAAE,QAAQ,CAAC,CAAC;QACxE,CAAC;KACF,CAAC;AACJ,CAAC;AAvBD,8DAuBC"}
|
|
@@ -5,8 +5,7 @@ exports.getHostSettingsWin32 = void 0;
|
|
|
5
5
|
* @deprecated
|
|
6
6
|
*/
|
|
7
7
|
function getHostSettingsWin32(theme) {
|
|
8
|
-
|
|
9
|
-
return ((_a = theme.host) === null || _a === void 0 ? void 0 : _a.palette) ? theme.host : undefined;
|
|
8
|
+
return theme.host?.palette ? theme.host : undefined;
|
|
10
9
|
}
|
|
11
10
|
exports.getHostSettingsWin32 = getHostSettingsWin32;
|
|
12
11
|
//# sourceMappingURL=getHostSettings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getHostSettings.js","sourceRoot":"","sources":["../../src/NativeModule/getHostSettings.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH,SAAgB,oBAAoB,CAAC,KAAa
|
|
1
|
+
{"version":3,"file":"getHostSettings.js","sourceRoot":"","sources":["../../src/NativeModule/getHostSettings.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH,SAAgB,oBAAoB,CAAC,KAAa;IAChD,OAAO,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AACtD,CAAC;AAFD,oDAEC"}
|
|
@@ -24,7 +24,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.useThemeRegistry = exports.ThemeRegistryContext = exports.useTheme = exports.ThemeContext = void 0;
|
|
27
|
-
|
|
27
|
+
const React = __importStar(require("react"));
|
|
28
28
|
/**
|
|
29
29
|
* @deprecated
|
|
30
30
|
*/
|
|
@@ -38,6 +38,6 @@ exports.ThemeRegistryContext = React.createContext(undefined);
|
|
|
38
38
|
/**
|
|
39
39
|
* @deprecated
|
|
40
40
|
*/
|
|
41
|
-
|
|
41
|
+
const useThemeRegistry = () => React.useContext(exports.ThemeRegistryContext);
|
|
42
42
|
exports.useThemeRegistry = useThemeRegistry;
|
|
43
43
|
//# sourceMappingURL=ThemeContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeContext.js","sourceRoot":"","sources":["../src/ThemeContext.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"ThemeContext.js","sourceRoot":"","sources":["../src/ThemeContext.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAG/B;;GAEG;AACH,6DAAsE;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,4BAAoB,CAAC,CAAC;AAAhE,QAAA,gBAAgB,oBAAgD"}
|
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
3
|
if (k2 === undefined) k2 = k;
|
|
19
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -39,9 +24,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
39
24
|
};
|
|
40
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
26
|
exports.ThemeLayer = void 0;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
27
|
+
const React = __importStar(require("react"));
|
|
28
|
+
const theming_ramp_1 = require("@uifabricshared/theming-ramp");
|
|
29
|
+
const Global_1 = require("./Global");
|
|
45
30
|
/**
|
|
46
31
|
* Multipurpose theme provider. This can run in provider/consumer mode and pure consumer mode.
|
|
47
32
|
*
|
|
@@ -68,50 +53,48 @@ var Global_1 = require("./Global");
|
|
|
68
53
|
* change
|
|
69
54
|
* @deprecated
|
|
70
55
|
*/
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
if (_this._registeredTheme === undefined) {
|
|
85
|
-
(0, Global_1.addThemeRegistryListener)(_this);
|
|
86
|
-
}
|
|
87
|
-
_this._registeredTheme = themeName;
|
|
88
|
-
};
|
|
89
|
-
return _this;
|
|
90
|
-
}
|
|
56
|
+
class ThemeLayer extends React.Component {
|
|
57
|
+
/**
|
|
58
|
+
* stores the name of the theme if in provider mode. Existence of this string is tied to registration
|
|
59
|
+
* and is used to signal registration and unregistration
|
|
60
|
+
*/
|
|
61
|
+
_registeredTheme;
|
|
62
|
+
/** handler for theme changes, conditionally will force update */
|
|
63
|
+
onInvalidate = (name) => {
|
|
64
|
+
// only force updates if this theme was the one invalidated
|
|
65
|
+
if (name === this._registeredTheme) {
|
|
66
|
+
this.forceUpdate();
|
|
67
|
+
}
|
|
68
|
+
};
|
|
91
69
|
/** standard cleanup handler to ensure we unregister */
|
|
92
|
-
|
|
70
|
+
componentWillUnmount() {
|
|
93
71
|
if (this._registeredTheme !== undefined) {
|
|
94
72
|
(0, Global_1.removeThemeRegistryListener)(this);
|
|
95
73
|
this._registeredTheme = undefined;
|
|
96
74
|
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
return (React.createElement(theming_ramp_1.ThemeContext.Consumer, null, function (theme) {
|
|
75
|
+
}
|
|
76
|
+
render() {
|
|
77
|
+
let themeName = this.props.themeName;
|
|
78
|
+
return (React.createElement(theming_ramp_1.ThemeContext.Consumer, null, (theme) => {
|
|
102
79
|
// go to provider mode if a themeName is specified or if this is the first consumer and the context
|
|
103
80
|
// is undefined.
|
|
104
81
|
if (themeName !== undefined || theme === undefined) {
|
|
105
82
|
themeName = themeName || '';
|
|
106
|
-
|
|
83
|
+
this._ensureCallbackRegistration(themeName);
|
|
107
84
|
theme = (0, Global_1.getTheme)(themeName);
|
|
108
|
-
return React.createElement(theming_ramp_1.ThemeContext.Provider, { value: theme },
|
|
85
|
+
return React.createElement(theming_ramp_1.ThemeContext.Provider, { value: theme }, this.props.children(theme));
|
|
109
86
|
}
|
|
110
87
|
// otherwise in consumer mode just push the current theme to the children
|
|
111
|
-
return
|
|
88
|
+
return this.props.children(theme);
|
|
112
89
|
}));
|
|
90
|
+
}
|
|
91
|
+
/** helper to register if this is the first time and to update the filter if necessary */
|
|
92
|
+
_ensureCallbackRegistration = (themeName) => {
|
|
93
|
+
if (this._registeredTheme === undefined) {
|
|
94
|
+
(0, Global_1.addThemeRegistryListener)(this);
|
|
95
|
+
}
|
|
96
|
+
this._registeredTheme = themeName;
|
|
113
97
|
};
|
|
114
|
-
|
|
115
|
-
}(React.Component));
|
|
98
|
+
}
|
|
116
99
|
exports.ThemeLayer = ThemeLayer;
|
|
117
100
|
//# sourceMappingURL=ThemeLayer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeLayer.js","sourceRoot":"","sources":["../src/ThemeLayer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ThemeLayer.js","sourceRoot":"","sources":["../src/ThemeLayer.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAG/B,+DAA4D;AAE5D,qCAA2F;AAsB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AgB,KAAK,SAAS,EAAE;YACvC,IAAA,iCAAwB,EAAC,IAAI,CAAC,CAAC;SAChC;QACD,IAAI,CAAC,gBAAgB,GAAG,SAAS,CAAC;IACpC,CAAC,CAAC;CACH;AAlDD,gCAkDC"}
|
|
@@ -24,32 +24,32 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.ThemeProvider = void 0;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
const React = __importStar(require("react"));
|
|
28
|
+
const theming_ramp_1 = require("@uifabricshared/theming-ramp");
|
|
29
|
+
const Global_1 = require("./Global");
|
|
30
|
+
const ThemeContext_1 = require("./ThemeContext");
|
|
31
31
|
/**
|
|
32
32
|
* @deprecated Use ThemeProvider from @fluentui-react-native/theme instead.
|
|
33
33
|
* See https://github.com/microsoft/fluentui-react-native/blob/main/docs/pages/Guides/UpdateThemeProvider.md for details
|
|
34
34
|
*/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
React.useEffect(
|
|
35
|
+
const ThemeProvider = (props) => {
|
|
36
|
+
const { registry: registryFromProps, theme: themeName = '', children } = props;
|
|
37
|
+
const defaultRegistry = (0, ThemeContext_1.useThemeRegistry)();
|
|
38
|
+
const registryToUse = registryFromProps || defaultRegistry || (0, Global_1.getThemeRegistry)();
|
|
39
|
+
const [theme, setThemeState] = React.useState(registryToUse.getTheme(themeName));
|
|
40
|
+
React.useEffect(() => {
|
|
41
41
|
setThemeState(registryToUse.getTheme(themeName));
|
|
42
|
-
|
|
43
|
-
onInvalidate:
|
|
42
|
+
const themeInvalidater = {
|
|
43
|
+
onInvalidate: (name) => {
|
|
44
44
|
name === themeName && setThemeState(registryToUse.getTheme(themeName));
|
|
45
45
|
},
|
|
46
46
|
};
|
|
47
47
|
registryToUse.addEventListener(themeInvalidater);
|
|
48
|
-
return
|
|
48
|
+
return () => {
|
|
49
49
|
registryToUse.removeEventListener(themeInvalidater);
|
|
50
50
|
};
|
|
51
51
|
}, [registryToUse, themeName, setThemeState]);
|
|
52
|
-
|
|
52
|
+
const themeProvider = React.createElement(theming_ramp_1.ThemeContext.Provider, { value: theme }, children);
|
|
53
53
|
// note `registryFromProps` came from props and it's not the same as `registryToUse`
|
|
54
54
|
return registryFromProps ? (React.createElement(ThemeContext_1.ThemeRegistryContext.Provider, { value: registryFromProps }, themeProvider)) : (themeProvider);
|
|
55
55
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.js","sourceRoot":"","sources":["../src/ThemeProvider.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"ThemeProvider.js","sourceRoot":"","sources":["../src/ThemeProvider.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAG/B,+DAA4D;AAE5D,qCAA4C;AAC5C,iDAAwE;AAGxE;;;GAGG;AACI,MAAM,aAAa,GAAiD,CAAC,KAA0B,EAAE,EAAE;IACxG,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,KAAK,EAAE,SAAS,GAAG,EAAE,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAC/E,MAAM,eAAe,GAAG,IAAA,+BAAgB,GAAE,CAAC;IAC3C,MAAM,aAAa,GAAG,iBAAiB,IAAI,eAAe,IAAI,IAAA,yBAAgB,GAAE,CAAC;IACjF,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;IAEjF,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,aAAa,CAAC,aAAa,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;QAEjD,MAAM,gBAAgB,GAAwB;YAC5C,YAAY,EAAE,CAAC,IAAY,EAAE,EAAE;gBAC7B,IAAI,KAAK,SAAS,IAAI,aAAa,CAAC,aAAa,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;YACzE,CAAC;SACF,CAAC;QAEF,aAAa,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;QACjD,OAAO,GAAG,EAAE;YACV,aAAa,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;QACtD,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,aAAa,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC;IAE9C,MAAM,aAAa,GAAG,oBAAC,2BAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,IAAG,QAAQ,CAAyB,CAAC;IAE9F,oFAAoF;IACpF,OAAO,iBAAiB,CAAC,CAAC,CAAC,CACzB,oBAAC,mCAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,iBAAiB,IAAG,aAAa,CAAiC,CACzG,CAAC,CAAC,CAAC,CACF,aAAa,CACd,CAAC;AACJ,CAAC,CAAC;AA7BW,QAAA,aAAa,iBA6BxB"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createPlatformThemeRegistry = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
const theme_registry_1 = require("@uifabricshared/theme-registry");
|
|
5
|
+
const theming_ramp_1 = require("@uifabricshared/theming-ramp");
|
|
6
|
+
const BaselinePlatformDefaults_1 = require("../BaselinePlatformDefaults");
|
|
7
7
|
/**
|
|
8
8
|
* @deprecated
|
|
9
9
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlatformDefaults.js","sourceRoot":"","sources":["../../src/platform/PlatformDefaults.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"PlatformDefaults.js","sourceRoot":"","sources":["../../src/platform/PlatformDefaults.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AACrE,+DAAmE;AAEnE,0EAAuE;AAGvE;;GAEG;AACH,SAAgB,2BAA2B,CAAC,QAAiB,EAAE,OAA8B;IAC3F,OAAO,IAAA,oCAAmB,EAAC,IAAA,mDAAwB,GAAE,EAAE,kCAAmB,CAAC,CAAC;AAC9E,CAAC;AAFD,kEAEC"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createPlatformThemeRegistry = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
const theme_registry_1 = require("@uifabricshared/theme-registry");
|
|
5
|
+
const theming_ramp_1 = require("@uifabricshared/theming-ramp");
|
|
6
|
+
const NativeModule_1 = require("../NativeModule");
|
|
7
7
|
/**
|
|
8
8
|
* @deprecated
|
|
9
9
|
*/
|
|
10
|
-
function createPlatformThemeRegistry(platformThemeId, module) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
module.addListener(function () {
|
|
10
|
+
function createPlatformThemeRegistry(platformThemeId, module = NativeModule_1.ThemingModuleHelper) {
|
|
11
|
+
const registry = (0, theme_registry_1.createThemeRegistry)(module.getPlatformDefaults(platformThemeId), theming_ramp_1.resolvePartialTheme);
|
|
12
|
+
module.addListener(() => {
|
|
14
13
|
registry.updatePlatformDefaults(module.getPlatformDefaults(platformThemeId));
|
|
15
14
|
});
|
|
16
15
|
return registry;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlatformDefaults.native.js","sourceRoot":"","sources":["../../src/platform/PlatformDefaults.native.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"PlatformDefaults.native.js","sourceRoot":"","sources":["../../src/platform/PlatformDefaults.native.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AACrE,+DAAmE;AAGnE,kDAAsD;AAEtD;;GAEG;AACH,SAAgB,2BAA2B,CAAC,eAAwB,EAAE,SAA+B,kCAAmB;IACtH,MAAM,QAAQ,GAAG,IAAA,oCAAmB,EAAC,MAAM,CAAC,mBAAmB,CAAC,eAAe,CAAC,EAAE,kCAAmB,CAAC,CAAC;IACvG,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE;QACtB,QAAQ,CAAC,sBAAsB,CAAC,MAAM,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAAC,CAAC;IAC/E,CAAC,CAAC,CAAC;IACH,OAAO,QAAQ,CAAC;AAClB,CAAC;AAND,kEAMC"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uifabricshared/theming-react-native",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.8",
|
|
4
4
|
"description": "A library of functions which produce React Native styles from a Theme",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
7
7
|
"typings": "lib/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./lib/index.js",
|
|
11
|
+
"require": "./lib-commonjs/index.js",
|
|
12
|
+
"types": "./lib/index.d.ts"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
8
15
|
"scripts": {
|
|
9
16
|
"build": "fluentui-scripts build",
|
|
10
17
|
"just": "fluentui-scripts",
|
|
@@ -27,10 +34,10 @@
|
|
|
27
34
|
"author": "",
|
|
28
35
|
"license": "MIT",
|
|
29
36
|
"dependencies": {
|
|
30
|
-
"@fluentui-react-native/default-theme": "0.26.
|
|
31
|
-
"@fluentui-react-native/win32-theme": "0.34.
|
|
32
|
-
"@uifabricshared/theme-registry": "0.12.
|
|
33
|
-
"@uifabricshared/theming-ramp": "0.20.
|
|
37
|
+
"@fluentui-react-native/default-theme": "0.26.5",
|
|
38
|
+
"@fluentui-react-native/win32-theme": "0.34.8",
|
|
39
|
+
"@uifabricshared/theme-registry": "0.12.3",
|
|
40
|
+
"@uifabricshared/theming-ramp": "0.20.5"
|
|
34
41
|
},
|
|
35
42
|
"devDependencies": {
|
|
36
43
|
"@babel/core": "^7.20.0",
|
|
@@ -42,6 +49,8 @@
|
|
|
42
49
|
"@types/react": "^18.2.0",
|
|
43
50
|
"react": "18.2.0",
|
|
44
51
|
"react-native": "^0.74.0",
|
|
52
|
+
"react-native-macos": "^0.74.0",
|
|
53
|
+
"react-native-windows": "^0.74.0",
|
|
45
54
|
"typescript": "4.9.4"
|
|
46
55
|
},
|
|
47
56
|
"peerDependencies": {
|
|
@@ -66,9 +75,12 @@
|
|
|
66
75
|
]
|
|
67
76
|
},
|
|
68
77
|
"capabilities": [
|
|
78
|
+
"babel-preset-react-native",
|
|
69
79
|
"core",
|
|
70
80
|
"core-android",
|
|
71
81
|
"core-ios",
|
|
82
|
+
"core-macos",
|
|
83
|
+
"core-windows",
|
|
72
84
|
"react"
|
|
73
85
|
]
|
|
74
86
|
}
|