@itwin/appui-react 3.0.0-dev.87 → 3.0.0-dev.88
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/appui-react/UiFramework.d.ts.map +1 -1
- package/lib/cjs/appui-react/UiFramework.js +7 -2
- package/lib/cjs/appui-react/UiFramework.js.map +1 -1
- package/lib/cjs/appui-react/frontstage/Frontstage.d.ts +0 -1
- package/lib/cjs/appui-react/frontstage/Frontstage.d.ts.map +1 -1
- package/lib/cjs/appui-react/frontstage/Frontstage.js +0 -6
- package/lib/cjs/appui-react/frontstage/Frontstage.js.map +1 -1
- package/lib/cjs/appui-react/widget-panels/Content.d.ts.map +1 -1
- package/lib/cjs/appui-react/widget-panels/Content.js +0 -8
- package/lib/cjs/appui-react/widget-panels/Content.js.map +1 -1
- package/lib/cjs/appui-react/widgets/WidgetManager.d.ts +0 -38
- package/lib/cjs/appui-react/widgets/WidgetManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/widgets/WidgetManager.js +2 -55
- package/lib/cjs/appui-react/widgets/WidgetManager.js.map +1 -1
- package/lib/esm/appui-react/UiFramework.d.ts.map +1 -1
- package/lib/esm/appui-react/UiFramework.js +7 -2
- package/lib/esm/appui-react/UiFramework.js.map +1 -1
- package/lib/esm/appui-react/frontstage/Frontstage.d.ts +0 -1
- package/lib/esm/appui-react/frontstage/Frontstage.d.ts.map +1 -1
- package/lib/esm/appui-react/frontstage/Frontstage.js +0 -6
- package/lib/esm/appui-react/frontstage/Frontstage.js.map +1 -1
- package/lib/esm/appui-react/widget-panels/Content.d.ts.map +1 -1
- package/lib/esm/appui-react/widget-panels/Content.js +0 -8
- package/lib/esm/appui-react/widget-panels/Content.js.map +1 -1
- package/lib/esm/appui-react/widgets/WidgetManager.d.ts +0 -38
- package/lib/esm/appui-react/widgets/WidgetManager.d.ts.map +1 -1
- package/lib/esm/appui-react/widgets/WidgetManager.js +1 -53
- package/lib/esm/appui-react/widgets/WidgetManager.js.map +1 -1
- package/package.json +39 -39
|
@@ -21,49 +21,20 @@ export interface WidgetInfo {
|
|
|
21
21
|
export interface WidgetsChangedEventArgs {
|
|
22
22
|
readonly items: ReadonlyArray<WidgetInfo>;
|
|
23
23
|
}
|
|
24
|
-
/** Event class for [[this.onWidgetProvidersChanged]].
|
|
25
|
-
* @internal
|
|
26
|
-
*/
|
|
27
|
-
export declare class WidgetProvidersChangedEvent extends BeUiEvent<WidgetProvidersChangedEventArgs> {
|
|
28
|
-
}
|
|
29
|
-
/** Arguments of [[this.onWidgetProvidersChanged]] event.
|
|
30
|
-
* @internal
|
|
31
|
-
*/
|
|
32
|
-
export interface WidgetProvidersChangedEventArgs {
|
|
33
|
-
readonly providers: ReadonlyArray<WidgetProvider>;
|
|
34
|
-
}
|
|
35
24
|
/** Event class for [[this.onWidgetsChanged]].
|
|
36
25
|
* @internal
|
|
37
26
|
*/
|
|
38
27
|
export declare class WidgetsChangedEvent extends BeUiEvent<WidgetsChangedEventArgs> {
|
|
39
28
|
}
|
|
40
|
-
/** Widget Provider interface.
|
|
41
|
-
* @beta
|
|
42
|
-
*/
|
|
43
|
-
export interface WidgetProvider {
|
|
44
|
-
/** Id of provider */
|
|
45
|
-
readonly id: string;
|
|
46
|
-
/** Get WidgetDefs matching the given criteria.
|
|
47
|
-
* @note It is recommended to provide custom unique ids to returned widget defs.
|
|
48
|
-
* Semi-stable id is used when auto-generated `widgetDef` id is detected,
|
|
49
|
-
* but correctness of such id depends on widget index in the returned array.
|
|
50
|
-
*/
|
|
51
|
-
getWidgetDefs(stageId: string, stageUsage: string, location: ZoneLocation | StagePanelLocation, section?: StagePanelSection, frontstageApplicationData?: any): ReadonlyArray<WidgetDef> | undefined;
|
|
52
|
-
}
|
|
53
29
|
/** Widget Manager class.
|
|
54
30
|
* @beta
|
|
55
31
|
*/
|
|
56
32
|
export declare class WidgetManager {
|
|
57
33
|
private _widgets;
|
|
58
|
-
private _providers;
|
|
59
34
|
/** Event raised when Widgets are changed.
|
|
60
35
|
* @internal
|
|
61
36
|
*/
|
|
62
37
|
readonly onWidgetsChanged: WidgetsChangedEvent;
|
|
63
|
-
/** Event raised when WidgetProviders are changed.
|
|
64
|
-
* @internal
|
|
65
|
-
*/
|
|
66
|
-
readonly onWidgetProvidersChanged: WidgetProvidersChangedEvent;
|
|
67
38
|
/** @internal */
|
|
68
39
|
get widgetCount(): number;
|
|
69
40
|
/** @internal */
|
|
@@ -78,15 +49,6 @@ export declare class WidgetManager {
|
|
|
78
49
|
/** Removes a WidgetDef.
|
|
79
50
|
*/
|
|
80
51
|
removeWidgetDef(widgetId: string): boolean;
|
|
81
|
-
/** @internal */
|
|
82
|
-
get providers(): ReadonlyArray<WidgetProvider>;
|
|
83
|
-
set providers(p: ReadonlyArray<WidgetProvider>);
|
|
84
|
-
/** Adds a WidgetDef Provider
|
|
85
|
-
*/
|
|
86
|
-
addWidgetProvider(widgetProvider: WidgetProvider): void;
|
|
87
|
-
/** Removes a WidgetDef Provider
|
|
88
|
-
*/
|
|
89
|
-
removeWidgetProvider(providerId: string): boolean;
|
|
90
52
|
private getStagePanelLocationFromZoneLocation;
|
|
91
53
|
/** Gets WidgetDefs for a Frontstage location.
|
|
92
54
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WidgetManager.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/widgets/WidgetManager.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAU,MAAM,qBAAqB,CAAC;AACxD,OAAO,
|
|
1
|
+
{"version":3,"file":"WidgetManager.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/widgets/WidgetManager.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAU,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAA6C,kBAAkB,EAAE,iBAAiB,EAAkB,MAAM,uBAAuB,CAAC;AAEzI,OAAO,EAAwB,YAAY,EAAE,MAAM,eA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AAG,aAAa,CAAC,SAAS,CAAC,GAAG,SAAS;CA0CzE"}
|
|
@@ -8,19 +8,13 @@
|
|
|
8
8
|
* @module Widget
|
|
9
9
|
*/
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.WidgetManager = exports.WidgetsChangedEvent =
|
|
11
|
+
exports.WidgetManager = exports.WidgetsChangedEvent = void 0;
|
|
12
12
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
13
13
|
const appui_abstract_1 = require("@itwin/appui-abstract");
|
|
14
14
|
const UiFramework_1 = require("../UiFramework");
|
|
15
15
|
const Zone_1 = require("../zones/Zone");
|
|
16
16
|
const WidgetDef_1 = require("./WidgetDef");
|
|
17
17
|
const StableWidgetDef_1 = require("./StableWidgetDef");
|
|
18
|
-
/** Event class for [[this.onWidgetProvidersChanged]].
|
|
19
|
-
* @internal
|
|
20
|
-
*/
|
|
21
|
-
class WidgetProvidersChangedEvent extends core_bentley_1.BeUiEvent {
|
|
22
|
-
}
|
|
23
|
-
exports.WidgetProvidersChangedEvent = WidgetProvidersChangedEvent;
|
|
24
18
|
/** Event class for [[this.onWidgetsChanged]].
|
|
25
19
|
* @internal
|
|
26
20
|
*/
|
|
@@ -36,9 +30,6 @@ function getLocationName(location) {
|
|
|
36
30
|
function getWidgetManagerStableWidgetId(stageUsage, location, section, index) {
|
|
37
31
|
return `uifw-wm-${stageUsage || ""}-${getLocationName(location)}-${appui_abstract_1.StagePanelSection[section]}-${index}`;
|
|
38
32
|
}
|
|
39
|
-
function getWidgetProviderStableWidgetId(providerId, stageUsage, location, section, index) {
|
|
40
|
-
return `uifw-wp-${providerId}-${stageUsage}-${getLocationName(location)}-${appui_abstract_1.StagePanelSection[section]}-${index}`;
|
|
41
|
-
}
|
|
42
33
|
function getAddonStableWidgetId(stageUsage, location, section, index) {
|
|
43
34
|
return `uifw-addon-${stageUsage}-${appui_abstract_1.StagePanelLocation[location]}-${appui_abstract_1.StagePanelSection[section]}-${index}`;
|
|
44
35
|
}
|
|
@@ -48,15 +39,10 @@ function getAddonStableWidgetId(stageUsage, location, section, index) {
|
|
|
48
39
|
class WidgetManager {
|
|
49
40
|
constructor() {
|
|
50
41
|
this._widgets = [];
|
|
51
|
-
this._providers = [];
|
|
52
42
|
/** Event raised when Widgets are changed.
|
|
53
43
|
* @internal
|
|
54
44
|
*/
|
|
55
45
|
this.onWidgetsChanged = new WidgetsChangedEvent();
|
|
56
|
-
/** Event raised when WidgetProviders are changed.
|
|
57
|
-
* @internal
|
|
58
|
-
*/
|
|
59
|
-
this.onWidgetProvidersChanged = new WidgetProvidersChangedEvent();
|
|
60
46
|
}
|
|
61
47
|
/** @internal */
|
|
62
48
|
get widgetCount() {
|
|
@@ -106,33 +92,6 @@ class WidgetManager {
|
|
|
106
92
|
}
|
|
107
93
|
return result;
|
|
108
94
|
}
|
|
109
|
-
/** @internal */
|
|
110
|
-
get providers() { return this._providers; }
|
|
111
|
-
set providers(p) {
|
|
112
|
-
this._providers = p;
|
|
113
|
-
this.onWidgetProvidersChanged.emit({ providers: p });
|
|
114
|
-
}
|
|
115
|
-
/** Adds a WidgetDef Provider
|
|
116
|
-
*/
|
|
117
|
-
addWidgetProvider(widgetProvider) {
|
|
118
|
-
const oldProviders = this._providers.filter((p) => p.id !== widgetProvider.id);
|
|
119
|
-
const updatedProviders = [
|
|
120
|
-
...oldProviders,
|
|
121
|
-
widgetProvider,
|
|
122
|
-
];
|
|
123
|
-
this.providers = updatedProviders;
|
|
124
|
-
}
|
|
125
|
-
/** Removes a WidgetDef Provider
|
|
126
|
-
*/
|
|
127
|
-
removeWidgetProvider(providerId) {
|
|
128
|
-
let result = false;
|
|
129
|
-
const updatedProviders = this._providers.filter((p) => p.id !== providerId);
|
|
130
|
-
if (updatedProviders.length !== this._providers.length) {
|
|
131
|
-
this.providers = updatedProviders;
|
|
132
|
-
result = true;
|
|
133
|
-
}
|
|
134
|
-
return result;
|
|
135
|
-
}
|
|
136
95
|
// Used when WidgetDefs are requested from UiItemProviders when uiVersion="1"
|
|
137
96
|
getStagePanelLocationFromZoneLocation(location) {
|
|
138
97
|
switch (location) {
|
|
@@ -159,19 +118,7 @@ class WidgetManager {
|
|
|
159
118
|
&& info.location === location
|
|
160
119
|
&& info.section === definedSection;
|
|
161
120
|
});
|
|
162
|
-
|
|
163
|
-
// Consult the registered WidgetProviders
|
|
164
|
-
this._providers.forEach((p, index) => {
|
|
165
|
-
const wds = p.getWidgetDefs(stageId, stageUsage, location, definedSection, frontstageApplicationData);
|
|
166
|
-
// istanbul ignore else
|
|
167
|
-
if (wds) {
|
|
168
|
-
const stableWds = wds.map((wd) => {
|
|
169
|
-
const stableId = getWidgetProviderStableWidgetId(p.id, stageUsage, location, definedSection, index);
|
|
170
|
-
return (0, StableWidgetDef_1.createStableWidgetDef)(wd, stableId);
|
|
171
|
-
});
|
|
172
|
-
widgetDefs = widgetDefs.concat(stableWds);
|
|
173
|
-
}
|
|
174
|
-
});
|
|
121
|
+
const widgetDefs = widgetInfos.map((info) => info.widgetDef);
|
|
175
122
|
// Consult the UiItemsManager to get any Abstract widgets
|
|
176
123
|
if (location in appui_abstract_1.StagePanelLocation) {
|
|
177
124
|
const widgets = appui_abstract_1.UiItemsManager.getWidgets(stageId, stageUsage, location, definedSection, frontstageApplicationData);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WidgetManager.js","sourceRoot":"","sources":["../../../../src/appui-react/widgets/WidgetManager.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F,4CAA4C;AAC5C;;GAEG;;;AAEH,sDAAwD;AACxD,0DAAoH;AACpH,gDAA6C;AAC7C,wCAAmE;AACnE,2CAAwC;AACxC,uDAA0D;AAoB1D;;GAEG;AACH,MAAa,2BAA4B,SAAQ,wBAA0C;CAAI;AAA/F,kEAA+F;AAS/F;;GAEG;AACH,MAAa,mBAAoB,SAAQ,wBAAkC;CAAI;AAA/E,kDAA+E;AAiB/E,SAAS,cAAc,CAAC,QAA2C;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F;SACF;QAED,OAAO,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;IACxD,CAAC;CACF;AAlLD,sCAkLC","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/* eslint-disable deprecation/deprecation */\r\n/** @packageDocumentation\r\n * @module Widget\r\n */\r\n\r\nimport { BeUiEvent, Logger } from \"@itwin/core-bentley\";\r\nimport { AbstractZoneLocation, StagePanelLocation, StagePanelSection, UiItemsManager } from \"@itwin/appui-abstract\";\r\nimport { UiFramework } from \"../UiFramework\";\r\nimport { getStableWidgetProps, ZoneLocation } from \"../zones/Zone\";\r\nimport { WidgetDef } from \"./WidgetDef\";\r\nimport { createStableWidgetDef } from \"./StableWidgetDef\";\r\n\r\n/** Information about WidgetDefs in the WidgetManager\r\n * @internal\r\n */\r\nexport interface WidgetInfo {\r\n widgetDef: WidgetDef;\r\n stageId?: string;\r\n stageUsage?: string;\r\n location: ZoneLocation | StagePanelLocation;\r\n section: StagePanelSection;\r\n}\r\n\r\n/** Arguments of [[this.onWidgetsChanged]] event.\r\n * @internal\r\n */\r\nexport interface WidgetsChangedEventArgs {\r\n readonly items: ReadonlyArray<WidgetInfo>;\r\n}\r\n\r\n/** Event class for [[this.onWidgetProvidersChanged]].\r\n * @internal\r\n */\r\nexport class WidgetProvidersChangedEvent extends BeUiEvent<WidgetProvidersChangedEventArgs> { }\r\n\r\n/** Arguments of [[this.onWidgetProvidersChanged]] event.\r\n * @internal\r\n */\r\nexport interface WidgetProvidersChangedEventArgs {\r\n readonly providers: ReadonlyArray<WidgetProvider>;\r\n}\r\n\r\n/** Event class for [[this.onWidgetsChanged]].\r\n * @internal\r\n */\r\nexport class WidgetsChangedEvent extends BeUiEvent<WidgetsChangedEventArgs> { }\r\n\r\n/** Widget Provider interface.\r\n * @beta\r\n */\r\nexport interface WidgetProvider {\r\n /** Id of provider */\r\n readonly id: string;\r\n /** Get WidgetDefs matching the given criteria.\r\n * @note It is recommended to provide custom unique ids to returned widget defs.\r\n * Semi-stable id is used when auto-generated `widgetDef` id is detected,\r\n * but correctness of such id depends on widget index in the returned array.\r\n */\r\n getWidgetDefs(stageId: string, stageUsage: string, location: ZoneLocation | StagePanelLocation,\r\n section?: StagePanelSection, frontstageApplicationData?: any): ReadonlyArray<WidgetDef> | undefined;\r\n}\r\n\r\nfunction isZoneLocation(location: ZoneLocation | StagePanelLocation): location is ZoneLocation {\r\n return location >= ZoneLocation.TopLeft && location <= ZoneLocation.BottomRight;\r\n}\r\n\r\nfunction getLocationName(location: ZoneLocation | StagePanelLocation) {\r\n return isZoneLocation(location) ? ZoneLocation[location] : StagePanelLocation[location];\r\n}\r\n\r\nfunction getWidgetManagerStableWidgetId(stageUsage: string | undefined, location: ZoneLocation | StagePanelLocation, section: StagePanelSection,\r\n index: number) {\r\n return `uifw-wm-${stageUsage || \"\"}-${getLocationName(location)}-${StagePanelSection[section]}-${index}`;\r\n}\r\n\r\nfunction getWidgetProviderStableWidgetId(providerId: string, stageUsage: string, location: ZoneLocation | StagePanelLocation,\r\n section: StagePanelSection, index: number) {\r\n return `uifw-wp-${providerId}-${stageUsage}-${getLocationName(location)}-${StagePanelSection[section]}-${index}`;\r\n}\r\n\r\nfunction getAddonStableWidgetId(stageUsage: string, location: StagePanelLocation, section: StagePanelSection, index: number) {\r\n return `uifw-addon-${stageUsage}-${StagePanelLocation[location]}-${StagePanelSection[section]}-${index}`;\r\n}\r\n\r\n/** Widget Manager class.\r\n * @beta\r\n */\r\nexport class WidgetManager {\r\n private _widgets: ReadonlyArray<WidgetInfo> = [];\r\n private _providers: ReadonlyArray<WidgetProvider> = [];\r\n\r\n /** Event raised when Widgets are changed.\r\n * @internal\r\n */\r\n public readonly onWidgetsChanged = new WidgetsChangedEvent();\r\n\r\n /** Event raised when WidgetProviders are changed.\r\n * @internal\r\n */\r\n public readonly onWidgetProvidersChanged = new WidgetProvidersChangedEvent();\r\n\r\n /** @internal */\r\n public get widgetCount(): number {\r\n return this._widgets.length;\r\n }\r\n\r\n /** @internal */\r\n public get widgets(): ReadonlyArray<WidgetInfo> { return this._widgets; }\r\n public set widgets(w: ReadonlyArray<WidgetInfo>) {\r\n this._widgets = w;\r\n this.onWidgetsChanged.emit({ items: w });\r\n }\r\n\r\n /** Adds a WidgetDef for use in a Frontstage.\r\n * @note Added `widgetDef` must return unique id to correctly save/restore App layout.\r\n * Semi-stable id is generated when auto-generated `widgetDef` id is detected,\r\n * but correctness of such id depends on `addWidgetDef` call order and widget location.\r\n */\r\n public addWidgetDef(widgetDef: WidgetDef, stageId: string | undefined, stageUsage: string | undefined, location: ZoneLocation | StagePanelLocation, section?: StagePanelSection): boolean {\r\n if (stageId === undefined && stageUsage === undefined) {\r\n Logger.logError(UiFramework.loggerCategory(this), `addWidgetDef: stageId or stageUsage param must be specified`);\r\n return false;\r\n }\r\n\r\n section = (section !== undefined) ? section : StagePanelSection.Start;\r\n const index = this._widgets.reduce((acc, info) => {\r\n if (info.stageId === stageId && info.stageUsage === stageUsage && info.location === location && info.section === section)\r\n return acc + 1;\r\n return acc;\r\n }, 0);\r\n const stableId = getWidgetManagerStableWidgetId(stageUsage, location, section, index);\r\n const stableWidget = createStableWidgetDef(widgetDef, stableId);\r\n const newWidget: WidgetInfo = { widgetDef: stableWidget, stageId, stageUsage, location, section };\r\n\r\n const oldWidgets = this._widgets.filter((info) => info.widgetDef.id !== newWidget.widgetDef.id);\r\n const updatedWidgets = [\r\n ...oldWidgets,\r\n newWidget,\r\n ];\r\n this.widgets = updatedWidgets;\r\n\r\n return true;\r\n }\r\n\r\n /** Removes a WidgetDef.\r\n */\r\n public removeWidgetDef(widgetId: string): boolean {\r\n let result = false;\r\n const updatedWidgets = this._widgets.filter((info) => info.widgetDef.id !== widgetId);\r\n\r\n if (updatedWidgets.length !== this._widgets.length) {\r\n this.widgets = updatedWidgets;\r\n result = true;\r\n }\r\n\r\n return result;\r\n }\r\n\r\n /** @internal */\r\n public get providers(): ReadonlyArray<WidgetProvider> { return this._providers; }\r\n public set providers(p: ReadonlyArray<WidgetProvider>) {\r\n this._providers = p;\r\n this.onWidgetProvidersChanged.emit({ providers: p });\r\n }\r\n\r\n /** Adds a WidgetDef Provider\r\n */\r\n public addWidgetProvider(widgetProvider: WidgetProvider): void {\r\n const oldProviders = this._providers.filter((p) => p.id !== widgetProvider.id);\r\n const updatedProviders = [\r\n ...oldProviders,\r\n widgetProvider,\r\n ];\r\n this.providers = updatedProviders;\r\n }\r\n\r\n /** Removes a WidgetDef Provider\r\n */\r\n public removeWidgetProvider(providerId: string): boolean {\r\n let result = false;\r\n const updatedProviders = this._providers.filter((p) => p.id !== providerId);\r\n\r\n if (updatedProviders.length !== this._providers.length) {\r\n this.providers = updatedProviders;\r\n result = true;\r\n }\r\n\r\n return result;\r\n }\r\n\r\n // Used when WidgetDefs are requested from UiItemProviders when uiVersion=\"1\"\r\n private getStagePanelLocationFromZoneLocation(location: ZoneLocation): StagePanelLocation | undefined {\r\n switch (location) {\r\n case ZoneLocation.BottomCenter:\r\n case ZoneLocation.TopCenter:\r\n case ZoneLocation.TopRight:\r\n case ZoneLocation.TopLeft:\r\n return undefined; // an existing stage does not support appending widgets to these zones\r\n case ZoneLocation.BottomLeft:\r\n case ZoneLocation.CenterLeft:\r\n return StagePanelLocation.Left;\r\n case ZoneLocation.BottomRight:\r\n case ZoneLocation.CenterRight:\r\n return StagePanelLocation.Right;\r\n }\r\n }\r\n\r\n /** Gets WidgetDefs for a Frontstage location.\r\n */\r\n public getWidgetDefs(stageId: string, stageUsage: string, location: ZoneLocation | StagePanelLocation, section?: StagePanelSection,\r\n frontstageApplicationData?: any): ReadonlyArray<WidgetDef> | undefined {\r\n const definedSection = section === undefined ? StagePanelSection.Start : section;\r\n\r\n const widgetInfos = this._widgets.filter((info) => {\r\n return (!info.stageId || info.stageId === stageId)\r\n && (!info.stageUsage || info.stageUsage === stageUsage)\r\n && info.location === location\r\n && info.section === definedSection;\r\n });\r\n\r\n let widgetDefs = widgetInfos.map((info) => info.widgetDef);\r\n\r\n // Consult the registered WidgetProviders\r\n this._providers.forEach((p, index) => {\r\n const wds = p.getWidgetDefs(stageId, stageUsage, location, definedSection, frontstageApplicationData);\r\n // istanbul ignore else\r\n if (wds) {\r\n const stableWds = wds.map((wd) => {\r\n const stableId = getWidgetProviderStableWidgetId(p.id, stageUsage, location, definedSection, index);\r\n return createStableWidgetDef(wd, stableId);\r\n });\r\n widgetDefs = widgetDefs.concat(stableWds);\r\n }\r\n });\r\n\r\n // Consult the UiItemsManager to get any Abstract widgets\r\n if (location in StagePanelLocation) {\r\n const widgets = UiItemsManager.getWidgets(stageId, stageUsage, location as StagePanelLocation, definedSection, frontstageApplicationData);\r\n widgets.forEach((abstractProps, index) => {\r\n const props = WidgetDef.createWidgetPropsFromAbstractProps(abstractProps);\r\n const stableId = getAddonStableWidgetId(stageUsage, location as StagePanelLocation, definedSection, index);\r\n const stableProps = getStableWidgetProps(props, stableId);\r\n const wd = new WidgetDef(stableProps);\r\n widgetDefs.push(wd);\r\n });\r\n } else {\r\n // istanbul ignore else\r\n if (location in ZoneLocation) {\r\n const panelLocation = this.getStagePanelLocationFromZoneLocation(location as ZoneLocation);\r\n // istanbul ignore else\r\n if (panelLocation && location in AbstractZoneLocation) {\r\n const widgets = UiItemsManager.getWidgets(stageId, stageUsage, panelLocation, undefined, location as unknown as AbstractZoneLocation, frontstageApplicationData);\r\n widgets.forEach((abstractProps, index) => {\r\n const props = WidgetDef.createWidgetPropsFromAbstractProps(abstractProps);\r\n const stableId = getAddonStableWidgetId(stageUsage, location as StagePanelLocation, definedSection, index);\r\n const stableProps = getStableWidgetProps(props, stableId);\r\n const wd = new WidgetDef(stableProps);\r\n widgetDefs.push(wd);\r\n });\r\n }\r\n }\r\n }\r\n\r\n return widgetDefs.length > 0 ? wid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C,CAAC;gBAC1D,MAAM,EAAE,GAAG,IAAI,qBAAS,CAAC,WAAW,CAAC,CAAC;gBACtC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACtB,CAAC,CAAC,CAAC;SACJ;aAAM;YACL,uBAAuB;YACvB,IAAI,QAAQ,IAAI,mBAAY,EAAE;gBAC5B,MAAM,aAAa,GAAG,IAAI,CAAC,qCAAqC,CAAC,QAAwB,CAAC,CAAC;gBAC3F,uBAAuB;gBACvB,IAAI,aAAa,IAAI,QAAQ,IAAI,qCAAoB,EAAE;oBACrD,MAAM,OAAO,GAAG,+BAAc,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,QAA2C,EAAE,yBAAyB,CAAC,CAAC;oBACjK,OAAO,CAAC,OAAO,CAAC,CAAC,aAAkC,EAAE,KAAa,EAAE,EAAE;wBACpE,MAAM,KAAK,GAAG,qBAAS,CAAC,kCAAkC,CAAC,aAAa,CAAC,CAAC;wBAC1E,MAAM,QAAQ,GAAG,sBAAsB,CAAC,UAAU,EAAE,QAA8B,EAAE,cAAc,EAAE,KAAK,CAAC,CAAC;wBAC3G,MAAM,WAAW,GAAG,IAAA,2BAAoB,EAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;wBAC1D,MAAM,EAAE,GAAG,IAAI,qBAAS,CAAC,WAAW,CAAC,CAAC;wBACtC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;oBACtB,CAAC,CAAC,CAAC;iBACJ;aACF;SACF;QAED,OAAO,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;IACxD,CAAC;CACF;AA/HD,sCA+HC","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/* eslint-disable deprecation/deprecation */\r\n/** @packageDocumentation\r\n * @module Widget\r\n */\r\n\r\nimport { BeUiEvent, Logger } from \"@itwin/core-bentley\";\r\nimport { AbstractWidgetProps, AbstractZoneLocation, StagePanelLocation, StagePanelSection, UiItemsManager } from \"@itwin/appui-abstract\";\r\nimport { UiFramework } from \"../UiFramework\";\r\nimport { getStableWidgetProps, ZoneLocation } from \"../zones/Zone\";\r\nimport { WidgetDef } from \"./WidgetDef\";\r\nimport { createStableWidgetDef } from \"./StableWidgetDef\";\r\n\r\n/** Information about WidgetDefs in the WidgetManager\r\n * @internal\r\n */\r\nexport interface WidgetInfo {\r\n widgetDef: WidgetDef;\r\n stageId?: string;\r\n stageUsage?: string;\r\n location: ZoneLocation | StagePanelLocation;\r\n section: StagePanelSection;\r\n}\r\n\r\n/** Arguments of [[this.onWidgetsChanged]] event.\r\n * @internal\r\n */\r\nexport interface WidgetsChangedEventArgs {\r\n readonly items: ReadonlyArray<WidgetInfo>;\r\n}\r\n\r\n/** Event class for [[this.onWidgetsChanged]].\r\n * @internal\r\n */\r\nexport class WidgetsChangedEvent extends BeUiEvent<WidgetsChangedEventArgs> { }\r\n\r\nfunction isZoneLocation(location: ZoneLocation | StagePanelLocation): location is ZoneLocation {\r\n return location >= ZoneLocation.TopLeft && location <= ZoneLocation.BottomRight;\r\n}\r\n\r\nfunction getLocationName(location: ZoneLocation | StagePanelLocation) {\r\n return isZoneLocation(location) ? ZoneLocation[location] : StagePanelLocation[location];\r\n}\r\n\r\nfunction getWidgetManagerStableWidgetId(stageUsage: string | undefined, location: ZoneLocation | StagePanelLocation, section: StagePanelSection,\r\n index: number) {\r\n return `uifw-wm-${stageUsage || \"\"}-${getLocationName(location)}-${StagePanelSection[section]}-${index}`;\r\n}\r\n\r\nfunction getAddonStableWidgetId(stageUsage: string, location: StagePanelLocation, section: StagePanelSection, index: number) {\r\n return `uifw-addon-${stageUsage}-${StagePanelLocation[location]}-${StagePanelSection[section]}-${index}`;\r\n}\r\n\r\n/** Widget Manager class.\r\n * @beta\r\n */\r\nexport class WidgetManager {\r\n private _widgets: ReadonlyArray<WidgetInfo> = [];\r\n\r\n /** Event raised when Widgets are changed.\r\n * @internal\r\n */\r\n public readonly onWidgetsChanged = new WidgetsChangedEvent();\r\n\r\n /** @internal */\r\n public get widgetCount(): number {\r\n return this._widgets.length;\r\n }\r\n\r\n /** @internal */\r\n public get widgets(): ReadonlyArray<WidgetInfo> { return this._widgets; }\r\n public set widgets(w: ReadonlyArray<WidgetInfo>) {\r\n this._widgets = w;\r\n this.onWidgetsChanged.emit({ items: w });\r\n }\r\n\r\n /** Adds a WidgetDef for use in a Frontstage.\r\n * @note Added `widgetDef` must return unique id to correctly save/restore App layout.\r\n * Semi-stable id is generated when auto-generated `widgetDef` id is detected,\r\n * but correctness of such id depends on `addWidgetDef` call order and widget location.\r\n */\r\n public addWidgetDef(widgetDef: WidgetDef, stageId: string | undefined, stageUsage: string | undefined, location: ZoneLocation | StagePanelLocation, section?: StagePanelSection): boolean {\r\n if (stageId === undefined && stageUsage === undefined) {\r\n Logger.logError(UiFramework.loggerCategory(this), `addWidgetDef: stageId or stageUsage param must be specified`);\r\n return false;\r\n }\r\n\r\n section = (section !== undefined) ? section : StagePanelSection.Start;\r\n const index = this._widgets.reduce((acc, info) => {\r\n if (info.stageId === stageId && info.stageUsage === stageUsage && info.location === location && info.section === section)\r\n return acc + 1;\r\n return acc;\r\n }, 0);\r\n const stableId = getWidgetManagerStableWidgetId(stageUsage, location, section, index);\r\n const stableWidget = createStableWidgetDef(widgetDef, stableId);\r\n const newWidget: WidgetInfo = { widgetDef: stableWidget, stageId, stageUsage, location, section };\r\n\r\n const oldWidgets = this._widgets.filter((info) => info.widgetDef.id !== newWidget.widgetDef.id);\r\n const updatedWidgets = [\r\n ...oldWidgets,\r\n newWidget,\r\n ];\r\n this.widgets = updatedWidgets;\r\n\r\n return true;\r\n }\r\n\r\n /** Removes a WidgetDef.\r\n */\r\n public removeWidgetDef(widgetId: string): boolean {\r\n let result = false;\r\n const updatedWidgets = this._widgets.filter((info) => info.widgetDef.id !== widgetId);\r\n\r\n if (updatedWidgets.length !== this._widgets.length) {\r\n this.widgets = updatedWidgets;\r\n result = true;\r\n }\r\n\r\n return result;\r\n }\r\n\r\n // Used when WidgetDefs are requested from UiItemProviders when uiVersion=\"1\"\r\n private getStagePanelLocationFromZoneLocation(location: ZoneLocation): StagePanelLocation | undefined {\r\n switch (location) {\r\n case ZoneLocation.BottomCenter:\r\n case ZoneLocation.TopCenter:\r\n case ZoneLocation.TopRight:\r\n case ZoneLocation.TopLeft:\r\n return undefined; // an existing stage does not support appending widgets to these zones\r\n case ZoneLocation.BottomLeft:\r\n case ZoneLocation.CenterLeft:\r\n return StagePanelLocation.Left;\r\n case ZoneLocation.BottomRight:\r\n case ZoneLocation.CenterRight:\r\n return StagePanelLocation.Right;\r\n }\r\n }\r\n\r\n /** Gets WidgetDefs for a Frontstage location.\r\n */\r\n public getWidgetDefs(stageId: string, stageUsage: string, location: ZoneLocation | StagePanelLocation, section?: StagePanelSection,\r\n frontstageApplicationData?: any): ReadonlyArray<WidgetDef> | undefined {\r\n const definedSection = section === undefined ? StagePanelSection.Start : section;\r\n\r\n const widgetInfos = this._widgets.filter((info) => {\r\n return (!info.stageId || info.stageId === stageId)\r\n && (!info.stageUsage || info.stageUsage === stageUsage)\r\n && info.location === location\r\n && info.section === definedSection;\r\n });\r\n\r\n const widgetDefs = widgetInfos.map((info) => info.widgetDef);\r\n\r\n // Consult the UiItemsManager to get any Abstract widgets\r\n if (location in StagePanelLocation) {\r\n const widgets = UiItemsManager.getWidgets(stageId, stageUsage, location as StagePanelLocation, definedSection, frontstageApplicationData);\r\n widgets.forEach((abstractProps: AbstractWidgetProps, index: number) => {\r\n const props = WidgetDef.createWidgetPropsFromAbstractProps(abstractProps);\r\n const stableId = getAddonStableWidgetId(stageUsage, location as StagePanelLocation, definedSection, index);\r\n const stableProps = getStableWidgetProps(props, stableId);\r\n const wd = new WidgetDef(stableProps);\r\n widgetDefs.push(wd);\r\n });\r\n } else {\r\n // istanbul ignore else\r\n if (location in ZoneLocation) {\r\n const panelLocation = this.getStagePanelLocationFromZoneLocation(location as ZoneLocation);\r\n // istanbul ignore else\r\n if (panelLocation && location in AbstractZoneLocation) {\r\n const widgets = UiItemsManager.getWidgets(stageId, stageUsage, panelLocation, undefined, location as unknown as AbstractZoneLocation, frontstageApplicationData);\r\n widgets.forEach((abstractProps: AbstractWidgetProps, index: number) => {\r\n const props = WidgetDef.createWidgetPropsFromAbstractProps(abstractProps);\r\n const stableId = getAddonStableWidgetId(stageUsage, location as StagePanelLocation, definedSection, index);\r\n const stableProps = getStableWidgetProps(props, stableId);\r\n const wd = new WidgetDef(stableProps);\r\n widgetDefs.push(wd);\r\n });\r\n }\r\n }\r\n }\r\n\r\n return widgetDefs.length > 0 ? widgetDefs : undefined;\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiFramework.d.ts","sourceRoot":"","sources":["../../../src/appui-react/UiFramework.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,UAAU,EAA2B,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAe,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAa,gBAAgB,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAIxF,OAAO,EAAwB,eAAe,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtG,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAGtE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,0BAA0B,EAAwB,MAAM,sBAAsB,CAAC;AAExG,OAAO,EAA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,CAG7C;CAEF"}
|
|
@@ -80,7 +80,10 @@ export class UiFramework {
|
|
|
80
80
|
Logger.logInfo(UiFramework.loggerCategory(UiFramework), `UiFramework.initialize already called`);
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
83
|
-
|
|
83
|
+
/* if store is undefined then the StateManager class should have been initialized by parent app and the apps default set of reducers registered with it.
|
|
84
|
+
If the app has no reducers to add and does not initialize a StateManager then just initialize the StateManager with the default framework reducer now */
|
|
85
|
+
if (undefined === store && !StateManager.isInitialized(true))
|
|
86
|
+
new StateManager();
|
|
84
87
|
UiFramework._store = store;
|
|
85
88
|
UiFramework._localization = localization || IModelApp.localization;
|
|
86
89
|
// ignore setting _frameworkStateKeyInStore if not using store
|
|
@@ -115,6 +118,8 @@ export class UiFramework {
|
|
|
115
118
|
static terminate() {
|
|
116
119
|
UiFramework._store = undefined;
|
|
117
120
|
UiFramework._frameworkStateKeyInStore = "frameworkState";
|
|
121
|
+
if (StateManager.isInitialized(true))
|
|
122
|
+
StateManager.clearStore();
|
|
118
123
|
if (UiFramework._localization)
|
|
119
124
|
UiFramework._localization.unregisterNamespace(UiFramework.localizationNamespace);
|
|
120
125
|
UiFramework._localization = undefined;
|
|
@@ -157,7 +162,7 @@ export class UiFramework {
|
|
|
157
162
|
return UiFramework._store;
|
|
158
163
|
// istanbul ignore else
|
|
159
164
|
if (!StateManager.isInitialized(true))
|
|
160
|
-
throw new UiError(UiFramework.loggerCategory(this),
|
|
165
|
+
throw new UiError(UiFramework.loggerCategory(this), `Error trying to access redux store before either store or StateManager has been initialized.`);
|
|
161
166
|
// istanbul ignore next
|
|
162
167
|
return StateManager.store;
|
|
163
168
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiFramework.js","sourceRoot":"","sources":["../../../src/appui-react/UiFramework.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAKH,OAAO,EAAc,MAAM,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAA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AC,MAAM,GAAE;IACZ,CAAC;IASD;;SAEK;IACE,MAAM,KAAK,iBAAiB;QACjC,MAAM,WAAW,GAAG,QAAQ,CAAC,aAAa,CAAC,8BAA8B,CAAC,CAAC;QAC3E,OAAO,WAAW,KAAK,IAAI,IAAI,WAAW,KAAK,SAAS,CAAC;IAC3D,CAAC;;AA/cc,wBAAY,GAAG,KAAK,CAAC;AAGrB,sBAAU,GAAG,6BAA6B,CAAC;AAC3C,qCAAyB,GAAW,gBAAgB,CAAC,CAAE,eAAe;AAGtE,sBAAU,GAAG,EAAE,CAAC;AAEhB,8BAAkB,GAAsB,IAAI,oBAAoB,EAAE,CAAC,CAAC,wDAAwD;AAE5H,uCAA2B,GAAsC,IAAI,GAAG,EAAgC,CAAC;AACzG,+BAAmB,GAAG,IAAI,kBAAkB,EAAE,CAAC;AAChD,+BAAmB,GAAG,KAAK,CAAC;AAoB1C;;GAEG;AACoB,iCAAqB,GAAG,IAAI,wBAAwB,EAAE,CAAC;AAE9E;;GAEG;AACoB,0CAA8B,GAAG,IAAI,4BAA4B,EAAE,CAAC;AAwZ5E,+CAAmC,GAAG,CAAC,IAAsC,EAAE,EAAE;IAC9F,sBAAsB;IACtB,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,yBAAyB,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;IAClG,mEAAmE;IACnE,WAAW,CAAC,aAAa,CAAC,yBAAyB,IAAI,CAAC,OAAO,GAAG,EAAE,sCAAsC,CAAC,CAAC;IAC5G,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACzC,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utilities\r\n */\r\n\r\n// cSpell:ignore configurableui clientservices\r\n\r\nimport { Store } from \"redux\";\r\nimport { GuidString, Logger, ProcessDetector } from \"@itwin/core-bentley\";\r\nimport { Localization, RpcActivity } from \"@itwin/core-common\";\r\nimport { IModelApp, IModelConnection, SnapMode, ViewState } from \"@itwin/core-frontend\";\r\nimport { Presentation } from \"@itwin/presentation-frontend\";\r\nimport { TelemetryEvent } from \"@bentley/telemetry-client\";\r\nimport { getClassName, UiAbstract, UiError } from \"@itwin/appui-abstract\";\r\nimport { LocalSettingsStorage, SettingsManager, UiEvent, UiSettingsStorage } from \"@itwin/core-react\";\r\nimport { UiIModelComponents } from \"@itwin/imodel-components-react\";\r\nimport { BackstageManager } from \"./backstage/BackstageManager\";\r\nimport { ChildWindowManager } from \"./childwindow/ChildWindowManager\";\r\nimport { ConfigurableUiManager } from \"./configurableui/ConfigurableUiManager\";\r\nimport { ConfigurableUiActionId } from \"./configurableui/state\";\r\nimport { FrameworkState } from \"./redux/FrameworkState\";\r\nimport { CursorMenuData, PresentationSelectionScope, SessionStateActionId } from \"./redux/SessionState\";\r\nimport { StateManager } from \"./redux/StateManager\";\r\nimport { HideIsolateEmphasizeActionHandler, HideIsolateEmphasizeManager } from \"./selection/HideIsolateEmphasizeManager\";\r\nimport { SyncUiEventDispatcher, SyncUiEventId } from \"./syncui/SyncUiEventDispatcher\";\r\nimport { SYSTEM_PREFERRED_COLOR_THEME, WIDGET_OPACITY_DEFAULT } from \"./theme/ThemeManager\";\r\nimport * as keyinPaletteTools from \"./tools/KeyinPaletteTools\";\r\nimport * as openSettingTools from \"./tools/OpenSettingsTool\";\r\nimport * as restoreLayoutTools from \"./tools/RestoreLayoutTool\";\r\nimport * as toolSettingTools from \"./tools/ToolSettingsTools\";\r\nimport { UserInfo } from \"./UserInfo\";\r\nimport { UiShowHideManager, UiShowHideSettingsProvider } from \"./utils/UiShowHideManager\";\r\nimport { WidgetManager } from \"./widgets/WidgetManager\";\r\nimport { FrontstageManager } from \"./frontstage/FrontstageManager\";\r\n\r\n// cSpell:ignore Mobi\r\n\r\n/** Interface to be implemented but any classes that wants to load their user settings when the UiSetting storage class is set.\r\n * @public\r\n */\r\nexport interface UserSettingsProvider {\r\n /** Unique provider Id */\r\n providerId: string;\r\n /** Function to load settings from settings storage */\r\n loadUserSettings(storage: UiSettingsStorage): Promise<void>;\r\n}\r\n\r\n/** UiVisibility Event Args interface.\r\n * @public\r\n */\r\nexport interface UiVisibilityEventArgs {\r\n visible: boolean;\r\n}\r\n\r\n/** UiVisibility Event class.\r\n * @public\r\n */\r\nexport class UiVisibilityChangedEvent extends UiEvent<UiVisibilityEventArgs> { }\r\n\r\n/** FrameworkVersion Changed Event Args interface.\r\n * @internal\r\n */\r\nexport interface FrameworkVersionChangedEventArgs {\r\n oldVersion: string;\r\n version: string;\r\n}\r\n\r\n/** FrameworkVersion Changed Event class.\r\n * @internal\r\n */\r\nexport class FrameworkVersionChangedEvent extends UiEvent<FrameworkVersionChangedEventArgs> { }\r\n\r\n/** TrackingTime time argument used by our feature tracking manager as an option argument to the TelemetryClient\r\n * @internal\r\n */\r\nexport interface TrackingTime {\r\n startTime: Date;\r\n endTime: Date;\r\n}\r\n\r\n/**\r\n * Manages the Redux store, localization service and iModel, Project and Login services for the ui-framework package.\r\n * @public\r\n */\r\nexport class UiFramework {\r\n private static _initialized = false;\r\n private static _localization?: Localization;\r\n private static _store?: Store<any>;\r\n private static _complaint = \"UiFramework not initialized\";\r\n private static _frameworkStateKeyInStore: string = \"frameworkState\"; // default name\r\n private static _backstageManager?: BackstageManager;\r\n private static _widgetManager?: WidgetManager;\r\n private static _uiVersion = \"\";\r\n private static _hideIsolateEmphasizeActionHandler?: HideIsolateEmphasizeActionHandler;\r\n private static _uiSettingsStorage: UiSettingsStorage = new LocalSettingsStorage(); // this provides a default storage location for settings\r\n private static _settingsManager?: SettingsManager;\r\n private static _uiSettingsProviderRegistry: Map<string, UserSettingsProvider> = new Map<string, UserSettingsProvider>();\r\n private static _PopupWindowManager = new ChildWindowManager();\r\n public static useDefaultPopoutUrl = false;\r\n\r\n /** @public */\r\n public static get childWindowManager(): ChildWindowManager {\r\n return UiFramework._PopupWindowManager;\r\n }\r\n\r\n /** Registers class that will be informed when the UserSettingsStorage location has been set or changed. This allows\r\n * classes to load any previously saved settings from the new storage location. Common storage locations are the browser's\r\n * local storage, or the iTwin Product Settings cloud storage available via the SettingsAdmin see `IModelApp.settingsAdmin`.\r\n * @beta\r\n */\r\n public static registerUserSettingsProvider(entry: UserSettingsProvider) {\r\n if (this._uiSettingsProviderRegistry.has(entry.providerId))\r\n return false;\r\n\r\n this._uiSettingsProviderRegistry.set(entry.providerId, entry);\r\n return true;\r\n }\r\n\r\n /** Get Show Ui event.\r\n * @public\r\n */\r\n public static readonly onUiVisibilityChanged = new UiVisibilityChangedEvent();\r\n\r\n /** Get FrameworkVersion Changed event.\r\n * @internal\r\n */\r\n public static readonly onFrameworkVersionChangedEvent = new FrameworkVersionChangedEvent();\r\n\r\n /**\r\n * Called by the application to initialize the UiFramework. Also initializes UIIModelComponents, UiComponents, UiCore and UiAbstract.\r\n * @param store The single Redux store created by the host application. If this is `undefined` then it is assumed that the [[StateManager]] is being used to provide the Redux store.\r\n * @param localization The internationalization service created by the application. Defaults to IModelApp.localization.\r\n * @param frameworkStateKey The name of the key used by the app when adding the UiFramework state into the Redux store. If not defined \"frameworkState\" is assumed. This value is ignored if [[StateManager]] is being used. The StateManager use \"frameworkState\".\r\n */\r\n public static async initialize(store: Store<any> | undefined, localization?: Localization, frameworkStateKey?: string): Promise<void> {\r\n return this.initializeEx(store, localization, frameworkStateKey);\r\n }\r\n\r\n /**\r\n * Called by the application to initialize the UiFramework. Also initializes UIIModelComponents, UiComponents, UiCore and UiAbstract.\r\n * @param store The single Redux store created by the host application. If this is `undefined` then it is assumed that the [[StateManager]] is being used to provide the Redux store.\r\n * @param localization The internationalization service created by the application. Defaults to IModelApp.localization.\r\n * @param frameworkStateKey The name of the key used by the app when adding the UiFramework state into the Redux store. If not defined \"frameworkState\" is assumed. This value is ignored if [[StateManager]] is being used. The StateManager use \"frameworkState\".\r\n *\r\n * @internal\r\n */\r\n public static async initializeEx(store: Store<any> | undefined, localization?: Localization, frameworkStateKey?: string): Promise<void> {\r\n if (UiFramework._initialized) {\r\n Logger.logInfo(UiFramework.loggerCategory(UiFramework), `UiFramework.initialize already called`);\r\n return;\r\n }\r\n\r\n // if store is undefined then the StateManager class should have been initialized by parent app and the apps default set of reducer registered with it.\r\n UiFramework._store = store;\r\n UiFramework._localization = localization || IModelApp.localization;\r\n // ignore setting _frameworkStateKeyInStore if not using store\r\n if (frameworkStateKey && store)\r\n UiFramework._frameworkStateKeyInStore = frameworkStateKey;\r\n\r\n // set up namespace and register all tools from package\r\n const frameworkNamespace = UiFramework._localization.registerNamespace(UiFramework.localizationNamespace);\r\n [\r\n restoreLayoutTools,\r\n keyinPaletteTools,\r\n openSettingTools,\r\n toolSettingTools,\r\n ].forEach((tool) => IModelApp.tools.registerModule(tool, this.localizationNamespace));\r\n\r\n UiFramework._backstageManager = new BackstageManager();\r\n UiFramework._hideIsolateEmphasizeActionHandler = new HideIsolateEmphasizeManager(); // this allows user to override the default HideIsolateEmphasizeManager implementation.\r\n UiFramework._widgetManager = new WidgetManager();\r\n\r\n UiFramework.onFrameworkVersionChangedEvent.addListener(UiFramework._handleFrameworkVersionChangedEvent);\r\n\r\n // Initialize ui-imodel-components, ui-components, ui-core & ui-abstract\r\n await UiIModelComponents.initialize(UiFramework._localization);\r\n\r\n UiFramework.settingsManager.onSettingsProvidersChanged.addListener(() => {\r\n SyncUiEventDispatcher.dispatchSyncUiEvent(SyncUiEventId.SettingsProvidersChanged);\r\n });\r\n\r\n // Initialize the MessagePresenter interface in UiAbstract for Editor notifications\r\n UiAbstract.messagePresenter = IModelApp.notifications;\r\n\r\n UiFramework._initialized = true;\r\n\r\n // initialize any standalone settings providers that don't need to have defaults set by iModelApp\r\n UiShowHideSettingsProvider.initialize();\r\n\r\n ConfigurableUiManager.initialize();\r\n\r\n return frameworkNamespace;\r\n }\r\n\r\n /** Un-registers the UiFramework internationalization service namespace */\r\n public static terminate() {\r\n UiFramework._store = undefined;\r\n UiFramework._frameworkStateKeyInStore = \"frameworkState\";\r\n\r\n if (UiFramework._localization)\r\n UiFramework._localization.unregisterNamespace(UiFramework.localizationNamespace);\r\n UiFramework._localization = undefined;\r\n UiFramework._backstageManager = undefined;\r\n UiFramework._widgetManager = undefined;\r\n UiFramework._hideIsolateEmphasizeActionHandler = undefined;\r\n UiFramework._settingsManager = undefined;\r\n\r\n UiFramework.onFrameworkVersionChangedEvent.removeListener(UiFramework._handleFrameworkVersionChangedEvent);\r\n\r\n UiIModelComponents.terminate();\r\n UiFramework._initialized = false;\r\n }\r\n\r\n /** Determines if UiFramework has been initialized */\r\n public static get initialized(): boolean { return UiFramework._initialized; }\r\n\r\n /** Property that returns the SettingManager used by AppUI-based applications.\r\n * @public */\r\n public static get settingsManager() {\r\n if (undefined === UiFramework._settingsManager)\r\n UiFramework._settingsManager = new SettingsManager();\r\n return UiFramework._settingsManager;\r\n }\r\n\r\n /** @public */\r\n public static get frameworkStateKey(): string {\r\n return UiFramework._frameworkStateKeyInStore;\r\n }\r\n\r\n /** The UiFramework state maintained by Redux\r\n * @public\r\n */\r\n public static get frameworkState(): FrameworkState | undefined {\r\n try {\r\n // eslint-disable-next-line dot-notation\r\n return UiFramework.store.getState()[UiFramework.frameworkStateKey];\r\n } catch (_e) {\r\n return undefined;\r\n }\r\n }\r\n\r\n /** The Redux store */\r\n public static get store(): Store<any> {\r\n if (UiFramework._store)\r\n return UiFramework._store;\r\n\r\n // istanbul ignore else\r\n if (!StateManager.isInitialized(true))\r\n throw new UiError(UiFramework.loggerCategory(this), UiFramework._complaint);\r\n\r\n // istanbul ignore next\r\n return StateManager.store;\r\n }\r\n\r\n /** The internationalization service created by the app. */\r\n public static get localization(): Localization {\r\n if (!UiFramework._localization)\r\n throw new UiError(UiFramework.loggerCategory(this), UiFramework._complaint);\r\n return UiFramework._localization;\r\n }\r\n\r\n /** The internationalization service namespace. */\r\n public static get localizationNamespace(): string {\r\n return \"UiFramework\";\r\n }\r\n\r\n /** @public */\r\n public static get backstageManager(): BackstageManager {\r\n // istanbul ignore next\r\n if (!UiFramework._backstageManager)\r\n throw new UiError(UiFramework.loggerCategory(this), UiFramework._complaint);\r\n return UiFramework._backstageManager;\r\n }\r\n\r\n /** @alpha */\r\n public static get hideIsolateEmphasizeActionHandler(): HideIsolateEmphasizeActionHandler {\r\n // istanbul ignore next\r\n if (!UiFramework._hideIsolateEmphasizeActionHandler)\r\n throw new UiError(UiFramework.loggerCategory(this), UiFramework._complaint);\r\n return UiFramework._hideIsolateEmphasizeActionHandler;\r\n }\r\n\r\n /** @alpha */\r\n public static setHideIsolateEmphasizeActionHandler(handler: HideIsolateEmphasizeActionHandler | undefined) {\r\n // istanbul ignore else\r\n if (handler)\r\n UiFramework._hideIsolateEmphasizeActionHandler = handler;\r\n else\r\n UiFramework._hideIsolateEmphasizeActionHandler = new HideIsolateEmphasizeManager();\r\n }\r\n\r\n /** @alpha */\r\n public static get widgetManager(): WidgetManager {\r\n // istanbul ignore next\r\n if (!UiFramework._widgetManager)\r\n throw new UiError(UiFramework.loggerCategory(this), UiFramework._complaint);\r\n return UiFramework._widgetManager;\r\n }\r\n\r\n /** Calls localization.getLocalizedStringWithNamespace with the \"UiFramework\" namespace. Do NOT include the namespace in the key.\r\n * @internal\r\n */\r\n public static translate(key: string | string[]): string {\r\n return UiFramework.localization.getLocalizedStringWithNamespace(UiFramework.localizationNamespace, key);\r\n }\r\n\r\n /** @internal */\r\n public static get packageName(): string {\r\n return \"appui-react\";\r\n }\r\n\r\n /** @internal */\r\n public static loggerCategory(obj: any): string {\r\n const className = getClassName(obj);\r\n const category = UiFramework.packageName + (className ? `.${className}` : \"\");\r\n return category;\r\n }\r\n\r\n public static dispatchActionToStore(type: string, payload: any, immediateSync = false) {\r\n UiFramework.store.dispatch({ type, payload });\r\n if (immediateSync)\r\n SyncUiEventDispatcher.dispatchImmediateSyncUiEvent(type);\r\n else\r\n SyncUiEventDispatcher.dispatchSyncUiEvent(type);\r\n }\r\n\r\n public static setAccudrawSnapMode(snapMode: SnapMode) {\r\n UiFramework.dispatchActionToStore(ConfigurableUiActionId.SetSnapMode, snapMode, true);\r\n }\r\n\r\n public static getAccudrawSnapMode(): SnapMode {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.configurableUiState.snapMode : /* istanbul ignore next */ SnapMode.NearestKeypoint;\r\n }\r\n\r\n public static getActiveSelectionScope(): string {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.sessionState.activeSelectionScope : /* istanbul ignore next */ \"element\";\r\n }\r\n\r\n public static setActiveSelectionScope(selectionScopeId: string): void {\r\n // istanbul ignore else\r\n if (UiFramework.frameworkState) {\r\n const foundIndex = UiFramework.frameworkState.sessionState.availableSelectionScopes.findIndex((selectionScope: PresentationSelectionScope) => selectionScope.id === selectionScopeId);\r\n if (-1 !== foundIndex) {\r\n const scope = UiFramework.frameworkState.sessionState.availableSelectionScopes[foundIndex];\r\n UiFramework.dispatchActionToStore(SessionStateActionId.SetSelectionScope, scope.id);\r\n Presentation.selection.scopes.activeScope = scope.id;\r\n }\r\n }\r\n }\r\n\r\n /** @public */\r\n public static openCursorMenu(menuData: CursorMenuData | undefined): void {\r\n UiFramework.dispatchActionToStore(SessionStateActionId.UpdateCursorMenu, menuData);\r\n }\r\n\r\n /** @public */\r\n public static closeCursorMenu(): void {\r\n UiFramework.dispatchActionToStore(SessionStateActionId.UpdateCursorMenu, undefined);\r\n }\r\n\r\n /** @public */\r\n public static getCursorMenuData(): CursorMenuData | undefined {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.sessionState.cursorMenuData : /* istanbul ignore next */ undefined;\r\n }\r\n\r\n public static getActiveIModelId(): string {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.sessionState.iModelId : /* istanbul ignore next */ \"\";\r\n }\r\n\r\n public static setActiveIModelId(iModelId: string): void {\r\n UiFramework.dispatchActionToStore(SessionStateActionId.SetActiveIModelId, iModelId);\r\n }\r\n\r\n public static setIModelConnection(iModelConnection: IModelConnection | undefined, immediateSync = false) {\r\n const oldConnection = UiFramework.getIModelConnection();\r\n if (oldConnection !== iModelConnection) {\r\n if (oldConnection?.iModelId)\r\n FrontstageManager.clearFrontstageDefsForIModelId(oldConnection?.iModelId);\r\n oldConnection && undefined === iModelConnection && SyncUiEventDispatcher.clearConnectionEvents(oldConnection);\r\n iModelConnection && SyncUiEventDispatcher.initializeConnectionEvents(iModelConnection);\r\n UiFramework.dispatchActionToStore(SessionStateActionId.SetIModelConnection, iModelConnection, immediateSync);\r\n }\r\n UiFramework.setActiveIModelId(iModelConnection?.iModelId ?? \"\");\r\n }\r\n\r\n public static getIModelConnection(): IModelConnection | undefined {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.sessionState.iModelConnection : /* istanbul ignore next */ undefined;\r\n }\r\n\r\n /** @public */\r\n public static async setUiSettingsStorage(storage: UiSettingsStorage, immediateSync = false) {\r\n if (UiFramework._uiSettingsStorage === storage)\r\n return;\r\n\r\n UiFramework._uiSettingsStorage = storage;\r\n\r\n // let any registered providers to load values from the new storage location\r\n const providerKeys = [...this._uiSettingsProviderRegistry.keys()];\r\n for await (const key of providerKeys) {\r\n await this._uiSettingsProviderRegistry.get(key)!.loadUserSettings(storage);\r\n }\r\n\r\n // istanbul ignore next\r\n if (immediateSync)\r\n SyncUiEventDispatcher.dispatchImmediateSyncUiEvent(SyncUiEventId.UiSettingsChanged);\r\n else\r\n SyncUiEventDispatcher.dispatchSyncUiEvent(SyncUiEventId.UiSettingsChanged);\r\n }\r\n\r\n /** @public */\r\n public static getUiSettingsStorage(): UiSettingsStorage {\r\n return UiFramework._uiSettingsStorage;\r\n }\r\n\r\n /** @public */\r\n public static setUserInfo(userInfo: UserInfo | undefined, immediateSync = false) {\r\n UiFramework.dispatchActionToStore(SessionStateActionId.SetUserInfo, userInfo, immediateSync);\r\n }\r\n\r\n /** @public */\r\n public static getUserInfo(): UserInfo | undefined {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.sessionState.userInfo : /* istanbul ignore next */ undefined;\r\n }\r\n\r\n public static setDefaultIModelViewportControlId(iModelViewportControlId: string, immediateSync = false) {\r\n UiFramework.dispatchActionToStore(SessionStateActionId.SetDefaultIModelViewportControlId, iModelViewportControlId, immediateSync);\r\n }\r\n\r\n public static getDefaultIModelViewportControlId(): string | undefined {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.sessionState.defaultIModelViewportControlId : /* istanbul ignore next */ undefined;\r\n }\r\n\r\n public static setDefaultViewId(viewId: string, immediateSync = false) {\r\n UiFramework.dispatchActionToStore(SessionStateActionId.SetDefaultViewId, viewId, immediateSync);\r\n }\r\n\r\n public static getDefaultViewId(): string | undefined {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.sessionState.defaultViewId : /* istanbul ignore next */ undefined;\r\n }\r\n\r\n public static setDefaultViewState(viewState: ViewState, immediateSync = false) {\r\n UiFramework.dispatchActionToStore(SessionStateActionId.SetDefaultViewState, viewState, immediateSync);\r\n }\r\n public static getDefaultViewState(): ViewState | undefined {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.sessionState.defaultViewState : /* istanbul ignore next */ undefined;\r\n }\r\n\r\n /** @public */\r\n public static getAvailableSelectionScopes(): PresentationSelectionScope[] {\r\n return UiFramework.frameworkState ?\r\n UiFramework.frameworkState.sessionState.availableSelectionScopes :\r\n /* istanbul ignore next */\r\n [{ id: \"element\", label: \"Element\" } as PresentationSelectionScope];\r\n }\r\n\r\n public static getIsUiVisible() {\r\n return UiShowHideManager.isUiVisible;\r\n }\r\n\r\n public static setIsUiVisible(visible: boolean) {\r\n if (UiShowHideManager.isUiVisible !== visible) {\r\n UiShowHideManager.isUiVisible = visible;\r\n UiFramework.onUiVisibilityChanged.emit({ visible });\r\n }\r\n }\r\n\r\n public static setColorTheme(theme: string) {\r\n if (UiFramework.getColorTheme() === theme)\r\n return;\r\n\r\n UiFramework.dispatchActionToStore(ConfigurableUiActionId.SetTheme, theme, true);\r\n }\r\n\r\n public static getColorTheme(): string {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.configurableUiState.theme : /* istanbul ignore next */ SYSTEM_PREFERRED_COLOR_THEME;\r\n }\r\n\r\n public static setWidgetOpacity(opacity: number) {\r\n if (UiFramework.getWidgetOpacity() === opacity)\r\n return;\r\n\r\n UiFramework.dispatchActionToStore(ConfigurableUiActionId.SetWidgetOpacity, opacity, true);\r\n }\r\n\r\n public static getWidgetOpacity(): number {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.configurableUiState.widgetOpacity : /* istanbul ignore next */ WIDGET_OPACITY_DEFAULT;\r\n }\r\n\r\n public static isMobile() { // eslint-disable-line @itwin/prefer-get\r\n return ProcessDetector.isMobileBrowser;\r\n }\r\n\r\n /** Returns the Ui Version.\r\n * @public\r\n */\r\n public static get uiVersion(): string {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.configurableUiState.frameworkVersion : this._uiVersion;\r\n }\r\n\r\n public static setUiVersion(version: string) {\r\n if (UiFramework.uiVersion === version)\r\n return;\r\n\r\n UiFramework.dispatchActionToStore(ConfigurableUiActionId.SetFrameworkVersion, version === \"1\" ? \"1\" : \"2\", true);\r\n }\r\n\r\n public static get useDragInteraction(): boolean {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.configurableUiState.useDragInteraction : false;\r\n }\r\n\r\n public static setUseDragInteraction(useDragInteraction: boolean) {\r\n UiFramework.dispatchActionToStore(ConfigurableUiActionId.SetDragInteraction, useDragInteraction, true);\r\n }\r\n\r\n /** Send logging message to the telemetry system\r\n * @internal\r\n */\r\n // istanbul ignore next\r\n public static async postTelemetry(eventName: string, eventId?: GuidString, iTwinId?: GuidString, iModeId?: GuidString, changeSetId?: string, time?: TrackingTime, additionalProperties?: { [key: string]: any }): Promise<void> {\r\n if (!IModelApp.authorizationClient)\r\n return;\r\n\r\n try {\r\n const activity: RpcActivity = {\r\n sessionId: IModelApp.sessionId,\r\n activityId: \"\",\r\n applicationId: IModelApp.applicationId,\r\n applicationVersion: IModelApp.applicationVersion,\r\n accessToken: (await IModelApp.authorizationClient.getAccessToken()) ?? \"\",\r\n };\r\n const telemetryEvent = new TelemetryEvent(eventName, eventId, iTwinId, iModeId, changeSetId, time, additionalProperties);\r\n await IModelApp.telemetry.postTelemetry(activity, telemetryEvent);\r\n } catch {}\r\n }\r\n private static _handleFrameworkVersionChangedEvent = (args: FrameworkVersionChangedEventArgs) => {\r\n // Log Ui Version used\r\n Logger.logInfo(UiFramework.loggerCategory(UiFramework), `Ui Version changed to ${args.version} `);\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n UiFramework.postTelemetry(`Ui Version changed to ${args.version} `, \"F2772C81-962D-4755-807C-2D675A5FF399\");\r\n UiFramework.setUiVersion(args.version);\r\n };\r\n\r\n /** Determines whether a ContextMenu is open\r\n * @alpha\r\n * */\r\n public static get isContextMenuOpen(): boolean {\r\n const contextMenu = document.querySelector(\"div.core-context-menu-opened\");\r\n return contextMenu !== null && contextMenu !== undefined;\r\n }\r\n\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"UiFramework.js","sourceRoot":"","sources":["../../../src/appui-react/UiFramework.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAKH,OAAO,EAAc,MAAM,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE1E,OAAO,EAAE,SAAS,EAAoB,QAAQ,EAAa,MAAM,sBAAsB,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,OAAO,EAAqB,MAAM,mBAAmB,CAAC;AACtG,OAAO,EAAE,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AAI,IAAI,WAAW,KAAK,SAAS,CAAC;IAC3D,CAAC;;AApdc,wBAAY,GAAG,KAAK,CAAC;AAGrB,sBAAU,GAAG,6BAA6B,CAAC;AAC3C,qCAAyB,GAAW,gBAAgB,CAAC,CAAE,eAAe;AAGtE,sBAAU,GAAG,EAAE,CAAC;AAEhB,8BAAkB,GAAsB,IAAI,oBAAoB,EAAE,CAAC,CAAC,wDAAwD;AAE5H,uCAA2B,GAAsC,IAAI,GAAG,EAAgC,CAAC;AACzG,+BAAmB,GAAG,IAAI,kBAAkB,EAAE,CAAC;AAChD,+BAAmB,GAAG,KAAK,CAAC;AAoB1C;;GAEG;AACoB,iCAAqB,GAAG,IAAI,wBAAwB,EAAE,CAAC;AAE9E;;GAEG;AACoB,0CAA8B,GAAG,IAAI,4BAA4B,EAAE,CAAC;AA6Z5E,+CAAmC,GAAG,CAAC,IAAsC,EAAE,EAAE;IAC9F,sBAAsB;IACtB,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,yBAAyB,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;IAClG,mEAAmE;IACnE,WAAW,CAAC,aAAa,CAAC,yBAAyB,IAAI,CAAC,OAAO,GAAG,EAAE,sCAAsC,CAAC,CAAC;IAC5G,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACzC,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utilities\r\n */\r\n\r\n// cSpell:ignore configurableui clientservices\r\n\r\nimport { Store } from \"redux\";\r\nimport { GuidString, Logger, ProcessDetector } from \"@itwin/core-bentley\";\r\nimport { Localization, RpcActivity } from \"@itwin/core-common\";\r\nimport { IModelApp, IModelConnection, SnapMode, ViewState } from \"@itwin/core-frontend\";\r\nimport { Presentation } from \"@itwin/presentation-frontend\";\r\nimport { TelemetryEvent } from \"@bentley/telemetry-client\";\r\nimport { getClassName, UiAbstract, UiError } from \"@itwin/appui-abstract\";\r\nimport { LocalSettingsStorage, SettingsManager, UiEvent, UiSettingsStorage } from \"@itwin/core-react\";\r\nimport { UiIModelComponents } from \"@itwin/imodel-components-react\";\r\nimport { BackstageManager } from \"./backstage/BackstageManager\";\r\nimport { ChildWindowManager } from \"./childwindow/ChildWindowManager\";\r\nimport { ConfigurableUiManager } from \"./configurableui/ConfigurableUiManager\";\r\nimport { ConfigurableUiActionId } from \"./configurableui/state\";\r\nimport { FrameworkState } from \"./redux/FrameworkState\";\r\nimport { CursorMenuData, PresentationSelectionScope, SessionStateActionId } from \"./redux/SessionState\";\r\nimport { StateManager } from \"./redux/StateManager\";\r\nimport { HideIsolateEmphasizeActionHandler, HideIsolateEmphasizeManager } from \"./selection/HideIsolateEmphasizeManager\";\r\nimport { SyncUiEventDispatcher, SyncUiEventId } from \"./syncui/SyncUiEventDispatcher\";\r\nimport { SYSTEM_PREFERRED_COLOR_THEME, WIDGET_OPACITY_DEFAULT } from \"./theme/ThemeManager\";\r\nimport * as keyinPaletteTools from \"./tools/KeyinPaletteTools\";\r\nimport * as openSettingTools from \"./tools/OpenSettingsTool\";\r\nimport * as restoreLayoutTools from \"./tools/RestoreLayoutTool\";\r\nimport * as toolSettingTools from \"./tools/ToolSettingsTools\";\r\nimport { UserInfo } from \"./UserInfo\";\r\nimport { UiShowHideManager, UiShowHideSettingsProvider } from \"./utils/UiShowHideManager\";\r\nimport { WidgetManager } from \"./widgets/WidgetManager\";\r\nimport { FrontstageManager } from \"./frontstage/FrontstageManager\";\r\n\r\n// cSpell:ignore Mobi\r\n\r\n/** Interface to be implemented but any classes that wants to load their user settings when the UiSetting storage class is set.\r\n * @public\r\n */\r\nexport interface UserSettingsProvider {\r\n /** Unique provider Id */\r\n providerId: string;\r\n /** Function to load settings from settings storage */\r\n loadUserSettings(storage: UiSettingsStorage): Promise<void>;\r\n}\r\n\r\n/** UiVisibility Event Args interface.\r\n * @public\r\n */\r\nexport interface UiVisibilityEventArgs {\r\n visible: boolean;\r\n}\r\n\r\n/** UiVisibility Event class.\r\n * @public\r\n */\r\nexport class UiVisibilityChangedEvent extends UiEvent<UiVisibilityEventArgs> { }\r\n\r\n/** FrameworkVersion Changed Event Args interface.\r\n * @internal\r\n */\r\nexport interface FrameworkVersionChangedEventArgs {\r\n oldVersion: string;\r\n version: string;\r\n}\r\n\r\n/** FrameworkVersion Changed Event class.\r\n * @internal\r\n */\r\nexport class FrameworkVersionChangedEvent extends UiEvent<FrameworkVersionChangedEventArgs> { }\r\n\r\n/** TrackingTime time argument used by our feature tracking manager as an option argument to the TelemetryClient\r\n * @internal\r\n */\r\nexport interface TrackingTime {\r\n startTime: Date;\r\n endTime: Date;\r\n}\r\n\r\n/**\r\n * Manages the Redux store, localization service and iModel, Project and Login services for the ui-framework package.\r\n * @public\r\n */\r\nexport class UiFramework {\r\n private static _initialized = false;\r\n private static _localization?: Localization;\r\n private static _store?: Store<any>;\r\n private static _complaint = \"UiFramework not initialized\";\r\n private static _frameworkStateKeyInStore: string = \"frameworkState\"; // default name\r\n private static _backstageManager?: BackstageManager;\r\n private static _widgetManager?: WidgetManager;\r\n private static _uiVersion = \"\";\r\n private static _hideIsolateEmphasizeActionHandler?: HideIsolateEmphasizeActionHandler;\r\n private static _uiSettingsStorage: UiSettingsStorage = new LocalSettingsStorage(); // this provides a default storage location for settings\r\n private static _settingsManager?: SettingsManager;\r\n private static _uiSettingsProviderRegistry: Map<string, UserSettingsProvider> = new Map<string, UserSettingsProvider>();\r\n private static _PopupWindowManager = new ChildWindowManager();\r\n public static useDefaultPopoutUrl = false;\r\n\r\n /** @public */\r\n public static get childWindowManager(): ChildWindowManager {\r\n return UiFramework._PopupWindowManager;\r\n }\r\n\r\n /** Registers class that will be informed when the UserSettingsStorage location has been set or changed. This allows\r\n * classes to load any previously saved settings from the new storage location. Common storage locations are the browser's\r\n * local storage, or the iTwin Product Settings cloud storage available via the SettingsAdmin see `IModelApp.settingsAdmin`.\r\n * @beta\r\n */\r\n public static registerUserSettingsProvider(entry: UserSettingsProvider) {\r\n if (this._uiSettingsProviderRegistry.has(entry.providerId))\r\n return false;\r\n\r\n this._uiSettingsProviderRegistry.set(entry.providerId, entry);\r\n return true;\r\n }\r\n\r\n /** Get Show Ui event.\r\n * @public\r\n */\r\n public static readonly onUiVisibilityChanged = new UiVisibilityChangedEvent();\r\n\r\n /** Get FrameworkVersion Changed event.\r\n * @internal\r\n */\r\n public static readonly onFrameworkVersionChangedEvent = new FrameworkVersionChangedEvent();\r\n\r\n /**\r\n * Called by the application to initialize the UiFramework. Also initializes UIIModelComponents, UiComponents, UiCore and UiAbstract.\r\n * @param store The single Redux store created by the host application. If this is `undefined` then it is assumed that the [[StateManager]] is being used to provide the Redux store.\r\n * @param localization The internationalization service created by the application. Defaults to IModelApp.localization.\r\n * @param frameworkStateKey The name of the key used by the app when adding the UiFramework state into the Redux store. If not defined \"frameworkState\" is assumed. This value is ignored if [[StateManager]] is being used. The StateManager use \"frameworkState\".\r\n */\r\n public static async initialize(store: Store<any> | undefined, localization?: Localization, frameworkStateKey?: string): Promise<void> {\r\n return this.initializeEx(store, localization, frameworkStateKey);\r\n }\r\n\r\n /**\r\n * Called by the application to initialize the UiFramework. Also initializes UIIModelComponents, UiComponents, UiCore and UiAbstract.\r\n * @param store The single Redux store created by the host application. If this is `undefined` then it is assumed that the [[StateManager]] is being used to provide the Redux store.\r\n * @param localization The internationalization service created by the application. Defaults to IModelApp.localization.\r\n * @param frameworkStateKey The name of the key used by the app when adding the UiFramework state into the Redux store. If not defined \"frameworkState\" is assumed. This value is ignored if [[StateManager]] is being used. The StateManager use \"frameworkState\".\r\n *\r\n * @internal\r\n */\r\n public static async initializeEx(store: Store<any> | undefined, localization?: Localization, frameworkStateKey?: string): Promise<void> {\r\n if (UiFramework._initialized) {\r\n Logger.logInfo(UiFramework.loggerCategory(UiFramework), `UiFramework.initialize already called`);\r\n return;\r\n }\r\n\r\n /* if store is undefined then the StateManager class should have been initialized by parent app and the apps default set of reducers registered with it.\r\n If the app has no reducers to add and does not initialize a StateManager then just initialize the StateManager with the default framework reducer now */\r\n if (undefined === store && !StateManager.isInitialized(true))\r\n new StateManager();\r\n\r\n UiFramework._store = store;\r\n UiFramework._localization = localization || IModelApp.localization;\r\n // ignore setting _frameworkStateKeyInStore if not using store\r\n if (frameworkStateKey && store)\r\n UiFramework._frameworkStateKeyInStore = frameworkStateKey;\r\n\r\n // set up namespace and register all tools from package\r\n const frameworkNamespace = UiFramework._localization.registerNamespace(UiFramework.localizationNamespace);\r\n [\r\n restoreLayoutTools,\r\n keyinPaletteTools,\r\n openSettingTools,\r\n toolSettingTools,\r\n ].forEach((tool) => IModelApp.tools.registerModule(tool, this.localizationNamespace));\r\n\r\n UiFramework._backstageManager = new BackstageManager();\r\n UiFramework._hideIsolateEmphasizeActionHandler = new HideIsolateEmphasizeManager(); // this allows user to override the default HideIsolateEmphasizeManager implementation.\r\n UiFramework._widgetManager = new WidgetManager();\r\n\r\n UiFramework.onFrameworkVersionChangedEvent.addListener(UiFramework._handleFrameworkVersionChangedEvent);\r\n\r\n // Initialize ui-imodel-components, ui-components, ui-core & ui-abstract\r\n await UiIModelComponents.initialize(UiFramework._localization);\r\n\r\n UiFramework.settingsManager.onSettingsProvidersChanged.addListener(() => {\r\n SyncUiEventDispatcher.dispatchSyncUiEvent(SyncUiEventId.SettingsProvidersChanged);\r\n });\r\n\r\n // Initialize the MessagePresenter interface in UiAbstract for Editor notifications\r\n UiAbstract.messagePresenter = IModelApp.notifications;\r\n\r\n UiFramework._initialized = true;\r\n\r\n // initialize any standalone settings providers that don't need to have defaults set by iModelApp\r\n UiShowHideSettingsProvider.initialize();\r\n\r\n ConfigurableUiManager.initialize();\r\n\r\n return frameworkNamespace;\r\n }\r\n\r\n /** Un-registers the UiFramework internationalization service namespace */\r\n public static terminate() {\r\n UiFramework._store = undefined;\r\n UiFramework._frameworkStateKeyInStore = \"frameworkState\";\r\n if (StateManager.isInitialized(true))\r\n StateManager.clearStore();\r\n if (UiFramework._localization)\r\n UiFramework._localization.unregisterNamespace(UiFramework.localizationNamespace);\r\n UiFramework._localization = undefined;\r\n UiFramework._backstageManager = undefined;\r\n UiFramework._widgetManager = undefined;\r\n UiFramework._hideIsolateEmphasizeActionHandler = undefined;\r\n UiFramework._settingsManager = undefined;\r\n\r\n UiFramework.onFrameworkVersionChangedEvent.removeListener(UiFramework._handleFrameworkVersionChangedEvent);\r\n\r\n UiIModelComponents.terminate();\r\n UiFramework._initialized = false;\r\n }\r\n\r\n /** Determines if UiFramework has been initialized */\r\n public static get initialized(): boolean { return UiFramework._initialized; }\r\n\r\n /** Property that returns the SettingManager used by AppUI-based applications.\r\n * @public */\r\n public static get settingsManager() {\r\n if (undefined === UiFramework._settingsManager)\r\n UiFramework._settingsManager = new SettingsManager();\r\n return UiFramework._settingsManager;\r\n }\r\n\r\n /** @public */\r\n public static get frameworkStateKey(): string {\r\n return UiFramework._frameworkStateKeyInStore;\r\n }\r\n\r\n /** The UiFramework state maintained by Redux\r\n * @public\r\n */\r\n public static get frameworkState(): FrameworkState | undefined {\r\n try {\r\n // eslint-disable-next-line dot-notation\r\n return UiFramework.store.getState()[UiFramework.frameworkStateKey];\r\n } catch (_e) {\r\n return undefined;\r\n }\r\n }\r\n\r\n /** The Redux store */\r\n public static get store(): Store<any> {\r\n if (UiFramework._store)\r\n return UiFramework._store;\r\n\r\n // istanbul ignore else\r\n if (!StateManager.isInitialized(true))\r\n throw new UiError(UiFramework.loggerCategory(this), `Error trying to access redux store before either store or StateManager has been initialized.`);\r\n\r\n // istanbul ignore next\r\n return StateManager.store;\r\n }\r\n\r\n /** The internationalization service created by the app. */\r\n public static get localization(): Localization {\r\n if (!UiFramework._localization)\r\n throw new UiError(UiFramework.loggerCategory(this), UiFramework._complaint);\r\n return UiFramework._localization;\r\n }\r\n\r\n /** The internationalization service namespace. */\r\n public static get localizationNamespace(): string {\r\n return \"UiFramework\";\r\n }\r\n\r\n /** @public */\r\n public static get backstageManager(): BackstageManager {\r\n // istanbul ignore next\r\n if (!UiFramework._backstageManager)\r\n throw new UiError(UiFramework.loggerCategory(this), UiFramework._complaint);\r\n return UiFramework._backstageManager;\r\n }\r\n\r\n /** @alpha */\r\n public static get hideIsolateEmphasizeActionHandler(): HideIsolateEmphasizeActionHandler {\r\n // istanbul ignore next\r\n if (!UiFramework._hideIsolateEmphasizeActionHandler)\r\n throw new UiError(UiFramework.loggerCategory(this), UiFramework._complaint);\r\n return UiFramework._hideIsolateEmphasizeActionHandler;\r\n }\r\n\r\n /** @alpha */\r\n public static setHideIsolateEmphasizeActionHandler(handler: HideIsolateEmphasizeActionHandler | undefined) {\r\n // istanbul ignore else\r\n if (handler)\r\n UiFramework._hideIsolateEmphasizeActionHandler = handler;\r\n else\r\n UiFramework._hideIsolateEmphasizeActionHandler = new HideIsolateEmphasizeManager();\r\n }\r\n\r\n /** @alpha */\r\n public static get widgetManager(): WidgetManager {\r\n // istanbul ignore next\r\n if (!UiFramework._widgetManager)\r\n throw new UiError(UiFramework.loggerCategory(this), UiFramework._complaint);\r\n return UiFramework._widgetManager;\r\n }\r\n\r\n /** Calls localization.getLocalizedStringWithNamespace with the \"UiFramework\" namespace. Do NOT include the namespace in the key.\r\n * @internal\r\n */\r\n public static translate(key: string | string[]): string {\r\n return UiFramework.localization.getLocalizedStringWithNamespace(UiFramework.localizationNamespace, key);\r\n }\r\n\r\n /** @internal */\r\n public static get packageName(): string {\r\n return \"appui-react\";\r\n }\r\n\r\n /** @internal */\r\n public static loggerCategory(obj: any): string {\r\n const className = getClassName(obj);\r\n const category = UiFramework.packageName + (className ? `.${className}` : \"\");\r\n return category;\r\n }\r\n\r\n public static dispatchActionToStore(type: string, payload: any, immediateSync = false) {\r\n UiFramework.store.dispatch({ type, payload });\r\n if (immediateSync)\r\n SyncUiEventDispatcher.dispatchImmediateSyncUiEvent(type);\r\n else\r\n SyncUiEventDispatcher.dispatchSyncUiEvent(type);\r\n }\r\n\r\n public static setAccudrawSnapMode(snapMode: SnapMode) {\r\n UiFramework.dispatchActionToStore(ConfigurableUiActionId.SetSnapMode, snapMode, true);\r\n }\r\n\r\n public static getAccudrawSnapMode(): SnapMode {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.configurableUiState.snapMode : /* istanbul ignore next */ SnapMode.NearestKeypoint;\r\n }\r\n\r\n public static getActiveSelectionScope(): string {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.sessionState.activeSelectionScope : /* istanbul ignore next */ \"element\";\r\n }\r\n\r\n public static setActiveSelectionScope(selectionScopeId: string): void {\r\n // istanbul ignore else\r\n if (UiFramework.frameworkState) {\r\n const foundIndex = UiFramework.frameworkState.sessionState.availableSelectionScopes.findIndex((selectionScope: PresentationSelectionScope) => selectionScope.id === selectionScopeId);\r\n if (-1 !== foundIndex) {\r\n const scope = UiFramework.frameworkState.sessionState.availableSelectionScopes[foundIndex];\r\n UiFramework.dispatchActionToStore(SessionStateActionId.SetSelectionScope, scope.id);\r\n Presentation.selection.scopes.activeScope = scope.id;\r\n }\r\n }\r\n }\r\n\r\n /** @public */\r\n public static openCursorMenu(menuData: CursorMenuData | undefined): void {\r\n UiFramework.dispatchActionToStore(SessionStateActionId.UpdateCursorMenu, menuData);\r\n }\r\n\r\n /** @public */\r\n public static closeCursorMenu(): void {\r\n UiFramework.dispatchActionToStore(SessionStateActionId.UpdateCursorMenu, undefined);\r\n }\r\n\r\n /** @public */\r\n public static getCursorMenuData(): CursorMenuData | undefined {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.sessionState.cursorMenuData : /* istanbul ignore next */ undefined;\r\n }\r\n\r\n public static getActiveIModelId(): string {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.sessionState.iModelId : /* istanbul ignore next */ \"\";\r\n }\r\n\r\n public static setActiveIModelId(iModelId: string): void {\r\n UiFramework.dispatchActionToStore(SessionStateActionId.SetActiveIModelId, iModelId);\r\n }\r\n\r\n public static setIModelConnection(iModelConnection: IModelConnection | undefined, immediateSync = false) {\r\n const oldConnection = UiFramework.getIModelConnection();\r\n if (oldConnection !== iModelConnection) {\r\n if (oldConnection?.iModelId)\r\n FrontstageManager.clearFrontstageDefsForIModelId(oldConnection?.iModelId);\r\n oldConnection && undefined === iModelConnection && SyncUiEventDispatcher.clearConnectionEvents(oldConnection);\r\n iModelConnection && SyncUiEventDispatcher.initializeConnectionEvents(iModelConnection);\r\n UiFramework.dispatchActionToStore(SessionStateActionId.SetIModelConnection, iModelConnection, immediateSync);\r\n }\r\n UiFramework.setActiveIModelId(iModelConnection?.iModelId ?? \"\");\r\n }\r\n\r\n public static getIModelConnection(): IModelConnection | undefined {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.sessionState.iModelConnection : /* istanbul ignore next */ undefined;\r\n }\r\n\r\n /** @public */\r\n public static async setUiSettingsStorage(storage: UiSettingsStorage, immediateSync = false) {\r\n if (UiFramework._uiSettingsStorage === storage)\r\n return;\r\n\r\n UiFramework._uiSettingsStorage = storage;\r\n\r\n // let any registered providers to load values from the new storage location\r\n const providerKeys = [...this._uiSettingsProviderRegistry.keys()];\r\n for await (const key of providerKeys) {\r\n await this._uiSettingsProviderRegistry.get(key)!.loadUserSettings(storage);\r\n }\r\n\r\n // istanbul ignore next\r\n if (immediateSync)\r\n SyncUiEventDispatcher.dispatchImmediateSyncUiEvent(SyncUiEventId.UiSettingsChanged);\r\n else\r\n SyncUiEventDispatcher.dispatchSyncUiEvent(SyncUiEventId.UiSettingsChanged);\r\n }\r\n\r\n /** @public */\r\n public static getUiSettingsStorage(): UiSettingsStorage {\r\n return UiFramework._uiSettingsStorage;\r\n }\r\n\r\n /** @public */\r\n public static setUserInfo(userInfo: UserInfo | undefined, immediateSync = false) {\r\n UiFramework.dispatchActionToStore(SessionStateActionId.SetUserInfo, userInfo, immediateSync);\r\n }\r\n\r\n /** @public */\r\n public static getUserInfo(): UserInfo | undefined {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.sessionState.userInfo : /* istanbul ignore next */ undefined;\r\n }\r\n\r\n public static setDefaultIModelViewportControlId(iModelViewportControlId: string, immediateSync = false) {\r\n UiFramework.dispatchActionToStore(SessionStateActionId.SetDefaultIModelViewportControlId, iModelViewportControlId, immediateSync);\r\n }\r\n\r\n public static getDefaultIModelViewportControlId(): string | undefined {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.sessionState.defaultIModelViewportControlId : /* istanbul ignore next */ undefined;\r\n }\r\n\r\n public static setDefaultViewId(viewId: string, immediateSync = false) {\r\n UiFramework.dispatchActionToStore(SessionStateActionId.SetDefaultViewId, viewId, immediateSync);\r\n }\r\n\r\n public static getDefaultViewId(): string | undefined {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.sessionState.defaultViewId : /* istanbul ignore next */ undefined;\r\n }\r\n\r\n public static setDefaultViewState(viewState: ViewState, immediateSync = false) {\r\n UiFramework.dispatchActionToStore(SessionStateActionId.SetDefaultViewState, viewState, immediateSync);\r\n }\r\n public static getDefaultViewState(): ViewState | undefined {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.sessionState.defaultViewState : /* istanbul ignore next */ undefined;\r\n }\r\n\r\n /** @public */\r\n public static getAvailableSelectionScopes(): PresentationSelectionScope[] {\r\n return UiFramework.frameworkState ?\r\n UiFramework.frameworkState.sessionState.availableSelectionScopes :\r\n /* istanbul ignore next */\r\n [{ id: \"element\", label: \"Element\" } as PresentationSelectionScope];\r\n }\r\n\r\n public static getIsUiVisible() {\r\n return UiShowHideManager.isUiVisible;\r\n }\r\n\r\n public static setIsUiVisible(visible: boolean) {\r\n if (UiShowHideManager.isUiVisible !== visible) {\r\n UiShowHideManager.isUiVisible = visible;\r\n UiFramework.onUiVisibilityChanged.emit({ visible });\r\n }\r\n }\r\n\r\n public static setColorTheme(theme: string) {\r\n if (UiFramework.getColorTheme() === theme)\r\n return;\r\n\r\n UiFramework.dispatchActionToStore(ConfigurableUiActionId.SetTheme, theme, true);\r\n }\r\n\r\n public static getColorTheme(): string {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.configurableUiState.theme : /* istanbul ignore next */ SYSTEM_PREFERRED_COLOR_THEME;\r\n }\r\n\r\n public static setWidgetOpacity(opacity: number) {\r\n if (UiFramework.getWidgetOpacity() === opacity)\r\n return;\r\n\r\n UiFramework.dispatchActionToStore(ConfigurableUiActionId.SetWidgetOpacity, opacity, true);\r\n }\r\n\r\n public static getWidgetOpacity(): number {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.configurableUiState.widgetOpacity : /* istanbul ignore next */ WIDGET_OPACITY_DEFAULT;\r\n }\r\n\r\n public static isMobile() { // eslint-disable-line @itwin/prefer-get\r\n return ProcessDetector.isMobileBrowser;\r\n }\r\n\r\n /** Returns the Ui Version.\r\n * @public\r\n */\r\n public static get uiVersion(): string {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.configurableUiState.frameworkVersion : this._uiVersion;\r\n }\r\n\r\n public static setUiVersion(version: string) {\r\n if (UiFramework.uiVersion === version)\r\n return;\r\n\r\n UiFramework.dispatchActionToStore(ConfigurableUiActionId.SetFrameworkVersion, version === \"1\" ? \"1\" : \"2\", true);\r\n }\r\n\r\n public static get useDragInteraction(): boolean {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.configurableUiState.useDragInteraction : false;\r\n }\r\n\r\n public static setUseDragInteraction(useDragInteraction: boolean) {\r\n UiFramework.dispatchActionToStore(ConfigurableUiActionId.SetDragInteraction, useDragInteraction, true);\r\n }\r\n\r\n /** Send logging message to the telemetry system\r\n * @internal\r\n */\r\n // istanbul ignore next\r\n public static async postTelemetry(eventName: string, eventId?: GuidString, iTwinId?: GuidString, iModeId?: GuidString, changeSetId?: string, time?: TrackingTime, additionalProperties?: { [key: string]: any }): Promise<void> {\r\n if (!IModelApp.authorizationClient)\r\n return;\r\n\r\n try {\r\n const activity: RpcActivity = {\r\n sessionId: IModelApp.sessionId,\r\n activityId: \"\",\r\n applicationId: IModelApp.applicationId,\r\n applicationVersion: IModelApp.applicationVersion,\r\n accessToken: (await IModelApp.authorizationClient.getAccessToken()) ?? \"\",\r\n };\r\n const telemetryEvent = new TelemetryEvent(eventName, eventId, iTwinId, iModeId, changeSetId, time, additionalProperties);\r\n await IModelApp.telemetry.postTelemetry(activity, telemetryEvent);\r\n } catch { }\r\n }\r\n private static _handleFrameworkVersionChangedEvent = (args: FrameworkVersionChangedEventArgs) => {\r\n // Log Ui Version used\r\n Logger.logInfo(UiFramework.loggerCategory(UiFramework), `Ui Version changed to ${args.version} `);\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n UiFramework.postTelemetry(`Ui Version changed to ${args.version} `, \"F2772C81-962D-4755-807C-2D675A5FF399\");\r\n UiFramework.setUiVersion(args.version);\r\n };\r\n\r\n /** Determines whether a ContextMenu is open\r\n * @alpha\r\n * */\r\n public static get isContextMenuOpen(): boolean {\r\n const contextMenu = document.querySelector(\"div.core-context-menu-opened\");\r\n return contextMenu !== null && contextMenu !== undefined;\r\n }\r\n\r\n}\r\n"]}
|
|
@@ -117,7 +117,6 @@ export declare class Frontstage extends React.Component<FrontstageProps, Frontst
|
|
|
117
117
|
componentWillUnmount(): void;
|
|
118
118
|
private _uiVisibilityChanged;
|
|
119
119
|
private _handleWidgetsChanged;
|
|
120
|
-
private _handleWidgetProvidersChanged;
|
|
121
120
|
private _handleUiProviderRegisteredEvent;
|
|
122
121
|
private updateWidgetDefs;
|
|
123
122
|
/** @internal */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Frontstage.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/frontstage/Frontstage.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,kBAAkB,EAAkE,MAAM,uBAAuB,CAAC;AAC3H,OAAO,EAAE,WAAW,EAAa,MAA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|
|
47
47
|
};
|
|
48
|
-
this._handleWidgetProvidersChanged = (_args) => {
|
|
49
|
-
this.updateWidgetDefs();
|
|
50
|
-
};
|
|
51
48
|
this._handleUiProviderRegisteredEvent = (_args) => {
|
|
52
49
|
this.updateWidgetDefs();
|
|
53
50
|
};
|
|
@@ -77,7 +74,6 @@ export class Frontstage extends React.Component {
|
|
|
77
74
|
async componentDidMount() {
|
|
78
75
|
UiFramework.onUiVisibilityChanged.addListener(this._uiVisibilityChanged);
|
|
79
76
|
UiFramework.widgetManager.onWidgetsChanged.addListener(this._handleWidgetsChanged);
|
|
80
|
-
UiFramework.widgetManager.onWidgetProvidersChanged.addListener(this._handleWidgetProvidersChanged);
|
|
81
77
|
UiItemsManager.onUiProviderRegisteredEvent.addListener(this._handleUiProviderRegisteredEvent);
|
|
82
78
|
}
|
|
83
79
|
componentDidUpdate() {
|
|
@@ -95,8 +91,6 @@ export class Frontstage extends React.Component {
|
|
|
95
91
|
*/
|
|
96
92
|
componentWillUnmount() {
|
|
97
93
|
UiFramework.onUiVisibilityChanged.removeListener(this._uiVisibilityChanged);
|
|
98
|
-
UiFramework.widgetManager.onWidgetsChanged.removeListener(this._handleWidgetsChanged);
|
|
99
|
-
UiFramework.widgetManager.onWidgetProvidersChanged.removeListener(this._handleWidgetProvidersChanged);
|
|
100
94
|
UiItemsManager.onUiProviderRegisteredEvent.removeListener(this._handleUiProviderRegisteredEvent);
|
|
101
95
|
}
|
|
102
96
|
updateWidgetDefs() {
|