@itwin/appui-react 4.7.2 → 4.8.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 (255) hide show
  1. package/CHANGELOG.md +9 -3
  2. package/lib/cjs/appui-react/UiFramework.js +7 -4
  3. package/lib/cjs/appui-react/UiFramework.js.map +1 -1
  4. package/lib/cjs/appui-react/backstage/BackstageComposerItem.js +2 -1
  5. package/lib/cjs/appui-react/backstage/BackstageComposerItem.js.map +1 -1
  6. package/lib/cjs/appui-react/childwindow/ChildWindowConfig.d.ts +17 -0
  7. package/lib/cjs/appui-react/childwindow/ChildWindowConfig.d.ts.map +1 -0
  8. package/lib/cjs/appui-react/childwindow/ChildWindowConfig.js +3 -0
  9. package/lib/cjs/appui-react/childwindow/ChildWindowConfig.js.map +1 -0
  10. package/lib/cjs/appui-react/childwindow/InternalChildWindowManager.d.ts.map +1 -1
  11. package/lib/cjs/appui-react/childwindow/InternalChildWindowManager.js +18 -1
  12. package/lib/cjs/appui-react/childwindow/InternalChildWindowManager.js.map +1 -1
  13. package/lib/cjs/appui-react/configurableui/InternalConfigurableUiManager.js +1 -1
  14. package/lib/cjs/appui-react/configurableui/InternalConfigurableUiManager.js.map +1 -1
  15. package/lib/cjs/appui-react/configurableui/TimeTracker.js +2 -1
  16. package/lib/cjs/appui-react/configurableui/TimeTracker.js.map +1 -1
  17. package/lib/cjs/appui-react/content/ContentLayout.js +12 -9
  18. package/lib/cjs/appui-react/content/ContentLayout.js.map +1 -1
  19. package/lib/cjs/appui-react/content/DefaultViewOverlay.js +4 -3
  20. package/lib/cjs/appui-react/content/DefaultViewOverlay.js.map +1 -1
  21. package/lib/cjs/appui-react/content/FloatingViewportContent.js +2 -1
  22. package/lib/cjs/appui-react/content/FloatingViewportContent.js.map +1 -1
  23. package/lib/cjs/appui-react/content/IModelViewport.js +7 -4
  24. package/lib/cjs/appui-react/content/IModelViewport.js.map +1 -1
  25. package/lib/cjs/appui-react/content/InternalContentLayoutManager.js +2 -1
  26. package/lib/cjs/appui-react/content/InternalContentLayoutManager.js.map +1 -1
  27. package/lib/cjs/appui-react/content/InternalContentViewManager.js +2 -2
  28. package/lib/cjs/appui-react/content/InternalContentViewManager.js.map +1 -1
  29. package/lib/cjs/appui-react/content/split-pane/SplitPane.js +12 -10
  30. package/lib/cjs/appui-react/content/split-pane/SplitPane.js.map +1 -1
  31. package/lib/cjs/appui-react/cursor/cursormenu/CursorMenu.js +3 -2
  32. package/lib/cjs/appui-react/cursor/cursormenu/CursorMenu.js.map +1 -1
  33. package/lib/cjs/appui-react/dialog/ContentDialog.js +6 -3
  34. package/lib/cjs/appui-react/dialog/ContentDialog.js.map +1 -1
  35. package/lib/cjs/appui-react/dialog/DialogManagerBase.js +3 -2
  36. package/lib/cjs/appui-react/dialog/DialogManagerBase.js.map +1 -1
  37. package/lib/cjs/appui-react/frontstage/FrontstageDef.d.ts +2 -1
  38. package/lib/cjs/appui-react/frontstage/FrontstageDef.d.ts.map +1 -1
  39. package/lib/cjs/appui-react/frontstage/FrontstageDef.js +56 -38
  40. package/lib/cjs/appui-react/frontstage/FrontstageDef.js.map +1 -1
  41. package/lib/cjs/appui-react/frontstage/ModalSettingsStage.js +3 -2
  42. package/lib/cjs/appui-react/frontstage/ModalSettingsStage.js.map +1 -1
  43. package/lib/cjs/appui-react/frontstage/StandardFrontstageProvider.js +2 -1
  44. package/lib/cjs/appui-react/frontstage/StandardFrontstageProvider.js.map +1 -1
  45. package/lib/cjs/appui-react/hooks/useAnalysisAnimationDataProvider.js +11 -7
  46. package/lib/cjs/appui-react/hooks/useAnalysisAnimationDataProvider.js.map +1 -1
  47. package/lib/cjs/appui-react/hooks/useScheduleAnimationDataProvider.js +11 -7
  48. package/lib/cjs/appui-react/hooks/useScheduleAnimationDataProvider.js.map +1 -1
  49. package/lib/cjs/appui-react/hooks/useSolarDataProvider.js +13 -8
  50. package/lib/cjs/appui-react/hooks/useSolarDataProvider.js.map +1 -1
  51. package/lib/cjs/appui-react/messages/ActivityMessage.js +7 -5
  52. package/lib/cjs/appui-react/messages/ActivityMessage.js.map +1 -1
  53. package/lib/cjs/appui-react/messages/MessageManager.js +2 -1
  54. package/lib/cjs/appui-react/messages/MessageManager.js.map +1 -1
  55. package/lib/cjs/appui-react/pickers/ViewSelector.js +6 -5
  56. package/lib/cjs/appui-react/pickers/ViewSelector.js.map +1 -1
  57. package/lib/cjs/appui-react/popup/KeyinPalettePanel.js +2 -1
  58. package/lib/cjs/appui-react/popup/KeyinPalettePanel.js.map +1 -1
  59. package/lib/cjs/appui-react/popup/PopupManager.js +2 -1
  60. package/lib/cjs/appui-react/popup/PopupManager.js.map +1 -1
  61. package/lib/cjs/appui-react/preview/PreviewFeatures.d.ts +1 -0
  62. package/lib/cjs/appui-react/preview/PreviewFeatures.d.ts.map +1 -1
  63. package/lib/cjs/appui-react/preview/PreviewFeatures.js +2 -1
  64. package/lib/cjs/appui-react/preview/PreviewFeatures.js.map +1 -1
  65. package/lib/cjs/appui-react/selection/SelectionContextItemDef.js +2 -2
  66. package/lib/cjs/appui-react/selection/SelectionContextItemDef.js.map +1 -1
  67. package/lib/cjs/appui-react/settings/quantityformatting/QuantityFormat.js +1 -2
  68. package/lib/cjs/appui-react/settings/quantityformatting/QuantityFormat.js.map +1 -1
  69. package/lib/cjs/appui-react/stagepanels/StagePanelDef.js +16 -11
  70. package/lib/cjs/appui-react/stagepanels/StagePanelDef.js.map +1 -1
  71. package/lib/cjs/appui-react/statusbar/Indicator.js +2 -1
  72. package/lib/cjs/appui-react/statusbar/Indicator.js.map +1 -1
  73. package/lib/cjs/appui-react/statusbar/StatusBar.js +5 -3
  74. package/lib/cjs/appui-react/statusbar/StatusBar.js.map +1 -1
  75. package/lib/cjs/appui-react/statusfields/toolassistance/ToolAssistanceField.js +1 -1
  76. package/lib/cjs/appui-react/statusfields/toolassistance/ToolAssistanceField.js.map +1 -1
  77. package/lib/cjs/appui-react/theme/ThemeManager.js +1 -1
  78. package/lib/cjs/appui-react/theme/ThemeManager.js.map +1 -1
  79. package/lib/cjs/appui-react/toolbar/ToolbarHelper.js +4 -6
  80. package/lib/cjs/appui-react/toolbar/ToolbarHelper.js.map +1 -1
  81. package/lib/cjs/appui-react/toolbar/useUiItemsProviderToolbarItems.js +4 -3
  82. package/lib/cjs/appui-react/toolbar/useUiItemsProviderToolbarItems.js.map +1 -1
  83. package/lib/cjs/appui-react/tools/CoreToolDefinitions.js +17 -10
  84. package/lib/cjs/appui-react/tools/CoreToolDefinitions.js.map +1 -1
  85. package/lib/cjs/appui-react/tools/FrameworkToolAdmin.d.ts +1 -1
  86. package/lib/cjs/appui-react/tools/FrameworkToolAdmin.js +1 -1
  87. package/lib/cjs/appui-react/tools/FrameworkToolAdmin.js.map +1 -1
  88. package/lib/cjs/appui-react/toolsettings/DefaultToolSettingsProvider.js +2 -3
  89. package/lib/cjs/appui-react/toolsettings/DefaultToolSettingsProvider.js.map +1 -1
  90. package/lib/cjs/appui-react/ui-items-provider/AbstractUiItemsManager.js +22 -20
  91. package/lib/cjs/appui-react/ui-items-provider/AbstractUiItemsManager.js.map +1 -1
  92. package/lib/cjs/appui-react/ui-items-provider/StandardContentToolsUiItemsProvider.js +10 -9
  93. package/lib/cjs/appui-react/ui-items-provider/StandardContentToolsUiItemsProvider.js.map +1 -1
  94. package/lib/cjs/appui-react/ui-items-provider/StandardStatusbarUiItemsProvider.js +2 -1
  95. package/lib/cjs/appui-react/ui-items-provider/StandardStatusbarUiItemsProvider.js.map +1 -1
  96. package/lib/cjs/appui-react/ui-items-provider/UiItemsManager.js +14 -8
  97. package/lib/cjs/appui-react/ui-items-provider/UiItemsManager.js.map +1 -1
  98. package/lib/cjs/appui-react/uiadmin/FrameworkUiAdmin.js +1 -1
  99. package/lib/cjs/appui-react/uiadmin/FrameworkUiAdmin.js.map +1 -1
  100. package/lib/cjs/appui-react/uiprovider/ComponentGenerator.js +1 -1
  101. package/lib/cjs/appui-react/uiprovider/ComponentGenerator.js.map +1 -1
  102. package/lib/cjs/appui-react/utils/InternalUiShowHideManager.js +3 -3
  103. package/lib/cjs/appui-react/utils/InternalUiShowHideManager.js.map +1 -1
  104. package/lib/cjs/appui-react/widget-panels/Content.js +9 -8
  105. package/lib/cjs/appui-react/widget-panels/Content.js.map +1 -1
  106. package/lib/cjs/appui-react/widget-panels/Frontstage.d.ts +1 -1
  107. package/lib/cjs/appui-react/widget-panels/Frontstage.d.ts.map +1 -1
  108. package/lib/cjs/appui-react/widget-panels/Frontstage.js +50 -47
  109. package/lib/cjs/appui-react/widget-panels/Frontstage.js.map +1 -1
  110. package/lib/cjs/appui-react/widget-panels/StatusBar.js +1 -1
  111. package/lib/cjs/appui-react/widget-panels/StatusBar.js.map +1 -1
  112. package/lib/cjs/appui-react/widget-panels/Tab.js +1 -1
  113. package/lib/cjs/appui-react/widget-panels/Tab.js.map +1 -1
  114. package/lib/cjs/appui-react/widget-panels/ToolSettings.js +23 -15
  115. package/lib/cjs/appui-react/widget-panels/ToolSettings.js.map +1 -1
  116. package/lib/cjs/appui-react/widget-panels/Toolbars.js +3 -2
  117. package/lib/cjs/appui-react/widget-panels/Toolbars.js.map +1 -1
  118. package/lib/cjs/appui-react/widgets/NavigationWidgetComposer.js +2 -2
  119. package/lib/cjs/appui-react/widgets/NavigationWidgetComposer.js.map +1 -1
  120. package/lib/cjs/appui-react/widgets/Widget.d.ts +1 -1
  121. package/lib/cjs/appui-react/widgets/Widget.d.ts.map +1 -1
  122. package/lib/cjs/appui-react/widgets/Widget.js.map +1 -1
  123. package/lib/cjs/appui-react/widgets/WidgetDef.d.ts.map +1 -1
  124. package/lib/cjs/appui-react/widgets/WidgetDef.js +15 -7
  125. package/lib/cjs/appui-react/widgets/WidgetDef.js.map +1 -1
  126. package/lib/cjs/appui-react/widgets/WidgetHost.js +3 -2
  127. package/lib/cjs/appui-react/widgets/WidgetHost.js.map +1 -1
  128. package/lib/esm/appui-react/UiFramework.js +7 -4
  129. package/lib/esm/appui-react/UiFramework.js.map +1 -1
  130. package/lib/esm/appui-react/backstage/BackstageComposerItem.js +2 -1
  131. package/lib/esm/appui-react/backstage/BackstageComposerItem.js.map +1 -1
  132. package/lib/esm/appui-react/childwindow/ChildWindowConfig.d.ts +17 -0
  133. package/lib/esm/appui-react/childwindow/ChildWindowConfig.d.ts.map +1 -0
  134. package/lib/esm/appui-react/childwindow/ChildWindowConfig.js +2 -0
  135. package/lib/esm/appui-react/childwindow/ChildWindowConfig.js.map +1 -0
  136. package/lib/esm/appui-react/childwindow/InternalChildWindowManager.d.ts.map +1 -1
  137. package/lib/esm/appui-react/childwindow/InternalChildWindowManager.js +18 -1
  138. package/lib/esm/appui-react/childwindow/InternalChildWindowManager.js.map +1 -1
  139. package/lib/esm/appui-react/configurableui/InternalConfigurableUiManager.js +1 -1
  140. package/lib/esm/appui-react/configurableui/InternalConfigurableUiManager.js.map +1 -1
  141. package/lib/esm/appui-react/configurableui/TimeTracker.js +2 -1
  142. package/lib/esm/appui-react/configurableui/TimeTracker.js.map +1 -1
  143. package/lib/esm/appui-react/content/ContentLayout.js +12 -9
  144. package/lib/esm/appui-react/content/ContentLayout.js.map +1 -1
  145. package/lib/esm/appui-react/content/DefaultViewOverlay.js +4 -3
  146. package/lib/esm/appui-react/content/DefaultViewOverlay.js.map +1 -1
  147. package/lib/esm/appui-react/content/FloatingViewportContent.js +2 -1
  148. package/lib/esm/appui-react/content/FloatingViewportContent.js.map +1 -1
  149. package/lib/esm/appui-react/content/IModelViewport.js +7 -4
  150. package/lib/esm/appui-react/content/IModelViewport.js.map +1 -1
  151. package/lib/esm/appui-react/content/InternalContentLayoutManager.js +2 -1
  152. package/lib/esm/appui-react/content/InternalContentLayoutManager.js.map +1 -1
  153. package/lib/esm/appui-react/content/InternalContentViewManager.js +2 -2
  154. package/lib/esm/appui-react/content/InternalContentViewManager.js.map +1 -1
  155. package/lib/esm/appui-react/content/split-pane/SplitPane.js +12 -10
  156. package/lib/esm/appui-react/content/split-pane/SplitPane.js.map +1 -1
  157. package/lib/esm/appui-react/cursor/cursormenu/CursorMenu.js +3 -2
  158. package/lib/esm/appui-react/cursor/cursormenu/CursorMenu.js.map +1 -1
  159. package/lib/esm/appui-react/dialog/ContentDialog.js +6 -3
  160. package/lib/esm/appui-react/dialog/ContentDialog.js.map +1 -1
  161. package/lib/esm/appui-react/dialog/DialogManagerBase.js +3 -2
  162. package/lib/esm/appui-react/dialog/DialogManagerBase.js.map +1 -1
  163. package/lib/esm/appui-react/frontstage/FrontstageDef.d.ts +2 -1
  164. package/lib/esm/appui-react/frontstage/FrontstageDef.d.ts.map +1 -1
  165. package/lib/esm/appui-react/frontstage/FrontstageDef.js +57 -39
  166. package/lib/esm/appui-react/frontstage/FrontstageDef.js.map +1 -1
  167. package/lib/esm/appui-react/frontstage/ModalSettingsStage.js +3 -2
  168. package/lib/esm/appui-react/frontstage/ModalSettingsStage.js.map +1 -1
  169. package/lib/esm/appui-react/frontstage/StandardFrontstageProvider.js +2 -1
  170. package/lib/esm/appui-react/frontstage/StandardFrontstageProvider.js.map +1 -1
  171. package/lib/esm/appui-react/hooks/useAnalysisAnimationDataProvider.js +11 -7
  172. package/lib/esm/appui-react/hooks/useAnalysisAnimationDataProvider.js.map +1 -1
  173. package/lib/esm/appui-react/hooks/useScheduleAnimationDataProvider.js +11 -7
  174. package/lib/esm/appui-react/hooks/useScheduleAnimationDataProvider.js.map +1 -1
  175. package/lib/esm/appui-react/hooks/useSolarDataProvider.js +13 -8
  176. package/lib/esm/appui-react/hooks/useSolarDataProvider.js.map +1 -1
  177. package/lib/esm/appui-react/messages/ActivityMessage.js +7 -5
  178. package/lib/esm/appui-react/messages/ActivityMessage.js.map +1 -1
  179. package/lib/esm/appui-react/messages/MessageManager.js +2 -1
  180. package/lib/esm/appui-react/messages/MessageManager.js.map +1 -1
  181. package/lib/esm/appui-react/pickers/ViewSelector.js +6 -5
  182. package/lib/esm/appui-react/pickers/ViewSelector.js.map +1 -1
  183. package/lib/esm/appui-react/popup/KeyinPalettePanel.js +2 -1
  184. package/lib/esm/appui-react/popup/KeyinPalettePanel.js.map +1 -1
  185. package/lib/esm/appui-react/popup/PopupManager.js +2 -1
  186. package/lib/esm/appui-react/popup/PopupManager.js.map +1 -1
  187. package/lib/esm/appui-react/preview/PreviewFeatures.d.ts +1 -0
  188. package/lib/esm/appui-react/preview/PreviewFeatures.d.ts.map +1 -1
  189. package/lib/esm/appui-react/preview/PreviewFeatures.js +2 -1
  190. package/lib/esm/appui-react/preview/PreviewFeatures.js.map +1 -1
  191. package/lib/esm/appui-react/selection/SelectionContextItemDef.js +2 -2
  192. package/lib/esm/appui-react/selection/SelectionContextItemDef.js.map +1 -1
  193. package/lib/esm/appui-react/settings/quantityformatting/QuantityFormat.js +1 -2
  194. package/lib/esm/appui-react/settings/quantityformatting/QuantityFormat.js.map +1 -1
  195. package/lib/esm/appui-react/stagepanels/StagePanelDef.js +16 -11
  196. package/lib/esm/appui-react/stagepanels/StagePanelDef.js.map +1 -1
  197. package/lib/esm/appui-react/statusbar/Indicator.js +2 -1
  198. package/lib/esm/appui-react/statusbar/Indicator.js.map +1 -1
  199. package/lib/esm/appui-react/statusbar/StatusBar.js +5 -3
  200. package/lib/esm/appui-react/statusbar/StatusBar.js.map +1 -1
  201. package/lib/esm/appui-react/statusfields/toolassistance/ToolAssistanceField.js +1 -1
  202. package/lib/esm/appui-react/statusfields/toolassistance/ToolAssistanceField.js.map +1 -1
  203. package/lib/esm/appui-react/theme/ThemeManager.js +1 -1
  204. package/lib/esm/appui-react/theme/ThemeManager.js.map +1 -1
  205. package/lib/esm/appui-react/toolbar/ToolbarHelper.js +4 -6
  206. package/lib/esm/appui-react/toolbar/ToolbarHelper.js.map +1 -1
  207. package/lib/esm/appui-react/toolbar/useUiItemsProviderToolbarItems.js +4 -3
  208. package/lib/esm/appui-react/toolbar/useUiItemsProviderToolbarItems.js.map +1 -1
  209. package/lib/esm/appui-react/tools/CoreToolDefinitions.js +17 -10
  210. package/lib/esm/appui-react/tools/CoreToolDefinitions.js.map +1 -1
  211. package/lib/esm/appui-react/tools/FrameworkToolAdmin.d.ts +1 -1
  212. package/lib/esm/appui-react/tools/FrameworkToolAdmin.js +1 -1
  213. package/lib/esm/appui-react/tools/FrameworkToolAdmin.js.map +1 -1
  214. package/lib/esm/appui-react/toolsettings/DefaultToolSettingsProvider.js +2 -3
  215. package/lib/esm/appui-react/toolsettings/DefaultToolSettingsProvider.js.map +1 -1
  216. package/lib/esm/appui-react/ui-items-provider/AbstractUiItemsManager.js +22 -20
  217. package/lib/esm/appui-react/ui-items-provider/AbstractUiItemsManager.js.map +1 -1
  218. package/lib/esm/appui-react/ui-items-provider/StandardContentToolsUiItemsProvider.js +10 -9
  219. package/lib/esm/appui-react/ui-items-provider/StandardContentToolsUiItemsProvider.js.map +1 -1
  220. package/lib/esm/appui-react/ui-items-provider/StandardStatusbarUiItemsProvider.js +2 -1
  221. package/lib/esm/appui-react/ui-items-provider/StandardStatusbarUiItemsProvider.js.map +1 -1
  222. package/lib/esm/appui-react/ui-items-provider/UiItemsManager.js +14 -8
  223. package/lib/esm/appui-react/ui-items-provider/UiItemsManager.js.map +1 -1
  224. package/lib/esm/appui-react/uiadmin/FrameworkUiAdmin.js +1 -1
  225. package/lib/esm/appui-react/uiadmin/FrameworkUiAdmin.js.map +1 -1
  226. package/lib/esm/appui-react/uiprovider/ComponentGenerator.js +1 -1
  227. package/lib/esm/appui-react/uiprovider/ComponentGenerator.js.map +1 -1
  228. package/lib/esm/appui-react/utils/InternalUiShowHideManager.js +3 -3
  229. package/lib/esm/appui-react/utils/InternalUiShowHideManager.js.map +1 -1
  230. package/lib/esm/appui-react/widget-panels/Content.js +9 -8
  231. package/lib/esm/appui-react/widget-panels/Content.js.map +1 -1
  232. package/lib/esm/appui-react/widget-panels/Frontstage.d.ts +1 -1
  233. package/lib/esm/appui-react/widget-panels/Frontstage.d.ts.map +1 -1
  234. package/lib/esm/appui-react/widget-panels/Frontstage.js +50 -47
  235. package/lib/esm/appui-react/widget-panels/Frontstage.js.map +1 -1
  236. package/lib/esm/appui-react/widget-panels/StatusBar.js +1 -1
  237. package/lib/esm/appui-react/widget-panels/StatusBar.js.map +1 -1
  238. package/lib/esm/appui-react/widget-panels/Tab.js +1 -1
  239. package/lib/esm/appui-react/widget-panels/Tab.js.map +1 -1
  240. package/lib/esm/appui-react/widget-panels/ToolSettings.js +23 -15
  241. package/lib/esm/appui-react/widget-panels/ToolSettings.js.map +1 -1
  242. package/lib/esm/appui-react/widget-panels/Toolbars.js +3 -2
  243. package/lib/esm/appui-react/widget-panels/Toolbars.js.map +1 -1
  244. package/lib/esm/appui-react/widgets/NavigationWidgetComposer.js +2 -2
  245. package/lib/esm/appui-react/widgets/NavigationWidgetComposer.js.map +1 -1
  246. package/lib/esm/appui-react/widgets/Widget.d.ts +1 -1
  247. package/lib/esm/appui-react/widgets/Widget.d.ts.map +1 -1
  248. package/lib/esm/appui-react/widgets/Widget.js.map +1 -1
  249. package/lib/esm/appui-react/widgets/WidgetDef.d.ts.map +1 -1
  250. package/lib/esm/appui-react/widgets/WidgetDef.js +15 -7
  251. package/lib/esm/appui-react/widgets/WidgetDef.js.map +1 -1
  252. package/lib/esm/appui-react/widgets/WidgetHost.js +3 -2
  253. package/lib/esm/appui-react/widgets/WidgetHost.js.map +1 -1
  254. package/lib/public/locales/en/UiFramework.json +2 -1
  255. package/package.json +9 -9
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeManager.js","sourceRoot":"","sources":["../../../../src/appui-react/theme/ThemeManager.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,kBAAk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,CAAC,KAAK,CAAC,CAAC;QACjC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QACjD,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IACrD,CAAC;IAEe,kBAAkB,CAAC,SAA4B;QAC7D,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,KAAK;YAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC3E,IAAI,IAAI,CAAC,KAAK,CAAC,aAAa,KAAK,SAAS,CAAC,aAAa;YACtD,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QACnD,IAAI,IAAI,CAAC,KAAK,CAAC,cAAc,KAAK,SAAS,CAAC,cAAc;YACxD,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IACvD,CAAC;IAqCe,MAAM;QACpB,MAAM,KAAK,GAAG,wBAAwB,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACzD,MAAM,YAAY,GAAG,uBAAuB,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAExE,OAAO,CACL,oBAAC,aAAa,IACZ,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EACzB,KAAK,EAAE,KAAK,IAAI,SAAS,EACzB,YAAY,EAAE,EAAE,YAAY,EAAE,yBACT,aAAa,IAEjC,IAAI,CAAC,KAAK,CAAC,QAAQ,CACN,CACjB,CAAC;IACJ,CAAC;CACF;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,qBAAqB,CAAC,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 State\n */\n\nimport * as React from \"react\";\nimport { connect } from \"react-redux\";\nimport type { ThemeType } from \"@itwin/itwinui-react\";\nimport { ThemeProvider } from \"@itwin/itwinui-react\";\nimport type { FrameworkState } from \"../redux/FrameworkState\";\nimport { UiFramework } from \"../UiFramework\";\n\n/** System preferred color theme.\n * @public\n */\nexport const SYSTEM_PREFERRED_COLOR_THEME = \"SYSTEM_PREFERRED\";\n\n/** Enum for the Color Theme string.\n * @public\n */\nexport enum ColorTheme {\n /** Will use iTwinUI `light` theme. */\n Light = \"light\",\n /** Will use iTwinUI `dark` theme. */\n Dark = \"dark\",\n /** Will use iTwinUI `os` theme. */\n System = SYSTEM_PREFERRED_COLOR_THEME,\n /** Will use iTwinUI wrapping `ThemeProvider` if provided, or default to 'Light' */\n Inherit = \"inherit\",\n /** Will use iTwinUI `light` theme with `highContrast` set to `true` */\n HighContrastLight = \"high-contrast-light\",\n /** Will use iTwinUI `dark` theme with `highContrast` set to `true` */\n HighContrastDark = \"high-contrast-dark\",\n}\n\n/**\n * Describe valid themes.\n * See [[ThemeManager]] for more information.\n * @public\n */\nexport type ThemeId = `${ColorTheme}` | (string & {});\n\n/**\n * Map of ColorTheme to ThemeType\n */\nconst colorThemeToThemeTypeMap: { [x: string]: ThemeType } = {\n [ColorTheme.Light]: \"light\",\n [ColorTheme.HighContrastLight]: \"light\",\n [ColorTheme.Dark]: \"dark\",\n [ColorTheme.HighContrastDark]: \"dark\",\n [ColorTheme.System]: \"os\",\n};\n\n/**\n * List of high contrast color themes\n */\nconst highContrastColorThemes: string[] = [\n ColorTheme.HighContrastDark,\n ColorTheme.HighContrastLight,\n];\n\n/** The default widget opacity.\n * @public\n */\nexport const WIDGET_OPACITY_DEFAULT = 0.9;\n\n/** The default widget opacity.\n * @public\n */\nexport const TOOLBAR_OPACITY_DEFAULT = 0.5;\n\n/** Properties of [[ThemeManagerComponent]].\n */\ninterface ThemeManagerProps {\n /** theme (\"light\", \"dark\", etc.) */\n theme: ThemeId;\n /* Widget Opacity */\n widgetOpacity: number;\n children?: React.ReactNode;\n toolbarOpacity: number;\n}\n\nfunction mapStateToProps(state: any) {\n const frameworkState = state[UiFramework.frameworkStateKey] as FrameworkState; // since app sets up key, don't hard-code name\n // istanbul ignore if\n if (!frameworkState) return undefined;\n\n return {\n theme: frameworkState.configurableUiState.theme,\n widgetOpacity: frameworkState.configurableUiState.widgetOpacity,\n toolbarOpacity: frameworkState.configurableUiState.toolbarOpacity,\n };\n}\n\n/** ThemeManagerComponent handles setting themes.\n */\nclass ThemeManagerComponent extends React.Component<ThemeManagerProps> {\n public override componentDidMount() {\n this._setTheme(this.props.theme);\n this._setWidgetOpacity(this.props.widgetOpacity);\n this._setToolbarOpacity(this.props.toolbarOpacity);\n }\n\n public override componentDidUpdate(prevProps: ThemeManagerProps) {\n if (this.props.theme !== prevProps.theme) this._setTheme(this.props.theme);\n if (this.props.widgetOpacity !== prevProps.widgetOpacity)\n this._setWidgetOpacity(this.props.widgetOpacity);\n if (this.props.toolbarOpacity !== prevProps.toolbarOpacity)\n this._setToolbarOpacity(this.props.toolbarOpacity);\n }\n\n private _setTheme = (theme: string) => {\n document.documentElement.classList.add(\"theme-transition\");\n document.documentElement.setAttribute(\"data-theme\", theme);\n window.setTimeout(\n () => document.documentElement.classList.remove(\"theme-transition\"),\n 1000\n );\n };\n\n private _setWidgetOpacity = (opacity: number) => {\n const currentWidgetOpacity =\n document.documentElement.style.getPropertyValue(\"--buic-widget-opacity\");\n if (currentWidgetOpacity !== opacity.toString()) {\n setTimeout(() =>\n document.documentElement.style.setProperty(\n \"--buic-widget-opacity\",\n opacity.toString()\n )\n );\n }\n };\n\n private _setToolbarOpacity = (opacity: number) => {\n const currentToolbarOpacity =\n document.documentElement.style.getPropertyValue(\"--buic-toolbar-opacity\");\n if (currentToolbarOpacity !== opacity.toString()) {\n setTimeout(() => {\n document.documentElement.style.setProperty(\n \"--buic-toolbar-opacity\",\n opacity.toString()\n );\n });\n }\n };\n\n public override render(): React.ReactNode {\n const theme = colorThemeToThemeTypeMap[this.props.theme];\n const highContrast = highContrastColorThemes.includes(this.props.theme);\n\n return (\n <ThemeProvider\n style={{ height: \"100%\" }}\n theme={theme ?? \"inherit\"}\n themeOptions={{ highContrast }}\n data-root-container={\"iui-root-id\"}\n >\n {this.props.children}\n </ThemeProvider>\n );\n }\n}\n\n/** ThemeManager handles setting color themes and element opacity management. Note that this component will\n * affect the entire application by setting the data-theme attribute to the html element.\n * It also sets an iTwinUI `ThemeProvider` element locally, so all elements\n * within the AppUI tree will have the same theme, and should be using iTwinUI 2.x or later.\n * A `ColorTheme` enum values will configure iTwinUI `ThemeProvider` accordingly.\n * Any other string will only apply the `data-theme` attribute to the `html` element\n * and `ThemeProvider` theme will be set to `inherit`, in this case the application is\n * responsible for setting the theme by overriding iTwinUI css variables.\n *\n * This React component is Redux connected and should wrap [[ConfigurableUiContent]].\n *\n * ```tsx\n * <Provider store={UiFramework.store}>\n * <ThemeManager>\n * <ConfigurableUiContent />\n * </ThemeManager>\n * </Provider>\n * ```\n * @public\n */\nexport const ThemeManager = connect(mapStateToProps)(ThemeManagerComponent);\n"]}
1
+ {"version":3,"file":"ThemeManager.js","sourceRoot":"","sources":["../../../../src/appui-react/theme/ThemeManager.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,kBAAkB,CAAC;AAE/D;;GAEG;AACH,MAAM,CAAN,IAAY,UAaX;AAbD,W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AAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QACjD,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IACrD,CAAC;IAEe,kBAAkB,CAAC,SAA4B;QAC7D,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,KAAK;YAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC3E,IAAI,IAAI,CAAC,KAAK,CAAC,aAAa,KAAK,SAAS,CAAC,aAAa;YACtD,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QACnD,IAAI,IAAI,CAAC,KAAK,CAAC,cAAc,KAAK,SAAS,CAAC,cAAc;YACxD,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IACvD,CAAC;IAqCe,MAAM;QACpB,MAAM,KAAK,GAAG,wBAAwB,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACzD,MAAM,YAAY,GAAG,uBAAuB,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAExE,OAAO,CACL,oBAAC,aAAa,IACZ,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EACzB,KAAK,EAAE,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,SAAS,EACzB,YAAY,EAAE,EAAE,YAAY,EAAE,yBACT,aAAa,IAEjC,IAAI,CAAC,KAAK,CAAC,QAAQ,CACN,CACjB,CAAC;IACJ,CAAC;CACF;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,qBAAqB,CAAC,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 State\n */\n\nimport * as React from \"react\";\nimport { connect } from \"react-redux\";\nimport type { ThemeType } from \"@itwin/itwinui-react\";\nimport { ThemeProvider } from \"@itwin/itwinui-react\";\nimport type { FrameworkState } from \"../redux/FrameworkState\";\nimport { UiFramework } from \"../UiFramework\";\n\n/** System preferred color theme.\n * @public\n */\nexport const SYSTEM_PREFERRED_COLOR_THEME = \"SYSTEM_PREFERRED\";\n\n/** Enum for the Color Theme string.\n * @public\n */\nexport enum ColorTheme {\n /** Will use iTwinUI `light` theme. */\n Light = \"light\",\n /** Will use iTwinUI `dark` theme. */\n Dark = \"dark\",\n /** Will use iTwinUI `os` theme. */\n System = SYSTEM_PREFERRED_COLOR_THEME,\n /** Will use iTwinUI wrapping `ThemeProvider` if provided, or default to 'Light' */\n Inherit = \"inherit\",\n /** Will use iTwinUI `light` theme with `highContrast` set to `true` */\n HighContrastLight = \"high-contrast-light\",\n /** Will use iTwinUI `dark` theme with `highContrast` set to `true` */\n HighContrastDark = \"high-contrast-dark\",\n}\n\n/**\n * Describe valid themes.\n * See [[ThemeManager]] for more information.\n * @public\n */\nexport type ThemeId = `${ColorTheme}` | (string & {});\n\n/**\n * Map of ColorTheme to ThemeType\n */\nconst colorThemeToThemeTypeMap: { [x: string]: ThemeType } = {\n [ColorTheme.Light]: \"light\",\n [ColorTheme.HighContrastLight]: \"light\",\n [ColorTheme.Dark]: \"dark\",\n [ColorTheme.HighContrastDark]: \"dark\",\n [ColorTheme.System]: \"os\",\n};\n\n/**\n * List of high contrast color themes\n */\nconst highContrastColorThemes: string[] = [\n ColorTheme.HighContrastDark,\n ColorTheme.HighContrastLight,\n];\n\n/** The default widget opacity.\n * @public\n */\nexport const WIDGET_OPACITY_DEFAULT = 0.9;\n\n/** The default widget opacity.\n * @public\n */\nexport const TOOLBAR_OPACITY_DEFAULT = 0.5;\n\n/** Properties of [[ThemeManagerComponent]].\n */\ninterface ThemeManagerProps {\n /** theme (\"light\", \"dark\", etc.) */\n theme: ThemeId;\n /* Widget Opacity */\n widgetOpacity: number;\n children?: React.ReactNode;\n toolbarOpacity: number;\n}\n\nfunction mapStateToProps(state: any) {\n const frameworkState = state[UiFramework.frameworkStateKey] as FrameworkState; // since app sets up key, don't hard-code name\n // istanbul ignore if\n if (!frameworkState) return undefined;\n\n return {\n theme: frameworkState.configurableUiState.theme,\n widgetOpacity: frameworkState.configurableUiState.widgetOpacity,\n toolbarOpacity: frameworkState.configurableUiState.toolbarOpacity,\n };\n}\n\n/** ThemeManagerComponent handles setting themes.\n */\nclass ThemeManagerComponent extends React.Component<ThemeManagerProps> {\n public override componentDidMount() {\n this._setTheme(this.props.theme);\n this._setWidgetOpacity(this.props.widgetOpacity);\n this._setToolbarOpacity(this.props.toolbarOpacity);\n }\n\n public override componentDidUpdate(prevProps: ThemeManagerProps) {\n if (this.props.theme !== prevProps.theme) this._setTheme(this.props.theme);\n if (this.props.widgetOpacity !== prevProps.widgetOpacity)\n this._setWidgetOpacity(this.props.widgetOpacity);\n if (this.props.toolbarOpacity !== prevProps.toolbarOpacity)\n this._setToolbarOpacity(this.props.toolbarOpacity);\n }\n\n private _setTheme = (theme: string) => {\n document.documentElement.classList.add(\"theme-transition\");\n document.documentElement.setAttribute(\"data-theme\", theme);\n window.setTimeout(\n () => document.documentElement.classList.remove(\"theme-transition\"),\n 1000\n );\n };\n\n private _setWidgetOpacity = (opacity: number) => {\n const currentWidgetOpacity =\n document.documentElement.style.getPropertyValue(\"--buic-widget-opacity\");\n if (currentWidgetOpacity !== opacity.toString()) {\n setTimeout(() =>\n document.documentElement.style.setProperty(\n \"--buic-widget-opacity\",\n opacity.toString()\n )\n );\n }\n };\n\n private _setToolbarOpacity = (opacity: number) => {\n const currentToolbarOpacity =\n document.documentElement.style.getPropertyValue(\"--buic-toolbar-opacity\");\n if (currentToolbarOpacity !== opacity.toString()) {\n setTimeout(() => {\n document.documentElement.style.setProperty(\n \"--buic-toolbar-opacity\",\n opacity.toString()\n );\n });\n }\n };\n\n public override render(): React.ReactNode {\n const theme = colorThemeToThemeTypeMap[this.props.theme];\n const highContrast = highContrastColorThemes.includes(this.props.theme);\n\n return (\n <ThemeProvider\n style={{ height: \"100%\" }}\n theme={theme ?? \"inherit\"}\n themeOptions={{ highContrast }}\n data-root-container={\"iui-root-id\"}\n >\n {this.props.children}\n </ThemeProvider>\n );\n }\n}\n\n/** ThemeManager handles setting color themes and element opacity management. Note that this component will\n * affect the entire application by setting the data-theme attribute to the html element.\n * It also sets an iTwinUI `ThemeProvider` element locally, so all elements\n * within the AppUI tree will have the same theme, and should be using iTwinUI 2.x or later.\n * A `ColorTheme` enum values will configure iTwinUI `ThemeProvider` accordingly.\n * Any other string will only apply the `data-theme` attribute to the `html` element\n * and `ThemeProvider` theme will be set to `inherit`, in this case the application is\n * responsible for setting the theme by overriding iTwinUI css variables.\n *\n * This React component is Redux connected and should wrap [[ConfigurableUiContent]].\n *\n * ```tsx\n * <Provider store={UiFramework.store}>\n * <ThemeManager>\n * <ConfigurableUiContent />\n * </ThemeManager>\n * </Provider>\n * ```\n * @public\n */\nexport const ThemeManager = connect(mapStateToProps)(ThemeManagerComponent);\n"]}
@@ -47,19 +47,17 @@ export class ToolbarHelper {
47
47
  }
