@itwin/appui-react 5.34.0 → 5.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/lib/appui-react/configurableui/ConfigurableUiContent.d.ts +6 -2
  3. package/lib/appui-react/configurableui/ConfigurableUiContent.d.ts.map +1 -1
  4. package/lib/appui-react/configurableui/ConfigurableUiContent.js +9 -2
  5. package/lib/appui-react/configurableui/ConfigurableUiContent.js.map +1 -1
  6. package/lib/appui-react/framework/FrameworkFrontstages.d.ts +1 -0
  7. package/lib/appui-react/framework/FrameworkFrontstages.d.ts.map +1 -1
  8. package/lib/appui-react/framework/FrameworkFrontstages.js.map +1 -1
  9. package/lib/appui-react/framework/FrameworkVisibility.d.ts +3 -1
  10. package/lib/appui-react/framework/FrameworkVisibility.d.ts.map +1 -1
  11. package/lib/appui-react/framework/FrameworkVisibility.js.map +1 -1
  12. package/lib/appui-react/frontstage/InternalFrontstageManager.d.ts.map +1 -1
  13. package/lib/appui-react/frontstage/InternalFrontstageManager.js +6 -0
  14. package/lib/appui-react/frontstage/InternalFrontstageManager.js.map +1 -1
  15. package/lib/appui-react/keyboardshortcut/KeyboardShortcutUtilities.d.ts.map +1 -1
  16. package/lib/appui-react/keyboardshortcut/KeyboardShortcutUtilities.js +6 -1
  17. package/lib/appui-react/keyboardshortcut/KeyboardShortcutUtilities.js.map +1 -1
  18. package/lib/appui-react/layout/_widgetopacity.scss +1 -1
  19. package/lib/appui-react/popup/CardPopup.d.ts.map +1 -1
  20. package/lib/appui-react/popup/CardPopup.js +3 -1
  21. package/lib/appui-react/popup/CardPopup.js.map +1 -1
  22. package/lib/appui-react/popup/ToolbarPopup.d.ts.map +1 -1
  23. package/lib/appui-react/popup/ToolbarPopup.js +3 -1
  24. package/lib/appui-react/popup/ToolbarPopup.js.map +1 -1
  25. package/lib/appui-react/shared/ToolItemDef.d.ts.map +1 -1
  26. package/lib/appui-react/shared/ToolItemDef.js +6 -5
  27. package/lib/appui-react/shared/ToolItemDef.js.map +1 -1
  28. package/lib/appui-react/statusfields/toolassistance/ToolAssistanceField.d.ts.map +1 -1
  29. package/lib/appui-react/statusfields/toolassistance/ToolAssistanceField.js +4 -2
  30. package/lib/appui-react/statusfields/toolassistance/ToolAssistanceField.js.map +1 -1
  31. package/lib/appui-react/theme/ThemeId.d.ts +3 -1
  32. package/lib/appui-react/theme/ThemeId.d.ts.map +1 -1
  33. package/lib/appui-react/theme/ThemeId.js +3 -1
  34. package/lib/appui-react/theme/ThemeId.js.map +1 -1
  35. package/lib/appui-react/toolbar/Toolbar.d.ts +3 -1
  36. package/lib/appui-react/toolbar/Toolbar.d.ts.map +1 -1
  37. package/lib/appui-react/toolbar/Toolbar.js.map +1 -1
  38. package/lib/appui-react/toolbar/ToolbarComposer.d.ts.map +1 -1
  39. package/lib/appui-react/toolbar/ToolbarComposer.js +13 -5
  40. package/lib/appui-react/toolbar/ToolbarComposer.js.map +1 -1
  41. package/lib/appui-react/toolbar/ToolbarWithOverflow.d.ts +3 -1
  42. package/lib/appui-react/toolbar/ToolbarWithOverflow.d.ts.map +1 -1
  43. package/lib/appui-react/toolbar/ToolbarWithOverflow.js.map +1 -1
  44. package/lib/appui-react/toolbar/new-toolbars/Surface.d.ts.map +1 -1
  45. package/lib/appui-react/toolbar/new-toolbars/Surface.js +1 -0
  46. package/lib/appui-react/toolbar/new-toolbars/Surface.js.map +1 -1
  47. package/lib/appui-react/toolbar/new-toolbars/Surface.scss +1 -6
  48. package/lib/appui-react/tools/CoreToolDefinitions.d.ts.map +1 -1
  49. package/lib/appui-react/tools/CoreToolDefinitions.js +37 -133
  50. package/lib/appui-react/tools/CoreToolDefinitions.js.map +1 -1
  51. package/lib/appui-react/tools/defineToolIcons.d.ts +3 -0
  52. package/lib/appui-react/tools/defineToolIcons.d.ts.map +1 -0
  53. package/lib/appui-react/tools/defineToolIcons.js +45 -0
  54. package/lib/appui-react/tools/defineToolIcons.js.map +1 -0
  55. package/lib/appui-react/uistate/AppUiSettings.d.ts +6 -0
  56. package/lib/appui-react/uistate/AppUiSettings.d.ts.map +1 -1
  57. package/lib/appui-react/uistate/AppUiSettings.js +15 -0
  58. package/lib/appui-react/uistate/AppUiSettings.js.map +1 -1
  59. package/lib/appui-react/widgets/NavigationWidgetComposer.d.ts.map +1 -1
  60. package/lib/appui-react/widgets/NavigationWidgetComposer.js +4 -1
  61. package/lib/appui-react/widgets/NavigationWidgetComposer.js.map +1 -1
  62. package/lib/appui-react/widgets/ToolWidgetComposer.d.ts.map +1 -1
  63. package/lib/appui-react/widgets/ToolWidgetComposer.js +3 -1
  64. package/lib/appui-react/widgets/ToolWidgetComposer.js.map +1 -1
  65. package/lib/appui-react.d.ts.map +1 -1
  66. package/lib/appui-react.js +2 -0
  67. package/lib/appui-react.js.map +1 -1
  68. package/lib/cjs/appui-react/layout/_widgetopacity.scss +1 -1
  69. package/lib/cjs/appui-react/toolbar/new-toolbars/Surface.scss +1 -6
  70. package/lib/esm/appui-react/layout/_widgetopacity.scss +1 -1
  71. package/lib/esm/appui-react/toolbar/new-toolbars/Surface.scss +1 -6
  72. package/package.json +7 -7
@@ -8,7 +8,7 @@
8
8
  import * as React from "react";
9
9
  import { FitViewTool, FlyViewTool, IModelApp, MeasureDistanceTool, MeasureLocationTool, PanViewTool, RotateViewTool, SelectionTool, SetupWalkCameraTool, ViewClipByElementTool, ViewClipByPlaneTool, ViewClipByRangeTool, ViewClipByShapeTool, ViewClipDecorationProvider, ViewRedoTool, ViewToggleCameraTool, ViewUndoTool, WalkViewTool, WindowAreaTool, ZoomViewTool, } from "@itwin/core-frontend";
10
10
  import { ConditionalBooleanValue, ConditionalStringValue, } from "@itwin/appui-abstract";
11
- import { SvgCameraAnimation, SvgCameraAnimationDisabled, } from "@itwin/itwinui-icons-react";
11
+ import { ToolUtilities } from "@itwin/imodel-components-react";
12
12
  import { getIsHiddenIfSelectionNotActive } from "../selection/SelectionContextItemDef.js";
13
13
  import { CommandItemDef } from "../shared/CommandItemDef.js";
14
14
  import { ToolItemDef } from "../shared/ToolItemDef.js";
@@ -16,11 +16,9 @@ import { SyncUiEventId } from "../syncui/UiSyncEvent.js";
16
16
  import { GroupItemDef } from "../toolbar/GroupItem.js";
17
17
  import { RestoreFrontstageLayoutTool } from "./RestoreLayoutTool.js";
18
18
  import { UiFramework } from "../UiFramework.js";
19
- import { SvgGyroscope } from "../icons/SvgGyroscope.js";
20
19
  import { SvgSectionTool } from "../icons/SvgSectionTool.js";
21
20
  import { SvgSelectionClear } from "../icons/SvgSelectionClear.js";
22
- import { SvgMeasure, SvgProcess, SvgRotateLeft, } from "@itwin/itwinui-icons-react";
23
- import { ConditionalIconItem } from "@itwin/core-react";
21
+ import { SvgMeasure, SvgProcess } from "@itwin/itwinui-icons-react";
24
22
  import { getActiveViewport } from "../utils/getActiveViewport.js";
25
23
  /* eslint-disable @typescript-eslint/no-deprecated */
