@itwin/appui-react 5.18.0 → 5.20.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 (250) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/lib/appui-react/UiFramework.js +20 -13
  3. package/lib/appui-react/UiFramework.js.map +1 -1
  4. package/lib/appui-react/accudraw/AccuDrawPopupManager.js +1 -1
  5. package/lib/appui-react/accudraw/AccuDrawPopupManager.js.map +1 -1
  6. package/lib/appui-react/accudraw/AccuDrawWidget.js +1 -1
  7. package/lib/appui-react/accudraw/AccuDrawWidget.js.map +1 -1
  8. package/lib/appui-react/accudraw/Calculator.js +92 -98
  9. package/lib/appui-react/accudraw/Calculator.js.map +1 -1
  10. package/lib/appui-react/accudraw/CalculatorEngine.js +130 -129
  11. package/lib/appui-react/accudraw/CalculatorEngine.js.map +1 -1
  12. package/lib/appui-react/accudraw/CalculatorPopup.js +9 -12
  13. package/lib/appui-react/accudraw/CalculatorPopup.js.map +1 -1
  14. package/lib/appui-react/accudraw/FrameworkAccuDraw.js +39 -38
  15. package/lib/appui-react/accudraw/FrameworkAccuDraw.js.map +1 -1
  16. package/lib/appui-react/accudraw/MenuButton.js +20 -20
  17. package/lib/appui-react/accudraw/MenuButton.js.map +1 -1
  18. package/lib/appui-react/accudraw/MenuButtonPopup.js +9 -12
  19. package/lib/appui-react/accudraw/MenuButtonPopup.js.map +1 -1
  20. package/lib/appui-react/backstage/BackstageItemsManager.js +5 -5
  21. package/lib/appui-react/backstage/BackstageItemsManager.js.map +1 -1
  22. package/lib/appui-react/backstage/BackstageManager.js +1 -3
  23. package/lib/appui-react/backstage/BackstageManager.js.map +1 -1
  24. package/lib/appui-react/backstage/InternalBackstageManager.js +3 -5
  25. package/lib/appui-react/backstage/InternalBackstageManager.js.map +1 -1
  26. package/lib/appui-react/childwindow/InternalChildWindowManager.js +30 -32
  27. package/lib/appui-react/childwindow/InternalChildWindowManager.js.map +1 -1
  28. package/lib/appui-react/configurableui/ActivityTracker.js +33 -33
  29. package/lib/appui-react/configurableui/ActivityTracker.js.map +1 -1
  30. package/lib/appui-react/configurableui/ConfigurableUiContent.scss +0 -1
  31. package/lib/appui-react/configurableui/ConfigurableUiControl.js +8 -0
  32. package/lib/appui-react/configurableui/ConfigurableUiControl.js.map +1 -1
  33. package/lib/appui-react/configurableui/InternalConfigurableUiManager.js +8 -8
  34. package/lib/appui-react/configurableui/InternalConfigurableUiManager.js.map +1 -1
  35. package/lib/appui-react/configurableui/TimeTracker.js +25 -27
  36. package/lib/appui-react/configurableui/TimeTracker.js.map +1 -1
  37. package/lib/appui-react/content/ContentControl.js +2 -1
  38. package/lib/appui-react/content/ContentControl.js.map +1 -1
  39. package/lib/appui-react/content/ContentGroup.js +8 -4
  40. package/lib/appui-react/content/ContentGroup.js.map +1 -1
  41. package/lib/appui-react/content/ContentLayout.js +47 -38
  42. package/lib/appui-react/content/ContentLayout.js.map +1 -1
  43. package/lib/appui-react/content/IModelViewport.js +28 -23
  44. package/lib/appui-react/content/IModelViewport.js.map +1 -1
  45. package/lib/appui-react/content/InternalContentLayoutManager.js +1 -1
  46. package/lib/appui-react/content/InternalContentLayoutManager.js.map +1 -1
  47. package/lib/appui-react/content/InternalContentViewManager.js +9 -8
  48. package/lib/appui-react/content/InternalContentViewManager.js.map +1 -1
  49. package/lib/appui-react/content/StandardContentLayouts.js +141 -141
  50. package/lib/appui-react/content/StandardContentLayouts.js.map +1 -1
  51. package/lib/appui-react/content/ViewportContentControl.js +25 -22
  52. package/lib/appui-react/content/ViewportContentControl.js.map +1 -1
  53. package/lib/appui-react/cursor/CursorInformation.js +7 -6
  54. package/lib/appui-react/cursor/CursorInformation.js.map +1 -1
  55. package/lib/appui-react/cursor/cursorpopup/CursorPopup.js +9 -9
  56. package/lib/appui-react/cursor/cursorpopup/CursorPopup.js.map +1 -1
  57. package/lib/appui-react/cursor/cursorpopup/CursorPopupManager.js +7 -7
  58. package/lib/appui-react/cursor/cursorpopup/CursorPopupManager.js.map +1 -1
  59. package/lib/appui-react/dialog/DialogManagerBase.js +18 -19
  60. package/lib/appui-react/dialog/DialogManagerBase.js.map +1 -1
  61. package/lib/appui-react/dialog/InternalContentDialogManager.js +7 -7
  62. package/lib/appui-react/dialog/InternalContentDialogManager.js.map +1 -1
  63. package/lib/appui-react/dialog/InternalModalDialogManager.js +4 -4
  64. package/lib/appui-react/dialog/InternalModalDialogManager.js.map +1 -1
  65. package/lib/appui-react/dialog/InternalModelessDialogManager.js +6 -6
  66. package/lib/appui-react/dialog/InternalModelessDialogManager.js.map +1 -1
  67. package/lib/appui-react/dialog/ModelessDialog.js +3 -3
  68. package/lib/appui-react/dialog/ModelessDialog.js.map +1 -1
  69. package/lib/appui-react/feedback/ElementTooltip.js +3 -1
  70. package/lib/appui-react/feedback/ElementTooltip.js.map +1 -1
  71. package/lib/appui-react/feedback/ValidationTextbox.js +25 -25
  72. package/lib/appui-react/feedback/ValidationTextbox.js.map +1 -1
  73. package/lib/appui-react/frontstage/FrontstageDef.js +28 -10
  74. package/lib/appui-react/frontstage/FrontstageDef.js.map +1 -1
  75. package/lib/appui-react/frontstage/InternalFrontstageManager.js +96 -96
  76. package/lib/appui-react/frontstage/InternalFrontstageManager.js.map +1 -1
  77. package/lib/appui-react/frontstage/ModalFrontstage.js +5 -5
  78. package/lib/appui-react/frontstage/ModalFrontstage.js.map +1 -1
  79. package/lib/appui-react/frontstage/ModalSettingsStage.js +5 -4
  80. package/lib/appui-react/frontstage/ModalSettingsStage.js.map +1 -1
  81. package/lib/appui-react/frontstage/StandardFrontstageProvider.js +1 -0
  82. package/lib/appui-react/frontstage/StandardFrontstageProvider.js.map +1 -1
  83. package/lib/appui-react/keyboardshortcut/InternalKeyboardShortcut.js +22 -22
  84. package/lib/appui-react/keyboardshortcut/InternalKeyboardShortcut.js.map +1 -1
  85. package/lib/appui-react/keyboardshortcut/KeyboardShortcut.js +11 -9
  86. package/lib/appui-react/keyboardshortcut/KeyboardShortcut.js.map +1 -1
  87. package/lib/appui-react/keyboardshortcut/KeyboardShortcutMenu.js +17 -20
  88. package/lib/appui-react/keyboardshortcut/KeyboardShortcutMenu.js.map +1 -1
  89. package/lib/appui-react/layout/backstage/Backstage.js +11 -14
  90. package/lib/appui-react/layout/backstage/Backstage.js.map +1 -1
  91. package/lib/appui-react/layout/base/DragManager.js +6 -7
  92. package/lib/appui-react/layout/base/DragManager.js.map +1 -1
  93. package/lib/appui-react/layout/base/SafeAreaInsets.js +8 -8
  94. package/lib/appui-react/layout/base/SafeAreaInsets.js.map +1 -1
  95. package/lib/appui-react/layout/popup/Tooltip.js +8 -11
  96. package/lib/appui-react/layout/popup/Tooltip.js.map +1 -1
  97. package/lib/appui-react/layout/state/NineZoneStateReducer.d.ts.map +1 -1
  98. package/lib/appui-react/layout/state/NineZoneStateReducer.js +8 -4
  99. package/lib/appui-react/layout/state/NineZoneStateReducer.js.map +1 -1
  100. package/lib/appui-react/layout/widget/Overflow.d.ts.map +1 -1
  101. package/lib/appui-react/layout/widget/Overflow.js +11 -17
  102. package/lib/appui-react/layout/widget/Overflow.js.map +1 -1
  103. package/lib/appui-react/layout/widget/Overflow.scss +3 -48
  104. package/lib/appui-react/layout/widget/Tab.d.ts.map +1 -1
  105. package/lib/appui-react/layout/widget/Tab.js +7 -5
  106. package/lib/appui-react/layout/widget/Tab.js.map +1 -1
  107. package/lib/appui-react/messages/InputField.js +21 -24
  108. package/lib/appui-react/messages/InputField.js.map +1 -1
  109. package/lib/appui-react/messages/MessageManager.js +39 -38
  110. package/lib/appui-react/messages/MessageManager.js.map +1 -1
  111. package/lib/appui-react/messages/Pointer.js +38 -38
  112. package/lib/appui-react/messages/Pointer.js.map +1 -1
  113. package/lib/appui-react/messages/ReactNotifyMessageDetails.js +6 -0
  114. package/lib/appui-react/messages/ReactNotifyMessageDetails.js.map +1 -1
  115. package/lib/appui-react/messages/StatusMessageManager.js +2 -4
  116. package/lib/appui-react/messages/StatusMessageManager.js.map +1 -1
  117. package/lib/appui-react/navigationaids/CubeNavigationAidControl.js +1 -1
  118. package/lib/appui-react/navigationaids/CubeNavigationAidControl.js.map +1 -1
  119. package/lib/appui-react/navigationaids/DrawingNavigationAidControl.js +1 -1
  120. package/lib/appui-react/navigationaids/DrawingNavigationAidControl.js.map +1 -1
  121. package/lib/appui-react/navigationaids/NavigationAidControl.js +1 -0
  122. package/lib/appui-react/navigationaids/NavigationAidControl.js.map +1 -1
  123. package/lib/appui-react/navigationaids/SheetNavigationAid.js +55 -54
  124. package/lib/appui-react/navigationaids/SheetNavigationAid.js.map +1 -1
  125. package/lib/appui-react/navigationaids/SheetsModalFrontstage.js +22 -20
  126. package/lib/appui-react/navigationaids/SheetsModalFrontstage.js.map +1 -1
  127. package/lib/appui-react/navigationaids/StandardRotationNavigationAid.js +15 -14
  128. package/lib/appui-react/navigationaids/StandardRotationNavigationAid.js.map +1 -1
  129. package/lib/appui-react/pickers/ListPicker.js +28 -28
  130. package/lib/appui-react/pickers/ListPicker.js.map +1 -1
  131. package/lib/appui-react/pickers/ViewSelector.js +87 -86
  132. package/lib/appui-react/pickers/ViewSelector.js.map +1 -1
  133. package/lib/appui-react/popup/CardPopup.js +18 -21
  134. package/lib/appui-react/popup/CardPopup.js.map +1 -1
  135. package/lib/appui-react/popup/HTMLElementPopup.js +9 -12
  136. package/lib/appui-react/popup/HTMLElementPopup.js.map +1 -1
  137. package/lib/appui-react/popup/InputEditorPopup.js +18 -20
  138. package/lib/appui-react/popup/InputEditorPopup.js.map +1 -1
  139. package/lib/appui-react/popup/PopupManager.js +22 -25
  140. package/lib/appui-react/popup/PopupManager.js.map +1 -1
  141. package/lib/appui-react/popup/ToolSettingsPopup.js +17 -17
  142. package/lib/appui-react/popup/ToolSettingsPopup.js.map +1 -1
  143. package/lib/appui-react/popup/ToolbarPopup.js +18 -21
  144. package/lib/appui-react/popup/ToolbarPopup.js.map +1 -1
  145. package/lib/appui-react/redux/ReducerRegistry.js +2 -0
  146. package/lib/appui-react/redux/ReducerRegistry.js.map +1 -1
  147. package/lib/appui-react/redux/StateManager.js +4 -1
  148. package/lib/appui-react/redux/StateManager.js.map +1 -1
  149. package/lib/appui-react/selection/HideIsolateEmphasizeManager.js +7 -3
  150. package/lib/appui-react/selection/HideIsolateEmphasizeManager.js.map +1 -1
  151. package/lib/appui-react/shared/ActionButtonItemDef.js +13 -6
  152. package/lib/appui-react/shared/ActionButtonItemDef.js.map +1 -1
  153. package/lib/appui-react/shared/CommandItemDef.js +3 -3
  154. package/lib/appui-react/shared/CommandItemDef.js.map +1 -1
  155. package/lib/appui-react/shared/CustomItemDef.js +4 -2
  156. package/lib/appui-react/shared/CustomItemDef.js.map +1 -1
  157. package/lib/appui-react/shared/ItemDefBase.js +13 -5
  158. package/lib/appui-react/shared/ItemDefBase.js.map +1 -1
  159. package/lib/appui-react/shared/MenuItem.js +6 -1
  160. package/lib/appui-react/shared/MenuItem.js.map +1 -1
  161. package/lib/appui-react/shared/ToolItemDef.js +1 -1
  162. package/lib/appui-react/shared/ToolItemDef.js.map +1 -1
  163. package/lib/appui-react/stagepanels/StagePanelDef.js +4 -3
  164. package/lib/appui-react/stagepanels/StagePanelDef.js.map +1 -1
  165. package/lib/appui-react/statusbar/StatusBarItemsManager.js +5 -5
  166. package/lib/appui-react/statusbar/StatusBarItemsManager.js.map +1 -1
  167. package/lib/appui-react/statusfields/ViewAttributes.js +16 -16
  168. package/lib/appui-react/statusfields/ViewAttributes.js.map +1 -1
  169. package/lib/appui-react/statusfields/tileloading/TileLoadingIndicator.js +35 -33
  170. package/lib/appui-react/statusfields/tileloading/TileLoadingIndicator.js.map +1 -1
  171. package/lib/appui-react/syncui/InternalSyncUiEventDispatcher.js +7 -0
  172. package/lib/appui-react/syncui/InternalSyncUiEventDispatcher.js.map +1 -1
  173. package/lib/appui-react/syncui/SyncUiEventDispatcher.js +4 -3
  174. package/lib/appui-react/syncui/SyncUiEventDispatcher.js.map +1 -1
  175. package/lib/appui-react/timeline/AnalysisAnimationProvider.js +9 -8
  176. package/lib/appui-react/timeline/AnalysisAnimationProvider.js.map +1 -1
  177. package/lib/appui-react/timeline/ScheduleAnimationProvider.js +13 -12
  178. package/lib/appui-react/timeline/ScheduleAnimationProvider.js.map +1 -1
  179. package/lib/appui-react/timeline/SolarTimelineDataProvider.js +6 -5
  180. package/lib/appui-react/timeline/SolarTimelineDataProvider.js.map +1 -1
  181. package/lib/appui-react/toolbar/GroupItem.js +11 -5
  182. package/lib/appui-react/toolbar/GroupItem.js.map +1 -1
  183. package/lib/appui-react/toolbar/ToolbarItemsManager.js +7 -7
  184. package/lib/appui-react/toolbar/ToolbarItemsManager.js.map +1 -1
  185. package/lib/appui-react/tools/FrameworkToolAdmin.js +5 -1
  186. package/lib/appui-react/tools/FrameworkToolAdmin.js.map +1 -1
  187. package/lib/appui-react/tools/KeyinPaletteTools.js +2 -2
  188. package/lib/appui-react/tools/KeyinPaletteTools.js.map +1 -1
  189. package/lib/appui-react/tools/OpenSettingsTool.js +2 -2
  190. package/lib/appui-react/tools/OpenSettingsTool.js.map +1 -1
  191. package/lib/appui-react/tools/RestoreLayoutTool.js +4 -4
  192. package/lib/appui-react/tools/RestoreLayoutTool.js.map +1 -1
  193. package/lib/appui-react/tools/ToolSettingsTools.js +2 -2
  194. package/lib/appui-react/tools/ToolSettingsTools.js.map +1 -1
  195. package/lib/appui-react/toolsettings/DefaultToolSettingsProvider.js +15 -18
  196. package/lib/appui-react/toolsettings/DefaultToolSettingsProvider.js.map +1 -1
  197. package/lib/appui-react/toolsettings/InternalToolSettingsManager.js +8 -8
  198. package/lib/appui-react/toolsettings/InternalToolSettingsManager.js.map +1 -1
  199. package/lib/appui-react/toolsettings/ToolInformation.js +2 -0
  200. package/lib/appui-react/toolsettings/ToolInformation.js.map +1 -1
  201. package/lib/appui-react/toolsettings/ToolUiProvider.js +3 -0
  202. package/lib/appui-react/toolsettings/ToolUiProvider.js.map +1 -1
  203. package/lib/appui-react/ui-items-provider/AbstractUiItemsManager.js +1 -0
  204. package/lib/appui-react/ui-items-provider/AbstractUiItemsManager.js.map +1 -1
  205. package/lib/appui-react/ui-items-provider/BaseUiItemsProvider.js +2 -0
  206. package/lib/appui-react/ui-items-provider/BaseUiItemsProvider.js.map +1 -1
  207. package/lib/appui-react/ui-items-provider/StandardContentToolsProvider.js +1 -0
  208. package/lib/appui-react/ui-items-provider/StandardContentToolsProvider.js.map +1 -1
  209. package/lib/appui-react/ui-items-provider/StandardContentToolsUiItemsProvider.js +1 -0
  210. package/lib/appui-react/ui-items-provider/StandardContentToolsUiItemsProvider.js.map +1 -1
  211. package/lib/appui-react/ui-items-provider/StandardNavigationToolsProvider.js +1 -0
  212. package/lib/appui-react/ui-items-provider/StandardNavigationToolsProvider.js.map +1 -1
  213. package/lib/appui-react/ui-items-provider/StandardNavigationToolsUiItemsProvider.js +1 -0
  214. package/lib/appui-react/ui-items-provider/StandardNavigationToolsUiItemsProvider.js.map +1 -1
  215. package/lib/appui-react/ui-items-provider/StandardStatusbarItemsProvider.js +1 -0
  216. package/lib/appui-react/ui-items-provider/StandardStatusbarItemsProvider.js.map +1 -1
  217. package/lib/appui-react/ui-items-provider/StandardStatusbarUiItemsProvider.js +1 -0
  218. package/lib/appui-react/ui-items-provider/StandardStatusbarUiItemsProvider.js.map +1 -1
  219. package/lib/appui-react/ui-items-provider/UiItemsManager.js +3 -3
  220. package/lib/appui-react/ui-items-provider/UiItemsManager.js.map +1 -1
  221. package/lib/appui-react/uiadmin/FrameworkUiAdmin.js +1 -4
  222. package/lib/appui-react/uiadmin/FrameworkUiAdmin.js.map +1 -1
  223. package/lib/appui-react/uiprovider/ComponentGenerator.js +2 -0
  224. package/lib/appui-react/uiprovider/ComponentGenerator.js.map +1 -1
  225. package/lib/appui-react/uistate/AppUiSettings.js +41 -33
  226. package/lib/appui-react/uistate/AppUiSettings.js.map +1 -1
  227. package/lib/appui-react/utils/InternalUiShowHideManager.js +13 -14
  228. package/lib/appui-react/utils/InternalUiShowHideManager.js.map +1 -1
  229. package/lib/appui-react/widgets/StatusBarWidgetComposerControl.js +2 -5
  230. package/lib/appui-react/widgets/StatusBarWidgetComposerControl.js.map +1 -1
  231. package/lib/appui-react/widgets/WidgetControl.js +2 -0
  232. package/lib/appui-react/widgets/WidgetControl.js.map +1 -1
  233. package/lib/appui-react/widgets/WidgetDef.js +28 -7
  234. package/lib/appui-react/widgets/WidgetDef.js.map +1 -1
  235. package/lib/appui-react/widgets/WidgetHost.js +4 -4
  236. package/lib/appui-react/widgets/WidgetHost.js.map +1 -1
  237. package/lib/appui-react/widgets/WidgetManager.js +5 -7
  238. package/lib/appui-react/widgets/WidgetManager.js.map +1 -1
  239. package/lib/cjs/appui-react/configurableui/ConfigurableUiContent.scss +0 -1
  240. package/lib/cjs/appui-react/layout/widget/Overflow.scss +3 -48
  241. package/lib/esm/appui-react/configurableui/ConfigurableUiContent.scss +0 -1
  242. package/lib/esm/appui-react/layout/widget/Overflow.scss +3 -48
  243. package/package.json +10 -11
  244. package/lib/appui-react/layout/widget/Menu.d.ts +0 -16
  245. package/lib/appui-react/layout/widget/Menu.d.ts.map +0 -1
  246. package/lib/appui-react/layout/widget/Menu.js +0 -21
  247. package/lib/appui-react/layout/widget/Menu.js.map +0 -1
  248. package/lib/appui-react/layout/widget/Menu.scss +0 -12
  249. package/lib/cjs/appui-react/layout/widget/Menu.scss +0 -12
  250. package/lib/esm/appui-react/layout/widget/Menu.scss +0 -12
