@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.
- package/CHANGELOG.md +13 -1
- package/lib/cjs/appui-react/UiFramework.js +7 -4
- package/lib/cjs/appui-react/UiFramework.js.map +1 -1
- package/lib/cjs/appui-react/accudraw/MenuButton.d.ts +2 -2
- package/lib/cjs/appui-react/accudraw/MenuButton.d.ts.map +1 -1
- package/lib/cjs/appui-react/accudraw/MenuButton.js.map +1 -1
- package/lib/cjs/appui-react/backstage/BackstageComposer.d.ts.map +1 -1
- package/lib/cjs/appui-react/backstage/BackstageComposer.js.map +1 -1
- package/lib/cjs/appui-react/backstage/BackstageComposerItem.js +2 -1
- package/lib/cjs/appui-react/backstage/BackstageComposerItem.js.map +1 -1
- package/lib/cjs/appui-react/childwindow/CopyStyles.d.ts.map +1 -1
- package/lib/cjs/appui-react/childwindow/CopyStyles.js +3 -1
- package/lib/cjs/appui-react/childwindow/CopyStyles.js.map +1 -1
- package/lib/cjs/appui-react/childwindow/InternalChildWindowManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/childwindow/InternalChildWindowManager.js +3 -2
- package/lib/cjs/appui-react/childwindow/InternalChildWindowManager.js.map +1 -1
- package/lib/cjs/appui-react/configurableui/InternalConfigurableUiManager.js +1 -1
- package/lib/cjs/appui-react/configurableui/InternalConfigurableUiManager.js.map +1 -1
- package/lib/cjs/appui-react/configurableui/TimeTracker.js +2 -1
- package/lib/cjs/appui-react/configurableui/TimeTracker.js.map +1 -1
- package/lib/cjs/appui-react/content/ContentLayout.js +12 -9
- package/lib/cjs/appui-react/content/ContentLayout.js.map +1 -1
- package/lib/cjs/appui-react/content/DefaultViewOverlay.js +4 -3
- package/lib/cjs/appui-react/content/DefaultViewOverlay.js.map +1 -1
- package/lib/cjs/appui-react/content/FloatingViewportContent.js +2 -1
- package/lib/cjs/appui-react/content/FloatingViewportContent.js.map +1 -1
- package/lib/cjs/appui-react/content/IModelViewport.js +6 -3
- package/lib/cjs/appui-react/content/IModelViewport.js.map +1 -1
- package/lib/cjs/appui-react/content/InternalContentLayoutManager.js +2 -1
- package/lib/cjs/appui-react/content/InternalContentLayoutManager.js.map +1 -1
- package/lib/cjs/appui-react/content/InternalContentViewManager.js +1 -1
- package/lib/cjs/appui-react/content/InternalContentViewManager.js.map +1 -1
- package/lib/cjs/appui-react/content/split-pane/SplitPane.js +12 -10
- package/lib/cjs/appui-react/content/split-pane/SplitPane.js.map +1 -1
- package/lib/cjs/appui-react/cursor/CursorInformation.d.ts +6 -6
- package/lib/cjs/appui-react/cursor/CursorInformation.d.ts.map +1 -1
- package/lib/cjs/appui-react/cursor/CursorInformation.js.map +1 -1
- package/lib/cjs/appui-react/cursor/cursormenu/CursorMenu.d.ts.map +1 -1
- package/lib/cjs/appui-react/cursor/cursormenu/CursorMenu.js +3 -2
- package/lib/cjs/appui-react/cursor/cursormenu/CursorMenu.js.map +1 -1
- package/lib/cjs/appui-react/cursor/cursorpopup/CursorPopup.d.ts +4 -4
- package/lib/cjs/appui-react/cursor/cursorpopup/CursorPopup.d.ts.map +1 -1
- package/lib/cjs/appui-react/cursor/cursorpopup/CursorPopup.js.map +1 -1
- package/lib/cjs/appui-react/cursor/cursorpopup/CursorPopupManager.d.ts +5 -5
- package/lib/cjs/appui-react/cursor/cursorpopup/CursorPopupManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/cursor/cursorpopup/CursorPopupManager.js.map +1 -1
- package/lib/cjs/appui-react/cursor/cursorprompt/CursorPrompt.d.ts +2 -2
- package/lib/cjs/appui-react/cursor/cursorprompt/CursorPrompt.d.ts.map +1 -1
- package/lib/cjs/appui-react/cursor/cursorprompt/CursorPrompt.js.map +1 -1
- package/lib/cjs/appui-react/dialog/ContentDialog.js +6 -3
- package/lib/cjs/appui-react/dialog/ContentDialog.js.map +1 -1
- package/lib/cjs/appui-react/dialog/DialogManagerBase.js +3 -2
- package/lib/cjs/appui-react/dialog/DialogManagerBase.js.map +1 -1
- package/lib/cjs/appui-react/feedback/ElementTooltip.d.ts +1 -2
- package/lib/cjs/appui-react/feedback/ElementTooltip.d.ts.map +1 -1
- package/lib/cjs/appui-react/feedback/ElementTooltip.js.map +1 -1
- package/lib/cjs/appui-react/frontstage/FrontstageDef.d.ts +22 -26
- package/lib/cjs/appui-react/frontstage/FrontstageDef.d.ts.map +1 -1
- package/lib/cjs/appui-react/frontstage/FrontstageDef.js +166 -217
- package/lib/cjs/appui-react/frontstage/FrontstageDef.js.map +1 -1
- package/lib/cjs/appui-react/frontstage/InternalFrontstageManager.d.ts +1 -7
- package/lib/cjs/appui-react/frontstage/InternalFrontstageManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/frontstage/InternalFrontstageManager.js +0 -6
- package/lib/cjs/appui-react/frontstage/InternalFrontstageManager.js.map +1 -1
- package/lib/cjs/appui-react/frontstage/ModalSettingsStage.js +3 -2
- package/lib/cjs/appui-react/frontstage/ModalSettingsStage.js.map +1 -1
- package/lib/cjs/appui-react/frontstage/StandardFrontstageProvider.js +2 -1
- package/lib/cjs/appui-react/frontstage/StandardFrontstageProvider.js.map +1 -1
- package/lib/cjs/appui-react/hooks/useActiveIModelConnection.d.ts.map +1 -1
- package/lib/cjs/appui-react/hooks/useActiveIModelConnection.js.map +1 -1
- package/lib/cjs/appui-react/hooks/useActiveViewport.d.ts.map +1 -1
- package/lib/cjs/appui-react/hooks/useActiveViewport.js.map +1 -1
- package/lib/cjs/appui-react/hooks/useAnalysisAnimationDataProvider.js +11 -7
- package/lib/cjs/appui-react/hooks/useAnalysisAnimationDataProvider.js.map +1 -1
- package/lib/cjs/appui-react/hooks/useScheduleAnimationDataProvider.js +11 -7
- package/lib/cjs/appui-react/hooks/useScheduleAnimationDataProvider.js.map +1 -1
- package/lib/cjs/appui-react/hooks/useSolarDataProvider.js +13 -8
- package/lib/cjs/appui-react/hooks/useSolarDataProvider.js.map +1 -1
- package/lib/cjs/appui-react/keyboardshortcut/InternalKeyboardShortcut.d.ts.map +1 -1
- package/lib/cjs/appui-react/keyboardshortcut/InternalKeyboardShortcut.js.map +1 -1
- package/lib/cjs/appui-react/messages/ActivityMessage.js +7 -5
- package/lib/cjs/appui-react/messages/ActivityMessage.js.map +1 -1
- package/lib/cjs/appui-react/messages/MessageManager.d.ts +0 -1
- package/lib/cjs/appui-react/messages/MessageManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/messages/MessageManager.js +1 -2
- package/lib/cjs/appui-react/messages/MessageManager.js.map +1 -1
- package/lib/cjs/appui-react/messages/Pointer.d.ts +1 -2
- package/lib/cjs/appui-react/messages/Pointer.d.ts.map +1 -1
- package/lib/cjs/appui-react/messages/Pointer.js +1 -1
- package/lib/cjs/appui-react/messages/Pointer.js.map +1 -1
- package/lib/cjs/appui-react/pickers/ViewSelector.js +6 -5
- package/lib/cjs/appui-react/pickers/ViewSelector.js.map +1 -1
- package/lib/cjs/appui-react/popup/KeyinPalettePanel.js +2 -1
- package/lib/cjs/appui-react/popup/KeyinPalettePanel.js.map +1 -1
- package/lib/cjs/appui-react/popup/PopupManager.js +2 -1
- package/lib/cjs/appui-react/popup/PopupManager.js.map +1 -1
- package/lib/cjs/appui-react/popup/PositionPopup.d.ts +2 -2
- package/lib/cjs/appui-react/popup/PositionPopup.d.ts.map +1 -1
- package/lib/cjs/appui-react/popup/PositionPopup.js.map +1 -1
- package/lib/cjs/appui-react/selection/SelectionContextItemDef.js +2 -2
- package/lib/cjs/appui-react/selection/SelectionContextItemDef.js.map +1 -1
- package/lib/cjs/appui-react/settings/quantityformatting/QuantityFormat.js +1 -2
- package/lib/cjs/appui-react/settings/quantityformatting/QuantityFormat.js.map +1 -1
- package/lib/cjs/appui-react/settings/ui/UiSettingsPage.js.map +1 -1
- package/lib/cjs/appui-react/stagepanels/StagePanelDef.d.ts +16 -20
- package/lib/cjs/appui-react/stagepanels/StagePanelDef.d.ts.map +1 -1
- package/lib/cjs/appui-react/stagepanels/StagePanelDef.js +86 -116
- package/lib/cjs/appui-react/stagepanels/StagePanelDef.js.map +1 -1
- package/lib/cjs/appui-react/statusbar/Indicator.js +2 -1
- package/lib/cjs/appui-react/statusbar/Indicator.js.map +1 -1
- package/lib/cjs/appui-react/statusbar/StatusBar.js +5 -3
- package/lib/cjs/appui-react/statusbar/StatusBar.js.map +1 -1
- package/lib/cjs/appui-react/statusfields/MessageCenter.d.ts.map +1 -1
- package/lib/cjs/appui-react/statusfields/MessageCenter.js +1 -2
- package/lib/cjs/appui-react/statusfields/MessageCenter.js.map +1 -1
- package/lib/cjs/appui-react/statusfields/toolassistance/ToolAssistanceField.js +1 -1
- package/lib/cjs/appui-react/statusfields/toolassistance/ToolAssistanceField.js.map +1 -1
- package/lib/cjs/appui-react/syncui/InternalSyncUiEventDispatcher.d.ts +36 -0
- package/lib/cjs/appui-react/syncui/InternalSyncUiEventDispatcher.d.ts.map +1 -0
- package/lib/cjs/appui-react/syncui/InternalSyncUiEventDispatcher.js +134 -0
- package/lib/cjs/appui-react/syncui/InternalSyncUiEventDispatcher.js.map +1 -0
- package/lib/cjs/appui-react/syncui/SyncUiEventDispatcher.d.ts +1 -1
- package/lib/cjs/appui-react/syncui/SyncUiEventDispatcher.d.ts.map +1 -1
- package/lib/cjs/appui-react/syncui/SyncUiEventDispatcher.js +2 -2
- package/lib/cjs/appui-react/syncui/SyncUiEventDispatcher.js.map +1 -1
- package/lib/cjs/appui-react/syncui/UiSyncEvent.d.ts +16 -0
- package/lib/cjs/appui-react/syncui/UiSyncEvent.d.ts.map +1 -0
- package/lib/cjs/appui-react/syncui/UiSyncEvent.js +18 -0
- package/lib/cjs/appui-react/syncui/UiSyncEvent.js.map +1 -0
- package/lib/cjs/appui-react/toolbar/ToolbarHelper.js +4 -6
- package/lib/cjs/appui-react/toolbar/ToolbarHelper.js.map +1 -1
- package/lib/cjs/appui-react/toolbar/useUiItemsProviderToolbarItems.js +4 -3
- package/lib/cjs/appui-react/toolbar/useUiItemsProviderToolbarItems.js.map +1 -1
- package/lib/cjs/appui-react/tools/CoreToolDefinitions.js +17 -10
- package/lib/cjs/appui-react/tools/CoreToolDefinitions.js.map +1 -1
- package/lib/cjs/appui-react/toolsettings/DefaultToolSettingsProvider.js +2 -3
- package/lib/cjs/appui-react/toolsettings/DefaultToolSettingsProvider.js.map +1 -1
- package/lib/cjs/appui-react/ui-items-provider/AbstractUiItemsManager.js +14 -12
- package/lib/cjs/appui-react/ui-items-provider/AbstractUiItemsManager.js.map +1 -1
- package/lib/cjs/appui-react/ui-items-provider/StandardContentToolsUiItemsProvider.js +10 -9
- package/lib/cjs/appui-react/ui-items-provider/StandardContentToolsUiItemsProvider.js.map +1 -1
- package/lib/cjs/appui-react/ui-items-provider/StandardStatusbarUiItemsProvider.js +2 -1
- package/lib/cjs/appui-react/ui-items-provider/StandardStatusbarUiItemsProvider.js.map +1 -1
- package/lib/cjs/appui-react/ui-items-provider/UiItemsManager.js +14 -8
- package/lib/cjs/appui-react/ui-items-provider/UiItemsManager.js.map +1 -1
- package/lib/cjs/appui-react/uiadmin/FrameworkUiAdmin.js +1 -1
- package/lib/cjs/appui-react/uiadmin/FrameworkUiAdmin.js.map +1 -1
- package/lib/cjs/appui-react/uiprovider/ComponentGenerator.js +1 -1
- package/lib/cjs/appui-react/uiprovider/ComponentGenerator.js.map +1 -1
- package/lib/cjs/appui-react/uistate/AppUiSettings.d.ts.map +1 -1
- package/lib/cjs/appui-react/uistate/AppUiSettings.js.map +1 -1
- package/lib/cjs/appui-react/uistate/useUiStateStorage.d.ts.map +1 -1
- package/lib/cjs/appui-react/uistate/useUiStateStorage.js.map +1 -1
- package/lib/cjs/appui-react/utils/InternalUiShowHideManager.js +3 -3
- package/lib/cjs/appui-react/utils/InternalUiShowHideManager.js.map +1 -1
- package/lib/cjs/appui-react/widget-panels/Content.js +9 -8
- package/lib/cjs/appui-react/widget-panels/Content.js.map +1 -1
- package/lib/cjs/appui-react/widget-panels/Frontstage.d.ts +7 -29
- package/lib/cjs/appui-react/widget-panels/Frontstage.d.ts.map +1 -1
- package/lib/cjs/appui-react/widget-panels/Frontstage.js +128 -463
- package/lib/cjs/appui-react/widget-panels/Frontstage.js.map +1 -1
- package/lib/cjs/appui-react/widget-panels/StatusBar.js +1 -1
- package/lib/cjs/appui-react/widget-panels/StatusBar.js.map +1 -1
- package/lib/cjs/appui-react/widget-panels/Tab.js +1 -1
- package/lib/cjs/appui-react/widget-panels/Tab.js.map +1 -1
- package/lib/cjs/appui-react/widget-panels/ToolSettings.d.ts.map +1 -1
- package/lib/cjs/appui-react/widget-panels/ToolSettings.js +34 -15
- package/lib/cjs/appui-react/widget-panels/ToolSettings.js.map +1 -1
- package/lib/cjs/appui-react/widget-panels/Toolbars.js +3 -2
- package/lib/cjs/appui-react/widget-panels/Toolbars.js.map +1 -1
- package/lib/cjs/appui-react/widgets/NavigationWidgetComposer.js +2 -2
- package/lib/cjs/appui-react/widgets/NavigationWidgetComposer.js.map +1 -1
- package/lib/cjs/appui-react/widgets/Widget.d.ts +10 -4
- package/lib/cjs/appui-react/widgets/Widget.d.ts.map +1 -1
- package/lib/cjs/appui-react/widgets/Widget.js.map +1 -1
- package/lib/cjs/appui-react/widgets/WidgetDef.d.ts +9 -29
- package/lib/cjs/appui-react/widgets/WidgetDef.d.ts.map +1 -1
- package/lib/cjs/appui-react/widgets/WidgetDef.js +90 -46
- package/lib/cjs/appui-react/widgets/WidgetDef.js.map +1 -1
- package/lib/cjs/appui-react/widgets/WidgetHost.js +3 -2
- package/lib/cjs/appui-react/widgets/WidgetHost.js.map +1 -1
- package/lib/cjs/appui-react.d.ts +1 -0
- package/lib/cjs/appui-react.d.ts.map +1 -1
- package/lib/cjs/appui-react.js +1 -0
- package/lib/cjs/appui-react.js.map +1 -1
- package/lib/esm/appui-react/UiFramework.js +7 -4
- package/lib/esm/appui-react/UiFramework.js.map +1 -1
- package/lib/esm/appui-react/accudraw/MenuButton.d.ts +2 -2
- package/lib/esm/appui-react/accudraw/MenuButton.d.ts.map +1 -1
- package/lib/esm/appui-react/accudraw/MenuButton.js.map +1 -1
- package/lib/esm/appui-react/backstage/BackstageComposer.d.ts.map +1 -1
- package/lib/esm/appui-react/backstage/BackstageComposer.js.map +1 -1
- package/lib/esm/appui-react/backstage/BackstageComposerItem.js +2 -1
- package/lib/esm/appui-react/backstage/BackstageComposerItem.js.map +1 -1
- package/lib/esm/appui-react/childwindow/CopyStyles.d.ts.map +1 -1
- package/lib/esm/appui-react/childwindow/CopyStyles.js +3 -1
- package/lib/esm/appui-react/childwindow/CopyStyles.js.map +1 -1
- package/lib/esm/appui-react/childwindow/InternalChildWindowManager.d.ts.map +1 -1
- package/lib/esm/appui-react/childwindow/InternalChildWindowManager.js +3 -2
- package/lib/esm/appui-react/childwindow/InternalChildWindowManager.js.map +1 -1
- package/lib/esm/appui-react/configurableui/InternalConfigurableUiManager.js +1 -1
- package/lib/esm/appui-react/configurableui/InternalConfigurableUiManager.js.map +1 -1
- package/lib/esm/appui-react/configurableui/TimeTracker.js +2 -1
- package/lib/esm/appui-react/configurableui/TimeTracker.js.map +1 -1
- package/lib/esm/appui-react/content/ContentLayout.js +12 -9
- package/lib/esm/appui-react/content/ContentLayout.js.map +1 -1
- package/lib/esm/appui-react/content/DefaultViewOverlay.js +4 -3
- package/lib/esm/appui-react/content/DefaultViewOverlay.js.map +1 -1
- package/lib/esm/appui-react/content/FloatingViewportContent.js +2 -1
- package/lib/esm/appui-react/content/FloatingViewportContent.js.map +1 -1
- package/lib/esm/appui-react/content/IModelViewport.js +6 -3
- package/lib/esm/appui-react/content/IModelViewport.js.map +1 -1
- package/lib/esm/appui-react/content/InternalContentLayoutManager.js +2 -1
- package/lib/esm/appui-react/content/InternalContentLayoutManager.js.map +1 -1
- package/lib/esm/appui-react/content/InternalContentViewManager.js +1 -1
- package/lib/esm/appui-react/content/InternalContentViewManager.js.map +1 -1
- package/lib/esm/appui-react/content/split-pane/SplitPane.js +12 -10
- package/lib/esm/appui-react/content/split-pane/SplitPane.js.map +1 -1
- package/lib/esm/appui-react/cursor/CursorInformation.d.ts +6 -6
- package/lib/esm/appui-react/cursor/CursorInformation.d.ts.map +1 -1
- package/lib/esm/appui-react/cursor/CursorInformation.js.map +1 -1
- package/lib/esm/appui-react/cursor/cursormenu/CursorMenu.d.ts.map +1 -1
- package/lib/esm/appui-react/cursor/cursormenu/CursorMenu.js +3 -2
- package/lib/esm/appui-react/cursor/cursormenu/CursorMenu.js.map +1 -1
- package/lib/esm/appui-react/cursor/cursorpopup/CursorPopup.d.ts +4 -4
- package/lib/esm/appui-react/cursor/cursorpopup/CursorPopup.d.ts.map +1 -1
- package/lib/esm/appui-react/cursor/cursorpopup/CursorPopup.js.map +1 -1
- package/lib/esm/appui-react/cursor/cursorpopup/CursorPopupManager.d.ts +5 -5
- package/lib/esm/appui-react/cursor/cursorpopup/CursorPopupManager.d.ts.map +1 -1
- package/lib/esm/appui-react/cursor/cursorpopup/CursorPopupManager.js.map +1 -1
- package/lib/esm/appui-react/cursor/cursorprompt/CursorPrompt.d.ts +2 -2
- package/lib/esm/appui-react/cursor/cursorprompt/CursorPrompt.d.ts.map +1 -1
- package/lib/esm/appui-react/cursor/cursorprompt/CursorPrompt.js.map +1 -1
- package/lib/esm/appui-react/dialog/ContentDialog.js +6 -3
- package/lib/esm/appui-react/dialog/ContentDialog.js.map +1 -1
- package/lib/esm/appui-react/dialog/DialogManagerBase.js +3 -2
- package/lib/esm/appui-react/dialog/DialogManagerBase.js.map +1 -1
- package/lib/esm/appui-react/feedback/ElementTooltip.d.ts +1 -2
- package/lib/esm/appui-react/feedback/ElementTooltip.d.ts.map +1 -1
- package/lib/esm/appui-react/feedback/ElementTooltip.js.map +1 -1
- package/lib/esm/appui-react/frontstage/FrontstageDef.d.ts +22 -26
- package/lib/esm/appui-react/frontstage/FrontstageDef.d.ts.map +1 -1
- package/lib/esm/appui-react/frontstage/FrontstageDef.js +170 -221
- package/lib/esm/appui-react/frontstage/FrontstageDef.js.map +1 -1
- package/lib/esm/appui-react/frontstage/InternalFrontstageManager.d.ts +1 -7
- package/lib/esm/appui-react/frontstage/InternalFrontstageManager.d.ts.map +1 -1
- package/lib/esm/appui-react/frontstage/InternalFrontstageManager.js +0 -6
- package/lib/esm/appui-react/frontstage/InternalFrontstageManager.js.map +1 -1
- package/lib/esm/appui-react/frontstage/ModalSettingsStage.js +3 -2
- package/lib/esm/appui-react/frontstage/ModalSettingsStage.js.map +1 -1
- package/lib/esm/appui-react/frontstage/StandardFrontstageProvider.js +2 -1
- package/lib/esm/appui-react/frontstage/StandardFrontstageProvider.js.map +1 -1
- package/lib/esm/appui-react/hooks/useActiveIModelConnection.d.ts.map +1 -1
- package/lib/esm/appui-react/hooks/useActiveIModelConnection.js.map +1 -1
- package/lib/esm/appui-react/hooks/useActiveViewport.d.ts.map +1 -1
- package/lib/esm/appui-react/hooks/useActiveViewport.js.map +1 -1
- package/lib/esm/appui-react/hooks/useAnalysisAnimationDataProvider.js +11 -7
- package/lib/esm/appui-react/hooks/useAnalysisAnimationDataProvider.js.map +1 -1
- package/lib/esm/appui-react/hooks/useScheduleAnimationDataProvider.js +11 -7
- package/lib/esm/appui-react/hooks/useScheduleAnimationDataProvider.js.map +1 -1
- package/lib/esm/appui-react/hooks/useSolarDataProvider.js +13 -8
- package/lib/esm/appui-react/hooks/useSolarDataProvider.js.map +1 -1
- package/lib/esm/appui-react/keyboardshortcut/InternalKeyboardShortcut.d.ts.map +1 -1
- package/lib/esm/appui-react/keyboardshortcut/InternalKeyboardShortcut.js.map +1 -1
- package/lib/esm/appui-react/messages/ActivityMessage.js +7 -5
- package/lib/esm/appui-react/messages/ActivityMessage.js.map +1 -1
- package/lib/esm/appui-react/messages/MessageManager.d.ts +0 -1
- package/lib/esm/appui-react/messages/MessageManager.d.ts.map +1 -1
- package/lib/esm/appui-react/messages/MessageManager.js +1 -2
- package/lib/esm/appui-react/messages/MessageManager.js.map +1 -1
- package/lib/esm/appui-react/messages/Pointer.d.ts +1 -2
- package/lib/esm/appui-react/messages/Pointer.d.ts.map +1 -1
- package/lib/esm/appui-react/messages/Pointer.js +1 -1
- package/lib/esm/appui-react/messages/Pointer.js.map +1 -1
- package/lib/esm/appui-react/pickers/ViewSelector.js +6 -5
- package/lib/esm/appui-react/pickers/ViewSelector.js.map +1 -1
- package/lib/esm/appui-react/popup/KeyinPalettePanel.js +2 -1
- package/lib/esm/appui-react/popup/KeyinPalettePanel.js.map +1 -1
- package/lib/esm/appui-react/popup/PopupManager.js +2 -1
- package/lib/esm/appui-react/popup/PopupManager.js.map +1 -1
- package/lib/esm/appui-react/popup/PositionPopup.d.ts +2 -2
- package/lib/esm/appui-react/popup/PositionPopup.d.ts.map +1 -1
- package/lib/esm/appui-react/popup/PositionPopup.js.map +1 -1
- package/lib/esm/appui-react/selection/SelectionContextItemDef.js +2 -2
- package/lib/esm/appui-react/selection/SelectionContextItemDef.js.map +1 -1
- package/lib/esm/appui-react/settings/quantityformatting/QuantityFormat.js +1 -2
- package/lib/esm/appui-react/settings/quantityformatting/QuantityFormat.js.map +1 -1
- package/lib/esm/appui-react/settings/ui/UiSettingsPage.js.map +1 -1
- package/lib/esm/appui-react/stagepanels/StagePanelDef.d.ts +16 -20
- package/lib/esm/appui-react/stagepanels/StagePanelDef.d.ts.map +1 -1
- package/lib/esm/appui-react/stagepanels/StagePanelDef.js +84 -115
- package/lib/esm/appui-react/stagepanels/StagePanelDef.js.map +1 -1
- package/lib/esm/appui-react/statusbar/Indicator.js +2 -1
- package/lib/esm/appui-react/statusbar/Indicator.js.map +1 -1
- package/lib/esm/appui-react/statusbar/StatusBar.js +5 -3
- package/lib/esm/appui-react/statusbar/StatusBar.js.map +1 -1
- package/lib/esm/appui-react/statusfields/MessageCenter.d.ts.map +1 -1
- package/lib/esm/appui-react/statusfields/MessageCenter.js +1 -2
- package/lib/esm/appui-react/statusfields/MessageCenter.js.map +1 -1
- package/lib/esm/appui-react/statusfields/toolassistance/ToolAssistanceField.js +1 -1
- package/lib/esm/appui-react/statusfields/toolassistance/ToolAssistanceField.js.map +1 -1
- package/lib/esm/appui-react/syncui/InternalSyncUiEventDispatcher.d.ts +36 -0
- package/lib/esm/appui-react/syncui/InternalSyncUiEventDispatcher.d.ts.map +1 -0
- package/lib/esm/appui-react/syncui/InternalSyncUiEventDispatcher.js +130 -0
- package/lib/esm/appui-react/syncui/InternalSyncUiEventDispatcher.js.map +1 -0
- package/lib/esm/appui-react/syncui/SyncUiEventDispatcher.d.ts +1 -1
- package/lib/esm/appui-react/syncui/SyncUiEventDispatcher.d.ts.map +1 -1
- package/lib/esm/appui-react/syncui/SyncUiEventDispatcher.js +2 -2
- package/lib/esm/appui-react/syncui/SyncUiEventDispatcher.js.map +1 -1
- package/lib/esm/appui-react/syncui/UiSyncEvent.d.ts +16 -0
- package/lib/esm/appui-react/syncui/UiSyncEvent.d.ts.map +1 -0
- package/lib/esm/appui-react/syncui/UiSyncEvent.js +14 -0
- package/lib/esm/appui-react/syncui/UiSyncEvent.js.map +1 -0
- package/lib/esm/appui-react/toolbar/ToolbarHelper.js +4 -6
- package/lib/esm/appui-react/toolbar/ToolbarHelper.js.map +1 -1
- package/lib/esm/appui-react/toolbar/useUiItemsProviderToolbarItems.js +4 -3
- package/lib/esm/appui-react/toolbar/useUiItemsProviderToolbarItems.js.map +1 -1
- package/lib/esm/appui-react/tools/CoreToolDefinitions.js +17 -10
- package/lib/esm/appui-react/tools/CoreToolDefinitions.js.map +1 -1
- package/lib/esm/appui-react/toolsettings/DefaultToolSettingsProvider.js +2 -3
- package/lib/esm/appui-react/toolsettings/DefaultToolSettingsProvider.js.map +1 -1
- package/lib/esm/appui-react/ui-items-provider/AbstractUiItemsManager.js +14 -12
- package/lib/esm/appui-react/ui-items-provider/AbstractUiItemsManager.js.map +1 -1
- package/lib/esm/appui-react/ui-items-provider/StandardContentToolsUiItemsProvider.js +10 -9
- package/lib/esm/appui-react/ui-items-provider/StandardContentToolsUiItemsProvider.js.map +1 -1
- package/lib/esm/appui-react/ui-items-provider/StandardStatusbarUiItemsProvider.js +2 -1
- package/lib/esm/appui-react/ui-items-provider/StandardStatusbarUiItemsProvider.js.map +1 -1
- package/lib/esm/appui-react/ui-items-provider/UiItemsManager.js +14 -8
- package/lib/esm/appui-react/ui-items-provider/UiItemsManager.js.map +1 -1
- package/lib/esm/appui-react/uiadmin/FrameworkUiAdmin.js +1 -1
- package/lib/esm/appui-react/uiadmin/FrameworkUiAdmin.js.map +1 -1
- package/lib/esm/appui-react/uiprovider/ComponentGenerator.js +1 -1
- package/lib/esm/appui-react/uiprovider/ComponentGenerator.js.map +1 -1
- package/lib/esm/appui-react/uistate/AppUiSettings.d.ts.map +1 -1
- package/lib/esm/appui-react/uistate/AppUiSettings.js.map +1 -1
- package/lib/esm/appui-react/uistate/useUiStateStorage.d.ts.map +1 -1
- package/lib/esm/appui-react/uistate/useUiStateStorage.js.map +1 -1
- package/lib/esm/appui-react/utils/InternalUiShowHideManager.js +3 -3
- package/lib/esm/appui-react/utils/InternalUiShowHideManager.js.map +1 -1
- package/lib/esm/appui-react/widget-panels/Content.js +9 -8
- package/lib/esm/appui-react/widget-panels/Content.js.map +1 -1
- package/lib/esm/appui-react/widget-panels/Frontstage.d.ts +7 -29
- package/lib/esm/appui-react/widget-panels/Frontstage.d.ts.map +1 -1
- package/lib/esm/appui-react/widget-panels/Frontstage.js +131 -462
- package/lib/esm/appui-react/widget-panels/Frontstage.js.map +1 -1
- package/lib/esm/appui-react/widget-panels/StatusBar.js +1 -1
- package/lib/esm/appui-react/widget-panels/StatusBar.js.map +1 -1
- package/lib/esm/appui-react/widget-panels/Tab.js +1 -1
- package/lib/esm/appui-react/widget-panels/Tab.js.map +1 -1
- package/lib/esm/appui-react/widget-panels/ToolSettings.d.ts.map +1 -1
- package/lib/esm/appui-react/widget-panels/ToolSettings.js +34 -15
- package/lib/esm/appui-react/widget-panels/ToolSettings.js.map +1 -1
- package/lib/esm/appui-react/widget-panels/Toolbars.js +3 -2
- package/lib/esm/appui-react/widget-panels/Toolbars.js.map +1 -1
- package/lib/esm/appui-react/widgets/NavigationWidgetComposer.js +2 -2
- package/lib/esm/appui-react/widgets/NavigationWidgetComposer.js.map +1 -1
- package/lib/esm/appui-react/widgets/Widget.d.ts +10 -4
- package/lib/esm/appui-react/widgets/Widget.d.ts.map +1 -1
- package/lib/esm/appui-react/widgets/Widget.js.map +1 -1
- package/lib/esm/appui-react/widgets/WidgetDef.d.ts +9 -29
- package/lib/esm/appui-react/widgets/WidgetDef.d.ts.map +1 -1
- package/lib/esm/appui-react/widgets/WidgetDef.js +90 -46
- package/lib/esm/appui-react/widgets/WidgetDef.js.map +1 -1
- package/lib/esm/appui-react/widgets/WidgetHost.js +3 -2
- package/lib/esm/appui-react/widgets/WidgetHost.js.map +1 -1
- package/lib/esm/appui-react.d.ts +1 -0
- package/lib/esm/appui-react.d.ts.map +1 -1
- package/lib/esm/appui-react.js +1 -0
- package/lib/esm/appui-react.js.map +1 -1
- package/package.json +10 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InternalConfigurableUiManager.js","sourceRoot":"","sources":["../../../../src/appui-react/configurableui/InternalConfigurableUiManager.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4CAA4C,CAAC;AACtF,OAAO,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AAC5F,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EAAE,oCAAoC,EAAE,MAAM,iDAAiD,CAAC;AACvG,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAK7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,eAAe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Ae,EAAE,CAAC;SAZtD,6BAA6B","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 ConfigurableUi\n */\n\nimport { UiError } from \"@itwin/appui-abstract\";\nimport { CubeNavigationAidControl } from \"../navigationaids/CubeNavigationAidControl\";\nimport { DrawingNavigationAidControl } from \"../navigationaids/DrawingNavigationAidControl\";\nimport { SheetNavigationAidControl } from \"../navigationaids/SheetNavigationAid\";\nimport { StandardRotationNavigationAidControl } from \"../navigationaids/StandardRotationNavigationAid\";\nimport { UiFramework } from \"../UiFramework\";\nimport type {\n ConfigurableUiControlConstructor,\n ConfigurableUiElement,\n} from \"./ConfigurableUiControl\";\nimport { ConfigurableCreateInfo } from \"./ConfigurableUiControl\";\nimport { MessageManager } from \"../messages/MessageManager\";\nimport { PopupManager } from \"../popup/PopupManager\";\nimport { ActivityTracker } from \"./ActivityTracker\";\nimport { BeUiEvent } from \"@itwin/core-bentley\";\nimport { InternalFrontstageManager } from \"../frontstage/InternalFrontstageManager\";\nimport { InternalToolSettingsManager } from \"../toolsettings/InternalToolSettingsManager\";\nimport { InternalModelessDialogManager } from \"../dialog/InternalModelessDialogManager\";\nimport { InternalContentDialogManager } from \"../dialog/InternalContentDialogManager\";\nimport { InternalKeyboardShortcutManager } from \"../keyboardshortcut/InternalKeyboardShortcut\";\nimport { InternalModalDialogManager } from \"../dialog/InternalModalDialogManager\";\nimport { SyncUiEventDispatcher } from \"../syncui/SyncUiEventDispatcher\";\n\n/** Ui Activity Event Args interface.\n * @internal\n */\nexport interface UiActivityEventArgs {\n event: Event;\n}\n\n/** Ui Activity Event class.\n * @internal\n */\nexport class UiActivityEvent extends BeUiEvent<UiActivityEventArgs> {}\n\n/** Ui Interval Event Args interface\n * @internal\n */\nexport interface UiIntervalEventArgs {\n idleTimeout?: number;\n}\n\n/** Ui Interval Event class.\n * @internal\n */\nexport class UiIntervalEvent extends BeUiEvent<UiIntervalEventArgs> {}\n\n/** Configurable Ui Manager maintains controls, Frontstages, Content Groups, Content Layouts, Tasks and Workflows.\n * @internal\n */\nexport class InternalConfigurableUiManager {\n private static _registeredControls = new Map<\n string,\n ConfigurableUiControlConstructor\n >();\n private static _initialized = false;\n\n /** @internal */\n public static readonly activityTracker = new ActivityTracker();\n /** @internal */\n public static readonly onUiActivityEvent = new UiActivityEvent();\n /** @internal */\n public static readonly onUiIntervalEvent = new UiIntervalEvent();\n\n /** Initializes the InternalConfigurableUiManager and registers core controls.\n * @internal\n */\n public static initialize() {\n if (this._initialized) return;\n\n // Register core controls\n InternalConfigurableUiManager.register(\n StandardRotationNavigationAidControl.navigationAidId,\n StandardRotationNavigationAidControl\n );\n InternalConfigurableUiManager.register(\n SheetNavigationAidControl.navigationAidId,\n SheetNavigationAidControl\n );\n InternalConfigurableUiManager.register(\n DrawingNavigationAidControl.navigationAidId,\n DrawingNavigationAidControl\n );\n InternalConfigurableUiManager.register(\n CubeNavigationAidControl.navigationAidId,\n CubeNavigationAidControl\n );\n\n // Initialize SyncUiEventDispatcher so it can register event callbacks.\n SyncUiEventDispatcher.initialize();\n\n // Initialize the FrontstageManager\n InternalFrontstageManager.initialize();\n\n // Initialize the ToolSettingsManager that manages Tool Settings properties.\n InternalToolSettingsManager.initialize();\n\n // Initialize dialog managers that allow one or more dialogs to be open at a time. These managers adjust the z-indexing\n // to ensure the most recently focused dialog of a specific type displays above its siblings.\n InternalModelessDialogManager.initialize();\n\n // ContentDialog have a z-index just above the fixed content views and below all other UI elements.\n InternalContentDialogManager.initialize();\n\n // Initialize the Keyboard Shortcut manager\n InternalKeyboardShortcutManager.initialize();\n\n this._initialized = true;\n }\n\n /** Registers a control implementing the [[ConfigurableUiElement]] interface.\n * These controls can be a\n * [[ContentControl]],\n * [[NavigationAidControl]],\n * [[StatusBarWidgetControl]],\n * [[WidgetControl]] or\n * [ToolUiProvider]($appui-react).\n * @param classId the class id of the control to register\n * @param constructor the constructor of the control to register\n */\n public static register(\n classId: string,\n constructor: ConfigurableUiControlConstructor\n ): void {\n if (this._registeredControls.get(classId) !== undefined) {\n throw new UiError(\n UiFramework.loggerCategory(this),\n `registerControl: classId '${classId}' already registered`\n );\n }\n\n this._registeredControls.set(classId, constructor);\n }\n\n /** Determines if a control has been registered based on its classId.\n * @param classId the class id of the control to test\n * @returns true if the control is registered or false if not\n */\n public static isRegistered(classId: string): boolean {\n const constructor = this._registeredControls.get(classId);\n return constructor !== undefined;\n }\n\n /** Determines if a control has been registered.\n * @internal\n */\n public static getConstructorClassId(\n constructor: ConfigurableUiControlConstructor\n ): string | undefined {\n for (const [key, value] of this._registeredControls.entries()) {\n if (value === constructor) return key;\n }\n\n return undefined;\n }\n\n /** Unregisters a control that has been registered.\n * @param classId the class id of the control to unregister\n */\n public static unregister(classId: string): void {\n const constructor = this._registeredControls.get(classId);\n if (constructor) this._registeredControls.delete(classId);\n }\n\n /** Creates a control registered by calling registerControl.\n * @param classId the class id of the control to create\n * @param uniqueId a unique id for the control\n * @param options options passed to the constructor of the control\n * @param controlId controlId which may not be unique across all control instances.\n * @returns the created control\n */\n public static create(\n classId: string,\n uniqueId: string,\n options?: any,\n controlId?: string\n ): ConfigurableUiElement | undefined {\n const info = new ConfigurableCreateInfo(\n classId,\n uniqueId,\n controlId ?? uniqueId\n );\n const constructor = this._registeredControls.get(info.classId);\n if (!constructor) {\n throw new UiError(\n UiFramework.loggerCategory(this),\n `createControl: classId '${classId}' not registered`\n );\n }\n\n const control = new constructor(info, options);\n return control;\n }\n\n /** Gets the HTML wrapper element for Configurable UI */\n public static getWrapperElement(): HTMLElement {\n const wrapper = document.getElementById(\"uifw-configurableui-wrapper\");\n const htmlElement = wrapper!;\n return htmlElement;\n }\n\n /** Closes all UI popups currently open */\n public static closeUi(): void {\n MessageManager.closeAllMessages();\n InternalModelessDialogManager.closeAll();\n InternalModalDialogManager.closeAll();\n InternalContentDialogManager.closeAll();\n UiFramework.keyboardShortcuts.closeMenu();\n UiFramework.closeCursorMenu();\n PopupManager.clearPopups();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"InternalConfigurableUiManager.js","sourceRoot":"","sources":["../../../../src/appui-react/configurableui/InternalConfigurableUiManager.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4CAA4C,CAAC;AACtF,OAAO,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AAC5F,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EAAE,oCAAoC,EAAE,MAAM,iDAAiD,CAAC;AACvG,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAK7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,2BAA2B,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AACxF,OAAO,EAAE,4BAA4B,EAAE,MAAM,wCAAwC,CAAC;AACtF,OAAO,EAAE,+BAA+B,EAAE,MAAM,8CAA8C,CAAC;AAC/F,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AASxE;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ,SAA8B;CA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DAAwD;IACjD,MAAM,CAAC,iBAAiB;QAC7B,MAAM,OAAO,GAAG,QAAQ,CAAC,cAAc,CAAC,6BAA6B,CAAC,CAAC;QACvE,MAAM,WAAW,GAAG,OAAQ,CAAC;QAC7B,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,0CAA0C;IACnC,MAAM,CAAC,OAAO;QACnB,cAAc,CAAC,gBAAgB,EAAE,CAAC;QAClC,6BAA6B,CAAC,QAAQ,EAAE,CAAC;QACzC,0BAA0B,CAAC,QAAQ,EAAE,CAAC;QACtC,4BAA4B,CAAC,QAAQ,EAAE,CAAC;QACxC,WAAW,CAAC,iBAAiB,CAAC,SAAS,EAAE,CAAC;QAC1C,WAAW,CAAC,eAAe,EAAE,CAAC;QAC9B,YAAY,CAAC,WAAW,EAAE,CAAC;IAC7B,CAAC;;AA/Jc,iDAAmB,GAAG,IAAI,GAAG,EAGzC,CAAC;AACW,0CAAY,GAAG,KAAK,CAAC;AAEpC,gBAAgB;AACO,6CAAe,GAAG,IAAI,eAAe,EAAE,CAAC;AAC/D,gBAAgB;AACO,+CAAiB,GAAG,IAAI,eAAe,EAAE,CAAC;AACjE,gBAAgB;AACO,+CAAiB,GAAG,IAAI,eAAe,EAAE,CAAC;SAZtD,6BAA6B","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 ConfigurableUi\n */\n\nimport { UiError } from \"@itwin/appui-abstract\";\nimport { CubeNavigationAidControl } from \"../navigationaids/CubeNavigationAidControl\";\nimport { DrawingNavigationAidControl } from \"../navigationaids/DrawingNavigationAidControl\";\nimport { SheetNavigationAidControl } from \"../navigationaids/SheetNavigationAid\";\nimport { StandardRotationNavigationAidControl } from \"../navigationaids/StandardRotationNavigationAid\";\nimport { UiFramework } from \"../UiFramework\";\nimport type {\n ConfigurableUiControlConstructor,\n ConfigurableUiElement,\n} from \"./ConfigurableUiControl\";\nimport { ConfigurableCreateInfo } from \"./ConfigurableUiControl\";\nimport { MessageManager } from \"../messages/MessageManager\";\nimport { PopupManager } from \"../popup/PopupManager\";\nimport { ActivityTracker } from \"./ActivityTracker\";\nimport { BeUiEvent } from \"@itwin/core-bentley\";\nimport { InternalFrontstageManager } from \"../frontstage/InternalFrontstageManager\";\nimport { InternalToolSettingsManager } from \"../toolsettings/InternalToolSettingsManager\";\nimport { InternalModelessDialogManager } from \"../dialog/InternalModelessDialogManager\";\nimport { InternalContentDialogManager } from \"../dialog/InternalContentDialogManager\";\nimport { InternalKeyboardShortcutManager } from \"../keyboardshortcut/InternalKeyboardShortcut\";\nimport { InternalModalDialogManager } from \"../dialog/InternalModalDialogManager\";\nimport { SyncUiEventDispatcher } from \"../syncui/SyncUiEventDispatcher\";\n\n/** Ui Activity Event Args interface.\n * @internal\n */\nexport interface UiActivityEventArgs {\n event: Event;\n}\n\n/** Ui Activity Event class.\n * @internal\n */\nexport class UiActivityEvent extends BeUiEvent<UiActivityEventArgs> {}\n\n/** Ui Interval Event Args interface\n * @internal\n */\nexport interface UiIntervalEventArgs {\n idleTimeout?: number;\n}\n\n/** Ui Interval Event class.\n * @internal\n */\nexport class UiIntervalEvent extends BeUiEvent<UiIntervalEventArgs> {}\n\n/** Configurable Ui Manager maintains controls, Frontstages, Content Groups, Content Layouts, Tasks and Workflows.\n * @internal\n */\nexport class InternalConfigurableUiManager {\n private static _registeredControls = new Map<\n string,\n ConfigurableUiControlConstructor\n >();\n private static _initialized = false;\n\n /** @internal */\n public static readonly activityTracker = new ActivityTracker();\n /** @internal */\n public static readonly onUiActivityEvent = new UiActivityEvent();\n /** @internal */\n public static readonly onUiIntervalEvent = new UiIntervalEvent();\n\n /** Initializes the InternalConfigurableUiManager and registers core controls.\n * @internal\n */\n public static initialize() {\n if (this._initialized) return;\n\n // Register core controls\n InternalConfigurableUiManager.register(\n StandardRotationNavigationAidControl.navigationAidId,\n StandardRotationNavigationAidControl\n );\n InternalConfigurableUiManager.register(\n SheetNavigationAidControl.navigationAidId,\n SheetNavigationAidControl\n );\n InternalConfigurableUiManager.register(\n DrawingNavigationAidControl.navigationAidId,\n DrawingNavigationAidControl\n );\n InternalConfigurableUiManager.register(\n CubeNavigationAidControl.navigationAidId,\n CubeNavigationAidControl\n );\n\n // Initialize SyncUiEventDispatcher so it can register event callbacks.\n SyncUiEventDispatcher.initialize();\n\n // Initialize the FrontstageManager\n InternalFrontstageManager.initialize();\n\n // Initialize the ToolSettingsManager that manages Tool Settings properties.\n InternalToolSettingsManager.initialize();\n\n // Initialize dialog managers that allow one or more dialogs to be open at a time. These managers adjust the z-indexing\n // to ensure the most recently focused dialog of a specific type displays above its siblings.\n InternalModelessDialogManager.initialize();\n\n // ContentDialog have a z-index just above the fixed content views and below all other UI elements.\n InternalContentDialogManager.initialize();\n\n // Initialize the Keyboard Shortcut manager\n InternalKeyboardShortcutManager.initialize();\n\n this._initialized = true;\n }\n\n /** Registers a control implementing the [[ConfigurableUiElement]] interface.\n * These controls can be a\n * [[ContentControl]],\n * [[NavigationAidControl]],\n * [[StatusBarWidgetControl]],\n * [[WidgetControl]] or\n * [ToolUiProvider]($appui-react).\n * @param classId the class id of the control to register\n * @param constructor the constructor of the control to register\n */\n public static register(\n classId: string,\n constructor: ConfigurableUiControlConstructor\n ): void {\n if (this._registeredControls.get(classId) !== undefined) {\n throw new UiError(\n UiFramework.loggerCategory(this),\n `registerControl: classId '${classId}' already registered`\n );\n }\n\n this._registeredControls.set(classId, constructor);\n }\n\n /** Determines if a control has been registered based on its classId.\n * @param classId the class id of the control to test\n * @returns true if the control is registered or false if not\n */\n public static isRegistered(classId: string): boolean {\n const constructor = this._registeredControls.get(classId);\n return constructor !== undefined;\n }\n\n /** Determines if a control has been registered.\n * @internal\n */\n public static getConstructorClassId(\n constructor: ConfigurableUiControlConstructor\n ): string | undefined {\n for (const [key, value] of this._registeredControls.entries()) {\n if (value === constructor) return key;\n }\n\n return undefined;\n }\n\n /** Unregisters a control that has been registered.\n * @param classId the class id of the control to unregister\n */\n public static unregister(classId: string): void {\n const constructor = this._registeredControls.get(classId);\n if (constructor) this._registeredControls.delete(classId);\n }\n\n /** Creates a control registered by calling registerControl.\n * @param classId the class id of the control to create\n * @param uniqueId a unique id for the control\n * @param options options passed to the constructor of the control\n * @param controlId controlId which may not be unique across all control instances.\n * @returns the created control\n */\n public static create(\n classId: string,\n uniqueId: string,\n options?: any,\n controlId?: string\n ): ConfigurableUiElement | undefined {\n const info = new ConfigurableCreateInfo(\n classId,\n uniqueId,\n controlId ?? uniqueId\n );\n const constructor = this._registeredControls.get(info.classId);\n if (!constructor) {\n throw new UiError(\n UiFramework.loggerCategory(this),\n `createControl: classId '${classId}' not registered`\n );\n }\n\n const control = new constructor(info, options);\n return control;\n }\n\n /** Gets the HTML wrapper element for Configurable UI */\n public static getWrapperElement(): HTMLElement {\n const wrapper = document.getElementById(\"uifw-configurableui-wrapper\");\n const htmlElement = wrapper!;\n return htmlElement;\n }\n\n /** Closes all UI popups currently open */\n public static closeUi(): void {\n MessageManager.closeAllMessages();\n InternalModelessDialogManager.closeAll();\n InternalModalDialogManager.closeAll();\n InternalContentDialogManager.closeAll();\n UiFramework.keyboardShortcuts.closeMenu();\n UiFramework.closeCursorMenu();\n PopupManager.clearPopups();\n }\n}\n"]}
|
|
@@ -20,8 +20,9 @@ export class TimeTracker {
|
|
|
20
20
|
this._totalTime = 0;
|
|
21
21
|
this._idleTime = 0;
|
|
22
22
|
this._idleTimeCounter = (args) => {
|
|
23
|
+
var _a;
|
|
23
24
|
// istanbul ignore next
|
|
24
|
-
const idleTimeout = args.idleTimeout
|
|
25
|
+
const idleTimeout = (_a = args.idleTimeout) !== null && _a !== void 0 ? _a : this._idleTimeout;
|
|
25
26
|
// istanbul ignore else
|
|
26
27
|
if (this._lastActiveTimestamp > 0 &&
|
|
27
28
|
this._idleStartTimestamp === 0 &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeTracker.js","sourceRoot":"","sources":["../../../../src/appui-react/configurableui/TimeTracker.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAMH,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAEhF;;GAEG;AACH,MAAM,OAAO,WAAW;IAAxB;QACU,0BAAqB,GAAW,CAAC,CAAC;QAClC,wBAAmB,GAAW,CAAC,CAAC;QAChC,yBAAoB,GAAW,CAAC,CAAC;QACjC,mBAAc,GAAW,CAAC,CAAC;QAC3B,eAAU,GAAW,CAAC,CAAC;QACvB,iBAAY,GAAW,IAAI,CAAC;QAC5B,eAAU,GAAW,CAAC,CAAC;QACvB,cAAS,GAAW,CAAC,CAAC;QAsDtB,qBAAgB,GAAG,CAAC,IAAyB,EAAQ,EAAE
|
|
1
|
+
{"version":3,"file":"TimeTracker.js","sourceRoot":"","sources":["../../../../src/appui-react/configurableui/TimeTracker.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAMH,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAEhF;;GAEG;AACH,MAAM,OAAO,WAAW;IAAxB;QACU,0BAAqB,GAAW,CAAC,CAAC;QAClC,wBAAmB,GAAW,CAAC,CAAC;QAChC,yBAAoB,GAAW,CAAC,CAAC;QACjC,mBAAc,GAAW,CAAC,CAAC;QAC3B,eAAU,GAAW,CAAC,CAAC;QACvB,iBAAY,GAAW,IAAI,CAAC;QAC5B,eAAU,GAAW,CAAC,CAAC;QACvB,cAAS,GAAW,CAAC,CAAC;QAsDtB,qBAAgB,GAAG,CAAC,IAAyB,EAAQ,EAAE;;YAC7D,uBAAuB;YACvB,MAAM,WAAW,GAAG,MAAA,IAAI,CAAC,WAAW,mCAAI,IAAI,CAAC,YAAY,CAAC;YAC1D,uBAAuB;YACvB,IACE,IAAI,CAAC,oBAAoB,GAAG,CAAC;gBAC7B,IAAI,CAAC,mBAAmB,KAAK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C,cAAc,CAC5D,IAAI,CAAC,cAAc,CACpB,CAAC;QAEF,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,qBAAqB,CAAC;QAC1D,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC;IAC7E,CAAC;IAED;OACG;IACI,wBAAwB;QAC7B,OAAO,CAAC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;IACnD,CAAC;IAED;OACG;IACI,mBAAmB;QACxB,OAAO,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IAChC,CAAC;IAED;OACG;IACI,kBAAkB;QACvB,OAAO,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IAC/B,CAAC;CAyBF","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 ConfigurableUi\n */\n\nimport type {\n UiActivityEventArgs,\n UiIntervalEventArgs,\n} from \"./InternalConfigurableUiManager\";\nimport { InternalConfigurableUiManager } from \"./InternalConfigurableUiManager\";\n\n/** Time Tracker utility class\n * @internal\n */\nexport class TimeTracker {\n private _firstActiveTimestamp: number = 0;\n private _idleStartTimestamp: number = 0;\n private _lastActiveTimestamp: number = 0;\n private _totalIdleTime: number = 0;\n private _idleCount: number = 0;\n private _idleTimeout: number = 5000;\n private _totalTime: number = 0;\n private _idleTime: number = 0;\n\n /** Starts time tracking\n */\n public startTiming(): void {\n this._totalIdleTime = 0;\n this._idleStartTimestamp = 0;\n this._idleCount = 0;\n this._totalTime = 0;\n this._idleTime = 0;\n\n this._firstActiveTimestamp = Date.now();\n this._lastActiveTimestamp = this._firstActiveTimestamp;\n\n InternalConfigurableUiManager.onUiIntervalEvent.addListener(\n this._idleTimeCounter\n );\n InternalConfigurableUiManager.onUiActivityEvent.addListener(\n this._trackActivity\n );\n }\n\n /** Stops time tracking\n */\n public stopTiming(): void {\n InternalConfigurableUiManager.onUiIntervalEvent.removeListener(\n this._idleTimeCounter\n );\n InternalConfigurableUiManager.onUiActivityEvent.removeListener(\n this._trackActivity\n );\n\n this._totalTime = Date.now() - this._firstActiveTimestamp;\n this._idleTime = this._totalIdleTime + this._idleCount * this._idleTimeout;\n }\n\n /** Gets engagement time in seconds\n */\n public getEngagementTimeSeconds(): number {\n return (this._totalTime - this._idleTime) / 1000;\n }\n\n /** Gets total time in seconds\n */\n public getTotalTimeSeconds(): number {\n return this._totalTime / 1000;\n }\n\n /** Gets idle time in seconds\n */\n public getIdleTimeSeconds(): number {\n return this._idleTime / 1000;\n }\n\n private _idleTimeCounter = (args: UiIntervalEventArgs): void => {\n // istanbul ignore next\n const idleTimeout = args.idleTimeout ?? this._idleTimeout;\n // istanbul ignore else\n if (\n this._lastActiveTimestamp > 0 &&\n this._idleStartTimestamp === 0 &&\n Date.now() - this._lastActiveTimestamp >= idleTimeout\n ) {\n this._idleStartTimestamp = Date.now();\n this._idleCount++;\n }\n };\n\n private _trackActivity = (_args: UiActivityEventArgs): void => {\n this._lastActiveTimestamp = Date.now();\n\n if (this._idleStartTimestamp > 0) {\n const lastIdleTime = this._lastActiveTimestamp - this._idleStartTimestamp;\n this._totalIdleTime += lastIdleTime;\n this._idleStartTimestamp = 0;\n }\n };\n}\n"]}
|
|
@@ -31,14 +31,18 @@ export function ContentWrapper(props) {
|
|
|
31
31
|
return controlId;
|
|
32
32
|
};
|
|
33
33
|
// istanbul ignore next
|
|
34
|
-
const [hasMultipleContents, setHasMultipleContents] = React.useState(() =>
|
|
35
|
-
|
|
36
|
-
(activeFrontstageDef
|
|
34
|
+
const [hasMultipleContents, setHasMultipleContents] = React.useState(() => {
|
|
35
|
+
var _a, _b, _c;
|
|
36
|
+
return (activeFrontstageDef &&
|
|
37
|
+
!!((_a = activeFrontstageDef.floatingContentControls) === null || _a === void 0 ? void 0 : _a.length)) ||
|
|
38
|
+
((_c = (_b = activeFrontstageDef === null || activeFrontstageDef === void 0 ? void 0 : activeFrontstageDef.contentGroup) === null || _b === void 0 ? void 0 : _b.getContentControls().length) !== null && _c !== void 0 ? _c : 0) > 1;
|
|
39
|
+
});
|
|
37
40
|
React.useEffect(() => {
|
|
38
41
|
setIsActive(content === UiFramework.content.getActive());
|
|
39
42
|
}, [content]);
|
|
40
43
|
React.useEffect(() => {
|
|
41
44
|
const handleActiveContentChanged = (args) => {
|
|
45
|
+
var _a, _b, _c;
|
|
42
46
|
const contentIsIdentical = content === args.activeContent;
|
|
43
47
|
if (contentIsIdentical)
|
|
44
48
|
setIsActive(contentIsIdentical);
|
|
@@ -49,9 +53,8 @@ export function ContentWrapper(props) {
|
|
|
49
53
|
}
|
|
50
54
|
// istanbul ignore next
|
|
51
55
|
setHasMultipleContents((activeFrontstageDef &&
|
|
52
|
-
!!activeFrontstageDef.floatingContentControls
|
|
53
|
-
(activeFrontstageDef
|
|
54
|
-
0) > 1);
|
|
56
|
+
!!((_a = activeFrontstageDef.floatingContentControls) === null || _a === void 0 ? void 0 : _a.length)) ||
|
|
57
|
+
((_c = (_b = activeFrontstageDef === null || activeFrontstageDef === void 0 ? void 0 : activeFrontstageDef.contentGroup) === null || _b === void 0 ? void 0 : _b.getContentControls().length) !== null && _c !== void 0 ? _c : 0) > 1);
|
|
55
58
|
};
|
|
56
59
|
return UiFramework.content.onActiveContentChangedEvent.addListener(handleActiveContentChanged);
|
|
57
60
|
}, [activeFrontstageDef, content]);
|
|
@@ -61,11 +64,11 @@ export function ContentWrapper(props) {
|
|
|
61
64
|
}, [content]);
|
|
62
65
|
React.useEffect(() => {
|
|
63
66
|
const onAvailableContentChanged = () => {
|
|
67
|
+
var _a, _b, _c;
|
|
64
68
|
// istanbul ignore next
|
|
65
69
|
setHasMultipleContents((activeFrontstageDef &&
|
|
66
|
-
!!activeFrontstageDef.floatingContentControls
|
|
67
|
-
(activeFrontstageDef
|
|
68
|
-
0) > 1);
|
|
70
|
+
!!((_a = activeFrontstageDef.floatingContentControls) === null || _a === void 0 ? void 0 : _a.length)) ||
|
|
71
|
+
((_c = (_b = activeFrontstageDef === null || activeFrontstageDef === void 0 ? void 0 : activeFrontstageDef.contentGroup) === null || _b === void 0 ? void 0 : _b.getContentControls().length) !== null && _c !== void 0 ? _c : 0) > 1);
|
|
69
72
|
};
|
|
70
73
|
return UiFramework.content.onAvailableContentChangedEvent.addListener(onAvailableContentChanged);
|
|
71
74
|
}, [activeFrontstageDef]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentLayout.js","sourceRoot":"","sources":["../../../../src/appui-react/content/ContentLayout.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,8BAA8B;AAE9B,OAAO,sBAAsB,CAAC;AAC9B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAO7C;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,KAA0B;IACvD,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAC1B,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,KAAK,CAAC,QAAQ,CAC5C,OAAO,KAAK,WAAW,CAAC,OAAO,CAAC,SAAS,EAAE,CAC5C,CAAC;IACF,MAAM,mBAAmB,GAAG,sBAAsB,EAAE,CAAC;IAErD,MAAM,iBAAiB,GAAG,CACxB,cAA+B,EAC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AAC,KAAK,CAAC,KAAK,EACvB,GAAG,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,IAAI,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,EAAE,EAAE,EACrE,WAAW,EAAE,IAAI,CAAC,YAAY,EAC9B,SAAS,EAAE,IAAI,CAAC,UAAU,EAC1B,IAAI,EAAC,cAAc,IAElB,IAAI,CAAC,KAAK,CAAC,gBAAgB,CACxB,CACP,CAAC;SACH;QAED,OAAO,IAAI,CAAC;IACd,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 ContentView\n */\n\n// cSpell:ignore contentlayout\n\nimport \"./ContentLayout.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { SplitPane } from \"./split-pane/SplitPane\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { Orientation } from \"@itwin/core-react\";\nimport type { ContentGroup } from \"./ContentGroup\";\nimport type {\n ContentLayoutProps,\n LayoutFragmentProps,\n LayoutHorizontalSplitProps,\n LayoutSplitPropsBase,\n LayoutVerticalSplitProps,\n} from \"@itwin/appui-abstract\";\nimport { UiEvent } from \"@itwin/appui-abstract\";\nimport type { ActiveContentChangedEventArgs } from \"../framework/FrameworkContent\";\nimport { useActiveFrontstageDef } from \"../frontstage/FrontstageDef\";\nimport { UiFramework } from \"../UiFramework\";\n\n/** Properties for [[ContentWrapper]] */\ninterface ContentWrapperProps extends CommonProps {\n content: React.ReactNode;\n}\n\n/** ContentWrapper React component.\n * @internal\n */\nexport function ContentWrapper(props: ContentWrapperProps) {\n const { content } = props;\n const [isActive, setIsActive] = React.useState(\n content === UiFramework.content.getActive()\n );\n const activeFrontstageDef = useActiveFrontstageDef();\n\n const contentControlKey = (\n contentControl: React.ReactNode\n ): string | undefined => {\n let controlId: string | undefined;\n if (contentControl && (contentControl as React.ReactElement<any>).key) {\n const key = (contentControl 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 return controlId;\n };\n\n // istanbul ignore next\n const [hasMultipleContents, setHasMultipleContents] = React.useState(\n () =>\n (activeFrontstageDef &&\n !!activeFrontstageDef.floatingContentControls?.length) ||\n (activeFrontstageDef?.contentGroup?.getContentControls().length ?? 0) > 1\n );\n\n React.useEffect(() => {\n setIsActive(content === UiFramework.content.getActive());\n }, [content]);\n\n React.useEffect(() => {\n const handleActiveContentChanged = (\n args: ActiveContentChangedEventArgs\n ) => {\n const contentIsIdentical = content === args.activeContent;\n if (contentIsIdentical) setIsActive(contentIsIdentical);\n else {\n const contentId = contentControlKey(content);\n const activeContentId = contentControlKey(args.activeContent);\n setIsActive(contentId === activeContentId);\n }\n // istanbul ignore next\n setHasMultipleContents(\n (activeFrontstageDef &&\n !!activeFrontstageDef.floatingContentControls?.length) ||\n (activeFrontstageDef?.contentGroup?.getContentControls().length ??\n 0) > 1\n );\n };\n return UiFramework.content.onActiveContentChangedEvent.addListener(\n handleActiveContentChanged\n );\n }, [activeFrontstageDef, content]);\n\n const handleMouseDown = React.useCallback(() => {\n UiFramework.content.setActive(content);\n setIsActive(true);\n }, [content]);\n\n React.useEffect(() => {\n const onAvailableContentChanged = () => {\n // istanbul ignore next\n setHasMultipleContents(\n (activeFrontstageDef &&\n !!activeFrontstageDef.floatingContentControls?.length) ||\n (activeFrontstageDef?.contentGroup?.getContentControls().length ??\n 0) > 1\n );\n };\n return UiFramework.content.onAvailableContentChangedEvent.addListener(\n onAvailableContentChanged\n );\n }, [activeFrontstageDef]);\n\n const overlayClassName = classnames(\n \"uifw-contentlayout-overlay-div\",\n isActive && hasMultipleContents\n ? \"uifw-contentlayout-overlay-active\"\n : \"uifw-contentlayout-overlay-inactive\"\n );\n\n return (\n <div\n className={classnames(\"uifw-contentlayout-wrapper\", props.className)}\n style={props.style}\n onMouseDown={handleMouseDown}\n onMouseMove={UiFramework.visibility.handleContentMouseMove}\n role=\"presentation\"\n >\n {content}\n <div className={overlayClassName} />\n </div>\n );\n}\n\n/** Properties for the [[SplitContainer]] component */\ninterface SplitContainerProps extends CommonProps {\n contentA: React.ReactNode;\n contentB: React.ReactNode;\n orientation: Orientation;\n percentage: number;\n resizable: boolean;\n minSizeTopLeft: number;\n minSizeBottomRight: number;\n splitterStateId?: string;\n onSplitterChange?: (size: number, percentage: number) => void;\n}\n\n/** Split Container class.\n */\nclass SplitContainer extends React.Component<SplitContainerProps> {\n private _containerDiv: HTMLDivElement | null = null;\n\n constructor(props: SplitContainerProps) {\n super(props);\n }\n\n private _onSplitterChange = (size: number): void => {\n let percentage = 0;\n\n // istanbul ignore else\n if (this._containerDiv && size > 0) {\n if (this.props.orientation === Orientation.Horizontal) {\n const height = this._containerDiv.getBoundingClientRect().height;\n // istanbul ignore if\n if (height > 0) percentage = size / height;\n } else {\n const width = this._containerDiv.getBoundingClientRect().width;\n // istanbul ignore if\n if (width > 0) percentage = size / width;\n }\n\n // istanbul ignore else\n if (this.props.onSplitterChange)\n this.props.onSplitterChange(size, percentage);\n }\n };\n\n public override render(): React.ReactNode {\n const orientation =\n this.props.orientation === Orientation.Horizontal\n ? \"horizontal\"\n : \"vertical\";\n const defaultSize = `${(this.props.percentage * 100).toString()}%`;\n const minSizeTopLeft = this.props.minSizeTopLeft;\n const minSizeBottomRight = -this.props.minSizeBottomRight;\n\n return (\n <div\n ref={(e) => {\n this._containerDiv = e;\n }}\n className={classnames(\n \"uifw-contentlayout-full-size\",\n this.props.className\n )}\n style={this.props.style}\n >\n <SplitPane\n split={orientation}\n minSize={minSizeTopLeft}\n maxSize={minSizeBottomRight}\n defaultSize={defaultSize}\n onChange={this._onSplitterChange}\n allowResize={this.props.resizable}\n >\n {this.props.contentA}\n {this.props.contentB}\n </SplitPane>\n </div>\n );\n }\n}\n\n/** Properties for [[SingleContentContainer]] component\n */\ninterface SingleContentProps extends CommonProps {\n content: React.ReactNode;\n}\n\n/** Single Content Container class.\n */\nclass SingleContentContainer extends React.Component<SingleContentProps> {\n public override render(): React.ReactNode {\n return (\n <div\n className={classnames(\n \"uifw-contentlayout-full-size\",\n this.props.className\n )}\n style={this.props.style}\n data-testid=\"single-content-container\"\n onMouseMove={UiFramework.visibility.handleContentMouseMove}\n >\n <ContentWrapper\n content={this.props.content}\n style={{ height: \"100%\", position: \"relative\" }}\n />\n </div>\n );\n }\n}\n\n/** Common interface for HorizontalSplit and VerticalSplit\n */\ninterface LayoutSplit {\n createContentContainer(\n contentNodes: React.ReactNode[],\n resizable: boolean\n ): React.ReactNode;\n isLocked: boolean;\n}\n\n/** Minimum split size */\nconst MIN_SPLIT_SIZE = 6;\n\n/** Base Split class.\n */\nclass BaseSplit {\n public defaultPercentage: number;\n public stateId: string = \"\";\n public isLocked: boolean = false;\n\n constructor(props: LayoutSplitPropsBase) {\n this.defaultPercentage = props.percentage;\n\n // istanbul ignore else\n if (props.id) this.stateId = props.id;\n\n // istanbul ignore else\n if (props.lock) this.isLocked = props.lock;\n }\n}\n\n/** Horizontal Split class.\n */\nclass HorizontalSplit extends BaseSplit implements LayoutSplit {\n private _topIndex: number = -1;\n private _bottomIndex: number = -1;\n private _topSplit?: LayoutSplit;\n private _bottomSplit?: LayoutSplit;\n private _props: LayoutHorizontalSplitProps;\n private _minSizeTop: number = MIN_SPLIT_SIZE;\n private _minSizeBottom: number = MIN_SPLIT_SIZE;\n\n constructor(props: LayoutHorizontalSplitProps) {\n super(props);\n\n this._props = props;\n\n if (typeof props.top === \"number\") {\n this._topIndex = props.top;\n } else {\n this._topSplit = ContentLayoutDef.createSplit(props.top);\n }\n\n if (typeof props.bottom === \"number\") {\n this._bottomIndex = props.bottom;\n } else {\n this._bottomSplit = ContentLayoutDef.createSplit(props.bottom);\n }\n\n if (props.minSizeTop)\n this._minSizeTop = Math.max(props.minSizeTop, MIN_SPLIT_SIZE);\n\n if (props.minSizeBottom)\n this._minSizeBottom = Math.max(props.minSizeBottom, MIN_SPLIT_SIZE);\n }\n\n private _handleSplitterChange = (_size: number, percentage: number): void => {\n this._props.percentage = percentage;\n };\n\n public createContentContainer(\n contentNodes: React.ReactNode[],\n resizable: boolean\n ): React.ReactNode {\n if (this.isLocked) resizable = false;\n\n const topContent = !this._topSplit ? (\n <ContentWrapper content={contentNodes[this._topIndex]} />\n ) : (\n this._topSplit.createContentContainer(contentNodes, resizable)\n );\n const bottomContent = !this._bottomSplit ? (\n <ContentWrapper content={contentNodes[this._bottomIndex]} />\n ) : (\n this._bottomSplit.createContentContainer(contentNodes, resizable)\n );\n\n return (\n <SplitContainer\n contentA={topContent}\n contentB={bottomContent}\n orientation={Orientation.Horizontal}\n percentage={this.defaultPercentage}\n resizable={resizable}\n minSizeTopLeft={this._minSizeTop}\n minSizeBottomRight={this._minSizeBottom}\n splitterStateId={this.stateId}\n onSplitterChange={this._handleSplitterChange}\n />\n );\n }\n}\n\n/** Vertical Split class.\n */\nclass VerticalSplit extends BaseSplit implements LayoutSplit {\n private _leftIndex: number = -1;\n private _rightIndex: number = -1;\n private _leftSplit?: LayoutSplit;\n private _rightSplit?: LayoutSplit;\n private _props: LayoutVerticalSplitProps;\n private _minSizeLeft: number = MIN_SPLIT_SIZE;\n private _minSizeRight: number = MIN_SPLIT_SIZE;\n\n constructor(props: LayoutVerticalSplitProps) {\n super(props);\n\n this._props = props;\n\n if (typeof props.left === \"number\") {\n this._leftIndex = props.left;\n } else {\n this._leftSplit = ContentLayoutDef.createSplit(props.left);\n }\n\n if (typeof props.right === \"number\") {\n this._rightIndex = props.right;\n } else {\n this._rightSplit = ContentLayoutDef.createSplit(props.right);\n }\n\n if (props.minSizeLeft)\n this._minSizeLeft = Math.max(props.minSizeLeft, MIN_SPLIT_SIZE);\n\n if (props.minSizeRight)\n this._minSizeRight = Math.max(props.minSizeRight, MIN_SPLIT_SIZE);\n }\n\n private _handleSplitterChange = (_size: number, percentage: number): void => {\n this._props.percentage = percentage;\n };\n\n public createContentContainer(\n contentNodes: React.ReactNode[],\n resizable: boolean\n ): React.ReactNode {\n if (this.isLocked) resizable = false;\n\n const leftContent = !this._leftSplit ? (\n <ContentWrapper content={contentNodes[this._leftIndex]} />\n ) : (\n this._leftSplit.createContentContainer(contentNodes, resizable)\n );\n const rightContent = !this._rightSplit ? (\n <ContentWrapper content={contentNodes[this._rightIndex]} />\n ) : (\n this._rightSplit.createContentContainer(contentNodes, resizable)\n );\n\n return (\n <SplitContainer\n contentA={leftContent}\n contentB={rightContent}\n orientation={Orientation.Vertical}\n percentage={this.defaultPercentage}\n resizable={resizable}\n minSizeTopLeft={this._minSizeLeft}\n minSizeBottomRight={this._minSizeRight}\n splitterStateId={this.stateId}\n onSplitterChange={this._handleSplitterChange}\n />\n );\n }\n}\n\n/** Content Layout Definition class.\n * @public\n */\nexport class ContentLayoutDef {\n private _layoutProps: ContentLayoutProps;\n private _rootSplit?: LayoutSplit;\n\n /** ID for this Content Layout */\n public id: string = \"\";\n /** Description of the layout. */\n public description: string = \"\";\n constructor(layoutProps: ContentLayoutProps) {\n this._layoutProps = layoutProps;\n this.id = layoutProps.id;\n if (layoutProps.description !== undefined)\n this.description = layoutProps.description;\n }\n\n public get rootSplit(): LayoutSplit | undefined {\n return this._rootSplit;\n }\n\n /** Creates [[ContentLayoutProps]] for JSON purposes\n * @public\n */\n public toJSON(): ContentLayoutProps {\n return this._layoutProps;\n }\n\n /** Fill a layout container with React nodes for each content view\n */\n public fillLayoutContainer(\n contentNodes: React.ReactNode[],\n resizable: boolean\n ): React.ReactNode | undefined {\n this._rootSplit = ContentLayoutDef.createSplit(this._layoutProps);\n\n if (this.rootSplit) {\n return this.rootSplit.createContentContainer(contentNodes, resizable);\n }\n\n if (contentNodes.length > 0)\n return <SingleContentContainer content={contentNodes[0]} />;\n\n return undefined;\n }\n\n /** Gets the indexes of content views used in this Content Layout\n */\n public getUsedContentIndexes(): number[] {\n let allContentIndexes: number[] = [];\n\n if (!this._layoutProps.horizontalSplit && !this._layoutProps.verticalSplit)\n allContentIndexes.push(0);\n else {\n allContentIndexes = allContentIndexes.concat(\n this.getHorizontalSplitContentIndexes(this._layoutProps.horizontalSplit)\n );\n allContentIndexes = allContentIndexes.concat(\n this.getVerticalSplitContentIndexes(this._layoutProps.verticalSplit)\n );\n }\n\n const uniqueContentIndexes = [...new Set(allContentIndexes)];\n\n return uniqueContentIndexes;\n }\n\n private getHorizontalSplitContentIndexes(\n splitProps?: LayoutHorizontalSplitProps\n ): number[] {\n let contentIndexes: number[] = [];\n\n if (!splitProps) return contentIndexes;\n\n if (typeof splitProps.top === \"number\") contentIndexes.push(splitProps.top);\n else {\n contentIndexes = contentIndexes.concat(\n this.getHorizontalSplitContentIndexes(splitProps.top.horizontalSplit)\n );\n contentIndexes = contentIndexes.concat(\n this.getVerticalSplitContentIndexes(splitProps.top.verticalSplit)\n );\n }\n\n if (typeof splitProps.bottom === \"number\")\n contentIndexes.push(splitProps.bottom);\n else {\n contentIndexes = contentIndexes.concat(\n this.getHorizontalSplitContentIndexes(splitProps.bottom.horizontalSplit)\n );\n contentIndexes = contentIndexes.concat(\n this.getVerticalSplitContentIndexes(splitProps.bottom.verticalSplit)\n );\n }\n\n return contentIndexes;\n }\n\n private getVerticalSplitContentIndexes(\n splitProps?: LayoutVerticalSplitProps\n ): number[] {\n let contentIndexes: number[] = [];\n\n if (!splitProps) return contentIndexes;\n\n if (typeof splitProps.left === \"number\")\n contentIndexes.push(splitProps.left);\n else {\n contentIndexes = contentIndexes.concat(\n this.getHorizontalSplitContentIndexes(splitProps.left.horizontalSplit)\n );\n contentIndexes = contentIndexes.concat(\n this.getVerticalSplitContentIndexes(splitProps.left.verticalSplit)\n );\n }\n\n if (typeof splitProps.right === \"number\")\n contentIndexes.push(splitProps.right);\n else {\n contentIndexes = contentIndexes.concat(\n this.getHorizontalSplitContentIndexes(splitProps.right.horizontalSplit)\n );\n contentIndexes = contentIndexes.concat(\n this.getVerticalSplitContentIndexes(splitProps.right.verticalSplit)\n );\n }\n\n return contentIndexes;\n }\n\n /** @internal */\n public static createSplit(\n fragmentDef: LayoutFragmentProps\n ): LayoutSplit | undefined {\n if (fragmentDef.horizontalSplit) {\n return new HorizontalSplit(fragmentDef.horizontalSplit);\n } else if (fragmentDef.verticalSplit) {\n return new VerticalSplit(fragmentDef.verticalSplit);\n }\n\n return undefined;\n }\n}\n\n/** Content Layout Activated Event Args class.\n * @public\n */\nexport interface ContentLayoutActivatedEventArgs {\n contentLayout: ContentLayoutDef;\n contentGroup: ContentGroup;\n}\n\n/** Content Layout Activated Event class.\n * @public\n */\nexport class ContentLayoutActivatedEvent extends UiEvent<ContentLayoutActivatedEventArgs> {}\n\n/** State for the [[ContentLayout]].\n */\ninterface ContentLayoutState {\n contentLayoutDef: ContentLayoutDef;\n contentContainer?: React.ReactNode;\n contentGroupId?: string;\n}\n\n/** Properties for the [[ContentLayout]] React component.\n * @public\n */\nexport interface ContentLayoutComponentProps extends CommonProps {\n contentLayout: ContentLayoutDef;\n contentGroup: ContentGroup;\n}\n\n/** Content Layout React component.\n * @public\n */\nexport class ContentLayout extends React.Component<\n ContentLayoutComponentProps,\n ContentLayoutState\n> {\n /** @internal */\n public override readonly state: Readonly<ContentLayoutState>;\n\n constructor(props: ContentLayoutComponentProps) {\n super(props);\n\n const contentLayoutDef = this.props.contentLayout;\n const contentGroup = this.props.contentGroup;\n\n const contentNodes = contentGroup.getContentNodes();\n const contentContainer = contentLayoutDef.fillLayoutContainer(\n contentNodes,\n true\n );\n\n this.state = {\n contentLayoutDef: this.props.contentLayout,\n contentContainer,\n contentGroupId: this.props.contentGroup.groupId,\n };\n }\n\n public override componentDidMount() {\n UiFramework.frontstages.onContentLayoutActivatedEvent.addListener(\n this._handleContentLayoutActivated\n );\n }\n\n public override componentWillUnmount() {\n UiFramework.frontstages.onContentLayoutActivatedEvent.removeListener(\n this._handleContentLayoutActivated\n );\n }\n\n private _handleContentLayoutActivated = (\n args: ContentLayoutActivatedEventArgs\n ) => {\n const contentLayoutDef = args.contentLayout;\n const contentGroup = args.contentGroup;\n\n const contentNodes = contentGroup.getContentNodes();\n const contentContainer = contentLayoutDef.fillLayoutContainer(\n contentNodes,\n true\n );\n\n this.setState({\n contentLayoutDef: args.contentLayout,\n contentContainer,\n contentGroupId: contentGroup.groupId,\n });\n };\n\n public override render(): React.ReactNode {\n if (this.state.contentContainer) {\n return (\n <div\n id=\"uifw-contentlayout-div\"\n className={this.props.className}\n style={this.props.style}\n key={`${this.state.contentGroupId}-${this.state.contentLayoutDef.id}`}\n onMouseDown={this._onMouseDown}\n onMouseUp={this._onMouseUp}\n role=\"presentation\"\n >\n {this.state.contentContainer}\n </div>\n );\n }\n\n return null;\n }\n\n private _onMouseDown = (_event: React.MouseEvent<HTMLDivElement>) => {\n UiFramework.content.setMouseDown(true);\n };\n\n private _onMouseUp = (_event: React.MouseEvent<HTMLDivElement>) => {\n UiFramework.content.setMouseDown(false);\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ContentLayout.js","sourceRoot":"","sources":["../../../../src/appui-react/content/ContentLayout.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,8BAA8B;AAE9B,OAAO,sBAAsB,CAAC;AAC9B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAO7C;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,KAA0B;IACvD,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAC1B,MAAM,CAAC,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iB;QAC/B,WAAW,CAAC,WAAW,CAAC,6BAA6B,CAAC,WAAW,CAC/D,IAAI,CAAC,6BAA6B,CACnC,CAAC;IACJ,CAAC;IAEe,oBAAoB;QAClC,WAAW,CAAC,WAAW,CAAC,6BAA6B,CAAC,cAAc,CAClE,IAAI,CAAC,6BAA6B,CACnC,CAAC;IACJ,CAAC;IAqBe,MAAM;QACpB,IAAI,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE;YAC/B,OAAO,CACL,6BACE,EAAE,EAAC,wBAAwB,EAC3B,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAC/B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,GAAG,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,IAAI,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,EAAE,EAAE,EACrE,WAAW,EAAE,IAAI,CAAC,YAAY,EAC9B,SAAS,EAAE,IAAI,CAAC,UAAU,EAC1B,IAAI,EAAC,cAAc,IAElB,IAAI,CAAC,KAAK,CAAC,gBAAgB,CACxB,CACP,CAAC;SACH;QAED,OAAO,IAAI,CAAC;IACd,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 ContentView\n */\n\n// cSpell:ignore contentlayout\n\nimport \"./ContentLayout.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { SplitPane } from \"./split-pane/SplitPane\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { Orientation } from \"@itwin/core-react\";\nimport type { ContentGroup } from \"./ContentGroup\";\nimport type {\n ContentLayoutProps,\n LayoutFragmentProps,\n LayoutHorizontalSplitProps,\n LayoutSplitPropsBase,\n LayoutVerticalSplitProps,\n} from \"@itwin/appui-abstract\";\nimport { UiEvent } from \"@itwin/appui-abstract\";\nimport type { ActiveContentChangedEventArgs } from \"../framework/FrameworkContent\";\nimport { useActiveFrontstageDef } from \"../frontstage/FrontstageDef\";\nimport { UiFramework } from \"../UiFramework\";\n\n/** Properties for [[ContentWrapper]] */\ninterface ContentWrapperProps extends CommonProps {\n content: React.ReactNode;\n}\n\n/** ContentWrapper React component.\n * @internal\n */\nexport function ContentWrapper(props: ContentWrapperProps) {\n const { content } = props;\n const [isActive, setIsActive] = React.useState(\n content === UiFramework.content.getActive()\n );\n const activeFrontstageDef = useActiveFrontstageDef();\n\n const contentControlKey = (\n contentControl: React.ReactNode\n ): string | undefined => {\n let controlId: string | undefined;\n if (contentControl && (contentControl as React.ReactElement<any>).key) {\n const key = (contentControl 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 return controlId;\n };\n\n // istanbul ignore next\n const [hasMultipleContents, setHasMultipleContents] = React.useState(\n () =>\n (activeFrontstageDef &&\n !!activeFrontstageDef.floatingContentControls?.length) ||\n (activeFrontstageDef?.contentGroup?.getContentControls().length ?? 0) > 1\n );\n\n React.useEffect(() => {\n setIsActive(content === UiFramework.content.getActive());\n }, [content]);\n\n React.useEffect(() => {\n const handleActiveContentChanged = (\n args: ActiveContentChangedEventArgs\n ) => {\n const contentIsIdentical = content === args.activeContent;\n if (contentIsIdentical) setIsActive(contentIsIdentical);\n else {\n const contentId = contentControlKey(content);\n const activeContentId = contentControlKey(args.activeContent);\n setIsActive(contentId === activeContentId);\n }\n // istanbul ignore next\n setHasMultipleContents(\n (activeFrontstageDef &&\n !!activeFrontstageDef.floatingContentControls?.length) ||\n (activeFrontstageDef?.contentGroup?.getContentControls().length ??\n 0) > 1\n );\n };\n return UiFramework.content.onActiveContentChangedEvent.addListener(\n handleActiveContentChanged\n );\n }, [activeFrontstageDef, content]);\n\n const handleMouseDown = React.useCallback(() => {\n UiFramework.content.setActive(content);\n setIsActive(true);\n }, [content]);\n\n React.useEffect(() => {\n const onAvailableContentChanged = () => {\n // istanbul ignore next\n setHasMultipleContents(\n (activeFrontstageDef &&\n !!activeFrontstageDef.floatingContentControls?.length) ||\n (activeFrontstageDef?.contentGroup?.getContentControls().length ??\n 0) > 1\n );\n };\n return UiFramework.content.onAvailableContentChangedEvent.addListener(\n onAvailableContentChanged\n );\n }, [activeFrontstageDef]);\n\n const overlayClassName = classnames(\n \"uifw-contentlayout-overlay-div\",\n isActive && hasMultipleContents\n ? \"uifw-contentlayout-overlay-active\"\n : \"uifw-contentlayout-overlay-inactive\"\n );\n\n return (\n <div\n className={classnames(\"uifw-contentlayout-wrapper\", props.className)}\n style={props.style}\n onMouseDown={handleMouseDown}\n onMouseMove={UiFramework.visibility.handleContentMouseMove}\n role=\"presentation\"\n >\n {content}\n <div className={overlayClassName} />\n </div>\n );\n}\n\n/** Properties for the [[SplitContainer]] component */\ninterface SplitContainerProps extends CommonProps {\n contentA: React.ReactNode;\n contentB: React.ReactNode;\n orientation: Orientation;\n percentage: number;\n resizable: boolean;\n minSizeTopLeft: number;\n minSizeBottomRight: number;\n splitterStateId?: string;\n onSplitterChange?: (size: number, percentage: number) => void;\n}\n\n/** Split Container class.\n */\nclass SplitContainer extends React.Component<SplitContainerProps> {\n private _containerDiv: HTMLDivElement | null = null;\n\n constructor(props: SplitContainerProps) {\n super(props);\n }\n\n private _onSplitterChange = (size: number): void => {\n let percentage = 0;\n\n // istanbul ignore else\n if (this._containerDiv && size > 0) {\n if (this.props.orientation === Orientation.Horizontal) {\n const height = this._containerDiv.getBoundingClientRect().height;\n // istanbul ignore if\n if (height > 0) percentage = size / height;\n } else {\n const width = this._containerDiv.getBoundingClientRect().width;\n // istanbul ignore if\n if (width > 0) percentage = size / width;\n }\n\n // istanbul ignore else\n if (this.props.onSplitterChange)\n this.props.onSplitterChange(size, percentage);\n }\n };\n\n public override render(): React.ReactNode {\n const orientation =\n this.props.orientation === Orientation.Horizontal\n ? \"horizontal\"\n : \"vertical\";\n const defaultSize = `${(this.props.percentage * 100).toString()}%`;\n const minSizeTopLeft = this.props.minSizeTopLeft;\n const minSizeBottomRight = -this.props.minSizeBottomRight;\n\n return (\n <div\n ref={(e) => {\n this._containerDiv = e;\n }}\n className={classnames(\n \"uifw-contentlayout-full-size\",\n this.props.className\n )}\n style={this.props.style}\n >\n <SplitPane\n split={orientation}\n minSize={minSizeTopLeft}\n maxSize={minSizeBottomRight}\n defaultSize={defaultSize}\n onChange={this._onSplitterChange}\n allowResize={this.props.resizable}\n >\n {this.props.contentA}\n {this.props.contentB}\n </SplitPane>\n </div>\n );\n }\n}\n\n/** Properties for [[SingleContentContainer]] component\n */\ninterface SingleContentProps extends CommonProps {\n content: React.ReactNode;\n}\n\n/** Single Content Container class.\n */\nclass SingleContentContainer extends React.Component<SingleContentProps> {\n public override render(): React.ReactNode {\n return (\n <div\n className={classnames(\n \"uifw-contentlayout-full-size\",\n this.props.className\n )}\n style={this.props.style}\n data-testid=\"single-content-container\"\n onMouseMove={UiFramework.visibility.handleContentMouseMove}\n >\n <ContentWrapper\n content={this.props.content}\n style={{ height: \"100%\", position: \"relative\" }}\n />\n </div>\n );\n }\n}\n\n/** Common interface for HorizontalSplit and VerticalSplit\n */\ninterface LayoutSplit {\n createContentContainer(\n contentNodes: React.ReactNode[],\n resizable: boolean\n ): React.ReactNode;\n isLocked: boolean;\n}\n\n/** Minimum split size */\nconst MIN_SPLIT_SIZE = 6;\n\n/** Base Split class.\n */\nclass BaseSplit {\n public defaultPercentage: number;\n public stateId: string = \"\";\n public isLocked: boolean = false;\n\n constructor(props: LayoutSplitPropsBase) {\n this.defaultPercentage = props.percentage;\n\n // istanbul ignore else\n if (props.id) this.stateId = props.id;\n\n // istanbul ignore else\n if (props.lock) this.isLocked = props.lock;\n }\n}\n\n/** Horizontal Split class.\n */\nclass HorizontalSplit extends BaseSplit implements LayoutSplit {\n private _topIndex: number = -1;\n private _bottomIndex: number = -1;\n private _topSplit?: LayoutSplit;\n private _bottomSplit?: LayoutSplit;\n private _props: LayoutHorizontalSplitProps;\n private _minSizeTop: number = MIN_SPLIT_SIZE;\n private _minSizeBottom: number = MIN_SPLIT_SIZE;\n\n constructor(props: LayoutHorizontalSplitProps) {\n super(props);\n\n this._props = props;\n\n if (typeof props.top === \"number\") {\n this._topIndex = props.top;\n } else {\n this._topSplit = ContentLayoutDef.createSplit(props.top);\n }\n\n if (typeof props.bottom === \"number\") {\n this._bottomIndex = props.bottom;\n } else {\n this._bottomSplit = ContentLayoutDef.createSplit(props.bottom);\n }\n\n if (props.minSizeTop)\n this._minSizeTop = Math.max(props.minSizeTop, MIN_SPLIT_SIZE);\n\n if (props.minSizeBottom)\n this._minSizeBottom = Math.max(props.minSizeBottom, MIN_SPLIT_SIZE);\n }\n\n private _handleSplitterChange = (_size: number, percentage: number): void => {\n this._props.percentage = percentage;\n };\n\n public createContentContainer(\n contentNodes: React.ReactNode[],\n resizable: boolean\n ): React.ReactNode {\n if (this.isLocked) resizable = false;\n\n const topContent = !this._topSplit ? (\n <ContentWrapper content={contentNodes[this._topIndex]} />\n ) : (\n this._topSplit.createContentContainer(contentNodes, resizable)\n );\n const bottomContent = !this._bottomSplit ? (\n <ContentWrapper content={contentNodes[this._bottomIndex]} />\n ) : (\n this._bottomSplit.createContentContainer(contentNodes, resizable)\n );\n\n return (\n <SplitContainer\n contentA={topContent}\n contentB={bottomContent}\n orientation={Orientation.Horizontal}\n percentage={this.defaultPercentage}\n resizable={resizable}\n minSizeTopLeft={this._minSizeTop}\n minSizeBottomRight={this._minSizeBottom}\n splitterStateId={this.stateId}\n onSplitterChange={this._handleSplitterChange}\n />\n );\n }\n}\n\n/** Vertical Split class.\n */\nclass VerticalSplit extends BaseSplit implements LayoutSplit {\n private _leftIndex: number = -1;\n private _rightIndex: number = -1;\n private _leftSplit?: LayoutSplit;\n private _rightSplit?: LayoutSplit;\n private _props: LayoutVerticalSplitProps;\n private _minSizeLeft: number = MIN_SPLIT_SIZE;\n private _minSizeRight: number = MIN_SPLIT_SIZE;\n\n constructor(props: LayoutVerticalSplitProps) {\n super(props);\n\n this._props = props;\n\n if (typeof props.left === \"number\") {\n this._leftIndex = props.left;\n } else {\n this._leftSplit = ContentLayoutDef.createSplit(props.left);\n }\n\n if (typeof props.right === \"number\") {\n this._rightIndex = props.right;\n } else {\n this._rightSplit = ContentLayoutDef.createSplit(props.right);\n }\n\n if (props.minSizeLeft)\n this._minSizeLeft = Math.max(props.minSizeLeft, MIN_SPLIT_SIZE);\n\n if (props.minSizeRight)\n this._minSizeRight = Math.max(props.minSizeRight, MIN_SPLIT_SIZE);\n }\n\n private _handleSplitterChange = (_size: number, percentage: number): void => {\n this._props.percentage = percentage;\n };\n\n public createContentContainer(\n contentNodes: React.ReactNode[],\n resizable: boolean\n ): React.ReactNode {\n if (this.isLocked) resizable = false;\n\n const leftContent = !this._leftSplit ? (\n <ContentWrapper content={contentNodes[this._leftIndex]} />\n ) : (\n this._leftSplit.createContentContainer(contentNodes, resizable)\n );\n const rightContent = !this._rightSplit ? (\n <ContentWrapper content={contentNodes[this._rightIndex]} />\n ) : (\n this._rightSplit.createContentContainer(contentNodes, resizable)\n );\n\n return (\n <SplitContainer\n contentA={leftContent}\n contentB={rightContent}\n orientation={Orientation.Vertical}\n percentage={this.defaultPercentage}\n resizable={resizable}\n minSizeTopLeft={this._minSizeLeft}\n minSizeBottomRight={this._minSizeRight}\n splitterStateId={this.stateId}\n onSplitterChange={this._handleSplitterChange}\n />\n );\n }\n}\n\n/** Content Layout Definition class.\n * @public\n */\nexport class ContentLayoutDef {\n private _layoutProps: ContentLayoutProps;\n private _rootSplit?: LayoutSplit;\n\n /** ID for this Content Layout */\n public id: string = \"\";\n /** Description of the layout. */\n public description: string = \"\";\n constructor(layoutProps: ContentLayoutProps) {\n this._layoutProps = layoutProps;\n this.id = layoutProps.id;\n if (layoutProps.description !== undefined)\n this.description = layoutProps.description;\n }\n\n public get rootSplit(): LayoutSplit | undefined {\n return this._rootSplit;\n }\n\n /** Creates [[ContentLayoutProps]] for JSON purposes\n * @public\n */\n public toJSON(): ContentLayoutProps {\n return this._layoutProps;\n }\n\n /** Fill a layout container with React nodes for each content view\n */\n public fillLayoutContainer(\n contentNodes: React.ReactNode[],\n resizable: boolean\n ): React.ReactNode | undefined {\n this._rootSplit = ContentLayoutDef.createSplit(this._layoutProps);\n\n if (this.rootSplit) {\n return this.rootSplit.createContentContainer(contentNodes, resizable);\n }\n\n if (contentNodes.length > 0)\n return <SingleContentContainer content={contentNodes[0]} />;\n\n return undefined;\n }\n\n /** Gets the indexes of content views used in this Content Layout\n */\n public getUsedContentIndexes(): number[] {\n let allContentIndexes: number[] = [];\n\n if (!this._layoutProps.horizontalSplit && !this._layoutProps.verticalSplit)\n allContentIndexes.push(0);\n else {\n allContentIndexes = allContentIndexes.concat(\n this.getHorizontalSplitContentIndexes(this._layoutProps.horizontalSplit)\n );\n allContentIndexes = allContentIndexes.concat(\n this.getVerticalSplitContentIndexes(this._layoutProps.verticalSplit)\n );\n }\n\n const uniqueContentIndexes = [...new Set(allContentIndexes)];\n\n return uniqueContentIndexes;\n }\n\n private getHorizontalSplitContentIndexes(\n splitProps?: LayoutHorizontalSplitProps\n ): number[] {\n let contentIndexes: number[] = [];\n\n if (!splitProps) return contentIndexes;\n\n if (typeof splitProps.top === \"number\") contentIndexes.push(splitProps.top);\n else {\n contentIndexes = contentIndexes.concat(\n this.getHorizontalSplitContentIndexes(splitProps.top.horizontalSplit)\n );\n contentIndexes = contentIndexes.concat(\n this.getVerticalSplitContentIndexes(splitProps.top.verticalSplit)\n );\n }\n\n if (typeof splitProps.bottom === \"number\")\n contentIndexes.push(splitProps.bottom);\n else {\n contentIndexes = contentIndexes.concat(\n this.getHorizontalSplitContentIndexes(splitProps.bottom.horizontalSplit)\n );\n contentIndexes = contentIndexes.concat(\n this.getVerticalSplitContentIndexes(splitProps.bottom.verticalSplit)\n );\n }\n\n return contentIndexes;\n }\n\n private getVerticalSplitContentIndexes(\n splitProps?: LayoutVerticalSplitProps\n ): number[] {\n let contentIndexes: number[] = [];\n\n if (!splitProps) return contentIndexes;\n\n if (typeof splitProps.left === \"number\")\n contentIndexes.push(splitProps.left);\n else {\n contentIndexes = contentIndexes.concat(\n this.getHorizontalSplitContentIndexes(splitProps.left.horizontalSplit)\n );\n contentIndexes = contentIndexes.concat(\n this.getVerticalSplitContentIndexes(splitProps.left.verticalSplit)\n );\n }\n\n if (typeof splitProps.right === \"number\")\n contentIndexes.push(splitProps.right);\n else {\n contentIndexes = contentIndexes.concat(\n this.getHorizontalSplitContentIndexes(splitProps.right.horizontalSplit)\n );\n contentIndexes = contentIndexes.concat(\n this.getVerticalSplitContentIndexes(splitProps.right.verticalSplit)\n );\n }\n\n return contentIndexes;\n }\n\n /** @internal */\n public static createSplit(\n fragmentDef: LayoutFragmentProps\n ): LayoutSplit | undefined {\n if (fragmentDef.horizontalSplit) {\n return new HorizontalSplit(fragmentDef.horizontalSplit);\n } else if (fragmentDef.verticalSplit) {\n return new VerticalSplit(fragmentDef.verticalSplit);\n }\n\n return undefined;\n }\n}\n\n/** Content Layout Activated Event Args class.\n * @public\n */\nexport interface ContentLayoutActivatedEventArgs {\n contentLayout: ContentLayoutDef;\n contentGroup: ContentGroup;\n}\n\n/** Content Layout Activated Event class.\n * @public\n */\nexport class ContentLayoutActivatedEvent extends UiEvent<ContentLayoutActivatedEventArgs> {}\n\n/** State for the [[ContentLayout]].\n */\ninterface ContentLayoutState {\n contentLayoutDef: ContentLayoutDef;\n contentContainer?: React.ReactNode;\n contentGroupId?: string;\n}\n\n/** Properties for the [[ContentLayout]] React component.\n * @public\n */\nexport interface ContentLayoutComponentProps extends CommonProps {\n contentLayout: ContentLayoutDef;\n contentGroup: ContentGroup;\n}\n\n/** Content Layout React component.\n * @public\n */\nexport class ContentLayout extends React.Component<\n ContentLayoutComponentProps,\n ContentLayoutState\n> {\n /** @internal */\n public override readonly state: Readonly<ContentLayoutState>;\n\n constructor(props: ContentLayoutComponentProps) {\n super(props);\n\n const contentLayoutDef = this.props.contentLayout;\n const contentGroup = this.props.contentGroup;\n\n const contentNodes = contentGroup.getContentNodes();\n const contentContainer = contentLayoutDef.fillLayoutContainer(\n contentNodes,\n true\n );\n\n this.state = {\n contentLayoutDef: this.props.contentLayout,\n contentContainer,\n contentGroupId: this.props.contentGroup.groupId,\n };\n }\n\n public override componentDidMount() {\n UiFramework.frontstages.onContentLayoutActivatedEvent.addListener(\n this._handleContentLayoutActivated\n );\n }\n\n public override componentWillUnmount() {\n UiFramework.frontstages.onContentLayoutActivatedEvent.removeListener(\n this._handleContentLayoutActivated\n );\n }\n\n private _handleContentLayoutActivated = (\n args: ContentLayoutActivatedEventArgs\n ) => {\n const contentLayoutDef = args.contentLayout;\n const contentGroup = args.contentGroup;\n\n const contentNodes = contentGroup.getContentNodes();\n const contentContainer = contentLayoutDef.fillLayoutContainer(\n contentNodes,\n true\n );\n\n this.setState({\n contentLayoutDef: args.contentLayout,\n contentContainer,\n contentGroupId: contentGroup.groupId,\n });\n };\n\n public override render(): React.ReactNode {\n if (this.state.contentContainer) {\n return (\n <div\n id=\"uifw-contentlayout-div\"\n className={this.props.className}\n style={this.props.style}\n key={`${this.state.contentGroupId}-${this.state.contentLayoutDef.id}`}\n onMouseDown={this._onMouseDown}\n onMouseUp={this._onMouseUp}\n role=\"presentation\"\n >\n {this.state.contentContainer}\n </div>\n );\n }\n\n return null;\n }\n\n private _onMouseDown = (_event: React.MouseEvent<HTMLDivElement>) => {\n UiFramework.content.setMouseDown(true);\n };\n\n private _onMouseUp = (_event: React.MouseEvent<HTMLDivElement>) => {\n UiFramework.content.setMouseDown(false);\n };\n}\n"]}
|
|
@@ -19,6 +19,7 @@ import { useAnalysisAnimationDataProvider } from "../hooks/useAnalysisAnimationD
|
|
|
19
19
|
*/
|
|
20
20
|
// istanbul ignore next
|
|
21
21
|
export function DefaultViewOverlay({ viewport, onPlayPause, featureOptions, }) {
|
|
22
|
+
var _a, _b, _c;
|
|
22
23
|
const solarDataTimelineProvider = useSolarDataProvider(viewport);
|
|
23
24
|
const analysisAnimationTimelineDataProvider = useAnalysisAnimationDataProvider(viewport);
|
|
24
25
|
const scheduleTimelineDataProvider = useScheduleAnimationDataProvider(viewport);
|
|
@@ -27,19 +28,19 @@ export function DefaultViewOverlay({ viewport, onPlayPause, featureOptions, }) {
|
|
|
27
28
|
return null;
|
|
28
29
|
// Solar gets first shot
|
|
29
30
|
if (solarDataTimelineProvider &&
|
|
30
|
-
!!featureOptions
|
|
31
|
+
!!((_a = featureOptions === null || featureOptions === void 0 ? void 0 : featureOptions.defaultViewOverlay) === null || _a === void 0 ? void 0 : _a.enableSolarTimelineViewOverlay)) {
|
|
31
32
|
return (React.createElement("div", { className: "uifw-view-overlay" },
|
|
32
33
|
React.createElement("div", { className: "uifw-animation-overlay" },
|
|
33
34
|
React.createElement(SolarTimeline, { dataProvider: solarDataTimelineProvider }))));
|
|
34
35
|
}
|
|
35
36
|
if (analysisAnimationTimelineDataProvider &&
|
|
36
|
-
!!featureOptions
|
|
37
|
+
!!((_b = featureOptions === null || featureOptions === void 0 ? void 0 : featureOptions.defaultViewOverlay) === null || _b === void 0 ? void 0 : _b.enableAnalysisTimelineViewOverlay)) {
|
|
37
38
|
return (React.createElement("div", { className: "uifw-view-overlay" },
|
|
38
39
|
React.createElement("div", { className: "uifw-animation-overlay" },
|
|
39
40
|
React.createElement(TimelineComponent, { startDate: analysisAnimationTimelineDataProvider.start, endDate: analysisAnimationTimelineDataProvider.end, initialDuration: analysisAnimationTimelineDataProvider.initialDuration, totalDuration: analysisAnimationTimelineDataProvider.duration, minimized: true, onChange: analysisAnimationTimelineDataProvider.onAnimationFractionChanged, onPlayPause: onPlayPause }))));
|
|
40
41
|
}
|
|
41
42
|
if (scheduleTimelineDataProvider &&
|
|
42
|
-
!!featureOptions
|
|
43
|
+
!!((_c = featureOptions === null || featureOptions === void 0 ? void 0 : featureOptions.defaultViewOverlay) === null || _c === void 0 ? void 0 : _c.enableScheduleAnimationViewOverlay)) {
|
|
43
44
|
return (React.createElement("div", { className: "uifw-view-overlay" },
|
|
44
45
|
React.createElement("div", { className: "uifw-animation-overlay" },
|
|
45
46
|
React.createElement(TimelineComponent, { startDate: scheduleTimelineDataProvider.start, endDate: scheduleTimelineDataProvider.end, initialDuration: scheduleTimelineDataProvider.initialDuration, totalDuration: scheduleTimelineDataProvider.duration, minimized: true, onChange: scheduleTimelineDataProvider.onAnimationFractionChanged, onPlayPause: onPlayPause }))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultViewOverlay.js","sourceRoot":"","sources":["../../../../src/appui-react/content/DefaultViewOverlay.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,2BAA2B,CAAC;AACnC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,aAAa,EACb,iBAAiB,GAClB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,gCAAgC,EAAE,MAAM,2CAA2C,CAAC;AAC7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,gCAAgC,EAAE,MAAM,2CAA2C,CAAC;AAW7F;;;;GAIG;AACH,uBAAuB;AACvB,MAAM,UAAU,kBAAkB,CAAC,EACjC,QAAQ,EACR,WAAW,EACX,cAAc,GACG
|
|
1
|
+
{"version":3,"file":"DefaultViewOverlay.js","sourceRoot":"","sources":["../../../../src/appui-react/content/DefaultViewOverlay.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,2BAA2B,CAAC;AACnC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,aAAa,EACb,iBAAiB,GAClB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,gCAAgC,EAAE,MAAM,2CAA2C,CAAC;AAC7F,OAAO,EAAE,i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,qCAAqC,CAAC,0BAA0B,EAElE,WAAW,EAAE,WAAW,GACxB,CACE,CACF,CACP,CAAC;KACH;IAED,IACE,4BAA4B;QAC5B,CAAC,CAAC,CAAA,MAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,kBAAkB,0CAAE,kCAAkC,CAAA,EACxE;QACA,OAAO,CACL,6BAAK,SAAS,EAAC,mBAAmB;YAChC,6BAAK,SAAS,EAAC,wBAAwB;gBACrC,oBAAC,iBAAiB,IAChB,SAAS,EAAE,4BAA4B,CAAC,KAAK,EAC7C,OAAO,EAAE,4BAA4B,CAAC,GAAG,EACzC,eAAe,EAAE,4BAA4B,CAAC,eAAe,EAC7D,aAAa,EAAE,4BAA4B,CAAC,QAAQ,EACpD,SAAS,EAAE,IAAI,EACf,QAAQ,EAAE,4BAA4B,CAAC,0BAA0B,EACjE,WAAW,EAAE,WAAW,GACxB,CACE,CACF,CACP,CAAC;KACH;IAED,OAAO,IAAI,CAAC;AACd,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 \"./DefaultViewOverlay.scss\";\nimport * as React from \"react\";\nimport type { ScreenViewport } from \"@itwin/core-frontend\";\nimport {\n SolarTimeline,\n TimelineComponent,\n} from \"@itwin/imodel-components-react\";\nimport { useScheduleAnimationDataProvider } from \"../hooks/useScheduleAnimationDataProvider\";\nimport { useActiveViewport } from \"../hooks/useActiveViewport\";\nimport { useSolarDataProvider } from \"../hooks/useSolarDataProvider\";\nimport { useAnalysisAnimationDataProvider } from \"../hooks/useAnalysisAnimationDataProvider\";\n\n/** Props of Viewport Overlay Control that show timelines\n * @public\n */\nexport interface ViewOverlayProps {\n viewport: ScreenViewport;\n onPlayPause?: (playing: boolean) => void; // callback with play/pause button is pressed\n featureOptions?: { [key: string]: any };\n}\n\n/**\n * Default viewport overlay that examines ViewState of the active view for a schedule script, analysis data, or solar data. If one of these is detected, the corresponding\n * data provider is attached to the TimelineComponent and the overlay is made visible.\n * @public\n */\n// istanbul ignore next\nexport function DefaultViewOverlay({\n viewport,\n onPlayPause,\n featureOptions,\n}: ViewOverlayProps) {\n const solarDataTimelineProvider = useSolarDataProvider(viewport);\n const analysisAnimationTimelineDataProvider =\n useAnalysisAnimationDataProvider(viewport);\n const scheduleTimelineDataProvider =\n useScheduleAnimationDataProvider(viewport);\n const currentViewport = useActiveViewport();\n\n if (!currentViewport) return null;\n\n // Solar gets first shot\n if (\n solarDataTimelineProvider &&\n !!featureOptions?.defaultViewOverlay?.enableSolarTimelineViewOverlay\n ) {\n return (\n <div className=\"uifw-view-overlay\">\n <div className=\"uifw-animation-overlay\">\n <SolarTimeline dataProvider={solarDataTimelineProvider} />\n </div>\n </div>\n );\n }\n\n if (\n analysisAnimationTimelineDataProvider &&\n !!featureOptions?.defaultViewOverlay?.enableAnalysisTimelineViewOverlay\n ) {\n return (\n <div className=\"uifw-view-overlay\">\n <div className=\"uifw-animation-overlay\">\n <TimelineComponent\n startDate={analysisAnimationTimelineDataProvider.start}\n endDate={analysisAnimationTimelineDataProvider.end}\n initialDuration={\n analysisAnimationTimelineDataProvider.initialDuration\n }\n totalDuration={analysisAnimationTimelineDataProvider.duration}\n minimized={true}\n onChange={\n analysisAnimationTimelineDataProvider.onAnimationFractionChanged\n }\n onPlayPause={onPlayPause}\n />\n </div>\n </div>\n );\n }\n\n if (\n scheduleTimelineDataProvider &&\n !!featureOptions?.defaultViewOverlay?.enableScheduleAnimationViewOverlay\n ) {\n return (\n <div className=\"uifw-view-overlay\">\n <div className=\"uifw-animation-overlay\">\n <TimelineComponent\n startDate={scheduleTimelineDataProvider.start}\n endDate={scheduleTimelineDataProvider.end}\n initialDuration={scheduleTimelineDataProvider.initialDuration}\n totalDuration={scheduleTimelineDataProvider.duration}\n minimized={true}\n onChange={scheduleTimelineDataProvider.onAnimationFractionChanged}\n onPlayPause={onPlayPause}\n />\n </div>\n </div>\n );\n }\n\n return null;\n}\n"]}
|
|
@@ -61,7 +61,8 @@ export function useFloatingViewport(args) {
|
|
|
61
61
|
}, [viewState, viewport, viewportControl]);
|
|
62
62
|
React.useEffect(() => {
|
|
63
63
|
const onViewClose = (vp) => {
|
|
64
|
-
|
|
64
|
+
var _a;
|
|
65
|
+
if (((_a = contentControl.current) === null || _a === void 0 ? void 0 : _a.viewport) === vp) {
|
|
65
66
|
UiFramework.content.dropFloatingContentControl(contentControl.current);
|
|
66
67
|
contentControl.current = undefined;
|
|
67
68
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingViewportContent.js","sourceRoot":"","sources":["../../../../src/appui-react/content/FloatingViewportContent.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAgB5C,YAAY;AACZ,MAAM,UAAU,uBAAuB,CAAC,KAAmC;IACzE,MAAM,EAAE,eAAe,EAAE,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;IACvD,OAAO,CACL,oBAAC,8BAA8B,QAC5B,eAAe,CACe,CAClC,CAAC;AACJ,CAAC;AAOD,aAAa;AACb,MAAM,UAAU,8BAA8B,CAAC,EAC7C,QAAQ,GAC4B;IACpC,OAAO,CACL,6BACE,WAAW,EAAE,WAAW,CAAC,UAAU,CAAC,sBAAsB,EAC1D,S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,EAAE,CAAC,IAAI,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;IAEhD,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE;YAC3B,cAAc,CAAC,OAAO,GAAG,IAAI,8BAA8B,CACzD,SAAS,EACT,SAAS,EACT,IAAI,CACL,CAAC;YACF,WAAW,CAAC,OAAO,CAAC,yBAAyB,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;SACvE;QACD,OAAO,GAAG,EAAE;YACV,IAAI,cAAc,CAAC,OAAO,EAAE;gBAC1B,WAAW,CAAC,OAAO,CAAC,0BAA0B,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;gBACvE,cAAc,CAAC,OAAO,GAAG,SAAS,CAAC;aACpC;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhB,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,QAAQ,IAAI,cAAc,CAAC,OAAO,EAAE;YACtC,cAAc,CAAC,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;YAC3C,IAAI,IAAI,KAAK,cAAc,CAAC,OAAO,CAAC,SAAS,EAAE;gBAC7C,cAAc,CAAC,OAAO,CAAC,SAAS,GAAG,eAAe,CAAC;aACpD;YACD,KAAK,cAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;SAC5D;IACH,CAAC,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,eAAe,CAAC,CAAC,CAAC;IAE3C,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,WAAW,GAAG,CAAC,EAAkB,EAAE,EAAE
|
|
1
|
+
{"version":3,"file":"FloatingViewportContent.js","sourceRoot":"","sources":["../../../../src/appui-react/content/FloatingViewportContent.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;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C,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhB,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,QAAQ,IAAI,cAAc,CAAC,OAAO,EAAE;YACtC,cAAc,CAAC,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;YAC3C,IAAI,IAAI,KAAK,cAAc,CAAC,OAAO,CAAC,SAAS,EAAE;gBAC7C,cAAc,CAAC,OAAO,CAAC,SAAS,GAAG,eAAe,CAAC;aACpD;YACD,KAAK,cAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;SAC5D;IACH,CAAC,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,eAAe,CAAC,CAAC,CAAC;IAE3C,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,WAAW,GAAG,CAAC,EAAkB,EAAE,EAAE;;YACzC,IAAI,CAAA,MAAA,cAAc,CAAC,OAAO,0CAAE,QAAQ,MAAK,EAAE,EAAE;gBAC3C,WAAW,CAAC,OAAO,CAAC,0BAA0B,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;gBACvE,cAAc,CAAC,OAAO,GAAG,SAAS,CAAC;aACpC;QACH,CAAC,CAAC;QACF,OAAO,SAAS,CAAC,WAAW,CAAC,WAAW,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IACpE,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACL,eAAe;KAChB,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 type { ScreenViewport } from \"@itwin/core-frontend\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport type { ViewStateProp } from \"@itwin/imodel-components-react\";\nimport { ViewportComponent } from \"@itwin/imodel-components-react\";\nimport { FloatingViewportContentControl } from \"./ViewportContentControl\";\nimport { ContentWrapper } from \"./ContentLayout\";\nimport { UiFramework } from \"../UiFramework\";\nimport { useRefs } from \"@itwin/core-react\";\n\n/**\n * @beta\n */\nexport interface FloatingViewportContentProps {\n /** callback used to construct context menu when user right-clicks on canvas/viewport */\n onContextMenu?: (e: React.MouseEvent) => boolean;\n /** viewport/content control uniqueId */\n contentId: string;\n /** The initial view state used to create the viewport, or a function that returns it (will refresh when the function changes) */\n initialViewState: ViewStateProp;\n /** Function to get a reference to the ScreenViewport */\n viewportRef?: React.Ref<ScreenViewport>;\n}\n\n/** @beta */\nexport function FloatingViewportContent(props: FloatingViewportContentProps) {\n const { viewportControl } = useFloatingViewport(props);\n return (\n <FloatingViewportContentWrapper>\n {viewportControl}\n </FloatingViewportContentWrapper>\n );\n}\n\n/** @alpha */\nexport interface FloatingViewportContentWrapperProps {\n readonly children?: React.ReactNode;\n}\n\n/** @alpha */\nexport function FloatingViewportContentWrapper({\n children,\n}: FloatingViewportContentWrapperProps) {\n return (\n <div\n onMouseMove={UiFramework.visibility.handleContentMouseMove}\n className=\"uifw-dialog-imodel-content\"\n style={{ height: \"100%\", position: \"relative\" }}\n >\n <ContentWrapper\n content={children}\n style={{ height: \"100%\", position: \"relative\" }}\n />\n </div>\n );\n}\n\n/** @alpha */\nexport function useFloatingViewport(args: FloatingViewportContentProps) {\n const { contentId, initialViewState, onContextMenu, viewportRef } = args;\n const [viewport, setViewport] = React.useState<ScreenViewport | undefined>();\n const contentControl = React.useRef<\n FloatingViewportContentControl | undefined\n >();\n\n const viewState = React.useMemo(\n () =>\n typeof initialViewState === \"function\"\n ? initialViewState()\n : initialViewState,\n [initialViewState]\n );\n const ref = React.useCallback((v: ScreenViewport) => {\n setViewport(v);\n }, []);\n\n const refs = useRefs(ref, viewportRef);\n const viewportControl = React.useMemo(() => {\n const node = (\n <ViewportComponent\n key={contentId}\n imodel={viewState.iModel}\n viewState={viewState}\n controlId={contentId}\n onContextMenu={onContextMenu}\n viewportRef={refs}\n />\n );\n return node;\n }, [refs, onContextMenu, viewState, contentId]);\n\n React.useEffect(() => {\n if (!contentControl.current) {\n contentControl.current = new FloatingViewportContentControl(\n contentId,\n contentId,\n null\n );\n UiFramework.content.addFloatingContentControl(contentControl.current);\n }\n return () => {\n if (contentControl.current) {\n UiFramework.content.dropFloatingContentControl(contentControl.current);\n contentControl.current = undefined;\n }\n };\n }, [contentId]);\n\n React.useEffect(() => {\n if (viewport && contentControl.current) {\n contentControl.current.viewport = viewport;\n if (null === contentControl.current.reactNode) {\n contentControl.current.reactNode = viewportControl;\n }\n void contentControl.current.viewport.changeView(viewState);\n }\n }, [viewState, viewport, viewportControl]);\n\n React.useEffect(() => {\n const onViewClose = (vp: ScreenViewport) => {\n if (contentControl.current?.viewport === vp) {\n UiFramework.content.dropFloatingContentControl(contentControl.current);\n contentControl.current = undefined;\n }\n };\n return IModelApp.viewManager.onViewClose.addListener(onViewClose);\n }, []);\n\n return {\n viewportControl,\n };\n}\n"]}
|
|
@@ -43,6 +43,7 @@ export class IModelViewportControl extends ViewportContentControl {
|
|
|
43
43
|
return "UiFramework.IModelViewportControl";
|
|
44
44
|
}
|
|
45
45
|
constructor(info, _options) {
|
|
46
|
+
var _a;
|
|
46
47
|
super(info, _options);
|
|
47
48
|
this._options = _options;
|
|
48
49
|
this._featureOptions = {};
|
|
@@ -71,7 +72,7 @@ export class IModelViewportControl extends ViewportContentControl {
|
|
|
71
72
|
if (_options.featureOptions)
|
|
72
73
|
this._featureOptions = _options.featureOptions;
|
|
73
74
|
this._alwaysUseSuppliedViewState =
|
|
74
|
-
_options.alwaysUseSuppliedViewState
|
|
75
|
+
(_a = _options.alwaysUseSuppliedViewState) !== null && _a !== void 0 ? _a : false;
|
|
75
76
|
this._userSuppliedViewOverlay = _options.supplyViewOverlay;
|
|
76
77
|
if (!_options.deferNodeInitialization)
|
|
77
78
|
this.initializeReactNode();
|
|
@@ -107,23 +108,25 @@ export class IModelViewportControl extends ViewportContentControl {
|
|
|
107
108
|
/** Get the React component that will contain the Viewport */
|
|
108
109
|
getImodelConnectedViewportReactElement() {
|
|
109
110
|
return (React.createElement(IModelConnectedViewport, { viewportRef: (v) => {
|
|
111
|
+
var _a;
|
|
110
112
|
this.viewport = v;
|
|
111
113
|
// for convenience, if window defined bind viewport to window
|
|
112
114
|
if (undefined !== window)
|
|
113
115
|
window.viewport = v;
|
|
114
116
|
if (!UiFramework.frontstages.isLoading)
|
|
115
|
-
UiFramework.frontstages.activeFrontstageDef
|
|
117
|
+
(_a = UiFramework.frontstages.activeFrontstageDef) === null || _a === void 0 ? void 0 : _a.setActiveViewFromViewport(v);
|
|
116
118
|
}, getViewOverlay: this._getViewOverlay }));
|
|
117
119
|
}
|
|
118
120
|
/** Get the React component that will contain the Viewport */
|
|
119
121
|
getImodelViewportReactElement(iModelConnection, viewState) {
|
|
120
122
|
return (React.createElement(ViewportComponent, { viewState: viewState, imodel: iModelConnection, controlId: this.controlId, viewportRef: (v) => {
|
|
123
|
+
var _a;
|
|
121
124
|
this.viewport = v;
|
|
122
125
|
// for convenience, if window defined bind viewport to window
|
|
123
126
|
if (undefined !== window)
|
|
124
127
|
window.viewport = v;
|
|
125
128
|
if (!UiFramework.frontstages.isLoading)
|
|
126
|
-
UiFramework.frontstages.activeFrontstageDef
|
|
129
|
+
(_a = UiFramework.frontstages.activeFrontstageDef) === null || _a === void 0 ? void 0 : _a.setActiveViewFromViewport(v);
|
|
127
130
|
}, getViewOverlay: this._getViewOverlay }));
|
|
128
131
|
}
|
|
129
132
|
/** Get the React component that will be shown when no iModel data is available */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelViewport.js","sourceRoot":"","sources":["../../../../src/appui-react/content/IModelViewport.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,OAAO,EAAE,iBAAi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oB;QACtC,IAAI,IAAI,CAAC,QAAQ;YAAE,OAAO,KAAK,CAAC,oBAAoB,CAAC;;YAChD,OAAO,oCAAoC,CAAC,eAAe,CAAC;IACnE,CAAC;CACF;AAED,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EAAE,EAAE,qBAAqB,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module ContentView\n */\n\nimport * as React from \"react\";\nimport type { Id64String } from \"@itwin/core-bentley\";\nimport type {\n IModelConnection,\n ScreenViewport,\n ViewState,\n} from \"@itwin/core-frontend\";\nimport type { ViewStateProp } from \"@itwin/imodel-components-react\";\nimport { ViewportComponent } from \"@itwin/imodel-components-react\";\nimport { FillCentered } from \"@itwin/core-react\";\n\nimport type { ConfigurableCreateInfo } from \"../configurableui/ConfigurableUiControl\";\nimport { connectIModelConnectionAndViewState } from \"../redux/connectIModel\";\nimport { UiFramework } from \"../UiFramework\";\nimport { DefaultViewOverlay } from \"./DefaultViewOverlay\";\nimport { ViewportContentControl } from \"./ViewportContentControl\";\nimport { StandardRotationNavigationAidControl } from \"../navigationaids/StandardRotationNavigationAid\";\nimport { UiError } from \"@itwin/appui-abstract\";\nimport { useSelector } from \"react-redux\";\nimport type { FrameworkState } from \"../redux/FrameworkState\";\n\n/** Viewport that is connected to the IModelConnection property in the Redux store. The application must set up the Redux store and include the FrameworkReducer.\n * @public\n */\nexport const IModelConnectedViewport = connectIModelConnectionAndViewState(\n null,\n null\n)(ViewportComponent);\n\n/** [[IModelViewportControl]] options. These options are set in the applicationData property of the [[ContentProps]].\n * @public\n */\nexport interface IModelViewportControlOptions {\n /** ViewState or a function to return a ViewState */\n viewState?: ViewStateProp;\n /** IModelConnection of data in Viewport */\n iModelConnection?: IModelConnection | (() => IModelConnection);\n /** Map of options that can be used to enable/disable features within the view */\n featureOptions?: { [key: string]: any };\n /** Optional background color which may be used if viewState and iModelConnection are undefined */\n bgColor?: string;\n /** Optional property to always use the supplied `viewState` property instead of using viewport.view when set */\n alwaysUseSuppliedViewState?: boolean;\n /** Optional property to supply custom view overlay. Uses when caller want to supply custom overlay component. */\n supplyViewOverlay?: (_viewport: ScreenViewport) => React.ReactNode;\n /** Optional property to defer reactNode initialization until first reactNode property is needed. Useful when subclassing the `IModelViewportControl`. */\n deferNodeInitialization?: boolean;\n}\n\ninterface ViewOverlayHostProps {\n viewport: ScreenViewport;\n featureOptions?: { [key: string]: any };\n userSuppliedOverlay?: (_viewport: ScreenViewport) => React.ReactNode;\n}\n/** View Overlay component -- exported for testing\n * @internal\n */\n// istanbul ignore next\nexport function ViewOverlayHost({\n viewport,\n featureOptions,\n userSuppliedOverlay,\n}: ViewOverlayHostProps) {\n const displayViewOverlay = useSelector((state: FrameworkState) => {\n const frameworkState = (state as any)[UiFramework.frameworkStateKey];\n return frameworkState\n ? frameworkState.configurableUiState.viewOverlayDisplay\n : true;\n });\n if (!displayViewOverlay) return null;\n return userSuppliedOverlay ? (\n <React.Fragment>{userSuppliedOverlay(viewport)}</React.Fragment>\n ) : (\n <DefaultViewOverlay viewport={viewport} featureOptions={featureOptions} />\n );\n}\n/** iModel Viewport Control\n * @public\n */\n// istanbul ignore next\nexport class IModelViewportControl extends ViewportContentControl {\n public static get id() {\n return \"UiFramework.IModelViewportControl\";\n }\n protected _featureOptions: { [key: string]: boolean | string } = {};\n protected _viewState: ViewStateProp | undefined;\n protected _iModelConnection: IModelConnection | undefined;\n protected _alwaysUseSuppliedViewState: boolean;\n private _userSuppliedViewOverlay?: (\n _viewport: ScreenViewport\n ) => React.ReactNode;\n\n constructor(\n info: ConfigurableCreateInfo,\n protected _options: IModelViewportControlOptions\n ) {\n super(info, _options);\n\n if (_options.featureOptions) this._featureOptions = _options.featureOptions;\n this._alwaysUseSuppliedViewState =\n _options.alwaysUseSuppliedViewState ?? false;\n this._userSuppliedViewOverlay = _options.supplyViewOverlay;\n\n if (!_options.deferNodeInitialization) this.initializeReactNode();\n }\n\n protected initializeReactNode() {\n const options = this._options;\n\n if (options.viewState) this._viewState = options.viewState;\n\n const iModelConnection =\n typeof options.iModelConnection === \"function\"\n ? options.iModelConnection()\n : options.iModelConnection;\n\n if (this._viewState && iModelConnection) {\n /** Passing _determineViewState as a function reference; it is not called here. */\n this._reactNode = this.getImodelViewportReactElement(\n iModelConnection,\n this._determineViewState\n );\n } else {\n if (\n UiFramework.getIModelConnection() &&\n UiFramework.getDefaultViewState()\n ) {\n this._reactNode = this.getImodelConnectedViewportReactElement();\n } else {\n this._reactNode = this.getNoContentReactElement(options);\n this.setIsReady();\n }\n }\n }\n\n protected override getReactNode(): React.ReactNode {\n if (\n !React.isValidElement(this._reactNode) &&\n this._options.deferNodeInitialization\n )\n this.initializeReactNode();\n\n return this.getKeyedReactNode();\n }\n\n /**\n * This is passed as a function to the ViewportComponent as the `viewState` prop in getImodelViewportReactElement().\n * It is called by ViewportComponent on a mount to resolve the viewState.\n */\n private _determineViewState = (): ViewState => {\n let viewState: ViewState;\n\n if (this.viewport && !this._alwaysUseSuppliedViewState)\n viewState = this.viewport.view;\n else if (this._viewState) {\n if (typeof this._viewState === \"function\") viewState = this._viewState();\n else viewState = this._viewState;\n } else\n throw new UiError(\n UiFramework.loggerCategory(this),\n \"No ViewState could be determined\"\n );\n\n return viewState!;\n };\n\n /** Get the React component that will contain the Viewport */\n protected getImodelConnectedViewportReactElement(): React.ReactNode {\n return (\n <IModelConnectedViewport\n viewportRef={(v: ScreenViewport) => {\n this.viewport = v;\n // for convenience, if window defined bind viewport to window\n if (undefined !== window) (window as any).viewport = v;\n if (!UiFramework.frontstages.isLoading)\n UiFramework.frontstages.activeFrontstageDef?.setActiveViewFromViewport(\n v\n );\n }}\n getViewOverlay={this._getViewOverlay}\n />\n );\n }\n\n /** Get the React component that will contain the Viewport */\n protected getImodelViewportReactElement(\n iModelConnection: IModelConnection,\n viewState: ViewStateProp\n ): React.ReactNode {\n return (\n <ViewportComponent\n viewState={viewState}\n imodel={iModelConnection}\n controlId={this.controlId}\n viewportRef={(v: ScreenViewport) => {\n this.viewport = v;\n // for convenience, if window defined bind viewport to window\n if (undefined !== window) (window as any).viewport = v;\n if (!UiFramework.frontstages.isLoading)\n UiFramework.frontstages.activeFrontstageDef?.setActiveViewFromViewport(\n v\n );\n }}\n getViewOverlay={this._getViewOverlay}\n />\n );\n }\n\n /** Get the React component that will be shown when no iModel data is available */\n protected getNoContentReactElement(\n _options: IModelViewportControlOptions\n ): React.ReactNode {\n const noContent = UiFramework.translate(\"general.no-content\");\n return <FillCentered> {noContent} </FillCentered>;\n }\n\n /** Get the React.Element for a ViewSelector change. */\n public override getReactElementForViewSelectorChange(\n iModelConnection: IModelConnection,\n _unusedViewDefinitionId: Id64String,\n viewState: ViewState,\n _name: string\n ): React.ReactNode {\n return this.getImodelViewportReactElement(iModelConnection, viewState);\n }\n\n /** Get the default ViewOverlay unless parameter is set to not use it. May be override in an application specific sub-class */\n protected _getViewOverlay = (vp: ScreenViewport): React.ReactNode => {\n return (\n <ViewOverlayHost\n viewport={vp}\n featureOptions={this._featureOptions}\n userSuppliedOverlay={this._userSuppliedViewOverlay}\n data-testid=\"ViewOverlay\"\n />\n );\n };\n\n /** Get the NavigationAidControl associated with this ContentControl */\n public override get navigationAidControl(): string {\n if (this.viewport) return super.navigationAidControl;\n else return StandardRotationNavigationAidControl.navigationAidId;\n }\n}\n\nUiFramework.controls.register(IModelViewportControl.id, IModelViewportControl);\n"]}
|
|
1
|
+
{"version":3,"file":"IModelViewport.js","sourceRoot":"","sources":["../../../../src/appui-react/content/IModelViewport.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,Y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AAC,QAAQ;YAAE,OAAO,KAAK,CAAC,oBAAoB,CAAC;;YAChD,OAAO,oCAAoC,CAAC,eAAe,CAAC;IACnE,CAAC;CACF;AAED,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EAAE,EAAE,qBAAqB,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module ContentView\n */\n\nimport * as React from \"react\";\nimport type { Id64String } from \"@itwin/core-bentley\";\nimport type {\n IModelConnection,\n ScreenViewport,\n ViewState,\n} from \"@itwin/core-frontend\";\nimport type { ViewStateProp } from \"@itwin/imodel-components-react\";\nimport { ViewportComponent } from \"@itwin/imodel-components-react\";\nimport { FillCentered } from \"@itwin/core-react\";\n\nimport type { ConfigurableCreateInfo } from \"../configurableui/ConfigurableUiControl\";\nimport { connectIModelConnectionAndViewState } from \"../redux/connectIModel\";\nimport { UiFramework } from \"../UiFramework\";\nimport { DefaultViewOverlay } from \"./DefaultViewOverlay\";\nimport { ViewportContentControl } from \"./ViewportContentControl\";\nimport { StandardRotationNavigationAidControl } from \"../navigationaids/StandardRotationNavigationAid\";\nimport { UiError } from \"@itwin/appui-abstract\";\nimport { useSelector } from \"react-redux\";\nimport type { FrameworkState } from \"../redux/FrameworkState\";\n\n/** Viewport that is connected to the IModelConnection property in the Redux store. The application must set up the Redux store and include the FrameworkReducer.\n * @public\n */\nexport const IModelConnectedViewport = connectIModelConnectionAndViewState(\n null,\n null\n)(ViewportComponent);\n\n/** [[IModelViewportControl]] options. These options are set in the applicationData property of the [[ContentProps]].\n * @public\n */\nexport interface IModelViewportControlOptions {\n /** ViewState or a function to return a ViewState */\n viewState?: ViewStateProp;\n /** IModelConnection of data in Viewport */\n iModelConnection?: IModelConnection | (() => IModelConnection);\n /** Map of options that can be used to enable/disable features within the view */\n featureOptions?: { [key: string]: any };\n /** Optional background color which may be used if viewState and iModelConnection are undefined */\n bgColor?: string;\n /** Optional property to always use the supplied `viewState` property instead of using viewport.view when set */\n alwaysUseSuppliedViewState?: boolean;\n /** Optional property to supply custom view overlay. Uses when caller want to supply custom overlay component. */\n supplyViewOverlay?: (_viewport: ScreenViewport) => React.ReactNode;\n /** Optional property to defer reactNode initialization until first reactNode property is needed. Useful when subclassing the `IModelViewportControl`. */\n deferNodeInitialization?: boolean;\n}\n\ninterface ViewOverlayHostProps {\n viewport: ScreenViewport;\n featureOptions?: { [key: string]: any };\n userSuppliedOverlay?: (_viewport: ScreenViewport) => React.ReactNode;\n}\n/** View Overlay component -- exported for testing\n * @internal\n */\n// istanbul ignore next\nexport function ViewOverlayHost({\n viewport,\n featureOptions,\n userSuppliedOverlay,\n}: ViewOverlayHostProps) {\n const displayViewOverlay = useSelector((state: FrameworkState) => {\n const frameworkState = (state as any)[UiFramework.frameworkStateKey];\n return frameworkState\n ? frameworkState.configurableUiState.viewOverlayDisplay\n : true;\n });\n if (!displayViewOverlay) return null;\n return userSuppliedOverlay ? (\n <React.Fragment>{userSuppliedOverlay(viewport)}</React.Fragment>\n ) : (\n <DefaultViewOverlay viewport={viewport} featureOptions={featureOptions} />\n );\n}\n/** iModel Viewport Control\n * @public\n */\n// istanbul ignore next\nexport class IModelViewportControl extends ViewportContentControl {\n public static get id() {\n return \"UiFramework.IModelViewportControl\";\n }\n protected _featureOptions: { [key: string]: boolean | string } = {};\n protected _viewState: ViewStateProp | undefined;\n protected _iModelConnection: IModelConnection | undefined;\n protected _alwaysUseSuppliedViewState: boolean;\n private _userSuppliedViewOverlay?: (\n _viewport: ScreenViewport\n ) => React.ReactNode;\n\n constructor(\n info: ConfigurableCreateInfo,\n protected _options: IModelViewportControlOptions\n ) {\n super(info, _options);\n\n if (_options.featureOptions) this._featureOptions = _options.featureOptions;\n this._alwaysUseSuppliedViewState =\n _options.alwaysUseSuppliedViewState ?? false;\n this._userSuppliedViewOverlay = _options.supplyViewOverlay;\n\n if (!_options.deferNodeInitialization) this.initializeReactNode();\n }\n\n protected initializeReactNode() {\n const options = this._options;\n\n if (options.viewState) this._viewState = options.viewState;\n\n const iModelConnection =\n typeof options.iModelConnection === \"function\"\n ? options.iModelConnection()\n : options.iModelConnection;\n\n if (this._viewState && iModelConnection) {\n /** Passing _determineViewState as a function reference; it is not called here. */\n this._reactNode = this.getImodelViewportReactElement(\n iModelConnection,\n this._determineViewState\n );\n } else {\n if (\n UiFramework.getIModelConnection() &&\n UiFramework.getDefaultViewState()\n ) {\n this._reactNode = this.getImodelConnectedViewportReactElement();\n } else {\n this._reactNode = this.getNoContentReactElement(options);\n this.setIsReady();\n }\n }\n }\n\n protected override getReactNode(): React.ReactNode {\n if (\n !React.isValidElement(this._reactNode) &&\n this._options.deferNodeInitialization\n )\n this.initializeReactNode();\n\n return this.getKeyedReactNode();\n }\n\n /**\n * This is passed as a function to the ViewportComponent as the `viewState` prop in getImodelViewportReactElement().\n * It is called by ViewportComponent on a mount to resolve the viewState.\n */\n private _determineViewState = (): ViewState => {\n let viewState: ViewState;\n\n if (this.viewport && !this._alwaysUseSuppliedViewState)\n viewState = this.viewport.view;\n else if (this._viewState) {\n if (typeof this._viewState === \"function\") viewState = this._viewState();\n else viewState = this._viewState;\n } else\n throw new UiError(\n UiFramework.loggerCategory(this),\n \"No ViewState could be determined\"\n );\n\n return viewState!;\n };\n\n /** Get the React component that will contain the Viewport */\n protected getImodelConnectedViewportReactElement(): React.ReactNode {\n return (\n <IModelConnectedViewport\n viewportRef={(v: ScreenViewport) => {\n this.viewport = v;\n // for convenience, if window defined bind viewport to window\n if (undefined !== window) (window as any).viewport = v;\n if (!UiFramework.frontstages.isLoading)\n UiFramework.frontstages.activeFrontstageDef?.setActiveViewFromViewport(\n v\n );\n }}\n getViewOverlay={this._getViewOverlay}\n />\n );\n }\n\n /** Get the React component that will contain the Viewport */\n protected getImodelViewportReactElement(\n iModelConnection: IModelConnection,\n viewState: ViewStateProp\n ): React.ReactNode {\n return (\n <ViewportComponent\n viewState={viewState}\n imodel={iModelConnection}\n controlId={this.controlId}\n viewportRef={(v: ScreenViewport) => {\n this.viewport = v;\n // for convenience, if window defined bind viewport to window\n if (undefined !== window) (window as any).viewport = v;\n if (!UiFramework.frontstages.isLoading)\n UiFramework.frontstages.activeFrontstageDef?.setActiveViewFromViewport(\n v\n );\n }}\n getViewOverlay={this._getViewOverlay}\n />\n );\n }\n\n /** Get the React component that will be shown when no iModel data is available */\n protected getNoContentReactElement(\n _options: IModelViewportControlOptions\n ): React.ReactNode {\n const noContent = UiFramework.translate(\"general.no-content\");\n return <FillCentered> {noContent} </FillCentered>;\n }\n\n /** Get the React.Element for a ViewSelector change. */\n public override getReactElementForViewSelectorChange(\n iModelConnection: IModelConnection,\n _unusedViewDefinitionId: Id64String,\n viewState: ViewState,\n _name: string\n ): React.ReactNode {\n return this.getImodelViewportReactElement(iModelConnection, viewState);\n }\n\n /** Get the default ViewOverlay unless parameter is set to not use it. May be override in an application specific sub-class */\n protected _getViewOverlay = (vp: ScreenViewport): React.ReactNode => {\n return (\n <ViewOverlayHost\n viewport={vp}\n featureOptions={this._featureOptions}\n userSuppliedOverlay={this._userSuppliedViewOverlay}\n data-testid=\"ViewOverlay\"\n />\n );\n };\n\n /** Get the NavigationAidControl associated with this ContentControl */\n public override get navigationAidControl(): string {\n if (this.viewport) return super.navigationAidControl;\n else return StandardRotationNavigationAidControl.navigationAidId;\n }\n}\n\nUiFramework.controls.register(IModelViewportControl.id, IModelViewportControl);\n"]}
|
|
@@ -20,7 +20,8 @@ class InternalContentLayoutManager {
|
|
|
20
20
|
* @returns the [[ContentLayoutDef]] if found, or undefined otherwise
|
|
21
21
|
*/
|
|
22
22
|
static getForGroup(contentGroupProps, overrideContentLayout) {
|
|
23
|
-
|
|
23
|
+
var _a;
|
|
24
|
+
const layoutId = (_a = overrideContentLayout === null || overrideContentLayout === void 0 ? void 0 : overrideContentLayout.id) !== null && _a !== void 0 ? _a : contentGroupProps.layout.id;
|
|
24
25
|
const layoutKey = this.getKey({
|
|
25
26
|
contentGroupId: contentGroupProps.id,
|
|
26
27
|
layoutId,
|