@uifabricshared/theming-react-native 0.14.6 → 0.15.1

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.
Files changed (126) hide show
  1. package/CHANGELOG.json +43 -1
  2. package/CHANGELOG.md +20 -2
  3. package/lib/BaselinePlatformDefaults.d.ts +3 -0
  4. package/lib/BaselinePlatformDefaults.d.ts.map +1 -1
  5. package/lib/BaselinePlatformDefaults.js +3 -0
  6. package/lib/BaselinePlatformDefaults.js.map +1 -1
  7. package/lib/Global.d.ts +7 -0
  8. package/lib/Global.d.ts.map +1 -1
  9. package/lib/Global.js +7 -0
  10. package/lib/Global.js.map +1 -1
  11. package/lib/NativeModule/ThemingModule.d.ts +3 -0
  12. package/lib/NativeModule/ThemingModule.d.ts.map +1 -1
  13. package/lib/NativeModule/ThemingModule.js +3 -0
  14. package/lib/NativeModule/ThemingModule.js.map +1 -1
  15. package/lib/NativeModule/ThemingModule.types.d.ts +12 -0
  16. package/lib/NativeModule/ThemingModule.types.d.ts.map +1 -1
  17. package/lib/NativeModule/ThemingModuleHelpers.d.ts +6 -0
  18. package/lib/NativeModule/ThemingModuleHelpers.d.ts.map +1 -1
  19. package/lib/NativeModule/ThemingModuleHelpers.js +6 -0
  20. package/lib/NativeModule/ThemingModuleHelpers.js.map +1 -1
  21. package/lib/NativeModule/getHostSettings.d.ts +3 -0
  22. package/lib/NativeModule/getHostSettings.d.ts.map +1 -1
  23. package/lib/NativeModule/getHostSettings.js +3 -0
  24. package/lib/NativeModule/getHostSettings.js.map +1 -1
  25. package/lib/Theme.types.d.ts +9 -0
  26. package/lib/Theme.types.d.ts.map +1 -1
  27. package/lib/ThemeContext.d.ts +9 -0
  28. package/lib/ThemeContext.d.ts.map +1 -1
  29. package/lib/ThemeContext.js +9 -0
  30. package/lib/ThemeContext.js.map +1 -1
  31. package/lib/ThemeLayer.d.ts +2 -0
  32. package/lib/ThemeLayer.d.ts.map +1 -1
  33. package/lib/ThemeLayer.js +1 -0
  34. package/lib/ThemeLayer.js.map +1 -1
  35. package/lib/ThemeProvider.d.ts +3 -0
  36. package/lib/ThemeProvider.d.ts.map +1 -1
  37. package/lib/ThemeProvider.js +3 -0
  38. package/lib/ThemeProvider.js.map +1 -1
  39. package/lib/ThemeProvider.types.d.ts +3 -0
  40. package/lib/ThemeProvider.types.d.ts.map +1 -1
  41. package/lib/index.d.ts +30 -0
  42. package/lib/index.d.ts.map +1 -1
  43. package/lib/index.js +18 -0
  44. package/lib/index.js.map +1 -1
  45. package/lib/platform/PlatformDefaults.d.ts +3 -0
  46. package/lib/platform/PlatformDefaults.d.ts.map +1 -1
  47. package/lib/platform/PlatformDefaults.js +3 -0
  48. package/lib/platform/PlatformDefaults.js.map +1 -1
  49. package/lib/platform/PlatformDefaults.native.d.ts +3 -0
  50. package/lib/platform/PlatformDefaults.native.d.ts.map +1 -1
  51. package/lib/platform/PlatformDefaults.native.js +3 -0
  52. package/lib/platform/PlatformDefaults.native.js.map +1 -1
  53. package/lib-commonjs/BaselinePlatformDefaults.d.ts +3 -0
  54. package/lib-commonjs/BaselinePlatformDefaults.d.ts.map +1 -1
  55. package/lib-commonjs/BaselinePlatformDefaults.js +3 -0
  56. package/lib-commonjs/BaselinePlatformDefaults.js.map +1 -1
  57. package/lib-commonjs/Global.d.ts +7 -0
  58. package/lib-commonjs/Global.d.ts.map +1 -1
  59. package/lib-commonjs/Global.js +7 -0
  60. package/lib-commonjs/Global.js.map +1 -1
  61. package/lib-commonjs/NativeModule/ThemingModule.d.ts +3 -0
  62. package/lib-commonjs/NativeModule/ThemingModule.d.ts.map +1 -1
  63. package/lib-commonjs/NativeModule/ThemingModule.js +3 -0
  64. package/lib-commonjs/NativeModule/ThemingModule.js.map +1 -1
  65. package/lib-commonjs/NativeModule/ThemingModule.types.d.ts +12 -0
  66. package/lib-commonjs/NativeModule/ThemingModule.types.d.ts.map +1 -1
  67. package/lib-commonjs/NativeModule/ThemingModuleHelpers.d.ts +6 -0
  68. package/lib-commonjs/NativeModule/ThemingModuleHelpers.d.ts.map +1 -1
  69. package/lib-commonjs/NativeModule/ThemingModuleHelpers.js +6 -0
  70. package/lib-commonjs/NativeModule/ThemingModuleHelpers.js.map +1 -1
  71. package/lib-commonjs/NativeModule/getHostSettings.d.ts +3 -0
  72. package/lib-commonjs/NativeModule/getHostSettings.d.ts.map +1 -1
  73. package/lib-commonjs/NativeModule/getHostSettings.js +3 -0
  74. package/lib-commonjs/NativeModule/getHostSettings.js.map +1 -1
  75. package/lib-commonjs/Theme.types.d.ts +9 -0
  76. package/lib-commonjs/Theme.types.d.ts.map +1 -1
  77. package/lib-commonjs/ThemeContext.d.ts +9 -0
  78. package/lib-commonjs/ThemeContext.d.ts.map +1 -1
  79. package/lib-commonjs/ThemeContext.js +9 -0
  80. package/lib-commonjs/ThemeContext.js.map +1 -1
  81. package/lib-commonjs/ThemeLayer.d.ts +2 -0
  82. package/lib-commonjs/ThemeLayer.d.ts.map +1 -1
  83. package/lib-commonjs/ThemeLayer.js +1 -0
  84. package/lib-commonjs/ThemeLayer.js.map +1 -1
  85. package/lib-commonjs/ThemeProvider.d.ts +3 -0
  86. package/lib-commonjs/ThemeProvider.d.ts.map +1 -1
  87. package/lib-commonjs/ThemeProvider.js +3 -0
  88. package/lib-commonjs/ThemeProvider.js.map +1 -1
  89. package/lib-commonjs/ThemeProvider.types.d.ts +3 -0
  90. package/lib-commonjs/ThemeProvider.types.d.ts.map +1 -1
  91. package/lib-commonjs/index.d.ts +30 -0
  92. package/lib-commonjs/index.d.ts.map +1 -1
  93. package/lib-commonjs/index.js +18 -0
  94. package/lib-commonjs/index.js.map +1 -1
  95. package/lib-commonjs/platform/PlatformDefaults.d.ts +3 -0
  96. package/lib-commonjs/platform/PlatformDefaults.d.ts.map +1 -1
  97. package/lib-commonjs/platform/PlatformDefaults.js +3 -0
  98. package/lib-commonjs/platform/PlatformDefaults.js.map +1 -1
  99. package/lib-commonjs/platform/PlatformDefaults.native.d.ts +3 -0
  100. package/lib-commonjs/platform/PlatformDefaults.native.d.ts.map +1 -1
  101. package/lib-commonjs/platform/PlatformDefaults.native.js +3 -0
  102. package/lib-commonjs/platform/PlatformDefaults.native.js.map +1 -1
  103. package/package.json +4 -4
  104. package/src/BaselinePlatformDefaults.ts +3 -0
  105. package/src/Global.ts +7 -0
  106. package/src/NativeModule/ThemingModule.ts +3 -0
  107. package/src/NativeModule/ThemingModule.types.ts +12 -0
  108. package/src/NativeModule/ThemingModuleHelpers.ts +6 -0
  109. package/src/NativeModule/getHostSettings.ts +3 -0
  110. package/src/Theme.types.ts +11 -0
  111. package/src/ThemeContext.ts +9 -0
  112. package/src/ThemeLayer.tsx +2 -0
  113. package/src/ThemeProvider.tsx +3 -0
  114. package/src/ThemeProvider.types.ts +3 -0
  115. package/src/index.ts +30 -0
  116. package/src/platform/PlatformDefaults.native.ts +3 -0
  117. package/src/platform/PlatformDefaults.ts +3 -0
  118. package/lib/TSUtils.d.ts +0 -13
  119. package/lib/TSUtils.d.ts.map +0 -1
  120. package/lib/TSUtils.js +0 -10
  121. package/lib/TSUtils.js.map +0 -1
  122. package/lib-commonjs/TSUtils.d.ts +0 -13
  123. package/lib-commonjs/TSUtils.d.ts.map +0 -1
  124. package/lib-commonjs/TSUtils.js +0 -14
  125. package/lib-commonjs/TSUtils.js.map +0 -1
  126. package/src/TSUtils.ts +0 -25
