@itwin/appui-react 4.5.1 → 4.6.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 (370) hide show
  1. package/CHANGELOG.md +13 -1
  2. package/lib/cjs/appui-react/UiFramework.js +7 -4
  3. package/lib/cjs/appui-react/UiFramework.js.map +1 -1
  4. package/lib/cjs/appui-react/accudraw/MenuButton.d.ts +2 -2
  5. package/lib/cjs/appui-react/accudraw/MenuButton.d.ts.map +1 -1
  6. package/lib/cjs/appui-react/accudraw/MenuButton.js.map +1 -1
  7. package/lib/cjs/appui-react/backstage/BackstageComposer.d.ts.map +1 -1
  8. package/lib/cjs/appui-react/backstage/BackstageComposer.js.map +1 -1
  9. package/lib/cjs/appui-react/backstage/BackstageComposerItem.js +2 -1
  10. package/lib/cjs/appui-react/backstage/BackstageComposerItem.js.map +1 -1
  11. package/lib/cjs/appui-react/childwindow/CopyStyles.d.ts.map +1 -1
  12. package/lib/cjs/appui-react/childwindow/CopyStyles.js +3 -1
  13. package/lib/cjs/appui-react/childwindow/CopyStyles.js.map +1 -1
  14. package/lib/cjs/appui-react/childwindow/InternalChildWindowManager.d.ts.map +1 -1
  15. package/lib/cjs/appui-react/childwindow/InternalChildWindowManager.js +3 -2
  16. package/lib/cjs/appui-react/childwindow/InternalChildWindowManager.js.map +1 -1
  17. package/lib/cjs/appui-react/configurableui/InternalConfigurableUiManager.js +1 -1
  18. package/lib/cjs/appui-react/configurableui/InternalConfigurableUiManager.js.map +1 -1
  19. package/lib/cjs/appui-react/configurableui/TimeTracker.js +2 -1
  20. package/lib/cjs/appui-react/configurableui/TimeTracker.js.map +1 -1
  21. package/lib/cjs/appui-react/content/ContentLayout.js +12 -9
  22. package/lib/cjs/appui-react/content/ContentLayout.js.map +1 -1
  23. package/lib/cjs/appui-react/content/DefaultViewOverlay.js +4 -3
  24. package/lib/cjs/appui-react/content/DefaultViewOverlay.js.map +1 -1
  25. package/lib/cjs/appui-react/content/FloatingViewportContent.js +2 -1
  26. package/lib/cjs/appui-react/content/FloatingViewportContent.js.map +1 -1
  27. package/lib/cjs/appui-react/content/IModelViewport.js +6 -3
  28. package/lib/cjs/appui-react/content/IModelViewport.js.map +1 -1
  29. package/lib/cjs/appui-react/content/InternalContentLayoutManager.js +2 -1
  30. package/lib/cjs/appui-react/content/InternalContentLayoutManager.js.map +1 -1
  31. package/lib/cjs/appui-react/content/InternalContentViewManager.js +1 -1
  32. package/lib/cjs/appui-react/content/InternalContentViewManager.js.map +1 -1
  33. package/lib/cjs/appui-react/content/split-pane/SplitPane.js +12 -10
  34. package/lib/cjs/appui-react/content/split-pane/SplitPane.js.map +1 -1
  35. package/lib/cjs/appui-react/cursor/CursorInformation.d.ts +6 -6
  36. package/lib/cjs/appui-react/cursor/CursorInformation.d.ts.map +1 -1
  37. package/lib/cjs/appui-react/cursor/CursorInformation.js.map +1 -1
  38. package/lib/cjs/appui-react/cursor/cursormenu/CursorMenu.d.ts.map +1 -1
  39. package/lib/cjs/appui-react/cursor/cursormenu/CursorMenu.js +3 -2
  40. package/lib/cjs/appui-react/cursor/cursormenu/CursorMenu.js.map +1 -1
  41. package/lib/cjs/appui-react/cursor/cursorpopup/CursorPopup.d.ts +4 -4
  42. package/lib/cjs/appui-react/cursor/cursorpopup/CursorPopup.d.ts.map +1 -1
  43. package/lib/cjs/appui-react/cursor/cursorpopup/CursorPopup.js.map +1 -1
  44. package/lib/cjs/appui-react/cursor/cursorpopup/CursorPopupManager.d.ts +5 -5
  45. package/lib/cjs/appui-react/cursor/cursorpopup/CursorPopupManager.d.ts.map +1 -1
  46. package/lib/cjs/appui-react/cursor/cursorpopup/CursorPopupManager.js.map +1 -1
  47. package/lib/cjs/appui-react/cursor/cursorprompt/CursorPrompt.d.ts +2 -2
  48. package/lib/cjs/appui-react/cursor/cursorprompt/CursorPrompt.d.ts.map +1 -1
  49. package/lib/cjs/appui-react/cursor/cursorprompt/CursorPrompt.js.map +1 -1
  50. package/lib/cjs/appui-react/dialog/ContentDialog.js +6 -3
  51. package/lib/cjs/appui-react/dialog/ContentDialog.js.map +1 -1
  52. package/lib/cjs/appui-react/dialog/DialogManagerBase.js +3 -2
  53. package/lib/cjs/appui-react/dialog/DialogManagerBase.js.map +1 -1
  54. package/lib/cjs/appui-react/feedback/ElementTooltip.d.ts +1 -2
  55. package/lib/cjs/appui-react/feedback/ElementTooltip.d.ts.map +1 -1
  56. package/lib/cjs/appui-react/feedback/ElementTooltip.js.map +1 -1
  57. package/lib/cjs/appui-react/frontstage/FrontstageDef.d.ts +22 -26
  58. package/lib/cjs/appui-react/frontstage/FrontstageDef.d.ts.map +1 -1
  59. package/lib/cjs/appui-react/frontstage/FrontstageDef.js +166 -217
  60. package/lib/cjs/appui-react/frontstage/FrontstageDef.js.map +1 -1
  61. package/lib/cjs/appui-react/frontstage/InternalFrontstageManager.d.ts +1 -7
  62. package/lib/cjs/appui-react/frontstage/InternalFrontstageManager.d.ts.map +1 -1
  63. package/lib/cjs/appui-react/frontstage/InternalFrontstageManager.js +0 -6
  64. package/lib/cjs/appui-react/frontstage/InternalFrontstageManager.js.map +1 -1
  65. package/lib/cjs/appui-react/frontstage/ModalSettingsStage.js +3 -2
  66. package/lib/cjs/appui-react/frontstage/ModalSettingsStage.js.map +1 -1
  67. package/lib/cjs/appui-react/frontstage/StandardFrontstageProvider.js +2 -1
  68. package/lib/cjs/appui-react/frontstage/StandardFrontstageProvider.js.map +1 -1
  69. package/lib/cjs/appui-react/hooks/useActiveIModelConnection.d.ts.map +1 -1
  70. package/lib/cjs/appui-react/hooks/useActiveIModelConnection.js.map +1 -1
  71. package/lib/cjs/appui-react/hooks/useActiveViewport.d.ts.map +1 -1
  72. package/lib/cjs/appui-react/hooks/useActiveViewport.js.map +1 -1
  73. package/lib/cjs/appui-react/hooks/useAnalysisAnimationDataProvider.js +11 -7
  74. package/lib/cjs/appui-react/hooks/useAnalysisAnimationDataProvider.js.map +1 -1
  75. package/lib/cjs/appui-react/hooks/useScheduleAnimationDataProvider.js +11 -7
  76. package/lib/cjs/appui-react/hooks/useScheduleAnimationDataProvider.js.map +1 -1
  77. package/lib/cjs/appui-react/hooks/useSolarDataProvider.js +13 -8
  78. package/lib/cjs/appui-react/hooks/useSolarDataProvider.js.map +1 -1
  79. package/lib/cjs/appui-react/keyboardshortcut/InternalKeyboardShortcut.d.ts.map +1 -1
  80. package/lib/cjs/appui-react/keyboardshortcut/InternalKeyboardShortcut.js.map +1 -1
  81. package/lib/cjs/appui-react/messages/ActivityMessage.js +7 -5
  82. package/lib/cjs/appui-react/messages/ActivityMessage.js.map +1 -1
  83. package/lib/cjs/appui-react/messages/MessageManager.d.ts +0 -1
  84. package/lib/cjs/appui-react/messages/MessageManager.d.ts.map +1 -1
  85. package/lib/cjs/appui-react/messages/MessageManager.js +1 -2
  86. package/lib/cjs/appui-react/messages/MessageManager.js.map +1 -1
  87. package/lib/cjs/appui-react/messages/Pointer.d.ts +1 -2
  88. package/lib/cjs/appui-react/messages/Pointer.d.ts.map +1 -1
  89. package/lib/cjs/appui-react/messages/Pointer.js +1 -1
  90. package/lib/cjs/appui-react/messages/Pointer.js.map +1 -1
  91. package/lib/cjs/appui-react/pickers/ViewSelector.js +6 -5
  92. package/lib/cjs/appui-react/pickers/ViewSelector.js.map +1 -1
  93. package/lib/cjs/appui-react/popup/KeyinPalettePanel.js +2 -1
  94. package/lib/cjs/appui-react/popup/KeyinPalettePanel.js.map +1 -1
  95. package/lib/cjs/appui-react/popup/PopupManager.js +2 -1
  96. package/lib/cjs/appui-react/popup/PopupManager.js.map +1 -1
  97. package/lib/cjs/appui-react/popup/PositionPopup.d.ts +2 -2
  98. package/lib/cjs/appui-react/popup/PositionPopup.d.ts.map +1 -1
  99. package/lib/cjs/appui-react/popup/PositionPopup.js.map +1 -1
  100. package/lib/cjs/appui-react/selection/SelectionContextItemDef.js +2 -2
  101. package/lib/cjs/appui-react/selection/SelectionContextItemDef.js.map +1 -1
  102. package/lib/cjs/appui-react/settings/quantityformatting/QuantityFormat.js +1 -2
  103. package/lib/cjs/appui-react/settings/quantityformatting/QuantityFormat.js.map +1 -1
  104. package/lib/cjs/appui-react/settings/ui/UiSettingsPage.js.map +1 -1
  105. package/lib/cjs/appui-react/stagepanels/StagePanelDef.d.ts +16 -20
  106. package/lib/cjs/appui-react/stagepanels/StagePanelDef.d.ts.map +1 -1
  107. package/lib/cjs/appui-react/stagepanels/StagePanelDef.js +86 -116
  108. package/lib/cjs/appui-react/stagepanels/StagePanelDef.js.map +1 -1
  109. package/lib/cjs/appui-react/statusbar/Indicator.js +2 -1
  110. package/lib/cjs/appui-react/statusbar/Indicator.js.map +1 -1
  111. package/lib/cjs/appui-react/statusbar/StatusBar.js +5 -3
  112. package/lib/cjs/appui-react/statusbar/StatusBar.js.map +1 -1
  113. package/lib/cjs/appui-react/statusfields/MessageCenter.d.ts.map +1 -1
  114. package/lib/cjs/appui-react/statusfields/MessageCenter.js +1 -2
  115. package/lib/cjs/appui-react/statusfields/MessageCenter.js.map +1 -1
  116. package/lib/cjs/appui-react/statusfields/toolassistance/ToolAssistanceField.js +1 -1
  117. package/lib/cjs/appui-react/statusfields/toolassistance/ToolAssistanceField.js.map +1 -1
  118. package/lib/cjs/appui-react/syncui/InternalSyncUiEventDispatcher.d.ts +36 -0
  119. package/lib/cjs/appui-react/syncui/InternalSyncUiEventDispatcher.d.ts.map +1 -0
  120. package/lib/cjs/appui-react/syncui/InternalSyncUiEventDispatcher.js +134 -0
  121. package/lib/cjs/appui-react/syncui/InternalSyncUiEventDispatcher.js.map +1 -0
  122. package/lib/cjs/appui-react/syncui/SyncUiEventDispatcher.d.ts +1 -1
  123. package/lib/cjs/appui-react/syncui/SyncUiEventDispatcher.d.ts.map +1 -1
  124. package/lib/cjs/appui-react/syncui/SyncUiEventDispatcher.js +2 -2
  125. package/lib/cjs/appui-react/syncui/SyncUiEventDispatcher.js.map +1 -1
  126. package/lib/cjs/appui-react/syncui/UiSyncEvent.d.ts +16 -0
  127. package/lib/cjs/appui-react/syncui/UiSyncEvent.d.ts.map +1 -0
  128. package/lib/cjs/appui-react/syncui/UiSyncEvent.js +18 -0
  129. package/lib/cjs/appui-react/syncui/UiSyncEvent.js.map +1 -0
  130. package/lib/cjs/appui-react/toolbar/ToolbarHelper.js +4 -6
  131. package/lib/cjs/appui-react/toolbar/ToolbarHelper.js.map +1 -1
  132. package/lib/cjs/appui-react/toolbar/useUiItemsProviderToolbarItems.js +4 -3
  133. package/lib/cjs/appui-react/toolbar/useUiItemsProviderToolbarItems.js.map +1 -1
  134. package/lib/cjs/appui-react/tools/CoreToolDefinitions.js +17 -10
  135. package/lib/cjs/appui-react/tools/CoreToolDefinitions.js.map +1 -1
  136. package/lib/cjs/appui-react/toolsettings/DefaultToolSettingsProvider.js +2 -3
  137. package/lib/cjs/appui-react/toolsettings/DefaultToolSettingsProvider.js.map +1 -1
  138. package/lib/cjs/appui-react/ui-items-provider/AbstractUiItemsManager.js +14 -12
  139. package/lib/cjs/appui-react/ui-items-provider/AbstractUiItemsManager.js.map +1 -1
  140. package/lib/cjs/appui-react/ui-items-provider/StandardContentToolsUiItemsProvider.js +10 -9
  141. package/lib/cjs/appui-react/ui-items-provider/StandardContentToolsUiItemsProvider.js.map +1 -1
  142. package/lib/cjs/appui-react/ui-items-provider/StandardStatusbarUiItemsProvider.js +2 -1
  143. package/lib/cjs/appui-react/ui-items-provider/StandardStatusbarUiItemsProvider.js.map +1 -1
  144. package/lib/cjs/appui-react/ui-items-provider/UiItemsManager.js +14 -8
  145. package/lib/cjs/appui-react/ui-items-provider/UiItemsManager.js.map +1 -1
  146. package/lib/cjs/appui-react/uiadmin/FrameworkUiAdmin.js +1 -1
  147. package/lib/cjs/appui-react/uiadmin/FrameworkUiAdmin.js.map +1 -1
  148. package/lib/cjs/appui-react/uiprovider/ComponentGenerator.js +1 -1
  149. package/lib/cjs/appui-react/uiprovider/ComponentGenerator.js.map +1 -1
  150. package/lib/cjs/appui-react/uistate/AppUiSettings.d.ts.map +1 -1
  151. package/lib/cjs/appui-react/uistate/AppUiSettings.js.map +1 -1
  152. package/lib/cjs/appui-react/uistate/useUiStateStorage.d.ts.map +1 -1
  153. package/lib/cjs/appui-react/uistate/useUiStateStorage.js.map +1 -1
  154. package/lib/cjs/appui-react/utils/InternalUiShowHideManager.js +3 -3
  155. package/lib/cjs/appui-react/utils/InternalUiShowHideManager.js.map +1 -1
  156. package/lib/cjs/appui-react/widget-panels/Content.js +9 -8
  157. package/lib/cjs/appui-react/widget-panels/Content.js.map +1 -1
  158. package/lib/cjs/appui-react/widget-panels/Frontstage.d.ts +7 -29
  159. package/lib/cjs/appui-react/widget-panels/Frontstage.d.ts.map +1 -1
  160. package/lib/cjs/appui-react/widget-panels/Frontstage.js +128 -463
  161. package/lib/cjs/appui-react/widget-panels/Frontstage.js.map +1 -1
  162. package/lib/cjs/appui-react/widget-panels/StatusBar.js +1 -1
  163. package/lib/cjs/appui-react/widget-panels/StatusBar.js.map +1 -1
  164. package/lib/cjs/appui-react/widget-panels/Tab.js +1 -1
  165. package/lib/cjs/appui-react/widget-panels/Tab.js.map +1 -1
  166. package/lib/cjs/appui-react/widget-panels/ToolSettings.d.ts.map +1 -1
  167. package/lib/cjs/appui-react/widget-panels/ToolSettings.js +34 -15
  168. package/lib/cjs/appui-react/widget-panels/ToolSettings.js.map +1 -1
  169. package/lib/cjs/appui-react/widget-panels/Toolbars.js +3 -2
  170. package/lib/cjs/appui-react/widget-panels/Toolbars.js.map +1 -1
  171. package/lib/cjs/appui-react/widgets/NavigationWidgetComposer.js +2 -2
  172. package/lib/cjs/appui-react/widgets/NavigationWidgetComposer.js.map +1 -1
  173. package/lib/cjs/appui-react/widgets/Widget.d.ts +10 -4
  174. package/lib/cjs/appui-react/widgets/Widget.d.ts.map +1 -1
  175. package/lib/cjs/appui-react/widgets/Widget.js.map +1 -1
  176. package/lib/cjs/appui-react/widgets/WidgetDef.d.ts +9 -29
  177. package/lib/cjs/appui-react/widgets/WidgetDef.d.ts.map +1 -1
  178. package/lib/cjs/appui-react/widgets/WidgetDef.js +90 -46
  179. package/lib/cjs/appui-react/widgets/WidgetDef.js.map +1 -1
  180. package/lib/cjs/appui-react/widgets/WidgetHost.js +3 -2
  181. package/lib/cjs/appui-react/widgets/WidgetHost.js.map +1 -1
  182. package/lib/cjs/appui-react.d.ts +1 -0
  183. package/lib/cjs/appui-react.d.ts.map +1 -1
  184. package/lib/cjs/appui-react.js +1 -0
  185. package/lib/cjs/appui-react.js.map +1 -1
  186. package/lib/esm/appui-react/UiFramework.js +7 -4
  187. package/lib/esm/appui-react/UiFramework.js.map +1 -1
  188. package/lib/esm/appui-react/accudraw/MenuButton.d.ts +2 -2
  189. package/lib/esm/appui-react/accudraw/MenuButton.d.ts.map +1 -1
  190. package/lib/esm/appui-react/accudraw/MenuButton.js.map +1 -1
  191. package/lib/esm/appui-react/backstage/BackstageComposer.d.ts.map +1 -1
  192. package/lib/esm/appui-react/backstage/BackstageComposer.js.map +1 -1
  193. package/lib/esm/appui-react/backstage/BackstageComposerItem.js +2 -1
  194. package/lib/esm/appui-react/backstage/BackstageComposerItem.js.map +1 -1
  195. package/lib/esm/appui-react/childwindow/CopyStyles.d.ts.map +1 -1
  196. package/lib/esm/appui-react/childwindow/CopyStyles.js +3 -1
  197. package/lib/esm/appui-react/childwindow/CopyStyles.js.map +1 -1
  198. package/lib/esm/appui-react/childwindow/InternalChildWindowManager.d.ts.map +1 -1
  199. package/lib/esm/appui-react/childwindow/InternalChildWindowManager.js +3 -2
  200. package/lib/esm/appui-react/childwindow/InternalChildWindowManager.js.map +1 -1
  201. package/lib/esm/appui-react/configurableui/InternalConfigurableUiManager.js +1 -1
  202. package/lib/esm/appui-react/configurableui/InternalConfigurableUiManager.js.map +1 -1
  203. package/lib/esm/appui-react/configurableui/TimeTracker.js +2 -1
  204. package/lib/esm/appui-react/configurableui/TimeTracker.js.map +1 -1
  205. package/lib/esm/appui-react/content/ContentLayout.js +12 -9
  206. package/lib/esm/appui-react/content/ContentLayout.js.map +1 -1
  207. package/lib/esm/appui-react/content/DefaultViewOverlay.js +4 -3
  208. package/lib/esm/appui-react/content/DefaultViewOverlay.js.map +1 -1
  209. package/lib/esm/appui-react/content/FloatingViewportContent.js +2 -1
  210. package/lib/esm/appui-react/content/FloatingViewportContent.js.map +1 -1
  211. package/lib/esm/appui-react/content/IModelViewport.js +6 -3
  212. package/lib/esm/appui-react/content/IModelViewport.js.map +1 -1
  213. package/lib/esm/appui-react/content/InternalContentLayoutManager.js +2 -1
  214. package/lib/esm/appui-react/content/InternalContentLayoutManager.js.map +1 -1
  215. package/lib/esm/appui-react/content/InternalContentViewManager.js +1 -1
  216. package/lib/esm/appui-react/content/InternalContentViewManager.js.map +1 -1
  217. package/lib/esm/appui-react/content/split-pane/SplitPane.js +12 -10
  218. package/lib/esm/appui-react/content/split-pane/SplitPane.js.map +1 -1
  219. package/lib/esm/appui-react/cursor/CursorInformation.d.ts +6 -6
  220. package/lib/esm/appui-react/cursor/CursorInformation.d.ts.map +1 -1
  221. package/lib/esm/appui-react/cursor/CursorInformation.js.map +1 -1
  222. package/lib/esm/appui-react/cursor/cursormenu/CursorMenu.d.ts.map +1 -1
  223. package/lib/esm/appui-react/cursor/cursormenu/CursorMenu.js +3 -2
  224. package/lib/esm/appui-react/cursor/cursormenu/CursorMenu.js.map +1 -1
  225. package/lib/esm/appui-react/cursor/cursorpopup/CursorPopup.d.ts +4 -4
  226. package/lib/esm/appui-react/cursor/cursorpopup/CursorPopup.d.ts.map +1 -1
  227. package/lib/esm/appui-react/cursor/cursorpopup/CursorPopup.js.map +1 -1
  228. package/lib/esm/appui-react/cursor/cursorpopup/CursorPopupManager.d.ts +5 -5
  229. package/lib/esm/appui-react/cursor/cursorpopup/CursorPopupManager.d.ts.map +1 -1
  230. package/lib/esm/appui-react/cursor/cursorpopup/CursorPopupManager.js.map +1 -1
  231. package/lib/esm/appui-react/cursor/cursorprompt/CursorPrompt.d.ts +2 -2
  232. package/lib/esm/appui-react/cursor/cursorprompt/CursorPrompt.d.ts.map +1 -1
  233. package/lib/esm/appui-react/cursor/cursorprompt/CursorPrompt.js.map +1 -1
  234. package/lib/esm/appui-react/dialog/ContentDialog.js +6 -3
  235. package/lib/esm/appui-react/dialog/ContentDialog.js.map +1 -1
  236. package/lib/esm/appui-react/dialog/DialogManagerBase.js +3 -2
  237. package/lib/esm/appui-react/dialog/DialogManagerBase.js.map +1 -1
  238. package/lib/esm/appui-react/feedback/ElementTooltip.d.ts +1 -2
  239. package/lib/esm/appui-react/feedback/ElementTooltip.d.ts.map +1 -1
  240. package/lib/esm/appui-react/feedback/ElementTooltip.js.map +1 -1
  241. package/lib/esm/appui-react/frontstage/FrontstageDef.d.ts +22 -26
  242. package/lib/esm/appui-react/frontstage/FrontstageDef.d.ts.map +1 -1
  243. package/lib/esm/appui-react/frontstage/FrontstageDef.js +170 -221
  244. package/lib/esm/appui-react/frontstage/FrontstageDef.js.map +1 -1
  245. package/lib/esm/appui-react/frontstage/InternalFrontstageManager.d.ts +1 -7
  246. package/lib/esm/appui-react/frontstage/InternalFrontstageManager.d.ts.map +1 -1
  247. package/lib/esm/appui-react/frontstage/InternalFrontstageManager.js +0 -6
  248. package/lib/esm/appui-react/frontstage/InternalFrontstageManager.js.map +1 -1
  249. package/lib/esm/appui-react/frontstage/ModalSettingsStage.js +3 -2
  250. package/lib/esm/appui-react/frontstage/ModalSettingsStage.js.map +1 -1
  251. package/lib/esm/appui-react/frontstage/StandardFrontstageProvider.js +2 -1
  252. package/lib/esm/appui-react/frontstage/StandardFrontstageProvider.js.map +1 -1
  253. package/lib/esm/appui-react/hooks/useActiveIModelConnection.d.ts.map +1 -1
  254. package/lib/esm/appui-react/hooks/useActiveIModelConnection.js.map +1 -1
  255. package/lib/esm/appui-react/hooks/useActiveViewport.d.ts.map +1 -1
  256. package/lib/esm/appui-react/hooks/useActiveViewport.js.map +1 -1
  257. package/lib/esm/appui-react/hooks/useAnalysisAnimationDataProvider.js +11 -7
  258. package/lib/esm/appui-react/hooks/useAnalysisAnimationDataProvider.js.map +1 -1
  259. package/lib/esm/appui-react/hooks/useScheduleAnimationDataProvider.js +11 -7
  260. package/lib/esm/appui-react/hooks/useScheduleAnimationDataProvider.js.map +1 -1
  261. package/lib/esm/appui-react/hooks/useSolarDataProvider.js +13 -8
  262. package/lib/esm/appui-react/hooks/useSolarDataProvider.js.map +1 -1
  263. package/lib/esm/appui-react/keyboardshortcut/InternalKeyboardShortcut.d.ts.map +1 -1
  264. package/lib/esm/appui-react/keyboardshortcut/InternalKeyboardShortcut.js.map +1 -1
  265. package/lib/esm/appui-react/messages/ActivityMessage.js +7 -5
  266. package/lib/esm/appui-react/messages/ActivityMessage.js.map +1 -1
  267. package/lib/esm/appui-react/messages/MessageManager.d.ts +0 -1
  268. package/lib/esm/appui-react/messages/MessageManager.d.ts.map +1 -1
  269. package/lib/esm/appui-react/messages/MessageManager.js +1 -2
  270. package/lib/esm/appui-react/messages/MessageManager.js.map +1 -1
  271. package/lib/esm/appui-react/messages/Pointer.d.ts +1 -2
  272. package/lib/esm/appui-react/messages/Pointer.d.ts.map +1 -1
  273. package/lib/esm/appui-react/messages/Pointer.js +1 -1
  274. package/lib/esm/appui-react/messages/Pointer.js.map +1 -1
  275. package/lib/esm/appui-react/pickers/ViewSelector.js +6 -5
  276. package/lib/esm/appui-react/pickers/ViewSelector.js.map +1 -1
  277. package/lib/esm/appui-react/popup/KeyinPalettePanel.js +2 -1
  278. package/lib/esm/appui-react/popup/KeyinPalettePanel.js.map +1 -1
  279. package/lib/esm/appui-react/popup/PopupManager.js +2 -1
  280. package/lib/esm/appui-react/popup/PopupManager.js.map +1 -1
  281. package/lib/esm/appui-react/popup/PositionPopup.d.ts +2 -2
  282. package/lib/esm/appui-react/popup/PositionPopup.d.ts.map +1 -1
  283. package/lib/esm/appui-react/popup/PositionPopup.js.map +1 -1
  284. package/lib/esm/appui-react/selection/SelectionContextItemDef.js +2 -2
  285. package/lib/esm/appui-react/selection/SelectionContextItemDef.js.map +1 -1
  286. package/lib/esm/appui-react/settings/quantityformatting/QuantityFormat.js +1 -2
  287. package/lib/esm/appui-react/settings/quantityformatting/QuantityFormat.js.map +1 -1
  288. package/lib/esm/appui-react/settings/ui/UiSettingsPage.js.map +1 -1
  289. package/lib/esm/appui-react/stagepanels/StagePanelDef.d.ts +16 -20
  290. package/lib/esm/appui-react/stagepanels/StagePanelDef.d.ts.map +1 -1
  291. package/lib/esm/appui-react/stagepanels/StagePanelDef.js +84 -115
  292. package/lib/esm/appui-react/stagepanels/StagePanelDef.js.map +1 -1
  293. package/lib/esm/appui-react/statusbar/Indicator.js +2 -1
  294. package/lib/esm/appui-react/statusbar/Indicator.js.map +1 -1
  295. package/lib/esm/appui-react/statusbar/StatusBar.js +5 -3
  296. package/lib/esm/appui-react/statusbar/StatusBar.js.map +1 -1
  297. package/lib/esm/appui-react/statusfields/MessageCenter.d.ts.map +1 -1
  298. package/lib/esm/appui-react/statusfields/MessageCenter.js +1 -2
  299. package/lib/esm/appui-react/statusfields/MessageCenter.js.map +1 -1
  300. package/lib/esm/appui-react/statusfields/toolassistance/ToolAssistanceField.js +1 -1
  301. package/lib/esm/appui-react/statusfields/toolassistance/ToolAssistanceField.js.map +1 -1
  302. package/lib/esm/appui-react/syncui/InternalSyncUiEventDispatcher.d.ts +36 -0
  303. package/lib/esm/appui-react/syncui/InternalSyncUiEventDispatcher.d.ts.map +1 -0
  304. package/lib/esm/appui-react/syncui/InternalSyncUiEventDispatcher.js +130 -0
  305. package/lib/esm/appui-react/syncui/InternalSyncUiEventDispatcher.js.map +1 -0
  306. package/lib/esm/appui-react/syncui/SyncUiEventDispatcher.d.ts +1 -1
  307. package/lib/esm/appui-react/syncui/SyncUiEventDispatcher.d.ts.map +1 -1
  308. package/lib/esm/appui-react/syncui/SyncUiEventDispatcher.js +2 -2
  309. package/lib/esm/appui-react/syncui/SyncUiEventDispatcher.js.map +1 -1
  310. package/lib/esm/appui-react/syncui/UiSyncEvent.d.ts +16 -0
  311. package/lib/esm/appui-react/syncui/UiSyncEvent.d.ts.map +1 -0
  312. package/lib/esm/appui-react/syncui/UiSyncEvent.js +14 -0
  313. package/lib/esm/appui-react/syncui/UiSyncEvent.js.map +1 -0
  314. package/lib/esm/appui-react/toolbar/ToolbarHelper.js +4 -6
  315. package/lib/esm/appui-react/toolbar/ToolbarHelper.js.map +1 -1
  316. package/lib/esm/appui-react/toolbar/useUiItemsProviderToolbarItems.js +4 -3
  317. package/lib/esm/appui-react/toolbar/useUiItemsProviderToolbarItems.js.map +1 -1
  318. package/lib/esm/appui-react/tools/CoreToolDefinitions.js +17 -10
  319. package/lib/esm/appui-react/tools/CoreToolDefinitions.js.map +1 -1
  320. package/lib/esm/appui-react/toolsettings/DefaultToolSettingsProvider.js +2 -3
  321. package/lib/esm/appui-react/toolsettings/DefaultToolSettingsProvider.js.map +1 -1
  322. package/lib/esm/appui-react/ui-items-provider/AbstractUiItemsManager.js +14 -12
  323. package/lib/esm/appui-react/ui-items-provider/AbstractUiItemsManager.js.map +1 -1
  324. package/lib/esm/appui-react/ui-items-provider/StandardContentToolsUiItemsProvider.js +10 -9
  325. package/lib/esm/appui-react/ui-items-provider/StandardContentToolsUiItemsProvider.js.map +1 -1
  326. package/lib/esm/appui-react/ui-items-provider/StandardStatusbarUiItemsProvider.js +2 -1
  327. package/lib/esm/appui-react/ui-items-provider/StandardStatusbarUiItemsProvider.js.map +1 -1
  328. package/lib/esm/appui-react/ui-items-provider/UiItemsManager.js +14 -8
  329. package/lib/esm/appui-react/ui-items-provider/UiItemsManager.js.map +1 -1
  330. package/lib/esm/appui-react/uiadmin/FrameworkUiAdmin.js +1 -1
  331. package/lib/esm/appui-react/uiadmin/FrameworkUiAdmin.js.map +1 -1
  332. package/lib/esm/appui-react/uiprovider/ComponentGenerator.js +1 -1
  333. package/lib/esm/appui-react/uiprovider/ComponentGenerator.js.map +1 -1
  334. package/lib/esm/appui-react/uistate/AppUiSettings.d.ts.map +1 -1
  335. package/lib/esm/appui-react/uistate/AppUiSettings.js.map +1 -1
  336. package/lib/esm/appui-react/uistate/useUiStateStorage.d.ts.map +1 -1
  337. package/lib/esm/appui-react/uistate/useUiStateStorage.js.map +1 -1
  338. package/lib/esm/appui-react/utils/InternalUiShowHideManager.js +3 -3
  339. package/lib/esm/appui-react/utils/InternalUiShowHideManager.js.map +1 -1
  340. package/lib/esm/appui-react/widget-panels/Content.js +9 -8
  341. package/lib/esm/appui-react/widget-panels/Content.js.map +1 -1
  342. package/lib/esm/appui-react/widget-panels/Frontstage.d.ts +7 -29
  343. package/lib/esm/appui-react/widget-panels/Frontstage.d.ts.map +1 -1
  344. package/lib/esm/appui-react/widget-panels/Frontstage.js +131 -462
  345. package/lib/esm/appui-react/widget-panels/Frontstage.js.map +1 -1
  346. package/lib/esm/appui-react/widget-panels/StatusBar.js +1 -1
  347. package/lib/esm/appui-react/widget-panels/StatusBar.js.map +1 -1
  348. package/lib/esm/appui-react/widget-panels/Tab.js +1 -1
  349. package/lib/esm/appui-react/widget-panels/Tab.js.map +1 -1
  350. package/lib/esm/appui-react/widget-panels/ToolSettings.d.ts.map +1 -1
  351. package/lib/esm/appui-react/widget-panels/ToolSettings.js +34 -15
  352. package/lib/esm/appui-react/widget-panels/ToolSettings.js.map +1 -1
  353. package/lib/esm/appui-react/widget-panels/Toolbars.js +3 -2
  354. package/lib/esm/appui-react/widget-panels/Toolbars.js.map +1 -1
  355. package/lib/esm/appui-react/widgets/NavigationWidgetComposer.js +2 -2
  356. package/lib/esm/appui-react/widgets/NavigationWidgetComposer.js.map +1 -1
  357. package/lib/esm/appui-react/widgets/Widget.d.ts +10 -4
  358. package/lib/esm/appui-react/widgets/Widget.d.ts.map +1 -1
  359. package/lib/esm/appui-react/widgets/Widget.js.map +1 -1
  360. package/lib/esm/appui-react/widgets/WidgetDef.d.ts +9 -29
  361. package/lib/esm/appui-react/widgets/WidgetDef.d.ts.map +1 -1
  362. package/lib/esm/appui-react/widgets/WidgetDef.js +90 -46
  363. package/lib/esm/appui-react/widgets/WidgetDef.js.map +1 -1
  364. package/lib/esm/appui-react/widgets/WidgetHost.js +3 -2
  365. package/lib/esm/appui-react/widgets/WidgetHost.js.map +1 -1
  366. package/lib/esm/appui-react.d.ts +1 -0
  367. package/lib/esm/appui-react.d.ts.map +1 -1
  368. package/lib/esm/appui-react.js +1 -0
  369. package/lib/esm/appui-react.js.map +1 -1
  370. package/package.json +10 -10
