@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 CHANGED
@@ -2,7 +2,37 @@
2
2
  "name": "@fluentui-react-native/win32-theme",
3
3
  "entries": [
4
4
  {
5
- "date": "Thu, 02 May 2024 03:32:44 GMT",
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 Thu, 02 May 2024 03:32:44 GMT and should not be manually modified.
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:32:44 GMT
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;AAajE,wBAAgB,gBAAgB,IAAI,CAAC,mBAAmB,EAAE,kBAAkB,GAAG,SAAS,CAAC,CAgBxF"}
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
- var module = TurboModuleRegistry.get('Theming');
16
- // if the native module exists return the module + an emitter for it
17
- if (module) {
18
- if (!isInstantiated) {
19
- // We need to store the host theme so that when themes are created
20
- // they can use this information.
21
- setCurrentHostThemeSetting(module.getConstants().initialHostThemeSetting);
22
- isInstantiated = true;
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
- // otherwise use the fallback module
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;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"","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;AAajE,wBAAgB,gBAAgB,IAAI,CAAC,mBAAmB,EAAE,kBAAkB,GAAG,SAAS,CAAC,CAgBxF"}
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
- var module = react_native_1.TurboModuleRegistry.get('Theming');
19
- // if the native module exists return the module + an emitter for it
20
- if (module) {
21
- if (!isInstantiated) {
22
- // We need to store the host theme so that when themes are created
23
- // they can use this information.
24
- (0, hostThemeSetting_1.setCurrentHostThemeSetting)(module.getConstants().initialHostThemeSetting);
25
- isInstantiated = true;
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
- // otherwise use the fallback module
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,MAAM,GAAG,kCAAmB,CAAC,GAAG,CAAsB,SAAS,CAAC,CAAC;IACvE,oEAAoE;IACpE,IAAI,MAAM,EAAE;QACV,IAAI,CAAC,cAAc,EAAE;YACnB,kEAAkE;YAClE,iCAAiC;YACjC,IAAA,6CAA0B,EAAC,MAAM,CAAC,YAAY,EAAE,CAAC,uBAAuB,CAAC,CAAC;YAC1E,cAAc,GAAG,IAAI,CAAC;SACvB;QACD,iFAAiF;QACjF,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAAC,uCAAM,MAAM,KAAE,UAAU,EAAE,yCAAkB,IAAG,CAAC,CAAC,MAAM,EAAE,IAAI,iCAAkB,CAAC,MAAM,CAAC,CAAC,CAAC;KACvH;IAED,oCAAoC;IACpC,OAAO,CAAC,2CAAoB,EAAE,SAAS,CAAC,CAAC;AAC3C,CAAC;AAhBD,4CAgBC;AAED,IAAI,cAAc,GAAG,KAAK,CAAC"}
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui-react-native/win32-theme",
3
- "version": "0.34.1",
3
+ "version": "0.34.3",
4
4
  "description": "Win32 office theme that works with the theming native module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -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
- const module = TurboModuleRegistry.get<OfficeThemingModule>('Theming');
20
- // if the native module exists return the module + an emitter for it
21
- if (module) {
22
- if (!isInstantiated) {
23
- // We need to store the host theme so that when themes are created
24
- // they can use this information.
25
- setCurrentHostThemeSetting(module.getConstants().initialHostThemeSetting);
26
- isInstantiated = true;
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
- // otherwise use the fallback module
33
- return [fallbackOfficeModule, undefined];
52
+ return [themingModule, themingModuleEmitter];
34
53
  }
35
54
 
36
55
  let isInstantiated = false;