@@ -1 +1 @@
1
- {"version":3,"file":"ScheduleAnimationProvider.js","sourceRoot":"","sources":["../../../src/appui-react/timeline/ScheduleAnimationProvider.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAIH,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAE1E;;GAEG;AACH,mDAAmD;AACnD,MAAM,OAAO,qCAAsC,SAAQ,wBAAwB;IAGjF,YAAY,SAAoB,EAAE,QAAyB;QACzD,KAAK,CAAC,QAAQ,CAAC,CAAC;QAkCF,+BAA0B,G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C1B,IAAI,CAAC,iBAAiB;wBACpB,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,GAAG,SAAS,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC;;oBAC/D,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAC;YAClC,CAAC;YAED,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;CAeF","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 Timeline\n */\n\nimport type { ScreenViewport, ViewState } from \"@itwin/core-frontend\";\nimport type { PlaybackSettings } from \"@itwin/imodel-components-react\";\nimport { BaseTimelineDataProvider } from \"@itwin/imodel-components-react\";\n\n/** ScheduleAnimation Timeline Data Provider - allows a TimelineComponent to animate the data found in a ScheduleScript in a ViewState.\n * @public\n */\n// No access to scheduleScript to even mock in test\nexport class ScheduleAnimationTimelineDataProvider extends BaseTimelineDataProvider {\n private _viewState: ViewState;\n\n constructor(viewState: ViewState, viewport?: ScreenViewport) {\n super(viewport);\n this._viewState = viewState;\n\n if (viewState && viewState.scheduleScript) {\n this.supportsTimelineAnimation = true;\n }\n }\n\n public override async loadTimelineData(): Promise<boolean> {\n const script = this._viewState.scheduleScript;\n if (this.supportsTimelineAnimation && script) {\n // for now just initial settings\n this.updateSettings({\n duration: 20 * 1000, // this is playback duration\n loop: true,\n });\n\n const timeRange = script.duration;\n this.start = new Date(timeRange.low * 1000);\n this.end = new Date(timeRange.high * 1000);\n\n if (this._viewport) {\n if (this._viewport.timePoint)\n this.animationFraction =\n (this._viewport.timePoint - timeRange.low) / timeRange.length();\n else this.animationFraction = 0;\n }\n\n return true;\n }\n\n return false;\n }\n\n public override onAnimationFractionChanged = (animationFraction: number) => {\n this.animationFraction = animationFraction;\n if (this._viewport) {\n const script = this._viewport.displayStyle.scheduleScript;\n if (script)\n this._viewport.timePoint =\n script.duration.fractionToPoint(animationFraction);\n }\n };\n\n public override onPlaybackSettingChanged = (settings: PlaybackSettings) => {\n this.updateSettings(settings);\n };\n}\n"]}
1
+ {"version":3,"file":"ScheduleAnimationProvider.js","sourceRoot":"","sources":["../../../src/appui-react/timeline/ScheduleAnimationProvider.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAIH,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAE1E;;GAEG;AACH,mDAAmD;AACnD,MAAM,OAAO,qCAAsC,SAAQ,wBAAwB;IACzE,UAAU,CAAY;IAE9B,YAAY,SAAoB,EAAE,QAAyB;QACzD,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAE5B,IAAI,SAAS,IAAI,SAAS,CAAC,cAAc,EAAE,CAAC;YAC1C,IAAI,CAAC,yBAAyB,GAAG,IAAI,CAAC;QACxC,CAAC;IACH,CAAC;IAEe,KAAK,CAAC,gBAAgB;QACpC,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC;QAC9C,IAAI,IAAI,CAAC,yBAAyB,IAAI,MAAM,EAAE,CAAC;YAC7C,gCAAgC;YAChC,IAAI,CAAC,cAAc,CAAC;gBAClB,QAAQ,EAAE,EAAE,GAAG,IAAI,EAAE,4BAA4B;gBACjD,IAAI,EAAE,IAAI;aACX,CAAC,CAAC;YAEH,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC;YAClC,IAAI,CAAC,KAAK,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC;YAC5C,IAAI,CAAC,GAAG,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;YAE3C,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;gBACnB,IAAI,IAAI,CAAC,SAAS,CAAC,SAAS;oBAC1B,IAAI,CAAC,iBAAiB;wBACpB,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,GAAG,SAAS,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC;;oBAC/D,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAC;YAClC,CAAC;YAED,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAEe,0BAA0B,GAAG,CAAC,iBAAyB,EAAE,EAAE;QACzE,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAC3C,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,cAAc,CAAC;YAC1D,IAAI,MAAM;gBACR,IAAI,CAAC,SAAS,CAAC,SAAS;oBACtB,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAAC;QACzD,CAAC;IACH,CAAC,CAAC;IAEc,wBAAwB,GAAG,CAAC,QAA0B,EAAE,EAAE;QACxE,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;IAChC,CAAC,CAAC;CACH","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 Timeline\n */\n\nimport type { ScreenViewport, ViewState } from \"@itwin/core-frontend\";\nimport type { PlaybackSettings } from \"@itwin/imodel-components-react\";\nimport { BaseTimelineDataProvider } from \"@itwin/imodel-components-react\";\n\n/** ScheduleAnimation Timeline Data Provider - allows a TimelineComponent to animate the data found in a ScheduleScript in a ViewState.\n * @public\n */\n// No access to scheduleScript to even mock in test\nexport class ScheduleAnimationTimelineDataProvider extends BaseTimelineDataProvider {\n private _viewState: ViewState;\n\n constructor(viewState: ViewState, viewport?: ScreenViewport) {\n super(viewport);\n this._viewState = viewState;\n\n if (viewState && viewState.scheduleScript) {\n this.supportsTimelineAnimation = true;\n }\n }\n\n public override async loadTimelineData(): Promise<boolean> {\n const script = this._viewState.scheduleScript;\n if (this.supportsTimelineAnimation && script) {\n // for now just initial settings\n this.updateSettings({\n duration: 20 * 1000, // this is playback duration\n loop: true,\n });\n\n const timeRange = script.duration;\n this.start = new Date(timeRange.low * 1000);\n this.end = new Date(timeRange.high * 1000);\n\n if (this._viewport) {\n if (this._viewport.timePoint)\n this.animationFraction =\n (this._viewport.timePoint - timeRange.low) / timeRange.length();\n else this.animationFraction = 0;\n }\n\n return true;\n }\n\n return false;\n }\n\n public override onAnimationFractionChanged = (animationFraction: number) => {\n this.animationFraction = animationFraction;\n if (this._viewport) {\n const script = this._viewport.displayStyle.scheduleScript;\n if (script)\n this._viewport.timePoint =\n script.duration.fractionToPoint(animationFraction);\n }\n };\n\n public override onPlaybackSettingChanged = (settings: PlaybackSettings) => {\n this.updateSettings(settings);\n };\n}\n"]}
@@ -12,6 +12,7 @@ import { BaseSolarDataProvider } from "@itwin/imodel-components-react";
12
12
  * @alpha
13
13
  */