@@ -1 +1 @@
1
- {"version":3,"file":"InternalContentLayoutManager.js","sourceRoot":"","sources":["../../../../src/appui-react/content/InternalContentLayoutManager.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAGH,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD;;GAEG;AACH,MAAa,4BAA4B;IAMvC,qEAAqE;IAC9D,MAAM,CAAC,MAAM,CAAC,KAGpB;QACC,OAAO,GAAG,KAAK,CAAC,cAAc,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;IACrD,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,WAAW,CACvB,iBAAmD,EACnD,qBAA0C;QAE1C,MAAM,QAAQ,GAAG,qBAAqB,EAAE,EAAE,IAAI,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1E,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC;YAC5B,cAAc,EAAE,iBAAiB,CAAC,EAAE;YACpC,QAAQ;SACT,CAAC,CAAC;QAEH,IACE,CAAC,qBAAqB;YACtB,4BAA4B,CAAC,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,EACvD;YACA,OAAO,4BAA4B,CAAC,WAAW,CAAC,GAAG,CAAC,SAAS,CAAE,CAAC;SACjE;QAED,MAAM,qBAAqB,GAAG;YAC5B,GAAG,iBAAiB,CAAC,MAAM;YAC3B,GAAG,qBA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G;IACI,MAAM,CAAC,aAAa;QACzB,uBAAuB;QACvB,MAAM,mBAAmB,GAAG,WAAW,CAAC,WAAW,CAAC,mBAAmB,CAAC;QACxE,IACE,mBAAmB;YACnB,mBAAmB,CAAC,gBAAgB;YACpC,mBAAmB,CAAC,YAAY,EAChC;YACA,WAAW,CAAC,WAAW,CAAC,6BAA6B,CAAC,IAAI,CAAC;gBACzD,aAAa,EAAE,mBAAmB,CAAC,gBAAgB;gBACnD,YAAY,EAAE,mBAAmB,CAAC,YAAY;aAC/C,CAAC,CAAC;YAEH,mBAAmB,CAAC,YAAY,CAAC,mBAAmB,EAAE,CAAC;SACxD;IACH,CAAC;;AAtHc,wCAAW,GAAkC,IAAI,GAAG,EAGhE,CAAC;SAJO,4BAA4B","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 ContentView\n */\n\nimport type { ContentLayoutProps } from \"@itwin/appui-abstract\";\nimport { InternalFrontstageManager } from \"../frontstage/InternalFrontstageManager\";\nimport { UiFramework } from \"../UiFramework\";\nimport type { ContentGroup, ContentGroupProps } from \"./ContentGroup\";\nimport { ContentLayoutDef } from \"./ContentLayout\";\n\n/** ContentLayout Manager class.\n * @internal\n */\nexport class InternalContentLayoutManager {\n private static _layoutDefs: Map<string, ContentLayoutDef> = new Map<\n string,\n ContentLayoutDef\n >();\n\n /** build a layout key that is unique for group layout combination */\n public static getKey(props: {\n contentGroupId: string;\n layoutId: string;\n }): string {\n return `${props.contentGroupId}-${props.layoutId}`;\n }\n\n /** Return a LayoutDef that is specific to a content group.\n * @returns the [[ContentLayoutDef]] if found, or undefined otherwise\n */\n public static getForGroup(\n contentGroupProps: ContentGroupProps | ContentGroup,\n overrideContentLayout?: ContentLayoutProps\n ): ContentLayoutDef {\n const layoutId = overrideContentLayout?.id ?? contentGroupProps.layout.id;\n const layoutKey = this.getKey({\n contentGroupId: contentGroupProps.id,\n layoutId,\n });\n\n if (\n !overrideContentLayout &&\n InternalContentLayoutManager._layoutDefs.has(layoutKey)\n ) {\n return InternalContentLayoutManager._layoutDefs.get(layoutKey)!;\n }\n\n const newContentLayoutProps = {\n ...contentGroupProps.layout,\n ...overrideContentLayout,\n };\n const newLayoutDef = new ContentLayoutDef(newContentLayoutProps);\n this.add(layoutKey, newLayoutDef);\n return newLayoutDef;\n }\n\n /** Finds a Content Layout with a given id.\n * @param layoutKey group specific layout id, see `getLayoutKey`\n * @returns the [[ContentLayoutDef]] if found, or undefined otherwise\n */\n public static find(layoutKey: string): ContentLayoutDef | undefined {\n return InternalContentLayoutManager._layoutDefs.get(layoutKey)!;\n }\n\n /** Adds a Content Layout.\n * @param layoutId the id of the Content Layout to add\n * @param layoutDef the Content Layout definition to add\n */\n public static add(layoutId: string, layoutDef: ContentLayoutDef): void {\n InternalContentLayoutManager._layoutDefs.set(layoutId, layoutDef);\n }\n\n /** Gets the active Content Layout */\n public static get activeLayout(): ContentLayoutDef | undefined {\n let layoutDef: ContentLayoutDef | undefined;\n const activeFrontstageDef = UiFramework.frontstages.activeFrontstageDef;\n\n if (activeFrontstageDef) layoutDef = activeFrontstageDef.contentLayoutDef;\n\n return layoutDef;\n }\n\n /** Gets the active Content Group */\n public static get activeContentGroup(): ContentGroup | undefined {\n let contentGroup: ContentGroup | undefined;\n const activeFrontstageDef = UiFramework.frontstages.activeFrontstageDef;\n\n if (activeFrontstageDef) contentGroup = activeFrontstageDef.contentGroup;\n\n return contentGroup;\n }\n\n /** Sets the active Content Layout, Content Group and Content Control.\n * @param contentLayoutDef Content layout to make active\n * @param contentGroup Content Group to make active\n */\n public static async setActive(\n contentLayoutDef: ContentLayoutDef,\n contentGroup: ContentGroup\n ): Promise<void> {\n await InternalFrontstageManager.setActiveLayout(\n contentLayoutDef,\n contentGroup\n );\n }\n\n /** Sets the active Content Group.\n * @param contentGroup Content Group to make active\n */\n public static async setActiveContentGroup(\n contentGroup: ContentGroup\n ): Promise<void> {\n await InternalFrontstageManager.setActiveContentGroup(contentGroup);\n }\n\n /** Refreshes the active layout and content group.\n */\n public static refreshActive(): void {\n // istanbul ignore else\n const activeFrontstageDef = UiFramework.frontstages.activeFrontstageDef;\n if (\n activeFrontstageDef &&\n activeFrontstageDef.contentLayoutDef &&\n activeFrontstageDef.contentGroup\n ) {\n UiFramework.frontstages.onContentLayoutActivatedEvent.emit({\n contentLayout: activeFrontstageDef.contentLayoutDef,\n contentGroup: activeFrontstageDef.contentGroup,\n });\n\n activeFrontstageDef.contentGroup.refreshContentNodes();\n }\n }\n}\n"]}
1
+ {"version":3,"file":"InternalContentLayoutManager.js","sourceRoot":"","sources":["../../../../src/appui-react/content/InternalContentLayoutManager.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAGH,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD;;GAEG;AACH,MAAa,4BAA4B;IAMvC,qEAAqE;IAC9D,MAAM,CAAC,MAAM,CAAC,KAGpB;QACC,OAAO,GAAG,KAAK,CAAC,cAAc,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;IACrD,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,WAAW,CACvB,iBAAmD,EACnD,qBAA0C;;QAE1C,MAAM,QAAQ,GAAG,MAAA,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAE,EAAE,mCAAI,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1E,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC;YAC5B,cAAc,EAAE,iBAAiB,CAAC,EAAE;YACpC,QAAQ;SACT,CAAC,CAAC;QAEH,IACE,CAAC,qBAAqB;YACtB,4BAA4B,CAAC,WAAW,CA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AAgB,EAChB,YAAY,CACb,CAAC;IACJ,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,KAAK,CAAC,qBAAqB,CACvC,YAA0B;QAE1B,MAAM,yBAAyB,CAAC,qBAAqB,CAAC,YAAY,CAAC,CAAC;IACtE,CAAC;IAED;OACG;IACI,MAAM,CAAC,aAAa;QACzB,uBAAuB;QACvB,MAAM,mBAAmB,GAAG,WAAW,CAAC,WAAW,CAAC,mBAAmB,CAAC;QACxE,IACE,mBAAmB;YACnB,mBAAmB,CAAC,gBAAgB;YACpC,mBAAmB,CAAC,YAAY,EAChC;YACA,WAAW,CAAC,WAAW,CAAC,6BAA6B,CAAC,IAAI,CAAC;gBACzD,aAAa,EAAE,mBAAmB,CAAC,gBAAgB;gBACnD,YAAY,EAAE,mBAAmB,CAAC,YAAY;aAC/C,CAAC,CAAC;YAEH,mBAAmB,CAAC,YAAY,CAAC,mBAAmB,EAAE,CAAC;SACxD;IACH,CAAC;;AAtHc,wCAAW,GAAkC,IAAI,GAAG,EAGhE,CAAC;SAJO,4BAA4B","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 ContentView\n */\n\nimport type { ContentLayoutProps } from \"@itwin/appui-abstract\";\nimport { InternalFrontstageManager } from \"../frontstage/InternalFrontstageManager\";\nimport { UiFramework } from \"../UiFramework\";\nimport type { ContentGroup, ContentGroupProps } from \"./ContentGroup\";\nimport { ContentLayoutDef } from \"./ContentLayout\";\n\n/** ContentLayout Manager class.\n * @internal\n */\nexport class InternalContentLayoutManager {\n private static _layoutDefs: Map<string, ContentLayoutDef> = new Map<\n string,\n ContentLayoutDef\n >();\n\n /** build a layout key that is unique for group layout combination */\n public static getKey(props: {\n contentGroupId: string;\n layoutId: string;\n }): string {\n return `${props.contentGroupId}-${props.layoutId}`;\n }\n\n /** Return a LayoutDef that is specific to a content group.\n * @returns the [[ContentLayoutDef]] if found, or undefined otherwise\n */\n public static getForGroup(\n contentGroupProps: ContentGroupProps | ContentGroup,\n overrideContentLayout?: ContentLayoutProps\n ): ContentLayoutDef {\n const layoutId = overrideContentLayout?.id ?? contentGroupProps.layout.id;\n const layoutKey = this.getKey({\n contentGroupId: contentGroupProps.id,\n layoutId,\n });\n\n if (\n !overrideContentLayout &&\n InternalContentLayoutManager._layoutDefs.has(layoutKey)\n ) {\n return InternalContentLayoutManager._layoutDefs.get(layoutKey)!;\n }\n\n const newContentLayoutProps = {\n ...contentGroupProps.layout,\n ...overrideContentLayout,\n };\n const newLayoutDef = new ContentLayoutDef(newContentLayoutProps);\n this.add(layoutKey, newLayoutDef);\n return newLayoutDef;\n }\n\n /** Finds a Content Layout with a given id.\n * @param layoutKey group specific layout id, see `getLayoutKey`\n * @returns the [[ContentLayoutDef]] if found, or undefined otherwise\n */\n public static find(layoutKey: string): ContentLayoutDef | undefined {\n return InternalContentLayoutManager._layoutDefs.get(layoutKey)!;\n }\n\n /** Adds a Content Layout.\n * @param layoutId the id of the Content Layout to add\n * @param layoutDef the Content Layout definition to add\n */\n public static add(layoutId: string, layoutDef: ContentLayoutDef): void {\n InternalContentLayoutManager._layoutDefs.set(layoutId, layoutDef);\n }\n\n /** Gets the active Content Layout */\n public static get activeLayout(): ContentLayoutDef | undefined {\n let layoutDef: ContentLayoutDef | undefined;\n const activeFrontstageDef = UiFramework.frontstages.activeFrontstageDef;\n\n if (activeFrontstageDef) layoutDef = activeFrontstageDef.contentLayoutDef;\n\n return layoutDef;\n }\n\n /** Gets the active Content Group */\n public static get activeContentGroup(): ContentGroup | undefined {\n let contentGroup: ContentGroup | undefined;\n const activeFrontstageDef = UiFramework.frontstages.activeFrontstageDef;\n\n if (activeFrontstageDef) contentGroup = activeFrontstageDef.contentGroup;\n\n return contentGroup;\n }\n\n /** Sets the active Content Layout, Content Group and Content Control.\n * @param contentLayoutDef Content layout to make active\n * @param contentGroup Content Group to make active\n */\n public static async setActive(\n contentLayoutDef: ContentLayoutDef,\n contentGroup: ContentGroup\n ): Promise<void> {\n await InternalFrontstageManager.setActiveLayout(\n contentLayoutDef,\n contentGroup\n );\n }\n\n /** Sets the active Content Group.\n * @param contentGroup Content Group to make active\n */\n public static async setActiveContentGroup(\n contentGroup: ContentGroup\n ): Promise<void> {\n await InternalFrontstageManager.setActiveContentGroup(contentGroup);\n }\n\n /** Refreshes the active layout and content group.\n */\n public static refreshActive(): void {\n // istanbul ignore else\n const activeFrontstageDef = UiFramework.frontstages.activeFrontstageDef;\n if (\n activeFrontstageDef &&\n activeFrontstageDef.contentLayoutDef &&\n activeFrontstageDef.contentGroup\n ) {\n UiFramework.frontstages.onContentLayoutActivatedEvent.emit({\n contentLayout: activeFrontstageDef.contentLayoutDef,\n contentGroup: activeFrontstageDef.contentGroup,\n });\n\n activeFrontstageDef.contentGroup.refreshContentNodes();\n }\n }\n}\n"]}
@@ -31,7 +31,7 @@ class InternalContentViewManager {
31
31
  return this._activeContent;
32
32
  }
