@itwin/presentation-frontend 5.0.0-dev.9 → 5.0.0-dev.90
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 +53 -1
- package/lib/cjs/presentation-frontend/ConnectivityInformationProvider.d.ts +3 -3
- package/lib/cjs/presentation-frontend/ConnectivityInformationProvider.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/ConnectivityInformationProvider.js +11 -9
- package/lib/cjs/presentation-frontend/ConnectivityInformationProvider.js.map +1 -1
- package/lib/cjs/presentation-frontend/Diagnostics.js.map +1 -1
- package/lib/cjs/presentation-frontend/FrontendLoggerCategory.js.map +1 -1
- package/lib/cjs/presentation-frontend/IpcRequestsHandler.js +2 -1
- package/lib/cjs/presentation-frontend/IpcRequestsHandler.js.map +1 -1
- package/lib/cjs/presentation-frontend/LocalizationHelper.js +1 -0
- package/lib/cjs/presentation-frontend/LocalizationHelper.js.map +1 -1
- package/lib/cjs/presentation-frontend/Presentation.d.ts +12 -2
- package/lib/cjs/presentation-frontend/Presentation.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/Presentation.js +16 -7
- package/lib/cjs/presentation-frontend/Presentation.js.map +1 -1
- package/lib/cjs/presentation-frontend/PresentationManager.d.ts +4 -2
- package/lib/cjs/presentation-frontend/PresentationManager.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/PresentationManager.js +31 -21
- package/lib/cjs/presentation-frontend/PresentationManager.js.map +1 -1
- package/lib/cjs/presentation-frontend/RulesetManager.js +2 -4
- package/lib/cjs/presentation-frontend/RulesetManager.js.map +1 -1
- package/lib/cjs/presentation-frontend/RulesetVariablesManager.js +4 -2
- package/lib/cjs/presentation-frontend/RulesetVariablesManager.js.map +1 -1
- package/lib/cjs/presentation-frontend/StreamedResponseGenerator.js +1 -0
- package/lib/cjs/presentation-frontend/StreamedResponseGenerator.js.map +1 -1
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts +4 -2
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.js +142 -126
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.js.map +1 -1
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesStorage.d.ts +2 -3
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesStorage.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js +21 -19
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js.map +1 -1
- package/lib/cjs/presentation-frontend/selection/HiliteSetProvider.d.ts +3 -0
- package/lib/cjs/presentation-frontend/selection/HiliteSetProvider.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/selection/HiliteSetProvider.js +4 -0
- package/lib/cjs/presentation-frontend/selection/HiliteSetProvider.js.map +1 -1
- package/lib/cjs/presentation-frontend/selection/ISelectionProvider.d.ts +1 -0
- package/lib/cjs/presentation-frontend/selection/ISelectionProvider.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/selection/ISelectionProvider.js +1 -0
- package/lib/cjs/presentation-frontend/selection/ISelectionProvider.js.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionChangeEvent.d.ts +4 -0
- package/lib/cjs/presentation-frontend/selection/SelectionChangeEvent.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionChangeEvent.js +3 -0
- package/lib/cjs/presentation-frontend/selection/SelectionChangeEvent.js.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionHandler.d.ts +5 -2
- package/lib/cjs/presentation-frontend/selection/SelectionHandler.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionHandler.js +35 -13
- package/lib/cjs/presentation-frontend/selection/SelectionHandler.js.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionHelper.d.ts +2 -0
- package/lib/cjs/presentation-frontend/selection/SelectionHelper.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionHelper.js +2 -0
- package/lib/cjs/presentation-frontend/selection/SelectionHelper.js.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionManager.d.ts +27 -7
- package/lib/cjs/presentation-frontend/selection/SelectionManager.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionManager.js +192 -87
- package/lib/cjs/presentation-frontend/selection/SelectionManager.js.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionScopesManager.d.ts +3 -7
- package/lib/cjs/presentation-frontend/selection/SelectionScopesManager.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionScopesManager.js +6 -11
- package/lib/cjs/presentation-frontend/selection/SelectionScopesManager.js.map +1 -1
- package/lib/cjs/presentation-frontend.js.map +1 -1
- package/lib/esm/presentation-frontend/ConnectivityInformationProvider.d.ts +3 -3
- package/lib/esm/presentation-frontend/ConnectivityInformationProvider.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/ConnectivityInformationProvider.js +11 -9
- package/lib/esm/presentation-frontend/ConnectivityInformationProvider.js.map +1 -1
- package/lib/esm/presentation-frontend/Diagnostics.js.map +1 -1
- package/lib/esm/presentation-frontend/FrontendLoggerCategory.js.map +1 -1
- package/lib/esm/presentation-frontend/IpcRequestsHandler.js +2 -1
- package/lib/esm/presentation-frontend/IpcRequestsHandler.js.map +1 -1
- package/lib/esm/presentation-frontend/LocalizationHelper.js +1 -0
- package/lib/esm/presentation-frontend/LocalizationHelper.js.map +1 -1
- package/lib/esm/presentation-frontend/Presentation.d.ts +12 -2
- package/lib/esm/presentation-frontend/Presentation.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/Presentation.js +16 -7
- package/lib/esm/presentation-frontend/Presentation.js.map +1 -1
- package/lib/esm/presentation-frontend/PresentationManager.d.ts +4 -2
- package/lib/esm/presentation-frontend/PresentationManager.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/PresentationManager.js +32 -22
- package/lib/esm/presentation-frontend/PresentationManager.js.map +1 -1
- package/lib/esm/presentation-frontend/RulesetManager.js +2 -4
- package/lib/esm/presentation-frontend/RulesetManager.js.map +1 -1
- package/lib/esm/presentation-frontend/RulesetVariablesManager.js +4 -2
- package/lib/esm/presentation-frontend/RulesetVariablesManager.js.map +1 -1
- package/lib/esm/presentation-frontend/StreamedResponseGenerator.js +1 -0
- package/lib/esm/presentation-frontend/StreamedResponseGenerator.js.map +1 -1
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts +4 -2
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.js +143 -127
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.js.map +1 -1
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesStorage.d.ts +2 -3
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesStorage.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js +22 -20
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js.map +1 -1
- package/lib/esm/presentation-frontend/selection/HiliteSetProvider.d.ts +3 -0
- package/lib/esm/presentation-frontend/selection/HiliteSetProvider.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/selection/HiliteSetProvider.js +4 -0
- package/lib/esm/presentation-frontend/selection/HiliteSetProvider.js.map +1 -1
- package/lib/esm/presentation-frontend/selection/ISelectionProvider.d.ts +1 -0
- package/lib/esm/presentation-frontend/selection/ISelectionProvider.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/selection/ISelectionProvider.js +1 -0
- package/lib/esm/presentation-frontend/selection/ISelectionProvider.js.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionChangeEvent.d.ts +4 -0
- package/lib/esm/presentation-frontend/selection/SelectionChangeEvent.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionChangeEvent.js +3 -0
- package/lib/esm/presentation-frontend/selection/SelectionChangeEvent.js.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionHandler.d.ts +5 -2
- package/lib/esm/presentation-frontend/selection/SelectionHandler.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionHandler.js +35 -13
- package/lib/esm/presentation-frontend/selection/SelectionHandler.js.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionHelper.d.ts +2 -0
- package/lib/esm/presentation-frontend/selection/SelectionHelper.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionHelper.js +2 -0
- package/lib/esm/presentation-frontend/selection/SelectionHelper.js.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionManager.d.ts +27 -7
- package/lib/esm/presentation-frontend/selection/SelectionManager.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionManager.js +193 -88
- package/lib/esm/presentation-frontend/selection/SelectionManager.js.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionScopesManager.d.ts +3 -7
- package/lib/esm/presentation-frontend/selection/SelectionScopesManager.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionScopesManager.js +6 -10
- package/lib/esm/presentation-frontend/selection/SelectionScopesManager.js.map +1 -1
- package/lib/esm/presentation-frontend.js.map +1 -1
- package/package.json +25 -26
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,58 @@
|
|
|
1
1
|
# Change Log - @itwin/presentation-frontend
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Wed, 19 Mar 2025 15:33:24 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 4.10.11
|
|
6
|
+
Wed, 19 Mar 2025 15:30:39 GMT
|
|
7
|
+
|
|
8
|
+
_Version update only_
|
|
9
|
+
|
|
10
|
+
## 4.10.10
|
|
11
|
+
Tue, 11 Mar 2025 15:25:11 GMT
|
|
12
|
+
|
|
13
|
+
_Version update only_
|
|
14
|
+
|
|
15
|
+
## 4.10.9
|
|
16
|
+
Tue, 11 Mar 2025 05:17:33 GMT
|
|
17
|
+
|
|
18
|
+
_Version update only_
|
|
19
|
+
|
|
20
|
+
## 4.10.8
|
|
21
|
+
Thu, 06 Mar 2025 14:13:37 GMT
|
|
22
|
+
|
|
23
|
+
_Version update only_
|
|
24
|
+
|
|
25
|
+
## 4.10.7
|
|
26
|
+
Tue, 18 Feb 2025 17:27:03 GMT
|
|
27
|
+
|
|
28
|
+
### Updates
|
|
29
|
+
|
|
30
|
+
- Fix selection changes not being handled when using multiple connections to the same iModel
|
|
31
|
+
|
|
32
|
+
## 4.10.6
|
|
33
|
+
Fri, 24 Jan 2025 08:02:40 GMT
|
|
34
|
+
|
|
35
|
+
_Version update only_
|
|
36
|
+
|
|
37
|
+
## 4.10.5
|
|
38
|
+
Tue, 21 Jan 2025 21:56:45 GMT
|
|
39
|
+
|
|
40
|
+
_Version update only_
|
|
41
|
+
|
|
42
|
+
## 4.10.4
|
|
43
|
+
Mon, 13 Jan 2025 14:06:43 GMT
|
|
44
|
+
|
|
45
|
+
_Version update only_
|
|
46
|
+
|
|
47
|
+
## 4.10.3
|
|
48
|
+
Mon, 06 Jan 2025 14:00:13 GMT
|
|
49
|
+
|
|
50
|
+
_Version update only_
|
|
51
|
+
|
|
52
|
+
## 4.10.2
|
|
53
|
+
Thu, 21 Nov 2024 15:22:20 GMT
|
|
54
|
+
|
|
55
|
+
_Version update only_
|
|
4
56
|
|
|
5
57
|
## 4.10.1
|
|
6
58
|
Thu, 14 Nov 2024 18:11:00 GMT
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module Core
|
|
3
3
|
*/
|
|
4
|
-
import { BeEvent
|
|
4
|
+
import { BeEvent } from "@itwin/core-bentley";
|
|
5
5
|
import { InternetConnectivityStatus } from "@itwin/core-common";
|
|
6
6
|
/** @internal */
|
|
7
7
|
export interface IConnectivityInformationProvider {
|
|
@@ -16,14 +16,14 @@ export interface IConnectivityInformationProvider {
|
|
|
16
16
|
*
|
|
17
17
|
* @internal
|
|
18
18
|
*/
|
|
19
|
-
export declare class ConnectivityInformationProvider implements IConnectivityInformationProvider,
|
|
19
|
+
export declare class ConnectivityInformationProvider implements IConnectivityInformationProvider, Disposable {
|
|
20
20
|
private _currentStatus?;
|
|
21
21
|
private _unsubscribeFromInternetConnectivityChangedEvent?;
|
|
22
22
|
readonly onInternetConnectivityChanged: BeEvent<(args: {
|
|
23
23
|
status: InternetConnectivityStatus;
|
|
24
24
|
}) => void>;
|
|
25
25
|
constructor();
|
|
26
|
-
dispose(): void;
|
|
26
|
+
[Symbol.dispose](): void;
|
|
27
27
|
private onNativeAppInternetConnectivityChanged;
|
|
28
28
|
get status(): InternetConnectivityStatus;
|
|
29
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectivityInformationProvider.d.ts","sourceRoot":"","sources":["../../../src/presentation-frontend/ConnectivityInformationProvider.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ConnectivityInformationProvider.d.ts","sourceRoot":"","sources":["../../../src/presentation-frontend/ConnectivityInformationProvider.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAGhE,gBAAgB;AAChB,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,MAAM,EAAE,0BAA0B,CAAC;IAC5C,QAAQ,CAAC,6BAA6B,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,0BAA0B,CAAA;KAAE,KAAK,IAAI,CAAC,CAAC;CACzG;AAED;;;;;GAKG;AACH,qBAAa,+BAAgC,YAAW,gCAAgC,EAAE,UAAU;IAClG,OAAO,CAAC,cAAc,CAAC,CAA6B;IACpD,OAAO,CAAC,gDAAgD,CAAC,CAAa;IACtE,SAAgB,6BAA6B,iBAAsB;QAAE,MAAM,EAAE,0BAA0B,CAAA;KAAE,KAAK,IAAI,EAAI;;IAgB/G,CAAC,MAAM,CAAC,OAAO,CAAC;IAIvB,OAAO,CAAC,sCAAsC,CAO5C;IAEF,IAAW,MAAM,IAAI,0BAA0B,CAE9C;CACF"}
|
|
@@ -18,15 +18,10 @@ const core_frontend_1 = require("@itwin/core-frontend");
|
|
|
18
18
|
* @internal
|
|
19
19
|
*/
|
|
20
20
|
class ConnectivityInformationProvider {
|
|
21
|
+
_currentStatus;
|
|
22
|
+
_unsubscribeFromInternetConnectivityChangedEvent;
|
|
23
|
+
onInternetConnectivityChanged = new core_bentley_1.BeEvent();
|
|
21
24
|
constructor() {
|
|
22
|
-
this.onInternetConnectivityChanged = new core_bentley_1.BeEvent();
|
|
23
|
-
this.onNativeAppInternetConnectivityChanged = (status) => {
|
|
24
|
-
if (this._currentStatus === status) {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
this._currentStatus = status;
|
|
28
|
-
this.onInternetConnectivityChanged.raiseEvent({ status });
|
|
29
|
-
};
|
|
30
25
|
if (core_frontend_1.NativeApp.isValid) {
|
|
31
26
|
this._unsubscribeFromInternetConnectivityChangedEvent = core_frontend_1.NativeApp.onInternetConnectivityChanged.addListener(this.onNativeAppInternetConnectivityChanged);
|
|
32
27
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
@@ -40,9 +35,16 @@ class ConnectivityInformationProvider {
|
|
|
40
35
|
this._currentStatus = core_common_1.InternetConnectivityStatus.Online;
|
|
41
36
|
}
|
|
42
37
|
}
|
|
43
|
-
dispose() {
|
|
38
|
+
[Symbol.dispose]() {
|
|
44
39
|
this._unsubscribeFromInternetConnectivityChangedEvent && this._unsubscribeFromInternetConnectivityChangedEvent();
|
|
45
40
|
}
|
|
41
|
+
onNativeAppInternetConnectivityChanged = (status) => {
|
|
42
|
+
if (this._currentStatus === status) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
this._currentStatus = status;
|
|
46
|
+
this.onInternetConnectivityChanged.raiseEvent({ status });
|
|
47
|
+
};
|
|
46
48
|
get status() {
|
|
47
49
|
return this._currentStatus ?? core_common_1.InternetConnectivityStatus.Offline;
|
|
48
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectivityInformationProvider.js","sourceRoot":"","sources":["../../../src/presentation-frontend/ConnectivityInformationProvider.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"ConnectivityInformationProvider.js","sourceRoot":"","sources":["../../../src/presentation-frontend/ConnectivityInformationProvider.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,sDAA8C;AAC9C,oDAAgE;AAChE,wDAAiD;AAQjD;;;;;GAKG;AACH,MAAa,+BAA+B;IAClC,cAAc,CAA8B;IAC5C,gDAAgD,CAAc;IACtD,6BAA6B,GAAG,IAAI,sBAAO,EAA0D,CAAC;IAEtH;QACE,IAAI,yBAAS,CAAC,OAAO,EAAE,CAAC;YACtB,IAAI,CAAC,gDAAgD,GAAG,yBAAS,CAAC,6BAA6B,CAAC,WAAW,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;YACzJ,mEAAmE;YACnE,yBAAS,CAAC,yBAAyB,EAAE,CAAC,IAAI,CAAC,CAAC,MAAkC,EAAE,EAAE;gBAChF,IAAI,SAAS,KAAK,IAAI,CAAC,cAAc,EAAE,CAAC;oBACtC,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC;gBAC/B,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,cAAc,GAAG,wCAA0B,CAAC,MAAM,CAAC;QAC1D,CAAC;IACH,CAAC;IAEM,CAAC,MAAM,CAAC,OAAO,CAAC;QACrB,IAAI,CAAC,gDAAgD,IAAI,IAAI,CAAC,gDAAgD,EAAE,CAAC;IACnH,CAAC;IAEO,sCAAsC,GAAG,CAAC,MAAkC,EAAE,EAAE;QACtF,IAAI,IAAI,CAAC,cAAc,KAAK,MAAM,EAAE,CAAC;YACnC,OAAO;QACT,CAAC;QAED,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC;QAC7B,IAAI,CAAC,6BAA6B,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IAC5D,CAAC,CAAC;IAEF,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,cAAc,IAAI,wCAA0B,CAAC,OAAO,CAAC;IACnE,CAAC;CACF;AAnCD,0EAmCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Core\n */\n\nimport { BeEvent } from \"@itwin/core-bentley\";\nimport { InternetConnectivityStatus } from \"@itwin/core-common\";\nimport { NativeApp } from \"@itwin/core-frontend\";\n\n/** @internal */\nexport interface IConnectivityInformationProvider {\n readonly status: InternetConnectivityStatus;\n readonly onInternetConnectivityChanged: BeEvent<(args: { status: InternetConnectivityStatus }) => void>;\n}\n\n/**\n * A helper that wraps connectivity-related APIs in NativeApp\n * to give a unified information for interested parties in presentation.\n *\n * @internal\n */\nexport class ConnectivityInformationProvider implements IConnectivityInformationProvider, Disposable {\n private _currentStatus?: InternetConnectivityStatus;\n private _unsubscribeFromInternetConnectivityChangedEvent?: () => void;\n public readonly onInternetConnectivityChanged = new BeEvent<(args: { status: InternetConnectivityStatus }) => void>();\n\n public constructor() {\n if (NativeApp.isValid) {\n this._unsubscribeFromInternetConnectivityChangedEvent = NativeApp.onInternetConnectivityChanged.addListener(this.onNativeAppInternetConnectivityChanged);\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n NativeApp.checkInternetConnectivity().then((status: InternetConnectivityStatus) => {\n if (undefined === this._currentStatus) {\n this._currentStatus = status;\n }\n });\n } else {\n this._currentStatus = InternetConnectivityStatus.Online;\n }\n }\n\n public [Symbol.dispose]() {\n this._unsubscribeFromInternetConnectivityChangedEvent && this._unsubscribeFromInternetConnectivityChangedEvent();\n }\n\n private onNativeAppInternetConnectivityChanged = (status: InternetConnectivityStatus) => {\n if (this._currentStatus === status) {\n return;\n }\n\n this._currentStatus = status;\n this.onInternetConnectivityChanged.raiseEvent({ status });\n };\n\n public get status(): InternetConnectivityStatus {\n return this._currentStatus ?? InternetConnectivityStatus.Offline;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Diagnostics.js","sourceRoot":"","sources":["../../../src/presentation-frontend/Diagnostics.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;AAeH,8DAcC;AAMD,4EAIC;AArCD,oEAOoC;AAEpC;;;GAGG;AACH,SAAgB,yBAAyB,CAAC,WAA8B;IACtE,sCAAsC;IACtC,WAAW,CAAC,cAAc,IAAI,OAAO,CAAC,GAAG,CAAC,oBAAoB,WAAW,CAAC,cAAc,EAAE,CAAC,CAAC;IAC5F,WAAW,CAAC,IAAI;QACd,oBAAoB,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,GAA0B,EAAE,KAA6B,EAAE,EAAE;YACnG,+FAA+F;YAC/F,MAAM,GAAG,GAAG,qBAAqB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YAC9C,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;gBACxB,iBAAiB,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;YAC9C,CAAC;YACD,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;gBACrB,iBAAiB,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;YAC3C,CAAC;QACH,CAAC,CAAC,CAAC;AACP,CAAC;AAED;;;GAGG;AACH,SAAgB,gCAAgC,CAAC,QAAoC;IACnF,OAAO,CAAC,WAA8B,EAAE,EAAE;QACxC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;IACtD,CAAC,CAAC;AACJ,CAAC;AAID,SAAS,oBAAoB,CAAC,IAA2B,EAAE,cAA4C,EAAE,QAAgC,EAAE;IACzI,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QACnB,IAAI,yCAAmB,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC;YACvC,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC7B,CAAC;aAAM,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;YACpB,oBAAoB,CAAC,GAAG,CAAC,IAAI,EAAE,cAAc,EAAE,CAAC,GAAG,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;QAClE,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,qBAAqB,CAAC,GAA0B,EAAE,MAA8B;IACvF,OAAO,GAAG,CAAC,OAAO,CAAC;AACrB,CAAC;AAED,SAAS,iBAAiB,CAAC,QAAmC;IAC5D,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,OAAO;YACV,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,iCAAiC;QACzD,KAAK,SAAS;YACZ,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,iCAAiC;QACxD,KAAK,MAAM,CAAC;QACZ,KAAK,OAAO,CAAC;QACb,KAAK,OAAO;YACV,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,iCAAiC;IACzD,CAAC;AACH,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"Diagnostics.js","sourceRoot":"","sources":["../../../src/presentation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AAC;QAC7B,CAAC;aAAM,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;YACpB,oBAAoB,CAAC,GAAG,CAAC,IAAI,EAAE,cAAc,EAAE,CAAC,GAAG,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;QAClE,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,qBAAqB,CAAC,GAA0B,EAAE,MAA8B;IACvF,OAAO,GAAG,CAAC,OAAO,CAAC;AACrB,CAAC;AAED,SAAS,iBAAiB,CAAC,QAAmC;IAC5D,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,OAAO;YACV,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,iCAAiC;QACzD,KAAK,SAAS;YACZ,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,iCAAiC;QACxD,KAAK,MAAM,CAAC;QACZ,KAAK,OAAO,CAAC;QACb,KAAK,OAAO;YACV,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,iCAAiC;IACzD,CAAC;AACH,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Core\n */\n\nimport {\n ClientDiagnostics,\n ClientDiagnosticsHandler,\n DiagnosticsLogEntry,\n DiagnosticsLoggerSeverity,\n DiagnosticsLogMessage,\n DiagnosticsScopeLogs,\n} from \"@itwin/presentation-common\";\n\n/**\n * A function which logs messages to the console.\n * @public\n */\nexport function consoleDiagnosticsHandler(diagnostics: ClientDiagnostics) {\n // eslint-disable-next-line no-console\n diagnostics.backendVersion && console.log(`Backend version: ${diagnostics.backendVersion}`);\n diagnostics.logs &&\n handleDiagnosticLogs(diagnostics.logs, (msg: DiagnosticsLogMessage, stack: DiagnosticsScopeLogs[]) => {\n /* note: we're duplicating the message if it's logged at both editor and dev severity levels */\n const str = buildLogMessageString(msg, stack);\n if (msg.severity.editor) {\n getConsoleLogFunc(msg.severity.editor)(str);\n }\n if (msg.severity.dev) {\n getConsoleLogFunc(msg.severity.dev)(str);\n }\n });\n}\n\n/**\n * A function which calls all diagnostics handlers passed to it.\n * @public\n */\nexport function createCombinedDiagnosticsHandler(handlers: ClientDiagnosticsHandler[]) {\n return (diagnostics: ClientDiagnostics) => {\n handlers.forEach((handler) => handler(diagnostics));\n };\n}\n\ntype DiagnosticsLogMessageHandler = (msg: DiagnosticsLogMessage, stack: DiagnosticsScopeLogs[]) => void;\n\nfunction handleDiagnosticLogs(logs: DiagnosticsLogEntry[], messageHandler: DiagnosticsLogMessageHandler, stack: DiagnosticsScopeLogs[] = []) {\n logs.forEach((log) => {\n if (DiagnosticsLogEntry.isMessage(log)) {\n messageHandler(log, stack);\n } else if (log.logs) {\n handleDiagnosticLogs(log.logs, messageHandler, [...stack, log]);\n }\n });\n}\n\nfunction buildLogMessageString(msg: DiagnosticsLogMessage, _stack: DiagnosticsScopeLogs[]) {\n return msg.message;\n}\n\nfunction getConsoleLogFunc(severity: DiagnosticsLoggerSeverity) {\n switch (severity) {\n case \"error\":\n return console.error; // eslint-disable-line no-console\n case \"warning\":\n return console.warn; // eslint-disable-line no-console\n case \"info\":\n case \"debug\":\n case \"trace\":\n return console.log; // eslint-disable-line no-console\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FrontendLoggerCategory.js","sourceRoot":"","sources":["../../../src/presentation-frontend/FrontendLoggerCategory.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH;;;;;GAKG;AACH,IAAY,kCAEX;AAFD,WAAY,kCAAkC;IAC5C,uEAAiC,CAAA;AACnC,CAAC,EAFW,kCAAkC,kDAAlC,kCAAkC,QAE7C","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"FrontendLoggerCategory.js","sourceRoot":"","sources":["../../../src/presentation-frontend/FrontendLoggerCategory.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH;;;;;GAKG;AACH,IAAY,kCAEX;AAFD,WAAY,kCAAkC;IAC5C,uEAAiC,CAAA;AACnC,CAAC,EAFW,kCAAkC,kDAAlC,kCAAkC,QAE7C","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Logging\n */\n\n/**\n * Logger categories used by this package\n * @note All logger categories in this package start with the `presentation-frontend` prefix.\n * @see [Logger]($bentley)\n * @public\n */\nexport enum PresentationFrontendLoggerCategory {\n Package = \"presentation-frontend\",\n}\n"]}
|
|
@@ -9,8 +9,9 @@ const core_frontend_1 = require("@itwin/core-frontend");
|
|
|
9
9
|
const presentation_common_1 = require("@itwin/presentation-common");
|
|
10
10
|
/** @internal */
|
|
11
11
|
class IpcRequestsHandler {
|
|
12
|
+
_ipcProxy = core_frontend_1.IpcApp.makeIpcProxy(presentation_common_1.PRESENTATION_IPC_CHANNEL_NAME);
|
|
13
|
+
clientId;
|
|
12
14
|
constructor(clientId) {
|
|
13
|
-
this._ipcProxy = core_frontend_1.IpcApp.makeIpcProxy(presentation_common_1.PRESENTATION_IPC_CHANNEL_NAME);
|
|
14
15
|
this.clientId = clientId;
|
|
15
16
|
}
|
|
16
17
|
async setRulesetVariable(params) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IpcRequestsHandler.js","sourceRoot":"","sources":["../../../src/presentation-frontend/IpcRequestsHandler.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG,wDAA8C;AAC9C,oEAOoC;AAEpC,gBAAgB;AAChB,MAAa,kBAAkB;
|
|
1
|
+
{"version":3,"file":"IpcRequestsHandler.js","sourceRoot":"","sources":["../../../src/presentation-frontend/IpcRequestsHandler.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG,wDAA8C;AAC9C,oEAOoC;AAEpC,gBAAgB;AAChB,MAAa,kBAAkB;IACrB,SAAS,GAAG,sBAAM,CAAC,YAAY,CAA2B,mDAA6B,CAAC,CAAC;IACjF,QAAQ,CAAS;IAEjC,YAAY,QAAgB;QAC1B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAEM,KAAK,CAAC,kBAAkB,CAAC,MAAmE;QACjG,MAAM,UAAU,GAAkD;YAChE,GAAG,MAAM;YACT,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,QAAQ,EAAE,qCAAe,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;SAClD,CAAC;QACF,OAAO,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC;IACvD,CAAC;IAEM,KAAK,CAAC,oBAAoB,CAAC,MAAoD;QACpF,MAAM,UAAU,GAA+B;YAC7C,GAAG,MAAM;YACT,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC;QACF,OAAO,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC;IACzD,CAAC;CACF;AAxBD,gDAwBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IpcApp } from \"@itwin/core-frontend\";\nimport {\n PRESENTATION_IPC_CHANNEL_NAME,\n PresentationIpcInterface,\n RulesetVariable,\n RulesetVariableJSON,\n SetRulesetVariableParams,\n UnsetRulesetVariableParams,\n} from \"@itwin/presentation-common\";\n\n/** @internal */\nexport class IpcRequestsHandler {\n private _ipcProxy = IpcApp.makeIpcProxy<PresentationIpcInterface>(PRESENTATION_IPC_CHANNEL_NAME);\n public readonly clientId: string;\n\n constructor(clientId: string) {\n this.clientId = clientId;\n }\n\n public async setRulesetVariable(params: Omit<SetRulesetVariableParams<RulesetVariable>, \"clientId\">) {\n const jsonParams: SetRulesetVariableParams<RulesetVariableJSON> = {\n ...params,\n clientId: this.clientId,\n variable: RulesetVariable.toJSON(params.variable),\n };\n return this._ipcProxy.setRulesetVariable(jsonParams);\n }\n\n public async unsetRulesetVariable(params: Omit<UnsetRulesetVariableParams, \"clientId\">) {\n const jsonParams: UnsetRulesetVariableParams = {\n ...params,\n clientId: this.clientId,\n };\n return this._ipcProxy.unsetRulesetVariable(jsonParams);\n }\n}\n"]}
|
|
@@ -10,6 +10,7 @@ const Presentation_1 = require("./Presentation");
|
|
|
10
10
|
const NAMESPACES = ["Presentation"];
|
|
11
11
|
/** @internal */
|
|
12
12
|
class FrontendLocalizationHelper extends presentation_common_1.LocalizationHelper {
|
|
13
|
+
_lang;
|
|
13
14
|
constructor(lang) {
|
|
14
15
|
super({ getLocalizedString: (key) => Presentation_1.Presentation.localization.getLocalizedString(key, { defaultValue: key, lng: this._lang }) });
|
|
15
16
|
this._lang = lang;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalizationHelper.js","sourceRoot":"","sources":["../../../src/presentation-frontend/LocalizationHelper.ts"],"names":[],"mappings":";;;AAAA;;;gGAGgG;AAChG,oEAAgE;AAChE,iDAA8C;AAE9C,MAAM,UAAU,GAAG,CAAC,cAAc,CAAC,CAAC;AAEpC,gBAAgB;AAChB,MAAa,0BAA2B,SAAQ,wCAAkB;
|
|
1
|
+
{"version":3,"file":"LocalizationHelper.js","sourceRoot":"","sources":["../../../src/presentation-frontend/LocalizationHelper.ts"],"names":[],"mappings":";;;AAAA;;;gGAGgG;AAChG,oEAAgE;AAChE,iDAA8C;AAE9C,MAAM,UAAU,GAAG,CAAC,cAAc,CAAC,CAAC;AAEpC,gBAAgB;AAChB,MAAa,0BAA2B,SAAQ,wCAAkB;IACxD,KAAK,CAAqB;IAClC,YAAY,IAAa;QACvB,KAAK,CAAC,EAAE,kBAAkB,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,2BAAY,CAAC,YAAY,CAAC,kBAAkB,CAAC,GAAG,EAAE,EAAE,YAAY,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;QAClI,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IACD,IAAW,MAAM,CAAC,MAA0B;QAC1C,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC;IACtB,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,kBAAkB;QACpC,MAAM,oBAAoB,GAAG,UAAU,CAAC,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,CAAC,2BAAY,CAAC,YAAY,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,CAAC;QACzH,MAAM,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAC1C,CAAC;IAEM,MAAM,CAAC,oBAAoB;QAChC,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,2BAAY,CAAC,YAAY,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC,CAAC;IAC1F,CAAC;CACF;AAtBD,gEAsBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport { LocalizationHelper } from \"@itwin/presentation-common\";\nimport { Presentation } from \"./Presentation\";\n\nconst NAMESPACES = [\"Presentation\"];\n\n/** @internal */\nexport class FrontendLocalizationHelper extends LocalizationHelper {\n private _lang: string | undefined;\n constructor(lang?: string) {\n super({ getLocalizedString: (key) => Presentation.localization.getLocalizedString(key, { defaultValue: key, lng: this._lang }) });\n this._lang = lang;\n }\n\n public get locale() {\n return this._lang;\n }\n public set locale(locale: string | undefined) {\n this._lang = locale;\n }\n\n public static async registerNamespaces() {\n const localizationPromises = NAMESPACES.map(async (namespace) => Presentation.localization.registerNamespace(namespace));\n await Promise.all(localizationPromises);\n }\n\n public static unregisterNamespaces() {\n NAMESPACES.map((namespace) => Presentation.localization.unregisterNamespace(namespace));\n }\n}\n"]}
|
|
@@ -12,7 +12,12 @@ import { SelectionManager, SelectionManagerProps } from "./selection/SelectionMa
|
|
|
12
12
|
export interface PresentationProps {
|
|
13
13
|
/** Props for [[PresentationManager]]. */
|
|
14
14
|
presentation?: PresentationManagerProps;
|
|
15
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* Props for [[SelectionManager]].
|
|
17
|
+
*
|
|
18
|
+
* @deprecated in 5.0. The whole unified selection system in this package is deprecated in favor of the new
|
|
19
|
+
* [@itwin/unified-selection](https://github.com/iTwin/presentation/blob/master/packages/unified-selection/README.md) package.
|
|
20
|
+
*/
|
|
16
21
|
selection?: Partial<SelectionManagerProps>;
|
|
17
22
|
/** Props for [[FavoritePropertiesManager]]. */
|
|
18
23
|
favorites?: FavoritePropertiesManagerProps;
|
|
@@ -53,7 +58,12 @@ export declare class Presentation {
|
|
|
53
58
|
static get presentation(): PresentationManager;
|
|
54
59
|
/** @internal */
|
|
55
60
|
static setPresentationManager(value: PresentationManager): void;
|
|
56
|
-
/**
|
|
61
|
+
/**
|
|
62
|
+
* The singleton [[SelectionManager]].
|
|
63
|
+
*
|
|
64
|
+
* @deprecated in 5.0. The whole unified selection system in this package is deprecated in favor of the new
|
|
65
|
+
* [@itwin/unified-selection](https://github.com/iTwin/presentation/blob/master/packages/unified-selection/README.md) package.
|
|
66
|
+
*/
|
|
57
67
|
static get selection(): SelectionManager;
|
|
58
68
|
/** @internal */
|
|
59
69
|
static setSelectionManager(value: SelectionManager): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Presentation.d.ts","sourceRoot":"","sources":["../../../src/presentation-frontend/Presentation.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH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C;IAC5C,WAAkB,YAAY,IAAI,mBAAmB,CAKpD;IAED,gBAAgB;WACF,sBAAsB,CAAC,KAAK,EAAE,mBAAmB;IAO/D;;;;;OAKG;IAEH,WAAkB,SAAS,IAAI,gBAAgB,CAK9C;IAED,gBAAgB;WAEF,mBAAmB,CAAC,KAAK,EAAE,gBAAgB;IAIzD;;;OAGG;IACH,WAAkB,kBAAkB,IAAI,yBAAyB,CAKhE;IAED,gBAAgB;WACF,4BAA4B,CAAC,KAAK,EAAE,yBAAyB;IAO3E;;OAEG;IACH,WAAkB,YAAY,IAAI,YAAY,CAK7C;IAED,gBAAgB;WACF,eAAe,CAAC,KAAK,EAAE,YAAY;CAGlD"}
|
|
@@ -18,7 +18,7 @@ const SelectionManager_1 = require("./selection/SelectionManager");
|
|
|
18
18
|
const SelectionScopesManager_1 = require("./selection/SelectionScopesManager");
|
|
19
19
|
let localization;
|
|
20
20
|
let presentationManager;
|
|
21
|
-
let selectionManager;
|
|
21
|
+
let selectionManager; // eslint-disable-line @typescript-eslint/no-deprecated
|
|
22
22
|
let favoritePropertiesManager;
|
|
23
23
|
const initializationHandlers = [];
|
|
24
24
|
const terminationHandlers = [];
|
|
@@ -60,6 +60,7 @@ class Presentation {
|
|
|
60
60
|
presentationManager = PresentationManager_1.PresentationManager.create(managerProps);
|
|
61
61
|
}
|
|
62
62
|
if (!selectionManager) {
|
|
63
|
+
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
63
64
|
selectionManager = new SelectionManager_1.SelectionManager({
|
|
64
65
|
...props?.selection,
|
|
65
66
|
scopes: props?.selection?.scopes ??
|
|
@@ -68,6 +69,7 @@ class Presentation {
|
|
|
68
69
|
localeProvider: () => this.presentation.activeLocale,
|
|
69
70
|
}),
|
|
70
71
|
});
|
|
72
|
+
/* eslint-enable @typescript-eslint/no-deprecated */
|
|
71
73
|
}
|
|
72
74
|
if (!favoritePropertiesManager) {
|
|
73
75
|
favoritePropertiesManager = new FavoritePropertiesManager_1.FavoritePropertiesManager({
|
|
@@ -95,15 +97,15 @@ class Presentation {
|
|
|
95
97
|
LocalizationHelper_1.FrontendLocalizationHelper.unregisterNamespaces();
|
|
96
98
|
}
|
|
97
99
|
if (presentationManager) {
|
|
98
|
-
presentationManager.dispose();
|
|
100
|
+
presentationManager[Symbol.dispose]();
|
|
99
101
|
}
|
|
100
102
|
presentationManager = undefined;
|
|
101
103
|
if (favoritePropertiesManager) {
|
|
102
|
-
favoritePropertiesManager.dispose();
|
|
104
|
+
favoritePropertiesManager[Symbol.dispose]();
|
|
103
105
|
}
|
|
104
106
|
favoritePropertiesManager = undefined;
|
|
105
107
|
if (selectionManager) {
|
|
106
|
-
selectionManager.dispose();
|
|
108
|
+
selectionManager[Symbol.dispose]();
|
|
107
109
|
}
|
|
108
110
|
selectionManager = undefined;
|
|
109
111
|
localization = undefined;
|
|
@@ -125,11 +127,17 @@ class Presentation {
|
|
|
125
127
|
/** @internal */
|
|
126
128
|
static setPresentationManager(value) {
|
|
127
129
|
if (presentationManager) {
|
|
128
|
-
presentationManager.dispose();
|
|
130
|
+
presentationManager[Symbol.dispose]();
|
|
129
131
|
}
|
|
130
132
|
presentationManager = value;
|
|
131
133
|
}
|
|
132
|
-
/**
|
|
134
|
+
/**
|
|
135
|
+
* The singleton [[SelectionManager]].
|
|
136
|
+
*
|
|
137
|
+
* @deprecated in 5.0. The whole unified selection system in this package is deprecated in favor of the new
|
|
138
|
+
* [@itwin/unified-selection](https://github.com/iTwin/presentation/blob/master/packages/unified-selection/README.md) package.
|
|
139
|
+
*/
|
|
140
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
133
141
|
static get selection() {
|
|
134
142
|
if (!selectionManager) {
|
|
135
143
|
throw new Error("Presentation must be first initialized by calling Presentation.initialize");
|
|
@@ -137,6 +145,7 @@ class Presentation {
|
|
|
137
145
|
return selectionManager;
|
|
138
146
|
}
|
|
139
147
|
/** @internal */
|
|
148
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
140
149
|
static setSelectionManager(value) {
|
|
141
150
|
selectionManager = value;
|
|
142
151
|
}
|
|
@@ -153,7 +162,7 @@ class Presentation {
|
|
|
153
162
|
/** @internal */
|
|
154
163
|
static setFavoritePropertiesManager(value) {
|
|
155
164
|
if (favoritePropertiesManager) {
|
|
156
|
-
favoritePropertiesManager.dispose();
|
|
165
|
+
favoritePropertiesManager[Symbol.dispose]();
|
|
157
166
|
}
|
|
158
167
|
favoritePropertiesManager = value;
|
|
159
168
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Presentation.js","sourceRoot":"","sources":["../../../src/presentation-frontend/Presentation.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,wDAAiD;AAEjD,oEAAmF;AACnF,+FAA4H;AAC5H,+FAAyI;AACzI,6DAAkE;AAClE,+DAAsF;AACtF,mEAAuF;AACvF,+EAA4E;AAE5E,IAAI,YAAsC,CAAC;AAC3C,IAAI,mBAAoD,CAAC;AACzD,IAAI,gBAA8C,CAAC;AACnD,IAAI,yBAAgE,CAAC;AACrE,MAAM,sBAAsB,GAA8C,EAAE,CAAC;AAC7E,MAAM,mBAAmB,GAAsB,EAAE,CAAC;AAiBlD;;;;;;;;GAQG;AACH,MAAa,YAAY;IACvB,0BAA0B;IAC1B,gBAAuB,CAAC;IAExB;;;;;;;;;OASG;IACI,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,KAAyB;QACtD,IAAI,CAAC,yBAAS,CAAC,WAAW,EAAE,CAAC;YAC3B,MAAM,IAAI,uCAAiB,CAAC,wCAAkB,CAAC,cAAc,EAAE,yEAAyE,CAAC,CAAC;QAC5I,CAAC;QACD,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,YAAY,GAAG,yBAAS,CAAC,YAAY,CAAC;QACxC,CAAC;QACD,IAAI,CAAC,mBAAmB,EAAE,CAAC;YACzB,MAAM,YAAY,GAAG,KAAK,EAAE,YAAY,IAAI,EAAE,CAAC;YA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AO,EAAE,CAAC;QAChC,CAAC;QACD,mBAAmB,GAAG,KAAK,CAAC;IAC9B,CAAC;IAED,yCAAyC;IAClC,MAAM,KAAK,SAAS;QACzB,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,2EAA2E,CAAC,CAAC;QAC/F,CAAC;QACD,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,mBAAmB,CAAC,KAAuB;QACvD,gBAAgB,GAAG,KAAK,CAAC;IAC3B,CAAC;IAED;;;OAGG;IACI,MAAM,KAAK,kBAAkB;QAClC,IAAI,CAAC,yBAAyB,EAAE,CAAC;YAC/B,MAAM,IAAI,KAAK,CAAC,kFAAkF,CAAC,CAAC;QACtG,CAAC;QACD,OAAO,yBAAyB,CAAC;IACnC,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,4BAA4B,CAAC,KAAgC;QACzE,IAAI,yBAAyB,EAAE,CAAC;YAC9B,yBAAyB,CAAC,OAAO,EAAE,CAAC;QACtC,CAAC;QACD,yBAAyB,GAAG,KAAK,CAAC;IACpC,CAAC;IAED;;OAEG;IACI,MAAM,KAAK,YAAY;QAC5B,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,MAAM,IAAI,KAAK,CAAC,2EAA2E,CAAC,CAAC;QAC/F,CAAC;QACD,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,eAAe,CAAC,KAAmB;QAC/C,YAAY,GAAG,KAAK,CAAC;IACvB,CAAC;CACF;AA7JD,oCA6JC","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 Core\r\n */\r\n\r\nimport { IModelApp } from \"@itwin/core-frontend\";\r\nimport { Localization } from \"@itwin/core-common\";\r\nimport { PresentationError, PresentationStatus } from \"@itwin/presentation-common\";\r\nimport { FavoritePropertiesManager, FavoritePropertiesManagerProps } from \"./favorite-properties/FavoritePropertiesManager\";\r\nimport { createFavoritePropertiesStorage, DefaultFavoritePropertiesStorageTypes } from \"./favorite-properties/FavoritePropertiesStorage\";\r\nimport { FrontendLocalizationHelper } from \"./LocalizationHelper\";\r\nimport { PresentationManager, PresentationManagerProps } from \"./PresentationManager\";\r\nimport { SelectionManager, SelectionManagerProps } from \"./selection/SelectionManager\";\r\nimport { SelectionScopesManager } from \"./selection/SelectionScopesManager\";\r\n\r\nlet localization: Localization | undefined;\r\nlet presentationManager: PresentationManager | undefined;\r\nlet selectionManager: SelectionManager | undefined;\r\nlet favoritePropertiesManager: FavoritePropertiesManager | undefined;\r\nconst initializationHandlers: Array<() => Promise<(() => void) | void>> = [];\r\nconst terminationHandlers: Array<() => void> = [];\r\n\r\n/**\r\n * Props for initializing [[Presentation]].\r\n * @public\r\n */\r\nexport interface PresentationProps {\r\n /** Props for [[PresentationManager]]. */\r\n presentation?: PresentationManagerProps;\r\n\r\n /** Props for [[SelectionManager]]. */\r\n selection?: Partial<SelectionManagerProps>;\r\n\r\n /** Props for [[FavoritePropertiesManager]]. */\r\n favorites?: FavoritePropertiesManagerProps;\r\n}\r\n\r\n/**\r\n * Static class used to statically set up Presentation library for the frontend.\r\n * Basically what it does is:\r\n * - Create a singleton [[PresentationManager]] instance\r\n * - Create a singleton [[SelectionManager]] instance\r\n * - Create a singleton [[FavoritePropertiesManager]]] instance\r\n *\r\n * @public\r\n */\r\nexport class Presentation {\r\n /* istanbul ignore next */\r\n private constructor() {}\r\n\r\n /**\r\n * Initializes Presentation library for the frontend.\r\n *\r\n * Example:\r\n * ``` ts\r\n * [[include:Presentation.Frontend.Initialization]]\r\n * ```\r\n *\r\n * The method should be called after a call to [IModelApp.startup]($core-frontend).\r\n */\r\n public static async initialize(props?: PresentationProps): Promise<void> {\r\n if (!IModelApp.initialized) {\r\n throw new PresentationError(PresentationStatus.NotInitialized, \"IModelApp.startup must be called before calling Presentation.initialize\");\r\n }\r\n if (!localization) {\r\n localization = IModelApp.localization;\r\n }\r\n if (!presentationManager) {\r\n const managerProps = props?.presentation ?? {};\r\n if (!managerProps.activeLocale) {\r\n const languages = Presentation.localization.getLanguageList();\r\n managerProps.activeLocale = languages.length ? languages[0] : undefined;\r\n }\r\n presentationManager = PresentationManager.create(managerProps);\r\n }\r\n if (!selectionManager) {\r\n selectionManager = new SelectionManager({\r\n ...props?.selection,\r\n scopes:\r\n props?.selection?.scopes ??\r\n new SelectionScopesManager({\r\n rpcRequestsHandler: presentationManager.rpcRequestsHandler,\r\n localeProvider: () => this.presentation.activeLocale,\r\n }),\r\n });\r\n }\r\n if (!favoritePropertiesManager) {\r\n favoritePropertiesManager = new FavoritePropertiesManager({\r\n storage: props?.favorites ? props.favorites.storage : createFavoritePropertiesStorage(DefaultFavoritePropertiesStorageTypes.Noop),\r\n });\r\n }\r\n\r\n presentationManager.startIModelInitialization = (imodel) => favoritePropertiesManager?.startConnectionInitialization(imodel);\r\n presentationManager.ensureIModelInitialized = async (imodel) => favoritePropertiesManager?.ensureInitialized(imodel);\r\n\r\n await FrontendLocalizationHelper.registerNamespaces();\r\n for (const handler of initializationHandlers) {\r\n const cleanup = await handler();\r\n if (cleanup) {\r\n terminationHandlers.push(cleanup);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Terminates Presentation library frontend. This method should be called\r\n * before a call to [IModelApp.shutdown]($core-frontend)\r\n */\r\n public static terminate(): void {\r\n terminationHandlers.forEach((handler) => handler());\r\n terminationHandlers.length = 0;\r\n\r\n if (localization) {\r\n FrontendLocalizationHelper.unregisterNamespaces();\r\n }\r\n\r\n if (presentationManager) {\r\n presentationManager.dispose();\r\n }\r\n presentationManager = undefined;\r\n\r\n if (favoritePropertiesManager) {\r\n favoritePropertiesManager.dispose();\r\n }\r\n favoritePropertiesManager = undefined;\r\n\r\n if (selectionManager) {\r\n selectionManager.dispose();\r\n }\r\n selectionManager = undefined;\r\n localization = undefined;\r\n }\r\n\r\n /**\r\n * Registers an additional handler which will be invoked during Presentation library frontend\r\n * initialization.\r\n */\r\n public static registerInitializationHandler(handler: () => Promise<() => void>): void {\r\n initializationHandlers.push(handler);\r\n }\r\n\r\n /** The singleton [[PresentationManager]] */\r\n public static get presentation(): PresentationManager {\r\n if (!presentationManager) {\r\n throw new Error(\"Presentation must be first initialized by calling Presentation.initialize\");\r\n }\r\n return presentationManager;\r\n }\r\n\r\n /** @internal */\r\n public static setPresentationManager(value: PresentationManager) {\r\n if (presentationManager) {\r\n presentationManager.dispose();\r\n }\r\n presentationManager = value;\r\n }\r\n\r\n /** The singleton [[SelectionManager]] */\r\n public static get selection(): SelectionManager {\r\n if (!selectionManager) {\r\n throw new Error(\"Presentation must be first initialized by calling Presentation.initialize\");\r\n }\r\n return selectionManager;\r\n }\r\n\r\n /** @internal */\r\n public static setSelectionManager(value: SelectionManager) {\r\n selectionManager = value;\r\n }\r\n\r\n /**\r\n * The singleton [[FavoritePropertiesManager]]\r\n * @public\r\n */\r\n public static get favoriteProperties(): FavoritePropertiesManager {\r\n if (!favoritePropertiesManager) {\r\n throw new Error(\"Favorite Properties must be first initialized by calling Presentation.initialize\");\r\n }\r\n return favoritePropertiesManager;\r\n }\r\n\r\n /** @internal */\r\n public static setFavoritePropertiesManager(value: FavoritePropertiesManager) {\r\n if (favoritePropertiesManager) {\r\n favoritePropertiesManager.dispose();\r\n }\r\n favoritePropertiesManager = value;\r\n }\r\n\r\n /**\r\n * The localization manager used by Presentation frontend. Returns the result of `IModelApp.i18n`.\r\n */\r\n public static get localization(): Localization {\r\n if (!localization) {\r\n throw new Error(\"Presentation must be first initialized by calling Presentation.initialize\");\r\n }\r\n return localization;\r\n }\r\n\r\n /** @internal */\r\n public static setLocalization(value: Localization) {\r\n localization = value;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"Presentation.js","sourceRoot":"","sources":["../../../src/presentation-frontend/Pres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;IAChB,4DAA4D;IACrD,MAAM,CAAC,mBAAmB,CAAC,KAAuB;QACvD,gBAAgB,GAAG,KAAK,CAAC;IAC3B,CAAC;IAED;;;OAGG;IACI,MAAM,KAAK,kBAAkB;QAClC,IAAI,CAAC,yBAAyB,EAAE,CAAC;YAC/B,MAAM,IAAI,KAAK,CAAC,kFAAkF,CAAC,CAAC;QACtG,CAAC;QACD,OAAO,yBAAyB,CAAC;IACnC,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,4BAA4B,CAAC,KAAgC;QACzE,IAAI,yBAAyB,EAAE,CAAC;YAC9B,yBAAyB,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;QAC9C,CAAC;QACD,yBAAyB,GAAG,KAAK,CAAC;IACpC,CAAC;IAED;;OAEG;IACI,MAAM,KAAK,YAAY;QAC5B,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,MAAM,IAAI,KAAK,CAAC,2EAA2E,CAAC,CAAC;QAC/F,CAAC;QACD,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,eAAe,CAAC,KAAmB;QAC/C,YAAY,GAAG,KAAK,CAAC;IACvB,CAAC;CACF;AAtKD,oCAsKC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Core\n */\n\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport { Localization } from \"@itwin/core-common\";\nimport { PresentationError, PresentationStatus } from \"@itwin/presentation-common\";\nimport { FavoritePropertiesManager, FavoritePropertiesManagerProps } from \"./favorite-properties/FavoritePropertiesManager\";\nimport { createFavoritePropertiesStorage, DefaultFavoritePropertiesStorageTypes } from \"./favorite-properties/FavoritePropertiesStorage\";\nimport { FrontendLocalizationHelper } from \"./LocalizationHelper\";\nimport { PresentationManager, PresentationManagerProps } from \"./PresentationManager\";\nimport { SelectionManager, SelectionManagerProps } from \"./selection/SelectionManager\";\nimport { SelectionScopesManager } from \"./selection/SelectionScopesManager\";\n\nlet localization: Localization | undefined;\nlet presentationManager: PresentationManager | undefined;\nlet selectionManager: SelectionManager | undefined; // eslint-disable-line @typescript-eslint/no-deprecated\nlet favoritePropertiesManager: FavoritePropertiesManager | undefined;\nconst initializationHandlers: Array<() => Promise<(() => void) | void>> = [];\nconst terminationHandlers: Array<() => void> = [];\n\n/**\n * Props for initializing [[Presentation]].\n * @public\n */\nexport interface PresentationProps {\n /** Props for [[PresentationManager]]. */\n presentation?: PresentationManagerProps;\n\n /**\n * Props for [[SelectionManager]].\n *\n * @deprecated in 5.0. The whole unified selection system in this package is deprecated in favor of the new\n * [@itwin/unified-selection](https://github.com/iTwin/presentation/blob/master/packages/unified-selection/README.md) package.\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n selection?: Partial<SelectionManagerProps>;\n\n /** Props for [[FavoritePropertiesManager]]. */\n favorites?: FavoritePropertiesManagerProps;\n}\n\n/**\n * Static class used to statically set up Presentation library for the frontend.\n * Basically what it does is:\n * - Create a singleton [[PresentationManager]] instance\n * - Create a singleton [[SelectionManager]] instance\n * - Create a singleton [[FavoritePropertiesManager]]] instance\n *\n * @public\n */\nexport class Presentation {\n /* istanbul ignore next */\n private constructor() {}\n\n /**\n * Initializes Presentation library for the frontend.\n *\n * Example:\n * ``` ts\n * [[include:Presentation.Frontend.Initialization]]\n * ```\n *\n * The method should be called after a call to [IModelApp.startup]($core-frontend).\n */\n public static async initialize(props?: PresentationProps): Promise<void> {\n if (!IModelApp.initialized) {\n throw new PresentationError(PresentationStatus.NotInitialized, \"IModelApp.startup must be called before calling Presentation.initialize\");\n }\n if (!localization) {\n localization = IModelApp.localization;\n }\n if (!presentationManager) {\n const managerProps = props?.presentation ?? {};\n if (!managerProps.activeLocale) {\n const languages = Presentation.localization.getLanguageList();\n managerProps.activeLocale = languages.length ? languages[0] : undefined;\n }\n presentationManager = PresentationManager.create(managerProps);\n }\n if (!selectionManager) {\n /* eslint-disable @typescript-eslint/no-deprecated */\n selectionManager = new SelectionManager({\n ...props?.selection,\n scopes:\n props?.selection?.scopes ??\n new SelectionScopesManager({\n rpcRequestsHandler: presentationManager.rpcRequestsHandler,\n localeProvider: () => this.presentation.activeLocale,\n }),\n });\n /* eslint-enable @typescript-eslint/no-deprecated */\n }\n if (!favoritePropertiesManager) {\n favoritePropertiesManager = new FavoritePropertiesManager({\n storage: props?.favorites ? props.favorites.storage : createFavoritePropertiesStorage(DefaultFavoritePropertiesStorageTypes.Noop),\n });\n }\n\n presentationManager.startIModelInitialization = (imodel) => favoritePropertiesManager?.startConnectionInitialization(imodel);\n presentationManager.ensureIModelInitialized = async (imodel) => favoritePropertiesManager?.ensureInitialized(imodel);\n\n await FrontendLocalizationHelper.registerNamespaces();\n for (const handler of initializationHandlers) {\n const cleanup = await handler();\n if (cleanup) {\n terminationHandlers.push(cleanup);\n }\n }\n }\n\n /**\n * Terminates Presentation library frontend. This method should be called\n * before a call to [IModelApp.shutdown]($core-frontend)\n */\n public static terminate(): void {\n terminationHandlers.forEach((handler) => handler());\n terminationHandlers.length = 0;\n\n if (localization) {\n FrontendLocalizationHelper.unregisterNamespaces();\n }\n\n if (presentationManager) {\n presentationManager[Symbol.dispose]();\n }\n presentationManager = undefined;\n\n if (favoritePropertiesManager) {\n favoritePropertiesManager[Symbol.dispose]();\n }\n favoritePropertiesManager = undefined;\n\n if (selectionManager) {\n selectionManager[Symbol.dispose]();\n }\n selectionManager = undefined;\n localization = undefined;\n }\n\n /**\n * Registers an additional handler which will be invoked during Presentation library frontend\n * initialization.\n */\n public static registerInitializationHandler(handler: () => Promise<() => void>): void {\n initializationHandlers.push(handler);\n }\n\n /** The singleton [[PresentationManager]] */\n public static get presentation(): PresentationManager {\n if (!presentationManager) {\n throw new Error(\"Presentation must be first initialized by calling Presentation.initialize\");\n }\n return presentationManager;\n }\n\n /** @internal */\n public static setPresentationManager(value: PresentationManager) {\n if (presentationManager) {\n presentationManager[Symbol.dispose]();\n }\n presentationManager = value;\n }\n\n /**\n * The singleton [[SelectionManager]].\n *\n * @deprecated in 5.0. The whole unified selection system in this package is deprecated in favor of the new\n * [@itwin/unified-selection](https://github.com/iTwin/presentation/blob/master/packages/unified-selection/README.md) package.\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public static get selection(): SelectionManager {\n if (!selectionManager) {\n throw new Error(\"Presentation must be first initialized by calling Presentation.initialize\");\n }\n return selectionManager;\n }\n\n /** @internal */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public static setSelectionManager(value: SelectionManager) {\n selectionManager = value;\n }\n\n /**\n * The singleton [[FavoritePropertiesManager]]\n * @public\n */\n public static get favoriteProperties(): FavoritePropertiesManager {\n if (!favoritePropertiesManager) {\n throw new Error(\"Favorite Properties must be first initialized by calling Presentation.initialize\");\n }\n return favoritePropertiesManager;\n }\n\n /** @internal */\n public static setFavoritePropertiesManager(value: FavoritePropertiesManager) {\n if (favoritePropertiesManager) {\n favoritePropertiesManager[Symbol.dispose]();\n }\n favoritePropertiesManager = value;\n }\n\n /**\n * The localization manager used by Presentation frontend. Returns the result of `IModelApp.i18n`.\n */\n public static get localization(): Localization {\n if (!localization) {\n throw new Error(\"Presentation must be first initialized by calling Presentation.initialize\");\n }\n return localization;\n }\n\n /** @internal */\n public static setLocalization(value: Localization) {\n localization = value;\n }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module Core
|
|
3
3
|
*/
|
|
4
|
-
import { BeEvent
|
|
4
|
+
import { BeEvent } from "@itwin/core-bentley";
|
|
5
5
|
import { IModelConnection } from "@itwin/core-frontend";
|
|
6
6
|
import { UnitSystemKey } from "@itwin/core-quantity";
|
|
7
7
|
import { SchemaContext } from "@itwin/ecschema-metadata";
|
|
@@ -122,7 +122,7 @@ export interface PresentationManagerProps {
|
|
|
122
122
|
*
|
|
123
123
|
* @public
|
|
124
124
|
*/
|
|
125
|
-
export declare class PresentationManager implements
|
|
125
|
+
export declare class PresentationManager implements Disposable {
|
|
126
126
|
private _requestsHandler;
|
|
127
127
|
private _rulesets;
|
|
128
128
|
private _localizationHelper;
|
|
@@ -153,6 +153,8 @@ export declare class PresentationManager implements IDisposable {
|
|
|
153
153
|
/** Get / set active locale used for localizing presentation data */
|
|
154
154
|
get activeLocale(): string | undefined;
|
|
155
155
|
set activeLocale(locale: string | undefined);
|
|
156
|
+
[Symbol.dispose](): void;
|
|
157
|
+
/** @deprecated in 5.0 Use [Symbol.dispose] instead. */
|
|
156
158
|
dispose(): void;
|
|
157
159
|
private onUpdate;
|
|
158
160
|
/** @note This is only called in native apps after changes in iModels */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PresentationManager.d.ts","sourceRoot":"","sources":["../../../src/presentation-frontend/PresentationManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"PresentationManager.d.ts","sourceRoot":"","sources":["../../../src/presentation-frontend/PresentationManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAA0C,MAAM,qBAAqB,CAAC;AACtF,OAAO,EAAa,gBAAgB,EAAU,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAEL,0BAA0B,EAC1B,OAAO,EACP,+BAA+B,EAG/B,iCAAiC,EAEjC,qBAAqB,EACrB,4BAA4B,EAC5B,iBAAiB,EAEjB,UAAU,EACV,mBAAmB,EACnB,0BAA0B,EAC1B,2BAA2B,EAC3B,iBAAiB,EACjB,4BAA4B,EAC5B,iBAAiB,EACjB,4CAA4C,EAC5C,mCAAmC,EACnC,UAAU,EACV,sCAAsC,EACtC,uBAAuB,EACvB,mBAAm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B,GACrI,OAAO,CAAC,eAAe,EAAE,CAAC;CAI9B"}
|
|
@@ -24,6 +24,23 @@ const unified_selection_1 = require("@itwin/unified-selection");
|
|
|
24
24
|
* @public
|
|
25
25
|
*/
|
|
26
26
|
class PresentationManager {
|
|
27
|
+
_requestsHandler;
|
|
28
|
+
_rulesets;
|
|
29
|
+
_localizationHelper;
|
|
30
|
+
_explicitActiveUnitSystem;
|
|
31
|
+
_rulesetVars;
|
|
32
|
+
_clearEventListener;
|
|
33
|
+
_schemaContextProvider;
|
|
34
|
+
_defaultFormats;
|
|
35
|
+
_ipcRequestsHandler;
|
|
36
|
+
/**
|
|
37
|
+
* An event raised when hierarchies created using specific ruleset change
|
|
38
|
+
*/
|
|
39
|
+
onIModelHierarchyChanged = new core_bentley_1.BeEvent();
|
|
40
|
+
/**
|
|
41
|
+
* An event raised when content created using specific ruleset changes
|
|
42
|
+
*/
|
|
43
|
+
onIModelContentChanged = new core_bentley_1.BeEvent();
|
|
27
44
|
/**
|
|
28
45
|
* Get / set active unit system used to format property values with units.
|
|
29
46
|
*
|
|
@@ -38,18 +55,6 @@ class PresentationManager {
|
|
|
38
55
|
this._explicitActiveUnitSystem = value;
|
|
39
56
|
}
|
|
40
57
|
constructor(props) {
|
|
41
|
-
/**
|
|
42
|
-
* An event raised when hierarchies created using specific ruleset change
|
|
43
|
-
*/
|
|
44
|
-
this.onIModelHierarchyChanged = new core_bentley_1.BeEvent();
|
|
45
|
-
/**
|
|
46
|
-
* An event raised when content created using specific ruleset changes
|
|
47
|
-
*/
|
|
48
|
-
this.onIModelContentChanged = new core_bentley_1.BeEvent();
|
|
49
|
-
this.onUpdate = (_evt, report) => {
|
|
50
|
-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
51
|
-
this.handleUpdateAsync(report);
|
|
52
|
-
};
|
|
53
58
|
if (props) {
|
|
54
59
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
55
60
|
this._explicitActiveUnitSystem = props.activeUnitSystem;
|
|
@@ -74,12 +79,21 @@ class PresentationManager {
|
|
|
74
79
|
set activeLocale(locale) {
|
|
75
80
|
this._localizationHelper.locale = locale;
|
|
76
81
|
}
|
|
77
|
-
dispose() {
|
|
82
|
+
[Symbol.dispose]() {
|
|
78
83
|
if (this._clearEventListener) {
|
|
79
84
|
this._clearEventListener();
|
|
80
85
|
this._clearEventListener = undefined;
|
|
81
86
|
}
|
|
82
87
|
}
|
|
88
|
+
/** @deprecated in 5.0 Use [Symbol.dispose] instead. */
|
|
89
|
+
// istanbul ignore next
|
|
90
|
+
dispose() {
|
|
91
|
+
this[Symbol.dispose]();
|
|
92
|
+
}
|
|
93
|
+
onUpdate = (_evt, report) => {
|
|
94
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
95
|
+
this.handleUpdateAsync(report);
|
|
96
|
+
};
|
|
83
97
|
/** @note This is only called in native apps after changes in iModels */
|
|
84
98
|
async handleUpdateAsync(report) {
|
|
85
99
|
for (const imodelKey in report) {
|
|
@@ -201,8 +215,7 @@ class PresentationManager {
|
|
|
201
215
|
const result = await this._requestsHandler.getPagedNodes({ ...rpcOptions, paging });
|
|
202
216
|
return {
|
|
203
217
|
total: result.total,
|
|
204
|
-
|
|
205
|
-
items: this._localizationHelper.getLocalizedNodes(result.items.map(presentation_common_1.Node.fromJSON)),
|
|
218
|
+
items: this._localizationHelper.getLocalizedNodes(result.items),
|
|
206
219
|
};
|
|
207
220
|
},
|
|
208
221
|
});
|
|
@@ -257,16 +270,14 @@ class PresentationManager {
|
|
|
257
270
|
const options = await this.addRulesetAndVariablesToOptions(requestOptions);
|
|
258
271
|
const rpcOptions = this.toRpcTokenOptions({ ...options });
|
|
259
272
|
const result = await this._requestsHandler.getNodePaths(rpcOptions);
|
|
260
|
-
|
|
261
|
-
return result.map(presentation_common_1.NodePathElement.fromJSON).map((npe) => this._localizationHelper.getLocalizedNodePathElement(npe));
|
|
273
|
+
return result.map((npe) => this._localizationHelper.getLocalizedNodePathElement(npe));
|
|
262
274
|
}
|
|
263
275
|
/** Retrieves paths from root nodes to nodes containing filter text in their label. */
|
|
264
276
|
async getFilteredNodePaths(requestOptions) {
|
|
265
277
|
this.startIModelInitialization(requestOptions.imodel);
|
|
266
278
|
const options = await this.addRulesetAndVariablesToOptions(requestOptions);
|
|
267
279
|
const result = await this._requestsHandler.getFilteredNodePaths(this.toRpcTokenOptions(options));
|
|
268
|
-
|
|
269
|
-
return result.map(presentation_common_1.NodePathElement.fromJSON).map((npe) => this._localizationHelper.getLocalizedNodePathElement(npe));
|
|
280
|
+
return result.map((npe) => this._localizationHelper.getLocalizedNodePathElement(npe));
|
|
270
281
|
}
|
|
271
282
|
/**
|
|
272
283
|
* Get information about the sources of content when building it for specific ECClasses. Sources involve classes of the primary select instance,
|
|
@@ -408,8 +419,7 @@ class PresentationManager {
|
|
|
408
419
|
const response = await this._requestsHandler.getPagedDistinctValues({ ...rpcOptions, paging });
|
|
409
420
|
return {
|
|
410
421
|
total: response.total,
|
|
411
|
-
|
|
412
|
-
items: response.items.map((x) => this._localizationHelper.getLocalizedDisplayValueGroup(presentation_common_1.DisplayValueGroup.fromJSON(x))),
|
|
422
|
+
items: response.items.map((x) => this._localizationHelper.getLocalizedDisplayValueGroup(x)),
|
|
413
423
|
};
|
|
414
424
|
},
|
|
415
425
|
});
|