48
48
  /** Helper method to creates a generic toolbar item entry */
49
49
  static createToolbarItemFromItemDef(itemPriority, itemDef, overrides) {
50
- const { badgeType, icon, internalData, ...itemOverrides } = overrides ?? {};
50
+ var _a, _b, _c;
51
+ const { badgeType, icon, internalData, ...itemOverrides } = overrides !== null && overrides !== void 0 ? overrides : {};
51
52
  const itemBase = {
52
53
  id: itemDef.id,
53
54
  itemPriority,
54
55
  isActive: itemDef.isActive,
55
56
  isHidden: itemDef.isHidden,
56
57
  isDisabled: itemDef.isDisabled,
57
- icon: internalData?.get(IconHelper.reactIconKey) ??
58
- internalData?.get(IconHelper.conditionalIconItemKey) ??
59
- icon ??
60
- itemDef.iconSpec,
58
+ icon: (_c = (_b = (_a = internalData === null || internalData === void 0 ? void 0 : internalData.get(IconHelper.reactIconKey)) !== null && _a !== void 0 ? _a : internalData === null || internalData === void 0 ? void 0 : internalData.get(IconHelper.conditionalIconItemKey)) !== null && _b !== void 0 ? _b : icon) !== null && _c !== void 0 ? _c : itemDef.iconSpec,
61
59
  label: this.getStringOrConditionalString(itemDef.rawLabel),
62
- badge: badgeType ?? itemDef.badgeType,
60
+ badge: badgeType !== null && badgeType !== void 0 ? badgeType : itemDef.badgeType,
63
61
  };
64
62
  // istanbul ignore else
65
63
  if (itemDef instanceof CommandItemDef || itemDef instanceof ToolItemDef) {
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarHelper.js","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/ToolbarHelper.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAO3C,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAExE;;;;;;;GAOG;AACH,SAAS,yBAAyB,CAChC,QAAsB,EACtB,WAAc,EACd,oBAAoB,GAAG,EAAE,EACzB,SAAsC;IAEtC,IAAI,QAAQ,GAAG,oBAAoB,CAAC;IACpC,MAAM,KAAK,GAAG,EAAE,CAAC;IACjB,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;QAC9B,MAAM,IAAI,GAAG,aAAa,CAAC,4BAA4B,CACrD,QAAQ,EACR,OAAO,EACP,SAAS,CACV,CAAC;QACF,QAAQ,GAAG,QAAQ,GAAG,EA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F,YAAY,EAAE,GAAG,CAAC,UAAU,CAAC,YAAY,CAAC;gBAC1C,YAAY,EAAE,GAAG,CAAC,UAAU,CAAC,sBAAsB,CAAC;gBACpD,IAAI;gBACJ,OAAO,CAAC,QAAQ;YAClB,KAAK,EAAE,IAAI,CAAC,4BAA4B,CAAC,OAAO,CAAC,QAAQ,CAAC;YAC1D,KAAK,EAAE,SAAS,IAAI,OAAO,CAAC,SAAS;SACtC,CAAC;QAEF,uBAAuB;QACvB,IAAI,OAAO,YAAY,cAAc,IAAI,OAAO,YAAY,WAAW,EAAE;YACvE,OAAO;gBACL,GAAG,QAAQ;gBACX,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,GAAG,aAAa;aACjB,CAAC;SACH;aAAM,IAAI,OAAO,YAAY,aAAa,EAAE;YAC3C,OAAO;gBACL,GAAG,QAAQ;gBACX,YAAY,EAAE,OAAO,CAAC,cAAc;gBACpC,GAAG,aAAa;aACjB,CAAC;SACH;aAAM,IAAI,OAAO,YAAY,YAAY,EAAE;YAC1C,OAAO;gBACL,GAAG,QAAQ;gBACX,UAAU,EAAE,OAAO,CAAC,UAAU;gBAC9B,KAAK,EAAE,IAAI,CAAC,0BAA0B,CAAC,OAAO,CAAC,KAAK,CAAC;gBACrD,QAAQ,EAAE,KAAK;gBACf,GAAG,aAAa;aACjB,CAAC;SACH;aAAM;YACL,MAAM,IAAI,KAAK,CAAC,0CAA0C,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;SACzE;IACH,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,8BAA8B,CAC1C,QAAsB,EACtB,oBAAoB,GAAG,EAAE,EACzB,SAAsC;QAEtC,OAAO,yBAAyB,CAC9B,QAAQ,EACR,IAAI,EACJ,oBAAoB,EACpB,SAAS,CACV,CAAC;IACJ,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 */\nimport type * as React from \"react\";\nimport type {\n ActionButton,\n CommonToolbarItem,\n CustomButtonDefinition,\n GroupButton,\n StringGetter,\n} from \"@itwin/appui-abstract\";\nimport { ConditionalStringValue } from \"@itwin/appui-abstract\";\nimport { IconHelper } from \"@itwin/core-react\";\nimport type { AnyItemDef } from \"../shared/AnyItemDef\";\nimport { CommandItemDef } from \"../shared/CommandItemDef\";\nimport { CustomItemDef } from \"../shared/CustomItemDef\";\nimport { ToolItemDef } from \"../shared/ToolItemDef\";\nimport { GroupItemDef } from \"./GroupItem\";\nimport type {\n ToolbarActionItem,\n ToolbarCustomItem,\n ToolbarGroupItem,\n ToolbarItem,\n} from \"./ToolbarItem\";\nimport { isToolbarActionItem, isToolbarGroupItem } from \"./ToolbarItem\";\n\n/**\n * Common implementation for `constructChildToolbarItems` and `createToolbarItemsFromItemDefs`.\n * @param itemDefs List of itemDefs to convert.\n * @param allowCustom false if we are building children and don't support custom items.\n * @param startingItemPriority defaults to 10.\n * @param overrides Single override to apply to each itemDefs.\n * @returns ToolbarItem[] or (ToolbarActionItem | ToolbarGroupItem) if allowCustom is false.\n */\nfunction constructToolbarItemArray<T extends boolean>(\n itemDefs: AnyItemDef[],\n allowCustom: T,\n startingItemPriority = 10,\n overrides?: Partial<CommonToolbarItem>\n) {\n let priority = startingItemPriority;\n const items = [];\n for (const itemDef of itemDefs) {\n const item = ToolbarHelper.createToolbarItemFromItemDef(\n priority,\n itemDef,\n overrides\n );\n priority = priority + 10;\n if (allowCustom || isToolbarActionItem(item) || isToolbarGroupItem(item))\n items.push(item);\n }\n return items as T extends true\n ? Array<ToolbarItem>\n : Array<ToolbarActionItem | ToolbarGroupItem>;\n}\n\n/** Helper functions for defining a Toolbar items used in `Toolbar`, `ToolbarComposer` and `UiItemsProvider`.\n * @public\n */\nexport class ToolbarHelper {\n /** Construct ToolbarCustomItem definitions given a CustomItemDef. */\n public static createCustomDefinitionToolbarItem(\n itemPriority: number,\n itemDef: CustomItemDef,\n overrides?: Partial<CustomButtonDefinition>\n ): ToolbarCustomItem {\n return this.createToolbarItemFromItemDef(itemPriority, itemDef, overrides);\n }\n\n /** Construct ToolbarActionItem and ToolbarGroupItem definitions given an array of ItemDefs. */\n public static constructChildToolbarItems(\n itemDefs: AnyItemDef[]\n ): Array<ToolbarActionItem | ToolbarGroupItem> {\n return constructToolbarItemArray(itemDefs, false);\n }\n\n private static getStringOrConditionalString(\n inString: string | StringGetter | ConditionalStringValue\n ): string | ConditionalStringValue {\n if (\n inString instanceof ConditionalStringValue ||\n typeof inString === \"string\"\n )\n return inString;\n\n return inString();\n }\n\n public static getIconReactNode(\n item: ActionButton | GroupButton\n ): React.ReactNode {\n return IconHelper.getIconReactNode(item.icon, item.internalData);\n }\n\n /** Helper method to creates a generic toolbar item entry */\n public static createToolbarItemFromItemDef(\n itemPriority: number,\n itemDef: AnyItemDef,\n overrides?: Partial<CommonToolbarItem>\n ): ToolbarItem {\n const { badgeType, icon, internalData, ...itemOverrides } = overrides ?? {};\n const itemBase: ToolbarItem = {\n id: itemDef.id,\n itemPriority,\n isActive: itemDef.isActive,\n isHidden: itemDef.isHidden,\n isDisabled: itemDef.isDisabled,\n icon:\n internalData?.get(IconHelper.reactIconKey) ??\n internalData?.get(IconHelper.conditionalIconItemKey) ??\n icon ??\n itemDef.iconSpec,\n label: this.getStringOrConditionalString(itemDef.rawLabel),\n badge: badgeType ?? itemDef.badgeType,\n };\n\n // istanbul ignore else\n if (itemDef instanceof CommandItemDef || itemDef instanceof ToolItemDef) {\n return {\n ...itemBase,\n execute: itemDef.execute,\n ...itemOverrides,\n };\n } else if (itemDef instanceof CustomItemDef) {\n return {\n ...itemBase,\n panelContent: itemDef.popupPanelNode,\n ...itemOverrides,\n };\n } else if (itemDef instanceof GroupItemDef) {\n return {\n ...itemBase,\n panelLabel: itemDef.panelLabel,\n items: this.constructChildToolbarItems(itemDef.items),\n isActive: false,\n ...itemOverrides,\n };\n } else {\n throw new Error(`Invalid Item type encountered, item id=${itemDef.id}`);\n }\n }\n\n /**\n * Helper method to creates a generic toolbar item entry list.\n */\n public static createToolbarItemsFromItemDefs(\n itemDefs: AnyItemDef[],\n startingItemPriority = 10,\n overrides?: Partial<CommonToolbarItem>\n ): ToolbarItem[] {\n return constructToolbarItemArray(\n itemDefs,\n true,\n startingItemPriority,\n overrides\n );\n }\n}\n"]}
1
+ {"version":3,"file":"ToolbarHelper.js","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/ToolbarHelper.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAO3C,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAExE;;;;;;;GAOG;AACH,SAAS,yBAAyB,CAChC,QAAsB,EACtB,WAAc,EACd,oBAAoB,GAAG,EAAE,EACzB,SAAsC;IAEtC,IAAI,QAAQ,GAAG,oBAAoB,CAAC;IACpC,MAAM,KAAK,GAAG,EAAE,CAAC;IACjB,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;QAC9B,MAAM,IAAI,GAAG,aAAa,CAAC,4BAA4B,CACrD,QAAQ,EACR,OAAO,EACP,SAAS,CACV,CAAC;QACF,QAAQ,GAAG,QAAQ,GAAG,EAAE,CAAC;QACzB,IAAI,WAAW,IAAI,mBAAmB,CAAC,IAAI,CAAC,IAAI,kBAAkB,CAAC,IAAI,CAAC;YACtE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KACpB;IACD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BAAZ,YAAY,CAAE,GAAG,CAAC,UAAU,CAAC,sBAAsB,CAAC,mCACpD,IAAI,mCACJ,OAAO,CAAC,QAAQ;YAClB,KAAK,EAAE,IAAI,CAAC,4BAA4B,CAAC,OAAO,CAAC,QAAQ,CAAC;YAC1D,KAAK,EAAE,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,OAAO,CAAC,SAAS;SACtC,CAAC;QAEF,uBAAuB;QACvB,IAAI,OAAO,YAAY,cAAc,IAAI,OAAO,YAAY,WAAW,EAAE;YACvE,OAAO;gBACL,GAAG,QAAQ;gBACX,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,GAAG,aAAa;aACjB,CAAC;SACH;aAAM,IAAI,OAAO,YAAY,aAAa,EAAE;YAC3C,OAAO;gBACL,GAAG,QAAQ;gBACX,YAAY,EAAE,OAAO,CAAC,cAAc;gBACpC,GAAG,aAAa;aACjB,CAAC;SACH;aAAM,IAAI,OAAO,YAAY,YAAY,EAAE;YAC1C,OAAO;gBACL,GAAG,QAAQ;gBACX,UAAU,EAAE,OAAO,CAAC,UAAU;gBAC9B,KAAK,EAAE,IAAI,CAAC,0BAA0B,CAAC,OAAO,CAAC,KAAK,CAAC;gBACrD,QAAQ,EAAE,KAAK;gBACf,GAAG,aAAa;aACjB,CAAC;SACH;aAAM;YACL,MAAM,IAAI,KAAK,CAAC,0CAA0C,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;SACzE;IACH,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,8BAA8B,CAC1C,QAAsB,EACtB,oBAAoB,GAAG,EAAE,EACzB,SAAsC;QAEtC,OAAO,yBAAyB,CAC9B,QAAQ,EACR,IAAI,EACJ,oBAAoB,EACpB,SAAS,CACV,CAAC;IACJ,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 */\nimport type * as React from \"react\";\nimport type {\n ActionButton,\n CommonToolbarItem,\n CustomButtonDefinition,\n GroupButton,\n StringGetter,\n} from \"@itwin/appui-abstract\";\nimport { ConditionalStringValue } from \"@itwin/appui-abstract\";\nimport { IconHelper } from \"@itwin/core-react\";\nimport type { AnyItemDef } from \"../shared/AnyItemDef\";\nimport { CommandItemDef } from \"../shared/CommandItemDef\";\nimport { CustomItemDef } from \"../shared/CustomItemDef\";\nimport { ToolItemDef } from \"../shared/ToolItemDef\";\nimport { GroupItemDef } from \"./GroupItem\";\nimport type {\n ToolbarActionItem,\n ToolbarCustomItem,\n ToolbarGroupItem,\n ToolbarItem,\n} from \"./ToolbarItem\";\nimport { isToolbarActionItem, isToolbarGroupItem } from \"./ToolbarItem\";\n\n/**\n * Common implementation for `constructChildToolbarItems` and `createToolbarItemsFromItemDefs`.\n * @param itemDefs List of itemDefs to convert.\n * @param allowCustom false if we are building children and don't support custom items.\n * @param startingItemPriority defaults to 10.\n * @param overrides Single override to apply to each itemDefs.\n * @returns ToolbarItem[] or (ToolbarActionItem | ToolbarGroupItem) if allowCustom is false.\n */\nfunction constructToolbarItemArray<T extends boolean>(\n itemDefs: AnyItemDef[],\n allowCustom: T,\n startingItemPriority = 10,\n overrides?: Partial<CommonToolbarItem>\n) {\n let priority = startingItemPriority;\n const items = [];\n for (const itemDef of itemDefs) {\n const item = ToolbarHelper.createToolbarItemFromItemDef(\n priority,\n itemDef,\n overrides\n );\n priority = priority + 10;\n if (allowCustom || isToolbarActionItem(item) || isToolbarGroupItem(item))\n items.push(item);\n }\n return items as T extends true\n ? Array<ToolbarItem>\n : Array<ToolbarActionItem | ToolbarGroupItem>;\n}\n\n/** Helper functions for defining a Toolbar items used in `Toolbar`, `ToolbarComposer` and `UiItemsProvider`.\n * @public\n */\nexport class ToolbarHelper {\n /** Construct ToolbarCustomItem definitions given a CustomItemDef. */\n public static createCustomDefinitionToolbarItem(\n itemPriority: number,\n itemDef: CustomItemDef,\n overrides?: Partial<CustomButtonDefinition>\n ): ToolbarCustomItem {\n return this.createToolbarItemFromItemDef(itemPriority, itemDef, overrides);\n }\n\n /** Construct ToolbarActionItem and ToolbarGroupItem definitions given an array of ItemDefs. */\n public static constructChildToolbarItems(\n itemDefs: AnyItemDef[]\n ): Array<ToolbarActionItem | ToolbarGroupItem> {\n return constructToolbarItemArray(itemDefs, false);\n }\n\n private static getStringOrConditionalString(\n inString: string | StringGetter | ConditionalStringValue\n ): string | ConditionalStringValue {\n if (\n inString instanceof ConditionalStringValue ||\n typeof inString === \"string\"\n )\n return inString;\n\n return inString();\n }\n\n public static getIconReactNode(\n item: ActionButton | GroupButton\n ): React.ReactNode {\n return IconHelper.getIconReactNode(item.icon, item.internalData);\n }\n\n /** Helper method to creates a generic toolbar item entry */\n public static createToolbarItemFromItemDef(\n itemPriority: number,\n itemDef: AnyItemDef,\n overrides?: Partial<CommonToolbarItem>\n ): ToolbarItem {\n const { badgeType, icon, internalData, ...itemOverrides } = overrides ?? {};\n const itemBase: ToolbarItem = {\n id: itemDef.id,\n itemPriority,\n isActive: itemDef.isActive,\n isHidden: itemDef.isHidden,\n isDisabled: itemDef.isDisabled,\n icon:\n internalData?.get(IconHelper.reactIconKey) ??\n internalData?.get(IconHelper.conditionalIconItemKey) ??\n icon ??\n itemDef.iconSpec,\n label: this.getStringOrConditionalString(itemDef.rawLabel),\n badge: badgeType ?? itemDef.badgeType,\n };\n\n // istanbul ignore else\n if (itemDef instanceof CommandItemDef || itemDef instanceof ToolItemDef) {\n return {\n ...itemBase,\n execute: itemDef.execute,\n ...itemOverrides,\n };\n } else if (itemDef instanceof CustomItemDef) {\n return {\n ...itemBase,\n panelContent: itemDef.popupPanelNode,\n ...itemOverrides,\n };\n } else if (itemDef instanceof GroupItemDef) {\n return {\n ...itemBase,\n panelLabel: itemDef.panelLabel,\n items: this.constructChildToolbarItems(itemDef.items),\n isActive: false,\n ...itemOverrides,\n };\n } else {\n throw new Error(`Invalid Item type encountered, item id=${itemDef.id}`);\n }\n }\n\n /**\n * Helper method to creates a generic toolbar item entry list.\n */\n public static createToolbarItemsFromItemDefs(\n itemDefs: AnyItemDef[],\n startingItemPriority = 10,\n overrides?: Partial<CommonToolbarItem>\n ): ToolbarItem[] {\n return constructToolbarItemArray(\n itemDefs,\n true,\n startingItemPriority,\n overrides\n );\n }\n}\n"]}
@@ -17,9 +17,10 @@ manager, toolbarUsage, toolbarOrientation) => {
17
17
  const providedItems = useActiveStageProvidedToolbarItems(toolbarUsage, toolbarOrientation);
18
18
  const [items, setItems] = React.useState(providedItems);
19
19
  React.useEffect(() => {
20
- manager?.loadItems(providedItems);
21
- setItems(manager?.items ?? providedItems);
22
- return manager?.onItemsChanged.addListener((args) => {
20
+ var _a;
21
+ manager === null || manager === void 0 ? void 0 : manager.loadItems(providedItems);
22
+ setItems((_a = manager === null || manager === void 0 ? void 0 : manager.items) !== null && _a !== void 0 ? _a : providedItems);
23
+ return manager === null || manager === void 0 ? void 0 : manager.onItemsChanged.addListener((args) => {
23
24
  setItems(args.items);
24
25
  });
25
26
  }, [manager, providedItems]);
@@ -1 +1 @@
1
- {"version":3,"file":"useUiItemsProviderToolbarItems.js","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/useUiItemsProviderToolbarItems.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,EAAE,kCAAkC,EAAE,MAAM,sCAAsC,CAAC;AAE1F;;;GAGG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG;AAC5C,mDAAmD;AACnD,OAA4B,EAC5B,YAA0B,EAC1B,kBAAsC,EACd,EAAE;IAC1B,MAAM,aAAa,GAAG,kCAAkC,CACtD,YAAY,EACZ,kBAAkB,CACnB,CAAC;IACF,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;IACxD,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,OAAO,EAAE,SAAS,CAAC,aAAa,CAAC,CAAC;QAClC,QAAQ,CAAC,OAAO,EAAE,KAAK,IAAI,aAAa,CAAC,CAAC;QAE1C,OAAO,OAAO,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,EAAE;YAClD,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC;IAC7B,OAAO,KAAK,CAAC;AACf,CAAC,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 Toolbar\n */\n\nimport * as React from \"react\";\nimport type {\n ToolbarItem,\n ToolbarOrientation,\n ToolbarUsage,\n} from \"./ToolbarItem\";\nimport type { ToolbarItemsManager } from \"./ToolbarItemsManager\";\nimport { useActiveStageProvidedToolbarItems } from \"./useActiveStageProvidedToolbarItems\";\n\n/** Hook that retrieves active frontstage toolbar items from UiItemsProviders and manage them through [[ToolbarItemsManager]].\n * @public\n * @deprecated in 4.4.0. This uses ToolbarItemsManager which is internal, directly use [[ToolbarComposer]] instead.\n */\nexport const useUiItemsProviderToolbarItems = (\n // eslint-disable-next-line deprecation/deprecation\n manager: ToolbarItemsManager,\n toolbarUsage: ToolbarUsage,\n toolbarOrientation: ToolbarOrientation\n): readonly ToolbarItem[] => {\n const providedItems = useActiveStageProvidedToolbarItems(\n toolbarUsage,\n toolbarOrientation\n );\n const [items, setItems] = React.useState(providedItems);\n React.useEffect(() => {\n manager?.loadItems(providedItems);\n setItems(manager?.items ?? providedItems);\n\n return manager?.onItemsChanged.addListener((args) => {\n setItems(args.items);\n });\n }, [manager, providedItems]);\n return items;\n};\n"]}
1
+ {"version":3,"file":"useUiItemsProviderToolbarItems.js","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/useUiItemsProviderToolbarItems.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,EAAE,kCAAkC,EAAE,MAAM,sCAAsC,CAAC;AAE1F;;;GAGG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG;AAC5C,mDAAmD;AACnD,OAA4B,EAC5B,YAA0B,EAC1B,kBAAsC,EACd,EAAE;IAC1B,MAAM,aAAa,GAAG,kCAAkC,CACtD,YAAY,EACZ,kBAAkB,CACnB,CAAC;IACF,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;IACxD,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;;QACnB,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,CAAC,aAAa,CAAC,CAAC;QAClC,QAAQ,CAAC,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,mCAAI,aAAa,CAAC,CAAC;QAE1C,OAAO,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,cAAc,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,EAAE;YAClD,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC;IAC7B,OAAO,KAAK,CAAC;AACf,CAAC,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 Toolbar\n */\n\nimport * as React from \"react\";\nimport type {\n ToolbarItem,\n ToolbarOrientation,\n ToolbarUsage,\n} from \"./ToolbarItem\";\nimport type { ToolbarItemsManager } from \"./ToolbarItemsManager\";\nimport { useActiveStageProvidedToolbarItems } from \"./useActiveStageProvidedToolbarItems\";\n\n/** Hook that retrieves active frontstage toolbar items from UiItemsProviders and manage them through [[ToolbarItemsManager]].\n * @public\n * @deprecated in 4.4.0. This uses ToolbarItemsManager which is internal, directly use [[ToolbarComposer]] instead.\n */\nexport const useUiItemsProviderToolbarItems = (\n // eslint-disable-next-line deprecation/deprecation\n manager: ToolbarItemsManager,\n toolbarUsage: ToolbarUsage,\n toolbarOrientation: ToolbarOrientation\n): readonly ToolbarItem[] => {\n const providedItems = useActiveStageProvidedToolbarItems(\n toolbarUsage,\n toolbarOrientation\n );\n const [items, setItems] = React.useState(providedItems);\n React.useEffect(() => {\n manager?.loadItems(providedItems);\n setItems(manager?.items ?? providedItems);\n\n return manager?.onItemsChanged.addListener((args) => {\n setItems(args.items);\n });\n }, [manager, providedItems]);\n return items;\n};\n"]}
@@ -77,8 +77,9 @@ export class CoreTools {
77
77
  return new ToolItemDef({
78
78
  toolId: RotateViewTool.toolId,
79
79
  iconSpec: new ConditionalStringValue(() => {
80
+ var _a;
80
81
  const activeContentControl = UiFramework.content.getActiveContentControl();
81
- if (activeContentControl?.viewport?.view.is2d())
82
+ if ((_a = activeContentControl === null || activeContentControl === void 0 ? void 0 : activeContentControl.viewport) === null || _a === void 0 ? void 0 : _a.view.is2d())
82
83
  return svgRotateLeft;
83
84
  return svgGyroscope;
84
85
  }, [
@@ -98,8 +99,9 @@ export class CoreTools {
98
99
  label: WalkViewTool.flyover,
99
100
  description: WalkViewTool.description,
100
101
  isHidden: new ConditionalBooleanValue(() => {
102
+ var _a;
101
103
  const activeContentControl = UiFramework.content.getActiveContentControl();
102
- return !!activeContentControl?.viewport?.view.is2d();
104
+ return !!((_a = activeContentControl === null || activeContentControl === void 0 ? void 0 : activeContentControl.viewport) === null || _a === void 0 ? void 0 : _a.view.is2d());
103
105
  }, [
104
106
  SyncUiEventId.ActiveContentChanged,
105
107
  SyncUiEventId.ActiveViewportChanged,
@@ -130,9 +132,10 @@ export class CoreTools {
130
132
  return new ToolItemDef({
131
133
  toolId: ViewToggleCameraTool.toolId,
132
134
  iconSpec: new ConditionalStringValue(() => {
135
+ var _a, _b;
133
136
  const activeContentControl = UiFramework.content.getActiveContentControl();
134
- if (activeContentControl?.viewport?.view.is3d() &&
135
- activeContentControl?.viewport?.isCameraOn) {
137
+ if (((_a = activeContentControl === null || activeContentControl === void 0 ? void 0 : activeContentControl.viewport) === null || _a === void 0 ? void 0 : _a.view.is3d()) &&
138
+ ((_b = activeContentControl === null || activeContentControl === void 0 ? void 0 : activeContentControl.viewport) === null || _b === void 0 ? void 0 : _b.isCameraOn)) {
136
139
  return cameraAnimationIcon;
137
140
  }
138
141
  return cameraAnimationDisabledIcon;
@@ -142,9 +145,10 @@ export class CoreTools {
142
145
  SyncUiEventId.ViewStateChanged,
143
146
  ]),
144
147
  label: new ConditionalStringValue(() => {
148
+ var _a, _b;
145
149
  const activeContentControl = UiFramework.content.getActiveContentControl();
146
- if (activeContentControl?.viewport?.view.is3d() &&
147
- activeContentControl?.viewport?.isCameraOn) {
150
+ if (((_a = activeContentControl === null || activeContentControl === void 0 ? void 0 : activeContentControl.viewport) === null || _a === void 0 ? void 0 : _a.view.is3d()) &&
151
+ ((_b = activeContentControl === null || activeContentControl === void 0 ? void 0 : activeContentControl.viewport) === null || _b === void 0 ? void 0 : _b.isCameraOn)) {
148
152
  return UiFramework.translate("tools.View.ToggleCamera.turnOffFlyover");
149
153
  }
150
154
  return UiFramework.translate("tools.View.ToggleCamera.turnOnFlyover");
@@ -155,9 +159,10 @@ export class CoreTools {
155
159
  ]),
156
160
  description: ViewToggleCameraTool.description,
157
161
  isHidden: new ConditionalBooleanValue(() => {
162
+ var _a, _b;
158
163
  const activeContentControl = UiFramework.content.getActiveContentControl();
159
- return !(activeContentControl?.viewport?.view.is3d() &&
160
- activeContentControl?.viewport?.view.supportsCamera());
164
+ return !(((_a = activeContentControl === null || activeContentControl === void 0 ? void 0 : activeContentControl.viewport) === null || _a === void 0 ? void 0 : _a.view.is3d()) &&
165
+ ((_b = activeContentControl === null || activeContentControl === void 0 ? void 0 : activeContentControl.viewport) === null || _b === void 0 ? void 0 : _b.view.supportsCamera()));
161
166
  }, [
162
167
  SyncUiEventId.ActiveContentChanged,
163
168
  SyncUiEventId.ActiveViewportChanged,
@@ -284,8 +289,9 @@ export class CoreTools {
284
289
  labelKey: "UiFramework:tools.sectionTools",
285
290
  iconSpec: svgSectionTool,
286
291
  isHidden: new ConditionalBooleanValue(() => {
292
+ var _a;
287
293
  const activeContentControl = UiFramework.content.getActiveContentControl();
288
- return !!activeContentControl?.viewport?.view.is2d();
294
+ return !!((_a = activeContentControl === null || activeContentControl === void 0 ? void 0 : activeContentControl.viewport) === null || _a === void 0 ? void 0 : _a.view.is2d());
289
295
  }, [
290
296
  SyncUiEventId.ActiveContentChanged,
291
297
  SyncUiEventId.ActiveViewportChanged,
@@ -311,8 +317,9 @@ export class CoreTools {
311
317
  panelLabelKey: "UiFramework:tools.sectionPanelLabel",
312
318
  iconSpec: svgSectionTool,
313
319
  isHidden: new ConditionalBooleanValue(() => {
320
+ var _a;
314
321
  const activeContentControl = UiFramework.content.getActiveContentControl();
315
- return !!activeContentControl?.viewport?.view.is2d();
322
+ return !!((_a = activeContentControl === null || activeContentControl === void 0 ? void 0 : activeContentControl.viewport) === null || _a === void 0 ? void 0 : _a.view.is2d());
316
323
  }, [
317
324
  SyncUiEventId.ActiveContentChanged,
318
325
  SyncUiEventId.ActiveViewportChanged,
@@ -1 +1 @@
1
- {"version":3,"file":"CoreToolDefinitions.js","sourceRoot":"","sources":["../../../../src/appui-react/tools/CoreToolDefinitions.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC,CAAC,6BAA6B;AAC7D,OAAO,EACL,WAAW,EACX,WAAW,EACX,SAAS,EACT,mB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c,CAAC;YACxB,SAAS,EAAE,4BAA4B;YACvC,QAAQ,EAAE,iBAAiB;YAC3B,QAAQ,EAAE,oCAAoC;YAC9C,QAAQ,EAAE,+BAA+B,EAAE;YAC3C,OAAO,EAAE,KAAK,IAAI,EAAE;gBAClB,MAAM,gBAAgB,GAAG,WAAW,CAAC,mBAAmB,EAAE,CAAC;gBAC3D,IAAI,gBAAgB,EAAE;oBACpB,gBAAgB,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;iBAC1C;gBACD,MAAM,IAAI,GAAG,SAAS,CAAC,SAAS,CAAC,aAAa,CAAC;gBAC/C,IAAI,IAAI;oBAAE,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;;oBAChC,MAAM,SAAS,CAAC,SAAS,CAAC,gBAAgB,EAAE,CAAC;YACpD,CAAC;SACF,CAAC,CAAC;IACL,CAAC;IAEM,MAAM,KAAK,qCAAqC;QACrD,OAAO,IAAI,WAAW,CAAC;YACrB,MAAM,EAAE,2BAA2B,CAAC,MAAM;YAC1C,QAAQ,EAAE,2BAA2B,CAAC,QAAQ;YAC9C,KAAK,EAAE,2BAA2B,CAAC,OAAO;YAC1C,WAAW,EAAE,2BAA2B,CAAC,WAAW;YACpD,OAAO,EAAE,KAAK,IAAI,EAAE;gBAClB,OAAO,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAC;YACjE,CAAC;SACF,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tools\n */\n\nimport * as React from \"react\"; // cSpell:ignore keyinbrowser\nimport {\n FitViewTool,\n FlyViewTool,\n IModelApp,\n MeasureDistanceTool,\n MeasureLocationTool,\n PanViewTool,\n RotateViewTool,\n SelectionTool,\n SetupWalkCameraTool,\n ViewClipByElementTool,\n ViewClipByPlaneTool,\n ViewClipByRangeTool,\n ViewClipByShapeTool,\n ViewClipDecorationProvider,\n ViewRedoTool,\n ViewToggleCameraTool,\n ViewUndoTool,\n WalkViewTool,\n WindowAreaTool,\n ZoomViewTool,\n} from \"@itwin/core-frontend\";\nimport {\n ConditionalBooleanValue,\n ConditionalStringValue,\n} from \"@itwin/appui-abstract\";\nimport { getIsHiddenIfSelectionNotActive } from \"../selection/SelectionContextItemDef\";\nimport { CommandItemDef } from \"../shared/CommandItemDef\";\nimport { ToolItemDef } from \"../shared/ToolItemDef\";\nimport { SyncUiEventId } from \"../syncui/SyncUiEventDispatcher\";\nimport { GroupItemDef } from \"../toolbar/GroupItem\";\nimport { RestoreFrontstageLayoutTool } from \"./RestoreLayoutTool\";\nimport { UiFramework } from \"../UiFramework\";\nimport cameraAnimationIcon from \"@itwin/itwinui-icons/icons/camera-animation.svg\";\nimport cameraAnimationDisabledIcon from \"@itwin/itwinui-icons/icons/camera-animation-disabled.svg\";\nimport svgGyroscope from \"@bentley/icons-generic/icons/gyroscope.svg\";\nimport svgRotateLeft from \"@bentley/icons-generic/icons/rotate-left.svg\";\nimport svgSectionTool from \"@bentley/icons-generic/icons/section-tool.svg\";\nimport svgSelectionClear from \"@bentley/icons-generic/icons/selection-clear.svg\";\nimport { SvgMeasure, SvgProcess } from \"@itwin/itwinui-icons-react\";\n\n/** Utility Class that provides definitions of tools provided by the ($core-frontend) core. These definitions can be used to populate the UI.\n * @public\n */\n// istanbul ignore next\nexport class CoreTools {\n public static get keyinPaletteButtonItemDef() {\n return new ToolItemDef({\n toolId: \"uif:keyinpalette\",\n iconSpec: <SvgProcess />,\n labelKey: \"UiFramework:keyinbrowser.label\",\n execute: () => {\n IModelApp.uiAdmin.showKeyinPalette();\n },\n });\n }\n\n public static get fitViewCommand() {\n return new ToolItemDef({\n toolId: FitViewTool.toolId,\n iconSpec: FitViewTool.iconSpec,\n label: FitViewTool.flyover,\n description: FitViewTool.description,\n execute: async () =>\n IModelApp.tools.run(\n FitViewTool.toolId,\n IModelApp.viewManager.selectedView,\n true\n ),\n });\n }\n\n public static get windowAreaCommand() {\n return new ToolItemDef({\n toolId: WindowAreaTool.toolId,\n iconSpec: WindowAreaTool.iconSpec,\n label: WindowAreaTool.flyover,\n description: WindowAreaTool.description,\n execute: async () =>\n IModelApp.tools.run(\n WindowAreaTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get zoomViewCommand() {\n return new ToolItemDef({\n toolId: ZoomViewTool.toolId,\n iconSpec: ZoomViewTool.iconSpec,\n label: ZoomViewTool.flyover,\n description: ZoomViewTool.description,\n execute: async () =>\n IModelApp.tools.run(\n ZoomViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get panViewCommand() {\n return new ToolItemDef({\n toolId: PanViewTool.toolId,\n iconSpec: PanViewTool.iconSpec,\n label: PanViewTool.flyover,\n description: PanViewTool.description,\n execute: async () =>\n IModelApp.tools.run(\n PanViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get rotateViewCommand() {\n return new ToolItemDef({\n toolId: RotateViewTool.toolId,\n iconSpec: new ConditionalStringValue(() => {\n const activeContentControl =\n UiFramework.content.getActiveContentControl();\n if (activeContentControl?.viewport?.view.is2d()) return svgRotateLeft;\n return svgGyroscope;\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n label: RotateViewTool.flyover,\n description: RotateViewTool.description,\n execute: async () =>\n IModelApp.tools.run(\n RotateViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get walkViewCommand() {\n return new ToolItemDef({\n toolId: WalkViewTool.toolId,\n iconSpec: WalkViewTool.iconSpec,\n label: WalkViewTool.flyover,\n description: WalkViewTool.description,\n isHidden: new ConditionalBooleanValue(() => {\n const activeContentControl =\n UiFramework.content.getActiveContentControl();\n return !!activeContentControl?.viewport?.view.is2d();\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n execute: async () =>\n IModelApp.tools.run(\n WalkViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get selectElementCommand() {\n return new ToolItemDef({\n toolId: SelectionTool.toolId,\n iconSpec: SelectionTool.iconSpec,\n label: SelectionTool.flyover,\n description: SelectionTool.description,\n execute: async () => IModelApp.tools.run(SelectionTool.toolId),\n });\n }\n\n public static get setupCameraWalkTool() {\n return new ToolItemDef({\n toolId: SetupWalkCameraTool.toolId,\n iconSpec: SetupWalkCameraTool.iconSpec,\n label: SetupWalkCameraTool.flyover,\n description: SetupWalkCameraTool.description,\n execute: async () => IModelApp.tools.run(SetupWalkCameraTool.toolId),\n });\n }\n\n public static get toggleCameraViewCommand() {\n return new ToolItemDef({\n toolId: ViewToggleCameraTool.toolId,\n iconSpec: new ConditionalStringValue(() => {\n const activeContentControl =\n UiFramework.content.getActiveContentControl();\n if (\n activeContentControl?.viewport?.view.is3d() &&\n activeContentControl?.viewport?.isCameraOn\n ) {\n return cameraAnimationIcon;\n }\n return cameraAnimationDisabledIcon;\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n label: new ConditionalStringValue(() => {\n const activeContentControl =\n UiFramework.content.getActiveContentControl();\n if (\n activeContentControl?.viewport?.view.is3d() &&\n activeContentControl?.viewport?.isCameraOn\n ) {\n return UiFramework.translate(\n \"tools.View.ToggleCamera.turnOffFlyover\"\n );\n }\n return UiFramework.translate(\"tools.View.ToggleCamera.turnOnFlyover\");\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n description: ViewToggleCameraTool.description,\n isHidden: new ConditionalBooleanValue(() => {\n const activeContentControl =\n UiFramework.content.getActiveContentControl();\n return !(\n activeContentControl?.viewport?.view.is3d() &&\n activeContentControl?.viewport?.view.supportsCamera()\n );\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n execute: async () =>\n IModelApp.tools.run(\n ViewToggleCameraTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get flyViewCommand() {\n return new ToolItemDef({\n toolId: FlyViewTool.toolId,\n iconSpec: FlyViewTool.iconSpec,\n label: FlyViewTool.flyover,\n description: FlyViewTool.description,\n execute: async () =>\n IModelApp.tools.run(\n FlyViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n // TODO - Need to provide a sync message that is fired when the Undo/Redo button needs to be refreshed in the\n // active view.\n public static get viewUndoCommand() {\n return new ToolItemDef({\n toolId: ViewUndoTool.toolId,\n isDisabled: new ConditionalBooleanValue(() => {\n const activeContentControl =\n UiFramework.content.getActiveContentControl();\n if (activeContentControl && activeContentControl.viewport)\n return !activeContentControl.viewport.isUndoPossible;\n return false;\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n iconSpec: ViewUndoTool.iconSpec,\n label: ViewUndoTool.flyover,\n description: ViewUndoTool.description,\n execute: async () =>\n IModelApp.tools.run(\n ViewUndoTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get viewRedoCommand() {\n return new ToolItemDef({\n toolId: ViewRedoTool.toolId,\n iconSpec: ViewRedoTool.iconSpec,\n label: ViewRedoTool.flyover,\n description: ViewRedoTool.description,\n execute: async () =>\n IModelApp.tools.run(\n ViewRedoTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n isDisabled: new ConditionalBooleanValue(() => {\n const activeContentControl =\n UiFramework.content.getActiveContentControl();\n if (activeContentControl && activeContentControl.viewport)\n return !activeContentControl.viewport.isRedoPossible;\n return false;\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n });\n }\n\n private static turnOnClipVolume() {\n const vp = IModelApp.viewManager.selectedView;\n if (!vp || !vp.view.is3d()) return;\n\n // Turn on clip volume flag for section tools\n vp.viewFlags = vp.viewFlags.with(\"clipVolume\", true);\n }\n\n // note current ViewClipByPlaneTool is not automatically registered so the app must call ViewClipByPlaneTool.register();\n public static get sectionByPlaneCommandItemDef() {\n return new ToolItemDef({\n toolId: ViewClipByPlaneTool.toolId,\n iconSpec: ViewClipByPlaneTool.iconSpec,\n label: ViewClipByPlaneTool.flyover,\n description: ViewClipByPlaneTool.description,\n execute: async () => {\n this.turnOnClipVolume();\n return IModelApp.tools.run(\n ViewClipByPlaneTool.toolId,\n ViewClipDecorationProvider.create()\n );\n },\n });\n }\n\n // note current ViewClipByElementTool is not automatically registered so the app must call ViewClipByElementTool.register();\n public static get sectionByElementCommandItemDef() {\n return new ToolItemDef({\n toolId: ViewClipByElementTool.toolId,\n iconSpec: ViewClipByElementTool.iconSpec,\n label: ViewClipByElementTool.flyover,\n description: ViewClipByElementTool.description,\n execute: async () => {\n this.turnOnClipVolume();\n return IModelApp.tools.run(\n ViewClipByElementTool.toolId,\n ViewClipDecorationProvider.create()\n );\n },\n });\n }\n\n // note current ViewClipByRangeTool is not automatically registered so the app must call ViewClipByRangeTool.register();\n public static get sectionByRangeCommandItemDef() {\n return new ToolItemDef({\n toolId: ViewClipByRangeTool.toolId,\n iconSpec: ViewClipByRangeTool.iconSpec,\n label: ViewClipByRangeTool.flyover,\n description: ViewClipByRangeTool.description,\n execute: async () => {\n this.turnOnClipVolume();\n return IModelApp.tools.run(\n ViewClipByRangeTool.toolId,\n ViewClipDecorationProvider.create()\n );\n },\n });\n }\n\n // note current ViewClipByShapeTool is not automatically registered so the app must call ViewClipByShapeTool.register();\n public static get sectionByShapeCommandItemDef() {\n return new ToolItemDef({\n toolId: ViewClipByShapeTool.toolId,\n iconSpec: ViewClipByShapeTool.iconSpec,\n label: ViewClipByShapeTool.flyover,\n description: ViewClipByShapeTool.description,\n execute: async () => {\n this.turnOnClipVolume();\n return IModelApp.tools.run(\n ViewClipByShapeTool.toolId,\n ViewClipDecorationProvider.create()\n );\n },\n });\n }\n\n public static get sectionToolGroup() {\n ViewClipByElementTool.register();\n ViewClipByPlaneTool.register();\n ViewClipByRangeTool.register();\n ViewClipByShapeTool.register();\n\n return new GroupItemDef({\n groupId: \"sectionTools-group\",\n labelKey: \"UiFramework:tools.sectionTools\",\n iconSpec: svgSectionTool,\n isHidden: new ConditionalBooleanValue(() => {\n const activeContentControl =\n UiFramework.content.getActiveContentControl();\n return !!activeContentControl?.viewport?.view.is2d();\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n items: [\n this.sectionByPlaneCommandItemDef,\n this.sectionByElementCommandItemDef,\n this.sectionByRangeCommandItemDef,\n this.sectionByShapeCommandItemDef,\n ],\n itemsInColumn: 4,\n });\n }\n\n public static get sectionToolGroupWithPanel() {\n ViewClipByElementTool.register();\n ViewClipByPlaneTool.register();\n ViewClipByRangeTool.register();\n ViewClipByShapeTool.register();\n\n return new GroupItemDef({\n groupId: \"sectionTools-group-with-panel\",\n labelKey: \"UiFramework:tools.sectionTools\",\n panelLabelKey: \"UiFramework:tools.sectionPanelLabel\",\n iconSpec: svgSectionTool,\n isHidden: new ConditionalBooleanValue(() => {\n const activeContentControl =\n UiFramework.content.getActiveContentControl();\n return !!activeContentControl?.viewport?.view.is2d();\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n items: [\n new ToolItemDef({\n ...this.sectionByPlaneCommandItemDef,\n labelKey: \"UiFramework:tools.sectionByPlane\",\n }),\n new ToolItemDef({\n ...this.sectionByElementCommandItemDef,\n labelKey: \"UiFramework:tools.sectionByElement\",\n }),\n new ToolItemDef({\n ...this.sectionByRangeCommandItemDef,\n labelKey: \"UiFramework:tools.sectionByRange\",\n }),\n new ToolItemDef({\n ...this.sectionByShapeCommandItemDef,\n labelKey: \"UiFramework:tools.sectionByShape\",\n }),\n ],\n itemsInColumn: 4,\n });\n }\n\n // note current MeasureDistanceTool is not automatically registered so the app must call MeasureDistanceTool.register();\n public static get measureDistanceToolItemDef() {\n return new ToolItemDef({\n toolId: MeasureDistanceTool.toolId,\n iconSpec: MeasureDistanceTool.iconSpec,\n label: MeasureDistanceTool.flyover,\n description: MeasureDistanceTool.description,\n execute: async () => {\n return IModelApp.tools.run(MeasureDistanceTool.toolId);\n },\n });\n }\n\n // note current MeasureLocationTool is not automatically registered so the app must call MeasureLocationTool.register();\n public static get measureLocationToolItemDef() {\n return new ToolItemDef({\n toolId: MeasureLocationTool.toolId,\n iconSpec: MeasureLocationTool.iconSpec,\n label: MeasureLocationTool.flyover,\n description: MeasureLocationTool.description,\n execute: async () => {\n return IModelApp.tools.run(MeasureLocationTool.toolId);\n },\n });\n }\n\n public static get measureToolGroup() {\n MeasureDistanceTool.register();\n MeasureLocationTool.register();\n\n return new GroupItemDef({\n groupId: \"measureTools-group\",\n labelKey: \"UiFramework:tools.measureTools\",\n iconSpec: <SvgMeasure />,\n items: [this.measureDistanceToolItemDef, this.measureLocationToolItemDef],\n itemsInColumn: 2,\n });\n }\n\n public static get clearSelectionItemDef() {\n return new CommandItemDef({\n commandId: \"UiFramework.ClearSelection\",\n iconSpec: svgSelectionClear,\n labelKey: \"UiFramework:buttons.clearSelection\",\n isHidden: getIsHiddenIfSelectionNotActive(),\n execute: async () => {\n const iModelConnection = UiFramework.getIModelConnection();\n if (iModelConnection) {\n iModelConnection.selectionSet.emptyAll();\n }\n const tool = IModelApp.toolAdmin.primitiveTool;\n if (tool) await tool.onRestartTool();\n else await IModelApp.toolAdmin.startDefaultTool();\n },\n });\n }\n\n public static get restoreFrontstageLayoutCommandItemDef() {\n return new ToolItemDef({\n toolId: RestoreFrontstageLayoutTool.toolId,\n iconSpec: RestoreFrontstageLayoutTool.iconSpec,\n label: RestoreFrontstageLayoutTool.flyover,\n description: RestoreFrontstageLayoutTool.description,\n execute: async () => {\n return IModelApp.tools.run(RestoreFrontstageLayoutTool.toolId);\n },\n });\n }\n}\n"]}
1
+ {"version":3,"file":"CoreToolDefinitions.js","sourceRoot":"","sources":["../../../../src/appui-react/tools/CoreToolDefinitions.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC,CAAC,6BAA6B;AAC7D,OAAO,EACL,WAAW,EACX,WAAW,EACX,SAAS,EACT,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACX,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,0BAA0B,EAC1B,YAAY,EACZ,oBAAoB,EACpB,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,YAAY,GACb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,mBAAmB,MAAM,iDAAiD,CAAC;AAClF,OAAO,2BAA2B,MAAM,0DAA0D,CAAC;AACnG,OAAO,YAAY,MAAM,4CAA4C,CAAC;AACtE,OAAO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AC,SAAS,CAAC,aAAa,CAAC;gBAC/C,IAAI,IAAI;oBAAE,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;;oBAChC,MAAM,SAAS,CAAC,SAAS,CAAC,gBAAgB,EAAE,CAAC;YACpD,CAAC;SACF,CAAC,CAAC;IACL,CAAC;IAEM,MAAM,KAAK,qCAAqC;QACrD,OAAO,IAAI,WAAW,CAAC;YACrB,MAAM,EAAE,2BAA2B,CAAC,MAAM;YAC1C,QAAQ,EAAE,2BAA2B,CAAC,QAAQ;YAC9C,KAAK,EAAE,2BAA2B,CAAC,OAAO;YAC1C,WAAW,EAAE,2BAA2B,CAAC,WAAW;YACpD,OAAO,EAAE,KAAK,IAAI,EAAE;gBAClB,OAAO,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAC;YACjE,CAAC;SACF,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tools\n */\n\nimport * as React from \"react\"; // cSpell:ignore keyinbrowser\nimport {\n FitViewTool,\n FlyViewTool,\n IModelApp,\n MeasureDistanceTool,\n MeasureLocationTool,\n PanViewTool,\n RotateViewTool,\n SelectionTool,\n SetupWalkCameraTool,\n ViewClipByElementTool,\n ViewClipByPlaneTool,\n ViewClipByRangeTool,\n ViewClipByShapeTool,\n ViewClipDecorationProvider,\n ViewRedoTool,\n ViewToggleCameraTool,\n ViewUndoTool,\n WalkViewTool,\n WindowAreaTool,\n ZoomViewTool,\n} from \"@itwin/core-frontend\";\nimport {\n ConditionalBooleanValue,\n ConditionalStringValue,\n} from \"@itwin/appui-abstract\";\nimport { getIsHiddenIfSelectionNotActive } from \"../selection/SelectionContextItemDef\";\nimport { CommandItemDef } from \"../shared/CommandItemDef\";\nimport { ToolItemDef } from \"../shared/ToolItemDef\";\nimport { SyncUiEventId } from \"../syncui/SyncUiEventDispatcher\";\nimport { GroupItemDef } from \"../toolbar/GroupItem\";\nimport { RestoreFrontstageLayoutTool } from \"./RestoreLayoutTool\";\nimport { UiFramework } from \"../UiFramework\";\nimport cameraAnimationIcon from \"@itwin/itwinui-icons/icons/camera-animation.svg\";\nimport cameraAnimationDisabledIcon from \"@itwin/itwinui-icons/icons/camera-animation-disabled.svg\";\nimport svgGyroscope from \"@bentley/icons-generic/icons/gyroscope.svg\";\nimport svgRotateLeft from \"@bentley/icons-generic/icons/rotate-left.svg\";\nimport svgSectionTool from \"@bentley/icons-generic/icons/section-tool.svg\";\nimport svgSelectionClear from \"@bentley/icons-generic/icons/selection-clear.svg\";\nimport { SvgMeasure, SvgProcess } from \"@itwin/itwinui-icons-react\";\n\n/** Utility Class that provides definitions of tools provided by the ($core-frontend) core. These definitions can be used to populate the UI.\n * @public\n */\n// istanbul ignore next\nexport class CoreTools {\n public static get keyinPaletteButtonItemDef() {\n return new ToolItemDef({\n toolId: \"uif:keyinpalette\",\n iconSpec: <SvgProcess />,\n labelKey: \"UiFramework:keyinbrowser.label\",\n execute: () => {\n IModelApp.uiAdmin.showKeyinPalette();\n },\n });\n }\n\n public static get fitViewCommand() {\n return new ToolItemDef({\n toolId: FitViewTool.toolId,\n iconSpec: FitViewTool.iconSpec,\n label: FitViewTool.flyover,\n description: FitViewTool.description,\n execute: async () =>\n IModelApp.tools.run(\n FitViewTool.toolId,\n IModelApp.viewManager.selectedView,\n true\n ),\n });\n }\n\n public static get windowAreaCommand() {\n return new ToolItemDef({\n toolId: WindowAreaTool.toolId,\n iconSpec: WindowAreaTool.iconSpec,\n label: WindowAreaTool.flyover,\n description: WindowAreaTool.description,\n execute: async () =>\n IModelApp.tools.run(\n WindowAreaTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get zoomViewCommand() {\n return new ToolItemDef({\n toolId: ZoomViewTool.toolId,\n iconSpec: ZoomViewTool.iconSpec,\n label: ZoomViewTool.flyover,\n description: ZoomViewTool.description,\n execute: async () =>\n IModelApp.tools.run(\n ZoomViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get panViewCommand() {\n return new ToolItemDef({\n toolId: PanViewTool.toolId,\n iconSpec: PanViewTool.iconSpec,\n label: PanViewTool.flyover,\n description: PanViewTool.description,\n execute: async () =>\n IModelApp.tools.run(\n PanViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get rotateViewCommand() {\n return new ToolItemDef({\n toolId: RotateViewTool.toolId,\n iconSpec: new ConditionalStringValue(() => {\n const activeContentControl =\n UiFramework.content.getActiveContentControl();\n if (activeContentControl?.viewport?.view.is2d()) return svgRotateLeft;\n return svgGyroscope;\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n label: RotateViewTool.flyover,\n description: RotateViewTool.description,\n execute: async () =>\n IModelApp.tools.run(\n RotateViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get walkViewCommand() {\n return new ToolItemDef({\n toolId: WalkViewTool.toolId,\n iconSpec: WalkViewTool.iconSpec,\n label: WalkViewTool.flyover,\n description: WalkViewTool.description,\n isHidden: new ConditionalBooleanValue(() => {\n const activeContentControl =\n UiFramework.content.getActiveContentControl();\n return !!activeContentControl?.viewport?.view.is2d();\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n execute: async () =>\n IModelApp.tools.run(\n WalkViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get selectElementCommand() {\n return new ToolItemDef({\n toolId: SelectionTool.toolId,\n iconSpec: SelectionTool.iconSpec,\n label: SelectionTool.flyover,\n description: SelectionTool.description,\n execute: async () => IModelApp.tools.run(SelectionTool.toolId),\n });\n }\n\n public static get setupCameraWalkTool() {\n return new ToolItemDef({\n toolId: SetupWalkCameraTool.toolId,\n iconSpec: SetupWalkCameraTool.iconSpec,\n label: SetupWalkCameraTool.flyover,\n description: SetupWalkCameraTool.description,\n execute: async () => IModelApp.tools.run(SetupWalkCameraTool.toolId),\n });\n }\n\n public static get toggleCameraViewCommand() {\n return new ToolItemDef({\n toolId: ViewToggleCameraTool.toolId,\n iconSpec: new ConditionalStringValue(() => {\n const activeContentControl =\n UiFramework.content.getActiveContentControl();\n if (\n activeContentControl?.viewport?.view.is3d() &&\n activeContentControl?.viewport?.isCameraOn\n ) {\n return cameraAnimationIcon;\n }\n return cameraAnimationDisabledIcon;\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n label: new ConditionalStringValue(() => {\n const activeContentControl =\n UiFramework.content.getActiveContentControl();\n if (\n activeContentControl?.viewport?.view.is3d() &&\n activeContentControl?.viewport?.isCameraOn\n ) {\n return UiFramework.translate(\n \"tools.View.ToggleCamera.turnOffFlyover\"\n );\n }\n return UiFramework.translate(\"tools.View.ToggleCamera.turnOnFlyover\");\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n description: ViewToggleCameraTool.description,\n isHidden: new ConditionalBooleanValue(() => {\n const activeContentControl =\n UiFramework.content.getActiveContentControl();\n return !(\n activeContentControl?.viewport?.view.is3d() &&\n activeContentControl?.viewport?.view.supportsCamera()\n );\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n execute: async () =>\n IModelApp.tools.run(\n ViewToggleCameraTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get flyViewCommand() {\n return new ToolItemDef({\n toolId: FlyViewTool.toolId,\n iconSpec: FlyViewTool.iconSpec,\n label: FlyViewTool.flyover,\n description: FlyViewTool.description,\n execute: async () =>\n IModelApp.tools.run(\n FlyViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n // TODO - Need to provide a sync message that is fired when the Undo/Redo button needs to be refreshed in the\n // active view.\n public static get viewUndoCommand() {\n return new ToolItemDef({\n toolId: ViewUndoTool.toolId,\n isDisabled: new ConditionalBooleanValue(() => {\n const activeContentControl =\n UiFramework.content.getActiveContentControl();\n if (activeContentControl && activeContentControl.viewport)\n return !activeContentControl.viewport.isUndoPossible;\n return false;\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n iconSpec: ViewUndoTool.iconSpec,\n label: ViewUndoTool.flyover,\n description: ViewUndoTool.description,\n execute: async () =>\n IModelApp.tools.run(\n ViewUndoTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get viewRedoCommand() {\n return new ToolItemDef({\n toolId: ViewRedoTool.toolId,\n iconSpec: ViewRedoTool.iconSpec,\n label: ViewRedoTool.flyover,\n description: ViewRedoTool.description,\n execute: async () =>\n IModelApp.tools.run(\n ViewRedoTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n isDisabled: new ConditionalBooleanValue(() => {\n const activeContentControl =\n UiFramework.content.getActiveContentControl();\n if (activeContentControl && activeContentControl.viewport)\n return !activeContentControl.viewport.isRedoPossible;\n return false;\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n });\n }\n\n private static turnOnClipVolume() {\n const vp = IModelApp.viewManager.selectedView;\n if (!vp || !vp.view.is3d()) return;\n\n // Turn on clip volume flag for section tools\n vp.viewFlags = vp.viewFlags.with(\"clipVolume\", true);\n }\n\n // note current ViewClipByPlaneTool is not automatically registered so the app must call ViewClipByPlaneTool.register();\n public static get sectionByPlaneCommandItemDef() {\n return new ToolItemDef({\n toolId: ViewClipByPlaneTool.toolId,\n iconSpec: ViewClipByPlaneTool.iconSpec,\n label: ViewClipByPlaneTool.flyover,\n description: ViewClipByPlaneTool.description,\n execute: async () => {\n this.turnOnClipVolume();\n return IModelApp.tools.run(\n ViewClipByPlaneTool.toolId,\n ViewClipDecorationProvider.create()\n );\n },\n });\n }\n\n // note current ViewClipByElementTool is not automatically registered so the app must call ViewClipByElementTool.register();\n public static get sectionByElementCommandItemDef() {\n return new ToolItemDef({\n toolId: ViewClipByElementTool.toolId,\n iconSpec: ViewClipByElementTool.iconSpec,\n label: ViewClipByElementTool.flyover,\n description: ViewClipByElementTool.description,\n execute: async () => {\n this.turnOnClipVolume();\n return IModelApp.tools.run(\n ViewClipByElementTool.toolId,\n ViewClipDecorationProvider.create()\n );\n },\n });\n }\n\n // note current ViewClipByRangeTool is not automatically registered so the app must call ViewClipByRangeTool.register();\n public static get sectionByRangeCommandItemDef() {\n return new ToolItemDef({\n toolId: ViewClipByRangeTool.toolId,\n iconSpec: ViewClipByRangeTool.iconSpec,\n label: ViewClipByRangeTool.flyover,\n description: ViewClipByRangeTool.description,\n execute: async () => {\n this.turnOnClipVolume();\n return IModelApp.tools.run(\n ViewClipByRangeTool.toolId,\n ViewClipDecorationProvider.create()\n );\n },\n });\n }\n\n // note current ViewClipByShapeTool is not automatically registered so the app must call ViewClipByShapeTool.register();\n public static get sectionByShapeCommandItemDef() {\n return new ToolItemDef({\n toolId: ViewClipByShapeTool.toolId,\n iconSpec: ViewClipByShapeTool.iconSpec,\n label: ViewClipByShapeTool.flyover,\n description: ViewClipByShapeTool.description,\n execute: async () => {\n this.turnOnClipVolume();\n return IModelApp.tools.run(\n ViewClipByShapeTool.toolId,\n ViewClipDecorationProvider.create()\n );\n },\n });\n }\n\n public static get sectionToolGroup() {\n ViewClipByElementTool.register();\n ViewClipByPlaneTool.register();\n ViewClipByRangeTool.register();\n ViewClipByShapeTool.register();\n\n return new GroupItemDef({\n groupId: \"sectionTools-group\",\n labelKey: \"UiFramework:tools.sectionTools\",\n iconSpec: svgSectionTool,\n isHidden: new ConditionalBooleanValue(() => {\n const activeContentControl =\n UiFramework.content.getActiveContentControl();\n return !!activeContentControl?.viewport?.view.is2d();\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n items: [\n this.sectionByPlaneCommandItemDef,\n this.sectionByElementCommandItemDef,\n this.sectionByRangeCommandItemDef,\n this.sectionByShapeCommandItemDef,\n ],\n itemsInColumn: 4,\n });\n }\n\n public static get sectionToolGroupWithPanel() {\n ViewClipByElementTool.register();\n ViewClipByPlaneTool.register();\n ViewClipByRangeTool.register();\n ViewClipByShapeTool.register();\n\n return new GroupItemDef({\n groupId: \"sectionTools-group-with-panel\",\n labelKey: \"UiFramework:tools.sectionTools\",\n panelLabelKey: \"UiFramework:tools.sectionPanelLabel\",\n iconSpec: svgSectionTool,\n isHidden: new ConditionalBooleanValue(() => {\n const activeContentControl =\n UiFramework.content.getActiveContentControl();\n return !!activeContentControl?.viewport?.view.is2d();\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n items: [\n new ToolItemDef({\n ...this.sectionByPlaneCommandItemDef,\n labelKey: \"UiFramework:tools.sectionByPlane\",\n }),\n new ToolItemDef({\n ...this.sectionByElementCommandItemDef,\n labelKey: \"UiFramework:tools.sectionByElement\",\n }),\n new ToolItemDef({\n ...this.sectionByRangeCommandItemDef,\n labelKey: \"UiFramework:tools.sectionByRange\",\n }),\n new ToolItemDef({\n ...this.sectionByShapeCommandItemDef,\n labelKey: \"UiFramework:tools.sectionByShape\",\n }),\n ],\n itemsInColumn: 4,\n });\n }\n\n // note current MeasureDistanceTool is not automatically registered so the app must call MeasureDistanceTool.register();\n public static get measureDistanceToolItemDef() {\n return new ToolItemDef({\n toolId: MeasureDistanceTool.toolId,\n iconSpec: MeasureDistanceTool.iconSpec,\n label: MeasureDistanceTool.flyover,\n description: MeasureDistanceTool.description,\n execute: async () => {\n return IModelApp.tools.run(MeasureDistanceTool.toolId);\n },\n });\n }\n\n // note current MeasureLocationTool is not automatically registered so the app must call MeasureLocationTool.register();\n public static get measureLocationToolItemDef() {\n return new ToolItemDef({\n toolId: MeasureLocationTool.toolId,\n iconSpec: MeasureLocationTool.iconSpec,\n label: MeasureLocationTool.flyover,\n description: MeasureLocationTool.description,\n execute: async () => {\n return IModelApp.tools.run(MeasureLocationTool.toolId);\n },\n });\n }\n\n public static get measureToolGroup() {\n MeasureDistanceTool.register();\n MeasureLocationTool.register();\n\n return new GroupItemDef({\n groupId: \"measureTools-group\",\n labelKey: \"UiFramework:tools.measureTools\",\n iconSpec: <SvgMeasure />,\n items: [this.measureDistanceToolItemDef, this.measureLocationToolItemDef],\n itemsInColumn: 2,\n });\n }\n\n public static get clearSelectionItemDef() {\n return new CommandItemDef({\n commandId: \"UiFramework.ClearSelection\",\n iconSpec: svgSelectionClear,\n labelKey: \"UiFramework:buttons.clearSelection\",\n isHidden: getIsHiddenIfSelectionNotActive(),\n execute: async () => {\n const iModelConnection = UiFramework.getIModelConnection();\n if (iModelConnection) {\n iModelConnection.selectionSet.emptyAll();\n }\n const tool = IModelApp.toolAdmin.primitiveTool;\n if (tool) await tool.onRestartTool();\n else await IModelApp.toolAdmin.startDefaultTool();\n },\n });\n }\n\n public static get restoreFrontstageLayoutCommandItemDef() {\n return new ToolItemDef({\n toolId: RestoreFrontstageLayoutTool.toolId,\n iconSpec: RestoreFrontstageLayoutTool.iconSpec,\n label: RestoreFrontstageLayoutTool.flyover,\n description: RestoreFrontstageLayoutTool.description,\n execute: async () => {\n return IModelApp.tools.run(RestoreFrontstageLayoutTool.toolId);\n },\n });\n }\n}\n"]}
@@ -12,7 +12,7 @@ import { ToolAdmin } from "@itwin/core-frontend";
12
12
  * toolAdmin: new FrameworkToolAdmin()
13
13
  * });
14
14
  * ```
15
- * @alpha
15
+ * @beta
16
16
  */
17
17
  export declare class FrameworkToolAdmin extends ToolAdmin {
18
18
  /** Process shortcut key events */
@@ -18,7 +18,7 @@ import { UiFramework } from "../UiFramework";
18
18
  * toolAdmin: new FrameworkToolAdmin()
19
19
  * });
20
20
  * ```
21
- * @alpha
21
+ * @beta
22
22
  */
23
23
  export class FrameworkToolAdmin extends ToolAdmin {
24
24
  /** Process shortcut key events */
@@ -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,gBAAgB,CAAC;AAE7C;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,kBAAmB,SAAQ,SAAS;IAC/C,kCAAkC;IAClB,KAAK,CAAC,kBAAkB,CACtC,CAAgB,EAChB,QAAiB;QAEjB,IAAI,OAAO,GAAG,KAAK,CAAC;QAEpB,IAAI,QAAQ,IAAI,CAAC,WAAW,CAAC,iBAAiB,EAAE;YAC9C,IAAI,WAAW,CAAC,iBAAiB,CAAC,aAAa,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,MAAM,EAAE;gBACvE,WAAW,CAAC,iBAAiB,CAAC,UAAU,CACtC,CAAC,CAAC,GAAG,EACL,CAAC,CAAC,MAAM,EACR,CAAC,CAAC,OAAO,EACT,CAAC,CAAC,QAAQ,CACX,CAAC;gBACF,OAAO,GAAG,IAAI,CAAC;aAChB;SACF;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tools\n */\n\nimport { Key } from \"ts-key-enum\";\nimport { ToolAdmin } from \"@itwin/core-frontend\";\nimport { UiFramework } from \"../UiFramework\";\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 * @alpha\n */\nexport class FrameworkToolAdmin extends ToolAdmin {\n /** Process shortcut key events */\n public override async processShortcutKey(\n e: KeyboardEvent,\n wentDown: boolean\n ): Promise<boolean> {\n let handled = false;\n\n if (wentDown && !UiFramework.isContextMenuOpen) {\n if (UiFramework.keyboardShortcuts.isFocusOnHome && e.key !== Key.Escape) {\n UiFramework.keyboardShortcuts.processKey(\n e.key,\n e.altKey,\n e.ctrlKey,\n e.shiftKey\n );\n handled = true;\n }\n }\n\n return handled;\n }\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,gBAAgB,CAAC;AAE7C;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,kBAAmB,SAAQ,SAAS;IAC/C,kCAAkC;IAClB,KAAK,CAAC,kBAAkB,CACtC,CAAgB,EAChB,QAAiB;QAEjB,IAAI,OAAO,GAAG,KAAK,CAAC;QAEpB,IAAI,QAAQ,IAAI,CAAC,WAAW,CAAC,iBAAiB,EAAE;YAC9C,IAAI,WAAW,CAAC,iBAAiB,CAAC,aAAa,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,MAAM,EAAE;gBACvE,WAAW,CAAC,iBAAiB,CAAC,UAAU,CACtC,CAAC,CAAC,GAAG,EACL,CAAC,CAAC,MAAM,EACR,CAAC,CAAC,OAAO,EACT,CAAC,CAAC,QAAQ,CACX,CAAC;gBACF,OAAO,GAAG,IAAI,CAAC;aAChB;SACF;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tools\n */\n\nimport { Key } from \"ts-key-enum\";\nimport { ToolAdmin } from \"@itwin/core-frontend\";\nimport { UiFramework } from \"../UiFramework\";\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 * @beta\n */\nexport class FrameworkToolAdmin extends ToolAdmin {\n /** Process shortcut key events */\n public override async processShortcutKey(\n e: KeyboardEvent,\n wentDown: boolean\n ): Promise<boolean> {\n let handled = false;\n\n if (wentDown && !UiFramework.isContextMenuOpen) {\n if (UiFramework.keyboardShortcuts.isFocusOnHome && e.key !== Key.Escape) {\n UiFramework.keyboardShortcuts.processKey(\n e.key,\n e.altKey,\n e.ctrlKey,\n e.shiftKey\n );\n handled = true;\n }\n }\n\n return handled;\n }\n}\n"]}
@@ -20,10 +20,9 @@ class ToolSettingsUiDataProvider extends UiLayoutDataProvider {
20
20
  super(...arguments);
21
21
  // send property changes from UI back to tool
22
22
  this.applyUiPropertyChange = (syncItem) => {
23
+ var _a;
23
24
  // istanbul ignore next
24
- IModelApp.toolAdmin.activeTool
25
- ?.applyToolSettingPropertyChange(syncItem)
26
- .catch((err) => UnexpectedErrors.handle(err));
25
+ (_a = IModelApp.toolAdmin.activeTool) === null || _a === void 0 ? void 0 : _a.applyToolSettingPropertyChange(syncItem).catch((err) => UnexpectedErrors.handle(err));
27
26
  };
28
27
  }
29
28
  supplyDialogItems() {
@@ -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,kCAAkC,CAAC;AACtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AAEtF,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,gBAAgB;AAEhB,yEAAyE;AACzE,MAAM,0BAA2B,SAAQ,oBAAoB;IAA7D;;QAKE,6CAA6C;QAC7B,0BAAqB,GAAG,CACtC,QAAgC,EAChC,EAAE;YACF,uBAAuB;YACvB,SAAS,CAAC,SAAS,CAAC,UAAU;gBAC5B,EAAE,8BAA8B,CAAC,QAAQ,CAAC;iBACzC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,gBAAgB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QAClD,CAAC,CAAC;IACJ,CAAC;IAbiB,iBAAiB;QAC/B,OAAO,WAAW,CAAC,YAAY,CAAC,sBAAsB,CAAC;IACzD,CAAC;CAWF;AAED;;GAEG;AACH,MAAM,OAAO,2BAA4B,SAAQ,cAAc;IAC7D,YAAY,IAA4B,EAAE,OAAY;QACpD,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACrB,IAAI,CAAC,aAAa,GAAG,IAAI,0BAA0B,EAAE,CAAC;IACxD,CAAC;IAED,IAAW,cAAc;QACvB,OAAO,IAAI,CAAC,aAA2C,CAAC;IAC1D,CAAC;IAEM,uBAAuB;QAC5B,uBAAuB;QACvB,IAAI,IAAI,CAAC,cAAc,CAAC,gBAAgB,EAAE,EAAE;YAC1C,MAAM,kBAAkB,GAAG,IAAI,kBAAkB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YAEvE,IAAI,CAAC,gBAAgB,GAAG,CACtB,oBAAC,0BAA0B,IACzB,kBAAkB,EAAE,kBAAkB,EACtC,cAAc,EAAE,IAAI,GACpB,CACH,CAAC;YACF,IAAI,CAAC,0BAA0B;gBAC7B,kBAAkB,CAAC,sBAAsB,EAAE,CAAC;SAC/C;aAAM;YACL,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;YAC7B,IAAI,CAAC,0BAA0B,GAAG,EAAE,CAAC;SACtC;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;QAEzC,IAAI,CAAC,cAAc,CAAC,uBAAuB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACnE,CAAC;CACF;AAED,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAC3B,qBAAqB,EACrB,2BAA2B,CAC5B,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 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\";\nimport { ComponentGenerator } from \"../uiprovider/ComponentGenerator\";\nimport { DefaultDialogGridContainer } from \"../uiprovider/DefaultDialogGridContainer\";\nimport type { SyncToolSettingsPropertiesEventArgs } from \"../framework/FrameworkToolSettings\";\nimport { ToolUiProvider } from \"./ToolUiProvider\";\nimport { UiFramework } from \"../UiFramework\";\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 // istanbul ignore next\n IModelApp.toolAdmin.activeTool\n ?.applyToolSettingPropertyChange(syncItem)\n .catch((err) => UnexpectedErrors.handle(err));\n };\n}\n\n/** ToolUiProvider class that informs ConfigurableUi that Tool Settings are provided for the specified tool.\n * @internal\n */\nexport class DefaultToolSettingsProvider extends ToolUiProvider {\n constructor(info: ConfigurableCreateInfo, options: any) {\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 // istanbul ignore else\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\n ): void {\n this.uiDataProvider.fireSyncPropertiesEvent(args.syncProperties);\n }\n}\n\nUiFramework.controls.register(\n \"DefaultToolSettings\",\n DefaultToolSettingsProvider\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,kCAAkC,CAAC;AACtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AAEtF,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,gBAAgB;AAEhB,yEAAyE;AACzE,MAAM,0BAA2B,SAAQ,oBAAoB;IAA7D;;QAKE,6CAA6C;QAC7B,0BAAqB,GAAG,CACtC,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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;QAEzC,IAAI,CAAC,cAAc,CAAC,uBAAuB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACnE,CAAC;CACF;AAED,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAC3B,qBAAqB,EACrB,2BAA2B,CAC5B,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 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\";\nimport { ComponentGenerator } from \"../uiprovider/ComponentGenerator\";\nimport { DefaultDialogGridContainer } from \"../uiprovider/DefaultDialogGridContainer\";\nimport type { SyncToolSettingsPropertiesEventArgs } from \"../framework/FrameworkToolSettings\";\nimport { ToolUiProvider } from \"./ToolUiProvider\";\nimport { UiFramework } from \"../UiFramework\";\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 // istanbul ignore next\n IModelApp.toolAdmin.activeTool\n ?.applyToolSettingPropertyChange(syncItem)\n .catch((err) => UnexpectedErrors.handle(err));\n };\n}\n\n/** ToolUiProvider class that informs ConfigurableUi that Tool Settings are provided for the specified tool.\n * @internal\n */\nexport class DefaultToolSettingsProvider extends ToolUiProvider {\n constructor(info: ConfigurableCreateInfo, options: any) {\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 // istanbul ignore else\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\n ): void {\n this.uiDataProvider.fireSyncPropertiesEvent(args.syncProperties);\n }\n}\n\nUiFramework.controls.register(\n \"DefaultToolSettings\",\n DefaultToolSettingsProvider\n);\n"]}
@@ -94,10 +94,11 @@ class AbstractUiItemsManagerAdapter {
94
94
  const abstractItems = this._adaptee.getToolbarButtonItems(stageId, stageUsage, usage, orientation);
95
95
  // @ts-ignore Possibly 'any'
96
96
  const items = abstractItems.map((abstractItem) => {
97
+ var _a;
97
98
  const item = fromAbstractToolbarItem(abstractItem);
98
99
  return {
99
100
  ...item,
100
- providerId: abstractItem.providerId ?? "",
101
+ providerId: (_a = abstractItem.providerId) !== null && _a !== void 0 ? _a : "",
101
102
  };
102
103
  });
103
104
  return items;
@@ -126,10 +127,11 @@ class AbstractUiItemsManagerAdapter {
126
127
  const widgets = abstractWidgets
127
128
  // @ts-ignore Possibly 'any'
128
129
  .map((abstractWidget) => {
130
+ var _a;
129
131
  const widget = fromAbstractWidget(abstractWidget);
130
132
  return {
131
133
  ...widget,
132
- providerId: abstractWidget.providerId ?? "",
134
+ providerId: (_a = abstractWidget.providerId) !== null && _a !== void 0 ? _a : "",
133
135
  };
134
136
  });
135
137
  return widgets;
@@ -305,12 +307,11 @@ function toAbstractToolbarItem(item) {
305
307
  return abstractItem;
306
308
  }
307
309
  function toAbstractWidget(widget) {
310
+ var _a, _b;
308
311
  let abstractWidget = getOriginalData(widget);
309
312
  if (abstractWidget)
310
313
  return abstractWidget;
311
- const allowedPanelTargets = widget.allowedPanels
312
- // @ts-ignore Possibly 'any'
313
- ?.map((location) => {
314
+ const allowedPanelTargets = (_a = widget.allowedPanels) === null || _a === void 0 ? void 0 : _a.map((location) => {
314
315
  const map = {
315
316
  [StagePanelLocation.Top]: "top",
316
317
  [StagePanelLocation.Left]: "left",
@@ -324,7 +325,7 @@ function toAbstractWidget(widget) {
324
325
  const icon = IconHelper.getIconData(widget.icon, internalData);
325
326
  abstractWidget = {
326
327
  ...widget,
327
- id: widget.id ?? "",
328
+ id: (_b = widget.id) !== null && _b !== void 0 ? _b : "",
328
329
  getWidgetContent: () => widget.content,
329
330
  allowedPanelTargets,
330
331
  badgeType: widget.badge,
@@ -413,12 +414,11 @@ function fromAbstractToolbarItem(abstractItem) {
413
414
  return item;
414
415
  }
415
416
  function fromAbstractWidget(abstractWidget) {
417
+ var _a, _b;
416
418
  let widget = getOriginalData(abstractWidget);
417
419
  if (widget)
418
420
  return widget;
419
- const allowedPanels = abstractWidget.allowedPanelTargets
420
- // @ts-ignore Possibly 'any'
421
- ?.map((target) => {
421
+ const allowedPanels = (_a = abstractWidget.allowedPanelTargets) === null || _a === void 0 ? void 0 : _a.map((target) => {
422
422
  const map = {
423
423
  top: StagePanelLocation.Top,
424
424
  left: StagePanelLocation.Left,
@@ -431,7 +431,7 @@ function fromAbstractWidget(abstractWidget) {
431
431
  const icon = fromAbstractIcon(abstractWidget.icon, abstractWidget.internalData);
432
432
  widget = {
433
433
  ...abstractWidget,
434
- id: abstractWidget.id ?? "",
434
+ id: (_b = abstractWidget.id) !== null && _b !== void 0 ? _b : "",
435
435
  content: abstractWidget.getWidgetContent(),
436
436
  allowedPanels,
437
437
  badge: abstractWidget.badgeType,
@@ -520,36 +520,38 @@ export function createGetPropertyAdapter(provider) {
520
520
  return {
521
521
  ...provider,
522
522
  provideBackstageItems: () => {
523
- return (provider.getBackstageItems?.() ??
524
- provider.provideBackstageItems?.() ??
525
- []);
523
+ var _a, _b, _c, _d;
524
+ return ((_d = (_b = (_a = provider.getBackstageItems) === null || _a === void 0 ? void 0 : _a.call(provider)) !== null && _b !== void 0 ? _b : (_c = provider.provideBackstageItems) === null || _c === void 0 ? void 0 : _c.call(provider)) !== null && _d !== void 0 ? _d : []);
526
525
  },
527
526
  provideStatusBarItems: (stageId, stageUsage) => {
528
- return (provider.getStatusBarItems?.() ??
529
- provider.provideStatusBarItems?.(stageId, stageUsage) ??
530
- []);
527
+ var _a, _b, _c, _d;
528
+ return ((_d = (_b = (_a = provider.getStatusBarItems) === null || _a === void 0 ? void 0 : _a.call(provider)) !== null && _b !== void 0 ? _b : (_c = provider.provideStatusBarItems) === null || _c === void 0 ? void 0 : _c.call(provider, stageId, stageUsage)) !== null && _d !== void 0 ? _d : []);
531
529
  },
532
530
  provideToolbarItems: (stageId, stageUsage, usage, orientation) => {
531
+ var _a, _b;
533
532
  if (provider.getToolbarItems) {
534
533
  return provider.getToolbarItems().filter((item) => {
535
- const layout = item.layouts?.standard;
534
+ var _a;
535
+ const layout = (_a = item.layouts) === null || _a === void 0 ? void 0 : _a.standard;
536
536
  if (!layout)
537
537
  return false;
538
538
  return layout.usage === usage && layout.orientation === orientation;
539
539
  });
540
540
  }
541
- return (provider.provideToolbarItems?.(stageId, stageUsage, usage, orientation) ?? []);
541
+ return ((_b = (_a = provider.provideToolbarItems) === null || _a === void 0 ? void 0 : _a.call(provider, stageId, stageUsage, usage, orientation)) !== null && _b !== void 0 ? _b : []);
542
542
  },
543
543
  provideWidgets: (stageId, stageUsage, location, section) => {
544
+ var _a, _b;
544
545
  if (provider.getWidgets) {
545
546
  return provider.getWidgets().filter((item) => {
546
- const layout = item.layouts?.standard;
547
+ var _a;
548
+ const layout = (_a = item.layouts) === null || _a === void 0 ? void 0 : _a.standard;
547
549
  if (!layout)
548
550
  return false;
549
551
  return layout.location === location && layout.section === section;
550
552
  });
551
553
  }
552
- return (provider.provideWidgets?.(stageId, stageUsage, location, section) ?? []);
554
+ return ((_b = (_a = provider.provideWidgets) === null || _a === void 0 ? void 0 : _a.call(provider, stageId, stageUsage, location, section)) !== null && _b !== void 0 ? _b : []);
553
555
  },
554
556
  };
555
557
  }