@itwin/imodel-components-react 3.5.0-dev.8 → 3.6.0-dev.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.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,64 @@
1
1
  # Change Log - @itwin/imodel-components-react
2
2
 
3
- This log was last generated on Thu, 01 Sep 2022 14:37:22 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 30 Nov 2022 14:28:19 GMT and should not be manually modified.
4
+
5
+ ## 3.4.7
6
+ Wed, 30 Nov 2022 14:28:19 GMT
7
+
8
+ _Version update only_
9
+
10
+ ## 3.4.6
11
+ Tue, 22 Nov 2022 14:24:19 GMT
12
+
13
+ _Version update only_
14
+
15
+ ## 3.4.5
16
+ Thu, 17 Nov 2022 21:32:50 GMT
17
+
18
+ _Version update only_
19
+
20
+ ## 3.4.4
21
+ Thu, 10 Nov 2022 19:32:17 GMT
22
+
23
+ _Version update only_
24
+
25
+ ## 3.4.3
26
+ Fri, 28 Oct 2022 13:34:58 GMT
27
+
28
+ _Version update only_
29
+
30
+ ## 3.4.2
31
+ Mon, 24 Oct 2022 13:23:45 GMT
32
+
33
+ _Version update only_
34
+
35
+ ## 3.4.1
36
+ Mon, 17 Oct 2022 20:06:51 GMT
37
+
38
+ _Version update only_
39
+
40
+ ## 3.4.0
41
+ Thu, 13 Oct 2022 20:24:47 GMT
42
+
43
+ ### Updates
44
+
45
+ - Updated Node types declaration to support latest v16
46
+ - Fix/Remove skipped tests
47
+
48
+ ## 3.3.5
49
+ Tue, 27 Sep 2022 11:50:59 GMT
50
+
51
+ _Version update only_
52
+
53
+ ## 3.3.4
54
+ Thu, 08 Sep 2022 19:00:05 GMT
55
+
56
+ _Version update only_
57
+
58
+ ## 3.3.3
59
+ Tue, 06 Sep 2022 20:54:19 GMT
60
+
61
+ _Version update only_
4
62
 
5
63
  ## 3.3.2
6
64
  Thu, 01 Sep 2022 14:37:22 GMT
