@itwin/appui-react 4.6.4 → 4.7.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 (405) hide show
  1. package/CHANGELOG.md +19 -3
  2. package/lib/cjs/appui-react/UiFramework.d.ts +29 -14
  3. package/lib/cjs/appui-react/UiFramework.d.ts.map +1 -1
  4. package/lib/cjs/appui-react/UiFramework.js +28 -15
  5. package/lib/cjs/appui-react/UiFramework.js.map +1 -1
  6. package/lib/cjs/appui-react/accudraw/AccuDrawFieldContainer.d.ts.map +1 -1
  7. package/lib/cjs/appui-react/accudraw/AccuDrawFieldContainer.js +4 -7
  8. package/lib/cjs/appui-react/accudraw/AccuDrawFieldContainer.js.map +1 -1
  9. package/lib/cjs/appui-react/accudraw/AccuDrawInputField.d.ts.map +1 -1
  10. package/lib/cjs/appui-react/accudraw/AccuDrawInputField.js +3 -3
  11. package/lib/cjs/appui-react/accudraw/AccuDrawInputField.js.map +1 -1
  12. package/lib/cjs/appui-react/accudraw/AccuDrawKeyboardShortcuts.d.ts +8 -0
  13. package/lib/cjs/appui-react/accudraw/AccuDrawKeyboardShortcuts.d.ts.map +1 -1
  14. package/lib/cjs/appui-react/accudraw/AccuDrawKeyboardShortcuts.js +8 -0
  15. package/lib/cjs/appui-react/accudraw/AccuDrawKeyboardShortcuts.js.map +1 -1
  16. package/lib/cjs/appui-react/accudraw/AccuDrawPopupManager.d.ts.map +1 -1
  17. package/lib/cjs/appui-react/accudraw/AccuDrawPopupManager.js +3 -4
  18. package/lib/cjs/appui-react/accudraw/AccuDrawPopupManager.js.map +1 -1
  19. package/lib/cjs/appui-react/accudraw/Calculator.d.ts.map +1 -1
  20. package/lib/cjs/appui-react/accudraw/Calculator.js +11 -12
  21. package/lib/cjs/appui-react/accudraw/Calculator.js.map +1 -1
  22. package/lib/cjs/appui-react/accudraw/FrameworkAccuDraw.d.ts +9 -1
  23. package/lib/cjs/appui-react/accudraw/FrameworkAccuDraw.d.ts.map +1 -1
  24. package/lib/cjs/appui-react/accudraw/FrameworkAccuDraw.js +9 -1
  25. package/lib/cjs/appui-react/accudraw/FrameworkAccuDraw.js.map +1 -1
  26. package/lib/cjs/appui-react/childwindow/InternalChildWindowManager.d.ts +2 -2
  27. package/lib/cjs/appui-react/childwindow/InternalChildWindowManager.d.ts.map +1 -1
  28. package/lib/cjs/appui-react/childwindow/InternalChildWindowManager.js +16 -11
  29. package/lib/cjs/appui-react/childwindow/InternalChildWindowManager.js.map +1 -1
  30. package/lib/cjs/appui-react/childwindow/PopoutWidget.d.ts +2 -4
  31. package/lib/cjs/appui-react/childwindow/PopoutWidget.d.ts.map +1 -1
  32. package/lib/cjs/appui-react/childwindow/PopoutWidget.js +6 -3
  33. package/lib/cjs/appui-react/childwindow/PopoutWidget.js.map +1 -1
  34. package/lib/cjs/appui-react/configurableui/ConfigurableUiContent.d.ts.map +1 -1
  35. package/lib/cjs/appui-react/configurableui/ConfigurableUiContent.js +3 -1
  36. package/lib/cjs/appui-react/configurableui/ConfigurableUiContent.js.map +1 -1
  37. package/lib/cjs/appui-react/configurableui/state.d.ts.map +1 -1
  38. package/lib/cjs/appui-react/configurableui/state.js +5 -2
  39. package/lib/cjs/appui-react/configurableui/state.js.map +1 -1
  40. package/lib/cjs/appui-react/content/IModelViewport.d.ts.map +1 -1
  41. package/lib/cjs/appui-react/content/IModelViewport.js +2 -0
  42. package/lib/cjs/appui-react/content/IModelViewport.js.map +1 -1
  43. package/lib/cjs/appui-react/feedback/ValidationTextbox.js +3 -3
  44. package/lib/cjs/appui-react/feedback/ValidationTextbox.js.map +1 -1
  45. package/lib/cjs/appui-react/framework/FrameworkKeyboardShortcuts.d.ts +2 -2
  46. package/lib/cjs/appui-react/framework/FrameworkKeyboardShortcuts.d.ts.map +1 -1
  47. package/lib/cjs/appui-react/framework/FrameworkKeyboardShortcuts.js.map +1 -1
  48. package/lib/cjs/appui-react/frontstage/FrontstageDef.d.ts +6 -8
  49. package/lib/cjs/appui-react/frontstage/FrontstageDef.d.ts.map +1 -1
  50. package/lib/cjs/appui-react/frontstage/FrontstageDef.js +26 -16
  51. package/lib/cjs/appui-react/frontstage/FrontstageDef.js.map +1 -1
  52. package/lib/cjs/appui-react/frontstage/ModalSettingsStage.d.ts.map +1 -1
  53. package/lib/cjs/appui-react/frontstage/ModalSettingsStage.js +1 -1
  54. package/lib/cjs/appui-react/frontstage/ModalSettingsStage.js.map +1 -1
  55. package/lib/cjs/appui-react/frontstage/NestedFrontstage.d.ts.map +1 -1
  56. package/lib/cjs/appui-react/frontstage/NestedFrontstage.js +1 -2
  57. package/lib/cjs/appui-react/frontstage/NestedFrontstage.js.map +1 -1
  58. package/lib/cjs/appui-react/hooks/useEscapeSetFocusToHome.js +2 -2
  59. package/lib/cjs/appui-react/hooks/useEscapeSetFocusToHome.js.map +1 -1
  60. package/lib/cjs/appui-react/keyboardshortcut/KeyboardShortcut.d.ts.map +1 -1
  61. package/lib/cjs/appui-react/keyboardshortcut/KeyboardShortcut.js +42 -2
  62. package/lib/cjs/appui-react/keyboardshortcut/KeyboardShortcut.js.map +1 -1
  63. package/lib/cjs/appui-react/messages/AppNotificationManager.d.ts +9 -3
  64. package/lib/cjs/appui-react/messages/AppNotificationManager.d.ts.map +1 -1
  65. package/lib/cjs/appui-react/messages/AppNotificationManager.js +9 -3
  66. package/lib/cjs/appui-react/messages/AppNotificationManager.js.map +1 -1
  67. package/lib/cjs/appui-react/messages/MessageManager.d.ts +10 -0
  68. package/lib/cjs/appui-react/messages/MessageManager.d.ts.map +1 -1
  69. package/lib/cjs/appui-react/messages/MessageManager.js +51 -6
  70. package/lib/cjs/appui-react/messages/MessageManager.js.map +1 -1
  71. package/lib/cjs/appui-react/navigationaids/SheetNavigationAid.d.ts.map +1 -1
  72. package/lib/cjs/appui-react/navigationaids/SheetNavigationAid.js +1 -3
  73. package/lib/cjs/appui-react/navigationaids/SheetNavigationAid.js.map +1 -1
  74. package/lib/cjs/appui-react/navigationaids/SheetNavigationAid.scss +0 -15
  75. package/lib/cjs/appui-react/navigationaids/StandardRotationNavigationAid.d.ts.map +1 -1
  76. package/lib/cjs/appui-react/navigationaids/StandardRotationNavigationAid.js +8 -8
  77. package/lib/cjs/appui-react/navigationaids/StandardRotationNavigationAid.js.map +1 -1
  78. package/lib/cjs/appui-react/pickers/ViewSelector.d.ts +1 -1
  79. package/lib/cjs/appui-react/pickers/ViewSelector.d.ts.map +1 -1
  80. package/lib/cjs/appui-react/pickers/ViewSelector.js +2 -3
  81. package/lib/cjs/appui-react/pickers/ViewSelector.js.map +1 -1
  82. package/lib/cjs/appui-react/popup/CardPopup.d.ts.map +1 -1
  83. package/lib/cjs/appui-react/popup/CardPopup.js +2 -2
  84. package/lib/cjs/appui-react/popup/CardPopup.js.map +1 -1
  85. package/lib/cjs/appui-react/popup/KeyinPalettePanel.d.ts.map +1 -1
  86. package/lib/cjs/appui-react/popup/KeyinPalettePanel.js +7 -6
  87. package/lib/cjs/appui-react/popup/KeyinPalettePanel.js.map +1 -1
  88. package/lib/cjs/appui-react/popup/KeyinPalettePopup.d.ts.map +1 -1
  89. package/lib/cjs/appui-react/popup/KeyinPalettePopup.js +2 -2
  90. package/lib/cjs/appui-react/popup/KeyinPalettePopup.js.map +1 -1
  91. package/lib/cjs/appui-react/popup/ToolSettingsPopup.d.ts.map +1 -1
  92. package/lib/cjs/appui-react/popup/ToolSettingsPopup.js +2 -2
  93. package/lib/cjs/appui-react/popup/ToolSettingsPopup.js.map +1 -1
  94. package/lib/cjs/appui-react/popup/ToolbarPopup.d.ts.map +1 -1
  95. package/lib/cjs/appui-react/popup/ToolbarPopup.js +2 -2
  96. package/lib/cjs/appui-react/popup/ToolbarPopup.js.map +1 -1
  97. package/lib/cjs/appui-react/preview/PreviewFeatures.d.ts +47 -0
  98. package/lib/cjs/appui-react/preview/PreviewFeatures.d.ts.map +1 -0
  99. package/lib/cjs/appui-react/preview/PreviewFeatures.js +95 -0
  100. package/lib/cjs/appui-react/preview/PreviewFeatures.js.map +1 -0
  101. package/lib/cjs/appui-react/safearea/SafeAreaContext.d.ts +9 -2
  102. package/lib/cjs/appui-react/safearea/SafeAreaContext.d.ts.map +1 -1
  103. package/lib/cjs/appui-react/safearea/SafeAreaContext.js +9 -2
  104. package/lib/cjs/appui-react/safearea/SafeAreaContext.js.map +1 -1
  105. package/lib/cjs/appui-react/selection/SelectionContextItemDef.d.ts.map +1 -1
  106. package/lib/cjs/appui-react/selection/SelectionContextItemDef.js +10 -10
  107. package/lib/cjs/appui-react/selection/SelectionContextItemDef.js.map +1 -1
  108. package/lib/cjs/appui-react/settings/ui/UiSettingsPage.d.ts +2 -3
  109. package/lib/cjs/appui-react/settings/ui/UiSettingsPage.d.ts.map +1 -1
  110. package/lib/cjs/appui-react/settings/ui/UiSettingsPage.js +9 -6
  111. package/lib/cjs/appui-react/settings/ui/UiSettingsPage.js.map +1 -1
  112. package/lib/cjs/appui-react/statusbar/StatusBar.d.ts +1 -28
  113. package/lib/cjs/appui-react/statusbar/StatusBar.d.ts.map +1 -1
  114. package/lib/cjs/appui-react/statusbar/StatusBar.js +1 -69
  115. package/lib/cjs/appui-react/statusbar/StatusBar.js.map +1 -1
  116. package/lib/cjs/appui-react/statusfields/MessageCenter.d.ts.map +1 -1
  117. package/lib/cjs/appui-react/statusfields/MessageCenter.js +1 -3
  118. package/lib/cjs/appui-react/statusfields/MessageCenter.js.map +1 -1
  119. package/lib/cjs/appui-react/statusfields/SectionsField.d.ts.map +1 -1
  120. package/lib/cjs/appui-react/statusfields/SectionsField.js +1 -3
  121. package/lib/cjs/appui-react/statusfields/SectionsField.js.map +1 -1
  122. package/lib/cjs/appui-react/statusfields/SelectionScope.d.ts +4 -7
  123. package/lib/cjs/appui-react/statusfields/SelectionScope.d.ts.map +1 -1
  124. package/lib/cjs/appui-react/statusfields/SelectionScope.js +2 -7
  125. package/lib/cjs/appui-react/statusfields/SelectionScope.js.map +1 -1
  126. package/lib/cjs/appui-react/statusfields/SnapMode.d.ts.map +1 -1
  127. package/lib/cjs/appui-react/statusfields/SnapMode.js +8 -10
  128. package/lib/cjs/appui-react/statusfields/SnapMode.js.map +1 -1
  129. package/lib/cjs/appui-react/statusfields/toolassistance/ToolAssistanceField.d.ts.map +1 -1
  130. package/lib/cjs/appui-react/statusfields/toolassistance/ToolAssistanceField.js +8 -4
  131. package/lib/cjs/appui-react/statusfields/toolassistance/ToolAssistanceField.js.map +1 -1
  132. package/lib/cjs/appui-react/theme/ThemeManager.d.ts +38 -7
  133. package/lib/cjs/appui-react/theme/ThemeManager.d.ts.map +1 -1
  134. package/lib/cjs/appui-react/theme/ThemeManager.js +52 -11
  135. package/lib/cjs/appui-react/theme/ThemeManager.js.map +1 -1
  136. package/lib/cjs/appui-react/toolbar/Toolbar.d.ts.map +1 -1
  137. package/lib/cjs/appui-react/toolbar/Toolbar.js +12 -1
  138. package/lib/cjs/appui-react/toolbar/Toolbar.js.map +1 -1
  139. package/lib/cjs/appui-react/toolbar/ToolbarItem.d.ts +21 -0
  140. package/lib/cjs/appui-react/toolbar/ToolbarItem.d.ts.map +1 -1
  141. package/lib/cjs/appui-react/toolbar/ToolbarItem.js.map +1 -1
  142. package/lib/cjs/appui-react/tools/CoreToolDefinitions.d.ts.map +1 -1
  143. package/lib/cjs/appui-react/tools/CoreToolDefinitions.js +7 -7
  144. package/lib/cjs/appui-react/tools/CoreToolDefinitions.js.map +1 -1
  145. package/lib/cjs/appui-react/tools/FrameworkToolAdmin.d.ts +10 -1
  146. package/lib/cjs/appui-react/tools/FrameworkToolAdmin.d.ts.map +1 -1
  147. package/lib/cjs/appui-react/tools/FrameworkToolAdmin.js +12 -4
  148. package/lib/cjs/appui-react/tools/FrameworkToolAdmin.js.map +1 -1
  149. package/lib/cjs/appui-react/tools/KeyinPaletteTools.d.ts.map +1 -1
  150. package/lib/cjs/appui-react/tools/KeyinPaletteTools.js +1 -2
  151. package/lib/cjs/appui-react/tools/KeyinPaletteTools.js.map +1 -1
  152. package/lib/cjs/appui-react/tools/OpenSettingsTool.d.ts.map +1 -1
  153. package/lib/cjs/appui-react/tools/OpenSettingsTool.js +1 -2
  154. package/lib/cjs/appui-react/tools/OpenSettingsTool.js.map +1 -1
  155. package/lib/cjs/appui-react/tools/RestoreLayoutTool.d.ts.map +1 -1
  156. package/lib/cjs/appui-react/tools/RestoreLayoutTool.js +2 -3
  157. package/lib/cjs/appui-react/tools/RestoreLayoutTool.js.map +1 -1
  158. package/lib/cjs/appui-react/ui-items-provider/AbstractUiItemsManager.d.ts +15 -0
  159. package/lib/cjs/appui-react/ui-items-provider/AbstractUiItemsManager.d.ts.map +1 -1
  160. package/lib/cjs/appui-react/ui-items-provider/AbstractUiItemsManager.js +133 -105
  161. package/lib/cjs/appui-react/ui-items-provider/AbstractUiItemsManager.js.map +1 -1
  162. package/lib/cjs/appui-react/ui-items-provider/UiItemsManager.d.ts +10 -4
  163. package/lib/cjs/appui-react/ui-items-provider/UiItemsManager.d.ts.map +1 -1
  164. package/lib/cjs/appui-react/ui-items-provider/UiItemsManager.js +80 -65
  165. package/lib/cjs/appui-react/ui-items-provider/UiItemsManager.js.map +1 -1
  166. package/lib/cjs/appui-react/ui-items-provider/UiItemsProvider.d.ts +30 -4
  167. package/lib/cjs/appui-react/ui-items-provider/UiItemsProvider.d.ts.map +1 -1
  168. package/lib/cjs/appui-react/ui-items-provider/UiItemsProvider.js.map +1 -1
  169. package/lib/cjs/appui-react/uiadmin/FrameworkUiAdmin.d.ts +11 -2
  170. package/lib/cjs/appui-react/uiadmin/FrameworkUiAdmin.d.ts.map +1 -1
  171. package/lib/cjs/appui-react/uiadmin/FrameworkUiAdmin.js +9 -1
  172. package/lib/cjs/appui-react/uiadmin/FrameworkUiAdmin.js.map +1 -1
  173. package/lib/cjs/appui-react/uistate/AppUiSettings.d.ts +5 -4
  174. package/lib/cjs/appui-react/uistate/AppUiSettings.d.ts.map +1 -1
  175. package/lib/cjs/appui-react/uistate/AppUiSettings.js +2 -2
  176. package/lib/cjs/appui-react/uistate/AppUiSettings.js.map +1 -1
  177. package/lib/cjs/appui-react/uistate/useUiStateStorage.d.ts +10 -1
  178. package/lib/cjs/appui-react/uistate/useUiStateStorage.d.ts.map +1 -1
  179. package/lib/cjs/appui-react/uistate/useUiStateStorage.js +10 -1
  180. package/lib/cjs/appui-react/uistate/useUiStateStorage.js.map +1 -1
  181. package/lib/cjs/appui-react/utils/matchesWords.d.ts +22 -0
  182. package/lib/cjs/appui-react/utils/matchesWords.d.ts.map +1 -0
  183. package/lib/cjs/appui-react/utils/matchesWords.js +103 -0
  184. package/lib/cjs/appui-react/utils/matchesWords.js.map +1 -0
  185. package/lib/cjs/appui-react/widget-panels/Frontstage.d.ts.map +1 -1
  186. package/lib/cjs/appui-react/widget-panels/Frontstage.js +25 -13
  187. package/lib/cjs/appui-react/widget-panels/Frontstage.js.map +1 -1
  188. package/lib/cjs/appui-react/widget-panels/Frontstage.scss +19 -0
  189. package/lib/cjs/appui-react/widget-panels/ToolSettings.d.ts +4 -1
  190. package/lib/cjs/appui-react/widget-panels/ToolSettings.d.ts.map +1 -1
  191. package/lib/cjs/appui-react/widget-panels/ToolSettings.js +11 -5
  192. package/lib/cjs/appui-react/widget-panels/ToolSettings.js.map +1 -1
  193. package/lib/cjs/appui-react/widgets/BackstageAppButton.d.ts.map +1 -1
  194. package/lib/cjs/appui-react/widgets/BackstageAppButton.js +2 -7
  195. package/lib/cjs/appui-react/widgets/BackstageAppButton.js.map +1 -1
  196. package/lib/cjs/appui-react/widgets/Widget.d.ts +23 -1
  197. package/lib/cjs/appui-react/widgets/Widget.d.ts.map +1 -1
  198. package/lib/cjs/appui-react/widgets/Widget.js.map +1 -1
  199. package/lib/cjs/appui-react.d.ts +1 -0
  200. package/lib/cjs/appui-react.d.ts.map +1 -1
  201. package/lib/cjs/appui-react.js +3 -0
  202. package/lib/cjs/appui-react.js.map +1 -1
  203. package/lib/esm/appui-react/UiFramework.d.ts +29 -14
  204. package/lib/esm/appui-react/UiFramework.d.ts.map +1 -1
  205. package/lib/esm/appui-react/UiFramework.js +29 -16
  206. package/lib/esm/appui-react/UiFramework.js.map +1 -1
  207. package/lib/esm/appui-react/accudraw/AccuDrawFieldContainer.d.ts.map +1 -1
  208. package/lib/esm/appui-react/accudraw/AccuDrawFieldContainer.js +4 -7
  209. package/lib/esm/appui-react/accudraw/AccuDrawFieldContainer.js.map +1 -1
  210. package/lib/esm/appui-react/accudraw/AccuDrawInputField.d.ts.map +1 -1
  211. package/lib/esm/appui-react/accudraw/AccuDrawInputField.js +3 -3
  212. package/lib/esm/appui-react/accudraw/AccuDrawInputField.js.map +1 -1
  213. package/lib/esm/appui-react/accudraw/AccuDrawKeyboardShortcuts.d.ts +8 -0
  214. package/lib/esm/appui-react/accudraw/AccuDrawKeyboardShortcuts.d.ts.map +1 -1
  215. package/lib/esm/appui-react/accudraw/AccuDrawKeyboardShortcuts.js +8 -0
  216. package/lib/esm/appui-react/accudraw/AccuDrawKeyboardShortcuts.js.map +1 -1
  217. package/lib/esm/appui-react/accudraw/AccuDrawPopupManager.d.ts.map +1 -1
  218. package/lib/esm/appui-react/accudraw/AccuDrawPopupManager.js +3 -4
  219. package/lib/esm/appui-react/accudraw/AccuDrawPopupManager.js.map +1 -1
  220. package/lib/esm/appui-react/accudraw/Calculator.d.ts.map +1 -1
  221. package/lib/esm/appui-react/accudraw/Calculator.js +11 -12
  222. package/lib/esm/appui-react/accudraw/Calculator.js.map +1 -1
  223. package/lib/esm/appui-react/accudraw/FrameworkAccuDraw.d.ts +9 -1
  224. package/lib/esm/appui-react/accudraw/FrameworkAccuDraw.d.ts.map +1 -1
  225. package/lib/esm/appui-react/accudraw/FrameworkAccuDraw.js +9 -1
  226. package/lib/esm/appui-react/accudraw/FrameworkAccuDraw.js.map +1 -1
  227. package/lib/esm/appui-react/childwindow/InternalChildWindowManager.d.ts +2 -2
  228. package/lib/esm/appui-react/childwindow/InternalChildWindowManager.d.ts.map +1 -1
  229. package/lib/esm/appui-react/childwindow/InternalChildWindowManager.js +16 -11
  230. package/lib/esm/appui-react/childwindow/InternalChildWindowManager.js.map +1 -1
  231. package/lib/esm/appui-react/childwindow/PopoutWidget.d.ts +2 -4
  232. package/lib/esm/appui-react/childwindow/PopoutWidget.d.ts.map +1 -1
  233. package/lib/esm/appui-react/childwindow/PopoutWidget.js +6 -3
  234. package/lib/esm/appui-react/childwindow/PopoutWidget.js.map +1 -1
  235. package/lib/esm/appui-react/configurableui/ConfigurableUiContent.d.ts.map +1 -1
  236. package/lib/esm/appui-react/configurableui/ConfigurableUiContent.js +3 -1
  237. package/lib/esm/appui-react/configurableui/ConfigurableUiContent.js.map +1 -1
  238. package/lib/esm/appui-react/configurableui/state.d.ts.map +1 -1
  239. package/lib/esm/appui-react/configurableui/state.js +5 -2
  240. package/lib/esm/appui-react/configurableui/state.js.map +1 -1
  241. package/lib/esm/appui-react/content/IModelViewport.d.ts.map +1 -1
  242. package/lib/esm/appui-react/content/IModelViewport.js +2 -0
  243. package/lib/esm/appui-react/content/IModelViewport.js.map +1 -1
  244. package/lib/esm/appui-react/feedback/ValidationTextbox.js +3 -3
  245. package/lib/esm/appui-react/feedback/ValidationTextbox.js.map +1 -1
  246. package/lib/esm/appui-react/framework/FrameworkKeyboardShortcuts.d.ts +2 -2
  247. package/lib/esm/appui-react/framework/FrameworkKeyboardShortcuts.d.ts.map +1 -1
  248. package/lib/esm/appui-react/framework/FrameworkKeyboardShortcuts.js.map +1 -1
  249. package/lib/esm/appui-react/frontstage/FrontstageDef.d.ts +6 -8
  250. package/lib/esm/appui-react/frontstage/FrontstageDef.d.ts.map +1 -1
  251. package/lib/esm/appui-react/frontstage/FrontstageDef.js +27 -17
  252. package/lib/esm/appui-react/frontstage/FrontstageDef.js.map +1 -1
  253. package/lib/esm/appui-react/frontstage/ModalSettingsStage.d.ts.map +1 -1
  254. package/lib/esm/appui-react/frontstage/ModalSettingsStage.js +2 -2
  255. package/lib/esm/appui-react/frontstage/ModalSettingsStage.js.map +1 -1
  256. package/lib/esm/appui-react/frontstage/NestedFrontstage.d.ts.map +1 -1
  257. package/lib/esm/appui-react/frontstage/NestedFrontstage.js +1 -2
  258. package/lib/esm/appui-react/frontstage/NestedFrontstage.js.map +1 -1
  259. package/lib/esm/appui-react/hooks/useEscapeSetFocusToHome.js +2 -2
  260. package/lib/esm/appui-react/hooks/useEscapeSetFocusToHome.js.map +1 -1
  261. package/lib/esm/appui-react/keyboardshortcut/KeyboardShortcut.d.ts.map +1 -1
  262. package/lib/esm/appui-react/keyboardshortcut/KeyboardShortcut.js +41 -1
  263. package/lib/esm/appui-react/keyboardshortcut/KeyboardShortcut.js.map +1 -1
  264. package/lib/esm/appui-react/messages/AppNotificationManager.d.ts +9 -3
  265. package/lib/esm/appui-react/messages/AppNotificationManager.d.ts.map +1 -1
  266. package/lib/esm/appui-react/messages/AppNotificationManager.js +9 -3
  267. package/lib/esm/appui-react/messages/AppNotificationManager.js.map +1 -1
  268. package/lib/esm/appui-react/messages/MessageManager.d.ts +10 -0
  269. package/lib/esm/appui-react/messages/MessageManager.d.ts.map +1 -1
  270. package/lib/esm/appui-react/messages/MessageManager.js +52 -7
  271. package/lib/esm/appui-react/messages/MessageManager.js.map +1 -1
  272. package/lib/esm/appui-react/navigationaids/SheetNavigationAid.d.ts.map +1 -1
  273. package/lib/esm/appui-react/navigationaids/SheetNavigationAid.js +1 -3
  274. package/lib/esm/appui-react/navigationaids/SheetNavigationAid.js.map +1 -1
  275. package/lib/esm/appui-react/navigationaids/SheetNavigationAid.scss +0 -15
  276. package/lib/esm/appui-react/navigationaids/StandardRotationNavigationAid.d.ts.map +1 -1
  277. package/lib/esm/appui-react/navigationaids/StandardRotationNavigationAid.js +9 -9
  278. package/lib/esm/appui-react/navigationaids/StandardRotationNavigationAid.js.map +1 -1
  279. package/lib/esm/appui-react/pickers/ViewSelector.d.ts +1 -1
  280. package/lib/esm/appui-react/pickers/ViewSelector.d.ts.map +1 -1
  281. package/lib/esm/appui-react/pickers/ViewSelector.js +2 -3
  282. package/lib/esm/appui-react/pickers/ViewSelector.js.map +1 -1
  283. package/lib/esm/appui-react/popup/CardPopup.d.ts.map +1 -1
  284. package/lib/esm/appui-react/popup/CardPopup.js +2 -2
  285. package/lib/esm/appui-react/popup/CardPopup.js.map +1 -1
  286. package/lib/esm/appui-react/popup/KeyinPalettePanel.d.ts.map +1 -1
  287. package/lib/esm/appui-react/popup/KeyinPalettePanel.js +6 -5
  288. package/lib/esm/appui-react/popup/KeyinPalettePanel.js.map +1 -1
  289. package/lib/esm/appui-react/popup/KeyinPalettePopup.d.ts.map +1 -1
  290. package/lib/esm/appui-react/popup/KeyinPalettePopup.js +2 -2
  291. package/lib/esm/appui-react/popup/KeyinPalettePopup.js.map +1 -1
  292. package/lib/esm/appui-react/popup/ToolSettingsPopup.d.ts.map +1 -1
  293. package/lib/esm/appui-react/popup/ToolSettingsPopup.js +2 -2
  294. package/lib/esm/appui-react/popup/ToolSettingsPopup.js.map +1 -1
  295. package/lib/esm/appui-react/popup/ToolbarPopup.d.ts.map +1 -1
  296. package/lib/esm/appui-react/popup/ToolbarPopup.js +2 -2
  297. package/lib/esm/appui-react/popup/ToolbarPopup.js.map +1 -1
  298. package/lib/esm/appui-react/preview/PreviewFeatures.d.ts +47 -0
  299. package/lib/esm/appui-react/preview/PreviewFeatures.d.ts.map +1 -0
  300. package/lib/esm/appui-react/preview/PreviewFeatures.js +90 -0
  301. package/lib/esm/appui-react/preview/PreviewFeatures.js.map +1 -0
  302. package/lib/esm/appui-react/safearea/SafeAreaContext.d.ts +9 -2
  303. package/lib/esm/appui-react/safearea/SafeAreaContext.d.ts.map +1 -1
  304. package/lib/esm/appui-react/safearea/SafeAreaContext.js +9 -2
  305. package/lib/esm/appui-react/safearea/SafeAreaContext.js.map +1 -1
  306. package/lib/esm/appui-react/selection/SelectionContextItemDef.d.ts.map +1 -1
  307. package/lib/esm/appui-react/selection/SelectionContextItemDef.js +11 -11
  308. package/lib/esm/appui-react/selection/SelectionContextItemDef.js.map +1 -1
  309. package/lib/esm/appui-react/settings/ui/UiSettingsPage.d.ts +2 -3
  310. package/lib/esm/appui-react/settings/ui/UiSettingsPage.d.ts.map +1 -1
  311. package/lib/esm/appui-react/settings/ui/UiSettingsPage.js +9 -6
  312. package/lib/esm/appui-react/settings/ui/UiSettingsPage.js.map +1 -1
  313. package/lib/esm/appui-react/statusbar/StatusBar.d.ts +1 -28
  314. package/lib/esm/appui-react/statusbar/StatusBar.d.ts.map +1 -1
  315. package/lib/esm/appui-react/statusbar/StatusBar.js +1 -69
  316. package/lib/esm/appui-react/statusbar/StatusBar.js.map +1 -1
  317. package/lib/esm/appui-react/statusfields/MessageCenter.d.ts.map +1 -1
  318. package/lib/esm/appui-react/statusfields/MessageCenter.js +2 -4
  319. package/lib/esm/appui-react/statusfields/MessageCenter.js.map +1 -1
  320. package/lib/esm/appui-react/statusfields/SectionsField.d.ts.map +1 -1
  321. package/lib/esm/appui-react/statusfields/SectionsField.js +1 -3
  322. package/lib/esm/appui-react/statusfields/SectionsField.js.map +1 -1
  323. package/lib/esm/appui-react/statusfields/SelectionScope.d.ts +4 -7
  324. package/lib/esm/appui-react/statusfields/SelectionScope.d.ts.map +1 -1
  325. package/lib/esm/appui-react/statusfields/SelectionScope.js +2 -7
  326. package/lib/esm/appui-react/statusfields/SelectionScope.js.map +1 -1
  327. package/lib/esm/appui-react/statusfields/SnapMode.d.ts.map +1 -1
  328. package/lib/esm/appui-react/statusfields/SnapMode.js +8 -10
  329. package/lib/esm/appui-react/statusfields/SnapMode.js.map +1 -1
  330. package/lib/esm/appui-react/statusfields/toolassistance/ToolAssistanceField.d.ts.map +1 -1
  331. package/lib/esm/appui-react/statusfields/toolassistance/ToolAssistanceField.js +8 -4
  332. package/lib/esm/appui-react/statusfields/toolassistance/ToolAssistanceField.js.map +1 -1
  333. package/lib/esm/appui-react/theme/ThemeManager.d.ts +38 -7
  334. package/lib/esm/appui-react/theme/ThemeManager.d.ts.map +1 -1
  335. package/lib/esm/appui-react/theme/ThemeManager.js +51 -10
  336. package/lib/esm/appui-react/theme/ThemeManager.js.map +1 -1
  337. package/lib/esm/appui-react/toolbar/Toolbar.d.ts.map +1 -1
  338. package/lib/esm/appui-react/toolbar/Toolbar.js +11 -0
  339. package/lib/esm/appui-react/toolbar/Toolbar.js.map +1 -1
  340. package/lib/esm/appui-react/toolbar/ToolbarItem.d.ts +21 -0
  341. package/lib/esm/appui-react/toolbar/ToolbarItem.d.ts.map +1 -1
  342. package/lib/esm/appui-react/toolbar/ToolbarItem.js.map +1 -1
  343. package/lib/esm/appui-react/tools/CoreToolDefinitions.d.ts.map +1 -1
  344. package/lib/esm/appui-react/tools/CoreToolDefinitions.js +8 -8
  345. package/lib/esm/appui-react/tools/CoreToolDefinitions.js.map +1 -1
  346. package/lib/esm/appui-react/tools/FrameworkToolAdmin.d.ts +10 -1
  347. package/lib/esm/appui-react/tools/FrameworkToolAdmin.d.ts.map +1 -1
  348. package/lib/esm/appui-react/tools/FrameworkToolAdmin.js +12 -4
  349. package/lib/esm/appui-react/tools/FrameworkToolAdmin.js.map +1 -1
  350. package/lib/esm/appui-react/tools/KeyinPaletteTools.d.ts.map +1 -1
  351. package/lib/esm/appui-react/tools/KeyinPaletteTools.js +1 -2
  352. package/lib/esm/appui-react/tools/KeyinPaletteTools.js.map +1 -1
  353. package/lib/esm/appui-react/tools/OpenSettingsTool.d.ts.map +1 -1
  354. package/lib/esm/appui-react/tools/OpenSettingsTool.js +1 -2
  355. package/lib/esm/appui-react/tools/OpenSettingsTool.js.map +1 -1
  356. package/lib/esm/appui-react/tools/RestoreLayoutTool.d.ts.map +1 -1
  357. package/lib/esm/appui-react/tools/RestoreLayoutTool.js +2 -3
  358. package/lib/esm/appui-react/tools/RestoreLayoutTool.js.map +1 -1
  359. package/lib/esm/appui-react/ui-items-provider/AbstractUiItemsManager.d.ts +15 -0
  360. package/lib/esm/appui-react/ui-items-provider/AbstractUiItemsManager.d.ts.map +1 -1
  361. package/lib/esm/appui-react/ui-items-provider/AbstractUiItemsManager.js +131 -104
  362. package/lib/esm/appui-react/ui-items-provider/AbstractUiItemsManager.js.map +1 -1
  363. package/lib/esm/appui-react/ui-items-provider/UiItemsManager.d.ts +10 -4
  364. package/lib/esm/appui-react/ui-items-provider/UiItemsManager.d.ts.map +1 -1
  365. package/lib/esm/appui-react/ui-items-provider/UiItemsManager.js +81 -66
  366. package/lib/esm/appui-react/ui-items-provider/UiItemsManager.js.map +1 -1
  367. package/lib/esm/appui-react/ui-items-provider/UiItemsProvider.d.ts +30 -4
  368. package/lib/esm/appui-react/ui-items-provider/UiItemsProvider.d.ts.map +1 -1
  369. package/lib/esm/appui-react/ui-items-provider/UiItemsProvider.js.map +1 -1
  370. package/lib/esm/appui-react/uiadmin/FrameworkUiAdmin.d.ts +11 -2
  371. package/lib/esm/appui-react/uiadmin/FrameworkUiAdmin.d.ts.map +1 -1
  372. package/lib/esm/appui-react/uiadmin/FrameworkUiAdmin.js +9 -1
  373. package/lib/esm/appui-react/uiadmin/FrameworkUiAdmin.js.map +1 -1
  374. package/lib/esm/appui-react/uistate/AppUiSettings.d.ts +5 -4
  375. package/lib/esm/appui-react/uistate/AppUiSettings.d.ts.map +1 -1
  376. package/lib/esm/appui-react/uistate/AppUiSettings.js +2 -2
  377. package/lib/esm/appui-react/uistate/AppUiSettings.js.map +1 -1
  378. package/lib/esm/appui-react/uistate/useUiStateStorage.d.ts +10 -1
  379. package/lib/esm/appui-react/uistate/useUiStateStorage.d.ts.map +1 -1
  380. package/lib/esm/appui-react/uistate/useUiStateStorage.js +10 -1
  381. package/lib/esm/appui-react/uistate/useUiStateStorage.js.map +1 -1
  382. package/lib/esm/appui-react/utils/matchesWords.d.ts +22 -0
  383. package/lib/esm/appui-react/utils/matchesWords.d.ts.map +1 -0
  384. package/lib/esm/appui-react/utils/matchesWords.js +99 -0
  385. package/lib/esm/appui-react/utils/matchesWords.js.map +1 -0
  386. package/lib/esm/appui-react/widget-panels/Frontstage.d.ts.map +1 -1
  387. package/lib/esm/appui-react/widget-panels/Frontstage.js +27 -15
  388. package/lib/esm/appui-react/widget-panels/Frontstage.js.map +1 -1
  389. package/lib/esm/appui-react/widget-panels/Frontstage.scss +19 -0
  390. package/lib/esm/appui-react/widget-panels/ToolSettings.d.ts +4 -1
  391. package/lib/esm/appui-react/widget-panels/ToolSettings.d.ts.map +1 -1
  392. package/lib/esm/appui-react/widget-panels/ToolSettings.js +9 -4
  393. package/lib/esm/appui-react/widget-panels/ToolSettings.js.map +1 -1
  394. package/lib/esm/appui-react/widgets/BackstageAppButton.d.ts.map +1 -1
  395. package/lib/esm/appui-react/widgets/BackstageAppButton.js +2 -7
  396. package/lib/esm/appui-react/widgets/BackstageAppButton.js.map +1 -1
  397. package/lib/esm/appui-react/widgets/Widget.d.ts +23 -1
  398. package/lib/esm/appui-react/widgets/Widget.d.ts.map +1 -1
  399. package/lib/esm/appui-react/widgets/Widget.js.map +1 -1
  400. package/lib/esm/appui-react.d.ts +1 -0
  401. package/lib/esm/appui-react.d.ts.map +1 -1
  402. package/lib/esm/appui-react.js +1 -0
  403. package/lib/esm/appui-react.js.map +1 -1
  404. package/lib/public/locales/en/UiFramework.json +6 -4
  405. package/package.json +13 -11