14
14
  export class SolarTimelineDataProvider extends BaseSolarDataProvider {
15
+ _viewState;
15
16
  get _displayStyle3d() {
16
17
  return undefined !== this._viewport && this._viewport.view.is3d()
17
18
  ? this._viewport.view.displayStyle
@@ -20,11 +21,6 @@ export class SolarTimelineDataProvider extends BaseSolarDataProvider {
20
21
  /** constructor that takes an optional viewport and optional position on globe that is used if the imodel is not "GeoLocated" */
21
22
  constructor(viewState, viewport, longitude, latitude) {
22
23
  super(viewport, longitude, latitude);
23
- this.onTimeChanged = (time) => {
24
- if (this._viewport && this._viewport.view.is3d()) {
25
- this._viewport.view.displayStyle.setSunTime(time.getTime());
26
- }
27
- };
28
24
  this._viewState = viewState;
29
25
  if (viewState.is3d()) {
30
26
  this.supportsTimelineAnimation = true;
@@ -45,6 +41,11 @@ export class SolarTimelineDataProvider extends BaseSolarDataProvider {
45
41
  const style = this._displayStyle3d;
46
42
  return undefined !== style && style.viewFlags.shadows;
47
43
  }
44
+ onTimeChanged = (time) => {
45
+ if (this._viewport && this._viewport.view.is3d()) {
46
+ this._viewport.view.displayStyle.setSunTime(time.getTime());
47
+ }
48
+ };
48
49
  get shadowColor() {
49
50
  const style = this._displayStyle3d;
50
51
  return style
@@ -1 +1 @@
1
- {"version":3,"file":"SolarTimelineDataProvider.js","sourceRoot":"","sources":["../../../src/appui-react/timeline/SolarTimelineDataProvider.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EACL,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAM5B,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAEvE,kHAAkH;AAElH;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,qBAAqB;IAGlE,IAAc,eAAe;QAC3B,OAAO,SAAS,KAAK,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE;YAC/D,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY;YAClC,CAAC,CAAC,SAAS,CAAC;IAChB,CAAC;IAED,iIAAiI;IACjI,YACE,SAAoB,EACpB,QAAyB,EACzB,SAAkB,EAClB,QAAiB;QAEjB,KAAK,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;QAwBvB,kBAAa,GAAG,CAAC,IAAU,EAAE,EAAE;YAC7C,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;gBACjD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;YAC9D,CAAC;QACH,CAAC,CAAC;QA3BA,IAA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KAAK,CAAC;QAC3D,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC;QAC9B,IACE,SAAS,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC;YAC1B,SAAS,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC;YAC1B,SAAS,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC;YAE1B,OAAO;QAET,MAAM,WAAW,GAAG,YAAY,CAAC,QAAQ,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC;QACtE,WAAW,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC;QAE/B,YAAY,CAAC,QAAQ,CAAC,YAAY;YAChC,mBAAmB,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC9C,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 Timeline\n */\n\nimport {\n Cartographic,\n ColorByName,\n ColorDef,\n SolarShadowSettings,\n} from \"@itwin/core-common\";\nimport type {\n DisplayStyle3dState,\n ScreenViewport,\n ViewState,\n} from \"@itwin/core-frontend\";\nimport { BaseSolarDataProvider } from \"@itwin/imodel-components-react\";\n\n// the interface and class are in alpha state - it may change after usability testing - test coverage not complete\n\n/** Default Solar Data Provider interface for getting and setting solar position from iModels view definitions.\n * @alpha\n */\nexport class SolarTimelineDataProvider extends BaseSolarDataProvider {\n protected _viewState: ViewState;\n\n protected get _displayStyle3d(): DisplayStyle3dState | undefined {\n return undefined !== this._viewport && this._viewport.view.is3d()\n ? this._viewport.view.displayStyle\n : undefined;\n }\n\n /** constructor that takes an optional viewport and optional position on globe that is used if the imodel is not \"GeoLocated\" */\n constructor(\n viewState: ViewState,\n viewport?: ScreenViewport,\n longitude?: number,\n latitude?: number\n ) {\n super(viewport, longitude, latitude);\n this._viewState = viewState;\n\n if (viewState.is3d()) {\n this.supportsTimelineAnimation = true;\n this._cartographicCenter = this.getCartographicCenter(viewState.iModel);\n } else {\n this._cartographicCenter = Cartographic.fromDegrees({\n longitude: this.longitude,\n latitude: this.latitude,\n height: 0.0,\n });\n }\n\n this._projectTimeZoneOffset = this.getZone(this._cartographicCenter);\n this.initializeData(this._projectTimeZoneOffset);\n this.onTimeChanged(this.timeOfDay);\n }\n\n public override get shouldShowTimeline() {\n const style = this._displayStyle3d;\n return undefined !== style && style.viewFlags.shadows;\n }\n\n public override onTimeChanged = (time: Date) => {\n if (this._viewport && this._viewport.view.is3d()) {\n this._viewport.view.displayStyle.setSunTime(time.getTime());\n }\n };\n\n public override get shadowColor(): ColorDef {\n const style = this._displayStyle3d;\n return style\n ? style.settings.solarShadows.color.toColorDef()\n : ColorDef.create(ColorByName.gray);\n }\n\n public override set shadowColor(color: ColorDef) {\n const displayStyle = this._displayStyle3d;\n if (!displayStyle) return;\n\n const prevColor = displayStyle.settings.solarShadows.color;\n const newColor = color.colors;\n if (\n prevColor.r === newColor.r &&\n prevColor.g === newColor.g &&\n prevColor.b === newColor.b\n )\n return;\n\n const newSettings = displayStyle.settings.solarShadows.toJSON() ?? {};\n newSettings.color = color.tbgr;\n\n displayStyle.settings.solarShadows =\n SolarShadowSettings.fromJSON(newSettings);\n }\n}\n"]}
1
+ {"version":3,"file":"SolarTimelineDataProvider.js","sourceRoot":"","sources":["../../../src/appui-react/timeline/SolarTimelineDataProvider.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EACL,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAM5B,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAEvE,kHAAkH;AAElH;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,qBAAqB;IACxD,UAAU,CAAY;IAEhC,IAAc,eAAe;QAC3B,OAAO,SAAS,KAAK,IAA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C,IAAI,EAAE,EAAE,CAAC;YACjD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC,CAAC;IAEF,IAAoB,WAAW;QAC7B,MAAM,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC;QACnC,OAAO,KAAK;YACV,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,UAAU,EAAE;YAChD,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IAED,IAAoB,WAAW,CAAC,KAAe;QAC7C,MAAM,YAAY,GAAG,IAAI,CAAC,eAAe,CAAC;QAC1C,IAAI,CAAC,YAAY;YAAE,OAAO;QAE1B,MAAM,SAAS,GAAG,YAAY,CAAC,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC;QAC3D,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC;QAC9B,IACE,SAAS,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC;YAC1B,SAAS,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC;YAC1B,SAAS,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC;YAE1B,OAAO;QAET,MAAM,WAAW,GAAG,YAAY,CAAC,QAAQ,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC;QACtE,WAAW,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC;QAE/B,YAAY,CAAC,QAAQ,CAAC,YAAY;YAChC,mBAAmB,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC9C,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 Timeline\n */\n\nimport {\n Cartographic,\n ColorByName,\n ColorDef,\n SolarShadowSettings,\n} from \"@itwin/core-common\";\nimport type {\n DisplayStyle3dState,\n ScreenViewport,\n ViewState,\n} from \"@itwin/core-frontend\";\nimport { BaseSolarDataProvider } from \"@itwin/imodel-components-react\";\n\n// the interface and class are in alpha state - it may change after usability testing - test coverage not complete\n\n/** Default Solar Data Provider interface for getting and setting solar position from iModels view definitions.\n * @alpha\n */\nexport class SolarTimelineDataProvider extends BaseSolarDataProvider {\n protected _viewState: ViewState;\n\n protected get _displayStyle3d(): DisplayStyle3dState | undefined {\n return undefined !== this._viewport && this._viewport.view.is3d()\n ? this._viewport.view.displayStyle\n : undefined;\n }\n\n /** constructor that takes an optional viewport and optional position on globe that is used if the imodel is not \"GeoLocated\" */\n constructor(\n viewState: ViewState,\n viewport?: ScreenViewport,\n longitude?: number,\n latitude?: number\n ) {\n super(viewport, longitude, latitude);\n this._viewState = viewState;\n\n if (viewState.is3d()) {\n this.supportsTimelineAnimation = true;\n this._cartographicCenter = this.getCartographicCenter(viewState.iModel);\n } else {\n this._cartographicCenter = Cartographic.fromDegrees({\n longitude: this.longitude,\n latitude: this.latitude,\n height: 0.0,\n });\n }\n\n this._projectTimeZoneOffset = this.getZone(this._cartographicCenter);\n this.initializeData(this._projectTimeZoneOffset);\n this.onTimeChanged(this.timeOfDay);\n }\n\n public override get shouldShowTimeline() {\n const style = this._displayStyle3d;\n return undefined !== style && style.viewFlags.shadows;\n }\n\n public override onTimeChanged = (time: Date) => {\n if (this._viewport && this._viewport.view.is3d()) {\n this._viewport.view.displayStyle.setSunTime(time.getTime());\n }\n };\n\n public override get shadowColor(): ColorDef {\n const style = this._displayStyle3d;\n return style\n ? style.settings.solarShadows.color.toColorDef()\n : ColorDef.create(ColorByName.gray);\n }\n\n public override set shadowColor(color: ColorDef) {\n const displayStyle = this._displayStyle3d;\n if (!displayStyle) return;\n\n const prevColor = displayStyle.settings.solarShadows.color;\n const newColor = color.colors;\n if (\n prevColor.r === newColor.r &&\n prevColor.g === newColor.g &&\n prevColor.b === newColor.b\n )\n return;\n\n const newSettings = displayStyle.settings.solarShadows.toJSON() ?? {};\n newSettings.color = color.tbgr;\n\n displayStyle.settings.solarShadows =\n SolarShadowSettings.fromJSON(newSettings);\n }\n}\n"]}
@@ -14,11 +14,19 @@ import { PropsHelper } from "../utils/PropsHelper.js";
14
14
  * @deprecated in 4.15.0. Use specific item types instead, i.e. {@link ToolbarGroupItem}.
15
15
  */
16
16
  export class GroupItemDef extends ActionButtonItemDef {
17
+ static _sId = 0;
18
+ static groupIdPrefix = "Group-";
19
+ groupId;
20
+ itemsInColumn;
21
+ items;
22
+ defaultActiveItemId;
23
+ /** @internal */
24
+ overflow = false;
25
+ _itemList;
26
+ _itemMap;
27
+ _panelLabel = "";
17
28
  constructor(groupItemProps, onItemExecuted) {
18
29
  super(groupItemProps, onItemExecuted);
19
- /** @internal */
20
- this.overflow = false;
21
- this._panelLabel = "";
22
30
  this.groupId =
23
31
  groupItemProps.groupId !== undefined ? groupItemProps.groupId : "";
24
32
  if (groupItemProps.groupId)
@@ -70,6 +78,4 @@ export class GroupItemDef extends ActionButtonItemDef {
70
78
  }
71
79
  execute() { }
72
80
  }
73
- GroupItemDef._sId = 0;
74
- GroupItemDef.groupIdPrefix = "Group-";
75
81
  //# sourceMappingURL=GroupItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GroupItem.js","sourceRoot":"","sources":["../../../src/appui-react/toolbar/GroupItem.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAOH,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAIvE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,qDAAqD;AAErD;;;GAGG;AACH,MAAM,OAAO,YAAa,SAAQ,mBAAmB;IAgBnD,YACE,cAA8B,EAC9B,cA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QAAQ,EAAE,CAAC;QAChC,IAAI,CAAC,QAAQ,GAAG,IAAI,OAAO,EAAE,CAAC;QAE9B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAgB,EAAE,EAAE;YAClC,MAAM,EAAE,GAAW,IAAI,CAAC,EAAE,CAAC;YAC3B,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAC7B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;QAC9B,CAAC,CAAC,CAAC;IACL,CAAC;IAEM,WAAW,CAAC,EAAU;QAC3B,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC/B,CAAC;IAEM,cAAc,CAAC,KAAa;QACjC,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAED,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC;IACrC,CAAC;IAEe,OAAO,KAAU,CAAC;;AAlFnB,iBAAI,GAAG,CAAC,AAAJ,CAAK;AACV,0BAAa,GAAG,QAAQ,AAAX,CAAY","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 Item\n */\n\nimport type {\n ConditionalStringValue,\n OnItemExecutedFunc,\n StringGetter,\n} from \"@itwin/appui-abstract\";\nimport { ActionButtonItemDef } from \"../shared/ActionButtonItemDef.js\";\nimport type { AnyItemDef } from \"../shared/AnyItemDef.js\";\nimport type { GroupItemProps } from \"../shared/GroupItemProps.js\";\nimport type { ItemDefBase } from \"../shared/ItemDefBase.js\";\nimport { ItemList, ItemMap } from \"../shared/ItemMap.js\";\nimport { PropsHelper } from \"../utils/PropsHelper.js\";\nimport type { ToolbarGroupItem } from \"./ToolbarItem.js\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** An Item that opens a group of items.\n * @public\n * @deprecated in 4.15.0. Use specific item types instead, i.e. {@link ToolbarGroupItem}.\n */\nexport class GroupItemDef extends ActionButtonItemDef {\n private static _sId = 0;\n public static groupIdPrefix = \"Group-\";\n\n public groupId: string;\n public itemsInColumn: number;\n public items: AnyItemDef[];\n public defaultActiveItemId?: string;\n\n /** @internal */\n public overflow: boolean = false;\n\n private _itemList!: ItemList;\n private _itemMap!: ItemMap;\n private _panelLabel: string | StringGetter | ConditionalStringValue = \"\";\n\n constructor(\n groupItemProps: GroupItemProps,\n onItemExecuted?: OnItemExecutedFunc\n ) {\n super(groupItemProps, onItemExecuted);\n\n this.groupId =\n groupItemProps.groupId !== undefined ? groupItemProps.groupId : \"\";\n if (groupItemProps.groupId) this.groupId = groupItemProps.groupId;\n else {\n GroupItemDef._sId++;\n this.groupId = GroupItemDef.groupIdPrefix + GroupItemDef._sId;\n }\n\n this.itemsInColumn =\n groupItemProps.itemsInColumn !== undefined\n ? groupItemProps.itemsInColumn\n : 7;\n this._panelLabel = PropsHelper.getStringSpec(\n groupItemProps.panelLabel,\n groupItemProps.panelLabelKey\n );\n this.items = groupItemProps.items;\n this.defaultActiveItemId = groupItemProps.defaultActiveItemId;\n }\n\n public get id(): string {\n return this.groupId;\n }\n\n /** Get the panelLabel string */\n public get panelLabel(): string {\n return PropsHelper.getStringFromSpec(this._panelLabel);\n }\n\n /** Set the panelLabel.\n * @param v A string or a function to get the string.\n */\n public setPanelLabel(v: string | StringGetter | ConditionalStringValue) {\n this._panelLabel = v;\n }\n\n public resolveItems(force?: boolean): void {\n if (this._itemList && !force) return;\n\n this._itemList = new ItemList();\n this._itemMap = new ItemMap();\n\n this.items.map((item: AnyItemDef) => {\n const id: string = item.id;\n this._itemList.addItem(item);\n this._itemMap.set(id, item);\n });\n }\n\n public getItemById(id: string): ItemDefBase | undefined {\n return this._itemMap.get(id);\n }\n\n public getItemByIndex(index: number): ItemDefBase | undefined {\n return this._itemList.items[index];\n }\n\n public get itemCount(): number {\n return this._itemList.items.length;\n }\n\n public override execute(): void {}\n}\n"]}
1
+ {"version":3,"file":"GroupItem.js","sourceRoot":"","sources":["../../../src/appui-react/toolbar/GroupItem.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAOH,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAIvE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,qDAAqD;AAErD;;;GAGG;AACH,MAAM,OAAO,YAAa,SAAQ,mBAAmB;IAC3C,MAAM,CAAC,IAAI,GAAG,CAAC,CAAC;IACjB,MAAM,CAAC,aAAa,GAAG,QAAQ,CAAC;IAEhC,OAAO,CAAS;IAChB,aAAa,CAAS;IACtB,KAAK,CAAe;IACpB,mBAAmB,CAAU;IAEpC,gBAAgB;IACT,QAAQ,GAAY,KAAK,CAAC;IAEzB,SAAS,CAAY;IACrB,QAAQ,CAAW;IACnB,WAAW,GAAmD,EAAE,CAAC;IAEzE,YACE,cAA8B,EAC9B,cAAmC;QAEnC,KAAK,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;QAEtC,IAAI,CAAC,OAAO;YACV,cAAc,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QACrE,IAAI,cAAc,CAAC,OAAO;YAAE,IAAI,CAAC,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC;aAC7D,CAAC;YACJ,YAAY,CAAC,IAAI,EAAE,CAAC;YACpB,IAAI,CAAC,OAAO,GAAG,YAAY,CAAC,aAAa,GAAG,YAAY,CAAC,IAAI,CAAC;QAChE,CAAC;QAED,IAAI,CAAC,aAAa;YAChB,cAAc,CAAC,aA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C,KAAK,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAED,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC;IACrC,CAAC;IAEe,OAAO,KAAU,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 Item\n */\n\nimport type {\n ConditionalStringValue,\n OnItemExecutedFunc,\n StringGetter,\n} from \"@itwin/appui-abstract\";\nimport { ActionButtonItemDef } from \"../shared/ActionButtonItemDef.js\";\nimport type { AnyItemDef } from \"../shared/AnyItemDef.js\";\nimport type { GroupItemProps } from \"../shared/GroupItemProps.js\";\nimport type { ItemDefBase } from \"../shared/ItemDefBase.js\";\nimport { ItemList, ItemMap } from \"../shared/ItemMap.js\";\nimport { PropsHelper } from \"../utils/PropsHelper.js\";\nimport type { ToolbarGroupItem } from \"./ToolbarItem.js\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** An Item that opens a group of items.\n * @public\n * @deprecated in 4.15.0. Use specific item types instead, i.e. {@link ToolbarGroupItem}.\n */\nexport class GroupItemDef extends ActionButtonItemDef {\n private static _sId = 0;\n public static groupIdPrefix = \"Group-\";\n\n public groupId: string;\n public itemsInColumn: number;\n public items: AnyItemDef[];\n public defaultActiveItemId?: string;\n\n /** @internal */\n public overflow: boolean = false;\n\n private _itemList!: ItemList;\n private _itemMap!: ItemMap;\n private _panelLabel: string | StringGetter | ConditionalStringValue = \"\";\n\n constructor(\n groupItemProps: GroupItemProps,\n onItemExecuted?: OnItemExecutedFunc\n ) {\n super(groupItemProps, onItemExecuted);\n\n this.groupId =\n groupItemProps.groupId !== undefined ? groupItemProps.groupId : \"\";\n if (groupItemProps.groupId) this.groupId = groupItemProps.groupId;\n else {\n GroupItemDef._sId++;\n this.groupId = GroupItemDef.groupIdPrefix + GroupItemDef._sId;\n }\n\n this.itemsInColumn =\n groupItemProps.itemsInColumn !== undefined\n ? groupItemProps.itemsInColumn\n : 7;\n this._panelLabel = PropsHelper.getStringSpec(\n groupItemProps.panelLabel,\n groupItemProps.panelLabelKey\n );\n this.items = groupItemProps.items;\n this.defaultActiveItemId = groupItemProps.defaultActiveItemId;\n }\n\n public get id(): string {\n return this.groupId;\n }\n\n /** Get the panelLabel string */\n public get panelLabel(): string {\n return PropsHelper.getStringFromSpec(this._panelLabel);\n }\n\n /** Set the panelLabel.\n * @param v A string or a function to get the string.\n */\n public setPanelLabel(v: string | StringGetter | ConditionalStringValue) {\n this._panelLabel = v;\n }\n\n public resolveItems(force?: boolean): void {\n if (this._itemList && !force) return;\n\n this._itemList = new ItemList();\n this._itemMap = new ItemMap();\n\n this.items.map((item: AnyItemDef) => {\n const id: string = item.id;\n this._itemList.addItem(item);\n this._itemMap.set(id, item);\n });\n }\n\n public getItemById(id: string): ItemDefBase | undefined {\n return this._itemMap.get(id);\n }\n\n public getItemByIndex(index: number): ItemDefBase | undefined {\n return this._itemList.items[index];\n }\n\n public get itemCount(): number {\n return this._itemList.items.length;\n }\n\n public override execute(): void {}\n}\n"]}
@@ -18,17 +18,17 @@ function isInstance(args) {
18
18
  * @deprecated in 4.4.0. This is no longer used internally, left because of an erroneous public dependency that is also deprecated.
19
19
  */
20
20
  export class ToolbarItemsManager {
21
+ // This class should be removed once `useDefaultToolbarItems` and `useUiItemsProviderToolbarItems` (public version) get removed.
22
+ // If you are attempting to fix/clean this class, it is probably an error as it is no longer used and should not be reintroduced, use Hooks instead.
23
+ _items = [];
21
24
  constructor(items) {
22
- // This class should be removed once `useDefaultToolbarItems` and `useUiItemsProviderToolbarItems` (public version) get removed.
23
- // If you are attempting to fix/clean this class, it is probably an error as it is no longer used and should not be reintroduced, use Hooks instead.
24
- this._items = [];
25
- /** Event raised when Toolbar items are changed.
26
- * @internal
27
- */
28
- this.onItemsChanged = new BeEvent();
29
25
  if (items)
30
26
  this.loadItemsInternal(items, true, false);
31
27
  }
28
+ /** Event raised when Toolbar items are changed.
29
+ * @internal
30
+ */
31
+ onItemsChanged = new BeEvent();
32
32
  loadItemsInternal(items, processConditions, sendItemChanged) {
33
33
  if (processConditions && items) {
34
34
  // eslint-disable-next-line @typescript-eslint/no-deprecated
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarItemsManager.js","sourceRoot":"","sources":["../../../src/appui-react/toolbar/ToolbarItemsManager.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EACL,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAMxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,SAAS,UAAU,CAAI,IAA0B;IAC/C,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC;AASD;;;;GAIG;AACH,MAAM,OAAO,mBAAmB;IAK9B,YAAY,KAAkC;QAJ9C,gIAAgI;QAChI,oJAAoJ;QAC1I,WAAM,GAA+B,EAAE,CAAC;QAMlD;;WAEG;QACa,mBAAc,GAAG,IAAI,OAAO,EAEzC,CAAC;QARF,IAAI,KAAK;YAAE,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IACxD,CAAC;IASO,iBAAiB,CACvB,KAAiC,EACjC,iBAA0B,EAC1B,eAAwB;QAExB,IAAI,iBAAiB,IAAI,KAAK,EAAE,CAAC;YAC/B,4DAA4D;YAC5D,MAAM,QAAQ,GAAG,mBAAmB,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;YACjE,IAAI,CAAC,KAAK,QAAQ,CAAC,MAAM,EAAE,CAAC;gBAC1B,MAAM,EAAE,YA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AI,CAAC,KAAK,GAAG,QAAQ,CAAC;IACxB,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 Toolbar\n */\n\nimport {\n ConditionalBooleanValue,\n ConditionalStringValue,\n} from \"@itwin/appui-abstract\";\nimport { BeEvent } from \"@itwin/core-bentley\";\nimport { ConditionalIconItem } from \"@itwin/core-react\";\nimport type {\n ToolbarActionItem,\n ToolbarGroupItem,\n ToolbarItem,\n} from \"./ToolbarItem.js\";\nimport { isToolbarGroupItem } from \"./ToolbarItem.js\";\n\nfunction isInstance<T>(args: T | ReadonlyArray<T>): args is T {\n return !Array.isArray(args);\n}\n\n/** Arguments of [[ToolbarItemsManager.onChanged]] event.\n * @internal\n */\nexport interface ToolbarItemsChangedArgs {\n readonly items: ReadonlyArray<ToolbarItem>;\n}\n\n/**\n * Controls status bar items.\n * @internal\n * @deprecated in 4.4.0. This is no longer used internally, left because of an erroneous public dependency that is also deprecated.\n */\nexport class ToolbarItemsManager {\n // This class should be removed once `useDefaultToolbarItems` and `useUiItemsProviderToolbarItems` (public version) get removed.\n // If you are attempting to fix/clean this class, it is probably an error as it is no longer used and should not be reintroduced, use Hooks instead.\n protected _items: ReadonlyArray<ToolbarItem> = [];\n\n constructor(items?: ReadonlyArray<ToolbarItem>) {\n if (items) this.loadItemsInternal(items, true, false);\n }\n\n /** Event raised when Toolbar items are changed.\n * @internal\n */\n public readonly onItemsChanged = new BeEvent<\n (args: ToolbarItemsChangedArgs) => void\n >();\n\n private loadItemsInternal(\n items: ReadonlyArray<ToolbarItem>,\n processConditions: boolean,\n sendItemChanged: boolean\n ) {\n if (processConditions && items) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const eventIds = ToolbarItemsManager.getSyncIdsOfInterest(items);\n if (0 !== eventIds.length) {\n const { itemsUpdated, updatedItems } =\n this.internalRefreshAffectedItems(items, new Set(eventIds));\n\n if (itemsUpdated) items = updatedItems;\n }\n }\n\n this._items = items;\n if (sendItemChanged) this.onItemsChanged.raiseEvent({ items });\n }\n\n /** load items but do not fire onItemsChanged\n * @internal\n */\n public loadItems(items: ReadonlyArray<ToolbarItem>) {\n this.loadItemsInternal(items, true, false);\n }\n\n /** Get an array of the Toolbar items */\n public get items(): ReadonlyArray<ToolbarItem> {\n return this._items;\n }\n\n public set items(items: ReadonlyArray<ToolbarItem>) {\n if (items !== this._items) this.loadItemsInternal(items, true, true);\n }\n\n public add(itemOrItems: ToolbarItem | ReadonlyArray<ToolbarItem>) {\n let itemsToAdd;\n if (isInstance(itemOrItems)) itemsToAdd = [itemOrItems];\n else {\n itemsToAdd = itemOrItems.filter(\n (itemToAdd, index) =>\n itemOrItems.findIndex((item) => item.id === itemToAdd.id) === index\n );\n }\n itemsToAdd = itemsToAdd.filter(\n (itemToAdd) =>\n this._items.find((item) => item.id === itemToAdd.id) === undefined\n );\n if (itemsToAdd.length === 0) return;\n const items = [...this._items, ...itemsToAdd];\n this.items = items;\n }\n\n /** Remove Toolbar items based on id */\n public remove(\n itemIdOrItemIds: ToolbarItem[\"id\"] | ReadonlyArray<ToolbarItem[\"id\"]>\n ) {\n const items = this._items.filter((item) => {\n return isInstance(itemIdOrItemIds)\n ? item.id !== itemIdOrItemIds\n : !itemIdOrItemIds.find((itemId) => itemId === item.id);\n });\n this.items = items;\n }\n\n /** @internal */\n public removeAll() {\n this._items = [];\n }\n\n private static gatherSyncIds(\n eventIds: Set<string>,\n items: readonly ToolbarItem[]\n ) {\n for (const item of items) {\n for (const [, entry] of Object.entries(item)) {\n if (entry instanceof ConditionalBooleanValue) {\n entry.syncEventIds.forEach((eventId: string) =>\n eventIds.add(eventId.toLowerCase())\n );\n } else if (entry instanceof ConditionalStringValue) {\n entry.syncEventIds.forEach((eventId: string) =>\n eventIds.add(eventId.toLowerCase())\n );\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n } else if (entry instanceof ConditionalIconItem) {\n entry.syncEventIds.forEach((eventId: string) =>\n eventIds.add(eventId.toLowerCase())\n );\n }\n }\n if (isToolbarGroupItem(item)) {\n this.gatherSyncIds(eventIds, item.items);\n }\n }\n }\n\n public static getSyncIdsOfInterest(items: readonly ToolbarItem[]): string[] {\n const eventIds = new Set<string>();\n this.gatherSyncIds(eventIds, items);\n return [...eventIds.values()];\n }\n\n private static refreshChildItems(\n parentItem: ToolbarGroupItem,\n eventIds: Set<string>\n ): {\n childrenUpdated: boolean;\n childItems: ReadonlyArray<ToolbarActionItem | ToolbarGroupItem>;\n } {\n const updatedItems: Array<ToolbarActionItem | ToolbarGroupItem> = [];\n let itemsUpdated = false;\n\n for (const item of parentItem.items) {\n let updatedItem;\n if (isToolbarGroupItem(item)) {\n updatedItem = { ...item };\n const { childrenUpdated, childItems } = this.refreshChildItems(\n updatedItem,\n eventIds\n );\n if (childrenUpdated) {\n updatedItem.items = childItems;\n itemsUpdated = true;\n }\n } else {\n updatedItem = { ...item };\n }\n\n for (const [, entry] of Object.entries(updatedItem)) {\n if (entry instanceof ConditionalBooleanValue) {\n if (ConditionalBooleanValue.refreshValue(entry, eventIds))\n itemsUpdated = true;\n } else if (entry instanceof ConditionalStringValue) {\n if (ConditionalStringValue.refreshValue(entry, eventIds))\n itemsUpdated = true;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n } else if (entry instanceof ConditionalIconItem) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n if (ConditionalIconItem.refreshValue(entry, eventIds))\n itemsUpdated = true;\n }\n }\n\n updatedItems.push(updatedItem);\n }\n return { childrenUpdated: itemsUpdated, childItems: updatedItems };\n }\n\n private internalRefreshAffectedItems(\n items: readonly ToolbarItem[],\n eventIds: Set<string>\n ): { itemsUpdated: boolean; updatedItems: ToolbarItem[] } {\n if (0 === eventIds.size) return { itemsUpdated: false, updatedItems: [] };\n\n let updateRequired = false;\n\n const newItems: ToolbarItem[] = [];\n for (const item of items) {\n let updatedItem = { ...item };\n if (isToolbarGroupItem(updatedItem)) {\n const { childrenUpdated, childItems } =\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ToolbarItemsManager.refreshChildItems(updatedItem, eventIds);\n if (childrenUpdated) {\n updatedItem = {\n ...updatedItem,\n items: childItems,\n };\n updateRequired = true;\n }\n }\n\n for (const [, entry] of Object.entries(updatedItem)) {\n if (entry instanceof ConditionalBooleanValue) {\n if (ConditionalBooleanValue.refreshValue(entry, eventIds))\n updateRequired = true;\n } else if (entry instanceof ConditionalStringValue) {\n if (ConditionalStringValue.refreshValue(entry, eventIds))\n updateRequired = true;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n } else if (entry instanceof ConditionalIconItem) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n if (ConditionalIconItem.refreshValue(entry, eventIds))\n updateRequired = true;\n }\n }\n\n newItems.push(updatedItem);\n }\n\n return { itemsUpdated: updateRequired, updatedItems: newItems };\n }\n\n public refreshAffectedItems(eventIds: Set<string>) {\n if (0 === eventIds.size) return;\n\n const { itemsUpdated, updatedItems } = this.internalRefreshAffectedItems(\n this.items,\n eventIds\n );\n\n if (itemsUpdated) this.loadItemsInternal(updatedItems, false, true);\n }\n\n private static isActiveToolIdRefreshRequiredForChildren(\n children: ReadonlyArray<ToolbarActionItem | ToolbarGroupItem>,\n toolId: string\n ): boolean {\n for (const item of children) {\n if (isToolbarGroupItem(item)) {\n if (this.isActiveToolIdRefreshRequiredForChildren(item.items, toolId))\n return true;\n } else {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const isActive = !!item.isActive;\n if (\n (isActive && item.id !== toolId) ||\n (!isActive && item.id === toolId)\n )\n return true;\n }\n }\n return false;\n }\n\n private isActiveToolIdRefreshRequired(toolId: string): boolean {\n for (const item of this.items) {\n if (isToolbarGroupItem(item)) {\n if (\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ToolbarItemsManager.isActiveToolIdRefreshRequiredForChildren(\n item.items,\n toolId\n )\n )\n return true;\n } else {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const isActive = !!item.isActive;\n if (\n (isActive && item.id !== toolId) ||\n (!isActive && item.id === toolId)\n )\n return true;\n }\n }\n\n return false;\n }\n\n private static refreshActiveToolIdInChildItems(\n parentItem: ToolbarGroupItem,\n toolId: string\n ): Array<ToolbarActionItem | ToolbarGroupItem> {\n const newChildren: Array<ToolbarActionItem | ToolbarGroupItem> = [];\n for (const item of parentItem.items) {\n let updatedItem = { ...item };\n\n if (isToolbarGroupItem(updatedItem)) {\n updatedItem = {\n ...updatedItem,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n items: ToolbarItemsManager.refreshActiveToolIdInChildItems(\n updatedItem,\n toolId\n ),\n };\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n updatedItem.isActive = updatedItem.id === toolId;\n newChildren.push(updatedItem);\n }\n return newChildren;\n }\n\n public setActiveToolId(toolId: string) {\n // first see if any updates are really necessary\n if (!this.isActiveToolIdRefreshRequired(toolId)) return;\n\n const newItems: ToolbarItem[] = [];\n for (const item of this.items) {\n let updatedItem = { ...item };\n\n if (isToolbarGroupItem(updatedItem)) {\n updatedItem = {\n ...updatedItem,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n items: ToolbarItemsManager.refreshActiveToolIdInChildItems(\n updatedItem,\n toolId\n ),\n };\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n updatedItem.isActive = updatedItem.id === toolId;\n newItems.push(updatedItem);\n }\n\n this.items = newItems;\n }\n}\n"]}
1
+ {"version":3,"file":"ToolbarItemsManager.js","sourceRoot":"","sources":["../../../src/appui-react/toolbar/ToolbarItemsManager.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EACL,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,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C,QAAQ,GAAG,WAAW,CAAC,EAAE,KAAK,MAAM,CAAC;YACjD,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAChC,CAAC;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;IAEM,eAAe,CAAC,MAAc;QACnC,gDAAgD;QAChD,IAAI,CAAC,IAAI,CAAC,6BAA6B,CAAC,MAAM,CAAC;YAAE,OAAO;QAExD,MAAM,QAAQ,GAAkB,EAAE,CAAC;QACnC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAC9B,IAAI,WAAW,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC;YAE9B,IAAI,kBAAkB,CAAC,WAAW,CAAC,EAAE,CAAC;gBACpC,WAAW,GAAG;oBACZ,GAAG,WAAW;oBACd,4DAA4D;oBAC5D,KAAK,EAAE,mBAAmB,CAAC,+BAA+B,CACxD,WAAW,EACX,MAAM,CACP;iBACF,CAAC;YACJ,CAAC;YAED,4DAA4D;YAC5D,WAAW,CAAC,QAAQ,GAAG,WAAW,CAAC,EAAE,KAAK,MAAM,CAAC;YACjD,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC7B,CAAC;QAED,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC;IACxB,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 Toolbar\n */\n\nimport {\n ConditionalBooleanValue,\n ConditionalStringValue,\n} from \"@itwin/appui-abstract\";\nimport { BeEvent } from \"@itwin/core-bentley\";\nimport { ConditionalIconItem } from \"@itwin/core-react\";\nimport type {\n ToolbarActionItem,\n ToolbarGroupItem,\n ToolbarItem,\n} from \"./ToolbarItem.js\";\nimport { isToolbarGroupItem } from \"./ToolbarItem.js\";\n\nfunction isInstance<T>(args: T | ReadonlyArray<T>): args is T {\n return !Array.isArray(args);\n}\n\n/** Arguments of [[ToolbarItemsManager.onChanged]] event.\n * @internal\n */\nexport interface ToolbarItemsChangedArgs {\n readonly items: ReadonlyArray<ToolbarItem>;\n}\n\n/**\n * Controls status bar items.\n * @internal\n * @deprecated in 4.4.0. This is no longer used internally, left because of an erroneous public dependency that is also deprecated.\n */\nexport class ToolbarItemsManager {\n // This class should be removed once `useDefaultToolbarItems` and `useUiItemsProviderToolbarItems` (public version) get removed.\n // If you are attempting to fix/clean this class, it is probably an error as it is no longer used and should not be reintroduced, use Hooks instead.\n protected _items: ReadonlyArray<ToolbarItem> = [];\n\n constructor(items?: ReadonlyArray<ToolbarItem>) {\n if (items) this.loadItemsInternal(items, true, false);\n }\n\n /** Event raised when Toolbar items are changed.\n * @internal\n */\n public readonly onItemsChanged = new BeEvent<\n (args: ToolbarItemsChangedArgs) => void\n >();\n\n private loadItemsInternal(\n items: ReadonlyArray<ToolbarItem>,\n processConditions: boolean,\n sendItemChanged: boolean\n ) {\n if (processConditions && items) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const eventIds = ToolbarItemsManager.getSyncIdsOfInterest(items);\n if (0 !== eventIds.length) {\n const { itemsUpdated, updatedItems } =\n this.internalRefreshAffectedItems(items, new Set(eventIds));\n\n if (itemsUpdated) items = updatedItems;\n }\n }\n\n this._items = items;\n if (sendItemChanged) this.onItemsChanged.raiseEvent({ items });\n }\n\n /** load items but do not fire onItemsChanged\n * @internal\n */\n public loadItems(items: ReadonlyArray<ToolbarItem>) {\n this.loadItemsInternal(items, true, false);\n }\n\n /** Get an array of the Toolbar items */\n public get items(): ReadonlyArray<ToolbarItem> {\n return this._items;\n }\n\n public set items(items: ReadonlyArray<ToolbarItem>) {\n if (items !== this._items) this.loadItemsInternal(items, true, true);\n }\n\n public add(itemOrItems: ToolbarItem | ReadonlyArray<ToolbarItem>) {\n let itemsToAdd;\n if (isInstance(itemOrItems)) itemsToAdd = [itemOrItems];\n else {\n itemsToAdd = itemOrItems.filter(\n (itemToAdd, index) =>\n itemOrItems.findIndex((item) => item.id === itemToAdd.id) === index\n );\n }\n itemsToAdd = itemsToAdd.filter(\n (itemToAdd) =>\n this._items.find((item) => item.id === itemToAdd.id) === undefined\n );\n if (itemsToAdd.length === 0) return;\n const items = [...this._items, ...itemsToAdd];\n this.items = items;\n }\n\n /** Remove Toolbar items based on id */\n public remove(\n itemIdOrItemIds: ToolbarItem[\"id\"] | ReadonlyArray<ToolbarItem[\"id\"]>\n ) {\n const items = this._items.filter((item) => {\n return isInstance(itemIdOrItemIds)\n ? item.id !== itemIdOrItemIds\n : !itemIdOrItemIds.find((itemId) => itemId === item.id);\n });\n this.items = items;\n }\n\n /** @internal */\n public removeAll() {\n this._items = [];\n }\n\n private static gatherSyncIds(\n eventIds: Set<string>,\n items: readonly ToolbarItem[]\n ) {\n for (const item of items) {\n for (const [, entry] of Object.entries(item)) {\n if (entry instanceof ConditionalBooleanValue) {\n entry.syncEventIds.forEach((eventId: string) =>\n eventIds.add(eventId.toLowerCase())\n );\n } else if (entry instanceof ConditionalStringValue) {\n entry.syncEventIds.forEach((eventId: string) =>\n eventIds.add(eventId.toLowerCase())\n );\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n } else if (entry instanceof ConditionalIconItem) {\n entry.syncEventIds.forEach((eventId: string) =>\n eventIds.add(eventId.toLowerCase())\n );\n }\n }\n if (isToolbarGroupItem(item)) {\n this.gatherSyncIds(eventIds, item.items);\n }\n }\n }\n\n public static getSyncIdsOfInterest(items: readonly ToolbarItem[]): string[] {\n const eventIds = new Set<string>();\n this.gatherSyncIds(eventIds, items);\n return [...eventIds.values()];\n }\n\n private static refreshChildItems(\n parentItem: ToolbarGroupItem,\n eventIds: Set<string>\n ): {\n childrenUpdated: boolean;\n childItems: ReadonlyArray<ToolbarActionItem | ToolbarGroupItem>;\n } {\n const updatedItems: Array<ToolbarActionItem | ToolbarGroupItem> = [];\n let itemsUpdated = false;\n\n for (const item of parentItem.items) {\n let updatedItem;\n if (isToolbarGroupItem(item)) {\n updatedItem = { ...item };\n const { childrenUpdated, childItems } = this.refreshChildItems(\n updatedItem,\n eventIds\n );\n if (childrenUpdated) {\n updatedItem.items = childItems;\n itemsUpdated = true;\n }\n } else {\n updatedItem = { ...item };\n }\n\n for (const [, entry] of Object.entries(updatedItem)) {\n if (entry instanceof ConditionalBooleanValue) {\n if (ConditionalBooleanValue.refreshValue(entry, eventIds))\n itemsUpdated = true;\n } else if (entry instanceof ConditionalStringValue) {\n if (ConditionalStringValue.refreshValue(entry, eventIds))\n itemsUpdated = true;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n } else if (entry instanceof ConditionalIconItem) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n if (ConditionalIconItem.refreshValue(entry, eventIds))\n itemsUpdated = true;\n }\n }\n\n updatedItems.push(updatedItem);\n }\n return { childrenUpdated: itemsUpdated, childItems: updatedItems };\n }\n\n private internalRefreshAffectedItems(\n items: readonly ToolbarItem[],\n eventIds: Set<string>\n ): { itemsUpdated: boolean; updatedItems: ToolbarItem[] } {\n if (0 === eventIds.size) return { itemsUpdated: false, updatedItems: [] };\n\n let updateRequired = false;\n\n const newItems: ToolbarItem[] = [];\n for (const item of items) {\n let updatedItem = { ...item };\n if (isToolbarGroupItem(updatedItem)) {\n const { childrenUpdated, childItems } =\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ToolbarItemsManager.refreshChildItems(updatedItem, eventIds);\n if (childrenUpdated) {\n updatedItem = {\n ...updatedItem,\n items: childItems,\n };\n updateRequired = true;\n }\n }\n\n for (const [, entry] of Object.entries(updatedItem)) {\n if (entry instanceof ConditionalBooleanValue) {\n if (ConditionalBooleanValue.refreshValue(entry, eventIds))\n updateRequired = true;\n } else if (entry instanceof ConditionalStringValue) {\n if (ConditionalStringValue.refreshValue(entry, eventIds))\n updateRequired = true;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n } else if (entry instanceof ConditionalIconItem) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n if (ConditionalIconItem.refreshValue(entry, eventIds))\n updateRequired = true;\n }\n }\n\n newItems.push(updatedItem);\n }\n\n return { itemsUpdated: updateRequired, updatedItems: newItems };\n }\n\n public refreshAffectedItems(eventIds: Set<string>) {\n if (0 === eventIds.size) return;\n\n const { itemsUpdated, updatedItems } = this.internalRefreshAffectedItems(\n this.items,\n eventIds\n );\n\n if (itemsUpdated) this.loadItemsInternal(updatedItems, false, true);\n }\n\n private static isActiveToolIdRefreshRequiredForChildren(\n children: ReadonlyArray<ToolbarActionItem | ToolbarGroupItem>,\n toolId: string\n ): boolean {\n for (const item of children) {\n if (isToolbarGroupItem(item)) {\n if (this.isActiveToolIdRefreshRequiredForChildren(item.items, toolId))\n return true;\n } else {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const isActive = !!item.isActive;\n if (\n (isActive && item.id !== toolId) ||\n (!isActive && item.id === toolId)\n )\n return true;\n }\n }\n return false;\n }\n\n private isActiveToolIdRefreshRequired(toolId: string): boolean {\n for (const item of this.items) {\n if (isToolbarGroupItem(item)) {\n if (\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ToolbarItemsManager.isActiveToolIdRefreshRequiredForChildren(\n item.items,\n toolId\n )\n )\n return true;\n } else {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const isActive = !!item.isActive;\n if (\n (isActive && item.id !== toolId) ||\n (!isActive && item.id === toolId)\n )\n return true;\n }\n }\n\n return false;\n }\n\n private static refreshActiveToolIdInChildItems(\n parentItem: ToolbarGroupItem,\n toolId: string\n ): Array<ToolbarActionItem | ToolbarGroupItem> {\n const newChildren: Array<ToolbarActionItem | ToolbarGroupItem> = [];\n for (const item of parentItem.items) {\n let updatedItem = { ...item };\n\n if (isToolbarGroupItem(updatedItem)) {\n updatedItem = {\n ...updatedItem,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n items: ToolbarItemsManager.refreshActiveToolIdInChildItems(\n updatedItem,\n toolId\n ),\n };\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n updatedItem.isActive = updatedItem.id === toolId;\n newChildren.push(updatedItem);\n }\n return newChildren;\n }\n\n public setActiveToolId(toolId: string) {\n // first see if any updates are really necessary\n if (!this.isActiveToolIdRefreshRequired(toolId)) return;\n\n const newItems: ToolbarItem[] = [];\n for (const item of this.items) {\n let updatedItem = { ...item };\n\n if (isToolbarGroupItem(updatedItem)) {\n updatedItem = {\n ...updatedItem,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n items: ToolbarItemsManager.refreshActiveToolIdInChildItems(\n updatedItem,\n toolId\n ),\n };\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n updatedItem.isActive = updatedItem.id === toolId;\n newItems.push(updatedItem);\n }\n\n this.items = newItems;\n }\n}\n"]}
@@ -40,6 +40,10 @@ function isElement(target) {
40
40
  const editableTags = ["input", "textarea", "select"];
41
41
  function isEditable(element) {
42
42
  const tagName = element.tagName.toLowerCase();
43
- return editableTags.includes(tagName);
43
+ if (editableTags.includes(tagName))
44
+ return true;
45
+ if (element instanceof HTMLElement && element.isContentEditable)
46
+ return true;
47
+ return false;
44
48
  }
45
49
  //# sourceMappingURL=FrameworkToolAdmin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FrameworkToolAdmin.js","sourceRoot":"","sources":["../../../src/appui-react/tools/FrameworkToolAdmin.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,kBAAmB,SAAQ,SAAS;IAC/B,KAAK,CAAC,kBAAkB,CACtC,CAAgB,EAChB,QAAiB;QAEjB,IAAI,CAAC,QAAQ;YAAE,OAAO,KAAK,CAAC;QAC5B,IAAI,WAAW,CAAC,iBAAiB;YAAE,OAAO,KAAK,CAAC;QAChD,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE;YAAE,OAAO,KAAK,CAAC;QACjD,IAAI,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC;YAAE,OAAO,KAAK,CAAC;QAE9D,WAAW,CAAC,iBAAiB,CAAC,UAAU,CACtC,CAAC,CAAC,GAAG,EACL,CAAC,CAAC,MAAM,EACR,CAAC,CAAC,OAAO,EACT,CAAC,CAAC,QAAQ,CACX,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAED,SAAS,SAAS,CAAC,MAA0B;IAC3C,OAAO,MAAM,YAAY,OAAO,CAAC;AACnC,CAAC;AAED,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;AACrD,SAAS,UAAU,CAAC,OAAgB;IAClC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;IAC9C,OAAO,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AACxC,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 { Key } from \"ts-key-enum\";\nimport { ToolAdmin } from \"@itwin/core-frontend\";\nimport { UiFramework } from \"../UiFramework.js\";\n\n/** Subclass of `ToolAdmin` in `@itwin/core-frontend` to be used to initialize `IModelApp`.\n *\n * Enable processing of shortcut keys registered to\n * [[UiFramework.keyboardShortcuts]] when focus is set to Home.\n *\n * ```ts\n * await IModelApp.startup({\n * toolAdmin: new FrameworkToolAdmin()\n * });\n * ```\n * @public\n */\nexport class FrameworkToolAdmin extends ToolAdmin {\n public override async processShortcutKey(\n e: KeyboardEvent,\n wentDown: boolean\n ): Promise<boolean> {\n if (!wentDown) return false;\n if (UiFramework.isContextMenuOpen) return false;\n if (e.key === Key.Escape.valueOf()) return false;\n if (isElement(e.target) && isEditable(e.target)) return false;\n\n UiFramework.keyboardShortcuts.processKey(\n e.key,\n e.altKey,\n e.ctrlKey,\n e.shiftKey\n );\n return true;\n }\n}\n\nfunction isElement(target: EventTarget | null): target is Element {\n return target instanceof Element;\n}\n\nconst editableTags = [\"input\", \"textarea\", \"select\"];\nfunction isEditable(element: Element) {\n const tagName = element.tagName.toLowerCase();\n return editableTags.includes(tagName);\n}\n"]}
1
+ {"version":3,"file":"FrameworkToolAdmin.js","sourceRoot":"","sources":["../../../src/appui-react/tools/FrameworkToolAdmin.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,kBAAmB,SAAQ,SAAS;IAC/B,KAAK,CAAC,kBAAkB,CACtC,CAAgB,EAChB,QAAiB;QAEjB,IAAI,CAAC,QAAQ;YAAE,OAAO,KAAK,CAAC;QAC5B,IAAI,WAAW,CAAC,iBAAiB;YAAE,OAAO,KAAK,CAAC;QAChD,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE;YAAE,OAAO,KAAK,CAAC;QACjD,IAAI,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC;YAAE,OAAO,KAAK,CAAC;QAE9D,WAAW,CAAC,iBAAiB,CAAC,UAAU,CACtC,CAAC,CAAC,GAAG,EACL,CAAC,CAAC,MAAM,EACR,CAAC,CAAC,OAAO,EACT,CAAC,CAAC,QAAQ,CACX,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAED,SAAS,SAAS,CAAC,MAA0B;IAC3C,OAAO,MAAM,YAAY,OAAO,CAAC;AACnC,CAAC;AAED,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;AACrD,SAAS,UAAU,CAAC,OAAgB;IAClC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;IAC9C,IAAI,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC;QAAE,OAAO,IAAI,CAAC;IAChD,IAAI,OAAO,YAAY,WAAW,IAAI,OAAO,CAAC,iBAAiB;QAAE,OAAO,IAAI,CAAC;IAC7E,OAAO,KAAK,CAAC;AACf,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 { Key } from \"ts-key-enum\";\nimport { ToolAdmin } from \"@itwin/core-frontend\";\nimport { UiFramework } from \"../UiFramework.js\";\n\n/** Subclass of `ToolAdmin` in `@itwin/core-frontend` to be used to initialize `IModelApp`.\n *\n * Enable processing of shortcut keys registered to\n * [[UiFramework.keyboardShortcuts]] when focus is set to Home.\n *\n * ```ts\n * await IModelApp.startup({\n * toolAdmin: new FrameworkToolAdmin()\n * });\n * ```\n * @public\n */\nexport class FrameworkToolAdmin extends ToolAdmin {\n public override async processShortcutKey(\n e: KeyboardEvent,\n wentDown: boolean\n ): Promise<boolean> {\n if (!wentDown) return false;\n if (UiFramework.isContextMenuOpen) return false;\n if (e.key === Key.Escape.valueOf()) return false;\n if (isElement(e.target) && isEditable(e.target)) return false;\n\n UiFramework.keyboardShortcuts.processKey(\n e.key,\n e.altKey,\n e.ctrlKey,\n e.shiftKey\n );\n return true;\n }\n}\n\nfunction isElement(target: EventTarget | null): target is Element {\n return target instanceof Element;\n}\n\nconst editableTags = [\"input\", \"textarea\", \"select\"];\nfunction isEditable(element: Element) {\n const tagName = element.tagName.toLowerCase();\n if (editableTags.includes(tagName)) return true;\n if (element instanceof HTMLElement && element.isContentEditable) return true;\n return false;\n}\n"]}
@@ -11,6 +11,8 @@ import { Tool } from "@itwin/core-frontend";
11
11
  import { ToolUtilities } from "@itwin/imodel-components-react";
12
12
  import { SvgRemove } from "@itwin/itwinui-icons-react";
13
13
  class ClearKeyinPaletteHistoryCoreTool extends Tool {
14
+ static toolId = "ClearKeyinPaletteHistory";
15
+ static iconSpec = "icon-remove";
14
16
  static get minArgs() {
15
17
  return 0;
16
18
  }
@@ -22,8 +24,6 @@ class ClearKeyinPaletteHistoryCoreTool extends Tool {
22
24
  return true;
23
25
  }
24
26
  }
25
- ClearKeyinPaletteHistoryCoreTool.toolId = "ClearKeyinPaletteHistory";
26
- ClearKeyinPaletteHistoryCoreTool.iconSpec = "icon-remove";
27
27
  /**
28
28
  * Immediate tool that will clear the recent history of command/tool keyins shown in
29
29
  * the command palette.
@@ -1 +1 @@
1
- {"version":3,"file":"KeyinPaletteTools.js","sourceRoot":"","sources":["../../../src/appui-react/tools/KeyinPaletteTools.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEvD,MAAM,gCAAiC,SAAQ,IAAI;IAI1C,MAAM,KAAc,OAAO;QAChC,OAAO,CAAC,CAAC;IACX,CAAC;IACM,MAAM,KAAc,OAAO;QAChC,OAAO,CAAC,CAAC;IACX,CAAC;IAEe,KAAK,CAAC,GAAG;QACvB,wBAAwB,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;;AAbsB,uCAAM,GAAG,0BAA0B,CAAC;AACpC,yCAAQ,GAAG,aAAa,CAAC;AAelD;;;;GAIG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,aAAa,CAAC,UAAU,CAClE,gCAAgC,EAChC,oBAAC,SAAS,OAAG,CACd,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 */\nimport * as React from \"react\";\nimport { clearKeyinPaletteHistory } from \"../popup/KeyinPalettePanel.js\";\nimport { Tool } from \"@itwin/core-frontend\";\nimport { ToolUtilities } from \"@itwin/imodel-components-react\";\nimport { SvgRemove } from \"@itwin/itwinui-icons-react\";\n\nclass ClearKeyinPaletteHistoryCoreTool extends Tool {\n public static override toolId = \"ClearKeyinPaletteHistory\";\n public static override iconSpec = \"icon-remove\";\n\n public static override get minArgs() {\n return 0;\n }\n public static override get maxArgs() {\n return 0;\n }\n\n public override async run(): Promise<boolean> {\n clearKeyinPaletteHistory();\n return true;\n }\n}\n\n/**\n * Immediate tool that will clear the recent history of command/tool keyins shown in\n * the command palette.\n * @alpha\n */\nexport const ClearKeyinPaletteHistoryTool = ToolUtilities.defineIcon(\n ClearKeyinPaletteHistoryCoreTool,\n <SvgRemove />\n);\n"]}
1
+ {"version":3,"file":"KeyinPaletteTools.js","sourceRoot":"","sources":["../../../src/appui-react/tools/KeyinPaletteTools.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEvD,MAAM,gCAAiC,SAAQ,IAAI;IAC1C,MAAM,CAAU,MAAM,GAAG,0BAA0B,CAAC;IACpD,MAAM,CAAU,QAAQ,GAAG,aAAa,CAAC;IAEzC,MAAM,KAAc,OAAO;QAChC,OAAO,CAAC,CAAC;IACX,CAAC;IACM,MAAM,KAAc,OAAO;QAChC,OAAO,CAAC,CAAC;IACX,CAAC;IAEe,KAAK,CAAC,GAAG;QACvB,wBAAwB,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;;AAGH;;;;GAIG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,aAAa,CAAC,UAAU,CAClE,gCAAgC,EAChC,oBAAC,SAAS,OAAG,CACd,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 */\nimport * as React from \"react\";\nimport { clearKeyinPaletteHistory } from \"../popup/KeyinPalettePanel.js\";\nimport { Tool } from \"@itwin/core-frontend\";\nimport { ToolUtilities } from \"@itwin/imodel-components-react\";\nimport { SvgRemove } from \"@itwin/itwinui-icons-react\";\n\nclass ClearKeyinPaletteHistoryCoreTool extends Tool {\n public static override toolId = \"ClearKeyinPaletteHistory\";\n public static override iconSpec = \"icon-remove\";\n\n public static override get minArgs() {\n return 0;\n }\n public static override get maxArgs() {\n return 0;\n }\n\n public override async run(): Promise<boolean> {\n clearKeyinPaletteHistory();\n return true;\n }\n}\n\n/**\n * Immediate tool that will clear the recent history of command/tool keyins shown in\n * the command palette.\n * @alpha\n */\nexport const ClearKeyinPaletteHistoryTool = ToolUtilities.defineIcon(\n ClearKeyinPaletteHistoryCoreTool,\n <SvgRemove />\n);\n"]}
@@ -11,6 +11,8 @@ import { ToolUtilities } from "@itwin/imodel-components-react";
11
11
  import { SvgSettings } from "@itwin/itwinui-icons-react";
12
12
  import { SettingsModalFrontstage } from "../frontstage/ModalSettingsStage.js";
13
13
  class OpenSettingsCoreTool extends Tool {
14
+ static toolId = "OpenSettings";
15
+ static iconSpec = "icon-settings";
14
16
  static get minArgs() {
15
17
  return 0;
16
18
  }
@@ -25,8 +27,6 @@ class OpenSettingsCoreTool extends Tool {
25
27
  return this.run(args[0]);
26
28
  }
27
29
  }
28
- OpenSettingsCoreTool.toolId = "OpenSettings";
29
- OpenSettingsCoreTool.iconSpec = "icon-settings";
30
30
  /**
31
31
  * Immediate tool that will open the Settings modal stage.
32
32
  * @alpha
@@ -1 +1 @@
1
- {"version":3,"file":"OpenSettingsTool.js","sourceRoot":"","sources":["../../../src/appui-react/tools/OpenSettingsTool.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAE9E,MAAM,oBAAqB,SAAQ,IAAI;IAI9B,MAAM,KAAc,OAAO;QAChC,OAAO,CAAC,CAAC;IACX,CAAC;IACM,MAAM,KAAc,OAAO;QAChC,OAAO,CAAC,CAAC;IACX,CAAC;IAEe,KAAK,CAAC,GAAG,CAAC,eAAwB;QAChD,uBAAuB,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAC;QAC3D,OAAO,IAAI,CAAC;IACd,CAAC;IAEe,KAAK,CAAC,WAAW,CAAC,GAAG,IAAc;QACjD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;;AAjBsB,2BAAM,GAAG,cAAc,CAAC;AACxB,6BAAQ,GAAG,eAAe,CAAC;AAmBpD;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAC,UAAU,CACtD,oBAAoB,EACpB,oBAAC,WAAW,OAAG,CAChB,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 */\nimport * as React from \"react\";\nimport { Tool } from \"@itwin/core-frontend\";\nimport { ToolUtilities } from \"@itwin/imodel-components-react\";\nimport { SvgSettings } from \"@itwin/itwinui-icons-react\";\nimport { SettingsModalFrontstage } from \"../frontstage/ModalSettingsStage.js\";\n\nclass OpenSettingsCoreTool extends Tool {\n public static override toolId = \"OpenSettings\";\n public static override iconSpec = \"icon-settings\";\n\n public static override get minArgs() {\n return 0;\n }\n public static override get maxArgs() {\n return 1;\n }\n\n public override async run(settingCategory?: string): Promise<boolean> {\n SettingsModalFrontstage.showSettingsStage(settingCategory);\n return true;\n }\n\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n return this.run(args[0]);\n }\n}\n\n/**\n * Immediate tool that will open the Settings modal stage.\n * @alpha\n */\nexport const OpenSettingsTool = ToolUtilities.defineIcon(\n OpenSettingsCoreTool,\n <SvgSettings />\n);\n"]}
1
+ {"version":3,"file":"OpenSettingsTool.js","sourceRoot":"","sources":["../../../src/appui-react/tools/OpenSettingsTool.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAE9E,MAAM,oBAAqB,SAAQ,IAAI;IAC9B,MAAM,CAAU,MAAM,GAAG,cAAc,CAAC;IACxC,MAAM,CAAU,QAAQ,GAAG,eAAe,CAAC;IAE3C,MAAM,KAAc,OAAO;QAChC,OAAO,CAAC,CAAC;IACX,CAAC;IACM,MAAM,KAAc,OAAO;QAChC,OAAO,CAAC,CAAC;IACX,CAAC;IAEe,KAAK,CAAC,GAAG,CAAC,eAAwB;QAChD,uBAAuB,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAC;QAC3D,OAAO,IAAI,CAAC;IACd,CAAC;IAEe,KAAK,CAAC,WAAW,CAAC,GAAG,IAAc;QACjD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;;AAGH;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAC,UAAU,CACtD,oBAAoB,EACpB,oBAAC,WAAW,OAAG,CAChB,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 */\nimport * as React from \"react\";\nimport { Tool } from \"@itwin/core-frontend\";\nimport { ToolUtilities } from \"@itwin/imodel-components-react\";\nimport { SvgSettings } from \"@itwin/itwinui-icons-react\";\nimport { SettingsModalFrontstage } from \"../frontstage/ModalSettingsStage.js\";\n\nclass OpenSettingsCoreTool extends Tool {\n public static override toolId = \"OpenSettings\";\n public static override iconSpec = \"icon-settings\";\n\n public static override get minArgs() {\n return 0;\n }\n public static override get maxArgs() {\n return 1;\n }\n\n public override async run(settingCategory?: string): Promise<boolean> {\n SettingsModalFrontstage.showSettingsStage(settingCategory);\n return true;\n }\n\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n return this.run(args[0]);\n }\n}\n\n/**\n * Immediate tool that will open the Settings modal stage.\n * @alpha\n */\nexport const OpenSettingsTool = ToolUtilities.defineIcon(\n OpenSettingsCoreTool,\n <SvgSettings />\n);\n"]}
@@ -12,6 +12,8 @@ import { UiFramework } from "../UiFramework.js";
12
12
  import { SvgViewLayouts } from "../icons/SvgViewLayouts.js";
13
13
  import { ToolUtilities } from "@itwin/imodel-components-react";
14
14
  class RestoreFrontstageLayoutCoreTool extends Tool {
15
+ static toolId = "RestoreFrontstageLayout";
16
+ static iconSpec = "icon-view-layouts";
15
17
  static get minArgs() {
16
18
  return 0;
17
19
  }
@@ -36,8 +38,6 @@ class RestoreFrontstageLayoutCoreTool extends Tool {
36
38
  return this.run(args[0]);
37
39
  }
38
40
  }
39
- RestoreFrontstageLayoutCoreTool.toolId = "RestoreFrontstageLayout";
40
- RestoreFrontstageLayoutCoreTool.iconSpec = "icon-view-layouts";
41
41
  /**
42
42
  * Immediate tool that will reset the layout to that specified in the stage definition. A stage Id
43
43
  * may be passed in, if not the active stage is used. The stage Id is case sensitive.
@@ -45,6 +45,8 @@ RestoreFrontstageLayoutCoreTool.iconSpec = "icon-view-layouts";
45
45
  */
46
46
  export const RestoreFrontstageLayoutTool = ToolUtilities.defineIcon(RestoreFrontstageLayoutCoreTool, React.createElement(SvgViewLayouts, null));
47
47
  class RestoreAllFrontstagesCoreTool extends Tool {
48
+ static toolId = "RestoreAllFrontstages";
49
+ static iconSpec = "icon-view-layouts";
48
50
  async run() {
49
51
  const frontstages = InternalFrontstageManager.frontstageDefs;
50
52
  for (const [, frontstage] of frontstages) {
@@ -53,8 +55,6 @@ class RestoreAllFrontstagesCoreTool extends Tool {
53
55
  return true;
54
56
  }
55
57
  }
56
- RestoreAllFrontstagesCoreTool.toolId = "RestoreAllFrontstages";
57
- RestoreAllFrontstagesCoreTool.iconSpec = "icon-view-layouts";
58
58
  /**
59
59
  * Immediate tool that will reset the layout of all frontstages to that specified in the stage definition.
60
60
  * @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CAAC,CAAC,CAAC;IAC3B,CAAC;;AAlCsB,sCAAM,GAAG,yBAAyB,CAAC;AACnC,wCAAQ,GAAG,mBAAmB,CAAC;AAoCxD;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,aAAa,CAAC,UAAU,CACjE,+BAA+B,EAC/B,oBAAC,cAAc,OAAG,CACnB,CAAC;AAEF,MAAM,6BAA8B,SAAQ,IAAI;IAI9B,KAAK,CAAC,GAAG;QACvB,MAAM,WAAW,GAAG,yBAAyB,CAAC,cAAc,CAAC;QAC7D,KAAK,MAAM,CAAC,EAAE,UAAU,CAAC,IAAI,WAAW,EAAE,CAAC;YACzC,UAAU,CAAC,aAAa,EAAE,CAAC;QAC7B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;;AATsB,oCAAM,GAAG,uBAAuB,CAAC;AACjC,sCAAQ,GAAG,mBAAmB,CAAC;AAWxD;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,aAAa,CAAC,UAAU,CAC/D,6BAA6B,EAC7B,oBAAC,cAAc,OAAG,CACnB,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 */\nimport * as React from \"react\";\nimport {\n IModelApp,\n NotifyMessageDetails,\n OutputMessagePriority,\n Tool,\n} from \"@itwin/core-frontend\";\nimport type { FrontstageDef } from \"../frontstage/FrontstageDef.js\";\nimport { InternalFrontstageManager } from \"../frontstage/InternalFrontstageManager.js\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport { SvgViewLayouts } from \"../icons/SvgViewLayouts.js\";\nimport { ToolUtilities } from \"@itwin/imodel-components-react\";\n\nclass RestoreFrontstageLayoutCoreTool extends Tool {\n public static override toolId = \"RestoreFrontstageLayout\";\n public static override iconSpec = \"icon-view-layouts\";\n\n public static override get minArgs() {\n return 0;\n }\n public static override get maxArgs() {\n return 1;\n }\n\n public override async run(frontstageId?: string): Promise<boolean> {\n let frontstageDef: FrontstageDef | undefined;\n\n if (frontstageId) {\n frontstageDef = await UiFramework.frontstages.getFrontstageDef(\n frontstageId\n );\n } else {\n frontstageDef = UiFramework.frontstages.activeFrontstageDef;\n }\n\n if (frontstageDef) frontstageDef.restoreLayout();\n else\n IModelApp.notifications.outputMessage(\n new NotifyMessageDetails(\n OutputMessagePriority.Info,\n UiFramework.translate(\"tools.RestoreFrontstageLayout.noStageFound\")\n )\n );\n return true;\n }\n\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n return this.run(args[0]);\n }\n}\n\n/**\n * Immediate tool that will reset the layout to that specified in the stage definition. A stage Id\n * may be passed in, if not the active stage is used. The stage Id is case sensitive.\n * @public\n */\nexport const RestoreFrontstageLayoutTool = ToolUtilities.defineIcon(\n RestoreFrontstageLayoutCoreTool,\n <SvgViewLayouts />\n);\n\nclass RestoreAllFrontstagesCoreTool extends Tool {\n public static override toolId = \"RestoreAllFrontstages\";\n public static override iconSpec = \"icon-view-layouts\";\n\n public override async run() {\n const frontstages = InternalFrontstageManager.frontstageDefs;\n for (const [, frontstage] of frontstages) {\n frontstage.restoreLayout();\n }\n return true;\n }\n}\n\n/**\n * Immediate tool that will reset the layout of all frontstages to that specified in the stage definition.\n * @public\n */\nexport const RestoreAllFrontstagesTool = ToolUtilities.defineIcon(\n RestoreAllFrontstagesCoreTool,\n <SvgViewLayouts />\n);\n"]}
1
+ {"version":3,"file":"RestoreLayoutTool.js","sourceRoot":"","sources":["../../../src/appui-react/tools/RestoreLayoutTool.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,SAAS,EACT,oBAAoB,EACpB,qBAAqB,EACrB,IAAI,GACL,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,yBAAyB,EAAE,MAAM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uBAAuB,CAAC;IACjD,MAAM,CAAU,QAAQ,GAAG,mBAAmB,CAAC;IAEtC,KAAK,CAAC,GAAG;QACvB,MAAM,WAAW,GAAG,yBAAyB,CAAC,cAAc,CAAC;QAC7D,KAAK,MAAM,CAAC,EAAE,UAAU,CAAC,IAAI,WAAW,EAAE,CAAC;YACzC,UAAU,CAAC,aAAa,EAAE,CAAC;QAC7B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;;AAGH;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,aAAa,CAAC,UAAU,CAC/D,6BAA6B,EAC7B,oBAAC,cAAc,OAAG,CACnB,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 */\nimport * as React from \"react\";\nimport {\n IModelApp,\n NotifyMessageDetails,\n OutputMessagePriority,\n Tool,\n} from \"@itwin/core-frontend\";\nimport type { FrontstageDef } from \"../frontstage/FrontstageDef.js\";\nimport { InternalFrontstageManager } from \"../frontstage/InternalFrontstageManager.js\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport { SvgViewLayouts } from \"../icons/SvgViewLayouts.js\";\nimport { ToolUtilities } from \"@itwin/imodel-components-react\";\n\nclass RestoreFrontstageLayoutCoreTool extends Tool {\n public static override toolId = \"RestoreFrontstageLayout\";\n public static override iconSpec = \"icon-view-layouts\";\n\n public static override get minArgs() {\n return 0;\n }\n public static override get maxArgs() {\n return 1;\n }\n\n public override async run(frontstageId?: string): Promise<boolean> {\n let frontstageDef: FrontstageDef | undefined;\n\n if (frontstageId) {\n frontstageDef = await UiFramework.frontstages.getFrontstageDef(\n frontstageId\n );\n } else {\n frontstageDef = UiFramework.frontstages.activeFrontstageDef;\n }\n\n if (frontstageDef) frontstageDef.restoreLayout();\n else\n IModelApp.notifications.outputMessage(\n new NotifyMessageDetails(\n OutputMessagePriority.Info,\n UiFramework.translate(\"tools.RestoreFrontstageLayout.noStageFound\")\n )\n );\n return true;\n }\n\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n return this.run(args[0]);\n }\n}\n\n/**\n * Immediate tool that will reset the layout to that specified in the stage definition. A stage Id\n * may be passed in, if not the active stage is used. The stage Id is case sensitive.\n * @public\n */\nexport const RestoreFrontstageLayoutTool = ToolUtilities.defineIcon(\n RestoreFrontstageLayoutCoreTool,\n <SvgViewLayouts />\n);\n\nclass RestoreAllFrontstagesCoreTool extends Tool {\n public static override toolId = \"RestoreAllFrontstages\";\n public static override iconSpec = \"icon-view-layouts\";\n\n public override async run() {\n const frontstages = InternalFrontstageManager.frontstageDefs;\n for (const [, frontstage] of frontstages) {\n frontstage.restoreLayout();\n }\n return true;\n }\n}\n\n/**\n * Immediate tool that will reset the layout of all frontstages to that specified in the stage definition.\n * @public\n */\nexport const RestoreAllFrontstagesTool = ToolUtilities.defineIcon(\n RestoreAllFrontstagesCoreTool,\n <SvgViewLayouts />\n);\n"]}
@@ -12,16 +12,17 @@ import { UiFramework } from "../UiFramework.js";
12
12
  * @alpha
13
13
  */
14
14
  export class FocusToolSettings extends Tool {
15
+ static toolId = "FocusToolSettings";
15
16
  async run() {
16
17
  return UiFramework.toolSettings.focusIntoToolSettings();
17
18
  }
18
19
  }
19
- FocusToolSettings.toolId = "FocusToolSettings";
20
20
  /**
21
21
  * Immediate tool that will bump a Tool Settings value.
22
22
  * @alpha
23
23
  */
24
24
  export class BumpToolSetting extends Tool {
25
+ static toolId = "BumpToolSetting";
25
26
  static get maxArgs() {
26
27
  return 1;
27
28
  }
@@ -39,5 +40,4 @@ export class BumpToolSetting extends Tool {
39
40
  return this.run(args[0]);
40
41
  }
41
42
  }
42
- BumpToolSetting.toolId = "BumpToolSetting";
43
43
  //# sourceMappingURL=ToolSettingsTools.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ToolSettingsTools.js","sourceRoot":"","sources":["../../../src/appui-react/tools/ToolSettingsTools.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;GAGG;AACH,MAAM,OAAO,iBAAkB,SAAQ,IAAI;IAGzB,KAAK,CAAC,GAAG;QACvB,OAAO,WAAW,CAAC,YAAY,CAAC,qBAAqB,EAAE,CAAC;IAC1D,CAAC;;AAJsB,wBAAM,GAAG,mBAAmB,CAAC;AAOtD;;;GAGG;AACH,MAAM,OAAO,eAAgB,SAAQ,IAAI;IAGhC,MAAM,KAAc,OAAO;QAChC,OAAO,CAAC,CAAC;IACX,CAAC;IAEe,KAAK,CAAC,GAAG,CAAC,eAAwB;QAChD,IAAI,YAAgC,CAAC;QACrC,IAAI,eAAe,EAAE,CAAC;YACpB,YAAY,GAAG,QAAQ,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;YAC7C,IAAI,KAAK,CAAC,YAAY,CAAC;gBAAE,OAAO,KAAK,CAAC;QACxC,CAAC;QACD,SAAS,CAAC,SAAS,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC,8DAA8D;QACjH,OAAO,IAAI,CAAC;IACd,CAAC;IAEe,KAAK,CAAC,WAAW,CAAC,GAAG,IAAc;QACjD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;;AAlBsB,sBAAM,GAAG,iBAAiB,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 */\nimport { IModelApp, Tool } from \"@itwin/core-frontend\";\nimport { UiFramework } from \"../UiFramework.js\";\n\n/**\n * Immediate tool that will focus into the Tool Settings widget.\n * @alpha\n */\nexport class FocusToolSettings extends Tool {\n public static override toolId = \"FocusToolSettings\";\n\n public override async run(): Promise<boolean> {\n return UiFramework.toolSettings.focusIntoToolSettings();\n }\n}\n\n/**\n * Immediate tool that will bump a Tool Settings value.\n * @alpha\n */\nexport class BumpToolSetting extends Tool {\n public static override toolId = \"BumpToolSetting\";\n\n public static override get maxArgs() {\n return 1;\n }\n\n public override async run(settingIndexStr?: string): Promise<boolean> {\n let settingIndex: number | undefined;\n if (settingIndexStr) {\n settingIndex = parseInt(settingIndexStr, 10);\n if (isNaN(settingIndex)) return false;\n }\n IModelApp.toolAdmin.bumpToolSetting(settingIndex); // eslint-disable-line @typescript-eslint/no-floating-promises\n return true;\n }\n\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n return this.run(args[0]);\n }\n}\n"]}
1
+ {"version":3,"file":"ToolSettingsTools.js","sourceRoot":"","sources":["../../../src/appui-react/tools/ToolSettingsTools.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;GAGG;AACH,MAAM,OAAO,iBAAkB,SAAQ,IAAI;IAClC,MAAM,CAAU,MAAM,GAAG,mBAAmB,CAAC;IAEpC,KAAK,CAAC,GAAG;QACvB,OAAO,WAAW,CAAC,YAAY,CAAC,qBAAqB,EAAE,CAAC;IAC1D,CAAC;;AAGH;;;GAGG;AACH,MAAM,OAAO,eAAgB,SAAQ,IAAI;IAChC,MAAM,CAAU,MAAM,GAAG,iBAAiB,CAAC;IAE3C,MAAM,KAAc,OAAO;QAChC,OAAO,CAAC,CAAC;IACX,CAAC;IAEe,KAAK,CAAC,GAAG,CAAC,eAAwB;QAChD,IAAI,YAAgC,CAAC;QACrC,IAAI,eAAe,EAAE,CAAC;YACpB,YAAY,GAAG,QAAQ,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;YAC7C,IAAI,KAAK,CAAC,YAAY,CAAC;gBAAE,OAAO,KAAK,CAAC;QACxC,CAAC;QACD,SAAS,CAAC,SAAS,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC,8DAA8D;QACjH,OAAO,IAAI,CAAC;IACd,CAAC;IAEe,KAAK,CAAC,WAAW,CAAC,GAAG,IAAc;QACjD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3B,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 */\nimport { IModelApp, Tool } from \"@itwin/core-frontend\";\nimport { UiFramework } from \"../UiFramework.js\";\n\n/**\n * Immediate tool that will focus into the Tool Settings widget.\n * @alpha\n */\nexport class FocusToolSettings extends Tool {\n public static override toolId = \"FocusToolSettings\";\n\n public override async run(): Promise<boolean> {\n return UiFramework.toolSettings.focusIntoToolSettings();\n }\n}\n\n/**\n * Immediate tool that will bump a Tool Settings value.\n * @alpha\n */\nexport class BumpToolSetting extends Tool {\n public static override toolId = \"BumpToolSetting\";\n\n public static override get maxArgs() {\n return 1;\n }\n\n public override async run(settingIndexStr?: string): Promise<boolean> {\n let settingIndex: number | undefined;\n if (settingIndexStr) {\n settingIndex = parseInt(settingIndexStr, 10);\n if (isNaN(settingIndex)) return false;\n }\n IModelApp.toolAdmin.bumpToolSetting(settingIndex); // eslint-disable-line @typescript-eslint/no-floating-promises\n return true;\n }\n\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n return this.run(args[0]);\n }\n}\n"]}
@@ -16,27 +16,24 @@ import { UnexpectedErrors } from "@itwin/core-bentley";
16
16
  /** @internal */
17
17
  /** ToolSettingsUiDataProvider keeps tool data in sync with UI display */
18
18
  class ToolSettingsUiDataProvider extends UiLayoutDataProvider {
19
- constructor() {
20
- super(...arguments);
21
- // send property changes from UI back to tool
22
- this.applyUiPropertyChange = (syncItem) => {
23
- void (async () => {
24
- try {
25
- const toolAdmin = IModelApp.toolAdmin;
26
- await toolAdmin.activeTool?.applyToolSettingPropertyChange(syncItem);
27
- if ("simulateMotionEvent" in toolAdmin) {
28
- toolAdmin.simulateMotionEvent();
29
- }
30
- }
31
- catch (err) {
32
- UnexpectedErrors.handle(err);
33
- }
34
- })();
35
- };
36
- }
37
19
  supplyDialogItems() {
38
20
  return UiFramework.toolSettings.toolSettingsProperties;
39
21
  }
22
+ // send property changes from UI back to tool
23
+ applyUiPropertyChange = (syncItem) => {
24
+ void (async () => {
25
+ try {
26
+ const toolAdmin = IModelApp.toolAdmin;
27
+ await toolAdmin.activeTool?.applyToolSettingPropertyChange(syncItem);
28
+ if ("simulateMotionEvent" in toolAdmin) {
29
+ toolAdmin.simulateMotionEvent();
30
+ }
31
+ }
32
+ catch (err) {
33
+ UnexpectedErrors.handle(err);
34
+ }
35
+ })();
36
+ };
40
37
  }
41
38
  /** ToolUiProvider class that informs ConfigurableUi that Tool Settings are provided for the specified tool.
42
39
  * @internal
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultToolSettingsProvider.js","sourceRoot":"","sources":["../../../src/appui-react/toolsettings/DefaultToolSettingsProvider.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AAEzF,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,mB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tB,oBAAC,0BAA0B,IACzB,kBAAkB,EAAE,kBAAkB,EACtC,cAAc,EAAE,IAAI,GACpB,CACH,CAAC;YACF,IAAI,CAAC,0BAA0B;gBAC7B,kBAAkB,CAAC,sBAAsB,EAAE,CAAC;QAChD,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;YAC7B,IAAI,CAAC,0BAA0B,GAAG,EAAE,CAAC;QACvC,CAAC;QACD,sHAAsH;QACtH,0DAA0D;QAC1D,WAAW,CAAC,WAAW,CAAC,yBAAyB,CAAC,IAAI,EAAE,CAAC;IAC3D,CAAC;IAEe,wBAAwB;QACtC,wDAAwD;QACxD,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;QAC7C,IAAI,CAAC,uBAAuB,EAAE,CAAC;IACjC,CAAC;IAED,6DAA6D;IAC7C,YAAY;QAC1B,IAAI,CAAC,wBAAwB,EAAE,CAAC;IAClC,CAAC;IAED,gFAAgF;IAChE,0BAA0B,CACxC,IAAyC,CAAC,uDAAuD;;QAEjG,IAAI,CAAC,cAAc,CAAC,uBAAuB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACnE,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 ToolSettings\n */\n\nimport * as React from \"react\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport type { DialogItem, DialogPropertySyncItem } from \"@itwin/appui-abstract\";\nimport { UiLayoutDataProvider } from \"@itwin/appui-abstract\";\nimport type { ConfigurableCreateInfo } from \"../configurableui/ConfigurableUiControl.js\";\nimport { ComponentGenerator } from \"../uiprovider/ComponentGenerator.js\";\nimport { DefaultDialogGridContainer } from \"../uiprovider/DefaultDialogGridContainer.js\";\nimport type { SyncToolSettingsPropertiesEventArgs } from \"../framework/FrameworkToolSettings.js\";\nimport { ToolUiProvider } from \"./ToolUiProvider.js\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport { UnexpectedErrors } from \"@itwin/core-bentley\";\n\n/** @internal */\n\n/** ToolSettingsUiDataProvider keeps tool data in sync with UI display */\nclass ToolSettingsUiDataProvider extends UiLayoutDataProvider {\n public override supplyDialogItems(): DialogItem[] | undefined {\n return UiFramework.toolSettings.toolSettingsProperties;\n }\n\n // send property changes from UI back to tool\n public override applyUiPropertyChange = (\n syncItem: DialogPropertySyncItem\n ) => {\n void (async () => {\n try {\n const toolAdmin = IModelApp.toolAdmin;\n await toolAdmin.activeTool?.applyToolSettingPropertyChange(syncItem);\n if (\"simulateMotionEvent\" in toolAdmin) {\n toolAdmin.simulateMotionEvent();\n }\n } catch (err) {\n UnexpectedErrors.handle(err);\n }\n })();\n };\n}\n\n/** ToolUiProvider class that informs ConfigurableUi that Tool Settings are provided for the specified tool.\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport class DefaultToolSettingsProvider extends ToolUiProvider {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n constructor(info: ConfigurableCreateInfo, options: any) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n super(info, options);\n this._dataProvider = new ToolSettingsUiDataProvider();\n }\n\n public get uiDataProvider() {\n return this._dataProvider as ToolSettingsUiDataProvider;\n }\n\n public updateToolSettingsNodes(): void {\n if (this.uiDataProvider.layoutDialogRows()) {\n const componentGenerator = new ComponentGenerator(this.uiDataProvider);\n\n this.toolSettingsNode = (\n <DefaultDialogGridContainer\n componentGenerator={componentGenerator}\n isToolSettings={true}\n />\n );\n this.horizontalToolSettingNodes =\n componentGenerator.getToolSettingsEntries();\n } else {\n this.toolSettingsNode = null;\n this.horizontalToolSettingNodes = [];\n }\n // We emit the UiFramework.frontstages.onToolSettingsReloadEvent event here because the Frontstage Manager is a static\n // class that UI components can easily register listeners.\n UiFramework.frontstages.onToolSettingsReloadEvent.emit();\n }\n\n public override reloadPropertiesFromTool(): void {\n // trigger the items to be reloaded from the active tool\n this.uiDataProvider.reloadDialogItems(false);\n this.updateToolSettingsNodes();\n }\n\n // called when tool is activated to repopulate tool settings.\n public override onInitialize(): void {\n this.reloadPropertiesFromTool();\n }\n\n // called to process UiFramework.toolSettings.onSyncToolSettingsProperties event\n public override syncToolSettingsProperties(\n args: SyncToolSettingsPropertiesEventArgs // eslint-disable-line @typescript-eslint/no-deprecated\n ): void {\n this.uiDataProvider.fireSyncPropertiesEvent(args.syncProperties);\n }\n}\n"]}
1
+ {"version":3,"file":"DefaultToolSettingsProvider.js","sourceRoot":"","sources":["../../../src/appui-react/toolsettings/DefaultToolSettingsProvider.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AAEzF,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,gBAAgB;AAEhB,yEAAyE;AACzE,MAAM,0BAA2B,SAAQ,oBAAoB;IAC3C,iBAAiB;QAC/B,OAAO,WAAW,CAAC,YAAY,CAAC,sBAAsB,CAAC;IACzD,CAAC;IAED,6CAA6C;IAC7B,qBAAqB,GAAG,CACtC,QAAgC,EAChC,EAAE;QACF,KAAK,CAAC,KAAK,IAAI,EAAE;YACf,IAAI,CAAC;gBACH,MAAM,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC;gBACtC,MAAM,SAAS,CAA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AAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;QAC7C,IAAI,CAAC,uBAAuB,EAAE,CAAC;IACjC,CAAC;IAED,6DAA6D;IAC7C,YAAY;QAC1B,IAAI,CAAC,wBAAwB,EAAE,CAAC;IAClC,CAAC;IAED,gFAAgF;IAChE,0BAA0B,CACxC,IAAyC,CAAC,uDAAuD;;QAEjG,IAAI,CAAC,cAAc,CAAC,uBAAuB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACnE,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 ToolSettings\n */\n\nimport * as React from \"react\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport type { DialogItem, DialogPropertySyncItem } from \"@itwin/appui-abstract\";\nimport { UiLayoutDataProvider } from \"@itwin/appui-abstract\";\nimport type { ConfigurableCreateInfo } from \"../configurableui/ConfigurableUiControl.js\";\nimport { ComponentGenerator } from \"../uiprovider/ComponentGenerator.js\";\nimport { DefaultDialogGridContainer } from \"../uiprovider/DefaultDialogGridContainer.js\";\nimport type { SyncToolSettingsPropertiesEventArgs } from \"../framework/FrameworkToolSettings.js\";\nimport { ToolUiProvider } from \"./ToolUiProvider.js\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport { UnexpectedErrors } from \"@itwin/core-bentley\";\n\n/** @internal */\n\n/** ToolSettingsUiDataProvider keeps tool data in sync with UI display */\nclass ToolSettingsUiDataProvider extends UiLayoutDataProvider {\n public override supplyDialogItems(): DialogItem[] | undefined {\n return UiFramework.toolSettings.toolSettingsProperties;\n }\n\n // send property changes from UI back to tool\n public override applyUiPropertyChange = (\n syncItem: DialogPropertySyncItem\n ) => {\n void (async () => {\n try {\n const toolAdmin = IModelApp.toolAdmin;\n await toolAdmin.activeTool?.applyToolSettingPropertyChange(syncItem);\n if (\"simulateMotionEvent\" in toolAdmin) {\n toolAdmin.simulateMotionEvent();\n }\n } catch (err) {\n UnexpectedErrors.handle(err);\n }\n })();\n };\n}\n\n/** ToolUiProvider class that informs ConfigurableUi that Tool Settings are provided for the specified tool.\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport class DefaultToolSettingsProvider extends ToolUiProvider {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n constructor(info: ConfigurableCreateInfo, options: any) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n super(info, options);\n this._dataProvider = new ToolSettingsUiDataProvider();\n }\n\n public get uiDataProvider() {\n return this._dataProvider as ToolSettingsUiDataProvider;\n }\n\n public updateToolSettingsNodes(): void {\n if (this.uiDataProvider.layoutDialogRows()) {\n const componentGenerator = new ComponentGenerator(this.uiDataProvider);\n\n this.toolSettingsNode = (\n <DefaultDialogGridContainer\n componentGenerator={componentGenerator}\n isToolSettings={true}\n />\n );\n this.horizontalToolSettingNodes =\n componentGenerator.getToolSettingsEntries();\n } else {\n this.toolSettingsNode = null;\n this.horizontalToolSettingNodes = [];\n }\n // We emit the UiFramework.frontstages.onToolSettingsReloadEvent event here because the Frontstage Manager is a static\n // class that UI components can easily register listeners.\n UiFramework.frontstages.onToolSettingsReloadEvent.emit();\n }\n\n public override reloadPropertiesFromTool(): void {\n // trigger the items to be reloaded from the active tool\n this.uiDataProvider.reloadDialogItems(false);\n this.updateToolSettingsNodes();\n }\n\n // called when tool is activated to repopulate tool settings.\n public override onInitialize(): void {\n this.reloadPropertiesFromTool();\n }\n\n // called to process UiFramework.toolSettings.onSyncToolSettingsProperties event\n public override syncToolSettingsProperties(\n args: SyncToolSettingsPropertiesEventArgs // eslint-disable-line @typescript-eslint/no-deprecated\n ): void {\n this.uiDataProvider.fireSyncPropertiesEvent(args.syncProperties);\n }\n}\n"]}
@@ -13,6 +13,10 @@ import { BeUiEvent } from "@itwin/core-bentley";
13
13
  * @internal
14
14
  */
15
15
  export class InternalToolSettingsManager {
16
+ static _useDefaultToolSettingsProvider = false;
17
+ static _toolIdForToolSettings = "";
18
+ static _activeToolLabel = "";
19
+ static _activeToolDescription = "";
16
20
  static syncToolSettingsProperties(toolId, syncProperties) {
17
21
  InternalToolSettingsManager.onSyncToolSettingsProperties.emit({
18
22
  toolId,
@@ -101,6 +105,10 @@ export class InternalToolSettingsManager {
101
105
  static get activeToolDescription() {
102
106
  return InternalToolSettingsManager._activeToolDescription;
103
107
  }
108
+ /** Get ToolSettings Properties sync event. */
109
+ static onSyncToolSettingsProperties = new BeUiEvent(); // eslint-disable-line @typescript-eslint/no-deprecated
110
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
111
+ static onReloadToolSettingsProperties = new BeUiEvent();
104
112
  /** Gets the Id of the active tool. If a tool is not active, blank is returned.
105
113
  * @return Id of the active tool, or blank if one is not active.
106
114
  */
@@ -121,12 +129,4 @@ export class InternalToolSettingsManager {
121
129
  return false;
122
130
  }
123
131
  }
124
- InternalToolSettingsManager._useDefaultToolSettingsProvider = false;
125
- InternalToolSettingsManager._toolIdForToolSettings = "";
126
- InternalToolSettingsManager._activeToolLabel = "";
127
- InternalToolSettingsManager._activeToolDescription = "";
128
- /** Get ToolSettings Properties sync event. */
129
- InternalToolSettingsManager.onSyncToolSettingsProperties = new BeUiEvent(); // eslint-disable-line @typescript-eslint/no-deprecated
130
- // eslint-disable-next-line @typescript-eslint/no-deprecated
131
- InternalToolSettingsManager.onReloadToolSettingsProperties = new BeUiEvent();
132
132
  //# sourceMappingURL=InternalToolSettingsManager.js.map