26
24
  /** Utility Class that provides definitions of tools provided by the ($core-frontend) core. These definitions can be used to populate the UI.
@@ -39,65 +37,32 @@ export class CoreTools {
39
37
  });
40
38
  }
41
39
  static get fitViewCommand() {
42
- return new ToolItemDef({
43
- toolId: FitViewTool.toolId,
44
- iconSpec: FitViewTool.iconSpec,
45
- label: FitViewTool.flyover,
46
- description: FitViewTool.description,
40
+ return createForTool(FitViewTool, {
47
41
  execute: async () => IModelApp.tools.run(FitViewTool.toolId, IModelApp.viewManager.selectedView, true),
48
42
  });
49
43
  }
50
44
  static get windowAreaCommand() {
51
- return new ToolItemDef({
52
- toolId: WindowAreaTool.toolId,
53
- iconSpec: WindowAreaTool.iconSpec,
54
- label: WindowAreaTool.flyover,
55
- description: WindowAreaTool.description,
45
+ return createForTool(WindowAreaTool, {
56
46
  execute: async () => IModelApp.tools.run(WindowAreaTool.toolId, IModelApp.viewManager.selectedView),
57
47
  });
58
48
  }
59
49
  static get zoomViewCommand() {
60
- return new ToolItemDef({
61
- toolId: ZoomViewTool.toolId,
62
- iconSpec: ZoomViewTool.iconSpec,
63
- label: ZoomViewTool.flyover,
64
- description: ZoomViewTool.description,
50
+ return createForTool(ZoomViewTool, {
65
51
  execute: async () => IModelApp.tools.run(ZoomViewTool.toolId, IModelApp.viewManager.selectedView),
66
52
  });
67
53
  }
68
54
  static get panViewCommand() {
69
- return new ToolItemDef({
70
- toolId: PanViewTool.toolId,
71
- iconSpec: PanViewTool.iconSpec,
72
- label: PanViewTool.flyover,
73
- description: PanViewTool.description,
55
+ return createForTool(PanViewTool, {
74
56
  execute: async () => IModelApp.tools.run(PanViewTool.toolId, IModelApp.viewManager.selectedView),
75
57
  });
76
58
  }
77
59
  static get rotateViewCommand() {
78
- return new ToolItemDef({
79
- toolId: RotateViewTool.toolId,
80
- icon: new ConditionalIconItem(() => {
81
- const viewport = getActiveViewport();
82
- if (viewport?.view.is2d())
83
- return React.createElement(SvgRotateLeft, null);
84
- return React.createElement(SvgGyroscope, null);
85
- }, [
86
- SyncUiEventId.ActiveContentChanged,
87
- SyncUiEventId.ActiveViewportChanged,
88
- SyncUiEventId.ViewStateChanged,
89
- ]),
90
- label: RotateViewTool.flyover,
91
- description: RotateViewTool.description,
60
+ return createForTool(RotateViewTool, {
92
61
  execute: async () => IModelApp.tools.run(RotateViewTool.toolId, IModelApp.viewManager.selectedView),
93
62
  });
94
63
  }
95
64
  static get walkViewCommand() {
96
- return new ToolItemDef({
97
- toolId: WalkViewTool.toolId,
98
- iconSpec: WalkViewTool.iconSpec,
99
- label: WalkViewTool.flyover,
100
- description: WalkViewTool.description,
65
+ return createForTool(WalkViewTool, {
101
66
  isHidden: new ConditionalBooleanValue(() => {
102
67
  const viewport = getActiveViewport();
103
68
  return !!viewport?.view.is2d();
@@ -110,37 +75,13 @@ export class CoreTools {
110
75
  });
111
76
  }
112
77
  static get selectElementCommand() {
113
- return new ToolItemDef({
114
- toolId: SelectionTool.toolId,
115
- iconSpec: SelectionTool.iconSpec,
116
- label: SelectionTool.flyover,
117
- description: SelectionTool.description,
118
- execute: async () => IModelApp.tools.run(SelectionTool.toolId),
119
- });
78
+ return createForTool(SelectionTool);
120
79
  }
121
80
  static get setupCameraWalkTool() {
122
- return new ToolItemDef({
123
- toolId: SetupWalkCameraTool.toolId,
124
- iconSpec: SetupWalkCameraTool.iconSpec,
125
- label: SetupWalkCameraTool.flyover,
126
- description: SetupWalkCameraTool.description,
127
- execute: async () => IModelApp.tools.run(SetupWalkCameraTool.toolId),
128
- });
81
+ return createForTool(SetupWalkCameraTool);
129
82
  }
130
83
  static get toggleCameraViewCommand() {
131
- return new ToolItemDef({
132
- toolId: ViewToggleCameraTool.toolId,
133
- iconSpec: new ConditionalIconItem(() => {
134
- const viewport = getActiveViewport();
135
- if (viewport?.view.is3d() && viewport?.isCameraOn) {
136
- return React.createElement(SvgCameraAnimation, null);
137
- }
138
- return React.createElement(SvgCameraAnimationDisabled, null);
139
- }, [
140
- SyncUiEventId.ActiveContentChanged,
141
- SyncUiEventId.ActiveViewportChanged,
142
- SyncUiEventId.ViewStateChanged,
143
- ]),
84
+ return createForTool(ViewToggleCameraTool, {
144
85
  label: new ConditionalStringValue(() => {
145
86
  const viewport = getActiveViewport();
146
87
  if (viewport?.view.is3d() && viewport?.isCameraOn) {
@@ -152,7 +93,6 @@ export class CoreTools {
152
93
  SyncUiEventId.ActiveViewportChanged,
153
94
  SyncUiEventId.ViewStateChanged,
154
95
  ]),
155
- description: ViewToggleCameraTool.description,
156
96
  isHidden: new ConditionalBooleanValue(() => {
157
97
  const viewport = getActiveViewport();
158
98
  return !(viewport?.view.is3d() && viewport?.view.supportsCamera());
@@ -165,19 +105,14 @@ export class CoreTools {
165
105
  });
166
106
  }
167
107
  static get flyViewCommand() {
168
- return new ToolItemDef({
169
- toolId: FlyViewTool.toolId,
170
- iconSpec: FlyViewTool.iconSpec,
171
- label: FlyViewTool.flyover,
172
- description: FlyViewTool.description,
108
+ return createForTool(FlyViewTool, {
173
109
  execute: async () => IModelApp.tools.run(FlyViewTool.toolId, IModelApp.viewManager.selectedView),
174
110
  });
175
111
  }
176
112
  // TODO - Need to provide a sync message that is fired when the Undo/Redo button needs to be refreshed in the
177
113
  // active view.
178
114
  static get viewUndoCommand() {
179
- return new ToolItemDef({
180
- toolId: ViewUndoTool.toolId,
115
+ return createForTool(ViewUndoTool, {
181
116
  isDisabled: new ConditionalBooleanValue(() => {
182
117
  const viewport = getActiveViewport();
183
118
  if (!viewport)
@@ -188,18 +123,11 @@ export class CoreTools {
188
123
  SyncUiEventId.ActiveViewportChanged,
189
124
  SyncUiEventId.ViewStateChanged,
190
125
  ]),
191
- iconSpec: ViewUndoTool.iconSpec,
192
- label: ViewUndoTool.flyover,
193
- description: ViewUndoTool.description,
194
126
  execute: async () => IModelApp.tools.run(ViewUndoTool.toolId, IModelApp.viewManager.selectedView),
195
127
  });
196
128
  }
197
129
  static get viewRedoCommand() {
198
- return new ToolItemDef({
199
- toolId: ViewRedoTool.toolId,
200
- iconSpec: ViewRedoTool.iconSpec,
201
- label: ViewRedoTool.flyover,
202
- description: ViewRedoTool.description,
130
+ return createForTool(ViewRedoTool, {
203
131
  execute: async () => IModelApp.tools.run(ViewRedoTool.toolId, IModelApp.viewManager.selectedView),
204
132
  isDisabled: new ConditionalBooleanValue(() => {
205
133
  const viewport = getActiveViewport();
@@ -222,11 +150,7 @@ export class CoreTools {
222
150
  }
223
151
  // note current ViewClipByPlaneTool is not automatically registered so the app must call ViewClipByPlaneTool.register();
224
152
  static get sectionByPlaneCommandItemDef() {
225
- return new ToolItemDef({
226
- toolId: ViewClipByPlaneTool.toolId,
227
- iconSpec: ViewClipByPlaneTool.iconSpec,
228
- label: ViewClipByPlaneTool.flyover,
229
- description: ViewClipByPlaneTool.description,
153
+ return createForTool(ViewClipByPlaneTool, {
230
154
  execute: async () => {
231
155
  this.turnOnClipVolume();
232
156
  return IModelApp.tools.run(ViewClipByPlaneTool.toolId, ViewClipDecorationProvider.create());
@@ -235,11 +159,7 @@ export class CoreTools {
235
159
  }
236
160
  // note current ViewClipByElementTool is not automatically registered so the app must call ViewClipByElementTool.register();
237
161
  static get sectionByElementCommandItemDef() {
238
- return new ToolItemDef({
239
- toolId: ViewClipByElementTool.toolId,
240
- iconSpec: ViewClipByElementTool.iconSpec,
241
- label: ViewClipByElementTool.flyover,
242
- description: ViewClipByElementTool.description,
162
+ return createForTool(ViewClipByElementTool, {
243
163
  execute: async () => {
244
164
  this.turnOnClipVolume();
245
165
  return IModelApp.tools.run(ViewClipByElementTool.toolId, ViewClipDecorationProvider.create());
@@ -248,11 +168,7 @@ export class CoreTools {
248
168
  }
249
169
  // note current ViewClipByRangeTool is not automatically registered so the app must call ViewClipByRangeTool.register();
250
170
  static get sectionByRangeCommandItemDef() {
251
- return new ToolItemDef({
252
- toolId: ViewClipByRangeTool.toolId,
253
- iconSpec: ViewClipByRangeTool.iconSpec,
254
- label: ViewClipByRangeTool.flyover,
255
- description: ViewClipByRangeTool.description,
171
+ return createForTool(ViewClipByRangeTool, {
256
172
  execute: async () => {
257
173
  this.turnOnClipVolume();
258
174
  return IModelApp.tools.run(ViewClipByRangeTool.toolId, ViewClipDecorationProvider.create());
@@ -261,11 +177,7 @@ export class CoreTools {
261
177
  }
262
178
  // note current ViewClipByShapeTool is not automatically registered so the app must call ViewClipByShapeTool.register();
263
179
  static get sectionByShapeCommandItemDef() {
264
- return new ToolItemDef({
265
- toolId: ViewClipByShapeTool.toolId,
266
- iconSpec: ViewClipByShapeTool.iconSpec,
267
- label: ViewClipByShapeTool.flyover,
268
- description: ViewClipByShapeTool.description,
180
+ return createForTool(ViewClipByShapeTool, {
269
181
  execute: async () => {
270
182
  this.turnOnClipVolume();
271
183
  return IModelApp.tools.run(ViewClipByShapeTool.toolId, ViewClipDecorationProvider.create());
@@ -339,27 +251,11 @@ export class CoreTools {
339
251
  }
340
252
  // note current MeasureDistanceTool is not automatically registered so the app must call MeasureDistanceTool.register();
341
253
  static get measureDistanceToolItemDef() {
342
- return new ToolItemDef({
343
- toolId: MeasureDistanceTool.toolId,
344
- iconSpec: MeasureDistanceTool.iconSpec,
345
- label: MeasureDistanceTool.flyover,
346
- description: MeasureDistanceTool.description,
347
- execute: async () => {
348
- return IModelApp.tools.run(MeasureDistanceTool.toolId);
349
- },
350
- });
254
+ return createForTool(MeasureDistanceTool);
351
255
  }
352
256
  // note current MeasureLocationTool is not automatically registered so the app must call MeasureLocationTool.register();
353
257
  static get measureLocationToolItemDef() {
354
- return new ToolItemDef({
355
- toolId: MeasureLocationTool.toolId,
356
- iconSpec: MeasureLocationTool.iconSpec,
357
- label: MeasureLocationTool.flyover,
358
- description: MeasureLocationTool.description,
359
- execute: async () => {
360
- return IModelApp.tools.run(MeasureLocationTool.toolId);
361
- },
362
- });
258
+ return createForTool(MeasureLocationTool);
363
259
  }
364
260
  static get measureToolGroup() {
365
261
  MeasureDistanceTool.register();
@@ -392,15 +288,23 @@ export class CoreTools {
392
288
  });
393
289
  }
394
290
  static get restoreFrontstageLayoutCommandItemDef() {
395
- return new ToolItemDef({
396
- toolId: RestoreFrontstageLayoutTool.toolId,
397
- iconSpec: RestoreFrontstageLayoutTool.iconSpec,
398
- label: RestoreFrontstageLayoutTool.flyover,
399
- description: RestoreFrontstageLayoutTool.description,
400
- execute: async () => {
401
- return IModelApp.tools.run(RestoreFrontstageLayoutTool.toolId);
402
- },
403
- });
291
+ return createForTool(RestoreFrontstageLayoutTool);
404
292
  }
405
293
  }
294
+ function createForTool(toolType, overrides) {
295
+ const icon = ToolUtilities.isWithIcon(toolType)
296
+ ? toolType.iconElement
297
+ : undefined;
298
+ return new ToolItemDef({
299
+ toolId: toolType.toolId,
300
+ iconSpec: toolType.iconSpec,
301
+ label: toolType.flyover,
302
+ description: toolType.description,
303
+ execute: async () => {
304
+ return IModelApp.tools.run(toolType.toolId);
305
+ },
306
+ ...(icon ? { icon } : {}),
307
+ ...overrides,
308
+ });
309
+ }
406
310
  //# sourceMappingURL=CoreToolDefinitions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CoreToolDefin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,CAAC;SACjB,CAAC,CAAC;IACL,CAAC;IAEM,MAAM,KAAK,qBAAqB;QACrC,OAAO,IAAI,cAAc,CAAC;YACxB,SAAS,EAAE,4BAA4B;YACvC,IAAI,EAAE,oBAAC,iBAAiB,OAAG;YAC3B,QAAQ,EAAE,oCAAoC;YAC9C,QAAQ,EAAE,+BAA+B,EAAE;YAC3C,OAAO,EAAE,KAAK,IAAI,EAAE;gBAClB,MAAM,gBAAgB,GAAG,WAAW,CAAC,mBAAmB,EAAE,CAAC;gBAC3D,IAAI,gBAAgB,EAAE,CAAC;oBACrB,gBAAgB,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;gBAC3C,CAAC;gBACD,MAAM,IAAI,GAAG,SAAS,CAAC,SAAS,CAAC,aAAa,CAAC;gBAC/C,IAAI,IAAI;oBAAE,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;;oBAChC,MAAM,SAAS,CAAC,SAAS,CAAC,gBAAgB,EAAE,CAAC;YACpD,CAAC;SACF,CAAC,CAAC;IACL,CAAC;IAEM,MAAM,KAAK,qCAAqC;QACrD,OAAO,IAAI,WAAW,CAAC;YACrB,MAAM,EAAE,2BAA2B,CAAC,MAAM;YAC1C,QAAQ,EAAE,2BAA2B,CAAC,QAAQ;YAC9C,KAAK,EAAE,2BAA2B,CAAC,OAAO;YAC1C,WAAW,EAAE,2BAA2B,CAAC,WAAW;YACpD,OAAO,EAAE,KAAK,IAAI,EAAE;gBAClB,OAAO,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAC;YACjE,CAAC;SACF,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tools\n */\n\nimport * as React from \"react\";\nimport {\n FitViewTool,\n FlyViewTool,\n IModelApp,\n MeasureDistanceTool,\n MeasureLocationTool,\n PanViewTool,\n RotateViewTool,\n SelectionTool,\n SetupWalkCameraTool,\n ViewClipByElementTool,\n ViewClipByPlaneTool,\n ViewClipByRangeTool,\n ViewClipByShapeTool,\n ViewClipDecorationProvider,\n ViewRedoTool,\n ViewToggleCameraTool,\n ViewUndoTool,\n WalkViewTool,\n WindowAreaTool,\n ZoomViewTool,\n} from \"@itwin/core-frontend\";\nimport {\n ConditionalBooleanValue,\n ConditionalStringValue,\n} from \"@itwin/appui-abstract\";\nimport {\n SvgCameraAnimation,\n SvgCameraAnimationDisabled,\n} from \"@itwin/itwinui-icons-react\";\nimport { getIsHiddenIfSelectionNotActive } from \"../selection/SelectionContextItemDef.js\";\nimport { CommandItemDef } from \"../shared/CommandItemDef.js\";\nimport { ToolItemDef } from \"../shared/ToolItemDef.js\";\nimport { SyncUiEventId } from \"../syncui/UiSyncEvent.js\";\nimport { GroupItemDef } from \"../toolbar/GroupItem.js\";\nimport { RestoreFrontstageLayoutTool } from \"./RestoreLayoutTool.js\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport { SvgGyroscope } from \"../icons/SvgGyroscope.js\";\nimport { SvgSectionTool } from \"../icons/SvgSectionTool.js\";\nimport { SvgSelectionClear } from \"../icons/SvgSelectionClear.js\";\nimport {\n SvgMeasure,\n SvgProcess,\n SvgRotateLeft,\n} from \"@itwin/itwinui-icons-react\";\nimport { ConditionalIconItem } from \"@itwin/core-react\";\nimport type { ToolbarItems } from \"./ToolbarItems.js\";\nimport { getActiveViewport } from \"../utils/getActiveViewport.js\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** Utility Class that provides definitions of tools provided by the ($core-frontend) core. These definitions can be used to populate the UI.\n * @public\n * @deprecated in 4.15.0. Use {@link ToolbarItems} instead.\n */\nexport class CoreTools {\n public static get keyinPaletteButtonItemDef() {\n return new ToolItemDef({\n toolId: \"uif:keyinpalette\",\n icon: <SvgProcess />,\n labelKey: \"UiFramework:keyinbrowser.label\",\n execute: () => {\n UiFramework.showKeyinPalette(\n IModelApp.tools.getToolList().map((tool) => ({ value: tool.keyin }))\n );\n },\n });\n }\n\n public static get fitViewCommand() {\n return new ToolItemDef({\n toolId: FitViewTool.toolId,\n iconSpec: FitViewTool.iconSpec,\n label: FitViewTool.flyover,\n description: FitViewTool.description,\n execute: async () =>\n IModelApp.tools.run(\n FitViewTool.toolId,\n IModelApp.viewManager.selectedView,\n true\n ),\n });\n }\n\n public static get windowAreaCommand() {\n return new ToolItemDef({\n toolId: WindowAreaTool.toolId,\n iconSpec: WindowAreaTool.iconSpec,\n label: WindowAreaTool.flyover,\n description: WindowAreaTool.description,\n execute: async () =>\n IModelApp.tools.run(\n WindowAreaTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get zoomViewCommand() {\n return new ToolItemDef({\n toolId: ZoomViewTool.toolId,\n iconSpec: ZoomViewTool.iconSpec,\n label: ZoomViewTool.flyover,\n description: ZoomViewTool.description,\n execute: async () =>\n IModelApp.tools.run(\n ZoomViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get panViewCommand() {\n return new ToolItemDef({\n toolId: PanViewTool.toolId,\n iconSpec: PanViewTool.iconSpec,\n label: PanViewTool.flyover,\n description: PanViewTool.description,\n execute: async () =>\n IModelApp.tools.run(\n PanViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get rotateViewCommand() {\n return new ToolItemDef({\n toolId: RotateViewTool.toolId,\n icon: new ConditionalIconItem(() => {\n const viewport = getActiveViewport();\n if (viewport?.view.is2d()) return <SvgRotateLeft />;\n return <SvgGyroscope />;\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n label: RotateViewTool.flyover,\n description: RotateViewTool.description,\n execute: async () =>\n IModelApp.tools.run(\n RotateViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get walkViewCommand() {\n return new ToolItemDef({\n toolId: WalkViewTool.toolId,\n iconSpec: WalkViewTool.iconSpec,\n label: WalkViewTool.flyover,\n description: WalkViewTool.description,\n isHidden: new ConditionalBooleanValue(() => {\n const viewport = getActiveViewport();\n return !!viewport?.view.is2d();\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n execute: async () =>\n IModelApp.tools.run(\n WalkViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get selectElementCommand() {\n return new ToolItemDef({\n toolId: SelectionTool.toolId,\n iconSpec: SelectionTool.iconSpec,\n label: SelectionTool.flyover,\n description: SelectionTool.description,\n execute: async () => IModelApp.tools.run(SelectionTool.toolId),\n });\n }\n\n public static get setupCameraWalkTool() {\n return new ToolItemDef({\n toolId: SetupWalkCameraTool.toolId,\n iconSpec: SetupWalkCameraTool.iconSpec,\n label: SetupWalkCameraTool.flyover,\n description: SetupWalkCameraTool.description,\n execute: async () => IModelApp.tools.run(SetupWalkCameraTool.toolId),\n });\n }\n\n public static get toggleCameraViewCommand() {\n return new ToolItemDef({\n toolId: ViewToggleCameraTool.toolId,\n iconSpec: new ConditionalIconItem(() => {\n const viewport = getActiveViewport();\n if (viewport?.view.is3d() && viewport?.isCameraOn) {\n return <SvgCameraAnimation />;\n }\n\n return <SvgCameraAnimationDisabled />;\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n label: new ConditionalStringValue(() => {\n const viewport = getActiveViewport();\n if (viewport?.view.is3d() && viewport?.isCameraOn) {\n return UiFramework.translate(\n \"tools.View.ToggleCamera.turnOffFlyover\"\n );\n }\n return UiFramework.translate(\"tools.View.ToggleCamera.turnOnFlyover\");\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n description: ViewToggleCameraTool.description,\n isHidden: new ConditionalBooleanValue(() => {\n const viewport = getActiveViewport();\n return !(viewport?.view.is3d() && viewport?.view.supportsCamera());\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n execute: async () =>\n IModelApp.tools.run(\n ViewToggleCameraTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get flyViewCommand() {\n return new ToolItemDef({\n toolId: FlyViewTool.toolId,\n iconSpec: FlyViewTool.iconSpec,\n label: FlyViewTool.flyover,\n description: FlyViewTool.description,\n execute: async () =>\n IModelApp.tools.run(\n FlyViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n // TODO - Need to provide a sync message that is fired when the Undo/Redo button needs to be refreshed in the\n // active view.\n public static get viewUndoCommand() {\n return new ToolItemDef({\n toolId: ViewUndoTool.toolId,\n isDisabled: new ConditionalBooleanValue(() => {\n const viewport = getActiveViewport();\n if (!viewport) return false;\n return !viewport.isUndoPossible;\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n iconSpec: ViewUndoTool.iconSpec,\n label: ViewUndoTool.flyover,\n description: ViewUndoTool.description,\n execute: async () =>\n IModelApp.tools.run(\n ViewUndoTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get viewRedoCommand() {\n return new ToolItemDef({\n toolId: ViewRedoTool.toolId,\n iconSpec: ViewRedoTool.iconSpec,\n label: ViewRedoTool.flyover,\n description: ViewRedoTool.description,\n execute: async () =>\n IModelApp.tools.run(\n ViewRedoTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n isDisabled: new ConditionalBooleanValue(() => {\n const viewport = getActiveViewport();\n if (!viewport) return false;\n return !viewport.isRedoPossible;\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n });\n }\n\n private static turnOnClipVolume() {\n const vp = IModelApp.viewManager.selectedView;\n if (!vp || !vp.view.is3d()) return;\n\n // Turn on clip volume flag for section tools\n vp.viewFlags = vp.viewFlags.with(\"clipVolume\", true);\n }\n\n // note current ViewClipByPlaneTool is not automatically registered so the app must call ViewClipByPlaneTool.register();\n public static get sectionByPlaneCommandItemDef() {\n return new ToolItemDef({\n toolId: ViewClipByPlaneTool.toolId,\n iconSpec: ViewClipByPlaneTool.iconSpec,\n label: ViewClipByPlaneTool.flyover,\n description: ViewClipByPlaneTool.description,\n execute: async () => {\n this.turnOnClipVolume();\n return IModelApp.tools.run(\n ViewClipByPlaneTool.toolId,\n ViewClipDecorationProvider.create()\n );\n },\n });\n }\n\n // note current ViewClipByElementTool is not automatically registered so the app must call ViewClipByElementTool.register();\n public static get sectionByElementCommandItemDef() {\n return new ToolItemDef({\n toolId: ViewClipByElementTool.toolId,\n iconSpec: ViewClipByElementTool.iconSpec,\n label: ViewClipByElementTool.flyover,\n description: ViewClipByElementTool.description,\n execute: async () => {\n this.turnOnClipVolume();\n return IModelApp.tools.run(\n ViewClipByElementTool.toolId,\n ViewClipDecorationProvider.create()\n );\n },\n });\n }\n\n // note current ViewClipByRangeTool is not automatically registered so the app must call ViewClipByRangeTool.register();\n public static get sectionByRangeCommandItemDef() {\n return new ToolItemDef({\n toolId: ViewClipByRangeTool.toolId,\n iconSpec: ViewClipByRangeTool.iconSpec,\n label: ViewClipByRangeTool.flyover,\n description: ViewClipByRangeTool.description,\n execute: async () => {\n this.turnOnClipVolume();\n return IModelApp.tools.run(\n ViewClipByRangeTool.toolId,\n ViewClipDecorationProvider.create()\n );\n },\n });\n }\n\n // note current ViewClipByShapeTool is not automatically registered so the app must call ViewClipByShapeTool.register();\n public static get sectionByShapeCommandItemDef() {\n return new ToolItemDef({\n toolId: ViewClipByShapeTool.toolId,\n iconSpec: ViewClipByShapeTool.iconSpec,\n label: ViewClipByShapeTool.flyover,\n description: ViewClipByShapeTool.description,\n execute: async () => {\n this.turnOnClipVolume();\n return IModelApp.tools.run(\n ViewClipByShapeTool.toolId,\n ViewClipDecorationProvider.create()\n );\n },\n });\n }\n\n public static get sectionToolGroup() {\n ViewClipByElementTool.register();\n ViewClipByPlaneTool.register();\n ViewClipByRangeTool.register();\n ViewClipByShapeTool.register();\n\n return new GroupItemDef({\n groupId: \"sectionTools-group\",\n labelKey: \"UiFramework:tools.sectionTools\",\n icon: <SvgSectionTool />,\n isHidden: new ConditionalBooleanValue(() => {\n const viewport = getActiveViewport();\n return !!viewport?.view.is2d();\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n items: [\n this.sectionByPlaneCommandItemDef,\n this.sectionByElementCommandItemDef,\n this.sectionByRangeCommandItemDef,\n this.sectionByShapeCommandItemDef,\n ],\n itemsInColumn: 4,\n });\n }\n\n public static get sectionToolGroupWithPanel() {\n ViewClipByElementTool.register();\n ViewClipByPlaneTool.register();\n ViewClipByRangeTool.register();\n ViewClipByShapeTool.register();\n\n return new GroupItemDef({\n groupId: \"sectionTools-group-with-panel\",\n labelKey: \"UiFramework:tools.sectionTools\",\n panelLabelKey: \"UiFramework:tools.sectionPanelLabel\",\n icon: <SvgSectionTool />,\n isHidden: new ConditionalBooleanValue(() => {\n const viewport = getActiveViewport();\n return !!viewport?.view.is2d();\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n items: [\n new ToolItemDef({\n ...this.sectionByPlaneCommandItemDef,\n labelKey: \"UiFramework:tools.sectionByPlane\",\n }),\n new ToolItemDef({\n ...this.sectionByElementCommandItemDef,\n labelKey: \"UiFramework:tools.sectionByElement\",\n }),\n new ToolItemDef({\n ...this.sectionByRangeCommandItemDef,\n labelKey: \"UiFramework:tools.sectionByRange\",\n }),\n new ToolItemDef({\n ...this.sectionByShapeCommandItemDef,\n labelKey: \"UiFramework:tools.sectionByShape\",\n }),\n ],\n itemsInColumn: 4,\n });\n }\n\n // note current MeasureDistanceTool is not automatically registered so the app must call MeasureDistanceTool.register();\n public static get measureDistanceToolItemDef() {\n return new ToolItemDef({\n toolId: MeasureDistanceTool.toolId,\n iconSpec: MeasureDistanceTool.iconSpec,\n label: MeasureDistanceTool.flyover,\n description: MeasureDistanceTool.description,\n execute: async () => {\n return IModelApp.tools.run(MeasureDistanceTool.toolId);\n },\n });\n }\n\n // note current MeasureLocationTool is not automatically registered so the app must call MeasureLocationTool.register();\n public static get measureLocationToolItemDef() {\n return new ToolItemDef({\n toolId: MeasureLocationTool.toolId,\n iconSpec: MeasureLocationTool.iconSpec,\n label: MeasureLocationTool.flyover,\n description: MeasureLocationTool.description,\n execute: async () => {\n return IModelApp.tools.run(MeasureLocationTool.toolId);\n },\n });\n }\n\n public static get measureToolGroup() {\n MeasureDistanceTool.register();\n MeasureLocationTool.register();\n\n return new GroupItemDef({\n groupId: \"measureTools-group\",\n labelKey: \"UiFramework:tools.measureTools\",\n icon: <SvgMeasure />,\n items: [this.measureDistanceToolItemDef, this.measureLocationToolItemDef],\n itemsInColumn: 2,\n });\n }\n\n public static get clearSelectionItemDef() {\n return new CommandItemDef({\n commandId: \"UiFramework.ClearSelection\",\n icon: <SvgSelectionClear />,\n labelKey: \"UiFramework:buttons.clearSelection\",\n isHidden: getIsHiddenIfSelectionNotActive(),\n execute: async () => {\n const iModelConnection = UiFramework.getIModelConnection();\n if (iModelConnection) {\n iModelConnection.selectionSet.emptyAll();\n }\n const tool = IModelApp.toolAdmin.primitiveTool;\n if (tool) await tool.onRestartTool();\n else await IModelApp.toolAdmin.startDefaultTool();\n },\n });\n }\n\n public static get restoreFrontstageLayoutCommandItemDef() {\n return new ToolItemDef({\n toolId: RestoreFrontstageLayoutTool.toolId,\n iconSpec: RestoreFrontstageLayoutTool.iconSpec,\n label: RestoreFrontstageLayoutTool.flyover,\n description: RestoreFrontstageLayoutTool.description,\n execute: async () => {\n return IModelApp.tools.run(RestoreFrontstageLayoutTool.toolId);\n },\n });\n }\n}\n"]}