33
33
  static getControlFromElement(content, activeContentGroup, floatingControls, logIfNotFound = false) {
34
- if (floatingControls?.length) {
34
+ if (floatingControls === null || floatingControls === void 0 ? void 0 : floatingControls.length) {
35
35
  // if we find a React node that matches exactly, return its containing control
36
36
  let control = floatingControls.find((contentControl) => contentControl.reactNode === content);
37
37
  if (control)
@@ -1 +1 @@
1
- {"version":3,"file":"InternalContentViewManager.js","sourceRoot":"","sources":["../../../../src/appui-react/content/InternalContentViewManager.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,MAAM,EAAE,MAAM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AAM,CAAC,yBAAyB,CACrC,OAAmC;QAEnC,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ;YAAE,OAAO,KAAK,CAAC;QAChD,OAAO,aAAa,CAAC,kBAAkB,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC5D,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,eAAe,CAAC,OAAmC;QAC/D,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ;YAAE,OAAO,KAAK,CAAC;QAChD,OAAO,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAClD,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,qBAAqB,CACjC,OAAmC;QAEnC,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ;YAAE,OAAO,KAAK,CAAC;QAChD,OAAO,aAAa,CAAC,kBAAkB,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC5D,CAAC;IAED;;;OAGG;IACI,MAAM,KAAK,OAAO;QACvB,OAAO,4BAA4B,CAAC;IACtC,CAAC;IACD;;;OAGG;IACI,MAAM,KAAK,OAAO;QACvB,OAAO,4BAA4B,CAAC;IACtC,CAAC;;AAnQc,qCAAU,GAAY,KAAK,CAAC;AAG3C,yCAAyC;AAClB,kDAAuB,GAAG,IAAI,qBAAqB,EAAE,CAAC;AAa7E,6CAA6C;AACtB,sDAA2B,GAChD,IAAI,yBAAyB,EAAE,CAAC;AAElC,wDAAwD;AAEjC,yDAA8B,GAAG,IAAI,OAAO,EAE/D,CAAC;SA1BM,0BAA0B","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 ContentView\n */\n\nimport type * as React from \"react\";\nimport { UiEvent } from \"@itwin/appui-abstract\";\nimport { ViewUtilities } from \"../utils/ViewUtilities\";\nimport type { ContentControl } from \"./ContentControl\";\nimport { InternalContentLayoutManager } from \"./InternalContentLayoutManager\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport type { ContentGroup } from \"./ContentGroup\";\nimport { Logger } from \"@itwin/core-bentley\";\nimport { UiFramework } from \"../UiFramework\";\nimport {\n ActiveContentChangedEvent,\n MouseDownChangedEvent,\n} from \"../framework/FrameworkContent\";\nimport { InternalContentDialogManager } from \"../dialog/InternalContentDialogManager\";\n\n/** Content View Manager class.\n * @internal\n */\nexport class InternalContentViewManager {\n private static _mouseDown: boolean = false;\n private static _activeContent?: React.ReactNode;\n\n /** Gets the [[MouseDownChangedEvent]] */\n public static readonly onMouseDownChangedEvent = new MouseDownChangedEvent();\n\n /** Determines if the mouse is down in a content view */\n public static get isMouseDown(): boolean {\n return this._mouseDown;\n }\n\n /** Sets the mouse down status for a content view */\n public static setMouseDown(mouseDown: boolean): void {\n this._mouseDown = mouseDown;\n this.onMouseDownChangedEvent.emit({ mouseDown });\n }\n\n /** Gets the [[ActiveContentChangedEvent]] */\n public static readonly onActiveContentChangedEvent =\n new ActiveContentChangedEvent();\n\n /** Fires when floating contents are added or removed */\n\n public static readonly onAvailableContentChangedEvent = new UiEvent<{\n contentId: string;\n }>();\n\n /** Gets the active content as a React.ReactNode. */\n public static getActive(): React.ReactNode | undefined {\n return this._activeContent;\n }\n\n private static getControlFromElement(\n content: React.ReactNode,\n activeContentGroup: ContentGroup | undefined,\n floatingControls: ContentControl[] | undefined,\n logIfNotFound = false\n ) {\n if (floatingControls?.length) {\n // if we find a React node that matches exactly, return its containing control\n let control = floatingControls.find(\n (contentControl) => contentControl.reactNode === content\n );\n if (control) return control;\n\n // if we don't find a React node that matches exactly, rely on the id specified by the creator\n let controlId: string;\n if (content && (content as React.ReactElement<any>).key) {\n const key = (content as React.ReactElement<any>).key as string;\n // key has format `${contentProps.id}::${this.groupId}` which is stored as unique id\n controlId = key.split(\"::\", 1)[0];\n }\n floatingControls.forEach((contentControl: ContentControl) => {\n const node = contentControl.reactNode;\n const key = (node as React.ReactElement<any>).key as string;\n const nodeId = key && key.split(\"::\", 1)[0];\n if (nodeId === controlId) control = contentControl;\n });\n if (control) return control;\n }\n\n // if it's not a floating control, look through the content area views\n // istanbul ignore else\n if (activeContentGroup) {\n const activeContentControl =\n activeContentGroup.getControlFromElement(content);\n if (activeContentControl) return activeContentControl;\n }\n\n if (logIfNotFound)\n Logger.logError(\n UiFramework.loggerCategory(this),\n `getControlFromElement: no control found for element`\n );\n\n return undefined;\n }\n\n /** Return the active ContentControl. */\n public static getActiveContentControl(): ContentControl | undefined {\n let activeContentControl: ContentControl | undefined;\n const activeFrontstageDef = UiFramework.frontstages.activeFrontstageDef;\n\n // istanbul ignore else\n if (this._activeContent && activeFrontstageDef) {\n const activeContentGroup = activeFrontstageDef.contentGroup;\n activeContentControl = this.getControlFromElement(\n this._activeContent,\n activeContentGroup,\n activeFrontstageDef.floatingContentControls\n );\n }\n\n return activeContentControl;\n }\n\n public static addFloatingContentControl(contentControl?: ContentControl) {\n const activeFrontstageDef = UiFramework.frontstages.activeFrontstageDef;\n // istanbul ignore else\n if (activeFrontstageDef && contentControl) {\n activeFrontstageDef.addFloatingContentControl(contentControl);\n }\n }\n\n public static dropFloatingContentControl(contentControl?: ContentControl) {\n const activeFrontstageDef = UiFramework.frontstages.activeFrontstageDef;\n // istanbul ignore else\n if (activeFrontstageDef && contentControl)\n activeFrontstageDef.dropFloatingContentControl(contentControl);\n }\n\n /** Sets the active [[ContentControl]] */\n public static setActive(\n activeContent?: React.ReactNode,\n forceEventProcessing = false\n ): void {\n // istanbul ignore else\n if (this._activeContent !== activeContent || forceEventProcessing) {\n const oldContent = this._activeContent;\n this._activeContent = activeContent;\n\n const activeFrontstageDef = UiFramework.frontstages.activeFrontstageDef;\n\n // istanbul ignore else\n if (activeFrontstageDef) {\n const activeContentGroup = activeFrontstageDef.contentGroup;\n\n // istanbul ignore else\n const oldContentControl = this.getControlFromElement(\n oldContent,\n activeContentGroup,\n activeFrontstageDef.floatingContentControls\n );\n const activeContentControl = this.getControlFromElement(\n activeContent,\n activeContentGroup,\n activeFrontstageDef.floatingContentControls,\n true\n );\n\n // Only call setActiveView if going to or coming from a non-viewport ContentControl\n // istanbul ignore else\n if (activeContentControl) {\n // istanbul ignore next\n const doSetActiveView =\n forceEventProcessing ||\n !activeContentControl.viewport ||\n /* istanbul ignore next */ (oldContentControl &&\n /* istanbul ignore next */ !oldContentControl.viewport);\n\n // istanbul ignore else\n if (doSetActiveView) {\n activeFrontstageDef.setActiveView(\n activeContentControl,\n oldContentControl\n );\n this.onActiveContentChangedEvent.emit({\n activeContent,\n oldContent,\n });\n } else {\n if (\n activeContentControl.viewport &&\n activeContentControl.viewport !==\n IModelApp.viewManager.selectedView\n ) {\n void IModelApp.viewManager.setSelectedView(\n activeContentControl.viewport\n );\n }\n }\n }\n }\n }\n }\n\n /** Refreshes the active [[ContentControl]] */\n public static refreshActive(activeContent: React.ReactNode) {\n this.layouts.refreshActive();\n this.setActive(activeContent, true);\n }\n\n /**\n * Determines if content displays a Sheet view.\n * @param content ContentControl to check\n */\n public static isContentSheetView(\n content: ContentControl | undefined\n ): boolean {\n if (!content || !content.viewport) return false;\n return ViewUtilities.isSheetView(content.viewport);\n }\n\n /**\n * Determines if content displays a Drawing view.\n * @param content ContentControl to check\n */\n public static isContentDrawingView(\n content: ContentControl | undefined\n ): boolean {\n if (!content || !content.viewport) return false;\n return ViewUtilities.isDrawingView(content.viewport);\n }\n\n /**\n * Determines if content displays a Spatial view.\n * @param content ContentControl to check\n */\n public static isContentSpatialView(\n content: ContentControl | undefined\n ): boolean {\n if (!content || !content.viewport) return false;\n return ViewUtilities.isSpatialView(content.viewport);\n }\n\n /**\n * Determines if content displays a Orthographic view.\n * @param content ContentControl to check\n */\n public static isContentOrthographicView(\n content: ContentControl | undefined\n ): boolean {\n if (!content || !content.viewport) return false;\n return ViewUtilities.isOrthographicView(content.viewport);\n }\n\n /**\n * Determines if content displays a 3d view.\n * @param content ContentControl to check\n */\n public static isContent3dView(content: ContentControl | undefined): boolean {\n if (!content || !content.viewport) return false;\n return ViewUtilities.is3dView(content.viewport);\n }\n\n /**\n * Determines if viewport supports use of a camera.\n * @param content ContentControl to check\n */\n public static contentSupportsCamera(\n content: ContentControl | undefined\n ): boolean {\n if (!content || !content.viewport) return false;\n return ViewUtilities.viewSupportsCamera(content.viewport);\n }\n\n /**\n * Manage content layouts.\n * @beta\n */\n public static get layouts() {\n return InternalContentLayoutManager;\n }\n /**\n * Manage dialogs displaying managed content.\n * @beta\n */\n public static get dialogs() {\n return InternalContentDialogManager;\n }\n}\n"]}
1
+ {"version":3,"file":"InternalContentViewManager.js","sourceRoot":"","sources":["../../../../src/appui-react/content/InternalContentViewManager.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EACL,yBAAyB,EACzB,qBAAqB,GACtB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,4BAA4B,EAAE,MAAM,wCAAwC,CAAC;AAEtF;;GAEG;AACH,MAAa,0BAA0B;IAOrC,wDAAwD;IACjD,MAAM,KAAK,WAAW;QAC3B,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED,oDAAoD;IAC7C,MAAM,CAAC,YAAY,CAAC,SAAkB;QAC3C,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC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G;IACI,MAAM,CAAC,qBAAqB,CACjC,OAAmC;QAEnC,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ;YAAE,OAAO,KAAK,CAAC;QAChD,OAAO,aAAa,CAAC,kBAAkB,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC5D,CAAC;IAED;;;OAGG;IACI,MAAM,KAAK,OAAO;QACvB,OAAO,4BAA4B,CAAC;IACtC,CAAC;IACD;;;OAGG;IACI,MAAM,KAAK,OAAO;QACvB,OAAO,4BAA4B,CAAC;IACtC,CAAC;;AAnQc,qCAAU,GAAY,KAAK,CAAC;AAG3C,yCAAyC;AAClB,kDAAuB,GAAG,IAAI,qBAAqB,EAAE,CAAC;AAa7E,6CAA6C;AACtB,sDAA2B,GAChD,IAAI,yBAAyB,EAAE,CAAC;AAElC,wDAAwD;AAEjC,yDAA8B,GAAG,IAAI,OAAO,EAE/D,CAAC;SA1BM,0BAA0B","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 ContentView\n */\n\nimport type * as React from \"react\";\nimport { UiEvent } from \"@itwin/appui-abstract\";\nimport { ViewUtilities } from \"../utils/ViewUtilities\";\nimport type { ContentControl } from \"./ContentControl\";\nimport { InternalContentLayoutManager } from \"./InternalContentLayoutManager\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport type { ContentGroup } from \"./ContentGroup\";\nimport { Logger } from \"@itwin/core-bentley\";\nimport { UiFramework } from \"../UiFramework\";\nimport {\n ActiveContentChangedEvent,\n MouseDownChangedEvent,\n} from \"../framework/FrameworkContent\";\nimport { InternalContentDialogManager } from \"../dialog/InternalContentDialogManager\";\n\n/** Content View Manager class.\n * @internal\n */\nexport class InternalContentViewManager {\n private static _mouseDown: boolean = false;\n private static _activeContent?: React.ReactNode;\n\n /** Gets the [[MouseDownChangedEvent]] */\n public static readonly onMouseDownChangedEvent = new MouseDownChangedEvent();\n\n /** Determines if the mouse is down in a content view */\n public static get isMouseDown(): boolean {\n return this._mouseDown;\n }\n\n /** Sets the mouse down status for a content view */\n public static setMouseDown(mouseDown: boolean): void {\n this._mouseDown = mouseDown;\n this.onMouseDownChangedEvent.emit({ mouseDown });\n }\n\n /** Gets the [[ActiveContentChangedEvent]] */\n public static readonly onActiveContentChangedEvent =\n new ActiveContentChangedEvent();\n\n /** Fires when floating contents are added or removed */\n\n public static readonly onAvailableContentChangedEvent = new UiEvent<{\n contentId: string;\n }>();\n\n /** Gets the active content as a React.ReactNode. */\n public static getActive(): React.ReactNode | undefined {\n return this._activeContent;\n }\n\n private static getControlFromElement(\n content: React.ReactNode,\n activeContentGroup: ContentGroup | undefined,\n floatingControls: ContentControl[] | undefined,\n logIfNotFound = false\n ) {\n if (floatingControls?.length) {\n // if we find a React node that matches exactly, return its containing control\n let control = floatingControls.find(\n (contentControl) => contentControl.reactNode === content\n );\n if (control) return control;\n\n // if we don't find a React node that matches exactly, rely on the id specified by the creator\n let controlId: string;\n if (content && (content as React.ReactElement<any>).key) {\n const key = (content as React.ReactElement<any>).key as string;\n // key has format `${contentProps.id}::${this.groupId}` which is stored as unique id\n controlId = key.split(\"::\", 1)[0];\n }\n floatingControls.forEach((contentControl: ContentControl) => {\n const node = contentControl.reactNode;\n const key = (node as React.ReactElement<any>).key as string;\n const nodeId = key && key.split(\"::\", 1)[0];\n if (nodeId === controlId) control = contentControl;\n });\n if (control) return control;\n }\n\n // if it's not a floating control, look through the content area views\n // istanbul ignore else\n if (activeContentGroup) {\n const activeContentControl =\n activeContentGroup.getControlFromElement(content);\n if (activeContentControl) return activeContentControl;\n }\n\n if (logIfNotFound)\n Logger.logError(\n UiFramework.loggerCategory(this),\n `getControlFromElement: no control found for element`\n );\n\n return undefined;\n }\n\n /** Return the active ContentControl. */\n public static getActiveContentControl(): ContentControl | undefined {\n let activeContentControl: ContentControl | undefined;\n const activeFrontstageDef = UiFramework.frontstages.activeFrontstageDef;\n\n // istanbul ignore else\n if (this._activeContent && activeFrontstageDef) {\n const activeContentGroup = activeFrontstageDef.contentGroup;\n activeContentControl = this.getControlFromElement(\n this._activeContent,\n activeContentGroup,\n activeFrontstageDef.floatingContentControls\n );\n }\n\n return activeContentControl;\n }\n\n public static addFloatingContentControl(contentControl?: ContentControl) {\n const activeFrontstageDef = UiFramework.frontstages.activeFrontstageDef;\n // istanbul ignore else\n if (activeFrontstageDef && contentControl) {\n activeFrontstageDef.addFloatingContentControl(contentControl);\n }\n }\n\n public static dropFloatingContentControl(contentControl?: ContentControl) {\n const activeFrontstageDef = UiFramework.frontstages.activeFrontstageDef;\n // istanbul ignore else\n if (activeFrontstageDef && contentControl)\n activeFrontstageDef.dropFloatingContentControl(contentControl);\n }\n\n /** Sets the active [[ContentControl]] */\n public static setActive(\n activeContent?: React.ReactNode,\n forceEventProcessing = false\n ): void {\n // istanbul ignore else\n if (this._activeContent !== activeContent || forceEventProcessing) {\n const oldContent = this._activeContent;\n this._activeContent = activeContent;\n\n const activeFrontstageDef = UiFramework.frontstages.activeFrontstageDef;\n\n // istanbul ignore else\n if (activeFrontstageDef) {\n const activeContentGroup = activeFrontstageDef.contentGroup;\n\n // istanbul ignore else\n const oldContentControl = this.getControlFromElement(\n oldContent,\n activeContentGroup,\n activeFrontstageDef.floatingContentControls\n );\n const activeContentControl = this.getControlFromElement(\n activeContent,\n activeContentGroup,\n activeFrontstageDef.floatingContentControls,\n true\n );\n\n // Only call setActiveView if going to or coming from a non-viewport ContentControl\n // istanbul ignore else\n if (activeContentControl) {\n // istanbul ignore next\n const doSetActiveView =\n forceEventProcessing ||\n !activeContentControl.viewport ||\n /* istanbul ignore next */ (oldContentControl &&\n /* istanbul ignore next */ !oldContentControl.viewport);\n\n // istanbul ignore else\n if (doSetActiveView) {\n activeFrontstageDef.setActiveView(\n activeContentControl,\n oldContentControl\n );\n this.onActiveContentChangedEvent.emit({\n activeContent,\n oldContent,\n });\n } else {\n if (\n activeContentControl.viewport &&\n activeContentControl.viewport !==\n IModelApp.viewManager.selectedView\n ) {\n void IModelApp.viewManager.setSelectedView(\n activeContentControl.viewport\n );\n }\n }\n }\n }\n }\n }\n\n /** Refreshes the active [[ContentControl]] */\n public static refreshActive(activeContent: React.ReactNode) {\n this.layouts.refreshActive();\n this.setActive(activeContent, true);\n }\n\n /**\n * Determines if content displays a Sheet view.\n * @param content ContentControl to check\n */\n public static isContentSheetView(\n content: ContentControl | undefined\n ): boolean {\n if (!content || !content.viewport) return false;\n return ViewUtilities.isSheetView(content.viewport);\n }\n\n /**\n * Determines if content displays a Drawing view.\n * @param content ContentControl to check\n */\n public static isContentDrawingView(\n content: ContentControl | undefined\n ): boolean {\n if (!content || !content.viewport) return false;\n return ViewUtilities.isDrawingView(content.viewport);\n }\n\n /**\n * Determines if content displays a Spatial view.\n * @param content ContentControl to check\n */\n public static isContentSpatialView(\n content: ContentControl | undefined\n ): boolean {\n if (!content || !content.viewport) return false;\n return ViewUtilities.isSpatialView(content.viewport);\n }\n\n /**\n * Determines if content displays a Orthographic view.\n * @param content ContentControl to check\n */\n public static isContentOrthographicView(\n content: ContentControl | undefined\n ): boolean {\n if (!content || !content.viewport) return false;\n return ViewUtilities.isOrthographicView(content.viewport);\n }\n\n /**\n * Determines if content displays a 3d view.\n * @param content ContentControl to check\n */\n public static isContent3dView(content: ContentControl | undefined): boolean {\n if (!content || !content.viewport) return false;\n return ViewUtilities.is3dView(content.viewport);\n }\n\n /**\n * Determines if viewport supports use of a camera.\n * @param content ContentControl to check\n */\n public static contentSupportsCamera(\n content: ContentControl | undefined\n ): boolean {\n if (!content || !content.viewport) return false;\n return ViewUtilities.viewSupportsCamera(content.viewport);\n }\n\n /**\n * Manage content layouts.\n * @beta\n */\n public static get layouts() {\n return InternalContentLayoutManager;\n }\n /**\n * Manage dialogs displaying managed content.\n * @beta\n */\n public static get dialogs() {\n return InternalContentDialogManager;\n }\n}\n"]}
@@ -10,6 +10,7 @@ import classnames from "classnames";
10
10
  import { Pane } from "./Pane";
11
11
  import { Resizer } from "./Resizer";
12
12
  function unFocus(ownerDoc) {
13
+ var _a;
13
14
  // istanbul ignore next
14
15
  if (!ownerDoc)
15
16
  return;
@@ -21,8 +22,8 @@ function unFocus(ownerDoc) {
21
22
  else {
22
23
  // istanbul ignore next
23
24
  try {
24
- const winSelection = ownerDoc.defaultView?.getSelection();
25
- winSelection?.removeAllRanges();
25
+ const winSelection = (_a = ownerDoc.defaultView) === null || _a === void 0 ? void 0 : _a.getSelection();
26
+ winSelection === null || winSelection === void 0 ? void 0 : winSelection.removeAllRanges();
26
27
  }
27
28
  catch (_e) { }
28
29
  }
@@ -100,14 +101,15 @@ export function SplitPane(props) {
100
101
  }, [split, style]);
101
102
  const pane1DivStyle = { ...paneStyle, ...pane1Style };
102
103
  const pane2DivStyle = { ...paneStyle, ...pane2Style };
103
- const resizerStyle = React.useMemo(() => props.resizerStyle ?? {}, [props.resizerStyle]);
104
+ const resizerStyle = React.useMemo(() => { var _a; return (_a = props.resizerStyle) !== null && _a !== void 0 ? _a : {}; }, [props.resizerStyle]);
104
105
  const resizerClasses = React.useMemo(() => classnames("Resizer", !allowResize && "disabled"), [allowResize]);
105
106
  const splitPaneClasses = React.useMemo(() => classnames("SplitPane", className, split, !allowResize && "disabled"), [className, split, allowResize]);
106
107
  const pane1Classes = React.useMemo(() => classnames("Pane1", paneClassName, pane1ClassName), [paneClassName, pane1ClassName]);
107
108
  const pane2Classes = React.useMemo(() => classnames("Pane2", paneClassName, pane2ClassName), [paneClassName, pane2ClassName]);
108
109
  const initializeDrag = React.useCallback((x, y) => {
110
+ var _a;
109
111
  // istanbul ignore next
110
- unFocus(splitPane.current?.ownerDocument);
112
+ unFocus((_a = splitPane.current) === null || _a === void 0 ? void 0 : _a.ownerDocument);
111
113
  const newPosition = split === "vertical" ? x : y;
112
114
  onDragStarted && onDragStarted();
113
115
  setActive(true);
@@ -120,8 +122,9 @@ export function SplitPane(props) {
120
122
  }
121
123
  }, [allowResize, initializeDrag]);
122
124
  const processMove = React.useCallback((x, y) => {
125
+ var _a, _b, _c, _d, _f, _g, _h;
123
126
  // istanbul ignore next
124
- unFocus(splitPane.current?.ownerDocument);
127
+ unFocus((_a = splitPane.current) === null || _a === void 0 ? void 0 : _a.ownerDocument);
125
128
  const isPrimaryFirst = primary === "first";
126
129
  const ref = isPrimaryFirst ? pane1.current : pane2.current;
127
130
  const ref2 = isPrimaryFirst ? pane2.current : pane1.current;
@@ -149,11 +152,9 @@ export function SplitPane(props) {
149
152
  }
150
153
  let sizeDelta = isPrimaryFirst ? positionDelta : -positionDelta;
151
154
  // istanbul ignore next
152
- const pane1Order = parseInt(node.ownerDocument?.defaultView?.getComputedStyle(node).order ??
153
- "0", 10);
155
+ const pane1Order = parseInt((_d = (_c = (_b = node.ownerDocument) === null || _b === void 0 ? void 0 : _b.defaultView) === null || _c === void 0 ? void 0 : _c.getComputedStyle(node).order) !== null && _d !== void 0 ? _d : "0", 10);
154
156
  // istanbul ignore next
155
- const pane2Order = parseInt(node2.ownerDocument?.defaultView?.getComputedStyle(node2).order ??
156
- "0", 10);
157
+ const pane2Order = parseInt((_h = (_g = (_f = node2.ownerDocument) === null || _f === void 0 ? void 0 : _f.defaultView) === null || _g === void 0 ? void 0 : _g.getComputedStyle(node2).order) !== null && _h !== void 0 ? _h : "0", 10);
157
158
  // istanbul ignore next
158
159
  if (pane1Order > pane2Order) {
159
160
  sizeDelta = -sizeDelta;
@@ -221,8 +222,9 @@ export function SplitPane(props) {
221
222
  processResizeFinished();
222
223
  }, [processResizeFinished]);
223
224
  React.useEffect(() => {
225
+ var _a;
224
226
  // istanbul ignore next
225
- const ownerDoc = splitPane.current?.ownerDocument;
227
+ const ownerDoc = (_a = splitPane.current) === null || _a === void 0 ? void 0 : _a.ownerDocument;
226
228
  // istanbul ignore next
227
229
  if (!ownerDoc)
228
230
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"SplitPane.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gBAAgB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;QACpD,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,mBAAmB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;YACnD,QAAQ,CAAC,mBAAmB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;YACvD,QAAQ,CAAC,mBAAmB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;QACzD,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,WAAW,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC;IAE1C,OAAO,CACL,6BAAK,SAAS,EAAE,gBAAgB,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,cAAc;QACrE,oBAAC,IAAI,IACH,SAAS,EAAE,YAAY,EACvB,GAAG,EAAC,OAAO,EACX,MAAM,EAAE,KAAK,EACb,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,aAAa,IAEnB,eAAe,CAAC,CAAC,CAAC,CACd;QACP,oBAAC,OAAO,IACN,SAAS,EAAE,cAAc,EACzB,OAAO,EAAE,cAAc,EACvB,aAAa,EAAE,oBAAoB,EACnC,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,qBAAqB,EACjC,GAAG,EAAC,SAAS,EACb,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,YAAY,GACnB;QACF,oBAAC,IAAI,IACH,SAAS,EAAE,YAAY,EACvB,GAAG,EAAC,OAAO,EACX,MAAM,EAAE,KAAK,EACb,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,aAAa,IAEnB,eAAe,CAAC,CAAC,CAAC,CACd,CACH,CACP,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module ContentView\n */\n\nimport * as React from \"react\";\nimport classnames from \"classnames\";\nimport { Pane } from \"./Pane\";\nimport { Resizer } from \"./Resizer\";\n\n/**\n * Props for [[SplitPane]] component\n * @public\n */\nexport interface SplitPaneProps {\n /** Pass false to disable resizing */\n allowResize?: boolean;\n /** The array of two react nodes, one for each pane. */\n children: React.ReactNode[];\n /** Determines which pane maintains its size when browser window is resized.*/\n primary?: \"first\" | \"second\";\n\n minSize?: string | number;\n /** You can limit the maximal size of the 'fixed' pane using the maxSize parameter with a positive value\n * (measured in pixels but state just a number). If you wrap the SplitPane into a container component\n * (yes you can, just remember the container has to have the relative or absolute positioning), then you'll need to limit\n * the movement of the splitter (resizer) at the end of the SplitPane (otherwise it can be dragged outside the SplitPane\n * and you don't catch it never more). For this purpose use the maxSize parameter with value 0. When dragged the splitter/resizer\n * will stop at the border of the SplitPane component and think this you'll be able to pick it again and drag it back then.\n * And more: if you set the maxSize to negative value (e.g. -200), then the splitter stops 200px before the border\n * (in other words it sets the minimal size of the 'resizable' pane in this case). This can be useful also in the\n * full-screen case of use. */\n maxSize?: string | number;\n /** Default initial size of primary pane */\n defaultSize?: string | number;\n /** Size of primary pane */\n size?: string | number;\n /** You can use the step prop to only allow resizing in fixed increments. */\n step?: number;\n split?: \"vertical\" | \"horizontal\";\n /** This callback is invoked when a drag start. */\n onDragStarted?: () => void;\n /** This callback is invoked when a drag ends. */\n onDragFinished?: (newSize: number) => void;\n /** Callback is invoked with the current drag during a drag event.*/\n onChange?: (newSize: number) => void;\n /** Callback is invoked if user clicks on Resizer. */\n onResizerClick?: (event: MouseEvent) => void;\n /** Callback is invoked if user double clicks on Resizer. */\n onResizerDoubleClick?: (event: MouseEvent) => void;\n /** Styling to be applied to the main container */\n style?: React.CSSProperties;\n /** Styling to be applied to both panes */\n paneStyle?: React.CSSProperties;\n /** Styling to be applied to the first pane, with precedence over paneStyle */\n pane1Style?: React.CSSProperties;\n /** Styling to be applied to the second pane, with precedence over paneStyle */\n pane2Style?: React.CSSProperties;\n /** Styling to be applied to the resizer bar */\n resizerStyle?: React.CSSProperties;\n /** Class name to be added to the SplitPane div */\n className?: string;\n /** Class name to be added to each Pane's div */\n paneClassName?: string;\n /** Class name to be added to Pane1's div */\n pane1ClassName?: string;\n /** Class name to be added to Pane2's div */\n pane2ClassName?: string;\n}\n\nfunction unFocus(ownerDoc: Document | undefined) {\n // istanbul ignore next\n if (!ownerDoc) return;\n\n const docSelection = ownerDoc.getSelection();\n // istanbul ignore else\n if (docSelection) {\n docSelection.empty();\n } else {\n // istanbul ignore next\n try {\n const winSelection = ownerDoc.defaultView?.getSelection();\n winSelection?.removeAllRanges();\n } catch (_e) {}\n }\n}\n\nfunction getDefaultSize(\n defaultSize?: number | string,\n minSize?: string | number,\n maxSize?: string | number,\n draggedSize?: number\n) {\n // istanbul ignore next\n if (typeof draggedSize === \"number\") {\n const min = typeof minSize === \"number\" ? minSize : 0;\n const max =\n typeof maxSize === \"number\" && maxSize >= 0 ? maxSize : Infinity;\n return Math.max(min, Math.min(max, draggedSize));\n }\n if (defaultSize !== undefined) {\n return defaultSize;\n }\n return minSize;\n}\n\nfunction removeNullChildren(children: React.ReactNode[]) {\n return React.Children.toArray(children).filter((c) => c);\n}\n\n/**\n * Local TypeScript implementation of `SplitPane` from `react-split-pane` package since that\n * package is not regularly maintained.\n * See https://github.com/tomkp/react-split-pane/blob/master/LICENSE.\n * @public\n */\nexport function SplitPane(props: SplitPaneProps) {\n const {\n style,\n size,\n defaultSize,\n maxSize,\n children,\n paneStyle,\n pane1Style,\n pane2Style,\n className,\n paneClassName,\n pane1ClassName,\n pane2ClassName,\n onDragStarted,\n onDragFinished,\n step,\n onChange,\n onResizerClick,\n onResizerDoubleClick,\n } = props;\n\n // honor same defaults as react-split-pane\n const allowResize = React.useMemo(\n () => (undefined !== props.allowResize ? props.allowResize : true),\n [props.allowResize]\n );\n const minSize = React.useMemo(\n () => (undefined !== props.minSize ? props.minSize : 50),\n [props.minSize]\n );\n const primary = React.useMemo(\n () => (undefined !== props.primary ? props.primary : \"first\"),\n [props.primary]\n );\n const split = React.useMemo(\n () => (undefined !== props.split ? props.split : \"vertical\"),\n [props.split]\n );\n const initialSize =\n size !== undefined ? size : getDefaultSize(defaultSize, minSize, maxSize);\n\n const [position, setPosition] = React.useState(0);\n const [draggedSize, setDraggedSize] = React.useState<number | undefined>();\n const [active, setActive] = React.useState(false);\n const [pane1Size, setPane1Size] = React.useState(() =>\n primary === \"first\" ? initialSize : undefined\n );\n const [pane2Size, setPane2Size] = React.useState(() =>\n primary === \"second\" ? initialSize : undefined\n );\n const splitPane = React.useRef<HTMLDivElement>(null);\n const pane1 = React.useRef<HTMLDivElement>(null);\n const pane2 = React.useRef<HTMLDivElement>(null);\n const notNullChildren = React.useMemo(\n () => removeNullChildren(children),\n [children]\n );\n\n React.useEffect(() => {\n primary === \"first\" ? setPane1Size(initialSize) : setPane2Size(initialSize);\n primary === \"first\" ? setPane2Size(undefined) : setPane1Size(undefined);\n }, [initialSize, primary]);\n\n const splitPaneStyle = React.useMemo(() => {\n const directionSpecificParts =\n split === \"vertical\"\n ? {\n flexDirection: \"row\",\n left: 0,\n right: 0,\n }\n : {\n bottom: 0,\n flexDirection: \"column\",\n minHeight: \"100%\",\n top: 0,\n width: \"100%\",\n };\n\n return {\n display: \"flex\",\n flex: 1,\n height: \"100%\",\n position: \"absolute\",\n outline: \"none\",\n overflow: \"hidden\",\n MozUserSelect: \"text\",\n WebkitUserSelect: \"text\",\n msUserSelect: \"text\",\n userSelect: \"text\",\n ...style,\n ...directionSpecificParts,\n } as React.CSSProperties;\n }, [split, style]);\n\n const pane1DivStyle = { ...paneStyle, ...pane1Style };\n const pane2DivStyle = { ...paneStyle, ...pane2Style };\n const resizerStyle = React.useMemo(\n () => props.resizerStyle ?? {},\n [props.resizerStyle]\n );\n const resizerClasses = React.useMemo(\n () => classnames(\"Resizer\", !allowResize && \"disabled\"),\n [allowResize]\n );\n const splitPaneClasses = React.useMemo(\n () => classnames(\"SplitPane\", className, split, !allowResize && \"disabled\"),\n [className, split, allowResize]\n );\n const pane1Classes = React.useMemo(\n () => classnames(\"Pane1\", paneClassName, pane1ClassName),\n [paneClassName, pane1ClassName]\n );\n const pane2Classes = React.useMemo(\n () => classnames(\"Pane2\", paneClassName, pane2ClassName),\n [paneClassName, pane2ClassName]\n );\n\n const initializeDrag = React.useCallback(\n (x: number, y: number) => {\n // istanbul ignore next\n unFocus(splitPane.current?.ownerDocument);\n const newPosition = split === \"vertical\" ? x : y;\n onDragStarted && onDragStarted();\n setActive(true);\n setPosition(newPosition);\n },\n [onDragStarted, split]\n );\n\n const onTouchStart = React.useCallback(\n (event: TouchEvent) => {\n // istanbul ignore else\n if (allowResize) {\n initializeDrag(event.touches[0].clientX, event.touches[0].clientY);\n }\n },\n [allowResize, initializeDrag]\n );\n\n const processMove = React.useCallback(\n (x: number, y: number) => {\n // istanbul ignore next\n unFocus(splitPane.current?.ownerDocument);\n const isPrimaryFirst = primary === \"first\";\n const ref = isPrimaryFirst ? pane1.current : pane2.current;\n const ref2 = isPrimaryFirst ? pane2.current : pane1.current;\n const splitPaneDiv = splitPane.current;\n\n // istanbul ignore else\n if (ref && ref2 && splitPaneDiv) {\n const node = ref;\n const node2 = ref2;\n // istanbul ignore else\n if (node.getBoundingClientRect) {\n const width = node.getBoundingClientRect().width;\n const height = node.getBoundingClientRect().height;\n // istanbul ignore next\n const current = split === \"vertical\" ? x : y;\n // istanbul ignore next\n const oldSize = split === \"vertical\" ? width : height;\n let positionDelta = position - current;\n if (step) {\n // istanbul ignore next\n if (Math.abs(positionDelta) < step) {\n return;\n }\n // Integer division\n positionDelta = ~~(positionDelta / step) * step;\n }\n let sizeDelta = isPrimaryFirst ? positionDelta : -positionDelta;\n\n // istanbul ignore next\n const pane1Order = parseInt(\n node.ownerDocument?.defaultView?.getComputedStyle(node).order ??\n \"0\",\n 10\n );\n // istanbul ignore next\n const pane2Order = parseInt(\n node2.ownerDocument?.defaultView?.getComputedStyle(node2).order ??\n \"0\",\n 10\n );\n // istanbul ignore next\n if (pane1Order > pane2Order) {\n sizeDelta = -sizeDelta;\n }\n\n let newMaxSize = maxSize;\n // istanbul ignore next\n if (\n typeof maxSize === \"number\" &&\n maxSize !== undefined &&\n maxSize <= 0\n ) {\n if (split === \"vertical\") {\n newMaxSize = splitPaneDiv.getBoundingClientRect().width + maxSize;\n } else {\n newMaxSize =\n splitPaneDiv.getBoundingClientRect().height + maxSize;\n }\n }\n\n let newSize = oldSize - sizeDelta;\n const newPosition = position - positionDelta;\n\n // istanbul ignore next\n if (typeof minSize === \"number\" && newSize < minSize) {\n newSize = minSize;\n } else if (\n typeof newMaxSize === \"number\" &&\n newMaxSize !== undefined &&\n newSize > newMaxSize\n ) {\n newSize = newMaxSize;\n } else {\n setPosition(newPosition);\n }\n\n onChange && onChange(newSize);\n setDraggedSize(newSize);\n isPrimaryFirst ? setPane1Size(newSize) : setPane2Size(newSize);\n }\n }\n },\n [maxSize, minSize, onChange, position, primary, split, step]\n );\n\n const onTouchMove = React.useCallback(\n (event: TouchEvent) => {\n // istanbul ignore next\n if (!allowResize || !active) return;\n processMove(event.touches[0].clientX, event.touches[0].clientY);\n },\n [active, allowResize, processMove]\n );\n\n const onMouseMove = React.useCallback(\n (event: MouseEvent) => {\n if (!allowResize || !active) return;\n processMove(event.clientX, event.clientY);\n },\n [active, allowResize, processMove]\n );\n\n const onMouseDown = React.useCallback(\n (event: MouseEvent) => {\n // istanbul ignore else\n if (allowResize) {\n event.preventDefault();\n initializeDrag(event.clientX, event.clientY);\n }\n },\n [allowResize, initializeDrag]\n );\n\n const processResizeFinished = React.useCallback(() => {\n // istanbul ignore else\n if (undefined !== draggedSize && allowResize && active) {\n onDragFinished && onDragFinished(draggedSize);\n }\n setActive(false);\n }, [draggedSize, allowResize, active, onDragFinished]);\n\n const onMouseUp = React.useCallback(\n (event: MouseEvent) => {\n event.preventDefault();\n processResizeFinished();\n },\n [processResizeFinished]\n );\n\n React.useEffect(() => {\n // istanbul ignore next\n const ownerDoc = splitPane.current?.ownerDocument;\n // istanbul ignore next\n if (!ownerDoc) return;\n\n ownerDoc.addEventListener(\"mouseup\", onMouseUp);\n ownerDoc.addEventListener(\"mousemove\", onMouseMove);\n ownerDoc.addEventListener(\"touchmove\", onTouchMove);\n return () => {\n ownerDoc.removeEventListener(\"mouseup\", onMouseUp);\n ownerDoc.removeEventListener(\"mousemove\", onMouseMove);\n ownerDoc.removeEventListener(\"touchmove\", onTouchMove);\n };\n }, [onMouseMove, onMouseUp, onTouchMove]);\n\n return (\n <div className={splitPaneClasses} ref={splitPane} style={splitPaneStyle}>\n <Pane\n className={pane1Classes}\n key=\"pane1\"\n eleRef={pane1}\n size={pane1Size}\n split={split}\n style={pane1DivStyle}\n >\n {notNullChildren[0]}\n </Pane>\n <Resizer\n className={resizerClasses}\n onClick={onResizerClick}\n onDoubleClick={onResizerDoubleClick}\n onMouseDown={onMouseDown}\n onTouchStart={onTouchStart}\n onTouchEnd={processResizeFinished}\n key=\"resizer\"\n split={split}\n style={resizerStyle}\n />\n <Pane\n className={pane2Classes}\n key=\"pane2\"\n eleRef={pane2}\n size={pane2Size}\n split={split}\n style={pane2DivStyle}\n >\n {notNullChildren[1]}\n </Pane>\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"SplitPane.js","sourceRoot":"","sources":["../../../../../src/appui-react/content/split-pane/SplitPane.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA8DpC,SAAS,OAAO,CAAC,QAA8B;;IAC7C,uBAAuB;IACvB,IAAI,CAAC,QAAQ;QAAE,OAAO;IAEtB,MAAM,YAAY,GAAG,QAAQ,CAAC,YAAY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AE,CAAC,WAAW,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC;IAE1C,OAAO,CACL,6BAAK,SAAS,EAAE,gBAAgB,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,cAAc;QACrE,oBAAC,IAAI,IACH,SAAS,EAAE,YAAY,EACvB,GAAG,EAAC,OAAO,EACX,MAAM,EAAE,KAAK,EACb,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,aAAa,IAEnB,eAAe,CAAC,CAAC,CAAC,CACd;QACP,oBAAC,OAAO,IACN,SAAS,EAAE,cAAc,EACzB,OAAO,EAAE,cAAc,EACvB,aAAa,EAAE,oBAAoB,EACnC,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,qBAAqB,EACjC,GAAG,EAAC,SAAS,EACb,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,YAAY,GACnB;QACF,oBAAC,IAAI,IACH,SAAS,EAAE,YAAY,EACvB,GAAG,EAAC,OAAO,EACX,MAAM,EAAE,KAAK,EACb,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,aAAa,IAEnB,eAAe,CAAC,CAAC,CAAC,CACd,CACH,CACP,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module ContentView\n */\n\nimport * as React from \"react\";\nimport classnames from \"classnames\";\nimport { Pane } from \"./Pane\";\nimport { Resizer } from \"./Resizer\";\n\n/**\n * Props for [[SplitPane]] component\n * @public\n */\nexport interface SplitPaneProps {\n /** Pass false to disable resizing */\n allowResize?: boolean;\n /** The array of two react nodes, one for each pane. */\n children: React.ReactNode[];\n /** Determines which pane maintains its size when browser window is resized.*/\n primary?: \"first\" | \"second\";\n\n minSize?: string | number;\n /** You can limit the maximal size of the 'fixed' pane using the maxSize parameter with a positive value\n * (measured in pixels but state just a number). If you wrap the SplitPane into a container component\n * (yes you can, just remember the container has to have the relative or absolute positioning), then you'll need to limit\n * the movement of the splitter (resizer) at the end of the SplitPane (otherwise it can be dragged outside the SplitPane\n * and you don't catch it never more). For this purpose use the maxSize parameter with value 0. When dragged the splitter/resizer\n * will stop at the border of the SplitPane component and think this you'll be able to pick it again and drag it back then.\n * And more: if you set the maxSize to negative value (e.g. -200), then the splitter stops 200px before the border\n * (in other words it sets the minimal size of the 'resizable' pane in this case). This can be useful also in the\n * full-screen case of use. */\n maxSize?: string | number;\n /** Default initial size of primary pane */\n defaultSize?: string | number;\n /** Size of primary pane */\n size?: string | number;\n /** You can use the step prop to only allow resizing in fixed increments. */\n step?: number;\n split?: \"vertical\" | \"horizontal\";\n /** This callback is invoked when a drag start. */\n onDragStarted?: () => void;\n /** This callback is invoked when a drag ends. */\n onDragFinished?: (newSize: number) => void;\n /** Callback is invoked with the current drag during a drag event.*/\n onChange?: (newSize: number) => void;\n /** Callback is invoked if user clicks on Resizer. */\n onResizerClick?: (event: MouseEvent) => void;\n /** Callback is invoked if user double clicks on Resizer. */\n onResizerDoubleClick?: (event: MouseEvent) => void;\n /** Styling to be applied to the main container */\n style?: React.CSSProperties;\n /** Styling to be applied to both panes */\n paneStyle?: React.CSSProperties;\n /** Styling to be applied to the first pane, with precedence over paneStyle */\n pane1Style?: React.CSSProperties;\n /** Styling to be applied to the second pane, with precedence over paneStyle */\n pane2Style?: React.CSSProperties;\n /** Styling to be applied to the resizer bar */\n resizerStyle?: React.CSSProperties;\n /** Class name to be added to the SplitPane div */\n className?: string;\n /** Class name to be added to each Pane's div */\n paneClassName?: string;\n /** Class name to be added to Pane1's div */\n pane1ClassName?: string;\n /** Class name to be added to Pane2's div */\n pane2ClassName?: string;\n}\n\nfunction unFocus(ownerDoc: Document | undefined) {\n // istanbul ignore next\n if (!ownerDoc) return;\n\n const docSelection = ownerDoc.getSelection();\n // istanbul ignore else\n if (docSelection) {\n docSelection.empty();\n } else {\n // istanbul ignore next\n try {\n const winSelection = ownerDoc.defaultView?.getSelection();\n winSelection?.removeAllRanges();\n } catch (_e) {}\n }\n}\n\nfunction getDefaultSize(\n defaultSize?: number | string,\n minSize?: string | number,\n maxSize?: string | number,\n draggedSize?: number\n) {\n // istanbul ignore next\n if (typeof draggedSize === \"number\") {\n const min = typeof minSize === \"number\" ? minSize : 0;\n const max =\n typeof maxSize === \"number\" && maxSize >= 0 ? maxSize : Infinity;\n return Math.max(min, Math.min(max, draggedSize));\n }\n if (defaultSize !== undefined) {\n return defaultSize;\n }\n return minSize;\n}\n\nfunction removeNullChildren(children: React.ReactNode[]) {\n return React.Children.toArray(children).filter((c) => c);\n}\n\n/**\n * Local TypeScript implementation of `SplitPane` from `react-split-pane` package since that\n * package is not regularly maintained.\n * See https://github.com/tomkp/react-split-pane/blob/master/LICENSE.\n * @public\n */\nexport function SplitPane(props: SplitPaneProps) {\n const {\n style,\n size,\n defaultSize,\n maxSize,\n children,\n paneStyle,\n pane1Style,\n pane2Style,\n className,\n paneClassName,\n pane1ClassName,\n pane2ClassName,\n onDragStarted,\n onDragFinished,\n step,\n onChange,\n onResizerClick,\n onResizerDoubleClick,\n } = props;\n\n // honor same defaults as react-split-pane\n const allowResize = React.useMemo(\n () => (undefined !== props.allowResize ? props.allowResize : true),\n [props.allowResize]\n );\n const minSize = React.useMemo(\n () => (undefined !== props.minSize ? props.minSize : 50),\n [props.minSize]\n );\n const primary = React.useMemo(\n () => (undefined !== props.primary ? props.primary : \"first\"),\n [props.primary]\n );\n const split = React.useMemo(\n () => (undefined !== props.split ? props.split : \"vertical\"),\n [props.split]\n );\n const initialSize =\n size !== undefined ? size : getDefaultSize(defaultSize, minSize, maxSize);\n\n const [position, setPosition] = React.useState(0);\n const [draggedSize, setDraggedSize] = React.useState<number | undefined>();\n const [active, setActive] = React.useState(false);\n const [pane1Size, setPane1Size] = React.useState(() =>\n primary === \"first\" ? initialSize : undefined\n );\n const [pane2Size, setPane2Size] = React.useState(() =>\n primary === \"second\" ? initialSize : undefined\n );\n const splitPane = React.useRef<HTMLDivElement>(null);\n const pane1 = React.useRef<HTMLDivElement>(null);\n const pane2 = React.useRef<HTMLDivElement>(null);\n const notNullChildren = React.useMemo(\n () => removeNullChildren(children),\n [children]\n );\n\n React.useEffect(() => {\n primary === \"first\" ? setPane1Size(initialSize) : setPane2Size(initialSize);\n primary === \"first\" ? setPane2Size(undefined) : setPane1Size(undefined);\n }, [initialSize, primary]);\n\n const splitPaneStyle = React.useMemo(() => {\n const directionSpecificParts =\n split === \"vertical\"\n ? {\n flexDirection: \"row\",\n left: 0,\n right: 0,\n }\n : {\n bottom: 0,\n flexDirection: \"column\",\n minHeight: \"100%\",\n top: 0,\n width: \"100%\",\n };\n\n return {\n display: \"flex\",\n flex: 1,\n height: \"100%\",\n position: \"absolute\",\n outline: \"none\",\n overflow: \"hidden\",\n MozUserSelect: \"text\",\n WebkitUserSelect: \"text\",\n msUserSelect: \"text\",\n userSelect: \"text\",\n ...style,\n ...directionSpecificParts,\n } as React.CSSProperties;\n }, [split, style]);\n\n const pane1DivStyle = { ...paneStyle, ...pane1Style };\n const pane2DivStyle = { ...paneStyle, ...pane2Style };\n const resizerStyle = React.useMemo(\n () => props.resizerStyle ?? {},\n [props.resizerStyle]\n );\n const resizerClasses = React.useMemo(\n () => classnames(\"Resizer\", !allowResize && \"disabled\"),\n [allowResize]\n );\n const splitPaneClasses = React.useMemo(\n () => classnames(\"SplitPane\", className, split, !allowResize && \"disabled\"),\n [className, split, allowResize]\n );\n const pane1Classes = React.useMemo(\n () => classnames(\"Pane1\", paneClassName, pane1ClassName),\n [paneClassName, pane1ClassName]\n );\n const pane2Classes = React.useMemo(\n () => classnames(\"Pane2\", paneClassName, pane2ClassName),\n [paneClassName, pane2ClassName]\n );\n\n const initializeDrag = React.useCallback(\n (x: number, y: number) => {\n // istanbul ignore next\n unFocus(splitPane.current?.ownerDocument);\n const newPosition = split === \"vertical\" ? x : y;\n onDragStarted && onDragStarted();\n setActive(true);\n setPosition(newPosition);\n },\n [onDragStarted, split]\n );\n\n const onTouchStart = React.useCallback(\n (event: TouchEvent) => {\n // istanbul ignore else\n if (allowResize) {\n initializeDrag(event.touches[0].clientX, event.touches[0].clientY);\n }\n },\n [allowResize, initializeDrag]\n );\n\n const processMove = React.useCallback(\n (x: number, y: number) => {\n // istanbul ignore next\n unFocus(splitPane.current?.ownerDocument);\n const isPrimaryFirst = primary === \"first\";\n const ref = isPrimaryFirst ? pane1.current : pane2.current;\n const ref2 = isPrimaryFirst ? pane2.current : pane1.current;\n const splitPaneDiv = splitPane.current;\n\n // istanbul ignore else\n if (ref && ref2 && splitPaneDiv) {\n const node = ref;\n const node2 = ref2;\n // istanbul ignore else\n if (node.getBoundingClientRect) {\n const width = node.getBoundingClientRect().width;\n const height = node.getBoundingClientRect().height;\n // istanbul ignore next\n const current = split === \"vertical\" ? x : y;\n // istanbul ignore next\n const oldSize = split === \"vertical\" ? width : height;\n let positionDelta = position - current;\n if (step) {\n // istanbul ignore next\n if (Math.abs(positionDelta) < step) {\n return;\n }\n // Integer division\n positionDelta = ~~(positionDelta / step) * step;\n }\n let sizeDelta = isPrimaryFirst ? positionDelta : -positionDelta;\n\n // istanbul ignore next\n const pane1Order = parseInt(\n node.ownerDocument?.defaultView?.getComputedStyle(node).order ??\n \"0\",\n 10\n );\n // istanbul ignore next\n const pane2Order = parseInt(\n node2.ownerDocument?.defaultView?.getComputedStyle(node2).order ??\n \"0\",\n 10\n );\n // istanbul ignore next\n if (pane1Order > pane2Order) {\n sizeDelta = -sizeDelta;\n }\n\n let newMaxSize = maxSize;\n // istanbul ignore next\n if (\n typeof maxSize === \"number\" &&\n maxSize !== undefined &&\n maxSize <= 0\n ) {\n if (split === \"vertical\") {\n newMaxSize = splitPaneDiv.getBoundingClientRect().width + maxSize;\n } else {\n newMaxSize =\n splitPaneDiv.getBoundingClientRect().height + maxSize;\n }\n }\n\n let newSize = oldSize - sizeDelta;\n const newPosition = position - positionDelta;\n\n // istanbul ignore next\n if (typeof minSize === \"number\" && newSize < minSize) {\n newSize = minSize;\n } else if (\n typeof newMaxSize === \"number\" &&\n newMaxSize !== undefined &&\n newSize > newMaxSize\n ) {\n newSize = newMaxSize;\n } else {\n setPosition(newPosition);\n }\n\n onChange && onChange(newSize);\n setDraggedSize(newSize);\n isPrimaryFirst ? setPane1Size(newSize) : setPane2Size(newSize);\n }\n }\n },\n [maxSize, minSize, onChange, position, primary, split, step]\n );\n\n const onTouchMove = React.useCallback(\n (event: TouchEvent) => {\n // istanbul ignore next\n if (!allowResize || !active) return;\n processMove(event.touches[0].clientX, event.touches[0].clientY);\n },\n [active, allowResize, processMove]\n );\n\n const onMouseMove = React.useCallback(\n (event: MouseEvent) => {\n if (!allowResize || !active) return;\n processMove(event.clientX, event.clientY);\n },\n [active, allowResize, processMove]\n );\n\n const onMouseDown = React.useCallback(\n (event: MouseEvent) => {\n // istanbul ignore else\n if (allowResize) {\n event.preventDefault();\n initializeDrag(event.clientX, event.clientY);\n }\n },\n [allowResize, initializeDrag]\n );\n\n const processResizeFinished = React.useCallback(() => {\n // istanbul ignore else\n if (undefined !== draggedSize && allowResize && active) {\n onDragFinished && onDragFinished(draggedSize);\n }\n setActive(false);\n }, [draggedSize, allowResize, active, onDragFinished]);\n\n const onMouseUp = React.useCallback(\n (event: MouseEvent) => {\n event.preventDefault();\n processResizeFinished();\n },\n [processResizeFinished]\n );\n\n React.useEffect(() => {\n // istanbul ignore next\n const ownerDoc = splitPane.current?.ownerDocument;\n // istanbul ignore next\n if (!ownerDoc) return;\n\n ownerDoc.addEventListener(\"mouseup\", onMouseUp);\n ownerDoc.addEventListener(\"mousemove\", onMouseMove);\n ownerDoc.addEventListener(\"touchmove\", onTouchMove);\n return () => {\n ownerDoc.removeEventListener(\"mouseup\", onMouseUp);\n ownerDoc.removeEventListener(\"mousemove\", onMouseMove);\n ownerDoc.removeEventListener(\"touchmove\", onTouchMove);\n };\n }, [onMouseMove, onMouseUp, onTouchMove]);\n\n return (\n <div className={splitPaneClasses} ref={splitPane} style={splitPaneStyle}>\n <Pane\n className={pane1Classes}\n key=\"pane1\"\n eleRef={pane1}\n size={pane1Size}\n split={split}\n style={pane1DivStyle}\n >\n {notNullChildren[0]}\n </Pane>\n <Resizer\n className={resizerClasses}\n onClick={onResizerClick}\n onDoubleClick={onResizerDoubleClick}\n onMouseDown={onMouseDown}\n onTouchStart={onTouchStart}\n onTouchEnd={processResizeFinished}\n key=\"resizer\"\n split={split}\n style={resizerStyle}\n />\n <Pane\n className={pane2Classes}\n key=\"pane2\"\n eleRef={pane2}\n size={pane2Size}\n split={split}\n style={pane2DivStyle}\n >\n {notNullChildren[1]}\n </Pane>\n </div>\n );\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  /** @packageDocumentation
2
2
  * @module Cursor
3
3
  */
4
- import type { PointProps } from "@itwin/appui-abstract";
4
+ import type { XAndY } from "@itwin/core-geometry";
5
5
  import { RelativePosition, UiEvent } from "@itwin/appui-abstract";
6
6
  /** Enum for Cursor Direction parts
7
7
  * @public
@@ -30,8 +30,8 @@ export declare enum CursorDirection {
30
30
  * @public
31
31
  */
32
32
  export interface CursorUpdatedEventArgs {
33
- oldPt: PointProps;
34
- newPt: PointProps;
33
+ oldPt: XAndY;
34
+ newPt: XAndY;
35
35
  direction: CursorDirection;
36
36
  }
37
37
  /** Cursor Updated Event class.
@@ -47,8 +47,8 @@ export declare class CursorInformation {
47
47
  private static _cursorDirection;
48
48
  private static _cursorDirections;
49
49
  /** The cursor position. */
50
- static get cursorPosition(): PointProps;
51
- static set cursorPosition(pt: PointProps);
50
+ static get cursorPosition(): XAndY;
51
+ static set cursorPosition(pt: XAndY);
52
52
  /** Gets the cursor X position. */
53
53
  static get cursorX(): number;
54
54
  /** Gets the cursor Y position. */
@@ -58,7 +58,7 @@ export declare class CursorInformation {
58
58
  /** Gets the [[CursorUpdatedEvent]]. */
59
59
  static readonly onCursorUpdatedEvent: CursorUpdatedEvent;
60
60
  /** Handles the mouse movement. Sets the cursor position and direction and emits onCursorUpdatedEvent. */
61
- static handleMouseMove(point: PointProps): void;
61
+ static handleMouseMove(point: XAndY): void;
62
62
  private static _determineMostFrequentDirection;
63
63
  private static _mostFrequent;
64
64
  private static _determineCursorDirection;
@@ -1 +1 @@
1
- {"version":3,"file":"CursorInformation.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/cursor/CursorInformation.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAGlE;;GAEG;AACH,oBAAY,oBAAoB;IAC9B,GAAG,OAAS;IACZ,IAAI,MAAS;IACb,KAAK,KAAS;IACd,MAAM,IAAS;CAChB;AAED;;GAEG;AACH,oBAAY,eAAe;IACzB,IAAI,IAAI;IACR,GAAG,OAA2B;IAC9B,IAAI,MAA4B;IAChC,KAAK,KAA6B;IAClC,MAAM,IAA8B;IACpC,OAAO,OAAuD;IAC9D,QAAQ,OAAwD;IAChE,UAAU,MAA0D;IACpE,WAAW,KAA2D;CACvE;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,UAAU,CAAC;IAClB,KAAK,EAAE,UAAU,CAAC;IAClB,SAAS,EAAE,eAAe,CAAC;CAC5B;AAED;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,OAAO,CAAC,sBAAsB,CAAC;CAAG;AAE1E;;GAEG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,MAAM,CAAC,eAAe,CAAsB;IACpD,OAAO,CAAC,MAAM,CAAC,gBAAgB,CACD;IAE9B,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAgC;IAEhE,2BAA2B;IAC3B,WAAkB,cAAc,IAAI,UAAU,CAE7C;IACD,WAAkB,cAAc,CAAC,EAAE,EAAE,UAAU,EAE9C;IAED,kCAAkC;IAClC,WAAkB,OAAO,IAAI,MAAM,CAElC;IACD,kCAAkC;IAClC,WAAkB,OAAO,IAAI,MAAM,CAElC;IAED,kDAAkD;IAClD,WAAkB,eAAe,IAAI,eAAe,CAEnD;IAED,uCAAuC;IACvC,gBAAuB,oBAAoB,qBAA4B;IAEvE,0GAA0G;WAC5F,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IActD,OAAO,CAAC,MAAM,CAAC,+BAA+B;IAW9C,OAAO,CAAC,MAAM,CAAC,aAAa;IAuB5B,OAAO,CAAC,MAAM,CAAC,yBAAyB;IAiBxC,gEAAgE;WAClD,sCAAsC,CAClD,eAAe,EAAE,eAAe,GAC/B,gBAAgB;IAiCnB,8BAA8B;WAChB,qBAAqB,IAAI,IAAI;CAG5C"}
1
+ {"version":3,"file":"CursorInformation.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/cursor/CursorInformation.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAGlE;;GAEG;AACH,oBAAY,oBAAoB;IAC9B,GAAG,OAAS;IACZ,IAAI,MAAS;IACb,KAAK,KAAS;IACd,MAAM,IAAS;CAChB;AAED;;GAEG;AACH,oBAAY,eAAe;IACzB,IAAI,IAAI;IACR,GAAG,OAA2B;IAC9B,IAAI,MAA4B;IAChC,KAAK,KAA6B;IAClC,MAAM,IAA8B;IACpC,OAAO,OAAuD;IAC9D,QAAQ,OAAwD;IAChE,UAAU,MAA0D;IACpE,WAAW,KAA2D;CACvE;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,eAAe,CAAC;CAC5B;AAED;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,OAAO,CAAC,sBAAsB,CAAC;CAAG;AAE1E;;GAEG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,MAAM,CAAC,eAAe,CAAsB;IACpD,OAAO,CAAC,MAAM,CAAC,gBAAgB,CACD;IAE9B,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAgC;IAEhE,2BAA2B;IAC3B,WAAkB,cAAc,IAAI,KAAK,CAExC;IACD,WAAkB,cAAc,CAAC,EAAE,EAAE,KAAK,EAEzC;IAED,kCAAkC;IAClC,WAAkB,OAAO,IAAI,MAAM,CAElC;IACD,kCAAkC;IAClC,WAAkB,OAAO,IAAI,MAAM,CAElC;IAED,kDAAkD;IAClD,WAAkB,eAAe,IAAI,eAAe,CAEnD;IAED,uCAAuC;IACvC,gBAAuB,oBAAoB,qBAA4B;IAEvE,0GAA0G;WAC5F,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAcjD,OAAO,CAAC,MAAM,CAAC,+BAA+B;IAW9C,OAAO,CAAC,MAAM,CAAC,aAAa;IAuB5B,OAAO,CAAC,MAAM,CAAC,yBAAyB;IAiBxC,gEAAgE;WAClD,sCAAsC,CAClD,eAAe,EAAE,eAAe,GAC/B,gBAAgB;IAiCnB,8BAA8B;WAChB,qBAAqB,IAAI,IAAI;CAG5C"}
@@ -1 +1 @@
1
- {"version":3,"file":"CursorInformation.js","sourceRoot":"","sources":["../../../../src/appui-react/cursor/CursorInformation.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAGH,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C;;GAEG;AACH,MAAM,CAAN,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,gEAAY,CAAA;IACZ,iEAAa,CAAA;IACb,kEAAc,CAAA;IACd,mEAAe,CAAA;AACjB,CAAC,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gBAC/C,MAAM;YACR,KAAK,eAAe,CAAC,WAAW;gBAC9B,gBAAgB,GAAG,gBAAgB,CAAC,WAAW,CAAC;gBAChD,MAAM;SACT;QAED,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAED,8BAA8B;IACvB,MAAM,CAAC,qBAAqB;QACjC,IAAI,CAAC,iBAAiB,CAAC,MAAM,GAAG,CAAC,CAAC;IACpC,CAAC;;AAxIc,iCAAe,GAAU,IAAI,KAAK,EAAE,CAAC;AACrC,kCAAgB,GAC7B,eAAe,CAAC,WAAW,CAAC;AAEf,mCAAiB,GAAG,IAAI,KAAK,EAAmB,CAAC;AAwBhE,uCAAuC;AAChB,sCAAoB,GAAG,IAAI,kBAAkB,EAAE,CAAC;SA9B5D,iBAAiB","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 Cursor\n */\n\nimport type { PointProps } from \"@itwin/appui-abstract\";\nimport { RelativePosition, UiEvent } from \"@itwin/appui-abstract\";\nimport { Point } from \"@itwin/core-react\";\n\n/** Enum for Cursor Direction parts\n * @public\n */\nexport enum CursorDirectionParts {\n Top = 0x1000,\n Left = 0x0100,\n Right = 0x0010,\n Bottom = 0x0001,\n}\n\n/** Enum for Cursor Direction\n * @public\n */\nexport enum CursorDirection {\n None = 0,\n Top = CursorDirectionParts.Top,\n Left = CursorDirectionParts.Left,\n Right = CursorDirectionParts.Right,\n Bottom = CursorDirectionParts.Bottom,\n TopLeft = CursorDirectionParts.Top | CursorDirectionParts.Left,\n TopRight = CursorDirectionParts.Top | CursorDirectionParts.Right,\n BottomLeft = CursorDirectionParts.Bottom | CursorDirectionParts.Left,\n BottomRight = CursorDirectionParts.Bottom | CursorDirectionParts.Right,\n}\n\n/** Cursor Updated Event Args interface.\n * @public\n */\nexport interface CursorUpdatedEventArgs {\n oldPt: PointProps;\n newPt: PointProps;\n direction: CursorDirection;\n}\n\n/** Cursor Updated Event class.\n * @public\n */\nexport class CursorUpdatedEvent extends UiEvent<CursorUpdatedEventArgs> {}\n\n/** Cursor Information class\n * @public\n */\nexport class CursorInformation {\n private static _cursorPosition: Point = new Point();\n private static _cursorDirection: CursorDirection =\n CursorDirection.BottomRight;\n\n private static _cursorDirections = new Array<CursorDirection>();\n\n /** The cursor position. */\n public static get cursorPosition(): PointProps {\n return this._cursorPosition;\n }\n public static set cursorPosition(pt: PointProps) {\n this._cursorPosition = Point.create(pt);\n }\n\n /** Gets the cursor X position. */\n public static get cursorX(): number {\n return this._cursorPosition.x;\n }\n /** Gets the cursor Y position. */\n public static get cursorY(): number {\n return this._cursorPosition.y;\n }\n\n /** Gets the general cursor movement direction. */\n public static get cursorDirection(): CursorDirection {\n return this._cursorDirection;\n }\n\n /** Gets the [[CursorUpdatedEvent]]. */\n public static readonly onCursorUpdatedEvent = new CursorUpdatedEvent();\n\n /** Handles the mouse movement. Sets the cursor position and direction and emits onCursorUpdatedEvent. */\n public static handleMouseMove(point: PointProps): void {\n const oldPt = CursorInformation.cursorPosition;\n const direction = this._determineMostFrequentDirection(\n this._cursorDirections,\n this._cursorPosition,\n Point.create(point)\n );\n\n this.cursorPosition = point;\n this._cursorDirection = direction;\n\n this.onCursorUpdatedEvent.emit({ oldPt, newPt: point, direction });\n }\n\n private static _determineMostFrequentDirection(\n cursorDirections: CursorDirection[],\n oldPt: Point,\n newPt: Point\n ): CursorDirection {\n const cursorDirection = this._determineCursorDirection(oldPt, newPt);\n cursorDirections.push(cursorDirection);\n if (cursorDirections.length > 10) cursorDirections.shift();\n return this._mostFrequent(cursorDirections);\n }\n\n private static _mostFrequent(array: CursorDirection[]): CursorDirection {\n const hashMap = new Map<CursorDirection, number>();\n let maxCount = 0,\n mostFrequent = CursorDirection.None;\n\n array.forEach((value: CursorDirection) => {\n const key = value;\n let frequency = hashMap.get(key);\n\n if (frequency !== undefined) frequency++;\n else frequency = 1;\n\n hashMap.set(key, frequency);\n\n if (frequency > maxCount) {\n mostFrequent = key;\n maxCount = frequency;\n }\n });\n\n return mostFrequent;\n }\n\n private static _determineCursorDirection(\n oldPt: Point,\n newPt: Point\n ): CursorDirection {\n let directionParts: number = 0;\n\n if (newPt.x < oldPt.x) directionParts |= CursorDirectionParts.Left;\n else if (newPt.x > oldPt.x) directionParts |= CursorDirectionParts.Right;\n\n if (newPt.y < oldPt.y) directionParts |= CursorDirectionParts.Top;\n else if (newPt.y > oldPt.y) directionParts |= CursorDirectionParts.Bottom;\n\n const direction = directionParts as CursorDirection;\n\n return direction;\n }\n\n /** Gets the relative position based on the cursor direction. */\n public static getRelativePositionFromCursorDirection(\n cursorDirection: CursorDirection\n ): RelativePosition {\n let relativePosition: RelativePosition = RelativePosition.BottomRight;\n\n switch (cursorDirection) {\n case CursorDirection.Top:\n relativePosition = RelativePosition.Top;\n break;\n case CursorDirection.Left:\n relativePosition = RelativePosition.Left;\n break;\n case CursorDirection.Right:\n relativePosition = RelativePosition.Right;\n break;\n case CursorDirection.Bottom:\n relativePosition = RelativePosition.Bottom;\n break;\n case CursorDirection.TopLeft:\n relativePosition = RelativePosition.TopLeft;\n break;\n case CursorDirection.TopRight:\n relativePosition = RelativePosition.TopRight;\n break;\n case CursorDirection.BottomLeft:\n relativePosition = RelativePosition.BottomLeft;\n break;\n case CursorDirection.BottomRight:\n relativePosition = RelativePosition.BottomRight;\n break;\n }\n\n return relativePosition;\n }\n\n /** @internal - for testing */\n public static clearCursorDirections(): void {\n this._cursorDirections.length = 0;\n }\n}\n"]}
1
+ {"version":3,"file":"CursorInformation.js","sourceRoot":"","sources":["../../../../src/appui-react/cursor/CursorInformation.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAGH,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C;;GAEG;A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AAgB,GAAG,gBAAgB,CAAC,QAAQ,CAAC;gBAC7C,MAAM;YACR,KAAK,eAAe,CAAC,UAAU;gBAC7B,gBAAgB,GAAG,gBAAgB,CAAC,UAAU,CAAC;gBAC/C,MAAM;YACR,KAAK,eAAe,CAAC,WAAW;gBAC9B,gBAAgB,GAAG,gBAAgB,CAAC,WAAW,CAAC;gBAChD,MAAM;SACT;QAED,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAED,8BAA8B;IACvB,MAAM,CAAC,qBAAqB;QACjC,IAAI,CAAC,iBAAiB,CAAC,MAAM,GAAG,CAAC,CAAC;IACpC,CAAC;;AAxIc,iCAAe,GAAU,IAAI,KAAK,EAAE,CAAC;AACrC,kCAAgB,GAC7B,eAAe,CAAC,WAAW,CAAC;AAEf,mCAAiB,GAAG,IAAI,KAAK,EAAmB,CAAC;AAwBhE,uCAAuC;AAChB,sCAAoB,GAAG,IAAI,kBAAkB,EAAE,CAAC;SA9B5D,iBAAiB","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 Cursor\n */\n\nimport type { XAndY } from \"@itwin/core-geometry\";\nimport { RelativePosition, UiEvent } from \"@itwin/appui-abstract\";\nimport { Point } from \"@itwin/core-react\";\n\n/** Enum for Cursor Direction parts\n * @public\n */\nexport enum CursorDirectionParts {\n Top = 0x1000,\n Left = 0x0100,\n Right = 0x0010,\n Bottom = 0x0001,\n}\n\n/** Enum for Cursor Direction\n * @public\n */\nexport enum CursorDirection {\n None = 0,\n Top = CursorDirectionParts.Top,\n Left = CursorDirectionParts.Left,\n Right = CursorDirectionParts.Right,\n Bottom = CursorDirectionParts.Bottom,\n TopLeft = CursorDirectionParts.Top | CursorDirectionParts.Left,\n TopRight = CursorDirectionParts.Top | CursorDirectionParts.Right,\n BottomLeft = CursorDirectionParts.Bottom | CursorDirectionParts.Left,\n BottomRight = CursorDirectionParts.Bottom | CursorDirectionParts.Right,\n}\n\n/** Cursor Updated Event Args interface.\n * @public\n */\nexport interface CursorUpdatedEventArgs {\n oldPt: XAndY;\n newPt: XAndY;\n direction: CursorDirection;\n}\n\n/** Cursor Updated Event class.\n * @public\n */\nexport class CursorUpdatedEvent extends UiEvent<CursorUpdatedEventArgs> {}\n\n/** Cursor Information class\n * @public\n */\nexport class CursorInformation {\n private static _cursorPosition: Point = new Point();\n private static _cursorDirection: CursorDirection =\n CursorDirection.BottomRight;\n\n private static _cursorDirections = new Array<CursorDirection>();\n\n /** The cursor position. */\n public static get cursorPosition(): XAndY {\n return this._cursorPosition;\n }\n public static set cursorPosition(pt: XAndY) {\n this._cursorPosition = Point.create(pt);\n }\n\n /** Gets the cursor X position. */\n public static get cursorX(): number {\n return this._cursorPosition.x;\n }\n /** Gets the cursor Y position. */\n public static get cursorY(): number {\n return this._cursorPosition.y;\n }\n\n /** Gets the general cursor movement direction. */\n public static get cursorDirection(): CursorDirection {\n return this._cursorDirection;\n }\n\n /** Gets the [[CursorUpdatedEvent]]. */\n public static readonly onCursorUpdatedEvent = new CursorUpdatedEvent();\n\n /** Handles the mouse movement. Sets the cursor position and direction and emits onCursorUpdatedEvent. */\n public static handleMouseMove(point: XAndY): void {\n const oldPt = CursorInformation.cursorPosition;\n const direction = this._determineMostFrequentDirection(\n this._cursorDirections,\n this._cursorPosition,\n Point.create(point)\n );\n\n this.cursorPosition = point;\n this._cursorDirection = direction;\n\n this.onCursorUpdatedEvent.emit({ oldPt, newPt: point, direction });\n }\n\n private static _determineMostFrequentDirection(\n cursorDirections: CursorDirection[],\n oldPt: Point,\n newPt: Point\n ): CursorDirection {\n const cursorDirection = this._determineCursorDirection(oldPt, newPt);\n cursorDirections.push(cursorDirection);\n if (cursorDirections.length > 10) cursorDirections.shift();\n return this._mostFrequent(cursorDirections);\n }\n\n private static _mostFrequent(array: CursorDirection[]): CursorDirection {\n const hashMap = new Map<CursorDirection, number>();\n let maxCount = 0,\n mostFrequent = CursorDirection.None;\n\n array.forEach((value: CursorDirection) => {\n const key = value;\n let frequency = hashMap.get(key);\n\n if (frequency !== undefined) frequency++;\n else frequency = 1;\n\n hashMap.set(key, frequency);\n\n if (frequency > maxCount) {\n mostFrequent = key;\n maxCount = frequency;\n }\n });\n\n return mostFrequent;\n }\n\n private static _determineCursorDirection(\n oldPt: Point,\n newPt: Point\n ): CursorDirection {\n let directionParts: number = 0;\n\n if (newPt.x < oldPt.x) directionParts |= CursorDirectionParts.Left;\n else if (newPt.x > oldPt.x) directionParts |= CursorDirectionParts.Right;\n\n if (newPt.y < oldPt.y) directionParts |= CursorDirectionParts.Top;\n else if (newPt.y > oldPt.y) directionParts |= CursorDirectionParts.Bottom;\n\n const direction = directionParts as CursorDirection;\n\n return direction;\n }\n\n /** Gets the relative position based on the cursor direction. */\n public static getRelativePositionFromCursorDirection(\n cursorDirection: CursorDirection\n ): RelativePosition {\n let relativePosition: RelativePosition = RelativePosition.BottomRight;\n\n switch (cursorDirection) {\n case CursorDirection.Top:\n relativePosition = RelativePosition.Top;\n break;\n case CursorDirection.Left:\n relativePosition = RelativePosition.Left;\n break;\n case CursorDirection.Right:\n relativePosition = RelativePosition.Right;\n break;\n case CursorDirection.Bottom:\n relativePosition = RelativePosition.Bottom;\n break;\n case CursorDirection.TopLeft:\n relativePosition = RelativePosition.TopLeft;\n break;\n case CursorDirection.TopRight:\n relativePosition = RelativePosition.TopRight;\n break;\n case CursorDirection.BottomLeft:\n relativePosition = RelativePosition.BottomLeft;\n break;\n case CursorDirection.BottomRight:\n relativePosition = RelativePosition.BottomRight;\n break;\n }\n\n return relativePosition;\n }\n\n /** @internal - for testing */\n public static clearCursorDirections(): void {\n this._cursorDirections.length = 0;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CursorMenu.d.ts","sourceRoot":"","sources":["../../../../../src/appui-react/cursor/cursormenu/CursorMenu.tsx"],"names":[],"mappings":"AAI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gB,SAAQ,KAAK,CAAC,aAAa,CACtD,WAAW,EACX,oBAAoB,CACrB;IACC,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,kBAAkB,CAAC,CAAS;IAEpC,gBAAgB;IAChB,SAAyB,KAAK,EAAE,oBAAoB,CAKlD;IAEF,OAAO,CAAC,kBAAkB,CAsBxB;IAEc,iBAAiB;IAKjB,oBAAoB;IAKpC,OAAO,CAAC,aAAa,CAQnB;IAEc,MAAM,IAAI,KAAK,CAAC,SAAS;IA4BzC,OAAO,CAAC,gBAAgB,CAEtB;IAEF,OAAO,CAAC,WAAW,CAEjB;CACH"}
@@ -50,10 +50,11 @@ export class CursorPopupMenu extends React.PureComponent {
50
50
  }
51
51
  };
52
52
  this._handleRefSet = (popupDiv) => {
53
- const parentWindow = popupDiv?.ownerDocument.defaultView ?? undefined;
53
+ var _a, _b;
54
+ const parentWindow = (_a = popupDiv === null || popupDiv === void 0 ? void 0 : popupDiv.ownerDocument.defaultView) !== null && _a !== void 0 ? _a : undefined;
54
55
  // if the window is not a pop out set to undefined
55
56
  this._hostChildWindowId = UiFramework.childWindows.findId(parentWindow);
56
- Logger.logInfo(UiFramework.loggerCategory(UiFramework), `Cursor Menu for ${this._hostChildWindowId ?? "main"} window`);
57
+ Logger.logInfo(UiFramework.loggerCategory(UiFramework), `Cursor Menu for ${(_b = this._hostChildWindowId) !== null && _b !== void 0 ? _b : "main"} window`);
57
58
  };
58
59
  this._hideContextMenu = () => {
59
60
  this.setState({ menuVisible: false });
@@ -1 +1 @@
1
- {"version":3,"file":"CursorMenu.js","sourceRoot":"","sources":["../../../../../src/appui-react/cursor/cursormenu/CursorMenu.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC,CAAC,kBAAkB;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0B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GAAG,CAAC,IAAI,WAAW,IAAI,CAC3C,oBAAC,iBAAiB,IAChB,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAC/B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,UAAU,EAAC,mBAAmB,EAC9B,CAAC,EAAE,KAAK,EACR,CAAC,EAAE,KAAK,EACR,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,OAAO,EACd,cAAc,EAAE,OAAO,EACvB,SAAS,EAAE,KAAK,EAChB,QAAQ,EAAE,IAAI,IAEb,eAAe,CAAC,mBAAmB,CAClC,eAAe,CAAC,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,CACzD,CACiB,CACrB,CACG,CACP,CAAC;IACJ,CAAC;CASF","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 Cursor\n */\n\nimport * as React from \"react\";\nimport type { UiSyncEventArgs } from \"@itwin/appui-abstract\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { GlobalContextMenu } from \"@itwin/core-react\"; // ContextSubMenu,\nimport { SessionStateActionId } from \"../../redux/SessionState\";\nimport type { MenuItemProps } from \"../../shared/MenuItem\";\nimport { MenuItemHelpers } from \"../../shared/MenuItem\";\nimport { SyncUiEventDispatcher } from \"../../syncui/SyncUiEventDispatcher\";\nimport { UiFramework } from \"../../UiFramework\";\nimport { Logger } from \"@itwin/core-bentley\";\n\n/** State for [[CursorPopupMenu]] component\n * @alpha\n */\ninterface CursorPopupMenuState {\n menuX: number;\n menuY: number;\n menuVisible: boolean;\n items?: MenuItemProps[];\n}\n\n/** Popup Menu to show at cursor typically used by tools to provide a right-click context menu.\n * @alpha\n */\n// istanbul ignore next\nexport class CursorPopupMenu extends React.PureComponent<\n CommonProps,\n CursorPopupMenuState\n> {\n private _isMounted = false; // used to ensure _handleSyncUiEvent callback is not processed after componentWillUnmount is called\n private _hostChildWindowId?: string;\n\n /** @internal */\n public override readonly state: CursorPopupMenuState = {\n menuX: 0,\n menuY: 0,\n menuVisible: false,\n items: undefined,\n };\n\n private _handleSyncUiEvent = (args: UiSyncEventArgs): void => {\n /* istanbul ignore next */\n if (!this._isMounted) return;\n\n /* istanbul ignore else */\n if (\n SyncUiEventDispatcher.hasEventOfInterest(args.eventIds, [\n SessionStateActionId.UpdateCursorMenu,\n ])\n ) {\n const menuData = UiFramework.getCursorMenuData();\n if (menuData && this._hostChildWindowId === menuData.childWindowId) {\n this.setState({\n menuVisible: menuData.items && menuData.items.length > 0,\n items: menuData.items,\n menuX: menuData.position.x,\n menuY: menuData.position.y,\n });\n } else {\n this.setState({ menuVisible: false, items: undefined });\n }\n }\n };\n\n public override componentDidMount() {\n this._isMounted = true;\n SyncUiEventDispatcher.onSyncUiEvent.addListener(this._handleSyncUiEvent);\n }\n\n public override componentWillUnmount() {\n this._isMounted = false;\n SyncUiEventDispatcher.onSyncUiEvent.removeListener(this._handleSyncUiEvent);\n }\n\n private _handleRefSet = (popupDiv: HTMLElement | null) => {\n const parentWindow = popupDiv?.ownerDocument.defaultView ?? undefined;\n // if the window is not a pop out set to undefined\n this._hostChildWindowId = UiFramework.childWindows.findId(parentWindow);\n Logger.logInfo(\n UiFramework.loggerCategory(UiFramework),\n `Cursor Menu for ${this._hostChildWindowId ?? \"main\"} window`\n );\n };\n\n public override render(): React.ReactNode {\n const { menuX, menuY, items, menuVisible } = this.state;\n const onClose = this._hideContextMenu;\n\n return (\n <div className=\"uifw-cursor-menu-container-div\" ref={this._handleRefSet}>\n {items && items.length > 0 && menuVisible && (\n <GlobalContextMenu\n className={this.props.className}\n style={this.props.style}\n identifier=\"cursor-popup-menu\"\n x={menuX}\n y={menuY}\n opened={menuVisible}\n onEsc={onClose}\n onOutsideClick={onClose}\n edgeLimit={false}\n autoflip={true}\n >\n {MenuItemHelpers.createMenuItemNodes(\n MenuItemHelpers.createMenuItems(items, this._itemPicked)\n )}\n </GlobalContextMenu>\n )}\n </div>\n );\n }\n\n private _hideContextMenu = () => {\n this.setState({ menuVisible: false });\n };\n\n private _itemPicked = (): void => {\n this._hideContextMenu();\n };\n}\n"]}
1
+ {"version":3,"file":"CursorMenu.js","sourceRoot":"","sources":["../../../../../src/appui-react/cursor/cursormenu/CursorMenu.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC,CAAC,kBAAkB;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAa7C;;GAEG;AACH,uBAAuB;AACvB,MAAM,OAAO,eAAgB,SAAQ,KAAK,CAAC,aAG1C;IAHD;;QAIU,eAAU,GAAG,KAAK,CAAC,CAAC,mGAAmG;QAG/H,gBAAgB;QACS,UAAK,GAAyB;YACrD,KAAK,EAAE,CAAC;YACR,KAAK,EAAE,CAAC;YACR,WAAW,EAAE,KAAK;YAClB,KAAK,EAAE,SAAS;SACjB,CAAC;QAEM,uBAAkB,GAAG,CAAC,IAAqB,EAAQ,EAAE;YAC3D,0BAA0B;YAC1B,IAAI,CAAC,IAAI,CAAC,UAAU;gBAAE,OAAO;YAE7B,0BAA0B;YAC1B,IACE,qBAAqB,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,EAAE;gBACtD,oBAAoB,CAAC,gBAAgB;aACtC,CAAC,EACF;gBACA,MAAM,QAAQ,GAAG,WAAW,CAAC,iBAAiB,E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AC,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IAC3E,CAAC;IAEe,oBAAoB;QAClC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QACxB,qBAAqB,CAAC,aAAa,CAAC,cAAc,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IAC9E,CAAC;IAYe,MAAM;QACpB,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QACxD,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC;QAEtC,OAAO,CACL,6BAAK,SAAS,EAAC,gCAAgC,EAAC,GAAG,EAAE,IAAI,CAAC,aAAa,IACpE,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,WAAW,IAAI,CAC3C,oBAAC,iBAAiB,IAChB,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAC/B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,UAAU,EAAC,mBAAmB,EAC9B,CAAC,EAAE,KAAK,EACR,CAAC,EAAE,KAAK,EACR,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,OAAO,EACd,cAAc,EAAE,OAAO,EACvB,SAAS,EAAE,KAAK,EAChB,QAAQ,EAAE,IAAI,IAEb,eAAe,CAAC,mBAAmB,CAClC,eAAe,CAAC,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,CACzD,CACiB,CACrB,CACG,CACP,CAAC;IACJ,CAAC;CASF","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 Cursor\n */\n\nimport * as React from \"react\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { GlobalContextMenu } from \"@itwin/core-react\"; // ContextSubMenu,\nimport { SessionStateActionId } from \"../../redux/SessionState\";\nimport type { MenuItemProps } from \"../../shared/MenuItem\";\nimport { MenuItemHelpers } from \"../../shared/MenuItem\";\nimport { SyncUiEventDispatcher } from \"../../syncui/SyncUiEventDispatcher\";\nimport { UiFramework } from \"../../UiFramework\";\nimport { Logger } from \"@itwin/core-bentley\";\nimport type { UiSyncEventArgs } from \"../../syncui/UiSyncEvent\";\n\n/** State for [[CursorPopupMenu]] component\n * @alpha\n */\ninterface CursorPopupMenuState {\n menuX: number;\n menuY: number;\n menuVisible: boolean;\n items?: MenuItemProps[];\n}\n\n/** Popup Menu to show at cursor typically used by tools to provide a right-click context menu.\n * @alpha\n */\n// istanbul ignore next\nexport class CursorPopupMenu extends React.PureComponent<\n CommonProps,\n CursorPopupMenuState\n> {\n private _isMounted = false; // used to ensure _handleSyncUiEvent callback is not processed after componentWillUnmount is called\n private _hostChildWindowId?: string;\n\n /** @internal */\n public override readonly state: CursorPopupMenuState = {\n menuX: 0,\n menuY: 0,\n menuVisible: false,\n items: undefined,\n };\n\n private _handleSyncUiEvent = (args: UiSyncEventArgs): void => {\n /* istanbul ignore next */\n if (!this._isMounted) return;\n\n /* istanbul ignore else */\n if (\n SyncUiEventDispatcher.hasEventOfInterest(args.eventIds, [\n SessionStateActionId.UpdateCursorMenu,\n ])\n ) {\n const menuData = UiFramework.getCursorMenuData();\n if (menuData && this._hostChildWindowId === menuData.childWindowId) {\n this.setState({\n menuVisible: menuData.items && menuData.items.length > 0,\n items: menuData.items,\n menuX: menuData.position.x,\n menuY: menuData.position.y,\n });\n } else {\n this.setState({ menuVisible: false, items: undefined });\n }\n }\n };\n\n public override componentDidMount() {\n this._isMounted = true;\n SyncUiEventDispatcher.onSyncUiEvent.addListener(this._handleSyncUiEvent);\n }\n\n public override componentWillUnmount() {\n this._isMounted = false;\n SyncUiEventDispatcher.onSyncUiEvent.removeListener(this._handleSyncUiEvent);\n }\n\n private _handleRefSet = (popupDiv: HTMLElement | null) => {\n const parentWindow = popupDiv?.ownerDocument.defaultView ?? undefined;\n // if the window is not a pop out set to undefined\n this._hostChildWindowId = UiFramework.childWindows.findId(parentWindow);\n Logger.logInfo(\n UiFramework.loggerCategory(UiFramework),\n `Cursor Menu for ${this._hostChildWindowId ?? \"main\"} window`\n );\n };\n\n public override render(): React.ReactNode {\n const { menuX, menuY, items, menuVisible } = this.state;\n const onClose = this._hideContextMenu;\n\n return (\n <div className=\"uifw-cursor-menu-container-div\" ref={this._handleRefSet}>\n {items && items.length > 0 && menuVisible && (\n <GlobalContextMenu\n className={this.props.className}\n style={this.props.style}\n identifier=\"cursor-popup-menu\"\n x={menuX}\n y={menuY}\n opened={menuVisible}\n onEsc={onClose}\n onOutsideClick={onClose}\n edgeLimit={false}\n autoflip={true}\n >\n {MenuItemHelpers.createMenuItemNodes(\n MenuItemHelpers.createMenuItems(items, this._itemPicked)\n )}\n </GlobalContextMenu>\n )}\n </div>\n );\n }\n\n private _hideContextMenu = () => {\n this.setState({ menuVisible: false });\n };\n\n private _itemPicked = (): void => {\n this._hideContextMenu();\n };\n}\n"]}
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import "./CursorPopup.scss";
5
5
  import * as React from "react";
6
- import type { PointProps } from "@itwin/appui-abstract";
6
+ import type { XAndY } from "@itwin/core-geometry";
7
7
  import { RelativePosition } from "@itwin/appui-abstract";
8
8
  import type { CommonDivProps, CommonProps, RectangleProps, SizeProps } from "@itwin/core-react";
9
9
  import { Size } from "@itwin/core-react";
@@ -13,8 +13,8 @@ import { Size } from "@itwin/core-react";
13
13
  export interface CursorPopupProps extends CommonProps {
14
14
  id: string;
15
15
  content: React.ReactNode;
16
- pt: PointProps;
17
- offset: PointProps;
16
+ pt: XAndY;
17
+ offset: XAndY;
18
18
  relativePosition: RelativePosition;
19
19
  title?: string;
20
20
  shadow?: boolean;
@@ -48,7 +48,7 @@ export declare class CursorPopup extends React.Component<CursorPopupProps, Curso
48
48
  componentWillUnmount(): void;
49
49
  private _handleCursorPopupFadeOutEvent;
50
50
  /** @internal */
51
- static getPopupRect(pt: PointProps, offset: PointProps, popupSize: SizeProps | undefined, relativePosition: RelativePosition): RectangleProps;
51
+ static getPopupRect(pt: XAndY, offset: XAndY, popupSize: SizeProps | undefined, relativePosition: RelativePosition): RectangleProps;
52
52
  private setDivRef;
53
53
  /** @internal */
54
54
  render(): JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"CursorPopup.d.ts","sourceRoot":"","sources":["../../../../../src/appui-react/cursor/cursorpopup/CursorPopup.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,oBAAoB,CAAC;AAC5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EACV,cAAc,EACd,WAAW,EACX,cAAc,EACd,SAAS,EACV,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAO,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAK9C;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,EAAE,EAAE,UAAU,CAAC;IACf,MAAM,EAAE,UAAU,CAAC;IACnB,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,0CAA0C;IAC1C,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;CACzC;AAED;;GAEG;AACH,oBAAY,eAAe;IACzB,IAAI,IAAA;IACJ,OAAO,IAAA;CACR;AAED;;GAEG;AACH,UAAU,gBAAgB;IACxB,SAAS,EAAE,eAAe,CAAC;IAC3B,IAAI,EAAE,IAAI,CAAC;CACZ;AAED;;GAEG;AACH,qBAAa,WAAY,SAAQ,KAAK,CAAC,SAAS,CAC9C,gBAAgB,EAChB,gBAAgB,CACjB;IACC,OAAO,CAAC,UAAU,CAAkB;IAEpC,gBAAgB;IAChB,OAAc,WAAW,SAAO;IAEhC,gBAAgB;gBACJ,KAAK,EAAE,gBAAgB;IASnB,iBAAiB;IAOjB,oBAAoB;IAOpC,OAAO,CAAC,8BAA8B,CAQpC;IAEF,gBAAgB;WACF,YAAY,CACxB,EAAE,EAAE,UAAU,EACd,MAAM,EAAE,UAAU,EAClB,SAAS,EAAE,SAAS,GAAG,SAAS,EAChC,gBAAgB,EAAE,gBAAgB,GACjC,cAAc;IA2DjB,OAAO,CAAC,SAAS;IAiBjB,gBAAgB;IACA,MAAM;CAoCvB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,cAAc,eAEvD"}
1
+ {"version":3,"file":"CursorPopup.d.ts","sourceRoot":"","sources":["../../../../../src/appui-react/cursor/cursorpopup/CursorPopup.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,oBAAoB,CAAC;AAC5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EACV,cAAc,EACd,WAAW,EACX,cAAc,EACd,SAAS,EACV,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAO,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAK9C;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,EAAE,EAAE,KAAK,CAAC;IACV,MAAM,EAAE,KAAK,CAAC;IACd,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,0CAA0C;IAC1C,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;CACzC;AAED;;GAEG;AACH,oBAAY,eAAe;IACzB,IAAI,IAAA;IACJ,OAAO,IAAA;CACR;AAED;;GAEG;AACH,UAAU,gBAAgB;IACxB,SAAS,EAAE,eAAe,CAAC;IAC3B,IAAI,EAAE,IAAI,CAAC;CACZ;AAED;;GAEG;AACH,qBAAa,WAAY,SAAQ,KAAK,CAAC,SAAS,CAC9C,gBAAgB,EAChB,gBAAgB,CACjB;IACC,OAAO,CAAC,UAAU,CAAkB;IAEpC,gBAAgB;IAChB,OAAc,WAAW,SAAO;IAEhC,gBAAgB;gBACJ,KAAK,EAAE,gBAAgB;IASnB,iBAAiB;IAOjB,oBAAoB;IAOpC,OAAO,CAAC,8BAA8B,CAQpC;IAEF,gBAAgB;WACF,YAAY,CACxB,EAAE,EAAE,KAAK,EACT,MAAM,EAAE,KAAK,EACb,SAAS,EAAE,SAAS,GAAG,SAAS,EAChC,gBAAgB,EAAE,gBAAgB,GACjC,cAAc;IA2DjB,OAAO,CAAC,SAAS;IAiBjB,gBAAgB;IACA,MAAM;CAoCvB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,cAAc,eAEvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"CursorPopup.js","sourceRoot":"","sources":["../../../../../src/appui-react/cursor/cursorpopup/CursorPopup.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,oBAAoB,CAAC;AAC5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAOzD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAA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AAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;aACvD;SACF;IACH,CAAC;IAED,gBAAgB;IACA,MAAM;QACpB,MAAM,SAAS,GAAG,WAAW,CAAC,YAAY,CACxC,IAAI,CAAC,KAAK,CAAC,EAAE,EACb,IAAI,CAAC,KAAK,CAAC,MAAM,EACjB,IAAI,CAAC,KAAK,CAAC,IAAI,EACf,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAC5B,CAAC;QAEF,MAAM,gBAAgB,GAAwB;YAC5C,IAAI,EAAE,SAAS,CAAC,IAAI;YACpB,GAAG,EAAE,SAAS,CAAC,GAAG;SACnB,CAAC;QAEF,MAAM,UAAU,GAAG,UAAU,CAC3B,kBAAkB,EAClB,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,mBAAmB,EACxC,IAAI,CAAC,KAAK,CAAC,SAAS,KAAK,eAAe,CAAC,OAAO;YAC9C,0BAA0B,CAC7B,CAAC;QAEF,OAAO,CACL,6BACE,SAAS,EAAE,UAAU,EACrB,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAC7B,KAAK,EAAE,gBAAgB;YAEtB,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,CACnB,oBAAC,QAAQ,IACP,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,SAAS,EAAC,wBAAwB,GAClC,CACH;YACA,IAAI,CAAC,KAAK,CAAC,OAAO,CACf,CACP,CAAC;IACJ,CAAC;;AA3JD,gBAAgB;AACF,uBAAW,GAAG,GAAG,AAAN,CAAO;SAPrB,WAAW;AAoKxB;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAqB;IACtD,OAAO,oBAAC,GAAG,OAAK,KAAK,EAAE,aAAa,EAAC,0BAA0B,GAAG,CAAC;AACrE,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 Cursor\n */\n\nimport \"./CursorPopup.scss\";\nimport * as React from \"react\";\nimport classnames from \"classnames\";\nimport type { PointProps } from \"@itwin/appui-abstract\";\nimport { RelativePosition } from \"@itwin/appui-abstract\";\nimport type {\n CommonDivProps,\n CommonProps,\n RectangleProps,\n SizeProps,\n} from \"@itwin/core-react\";\nimport { Div, Size } from \"@itwin/core-react\";\nimport { TitleBar } from \"@itwin/appui-layout-react\";\nimport type { CursorPopupFadeOutEventArgs } from \"./CursorPopupManager\";\nimport { CursorPopupManager } from \"./CursorPopupManager\";\n\n/** Properties for the [[CursorPopup]] React component\n * @public\n */\nexport interface CursorPopupProps extends CommonProps {\n id: string;\n content: React.ReactNode;\n pt: PointProps;\n offset: PointProps;\n relativePosition: RelativePosition;\n title?: string;\n shadow?: boolean;\n /** Function called when size is known. */\n onSizeKnown?: (size: SizeProps) => void;\n}\n\n/** Enum for showing CursorPopup\n * @internal - unit testing\n */\nexport enum CursorPopupShow {\n Open,\n FadeOut,\n}\n\n/** State for the [[CursorPopup]] React component\n * @internal\n */\ninterface CursorPopupState {\n showPopup: CursorPopupShow;\n size: Size;\n}\n\n/** CursorPopup React component\n * @public\n */\nexport class CursorPopup extends React.Component<\n CursorPopupProps,\n CursorPopupState\n> {\n private _isMounted: boolean = false;\n\n /** @internal */\n public static fadeOutTime = 500;\n\n /** @internal */\n constructor(props: CursorPopupProps) {\n super(props);\n\n this.state = {\n showPopup: CursorPopupShow.Open,\n size: new Size(-1, -1),\n };\n }\n\n public override componentDidMount() {\n this._isMounted = true;\n CursorPopupManager.onCursorPopupFadeOutEvent.addListener(\n this._handleCursorPopupFadeOutEvent\n );\n }\n\n public override componentWillUnmount() {\n this._isMounted = false;\n CursorPopupManager.onCursorPopupFadeOutEvent.removeListener(\n this._handleCursorPopupFadeOutEvent\n );\n }\n\n private _handleCursorPopupFadeOutEvent = (\n args: CursorPopupFadeOutEventArgs\n ) => {\n if (this.props.id === args.id) {\n // istanbul ignore else\n if (this._isMounted)\n this.setState({ showPopup: CursorPopupShow.FadeOut });\n }\n };\n\n /** @internal */\n public static getPopupRect(\n pt: PointProps,\n offset: PointProps,\n popupSize: SizeProps | undefined,\n relativePosition: RelativePosition\n ): RectangleProps {\n const popupRect = { top: 0, left: 0, right: 0, bottom: 0 };\n\n if (popupSize === undefined) return popupRect;\n\n switch (relativePosition) {\n case RelativePosition.Top:\n popupRect.bottom = pt.y - offset.y;\n popupRect.left = pt.x - popupSize.width / 2;\n popupRect.top = popupRect.bottom - popupSize.height;\n popupRect.right = popupRect.left + popupSize.width;\n break;\n case RelativePosition.Left:\n popupRect.right = pt.x - offset.x;\n popupRect.top = pt.y - popupSize.height / 2;\n popupRect.left = popupRect.right - popupSize.width;\n popupRect.bottom = popupRect.top + popupSize.height;\n break;\n case RelativePosition.Right:\n popupRect.left = pt.x + offset.x;\n popupRect.top = pt.y - popupSize.height / 2;\n popupRect.right = popupRect.left + popupSize.width;\n popupRect.bottom = popupRect.top + popupSize.height;\n break;\n case RelativePosition.Bottom:\n popupRect.top = pt.y + offset.y;\n popupRect.left = pt.x - popupSize.width / 2;\n popupRect.bottom = popupRect.top + popupSize.height;\n popupRect.right = popupRect.left + popupSize.width;\n break;\n case RelativePosition.TopLeft:\n popupRect.bottom = pt.y - offset.y;\n popupRect.right = pt.x - offset.x;\n popupRect.top = popupRect.bottom - popupSize.height;\n popupRect.left = popupRect.right - popupSize.width;\n break;\n case RelativePosition.TopRight:\n popupRect.bottom = pt.y - offset.y;\n popupRect.left = pt.x + offset.x;\n popupRect.top = popupRect.bottom - popupSize.height;\n popupRect.right = popupRect.left + popupSize.width;\n break;\n case RelativePosition.BottomLeft:\n popupRect.top = pt.y + offset.y;\n popupRect.right = pt.x - offset.x;\n popupRect.bottom = popupRect.top + popupSize.height;\n popupRect.left = popupRect.right - popupSize.width;\n break;\n case RelativePosition.BottomRight:\n popupRect.top = pt.y + offset.y;\n popupRect.left = pt.x + offset.x;\n popupRect.bottom = popupRect.top + popupSize.height;\n popupRect.right = popupRect.left + popupSize.width;\n break;\n }\n\n return popupRect;\n }\n\n private setDivRef(div: HTMLDivElement | null) {\n // istanbul ignore else\n if (div) {\n const rect = div.getBoundingClientRect();\n const newSize = new Size(rect.width, rect.height);\n\n // istanbul ignore else\n if (!this.state.size.equals(newSize)) {\n // istanbul ignore else\n if (this.props.onSizeKnown) this.props.onSizeKnown(newSize);\n\n // istanbul ignore else\n if (this._isMounted) this.setState({ size: newSize });\n }\n }\n }\n\n /** @internal */\n public override render() {\n const popupRect = CursorPopup.getPopupRect(\n this.props.pt,\n this.props.offset,\n this.state.size,\n this.props.relativePosition\n );\n\n const positioningStyle: React.CSSProperties = {\n left: popupRect.left,\n top: popupRect.top,\n };\n\n const classNames = classnames(\n \"uifw-cursorpopup\",\n this.props.shadow && \"core-popup-shadow\",\n this.state.showPopup === CursorPopupShow.FadeOut &&\n \"uifw-cursorpopup-fadeOut\"\n );\n\n return (\n <div\n className={classNames}\n ref={(e) => this.setDivRef(e)}\n style={positioningStyle}\n >\n {this.props.title && (\n <TitleBar\n title={this.props.title}\n className=\"uifw-cursorpopup-title\"\n />\n )}\n {this.props.content}\n </div>\n );\n }\n}\n\n/** CursorPopup content with padding\n * @public\n */\nexport function CursorPopupContent(props: CommonDivProps) {\n return <Div {...props} mainClassName=\"uifw-cursorpopup-content\" />;\n}\n"]}
1
+ {"version":3,"file":"CursorPopup.js","sourceRoot":"","sources":["../../../../../src/appui-react/cursor/cursorpopup/CursorPopup.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,oBAAoB,CAAC;AAC5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAOzD,OAAO,EAAE,GAAG,EAAE,IAAI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------------------------------------------------------------------------------------\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 Cursor\n */\n\nimport \"./CursorPopup.scss\";\nimport * as React from \"react\";\nimport classnames from \"classnames\";\nimport type { XAndY } from \"@itwin/core-geometry\";\nimport { RelativePosition } from \"@itwin/appui-abstract\";\nimport type {\n CommonDivProps,\n CommonProps,\n RectangleProps,\n SizeProps,\n} from \"@itwin/core-react\";\nimport { Div, Size } from \"@itwin/core-react\";\nimport { TitleBar } from \"@itwin/appui-layout-react\";\nimport type { CursorPopupFadeOutEventArgs } from \"./CursorPopupManager\";\nimport { CursorPopupManager } from \"./CursorPopupManager\";\n\n/** Properties for the [[CursorPopup]] React component\n * @public\n */\nexport interface CursorPopupProps extends CommonProps {\n id: string;\n content: React.ReactNode;\n pt: XAndY;\n offset: XAndY;\n relativePosition: RelativePosition;\n title?: string;\n shadow?: boolean;\n /** Function called when size is known. */\n onSizeKnown?: (size: SizeProps) => void;\n}\n\n/** Enum for showing CursorPopup\n * @internal - unit testing\n */\nexport enum CursorPopupShow {\n Open,\n FadeOut,\n}\n\n/** State for the [[CursorPopup]] React component\n * @internal\n */\ninterface CursorPopupState {\n showPopup: CursorPopupShow;\n size: Size;\n}\n\n/** CursorPopup React component\n * @public\n */\nexport class CursorPopup extends React.Component<\n CursorPopupProps,\n CursorPopupState\n> {\n private _isMounted: boolean = false;\n\n /** @internal */\n public static fadeOutTime = 500;\n\n /** @internal */\n constructor(props: CursorPopupProps) {\n super(props);\n\n this.state = {\n showPopup: CursorPopupShow.Open,\n size: new Size(-1, -1),\n };\n }\n\n public override componentDidMount() {\n this._isMounted = true;\n CursorPopupManager.onCursorPopupFadeOutEvent.addListener(\n this._handleCursorPopupFadeOutEvent\n );\n }\n\n public override componentWillUnmount() {\n this._isMounted = false;\n CursorPopupManager.onCursorPopupFadeOutEvent.removeListener(\n this._handleCursorPopupFadeOutEvent\n );\n }\n\n private _handleCursorPopupFadeOutEvent = (\n args: CursorPopupFadeOutEventArgs\n ) => {\n if (this.props.id === args.id) {\n // istanbul ignore else\n if (this._isMounted)\n this.setState({ showPopup: CursorPopupShow.FadeOut });\n }\n };\n\n /** @internal */\n public static getPopupRect(\n pt: XAndY,\n offset: XAndY,\n popupSize: SizeProps | undefined,\n relativePosition: RelativePosition\n ): RectangleProps {\n const popupRect = { top: 0, left: 0, right: 0, bottom: 0 };\n\n if (popupSize === undefined) return popupRect;\n\n switch (relativePosition) {\n case RelativePosition.Top:\n popupRect.bottom = pt.y - offset.y;\n popupRect.left = pt.x - popupSize.width / 2;\n popupRect.top = popupRect.bottom - popupSize.height;\n popupRect.right = popupRect.left + popupSize.width;\n break;\n case RelativePosition.Left:\n popupRect.right = pt.x - offset.x;\n popupRect.top = pt.y - popupSize.height / 2;\n popupRect.left = popupRect.right - popupSize.width;\n popupRect.bottom = popupRect.top + popupSize.height;\n break;\n case RelativePosition.Right:\n popupRect.left = pt.x + offset.x;\n popupRect.top = pt.y - popupSize.height / 2;\n popupRect.right = popupRect.left + popupSize.width;\n popupRect.bottom = popupRect.top + popupSize.height;\n break;\n case RelativePosition.Bottom:\n popupRect.top = pt.y + offset.y;\n popupRect.left = pt.x - popupSize.width / 2;\n popupRect.bottom = popupRect.top + popupSize.height;\n popupRect.right = popupRect.left + popupSize.width;\n break;\n case RelativePosition.TopLeft:\n popupRect.bottom = pt.y - offset.y;\n popupRect.right = pt.x - offset.x;\n popupRect.top = popupRect.bottom - popupSize.height;\n popupRect.left = popupRect.right - popupSize.width;\n break;\n case RelativePosition.TopRight:\n popupRect.bottom = pt.y - offset.y;\n popupRect.left = pt.x + offset.x;\n popupRect.top = popupRect.bottom - popupSize.height;\n popupRect.right = popupRect.left + popupSize.width;\n break;\n case RelativePosition.BottomLeft:\n popupRect.top = pt.y + offset.y;\n popupRect.right = pt.x - offset.x;\n popupRect.bottom = popupRect.top + popupSize.height;\n popupRect.left = popupRect.right - popupSize.width;\n break;\n case RelativePosition.BottomRight:\n popupRect.top = pt.y + offset.y;\n popupRect.left = pt.x + offset.x;\n popupRect.bottom = popupRect.top + popupSize.height;\n popupRect.right = popupRect.left + popupSize.width;\n break;\n }\n\n return popupRect;\n }\n\n private setDivRef(div: HTMLDivElement | null) {\n // istanbul ignore else\n if (div) {\n const rect = div.getBoundingClientRect();\n const newSize = new Size(rect.width, rect.height);\n\n // istanbul ignore else\n if (!this.state.size.equals(newSize)) {\n // istanbul ignore else\n if (this.props.onSizeKnown) this.props.onSizeKnown(newSize);\n\n // istanbul ignore else\n if (this._isMounted) this.setState({ size: newSize });\n }\n }\n }\n\n /** @internal */\n public override render() {\n const popupRect = CursorPopup.getPopupRect(\n this.props.pt,\n this.props.offset,\n this.state.size,\n this.props.relativePosition\n );\n\n const positioningStyle: React.CSSProperties = {\n left: popupRect.left,\n top: popupRect.top,\n };\n\n const classNames = classnames(\n \"uifw-cursorpopup\",\n this.props.shadow && \"core-popup-shadow\",\n this.state.showPopup === CursorPopupShow.FadeOut &&\n \"uifw-cursorpopup-fadeOut\"\n );\n\n return (\n <div\n className={classNames}\n ref={(e) => this.setDivRef(e)}\n style={positioningStyle}\n >\n {this.props.title && (\n <TitleBar\n title={this.props.title}\n className=\"uifw-cursorpopup-title\"\n />\n )}\n {this.props.content}\n </div>\n );\n }\n}\n\n/** CursorPopup content with padding\n * @public\n */\nexport function CursorPopupContent(props: CommonDivProps) {\n return <Div {...props} mainClassName=\"uifw-cursorpopup-content\" />;\n}\n"]}