@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
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @module Frontstage
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.useItemsManager = exports.useFrontstageManager = exports.getFrontstageStateSettingName = exports.FRONTSTAGE_SETTINGS_NAMESPACE = exports.useSaveFrontstageSettings = exports.useSavedFrontstageState = exports.
|
|
10
|
+
exports.useItemsManager = exports.useFrontstageManager = exports.getFrontstageStateSettingName = exports.FRONTSTAGE_SETTINGS_NAMESPACE = exports.useSaveFrontstageSettings = exports.useSavedFrontstageState = exports.expandWidget = exports.showWidget = exports.isPanelCollapsed = exports.packNineZoneState = exports.restoreNineZoneState = exports.initializeNineZoneState = exports.stateVersion = exports.initializePanel = exports.isFrontstageStateSettingResult = exports.addPanelWidgets = exports.getPanelSectionWidgets = exports.getWidgetId = exports.addMissingWidgets = exports.appendWidgets = exports.addWidgets = exports.useLabels = exports.ActiveFrontstageDefProvider = exports.WidgetPanelsFrontstage = exports.useNineZoneDispatch = exports.useUpdateNineZoneSize = exports.useLayoutStore = void 0;
|
|
11
11
|
// cSpell:ignore popout
|
|
12
12
|
require("./Frontstage.scss");
|
|
13
13
|
const immer_1 = require("immer");
|
|
@@ -17,6 +17,7 @@ const core_bentley_1 = require("@itwin/core-bentley");
|
|
|
17
17
|
const core_react_1 = require("@itwin/core-react");
|
|
18
18
|
const components_react_1 = require("@itwin/components-react");
|
|
19
19
|
const appui_layout_react_1 = require("@itwin/appui-layout-react");
|
|
20
|
+
const FrontstageDef_1 = require("../frontstage/FrontstageDef");
|
|
20
21
|
const StagePanelDef_1 = require("../stagepanels/StagePanelDef");
|
|
21
22
|
const UiFramework_1 = require("../UiFramework");
|
|
22
23
|
const useUiStateStorage_1 = require("../uistate/useUiStateStorage");
|
|
@@ -53,30 +54,19 @@ const widgetContent = React.createElement(Content_1.WidgetContent, null);
|
|
|
53
54
|
const toolSettingsContent = React.createElement(ToolSettings_1.ToolSettingsContent, null);
|
|
54
55
|
const widgetPanelsFrontstage = React.createElement(WidgetPanelsFrontstageComponent, null);
|
|
55
56
|
/** @internal */
|
|
56
|
-
function useLayoutStore() {
|
|
57
|
-
const
|
|
58
|
-
const [layout, setLayout] = React.useState(() => (0, appui_layout_react_1.createLayoutStore)(def?.nineZoneState));
|
|
59
|
-
React.useEffect(() => {
|
|
60
|
-
return UiFramework_1.UiFramework.frontstages.onFrontstageActivatedEvent.addListener((args) => {
|
|
61
|
-
(0, react_dom_1.unstable_batchedUpdates)(() => {
|
|
62
|
-
setDef(args.activatedFrontstageDef);
|
|
63
|
-
setLayout((0, appui_layout_react_1.createLayoutStore)(args.activatedFrontstageDef.nineZoneState));
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
}, []);
|
|
57
|
+
function useLayoutStore(frontstageDef) {
|
|
58
|
+
const layoutStore = React.useMemo(() => (0, appui_layout_react_1.createLayoutStore)(frontstageDef === null || frontstageDef === void 0 ? void 0 : frontstageDef.nineZoneState), [frontstageDef]);
|
|
67
59
|
React.useEffect(() => {
|
|
68
60
|
return InternalFrontstageManager_1.InternalFrontstageManager.onFrontstageNineZoneStateChangedEvent.addListener((args) => {
|
|
69
|
-
if (args.frontstageDef !==
|
|
70
|
-
def.isStageClosing ||
|
|
71
|
-
def.isApplicationClosing)
|
|
61
|
+
if (args.frontstageDef !== frontstageDef)
|
|
72
62
|
return;
|
|
73
63
|
(0, react_dom_1.unstable_batchedUpdates)(() => {
|
|
74
64
|
// https://github.com/pmndrs/zustand/blob/main/docs/guides/event-handler-in-pre-react-18.md
|
|
75
|
-
|
|
65
|
+
layoutStore.setState(args.state || defaultNineZone);
|
|
76
66
|
});
|
|
77
67
|
});
|
|
78
|
-
}, [
|
|
79
|
-
return
|
|
68
|
+
}, [frontstageDef, layoutStore]);
|
|
69
|
+
return layoutStore;
|
|
80
70
|
}
|
|
81
71
|
exports.useLayoutStore = useLayoutStore;
|
|
82
72
|
/** Update in-memory NineZoneState of newly activated frontstage with up to date size.
|
|
@@ -85,68 +75,32 @@ exports.useLayoutStore = useLayoutStore;
|
|
|
85
75
|
function useUpdateNineZoneSize(frontstageDef) {
|
|
86
76
|
React.useEffect(() => {
|
|
87
77
|
const size = InternalFrontstageManager_1.InternalFrontstageManager.nineZoneSize;
|
|
88
|
-
|
|
78
|
+
const state = frontstageDef.nineZoneState;
|
|
89
79
|
if (!size || !state)
|
|
90
80
|
return;
|
|
91
|
-
|
|
81
|
+
frontstageDef.dispatch({
|
|
92
82
|
type: "RESIZE",
|
|
93
83
|
size: {
|
|
94
84
|
height: size.height,
|
|
95
85
|
width: size.width,
|
|
96
86
|
},
|
|
97
|
-
}
|
|
98
|
-
frontstageDef.nineZoneState = state;
|
|
87
|
+
});
|
|
99
88
|
}, [frontstageDef]);
|
|
100
89
|
}
|
|
101
90
|
exports.useUpdateNineZoneSize = useUpdateNineZoneSize;
|
|
102
91
|
/** @internal */
|
|
103
|
-
function FrameworkStateReducer(state, action, frontstageDef) {
|
|
104
|
-
state = (0, appui_layout_react_1.NineZoneStateReducer)(state, action);
|
|
105
|
-
if (action.type === "RESIZE") {
|
|
106
|
-
state = (0, immer_1.default)(state, (draft) => {
|
|
107
|
-
for (const panelSide of appui_layout_react_1.panelSides) {
|
|
108
|
-
const panel = draft.panels[panelSide];
|
|
109
|
-
const location = toStagePanelLocation(panelSide);
|
|
110
|
-
const panelDef = frontstageDef.getStagePanelDef(location);
|
|
111
|
-
if (panelDef?.maxSizeSpec) {
|
|
112
|
-
panel.maxSize = getPanelMaxSize(panelDef.maxSizeSpec, panelSide, action.size);
|
|
113
|
-
if (panel.size) {
|
|
114
|
-
panel.size = Math.min(Math.max(panel.size, panel.minSize), panel.maxSize);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
return state;
|
|
121
|
-
}
|
|
122
|
-
exports.FrameworkStateReducer = FrameworkStateReducer;
|
|
123
|
-
/** @internal */
|
|
124
92
|
function useNineZoneDispatch(frontstageDef) {
|
|
125
|
-
|
|
126
|
-
if (action.type === "RESIZE") {
|
|
127
|
-
InternalFrontstageManager_1.InternalFrontstageManager.nineZoneSize = core_react_1.Size.create(action.size);
|
|
128
|
-
}
|
|
129
|
-
if (action.type === "WIDGET_TAB_POPOUT") {
|
|
130
|
-
const tabId = action.id;
|
|
131
|
-
frontstageDef.popoutWidget(tabId);
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
const state = frontstageDef.nineZoneState;
|
|
135
|
-
if (!state)
|
|
136
|
-
return;
|
|
137
|
-
frontstageDef.nineZoneState = FrameworkStateReducer(state, action, frontstageDef);
|
|
138
|
-
}, [frontstageDef]);
|
|
139
|
-
return dispatch;
|
|
93
|
+
return React.useMemo(() => frontstageDef.dispatch, [frontstageDef]);
|
|
140
94
|
}
|
|
141
95
|
exports.useNineZoneDispatch = useNineZoneDispatch;
|
|
142
96
|
/** @internal */
|
|
143
97
|
function WidgetPanelsFrontstage() {
|
|
144
|
-
const
|
|
98
|
+
const frontstageDef = (0, FrontstageDef_1.useActiveFrontstageDef)();
|
|
99
|
+
const layout = useLayoutStore(frontstageDef);
|
|
145
100
|
React.useEffect(() => {
|
|
146
101
|
const triggerWidowCloseProcessing = () => {
|
|
147
102
|
frontstageDef && frontstageDef.setIsApplicationClosing(true);
|
|
148
103
|
};
|
|
149
|
-
frontstageDef && frontstageDef.setIsApplicationClosing(false);
|
|
150
104
|
window.addEventListener("unload", triggerWidowCloseProcessing);
|
|
151
105
|
return () => {
|
|
152
106
|
window.removeEventListener("unload", triggerWidowCloseProcessing);
|
|
@@ -207,17 +161,19 @@ function useLabels() {
|
|
|
207
161
|
}
|
|
208
162
|
exports.useLabels = useLabels;
|
|
209
163
|
function toTabArgs(widget) {
|
|
164
|
+
var _a;
|
|
210
165
|
const label = getWidgetLabel(widget.label);
|
|
211
|
-
|
|
212
|
-
allowedPanelTargets: widget.allowedPanelTargets
|
|
166
|
+
const args = {
|
|
167
|
+
allowedPanelTargets: (_a = widget.allowedPanelTargets) === null || _a === void 0 ? void 0 : _a.map((location) => (0, StagePanelDef_1.toPanelSide)(location)),
|
|
213
168
|
hideWithUiWhenFloating: !!widget.hideWithUiWhenFloating,
|
|
214
169
|
canPopout: widget.canPopout,
|
|
215
170
|
iconSpec: widget.iconSpec,
|
|
216
|
-
|
|
171
|
+
isFloatingWidgetResizable: widget.isFloatingStateWindowResizable,
|
|
217
172
|
label,
|
|
218
173
|
preferredFloatingWidgetSize: widget.defaultFloatingSize,
|
|
219
174
|
preferredPanelWidgetSize: widget.preferredPanelSize,
|
|
220
175
|
};
|
|
176
|
+
return args;
|
|
221
177
|
}
|
|
222
178
|
/** @internal */
|
|
223
179
|
function addWidgets(state, widgets, side, widgetId) {
|
|
@@ -232,7 +188,7 @@ function addWidgets(state, widgets, side, widgetId) {
|
|
|
232
188
|
const activeWidget = visibleWidgets.find((widget) => widget.isActive);
|
|
233
189
|
const minimized = false;
|
|
234
190
|
// istanbul ignore else
|
|
235
|
-
if (activeWidget
|
|
191
|
+
if ((activeWidget === null || activeWidget === void 0 ? void 0 : activeWidget.defaultState) !== WidgetState_1.WidgetState.Floating) {
|
|
236
192
|
state = (0, appui_layout_react_1.addPanelWidget)(state, side, widgetId, tabs, {
|
|
237
193
|
activeTabId: activeWidget ? activeWidget.id : tabs[0],
|
|
238
194
|
minimized,
|
|
@@ -266,9 +222,15 @@ function appendWidgets(state, widgetDefs, location, section) {
|
|
|
266
222
|
preferredPanelWidgetSize,
|
|
267
223
|
userSized,
|
|
268
224
|
});
|
|
269
|
-
|
|
225
|
+
const savedTab = state.savedTabs.byId[widgetDef.id];
|
|
226
|
+
if (savedTab) {
|
|
227
|
+
state = (0, appui_layout_react_1.addRemovedTab)(state, widgetDef.id);
|
|
228
|
+
}
|
|
229
|
+
else if (widgetDef.isFloatingStateSupported &&
|
|
270
230
|
widgetDef.defaultState === WidgetState_1.WidgetState.Floating) {
|
|
271
|
-
const floatingContainerId = widgetDef.floatingContainerId
|
|
231
|
+
const floatingContainerId = widgetDef.floatingContainerId
|
|
232
|
+
? widgetDef.floatingContainerId
|
|
233
|
+
: (0, appui_layout_react_1.getUniqueId)();
|
|
272
234
|
const widgetContainerId = getWidgetId(location, section);
|
|
273
235
|
const home = {
|
|
274
236
|
side,
|
|
@@ -286,7 +248,7 @@ function appendWidgets(state, widgetDefs, location, section) {
|
|
|
286
248
|
width: 300,
|
|
287
249
|
...tab.preferredFloatingWidgetSize,
|
|
288
250
|
};
|
|
289
|
-
const preferredPoint = preferredPosition
|
|
251
|
+
const preferredPoint = preferredPosition !== null && preferredPosition !== void 0 ? preferredPosition : {
|
|
290
252
|
x: (state.size.width - size.width) / 2,
|
|
291
253
|
y: (state.size.height - size.height) / 2,
|
|
292
254
|
};
|
|
@@ -297,8 +259,6 @@ function appendWidgets(state, widgetDefs, location, section) {
|
|
|
297
259
|
bounds: containedBounds.toProps(),
|
|
298
260
|
home,
|
|
299
261
|
userSized,
|
|
300
|
-
}, {
|
|
301
|
-
isFloatingStateWindowResizable: widgetDef.isFloatingStateWindowResizable,
|
|
302
262
|
});
|
|
303
263
|
}
|
|
304
264
|
}
|
|
@@ -322,47 +282,45 @@ function appendWidgets(state, widgetDefs, location, section) {
|
|
|
322
282
|
}
|
|
323
283
|
}
|
|
324
284
|
}
|
|
285
|
+
if (widgetDef.defaultState === WidgetState_1.WidgetState.Hidden) {
|
|
286
|
+
state = (0, appui_layout_react_1.NineZoneStateReducer)(state, {
|
|
287
|
+
type: "WIDGET_TAB_HIDE",
|
|
288
|
+
id: widgetDef.id,
|
|
289
|
+
});
|
|
290
|
+
}
|
|
325
291
|
}
|
|
326
292
|
return state;
|
|
327
293
|
}
|
|
328
294
|
exports.appendWidgets = appendWidgets;
|
|
329
|
-
function processPopoutWidgets(
|
|
330
|
-
//
|
|
331
|
-
if (
|
|
332
|
-
return
|
|
333
|
-
// istanbul ignore next - not unit testing electron case that reopens popout windows
|
|
334
|
-
if (initialState.popoutWidgets && core_bentley_1.ProcessDetector.isElectronAppFrontend) {
|
|
335
|
-
if (initialState.popoutWidgets.allIds.length &&
|
|
336
|
-
core_bentley_1.ProcessDetector.isElectronAppFrontend) {
|
|
337
|
-
for (const widgetContainerId of initialState.popoutWidgets.allIds) {
|
|
338
|
-
frontstageDef.openPopoutWidgetContainer(initialState, widgetContainerId);
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
return initialState;
|
|
295
|
+
function processPopoutWidgets(state) {
|
|
296
|
+
// Electron reopens popout windows
|
|
297
|
+
if (core_bentley_1.ProcessDetector.isElectronAppFrontend) {
|
|
298
|
+
return state;
|
|
342
299
|
}
|
|
343
|
-
|
|
300
|
+
for (const popoutWidgetId of state.popoutWidgets.allIds) {
|
|
301
|
+
const widget = state.widgets[popoutWidgetId];
|
|
302
|
+
const id = widget.tabs[0];
|
|
303
|
+
state = (0, appui_layout_react_1.NineZoneStateReducer)(state, {
|
|
304
|
+
type: "WIDGET_TAB_FLOAT",
|
|
305
|
+
id,
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
return state;
|
|
344
309
|
}
|
|
345
310
|
/** Adds frontstageDef widgets that are missing in NineZoneState.
|
|
346
311
|
* @internal
|
|
347
312
|
*/
|
|
348
313
|
function addMissingWidgets(frontstageDef, initialState) {
|
|
314
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
349
315
|
let state = initialState;
|
|
350
|
-
state = appendWidgets(state, determineNewWidgets(frontstageDef.leftPanel
|
|
351
|
-
|
|
352
|
-
state = appendWidgets(state, determineNewWidgets(frontstageDef.
|
|
353
|
-
|
|
354
|
-
state = appendWidgets(state, determineNewWidgets(frontstageDef.
|
|
355
|
-
|
|
356
|
-
state = appendWidgets(state, determineNewWidgets(frontstageDef.
|
|
357
|
-
|
|
358
|
-
state = appendWidgets(state, determineNewWidgets(frontstageDef.topPanel?.getPanelSectionDef(StagePanelSection_1.StagePanelSection.Start)
|
|
359
|
-
.widgetDefs, state), StagePanelLocation_1.StagePanelLocation.Top, StagePanelSection_1.StagePanelSection.Start);
|
|
360
|
-
state = appendWidgets(state, determineNewWidgets(frontstageDef.topPanel?.getPanelSectionDef(StagePanelSection_1.StagePanelSection.End)
|
|
361
|
-
.widgetDefs, state), StagePanelLocation_1.StagePanelLocation.Top, StagePanelSection_1.StagePanelSection.End);
|
|
362
|
-
state = appendWidgets(state, determineNewWidgets(frontstageDef.bottomPanel?.getPanelSectionDef(StagePanelSection_1.StagePanelSection.Start)
|
|
363
|
-
.widgetDefs, state), StagePanelLocation_1.StagePanelLocation.Bottom, StagePanelSection_1.StagePanelSection.Start);
|
|
364
|
-
state = appendWidgets(state, determineNewWidgets(frontstageDef.bottomPanel?.getPanelSectionDef(StagePanelSection_1.StagePanelSection.End)
|
|
365
|
-
.widgetDefs, state), StagePanelLocation_1.StagePanelLocation.Bottom, StagePanelSection_1.StagePanelSection.End);
|
|
316
|
+
state = appendWidgets(state, determineNewWidgets((_a = frontstageDef.leftPanel) === null || _a === void 0 ? void 0 : _a.getPanelSectionDef(StagePanelSection_1.StagePanelSection.Start).widgetDefs, state), StagePanelLocation_1.StagePanelLocation.Left, StagePanelSection_1.StagePanelSection.Start);
|
|
317
|
+
state = appendWidgets(state, determineNewWidgets((_b = frontstageDef.leftPanel) === null || _b === void 0 ? void 0 : _b.getPanelSectionDef(StagePanelSection_1.StagePanelSection.End).widgetDefs, state), StagePanelLocation_1.StagePanelLocation.Left, StagePanelSection_1.StagePanelSection.End);
|
|
318
|
+
state = appendWidgets(state, determineNewWidgets((_c = frontstageDef.rightPanel) === null || _c === void 0 ? void 0 : _c.getPanelSectionDef(StagePanelSection_1.StagePanelSection.Start).widgetDefs, state), StagePanelLocation_1.StagePanelLocation.Right, StagePanelSection_1.StagePanelSection.Start);
|
|
319
|
+
state = appendWidgets(state, determineNewWidgets((_d = frontstageDef.rightPanel) === null || _d === void 0 ? void 0 : _d.getPanelSectionDef(StagePanelSection_1.StagePanelSection.End).widgetDefs, state), StagePanelLocation_1.StagePanelLocation.Right, StagePanelSection_1.StagePanelSection.End);
|
|
320
|
+
state = appendWidgets(state, determineNewWidgets((_e = frontstageDef.topPanel) === null || _e === void 0 ? void 0 : _e.getPanelSectionDef(StagePanelSection_1.StagePanelSection.Start).widgetDefs, state), StagePanelLocation_1.StagePanelLocation.Top, StagePanelSection_1.StagePanelSection.Start);
|
|
321
|
+
state = appendWidgets(state, determineNewWidgets((_f = frontstageDef.topPanel) === null || _f === void 0 ? void 0 : _f.getPanelSectionDef(StagePanelSection_1.StagePanelSection.End).widgetDefs, state), StagePanelLocation_1.StagePanelLocation.Top, StagePanelSection_1.StagePanelSection.End);
|
|
322
|
+
state = appendWidgets(state, determineNewWidgets((_g = frontstageDef.bottomPanel) === null || _g === void 0 ? void 0 : _g.getPanelSectionDef(StagePanelSection_1.StagePanelSection.Start).widgetDefs, state), StagePanelLocation_1.StagePanelLocation.Bottom, StagePanelSection_1.StagePanelSection.Start);
|
|
323
|
+
state = appendWidgets(state, determineNewWidgets((_h = frontstageDef.bottomPanel) === null || _h === void 0 ? void 0 : _h.getPanelSectionDef(StagePanelSection_1.StagePanelSection.End).widgetDefs, state), StagePanelLocation_1.StagePanelLocation.Bottom, StagePanelSection_1.StagePanelSection.End);
|
|
366
324
|
if (frontstageDef.toolSettings) {
|
|
367
325
|
const newToolSettingsWidgets = determineNewWidgets([frontstageDef.toolSettings], state);
|
|
368
326
|
for (const newToolSettingsWidget of newToolSettingsWidgets) {
|
|
@@ -380,7 +338,10 @@ function hideWidgets(state, frontstageDef) {
|
|
|
380
338
|
if (!widgetDef)
|
|
381
339
|
continue;
|
|
382
340
|
if (widgetDef.defaultState === WidgetState_1.WidgetState.Hidden) {
|
|
383
|
-
state =
|
|
341
|
+
state = (0, appui_layout_react_1.NineZoneStateReducer)(state, {
|
|
342
|
+
type: "WIDGET_TAB_HIDE",
|
|
343
|
+
id: widgetDef.id,
|
|
344
|
+
});
|
|
384
345
|
}
|
|
385
346
|
}
|
|
386
347
|
return state;
|
|
@@ -389,33 +350,25 @@ function hideWidgets(state, frontstageDef) {
|
|
|
389
350
|
* @internal
|
|
390
351
|
*/
|
|
391
352
|
function removeMissingWidgets(frontstageDef, state) {
|
|
392
|
-
|
|
353
|
+
var _a;
|
|
354
|
+
const toolSettingsTabId = (_a = state.toolSettings) === null || _a === void 0 ? void 0 : _a.tabId;
|
|
393
355
|
for (const [, tab] of Object.entries(state.tabs)) {
|
|
394
356
|
if (tab.id === toolSettingsTabId)
|
|
395
357
|
continue;
|
|
396
358
|
const widgetDef = frontstageDef.findWidgetDef(tab.id);
|
|
397
359
|
if (widgetDef)
|
|
398
360
|
continue;
|
|
361
|
+
state = (0, appui_layout_react_1.NineZoneStateReducer)(state, {
|
|
362
|
+
type: "WIDGET_TAB_HIDE",
|
|
363
|
+
id: tab.id,
|
|
364
|
+
});
|
|
399
365
|
state = (0, appui_layout_react_1.removeTab)(state, tab.id);
|
|
400
366
|
}
|
|
401
367
|
return state;
|
|
402
368
|
}
|
|
403
|
-
exports.removeMissingWidgets = removeMissingWidgets;
|
|
404
369
|
function getWidgetLabel(label) {
|
|
405
370
|
return label === "" ? "Widget" : label;
|
|
406
371
|
}
|
|
407
|
-
function toStagePanelLocation(side) {
|
|
408
|
-
switch (side) {
|
|
409
|
-
case "bottom":
|
|
410
|
-
return StagePanelLocation_1.StagePanelLocation.Bottom;
|
|
411
|
-
case "left":
|
|
412
|
-
return StagePanelLocation_1.StagePanelLocation.Left;
|
|
413
|
-
case "right":
|
|
414
|
-
return StagePanelLocation_1.StagePanelLocation.Right;
|
|
415
|
-
case "top":
|
|
416
|
-
return StagePanelLocation_1.StagePanelLocation.Top;
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
372
|
/** @internal */
|
|
420
373
|
function getWidgetId(location, section) {
|
|
421
374
|
switch (location) {
|
|
@@ -445,8 +398,8 @@ exports.getWidgetId = getWidgetId;
|
|
|
445
398
|
/** @internal */
|
|
446
399
|
function getPanelSectionWidgets(frontstageDef, location, section) {
|
|
447
400
|
const stagePanel = frontstageDef.getStagePanelDef(location);
|
|
448
|
-
const panelSection = stagePanel
|
|
449
|
-
return panelSection
|
|
401
|
+
const panelSection = stagePanel === null || stagePanel === void 0 ? void 0 : stagePanel.getPanelSectionDef(section);
|
|
402
|
+
return (panelSection === null || panelSection === void 0 ? void 0 : panelSection.widgetDefs) || [];
|
|
450
403
|
}
|
|
451
404
|
exports.getPanelSectionWidgets = getPanelSectionWidgets;
|
|
452
405
|
/** @internal */
|
|
@@ -470,37 +423,29 @@ function isFrontstageStateSettingResult(settingsResult) {
|
|
|
470
423
|
exports.isFrontstageStateSettingResult = isFrontstageStateSettingResult;
|
|
471
424
|
/** @internal */
|
|
472
425
|
function initializePanel(state, frontstageDef, location) {
|
|
473
|
-
const
|
|
426
|
+
const side = (0, StagePanelDef_1.toPanelSide)(location);
|
|
474
427
|
state = addPanelWidgets(state, frontstageDef, location);
|
|
475
428
|
const panelDef = frontstageDef.getStagePanelDef(location);
|
|
476
429
|
state = (0, immer_1.default)(state, (draft) => {
|
|
477
|
-
|
|
478
|
-
panel
|
|
479
|
-
panel.
|
|
480
|
-
panel.
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
}
|
|
484
|
-
const size = panelDef?.size;
|
|
485
|
-
panel.size =
|
|
486
|
-
size === undefined
|
|
487
|
-
? size
|
|
488
|
-
: Math.min(Math.max(size, panel.minSize), panel.maxSize);
|
|
430
|
+
var _a, _b, _c, _d, _e, _f;
|
|
431
|
+
const panel = draft.panels[side];
|
|
432
|
+
panel.minSize = (_b = (_a = panelDef === null || panelDef === void 0 ? void 0 : panelDef.initialConfig) === null || _a === void 0 ? void 0 : _a.minSize) !== null && _b !== void 0 ? _b : panel.minSize;
|
|
433
|
+
panel.pinned = (_c = panelDef === null || panelDef === void 0 ? void 0 : panelDef.pinned) !== null && _c !== void 0 ? _c : panel.pinned;
|
|
434
|
+
panel.resizable = (_d = panelDef === null || panelDef === void 0 ? void 0 : panelDef.resizable) !== null && _d !== void 0 ? _d : panel.resizable;
|
|
435
|
+
panel.maxSize = (_f = (_e = panelDef === null || panelDef === void 0 ? void 0 : panelDef.initialConfig) === null || _e === void 0 ? void 0 : _e.maxSize) !== null && _f !== void 0 ? _f : panel.maxSize;
|
|
489
436
|
});
|
|
437
|
+
if ((panelDef === null || panelDef === void 0 ? void 0 : panelDef.size) !== undefined) {
|
|
438
|
+
state = (0, appui_layout_react_1.NineZoneStateReducer)(state, {
|
|
439
|
+
type: "PANEL_SET_SIZE",
|
|
440
|
+
side,
|
|
441
|
+
size: panelDef.size,
|
|
442
|
+
});
|
|
443
|
+
}
|
|
490
444
|
return state;
|
|
491
445
|
}
|
|
492
446
|
exports.initializePanel = initializePanel;
|
|
493
|
-
function getPanelMaxSize(maxSizeSpec, panel, nineZoneSize) {
|
|
494
|
-
if (typeof maxSizeSpec === "number") {
|
|
495
|
-
return maxSizeSpec;
|
|
496
|
-
}
|
|
497
|
-
const size = (0, appui_layout_react_1.isHorizontalPanelSide)(panel)
|
|
498
|
-
? nineZoneSize.height
|
|
499
|
-
: nineZoneSize.width;
|
|
500
|
-
return (maxSizeSpec.percentage / 100) * size;
|
|
501
|
-
}
|
|
502
447
|
/** @internal */
|
|
503
|
-
exports.stateVersion =
|
|
448
|
+
exports.stateVersion = 16; // this needs to be bumped when NineZoneState is changed (to recreate the layout).
|
|
504
449
|
/** @internal */
|
|
505
450
|
function initializeNineZoneState(frontstageDef) {
|
|
506
451
|
let nineZone = defaultNineZone;
|
|
@@ -518,6 +463,7 @@ function initializeNineZoneState(frontstageDef) {
|
|
|
518
463
|
nineZone = initializePanel(nineZone, frontstageDef, StagePanelLocation_1.StagePanelLocation.Top);
|
|
519
464
|
nineZone = initializePanel(nineZone, frontstageDef, StagePanelLocation_1.StagePanelLocation.Bottom);
|
|
520
465
|
nineZone = (0, immer_1.default)(nineZone, (draft) => {
|
|
466
|
+
var _a, _b, _c, _d;
|
|
521
467
|
for (const [, panel] of Object.entries(draft.panels)) {
|
|
522
468
|
const expanded = panel.widgets.find((widgetId) => draft.widgets[widgetId].minimized === false);
|
|
523
469
|
const firstWidget = panel.widgets.length > 0 ? draft.widgets[panel.widgets[0]] : undefined;
|
|
@@ -526,10 +472,10 @@ function initializeNineZoneState(frontstageDef) {
|
|
|
526
472
|
firstWidget.minimized = false;
|
|
527
473
|
}
|
|
528
474
|
}
|
|
529
|
-
draft.panels.left.collapsed = isPanelCollapsed(frontstageDef.leftPanel
|
|
530
|
-
draft.panels.right.collapsed = isPanelCollapsed(frontstageDef.rightPanel
|
|
531
|
-
draft.panels.top.collapsed = isPanelCollapsed(frontstageDef.topPanel
|
|
532
|
-
draft.panels.bottom.collapsed = isPanelCollapsed(frontstageDef.bottomPanel
|
|
475
|
+
draft.panels.left.collapsed = isPanelCollapsed((_a = frontstageDef.leftPanel) === null || _a === void 0 ? void 0 : _a.panelState);
|
|
476
|
+
draft.panels.right.collapsed = isPanelCollapsed((_b = frontstageDef.rightPanel) === null || _b === void 0 ? void 0 : _b.panelState);
|
|
477
|
+
draft.panels.top.collapsed = isPanelCollapsed((_c = frontstageDef.topPanel) === null || _c === void 0 ? void 0 : _c.panelState);
|
|
478
|
+
draft.panels.bottom.collapsed = isPanelCollapsed((_d = frontstageDef.bottomPanel) === null || _d === void 0 ? void 0 : _d.panelState);
|
|
533
479
|
});
|
|
534
480
|
nineZone = addMissingWidgets(frontstageDef, nineZone);
|
|
535
481
|
const toolSettingsWidgetDef = frontstageDef.toolSettings;
|
|
@@ -538,7 +484,7 @@ function initializeNineZoneState(frontstageDef) {
|
|
|
538
484
|
nineZone = (0, appui_layout_react_1.addDockedToolSettings)(nineZone, toolSettingsTabId);
|
|
539
485
|
}
|
|
540
486
|
nineZone = hideWidgets(nineZone, frontstageDef);
|
|
541
|
-
nineZone = processPopoutWidgets(nineZone
|
|
487
|
+
nineZone = processPopoutWidgets(nineZone);
|
|
542
488
|
return nineZone;
|
|
543
489
|
}
|
|
544
490
|
exports.initializeNineZoneState = initializeNineZoneState;
|
|
@@ -548,23 +494,23 @@ exports.initializeNineZoneState = initializeNineZoneState;
|
|
|
548
494
|
* @internal
|
|
549
495
|
*/
|
|
550
496
|
function restoreNineZoneState(frontstageDef, saved) {
|
|
551
|
-
let
|
|
497
|
+
let state = {
|
|
552
498
|
...saved,
|
|
553
499
|
tabs: {},
|
|
554
500
|
};
|
|
555
501
|
for (const [, tab] of Object.entries(saved.tabs)) {
|
|
556
502
|
// Re-add the placeholder tab in order to correctly remove it from the state if WidgetDef is not found.
|
|
557
|
-
|
|
503
|
+
state = (0, appui_layout_react_1.addTab)(state, tab.id);
|
|
558
504
|
const widgetDef = frontstageDef.findWidgetDef(tab.id);
|
|
559
505
|
if (!widgetDef) {
|
|
560
506
|
core_bentley_1.Logger.logInfo(UiFramework_1.UiFramework.loggerCategory(restoreNineZoneState), "WidgetDef is not found for saved tab.", () => ({
|
|
561
507
|
frontstageId: frontstageDef.id,
|
|
562
508
|
tabId: tab.id,
|
|
563
509
|
}));
|
|
564
|
-
|
|
510
|
+
state = (0, appui_layout_react_1.removeTab)(state, tab.id);
|
|
565
511
|
continue;
|
|
566
512
|
}
|
|
567
|
-
|
|
513
|
+
state = (0, immer_1.default)(state, (draft) => {
|
|
568
514
|
draft.tabs[tab.id] = {
|
|
569
515
|
...tab,
|
|
570
516
|
...toTabArgs(widgetDef),
|
|
@@ -573,7 +519,7 @@ function restoreNineZoneState(frontstageDef, saved) {
|
|
|
573
519
|
};
|
|
574
520
|
});
|
|
575
521
|
}
|
|
576
|
-
|
|
522
|
+
state = (0, immer_1.default)(state, (draft) => {
|
|
577
523
|
// remove center panel section if one is found in left or right panels
|
|
578
524
|
const oldLeftMiddleIndex = saved.panels.left.widgets.findIndex((value) => value === "leftMiddle");
|
|
579
525
|
// istanbul ignore next
|
|
@@ -604,15 +550,18 @@ function restoreNineZoneState(frontstageDef, saved) {
|
|
|
604
550
|
if (InternalFrontstageManager_1.InternalFrontstageManager.nineZoneSize &&
|
|
605
551
|
(0 !== InternalFrontstageManager_1.InternalFrontstageManager.nineZoneSize.height ||
|
|
606
552
|
0 !== InternalFrontstageManager_1.InternalFrontstageManager.nineZoneSize.width)) {
|
|
607
|
-
|
|
553
|
+
state = (0, appui_layout_react_1.NineZoneStateReducer)(state, {
|
|
608
554
|
type: "RESIZE",
|
|
609
555
|
size: {
|
|
610
556
|
height: InternalFrontstageManager_1.InternalFrontstageManager.nineZoneSize.height,
|
|
611
557
|
width: InternalFrontstageManager_1.InternalFrontstageManager.nineZoneSize.width,
|
|
612
558
|
},
|
|
613
|
-
}
|
|
559
|
+
});
|
|
614
560
|
}
|
|
615
|
-
|
|
561
|
+
state = addMissingWidgets(frontstageDef, state);
|
|
562
|
+
state = hideWidgets(state, frontstageDef);
|
|
563
|
+
state = processPopoutWidgets(state);
|
|
564
|
+
return state;
|
|
616
565
|
}
|
|
617
566
|
exports.restoreNineZoneState = restoreNineZoneState;
|
|
618
567
|
/** Prepares NineZoneState to be saved.
|
|
@@ -637,222 +586,11 @@ function packNineZoneState(state) {
|
|
|
637
586
|
return packed;
|
|
638
587
|
}
|
|
639
588
|
exports.packNineZoneState = packNineZoneState;
|
|
640
|
-
// istanbul ignore next
|
|
641
|
-
function packSavedWidgets(frontstageDef) {
|
|
642
|
-
let savedWidgets = [];
|
|
643
|
-
for (const widgetDef of frontstageDef.widgetDefs) {
|
|
644
|
-
const id = widgetDef.id;
|
|
645
|
-
const initialWidget = {
|
|
646
|
-
id,
|
|
647
|
-
};
|
|
648
|
-
const widget = (0, immer_1.default)(initialWidget, (draft) => {
|
|
649
|
-
if (widgetDef.tabLocation) {
|
|
650
|
-
draft.tabLocation = { ...widgetDef.tabLocation };
|
|
651
|
-
}
|
|
652
|
-
if (widgetDef.popoutBounds) {
|
|
653
|
-
draft.popoutBounds = widgetDef.popoutBounds.toProps();
|
|
654
|
-
}
|
|
655
|
-
});
|
|
656
|
-
if (widget === initialWidget)
|
|
657
|
-
continue;
|
|
658
|
-
savedWidgets.push(widget);
|
|
659
|
-
}
|
|
660
|
-
// Add previously saved widgets.
|
|
661
|
-
const prevSavedWidgets = frontstageDef.savedWidgetDefs || [];
|
|
662
|
-
for (const prevWidget of prevSavedWidgets) {
|
|
663
|
-
if (savedWidgets.find((w) => w.id === prevWidget.id))
|
|
664
|
-
continue;
|
|
665
|
-
savedWidgets.push(prevWidget);
|
|
666
|
-
}
|
|
667
|
-
// Limit number of saved widgets.
|
|
668
|
-
const maxWidgets = 100;
|
|
669
|
-
if (savedWidgets.length > maxWidgets)
|
|
670
|
-
savedWidgets = savedWidgets.slice(0, maxWidgets);
|
|
671
|
-
return savedWidgets;
|
|
672
|
-
}
|
|
673
|
-
// istanbul ignore next
|
|
674
|
-
function restoreSavedWidgets(frontstage) {
|
|
675
|
-
const savedWidgets = frontstage.savedWidgetDefs || [];
|
|
676
|
-
for (const savedWidget of savedWidgets) {
|
|
677
|
-
const widgetId = savedWidget.id;
|
|
678
|
-
const widgetDef = frontstage.findWidgetDef(widgetId);
|
|
679
|
-
if (!widgetDef)
|
|
680
|
-
continue;
|
|
681
|
-
if (savedWidget.tabLocation) {
|
|
682
|
-
widgetDef.tabLocation = { ...savedWidget.tabLocation };
|
|
683
|
-
}
|
|
684
|
-
if (savedWidget.popoutBounds) {
|
|
685
|
-
widgetDef.popoutBounds = core_react_1.Rectangle.create(savedWidget.popoutBounds);
|
|
686
|
-
}
|
|
687
|
-
}
|
|
688
|
-
}
|
|
689
589
|
/** @internal */
|
|
690
590
|
function isPanelCollapsed(panelState) {
|
|
691
591
|
return panelState !== StagePanelDef_1.StagePanelState.Open;
|
|
692
592
|
}
|
|
693
593
|
exports.isPanelCollapsed = isPanelCollapsed;
|
|
694
|
-
function addHiddenWidget(state, widgetDef) {
|
|
695
|
-
const tabLocation = widgetDef.tabLocation || widgetDef.defaultTabLocation;
|
|
696
|
-
const tabId = widgetDef.id;
|
|
697
|
-
const { widgetId, tabIndex } = tabLocation;
|
|
698
|
-
if (widgetId in state.widgets) {
|
|
699
|
-
// Add to an existing widget (by widget id).
|
|
700
|
-
return (0, appui_layout_react_1.insertTabToWidget)(state, tabId, widgetId, tabIndex);
|
|
701
|
-
}
|
|
702
|
-
else if (tabLocation.floatingWidget) {
|
|
703
|
-
const floatingWidget = tabLocation.floatingWidget;
|
|
704
|
-
(0, core_bentley_1.assert)(widgetId === floatingWidget.id);
|
|
705
|
-
// Add to a new floating widget.
|
|
706
|
-
const nzBounds = core_react_1.Rectangle.createFromSize(state.size);
|
|
707
|
-
const bounds = core_react_1.Rectangle.create(floatingWidget.bounds).containIn(nzBounds);
|
|
708
|
-
return (0, appui_layout_react_1.addFloatingWidget)(state, floatingWidget.id, [tabId], {
|
|
709
|
-
...floatingWidget,
|
|
710
|
-
bounds: bounds.toProps(),
|
|
711
|
-
});
|
|
712
|
-
}
|
|
713
|
-
// Add to a panel section.
|
|
714
|
-
const panel = state.panels[tabLocation.side];
|
|
715
|
-
// Add to existing panel section.
|
|
716
|
-
if (panel.widgets.length >= panel.maxWidgetCount) {
|
|
717
|
-
const sectionIndex = Math.min(panel.maxWidgetCount - 1, tabLocation.widgetIndex);
|
|
718
|
-
const sectionId = panel.widgets[sectionIndex];
|
|
719
|
-
return (0, appui_layout_react_1.insertTabToWidget)(state, tabId, sectionId, tabLocation.tabIndex);
|
|
720
|
-
}
|
|
721
|
-
// Create a new panel section.
|
|
722
|
-
const newSectionId = (0, appui_layout_react_1.getUniqueId)();
|
|
723
|
-
return (0, appui_layout_react_1.insertPanelWidget)(state, panel.side, newSectionId, [tabId], tabLocation.widgetIndex);
|
|
724
|
-
}
|
|
725
|
-
/** @internal */
|
|
726
|
-
function setWidgetState(state, widgetDef, widgetState) {
|
|
727
|
-
if (widgetState === WidgetState_1.WidgetState.Hidden) {
|
|
728
|
-
return hideWidget(state, widgetDef);
|
|
729
|
-
}
|
|
730
|
-
else if (widgetState === WidgetState_1.WidgetState.Open) {
|
|
731
|
-
const id = widgetDef.id;
|
|
732
|
-
if (widgetDef.isToolSettings) {
|
|
733
|
-
if (!state.toolSettings && !widgetDef.tabLocation) {
|
|
734
|
-
state = (0, appui_layout_react_1.addDockedToolSettings)(state, id);
|
|
735
|
-
}
|
|
736
|
-
if (state.toolSettings?.type === "docked")
|
|
737
|
-
return state;
|
|
738
|
-
}
|
|
739
|
-
let location = (0, appui_layout_react_1.getTabLocation)(state, id);
|
|
740
|
-
if (!location) {
|
|
741
|
-
state = addHiddenWidget(state, widgetDef);
|
|
742
|
-
location = (0, appui_layout_react_1.getTabLocation)(state, id);
|
|
743
|
-
if (widgetDef.isToolSettings) {
|
|
744
|
-
state = (0, appui_layout_react_1.addWidgetToolSettings)(state, id);
|
|
745
|
-
}
|
|
746
|
-
}
|
|
747
|
-
return (0, immer_1.default)(state, (draft) => {
|
|
748
|
-
(0, core_bentley_1.assert)(!!location);
|
|
749
|
-
const widget = draft.widgets[location.widgetId];
|
|
750
|
-
widget.minimized = false;
|
|
751
|
-
widget.activeTabId = id;
|
|
752
|
-
if ((0, appui_layout_react_1.isFloatingTabLocation)(location)) {
|
|
753
|
-
const floatingWidget = draft.floatingWidgets.byId[location.floatingWidgetId];
|
|
754
|
-
floatingWidget.hidden = false;
|
|
755
|
-
// istanbul ignore else
|
|
756
|
-
}
|
|
757
|
-
else if ((0, appui_layout_react_1.isPanelTabLocation)(location)) {
|
|
758
|
-
const panel = draft.panels[location.side];
|
|
759
|
-
panel.collapsed = false;
|
|
760
|
-
if (undefined === panel.size || 0 === panel.size) {
|
|
761
|
-
// istanbul ignore next
|
|
762
|
-
panel.size = panel.minSize ?? 200;
|
|
763
|
-
}
|
|
764
|
-
}
|
|
765
|
-
});
|
|
766
|
-
}
|
|
767
|
-
else if (widgetState === WidgetState_1.WidgetState.Closed) {
|
|
768
|
-
const id = widgetDef.id;
|
|
769
|
-
if (widgetDef.isToolSettings && state.toolSettings?.type !== "widget") {
|
|
770
|
-
return state;
|
|
771
|
-
}
|
|
772
|
-
let location = (0, appui_layout_react_1.getTabLocation)(state, id);
|
|
773
|
-
if (!location) {
|
|
774
|
-
state = addHiddenWidget(state, widgetDef);
|
|
775
|
-
location = (0, appui_layout_react_1.getTabLocation)(state, id);
|
|
776
|
-
}
|
|
777
|
-
// TODO: should change activeTabId of a widget with multiple tabs.
|
|
778
|
-
return (0, immer_1.default)(state, (draft) => {
|
|
779
|
-
(0, core_bentley_1.assert)(!!location);
|
|
780
|
-
const widget = draft.widgets[location.widgetId];
|
|
781
|
-
if ((0, appui_layout_react_1.isFloatingTabLocation)(location)) {
|
|
782
|
-
if (id === widget.activeTabId) {
|
|
783
|
-
widget.minimized = true;
|
|
784
|
-
}
|
|
785
|
-
}
|
|
786
|
-
});
|
|
787
|
-
}
|
|
788
|
-
else if (widgetState === WidgetState_1.WidgetState.Floating) {
|
|
789
|
-
const id = widgetDef.id;
|
|
790
|
-
let location = (0, appui_layout_react_1.getTabLocation)(state, id);
|
|
791
|
-
if (!location) {
|
|
792
|
-
state = addHiddenWidget(state, widgetDef);
|
|
793
|
-
location = (0, appui_layout_react_1.getTabLocation)(state, id);
|
|
794
|
-
}
|
|
795
|
-
(0, core_bentley_1.assert)(!!location);
|
|
796
|
-
if ((0, appui_layout_react_1.isFloatingTabLocation)(location))
|
|
797
|
-
return state;
|
|
798
|
-
// Widget is not floating.
|
|
799
|
-
state = (0, appui_layout_react_1.removeTabFromWidget)(state, id);
|
|
800
|
-
const bounds = widgetDef.tabLocation?.floatingWidget?.bounds;
|
|
801
|
-
state = (0, appui_layout_react_1.addFloatingWidget)(state, (0, appui_layout_react_1.getUniqueId)(), [id], { bounds });
|
|
802
|
-
if (widgetDef.isToolSettings) {
|
|
803
|
-
if (state.toolSettings?.type === "docked") {
|
|
804
|
-
state = (0, appui_layout_react_1.removeToolSettings)(state);
|
|
805
|
-
}
|
|
806
|
-
if (!state.toolSettings) {
|
|
807
|
-
state = (0, appui_layout_react_1.addWidgetToolSettings)(state, id);
|
|
808
|
-
}
|
|
809
|
-
}
|
|
810
|
-
}
|
|
811
|
-
return state;
|
|
812
|
-
}
|
|
813
|
-
exports.setWidgetState = setWidgetState;
|
|
814
|
-
/** Stores widget location and hides it in the UI. */
|
|
815
|
-
function hideWidget(state, widgetDef) {
|
|
816
|
-
const toolSettingsTabId = state.toolSettings?.tabId;
|
|
817
|
-
if (widgetDef.id === toolSettingsTabId) {
|
|
818
|
-
widgetDef.tabLocation = undefined;
|
|
819
|
-
state = (0, immer_1.default)(state, (draft) => {
|
|
820
|
-
draft.toolSettings = undefined;
|
|
821
|
-
});
|
|
822
|
-
if (state.toolSettings?.type === "docked")
|
|
823
|
-
return state;
|
|
824
|
-
}
|
|
825
|
-
const location = (0, appui_layout_react_1.getTabLocation)(state, widgetDef.id);
|
|
826
|
-
if (!location)
|
|
827
|
-
return state;
|
|
828
|
-
// istanbul ignore else
|
|
829
|
-
if ((0, appui_layout_react_1.isFloatingTabLocation)(location)) {
|
|
830
|
-
const floatingWidget = state.floatingWidgets.byId[location.widgetId];
|
|
831
|
-
widgetDef.setFloatingContainerId(location.floatingWidgetId);
|
|
832
|
-
widgetDef.tabLocation = {
|
|
833
|
-
side: floatingWidget.home.side,
|
|
834
|
-
tabIndex: floatingWidget.home.widgetIndex,
|
|
835
|
-
widgetId: floatingWidget.id,
|
|
836
|
-
widgetIndex: floatingWidget.home.widgetIndex,
|
|
837
|
-
floatingWidget,
|
|
838
|
-
};
|
|
839
|
-
}
|
|
840
|
-
else if (!(0, appui_layout_react_1.isPopoutTabLocation)(location)) {
|
|
841
|
-
const widgetId = location.widgetId;
|
|
842
|
-
const side = (0, appui_layout_react_1.isPanelTabLocation)(location) ? location.side : "left";
|
|
843
|
-
const widgetIndex = (0, appui_layout_react_1.isPanelTabLocation)(location)
|
|
844
|
-
? state.panels[side].widgets.indexOf(widgetId)
|
|
845
|
-
: 0;
|
|
846
|
-
const tabIndex = state.widgets[location.widgetId].tabs.indexOf(widgetDef.id);
|
|
847
|
-
widgetDef.tabLocation = {
|
|
848
|
-
side,
|
|
849
|
-
tabIndex,
|
|
850
|
-
widgetId,
|
|
851
|
-
widgetIndex,
|
|
852
|
-
};
|
|
853
|
-
}
|
|
854
|
-
return (0, appui_layout_react_1.removeTabFromWidget)(state, widgetDef.id);
|
|
855
|
-
}
|
|
856
594
|
/** @internal */
|
|
857
595
|
function showWidget(state, id) {
|
|
858
596
|
const location = (0, appui_layout_react_1.getTabLocation)(state, id);
|
|
@@ -892,16 +630,6 @@ function expandWidget(state, id) {
|
|
|
892
630
|
}
|
|
893
631
|
exports.expandWidget = expandWidget;
|
|
894
632
|
/** @internal */
|
|
895
|
-
function setWidgetLabel(state, id, label) {
|
|
896
|
-
if (!(id in state.tabs))
|
|
897
|
-
return state;
|
|
898
|
-
return (0, immer_1.default)(state, (draft) => {
|
|
899
|
-
const tab = draft.tabs[id];
|
|
900
|
-
tab.label = label;
|
|
901
|
-
});
|
|
902
|
-
}
|
|
903
|
-
exports.setWidgetLabel = setWidgetLabel;
|
|
904
|
-
/** @internal */
|
|
905
633
|
function useSavedFrontstageState(frontstageDef) {
|
|
906
634
|
const uiStateStorage = (0, useUiStateStorage_1.useUiStateStorageHandler)();
|
|
907
635
|
const uiStateStorageRef = React.useRef(uiStateStorage);
|
|
@@ -918,7 +646,7 @@ function useSavedFrontstageState(frontstageDef) {
|
|
|
918
646
|
React.useEffect(() => {
|
|
919
647
|
async function fetchFrontstageState() {
|
|
920
648
|
if (frontstageDef.nineZoneState) {
|
|
921
|
-
frontstageDef.nineZoneState = processPopoutWidgets(frontstageDef.nineZoneState
|
|
649
|
+
frontstageDef.nineZoneState = processPopoutWidgets(frontstageDef.nineZoneState);
|
|
922
650
|
return;
|
|
923
651
|
}
|
|
924
652
|
const id = frontstageDef.id;
|
|
@@ -930,13 +658,7 @@ function useSavedFrontstageState(frontstageDef) {
|
|
|
930
658
|
const setting = settingResult.setting;
|
|
931
659
|
if (setting.version === version &&
|
|
932
660
|
setting.stateVersion === exports.stateVersion) {
|
|
933
|
-
|
|
934
|
-
frontstageDef.savedWidgetDefs = setting.widgets;
|
|
935
|
-
restoreSavedWidgets(frontstageDef);
|
|
936
|
-
let state = addMissingWidgets(frontstageDef, restored);
|
|
937
|
-
state = hideWidgets(state, frontstageDef);
|
|
938
|
-
state = processPopoutWidgets(state, frontstageDef);
|
|
939
|
-
frontstageDef.nineZoneState = state;
|
|
661
|
+
frontstageDef.nineZoneState = restoreNineZoneState(frontstageDef, setting.nineZone);
|
|
940
662
|
return;
|
|
941
663
|
}
|
|
942
664
|
}
|
|
@@ -952,14 +674,11 @@ function useSaveFrontstageSettings(frontstageDef, store) {
|
|
|
952
674
|
const saveSetting = React.useMemo(() => {
|
|
953
675
|
const debounced = debounce(async (frontstage, state) => {
|
|
954
676
|
const id = frontstage.id;
|
|
955
|
-
const widgets = packSavedWidgets(frontstage);
|
|
956
|
-
frontstage.savedWidgetDefs = widgets;
|
|
957
677
|
const setting = {
|
|
958
678
|
id,
|
|
959
679
|
version: frontstage.version,
|
|
960
680
|
stateVersion: exports.stateVersion,
|
|
961
681
|
nineZone: packNineZoneState(state),
|
|
962
|
-
widgets,
|
|
963
682
|
};
|
|
964
683
|
await uiSettingsStorage.saveSetting(exports.FRONTSTAGE_SETTINGS_NAMESPACE, getFrontstageStateSettingName(id), setting);
|
|
965
684
|
}, 1000);
|
|
@@ -1009,49 +728,11 @@ function debounce(func, duration) {
|
|
|
1009
728
|
};
|
|
1010
729
|
return debounced;
|
|
1011
730
|
}
|
|
1012
|
-
const createListener = (frontstageDef, listener) => {
|
|
1013
|
-
return (...args) => {
|
|
1014
|
-
if (!frontstageDef.nineZoneState)
|
|
1015
|
-
return;
|
|
1016
|
-
listener(...args);
|
|
1017
|
-
};
|
|
1018
|
-
};
|
|
1019
731
|
/** @internal */
|
|
1020
732
|
function useFrontstageManager(frontstageDef, useToolAsToolSettingsLabel) {
|
|
1021
|
-
React.useEffect(() => {
|
|
1022
|
-
return UiFramework_1.UiFramework.frontstages.onWidgetStateChangedEvent.addListener(({ widgetDef, widgetState }) => {
|
|
1023
|
-
if (!frontstageDef.nineZoneState)
|
|
1024
|
-
return;
|
|
1025
|
-
frontstageDef.nineZoneState = setWidgetState(frontstageDef.nineZoneState, widgetDef, widgetState);
|
|
1026
|
-
});
|
|
1027
|
-
}, [frontstageDef]);
|
|
1028
|
-
React.useEffect(() => {
|
|
1029
|
-
const listener = createListener(frontstageDef, ({ widgetDef }) => {
|
|
1030
|
-
(0, core_bentley_1.assert)(!!frontstageDef.nineZoneState);
|
|
1031
|
-
const nineZoneState = setWidgetState(frontstageDef.nineZoneState, widgetDef, WidgetState_1.WidgetState.Open);
|
|
1032
|
-
frontstageDef.nineZoneState = showWidget(nineZoneState, widgetDef.id);
|
|
1033
|
-
});
|
|
1034
|
-
InternalFrontstageManager_1.InternalFrontstageManager.onWidgetShowEvent.addListener(listener);
|
|
1035
|
-
return () => {
|
|
1036
|
-
InternalFrontstageManager_1.InternalFrontstageManager.onWidgetShowEvent.removeListener(listener);
|
|
1037
|
-
};
|
|
1038
|
-
}, [frontstageDef]);
|
|
1039
|
-
React.useEffect(() => {
|
|
1040
|
-
const listener = createListener(frontstageDef, ({ widgetDef }) => {
|
|
1041
|
-
(0, core_bentley_1.assert)(!!frontstageDef.nineZoneState);
|
|
1042
|
-
let nineZoneState = setWidgetState(frontstageDef.nineZoneState, widgetDef, WidgetState_1.WidgetState.Open);
|
|
1043
|
-
nineZoneState = showWidget(nineZoneState, widgetDef.id);
|
|
1044
|
-
nineZoneState = expandWidget(nineZoneState, widgetDef.id);
|
|
1045
|
-
frontstageDef.nineZoneState = nineZoneState;
|
|
1046
|
-
});
|
|
1047
|
-
InternalFrontstageManager_1.InternalFrontstageManager.onWidgetExpandEvent.addListener(listener);
|
|
1048
|
-
return () => {
|
|
1049
|
-
InternalFrontstageManager_1.InternalFrontstageManager.onWidgetExpandEvent.removeListener(listener);
|
|
1050
|
-
};
|
|
1051
|
-
}, [frontstageDef]);
|
|
1052
733
|
const uiSettingsStorage = (0, useUiStateStorage_1.useUiStateStorageHandler)();
|
|
1053
734
|
React.useEffect(() => {
|
|
1054
|
-
|
|
735
|
+
return InternalFrontstageManager_1.InternalFrontstageManager.onFrontstageRestoreLayoutEvent.addListener((args) => {
|
|
1055
736
|
// TODO: track restoring frontstages to support workflows: i.e. prevent loading frontstage OR saving layout when delete is pending
|
|
1056
737
|
void uiSettingsStorage.deleteSetting(exports.FRONTSTAGE_SETTINGS_NAMESPACE, getFrontstageStateSettingName(args.frontstageDef.id));
|
|
1057
738
|
if (frontstageDef.id === args.frontstageDef.id) {
|
|
@@ -1061,52 +742,37 @@ function useFrontstageManager(frontstageDef, useToolAsToolSettingsLabel) {
|
|
|
1061
742
|
else {
|
|
1062
743
|
args.frontstageDef.nineZoneState = undefined;
|
|
1063
744
|
}
|
|
1064
|
-
};
|
|
1065
|
-
InternalFrontstageManager_1.InternalFrontstageManager.onFrontstageRestoreLayoutEvent.addListener(listener);
|
|
1066
|
-
return () => {
|
|
1067
|
-
InternalFrontstageManager_1.InternalFrontstageManager.onFrontstageRestoreLayoutEvent.removeListener(listener);
|
|
1068
|
-
};
|
|
1069
|
-
}, [uiSettingsStorage, frontstageDef]);
|
|
1070
|
-
React.useEffect(() => {
|
|
1071
|
-
const listener = createListener(frontstageDef, ({ widgetDef }) => {
|
|
1072
|
-
(0, core_bentley_1.assert)(!!frontstageDef.nineZoneState);
|
|
1073
|
-
const label = widgetDef.label;
|
|
1074
|
-
frontstageDef.nineZoneState = setWidgetLabel(frontstageDef.nineZoneState, widgetDef.id, label);
|
|
1075
745
|
});
|
|
1076
|
-
|
|
1077
|
-
return () => {
|
|
1078
|
-
InternalFrontstageManager_1.InternalFrontstageManager.onWidgetLabelChangedEvent.removeListener(listener);
|
|
1079
|
-
};
|
|
1080
|
-
}, [frontstageDef]);
|
|
746
|
+
}, [uiSettingsStorage, frontstageDef]);
|
|
1081
747
|
const defaultLabel = React.useMemo(() => UiFramework_1.UiFramework.translate("widget.labels.toolSettings"), []);
|
|
1082
748
|
React.useEffect(() => {
|
|
1083
|
-
const updateLabel =
|
|
749
|
+
const updateLabel = () => {
|
|
750
|
+
var _a, _b;
|
|
751
|
+
const state = frontstageDef.nineZoneState;
|
|
752
|
+
if (!state)
|
|
753
|
+
return;
|
|
754
|
+
const toolSettingsTabId = (_a = state.toolSettings) === null || _a === void 0 ? void 0 : _a.tabId;
|
|
755
|
+
if (!toolSettingsTabId)
|
|
756
|
+
return;
|
|
1084
757
|
const toolId = UiFramework_1.UiFramework.frontstages.activeToolId;
|
|
1085
|
-
(0, core_bentley_1.assert)(!!frontstageDef.nineZoneState);
|
|
1086
758
|
const label = useToolAsToolSettingsLabel
|
|
1087
|
-
? core_frontend_1.IModelApp.tools.find(toolId)
|
|
759
|
+
? ((_b = core_frontend_1.IModelApp.tools.find(toolId)) === null || _b === void 0 ? void 0 : _b.flyover) || defaultLabel
|
|
1088
760
|
: defaultLabel;
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
761
|
+
frontstageDef.dispatch({
|
|
762
|
+
type: "WIDGET_TAB_SET_LABEL",
|
|
763
|
+
id: toolSettingsTabId,
|
|
764
|
+
label,
|
|
765
|
+
});
|
|
766
|
+
};
|
|
1094
767
|
// Whenever the frontstageDef or the useTool... changes, keep the label up to date.
|
|
1095
768
|
updateLabel();
|
|
769
|
+
const removeListenerFuncs = [];
|
|
1096
770
|
// If useTool... is true, listen for events to keep up the label up to date.
|
|
1097
771
|
if (useToolAsToolSettingsLabel) {
|
|
1098
|
-
UiFramework_1.UiFramework.frontstages.onFrontstageReadyEvent.addListener(updateLabel);
|
|
1099
|
-
InternalFrontstageManager_1.InternalFrontstageManager.onFrontstageRestoreLayoutEvent.addListener(updateLabel);
|
|
1100
|
-
UiFramework_1.UiFramework.frontstages.onToolActivatedEvent.addListener(updateLabel);
|
|
1101
|
-
UiFramework_1.UiFramework.frontstages.onToolSettingsReloadEvent.addListener(updateLabel);
|
|
772
|
+
removeListenerFuncs.push(UiFramework_1.UiFramework.frontstages.onFrontstageReadyEvent.addListener(updateLabel), InternalFrontstageManager_1.InternalFrontstageManager.onFrontstageRestoreLayoutEvent.addListener(updateLabel), UiFramework_1.UiFramework.frontstages.onToolActivatedEvent.addListener(updateLabel), UiFramework_1.UiFramework.frontstages.onToolSettingsReloadEvent.addListener(updateLabel));
|
|
1102
773
|
}
|
|
1103
774
|
return () => {
|
|
1104
|
-
|
|
1105
|
-
UiFramework_1.UiFramework.frontstages.onFrontstageReadyEvent.removeListener(updateLabel);
|
|
1106
|
-
InternalFrontstageManager_1.InternalFrontstageManager.onFrontstageRestoreLayoutEvent.removeListener(updateLabel);
|
|
1107
|
-
UiFramework_1.UiFramework.frontstages.onToolActivatedEvent.removeListener(updateLabel);
|
|
1108
|
-
UiFramework_1.UiFramework.frontstages.onToolSettingsReloadEvent.removeListener(updateLabel);
|
|
1109
|
-
}
|
|
775
|
+
removeListenerFuncs.forEach((removeListener) => removeListener());
|
|
1110
776
|
};
|
|
1111
777
|
}, [frontstageDef, useToolAsToolSettingsLabel, defaultLabel]);
|
|
1112
778
|
}
|
|
@@ -1117,23 +783,22 @@ function useItemsManager(frontstageDef) {
|
|
|
1117
783
|
const refreshNineZoneState = (def) => {
|
|
1118
784
|
// Fired for both registered/unregistered. Update definitions and remove/add missing widgets.
|
|
1119
785
|
def.updateWidgetDefs();
|
|
1120
|
-
restoreSavedWidgets(def);
|
|
1121
786
|
let state = def.nineZoneState;
|
|
1122
787
|
if (!state)
|
|
1123
788
|
return;
|
|
1124
789
|
state = addMissingWidgets(def, state);
|
|
1125
790
|
state = removeMissingWidgets(def, state);
|
|
1126
|
-
state = hideWidgets(state, def); // TODO: should only apply to widgets provided by registered provider in onUiProviderRegisteredEvent.
|
|
1127
791
|
def.nineZoneState = state;
|
|
1128
792
|
};
|
|
1129
793
|
React.useEffect(() => {
|
|
1130
|
-
const remove = UiItemsManager_1.UiItemsManager.onUiProviderRegisteredEvent.addListener(() => {
|
|
1131
|
-
refreshNineZoneState(frontstageDef);
|
|
1132
|
-
});
|
|
1133
794
|
// Need to refresh anytime frontstageDef changes because uiItemsProvider may have added something to
|
|
1134
795
|
// another stage before it was possibly unloaded in this stage.
|
|
1135
796
|
refreshNineZoneState(frontstageDef);
|
|
1136
|
-
|
|
797
|
+
}, [frontstageDef]);
|
|
798
|
+
React.useEffect(() => {
|
|
799
|
+
return UiItemsManager_1.UiItemsManager.onUiProviderRegisteredEvent.addListener(() => {
|
|
800
|
+
refreshNineZoneState(frontstageDef);
|
|
801
|
+
});
|
|
1137
802
|
}, [frontstageDef]);
|
|
1138
803
|
}
|
|
1139
804
|
exports.useItemsManager = useItemsManager;
|