@itwin/appui-react 4.5.0 → 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 +20 -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 +177 -216
- package/lib/cjs/appui-react/frontstage/FrontstageDef.js.map +1 -1
- package/lib/cjs/appui-react/frontstage/InternalFrontstageManager.d.ts +3 -7
- package/lib/cjs/appui-react/frontstage/InternalFrontstageManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/frontstage/InternalFrontstageManager.js +2 -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 +181 -220
- package/lib/esm/appui-react/frontstage/FrontstageDef.js.map +1 -1
- package/lib/esm/appui-react/frontstage/InternalFrontstageManager.d.ts +3 -7
- package/lib/esm/appui-react/frontstage/InternalFrontstageManager.d.ts.map +1 -1
- package/lib/esm/appui-react/frontstage/InternalFrontstageManager.js +2 -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
|
@@ -10,10 +10,11 @@ import "./Frontstage.scss";
|
|
|
10
10
|
import produce from "immer";
|
|
11
11
|
import * as React from "react";
|
|
12
12
|
import { unstable_batchedUpdates } from "react-dom";
|
|
13
|
-
import {
|
|
14
|
-
import { Rectangle,
|
|
13
|
+
import { Logger, ProcessDetector } from "@itwin/core-bentley";
|
|
14
|
+
import { Rectangle, UiStateStorageStatus } from "@itwin/core-react";
|
|
15
15
|
import { ToolbarPopupAutoHideContext } from "@itwin/components-react";
|
|
16
|
-
import { addDockedToolSettings, addFloatingWidget, addPanelWidget, addTab, addTabToWidget,
|
|
16
|
+
import { addDockedToolSettings, addFloatingWidget, addPanelWidget, addRemovedTab, addTab, addTabToWidget, createLayoutStore, createNineZoneState, floatingWidgetBringToFront, FloatingWidgets, getTabLocation, getUniqueId, getWidgetPanelSectionId, isFloatingTabLocation, isPanelTabLocation, NineZone, NineZoneStateReducer, removeTab, WidgetPanels, } from "@itwin/appui-layout-react";
|
|
17
|
+
import { useActiveFrontstageDef, } from "../frontstage/FrontstageDef";
|
|
17
18
|
import { StagePanelState, toPanelSide } from "../stagepanels/StagePanelDef";
|
|
18
19
|
import { UiFramework } from "../UiFramework";
|
|
19
20
|
import { useUiStateStorageHandler } from "../uistate/useUiStateStorage";
|
|
@@ -50,30 +51,19 @@ const widgetContent = React.createElement(WidgetContent, null);
|
|
|
50
51
|
const toolSettingsContent = React.createElement(ToolSettingsContent, null);
|
|
51
52
|
const widgetPanelsFrontstage = React.createElement(WidgetPanelsFrontstageComponent, null);
|
|
52
53
|
/** @internal */
|
|
53
|
-
export function useLayoutStore() {
|
|
54
|
-
const
|
|
55
|
-
const [layout, setLayout] = React.useState(() => createLayoutStore(def?.nineZoneState));
|
|
56
|
-
React.useEffect(() => {
|
|
57
|
-
return UiFramework.frontstages.onFrontstageActivatedEvent.addListener((args) => {
|
|
58
|
-
unstable_batchedUpdates(() => {
|
|
59
|
-
setDef(args.activatedFrontstageDef);
|
|
60
|
-
setLayout(createLayoutStore(args.activatedFrontstageDef.nineZoneState));
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
}, []);
|
|
54
|
+
export function useLayoutStore(frontstageDef) {
|
|
55
|
+
const layoutStore = React.useMemo(() => createLayoutStore(frontstageDef === null || frontstageDef === void 0 ? void 0 : frontstageDef.nineZoneState), [frontstageDef]);
|
|
64
56
|
React.useEffect(() => {
|
|
65
57
|
return InternalFrontstageManager.onFrontstageNineZoneStateChangedEvent.addListener((args) => {
|
|
66
|
-
if (args.frontstageDef !==
|
|
67
|
-
def.isStageClosing ||
|
|
68
|
-
def.isApplicationClosing)
|
|
58
|
+
if (args.frontstageDef !== frontstageDef)
|
|
69
59
|
return;
|
|
70
60
|
unstable_batchedUpdates(() => {
|
|
71
61
|
// https://github.com/pmndrs/zustand/blob/main/docs/guides/event-handler-in-pre-react-18.md
|
|
72
|
-
|
|
62
|
+
layoutStore.setState(args.state || defaultNineZone);
|
|
73
63
|
});
|
|
74
64
|
});
|
|
75
|
-
}, [
|
|
76
|
-
return
|
|
65
|
+
}, [frontstageDef, layoutStore]);
|
|
66
|
+
return layoutStore;
|
|
77
67
|
}
|
|
78
68
|
/** Update in-memory NineZoneState of newly activated frontstage with up to date size.
|
|
79
69
|
* @internal
|
|
@@ -81,65 +71,30 @@ export function useLayoutStore() {
|
|
|
81
71
|
export function useUpdateNineZoneSize(frontstageDef) {
|
|
82
72
|
React.useEffect(() => {
|
|
83
73
|
const size = InternalFrontstageManager.nineZoneSize;
|
|
84
|
-
|
|
74
|
+
const state = frontstageDef.nineZoneState;
|
|
85
75
|
if (!size || !state)
|
|
86
76
|
return;
|
|
87
|
-
|
|
77
|
+
frontstageDef.dispatch({
|
|
88
78
|
type: "RESIZE",
|
|
89
79
|
size: {
|
|
90
80
|
height: size.height,
|
|
91
81
|
width: size.width,
|
|
92
82
|
},
|
|
93
|
-
}, frontstageDef);
|
|
94
|
-
frontstageDef.nineZoneState = state;
|
|
95
|
-
}, [frontstageDef]);
|
|
96
|
-
}
|
|
97
|
-
/** @internal */
|
|
98
|
-
export function FrameworkStateReducer(state, action, frontstageDef) {
|
|
99
|
-
state = NineZoneStateReducer(state, action);
|
|
100
|
-
if (action.type === "RESIZE") {
|
|
101
|
-
state = produce(state, (draft) => {
|
|
102
|
-
for (const panelSide of panelSides) {
|
|
103
|
-
const panel = draft.panels[panelSide];
|
|
104
|
-
const location = toStagePanelLocation(panelSide);
|
|
105
|
-
const panelDef = frontstageDef.getStagePanelDef(location);
|
|
106
|
-
if (panelDef?.maxSizeSpec) {
|
|
107
|
-
panel.maxSize = getPanelMaxSize(panelDef.maxSizeSpec, panelSide, action.size);
|
|
108
|
-
if (panel.size) {
|
|
109
|
-
panel.size = Math.min(Math.max(panel.size, panel.minSize), panel.maxSize);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
83
|
});
|
|
114
|
-
}
|
|
115
|
-
return state;
|
|
84
|
+
}, [frontstageDef]);
|
|
116
85
|
}
|
|
117
86
|
/** @internal */
|
|
118
87
|
export function useNineZoneDispatch(frontstageDef) {
|
|
119
|
-
|
|
120
|
-
if (action.type === "RESIZE") {
|
|
121
|
-
InternalFrontstageManager.nineZoneSize = Size.create(action.size);
|
|
122
|
-
}
|
|
123
|
-
if (action.type === "WIDGET_TAB_POPOUT") {
|
|
124
|
-
const tabId = action.id;
|
|
125
|
-
frontstageDef.popoutWidget(tabId);
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
const state = frontstageDef.nineZoneState;
|
|
129
|
-
if (!state)
|
|
130
|
-
return;
|
|
131
|
-
frontstageDef.nineZoneState = FrameworkStateReducer(state, action, frontstageDef);
|
|
132
|
-
}, [frontstageDef]);
|
|
133
|
-
return dispatch;
|
|
88
|
+
return React.useMemo(() => frontstageDef.dispatch, [frontstageDef]);
|
|
134
89
|
}
|
|
135
90
|
/** @internal */
|
|
136
91
|
export function WidgetPanelsFrontstage() {
|
|
137
|
-
const
|
|
92
|
+
const frontstageDef = useActiveFrontstageDef();
|
|
93
|
+
const layout = useLayoutStore(frontstageDef);
|
|
138
94
|
React.useEffect(() => {
|
|
139
95
|
const triggerWidowCloseProcessing = () => {
|
|
140
96
|
frontstageDef && frontstageDef.setIsApplicationClosing(true);
|
|
141
97
|
};
|
|
142
|
-
frontstageDef && frontstageDef.setIsApplicationClosing(false);
|
|
143
98
|
window.addEventListener("unload", triggerWidowCloseProcessing);
|
|
144
99
|
return () => {
|
|
145
100
|
window.removeEventListener("unload", triggerWidowCloseProcessing);
|
|
@@ -197,17 +152,19 @@ export function useLabels() {
|
|
|
197
152
|
}), []);
|
|
198
153
|
}
|
|
199
154
|
function toTabArgs(widget) {
|
|
155
|
+
var _a;
|
|
200
156
|
const label = getWidgetLabel(widget.label);
|
|
201
|
-
|
|
202
|
-
allowedPanelTargets: widget.allowedPanelTargets
|
|
157
|
+
const args = {
|
|
158
|
+
allowedPanelTargets: (_a = widget.allowedPanelTargets) === null || _a === void 0 ? void 0 : _a.map((location) => toPanelSide(location)),
|
|
203
159
|
hideWithUiWhenFloating: !!widget.hideWithUiWhenFloating,
|
|
204
160
|
canPopout: widget.canPopout,
|
|
205
161
|
iconSpec: widget.iconSpec,
|
|
206
|
-
|
|
162
|
+
isFloatingWidgetResizable: widget.isFloatingStateWindowResizable,
|
|
207
163
|
label,
|
|
208
164
|
preferredFloatingWidgetSize: widget.defaultFloatingSize,
|
|
209
165
|
preferredPanelWidgetSize: widget.preferredPanelSize,
|
|
210
166
|
};
|
|
167
|
+
return args;
|
|
211
168
|
}
|
|
212
169
|
/** @internal */
|
|
213
170
|
export function addWidgets(state, widgets, side, widgetId) {
|
|
@@ -222,7 +179,7 @@ export function addWidgets(state, widgets, side, widgetId) {
|
|
|
222
179
|
const activeWidget = visibleWidgets.find((widget) => widget.isActive);
|
|
223
180
|
const minimized = false;
|
|
224
181
|
// istanbul ignore else
|
|
225
|
-
if (activeWidget
|
|
182
|
+
if ((activeWidget === null || activeWidget === void 0 ? void 0 : activeWidget.defaultState) !== WidgetState.Floating) {
|
|
226
183
|
state = addPanelWidget(state, side, widgetId, tabs, {
|
|
227
184
|
activeTabId: activeWidget ? activeWidget.id : tabs[0],
|
|
228
185
|
minimized,
|
|
@@ -255,9 +212,15 @@ export function appendWidgets(state, widgetDefs, location, section) {
|
|
|
255
212
|
preferredPanelWidgetSize,
|
|
256
213
|
userSized,
|
|
257
214
|
});
|
|
258
|
-
|
|
215
|
+
const savedTab = state.savedTabs.byId[widgetDef.id];
|
|
216
|
+
if (savedTab) {
|
|
217
|
+
state = addRemovedTab(state, widgetDef.id);
|
|
218
|
+
}
|
|
219
|
+
else if (widgetDef.isFloatingStateSupported &&
|
|
259
220
|
widgetDef.defaultState === WidgetState.Floating) {
|
|
260
|
-
const floatingContainerId = widgetDef.floatingContainerId
|
|
221
|
+
const floatingContainerId = widgetDef.floatingContainerId
|
|
222
|
+
? widgetDef.floatingContainerId
|
|
223
|
+
: getUniqueId();
|
|
261
224
|
const widgetContainerId = getWidgetId(location, section);
|
|
262
225
|
const home = {
|
|
263
226
|
side,
|
|
@@ -275,7 +238,7 @@ export function appendWidgets(state, widgetDefs, location, section) {
|
|
|
275
238
|
width: 300,
|
|
276
239
|
...tab.preferredFloatingWidgetSize,
|
|
277
240
|
};
|
|
278
|
-
const preferredPoint = preferredPosition
|
|
241
|
+
const preferredPoint = preferredPosition !== null && preferredPosition !== void 0 ? preferredPosition : {
|
|
279
242
|
x: (state.size.width - size.width) / 2,
|
|
280
243
|
y: (state.size.height - size.height) / 2,
|
|
281
244
|
};
|
|
@@ -286,8 +249,6 @@ export function appendWidgets(state, widgetDefs, location, section) {
|
|
|
286
249
|
bounds: containedBounds.toProps(),
|
|
287
250
|
home,
|
|
288
251
|
userSized,
|
|
289
|
-
}, {
|
|
290
|
-
isFloatingStateWindowResizable: widgetDef.isFloatingStateWindowResizable,
|
|
291
252
|
});
|
|
292
253
|
}
|
|
293
254
|
}
|
|
@@ -311,46 +272,44 @@ export function appendWidgets(state, widgetDefs, location, section) {
|
|
|
311
272
|
}
|
|
312
273
|
}
|
|
313
274
|
}
|
|
275
|
+
if (widgetDef.defaultState === WidgetState.Hidden) {
|
|
276
|
+
state = NineZoneStateReducer(state, {
|
|
277
|
+
type: "WIDGET_TAB_HIDE",
|
|
278
|
+
id: widgetDef.id,
|
|
279
|
+
});
|
|
280
|
+
}
|
|
314
281
|
}
|
|
315
282
|
return state;
|
|
316
283
|
}
|
|
317
|
-
function processPopoutWidgets(
|
|
318
|
-
//
|
|
319
|
-
if (
|
|
320
|
-
return
|
|
321
|
-
// istanbul ignore next - not unit testing electron case that reopens popout windows
|
|
322
|
-
if (initialState.popoutWidgets && ProcessDetector.isElectronAppFrontend) {
|
|
323
|
-
if (initialState.popoutWidgets.allIds.length &&
|
|
324
|
-
ProcessDetector.isElectronAppFrontend) {
|
|
325
|
-
for (const widgetContainerId of initialState.popoutWidgets.allIds) {
|
|
326
|
-
frontstageDef.openPopoutWidgetContainer(initialState, widgetContainerId);
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
return initialState;
|
|
284
|
+
function processPopoutWidgets(state) {
|
|
285
|
+
// Electron reopens popout windows
|
|
286
|
+
if (ProcessDetector.isElectronAppFrontend) {
|
|
287
|
+
return state;
|
|
330
288
|
}
|
|
331
|
-
|
|
289
|
+
for (const popoutWidgetId of state.popoutWidgets.allIds) {
|
|
290
|
+
const widget = state.widgets[popoutWidgetId];
|
|
291
|
+
const id = widget.tabs[0];
|
|
292
|
+
state = NineZoneStateReducer(state, {
|
|
293
|
+
type: "WIDGET_TAB_FLOAT",
|
|
294
|
+
id,
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
return state;
|
|
332
298
|
}
|
|
333
299
|
/** Adds frontstageDef widgets that are missing in NineZoneState.
|
|
334
300
|
* @internal
|
|
335
301
|
*/
|
|
336
302
|
export function addMissingWidgets(frontstageDef, initialState) {
|
|
303
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
337
304
|
let state = initialState;
|
|
338
|
-
state = appendWidgets(state, determineNewWidgets(frontstageDef.leftPanel
|
|
339
|
-
|
|
340
|
-
state = appendWidgets(state, determineNewWidgets(frontstageDef.
|
|
341
|
-
|
|
342
|
-
state = appendWidgets(state, determineNewWidgets(frontstageDef.
|
|
343
|
-
|
|
344
|
-
state = appendWidgets(state, determineNewWidgets(frontstageDef.
|
|
345
|
-
|
|
346
|
-
state = appendWidgets(state, determineNewWidgets(frontstageDef.topPanel?.getPanelSectionDef(StagePanelSection.Start)
|
|
347
|
-
.widgetDefs, state), StagePanelLocation.Top, StagePanelSection.Start);
|
|
348
|
-
state = appendWidgets(state, determineNewWidgets(frontstageDef.topPanel?.getPanelSectionDef(StagePanelSection.End)
|
|
349
|
-
.widgetDefs, state), StagePanelLocation.Top, StagePanelSection.End);
|
|
350
|
-
state = appendWidgets(state, determineNewWidgets(frontstageDef.bottomPanel?.getPanelSectionDef(StagePanelSection.Start)
|
|
351
|
-
.widgetDefs, state), StagePanelLocation.Bottom, StagePanelSection.Start);
|
|
352
|
-
state = appendWidgets(state, determineNewWidgets(frontstageDef.bottomPanel?.getPanelSectionDef(StagePanelSection.End)
|
|
353
|
-
.widgetDefs, state), StagePanelLocation.Bottom, StagePanelSection.End);
|
|
305
|
+
state = appendWidgets(state, determineNewWidgets((_a = frontstageDef.leftPanel) === null || _a === void 0 ? void 0 : _a.getPanelSectionDef(StagePanelSection.Start).widgetDefs, state), StagePanelLocation.Left, StagePanelSection.Start);
|
|
306
|
+
state = appendWidgets(state, determineNewWidgets((_b = frontstageDef.leftPanel) === null || _b === void 0 ? void 0 : _b.getPanelSectionDef(StagePanelSection.End).widgetDefs, state), StagePanelLocation.Left, StagePanelSection.End);
|
|
307
|
+
state = appendWidgets(state, determineNewWidgets((_c = frontstageDef.rightPanel) === null || _c === void 0 ? void 0 : _c.getPanelSectionDef(StagePanelSection.Start).widgetDefs, state), StagePanelLocation.Right, StagePanelSection.Start);
|
|
308
|
+
state = appendWidgets(state, determineNewWidgets((_d = frontstageDef.rightPanel) === null || _d === void 0 ? void 0 : _d.getPanelSectionDef(StagePanelSection.End).widgetDefs, state), StagePanelLocation.Right, StagePanelSection.End);
|
|
309
|
+
state = appendWidgets(state, determineNewWidgets((_e = frontstageDef.topPanel) === null || _e === void 0 ? void 0 : _e.getPanelSectionDef(StagePanelSection.Start).widgetDefs, state), StagePanelLocation.Top, StagePanelSection.Start);
|
|
310
|
+
state = appendWidgets(state, determineNewWidgets((_f = frontstageDef.topPanel) === null || _f === void 0 ? void 0 : _f.getPanelSectionDef(StagePanelSection.End).widgetDefs, state), StagePanelLocation.Top, StagePanelSection.End);
|
|
311
|
+
state = appendWidgets(state, determineNewWidgets((_g = frontstageDef.bottomPanel) === null || _g === void 0 ? void 0 : _g.getPanelSectionDef(StagePanelSection.Start).widgetDefs, state), StagePanelLocation.Bottom, StagePanelSection.Start);
|
|
312
|
+
state = appendWidgets(state, determineNewWidgets((_h = frontstageDef.bottomPanel) === null || _h === void 0 ? void 0 : _h.getPanelSectionDef(StagePanelSection.End).widgetDefs, state), StagePanelLocation.Bottom, StagePanelSection.End);
|
|
354
313
|
if (frontstageDef.toolSettings) {
|
|
355
314
|
const newToolSettingsWidgets = determineNewWidgets([frontstageDef.toolSettings], state);
|
|
356
315
|
for (const newToolSettingsWidget of newToolSettingsWidgets) {
|
|
@@ -367,7 +326,10 @@ function hideWidgets(state, frontstageDef) {
|
|
|
367
326
|
if (!widgetDef)
|
|
368
327
|
continue;
|
|
369
328
|
if (widgetDef.defaultState === WidgetState.Hidden) {
|
|
370
|
-
state =
|
|
329
|
+
state = NineZoneStateReducer(state, {
|
|
330
|
+
type: "WIDGET_TAB_HIDE",
|
|
331
|
+
id: widgetDef.id,
|
|
332
|
+
});
|
|
371
333
|
}
|
|
372
334
|
}
|
|
373
335
|
return state;
|
|
@@ -375,14 +337,19 @@ function hideWidgets(state, frontstageDef) {
|
|
|
375
337
|
/** Removes NineZoneState widgets that are missing in frontstageDef.
|
|
376
338
|
* @internal
|
|
377
339
|
*/
|
|
378
|
-
|
|
379
|
-
|
|
340
|
+
function removeMissingWidgets(frontstageDef, state) {
|
|
341
|
+
var _a;
|
|
342
|
+
const toolSettingsTabId = (_a = state.toolSettings) === null || _a === void 0 ? void 0 : _a.tabId;
|
|
380
343
|
for (const [, tab] of Object.entries(state.tabs)) {
|
|
381
344
|
if (tab.id === toolSettingsTabId)
|
|
382
345
|
continue;
|
|
383
346
|
const widgetDef = frontstageDef.findWidgetDef(tab.id);
|
|
384
347
|
if (widgetDef)
|
|
385
348
|
continue;
|
|
349
|
+
state = NineZoneStateReducer(state, {
|
|
350
|
+
type: "WIDGET_TAB_HIDE",
|
|
351
|
+
id: tab.id,
|
|
352
|
+
});
|
|
386
353
|
state = removeTab(state, tab.id);
|
|
387
354
|
}
|
|
388
355
|
return state;
|
|
@@ -390,18 +357,6 @@ export function removeMissingWidgets(frontstageDef, state) {
|
|
|
390
357
|
function getWidgetLabel(label) {
|
|
391
358
|
return label === "" ? "Widget" : label;
|
|
392
359
|
}
|
|
393
|
-
function toStagePanelLocation(side) {
|
|
394
|
-
switch (side) {
|
|
395
|
-
case "bottom":
|
|
396
|
-
return StagePanelLocation.Bottom;
|
|
397
|
-
case "left":
|
|
398
|
-
return StagePanelLocation.Left;
|
|
399
|
-
case "right":
|
|
400
|
-
return StagePanelLocation.Right;
|
|
401
|
-
case "top":
|
|
402
|
-
return StagePanelLocation.Top;
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
360
|
/** @internal */
|
|
406
361
|
export function getWidgetId(location, section) {
|
|
407
362
|
switch (location) {
|
|
@@ -430,8 +385,8 @@ export function getWidgetId(location, section) {
|
|
|
430
385
|
/** @internal */
|
|
431
386
|
export function getPanelSectionWidgets(frontstageDef, location, section) {
|
|
432
387
|
const stagePanel = frontstageDef.getStagePanelDef(location);
|
|
433
|
-
const panelSection = stagePanel
|
|
434
|
-
return panelSection
|
|
388
|
+
const panelSection = stagePanel === null || stagePanel === void 0 ? void 0 : stagePanel.getPanelSectionDef(section);
|
|
389
|
+
return (panelSection === null || panelSection === void 0 ? void 0 : panelSection.widgetDefs) || [];
|
|
435
390
|
}
|
|
436
391
|
/** @internal */
|
|
437
392
|
export function addPanelWidgets(state, frontstageDef, location) {
|
|
@@ -452,36 +407,28 @@ export function isFrontstageStateSettingResult(settingsResult) {
|
|
|
452
407
|
}
|
|
453
408
|
/** @internal */
|
|
454
409
|
export function initializePanel(state, frontstageDef, location) {
|
|
455
|
-
const
|
|
410
|
+
const side = toPanelSide(location);
|
|
456
411
|
state = addPanelWidgets(state, frontstageDef, location);
|
|
457
412
|
const panelDef = frontstageDef.getStagePanelDef(location);
|
|
458
413
|
state = produce(state, (draft) => {
|
|
459
|
-
|
|
460
|
-
panel
|
|
461
|
-
panel.
|
|
462
|
-
panel.
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
}
|
|
466
|
-
const size = panelDef?.size;
|
|
467
|
-
panel.size =
|
|
468
|
-
size === undefined
|
|
469
|
-
? size
|
|
470
|
-
: Math.min(Math.max(size, panel.minSize), panel.maxSize);
|
|
414
|
+
var _a, _b, _c, _d, _e, _f;
|
|
415
|
+
const panel = draft.panels[side];
|
|
416
|
+
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;
|
|
417
|
+
panel.pinned = (_c = panelDef === null || panelDef === void 0 ? void 0 : panelDef.pinned) !== null && _c !== void 0 ? _c : panel.pinned;
|
|
418
|
+
panel.resizable = (_d = panelDef === null || panelDef === void 0 ? void 0 : panelDef.resizable) !== null && _d !== void 0 ? _d : panel.resizable;
|
|
419
|
+
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;
|
|
471
420
|
});
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
421
|
+
if ((panelDef === null || panelDef === void 0 ? void 0 : panelDef.size) !== undefined) {
|
|
422
|
+
state = NineZoneStateReducer(state, {
|
|
423
|
+
type: "PANEL_SET_SIZE",
|
|
424
|
+
side,
|
|
425
|
+
size: panelDef.size,
|
|
426
|
+
});
|
|
477
427
|
}
|
|
478
|
-
|
|
479
|
-
? nineZoneSize.height
|
|
480
|
-
: nineZoneSize.width;
|
|
481
|
-
return (maxSizeSpec.percentage / 100) * size;
|
|
428
|
+
return state;
|
|
482
429
|
}
|
|
483
430
|
/** @internal */
|
|
484
|
-
export const stateVersion =
|
|
431
|
+
export const stateVersion = 16; // this needs to be bumped when NineZoneState is changed (to recreate the layout).
|
|
485
432
|
/** @internal */
|
|
486
433
|
export function initializeNineZoneState(frontstageDef) {
|
|
487
434
|
let nineZone = defaultNineZone;
|
|
@@ -499,6 +446,7 @@ export function initializeNineZoneState(frontstageDef) {
|
|
|
499
446
|
nineZone = initializePanel(nineZone, frontstageDef, StagePanelLocation.Top);
|
|
500
447
|
nineZone = initializePanel(nineZone, frontstageDef, StagePanelLocation.Bottom);
|
|
501
448
|
nineZone = produce(nineZone, (draft) => {
|
|
449
|
+
var _a, _b, _c, _d;
|
|
502
450
|
for (const [, panel] of Object.entries(draft.panels)) {
|
|
503
451
|
const expanded = panel.widgets.find((widgetId) => draft.widgets[widgetId].minimized === false);
|
|
504
452
|
const firstWidget = panel.widgets.length > 0 ? draft.widgets[panel.widgets[0]] : undefined;
|
|
@@ -507,10 +455,10 @@ export function initializeNineZoneState(frontstageDef) {
|
|
|
507
455
|
firstWidget.minimized = false;
|
|
508
456
|
}
|
|
509
457
|
}
|
|
510
|
-
draft.panels.left.collapsed = isPanelCollapsed(frontstageDef.leftPanel
|
|
511
|
-
draft.panels.right.collapsed = isPanelCollapsed(frontstageDef.rightPanel
|
|
512
|
-
draft.panels.top.collapsed = isPanelCollapsed(frontstageDef.topPanel
|
|
513
|
-
draft.panels.bottom.collapsed = isPanelCollapsed(frontstageDef.bottomPanel
|
|
458
|
+
draft.panels.left.collapsed = isPanelCollapsed((_a = frontstageDef.leftPanel) === null || _a === void 0 ? void 0 : _a.panelState);
|
|
459
|
+
draft.panels.right.collapsed = isPanelCollapsed((_b = frontstageDef.rightPanel) === null || _b === void 0 ? void 0 : _b.panelState);
|
|
460
|
+
draft.panels.top.collapsed = isPanelCollapsed((_c = frontstageDef.topPanel) === null || _c === void 0 ? void 0 : _c.panelState);
|
|
461
|
+
draft.panels.bottom.collapsed = isPanelCollapsed((_d = frontstageDef.bottomPanel) === null || _d === void 0 ? void 0 : _d.panelState);
|
|
514
462
|
});
|
|
515
463
|
nineZone = addMissingWidgets(frontstageDef, nineZone);
|
|
516
464
|
const toolSettingsWidgetDef = frontstageDef.toolSettings;
|
|
@@ -519,7 +467,7 @@ export function initializeNineZoneState(frontstageDef) {
|
|
|
519
467
|
nineZone = addDockedToolSettings(nineZone, toolSettingsTabId);
|
|
520
468
|
}
|
|
521
469
|
nineZone = hideWidgets(nineZone, frontstageDef);
|
|
522
|
-
nineZone = processPopoutWidgets(nineZone
|
|
470
|
+
nineZone = processPopoutWidgets(nineZone);
|
|
523
471
|
return nineZone;
|
|
524
472
|
}
|
|
525
473
|
/** Converts from saved NineZoneState to NineZoneState.
|
|
@@ -528,23 +476,23 @@ export function initializeNineZoneState(frontstageDef) {
|
|
|
528
476
|
* @internal
|
|
529
477
|
*/
|
|
530
478
|
export function restoreNineZoneState(frontstageDef, saved) {
|
|
531
|
-
let
|
|
479
|
+
let state = {
|
|
532
480
|
...saved,
|
|
533
481
|
tabs: {},
|
|
534
482
|
};
|
|
535
483
|
for (const [, tab] of Object.entries(saved.tabs)) {
|
|
536
484
|
// Re-add the placeholder tab in order to correctly remove it from the state if WidgetDef is not found.
|
|
537
|
-
|
|
485
|
+
state = addTab(state, tab.id);
|
|
538
486
|
const widgetDef = frontstageDef.findWidgetDef(tab.id);
|
|
539
487
|
if (!widgetDef) {
|
|
540
488
|
Logger.logInfo(UiFramework.loggerCategory(restoreNineZoneState), "WidgetDef is not found for saved tab.", () => ({
|
|
541
489
|
frontstageId: frontstageDef.id,
|
|
542
490
|
tabId: tab.id,
|
|
543
491
|
}));
|
|
544
|
-
|
|
492
|
+
state = removeTab(state, tab.id);
|
|
545
493
|
continue;
|
|
546
494
|
}
|
|
547
|
-
|
|
495
|
+
state = produce(state, (draft) => {
|
|
548
496
|
draft.tabs[tab.id] = {
|
|
549
497
|
...tab,
|
|
550
498
|
...toTabArgs(widgetDef),
|
|
@@ -553,7 +501,7 @@ export function restoreNineZoneState(frontstageDef, saved) {
|
|
|
553
501
|
};
|
|
554
502
|
});
|
|
555
503
|
}
|
|
556
|
-
|
|
504
|
+
state = produce(state, (draft) => {
|
|
557
505
|
// remove center panel section if one is found in left or right panels
|
|
558
506
|
const oldLeftMiddleIndex = saved.panels.left.widgets.findIndex((value) => value === "leftMiddle");
|
|
559
507
|
// istanbul ignore next
|
|
@@ -584,15 +532,18 @@ export function restoreNineZoneState(frontstageDef, saved) {
|
|
|
584
532
|
if (InternalFrontstageManager.nineZoneSize &&
|
|
585
533
|
(0 !== InternalFrontstageManager.nineZoneSize.height ||
|
|
586
534
|
0 !== InternalFrontstageManager.nineZoneSize.width)) {
|
|
587
|
-
|
|
535
|
+
state = NineZoneStateReducer(state, {
|
|
588
536
|
type: "RESIZE",
|
|
589
537
|
size: {
|
|
590
538
|
height: InternalFrontstageManager.nineZoneSize.height,
|
|
591
539
|
width: InternalFrontstageManager.nineZoneSize.width,
|
|
592
540
|
},
|
|
593
|
-
}
|
|
541
|
+
});
|
|
594
542
|
}
|
|
595
|
-
|
|
543
|
+
state = addMissingWidgets(frontstageDef, state);
|
|
544
|
+
state = hideWidgets(state, frontstageDef);
|
|
545
|
+
state = processPopoutWidgets(state);
|
|
546
|
+
return state;
|
|
596
547
|
}
|
|
597
548
|
/** Prepares NineZoneState to be saved.
|
|
598
549
|
* @note Removes toolSettings tab.
|
|
@@ -615,220 +566,10 @@ export function packNineZoneState(state) {
|
|
|
615
566
|
});
|
|
616
567
|
return packed;
|
|
617
568
|
}
|
|
618
|
-
// istanbul ignore next
|
|
619
|
-
function packSavedWidgets(frontstageDef) {
|
|
620
|
-
let savedWidgets = [];
|
|
621
|
-
for (const widgetDef of frontstageDef.widgetDefs) {
|
|
622
|
-
const id = widgetDef.id;
|
|
623
|
-
const initialWidget = {
|
|
624
|
-
id,
|
|
625
|
-
};
|
|
626
|
-
const widget = produce(initialWidget, (draft) => {
|
|
627
|
-
if (widgetDef.tabLocation) {
|
|
628
|
-
draft.tabLocation = { ...widgetDef.tabLocation };
|
|
629
|
-
}
|
|
630
|
-
if (widgetDef.popoutBounds) {
|
|
631
|
-
draft.popoutBounds = widgetDef.popoutBounds.toProps();
|
|
632
|
-
}
|
|
633
|
-
});
|
|
634
|
-
if (widget === initialWidget)
|
|
635
|
-
continue;
|
|
636
|
-
savedWidgets.push(widget);
|
|
637
|
-
}
|
|
638
|
-
// Add previously saved widgets.
|
|
639
|
-
const prevSavedWidgets = frontstageDef.savedWidgetDefs || [];
|
|
640
|
-
for (const prevWidget of prevSavedWidgets) {
|
|
641
|
-
if (savedWidgets.find((w) => w.id === prevWidget.id))
|
|
642
|
-
continue;
|
|
643
|
-
savedWidgets.push(prevWidget);
|
|
644
|
-
}
|
|
645
|
-
// Limit number of saved widgets.
|
|
646
|
-
const maxWidgets = 100;
|
|
647
|
-
if (savedWidgets.length > maxWidgets)
|
|
648
|
-
savedWidgets = savedWidgets.slice(0, maxWidgets);
|
|
649
|
-
return savedWidgets;
|
|
650
|
-
}
|
|
651
|
-
// istanbul ignore next
|
|
652
|
-
function restoreSavedWidgets(frontstage) {
|
|
653
|
-
const savedWidgets = frontstage.savedWidgetDefs || [];
|
|
654
|
-
for (const savedWidget of savedWidgets) {
|
|
655
|
-
const widgetId = savedWidget.id;
|
|
656
|
-
const widgetDef = frontstage.findWidgetDef(widgetId);
|
|
657
|
-
if (!widgetDef)
|
|
658
|
-
continue;
|
|
659
|
-
if (savedWidget.tabLocation) {
|
|
660
|
-
widgetDef.tabLocation = { ...savedWidget.tabLocation };
|
|
661
|
-
}
|
|
662
|
-
if (savedWidget.popoutBounds) {
|
|
663
|
-
widgetDef.popoutBounds = Rectangle.create(savedWidget.popoutBounds);
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
569
|
/** @internal */
|
|
668
570
|
export function isPanelCollapsed(panelState) {
|
|
669
571
|
return panelState !== StagePanelState.Open;
|
|
670
572
|
}
|
|
671
|
-
function addHiddenWidget(state, widgetDef) {
|
|
672
|
-
const tabLocation = widgetDef.tabLocation || widgetDef.defaultTabLocation;
|
|
673
|
-
const tabId = widgetDef.id;
|
|
674
|
-
const { widgetId, tabIndex } = tabLocation;
|
|
675
|
-
if (widgetId in state.widgets) {
|
|
676
|
-
// Add to an existing widget (by widget id).
|
|
677
|
-
return insertTabToWidget(state, tabId, widgetId, tabIndex);
|
|
678
|
-
}
|
|
679
|
-
else if (tabLocation.floatingWidget) {
|
|
680
|
-
const floatingWidget = tabLocation.floatingWidget;
|
|
681
|
-
assert(widgetId === floatingWidget.id);
|
|
682
|
-
// Add to a new floating widget.
|
|
683
|
-
const nzBounds = Rectangle.createFromSize(state.size);
|
|
684
|
-
const bounds = Rectangle.create(floatingWidget.bounds).containIn(nzBounds);
|
|
685
|
-
return addFloatingWidget(state, floatingWidget.id, [tabId], {
|
|
686
|
-
...floatingWidget,
|
|
687
|
-
bounds: bounds.toProps(),
|
|
688
|
-
});
|
|
689
|
-
}
|
|
690
|
-
// Add to a panel section.
|
|
691
|
-
const panel = state.panels[tabLocation.side];
|
|
692
|
-
// Add to existing panel section.
|
|
693
|
-
if (panel.widgets.length >= panel.maxWidgetCount) {
|
|
694
|
-
const sectionIndex = Math.min(panel.maxWidgetCount - 1, tabLocation.widgetIndex);
|
|
695
|
-
const sectionId = panel.widgets[sectionIndex];
|
|
696
|
-
return insertTabToWidget(state, tabId, sectionId, tabLocation.tabIndex);
|
|
697
|
-
}
|
|
698
|
-
// Create a new panel section.
|
|
699
|
-
const newSectionId = getUniqueId();
|
|
700
|
-
return insertPanelWidget(state, panel.side, newSectionId, [tabId], tabLocation.widgetIndex);
|
|
701
|
-
}
|
|
702
|
-
/** @internal */
|
|
703
|
-
export function setWidgetState(state, widgetDef, widgetState) {
|
|
704
|
-
if (widgetState === WidgetState.Hidden) {
|
|
705
|
-
return hideWidget(state, widgetDef);
|
|
706
|
-
}
|
|
707
|
-
else if (widgetState === WidgetState.Open) {
|
|
708
|
-
const id = widgetDef.id;
|
|
709
|
-
if (widgetDef.isToolSettings) {
|
|
710
|
-
if (!state.toolSettings && !widgetDef.tabLocation) {
|
|
711
|
-
state = addDockedToolSettings(state, id);
|
|
712
|
-
}
|
|
713
|
-
if (state.toolSettings?.type === "docked")
|
|
714
|
-
return state;
|
|
715
|
-
}
|
|
716
|
-
let location = getTabLocation(state, id);
|
|
717
|
-
if (!location) {
|
|
718
|
-
state = addHiddenWidget(state, widgetDef);
|
|
719
|
-
location = getTabLocation(state, id);
|
|
720
|
-
if (widgetDef.isToolSettings) {
|
|
721
|
-
state = addWidgetToolSettings(state, id);
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
|
-
return produce(state, (draft) => {
|
|
725
|
-
assert(!!location);
|
|
726
|
-
const widget = draft.widgets[location.widgetId];
|
|
727
|
-
widget.minimized = false;
|
|
728
|
-
widget.activeTabId = id;
|
|
729
|
-
if (isFloatingTabLocation(location)) {
|
|
730
|
-
const floatingWidget = draft.floatingWidgets.byId[location.floatingWidgetId];
|
|
731
|
-
floatingWidget.hidden = false;
|
|
732
|
-
// istanbul ignore else
|
|
733
|
-
}
|
|
734
|
-
else if (isPanelTabLocation(location)) {
|
|
735
|
-
const panel = draft.panels[location.side];
|
|
736
|
-
panel.collapsed = false;
|
|
737
|
-
if (undefined === panel.size || 0 === panel.size) {
|
|
738
|
-
// istanbul ignore next
|
|
739
|
-
panel.size = panel.minSize ?? 200;
|
|
740
|
-
}
|
|
741
|
-
}
|
|
742
|
-
});
|
|
743
|
-
}
|
|
744
|
-
else if (widgetState === WidgetState.Closed) {
|
|
745
|
-
const id = widgetDef.id;
|
|
746
|
-
if (widgetDef.isToolSettings && state.toolSettings?.type !== "widget") {
|
|
747
|
-
return state;
|
|
748
|
-
}
|
|
749
|
-
let location = getTabLocation(state, id);
|
|
750
|
-
if (!location) {
|
|
751
|
-
state = addHiddenWidget(state, widgetDef);
|
|
752
|
-
location = getTabLocation(state, id);
|
|
753
|
-
}
|
|
754
|
-
// TODO: should change activeTabId of a widget with multiple tabs.
|
|
755
|
-
return produce(state, (draft) => {
|
|
756
|
-
assert(!!location);
|
|
757
|
-
const widget = draft.widgets[location.widgetId];
|
|
758
|
-
if (isFloatingTabLocation(location)) {
|
|
759
|
-
if (id === widget.activeTabId) {
|
|
760
|
-
widget.minimized = true;
|
|
761
|
-
}
|
|
762
|
-
}
|
|
763
|
-
});
|
|
764
|
-
}
|
|
765
|
-
else if (widgetState === WidgetState.Floating) {
|
|
766
|
-
const id = widgetDef.id;
|
|
767
|
-
let location = getTabLocation(state, id);
|
|
768
|
-
if (!location) {
|
|
769
|
-
state = addHiddenWidget(state, widgetDef);
|
|
770
|
-
location = getTabLocation(state, id);
|
|
771
|
-
}
|
|
772
|
-
assert(!!location);
|
|
773
|
-
if (isFloatingTabLocation(location))
|
|
774
|
-
return state;
|
|
775
|
-
// Widget is not floating.
|
|
776
|
-
state = removeTabFromWidget(state, id);
|
|
777
|
-
const bounds = widgetDef.tabLocation?.floatingWidget?.bounds;
|
|
778
|
-
state = addFloatingWidget(state, getUniqueId(), [id], { bounds });
|
|
779
|
-
if (widgetDef.isToolSettings) {
|
|
780
|
-
if (state.toolSettings?.type === "docked") {
|
|
781
|
-
state = removeToolSettings(state);
|
|
782
|
-
}
|
|
783
|
-
if (!state.toolSettings) {
|
|
784
|
-
state = addWidgetToolSettings(state, id);
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
}
|
|
788
|
-
return state;
|
|
789
|
-
}
|
|
790
|
-
/** Stores widget location and hides it in the UI. */
|
|
791
|
-
function hideWidget(state, widgetDef) {
|
|
792
|
-
const toolSettingsTabId = state.toolSettings?.tabId;
|
|
793
|
-
if (widgetDef.id === toolSettingsTabId) {
|
|
794
|
-
widgetDef.tabLocation = undefined;
|
|
795
|
-
state = produce(state, (draft) => {
|
|
796
|
-
draft.toolSettings = undefined;
|
|
797
|
-
});
|
|
798
|
-
if (state.toolSettings?.type === "docked")
|
|
799
|
-
return state;
|
|
800
|
-
}
|
|
801
|
-
const location = getTabLocation(state, widgetDef.id);
|
|
802
|
-
if (!location)
|
|
803
|
-
return state;
|
|
804
|
-
// istanbul ignore else
|
|
805
|
-
if (isFloatingTabLocation(location)) {
|
|
806
|
-
const floatingWidget = state.floatingWidgets.byId[location.widgetId];
|
|
807
|
-
widgetDef.setFloatingContainerId(location.floatingWidgetId);
|
|
808
|
-
widgetDef.tabLocation = {
|
|
809
|
-
side: floatingWidget.home.side,
|
|
810
|
-
tabIndex: floatingWidget.home.widgetIndex,
|
|
811
|
-
widgetId: floatingWidget.id,
|
|
812
|
-
widgetIndex: floatingWidget.home.widgetIndex,
|
|
813
|
-
floatingWidget,
|
|
814
|
-
};
|
|
815
|
-
}
|
|
816
|
-
else if (!isPopoutTabLocation(location)) {
|
|
817
|
-
const widgetId = location.widgetId;
|
|
818
|
-
const side = isPanelTabLocation(location) ? location.side : "left";
|
|
819
|
-
const widgetIndex = isPanelTabLocation(location)
|
|
820
|
-
? state.panels[side].widgets.indexOf(widgetId)
|
|
821
|
-
: 0;
|
|
822
|
-
const tabIndex = state.widgets[location.widgetId].tabs.indexOf(widgetDef.id);
|
|
823
|
-
widgetDef.tabLocation = {
|
|
824
|
-
side,
|
|
825
|
-
tabIndex,
|
|
826
|
-
widgetId,
|
|
827
|
-
widgetIndex,
|
|
828
|
-
};
|
|
829
|
-
}
|
|
830
|
-
return removeTabFromWidget(state, widgetDef.id);
|
|
831
|
-
}
|
|
832
573
|
/** @internal */
|
|
833
574
|
export function showWidget(state, id) {
|
|
834
575
|
const location = getTabLocation(state, id);
|
|
@@ -866,15 +607,6 @@ export function expandWidget(state, id) {
|
|
|
866
607
|
});
|
|
867
608
|
}
|
|
868
609
|
/** @internal */
|
|
869
|
-
export function setWidgetLabel(state, id, label) {
|
|
870
|
-
if (!(id in state.tabs))
|
|
871
|
-
return state;
|
|
872
|
-
return produce(state, (draft) => {
|
|
873
|
-
const tab = draft.tabs[id];
|
|
874
|
-
tab.label = label;
|
|
875
|
-
});
|
|
876
|
-
}
|
|
877
|
-
/** @internal */
|
|
878
610
|
export function useSavedFrontstageState(frontstageDef) {
|
|
879
611
|
const uiStateStorage = useUiStateStorageHandler();
|
|
880
612
|
const uiStateStorageRef = React.useRef(uiStateStorage);
|
|
@@ -891,7 +623,7 @@ export function useSavedFrontstageState(frontstageDef) {
|
|
|
891
623
|
React.useEffect(() => {
|
|
892
624
|
async function fetchFrontstageState() {
|
|
893
625
|
if (frontstageDef.nineZoneState) {
|
|
894
|
-
frontstageDef.nineZoneState = processPopoutWidgets(frontstageDef.nineZoneState
|
|
626
|
+
frontstageDef.nineZoneState = processPopoutWidgets(frontstageDef.nineZoneState);
|
|
895
627
|
return;
|
|
896
628
|
}
|
|
897
629
|
const id = frontstageDef.id;
|
|
@@ -903,13 +635,7 @@ export function useSavedFrontstageState(frontstageDef) {
|
|
|
903
635
|
const setting = settingResult.setting;
|
|
904
636
|
if (setting.version === version &&
|
|
905
637
|
setting.stateVersion === stateVersion) {
|
|
906
|
-
|
|
907
|
-
frontstageDef.savedWidgetDefs = setting.widgets;
|
|
908
|
-
restoreSavedWidgets(frontstageDef);
|
|
909
|
-
let state = addMissingWidgets(frontstageDef, restored);
|
|
910
|
-
state = hideWidgets(state, frontstageDef);
|
|
911
|
-
state = processPopoutWidgets(state, frontstageDef);
|
|
912
|
-
frontstageDef.nineZoneState = state;
|
|
638
|
+
frontstageDef.nineZoneState = restoreNineZoneState(frontstageDef, setting.nineZone);
|
|
913
639
|
return;
|
|
914
640
|
}
|
|
915
641
|
}
|
|
@@ -924,14 +650,11 @@ export function useSaveFrontstageSettings(frontstageDef, store) {
|
|
|
924
650
|
const saveSetting = React.useMemo(() => {
|
|
925
651
|
const debounced = debounce(async (frontstage, state) => {
|
|
926
652
|
const id = frontstage.id;
|
|
927
|
-
const widgets = packSavedWidgets(frontstage);
|
|
928
|
-
frontstage.savedWidgetDefs = widgets;
|
|
929
653
|
const setting = {
|
|
930
654
|
id,
|
|
931
655
|
version: frontstage.version,
|
|
932
656
|
stateVersion,
|
|
933
657
|
nineZone: packNineZoneState(state),
|
|
934
|
-
widgets,
|
|
935
658
|
};
|
|
936
659
|
await uiSettingsStorage.saveSetting(FRONTSTAGE_SETTINGS_NAMESPACE, getFrontstageStateSettingName(id), setting);
|
|
937
660
|
}, 1000);
|
|
@@ -979,49 +702,11 @@ function debounce(func, duration) {
|
|
|
979
702
|
};
|
|
980
703
|
return debounced;
|
|
981
704
|
}
|
|
982
|
-
const createListener = (frontstageDef, listener) => {
|
|
983
|
-
return (...args) => {
|
|
984
|
-
if (!frontstageDef.nineZoneState)
|
|
985
|
-
return;
|
|
986
|
-
listener(...args);
|
|
987
|
-
};
|
|
988
|
-
};
|
|
989
705
|
/** @internal */
|
|
990
706
|
export function useFrontstageManager(frontstageDef, useToolAsToolSettingsLabel) {
|
|
991
|
-
React.useEffect(() => {
|
|
992
|
-
return UiFramework.frontstages.onWidgetStateChangedEvent.addListener(({ widgetDef, widgetState }) => {
|
|
993
|
-
if (!frontstageDef.nineZoneState)
|
|
994
|
-
return;
|
|
995
|
-
frontstageDef.nineZoneState = setWidgetState(frontstageDef.nineZoneState, widgetDef, widgetState);
|
|
996
|
-
});
|
|
997
|
-
}, [frontstageDef]);
|
|
998
|
-
React.useEffect(() => {
|
|
999
|
-
const listener = createListener(frontstageDef, ({ widgetDef }) => {
|
|
1000
|
-
assert(!!frontstageDef.nineZoneState);
|
|
1001
|
-
const nineZoneState = setWidgetState(frontstageDef.nineZoneState, widgetDef, WidgetState.Open);
|
|
1002
|
-
frontstageDef.nineZoneState = showWidget(nineZoneState, widgetDef.id);
|
|
1003
|
-
});
|
|
1004
|
-
InternalFrontstageManager.onWidgetShowEvent.addListener(listener);
|
|
1005
|
-
return () => {
|
|
1006
|
-
InternalFrontstageManager.onWidgetShowEvent.removeListener(listener);
|
|
1007
|
-
};
|
|
1008
|
-
}, [frontstageDef]);
|
|
1009
|
-
React.useEffect(() => {
|
|
1010
|
-
const listener = createListener(frontstageDef, ({ widgetDef }) => {
|
|
1011
|
-
assert(!!frontstageDef.nineZoneState);
|
|
1012
|
-
let nineZoneState = setWidgetState(frontstageDef.nineZoneState, widgetDef, WidgetState.Open);
|
|
1013
|
-
nineZoneState = showWidget(nineZoneState, widgetDef.id);
|
|
1014
|
-
nineZoneState = expandWidget(nineZoneState, widgetDef.id);
|
|
1015
|
-
frontstageDef.nineZoneState = nineZoneState;
|
|
1016
|
-
});
|
|
1017
|
-
InternalFrontstageManager.onWidgetExpandEvent.addListener(listener);
|
|
1018
|
-
return () => {
|
|
1019
|
-
InternalFrontstageManager.onWidgetExpandEvent.removeListener(listener);
|
|
1020
|
-
};
|
|
1021
|
-
}, [frontstageDef]);
|
|
1022
707
|
const uiSettingsStorage = useUiStateStorageHandler();
|
|
1023
708
|
React.useEffect(() => {
|
|
1024
|
-
|
|
709
|
+
return InternalFrontstageManager.onFrontstageRestoreLayoutEvent.addListener((args) => {
|
|
1025
710
|
// TODO: track restoring frontstages to support workflows: i.e. prevent loading frontstage OR saving layout when delete is pending
|
|
1026
711
|
void uiSettingsStorage.deleteSetting(FRONTSTAGE_SETTINGS_NAMESPACE, getFrontstageStateSettingName(args.frontstageDef.id));
|
|
1027
712
|
if (frontstageDef.id === args.frontstageDef.id) {
|
|
@@ -1031,52 +716,37 @@ export function useFrontstageManager(frontstageDef, useToolAsToolSettingsLabel)
|
|
|
1031
716
|
else {
|
|
1032
717
|
args.frontstageDef.nineZoneState = undefined;
|
|
1033
718
|
}
|
|
1034
|
-
};
|
|
1035
|
-
InternalFrontstageManager.onFrontstageRestoreLayoutEvent.addListener(listener);
|
|
1036
|
-
return () => {
|
|
1037
|
-
InternalFrontstageManager.onFrontstageRestoreLayoutEvent.removeListener(listener);
|
|
1038
|
-
};
|
|
1039
|
-
}, [uiSettingsStorage, frontstageDef]);
|
|
1040
|
-
React.useEffect(() => {
|
|
1041
|
-
const listener = createListener(frontstageDef, ({ widgetDef }) => {
|
|
1042
|
-
assert(!!frontstageDef.nineZoneState);
|
|
1043
|
-
const label = widgetDef.label;
|
|
1044
|
-
frontstageDef.nineZoneState = setWidgetLabel(frontstageDef.nineZoneState, widgetDef.id, label);
|
|
1045
719
|
});
|
|
1046
|
-
|
|
1047
|
-
return () => {
|
|
1048
|
-
InternalFrontstageManager.onWidgetLabelChangedEvent.removeListener(listener);
|
|
1049
|
-
};
|
|
1050
|
-
}, [frontstageDef]);
|
|
720
|
+
}, [uiSettingsStorage, frontstageDef]);
|
|
1051
721
|
const defaultLabel = React.useMemo(() => UiFramework.translate("widget.labels.toolSettings"), []);
|
|
1052
722
|
React.useEffect(() => {
|
|
1053
|
-
const updateLabel =
|
|
723
|
+
const updateLabel = () => {
|
|
724
|
+
var _a, _b;
|
|
725
|
+
const state = frontstageDef.nineZoneState;
|
|
726
|
+
if (!state)
|
|
727
|
+
return;
|
|
728
|
+
const toolSettingsTabId = (_a = state.toolSettings) === null || _a === void 0 ? void 0 : _a.tabId;
|
|
729
|
+
if (!toolSettingsTabId)
|
|
730
|
+
return;
|
|
1054
731
|
const toolId = UiFramework.frontstages.activeToolId;
|
|
1055
|
-
assert(!!frontstageDef.nineZoneState);
|
|
1056
732
|
const label = useToolAsToolSettingsLabel
|
|
1057
|
-
? IModelApp.tools.find(toolId)
|
|
733
|
+
? ((_b = IModelApp.tools.find(toolId)) === null || _b === void 0 ? void 0 : _b.flyover) || defaultLabel
|
|
1058
734
|
: defaultLabel;
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
735
|
+
frontstageDef.dispatch({
|
|
736
|
+
type: "WIDGET_TAB_SET_LABEL",
|
|
737
|
+
id: toolSettingsTabId,
|
|
738
|
+
label,
|
|
739
|
+
});
|
|
740
|
+
};
|
|
1064
741
|
// Whenever the frontstageDef or the useTool... changes, keep the label up to date.
|
|
1065
742
|
updateLabel();
|
|
743
|
+
const removeListenerFuncs = [];
|
|
1066
744
|
// If useTool... is true, listen for events to keep up the label up to date.
|
|
1067
745
|
if (useToolAsToolSettingsLabel) {
|
|
1068
|
-
UiFramework.frontstages.onFrontstageReadyEvent.addListener(updateLabel);
|
|
1069
|
-
InternalFrontstageManager.onFrontstageRestoreLayoutEvent.addListener(updateLabel);
|
|
1070
|
-
UiFramework.frontstages.onToolActivatedEvent.addListener(updateLabel);
|
|
1071
|
-
UiFramework.frontstages.onToolSettingsReloadEvent.addListener(updateLabel);
|
|
746
|
+
removeListenerFuncs.push(UiFramework.frontstages.onFrontstageReadyEvent.addListener(updateLabel), InternalFrontstageManager.onFrontstageRestoreLayoutEvent.addListener(updateLabel), UiFramework.frontstages.onToolActivatedEvent.addListener(updateLabel), UiFramework.frontstages.onToolSettingsReloadEvent.addListener(updateLabel));
|
|
1072
747
|
}
|
|
1073
748
|
return () => {
|
|
1074
|
-
|
|
1075
|
-
UiFramework.frontstages.onFrontstageReadyEvent.removeListener(updateLabel);
|
|
1076
|
-
InternalFrontstageManager.onFrontstageRestoreLayoutEvent.removeListener(updateLabel);
|
|
1077
|
-
UiFramework.frontstages.onToolActivatedEvent.removeListener(updateLabel);
|
|
1078
|
-
UiFramework.frontstages.onToolSettingsReloadEvent.removeListener(updateLabel);
|
|
1079
|
-
}
|
|
749
|
+
removeListenerFuncs.forEach((removeListener) => removeListener());
|
|
1080
750
|
};
|
|
1081
751
|
}, [frontstageDef, useToolAsToolSettingsLabel, defaultLabel]);
|
|
1082
752
|
}
|
|
@@ -1086,23 +756,22 @@ export function useItemsManager(frontstageDef) {
|
|
|
1086
756
|
const refreshNineZoneState = (def) => {
|
|
1087
757
|
// Fired for both registered/unregistered. Update definitions and remove/add missing widgets.
|
|
1088
758
|
def.updateWidgetDefs();
|
|
1089
|
-
restoreSavedWidgets(def);
|
|
1090
759
|
let state = def.nineZoneState;
|
|
1091
760
|
if (!state)
|
|
1092
761
|
return;
|
|
1093
762
|
state = addMissingWidgets(def, state);
|
|
1094
763
|
state = removeMissingWidgets(def, state);
|
|
1095
|
-
state = hideWidgets(state, def); // TODO: should only apply to widgets provided by registered provider in onUiProviderRegisteredEvent.
|
|
1096
764
|
def.nineZoneState = state;
|
|
1097
765
|
};
|
|
1098
766
|
React.useEffect(() => {
|
|
1099
|
-
const remove = UiItemsManager.onUiProviderRegisteredEvent.addListener(() => {
|
|
1100
|
-
refreshNineZoneState(frontstageDef);
|
|
1101
|
-
});
|
|
1102
767
|
// Need to refresh anytime frontstageDef changes because uiItemsProvider may have added something to
|
|
1103
768
|
// another stage before it was possibly unloaded in this stage.
|
|
1104
769
|
refreshNineZoneState(frontstageDef);
|
|
1105
|
-
|
|
770
|
+
}, [frontstageDef]);
|
|
771
|
+
React.useEffect(() => {
|
|
772
|
+
return UiItemsManager.onUiProviderRegisteredEvent.addListener(() => {
|
|
773
|
+
refreshNineZoneState(frontstageDef);
|
|
774
|
+
});
|
|
1106
775
|
}, [frontstageDef]);
|
|
1107
776
|
}
|
|
1108
777
|
// istanbul ignore next
|