@itwin/presentation-frontend 4.0.0-dev.52 → 4.0.0-dev.55
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/lib/cjs/presentation-frontend/ConnectivityInformationProvider.d.ts +29 -29
- package/lib/cjs/presentation-frontend/ConnectivityInformationProvider.js +47 -47
- package/lib/cjs/presentation-frontend/Diagnostics.d.ts +14 -14
- package/lib/cjs/presentation-frontend/Diagnostics.js +61 -61
- package/lib/cjs/presentation-frontend/FrontendLoggerCategory.d.ts +12 -12
- package/lib/cjs/presentation-frontend/FrontendLoggerCategory.js +20 -20
- package/lib/cjs/presentation-frontend/IpcRequestsHandler.d.ts +10 -10
- package/lib/cjs/presentation-frontend/IpcRequestsHandler.js +41 -41
- package/lib/cjs/presentation-frontend/LocalizationHelper.d.ts +10 -10
- package/lib/cjs/presentation-frontend/LocalizationHelper.js +31 -31
- package/lib/cjs/presentation-frontend/Presentation.d.ts +73 -73
- package/lib/cjs/presentation-frontend/Presentation.js +159 -159
- package/lib/cjs/presentation-frontend/PresentationManager.d.ts +205 -205
- package/lib/cjs/presentation-frontend/PresentationManager.js +438 -438
- package/lib/cjs/presentation-frontend/PresentationManager.js.map +1 -1
- package/lib/cjs/presentation-frontend/RulesetManager.d.ts +63 -63
- package/lib/cjs/presentation-frontend/RulesetManager.js +85 -85
- package/lib/cjs/presentation-frontend/RulesetVariablesManager.d.ts +143 -143
- package/lib/cjs/presentation-frontend/RulesetVariablesManager.js +195 -195
- package/lib/cjs/presentation-frontend/StateTracker.d.ts +38 -38
- package/lib/cjs/presentation-frontend/StateTracker.js +128 -128
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts +132 -132
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.js +519 -519
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.js.map +1 -1
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesStorage.d.ts +111 -111
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js +290 -290
- package/lib/cjs/presentation-frontend/selection/HiliteSetProvider.d.ts +52 -52
- package/lib/cjs/presentation-frontend/selection/HiliteSetProvider.js +97 -97
- package/lib/cjs/presentation-frontend/selection/ISelectionProvider.d.ts +19 -19
- package/lib/cjs/presentation-frontend/selection/ISelectionProvider.js +9 -9
- package/lib/cjs/presentation-frontend/selection/SelectionChangeEvent.d.ts +52 -52
- package/lib/cjs/presentation-frontend/selection/SelectionChangeEvent.js +33 -33
- package/lib/cjs/presentation-frontend/selection/SelectionHandler.d.ts +103 -103
- package/lib/cjs/presentation-frontend/selection/SelectionHandler.js +108 -108
- package/lib/cjs/presentation-frontend/selection/SelectionHelper.d.ts +17 -17
- package/lib/cjs/presentation-frontend/selection/SelectionHelper.js +40 -40
- package/lib/cjs/presentation-frontend/selection/SelectionManager.d.ts +139 -139
- package/lib/cjs/presentation-frontend/selection/SelectionManager.js +414 -414
- package/lib/cjs/presentation-frontend/selection/SelectionScopesManager.d.ts +59 -59
- package/lib/cjs/presentation-frontend/selection/SelectionScopesManager.js +91 -91
- package/lib/cjs/presentation-frontend.d.ts +34 -34
- package/lib/cjs/presentation-frontend.js +54 -50
- package/lib/cjs/presentation-frontend.js.map +1 -1
- package/lib/esm/presentation-frontend/ConnectivityInformationProvider.d.ts +29 -29
- package/lib/esm/presentation-frontend/ConnectivityInformationProvider.js +43 -43
- package/lib/esm/presentation-frontend/Diagnostics.d.ts +14 -14
- package/lib/esm/presentation-frontend/Diagnostics.js +56 -56
- package/lib/esm/presentation-frontend/FrontendLoggerCategory.d.ts +12 -12
- package/lib/esm/presentation-frontend/FrontendLoggerCategory.js +17 -17
- package/lib/esm/presentation-frontend/IpcRequestsHandler.d.ts +10 -10
- package/lib/esm/presentation-frontend/IpcRequestsHandler.js +37 -37
- package/lib/esm/presentation-frontend/LocalizationHelper.d.ts +10 -10
- package/lib/esm/presentation-frontend/LocalizationHelper.js +27 -27
- package/lib/esm/presentation-frontend/Presentation.d.ts +73 -73
- package/lib/esm/presentation-frontend/Presentation.js +155 -155
- package/lib/esm/presentation-frontend/PresentationManager.d.ts +205 -205
- package/lib/esm/presentation-frontend/PresentationManager.js +433 -433
- package/lib/esm/presentation-frontend/PresentationManager.js.map +1 -1
- package/lib/esm/presentation-frontend/RulesetManager.d.ts +63 -63
- package/lib/esm/presentation-frontend/RulesetManager.js +81 -81
- package/lib/esm/presentation-frontend/RulesetVariablesManager.d.ts +143 -143
- package/lib/esm/presentation-frontend/RulesetVariablesManager.js +191 -191
- package/lib/esm/presentation-frontend/StateTracker.d.ts +38 -38
- package/lib/esm/presentation-frontend/StateTracker.js +124 -124
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts +132 -132
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.js +514 -513
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.js.map +1 -1
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesStorage.d.ts +111 -111
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js +282 -282
- package/lib/esm/presentation-frontend/selection/HiliteSetProvider.d.ts +52 -52
- package/lib/esm/presentation-frontend/selection/HiliteSetProvider.js +93 -93
- package/lib/esm/presentation-frontend/selection/ISelectionProvider.d.ts +19 -19
- package/lib/esm/presentation-frontend/selection/ISelectionProvider.js +8 -8
- package/lib/esm/presentation-frontend/selection/SelectionChangeEvent.d.ts +52 -52
- package/lib/esm/presentation-frontend/selection/SelectionChangeEvent.js +29 -29
- package/lib/esm/presentation-frontend/selection/SelectionHandler.d.ts +103 -103
- package/lib/esm/presentation-frontend/selection/SelectionHandler.js +104 -104
- package/lib/esm/presentation-frontend/selection/SelectionHelper.d.ts +17 -17
- package/lib/esm/presentation-frontend/selection/SelectionHelper.js +36 -36
- package/lib/esm/presentation-frontend/selection/SelectionManager.d.ts +139 -139
- package/lib/esm/presentation-frontend/selection/SelectionManager.js +409 -409
- package/lib/esm/presentation-frontend/selection/SelectionScopesManager.d.ts +59 -59
- package/lib/esm/presentation-frontend/selection/SelectionScopesManager.js +85 -85
- package/lib/esm/presentation-frontend.d.ts +34 -34
- package/lib/esm/presentation-frontend.js +38 -38
- package/package.json +15 -15
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
/** @packageDocumentation
|
|
6
|
-
* @module Core
|
|
7
|
-
*/
|
|
8
|
-
import { BeEvent } from "@itwin/core-bentley";
|
|
9
|
-
import { InternetConnectivityStatus } from "@itwin/core-common";
|
|
10
|
-
import { NativeApp } from "@itwin/core-frontend";
|
|
11
|
-
/**
|
|
12
|
-
* A helper that wraps connectivity-related APIs in NativeApp
|
|
13
|
-
* to give a unified information for interested parties in presentation.
|
|
14
|
-
*
|
|
15
|
-
* @internal
|
|
16
|
-
*/
|
|
17
|
-
export class ConnectivityInformationProvider {
|
|
18
|
-
constructor() {
|
|
19
|
-
this.onInternetConnectivityChanged = new BeEvent();
|
|
20
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
21
|
-
this.onNativeAppInternetConnectivityChanged = (status) => {
|
|
22
|
-
if (this._currentStatus === status)
|
|
23
|
-
return;
|
|
24
|
-
this._currentStatus = status;
|
|
25
|
-
this.onInternetConnectivityChanged.raiseEvent({ status });
|
|
26
|
-
};
|
|
27
|
-
if (NativeApp.isValid) {
|
|
28
|
-
this._unsubscribeFromInternetConnectivityChangedEvent = NativeApp.onInternetConnectivityChanged.addListener(this.onNativeAppInternetConnectivityChanged);
|
|
29
|
-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
30
|
-
NativeApp.checkInternetConnectivity().then((status) => {
|
|
31
|
-
if (undefined === this._currentStatus)
|
|
32
|
-
this._currentStatus = status;
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
this._currentStatus = InternetConnectivityStatus.Online;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
dispose() {
|
|
40
|
-
this._unsubscribeFromInternetConnectivityChangedEvent && this._unsubscribeFromInternetConnectivityChangedEvent();
|
|
41
|
-
}
|
|
42
|
-
get status() { return this._currentStatus ?? InternetConnectivityStatus.Offline; }
|
|
43
|
-
}
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module Core
|
|
7
|
+
*/
|
|
8
|
+
import { BeEvent } from "@itwin/core-bentley";
|
|
9
|
+
import { InternetConnectivityStatus } from "@itwin/core-common";
|
|
10
|
+
import { NativeApp } from "@itwin/core-frontend";
|
|
11
|
+
/**
|
|
12
|
+
* A helper that wraps connectivity-related APIs in NativeApp
|
|
13
|
+
* to give a unified information for interested parties in presentation.
|
|
14
|
+
*
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export class ConnectivityInformationProvider {
|
|
18
|
+
constructor() {
|
|
19
|
+
this.onInternetConnectivityChanged = new BeEvent();
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
21
|
+
this.onNativeAppInternetConnectivityChanged = (status) => {
|
|
22
|
+
if (this._currentStatus === status)
|
|
23
|
+
return;
|
|
24
|
+
this._currentStatus = status;
|
|
25
|
+
this.onInternetConnectivityChanged.raiseEvent({ status });
|
|
26
|
+
};
|
|
27
|
+
if (NativeApp.isValid) {
|
|
28
|
+
this._unsubscribeFromInternetConnectivityChangedEvent = NativeApp.onInternetConnectivityChanged.addListener(this.onNativeAppInternetConnectivityChanged);
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
30
|
+
NativeApp.checkInternetConnectivity().then((status) => {
|
|
31
|
+
if (undefined === this._currentStatus)
|
|
32
|
+
this._currentStatus = status;
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
this._currentStatus = InternetConnectivityStatus.Online;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
dispose() {
|
|
40
|
+
this._unsubscribeFromInternetConnectivityChangedEvent && this._unsubscribeFromInternetConnectivityChangedEvent();
|
|
41
|
+
}
|
|
42
|
+
get status() { return this._currentStatus ?? InternetConnectivityStatus.Offline; }
|
|
43
|
+
}
|
|
44
44
|
//# sourceMappingURL=ConnectivityInformationProvider.js.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module Core
|
|
3
|
-
*/
|
|
4
|
-
import { ClientDiagnostics, ClientDiagnosticsHandler } from "@itwin/presentation-common";
|
|
5
|
-
/**
|
|
6
|
-
* A function which logs messages to the console.
|
|
7
|
-
* @beta
|
|
8
|
-
*/
|
|
9
|
-
export declare function consoleDiagnosticsHandler(diagnostics: ClientDiagnostics): void;
|
|
10
|
-
/**
|
|
11
|
-
* A function which calls all diagnostics handlers passed to it.
|
|
12
|
-
* @beta
|
|
13
|
-
*/
|
|
14
|
-
export declare function createCombinedDiagnosticsHandler(handlers: ClientDiagnosticsHandler[]): (diagnostics: ClientDiagnostics) => void;
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Core
|
|
3
|
+
*/
|
|
4
|
+
import { ClientDiagnostics, ClientDiagnosticsHandler } from "@itwin/presentation-common";
|
|
5
|
+
/**
|
|
6
|
+
* A function which logs messages to the console.
|
|
7
|
+
* @beta
|
|
8
|
+
*/
|
|
9
|
+
export declare function consoleDiagnosticsHandler(diagnostics: ClientDiagnostics): void;
|
|
10
|
+
/**
|
|
11
|
+
* A function which calls all diagnostics handlers passed to it.
|
|
12
|
+
* @beta
|
|
13
|
+
*/
|
|
14
|
+
export declare function createCombinedDiagnosticsHandler(handlers: ClientDiagnosticsHandler[]): (diagnostics: ClientDiagnostics) => void;
|
|
15
15
|
//# sourceMappingURL=Diagnostics.d.ts.map
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
/** @packageDocumentation
|
|
6
|
-
* @module Core
|
|
7
|
-
*/
|
|
8
|
-
import { DiagnosticsLogEntry, } from "@itwin/presentation-common";
|
|
9
|
-
/**
|
|
10
|
-
* A function which logs messages to the console.
|
|
11
|
-
* @beta
|
|
12
|
-
*/
|
|
13
|
-
export function consoleDiagnosticsHandler(diagnostics) {
|
|
14
|
-
// eslint-disable-next-line no-console
|
|
15
|
-
diagnostics.backendVersion && console.log(`Backend version: ${diagnostics.backendVersion}`);
|
|
16
|
-
diagnostics.logs && handleDiagnosticLogs(diagnostics.logs, (msg, stack) => {
|
|
17
|
-
/* note: we're duplicating the message if it's logged at both editor and dev severity levels */
|
|
18
|
-
const str = buildLogMessageString(msg, stack);
|
|
19
|
-
if (msg.severity.editor)
|
|
20
|
-
getConsoleLogFunc(msg.severity.editor)(str);
|
|
21
|
-
if (msg.severity.dev)
|
|
22
|
-
getConsoleLogFunc(msg.severity.dev)(str);
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* A function which calls all diagnostics handlers passed to it.
|
|
27
|
-
* @beta
|
|
28
|
-
*/
|
|
29
|
-
export function createCombinedDiagnosticsHandler(handlers) {
|
|
30
|
-
return (diagnostics) => {
|
|
31
|
-
handlers.forEach((handler) => handler(diagnostics));
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
function handleDiagnosticLogs(logs, messageHandler, stack = []) {
|
|
35
|
-
logs.forEach((log) => {
|
|
36
|
-
if (DiagnosticsLogEntry.isMessage(log)) {
|
|
37
|
-
messageHandler(log, stack);
|
|
38
|
-
}
|
|
39
|
-
else if (log.logs) {
|
|
40
|
-
handleDiagnosticLogs(log.logs, messageHandler, [...stack, log]);
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
function buildLogMessageString(msg, _stack) {
|
|
45
|
-
return msg.message;
|
|
46
|
-
}
|
|
47
|
-
function getConsoleLogFunc(severity) {
|
|
48
|
-
switch (severity) {
|
|
49
|
-
case "error": return console.error; // eslint-disable-line no-console
|
|
50
|
-
case "warning": return console.warn; // eslint-disable-line no-console
|
|
51
|
-
case "info":
|
|
52
|
-
case "debug":
|
|
53
|
-
case "trace":
|
|
54
|
-
return console.log; // eslint-disable-line no-console
|
|
55
|
-
}
|
|
56
|
-
}
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module Core
|
|
7
|
+
*/
|
|
8
|
+
import { DiagnosticsLogEntry, } from "@itwin/presentation-common";
|
|
9
|
+
/**
|
|
10
|
+
* A function which logs messages to the console.
|
|
11
|
+
* @beta
|
|
12
|
+
*/
|
|
13
|
+
export function consoleDiagnosticsHandler(diagnostics) {
|
|
14
|
+
// eslint-disable-next-line no-console
|
|
15
|
+
diagnostics.backendVersion && console.log(`Backend version: ${diagnostics.backendVersion}`);
|
|
16
|
+
diagnostics.logs && handleDiagnosticLogs(diagnostics.logs, (msg, stack) => {
|
|
17
|
+
/* note: we're duplicating the message if it's logged at both editor and dev severity levels */
|
|
18
|
+
const str = buildLogMessageString(msg, stack);
|
|
19
|
+
if (msg.severity.editor)
|
|
20
|
+
getConsoleLogFunc(msg.severity.editor)(str);
|
|
21
|
+
if (msg.severity.dev)
|
|
22
|
+
getConsoleLogFunc(msg.severity.dev)(str);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A function which calls all diagnostics handlers passed to it.
|
|
27
|
+
* @beta
|
|
28
|
+
*/
|
|
29
|
+
export function createCombinedDiagnosticsHandler(handlers) {
|
|
30
|
+
return (diagnostics) => {
|
|
31
|
+
handlers.forEach((handler) => handler(diagnostics));
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function handleDiagnosticLogs(logs, messageHandler, stack = []) {
|
|
35
|
+
logs.forEach((log) => {
|
|
36
|
+
if (DiagnosticsLogEntry.isMessage(log)) {
|
|
37
|
+
messageHandler(log, stack);
|
|
38
|
+
}
|
|
39
|
+
else if (log.logs) {
|
|
40
|
+
handleDiagnosticLogs(log.logs, messageHandler, [...stack, log]);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function buildLogMessageString(msg, _stack) {
|
|
45
|
+
return msg.message;
|
|
46
|
+
}
|
|
47
|
+
function getConsoleLogFunc(severity) {
|
|
48
|
+
switch (severity) {
|
|
49
|
+
case "error": return console.error; // eslint-disable-line no-console
|
|
50
|
+
case "warning": return console.warn; // eslint-disable-line no-console
|
|
51
|
+
case "info":
|
|
52
|
+
case "debug":
|
|
53
|
+
case "trace":
|
|
54
|
+
return console.log; // eslint-disable-line no-console
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
57
|
//# sourceMappingURL=Diagnostics.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module Logging
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Logger categories used by this package
|
|
6
|
-
* @note All logger categories in this package start with the `presentation-frontend` prefix.
|
|
7
|
-
* @see [Logger]($bentley)
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
export declare enum PresentationFrontendLoggerCategory {
|
|
11
|
-
Package = "presentation-frontend"
|
|
12
|
-
}
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Logging
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Logger categories used by this package
|
|
6
|
+
* @note All logger categories in this package start with the `presentation-frontend` prefix.
|
|
7
|
+
* @see [Logger]($bentley)
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export declare enum PresentationFrontendLoggerCategory {
|
|
11
|
+
Package = "presentation-frontend"
|
|
12
|
+
}
|
|
13
13
|
//# sourceMappingURL=FrontendLoggerCategory.d.ts.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
/** @packageDocumentation
|
|
6
|
-
* @module Logging
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Logger categories used by this package
|
|
10
|
-
* @note All logger categories in this package start with the `presentation-frontend` prefix.
|
|
11
|
-
* @see [Logger]($bentley)
|
|
12
|
-
* @public
|
|
13
|
-
*/
|
|
14
|
-
export var PresentationFrontendLoggerCategory;
|
|
15
|
-
(function (PresentationFrontendLoggerCategory) {
|
|
16
|
-
PresentationFrontendLoggerCategory["Package"] = "presentation-frontend";
|
|
17
|
-
})(PresentationFrontendLoggerCategory || (PresentationFrontendLoggerCategory = {}));
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module Logging
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Logger categories used by this package
|
|
10
|
+
* @note All logger categories in this package start with the `presentation-frontend` prefix.
|
|
11
|
+
* @see [Logger]($bentley)
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export var PresentationFrontendLoggerCategory;
|
|
15
|
+
(function (PresentationFrontendLoggerCategory) {
|
|
16
|
+
PresentationFrontendLoggerCategory["Package"] = "presentation-frontend";
|
|
17
|
+
})(PresentationFrontendLoggerCategory || (PresentationFrontendLoggerCategory = {}));
|
|
18
18
|
//# sourceMappingURL=FrontendLoggerCategory.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { NodeKey, RulesetVariable, SetRulesetVariableParams, UnsetRulesetVariableParams, UpdateHierarchyStateParams } from "@itwin/presentation-common";
|
|
2
|
-
/** @internal */
|
|
3
|
-
export declare class IpcRequestsHandler {
|
|
4
|
-
readonly clientId: string;
|
|
5
|
-
constructor(clientId: string);
|
|
6
|
-
private call;
|
|
7
|
-
setRulesetVariable(params: Omit<SetRulesetVariableParams<RulesetVariable>, "clientId">): Promise<void>;
|
|
8
|
-
unsetRulesetVariable(params: Omit<UnsetRulesetVariableParams, "clientId">): Promise<void>;
|
|
9
|
-
updateHierarchyState(params: Omit<UpdateHierarchyStateParams<NodeKey>, "clientId">): Promise<void>;
|
|
10
|
-
}
|
|
1
|
+
import { NodeKey, RulesetVariable, SetRulesetVariableParams, UnsetRulesetVariableParams, UpdateHierarchyStateParams } from "@itwin/presentation-common";
|
|
2
|
+
/** @internal */
|
|
3
|
+
export declare class IpcRequestsHandler {
|
|
4
|
+
readonly clientId: string;
|
|
5
|
+
constructor(clientId: string);
|
|
6
|
+
private call;
|
|
7
|
+
setRulesetVariable(params: Omit<SetRulesetVariableParams<RulesetVariable>, "clientId">): Promise<void>;
|
|
8
|
+
unsetRulesetVariable(params: Omit<UnsetRulesetVariableParams, "clientId">): Promise<void>;
|
|
9
|
+
updateHierarchyState(params: Omit<UpdateHierarchyStateParams<NodeKey>, "clientId">): Promise<void>;
|
|
10
|
+
}
|
|
11
11
|
//# sourceMappingURL=IpcRequestsHandler.d.ts.map
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { IpcApp } from "@itwin/core-frontend";
|
|
6
|
-
import { PRESENTATION_IPC_CHANNEL_NAME, RulesetVariable, } from "@itwin/presentation-common";
|
|
7
|
-
/** @internal */
|
|
8
|
-
export class IpcRequestsHandler {
|
|
9
|
-
constructor(clientId) {
|
|
10
|
-
this.clientId = clientId;
|
|
11
|
-
}
|
|
12
|
-
async call(methodName, ...args) {
|
|
13
|
-
return IpcApp.callIpcChannel(PRESENTATION_IPC_CHANNEL_NAME, methodName, ...args);
|
|
14
|
-
}
|
|
15
|
-
async setRulesetVariable(params) {
|
|
16
|
-
const jsonParams = {
|
|
17
|
-
...params,
|
|
18
|
-
clientId: this.clientId,
|
|
19
|
-
variable: RulesetVariable.toJSON(params.variable),
|
|
20
|
-
};
|
|
21
|
-
return this.call("setRulesetVariable", jsonParams);
|
|
22
|
-
}
|
|
23
|
-
async unsetRulesetVariable(params) {
|
|
24
|
-
const jsonParams = {
|
|
25
|
-
...params,
|
|
26
|
-
clientId: this.clientId,
|
|
27
|
-
};
|
|
28
|
-
return this.call("unsetRulesetVariable", jsonParams);
|
|
29
|
-
}
|
|
30
|
-
async updateHierarchyState(params) {
|
|
31
|
-
const jsonParams = {
|
|
32
|
-
...params,
|
|
33
|
-
clientId: this.clientId,
|
|
34
|
-
};
|
|
35
|
-
return this.call("updateHierarchyState", jsonParams);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { IpcApp } from "@itwin/core-frontend";
|
|
6
|
+
import { PRESENTATION_IPC_CHANNEL_NAME, RulesetVariable, } from "@itwin/presentation-common";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export class IpcRequestsHandler {
|
|
9
|
+
constructor(clientId) {
|
|
10
|
+
this.clientId = clientId;
|
|
11
|
+
}
|
|
12
|
+
async call(methodName, ...args) {
|
|
13
|
+
return IpcApp.callIpcChannel(PRESENTATION_IPC_CHANNEL_NAME, methodName, ...args);
|
|
14
|
+
}
|
|
15
|
+
async setRulesetVariable(params) {
|
|
16
|
+
const jsonParams = {
|
|
17
|
+
...params,
|
|
18
|
+
clientId: this.clientId,
|
|
19
|
+
variable: RulesetVariable.toJSON(params.variable),
|
|
20
|
+
};
|
|
21
|
+
return this.call("setRulesetVariable", jsonParams);
|
|
22
|
+
}
|
|
23
|
+
async unsetRulesetVariable(params) {
|
|
24
|
+
const jsonParams = {
|
|
25
|
+
...params,
|
|
26
|
+
clientId: this.clientId,
|
|
27
|
+
};
|
|
28
|
+
return this.call("unsetRulesetVariable", jsonParams);
|
|
29
|
+
}
|
|
30
|
+
async updateHierarchyState(params) {
|
|
31
|
+
const jsonParams = {
|
|
32
|
+
...params,
|
|
33
|
+
clientId: this.clientId,
|
|
34
|
+
};
|
|
35
|
+
return this.call("updateHierarchyState", jsonParams);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
38
|
//# sourceMappingURL=IpcRequestsHandler.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { LocalizationHelper } from "@itwin/presentation-common";
|
|
2
|
-
/** @internal */
|
|
3
|
-
export declare class FrontendLocalizationHelper extends LocalizationHelper {
|
|
4
|
-
private _lang;
|
|
5
|
-
constructor(lang?: string);
|
|
6
|
-
get locale(): string | undefined;
|
|
7
|
-
set locale(locale: string | undefined);
|
|
8
|
-
static registerNamespaces(): Promise<void>;
|
|
9
|
-
static unregisterNamespaces(): void;
|
|
10
|
-
}
|
|
1
|
+
import { LocalizationHelper } from "@itwin/presentation-common";
|
|
2
|
+
/** @internal */
|
|
3
|
+
export declare class FrontendLocalizationHelper extends LocalizationHelper {
|
|
4
|
+
private _lang;
|
|
5
|
+
constructor(lang?: string);
|
|
6
|
+
get locale(): string | undefined;
|
|
7
|
+
set locale(locale: string | undefined);
|
|
8
|
+
static registerNamespaces(): Promise<void>;
|
|
9
|
+
static unregisterNamespaces(): void;
|
|
10
|
+
}
|
|
11
11
|
//# sourceMappingURL=LocalizationHelper.d.ts.map
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { LocalizationHelper } from "@itwin/presentation-common";
|
|
6
|
-
import { Presentation } from "./Presentation";
|
|
7
|
-
const NAMESPACES = ["Presentation"];
|
|
8
|
-
/** @internal */
|
|
9
|
-
export class FrontendLocalizationHelper extends LocalizationHelper {
|
|
10
|
-
constructor(lang) {
|
|
11
|
-
super({ getLocalizedString: (key) => Presentation.localization.getLocalizedString(key, { defaultValue: key, lng: this._lang }) });
|
|
12
|
-
this._lang = lang;
|
|
13
|
-
}
|
|
14
|
-
get locale() {
|
|
15
|
-
return this._lang;
|
|
16
|
-
}
|
|
17
|
-
set locale(locale) {
|
|
18
|
-
this._lang = locale;
|
|
19
|
-
}
|
|
20
|
-
static async registerNamespaces() {
|
|
21
|
-
const localizationPromises = NAMESPACES.map(async (namespace) => Presentation.localization.registerNamespace(namespace));
|
|
22
|
-
await Promise.all(localizationPromises);
|
|
23
|
-
}
|
|
24
|
-
static unregisterNamespaces() {
|
|
25
|
-
NAMESPACES.map((namespace) => Presentation.localization.unregisterNamespace(namespace));
|
|
26
|
-
}
|
|
27
|
-
}
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { LocalizationHelper } from "@itwin/presentation-common";
|
|
6
|
+
import { Presentation } from "./Presentation";
|
|
7
|
+
const NAMESPACES = ["Presentation"];
|
|
8
|
+
/** @internal */
|
|
9
|
+
export class FrontendLocalizationHelper extends LocalizationHelper {
|
|
10
|
+
constructor(lang) {
|
|
11
|
+
super({ getLocalizedString: (key) => Presentation.localization.getLocalizedString(key, { defaultValue: key, lng: this._lang }) });
|
|
12
|
+
this._lang = lang;
|
|
13
|
+
}
|
|
14
|
+
get locale() {
|
|
15
|
+
return this._lang;
|
|
16
|
+
}
|
|
17
|
+
set locale(locale) {
|
|
18
|
+
this._lang = locale;
|
|
19
|
+
}
|
|
20
|
+
static async registerNamespaces() {
|
|
21
|
+
const localizationPromises = NAMESPACES.map(async (namespace) => Presentation.localization.registerNamespace(namespace));
|
|
22
|
+
await Promise.all(localizationPromises);
|
|
23
|
+
}
|
|
24
|
+
static unregisterNamespaces() {
|
|
25
|
+
NAMESPACES.map((namespace) => Presentation.localization.unregisterNamespace(namespace));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
28
|
//# sourceMappingURL=LocalizationHelper.js.map
|
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module Core
|
|
3
|
-
*/
|
|
4
|
-
import { Localization } from "@itwin/core-common";
|
|
5
|
-
import { FavoritePropertiesManager, FavoritePropertiesManagerProps } from "./favorite-properties/FavoritePropertiesManager";
|
|
6
|
-
import { PresentationManager, PresentationManagerProps } from "./PresentationManager";
|
|
7
|
-
import { SelectionManager, SelectionManagerProps } from "./selection/SelectionManager";
|
|
8
|
-
/**
|
|
9
|
-
* Props for initializing [[Presentation]].
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
export interface PresentationProps {
|
|
13
|
-
/** Props for [[PresentationManager]]. */
|
|
14
|
-
presentation?: PresentationManagerProps;
|
|
15
|
-
/** Props for [[SelectionManager]]. */
|
|
16
|
-
selection?: SelectionManagerProps;
|
|
17
|
-
/** Props for [[FavoritePropertiesManager]]. */
|
|
18
|
-
favorites?: FavoritePropertiesManagerProps;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Static class used to statically set up Presentation library for the frontend.
|
|
22
|
-
* Basically what it does is:
|
|
23
|
-
* - Create a singleton [[PresentationManager]] instance
|
|
24
|
-
* - Create a singleton [[SelectionManager]] instance
|
|
25
|
-
* - Create a singleton [[FavoritePropertiesManager]]] instance
|
|
26
|
-
*
|
|
27
|
-
* @public
|
|
28
|
-
*/
|
|
29
|
-
export declare class Presentation {
|
|
30
|
-
private constructor();
|
|
31
|
-
/**
|
|
32
|
-
* Initializes Presentation library for the frontend.
|
|
33
|
-
*
|
|
34
|
-
* Example:
|
|
35
|
-
* ``` ts
|
|
36
|
-
* [[include:Presentation.Frontend.Initialization]]
|
|
37
|
-
* ```
|
|
38
|
-
*
|
|
39
|
-
* The method should be called after a call to [IModelApp.startup]($core-frontend).
|
|
40
|
-
*/
|
|
41
|
-
static initialize(props?: PresentationProps): Promise<void>;
|
|
42
|
-
/**
|
|
43
|
-
* Terminates Presentation library frontend. This method should be called
|
|
44
|
-
* before a call to [IModelApp.shutdown]($core-frontend)
|
|
45
|
-
*/
|
|
46
|
-
static terminate(): void;
|
|
47
|
-
/**
|
|
48
|
-
* Registers an additional handler which will be invoked during Presentation library frontend
|
|
49
|
-
* initialization.
|
|
50
|
-
*/
|
|
51
|
-
static registerInitializationHandler(handler: () => Promise<() => void>): void;
|
|
52
|
-
/** The singleton [[PresentationManager]] */
|
|
53
|
-
static get presentation(): PresentationManager;
|
|
54
|
-
/** @internal */
|
|
55
|
-
static setPresentationManager(value: PresentationManager): void;
|
|
56
|
-
/** The singleton [[SelectionManager]] */
|
|
57
|
-
static get selection(): SelectionManager;
|
|
58
|
-
/** @internal */
|
|
59
|
-
static setSelectionManager(value: SelectionManager): void;
|
|
60
|
-
/**
|
|
61
|
-
* The singleton [[FavoritePropertiesManager]]
|
|
62
|
-
* @public
|
|
63
|
-
*/
|
|
64
|
-
static get favoriteProperties(): FavoritePropertiesManager;
|
|
65
|
-
/** @internal */
|
|
66
|
-
static setFavoritePropertiesManager(value: FavoritePropertiesManager): void;
|
|
67
|
-
/**
|
|
68
|
-
* The localization manager used by Presentation frontend. Returns the result of `IModelApp.i18n`.
|
|
69
|
-
*/
|
|
70
|
-
static get localization(): Localization;
|
|
71
|
-
/** @internal */
|
|
72
|
-
static setLocalization(value: Localization): void;
|
|
73
|
-
}
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Core
|
|
3
|
+
*/
|
|
4
|
+
import { Localization } from "@itwin/core-common";
|
|
5
|
+
import { FavoritePropertiesManager, FavoritePropertiesManagerProps } from "./favorite-properties/FavoritePropertiesManager";
|
|
6
|
+
import { PresentationManager, PresentationManagerProps } from "./PresentationManager";
|
|
7
|
+
import { SelectionManager, SelectionManagerProps } from "./selection/SelectionManager";
|
|
8
|
+
/**
|
|
9
|
+
* Props for initializing [[Presentation]].
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export interface PresentationProps {
|
|
13
|
+
/** Props for [[PresentationManager]]. */
|
|
14
|
+
presentation?: PresentationManagerProps;
|
|
15
|
+
/** Props for [[SelectionManager]]. */
|
|
16
|
+
selection?: SelectionManagerProps;
|
|
17
|
+
/** Props for [[FavoritePropertiesManager]]. */
|
|
18
|
+
favorites?: FavoritePropertiesManagerProps;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Static class used to statically set up Presentation library for the frontend.
|
|
22
|
+
* Basically what it does is:
|
|
23
|
+
* - Create a singleton [[PresentationManager]] instance
|
|
24
|
+
* - Create a singleton [[SelectionManager]] instance
|
|
25
|
+
* - Create a singleton [[FavoritePropertiesManager]]] instance
|
|
26
|
+
*
|
|
27
|
+
* @public
|
|
28
|
+
*/
|
|
29
|
+
export declare class Presentation {
|
|
30
|
+
private constructor();
|
|
31
|
+
/**
|
|
32
|
+
* Initializes Presentation library for the frontend.
|
|
33
|
+
*
|
|
34
|
+
* Example:
|
|
35
|
+
* ``` ts
|
|
36
|
+
* [[include:Presentation.Frontend.Initialization]]
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* The method should be called after a call to [IModelApp.startup]($core-frontend).
|
|
40
|
+
*/
|
|
41
|
+
static initialize(props?: PresentationProps): Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* Terminates Presentation library frontend. This method should be called
|
|
44
|
+
* before a call to [IModelApp.shutdown]($core-frontend)
|
|
45
|
+
*/
|
|
46
|
+
static terminate(): void;
|
|
47
|
+
/**
|
|
48
|
+
* Registers an additional handler which will be invoked during Presentation library frontend
|
|
49
|
+
* initialization.
|
|
50
|
+
*/
|
|
51
|
+
static registerInitializationHandler(handler: () => Promise<() => void>): void;
|
|
52
|
+
/** The singleton [[PresentationManager]] */
|
|
53
|
+
static get presentation(): PresentationManager;
|
|
54
|
+
/** @internal */
|
|
55
|
+
static setPresentationManager(value: PresentationManager): void;
|
|
56
|
+
/** The singleton [[SelectionManager]] */
|
|
57
|
+
static get selection(): SelectionManager;
|
|
58
|
+
/** @internal */
|
|
59
|
+
static setSelectionManager(value: SelectionManager): void;
|
|
60
|
+
/**
|
|
61
|
+
* The singleton [[FavoritePropertiesManager]]
|
|
62
|
+
* @public
|
|
63
|
+
*/
|
|
64
|
+
static get favoriteProperties(): FavoritePropertiesManager;
|
|
65
|
+
/** @internal */
|
|
66
|
+
static setFavoritePropertiesManager(value: FavoritePropertiesManager): void;
|
|
67
|
+
/**
|
|
68
|
+
* The localization manager used by Presentation frontend. Returns the result of `IModelApp.i18n`.
|
|
69
|
+
*/
|
|
70
|
+
static get localization(): Localization;
|
|
71
|
+
/** @internal */
|
|
72
|
+
static setLocalization(value: Localization): void;
|
|
73
|
+
}
|
|
74
74
|
//# sourceMappingURL=Presentation.d.ts.map
|