@@ -1,3 +1,6 @@
1
1
  import { IThemingModuleHelper } from '../NativeModule';
2
+ /**
3
+ * @deprecated
4
+ */
2
5
  export declare function createPlatformThemeRegistry(_themeId?: string, _module?: IThemingModuleHelper): import("@uifabricshared/theme-registry").IThemeRegistry<import("@uifabricshared/theming-ramp").ITheme, import("@uifabricshared/theming-ramp").IPartialTheme>;
3
6
  //# sourceMappingURL=PlatformDefaults.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PlatformDefaults.d.ts","sourceRoot":"","sources":["../../src/platform/PlatformDefaults.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD,wBAAgB,2BAA2B,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,oBAAoB,gKAE5F"}
1
+ {"version":3,"file":"PlatformDefaults.d.ts","sourceRoot":"","sources":["../../src/platform/PlatformDefaults.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,oBAAoB,gKAE5F"}
@@ -4,6 +4,9 @@ exports.createPlatformThemeRegistry = void 0;
4
4
  var BaselinePlatformDefaults_1 = require("../BaselinePlatformDefaults");
5
5
  var theme_registry_1 = require("@uifabricshared/theme-registry");
6
6
  var theming_ramp_1 = require("@uifabricshared/theming-ramp");
7
+ /**
8
+ * @deprecated
9
+ */
7
10
  function createPlatformThemeRegistry(_themeId, _module) {
8
11
  return (0, theme_registry_1.createThemeRegistry)((0, BaselinePlatformDefaults_1.getBaselinePlatformTheme)(), theming_ramp_1.resolvePartialTheme);
9
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"PlatformDefaults.js","sourceRoot":"","sources":["../../src/platform/PlatformDefaults.ts"],"names":[],"mappings":";;;AAAA,wEAAuE;AACvE,iEAAqE;AACrE,6DAAmE;AAGnE,SAAgB,2BAA2B,CAAC,QAAiB,EAAE,OAA8B;IAC3F,OAAO,IAAA,oCAAmB,EAAC,IAAA,mDAAwB,GAAE,EAAE,kCAAmB,CAAC,CAAC;AAC9E,CAAC;AAFD,kEAEC"}
1
+ {"version":3,"file":"PlatformDefaults.js","sourceRoot":"","sources":["../../src/platform/PlatformDefaults.ts"],"names":[],"mappings":";;;AAAA,wEAAuE;AACvE,iEAAqE;AACrE,6DAAmE;AAGnE;;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,3 +1,6 @@
1
1
  import { IThemingModuleHelper } from '../NativeModule';
2
+ /**
3
+ * @deprecated
4
+ */
2
5
  export declare function createPlatformThemeRegistry(platformThemeId?: string, module?: IThemingModuleHelper): import("@uifabricshared/theme-registry").IThemeRegistry<import("@uifabricshared/theming-ramp").ITheme, import("@uifabricshared/theming-ramp").IPartialTheme>;
3
6
  //# sourceMappingURL=PlatformDefaults.native.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PlatformDefaults.native.d.ts","sourceRoot":"","sources":["../../src/platform/PlatformDefaults.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAI5E,wBAAgB,2BAA2B,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,MAAM,GAAE,oBAA0C,gKAMvH"}
1
+ {"version":3,"file":"PlatformDefaults.native.d.ts","sourceRoot":"","sources":["../../src/platform/PlatformDefaults.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAI5E;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,MAAM,GAAE,oBAA0C,gKAMvH"}
@@ -4,6 +4,9 @@ exports.createPlatformThemeRegistry = void 0;
4
4
  var NativeModule_1 = require("../NativeModule");
5
5
  var theme_registry_1 = require("@uifabricshared/theme-registry");
6
6
  var theming_ramp_1 = require("@uifabricshared/theming-ramp");
7
+ /**
8
+ * @deprecated
9
+ */
7
10
  function createPlatformThemeRegistry(platformThemeId, module) {
8
11
  if (module === void 0) { module = NativeModule_1.ThemingModuleHelper; }
9
12
  var registry = (0, theme_registry_1.createThemeRegistry)(module.getPlatformDefaults(platformThemeId), theming_ramp_1.resolvePartialTheme);
@@ -1 +1 @@
1
- {"version":3,"file":"PlatformDefaults.native.js","sourceRoot":"","sources":["../../src/platform/PlatformDefaults.native.ts"],"names":[],"mappings":";;;AAAA,gDAA4E;AAC5E,iEAAqE;AACrE,6DAAmE;AAEnE,SAAgB,2BAA2B,CAAC,eAAwB,EAAE,MAAkD;IAAlD,uBAAA,EAAA,SAA+B,kCAAmB;IACtH,IAAM,QAAQ,GAAG,IAAA,oCAAmB,EAAC,MAAM,CAAC,mBAAmB,CAAC,eAAe,CAAC,EAAE,kCAAmB,CAAC,CAAC;IACvG,MAAM,CAAC,WAAW,CAAC;QACjB,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"}
1
+ {"version":3,"file":"PlatformDefaults.native.js","sourceRoot":"","sources":["../../src/platform/PlatformDefaults.native.ts"],"names":[],"mappings":";;;AAAA,gDAA4E;AAC5E,iEAAqE;AACrE,6DAAmE;AAEnE;;GAEG;AACH,SAAgB,2BAA2B,CAAC,eAAwB,EAAE,MAAkD;IAAlD,uBAAA,EAAA,SAA+B,kCAAmB;IACtH,IAAM,QAAQ,GAAG,IAAA,oCAAmB,EAAC,MAAM,CAAC,mBAAmB,CAAC,eAAe,CAAC,EAAE,kCAAmB,CAAC,CAAC;IACvG,MAAM,CAAC,WAAW,CAAC;QACjB,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,6 +1,6 @@
1
1
  {
2
2
  "name": "@uifabricshared/theming-react-native",
3
- "version": "0.14.6",
3
+ "version": "0.15.1",
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",
@@ -27,9 +27,9 @@
27
27
  "author": "",
28
28
  "license": "MIT",
29
29
  "dependencies": {
30
- "@fluentui-react-native/default-theme": ">=0.16.0 <1.0.0",
31
- "@fluentui-react-native/win32-theme": ">=0.21.4 <1.0.0",
32
- "@uifabricshared/theme-registry": ">=0.8.1 <1.0.0",
30
+ "@fluentui-react-native/default-theme": ">=0.16.1 <1.0.0",
31
+ "@fluentui-react-native/win32-theme": ">=0.21.5 <1.0.0",
32
+ "@uifabricshared/theme-registry": ">=0.9.0 <1.0.0",
33
33
  "@uifabricshared/theming-ramp": ">=0.17.4 <1.0.0"
34
34
  },
35
35
  "devDependencies": {
@@ -1,6 +1,9 @@
1
1
  import { ITheme } from '@uifabricshared/theming-ramp';
2
2
  import { defaultFluentTheme } from '@fluentui-react-native/default-theme';
3
3
 
4
+ /**
5
+ * @deprecated
6
+ */
4
7
  export function getBaselinePlatformTheme(): ITheme {
5
8
  return defaultFluentTheme;
6
9
  }
package/src/Global.ts CHANGED
@@ -7,6 +7,7 @@ let _registry: ThemeRegistry;
7
7
  /**
8
8
  * Ensure that `_registry` is set. If not, create it using a native module to
9
9
  * provide platform defaults.
10
+ * @deprecated
10
11
  */
11
12
  export function getThemeRegistry(): ThemeRegistry {
12
13
  if (!_registry) {
@@ -24,6 +25,7 @@ export function getThemeRegistry(): ThemeRegistry {
24
25
  * The react tree may contain <ThemeLayer> controls which are tightly bound to
25
26
  * `_registry`. Changing `_registry` while the app is running will disrupt
26
27
  * theming, causing undefined behavior.
28
+ * @deprecated
27
29
  */
28
30
  export function setThemeRegistry(registry: ThemeRegistry): void {
29
31
  _registry = registry;
@@ -34,6 +36,7 @@ export function setThemeRegistry(registry: ThemeRegistry): void {
34
36
  * @param definition - partial theme definition or processing function that defines the theme
35
37
  * @param name - name of the theme, undefined or '' for default
36
38
  * @param parent - parent theme to depend on, if unspecified this will pull from the default theme
39
+ * @deprecated
37
40
  */
38
41
  export function setTheme(definition: IPartialTheme | IProcessTheme<ITheme, IPartialTheme>, name?: string, parent?: string): void {
39
42
  return getThemeRegistry().setTheme(definition, name, parent);
@@ -42,6 +45,7 @@ export function setTheme(definition: IPartialTheme | IProcessTheme<ITheme, IPart
42
45
  /**
43
46
  * Register a theme event listener
44
47
  * @param listener - theme event listener to add
48
+ * @deprecated
45
49
  */
46
50
  export function addThemeRegistryListener(listener: IThemeEventListener): void {
47
51
  return getThemeRegistry().addEventListener(listener);
@@ -50,6 +54,7 @@ export function addThemeRegistryListener(listener: IThemeEventListener): void {
50
54
  /**
51
55
  * Unregister a theme event listener
52
56
  * @param listener - theme event listener to remove
57
+ * @deprecated
53
58
  */
54
59
  export function removeThemeRegistryListener(listener: IThemeEventListener): void {
55
60
  return getThemeRegistry().removeEventListener(listener);
@@ -58,6 +63,7 @@ export function removeThemeRegistryListener(listener: IThemeEventListener): void
58
63
  /**
59
64
  * Get a theme by name
60
65
  * @param name - name of the theme. Undefined or '' will resolve to the default theme
66
+ * @deprecated
61
67
  */
62
68
  export function getTheme(name?: string): ITheme {
63
69
  return getThemeRegistry().getTheme(name);
@@ -69,6 +75,7 @@ export function getTheme(name?: string): ITheme {
69
75
  *
70
76
  * @param definition - properties to add to the platform theme. Note that this will invalidate every theme and cause rerenders
71
77
  * if this is not done in the boot sequence.
78
+ * @deprecated
72
79
  */
73
80
  export function augmentPlatformTheme(definition: IPartialTheme): void {
74
81
  getThemeRegistry().updatePlatformDefaults(definition);
@@ -1,4 +1,7 @@
1
1
  import { createThemingModuleHelper } from './ThemingModuleHelpers';
2
2
  import { getThemingModule } from '@fluentui-react-native/win32-theme';
3
3
 
4
+ /**
5
+ * @deprecated
6
+ */
4
7
  export const ThemingModuleHelper = createThemingModuleHelper(...getThemingModule());
@@ -2,12 +2,21 @@ import { ITheme, IPartialTheme, OfficePalette as IOfficePalette } from '@uifabri
2
2
  import { IProcessTheme } from '@uifabricshared/theme-registry';
3
3
  import { PlatformDefaultsChangedCallback } from '@fluentui-react-native/win32-theme';
4
4
 
5
+ /**
6
+ * @deprecated
7
+ */
5
8
  export interface IEventEmitter {
6
9
  addListener: (event: string, PlatformDefaultsChangedCallback) => void;
7
10
  }
8
11
 
12
+ /**
13
+ * @deprecated
14
+ */
9
15
  export type IPlatformThemeDefinition = IPartialTheme | IProcessTheme<ITheme, IPartialTheme>;
10
16
 
17
+ /**
18
+ * @deprecated
19
+ */
11
20
  export interface IThemingModuleHelper {
12
21
  /**
13
22
  * Gets a complete platform theme suitable for using with a Theme Registry
@@ -21,6 +30,9 @@ export interface IThemingModuleHelper {
21
30
  addListener: (listener: PlatformDefaultsChangedCallback) => void; // TODO: Should probably be able to remove
22
31
  }
23
32
 
33
+ /**
34
+ * @deprecated
35
+ */
24
36
  export type IHostSettingsWin32 = {
25
37
  palette: IOfficePalette;
26
38
  };
@@ -34,11 +34,17 @@ function ensurePalette(module: OfficeThemingModule, paletteCache: PaletteCache,
34
34
  return paletteCache[key] || ({} as OfficePalette);
35
35
  }
36
36
 
37
+ /**
38
+ * @deprecated
39
+ */
37
40
  export function translateOfficeTheme(module: OfficeThemingModule, cache: PaletteCache, id?: string, themeName?: string) {
38
41
  const palette = ensurePalette(module, cache, id);
39
42
  return createPartialOfficeTheme(module, themeName, palette);
40
43
  }
41
44
 
45
+ /**
46
+ * @deprecated
47
+ */
42
48
  export function createThemingModuleHelper(themingModule?: OfficeThemingModule, emitter?: IEventEmitter): IThemingModuleHelper {
43
49
  themingModule || console.error('No NativeModule for Theming found');
44
50
  const paletteCache: PaletteCache = {};
@@ -1,5 +1,8 @@
1
1
  import { ITheme } from '../Theme.types';
2
2
 
3
+ /**
4
+ * @deprecated
5
+ */
3
6
  export function getHostSettingsWin32(theme: ITheme): ITheme['host'] | undefined {
4
7
  return theme.host?.palette ? theme.host : undefined;
5
8
  }
@@ -1,6 +1,17 @@
1
1
  import { IThemeRegistry, IProcessTheme } from '@uifabricshared/theme-registry';
2
2
  import { ITheme, IPartialTheme } from '@uifabricshared/theming-ramp';
3
3
 
4
+ /**
5
+ * @deprecated
6
+ */
4
7
  export { ITheme, IPartialTheme } from '@uifabricshared/theming-ramp';
8
+
9
+ /**
10
+ * @deprecated
11
+ */
5
12
  export type IThemeDefinition = IPartialTheme | IProcessTheme<ITheme, IPartialTheme>;
13
+
14
+ /**
15
+ * @deprecated
16
+ */
6
17
  export type ThemeRegistry = IThemeRegistry<ITheme, IPartialTheme>;
@@ -1,6 +1,15 @@
1
1
  import * as React from 'react';
2
2
  import { ThemeRegistry } from './Theme.types';
3
+ /**
4
+ * @deprecated
5
+ */
3
6
  export { ThemeContext, useTheme } from '@uifabricshared/theming-ramp';
4
7
 
8
+ /**
9
+ * @deprecated
10
+ */
5
11
  export const ThemeRegistryContext = React.createContext<ThemeRegistry>(undefined);
12
+ /**
13
+ * @deprecated
14
+ */
6
15
  export const useThemeRegistry = () => React.useContext(ThemeRegistryContext);
@@ -6,6 +6,7 @@ import { ThemeContext } from '@uifabricshared/theming-ramp';
6
6
 
7
7
  /**
8
8
  * props for the ThemeLayer
9
+ * @deprecated
9
10
  */
10
11
  export interface IThemeLayerProps {
11
12
  /**
@@ -46,6 +47,7 @@ export interface IThemeLayerProps {
46
47
  * The work of registering for updates will be done automatically. The highest level `ThemeLayer` in
47
48
  * consumer mode will automatically register and act like a provider to ensure renders happen on theme
48
49
  * change
50
+ * @deprecated
49
51
  */
50
52
  export class ThemeLayer extends React.Component<IThemeLayerProps> {
51
53
  /**
@@ -5,6 +5,9 @@ import { IThemeEventListener } from '@uifabricshared/theme-registry';
5
5
  import { getThemeRegistry } from './Global';
6
6
  import { ThemeContext } from '@uifabricshared/theming-ramp';
7
7
 
8
+ /**
9
+ * @deprecated
10
+ */
8
11
  export const ThemeProvider: React.FunctionComponent<IThemeProviderProps> = (props: IThemeProviderProps) => {
9
12
  const { registry: registryFromProps, theme: themeName = '', children } = props;
10
13
  const defaultRegistry = useThemeRegistry();
@@ -2,6 +2,9 @@
2
2
 
3
3
  import { ThemeRegistry } from './Theme.types';
4
4
 
5
+ /**
6
+ * @deprecated
7
+ */
5
8
  export interface IThemeProviderProps extends React.PropsWithChildren<{}> {
6
9
  theme?: string;
7
10
  registry?: ThemeRegistry;
package/src/index.ts CHANGED
@@ -1,10 +1,40 @@
1
+ /**
2
+ * @deprecated
3
+ */
1
4
  export { addThemeRegistryListener, removeThemeRegistryListener, setTheme, getTheme, augmentPlatformTheme } from './Global';
5
+ /**
6
+ * @deprecated
7
+ */
2
8
  export { IPartialTheme, ITheme } from './Theme.types';
9
+ /**
10
+ * @deprecated
11
+ */
3
12
  export type { IThemeDefinition, ThemeRegistry } from './Theme.types';
13
+ /**
14
+ * @deprecated
15
+ */
4
16
  export { IThemeLayerProps, ThemeLayer } from './ThemeLayer';
17
+ /**
18
+ * @deprecated
19
+ */
5
20
  export { createPlatformThemeRegistry } from './platform';
21
+ /**
22
+ * @deprecated
23
+ */
6
24
  export { ThemeProvider } from './ThemeProvider';
25
+ /**
26
+ * @deprecated
27
+ */
7
28
  export type { IThemeProviderProps } from './ThemeProvider.types';
29
+ /**
30
+ * @deprecated
31
+ */
8
32
  export { ThemeContext, ThemeRegistryContext, useTheme, useThemeRegistry } from './ThemeContext';
33
+ /**
34
+ * @deprecated
35
+ */
9
36
  export { ThemingModuleHelper, getHostSettingsWin32 } from './NativeModule';
37
+ /**
38
+ * @deprecated
39
+ */
10
40
  export type { IEventEmitter, IHostSettingsWin32, IPlatformThemeDefinition, IThemingModuleHelper } from './NativeModule';
@@ -2,6 +2,9 @@ import { ThemingModuleHelper, IThemingModuleHelper } from '../NativeModule';
2
2
  import { createThemeRegistry } from '@uifabricshared/theme-registry';
3
3
  import { resolvePartialTheme } from '@uifabricshared/theming-ramp';
4
4
 
5
+ /**
6
+ * @deprecated
7
+ */
5
8
  export function createPlatformThemeRegistry(platformThemeId?: string, module: IThemingModuleHelper = ThemingModuleHelper) {
6
9
  const registry = createThemeRegistry(module.getPlatformDefaults(platformThemeId), resolvePartialTheme);
7
10
  module.addListener(() => {
@@ -3,6 +3,9 @@ import { createThemeRegistry } from '@uifabricshared/theme-registry';
3
3
  import { resolvePartialTheme } from '@uifabricshared/theming-ramp';
4
4
  import { IThemingModuleHelper } from '../NativeModule';
5
5
 
6
+ /**
7
+ * @deprecated
8
+ */
6
9
  export function createPlatformThemeRegistry(_themeId?: string, _module?: IThemingModuleHelper) {
7
10
  return createThemeRegistry(getBaselinePlatformTheme(), resolvePartialTheme);
8
11
  }
package/lib/TSUtils.d.ts DELETED
@@ -1,13 +0,0 @@
1
- /** typescript shorthand for excluding a key from an interface */
2
- export declare type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
3
- /** Extract from T those types that are assignable to U */
4
- export declare type Extract<T, U> = T extends U ? T : never;
5
- /** Extract from T based on expected with an alternate */
6
- export declare type ExtractProp<T, U = object, TUnset = object> = T extends U ? T : TUnset;
7
- /** Exclude from T those types that are assignable to U */
8
- export declare type Exclude<T, U> = T extends U ? never : T;
9
- /** Test for never, return TToSet if not never, TNeverVal if the type is never */
10
- export declare type NonNever<TObj, TToSet, TNeverVal = object> = [TObj] extends [never] ? TNeverVal : TToSet;
11
- /** Iterate through keys of object which are objects */
12
- export declare function iterObj(target: object, fn: (obj: object, key: string) => void): void;
13
- //# sourceMappingURL=TSUtils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TSUtils.d.ts","sourceRoot":"","sources":["../src/TSUtils.ts"],"names":[],"mappings":"AAEA,iEAAiE;AACjE,oBAAY,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAEtD,0DAA0D;AAC1D,oBAAY,OAAO,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAEpD,yDAAyD;AACzD,oBAAY,WAAW,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC;AAEnF,0DAA0D;AAC1D,oBAAY,OAAO,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC;AAEpD,iFAAiF;AACjF,oBAAY,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,SAAS,GAAG,MAAM,CAAC;AAErG,uDAAuD;AACvD,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAMpF"}
package/lib/TSUtils.js DELETED
@@ -1,10 +0,0 @@
1
- /* eslint-disable */
2
- /** Iterate through keys of object which are objects */
3
- export function iterObj(target, fn) {
4
- for (var targetKey in target) {
5
- if (target.hasOwnProperty(targetKey) && typeof target[targetKey] === 'object') {
6
- fn(target[targetKey], targetKey);
7
- }
8
- }
9
- }
10
- //# sourceMappingURL=TSUtils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TSUtils.js","sourceRoot":"","sources":["../src/TSUtils.ts"],"names":[],"mappings":"AAAA,oBAAoB;AAiBpB,uDAAuD;AACvD,MAAM,UAAU,OAAO,CAAC,MAAc,EAAE,EAAsC;IAC5E,KAAK,IAAM,SAAS,IAAI,MAAM,EAAE;QAC9B,IAAI,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,OAAO,MAAM,CAAC,SAAS,CAAC,KAAK,QAAQ,EAAE;YAC7E,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC,CAAC;SAClC;KACF;AACH,CAAC"}
@@ -1,13 +0,0 @@
1
- /** typescript shorthand for excluding a key from an interface */
2
- export declare type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
3
- /** Extract from T those types that are assignable to U */
4
- export declare type Extract<T, U> = T extends U ? T : never;
5
- /** Extract from T based on expected with an alternate */
6
- export declare type ExtractProp<T, U = object, TUnset = object> = T extends U ? T : TUnset;
7
- /** Exclude from T those types that are assignable to U */
8
- export declare type Exclude<T, U> = T extends U ? never : T;
9
- /** Test for never, return TToSet if not never, TNeverVal if the type is never */
10
- export declare type NonNever<TObj, TToSet, TNeverVal = object> = [TObj] extends [never] ? TNeverVal : TToSet;
11
- /** Iterate through keys of object which are objects */
12
- export declare function iterObj(target: object, fn: (obj: object, key: string) => void): void;
13
- //# sourceMappingURL=TSUtils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TSUtils.d.ts","sourceRoot":"","sources":["../src/TSUtils.ts"],"names":[],"mappings":"AAEA,iEAAiE;AACjE,oBAAY,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAEtD,0DAA0D;AAC1D,oBAAY,OAAO,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAEpD,yDAAyD;AACzD,oBAAY,WAAW,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC;AAEnF,0DAA0D;AAC1D,oBAAY,OAAO,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC;AAEpD,iFAAiF;AACjF,oBAAY,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,SAAS,GAAG,MAAM,CAAC;AAErG,uDAAuD;AACvD,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAMpF"}
@@ -1,14 +0,0 @@
1
- "use strict";
2
- /* eslint-disable */
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.iterObj = void 0;
5
- /** Iterate through keys of object which are objects */
6
- function iterObj(target, fn) {
7
- for (var targetKey in target) {
8
- if (target.hasOwnProperty(targetKey) && typeof target[targetKey] === 'object') {
9
- fn(target[targetKey], targetKey);
10
- }
11
- }
12
- }
13
- exports.iterObj = iterObj;
14
- //# sourceMappingURL=TSUtils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TSUtils.js","sourceRoot":"","sources":["../src/TSUtils.ts"],"names":[],"mappings":";AAAA,oBAAoB;;;AAiBpB,uDAAuD;AACvD,SAAgB,OAAO,CAAC,MAAc,EAAE,EAAsC;IAC5E,KAAK,IAAM,SAAS,IAAI,MAAM,EAAE;QAC9B,IAAI,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,OAAO,MAAM,CAAC,SAAS,CAAC,KAAK,QAAQ,EAAE;YAC7E,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC,CAAC;SAClC;KACF;AACH,CAAC;AAND,0BAMC"}
package/src/TSUtils.ts DELETED
@@ -1,25 +0,0 @@
1
- /* eslint-disable */
2
-
3
- /** typescript shorthand for excluding a key from an interface */
4
- export type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
5
-
6
- /** Extract from T those types that are assignable to U */
7
- export type Extract<T, U> = T extends U ? T : never;
8
-
9
- /** Extract from T based on expected with an alternate */
10
- export type ExtractProp<T, U = object, TUnset = object> = T extends U ? T : TUnset;
11
-
12
- /** Exclude from T those types that are assignable to U */
13
- export type Exclude<T, U> = T extends U ? never : T;
14
-
15
- /** Test for never, return TToSet if not never, TNeverVal if the type is never */
16
- export type NonNever<TObj, TToSet, TNeverVal = object> = [TObj] extends [never] ? TNeverVal : TToSet;
17
-
18
- /** Iterate through keys of object which are objects */
19
- export function iterObj(target: object, fn: (obj: object, key: string) => void): void {
20
- for (const targetKey in target) {
21
- if (target.hasOwnProperty(targetKey) && typeof target[targetKey] === 'object') {
22
- fn(target[targetKey], targetKey);
23
- }
24
- }
25
- }