@fluentui-react-native/win32-theme 0.34.1 → 0.34.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +31 -1
- package/CHANGELOG.md +18 -2
- package/lib/NativeModule/getThemingModule.native.d.ts.map +1 -1
- package/lib/NativeModule/getThemingModule.native.js +30 -12
- package/lib/NativeModule/getThemingModule.native.js.map +1 -1
- package/lib-commonjs/NativeModule/getThemingModule.native.d.ts.map +1 -1
- package/lib-commonjs/NativeModule/getThemingModule.native.js +30 -12
- package/lib-commonjs/NativeModule/getThemingModule.native.js.map +1 -1
- package/package.json +1 -1
- package/src/NativeModule/getThemingModule.native.ts +31 -12
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,37 @@
|
|
|
2
2
|
"name": "@fluentui-react-native/win32-theme",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Fri, 12 Jul 2024 17:40:34 GMT",
|
|
6
|
+
"version": "0.34.3",
|
|
7
|
+
"tag": "@fluentui-react-native/win32-theme_v0.34.3",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "30809111+acoates-ms@users.noreply.github.com",
|
|
12
|
+
"package": "@fluentui-react-native/win32-theme",
|
|
13
|
+
"commit": "0daee5ec2a9019bcb7d5820f161ba366bf870ec1",
|
|
14
|
+
"comment": "Fix missing getPalette method when using turbomodule"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Tue, 02 Jul 2024 21:36:35 GMT",
|
|
21
|
+
"version": "0.34.2",
|
|
22
|
+
"tag": "@fluentui-react-native/win32-theme_v0.34.2",
|
|
23
|
+
"comments": {
|
|
24
|
+
"patch": [
|
|
25
|
+
{
|
|
26
|
+
"author": "30809111+acoates-ms@users.noreply.github.com",
|
|
27
|
+
"package": "@fluentui-react-native/win32-theme",
|
|
28
|
+
"commit": "9e5c6cb490f30dcbd865c8db613a11904ff42a4b",
|
|
29
|
+
"comment": "Cache results of theme module getConstants"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"date": "Thu, 02 May 2024 03:33:29 GMT",
|
|
6
36
|
"version": "0.34.1",
|
|
7
37
|
"tag": "@fluentui-react-native/win32-theme_v0.34.1",
|
|
8
38
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
# Change Log - @fluentui-react-native/win32-theme
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Fri, 12 Jul 2024 17:40:34 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 0.34.3
|
|
8
|
+
|
|
9
|
+
Fri, 12 Jul 2024 17:40:34 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- Fix missing getPalette method when using turbomodule (30809111+acoates-ms@users.noreply.github.com)
|
|
14
|
+
|
|
15
|
+
## 0.34.2
|
|
16
|
+
|
|
17
|
+
Tue, 02 Jul 2024 21:36:35 GMT
|
|
18
|
+
|
|
19
|
+
### Patches
|
|
20
|
+
|
|
21
|
+
- Cache results of theme module getConstants (30809111+acoates-ms@users.noreply.github.com)
|
|
22
|
+
|
|
7
23
|
## 0.34.1
|
|
8
24
|
|
|
9
|
-
Thu, 02 May 2024 03:
|
|
25
|
+
Thu, 02 May 2024 03:33:29 GMT
|
|
10
26
|
|
|
11
27
|
### Patches
|
|
12
28
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getThemingModule.native.d.ts","sourceRoot":"","sources":["../../src/NativeModule/getThemingModule.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAuB,MAAM,cAAc,CAAC;AAIvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"getThemingModule.native.d.ts","sourceRoot":"","sources":["../../src/NativeModule/getThemingModule.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAuB,MAAM,cAAc,CAAC;AAIvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAoBjE,wBAAgB,gBAAgB,IAAI,CAAC,mBAAmB,EAAE,kBAAkB,GAAG,SAAS,CAAC,CA4BxF"}
|
|
@@ -11,21 +11,39 @@ function disableGetPalette() {
|
|
|
11
11
|
disabled && console.warn(console.warn('Web Debugging forces Theming Native Module to fallback to fake color values.'));
|
|
12
12
|
return disabled;
|
|
13
13
|
}
|
|
14
|
+
function themeGetConstants() {
|
|
15
|
+
return themingModuleConstants;
|
|
16
|
+
}
|
|
17
|
+
var themingModule = undefined;
|
|
18
|
+
var themingModuleConstants = undefined;
|
|
19
|
+
var themingModuleEmitter = undefined;
|
|
14
20
|
export function getThemingModule() {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
if (!themingModule) {
|
|
22
|
+
var module_1 = TurboModuleRegistry.get('Theming');
|
|
23
|
+
// if the native module exists return the module + an emitter for it
|
|
24
|
+
if (module_1) {
|
|
25
|
+
if (!isInstantiated) {
|
|
26
|
+
// We need to store the host theme so that when themes are created
|
|
27
|
+
// they can use this information.
|
|
28
|
+
setCurrentHostThemeSetting(module_1.getConstants().initialHostThemeSetting);
|
|
29
|
+
isInstantiated = true;
|
|
30
|
+
}
|
|
31
|
+
// Cache the result of getConstants to avoid continuous Native->JS marshalling
|
|
32
|
+
themingModuleConstants = module_1.getConstants();
|
|
33
|
+
// mock getPalette if it should be disabled
|
|
34
|
+
if (disableGetPalette()) {
|
|
35
|
+
themingModule = __assign(__assign({}, module_1), { getPalette: fallbackGetPalette, getConstants: themeGetConstants });
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
themingModule = __assign(__assign({}, module_1), { getPalette: module_1.getPalette, getConstants: themeGetConstants });
|
|
39
|
+
}
|
|
40
|
+
themingModuleEmitter = new NativeEventEmitter(module_1);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
themingModule = fallbackOfficeModule;
|
|
23
44
|
}
|
|
24
|
-
// mock getPalette if it should be disabled, otherwise return the module directly
|
|
25
|
-
return [disableGetPalette() ? __assign(__assign({}, module), { getPalette: fallbackGetPalette }) : module, new NativeEventEmitter(module)];
|
|
26
45
|
}
|
|
27
|
-
|
|
28
|
-
return [fallbackOfficeModule, undefined];
|
|
46
|
+
return [themingModule, themingModuleEmitter];
|
|
29
47
|
}
|
|
30
48
|
var isInstantiated = false;
|
|
31
49
|
//# sourceMappingURL=getThemingModule.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getThemingModule.native.js","sourceRoot":"","sources":["../../src/NativeModule/getThemingModule.native.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEvE,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAGhE;;;GAGG;AAEH,SAAS,iBAAiB;IACxB,IAAM,QAAQ,GAAG,OAAO,IAAI,SAAS,IAAI,SAAS,CAAC,SAAS,KAAK,SAAS,CAAC;IAC3E,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,8EAA8E,CAAC,CAAC,CAAC;IACvH,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC9B,IAAM,
|
|
1
|
+
{"version":3,"file":"getThemingModule.native.js","sourceRoot":"","sources":["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QAAM,KAAE,UAAU,EAAE,QAAM,CAAC,UAAU,EAAE,YAAY,EAAE,iBAAiB,GAAE,CAAC;aAC/F;YACD,oBAAoB,GAAG,IAAI,kBAAkB,CAAC,QAAM,CAAC,CAAC;SACvD;aAAM;YACL,aAAa,GAAG,oBAAoB,CAAC;SACtC;KACF;IAED,OAAO,CAAC,aAAa,EAAE,oBAAoB,CAAC,CAAC;AAC/C,CAAC;AAED,IAAI,cAAc,GAAG,KAAK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getThemingModule.native.d.ts","sourceRoot":"","sources":["../../src/NativeModule/getThemingModule.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAuB,MAAM,cAAc,CAAC;AAIvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"getThemingModule.native.d.ts","sourceRoot":"","sources":["../../src/NativeModule/getThemingModule.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAuB,MAAM,cAAc,CAAC;AAIvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAoBjE,wBAAgB,gBAAgB,IAAI,CAAC,mBAAmB,EAAE,kBAAkB,GAAG,SAAS,CAAC,CA4BxF"}
|
|
@@ -14,21 +14,39 @@ function disableGetPalette() {
|
|
|
14
14
|
disabled && console.warn(console.warn('Web Debugging forces Theming Native Module to fallback to fake color values.'));
|
|
15
15
|
return disabled;
|
|
16
16
|
}
|
|
17
|
+
function themeGetConstants() {
|
|
18
|
+
return themingModuleConstants;
|
|
19
|
+
}
|
|
20
|
+
var themingModule = undefined;
|
|
21
|
+
var themingModuleConstants = undefined;
|
|
22
|
+
var themingModuleEmitter = undefined;
|
|
17
23
|
function getThemingModule() {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
if (!themingModule) {
|
|
25
|
+
var module_1 = react_native_1.TurboModuleRegistry.get('Theming');
|
|
26
|
+
// if the native module exists return the module + an emitter for it
|
|
27
|
+
if (module_1) {
|
|
28
|
+
if (!isInstantiated) {
|
|
29
|
+
// We need to store the host theme so that when themes are created
|
|
30
|
+
// they can use this information.
|
|
31
|
+
(0, hostThemeSetting_1.setCurrentHostThemeSetting)(module_1.getConstants().initialHostThemeSetting);
|
|
32
|
+
isInstantiated = true;
|
|
33
|
+
}
|
|
34
|
+
// Cache the result of getConstants to avoid continuous Native->JS marshalling
|
|
35
|
+
themingModuleConstants = module_1.getConstants();
|
|
36
|
+
// mock getPalette if it should be disabled
|
|
37
|
+
if (disableGetPalette()) {
|
|
38
|
+
themingModule = tslib_1.__assign(tslib_1.__assign({}, module_1), { getPalette: fallbackOfficeModule_1.fallbackGetPalette, getConstants: themeGetConstants });
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
themingModule = tslib_1.__assign(tslib_1.__assign({}, module_1), { getPalette: module_1.getPalette, getConstants: themeGetConstants });
|
|
42
|
+
}
|
|
43
|
+
themingModuleEmitter = new react_native_1.NativeEventEmitter(module_1);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
themingModule = fallbackOfficeModule_1.fallbackOfficeModule;
|
|
26
47
|
}
|
|
27
|
-
// mock getPalette if it should be disabled, otherwise return the module directly
|
|
28
|
-
return [disableGetPalette() ? tslib_1.__assign(tslib_1.__assign({}, module), { getPalette: fallbackOfficeModule_1.fallbackGetPalette }) : module, new react_native_1.NativeEventEmitter(module)];
|
|
29
48
|
}
|
|
30
|
-
|
|
31
|
-
return [fallbackOfficeModule_1.fallbackOfficeModule, undefined];
|
|
49
|
+
return [themingModule, themingModuleEmitter];
|
|
32
50
|
}
|
|
33
51
|
exports.getThemingModule = getThemingModule;
|
|
34
52
|
var isInstantiated = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getThemingModule.native.js","sourceRoot":"","sources":["../../src/NativeModule/getThemingModule.native.ts"],"names":[],"mappings":";;;;AAAA,6CAAuE;AAEvE,+DAAkF;AAClF,uDAAgE;AAGhE;;;GAGG;AAEH,SAAS,iBAAiB;IACxB,IAAM,QAAQ,GAAG,OAAO,IAAI,SAAS,IAAI,SAAS,CAAC,SAAS,KAAK,SAAS,CAAC;IAC3E,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,8EAA8E,CAAC,CAAC,CAAC;IACvH,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAgB,gBAAgB;IAC9B,IAAM,
|
|
1
|
+
{"version":3,"file":"getThemingModule.native.js","sourceRoot":"","sources":["../../src/NativeModule/getThemingModule.native.ts"],"names":[],"mappings":";;;;AAAA,6CAAuE;AAEvE,+DAAkF;AAClF,uDAAgE;AAGhE;;;GAGG;AAEH,SAAS,iBAAiB;IACxB,IAAM,QAAQ,GAAG,OAAO,IAAI,SAAS,IAAI,SAAS,CAAC,SAAS,KAAK,SAAS,CAAC;IAC3E,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,8EAA8E,CAAC,CAAC,CAAC;IACvH,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAS,iBAAiB;IACxB,OAAO,sBAAsB,CAAC;AAChC,CAAC;AAED,IAAI,aAAa,GAAwB,SAAS,CAAC;AACnD,IAAI,sBAAsB,GAAoD,SAAS,CAAC;AACxF,IAAI,oBAAoB,GAAuB,SAAS,CAAC;AACzD,SAAgB,gBAAgB;IAC9B,IAAI,CAAC,aAAa,EAAE;QAClB,IAAM,QAAM,GAAG,kCAAmB,CAAC,GAAG,CAAsB,SAAS,CAAC,CAAC;QACvE,oEAAoE;QACpE,IAAI,QAAM,EAAE;YACV,IAAI,CAAC,cAAc,EAAE;gBACnB,kEAAkE;gBAClE,iCAAiC;gBACjC,IAAA,6CAA0B,EAAC,QAAM,CAAC,YAAY,EAAE,CAAC,uBAAuB,CAAC,CAAC;gBAC1E,cAAc,GAAG,IAAI,CAAC;aACvB;YAED,8EAA8E;YAC9E,sBAAsB,GAAG,QAAM,CAAC,YAAY,EAAE,CAAC;YAE/C,2CAA2C;YAC3C,IAAI,iBAAiB,EAAE,EAAE;gBACvB,aAAa,yCAAQ,QAAM,KAAE,UAAU,EAAE,yCAAkB,EAAE,YAAY,EAAE,iBAAiB,GAAE,CAAC;aAChG;iBAAM;gBACL,aAAa,yCAAQ,QAAM,KAAE,UAAU,EAAE,QAAM,CAAC,UAAU,EAAE,YAAY,EAAE,iBAAiB,GAAE,CAAC;aAC/F;YACD,oBAAoB,GAAG,IAAI,iCAAkB,CAAC,QAAM,CAAC,CAAC;SACvD;aAAM;YACL,aAAa,GAAG,2CAAoB,CAAC;SACtC;KACF;IAED,OAAO,CAAC,aAAa,EAAE,oBAAoB,CAAC,CAAC;AAC/C,CAAC;AA5BD,4CA4BC;AAED,IAAI,cAAc,GAAG,KAAK,CAAC"}
|
package/package.json
CHANGED
|
@@ -15,22 +15,41 @@ function disableGetPalette(): boolean {
|
|
|
15
15
|
return disabled;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
function themeGetConstants(): ReturnType<OfficeThemingModule['getConstants']> {
|
|
19
|
+
return themingModuleConstants;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
let themingModule: OfficeThemingModule = undefined;
|
|
23
|
+
let themingModuleConstants: ReturnType<OfficeThemingModule['getConstants']> = undefined;
|
|
24
|
+
let themingModuleEmitter: NativeEventEmitter = undefined;
|
|
18
25
|
export function getThemingModule(): [OfficeThemingModule, NativeEventEmitter | undefined] {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
if (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
if (!themingModule) {
|
|
27
|
+
const module = TurboModuleRegistry.get<OfficeThemingModule>('Theming');
|
|
28
|
+
// if the native module exists return the module + an emitter for it
|
|
29
|
+
if (module) {
|
|
30
|
+
if (!isInstantiated) {
|
|
31
|
+
// We need to store the host theme so that when themes are created
|
|
32
|
+
// they can use this information.
|
|
33
|
+
setCurrentHostThemeSetting(module.getConstants().initialHostThemeSetting);
|
|
34
|
+
isInstantiated = true;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Cache the result of getConstants to avoid continuous Native->JS marshalling
|
|
38
|
+
themingModuleConstants = module.getConstants();
|
|
39
|
+
|
|
40
|
+
// mock getPalette if it should be disabled
|
|
41
|
+
if (disableGetPalette()) {
|
|
42
|
+
themingModule = { ...module, getPalette: fallbackGetPalette, getConstants: themeGetConstants };
|
|
43
|
+
} else {
|
|
44
|
+
themingModule = { ...module, getPalette: module.getPalette, getConstants: themeGetConstants };
|
|
45
|
+
}
|
|
46
|
+
themingModuleEmitter = new NativeEventEmitter(module);
|
|
47
|
+
} else {
|
|
48
|
+
themingModule = fallbackOfficeModule;
|
|
27
49
|
}
|
|
28
|
-
// mock getPalette if it should be disabled, otherwise return the module directly
|
|
29
|
-
return [disableGetPalette() ? { ...module, getPalette: fallbackGetPalette } : module, new NativeEventEmitter(module)];
|
|
30
50
|
}
|
|
31
51
|
|
|
32
|
-
|
|
33
|
-
return [fallbackOfficeModule, undefined];
|
|
52
|
+
return [themingModule, themingModuleEmitter];
|
|
34
53
|
}
|
|
35
54
|
|
|
36
55
|
let isInstantiated = false;
|