1
+ {"version":3,"file":"CoreToolDefinitions.js","sourceRoot":"","sources":["../../../src/appui-react/tools/CoreToolDefinitions.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,WAAW,EACX,WAAW,EACX,SAAS,EACT,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACX,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,0BAA0B,EAC1B,YAAY,EACZ,oBAAoB,EACpB,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,YAAY,GACb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,+BAA+B,EAAE,MAAM,yCAAyC,CAAC;AAC1F,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAEpE,OAAO,EAAE,iBAAiB,EAAE,MA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AE,CAAC;QACzB,GAAG,SAAS;KACb,CAAC,CAAC;AACL,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tools\n */\n\nimport * as React from \"react\";\nimport type { ToolType } from \"@itwin/core-frontend\";\nimport {\n FitViewTool,\n FlyViewTool,\n IModelApp,\n MeasureDistanceTool,\n MeasureLocationTool,\n PanViewTool,\n RotateViewTool,\n SelectionTool,\n SetupWalkCameraTool,\n ViewClipByElementTool,\n ViewClipByPlaneTool,\n ViewClipByRangeTool,\n ViewClipByShapeTool,\n ViewClipDecorationProvider,\n ViewRedoTool,\n ViewToggleCameraTool,\n ViewUndoTool,\n WalkViewTool,\n WindowAreaTool,\n ZoomViewTool,\n} from \"@itwin/core-frontend\";\nimport {\n ConditionalBooleanValue,\n ConditionalStringValue,\n} from \"@itwin/appui-abstract\";\nimport { ToolUtilities } from \"@itwin/imodel-components-react\";\nimport { getIsHiddenIfSelectionNotActive } from \"../selection/SelectionContextItemDef.js\";\nimport { CommandItemDef } from \"../shared/CommandItemDef.js\";\nimport { ToolItemDef } from \"../shared/ToolItemDef.js\";\nimport { SyncUiEventId } from \"../syncui/UiSyncEvent.js\";\nimport { GroupItemDef } from \"../toolbar/GroupItem.js\";\nimport { RestoreFrontstageLayoutTool } from \"./RestoreLayoutTool.js\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport { SvgSectionTool } from \"../icons/SvgSectionTool.js\";\nimport { SvgSelectionClear } from \"../icons/SvgSelectionClear.js\";\nimport { SvgMeasure, SvgProcess } from \"@itwin/itwinui-icons-react\";\nimport type { ToolbarItems } from \"./ToolbarItems.js\";\nimport { getActiveViewport } from \"../utils/getActiveViewport.js\";\nimport type { ToolItemProps } from \"../shared/ItemProps.js\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** Utility Class that provides definitions of tools provided by the ($core-frontend) core. These definitions can be used to populate the UI.\n * @public\n * @deprecated in 4.15.0. Use {@link ToolbarItems} instead.\n */\nexport class CoreTools {\n public static get keyinPaletteButtonItemDef() {\n return new ToolItemDef({\n toolId: \"uif:keyinpalette\",\n icon: <SvgProcess />,\n labelKey: \"UiFramework:keyinbrowser.label\",\n execute: () => {\n UiFramework.showKeyinPalette(\n IModelApp.tools.getToolList().map((tool) => ({ value: tool.keyin }))\n );\n },\n });\n }\n\n public static get fitViewCommand() {\n return createForTool(FitViewTool, {\n execute: async () =>\n IModelApp.tools.run(\n FitViewTool.toolId,\n IModelApp.viewManager.selectedView,\n true\n ),\n });\n }\n\n public static get windowAreaCommand() {\n return createForTool(WindowAreaTool, {\n execute: async () =>\n IModelApp.tools.run(\n WindowAreaTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get zoomViewCommand() {\n return createForTool(ZoomViewTool, {\n execute: async () =>\n IModelApp.tools.run(\n ZoomViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get panViewCommand() {\n return createForTool(PanViewTool, {\n execute: async () =>\n IModelApp.tools.run(\n PanViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get rotateViewCommand() {\n return createForTool(RotateViewTool, {\n execute: async () =>\n IModelApp.tools.run(\n RotateViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get walkViewCommand() {\n return createForTool(WalkViewTool, {\n isHidden: new ConditionalBooleanValue(() => {\n const viewport = getActiveViewport();\n return !!viewport?.view.is2d();\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n execute: async () =>\n IModelApp.tools.run(\n WalkViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get selectElementCommand() {\n return createForTool(SelectionTool);\n }\n\n public static get setupCameraWalkTool() {\n return createForTool(SetupWalkCameraTool);\n }\n\n public static get toggleCameraViewCommand() {\n return createForTool(ViewToggleCameraTool, {\n label: new ConditionalStringValue(() => {\n const viewport = getActiveViewport();\n if (viewport?.view.is3d() && viewport?.isCameraOn) {\n return UiFramework.translate(\n \"tools.View.ToggleCamera.turnOffFlyover\"\n );\n }\n return UiFramework.translate(\"tools.View.ToggleCamera.turnOnFlyover\");\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n isHidden: new ConditionalBooleanValue(() => {\n const viewport = getActiveViewport();\n return !(viewport?.view.is3d() && viewport?.view.supportsCamera());\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n execute: async () =>\n IModelApp.tools.run(\n ViewToggleCameraTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get flyViewCommand() {\n return createForTool(FlyViewTool, {\n execute: async () =>\n IModelApp.tools.run(\n FlyViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n // TODO - Need to provide a sync message that is fired when the Undo/Redo button needs to be refreshed in the\n // active view.\n public static get viewUndoCommand() {\n return createForTool(ViewUndoTool, {\n isDisabled: new ConditionalBooleanValue(() => {\n const viewport = getActiveViewport();\n if (!viewport) return false;\n return !viewport.isUndoPossible;\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n execute: async () =>\n IModelApp.tools.run(\n ViewUndoTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get viewRedoCommand() {\n return createForTool(ViewRedoTool, {\n execute: async () =>\n IModelApp.tools.run(\n ViewRedoTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n isDisabled: new ConditionalBooleanValue(() => {\n const viewport = getActiveViewport();\n if (!viewport) return false;\n return !viewport.isRedoPossible;\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n });\n }\n\n private static turnOnClipVolume() {\n const vp = IModelApp.viewManager.selectedView;\n if (!vp || !vp.view.is3d()) return;\n\n // Turn on clip volume flag for section tools\n vp.viewFlags = vp.viewFlags.with(\"clipVolume\", true);\n }\n\n // note current ViewClipByPlaneTool is not automatically registered so the app must call ViewClipByPlaneTool.register();\n public static get sectionByPlaneCommandItemDef() {\n return createForTool(ViewClipByPlaneTool, {\n execute: async () => {\n this.turnOnClipVolume();\n return IModelApp.tools.run(\n ViewClipByPlaneTool.toolId,\n ViewClipDecorationProvider.create()\n );\n },\n });\n }\n\n // note current ViewClipByElementTool is not automatically registered so the app must call ViewClipByElementTool.register();\n public static get sectionByElementCommandItemDef() {\n return createForTool(ViewClipByElementTool, {\n execute: async () => {\n this.turnOnClipVolume();\n return IModelApp.tools.run(\n ViewClipByElementTool.toolId,\n ViewClipDecorationProvider.create()\n );\n },\n });\n }\n\n // note current ViewClipByRangeTool is not automatically registered so the app must call ViewClipByRangeTool.register();\n public static get sectionByRangeCommandItemDef() {\n return createForTool(ViewClipByRangeTool, {\n execute: async () => {\n this.turnOnClipVolume();\n return IModelApp.tools.run(\n ViewClipByRangeTool.toolId,\n ViewClipDecorationProvider.create()\n );\n },\n });\n }\n\n // note current ViewClipByShapeTool is not automatically registered so the app must call ViewClipByShapeTool.register();\n public static get sectionByShapeCommandItemDef() {\n return createForTool(ViewClipByShapeTool, {\n execute: async () => {\n this.turnOnClipVolume();\n return IModelApp.tools.run(\n ViewClipByShapeTool.toolId,\n ViewClipDecorationProvider.create()\n );\n },\n });\n }\n\n public static get sectionToolGroup() {\n ViewClipByElementTool.register();\n ViewClipByPlaneTool.register();\n ViewClipByRangeTool.register();\n ViewClipByShapeTool.register();\n\n return new GroupItemDef({\n groupId: \"sectionTools-group\",\n labelKey: \"UiFramework:tools.sectionTools\",\n icon: <SvgSectionTool />,\n isHidden: new ConditionalBooleanValue(() => {\n const viewport = getActiveViewport();\n return !!viewport?.view.is2d();\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n items: [\n this.sectionByPlaneCommandItemDef,\n this.sectionByElementCommandItemDef,\n this.sectionByRangeCommandItemDef,\n this.sectionByShapeCommandItemDef,\n ],\n itemsInColumn: 4,\n });\n }\n\n public static get sectionToolGroupWithPanel() {\n ViewClipByElementTool.register();\n ViewClipByPlaneTool.register();\n ViewClipByRangeTool.register();\n ViewClipByShapeTool.register();\n\n return new GroupItemDef({\n groupId: \"sectionTools-group-with-panel\",\n labelKey: \"UiFramework:tools.sectionTools\",\n panelLabelKey: \"UiFramework:tools.sectionPanelLabel\",\n icon: <SvgSectionTool />,\n isHidden: new ConditionalBooleanValue(() => {\n const viewport = getActiveViewport();\n return !!viewport?.view.is2d();\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n items: [\n new ToolItemDef({\n ...this.sectionByPlaneCommandItemDef,\n labelKey: \"UiFramework:tools.sectionByPlane\",\n }),\n new ToolItemDef({\n ...this.sectionByElementCommandItemDef,\n labelKey: \"UiFramework:tools.sectionByElement\",\n }),\n new ToolItemDef({\n ...this.sectionByRangeCommandItemDef,\n labelKey: \"UiFramework:tools.sectionByRange\",\n }),\n new ToolItemDef({\n ...this.sectionByShapeCommandItemDef,\n labelKey: \"UiFramework:tools.sectionByShape\",\n }),\n ],\n itemsInColumn: 4,\n });\n }\n\n // note current MeasureDistanceTool is not automatically registered so the app must call MeasureDistanceTool.register();\n public static get measureDistanceToolItemDef() {\n return createForTool(MeasureDistanceTool);\n }\n\n // note current MeasureLocationTool is not automatically registered so the app must call MeasureLocationTool.register();\n public static get measureLocationToolItemDef() {\n return createForTool(MeasureLocationTool);\n }\n\n public static get measureToolGroup() {\n MeasureDistanceTool.register();\n MeasureLocationTool.register();\n\n return new GroupItemDef({\n groupId: \"measureTools-group\",\n labelKey: \"UiFramework:tools.measureTools\",\n icon: <SvgMeasure />,\n items: [this.measureDistanceToolItemDef, this.measureLocationToolItemDef],\n itemsInColumn: 2,\n });\n }\n\n public static get clearSelectionItemDef() {\n return new CommandItemDef({\n commandId: \"UiFramework.ClearSelection\",\n icon: <SvgSelectionClear />,\n labelKey: \"UiFramework:buttons.clearSelection\",\n isHidden: getIsHiddenIfSelectionNotActive(),\n execute: async () => {\n const iModelConnection = UiFramework.getIModelConnection();\n if (iModelConnection) {\n iModelConnection.selectionSet.emptyAll();\n }\n const tool = IModelApp.toolAdmin.primitiveTool;\n if (tool) await tool.onRestartTool();\n else await IModelApp.toolAdmin.startDefaultTool();\n },\n });\n }\n\n public static get restoreFrontstageLayoutCommandItemDef() {\n return createForTool(RestoreFrontstageLayoutTool);\n }\n}\n\nfunction createForTool(toolType: ToolType, overrides?: Partial<ToolItemProps>) {\n const icon = ToolUtilities.isWithIcon(toolType)\n ? toolType.iconElement\n : undefined;\n return new ToolItemDef({\n toolId: toolType.toolId,\n iconSpec: toolType.iconSpec,\n label: toolType.flyover,\n description: toolType.description,\n execute: async () => {\n return IModelApp.tools.run(toolType.toolId);\n },\n ...(icon ? { icon } : {}),\n ...overrides,\n });\n}\n"]}
@@ -0,0 +1,3 @@
1
+ /** @internal */
2
+ export declare function defineToolIcons(): void;
3
+ //# sourceMappingURL=defineToolIcons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defineToolIcons.d.ts","sourceRoot":"","sources":["../../../src/appui-react/tools/defineToolIcons.tsx"],"names":[],"mappings":"AAoBA,gBAAgB;AAChB,wBAAgB,eAAe,SAG9B"}
@@ -0,0 +1,45 @@
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 * as React from "react";
6
+ import { RotateViewTool, ViewToggleCameraTool } from "@itwin/core-frontend";
7
+ import { ToolUtilities } from "@itwin/imodel-components-react";
8
+ import { SvgCameraAnimation, SvgCameraAnimationDisabled, SvgRotateLeft, } from "@itwin/itwinui-icons-react";
9
+ import { useConditionalValue } from "../hooks/useConditionalValue.js";
10
+ import { getActiveViewport } from "../utils/getActiveViewport.js";
11
+ import { SyncUiEventId } from "../syncui/UiSyncEvent.js";
12
+ import { SvgGyroscope } from "../icons/SvgGyroscope.js";
13
+ /** @internal */
14
+ export function defineToolIcons() {
15
+ defineIcon(RotateViewTool, React.createElement(RotateViewIcon, null));
16
+ defineIcon(ViewToggleCameraTool, React.createElement(ToggleCameraViewIcon, null));
17
+ }
18
+ function defineIcon(toolType, icon) {
19
+ if (ToolUtilities.isWithIcon(toolType))
20
+ return;
21
+ ToolUtilities.defineIcon(toolType, icon);
22
+ }
23
+ function RotateViewIcon() {
24
+ const is2d = useConditionalValue(() => {
25
+ const viewport = getActiveViewport();
26
+ return viewport?.view.is2d() ?? false;
27
+ }, [
28
+ SyncUiEventId.ActiveContentChanged,
29
+ SyncUiEventId.ActiveViewportChanged,
30
+ SyncUiEventId.ViewStateChanged,
31
+ ]);
32
+ return is2d ? React.createElement(SvgRotateLeft, null) : React.createElement(SvgGyroscope, null);
33
+ }
34
+ function ToggleCameraViewIcon() {
35
+ const cameraEnabled = useConditionalValue(() => {
36
+ const viewport = getActiveViewport();
37
+ return viewport?.view.is3d() && viewport?.isCameraOn;
38
+ }, [
39
+ SyncUiEventId.ActiveContentChanged,
40
+ SyncUiEventId.ActiveViewportChanged,
41
+ SyncUiEventId.ViewStateChanged,
42
+ ]);
43
+ return cameraEnabled ? (React.createElement(SvgCameraAnimation, null)) : (React.createElement(SvgCameraAnimationDisabled, null));
44
+ }
45
+ //# sourceMappingURL=defineToolIcons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defineToolIcons.js","sourceRoot":"","sources":["../../../src/appui-react/tools/defineToolIc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,OAAG,CAAC;AACrD,CAAC;AAED,SAAS,oBAAoB;IAC3B,MAAM,aAAa,GAAG,mBAAmB,CAAC,GAAG,EAAE;QAC7C,MAAM,QAAQ,GAAG,iBAAiB,EAAE,CAAC;QACrC,OAAO,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,QAAQ,EAAE,UAAU,CAAC;IACvD,CAAC,EAAE;QACD,aAAa,CAAC,oBAAoB;QAClC,aAAa,CAAC,qBAAqB;QACnC,aAAa,CAAC,gBAAgB;KAC/B,CAAC,CAAC;IAEH,OAAO,aAAa,CAAC,CAAC,CAAC,CACrB,oBAAC,kBAAkB,OAAG,CACvB,CAAC,CAAC,CAAC,CACF,oBAAC,0BAA0B,OAAG,CAC/B,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as React from \"react\";\nimport { RotateViewTool, ViewToggleCameraTool } from \"@itwin/core-frontend\";\nimport { ToolUtilities } from \"@itwin/imodel-components-react\";\nimport {\n SvgCameraAnimation,\n SvgCameraAnimationDisabled,\n SvgRotateLeft,\n} from \"@itwin/itwinui-icons-react\";\nimport { useConditionalValue } from \"../hooks/useConditionalValue.js\";\nimport { getActiveViewport } from \"../utils/getActiveViewport.js\";\nimport { SyncUiEventId } from \"../syncui/UiSyncEvent.js\";\nimport { SvgGyroscope } from \"../icons/SvgGyroscope.js\";\n\nimport type { ToolType } from \"@itwin/core-frontend\";\n\n/** @internal */\nexport function defineToolIcons() {\n defineIcon(RotateViewTool, <RotateViewIcon />);\n defineIcon(ViewToggleCameraTool, <ToggleCameraViewIcon />);\n}\n\nfunction defineIcon(toolType: ToolType, icon: React.ReactElement) {\n if (ToolUtilities.isWithIcon(toolType)) return;\n ToolUtilities.defineIcon(toolType, icon);\n}\n\nfunction RotateViewIcon() {\n const is2d = useConditionalValue(() => {\n const viewport = getActiveViewport();\n return viewport?.view.is2d() ?? false;\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]);\n\n return is2d ? <SvgRotateLeft /> : <SvgGyroscope />;\n}\n\nfunction ToggleCameraViewIcon() {\n const cameraEnabled = useConditionalValue(() => {\n const viewport = getActiveViewport();\n return viewport?.view.is3d() && viewport?.isCameraOn;\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]);\n\n return cameraEnabled ? (\n <SvgCameraAnimation />\n ) : (\n <SvgCameraAnimationDisabled />\n );\n}\n"]}
@@ -12,12 +12,14 @@ import type { ThemeId } from "../theme/ThemeId.js";
12
12
  export interface InitialAppUiSettings {
13
13
  colorTheme: ThemeId;
14
14
  dragInteraction: boolean;
15
+ /** @deprecated in 5.35.0. Use the default configuration. */
15
16
  widgetOpacity: number;
16
17
  showWidgetIcon?: boolean;
17
18
  /** @alpha */
18
19
  autoCollapseUnpinnedPanels?: boolean;
19
20
  animateToolSettings?: boolean;
20
21
  useToolAsToolSettingsLabel?: boolean;
22
+ /** @deprecated in 5.35.0. Use the default configuration. */
21
23
  toolbarOpacity: number;
22
24
  }