@@ -15,6 +15,17 @@ const AbstractUiItemsManager_1 = require("./AbstractUiItemsManager");
15
15
  * @public
16
16
  */
17
17
  class UiItemsManager {
18
+ /** For use in unit testing
19
+ * @internal
20
+ */
21
+ static useAbstractAdapter(useAbstractAdapter) {
22
+ if (useAbstractAdapter) {
23
+ this._abstractAdapter = (0, AbstractUiItemsManager_1.createAbstractUiItemsManagerAdapter)();
24
+ }
25
+ else {
26
+ this._abstractAdapter = undefined;
27
+ }
28
+ }
18
29
  /** For use in unit testing
19
30
  * @internal */
20
31
  static clearAllProviders() {
@@ -56,6 +67,7 @@ class UiItemsManager {
56
67
  /**
57
68
  * Registers a UiItemsProvider with the UiItemsManager.
58
69
  * @param uiProvider the UI items provider to register.
70
+ * @param overrides the UI items provider to register.
59
71
  */
60
72
  static register(uiProvider, overrides) {
61
73
  if (this._abstractAdapter)
@@ -101,119 +113,122 @@ class UiItemsManager {
101
113
  }
102
114
  /** Called when the application is populating a toolbar so that any registered UiItemsProvider can add tool buttons that either either execute
103
115
  * an action or specify a registered ToolId into toolbar.
104
- * @param stageId a string identifier the active stage.
116
+ * @param stageId a string identifier of the active stage.
105
117
  * @param stageUsage the StageUsage of the active stage.
106
118
  * @param usage usage of the toolbar
107
119
  * @param orientation orientation of the toolbar
108
120
  * @returns an array of error messages. The array will be empty if the load is successful, otherwise it is a list of one or more problems.
109
121
  */
110
122
  static getToolbarButtonItems(stageId, stageUsage, usage, orientation) {
111
- if (this._abstractAdapter)
123
+ if (this._abstractAdapter) {
112
124
  return this._abstractAdapter.getToolbarButtonItems(stageId, stageUsage, usage, orientation);
113
- const buttonItems = [];
125
+ }
126
+ const items = [];
114
127
  UiItemsManager._registeredUiItemsProviders.forEach((entry) => {
128
+ if (!this.allowItemsFromProvider(entry, stageId, stageUsage))
129
+ return;
115
130
  const uiProvider = entry.provider;
116
131
  const providerId = entry.overrides?.providerId ?? uiProvider.id;
117
- // istanbul ignore else
118
- if (uiProvider.provideToolbarItems &&
119
- this.allowItemsFromProvider(entry, stageId, stageUsage)) {
120
- uiProvider
121
- .provideToolbarItems(stageId, stageUsage, usage, orientation)
122
- .forEach((spec) => {
123
- // ignore duplicate ids
124
- if (-1 ===
125
- buttonItems.findIndex((existingItem) => spec.id === existingItem.id))
126
- buttonItems.push({ ...spec, providerId });
127
- });
128
- }
132
+ const provider = (0, AbstractUiItemsManager_1.createGetPropertyAdapter)(uiProvider);
133
+ const providerItems = provider
134
+ .provideToolbarItems(stageId, stageUsage, usage, orientation)
135
+ .map((item) => ({
136
+ ...item,
137
+ providerId,
138
+ }));
139
+ items.push(...providerItems);
129
140
  });
130
- return buttonItems;
141
+ return getUniqueItems(items);
131
142
  }
132
143
  /** Called when the application is populating the statusbar so that any registered UiItemsProvider can add status fields
133
- * @param stageId a string identifier the active stage.
144
+ * @param stageId a string identifier of the active stage.
134
145
  * @param stageUsage the StageUsage of the active stage.
135
146
  * @returns An array of CommonStatusBarItem that will be used to create controls for the status bar.
136
147
  */
137
148
  static getStatusBarItems(stageId, stageUsage) {
138
- if (this._abstractAdapter)
149
+ if (this._abstractAdapter) {
139
150
  return this._abstractAdapter.getStatusBarItems(stageId, stageUsage);
140
- const statusBarItems = [];
151
+ }
152
+ const items = [];
141
153
  UiItemsManager._registeredUiItemsProviders.forEach((entry) => {
154
+ if (!this.allowItemsFromProvider(entry, stageId, stageUsage))
155
+ return;
142
156
  const uiProvider = entry.provider;
143
157
  const providerId = entry.overrides?.providerId ?? uiProvider.id;
144
- // istanbul ignore else
145
- if (uiProvider.provideStatusBarItems &&
146
- this.allowItemsFromProvider(entry, stageId, stageUsage)) {
147
- uiProvider
148
- .provideStatusBarItems(stageId, stageUsage)
149
- .forEach((item) => {
150
- // ignore duplicate ids
151
- if (-1 ===
152
- statusBarItems.findIndex((existingItem) => item.id === existingItem.id))
153
- statusBarItems.push({ ...item, providerId });
154
- });
155
- }
158
+ const provider = (0, AbstractUiItemsManager_1.createGetPropertyAdapter)(uiProvider);
159
+ const providerItems = provider
160
+ .provideStatusBarItems(stageId, stageUsage)
161
+ .map((item) => ({
162
+ ...item,
163
+ providerId,
164
+ }));
165
+ items.push(...providerItems);
156
166
  });
157
- return statusBarItems;
167
+ return getUniqueItems(items);
158
168
  }
159
169
  /** Called when the application is populating the statusbar so that any registered UiItemsProvider can add status fields
160
170
  * @returns An array of BackstageItem that will be used to create controls for the backstage menu.
161
171
  */
162
172
  static getBackstageItems() {
163
- if (this._abstractAdapter)
173
+ if (this._abstractAdapter) {
164
174
  return this._abstractAdapter.getBackstageItems();
165
- const backstageItems = [];
175
+ }
176
+ const items = [];
166
177
  UiItemsManager._registeredUiItemsProviders.forEach((entry) => {
167
178
  const uiProvider = entry.provider;
168
179
  const providerId = entry.overrides?.providerId ?? uiProvider.id;
169
- // istanbul ignore else
170
- if (uiProvider.provideBackstageItems) {
171
- // Note: We do not call this.allowItemsFromProvider here as backstage items
172
- uiProvider
173
- .provideBackstageItems() // should not be considered stage specific. If they need to be hidden
174
- .forEach((item) => {
175
- // the isHidden property should be set to a ConditionalBooleanValue
176
- // ignore duplicate ids
177
- if (-1 ===
178
- backstageItems.findIndex((existingItem) => item.id === existingItem.id))
179
- backstageItems.push({ ...item, providerId });
180
- });
181
- }
180
+ const provider = (0, AbstractUiItemsManager_1.createGetPropertyAdapter)(uiProvider);
181
+ // Note: We do not call this.allowItemsFromProvider here as backstage items
182
+ // should not be considered stage specific.
183
+ const providerItems = provider.provideBackstageItems().map((item) => ({
184
+ ...item,
185
+ providerId,
186
+ }));
187
+ items.push(...providerItems);
182
188
  });
183
- return backstageItems;
189
+ return getUniqueItems(items);
184
190
  }
185
191
  /** Called when the application is populating the Stage Panels so that any registered UiItemsProvider can add widgets
186
- * @param stageId a string identifier the active stage.
192
+ * @param stageId a string identifier of the active stage.
187
193
  * @param stageUsage the StageUsage of the active stage.
188
194
  * @param location the location within the stage.
189
195
  * @param section the section within location.
190
196
  * @returns An array of widgets.
191
197
  */
192
198
  static getWidgets(stageId, stageUsage, location, section) {
193
- if (this._abstractAdapter)
194
- return this._abstractAdapter.getWidgets(stageId, stageUsage, location, section);
195
- const widgets = [];
199
+ const items = [];
200
+ if (this._abstractAdapter) {
201
+ const abstractWidgets = this._abstractAdapter.getWidgets(stageId, stageUsage, location, section);
202
+ items.push(...abstractWidgets);
203
+ }
196
204
  UiItemsManager._registeredUiItemsProviders.forEach((entry) => {
197
205
  const uiProvider = entry.provider;
198
206
  const providerId = entry.overrides?.providerId ?? uiProvider.id;
199
- // istanbul ignore else
200
- if (uiProvider.provideWidgets &&
201
- this.allowItemsFromProvider(entry, stageId, stageUsage)) {
202
- uiProvider
203
- .provideWidgets(stageId, stageUsage, location, section)
204
- .forEach((widget) => {
205
- // ignore duplicate ids
206
- if (-1 ===
207
- widgets.findIndex((existingItem) => widget.id === existingItem.id))
208
- widgets.push({ ...widget, providerId });
209
- });
210
- }
207
+ if (!this.allowItemsFromProvider(entry, stageId, stageUsage))
208
+ return;
209
+ const provider = (0, AbstractUiItemsManager_1.createGetPropertyAdapter)(uiProvider);
210
+ const providerItems = provider
211
+ .provideWidgets(stageId, stageUsage, location, section)
212
+ .map((item) => ({
213
+ ...item,
214
+ providerId,
215
+ }));
216
+ items.push(...providerItems);
211
217
  });
212
- return widgets;
218
+ return getUniqueItems(items);
213
219
  }
214
220
  }
215
221
  UiItemsManager._registeredUiItemsProviders = new Map();
216
222
  UiItemsManager._onUiProviderRegisteredEvent = new core_bentley_1.BeUiEvent();
217
223
  UiItemsManager._abstractAdapter = (0, AbstractUiItemsManager_1.createAbstractUiItemsManagerAdapter)();
218
224
  exports.UiItemsManager = UiItemsManager;
225
+ function getUniqueItems(items) {
226
+ const uniqueItems = [];
227
+ items.forEach((item) => {
228
+ if (uniqueItems.find((existingItem) => item.id === existingItem.id))
229
+ return;
230
+ uniqueItems.push(item);
231
+ });
232
+ return uniqueItems;
233
+ }
219
234
  //# sourceMappingURL=UiItemsManager.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UiItemsManager.js","sourceRoot":"","sources":["../../../../src/appui-react/ui-items-provider/UiItemsManager.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAGH,sDAAwD;AAUxD,gDAA6C;AAI7C,qEAA+E;AA0C/E;;GAEG;AACH,MAAa,cAAc;IAOzB;mBACe;IACR,MAAM,CAAC,iBAAiB;QAC7B,IAAI,IAAI,CAAC,gBAAgB;YAAE,OAAO,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,CAAC;QAE5E,cAAc,CAAC,2BAA2B,CAAC,KAAK,EAAE,CAAC;IACrD,CAAC;IAED,wEAAwE;IACjE,MAAM,KAAK,2BAA2B;QAC3C,IAAI,IAAI,CAAC,gBAAgB;YACvB,OAAO,IAAI,CAAC,gBAAgB,CAAC,2BAA2B,CAAC;QAE3D,OAAO,IAAI,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AO,EAAE,UAAU,CAAC,EACvD;gBACA,UAAU;qBACP,cAAc,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,CAAC;qBACtD,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;oBAClB,uBAAuB;oBACvB,IACE,CAAC,CAAC;wBACF,OAAO,CAAC,SAAS,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,KAAK,YAAY,CAAC,EAAE,CAAC;wBAElE,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;gBAC5C,CAAC,CAAC,CAAC;aACN;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,OAAO,CAAC;IACjB,CAAC;;AArTc,0CAA2B,GACxC,IAAI,GAAG,EAA+B,CAAC;AAC1B,2CAA4B,GACzC,IAAI,wBAAS,EAAsC,CAAC;AACvC,+BAAgB,GAAG,IAAA,4DAAmC,GAAE,CAAC;AAL7D,wCAAc","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 UiProvider\n */\n\nimport type { MarkRequired } from \"@itwin/core-bentley\";\nimport { BeUiEvent, Logger } from \"@itwin/core-bentley\";\nimport type { BackstageItem } from \"../backstage/BackstageItem\";\nimport type { StagePanelLocation } from \"../stagepanels/StagePanelLocation\";\nimport type { StagePanelSection } from \"../stagepanels/StagePanelSection\";\nimport type { StatusBarItem } from \"../statusbar/StatusBarItem\";\nimport type {\n ToolbarItem,\n ToolbarOrientation,\n ToolbarUsage,\n} from \"../toolbar/ToolbarItem\";\nimport { UiFramework } from \"../UiFramework\";\nimport type { Widget } from \"../widgets/Widget\";\nimport type { ProviderItem } from \"./ProviderItem\";\nimport type { UiItemsProvider } from \"./UiItemsProvider\";\nimport { createAbstractUiItemsManagerAdapter } from \"./AbstractUiItemsManager\";\n\n/** UiItemsProvider register event args.\n * @public\n */\nexport interface UiItemsProviderRegisteredEventArgs {\n providerId: string;\n}\n\n/** UiItemsProvider overrides allows the application that registers a provider to limit when it is allowed to provide items\n * @public\n */\nexport interface AllowedUiItemsProviderOverrides {\n /** allows providerId to be overridden in the items manager for cases where the same provider needs to provide different content to different stages */\n providerId?: string;\n /** if specified then the current stage's Usage will be compared before allowing any items to be provided */\n stageUsages?: string[];\n /** if specified then the current stage's Id will be compared before allowing any items to be provided */\n stageIds?: string[];\n}\n\n/** Allowed overrides applied to a UiItemsProvider the application that registers a provider to limit when it is allowed to provide items.\n * Note that if an override `providerId` is specified then either `stageIds` or `stageUsages` must be defined to limit when the provider's\n * items are allowed.\n * @public\n */\nexport type UiItemsProviderOverrides =\n | MarkRequired<AllowedUiItemsProviderOverrides, \"providerId\" | \"stageUsages\">\n | MarkRequired<AllowedUiItemsProviderOverrides, \"providerId\" | \"stageIds\">\n | MarkRequired<AllowedUiItemsProviderOverrides, \"stageIds\">\n | MarkRequired<AllowedUiItemsProviderOverrides, \"stageUsages\">\n | MarkRequired<\n AllowedUiItemsProviderOverrides,\n \"providerId\" | \"stageUsages\" | \"stageIds\"\n >;\n\n/** Interface that defines an instance of a UiItemsProvider and its application specified overrides. */\ninterface UiItemProviderEntry {\n provider: UiItemsProvider;\n overrides?: UiItemsProviderOverrides;\n}\n\n/** Controls registering of UiItemsProviders and calls the provider's methods when populating different parts of the User Interface.\n * @public\n */\nexport class UiItemsManager {\n private static _registeredUiItemsProviders: Map<string, UiItemProviderEntry> =\n new Map<string, UiItemProviderEntry>();\n private static _onUiProviderRegisteredEvent =\n new BeUiEvent<UiItemsProviderRegisteredEventArgs>();\n private static _abstractAdapter = createAbstractUiItemsManagerAdapter();\n\n /** For use in unit testing\n * @internal */\n public static clearAllProviders() {\n if (this._abstractAdapter) return this._abstractAdapter.clearAllProviders();\n\n UiItemsManager._registeredUiItemsProviders.clear();\n }\n\n /** Event raised any time a UiProvider is registered or unregistered. */\n public static get onUiProviderRegisteredEvent(): BeUiEvent<UiItemsProviderRegisteredEventArgs> {\n if (this._abstractAdapter)\n return this._abstractAdapter.onUiProviderRegisteredEvent;\n\n return this._onUiProviderRegisteredEvent;\n }\n\n /** Return number of registered UiProvider. */\n public static get registeredProviderIds(): string[] {\n if (this._abstractAdapter)\n return this._abstractAdapter.registeredProviderIds;\n\n const ids = [...UiItemsManager._registeredUiItemsProviders.keys()];\n return ids;\n }\n\n /** Return true if there is any registered UiProvider. */\n public static get hasRegisteredProviders(): boolean {\n if (this._abstractAdapter)\n return this._abstractAdapter.hasRegisteredProviders;\n\n return this._registeredUiItemsProviders.size > 0;\n }\n\n /**\n * Retrieves a previously loaded UiItemsProvider.\n * @param providerId id of the UiItemsProvider to get\n */\n public static getUiItemsProvider(\n providerId: string\n ): UiItemsProvider | undefined {\n if (this._abstractAdapter)\n return this._abstractAdapter.getUiItemsProvider(providerId);\n\n return UiItemsManager._registeredUiItemsProviders.get(providerId)?.provider;\n }\n\n private static sendRegisteredEvent(args: UiItemsProviderRegisteredEventArgs) {\n UiItemsManager.onUiProviderRegisteredEvent.raiseEvent(args);\n }\n\n /**\n * Registers a UiItemsProvider with the UiItemsManager.\n * @param uiProvider the UI items provider to register.\n */\n public static register(\n uiProvider: UiItemsProvider,\n overrides?: UiItemsProviderOverrides\n ): void {\n if (this._abstractAdapter)\n return this._abstractAdapter.register(uiProvider, overrides);\n\n const providerId = overrides?.providerId ?? uiProvider.id;\n\n if (UiItemsManager.getUiItemsProvider(providerId)) {\n Logger.logInfo(\n UiFramework.loggerCategory(this),\n `UiItemsProvider (${providerId}) is already loaded`\n );\n } else {\n UiItemsManager._registeredUiItemsProviders.set(providerId, {\n provider: uiProvider,\n overrides,\n });\n Logger.logInfo(\n UiFramework.loggerCategory(this),\n `UiItemsProvider ${uiProvider.id} registered as ${providerId} `\n );\n\n UiItemsManager.sendRegisteredEvent({ providerId });\n }\n }\n\n /** Remove a specific UiItemsProvider from the list of available providers. */\n public static unregister(providerId: string): void {\n if (this._abstractAdapter)\n return this._abstractAdapter.unregister(providerId);\n\n const provider = UiItemsManager.getUiItemsProvider(providerId);\n if (!provider) return;\n\n provider.onUnregister && provider.onUnregister();\n\n UiItemsManager._registeredUiItemsProviders.delete(providerId);\n Logger.logInfo(\n UiFramework.loggerCategory(this),\n `UiItemsProvider (${providerId}) unloaded`\n );\n\n // trigger a refresh of the ui\n UiItemsManager.sendRegisteredEvent({ providerId });\n }\n\n private static allowItemsFromProvider(\n entry: UiItemProviderEntry,\n stageId?: string,\n stageUsage?: string\n ) {\n // istanbul ignore else\n const overrides = entry.overrides;\n if (\n undefined !== stageId &&\n overrides?.stageIds &&\n !overrides.stageIds.some((value: string) => value === stageId)\n )\n return false;\n if (\n undefined !== stageUsage &&\n overrides?.stageUsages &&\n !overrides.stageUsages.some((value: string) => value === stageUsage)\n )\n return false;\n return true;\n }\n\n /** Called when the application is populating a toolbar so that any registered UiItemsProvider can add tool buttons that either either execute\n * an action or specify a registered ToolId into toolbar.\n * @param stageId a string identifier the active stage.\n * @param stageUsage the StageUsage of the active stage.\n * @param usage usage of the toolbar\n * @param orientation orientation of the toolbar\n * @returns an array of error messages. The array will be empty if the load is successful, otherwise it is a list of one or more problems.\n */\n public static getToolbarButtonItems(\n stageId: string,\n stageUsage: string,\n usage: ToolbarUsage,\n orientation: ToolbarOrientation\n ): ReadonlyArray<ProviderItem<ToolbarItem>> {\n if (this._abstractAdapter)\n return this._abstractAdapter.getToolbarButtonItems(\n stageId,\n stageUsage,\n usage,\n orientation\n );\n\n const buttonItems: ProviderItem<ToolbarItem>[] = [];\n\n UiItemsManager._registeredUiItemsProviders.forEach(\n (entry: UiItemProviderEntry) => {\n const uiProvider = entry.provider;\n const providerId = entry.overrides?.providerId ?? uiProvider.id;\n // istanbul ignore else\n if (\n uiProvider.provideToolbarItems &&\n this.allowItemsFromProvider(entry, stageId, stageUsage)\n ) {\n uiProvider\n .provideToolbarItems(stageId, stageUsage, usage, orientation)\n .forEach((spec: ToolbarItem) => {\n // ignore duplicate ids\n if (\n -1 ===\n buttonItems.findIndex(\n (existingItem) => spec.id === existingItem.id\n )\n )\n buttonItems.push({ ...spec, providerId });\n });\n }\n }\n );\n\n return buttonItems;\n }\n\n /** Called when the application is populating the statusbar so that any registered UiItemsProvider can add status fields\n * @param stageId a string identifier the active stage.\n * @param stageUsage the StageUsage of the active stage.\n * @returns An array of CommonStatusBarItem that will be used to create controls for the status bar.\n */\n public static getStatusBarItems(\n stageId: string,\n stageUsage: string\n ): ReadonlyArray<ProviderItem<StatusBarItem>> {\n if (this._abstractAdapter)\n return this._abstractAdapter.getStatusBarItems(stageId, stageUsage);\n\n const statusBarItems: ProviderItem<StatusBarItem>[] = [];\n\n UiItemsManager._registeredUiItemsProviders.forEach(\n (entry: UiItemProviderEntry) => {\n const uiProvider = entry.provider;\n const providerId = entry.overrides?.providerId ?? uiProvider.id;\n\n // istanbul ignore else\n if (\n uiProvider.provideStatusBarItems &&\n this.allowItemsFromProvider(entry, stageId, stageUsage)\n ) {\n uiProvider\n .provideStatusBarItems(stageId, stageUsage)\n .forEach((item: StatusBarItem) => {\n // ignore duplicate ids\n if (\n -1 ===\n statusBarItems.findIndex(\n (existingItem) => item.id === existingItem.id\n )\n )\n statusBarItems.push({ ...item, providerId });\n });\n }\n }\n );\n\n return statusBarItems;\n }\n\n /** Called when the application is populating the statusbar so that any registered UiItemsProvider can add status fields\n * @returns An array of BackstageItem that will be used to create controls for the backstage menu.\n */\n public static getBackstageItems(): ReadonlyArray<\n ProviderItem<BackstageItem>\n > {\n if (this._abstractAdapter) return this._abstractAdapter.getBackstageItems();\n\n const backstageItems: ProviderItem<BackstageItem>[] = [];\n\n UiItemsManager._registeredUiItemsProviders.forEach(\n (entry: UiItemProviderEntry) => {\n const uiProvider = entry.provider;\n const providerId = entry.overrides?.providerId ?? uiProvider.id;\n\n // istanbul ignore else\n if (uiProvider.provideBackstageItems) {\n // Note: We do not call this.allowItemsFromProvider here as backstage items\n uiProvider\n .provideBackstageItems() // should not be considered stage specific. If they need to be hidden\n .forEach((item: BackstageItem) => {\n // the isHidden property should be set to a ConditionalBooleanValue\n // ignore duplicate ids\n if (\n -1 ===\n backstageItems.findIndex(\n (existingItem) => item.id === existingItem.id\n )\n )\n backstageItems.push({ ...item, providerId });\n });\n }\n }\n );\n\n return backstageItems;\n }\n\n /** Called when the application is populating the Stage Panels so that any registered UiItemsProvider can add widgets\n * @param stageId a string identifier the active stage.\n * @param stageUsage the StageUsage of the active stage.\n * @param location the location within the stage.\n * @param section the section within location.\n * @returns An array of widgets.\n */\n public static getWidgets(\n stageId: string,\n stageUsage: string,\n location: StagePanelLocation,\n section?: StagePanelSection\n ): ReadonlyArray<ProviderItem<Widget>> {\n if (this._abstractAdapter)\n return this._abstractAdapter.getWidgets(\n stageId,\n stageUsage,\n location,\n section\n );\n\n const widgets: ProviderItem<Widget>[] = [];\n\n UiItemsManager._registeredUiItemsProviders.forEach((entry) => {\n const uiProvider = entry.provider;\n const providerId = entry.overrides?.providerId ?? uiProvider.id;\n\n // istanbul ignore else\n if (\n uiProvider.provideWidgets &&\n this.allowItemsFromProvider(entry, stageId, stageUsage)\n ) {\n uiProvider\n .provideWidgets(stageId, stageUsage, location, section)\n .forEach((widget) => {\n // ignore duplicate ids\n if (\n -1 ===\n widgets.findIndex((existingItem) => widget.id === existingItem.id)\n )\n widgets.push({ ...widget, providerId });\n });\n }\n });\n\n return widgets;\n }\n}\n"]}
1
+ {"version":3,"file":"UiItemsManager.js","sourceRoot":"","sources":["../../../../src/appui-react/ui-items-provider/UiItemsManager.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAGH,sDAAwD;AAOxD,gDAA6C;AAI7C,qEAGkC;AA0ClC;;GAEG;AACH,MAAa,cAAc;IAOzB;;OAEG;IACI,MAAM,CAAC,kBAAkB,CAAC,kBAA2B;QAC1D,IAAI,kBAAkB,EAAE;YACtB,IAAI,CAAC,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C;AACrB,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 UiProvider\n */\n\nimport type { MarkRequired } from \"@itwin/core-bentley\";\nimport { BeUiEvent, Logger } from \"@itwin/core-bentley\";\nimport type { BackstageItem } from \"../backstage/BackstageItem\";\nimport type { StagePanelLocation } from \"../stagepanels/StagePanelLocation\";\nimport type { StagePanelSection } from \"../stagepanels/StagePanelSection\";\nimport type { StatusBarItem } from \"../statusbar/StatusBarItem\";\nimport type { ToolbarItem } from \"../toolbar/ToolbarItem\";\nimport type { ToolbarOrientation, ToolbarUsage } from \"../toolbar/ToolbarItem\";\nimport { UiFramework } from \"../UiFramework\";\nimport type { Widget } from \"../widgets/Widget\";\nimport type { ProviderItem } from \"./ProviderItem\";\nimport type { UiItemsProvider } from \"./UiItemsProvider\";\nimport {\n createAbstractUiItemsManagerAdapter,\n createGetPropertyAdapter,\n} from \"./AbstractUiItemsManager\";\n\n/** UiItemsProvider register event args.\n * @public\n */\nexport interface UiItemsProviderRegisteredEventArgs {\n providerId: string;\n}\n\n/** UiItemsProvider overrides allows the application that registers a provider to limit when it is allowed to provide items\n * @public\n */\nexport interface AllowedUiItemsProviderOverrides {\n /** allows providerId to be overridden in the items manager for cases where the same provider needs to provide different content to different stages */\n providerId?: string;\n /** if specified then the current stage's Usage will be compared before allowing any items to be provided */\n stageUsages?: string[];\n /** if specified then the current stage's Id will be compared before allowing any items to be provided */\n stageIds?: string[];\n}\n\n/** Allowed overrides applied to a UiItemsProvider the application that registers a provider to limit when it is allowed to provide items.\n * Note that if an override `providerId` is specified then either `stageIds` or `stageUsages` must be defined to limit when the provider's\n * items are allowed.\n * @public\n */\nexport type UiItemsProviderOverrides =\n | MarkRequired<AllowedUiItemsProviderOverrides, \"providerId\" | \"stageUsages\">\n | MarkRequired<AllowedUiItemsProviderOverrides, \"providerId\" | \"stageIds\">\n | MarkRequired<AllowedUiItemsProviderOverrides, \"stageIds\">\n | MarkRequired<AllowedUiItemsProviderOverrides, \"stageUsages\">\n | MarkRequired<\n AllowedUiItemsProviderOverrides,\n \"providerId\" | \"stageUsages\" | \"stageIds\"\n >;\n\n/** Interface that defines an instance of a UiItemsProvider and its application specified overrides. */\ninterface UiItemProviderEntry {\n provider: UiItemsProvider;\n overrides?: UiItemsProviderOverrides;\n}\n\n/** Controls registering of UiItemsProviders and calls the provider's methods when populating different parts of the User Interface.\n * @public\n */\nexport class UiItemsManager {\n private static _registeredUiItemsProviders: Map<string, UiItemProviderEntry> =\n new Map<string, UiItemProviderEntry>();\n private static _onUiProviderRegisteredEvent =\n new BeUiEvent<UiItemsProviderRegisteredEventArgs>();\n private static _abstractAdapter = createAbstractUiItemsManagerAdapter();\n\n /** For use in unit testing\n * @internal\n */\n public static useAbstractAdapter(useAbstractAdapter: boolean) {\n if (useAbstractAdapter) {\n this._abstractAdapter = createAbstractUiItemsManagerAdapter();\n } else {\n this._abstractAdapter = undefined;\n }\n }\n\n /** For use in unit testing\n * @internal */\n public static clearAllProviders() {\n if (this._abstractAdapter) return this._abstractAdapter.clearAllProviders();\n\n UiItemsManager._registeredUiItemsProviders.clear();\n }\n\n /** Event raised any time a UiProvider is registered or unregistered. */\n public static get onUiProviderRegisteredEvent(): BeUiEvent<UiItemsProviderRegisteredEventArgs> {\n if (this._abstractAdapter)\n return this._abstractAdapter.onUiProviderRegisteredEvent;\n\n return this._onUiProviderRegisteredEvent;\n }\n\n /** Return number of registered UiProvider. */\n public static get registeredProviderIds(): string[] {\n if (this._abstractAdapter)\n return this._abstractAdapter.registeredProviderIds;\n\n const ids = [...UiItemsManager._registeredUiItemsProviders.keys()];\n return ids;\n }\n\n /** Return true if there is any registered UiProvider. */\n public static get hasRegisteredProviders(): boolean {\n if (this._abstractAdapter)\n return this._abstractAdapter.hasRegisteredProviders;\n\n return this._registeredUiItemsProviders.size > 0;\n }\n\n /**\n * Retrieves a previously loaded UiItemsProvider.\n * @param providerId id of the UiItemsProvider to get\n */\n public static getUiItemsProvider(\n providerId: string\n ): UiItemsProvider | undefined {\n if (this._abstractAdapter)\n return this._abstractAdapter.getUiItemsProvider(providerId);\n\n return UiItemsManager._registeredUiItemsProviders.get(providerId)?.provider;\n }\n\n private static sendRegisteredEvent(args: UiItemsProviderRegisteredEventArgs) {\n UiItemsManager.onUiProviderRegisteredEvent.raiseEvent(args);\n }\n\n /**\n * Registers a UiItemsProvider with the UiItemsManager.\n * @param uiProvider the UI items provider to register.\n * @param overrides the UI items provider to register.\n */\n public static register(\n uiProvider: UiItemsProvider,\n overrides?: UiItemsProviderOverrides\n ): void {\n if (this._abstractAdapter)\n return this._abstractAdapter.register(uiProvider, overrides);\n\n const providerId = overrides?.providerId ?? uiProvider.id;\n\n if (UiItemsManager.getUiItemsProvider(providerId)) {\n Logger.logInfo(\n UiFramework.loggerCategory(this),\n `UiItemsProvider (${providerId}) is already loaded`\n );\n } else {\n UiItemsManager._registeredUiItemsProviders.set(providerId, {\n provider: uiProvider,\n overrides,\n });\n Logger.logInfo(\n UiFramework.loggerCategory(this),\n `UiItemsProvider ${uiProvider.id} registered as ${providerId} `\n );\n\n UiItemsManager.sendRegisteredEvent({ providerId });\n }\n }\n\n /** Remove a specific UiItemsProvider from the list of available providers. */\n public static unregister(providerId: string): void {\n if (this._abstractAdapter)\n return this._abstractAdapter.unregister(providerId);\n\n const provider = UiItemsManager.getUiItemsProvider(providerId);\n if (!provider) return;\n\n provider.onUnregister && provider.onUnregister();\n\n UiItemsManager._registeredUiItemsProviders.delete(providerId);\n Logger.logInfo(\n UiFramework.loggerCategory(this),\n `UiItemsProvider (${providerId}) unloaded`\n );\n\n // trigger a refresh of the ui\n UiItemsManager.sendRegisteredEvent({ providerId });\n }\n\n private static allowItemsFromProvider(\n entry: UiItemProviderEntry,\n stageId?: string,\n stageUsage?: string\n ) {\n // istanbul ignore else\n const overrides = entry.overrides;\n if (\n undefined !== stageId &&\n overrides?.stageIds &&\n !overrides.stageIds.some((value: string) => value === stageId)\n )\n return false;\n if (\n undefined !== stageUsage &&\n overrides?.stageUsages &&\n !overrides.stageUsages.some((value: string) => value === stageUsage)\n )\n return false;\n return true;\n }\n\n /** Called when the application is populating a toolbar so that any registered UiItemsProvider can add tool buttons that either either execute\n * an action or specify a registered ToolId into toolbar.\n * @param stageId a string identifier of the active stage.\n * @param stageUsage the StageUsage of the active stage.\n * @param usage usage of the toolbar\n * @param orientation orientation of the toolbar\n * @returns an array of error messages. The array will be empty if the load is successful, otherwise it is a list of one or more problems.\n */\n public static getToolbarButtonItems(\n stageId: string,\n stageUsage: string,\n usage: ToolbarUsage,\n orientation: ToolbarOrientation\n ): ReadonlyArray<ProviderItem<ToolbarItem>> {\n if (this._abstractAdapter) {\n return this._abstractAdapter.getToolbarButtonItems(\n stageId,\n stageUsage,\n usage,\n orientation\n );\n }\n\n const items: ProviderItem<ToolbarItem>[] = [];\n UiItemsManager._registeredUiItemsProviders.forEach((entry) => {\n if (!this.allowItemsFromProvider(entry, stageId, stageUsage)) return;\n\n const uiProvider = entry.provider;\n const providerId = entry.overrides?.providerId ?? uiProvider.id;\n const provider = createGetPropertyAdapter(uiProvider);\n const providerItems = provider\n .provideToolbarItems(stageId, stageUsage, usage, orientation)\n .map((item) => ({\n ...item,\n providerId,\n }));\n items.push(...providerItems);\n });\n\n return getUniqueItems(items);\n }\n\n /** Called when the application is populating the statusbar so that any registered UiItemsProvider can add status fields\n * @param stageId a string identifier of the active stage.\n * @param stageUsage the StageUsage of the active stage.\n * @returns An array of CommonStatusBarItem that will be used to create controls for the status bar.\n */\n public static getStatusBarItems(\n stageId: string,\n stageUsage: string\n ): ReadonlyArray<ProviderItem<StatusBarItem>> {\n if (this._abstractAdapter) {\n return this._abstractAdapter.getStatusBarItems(stageId, stageUsage);\n }\n\n const items: ProviderItem<StatusBarItem>[] = [];\n UiItemsManager._registeredUiItemsProviders.forEach((entry) => {\n if (!this.allowItemsFromProvider(entry, stageId, stageUsage)) return;\n\n const uiProvider = entry.provider;\n const providerId = entry.overrides?.providerId ?? uiProvider.id;\n const provider = createGetPropertyAdapter(uiProvider);\n\n const providerItems = provider\n .provideStatusBarItems(stageId, stageUsage)\n .map((item) => ({\n ...item,\n providerId,\n }));\n items.push(...providerItems);\n });\n\n return getUniqueItems(items);\n }\n\n /** Called when the application is populating the statusbar so that any registered UiItemsProvider can add status fields\n * @returns An array of BackstageItem that will be used to create controls for the backstage menu.\n */\n public static getBackstageItems(): ReadonlyArray<\n ProviderItem<BackstageItem>\n > {\n if (this._abstractAdapter) {\n return this._abstractAdapter.getBackstageItems();\n }\n\n const items: ProviderItem<BackstageItem>[] = [];\n UiItemsManager._registeredUiItemsProviders.forEach((entry) => {\n const uiProvider = entry.provider;\n const providerId = entry.overrides?.providerId ?? uiProvider.id;\n const provider = createGetPropertyAdapter(uiProvider);\n // Note: We do not call this.allowItemsFromProvider here as backstage items\n // should not be considered stage specific.\n const providerItems = provider.provideBackstageItems().map((item) => ({\n ...item,\n providerId,\n }));\n items.push(...providerItems);\n });\n\n return getUniqueItems(items);\n }\n\n /** Called when the application is populating the Stage Panels so that any registered UiItemsProvider can add widgets\n * @param stageId a string identifier of the active stage.\n * @param stageUsage the StageUsage of the active stage.\n * @param location the location within the stage.\n * @param section the section within location.\n * @returns An array of widgets.\n */\n public static getWidgets(\n stageId: string,\n stageUsage: string,\n location: StagePanelLocation,\n section?: StagePanelSection\n ): ReadonlyArray<ProviderItem<Widget>> {\n const items: ProviderItem<Widget>[] = [];\n if (this._abstractAdapter) {\n const abstractWidgets = this._abstractAdapter.getWidgets(\n stageId,\n stageUsage,\n location,\n section\n );\n items.push(...abstractWidgets);\n }\n\n UiItemsManager._registeredUiItemsProviders.forEach((entry) => {\n const uiProvider = entry.provider;\n const providerId = entry.overrides?.providerId ?? uiProvider.id;\n if (!this.allowItemsFromProvider(entry, stageId, stageUsage)) return;\n\n const provider = createGetPropertyAdapter(uiProvider);\n const providerItems = provider\n .provideWidgets(stageId, stageUsage, location, section)\n .map((item) => ({\n ...item,\n providerId,\n }));\n items.push(...providerItems);\n });\n\n return getUniqueItems(items);\n }\n}\n\nfunction getUniqueItems<T extends { id: string }>(items: readonly T[]) {\n const uniqueItems: T[] = [];\n items.forEach((item) => {\n if (uniqueItems.find((existingItem) => item.id === existingItem.id)) return;\n uniqueItems.push(item);\n });\n return uniqueItems;\n}\n"]}
@@ -13,13 +13,39 @@ import type { Widget } from "../widgets/Widget";
13
13
  export interface UiItemsProvider {
14
14
  /** Id of provider. */
15
15
  readonly id: string;
16
- /** Provides toolbar items. */
16
+ /** Provides toolbar items.
17
+ * @note Use [[ToolbarItem.layouts]] to map item to location previously specified by `provideToolbarItems` arguments.
18
+ * @alpha
19
+ */
20
+ readonly getToolbarItems?: () => ReadonlyArray<ToolbarItem>;
21
+ /** Provides status bar items.
22
+ * @alpha
23
+ */
24
+ readonly getStatusBarItems?: () => ReadonlyArray<StatusBarItem>;
25
+ /** Provides backstage items.
26
+ * @alpha
27
+ */
28
+ readonly getBackstageItems?: () => ReadonlyArray<BackstageItem>;
29
+ /** Provides widgets.
30
+ * @note Use [[Widget.layouts]] to map item to location previously specified by `provideWidgets` arguments.
31
+ * @alpha
32
+ */
33
+ readonly getWidgets?: () => ReadonlyArray<Widget>;
34
+ /** Provides toolbar items.
35
+ * @note Use [[UiItemsProvider.getToolbarItems]] instead. To map item to location previously specified by arguments use [[ToolbarItem.layouts]].
36
+ */
17
37
  readonly provideToolbarItems?: (stageId: string, stageUsage: string, toolbarUsage: ToolbarUsage, toolbarOrientation: ToolbarOrientation) => ReadonlyArray<ToolbarItem>;
18
- /** Provides status bar items. */
38
+ /** Provides status bar items.
39
+ * @note Use [[UiItemsProvider.getStatusBarItems]] instead.
40
+ */
19
41
  readonly provideStatusBarItems?: (stageId: string, stageUsage: string) => ReadonlyArray<StatusBarItem>;
20
- /** Provides backstage items. */
42
+ /** Provides backstage items.
43
+ * @note Use [[UiItemsProvider.getBackstageItems]] instead.
44
+ */
21
45
  readonly provideBackstageItems?: () => ReadonlyArray<BackstageItem>;
22
- /** Provides widgets. */
46
+ /** Provides widgets.
47
+ * @note Use [[UiItemsProvider.getWidgets]] instead. To map item to location previously specified by arguments use [[Widget.layouts]].
48
+ */
23
49
  readonly provideWidgets?: (stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection) => ReadonlyArray<Widget>;
24
50
  /** Function called when the provider is unregistered. Allows provider to do a cleanup. */
25
51
  readonly onUnregister?: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"UiItemsProvider.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/ui-items-provider/UiItemsProvider.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EAClB,YAAY,EACb,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,sBAAsB;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB,8BAA8B;IAC9B,QAAQ,CAAC,mBAAmB,CAAC,EAAE,CAC7B,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,YAAY,EAC1B,kBAAkB,EAAE,kBAAkB,KACnC,aAAa,CAAC,WAAW,CAAC,CAAC;IAChC,iCAAiC;IACjC,QAAQ,CAAC,qBAAqB,CAAC,EAAE,CAC/B,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,M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,aAAa,CAAC,CAAC;IAChE;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,aAAa,CAAC,MAAM,CAAC,CAAC;IAElD;;OAEG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,CAC7B,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,YAAY,EAC1B,kBAAkB,EAAE,kBAAkB,KACnC,aAAa,CAAC,WAAW,CAAC,CAAC;IAChC;;OAEG;IACH,QAAQ,CAAC,qBAAqB,CAAC,EAAE,CAC/B,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,KACf,aAAa,CAAC,aAAa,CAAC,CAAC;IAClC;;OAEG;IACH,QAAQ,CAAC,qBAAqB,CAAC,EAAE,MAAM,aAAa,CAAC,aAAa,CAAC,CAAC;IACpE;;OAEG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,CACxB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,CAAC,EAAE,iBAAiB,KACxB,aAAa,CAAC,MAAM,CAAC,CAAC;IAC3B,0FAA0F;IAC1F,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CACpC"}
@@ -1 +1 @@
1
- {"version":3,"file":"UiItemsProvider.js","sourceRoot":"","sources":["../../../../src/appui-react/ui-items-provider/UiItemsProvider.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG","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 UiProvider\n */\n\nimport type { BackstageItem } from \"../backstage/BackstageItem\";\nimport type { StagePanelLocation } from \"../stagepanels/StagePanelLocation\";\nimport type { StagePanelSection } from \"../stagepanels/StagePanelSection\";\nimport type { StatusBarItem } from \"../statusbar/StatusBarItem\";\nimport type {\n ToolbarItem,\n ToolbarOrientation,\n ToolbarUsage,\n} from \"../toolbar/ToolbarItem\";\nimport type { Widget } from \"../widgets/Widget\";\n\n/** Describes interface of objects that want to provide UI component to the running IModelApp.\n * @public\n */\nexport interface UiItemsProvider {\n /** Id of provider. */\n readonly id: string;\n\n /** Provides toolbar items. */\n readonly provideToolbarItems?: (\n stageId: string,\n stageUsage: string,\n toolbarUsage: ToolbarUsage,\n toolbarOrientation: ToolbarOrientation\n ) => ReadonlyArray<ToolbarItem>;\n /** Provides status bar items. */\n readonly provideStatusBarItems?: (\n stageId: string,\n stageUsage: string\n ) => ReadonlyArray<StatusBarItem>;\n /** Provides backstage items. */\n readonly provideBackstageItems?: () => ReadonlyArray<BackstageItem>;\n /** Provides widgets. */\n readonly provideWidgets?: (\n stageId: string,\n stageUsage: string,\n location: StagePanelLocation,\n section?: StagePanelSection\n ) => ReadonlyArray<Widget>;\n /** Function called when the provider is unregistered. Allows provider to do a cleanup. */\n readonly onUnregister?: () => void;\n}\n"]}
1
+ {"version":3,"file":"UiItemsProvider.js","sourceRoot":"","sources":["../../../../src/appui-react/ui-items-provider/UiItemsProvider.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG","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 UiProvider\n */\n\nimport type { BackstageItem } from \"../backstage/BackstageItem\";\nimport type { StagePanelLocation } from \"../stagepanels/StagePanelLocation\";\nimport type { StagePanelSection } from \"../stagepanels/StagePanelSection\";\nimport type { StatusBarItem } from \"../statusbar/StatusBarItem\";\nimport type {\n ToolbarItem,\n ToolbarOrientation,\n ToolbarUsage,\n} from \"../toolbar/ToolbarItem\";\nimport type { Widget } from \"../widgets/Widget\";\n\n/** Describes interface of objects that want to provide UI component to the running IModelApp.\n * @public\n */\nexport interface UiItemsProvider {\n /** Id of provider. */\n readonly id: string;\n\n /** Provides toolbar items.\n * @note Use [[ToolbarItem.layouts]] to map item to location previously specified by `provideToolbarItems` arguments.\n * @alpha\n */\n readonly getToolbarItems?: () => ReadonlyArray<ToolbarItem>;\n /** Provides status bar items.\n * @alpha\n */\n readonly getStatusBarItems?: () => ReadonlyArray<StatusBarItem>;\n /** Provides backstage items.\n * @alpha\n */\n readonly getBackstageItems?: () => ReadonlyArray<BackstageItem>;\n /** Provides widgets.\n * @note Use [[Widget.layouts]] to map item to location previously specified by `provideWidgets` arguments.\n * @alpha\n */\n readonly getWidgets?: () => ReadonlyArray<Widget>;\n\n /** Provides toolbar items.\n * @note Use [[UiItemsProvider.getToolbarItems]] instead. To map item to location previously specified by arguments use [[ToolbarItem.layouts]].\n */\n readonly provideToolbarItems?: (\n stageId: string,\n stageUsage: string,\n toolbarUsage: ToolbarUsage,\n toolbarOrientation: ToolbarOrientation\n ) => ReadonlyArray<ToolbarItem>;\n /** Provides status bar items.\n * @note Use [[UiItemsProvider.getStatusBarItems]] instead.\n */\n readonly provideStatusBarItems?: (\n stageId: string,\n stageUsage: string\n ) => ReadonlyArray<StatusBarItem>;\n /** Provides backstage items.\n * @note Use [[UiItemsProvider.getBackstageItems]] instead.\n */\n readonly provideBackstageItems?: () => ReadonlyArray<BackstageItem>;\n /** Provides widgets.\n * @note Use [[UiItemsProvider.getWidgets]] instead. To map item to location previously specified by arguments use [[Widget.layouts]].\n */\n readonly provideWidgets?: (\n stageId: string,\n stageUsage: string,\n location: StagePanelLocation,\n section?: StagePanelSection\n ) => ReadonlyArray<Widget>;\n /** Function called when the provider is unregistered. Allows provider to do a cleanup. */\n readonly onUnregister?: () => void;\n}\n"]}
@@ -3,8 +3,9 @@
3
3
  */
4
4
  import * as React from "react";
5
5
  import type { XAndY } from "@itwin/core-geometry";
6
- import type { AbstractMenuItemProps, AbstractToolbarProps, DialogLayoutDataProvider, DialogProps, IMatch, OnCancelFunc, OnItemExecutedFunc, OnNumberCommitFunc, OnValueCommitFunc, Primitives, PropertyDescription, PropertyRecord } from "@itwin/appui-abstract";
6
+ import type { AbstractMenuItemProps, AbstractToolbarProps, DialogLayoutDataProvider, DialogProps, OnCancelFunc, OnItemExecutedFunc, OnNumberCommitFunc, OnValueCommitFunc, Primitives, PropertyDescription, PropertyRecord } from "@itwin/appui-abstract";
7
7
  import { RelativePosition, UiAdmin } from "@itwin/appui-abstract";
8
+ import type { IMatch } from "../utils/matchesWords";
8
9
  /** Controls whether localized and/or non-localized key-in strings appear in a KeyinField's auto-completion list.
9
10
  * @public
10
11
  */
@@ -27,7 +28,15 @@ export interface KeyinEntry {
27
28
  /** true if entry was loaded from key-in history */
28
29
  isHistory?: boolean;
29
30
  }
30
- /** The UiAdmin controls various UI components and is callable from IModelApp.uiAdmin in the core-frontend package.
31
+ /** Subclass of `UiAdmin` in `@itwin/core-frontend` to be used to initialize `IModelApp`.
32
+ *
33
+ * This implementation uses themed react components that blends in AppUI look and feel.
34
+ *
35
+ * ```ts
36
+ * await IModelApp.startup({
37
+ * uiAdmin: new FrameworkUiAdmin()
38
+ * });
39
+ * ```
31
40
  * @public
32
41
  */
33
42
  export declare class FrameworkUiAdmin extends UiAdmin {
@@ -1 +1 @@
1
- {"version":3,"file":"FrameworkUiAdmin.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/uiadmin/FrameworkUiAdmin.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,KAAK,EACV,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,EACxB,WAAW,EACX,MAAM,EACN,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,UAAU,EACV,mBAAmB,EACnB,cAAc,EACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,gB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C1B,OAAO;IAgBV,yCAAyC;IACzB,sBAAsB,IAAI,OAAO;IAIjD;;;;;;;OAOG;IACa,UAAU,CACxB,cAAc,EAAE,wBAAwB,EACxC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,OAAO,EAChB,EAAE,EAAE,MAAM,EACV,aAAa,CAAC,EAAE,WAAW,GAC1B,OAAO;IA4BV,yCAAyC;IACzB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;CAwBvD"}
1
+ {"version":3,"file":"FrameworkUiAdmin.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/uiadmin/FrameworkUiAdmin.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,KAAK,EACV,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,EACxB,WAAW,EACX,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,UAAU,EACV,mBAAmB,EACnB,cAAc,EACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAIlE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAKpD;;GAEG;AACH,oBAAY,sBAAsB;IAChC,iDAAiD;IACjD,YAAY,IAAA;IACZ,6CAA6C;IAC7C,SAAS,IAAA;IACT,mEAAmE;IACnE,IAAI,IAAA;CACL;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,mDAAmD;IACnD,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;GAUG;AACH,qBAAa,gBAAiB,SAAQ,OAAO;IAC3C,OAAO,C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S,EAC1C,YAAY,EAAE,oBAAoB,GAAG,SAAS,EAC9C,QAAQ,EAAE,KAAK,EACf,MAAM,EAAE,KAAK,EACb,cAAc,EAAE,kBAAkB,EAClC,QAAQ,EAAE,YAAY,EACtB,gBAAgB,CAAC,EAAE,gBAAgB,EACnC,aAAa,CAAC,EAAE,WAAW,GAC1B,OAAO;IAoBV;;;;;;;;;;;OAWG;IACI,aAAa,CAClB,OAAO,EAAE,KAAK,CAAC,SAAS,EACxB,KAAK,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,EAC1C,YAAY,EAAE,oBAAoB,GAAG,SAAS,EAC9C,QAAQ,EAAE,KAAK,EACf,MAAM,EAAE,KAAK,EACb,cAAc,EAAE,kBAAkB,EAClC,QAAQ,EAAE,YAAY,EACtB,gBAAgB,CAAC,EAAE,gBAAgB,EACnC,aAAa,CAAC,EAAE,WAAW,GAC1B,OAAO;IAqBV,sBAAsB;IACN,QAAQ,IAAI,OAAO;IAInC;;;;;;;;OAQG;IACa,qBAAqB,CACnC,YAAY,EAAE,wBAAwB,EACtC,QAAQ,EAAE,KAAK,EACf,MAAM,EAAE,KAAK,EACb,QAAQ,EAAE,YAAY,EACtB,gBAAgB,CAAC,EAAE,gBAAgB,EACnC,aAAa,CAAC,EAAE,WAAW,GAC1B,OAAO;IAgBV,yCAAyC;IACzB,sBAAsB,IAAI,OAAO;IAIjD;;;;;;;OAOG;IACa,UAAU,CACxB,cAAc,EAAE,wBAAwB,EACxC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,OAAO,EAChB,EAAE,EAAE,MAAM,EACV,aAAa,CAAC,EAAE,WAAW,GAC1B,OAAO;IA4BV,yCAAyC;IACzB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;CAwBvD"}
@@ -28,7 +28,15 @@ var KeyinFieldLocalization;
28
28
  /** Include localized and non-localized strings for each key-in. */
29
29
  KeyinFieldLocalization[KeyinFieldLocalization["Both"] = 2] = "Both";
30
30
  })(KeyinFieldLocalization = exports.KeyinFieldLocalization || (exports.KeyinFieldLocalization = {}));
31
- /** The UiAdmin controls various UI components and is callable from IModelApp.uiAdmin in the core-frontend package.
31
+ /** Subclass of `UiAdmin` in `@itwin/core-frontend` to be used to initialize `IModelApp`.
32
+ *
33
+ * This implementation uses themed react components that blends in AppUI look and feel.
34
+ *
35
+ * ```ts
36
+ * await IModelApp.startup({
37
+ * uiAdmin: new FrameworkUiAdmin()
38
+ * });
39
+ * ```
32
40
  * @public
33
41
  */
34
42
  class FrameworkUiAdmin extends appui_abstract_1.UiAdmin {
@@ -1 +1 @@
1
- {"version":3,"file":"FrameworkUiAdmin.js","sourceRoot":"","sources":["../../../../src/appui-react/uiadmin/FrameworkUiAdmin.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B;AAE/B,wDAAiD;AAejD,0DAAkE;AAClE,2EAAwE;AACxE,mEAAgE;AAChE,wDAAqD;AAErD,gDAA6C;AAC7C,yEAAsE;AAEtE;;GAEG;AACH,IAAY,sBAOX;AAPD,WAAY,sBAAsB;IAChC,iDAAiD;IACjD,mFAAY,CAAA;IACZ,6CAA6C;IAC7C,6EAAS,CAAA;IACT,mEAAmE;IACnE,mEAAI,CAAA;AACN,CAAC,EAPW,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QAOjC;AAcD;;GAEG;AACH,MAAa,gBAAiB,SAAQ,wBAAO;IAA7C;;QACU,8BAAyB,GAC/B,sBAAsB,CAAC,YAAY,CAAC;IAqkBxC,CAAC;IAnkBC,IAAW,wBAAwB;QACjC,OAAO,IAAI,CAAC,yBAAyB,CAAC;IACxC,CAAC;IACD,IAAW,wBAAwB,CAAC,UAAkC;QACpE,IAAI,CAAC,yBAAyB,GAAG,UAAU,CAAC;IAC9C,CAAC;IAED,gBAAgB;IACA,aAAa,KAAI,CAAC;IAElC,wFAAwF;IACxF,IAAoB,cAAc;QAChC,OAAO,qCAAiB,CAAC,cAAc,CAAC;IAC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AAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;YAC7C,OAAO,IAAI,CAAC;SACb;QAED,uBAAuB;QACvB,IACE,yBAAW,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CACzC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,QAAQ,CAC/B,EACD;YACA,yBAAW,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YAClC,OAAO,IAAI,CAAC;SACb;QAED,uBAAuB;QACvB,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAvkBD,4CAukBC","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 Admin\n */\n\nimport * as React from \"react\";\nimport type { XAndY } from \"@itwin/core-geometry\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport type {\n AbstractMenuItemProps,\n AbstractToolbarProps,\n DialogLayoutDataProvider,\n DialogProps,\n IMatch,\n OnCancelFunc,\n OnItemExecutedFunc,\n OnNumberCommitFunc,\n OnValueCommitFunc,\n Primitives,\n PropertyDescription,\n PropertyRecord,\n} from \"@itwin/appui-abstract\";\nimport { RelativePosition, UiAdmin } from \"@itwin/appui-abstract\";\nimport { AccuDrawPopupManager } from \"../accudraw/AccuDrawPopupManager\";\nimport { CursorInformation } from \"../cursor/CursorInformation\";\nimport { PopupManager } from \"../popup/PopupManager\";\nimport type { CursorMenuData } from \"../redux/SessionState\";\nimport { UiFramework } from \"../UiFramework\";\nimport { UiDataProvidedDialog } from \"../dialog/UiDataProvidedDialog\";\n\n/** Controls whether localized and/or non-localized key-in strings appear in a KeyinField's auto-completion list.\n * @public\n */\nexport enum KeyinFieldLocalization {\n /** Include only non-localized key-in strings. */\n NonLocalized,\n /** Include only localized key-in strings. */\n Localized,\n /** Include localized and non-localized strings for each key-in. */\n Both,\n}\n\n/** Defines a keyin entry to show/filter in UI\n * @public\n */\nexport interface KeyinEntry {\n /** string that matched a filter string */\n value: string;\n /** define array of start and end positions of filter matches. */\n matches?: IMatch[];\n /** true if entry was loaded from key-in history */\n isHistory?: boolean;\n}\n\n/** The UiAdmin controls various UI components and is callable from IModelApp.uiAdmin in the core-frontend package.\n * @public\n */\nexport class FrameworkUiAdmin extends UiAdmin {\n private _localizedKeyinPreference: KeyinFieldLocalization =\n KeyinFieldLocalization.NonLocalized;\n\n public get localizedKeyinPreference(): KeyinFieldLocalization {\n return this._localizedKeyinPreference;\n }\n public set localizedKeyinPreference(preference: KeyinFieldLocalization) {\n this._localizedKeyinPreference = preference;\n }\n\n /** @internal */\n public override onInitialized() {}\n\n /** Gets the cursor X and Y position, which is mouseEvent.pageX and mouseEvent.pageY. */\n public override get cursorPosition(): XAndY {\n return CursorInformation.cursorPosition;\n }\n\n /** Determines if focus is set to Home */\n public override get isFocusOnHome(): boolean {\n return UiFramework.keyboardShortcuts.isFocusOnHome;\n }\n\n /** Sets focus to Home */\n public override setFocusToHome(): void {\n UiFramework.keyboardShortcuts.setFocusToHome();\n }\n\n /** Show a context menu at a particular location.\n * @param items Properties of the menu items to display.\n * @param location Location of the context menu, relative to the origin of htmlElement or the overall window.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the menu was displayed, false if the menu could not be displayed.\n */\n public override showContextMenu(\n items: AbstractMenuItemProps[],\n location: XAndY,\n htmlElement?: HTMLElement\n ): boolean {\n let position = location;\n let childWindowId: string | undefined;\n if (htmlElement) {\n const anchorOffset = htmlElement.getBoundingClientRect();\n position = {\n x: anchorOffset.left + location.x,\n y: anchorOffset.top + location.y,\n };\n childWindowId = UiFramework.childWindows.findId(\n htmlElement.ownerDocument.defaultView\n );\n }\n\n const offset = -8;\n position = { x: position.x + offset, y: position.y + offset };\n\n const cursorMenu: CursorMenuData = { position, items, childWindowId };\n UiFramework.openCursorMenu(cursorMenu);\n\n return true;\n }\n\n /** Resolve location and parent element */\n private resolveHtmlElement(\n location: XAndY,\n htmlElement?: HTMLElement\n ): { position: XAndY; el: HTMLElement } {\n const position = location;\n const el = htmlElement ?? UiFramework.controls.getWrapperElement();\n return { position, el };\n }\n\n public getKeyins(): KeyinEntry[] {\n const toolKeyins: KeyinEntry[] = [];\n const tools = IModelApp.tools.getToolList();\n for (const tool of tools) {\n switch (this.localizedKeyinPreference) {\n case KeyinFieldLocalization.Localized:\n toolKeyins.push({ value: tool.keyin });\n break;\n case KeyinFieldLocalization.Both:\n toolKeyins.push({ value: tool.keyin });\n // istanbul ignore else\n if (tool.keyin === tool.englishKeyin) break;\n // istanbul ignore next\n default: // eslint-disable-line no-fallthrough\n case KeyinFieldLocalization.NonLocalized:\n // istanbul ignore next\n if (\n KeyinFieldLocalization.NonLocalized ===\n this.localizedKeyinPreference ||\n (KeyinFieldLocalization.Both === this.localizedKeyinPreference &&\n tool.englishKeyin !== tool.keyin)\n )\n toolKeyins.push({ value: tool.englishKeyin });\n break;\n }\n }\n\n return toolKeyins;\n }\n\n /** Show the Key-in Palette to display key-in from all registered Tools.\n * @param htmlElement The HTMLElement that anchors the Popup. If undefined, the location is relative to the overall window.\n * @return true if the Command Palette was displayed, false if it could not be displayed.\n */\n public override showKeyinPalette(htmlElement?: HTMLElement): boolean {\n if (!this.featureFlags.allowKeyinPalette) return false;\n\n // istanbul ignore next\n const el = htmlElement\n ? htmlElement\n : UiFramework.controls.getWrapperElement();\n\n // istanbul ignore next\n const hidePopup = () => {\n IModelApp.uiAdmin.hideKeyinPalette();\n };\n\n return PopupManager.showKeyinPalette(\n this.getKeyins(),\n el,\n hidePopup,\n hidePopup\n );\n }\n\n /** Hides the Key-in Palette. */\n public override hideKeyinPalette(): boolean {\n if (!this.featureFlags.allowKeyinPalette) return false;\n\n return PopupManager.hideKeyinPalette();\n }\n\n /** Show a Toolbar at a particular location.\n * @param toolbarProps Properties of the Toolbar to display.\n * @param location Location of the Toolbar, relative to the origin of htmlElement or the overall window.\n * @param offset Offset of the Toolbar from the location.\n * @param onItemExecuted Function invoked after a Toolbar item is executed\n * @param onCancel Function invoked when the Escape key is pressed or a click occurs outside the Toolbar\n * @param relativePosition Position relative to the given location. Defaults to TopRight.\n * @param htmlElement The HTMLElement that anchors the Toolbar. If undefined, the location is relative to the overall window.\n * @return true if the Toolbar was displayed, false if the Toolbar could not be displayed.\n */\n public override showToolbar(\n toolbarProps: AbstractToolbarProps,\n location: XAndY,\n offset: XAndY,\n onItemExecuted: OnItemExecutedFunc,\n onCancel: OnCancelFunc,\n relativePosition?: RelativePosition,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n if (relativePosition === undefined)\n relativePosition = RelativePosition.TopRight;\n\n return PopupManager.showToolbar(\n toolbarProps,\n el,\n position,\n offset,\n onItemExecuted,\n onCancel,\n relativePosition\n );\n }\n\n /** Hides the toolbar. */\n public override hideToolbar(): boolean {\n return PopupManager.hideToolbar();\n }\n\n /** Show a menu button at a particular location. A menu button opens a context menu.\n * @param id Id of the menu button. Multiple menu buttons may be displayed.\n * @param menuItemsProps Properties of the menu items to display.\n * @param location Location of the context menu, relative to the origin of htmlElement or the window.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the menu was displayed, false if the menu could not be displayed.\n */\n public override showMenuButton(\n id: string,\n menuItemsProps: AbstractMenuItemProps[],\n location: XAndY,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n return AccuDrawPopupManager.showMenuButton(\n id,\n el,\n position,\n menuItemsProps\n );\n }\n\n /** Hides a menu button.\n * @param id Id of the menu button. Multiple menu buttons may be displayed.\n * @return true if the menu was hidden, false if the menu could not be hidden.\n */\n public override hideMenuButton(id: string): boolean {\n return AccuDrawPopupManager.hideMenuButton(id);\n }\n\n /** Show a calculator at a particular location.\n * @param initialValue Value initially displayed in the calculator.\n * @param resultIcon Icon displayed to the left of the value.\n * @param location Location of the calculator, relative to the origin of htmlElement or the window.\n * @param onOk Function called when the OK button or the Enter key is pressed.\n * @param onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the menu was displayed, false if the menu could not be displayed.\n */\n public override showCalculator(\n initialValue: number,\n resultIcon: string,\n location: XAndY,\n onOk: OnNumberCommitFunc,\n onCancel: OnCancelFunc,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n return AccuDrawPopupManager.showCalculator(\n el,\n position,\n initialValue,\n resultIcon,\n onOk,\n onCancel\n );\n }\n\n /** Hides the calculator. */\n public override hideCalculator(): boolean {\n return AccuDrawPopupManager.hideCalculator();\n }\n\n /** Show an input editor for an angle value at a particular location.\n * @param initialValue Value initially displayed in the editor.\n * @param location Location of the editor, relative to the origin of htmlElement or the window.\n * @param onCommit Function called when the OK button or the Enter key is pressed.\n * @param onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the editor was displayed, false if the editor could not be displayed.\n */\n public override showAngleEditor(\n initialValue: number,\n location: XAndY,\n onCommit: OnNumberCommitFunc,\n onCancel: OnCancelFunc,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n return AccuDrawPopupManager.showAngleEditor(\n el,\n position,\n initialValue,\n onCommit,\n onCancel\n );\n }\n\n /** Show an input editor for a length value at a particular location.\n * @param initialValue Value initially displayed in the editor.\n * @param location Location of the editor, relative to the origin of htmlElement or the window.\n * @param onCommit Function called when the OK button or the Enter key is pressed.\n * @param onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the editor was displayed, false if the editor could not be displayed.\n */\n public override showLengthEditor(\n initialValue: number,\n location: XAndY,\n onCommit: OnNumberCommitFunc,\n onCancel: OnCancelFunc,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n return AccuDrawPopupManager.showLengthEditor(\n el,\n position,\n initialValue,\n onCommit,\n onCancel\n );\n }\n\n /** Show an input editor for a height value at a particular location.\n * @param initialValue Value initially displayed in the editor.\n * @param location Location of the editor, relative to the origin of htmlElement or the window.\n * @param onCommit Function called when the OK button or the Enter key is pressed.\n * @param onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the editor was displayed, false if the editor could not be displayed.\n */\n public override showHeightEditor(\n initialValue: number,\n location: XAndY,\n onCommit: OnNumberCommitFunc,\n onCancel: OnCancelFunc,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n return AccuDrawPopupManager.showHeightEditor(\n el,\n position,\n initialValue,\n onCommit,\n onCancel\n );\n }\n\n /** Show an input editor for a primitive value at a particular location.\n * @param initialValue Value initially displayed in the editor.\n * @param propertyDescription Description of the primitive value property\n * @param location Location of the editor, relative to the origin of htmlElement or the window.\n * @param onCommit Function called when the OK button or the Enter key is pressed.\n * @param onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the editor was displayed, false if the editor could not be displayed.\n */\n public override showInputEditor(\n initialValue: Primitives.Value,\n propertyDescription: PropertyDescription,\n location: XAndY,\n onCommit: OnValueCommitFunc,\n onCancel: OnCancelFunc,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n return PopupManager.showInputEditor(\n el,\n position,\n initialValue,\n propertyDescription,\n onCommit,\n onCancel\n );\n }\n\n /** Hides the input editor. */\n public override hideInputEditor(): boolean {\n return PopupManager.hideInputEditor();\n }\n\n /** Show an HTML element at a particular location.\n * @param displayElement The HTMLElement to display\n * @param location Location of the display element, relative to the origin of htmlElement or the window\n * @param offset Offset of the display element from the location\n * @param onCancel Function invoked when the Escape key is pressed or a click occurs outside the display element\n * @param relativePosition Position relative to the given location. Defaults to TopRight.\n * @param anchorElement The HTMLElement that anchors the display element. If undefined, the location is relative to the overall window.\n * @return true if the display element was displayed, false if the display element could not be displayed.\n */\n public override showHTMLElement(\n displayElement: HTMLElement,\n location: XAndY,\n offset: XAndY,\n onCancel: OnCancelFunc,\n relativePosition?: RelativePosition,\n anchorElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, anchorElement);\n\n // istanbul ignore if\n if (relativePosition === undefined)\n relativePosition = RelativePosition.TopRight;\n\n return PopupManager.showHTMLElement(\n displayElement,\n el,\n position,\n offset,\n onCancel,\n relativePosition\n );\n }\n\n /** Hides the HTML Element. */\n public override hideHTMLElement(): boolean {\n return PopupManager.hideHTMLElement();\n }\n\n /** Show a Card containing content, a title and a toolbar at a particular location.\n * @param content The HTMLElement of the content to display\n * @param title Title to display at the top of the card.\n * @param toolbarProps Properties of the Toolbar to display.\n * @param location Location of the Card, relative to the origin of htmlElement or the window.\n * @param offset Offset of the Card from the location.\n * @param onItemExecuted Function invoked after a Toolbar item is executed\n * @param onCancel Function invoked when the Escape key is pressed or a click occurs outside the Card\n * @param relativePosition Position relative to the given location. Defaults to TopRight.\n * @param anchorElement The HTMLElement that anchors the Card. If undefined, the location is relative to the overall window.\n * @return true if the Card was displayed, false if the Card could not be displayed.\n */\n public override showCard(\n content: HTMLElement,\n title: string | PropertyRecord | undefined,\n toolbarProps: AbstractToolbarProps | undefined,\n location: XAndY,\n offset: XAndY,\n onItemExecuted: OnItemExecutedFunc,\n onCancel: OnCancelFunc,\n relativePosition?: RelativePosition,\n anchorElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, anchorElement);\n\n // istanbul ignore if\n if (relativePosition === undefined)\n relativePosition = RelativePosition.TopRight;\n\n return PopupManager.showCard(\n content,\n title,\n toolbarProps,\n el,\n position,\n offset,\n onItemExecuted,\n onCancel,\n relativePosition\n );\n }\n\n /** Show a Card containing React-based content, a title and a toolbar at a particular location.\n * @param content The React node of the content to display\n * @param title Title to display at the top of the card.\n * @param toolbarProps Properties of the Toolbar to display.\n * @param location Location of the Card, relative to the origin of htmlElement or the window.\n * @param offset Offset of the Card from the location.\n * @param onItemExecuted Function invoked after a Toolbar item is executed\n * @param onCancel Function invoked when the Escape key is pressed or a click occurs outside the Card\n * @param relativePosition Position relative to the given location. Defaults to TopRight.\n * @param anchorElement The HTMLElement that anchors the Card. If undefined, the location is relative to the overall window.\n * @return true if the Card was displayed, false if the Card could not be displayed.\n */\n public showReactCard(\n content: React.ReactNode,\n title: string | PropertyRecord | undefined,\n toolbarProps: AbstractToolbarProps | undefined,\n location: XAndY,\n offset: XAndY,\n onItemExecuted: OnItemExecutedFunc,\n onCancel: OnCancelFunc,\n relativePosition?: RelativePosition,\n anchorElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, anchorElement);\n const reactContent = { reactNode: content };\n\n // istanbul ignore if\n if (relativePosition === undefined)\n relativePosition = RelativePosition.TopRight;\n\n return PopupManager.showCard(\n reactContent,\n title,\n toolbarProps,\n el,\n position,\n offset,\n onItemExecuted,\n onCancel,\n relativePosition\n );\n }\n\n /** Hides the Card. */\n public override hideCard(): boolean {\n return PopupManager.hideCard();\n }\n\n /** Opens a Tool Settings Ui popup at a particular location.\n * @param dataProvider The DialogLayoutDataProvider for the tool settings popup dialog.\n * @param location Location of the tool settings, relative to the origin of anchorElement or the window\n * @param offset Offset of the tool settings from the location\n * @param onCancel Function invoked when the Escape key is pressed or a click occurs outside the tool settings\n * @param relativePosition Position relative to the given location. Defaults to TopRight.\n * @param anchorElement The HTMLElement that anchors the tool settings. If undefined, the location is relative to the overall window.\n * @return true if the tool settings were displayed, false if the tool settings could not be displayed.\n */\n public override openToolSettingsPopup(\n dataProvider: DialogLayoutDataProvider,\n location: XAndY,\n offset: XAndY,\n onCancel: OnCancelFunc,\n relativePosition?: RelativePosition,\n anchorElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, anchorElement);\n\n if (relativePosition === undefined)\n relativePosition = RelativePosition.TopRight;\n\n return PopupManager.openToolSettings(\n dataProvider,\n el,\n position,\n offset,\n onCancel,\n relativePosition\n );\n }\n\n /** Closes the Tool Settings Ui popup. */\n public override closeToolSettingsPopup(): boolean {\n return PopupManager.closeToolSettings();\n }\n\n /** Opens a Dialog and automatically populates it using the properties defined by the UiDataProvider.\n * @param uiDataProvider The UiDataProvider for the tool settings\n * @param title Specify title for dialog.\n * @param isModal Specify if the dialog is opened as a modal or modeless.\n * @param id Id of the dialog that is used to close it.\n * @param optionalProps Optional props for Dialog construction.\n * @return true if the tool settings were displayed, false if the tool settings could not be displayed.\n */\n public override openDialog(\n uiDataProvider: DialogLayoutDataProvider,\n title: string,\n isModal: boolean,\n id: string,\n optionalProps?: DialogProps\n ): boolean {\n if (isModal) {\n UiFramework.dialogs.modal.open(\n <UiDataProvidedDialog\n uiDataProvider={uiDataProvider}\n title={title}\n isModal={isModal}\n id={id}\n {...optionalProps}\n />,\n id\n );\n return true;\n } else {\n UiFramework.dialogs.modeless.open(\n <UiDataProvidedDialog\n uiDataProvider={uiDataProvider}\n title={title}\n isModal={isModal}\n id={id}\n {...optionalProps}\n />,\n id\n );\n return true;\n }\n }\n\n /** Closes the Tool Settings Ui popup. */\n public override closeDialog(dialogId: string): boolean {\n // istanbul ignore else\n if (\n UiFramework.dialogs.modeless.dialogs.findIndex(\n (info) => info.id === dialogId\n )\n ) {\n UiFramework.dialogs.modeless.close(dialogId);\n return true;\n }\n\n // istanbul ignore else\n if (\n UiFramework.dialogs.modal.dialogs.findIndex(\n (info) => info.id === dialogId\n )\n ) {\n UiFramework.dialogs.modal.close();\n return true;\n }\n\n // istanbul ignore next\n return false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QAED,uBAAuB;QACvB,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAvkBD,4CAukBC","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 Admin\n */\n\nimport * as React from \"react\";\nimport type { XAndY } from \"@itwin/core-geometry\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport type {\n AbstractMenuItemProps,\n AbstractToolbarProps,\n DialogLayoutDataProvider,\n DialogProps,\n OnCancelFunc,\n OnItemExecutedFunc,\n OnNumberCommitFunc,\n OnValueCommitFunc,\n Primitives,\n PropertyDescription,\n PropertyRecord,\n} from \"@itwin/appui-abstract\";\nimport { RelativePosition, UiAdmin } from \"@itwin/appui-abstract\";\nimport { AccuDrawPopupManager } from \"../accudraw/AccuDrawPopupManager\";\nimport { CursorInformation } from \"../cursor/CursorInformation\";\nimport { PopupManager } from \"../popup/PopupManager\";\nimport type { IMatch } from \"../utils/matchesWords\";\nimport type { CursorMenuData } from \"../redux/SessionState\";\nimport { UiFramework } from \"../UiFramework\";\nimport { UiDataProvidedDialog } from \"../dialog/UiDataProvidedDialog\";\n\n/** Controls whether localized and/or non-localized key-in strings appear in a KeyinField's auto-completion list.\n * @public\n */\nexport enum KeyinFieldLocalization {\n /** Include only non-localized key-in strings. */\n NonLocalized,\n /** Include only localized key-in strings. */\n Localized,\n /** Include localized and non-localized strings for each key-in. */\n Both,\n}\n\n/** Defines a keyin entry to show/filter in UI\n * @public\n */\nexport interface KeyinEntry {\n /** string that matched a filter string */\n value: string;\n /** define array of start and end positions of filter matches. */\n matches?: IMatch[];\n /** true if entry was loaded from key-in history */\n isHistory?: boolean;\n}\n\n/** Subclass of `UiAdmin` in `@itwin/core-frontend` to be used to initialize `IModelApp`.\n *\n * This implementation uses themed react components that blends in AppUI look and feel.\n *\n * ```ts\n * await IModelApp.startup({\n * uiAdmin: new FrameworkUiAdmin()\n * });\n * ```\n * @public\n */\nexport class FrameworkUiAdmin extends UiAdmin {\n private _localizedKeyinPreference: KeyinFieldLocalization =\n KeyinFieldLocalization.NonLocalized;\n\n public get localizedKeyinPreference(): KeyinFieldLocalization {\n return this._localizedKeyinPreference;\n }\n public set localizedKeyinPreference(preference: KeyinFieldLocalization) {\n this._localizedKeyinPreference = preference;\n }\n\n /** @internal */\n public override onInitialized() {}\n\n /** Gets the cursor X and Y position, which is mouseEvent.pageX and mouseEvent.pageY. */\n public override get cursorPosition(): XAndY {\n return CursorInformation.cursorPosition;\n }\n\n /** Determines if focus is set to Home */\n public override get isFocusOnHome(): boolean {\n return UiFramework.keyboardShortcuts.isFocusOnHome;\n }\n\n /** Sets focus to Home */\n public override setFocusToHome(): void {\n UiFramework.keyboardShortcuts.setFocusToHome();\n }\n\n /** Show a context menu at a particular location.\n * @param items Properties of the menu items to display.\n * @param location Location of the context menu, relative to the origin of htmlElement or the overall window.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the menu was displayed, false if the menu could not be displayed.\n */\n public override showContextMenu(\n items: AbstractMenuItemProps[],\n location: XAndY,\n htmlElement?: HTMLElement\n ): boolean {\n let position = location;\n let childWindowId: string | undefined;\n if (htmlElement) {\n const anchorOffset = htmlElement.getBoundingClientRect();\n position = {\n x: anchorOffset.left + location.x,\n y: anchorOffset.top + location.y,\n };\n childWindowId = UiFramework.childWindows.findId(\n htmlElement.ownerDocument.defaultView\n );\n }\n\n const offset = -8;\n position = { x: position.x + offset, y: position.y + offset };\n\n const cursorMenu: CursorMenuData = { position, items, childWindowId };\n UiFramework.openCursorMenu(cursorMenu);\n\n return true;\n }\n\n /** Resolve location and parent element */\n private resolveHtmlElement(\n location: XAndY,\n htmlElement?: HTMLElement\n ): { position: XAndY; el: HTMLElement } {\n const position = location;\n const el = htmlElement ?? UiFramework.controls.getWrapperElement();\n return { position, el };\n }\n\n public getKeyins(): KeyinEntry[] {\n const toolKeyins: KeyinEntry[] = [];\n const tools = IModelApp.tools.getToolList();\n for (const tool of tools) {\n switch (this.localizedKeyinPreference) {\n case KeyinFieldLocalization.Localized:\n toolKeyins.push({ value: tool.keyin });\n break;\n case KeyinFieldLocalization.Both:\n toolKeyins.push({ value: tool.keyin });\n // istanbul ignore else\n if (tool.keyin === tool.englishKeyin) break;\n // istanbul ignore next\n default: // eslint-disable-line no-fallthrough\n case KeyinFieldLocalization.NonLocalized:\n // istanbul ignore next\n if (\n KeyinFieldLocalization.NonLocalized ===\n this.localizedKeyinPreference ||\n (KeyinFieldLocalization.Both === this.localizedKeyinPreference &&\n tool.englishKeyin !== tool.keyin)\n )\n toolKeyins.push({ value: tool.englishKeyin });\n break;\n }\n }\n\n return toolKeyins;\n }\n\n /** Show the Key-in Palette to display key-in from all registered Tools.\n * @param htmlElement The HTMLElement that anchors the Popup. If undefined, the location is relative to the overall window.\n * @return true if the Command Palette was displayed, false if it could not be displayed.\n */\n public override showKeyinPalette(htmlElement?: HTMLElement): boolean {\n if (!this.featureFlags.allowKeyinPalette) return false;\n\n // istanbul ignore next\n const el = htmlElement\n ? htmlElement\n : UiFramework.controls.getWrapperElement();\n\n // istanbul ignore next\n const hidePopup = () => {\n IModelApp.uiAdmin.hideKeyinPalette();\n };\n\n return PopupManager.showKeyinPalette(\n this.getKeyins(),\n el,\n hidePopup,\n hidePopup\n );\n }\n\n /** Hides the Key-in Palette. */\n public override hideKeyinPalette(): boolean {\n if (!this.featureFlags.allowKeyinPalette) return false;\n\n return PopupManager.hideKeyinPalette();\n }\n\n /** Show a Toolbar at a particular location.\n * @param toolbarProps Properties of the Toolbar to display.\n * @param location Location of the Toolbar, relative to the origin of htmlElement or the overall window.\n * @param offset Offset of the Toolbar from the location.\n * @param onItemExecuted Function invoked after a Toolbar item is executed\n * @param onCancel Function invoked when the Escape key is pressed or a click occurs outside the Toolbar\n * @param relativePosition Position relative to the given location. Defaults to TopRight.\n * @param htmlElement The HTMLElement that anchors the Toolbar. If undefined, the location is relative to the overall window.\n * @return true if the Toolbar was displayed, false if the Toolbar could not be displayed.\n */\n public override showToolbar(\n toolbarProps: AbstractToolbarProps,\n location: XAndY,\n offset: XAndY,\n onItemExecuted: OnItemExecutedFunc,\n onCancel: OnCancelFunc,\n relativePosition?: RelativePosition,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n if (relativePosition === undefined)\n relativePosition = RelativePosition.TopRight;\n\n return PopupManager.showToolbar(\n toolbarProps,\n el,\n position,\n offset,\n onItemExecuted,\n onCancel,\n relativePosition\n );\n }\n\n /** Hides the toolbar. */\n public override hideToolbar(): boolean {\n return PopupManager.hideToolbar();\n }\n\n /** Show a menu button at a particular location. A menu button opens a context menu.\n * @param id Id of the menu button. Multiple menu buttons may be displayed.\n * @param menuItemsProps Properties of the menu items to display.\n * @param location Location of the context menu, relative to the origin of htmlElement or the window.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the menu was displayed, false if the menu could not be displayed.\n */\n public override showMenuButton(\n id: string,\n menuItemsProps: AbstractMenuItemProps[],\n location: XAndY,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n return AccuDrawPopupManager.showMenuButton(\n id,\n el,\n position,\n menuItemsProps\n );\n }\n\n /** Hides a menu button.\n * @param id Id of the menu button. Multiple menu buttons may be displayed.\n * @return true if the menu was hidden, false if the menu could not be hidden.\n */\n public override hideMenuButton(id: string): boolean {\n return AccuDrawPopupManager.hideMenuButton(id);\n }\n\n /** Show a calculator at a particular location.\n * @param initialValue Value initially displayed in the calculator.\n * @param resultIcon Icon displayed to the left of the value.\n * @param location Location of the calculator, relative to the origin of htmlElement or the window.\n * @param onOk Function called when the OK button or the Enter key is pressed.\n * @param onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the menu was displayed, false if the menu could not be displayed.\n */\n public override showCalculator(\n initialValue: number,\n resultIcon: string,\n location: XAndY,\n onOk: OnNumberCommitFunc,\n onCancel: OnCancelFunc,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n return AccuDrawPopupManager.showCalculator(\n el,\n position,\n initialValue,\n resultIcon,\n onOk,\n onCancel\n );\n }\n\n /** Hides the calculator. */\n public override hideCalculator(): boolean {\n return AccuDrawPopupManager.hideCalculator();\n }\n\n /** Show an input editor for an angle value at a particular location.\n * @param initialValue Value initially displayed in the editor.\n * @param location Location of the editor, relative to the origin of htmlElement or the window.\n * @param onCommit Function called when the OK button or the Enter key is pressed.\n * @param onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the editor was displayed, false if the editor could not be displayed.\n */\n public override showAngleEditor(\n initialValue: number,\n location: XAndY,\n onCommit: OnNumberCommitFunc,\n onCancel: OnCancelFunc,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n return AccuDrawPopupManager.showAngleEditor(\n el,\n position,\n initialValue,\n onCommit,\n onCancel\n );\n }\n\n /** Show an input editor for a length value at a particular location.\n * @param initialValue Value initially displayed in the editor.\n * @param location Location of the editor, relative to the origin of htmlElement or the window.\n * @param onCommit Function called when the OK button or the Enter key is pressed.\n * @param onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the editor was displayed, false if the editor could not be displayed.\n */\n public override showLengthEditor(\n initialValue: number,\n location: XAndY,\n onCommit: OnNumberCommitFunc,\n onCancel: OnCancelFunc,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n return AccuDrawPopupManager.showLengthEditor(\n el,\n position,\n initialValue,\n onCommit,\n onCancel\n );\n }\n\n /** Show an input editor for a height value at a particular location.\n * @param initialValue Value initially displayed in the editor.\n * @param location Location of the editor, relative to the origin of htmlElement or the window.\n * @param onCommit Function called when the OK button or the Enter key is pressed.\n * @param onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the editor was displayed, false if the editor could not be displayed.\n */\n public override showHeightEditor(\n initialValue: number,\n location: XAndY,\n onCommit: OnNumberCommitFunc,\n onCancel: OnCancelFunc,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n return AccuDrawPopupManager.showHeightEditor(\n el,\n position,\n initialValue,\n onCommit,\n onCancel\n );\n }\n\n /** Show an input editor for a primitive value at a particular location.\n * @param initialValue Value initially displayed in the editor.\n * @param propertyDescription Description of the primitive value property\n * @param location Location of the editor, relative to the origin of htmlElement or the window.\n * @param onCommit Function called when the OK button or the Enter key is pressed.\n * @param onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the editor was displayed, false if the editor could not be displayed.\n */\n public override showInputEditor(\n initialValue: Primitives.Value,\n propertyDescription: PropertyDescription,\n location: XAndY,\n onCommit: OnValueCommitFunc,\n onCancel: OnCancelFunc,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n return PopupManager.showInputEditor(\n el,\n position,\n initialValue,\n propertyDescription,\n onCommit,\n onCancel\n );\n }\n\n /** Hides the input editor. */\n public override hideInputEditor(): boolean {\n return PopupManager.hideInputEditor();\n }\n\n /** Show an HTML element at a particular location.\n * @param displayElement The HTMLElement to display\n * @param location Location of the display element, relative to the origin of htmlElement or the window\n * @param offset Offset of the display element from the location\n * @param onCancel Function invoked when the Escape key is pressed or a click occurs outside the display element\n * @param relativePosition Position relative to the given location. Defaults to TopRight.\n * @param anchorElement The HTMLElement that anchors the display element. If undefined, the location is relative to the overall window.\n * @return true if the display element was displayed, false if the display element could not be displayed.\n */\n public override showHTMLElement(\n displayElement: HTMLElement,\n location: XAndY,\n offset: XAndY,\n onCancel: OnCancelFunc,\n relativePosition?: RelativePosition,\n anchorElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, anchorElement);\n\n // istanbul ignore if\n if (relativePosition === undefined)\n relativePosition = RelativePosition.TopRight;\n\n return PopupManager.showHTMLElement(\n displayElement,\n el,\n position,\n offset,\n onCancel,\n relativePosition\n );\n }\n\n /** Hides the HTML Element. */\n public override hideHTMLElement(): boolean {\n return PopupManager.hideHTMLElement();\n }\n\n /** Show a Card containing content, a title and a toolbar at a particular location.\n * @param content The HTMLElement of the content to display\n * @param title Title to display at the top of the card.\n * @param toolbarProps Properties of the Toolbar to display.\n * @param location Location of the Card, relative to the origin of htmlElement or the window.\n * @param offset Offset of the Card from the location.\n * @param onItemExecuted Function invoked after a Toolbar item is executed\n * @param onCancel Function invoked when the Escape key is pressed or a click occurs outside the Card\n * @param relativePosition Position relative to the given location. Defaults to TopRight.\n * @param anchorElement The HTMLElement that anchors the Card. If undefined, the location is relative to the overall window.\n * @return true if the Card was displayed, false if the Card could not be displayed.\n */\n public override showCard(\n content: HTMLElement,\n title: string | PropertyRecord | undefined,\n toolbarProps: AbstractToolbarProps | undefined,\n location: XAndY,\n offset: XAndY,\n onItemExecuted: OnItemExecutedFunc,\n onCancel: OnCancelFunc,\n relativePosition?: RelativePosition,\n anchorElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, anchorElement);\n\n // istanbul ignore if\n if (relativePosition === undefined)\n relativePosition = RelativePosition.TopRight;\n\n return PopupManager.showCard(\n content,\n title,\n toolbarProps,\n el,\n position,\n offset,\n onItemExecuted,\n onCancel,\n relativePosition\n );\n }\n\n /** Show a Card containing React-based content, a title and a toolbar at a particular location.\n * @param content The React node of the content to display\n * @param title Title to display at the top of the card.\n * @param toolbarProps Properties of the Toolbar to display.\n * @param location Location of the Card, relative to the origin of htmlElement or the window.\n * @param offset Offset of the Card from the location.\n * @param onItemExecuted Function invoked after a Toolbar item is executed\n * @param onCancel Function invoked when the Escape key is pressed or a click occurs outside the Card\n * @param relativePosition Position relative to the given location. Defaults to TopRight.\n * @param anchorElement The HTMLElement that anchors the Card. If undefined, the location is relative to the overall window.\n * @return true if the Card was displayed, false if the Card could not be displayed.\n */\n public showReactCard(\n content: React.ReactNode,\n title: string | PropertyRecord | undefined,\n toolbarProps: AbstractToolbarProps | undefined,\n location: XAndY,\n offset: XAndY,\n onItemExecuted: OnItemExecutedFunc,\n onCancel: OnCancelFunc,\n relativePosition?: RelativePosition,\n anchorElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, anchorElement);\n const reactContent = { reactNode: content };\n\n // istanbul ignore if\n if (relativePosition === undefined)\n relativePosition = RelativePosition.TopRight;\n\n return PopupManager.showCard(\n reactContent,\n title,\n toolbarProps,\n el,\n position,\n offset,\n onItemExecuted,\n onCancel,\n relativePosition\n );\n }\n\n /** Hides the Card. */\n public override hideCard(): boolean {\n return PopupManager.hideCard();\n }\n\n /** Opens a Tool Settings Ui popup at a particular location.\n * @param dataProvider The DialogLayoutDataProvider for the tool settings popup dialog.\n * @param location Location of the tool settings, relative to the origin of anchorElement or the window\n * @param offset Offset of the tool settings from the location\n * @param onCancel Function invoked when the Escape key is pressed or a click occurs outside the tool settings\n * @param relativePosition Position relative to the given location. Defaults to TopRight.\n * @param anchorElement The HTMLElement that anchors the tool settings. If undefined, the location is relative to the overall window.\n * @return true if the tool settings were displayed, false if the tool settings could not be displayed.\n */\n public override openToolSettingsPopup(\n dataProvider: DialogLayoutDataProvider,\n location: XAndY,\n offset: XAndY,\n onCancel: OnCancelFunc,\n relativePosition?: RelativePosition,\n anchorElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, anchorElement);\n\n if (relativePosition === undefined)\n relativePosition = RelativePosition.TopRight;\n\n return PopupManager.openToolSettings(\n dataProvider,\n el,\n position,\n offset,\n onCancel,\n relativePosition\n );\n }\n\n /** Closes the Tool Settings Ui popup. */\n public override closeToolSettingsPopup(): boolean {\n return PopupManager.closeToolSettings();\n }\n\n /** Opens a Dialog and automatically populates it using the properties defined by the UiDataProvider.\n * @param uiDataProvider The UiDataProvider for the tool settings\n * @param title Specify title for dialog.\n * @param isModal Specify if the dialog is opened as a modal or modeless.\n * @param id Id of the dialog that is used to close it.\n * @param optionalProps Optional props for Dialog construction.\n * @return true if the tool settings were displayed, false if the tool settings could not be displayed.\n */\n public override openDialog(\n uiDataProvider: DialogLayoutDataProvider,\n title: string,\n isModal: boolean,\n id: string,\n optionalProps?: DialogProps\n ): boolean {\n if (isModal) {\n UiFramework.dialogs.modal.open(\n <UiDataProvidedDialog\n uiDataProvider={uiDataProvider}\n title={title}\n isModal={isModal}\n id={id}\n {...optionalProps}\n />,\n id\n );\n return true;\n } else {\n UiFramework.dialogs.modeless.open(\n <UiDataProvidedDialog\n uiDataProvider={uiDataProvider}\n title={title}\n isModal={isModal}\n id={id}\n {...optionalProps}\n />,\n id\n );\n return true;\n }\n }\n\n /** Closes the Tool Settings Ui popup. */\n public override closeDialog(dialogId: string): boolean {\n // istanbul ignore else\n if (\n UiFramework.dialogs.modeless.dialogs.findIndex(\n (info) => info.id === dialogId\n )\n ) {\n UiFramework.dialogs.modeless.close(dialogId);\n return true;\n }\n\n // istanbul ignore else\n if (\n UiFramework.dialogs.modal.dialogs.findIndex(\n (info) => info.id === dialogId\n )\n ) {\n UiFramework.dialogs.modal.close();\n return true;\n }\n\n // istanbul ignore next\n return false;\n }\n}\n"]}