@@ -19,7 +19,7 @@ export declare class UiIModelComponents {
19
19
  static get localizationNamespace(): string;
20
20
  /** @internal */
21
21
  static get packageName(): string;
22
- /** Calls localization.getLocalizedStringWithNamespace with the "UiIModelComponents" namespace. Do NOT include the namespace in the key.
22
+ /** Calls localization.getLocalizedString with the "UiIModelComponents" namespace. Do NOT include the namespace in the key.
23
23
  * @internal
24
24
  */
25
25
  static translate(key: string | string[]): string;
@@ -58,7 +58,7 @@ class UiIModelComponents {
58
58
  static get packageName() {
59
59
  return "imodel-components-react";
60
60
  }
61
- /** Calls localization.getLocalizedStringWithNamespace with the "UiIModelComponents" namespace. Do NOT include the namespace in the key.
61
+ /** Calls localization.getLocalizedString with the "UiIModelComponents" namespace. Do NOT include the namespace in the key.
62
62
  * @internal
63
63
  */
64
64
  static translate(key) {
@@ -66,7 +66,7 @@ class UiIModelComponents {
66
66
  core_bentley_1.Logger.logError(UiIModelComponents.loggerCategory(this), `translate: IModelApp.localization has not been setup. Returning blank string.`);
67
67
  return "";
68
68
  }
69
- return core_frontend_1.IModelApp.localization.getLocalizedStringWithNamespace(UiIModelComponents.localizationNamespace, key);
69
+ return core_frontend_1.IModelApp.localization.getLocalizedString(key, { ns: UiIModelComponents.localizationNamespace });
70
70
  }
71
71
  /** @internal */
72
72
  static loggerCategory(obj) {
@@ -1 +1 @@
1
- {"version":3,"file":"UiIModelComponents.js","sourceRoot":"","sources":["../../../src/imodel-components-react/UiIModelComponents.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,iCAAsC;AACtC,sDAA6C;AAC7C,wDAAiD;AACjD,0DAAqD;AACrD,8DAAuD;AACvD,oDAAuD;AAEvD;;;GAGG;AACH,MAAa,kBAAkB;IAG7B;;OAEG;IACI,MAAM,CAAC,KAAK,CAAC,UAAU;;QAC5B,IAAI,kBAAkB,CAAC,YAAY,EAAE;YACnC,qBAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC,cAAc,CAAC,kBAAkB,CAAC,EAAE,8CAA8C,CAAC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AE,CAAC;SACX;QACD,OAAO,yBAAS,CAAC,YAAY,CAAC,+BAA+B,CAAC,kBAAkB,CAAC,qBAAqB,EAAE,GAAG,CAAC,CAAC;IAC/G,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,cAAc,CAAC,GAAQ;QACnC,MAAM,SAAS,GAAG,IAAA,6BAAY,EAAC,GAAG,CAAC,CAAC;QACpC,MAAM,QAAQ,GAAG,kBAAkB,CAAC,WAAW,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACrF,OAAO,QAAQ,CAAC;IAClB,CAAC;;AA/DH,gDAiEC;AAhEgB,+BAAY,GAAG,KAAK,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Common\r\n */\r\n\r\nimport { enablePatches } from \"immer\";\r\nimport { Logger } from \"@itwin/core-bentley\";\r\nimport { IModelApp } from \"@itwin/core-frontend\";\r\nimport { getClassName } from \"@itwin/appui-abstract\";\r\nimport { UiComponents } from \"@itwin/components-react\";\r\nimport { EmptyLocalization } from \"@itwin/core-common\";\r\n\r\n/**\r\n * Manages the localization service for the imodel-components-react package.\r\n * @public\r\n */\r\nexport class UiIModelComponents {\r\n private static _initialized = false;\r\n\r\n /**\r\n * initialize UiIModelComponents.\r\n */\r\n public static async initialize(): Promise<void> {\r\n if (UiIModelComponents._initialized) {\r\n Logger.logInfo(UiIModelComponents.loggerCategory(UiIModelComponents), `UiIModelComponents.initialize already called`);\r\n return;\r\n }\r\n\r\n enablePatches();\r\n await IModelApp.localization?.registerNamespace(UiIModelComponents.localizationNamespace);\r\n\r\n if (!IModelApp.localization) {\r\n // it should only get here in unit test where IModelApp is not setup\r\n const localization = new EmptyLocalization();\r\n await localization.initialize();\r\n await UiComponents.initialize(localization);\r\n } else {\r\n await UiComponents.initialize(IModelApp.localization);\r\n }\r\n\r\n UiIModelComponents._initialized = true;\r\n }\r\n\r\n /** Unregisters the UiIModelComponents localization namespace */\r\n public static terminate() {\r\n IModelApp.localization?.unregisterNamespace(UiIModelComponents.localizationNamespace);\r\n UiComponents.terminate();\r\n UiIModelComponents._initialized = false;\r\n }\r\n\r\n /** Determines if UiIModelComponents has been initialized */\r\n public static get initialized(): boolean { return UiIModelComponents._initialized; }\r\n\r\n /** The internationalization service namespace. */\r\n public static get localizationNamespace(): string {\r\n return \"UiIModelComponents\";\r\n }\r\n\r\n /** @internal */\r\n public static get packageName(): string {\r\n return \"imodel-components-react\";\r\n }\r\n\r\n /** Calls localization.getLocalizedStringWithNamespace with the \"UiIModelComponents\" namespace. Do NOT include the namespace in the key.\r\n * @internal\r\n */\r\n public static translate(key: string | string[]): string {\r\n if (!UiIModelComponents.initialized || /* istanbul ignore next */ !IModelApp.localization) {\r\n Logger.logError(UiIModelComponents.loggerCategory(this), `translate: IModelApp.localization has not been setup. Returning blank string.`);\r\n return \"\";\r\n }\r\n return IModelApp.localization.getLocalizedStringWithNamespace(UiIModelComponents.localizationNamespace, key);\r\n }\r\n\r\n /** @internal */\r\n public static loggerCategory(obj: any): string {\r\n const className = getClassName(obj);\r\n const category = UiIModelComponents.packageName + (className ? `.${className}` : \"\");\r\n return category;\r\n }\r\n\r\n}\r\n"]}
1
+ {"version":3,"file":"UiIModelComponents.js","sourceRoot":"","sources":["../../../src/imodel-components-react/UiIModelComponents.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,iCAAsC;AACtC,sDAA6C;AAC7C,wDAAiD;AACjD,0DAAqD;AACrD,8DAAuD;AACvD,oDAAuD;AAEvD;;;GAGG;AACH,MAAa,kBAAkB;IAG7B;;OAEG;IACI,MAAM,CAAC,KAAK,CAAC,UAAU;;QAC5B,IAAI,kBAAkB,CAAC,YAAY,EAAE;YACnC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CAAC,kBAAkB,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,+EAA+E,CAAC,CAAC;YAC1I,OAAO,EAAE,CAAC;SACX;QACD,OAAO,yBAAS,CAAC,YAAY,CAAC,kBAAkB,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,kBAAkB,CAAC,qBAAqB,EAAE,CAAC,CAAC;IAC1G,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,cAAc,CAAC,GAAQ;QACnC,MAAM,SAAS,GAAG,IAAA,6BAAY,EAAC,GAAG,CAAC,CAAC;QACpC,MAAM,QAAQ,GAAG,kBAAkB,CAAC,WAAW,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACrF,OAAO,QAAQ,CAAC;IAClB,CAAC;;AA/DH,gDAiEC;AAhEgB,+BAAY,GAAG,KAAK,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Common\r\n */\r\n\r\nimport { enablePatches } from \"immer\";\r\nimport { Logger } from \"@itwin/core-bentley\";\r\nimport { IModelApp } from \"@itwin/core-frontend\";\r\nimport { getClassName } from \"@itwin/appui-abstract\";\r\nimport { UiComponents } from \"@itwin/components-react\";\r\nimport { EmptyLocalization } from \"@itwin/core-common\";\r\n\r\n/**\r\n * Manages the localization service for the imodel-components-react package.\r\n * @public\r\n */\r\nexport class UiIModelComponents {\r\n private static _initialized = false;\r\n\r\n /**\r\n * initialize UiIModelComponents.\r\n */\r\n public static async initialize(): Promise<void> {\r\n if (UiIModelComponents._initialized) {\r\n Logger.logInfo(UiIModelComponents.loggerCategory(UiIModelComponents), `UiIModelComponents.initialize already called`);\r\n return;\r\n }\r\n\r\n enablePatches();\r\n await IModelApp.localization?.registerNamespace(UiIModelComponents.localizationNamespace);\r\n\r\n if (!IModelApp.localization) {\r\n // it should only get here in unit test where IModelApp is not setup\r\n const localization = new EmptyLocalization();\r\n await localization.initialize();\r\n await UiComponents.initialize(localization);\r\n } else {\r\n await UiComponents.initialize(IModelApp.localization);\r\n }\r\n\r\n UiIModelComponents._initialized = true;\r\n }\r\n\r\n /** Unregisters the UiIModelComponents localization namespace */\r\n public static terminate() {\r\n IModelApp.localization?.unregisterNamespace(UiIModelComponents.localizationNamespace);\r\n UiComponents.terminate();\r\n UiIModelComponents._initialized = false;\r\n }\r\n\r\n /** Determines if UiIModelComponents has been initialized */\r\n public static get initialized(): boolean { return UiIModelComponents._initialized; }\r\n\r\n /** The internationalization service namespace. */\r\n public static get localizationNamespace(): string {\r\n return \"UiIModelComponents\";\r\n }\r\n\r\n /** @internal */\r\n public static get packageName(): string {\r\n return \"imodel-components-react\";\r\n }\r\n\r\n /** Calls localization.getLocalizedString with the \"UiIModelComponents\" namespace. Do NOT include the namespace in the key.\r\n * @internal\r\n */\r\n public static translate(key: string | string[]): string {\r\n if (!UiIModelComponents.initialized || /* istanbul ignore next */ !IModelApp.localization) {\r\n Logger.logError(UiIModelComponents.loggerCategory(this), `translate: IModelApp.localization has not been setup. Returning blank string.`);\r\n return \"\";\r\n }\r\n return IModelApp.localization.getLocalizedString(key, { ns: UiIModelComponents.localizationNamespace });\r\n }\r\n\r\n /** @internal */\r\n public static loggerCategory(obj: any): string {\r\n const className = getClassName(obj);\r\n const category = UiIModelComponents.packageName + (className ? `.${className}` : \"\");\r\n return category;\r\n }\r\n\r\n}\r\n"]}
@@ -19,7 +19,7 @@ export declare class UiIModelComponents {
19
19
  static get localizationNamespace(): string;
20
20
  /** @internal */
21
21
  static get packageName(): string;
22
- /** Calls localization.getLocalizedStringWithNamespace with the "UiIModelComponents" namespace. Do NOT include the namespace in the key.
22
+ /** Calls localization.getLocalizedString with the "UiIModelComponents" namespace. Do NOT include the namespace in the key.
23
23
  * @internal
24
24
  */
25
25
  static translate(key: string | string[]): string;
@@ -55,7 +55,7 @@ export class UiIModelComponents {
55
55
  static get packageName() {
56
56
  return "imodel-components-react";
57
57
  }
58
- /** Calls localization.getLocalizedStringWithNamespace with the "UiIModelComponents" namespace. Do NOT include the namespace in the key.
58
+ /** Calls localization.getLocalizedString with the "UiIModelComponents" namespace. Do NOT include the namespace in the key.
59
59
  * @internal
60
60
  */
61
61
  static translate(key) {
@@ -63,7 +63,7 @@ export class UiIModelComponents {
63
63
  Logger.logError(UiIModelComponents.loggerCategory(this), `translate: IModelApp.localization has not been setup. Returning blank string.`);
64
64
  return "";
65
65
  }
66
- return IModelApp.localization.getLocalizedStringWithNamespace(UiIModelComponents.localizationNamespace, key);
66
+ return IModelApp.localization.getLocalizedString(key, { ns: UiIModelComponents.localizationNamespace });
67
67
  }
68
68
  /** @internal */
69
69
  static loggerCategory(obj) {
@@ -1 +1 @@
1
- {"version":3,"file":"UiIModelComponents.js","sourceRoot":"","sources":["../../../src/imodel-components-react/UiIModelComponents.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;GAGG;AACH,MAAM,OAAO,kBAAkB;IAG7B;;OAEG;IACI,MAAM,CAAC,KAAK,CAAC,UAAU;;QAC5B,IAAI,kBAAkB,CAAC,YAAY,EAAE;YACnC,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC,cAAc,CAAC,kBAAkB,CAAC,EAAE,8CAA8C,CAAC,CAAC;YACtH,OAAO;SACR;QAED,a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,+BAA+B,CAAC,kBAAkB,CAAC,qBAAqB,EAAE,GAAG,CAAC,CAAC;IAC/G,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,cAAc,CAAC,GAAQ;QACnC,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;QACpC,MAAM,QAAQ,GAAG,kBAAkB,CAAC,WAAW,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACrF,OAAO,QAAQ,CAAC;IAClB,CAAC;;AA9Dc,+BAAY,GAAG,KAAK,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Common\r\n */\r\n\r\nimport { enablePatches } from \"immer\";\r\nimport { Logger } from \"@itwin/core-bentley\";\r\nimport { IModelApp } from \"@itwin/core-frontend\";\r\nimport { getClassName } from \"@itwin/appui-abstract\";\r\nimport { UiComponents } from \"@itwin/components-react\";\r\nimport { EmptyLocalization } from \"@itwin/core-common\";\r\n\r\n/**\r\n * Manages the localization service for the imodel-components-react package.\r\n * @public\r\n */\r\nexport class UiIModelComponents {\r\n private static _initialized = false;\r\n\r\n /**\r\n * initialize UiIModelComponents.\r\n */\r\n public static async initialize(): Promise<void> {\r\n if (UiIModelComponents._initialized) {\r\n Logger.logInfo(UiIModelComponents.loggerCategory(UiIModelComponents), `UiIModelComponents.initialize already called`);\r\n return;\r\n }\r\n\r\n enablePatches();\r\n await IModelApp.localization?.registerNamespace(UiIModelComponents.localizationNamespace);\r\n\r\n if (!IModelApp.localization) {\r\n // it should only get here in unit test where IModelApp is not setup\r\n const localization = new EmptyLocalization();\r\n await localization.initialize();\r\n await UiComponents.initialize(localization);\r\n } else {\r\n await UiComponents.initialize(IModelApp.localization);\r\n }\r\n\r\n UiIModelComponents._initialized = true;\r\n }\r\n\r\n /** Unregisters the UiIModelComponents localization namespace */\r\n public static terminate() {\r\n IModelApp.localization?.unregisterNamespace(UiIModelComponents.localizationNamespace);\r\n UiComponents.terminate();\r\n UiIModelComponents._initialized = false;\r\n }\r\n\r\n /** Determines if UiIModelComponents has been initialized */\r\n public static get initialized(): boolean { return UiIModelComponents._initialized; }\r\n\r\n /** The internationalization service namespace. */\r\n public static get localizationNamespace(): string {\r\n return \"UiIModelComponents\";\r\n }\r\n\r\n /** @internal */\r\n public static get packageName(): string {\r\n return \"imodel-components-react\";\r\n }\r\n\r\n /** Calls localization.getLocalizedStringWithNamespace with the \"UiIModelComponents\" namespace. Do NOT include the namespace in the key.\r\n * @internal\r\n */\r\n public static translate(key: string | string[]): string {\r\n if (!UiIModelComponents.initialized || /* istanbul ignore next */ !IModelApp.localization) {\r\n Logger.logError(UiIModelComponents.loggerCategory(this), `translate: IModelApp.localization has not been setup. Returning blank string.`);\r\n return \"\";\r\n }\r\n return IModelApp.localization.getLocalizedStringWithNamespace(UiIModelComponents.localizationNamespace, key);\r\n }\r\n\r\n /** @internal */\r\n public static loggerCategory(obj: any): string {\r\n const className = getClassName(obj);\r\n const category = UiIModelComponents.packageName + (className ? `.${className}` : \"\");\r\n return category;\r\n }\r\n\r\n}\r\n"]}
1
+ {"version":3,"file":"UiIModelComponents.js","sourceRoot":"","sources":["../../../src/imodel-components-react/UiIModelComponents.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oB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CAAC,GAAsB;QAC5C,IAAI,CAAC,kBAAkB,CAAC,WAAW,IAAI,0BAA0B,CAAC,CAAC,SAAS,CAAC,YAAY,EAAE;YACzF,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,+EAA+E,CAAC,CAAC;YAC1I,OAAO,EAAE,CAAC;SACX;QACD,OAAO,SAAS,CAAC,YAAY,CAAC,kBAAkB,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,kBAAkB,CAAC,qBAAqB,EAAE,CAAC,CAAC;IAC1G,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,cAAc,CAAC,GAAQ;QACnC,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;QACpC,MAAM,QAAQ,GAAG,kBAAkB,CAAC,WAAW,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACrF,OAAO,QAAQ,CAAC;IAClB,CAAC;;AA9Dc,+BAAY,GAAG,KAAK,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Common\r\n */\r\n\r\nimport { enablePatches } from \"immer\";\r\nimport { Logger } from \"@itwin/core-bentley\";\r\nimport { IModelApp } from \"@itwin/core-frontend\";\r\nimport { getClassName } from \"@itwin/appui-abstract\";\r\nimport { UiComponents } from \"@itwin/components-react\";\r\nimport { EmptyLocalization } from \"@itwin/core-common\";\r\n\r\n/**\r\n * Manages the localization service for the imodel-components-react package.\r\n * @public\r\n */\r\nexport class UiIModelComponents {\r\n private static _initialized = false;\r\n\r\n /**\r\n * initialize UiIModelComponents.\r\n */\r\n public static async initialize(): Promise<void> {\r\n if (UiIModelComponents._initialized) {\r\n Logger.logInfo(UiIModelComponents.loggerCategory(UiIModelComponents), `UiIModelComponents.initialize already called`);\r\n return;\r\n }\r\n\r\n enablePatches();\r\n await IModelApp.localization?.registerNamespace(UiIModelComponents.localizationNamespace);\r\n\r\n if (!IModelApp.localization) {\r\n // it should only get here in unit test where IModelApp is not setup\r\n const localization = new EmptyLocalization();\r\n await localization.initialize();\r\n await UiComponents.initialize(localization);\r\n } else {\r\n await UiComponents.initialize(IModelApp.localization);\r\n }\r\n\r\n UiIModelComponents._initialized = true;\r\n }\r\n\r\n /** Unregisters the UiIModelComponents localization namespace */\r\n public static terminate() {\r\n IModelApp.localization?.unregisterNamespace(UiIModelComponents.localizationNamespace);\r\n UiComponents.terminate();\r\n UiIModelComponents._initialized = false;\r\n }\r\n\r\n /** Determines if UiIModelComponents has been initialized */\r\n public static get initialized(): boolean { return UiIModelComponents._initialized; }\r\n\r\n /** The internationalization service namespace. */\r\n public static get localizationNamespace(): string {\r\n return \"UiIModelComponents\";\r\n }\r\n\r\n /** @internal */\r\n public static get packageName(): string {\r\n return \"imodel-components-react\";\r\n }\r\n\r\n /** Calls localization.getLocalizedString with the \"UiIModelComponents\" namespace. Do NOT include the namespace in the key.\r\n * @internal\r\n */\r\n public static translate(key: string | string[]): string {\r\n if (!UiIModelComponents.initialized || /* istanbul ignore next */ !IModelApp.localization) {\r\n Logger.logError(UiIModelComponents.loggerCategory(this), `translate: IModelApp.localization has not been setup. Returning blank string.`);\r\n return \"\";\r\n }\r\n return IModelApp.localization.getLocalizedString(key, { ns: UiIModelComponents.localizationNamespace });\r\n }\r\n\r\n /** @internal */\r\n public static loggerCategory(obj: any): string {\r\n const className = getClassName(obj);\r\n const category = UiIModelComponents.packageName + (className ? `.${className}` : \"\");\r\n return category;\r\n }\r\n\r\n}\r\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/imodel-components-react",
3
- "version": "3.5.0-dev.8",
3
+ "version": "3.6.0-dev.1",
4
4
  "description": "iTwin.js UI IModel Components",
5
5
  "main": "lib/cjs/imodel-components-react.js",
6
6
  "module": "lib/esm/imodel-components-react.js",
@@ -20,14 +20,14 @@
20
20
  "url": "http://www.bentley.com"
21
21
  },
22
22
  "peerDependencies": {
23
- "@itwin/appui-abstract": "^3.5.0-dev.8",
24
- "@itwin/components-react": "^3.5.0-dev.8",
25
- "@itwin/core-bentley": "^3.5.0-dev.8",
26
- "@itwin/core-common": "^3.5.0-dev.8",
27
- "@itwin/core-frontend": "^3.5.0-dev.8",
28
- "@itwin/core-geometry": "^3.5.0-dev.8",
29
- "@itwin/core-quantity": "^3.5.0-dev.8",
30
- "@itwin/core-react": "^3.5.0-dev.8",
23
+ "@itwin/appui-abstract": "^3.6.0-dev.1",
24
+ "@itwin/components-react": "^3.6.0-dev.1",
25
+ "@itwin/core-bentley": "^3.6.0-dev.1",
26
+ "@itwin/core-common": "^3.6.0-dev.1",
27
+ "@itwin/core-frontend": "^3.6.0-dev.1",
28
+ "@itwin/core-geometry": "^3.6.0-dev.1",
29
+ "@itwin/core-quantity": "^3.6.0-dev.1",
30
+ "@itwin/core-react": "^3.6.0-dev.1",
31
31
  "react": "^17.0.0",
32
32
  "react-dom": "^17.0.0"
33
33
  },
@@ -36,16 +36,16 @@
36
36
  "NOTE: All tools used by scripts in this package must be listed as devDependencies"
37
37
  ],
38
38
  "devDependencies": {
39
- "@itwin/appui-abstract": "3.5.0-dev.8",
40
- "@itwin/build-tools": "3.5.0-dev.8",
41
- "@itwin/components-react": "3.5.0-dev.8",
42
- "@itwin/core-bentley": "3.5.0-dev.8",
43
- "@itwin/core-common": "3.5.0-dev.8",
44
- "@itwin/core-frontend": "3.5.0-dev.8",
45
- "@itwin/core-geometry": "3.5.0-dev.8",
46
- "@itwin/core-quantity": "3.5.0-dev.8",
47
- "@itwin/core-react": "3.5.0-dev.8",
48
- "@itwin/eslint-plugin": "3.5.0-dev.8",
39
+ "@itwin/appui-abstract": "3.6.0-dev.1",
40
+ "@itwin/build-tools": "3.6.0-dev.1",
41
+ "@itwin/components-react": "3.6.0-dev.1",
42
+ "@itwin/core-bentley": "3.6.0-dev.1",
43
+ "@itwin/core-common": "3.6.0-dev.1",
44
+ "@itwin/core-frontend": "3.6.0-dev.1",
45
+ "@itwin/core-geometry": "3.6.0-dev.1",
46
+ "@itwin/core-quantity": "3.6.0-dev.1",
47
+ "@itwin/core-react": "3.6.0-dev.1",
48
+ "@itwin/eslint-plugin": "3.6.0-dev.1",
49
49
  "@testing-library/dom": "^8.11.2",
50
50
  "@testing-library/react": "^12.0.0",
51
51
  "@testing-library/react-hooks": "^7.0.2",
@@ -59,7 +59,7 @@
59
59
  "@types/faker": "^4.1.0",
60
60
  "@types/lodash": "^4.14.0",
61
61
  "@types/mocha": "^8.2.2",
62
- "@types/node": "16.11.59",
62
+ "@types/node": "18.11.5",
63
63
  "@types/react": "^17.0.37",
64
64
  "@types/react-dom": "^17.0.0",
65
65
  "@types/sinon": "^9.0.0",