23
25
  /** These are the UI settings that are stored in the Redux store. They control the color theme,
@@ -36,6 +38,10 @@ export declare class AppUiSettings implements UserSettingsProvider {
36
38
  private static _settingNamespace;
37
39
  private _settings;
38
40
  private _applyingLocalSettings;
41
+ /** Bump this to invalidate stored settings. */
42
+ private static _currentVersion;
43
+ private _storedVersion;
44
+ private _version;
39
45
  colorTheme: UiStateEntry<ThemeId>;
40
46
  dragInteraction: UiStateEntry<boolean>;
41
47
  widgetOpacity: UiStateEntry<number>;
@@ -1 +1 @@
1
- {"version":3,"file":"AppUiSettings.d.ts","sourceRoot":"","sources":["../../../src/appui-react/uistate/AppUiSettings.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,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e,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IACvC,aAAa,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,cAAc,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IACtC,0BAA0B,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IAClD,mBAAmB,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IAC3C,0BAA0B,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IAClD,cAAc,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAE5C,OAAO,CAAC,aAAa,CAInB;gBAEU,QAAQ,EAAE,OAAO,CAAC,oBAAoB,CAAC;IAwFnD,OAAO,CAAC,iBAAiB,CAsCvB;IAEW,KAAK,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAkB7C,gBAAgB,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAGtE"}
@@ -25,6 +25,10 @@ export class AppUiSettings {
25
25
  static _settingNamespace = "AppUiSettings";
26
26
  _settings = [];
27
27
  _applyingLocalSettings = false;
28
+ /** Bump this to invalidate stored settings. */
29
+ static _currentVersion = 1;
30
+ _storedVersion = 0;
31
+ _version;
28
32
  colorTheme;
29
33
  dragInteraction;
30
34
  widgetOpacity;
@@ -39,6 +43,9 @@ export class AppUiSettings {
39
43
  window.localStorage.setItem("uifw:defaultTheme", theme);
40
44
  };
41
45
  constructor(defaults) {
46
+ this._version = new UiStateEntry(AppUiSettings._settingNamespace, "_version", () => AppUiSettings._currentVersion, (value) => {
47
+ this._storedVersion = value;
48
+ }, 0);
42
49
  this._settings = [];
43
50
  this.colorTheme = new UiStateEntry(AppUiSettings._settingNamespace, "ColorTheme", UiFramework.getColorTheme, this.setColorTheme, defaults.colorTheme);
44
51
  this._settings.push(this.colorTheme);
@@ -83,6 +90,14 @@ export class AppUiSettings {
83
90
  };
84
91
  async apply(storage) {
85
92
  this._applyingLocalSettings = true;
93
+ // Invalidate previously stored settings if the persisted version is outdated.
94
+ await this._version.getSettingAndApplyValue(storage);
95
+ if (this._storedVersion !== AppUiSettings._currentVersion) {
96
+ for (const setting of this._settings) {
97
+ await setting.deleteSetting(storage);
98
+ }
99
+ await this._version.saveSetting(storage);
100
+ }
86
101
  for (const setting of this._settings) {
87
102
  await setting.getSettingAndApplyValue(storage);
88
103
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AppUiSettings.js","sourceRoot":"","sources":["../../../src/appui-react/uistate/AppUiSettings.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAE3E,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAoBzE;;;;;;;;;;GAUG;AACH,MAAM,OAAO,aAAa;IACR,UAAU,GAAG,uBAAuB,CAAC;IAE7C,MAAM,CAAC,iBAAiB,GAAG,eAAe,CAAC;IAC3C,SAAS,GAA6B,EAAE,CAAC;IACzC,sBAAsB,GAAG,KAAK,CAAC;IAEhC,UAAU,CAAwB;IAClC,eAAe,CAAwB;IACvC,aAAa,CAAuB;IACpC,cAAc,CAAwB;IACtC,0BAA0B,CAAwB;IAClD,mBAAmB,CAAwB;IAC3C,0BAA0B,CAAwB;IAClD,cAAc,CAAuB;IAEpC,aAAa,GAAG,CAAC,KAAc,EAAE,EAAE;QACzC,WAAW,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACjC,6FAA6F;QAC7F,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,mBAAmB,EAAE,KAAK,CAAC,CAAC;IAC1D,CAAC,CAAC;IAEF,YAAY,QAAuC;QACjD,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QAEpB,IAAI,CAAC,UAAU,GAAG,IAA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AAW,CACxC,WAAW,CAAC,iBAAiB,EAAE,CAChC,CAAC;QAEJ,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,sBAAsB,CAAC,0BAA0B,CAAC;YACtE,MAAM,IAAI,CAAC,0BAA0B,CAAC,WAAW,CAC/C,WAAW,CAAC,iBAAiB,EAAE,CAChC,CAAC;QAEJ,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,sBAAsB,CAAC,iBAAiB,CAAC;YAC7D,MAAM,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,WAAW,CAAC,iBAAiB,EAAE,CAAC,CAAC;IAC3E,CAAC,CAAC;IAEK,KAAK,CAAC,KAAK,CAAC,OAAuB;QACxC,IAAI,CAAC,sBAAsB,GAAG,IAAI,CAAC;QACnC,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACrC,MAAM,OAAO,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;QACjD,CAAC;QACD,IAAI,CAAC,sBAAsB,GAAG,KAAK,CAAC;IACtC,CAAC;IAEM,KAAK,CAAC,gBAAgB,CAAC,OAAuB;QACnD,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC5B,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Settings\n */\n\nimport type { UiStateStorage } from \"@itwin/core-react\";\nimport { UiStateEntry } from \"@itwin/core-react\";\nimport { SyncUiEventDispatcher } from \"../syncui/SyncUiEventDispatcher.js\";\nimport type { UserSettingsProvider } from \"../UiFramework.js\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport type { UiSyncEventArgs } from \"../syncui/UiSyncEvent.js\";\nimport type { ThemeId } from \"../theme/ThemeId.js\";\nimport { ConfigurableUiActionId } from \"../redux/ConfigurableUiState.js\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** Default values that may be specified for [[AppUiSettings]].\n * @public\n * @deprecated in 4.15.0. Interface used in a deprecated class {@link AppUiSettings}.\n */\nexport interface InitialAppUiSettings {\n colorTheme: ThemeId;\n dragInteraction: boolean;\n widgetOpacity: number;\n showWidgetIcon?: boolean;\n /** @alpha */\n autoCollapseUnpinnedPanels?: boolean;\n animateToolSettings?: boolean;\n useToolAsToolSettingsLabel?: boolean;\n toolbarOpacity: number;\n}\n\n/** These are the UI settings that are stored in the Redux store. They control the color theme,\n * how toolbar group buttons work, and the opacity of floating widget when the cursor\n * is not inside them. It is expect that an IModelApp using App UI components will create and register AppUiSettings with\n * defaults specific to their application. This would be done by calling the following.\n *\n * ```ts\n * UiFramework.registerUserSettingsProvider(new AppUiSettings(defaults));\n * ```\n * @public\n * @deprecated in 4.15.0. Use {@link @itwin/core-react#UiStateStorage} to persist UI settings.\n */\nexport class AppUiSettings implements UserSettingsProvider {\n public readonly providerId = \"AppUiSettingsProvider\";\n\n private static _settingNamespace = \"AppUiSettings\";\n private _settings: Array<UiStateEntry<any>> = [];\n private _applyingLocalSettings = false;\n\n public colorTheme: UiStateEntry<ThemeId>;\n public dragInteraction: UiStateEntry<boolean>;\n public widgetOpacity: UiStateEntry<number>;\n public showWidgetIcon: UiStateEntry<boolean>;\n public autoCollapseUnpinnedPanels: UiStateEntry<boolean>;\n public animateToolSettings: UiStateEntry<boolean>;\n public useToolAsToolSettingsLabel: UiStateEntry<boolean>;\n public toolbarOpacity: UiStateEntry<number>;\n\n private setColorTheme = (theme: ThemeId) => {\n UiFramework.setColorTheme(theme);\n // always store to local storage to avoid flicker during startup if user is not yet logged-in\n window.localStorage.setItem(\"uifw:defaultTheme\", theme);\n };\n\n constructor(defaults: Partial<InitialAppUiSettings>) {\n this._settings = [];\n\n this.colorTheme = new UiStateEntry<ThemeId>(\n AppUiSettings._settingNamespace,\n \"ColorTheme\",\n UiFramework.getColorTheme,\n this.setColorTheme,\n defaults.colorTheme\n );\n this._settings.push(this.colorTheme);\n\n this.dragInteraction = new UiStateEntry<boolean>(\n AppUiSettings._settingNamespace,\n \"DragInteraction\",\n () => UiFramework.useDragInteraction,\n (value: boolean) => UiFramework.setUseDragInteraction(value),\n defaults.dragInteraction\n );\n this._settings.push(this.dragInteraction);\n\n this.showWidgetIcon = new UiStateEntry<boolean>(\n AppUiSettings._settingNamespace,\n \"ShowWidgetIcon\",\n () => UiFramework.showWidgetIcon,\n (value: boolean) => UiFramework.setShowWidgetIcon(value),\n defaults.showWidgetIcon\n );\n this._settings.push(this.showWidgetIcon);\n\n this.autoCollapseUnpinnedPanels = new UiStateEntry<boolean>(\n AppUiSettings._settingNamespace,\n \"AutoCollapseUnpinnedPanels\",\n () => UiFramework.autoCollapseUnpinnedPanels,\n (value: boolean) => UiFramework.setAutoCollapseUnpinnedPanels(value),\n defaults.autoCollapseUnpinnedPanels\n );\n this._settings.push(this.autoCollapseUnpinnedPanels);\n\n this.widgetOpacity = new UiStateEntry<number>(\n AppUiSettings._settingNamespace,\n \"WidgetOpacity\",\n () => UiFramework.getWidgetOpacity(),\n (value: number) => UiFramework.setWidgetOpacity(value),\n defaults.widgetOpacity\n );\n this._settings.push(this.widgetOpacity);\n\n this.animateToolSettings = new UiStateEntry<boolean>(\n AppUiSettings._settingNamespace,\n \"AnimateToolSettings\",\n () => UiFramework.animateToolSettings,\n (value: boolean) => UiFramework.setAnimateToolSettings(value),\n defaults.animateToolSettings\n );\n this._settings.push(this.animateToolSettings);\n\n this.useToolAsToolSettingsLabel = new UiStateEntry<boolean>(\n AppUiSettings._settingNamespace,\n \"UseToolAsToolSettingsLabel\",\n () => UiFramework.useToolAsToolSettingsLabel,\n (value: boolean) => UiFramework.setUseToolAsToolSettingsLabel(value),\n defaults.useToolAsToolSettingsLabel\n );\n this._settings.push(this.useToolAsToolSettingsLabel);\n\n this.toolbarOpacity = new UiStateEntry<number>(\n AppUiSettings._settingNamespace,\n \"ToolOpacity\",\n () => UiFramework.getToolbarOpacity(),\n (value: number) => UiFramework.setToolbarOpacity(value),\n defaults.toolbarOpacity\n );\n this._settings.push(this.toolbarOpacity);\n\n SyncUiEventDispatcher.onSyncUiEvent.addListener(this.handleSyncUiEvent);\n }\n\n private handleSyncUiEvent = async (args: UiSyncEventArgs) => {\n if (this._applyingLocalSettings) return;\n\n if (args.eventIds.has(ConfigurableUiActionId.SetTheme)) {\n await this.colorTheme.saveSetting(UiFramework.getUiStateStorage());\n // always store as default theme in local storage to avoid flicker during startup if user is not yet logged-in\n window.localStorage.setItem(\n \"uifw:defaultTheme\",\n UiFramework.getColorTheme()\n );\n }\n\n if (args.eventIds.has(ConfigurableUiActionId.SetDragInteraction))\n await this.dragInteraction.saveSetting(UiFramework.getUiStateStorage());\n\n if (args.eventIds.has(ConfigurableUiActionId.SetShowWidgetIcon))\n await this.showWidgetIcon.saveSetting(UiFramework.getUiStateStorage());\n\n if (args.eventIds.has(ConfigurableUiActionId.AutoCollapseUnpinnedPanels))\n await this.autoCollapseUnpinnedPanels.saveSetting(\n UiFramework.getUiStateStorage()\n );\n\n if (args.eventIds.has(ConfigurableUiActionId.SetWidgetOpacity))\n await this.widgetOpacity.saveSetting(UiFramework.getUiStateStorage());\n\n if (args.eventIds.has(ConfigurableUiActionId.AnimateToolSettings))\n await this.animateToolSettings.saveSetting(\n UiFramework.getUiStateStorage()\n );\n\n if (args.eventIds.has(ConfigurableUiActionId.UseToolAsToolSettingsLabel))\n await this.useToolAsToolSettingsLabel.saveSetting(\n UiFramework.getUiStateStorage()\n );\n\n if (args.eventIds.has(ConfigurableUiActionId.SetToolbarOpacity))\n await this.toolbarOpacity.saveSetting(UiFramework.getUiStateStorage());\n };\n\n public async apply(storage: UiStateStorage): Promise<void> {\n this._applyingLocalSettings = true;\n for (const setting of this._settings) {\n await setting.getSettingAndApplyValue(storage);\n }\n this._applyingLocalSettings = false;\n }\n\n public async loadUserSettings(storage: UiStateStorage): Promise<void> {\n await this.apply(storage);\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B,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Settings\n */\n\nimport type { UiStateStorage } from \"@itwin/core-react\";\nimport { UiStateEntry } from \"@itwin/core-react\";\nimport { SyncUiEventDispatcher } from \"../syncui/SyncUiEventDispatcher.js\";\nimport type { UserSettingsProvider } from \"../UiFramework.js\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport type { UiSyncEventArgs } from \"../syncui/UiSyncEvent.js\";\nimport type { ThemeId } from \"../theme/ThemeId.js\";\nimport { ConfigurableUiActionId } from \"../redux/ConfigurableUiState.js\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** Default values that may be specified for [[AppUiSettings]].\n * @public\n * @deprecated in 4.15.0. Interface used in a deprecated class {@link AppUiSettings}.\n */\nexport interface InitialAppUiSettings {\n colorTheme: ThemeId;\n dragInteraction: boolean;\n /** @deprecated in 5.35.0. Use the default configuration. */\n widgetOpacity: number;\n showWidgetIcon?: boolean;\n /** @alpha */\n autoCollapseUnpinnedPanels?: boolean;\n animateToolSettings?: boolean;\n useToolAsToolSettingsLabel?: boolean;\n /** @deprecated in 5.35.0. Use the default configuration. */\n toolbarOpacity: number;\n}\n\n/** These are the UI settings that are stored in the Redux store. They control the color theme,\n * how toolbar group buttons work, and the opacity of floating widget when the cursor\n * is not inside them. It is expect that an IModelApp using App UI components will create and register AppUiSettings with\n * defaults specific to their application. This would be done by calling the following.\n *\n * ```ts\n * UiFramework.registerUserSettingsProvider(new AppUiSettings(defaults));\n * ```\n * @public\n * @deprecated in 4.15.0. Use {@link @itwin/core-react#UiStateStorage} to persist UI settings.\n */\nexport class AppUiSettings implements UserSettingsProvider {\n public readonly providerId = \"AppUiSettingsProvider\";\n\n private static _settingNamespace = \"AppUiSettings\";\n private _settings: Array<UiStateEntry<any>> = [];\n private _applyingLocalSettings = false;\n\n /** Bump this to invalidate stored settings. */\n private static _currentVersion = 1;\n private _storedVersion = 0;\n private _version: UiStateEntry<number>;\n\n public colorTheme: UiStateEntry<ThemeId>;\n public dragInteraction: UiStateEntry<boolean>;\n public widgetOpacity: UiStateEntry<number>;\n public showWidgetIcon: UiStateEntry<boolean>;\n public autoCollapseUnpinnedPanels: UiStateEntry<boolean>;\n public animateToolSettings: UiStateEntry<boolean>;\n public useToolAsToolSettingsLabel: UiStateEntry<boolean>;\n public toolbarOpacity: UiStateEntry<number>;\n\n private setColorTheme = (theme: ThemeId) => {\n UiFramework.setColorTheme(theme);\n // always store to local storage to avoid flicker during startup if user is not yet logged-in\n window.localStorage.setItem(\"uifw:defaultTheme\", theme);\n };\n\n constructor(defaults: Partial<InitialAppUiSettings>) {\n this._version = new UiStateEntry<number>(\n AppUiSettings._settingNamespace,\n \"_version\",\n () => AppUiSettings._currentVersion,\n (value: number) => {\n this._storedVersion = value;\n },\n 0\n );\n\n this._settings = [];\n\n this.colorTheme = new UiStateEntry<ThemeId>(\n AppUiSettings._settingNamespace,\n \"ColorTheme\",\n UiFramework.getColorTheme,\n this.setColorTheme,\n defaults.colorTheme\n );\n this._settings.push(this.colorTheme);\n\n this.dragInteraction = new UiStateEntry<boolean>(\n AppUiSettings._settingNamespace,\n \"DragInteraction\",\n () => UiFramework.useDragInteraction,\n (value: boolean) => UiFramework.setUseDragInteraction(value),\n defaults.dragInteraction\n );\n this._settings.push(this.dragInteraction);\n\n this.showWidgetIcon = new UiStateEntry<boolean>(\n AppUiSettings._settingNamespace,\n \"ShowWidgetIcon\",\n () => UiFramework.showWidgetIcon,\n (value: boolean) => UiFramework.setShowWidgetIcon(value),\n defaults.showWidgetIcon\n );\n this._settings.push(this.showWidgetIcon);\n\n this.autoCollapseUnpinnedPanels = new UiStateEntry<boolean>(\n AppUiSettings._settingNamespace,\n \"AutoCollapseUnpinnedPanels\",\n () => UiFramework.autoCollapseUnpinnedPanels,\n (value: boolean) => UiFramework.setAutoCollapseUnpinnedPanels(value),\n defaults.autoCollapseUnpinnedPanels\n );\n this._settings.push(this.autoCollapseUnpinnedPanels);\n\n this.widgetOpacity = new UiStateEntry<number>(\n AppUiSettings._settingNamespace,\n \"WidgetOpacity\",\n () => UiFramework.getWidgetOpacity(),\n (value: number) => UiFramework.setWidgetOpacity(value),\n defaults.widgetOpacity\n );\n this._settings.push(this.widgetOpacity);\n\n this.animateToolSettings = new UiStateEntry<boolean>(\n AppUiSettings._settingNamespace,\n \"AnimateToolSettings\",\n () => UiFramework.animateToolSettings,\n (value: boolean) => UiFramework.setAnimateToolSettings(value),\n defaults.animateToolSettings\n );\n this._settings.push(this.animateToolSettings);\n\n this.useToolAsToolSettingsLabel = new UiStateEntry<boolean>(\n AppUiSettings._settingNamespace,\n \"UseToolAsToolSettingsLabel\",\n () => UiFramework.useToolAsToolSettingsLabel,\n (value: boolean) => UiFramework.setUseToolAsToolSettingsLabel(value),\n defaults.useToolAsToolSettingsLabel\n );\n this._settings.push(this.useToolAsToolSettingsLabel);\n\n this.toolbarOpacity = new UiStateEntry<number>(\n AppUiSettings._settingNamespace,\n \"ToolOpacity\",\n () => UiFramework.getToolbarOpacity(),\n (value: number) => UiFramework.setToolbarOpacity(value),\n defaults.toolbarOpacity\n );\n this._settings.push(this.toolbarOpacity);\n\n SyncUiEventDispatcher.onSyncUiEvent.addListener(this.handleSyncUiEvent);\n }\n\n private handleSyncUiEvent = async (args: UiSyncEventArgs) => {\n if (this._applyingLocalSettings) return;\n\n if (args.eventIds.has(ConfigurableUiActionId.SetTheme)) {\n await this.colorTheme.saveSetting(UiFramework.getUiStateStorage());\n // always store as default theme in local storage to avoid flicker during startup if user is not yet logged-in\n window.localStorage.setItem(\n \"uifw:defaultTheme\",\n UiFramework.getColorTheme()\n );\n }\n\n if (args.eventIds.has(ConfigurableUiActionId.SetDragInteraction))\n await this.dragInteraction.saveSetting(UiFramework.getUiStateStorage());\n\n if (args.eventIds.has(ConfigurableUiActionId.SetShowWidgetIcon))\n await this.showWidgetIcon.saveSetting(UiFramework.getUiStateStorage());\n\n if (args.eventIds.has(ConfigurableUiActionId.AutoCollapseUnpinnedPanels))\n await this.autoCollapseUnpinnedPanels.saveSetting(\n UiFramework.getUiStateStorage()\n );\n\n if (args.eventIds.has(ConfigurableUiActionId.SetWidgetOpacity))\n await this.widgetOpacity.saveSetting(UiFramework.getUiStateStorage());\n\n if (args.eventIds.has(ConfigurableUiActionId.AnimateToolSettings))\n await this.animateToolSettings.saveSetting(\n UiFramework.getUiStateStorage()\n );\n\n if (args.eventIds.has(ConfigurableUiActionId.UseToolAsToolSettingsLabel))\n await this.useToolAsToolSettingsLabel.saveSetting(\n UiFramework.getUiStateStorage()\n );\n\n if (args.eventIds.has(ConfigurableUiActionId.SetToolbarOpacity))\n await this.toolbarOpacity.saveSetting(UiFramework.getUiStateStorage());\n };\n\n public async apply(storage: UiStateStorage): Promise<void> {\n this._applyingLocalSettings = true;\n\n // Invalidate previously stored settings if the persisted version is outdated.\n await this._version.getSettingAndApplyValue(storage);\n if (this._storedVersion !== AppUiSettings._currentVersion) {\n for (const setting of this._settings) {\n await setting.deleteSetting(storage);\n }\n await this._version.saveSetting(storage);\n }\n\n for (const setting of this._settings) {\n await setting.getSettingAndApplyValue(storage);\n }\n this._applyingLocalSettings = false;\n }\n\n public async loadUserSettings(storage: UiStateStorage): Promise<void> {\n await this.apply(storage);\n }\n}\n"]}