@itwin/appui-react 4.8.1 → 4.9.0-dev.1
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 +8 -7
- package/lib/cjs/appui-react/UiFramework.d.ts.map +1 -1
- package/lib/cjs/appui-react/UiFramework.js +6 -0
- package/lib/cjs/appui-react/UiFramework.js.map +1 -1
- package/lib/cjs/appui-react/accudraw/AccuDrawFieldContainer.d.ts +4 -2
- package/lib/cjs/appui-react/accudraw/AccuDrawFieldContainer.d.ts.map +1 -1
- package/lib/cjs/appui-react/accudraw/AccuDrawFieldContainer.js +17 -29
- package/lib/cjs/appui-react/accudraw/AccuDrawFieldContainer.js.map +1 -1
- package/lib/cjs/appui-react/accudraw/AccuDrawFieldContainer.scss +10 -17
- package/lib/cjs/appui-react/accudraw/AccuDrawInputField.scss +2 -0
- package/lib/cjs/appui-react/accudraw/SquareButton.d.ts +3 -1
- package/lib/cjs/appui-react/accudraw/SquareButton.d.ts.map +1 -1
- package/lib/cjs/appui-react/accudraw/SquareButton.js +1 -4
- package/lib/cjs/appui-react/accudraw/SquareButton.js.map +1 -1
- package/lib/cjs/appui-react/childwindow/InternalChildWindowManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/childwindow/InternalChildWindowManager.js +25 -7
- package/lib/cjs/appui-react/childwindow/InternalChildWindowManager.js.map +1 -1
- package/lib/cjs/appui-react/configurableui/ConfigurableUiContent.d.ts +1 -1
- package/lib/cjs/appui-react/configurableui/ConfigurableUiContent.d.ts.map +1 -1
- package/lib/cjs/appui-react/configurableui/ConfigurableUiContent.js +19 -15
- package/lib/cjs/appui-react/configurableui/ConfigurableUiContent.js.map +1 -1
- package/lib/cjs/appui-react/configurableui/InternalConfigurableUiManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/configurableui/InternalConfigurableUiManager.js +2 -0
- package/lib/cjs/appui-react/configurableui/InternalConfigurableUiManager.js.map +1 -1
- package/lib/cjs/appui-react/content/ContentControl.d.ts.map +1 -1
- package/lib/cjs/appui-react/content/ContentControl.js +1 -0
- package/lib/cjs/appui-react/content/ContentControl.js.map +1 -1
- package/lib/cjs/appui-react/content/ContentGroup.d.ts.map +1 -1
- package/lib/cjs/appui-react/content/ContentGroup.js +2 -0
- package/lib/cjs/appui-react/content/ContentGroup.js.map +1 -1
- package/lib/cjs/appui-react/content/ContentLayout.d.ts.map +1 -1
- package/lib/cjs/appui-react/content/ContentLayout.js +1 -0
- package/lib/cjs/appui-react/content/ContentLayout.js.map +1 -1
- package/lib/cjs/appui-react/content/IModelViewport.d.ts.map +1 -1
- package/lib/cjs/appui-react/content/IModelViewport.js +1 -0
- package/lib/cjs/appui-react/content/IModelViewport.js.map +1 -1
- package/lib/cjs/appui-react/content/InternalContentViewManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/content/InternalContentViewManager.js +1 -0
- package/lib/cjs/appui-react/content/InternalContentViewManager.js.map +1 -1
- package/lib/cjs/appui-react/cursor/CursorInformation.d.ts.map +1 -1
- package/lib/cjs/appui-react/cursor/CursorInformation.js +1 -0
- package/lib/cjs/appui-react/cursor/CursorInformation.js.map +1 -1
- package/lib/cjs/appui-react/cursor/cursorpopup/CursorPopupManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/cursor/cursorpopup/CursorPopupManager.js +3 -0
- package/lib/cjs/appui-react/cursor/cursorpopup/CursorPopupManager.js.map +1 -1
- package/lib/cjs/appui-react/dialog/DialogManagerBase.d.ts.map +1 -1
- package/lib/cjs/appui-react/dialog/DialogManagerBase.js +1 -0
- package/lib/cjs/appui-react/dialog/DialogManagerBase.js.map +1 -1
- package/lib/cjs/appui-react/feedback/ElementTooltip.d.ts.map +1 -1
- package/lib/cjs/appui-react/feedback/ElementTooltip.js +3 -3
- package/lib/cjs/appui-react/feedback/ElementTooltip.js.map +1 -1
- package/lib/cjs/appui-react/framework/FrameworkContent.d.ts.map +1 -1
- package/lib/cjs/appui-react/framework/FrameworkContent.js +2 -0
- package/lib/cjs/appui-react/framework/FrameworkContent.js.map +1 -1
- package/lib/cjs/appui-react/framework/FrameworkFrontstages.d.ts.map +1 -1
- package/lib/cjs/appui-react/framework/FrameworkFrontstages.js +8 -0
- package/lib/cjs/appui-react/framework/FrameworkFrontstages.js.map +1 -1
- package/lib/cjs/appui-react/framework/FrameworkToolSettings.d.ts.map +1 -1
- package/lib/cjs/appui-react/framework/FrameworkToolSettings.js +1 -0
- package/lib/cjs/appui-react/framework/FrameworkToolSettings.js.map +1 -1
- package/lib/cjs/appui-react/frontstage/FrontstageDef.d.ts +8 -2
- package/lib/cjs/appui-react/frontstage/FrontstageDef.d.ts.map +1 -1
- package/lib/cjs/appui-react/frontstage/FrontstageDef.js +25 -8
- package/lib/cjs/appui-react/frontstage/FrontstageDef.js.map +1 -1
- package/lib/cjs/appui-react/frontstage/InternalFrontstageManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/frontstage/InternalFrontstageManager.js +15 -4
- package/lib/cjs/appui-react/frontstage/InternalFrontstageManager.js.map +1 -1
- package/lib/cjs/appui-react/frontstage/ModalFrontstage.d.ts +2 -4
- package/lib/cjs/appui-react/frontstage/ModalFrontstage.d.ts.map +1 -1
- package/lib/cjs/appui-react/frontstage/ModalFrontstage.js +2 -3
- package/lib/cjs/appui-react/frontstage/ModalFrontstage.js.map +1 -1
- package/lib/cjs/appui-react/frontstage/ModalFrontstage.scss +1 -1
- package/lib/cjs/appui-react/frontstage/StandardFrontstageProvider.d.ts.map +1 -1
- package/lib/cjs/appui-react/frontstage/StandardFrontstageProvider.js +5 -5
- package/lib/cjs/appui-react/frontstage/StandardFrontstageProvider.js.map +1 -1
- package/lib/cjs/appui-react/keyboardshortcut/KeyboardShortcut.d.ts.map +1 -1
- package/lib/cjs/appui-react/keyboardshortcut/KeyboardShortcut.js +1 -0
- package/lib/cjs/appui-react/keyboardshortcut/KeyboardShortcut.js.map +1 -1
- package/lib/cjs/appui-react/keyboardshortcut/KeyboardShortcutMenu.d.ts.map +1 -1
- package/lib/cjs/appui-react/keyboardshortcut/KeyboardShortcutMenu.js +1 -0
- package/lib/cjs/appui-react/keyboardshortcut/KeyboardShortcutMenu.js.map +1 -1
- package/lib/cjs/appui-react/messages/InputField.d.ts.map +1 -1
- package/lib/cjs/appui-react/messages/InputField.js +2 -3
- package/lib/cjs/appui-react/messages/InputField.js.map +1 -1
- package/lib/cjs/appui-react/messages/MessageLabel.js +2 -2
- package/lib/cjs/appui-react/messages/MessageLabel.js.map +1 -1
- package/lib/cjs/appui-react/messages/MessageManager.d.ts +15 -5
- package/lib/cjs/appui-react/messages/MessageManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/messages/MessageManager.js +31 -39
- package/lib/cjs/appui-react/messages/MessageManager.js.map +1 -1
- package/lib/cjs/appui-react/messages/MessageRenderer.d.ts +8 -0
- package/lib/cjs/appui-react/messages/MessageRenderer.d.ts.map +1 -0
- package/lib/cjs/appui-react/messages/{ActivityMessage.js → MessageRenderer.js} +60 -14
- package/lib/cjs/appui-react/messages/MessageRenderer.js.map +1 -0
- package/lib/cjs/appui-react/messages/Pointer.d.ts.map +1 -1
- package/lib/cjs/appui-react/messages/Pointer.js +4 -3
- package/lib/cjs/appui-react/messages/Pointer.js.map +1 -1
- package/lib/cjs/appui-react/messages/getToastCategory.d.ts +1 -1
- package/lib/cjs/appui-react/navigationaids/NavigationAidControl.d.ts.map +1 -1
- package/lib/cjs/appui-react/navigationaids/NavigationAidControl.js +1 -0
- package/lib/cjs/appui-react/navigationaids/NavigationAidControl.js.map +1 -1
- package/lib/cjs/appui-react/navigationaids/SheetsModalFrontstage.d.ts.map +1 -1
- package/lib/cjs/appui-react/navigationaids/SheetsModalFrontstage.js +1 -0
- package/lib/cjs/appui-react/navigationaids/SheetsModalFrontstage.js.map +1 -1
- package/lib/cjs/appui-react/pickers/ViewSelector.d.ts.map +1 -1
- package/lib/cjs/appui-react/pickers/ViewSelector.js +2 -0
- package/lib/cjs/appui-react/pickers/ViewSelector.js.map +1 -1
- package/lib/cjs/appui-react/popup/CardPopup.d.ts.map +1 -1
- package/lib/cjs/appui-react/popup/CardPopup.js +1 -2
- package/lib/cjs/appui-react/popup/CardPopup.js.map +1 -1
- package/lib/cjs/appui-react/popup/HTMLElementPopup.d.ts.map +1 -1
- package/lib/cjs/appui-react/popup/HTMLElementPopup.js +1 -2
- package/lib/cjs/appui-react/popup/HTMLElementPopup.js.map +1 -1
- package/lib/cjs/appui-react/popup/PopupManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/popup/PopupManager.js +1 -0
- package/lib/cjs/appui-react/popup/PopupManager.js.map +1 -1
- package/lib/cjs/appui-react/redux/ReducerRegistry.d.ts.map +1 -1
- package/lib/cjs/appui-react/redux/ReducerRegistry.js +1 -0
- package/lib/cjs/appui-react/redux/ReducerRegistry.js.map +1 -1
- package/lib/cjs/appui-react/redux/StateManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/redux/StateManager.js +1 -0
- package/lib/cjs/appui-react/redux/StateManager.js.map +1 -1
- package/lib/cjs/appui-react/settings/quantityformatting/QuantityFormat.scss +1 -4
- package/lib/cjs/appui-react/shared/MenuItem.d.ts.map +1 -1
- package/lib/cjs/appui-react/shared/MenuItem.js +1 -0
- package/lib/cjs/appui-react/shared/MenuItem.js.map +1 -1
- package/lib/cjs/appui-react/stagepanels/StagePanelConfig.d.ts +1 -1
- package/lib/cjs/appui-react/stagepanels/StagePanelConfig.d.ts.map +1 -1
- package/lib/cjs/appui-react/stagepanels/StagePanelConfig.js.map +1 -1
- package/lib/cjs/appui-react/stagepanels/StagePanelDef.d.ts +5 -9
- package/lib/cjs/appui-react/stagepanels/StagePanelDef.d.ts.map +1 -1
- package/lib/cjs/appui-react/stagepanels/StagePanelDef.js +19 -18
- package/lib/cjs/appui-react/stagepanels/StagePanelDef.js.map +1 -1
- package/lib/cjs/appui-react/stagepanels/StagePanelState.d.ts +13 -0
- package/lib/cjs/appui-react/stagepanels/StagePanelState.d.ts.map +1 -0
- package/lib/cjs/appui-react/stagepanels/StagePanelState.js +21 -0
- package/lib/cjs/appui-react/stagepanels/StagePanelState.js.map +1 -0
- package/lib/cjs/appui-react/statusbar/StatusBarComposer.js.map +1 -1
- package/lib/cjs/appui-react/statusfields/MessageCenter.d.ts.map +1 -1
- package/lib/cjs/appui-react/statusfields/MessageCenter.js +6 -5
- package/lib/cjs/appui-react/statusfields/MessageCenter.js.map +1 -1
- package/lib/cjs/appui-react/statusfields/SelectionScope.scss +1 -3
- package/lib/cjs/appui-react/statusfields/tileloading/TileLoadingIndicator.d.ts.map +1 -1
- package/lib/cjs/appui-react/statusfields/tileloading/TileLoadingIndicator.js +1 -1
- package/lib/cjs/appui-react/statusfields/tileloading/TileLoadingIndicator.js.map +1 -1
- package/lib/cjs/appui-react/statusfields/tileloading/TileLoadingIndicator.scss +1 -1
- package/lib/cjs/appui-react/statusfields/toolassistance/ToolAssistanceField.d.ts.map +1 -1
- package/lib/cjs/appui-react/statusfields/toolassistance/ToolAssistanceField.js +2 -1
- package/lib/cjs/appui-react/statusfields/toolassistance/ToolAssistanceField.js.map +1 -1
- package/lib/cjs/appui-react/statusfields/toolassistance/ToolAssistanceField.scss +3 -12
- package/lib/cjs/appui-react/theme/ThemeManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/theme/ThemeManager.js +3 -1
- package/lib/cjs/appui-react/theme/ThemeManager.js.map +1 -1
- package/lib/cjs/appui-react/tools/CoreToolDefinitions.d.ts.map +1 -1
- package/lib/cjs/appui-react/tools/CoreToolDefinitions.js +8 -8
- package/lib/cjs/appui-react/tools/CoreToolDefinitions.js.map +1 -1
- package/lib/cjs/appui-react/toolsettings/InternalToolSettingsManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/toolsettings/InternalToolSettingsManager.js +1 -0
- package/lib/cjs/appui-react/toolsettings/InternalToolSettingsManager.js.map +1 -1
- package/lib/cjs/appui-react/toolsettings/ToolInformation.d.ts.map +1 -1
- package/lib/cjs/appui-react/toolsettings/ToolInformation.js +1 -0
- package/lib/cjs/appui-react/toolsettings/ToolInformation.js.map +1 -1
- package/lib/cjs/appui-react/utils/InternalUiShowHideManager.d.ts +1 -0
- package/lib/cjs/appui-react/utils/InternalUiShowHideManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/utils/InternalUiShowHideManager.js +16 -13
- package/lib/cjs/appui-react/utils/InternalUiShowHideManager.js.map +1 -1
- package/lib/cjs/appui-react/widget-panels/Frontstage.d.ts +16 -33
- package/lib/cjs/appui-react/widget-panels/Frontstage.d.ts.map +1 -1
- package/lib/cjs/appui-react/widget-panels/Frontstage.js +243 -386
- package/lib/cjs/appui-react/widget-panels/Frontstage.js.map +1 -1
- package/lib/cjs/appui-react/widget-panels/ToolSettings.scss +1 -1
- package/lib/cjs/appui-react/widgets/WidgetDef.d.ts.map +1 -1
- package/lib/cjs/appui-react/widgets/WidgetDef.js +2 -0
- package/lib/cjs/appui-react/widgets/WidgetDef.js.map +1 -1
- package/lib/cjs/appui-react/widgets/useWidget.d.ts +17 -0
- package/lib/cjs/appui-react/widgets/useWidget.d.ts.map +1 -0
- package/lib/cjs/appui-react/widgets/useWidget.js +70 -0
- package/lib/cjs/appui-react/widgets/useWidget.js.map +1 -0
- package/lib/cjs/appui-react.d.ts +2 -0
- package/lib/cjs/appui-react.d.ts.map +1 -1
- package/lib/cjs/appui-react.js +2 -0
- package/lib/cjs/appui-react.js.map +1 -1
- package/lib/esm/appui-react/UiFramework.d.ts.map +1 -1
- package/lib/esm/appui-react/UiFramework.js +6 -0
- package/lib/esm/appui-react/UiFramework.js.map +1 -1
- package/lib/esm/appui-react/accudraw/AccuDrawFieldContainer.d.ts +4 -2
- package/lib/esm/appui-react/accudraw/AccuDrawFieldContainer.d.ts.map +1 -1
- package/lib/esm/appui-react/accudraw/AccuDrawFieldContainer.js +17 -29
- package/lib/esm/appui-react/accudraw/AccuDrawFieldContainer.js.map +1 -1
- package/lib/esm/appui-react/accudraw/AccuDrawFieldContainer.scss +10 -17
- package/lib/esm/appui-react/accudraw/AccuDrawInputField.scss +2 -0
- package/lib/esm/appui-react/accudraw/SquareButton.d.ts +3 -1
- package/lib/esm/appui-react/accudraw/SquareButton.d.ts.map +1 -1
- package/lib/esm/appui-react/accudraw/SquareButton.js +1 -4
- package/lib/esm/appui-react/accudraw/SquareButton.js.map +1 -1
- package/lib/esm/appui-react/childwindow/InternalChildWindowManager.d.ts.map +1 -1
- package/lib/esm/appui-react/childwindow/InternalChildWindowManager.js +25 -7
- package/lib/esm/appui-react/childwindow/InternalChildWindowManager.js.map +1 -1
- package/lib/esm/appui-react/configurableui/ConfigurableUiContent.d.ts +1 -1
- package/lib/esm/appui-react/configurableui/ConfigurableUiContent.d.ts.map +1 -1
- package/lib/esm/appui-react/configurableui/ConfigurableUiContent.js +19 -15
- package/lib/esm/appui-react/configurableui/ConfigurableUiContent.js.map +1 -1
- package/lib/esm/appui-react/configurableui/InternalConfigurableUiManager.d.ts.map +1 -1
- package/lib/esm/appui-react/configurableui/InternalConfigurableUiManager.js +2 -0
- package/lib/esm/appui-react/configurableui/InternalConfigurableUiManager.js.map +1 -1
- package/lib/esm/appui-react/content/ContentControl.d.ts.map +1 -1
- package/lib/esm/appui-react/content/ContentControl.js +1 -0
- package/lib/esm/appui-react/content/ContentControl.js.map +1 -1
- package/lib/esm/appui-react/content/ContentGroup.d.ts.map +1 -1
- package/lib/esm/appui-react/content/ContentGroup.js +2 -0
- package/lib/esm/appui-react/content/ContentGroup.js.map +1 -1
- package/lib/esm/appui-react/content/ContentLayout.d.ts.map +1 -1
- package/lib/esm/appui-react/content/ContentLayout.js +1 -0
- package/lib/esm/appui-react/content/ContentLayout.js.map +1 -1
- package/lib/esm/appui-react/content/IModelViewport.d.ts.map +1 -1
- package/lib/esm/appui-react/content/IModelViewport.js +1 -0
- package/lib/esm/appui-react/content/IModelViewport.js.map +1 -1
- package/lib/esm/appui-react/content/InternalContentViewManager.d.ts.map +1 -1
- package/lib/esm/appui-react/content/InternalContentViewManager.js +1 -0
- package/lib/esm/appui-react/content/InternalContentViewManager.js.map +1 -1
- package/lib/esm/appui-react/cursor/CursorInformation.d.ts.map +1 -1
- package/lib/esm/appui-react/cursor/CursorInformation.js +1 -0
- package/lib/esm/appui-react/cursor/CursorInformation.js.map +1 -1
- package/lib/esm/appui-react/cursor/cursorpopup/CursorPopupManager.d.ts.map +1 -1
- package/lib/esm/appui-react/cursor/cursorpopup/CursorPopupManager.js +3 -0
- package/lib/esm/appui-react/cursor/cursorpopup/CursorPopupManager.js.map +1 -1
- package/lib/esm/appui-react/dialog/DialogManagerBase.d.ts.map +1 -1
- package/lib/esm/appui-react/dialog/DialogManagerBase.js +1 -0
- package/lib/esm/appui-react/dialog/DialogManagerBase.js.map +1 -1
- package/lib/esm/appui-react/feedback/ElementTooltip.d.ts.map +1 -1
- package/lib/esm/appui-react/feedback/ElementTooltip.js +4 -4
- package/lib/esm/appui-react/feedback/ElementTooltip.js.map +1 -1
- package/lib/esm/appui-react/framework/FrameworkContent.d.ts.map +1 -1
- package/lib/esm/appui-react/framework/FrameworkContent.js +2 -0
- package/lib/esm/appui-react/framework/FrameworkContent.js.map +1 -1
- package/lib/esm/appui-react/framework/FrameworkFrontstages.d.ts.map +1 -1
- package/lib/esm/appui-react/framework/FrameworkFrontstages.js +8 -0
- package/lib/esm/appui-react/framework/FrameworkFrontstages.js.map +1 -1
- package/lib/esm/appui-react/framework/FrameworkToolSettings.d.ts.map +1 -1
- package/lib/esm/appui-react/framework/FrameworkToolSettings.js +1 -0
- package/lib/esm/appui-react/framework/FrameworkToolSettings.js.map +1 -1
- package/lib/esm/appui-react/frontstage/FrontstageDef.d.ts +8 -2
- package/lib/esm/appui-react/frontstage/FrontstageDef.d.ts.map +1 -1
- package/lib/esm/appui-react/frontstage/FrontstageDef.js +24 -7
- package/lib/esm/appui-react/frontstage/FrontstageDef.js.map +1 -1
- package/lib/esm/appui-react/frontstage/InternalFrontstageManager.d.ts.map +1 -1
- package/lib/esm/appui-react/frontstage/InternalFrontstageManager.js +15 -4
- package/lib/esm/appui-react/frontstage/InternalFrontstageManager.js.map +1 -1
- package/lib/esm/appui-react/frontstage/ModalFrontstage.d.ts +2 -4
- package/lib/esm/appui-react/frontstage/ModalFrontstage.d.ts.map +1 -1
- package/lib/esm/appui-react/frontstage/ModalFrontstage.js +2 -3
- package/lib/esm/appui-react/frontstage/ModalFrontstage.js.map +1 -1
- package/lib/esm/appui-react/frontstage/ModalFrontstage.scss +1 -1
- package/lib/esm/appui-react/frontstage/StandardFrontstageProvider.d.ts.map +1 -1
- package/lib/esm/appui-react/frontstage/StandardFrontstageProvider.js +1 -1
- package/lib/esm/appui-react/frontstage/StandardFrontstageProvider.js.map +1 -1
- package/lib/esm/appui-react/keyboardshortcut/KeyboardShortcut.d.ts.map +1 -1
- package/lib/esm/appui-react/keyboardshortcut/KeyboardShortcut.js +1 -0
- package/lib/esm/appui-react/keyboardshortcut/KeyboardShortcut.js.map +1 -1
- package/lib/esm/appui-react/keyboardshortcut/KeyboardShortcutMenu.d.ts.map +1 -1
- package/lib/esm/appui-react/keyboardshortcut/KeyboardShortcutMenu.js +1 -0
- package/lib/esm/appui-react/keyboardshortcut/KeyboardShortcutMenu.js.map +1 -1
- package/lib/esm/appui-react/messages/InputField.d.ts.map +1 -1
- package/lib/esm/appui-react/messages/InputField.js +3 -4
- package/lib/esm/appui-react/messages/InputField.js.map +1 -1
- package/lib/esm/appui-react/messages/MessageLabel.js +2 -2
- package/lib/esm/appui-react/messages/MessageLabel.js.map +1 -1
- package/lib/esm/appui-react/messages/MessageManager.d.ts +15 -5
- package/lib/esm/appui-react/messages/MessageManager.d.ts.map +1 -1
- package/lib/esm/appui-react/messages/MessageManager.js +31 -39
- package/lib/esm/appui-react/messages/MessageManager.js.map +1 -1
- package/lib/esm/appui-react/messages/MessageRenderer.d.ts +8 -0
- package/lib/esm/appui-react/messages/MessageRenderer.d.ts.map +1 -0
- package/lib/esm/appui-react/messages/{ActivityMessage.js → MessageRenderer.js} +58 -12
- package/lib/esm/appui-react/messages/MessageRenderer.js.map +1 -0
- package/lib/esm/appui-react/messages/Pointer.d.ts.map +1 -1
- package/lib/esm/appui-react/messages/Pointer.js +5 -4
- package/lib/esm/appui-react/messages/Pointer.js.map +1 -1
- package/lib/esm/appui-react/messages/getToastCategory.d.ts +1 -1
- package/lib/esm/appui-react/navigationaids/NavigationAidControl.d.ts.map +1 -1
- package/lib/esm/appui-react/navigationaids/NavigationAidControl.js +1 -0
- package/lib/esm/appui-react/navigationaids/NavigationAidControl.js.map +1 -1
- package/lib/esm/appui-react/navigationaids/SheetsModalFrontstage.d.ts.map +1 -1
- package/lib/esm/appui-react/navigationaids/SheetsModalFrontstage.js +1 -0
- package/lib/esm/appui-react/navigationaids/SheetsModalFrontstage.js.map +1 -1
- package/lib/esm/appui-react/pickers/ViewSelector.d.ts.map +1 -1
- package/lib/esm/appui-react/pickers/ViewSelector.js +2 -0
- package/lib/esm/appui-react/pickers/ViewSelector.js.map +1 -1
- package/lib/esm/appui-react/popup/CardPopup.d.ts.map +1 -1
- package/lib/esm/appui-react/popup/CardPopup.js +2 -3
- package/lib/esm/appui-react/popup/CardPopup.js.map +1 -1
- package/lib/esm/appui-react/popup/HTMLElementPopup.d.ts.map +1 -1
- package/lib/esm/appui-react/popup/HTMLElementPopup.js +2 -3
- package/lib/esm/appui-react/popup/HTMLElementPopup.js.map +1 -1
- package/lib/esm/appui-react/popup/PopupManager.d.ts.map +1 -1
- package/lib/esm/appui-react/popup/PopupManager.js +1 -0
- package/lib/esm/appui-react/popup/PopupManager.js.map +1 -1
- package/lib/esm/appui-react/redux/ReducerRegistry.d.ts.map +1 -1
- package/lib/esm/appui-react/redux/ReducerRegistry.js +1 -0
- package/lib/esm/appui-react/redux/ReducerRegistry.js.map +1 -1
- package/lib/esm/appui-react/redux/StateManager.d.ts.map +1 -1
- package/lib/esm/appui-react/redux/StateManager.js +1 -0
- package/lib/esm/appui-react/redux/StateManager.js.map +1 -1
- package/lib/esm/appui-react/settings/quantityformatting/QuantityFormat.scss +1 -4
- package/lib/esm/appui-react/shared/MenuItem.d.ts.map +1 -1
- package/lib/esm/appui-react/shared/MenuItem.js +1 -0
- package/lib/esm/appui-react/shared/MenuItem.js.map +1 -1
- package/lib/esm/appui-react/stagepanels/StagePanelConfig.d.ts +1 -1
- package/lib/esm/appui-react/stagepanels/StagePanelConfig.d.ts.map +1 -1
- package/lib/esm/appui-react/stagepanels/StagePanelConfig.js.map +1 -1
- package/lib/esm/appui-react/stagepanels/StagePanelDef.d.ts +5 -9
- package/lib/esm/appui-react/stagepanels/StagePanelDef.d.ts.map +1 -1
- package/lib/esm/appui-react/stagepanels/StagePanelDef.js +15 -14
- package/lib/esm/appui-react/stagepanels/StagePanelDef.js.map +1 -1
- package/lib/esm/appui-react/stagepanels/StagePanelState.d.ts +13 -0
- package/lib/esm/appui-react/stagepanels/StagePanelState.d.ts.map +1 -0
- package/lib/esm/appui-react/stagepanels/StagePanelState.js +18 -0
- package/lib/esm/appui-react/stagepanels/StagePanelState.js.map +1 -0
- package/lib/esm/appui-react/statusbar/StatusBarComposer.js.map +1 -1
- package/lib/esm/appui-react/statusfields/MessageCenter.d.ts.map +1 -1
- package/lib/esm/appui-react/statusfields/MessageCenter.js +6 -5
- package/lib/esm/appui-react/statusfields/MessageCenter.js.map +1 -1
- package/lib/esm/appui-react/statusfields/SelectionScope.scss +1 -3
- package/lib/esm/appui-react/statusfields/tileloading/TileLoadingIndicator.d.ts.map +1 -1
- package/lib/esm/appui-react/statusfields/tileloading/TileLoadingIndicator.js +1 -1
- package/lib/esm/appui-react/statusfields/tileloading/TileLoadingIndicator.js.map +1 -1
- package/lib/esm/appui-react/statusfields/tileloading/TileLoadingIndicator.scss +1 -1
- package/lib/esm/appui-react/statusfields/toolassistance/ToolAssistanceField.d.ts.map +1 -1
- package/lib/esm/appui-react/statusfields/toolassistance/ToolAssistanceField.js +2 -1
- package/lib/esm/appui-react/statusfields/toolassistance/ToolAssistanceField.js.map +1 -1
- package/lib/esm/appui-react/statusfields/toolassistance/ToolAssistanceField.scss +3 -12
- package/lib/esm/appui-react/theme/ThemeManager.d.ts.map +1 -1
- package/lib/esm/appui-react/theme/ThemeManager.js +3 -1
- package/lib/esm/appui-react/theme/ThemeManager.js.map +1 -1
- package/lib/esm/appui-react/tools/CoreToolDefinitions.d.ts.map +1 -1
- package/lib/esm/appui-react/tools/CoreToolDefinitions.js +5 -5
- package/lib/esm/appui-react/tools/CoreToolDefinitions.js.map +1 -1
- package/lib/esm/appui-react/toolsettings/InternalToolSettingsManager.d.ts.map +1 -1
- package/lib/esm/appui-react/toolsettings/InternalToolSettingsManager.js +1 -0
- package/lib/esm/appui-react/toolsettings/InternalToolSettingsManager.js.map +1 -1
- package/lib/esm/appui-react/toolsettings/ToolInformation.d.ts.map +1 -1
- package/lib/esm/appui-react/toolsettings/ToolInformation.js +1 -0
- package/lib/esm/appui-react/toolsettings/ToolInformation.js.map +1 -1
- package/lib/esm/appui-react/utils/InternalUiShowHideManager.d.ts +1 -0
- package/lib/esm/appui-react/utils/InternalUiShowHideManager.d.ts.map +1 -1
- package/lib/esm/appui-react/utils/InternalUiShowHideManager.js +16 -13
- package/lib/esm/appui-react/utils/InternalUiShowHideManager.js.map +1 -1
- package/lib/esm/appui-react/widget-panels/Frontstage.d.ts +16 -33
- package/lib/esm/appui-react/widget-panels/Frontstage.d.ts.map +1 -1
- package/lib/esm/appui-react/widget-panels/Frontstage.js +244 -382
- package/lib/esm/appui-react/widget-panels/Frontstage.js.map +1 -1
- package/lib/esm/appui-react/widget-panels/ToolSettings.scss +1 -1
- package/lib/esm/appui-react/widgets/WidgetDef.d.ts.map +1 -1
- package/lib/esm/appui-react/widgets/WidgetDef.js +2 -0
- package/lib/esm/appui-react/widgets/WidgetDef.js.map +1 -1
- package/lib/esm/appui-react/widgets/useWidget.d.ts +17 -0
- package/lib/esm/appui-react/widgets/useWidget.d.ts.map +1 -0
- package/lib/esm/appui-react/widgets/useWidget.js +66 -0
- package/lib/esm/appui-react/widgets/useWidget.js.map +1 -0
- package/lib/esm/appui-react.d.ts +2 -0
- package/lib/esm/appui-react.d.ts.map +1 -1
- package/lib/esm/appui-react.js +2 -0
- package/lib/esm/appui-react.js.map +1 -1
- package/package.json +16 -17
- package/lib/cjs/appui-react/messages/ActivityMessage.d.ts +0 -10
- package/lib/cjs/appui-react/messages/ActivityMessage.d.ts.map +0 -1
- package/lib/cjs/appui-react/messages/ActivityMessage.js.map +0 -1
- package/lib/cjs/appui-react/messages/MessageSpan.d.ts +0 -15
- package/lib/cjs/appui-react/messages/MessageSpan.d.ts.map +0 -1
- package/lib/cjs/appui-react/messages/MessageSpan.js +0 -23
- package/lib/cjs/appui-react/messages/MessageSpan.js.map +0 -1
- package/lib/esm/appui-react/messages/ActivityMessage.d.ts +0 -10
- package/lib/esm/appui-react/messages/ActivityMessage.d.ts.map +0 -1
- package/lib/esm/appui-react/messages/ActivityMessage.js.map +0 -1
- package/lib/esm/appui-react/messages/MessageSpan.d.ts +0 -15
- package/lib/esm/appui-react/messages/MessageSpan.d.ts.map +0 -1
- package/lib/esm/appui-react/messages/MessageSpan.js +0 -18
- package/lib/esm/appui-react/messages/MessageSpan.js.map +0 -1
- /package/lib/cjs/appui-react/configurableui/{configurableui.scss → ConfigurableUiContent.scss} +0 -0
- /package/lib/esm/appui-react/configurableui/{configurableui.scss → ConfigurableUiContent.scss} +0 -0
|
@@ -10,12 +10,12 @@ 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 { Logger, ProcessDetector } from "@itwin/core-bentley";
|
|
14
|
-
import {
|
|
13
|
+
import { assert, Logger, ProcessDetector } from "@itwin/core-bentley";
|
|
14
|
+
import { Size, UiStateStorageStatus } from "@itwin/core-react";
|
|
15
15
|
import { ToolbarPopupAutoHideContext } from "@itwin/components-react";
|
|
16
|
-
import {
|
|
17
|
-
import { useActiveFrontstageDef
|
|
18
|
-
import {
|
|
16
|
+
import { createLayoutStore, createNineZoneState, FloatingWidgets, getUniqueId, getWidgetPanelSectionId, NineZone, NineZoneStateReducer, PreviewLayoutFeaturesProvider, PreviewMaximizedWidgetFeatureProvider, useLayout, WidgetPanels, } from "@itwin/appui-layout-react";
|
|
17
|
+
import { useActiveFrontstageDef } from "../frontstage/FrontstageDef";
|
|
18
|
+
import { toPanelSide } from "../stagepanels/StagePanelDef";
|
|
19
19
|
import { UiFramework } from "../UiFramework";
|
|
20
20
|
import { useUiStateStorageHandler } from "../uistate/useUiStateStorage";
|
|
21
21
|
import { WidgetContent } from "./Content";
|
|
@@ -37,6 +37,7 @@ import { StagePanelLocation } from "../stagepanels/StagePanelLocation";
|
|
|
37
37
|
import { UiItemsManager } from "../ui-items-provider/UiItemsManager";
|
|
38
38
|
import { usePreviewFeatures } from "../preview/PreviewFeatures";
|
|
39
39
|
import classNames from "classnames";
|
|
40
|
+
import { StagePanelState } from "../stagepanels/StagePanelState";
|
|
40
41
|
function WidgetPanelsFrontstageComponent() {
|
|
41
42
|
const activeModalFrontstageInfo = useActiveModalFrontstageInfo();
|
|
42
43
|
const uiIsVisible = useUiVisibility();
|
|
@@ -83,8 +84,7 @@ export function useLayoutStore(frontstageDef) {
|
|
|
83
84
|
export function useUpdateNineZoneSize(frontstageDef) {
|
|
84
85
|
React.useEffect(() => {
|
|
85
86
|
const size = InternalFrontstageManager.nineZoneSize;
|
|
86
|
-
|
|
87
|
-
if (!size || !state)
|
|
87
|
+
if (!size)
|
|
88
88
|
return;
|
|
89
89
|
frontstageDef.dispatch({
|
|
90
90
|
type: "RESIZE",
|
|
@@ -95,14 +95,29 @@ export function useUpdateNineZoneSize(frontstageDef) {
|
|
|
95
95
|
});
|
|
96
96
|
}, [frontstageDef]);
|
|
97
97
|
}
|
|
98
|
+
const log = (reducer) => (state, action) => {
|
|
99
|
+
Logger.logTrace("appui-react:reducer", `action ${action.type}`, () => ({
|
|
100
|
+
action,
|
|
101
|
+
state,
|
|
102
|
+
}));
|
|
103
|
+
return reducer(state, action);
|
|
104
|
+
};
|
|
98
105
|
/** @internal */
|
|
99
106
|
export function useNineZoneDispatch(frontstageDef) {
|
|
100
|
-
|
|
107
|
+
const reducer = React.useMemo(() => log(NineZoneStateReducer), []);
|
|
108
|
+
return React.useCallback((action) => {
|
|
109
|
+
if (action.type === "RESIZE") {
|
|
110
|
+
InternalFrontstageManager.nineZoneSize = Size.create(action.size);
|
|
111
|
+
}
|
|
112
|
+
const state = frontstageDef.nineZoneState;
|
|
113
|
+
if (!state)
|
|
114
|
+
return;
|
|
115
|
+
frontstageDef.nineZoneState = reducer(state, action);
|
|
116
|
+
}, [frontstageDef, reducer]);
|
|
101
117
|
}
|
|
102
118
|
/** @internal */
|
|
103
119
|
export function WidgetPanelsFrontstage() {
|
|
104
120
|
const frontstageDef = useActiveFrontstageDef();
|
|
105
|
-
const layout = useLayoutStore(frontstageDef);
|
|
106
121
|
React.useEffect(() => {
|
|
107
122
|
const triggerWidowCloseProcessing = () => {
|
|
108
123
|
frontstageDef && frontstageDef.setIsApplicationClosing(true);
|
|
@@ -114,14 +129,16 @@ export function WidgetPanelsFrontstage() {
|
|
|
114
129
|
}, [frontstageDef]);
|
|
115
130
|
if (!frontstageDef)
|
|
116
131
|
return null;
|
|
117
|
-
return
|
|
132
|
+
return React.createElement(ActiveFrontstageDefProvider, { frontstageDef: frontstageDef });
|
|
118
133
|
}
|
|
119
134
|
const defaultNineZone = createNineZoneState();
|
|
120
135
|
const tabElement = React.createElement(WidgetPanelsTab, null);
|
|
121
136
|
const floatingWidgetElement = React.createElement(FloatingWidget, null);
|
|
122
137
|
/** @internal */
|
|
123
|
-
export function ActiveFrontstageDefProvider({ frontstageDef,
|
|
138
|
+
export function ActiveFrontstageDefProvider({ frontstageDef, }) {
|
|
124
139
|
const dispatch = useNineZoneDispatch(frontstageDef);
|
|
140
|
+
frontstageDef.dispatch = dispatch;
|
|
141
|
+
const layout = useLayoutStore(frontstageDef);
|
|
125
142
|
useUpdateNineZoneSize(frontstageDef);
|
|
126
143
|
useSavedFrontstageState(frontstageDef);
|
|
127
144
|
useSaveFrontstageSettings(frontstageDef, layout);
|
|
@@ -178,183 +195,116 @@ function toTabArgs(widget) {
|
|
|
178
195
|
};
|
|
179
196
|
return args;
|
|
180
197
|
}
|
|
181
|
-
|
|
182
|
-
export function addWidgets(state, widgets, side, widgetId) {
|
|
183
|
-
const visibleWidgets = widgets.filter((w) => w.isVisible && w.defaultState !== WidgetState.Floating);
|
|
184
|
-
if (visibleWidgets.length === 0)
|
|
185
|
-
return state;
|
|
186
|
-
const tabs = new Array();
|
|
187
|
-
for (const widget of visibleWidgets) {
|
|
188
|
-
state = addTab(state, widget.id, toTabArgs(widget));
|
|
189
|
-
tabs.push(widget.id);
|
|
190
|
-
}
|
|
191
|
-
const activeWidget = visibleWidgets.find((widget) => widget.isActive);
|
|
192
|
-
const minimized = false;
|
|
193
|
-
// istanbul ignore else
|
|
194
|
-
if ((activeWidget === null || activeWidget === void 0 ? void 0 : activeWidget.defaultState) !== WidgetState.Floating) {
|
|
195
|
-
state = addPanelWidget(state, side, widgetId, tabs, {
|
|
196
|
-
activeTabId: activeWidget ? activeWidget.id : tabs[0],
|
|
197
|
-
minimized,
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
return state;
|
|
201
|
-
}
|
|
202
|
-
/** @internal */
|
|
203
|
-
// istanbul ignore next
|
|
204
|
-
export function appendWidgets(state, widgetDefs, location, section) {
|
|
198
|
+
function addWidgetDef(frontstageDef, widgetDef, location, section) {
|
|
205
199
|
const side = toPanelSide(location);
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
const userSized = saveTab
|
|
217
|
-
? saveTab.userSized ||
|
|
218
|
-
(!!widgetDef.defaultFloatingSize &&
|
|
219
|
-
!!saveTab.preferredFloatingWidgetSize)
|
|
220
|
-
: !!widgetDef.defaultFloatingSize;
|
|
221
|
-
state = addTab(state, widgetDef.id, {
|
|
200
|
+
const isFloatingWidget = widgetDef.isFloatingStateSupported &&
|
|
201
|
+
widgetDef.defaultState === WidgetState.Floating;
|
|
202
|
+
const floatingWidgetId = widgetDef.floatingContainerId
|
|
203
|
+
? widgetDef.floatingContainerId
|
|
204
|
+
: getUniqueId();
|
|
205
|
+
const userSized = !!widgetDef.defaultFloatingSize;
|
|
206
|
+
frontstageDef.dispatch({
|
|
207
|
+
type: "WIDGET_DEF_ADD",
|
|
208
|
+
id: widgetDef.id,
|
|
209
|
+
overrides: {
|
|
222
210
|
...toTabArgs(widgetDef),
|
|
223
|
-
preferredFloatingWidgetSize,
|
|
224
|
-
preferredPanelWidgetSize,
|
|
225
211
|
userSized,
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
const nzBounds = Rectangle.createFromSize(state.size);
|
|
253
|
-
const bounds = Rectangle.createFromSize(size).offset(preferredPoint);
|
|
254
|
-
const containedBounds = bounds.containIn(nzBounds);
|
|
255
|
-
state = addFloatingWidget(state, floatingContainerId, [widgetDef.id], {
|
|
256
|
-
bounds: containedBounds.toProps(),
|
|
257
|
-
home: {
|
|
258
|
-
widgetId: widgetContainerId,
|
|
259
|
-
side,
|
|
260
|
-
widgetIndex: 0,
|
|
261
|
-
},
|
|
262
|
-
userSized,
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
else {
|
|
267
|
-
const preferredWidgetIndex = section;
|
|
268
|
-
const widgetPanelSectionId = getWidgetPanelSectionId(side, preferredWidgetIndex);
|
|
269
|
-
if (widgetPanelSectionId in state.widgets) {
|
|
270
|
-
state = addTabToWidget(state, widgetDef.id, widgetPanelSectionId);
|
|
271
|
-
}
|
|
272
|
-
else {
|
|
273
|
-
const panel = state.panels[side];
|
|
274
|
-
if (panel.widgets.length < panel.maxWidgetCount) {
|
|
275
|
-
state = addPanelWidget(state, side, widgetPanelSectionId, [
|
|
276
|
-
widgetDef.id,
|
|
277
|
-
]);
|
|
278
|
-
}
|
|
279
|
-
else {
|
|
280
|
-
const widgetIndex = Math.min(preferredWidgetIndex, panel.widgets.length - 1);
|
|
281
|
-
const widgetId = panel.widgets[widgetIndex];
|
|
282
|
-
state = addTabToWidget(state, widgetDef.id, widgetId);
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
if (widgetDef.defaultState === WidgetState.Hidden) {
|
|
287
|
-
state = NineZoneStateReducer(state, {
|
|
288
|
-
type: "WIDGET_TAB_HIDE",
|
|
289
|
-
id: widgetDef.id,
|
|
290
|
-
});
|
|
291
|
-
}
|
|
212
|
+
},
|
|
213
|
+
location: isFloatingWidget ? "floating" : "panel",
|
|
214
|
+
floatingWidget: {
|
|
215
|
+
id: floatingWidgetId,
|
|
216
|
+
preferredPosition: widgetDef.defaultFloatingPosition,
|
|
217
|
+
},
|
|
218
|
+
panelSection: {
|
|
219
|
+
id: getWidgetPanelSectionId(side, section),
|
|
220
|
+
side,
|
|
221
|
+
index: section,
|
|
222
|
+
},
|
|
223
|
+
});
|
|
224
|
+
// Hide widget if `defaultState` is `Hidden` or `Unloaded`.
|
|
225
|
+
hideWidgetDef(frontstageDef, widgetDef);
|
|
226
|
+
}
|
|
227
|
+
/** Adds missing widgets to the layout.
|
|
228
|
+
* @internal
|
|
229
|
+
*/
|
|
230
|
+
export function addPanelSectionWidgetDefs(frontstageDef, location, section) {
|
|
231
|
+
const panelDef = frontstageDef.getStagePanelDef(location);
|
|
232
|
+
if (!panelDef)
|
|
233
|
+
return;
|
|
234
|
+
const sectionDef = panelDef.getPanelSectionDef(section);
|
|
235
|
+
const widgetDefs = determineNewWidgets(frontstageDef, sectionDef.widgetDefs);
|
|
236
|
+
for (const widgetDef of widgetDefs) {
|
|
237
|
+
addWidgetDef(frontstageDef, widgetDef, location, section);
|
|
292
238
|
}
|
|
293
|
-
return state;
|
|
294
239
|
}
|
|
295
|
-
function processPopoutWidgets(
|
|
240
|
+
function processPopoutWidgets(frontstageDef) {
|
|
296
241
|
// Electron reopens popout windows w/o user interaction.
|
|
297
242
|
if (ProcessDetector.isElectronAppFrontend) {
|
|
298
|
-
return
|
|
243
|
+
return;
|
|
299
244
|
}
|
|
300
|
-
|
|
245
|
+
assert(!!frontstageDef.nineZoneState);
|
|
246
|
+
const state = frontstageDef.nineZoneState;
|
|
301
247
|
for (const id of state.popoutWidgets.allIds) {
|
|
302
|
-
|
|
248
|
+
frontstageDef.dispatch({
|
|
303
249
|
type: "POPOUT_WIDGET_SEND_BACK",
|
|
304
250
|
id,
|
|
305
251
|
});
|
|
306
252
|
}
|
|
307
|
-
return state;
|
|
308
253
|
}
|
|
309
254
|
/** Adds frontstageDef widgets that are missing in NineZoneState.
|
|
310
255
|
* @internal
|
|
311
256
|
*/
|
|
312
|
-
export function
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
state = addTab(state, newToolSettingsWidget.id, toTabArgs(newToolSettingsWidget));
|
|
327
|
-
}
|
|
257
|
+
export function addFrontstageWidgetDefs(frontstageDef) {
|
|
258
|
+
[
|
|
259
|
+
StagePanelLocation.Left,
|
|
260
|
+
StagePanelLocation.Right,
|
|
261
|
+
StagePanelLocation.Top,
|
|
262
|
+
StagePanelLocation.Bottom,
|
|
263
|
+
].forEach((location) => [StagePanelSection.Start, StagePanelSection.End].forEach((section) => addPanelSectionWidgetDefs(frontstageDef, location, section)));
|
|
264
|
+
const toolSettingsWidgetDefs = determineNewWidgets(frontstageDef, frontstageDef.toolSettings ? [frontstageDef.toolSettings] : undefined);
|
|
265
|
+
for (const toolSettingsWidgetDef of toolSettingsWidgetDefs) {
|
|
266
|
+
frontstageDef.dispatch({
|
|
267
|
+
type: "WIDGET_DEF_ADD_TOOL_SETTINGS",
|
|
268
|
+
id: toolSettingsWidgetDef.id,
|
|
269
|
+
overrides: toTabArgs(toolSettingsWidgetDef),
|
|
270
|
+
});
|
|
328
271
|
}
|
|
329
|
-
return state;
|
|
330
272
|
}
|
|
331
|
-
/** Hide widgets with Hidden defaultState. */
|
|
332
|
-
function
|
|
273
|
+
/** Hide widgets with `Hidden` or `Unloaded` defaultState. */
|
|
274
|
+
function hideWidgetDefs(frontstageDef) {
|
|
275
|
+
assert(!!frontstageDef.nineZoneState);
|
|
276
|
+
const state = frontstageDef.nineZoneState;
|
|
333
277
|
const tabs = Object.values(state.tabs);
|
|
334
278
|
for (const tab of tabs) {
|
|
335
279
|
const widgetDef = frontstageDef.findWidgetDef(tab.id);
|
|
336
280
|
if (!widgetDef)
|
|
337
281
|
continue;
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
282
|
+
hideWidgetDef(frontstageDef, widgetDef);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
/** Hide widget with `Hidden` or `Unloaded` defaultState. */
|
|
286
|
+
function hideWidgetDef(frontstageDef, widgetDef) {
|
|
287
|
+
if (widgetDef.defaultState === WidgetState.Hidden) {
|
|
288
|
+
frontstageDef.dispatch({
|
|
289
|
+
type: "WIDGET_TAB_HIDE",
|
|
290
|
+
id: widgetDef.id,
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
if (widgetDef.defaultState === WidgetState.Unloaded) {
|
|
294
|
+
frontstageDef.dispatch({
|
|
295
|
+
type: "WIDGET_TAB_UNLOAD",
|
|
296
|
+
id: widgetDef.id,
|
|
297
|
+
});
|
|
350
298
|
}
|
|
351
|
-
return state;
|
|
352
299
|
}
|
|
353
300
|
/** Removes NineZoneState widgets that are missing in frontstageDef.
|
|
354
301
|
* @internal
|
|
355
302
|
*/
|
|
356
|
-
function removeMissingWidgets(frontstageDef
|
|
303
|
+
function removeMissingWidgets(frontstageDef) {
|
|
357
304
|
var _a;
|
|
305
|
+
const state = frontstageDef.nineZoneState;
|
|
306
|
+
if (!state)
|
|
307
|
+
return;
|
|
358
308
|
const toolSettingsTabId = (_a = state.toolSettings) === null || _a === void 0 ? void 0 : _a.tabId;
|
|
359
309
|
for (const [, tab] of Object.entries(state.tabs)) {
|
|
360
310
|
if (tab.id === toolSettingsTabId)
|
|
@@ -362,41 +312,18 @@ function removeMissingWidgets(frontstageDef, state) {
|
|
|
362
312
|
const widgetDef = frontstageDef.findWidgetDef(tab.id);
|
|
363
313
|
if (widgetDef)
|
|
364
314
|
continue;
|
|
365
|
-
|
|
366
|
-
type: "
|
|
315
|
+
frontstageDef.dispatch({
|
|
316
|
+
type: "WIDGET_TAB_REMOVE",
|
|
367
317
|
id: tab.id,
|
|
368
318
|
});
|
|
369
|
-
state = removeTab(state, tab.id);
|
|
370
319
|
}
|
|
371
|
-
return state;
|
|
372
320
|
}
|
|
373
321
|
function getWidgetLabel(label) {
|
|
374
322
|
return label === "" ? "Widget" : label;
|
|
375
323
|
}
|
|
376
324
|
/** @internal */
|
|
377
|
-
export function
|
|
378
|
-
|
|
379
|
-
case StagePanelLocation.Left: {
|
|
380
|
-
if (section === StagePanelSection.Start)
|
|
381
|
-
return "leftStart";
|
|
382
|
-
return "leftEnd";
|
|
383
|
-
}
|
|
384
|
-
case StagePanelLocation.Right: {
|
|
385
|
-
if (section === StagePanelSection.Start)
|
|
386
|
-
return "rightStart";
|
|
387
|
-
return "rightEnd";
|
|
388
|
-
}
|
|
389
|
-
case StagePanelLocation.Top: {
|
|
390
|
-
if (section === StagePanelSection.Start)
|
|
391
|
-
return "topStart";
|
|
392
|
-
return "topEnd";
|
|
393
|
-
}
|
|
394
|
-
case StagePanelLocation.Bottom: {
|
|
395
|
-
if (section === StagePanelSection.Start)
|
|
396
|
-
return "bottomStart";
|
|
397
|
-
return "bottomEnd";
|
|
398
|
-
}
|
|
399
|
-
}
|
|
325
|
+
export function getPanelSectionId(location, section) {
|
|
326
|
+
return `${StagePanelLocation[location].toLowerCase()}${StagePanelSection[section]}`;
|
|
400
327
|
}
|
|
401
328
|
/** @internal */
|
|
402
329
|
export function getPanelSectionWidgets(frontstageDef, location, section) {
|
|
@@ -405,161 +332,143 @@ export function getPanelSectionWidgets(frontstageDef, location, section) {
|
|
|
405
332
|
return (panelSection === null || panelSection === void 0 ? void 0 : panelSection.widgetDefs) || [];
|
|
406
333
|
}
|
|
407
334
|
/** @internal */
|
|
408
|
-
export function addPanelWidgets(state, frontstageDef, location) {
|
|
409
|
-
const side = toPanelSide(location);
|
|
410
|
-
const start = getWidgetId(location, StagePanelSection.Start);
|
|
411
|
-
const startWidgets = getPanelSectionWidgets(frontstageDef, location, StagePanelSection.Start);
|
|
412
|
-
state = addWidgets(state, determineNewWidgets(startWidgets, state), side, start);
|
|
413
|
-
const end = getWidgetId(location, StagePanelSection.End);
|
|
414
|
-
const endWidgets = getPanelSectionWidgets(frontstageDef, location, StagePanelSection.End);
|
|
415
|
-
state = addWidgets(state, determineNewWidgets(endWidgets, state), side, end);
|
|
416
|
-
return state;
|
|
417
|
-
}
|
|
418
|
-
/** @internal */
|
|
419
335
|
export function isFrontstageStateSettingResult(settingsResult) {
|
|
420
336
|
if (settingsResult.status === UiStateStorageStatus.Success)
|
|
421
337
|
return true;
|
|
422
338
|
return false;
|
|
423
339
|
}
|
|
424
340
|
/** @internal */
|
|
425
|
-
export function initializePanel(
|
|
341
|
+
export function initializePanel(frontstageDef, location) {
|
|
342
|
+
var _a, _b;
|
|
426
343
|
const side = toPanelSide(location);
|
|
427
|
-
state = addPanelWidgets(state, frontstageDef, location);
|
|
428
344
|
const panelDef = frontstageDef.getStagePanelDef(location);
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
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;
|
|
436
|
-
});
|
|
437
|
-
if ((panelDef === null || panelDef === void 0 ? void 0 : panelDef.size) !== undefined) {
|
|
438
|
-
state = NineZoneStateReducer(state, {
|
|
345
|
+
if (!panelDef)
|
|
346
|
+
return;
|
|
347
|
+
const size = panelDef.defaultSize;
|
|
348
|
+
size !== undefined &&
|
|
349
|
+
frontstageDef.dispatch({
|
|
439
350
|
type: "PANEL_SET_SIZE",
|
|
440
351
|
side,
|
|
441
|
-
size
|
|
352
|
+
size,
|
|
442
353
|
});
|
|
443
|
-
|
|
444
|
-
|
|
354
|
+
frontstageDef.dispatch({
|
|
355
|
+
type: "PANEL_SET_PINNED",
|
|
356
|
+
side,
|
|
357
|
+
pinned: panelDef.defaultPinned,
|
|
358
|
+
});
|
|
359
|
+
frontstageDef.dispatch({
|
|
360
|
+
type: "PANEL_SET_RESIZABLE",
|
|
361
|
+
side,
|
|
362
|
+
resizable: panelDef.defaultResizable,
|
|
363
|
+
});
|
|
364
|
+
const minSize = (_a = panelDef.initialConfig) === null || _a === void 0 ? void 0 : _a.minSize;
|
|
365
|
+
minSize !== undefined &&
|
|
366
|
+
frontstageDef.dispatch({
|
|
367
|
+
type: "PANEL_SET_MIN_SIZE",
|
|
368
|
+
side,
|
|
369
|
+
minSize,
|
|
370
|
+
});
|
|
371
|
+
const maxSize = (_b = panelDef.initialConfig) === null || _b === void 0 ? void 0 : _b.maxSize;
|
|
372
|
+
maxSize !== undefined &&
|
|
373
|
+
frontstageDef.dispatch({
|
|
374
|
+
type: "PANEL_SET_MAX_SIZE",
|
|
375
|
+
side,
|
|
376
|
+
maxSize,
|
|
377
|
+
});
|
|
378
|
+
const collapsed = panelDef.defaultState !== StagePanelState.Open;
|
|
379
|
+
frontstageDef.dispatch({
|
|
380
|
+
type: "PANEL_SET_COLLAPSED",
|
|
381
|
+
side,
|
|
382
|
+
collapsed,
|
|
383
|
+
});
|
|
445
384
|
}
|
|
446
385
|
/** @internal */
|
|
447
386
|
export const stateVersion = 17; // this needs to be bumped when NineZoneState is changed (to recreate the layout).
|
|
448
387
|
/** @internal */
|
|
449
388
|
export function initializeNineZoneState(frontstageDef) {
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
nineZone = produce(nineZone, (draft) => {
|
|
465
|
-
var _a, _b, _c, _d;
|
|
466
|
-
for (const [, panel] of Object.entries(draft.panels)) {
|
|
467
|
-
const expanded = panel.widgets.find((widgetId) => draft.widgets[widgetId].minimized === false);
|
|
468
|
-
const firstWidget = panel.widgets.length > 0 ? draft.widgets[panel.widgets[0]] : undefined;
|
|
469
|
-
// istanbul ignore next
|
|
470
|
-
if (!expanded && firstWidget) {
|
|
471
|
-
firstWidget.minimized = false;
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
draft.panels.left.collapsed = isPanelCollapsed((_a = frontstageDef.leftPanel) === null || _a === void 0 ? void 0 : _a.panelState);
|
|
475
|
-
draft.panels.right.collapsed = isPanelCollapsed((_b = frontstageDef.rightPanel) === null || _b === void 0 ? void 0 : _b.panelState);
|
|
476
|
-
draft.panels.top.collapsed = isPanelCollapsed((_c = frontstageDef.topPanel) === null || _c === void 0 ? void 0 : _c.panelState);
|
|
477
|
-
draft.panels.bottom.collapsed = isPanelCollapsed((_d = frontstageDef.bottomPanel) === null || _d === void 0 ? void 0 : _d.panelState);
|
|
389
|
+
assert(!frontstageDef.nineZoneState);
|
|
390
|
+
frontstageDef.batch(() => {
|
|
391
|
+
frontstageDef.nineZoneState = defaultNineZone;
|
|
392
|
+
const size = InternalFrontstageManager.nineZoneSize;
|
|
393
|
+
size &&
|
|
394
|
+
frontstageDef.dispatch({
|
|
395
|
+
type: "RESIZE",
|
|
396
|
+
size,
|
|
397
|
+
});
|
|
398
|
+
addFrontstageWidgetDefs(frontstageDef);
|
|
399
|
+
initializePanel(frontstageDef, StagePanelLocation.Left);
|
|
400
|
+
initializePanel(frontstageDef, StagePanelLocation.Right);
|
|
401
|
+
initializePanel(frontstageDef, StagePanelLocation.Top);
|
|
402
|
+
initializePanel(frontstageDef, StagePanelLocation.Bottom);
|
|
478
403
|
});
|
|
479
|
-
nineZone = addMissingWidgets(frontstageDef, nineZone);
|
|
480
|
-
const toolSettingsWidgetDef = frontstageDef.toolSettings;
|
|
481
|
-
if (toolSettingsWidgetDef) {
|
|
482
|
-
const toolSettingsTabId = toolSettingsWidgetDef.id;
|
|
483
|
-
nineZone = addDockedToolSettings(nineZone, toolSettingsTabId);
|
|
484
|
-
}
|
|
485
|
-
nineZone = hideWidgets(nineZone, frontstageDef);
|
|
486
|
-
nineZone = processPopoutWidgets(nineZone);
|
|
487
|
-
return nineZone;
|
|
488
404
|
}
|
|
489
405
|
/** Converts from saved NineZoneState to NineZoneState.
|
|
490
406
|
* @note Restores toolSettings tab.
|
|
491
407
|
* @note Restores tab labels.
|
|
492
408
|
* @internal
|
|
493
409
|
*/
|
|
494
|
-
export function restoreNineZoneState(frontstageDef,
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
tabs
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
tabId: tab.id,
|
|
507
|
-
}));
|
|
508
|
-
state = removeTab(state, tab.id);
|
|
509
|
-
continue;
|
|
510
|
-
}
|
|
511
|
-
state = produce(state, (draft) => {
|
|
512
|
-
draft.tabs[tab.id] = {
|
|
513
|
-
...tab,
|
|
514
|
-
...toTabArgs(widgetDef),
|
|
515
|
-
preferredFloatingWidgetSize: tab.preferredFloatingWidgetSize,
|
|
516
|
-
preferredPanelWidgetSize: tab.preferredPanelWidgetSize,
|
|
517
|
-
};
|
|
518
|
-
});
|
|
519
|
-
}
|
|
520
|
-
state = produce(state, (draft) => {
|
|
521
|
-
// remove center panel section if one is found in left or right panels
|
|
522
|
-
const oldLeftMiddleIndex = saved.panels.left.widgets.findIndex((value) => value === "leftMiddle");
|
|
523
|
-
// istanbul ignore next
|
|
524
|
-
if (-1 !== oldLeftMiddleIndex) {
|
|
525
|
-
draft.panels.left.widgets = saved.panels.left.widgets.filter((value) => value !== "leftMiddle");
|
|
526
|
-
if ("leftEnd" in draft.widgets) {
|
|
527
|
-
draft.widgets.leftMiddle.tabs.forEach((tab) => draft.widgets.leftEnd.tabs.push(tab));
|
|
528
|
-
}
|
|
529
|
-
else {
|
|
530
|
-
draft.widgets.leftEnd = { ...draft.widgets.leftMiddle };
|
|
531
|
-
delete draft.widgets.leftMiddle;
|
|
410
|
+
export function restoreNineZoneState(frontstageDef, packed) {
|
|
411
|
+
frontstageDef.batch(() => {
|
|
412
|
+
frontstageDef.nineZoneState = packed;
|
|
413
|
+
for (const [, tab] of Object.entries(packed.tabs)) {
|
|
414
|
+
const widgetDef = frontstageDef.findWidgetDef(tab.id);
|
|
415
|
+
if (!widgetDef) {
|
|
416
|
+
Logger.logInfo(UiFramework.loggerCategory(restoreNineZoneState), "WidgetDef is not found for saved tab.", {
|
|
417
|
+
frontstageId: frontstageDef.id,
|
|
418
|
+
tabId: tab.id,
|
|
419
|
+
});
|
|
420
|
+
frontstageDef.dispatch({ type: "WIDGET_TAB_REMOVE", id: tab.id });
|
|
421
|
+
continue;
|
|
532
422
|
}
|
|
423
|
+
frontstageDef.dispatch({
|
|
424
|
+
type: "WIDGET_TAB_UPDATE",
|
|
425
|
+
id: tab.id,
|
|
426
|
+
overrides: toTabArgs(widgetDef),
|
|
427
|
+
});
|
|
533
428
|
}
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
if (
|
|
539
|
-
draft.widgets.
|
|
429
|
+
frontstageDef.nineZoneState = produce(frontstageDef.nineZoneState, (draft) => {
|
|
430
|
+
// remove center panel section if one is found in left or right panels
|
|
431
|
+
const oldLeftMiddleIndex = packed.panels.left.widgets.findIndex((value) => value === "leftMiddle");
|
|
432
|
+
// istanbul ignore next
|
|
433
|
+
if (-1 !== oldLeftMiddleIndex) {
|
|
434
|
+
draft.panels.left.widgets = packed.panels.left.widgets.filter((value) => value !== "leftMiddle");
|
|
435
|
+
if ("leftEnd" in draft.widgets) {
|
|
436
|
+
draft.widgets.leftMiddle.tabs.forEach((tab) => draft.widgets.leftEnd.tabs.push(tab));
|
|
437
|
+
}
|
|
438
|
+
else {
|
|
439
|
+
draft.widgets.leftEnd = { ...draft.widgets.leftMiddle };
|
|
440
|
+
delete draft.widgets.leftMiddle;
|
|
441
|
+
}
|
|
540
442
|
}
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
443
|
+
const oldRightMiddleIndex = packed.panels.right.widgets.findIndex((value) => value === "rightMiddle");
|
|
444
|
+
// istanbul ignore next
|
|
445
|
+
if (-1 !== oldRightMiddleIndex) {
|
|
446
|
+
draft.panels.right.widgets = packed.panels.right.widgets.filter((value) => value !== "rightMiddle");
|
|
447
|
+
if ("rightEnd" in draft.widgets) {
|
|
448
|
+
draft.widgets.rightMiddle.tabs.forEach((tab) => draft.widgets.rightEnd.tabs.push(tab));
|
|
449
|
+
}
|
|
450
|
+
else {
|
|
451
|
+
draft.widgets.rightEnd = { ...draft.widgets.rightMiddle };
|
|
452
|
+
delete draft.widgets.rightMiddle;
|
|
453
|
+
}
|
|
544
454
|
}
|
|
455
|
+
return;
|
|
456
|
+
});
|
|
457
|
+
if (InternalFrontstageManager.nineZoneSize &&
|
|
458
|
+
(0 !== InternalFrontstageManager.nineZoneSize.height ||
|
|
459
|
+
0 !== InternalFrontstageManager.nineZoneSize.width)) {
|
|
460
|
+
frontstageDef.dispatch({
|
|
461
|
+
type: "RESIZE",
|
|
462
|
+
size: {
|
|
463
|
+
height: InternalFrontstageManager.nineZoneSize.height,
|
|
464
|
+
width: InternalFrontstageManager.nineZoneSize.width,
|
|
465
|
+
},
|
|
466
|
+
});
|
|
545
467
|
}
|
|
546
|
-
|
|
468
|
+
addFrontstageWidgetDefs(frontstageDef);
|
|
469
|
+
hideWidgetDefs(frontstageDef);
|
|
470
|
+
processPopoutWidgets(frontstageDef);
|
|
547
471
|
});
|
|
548
|
-
if (InternalFrontstageManager.nineZoneSize &&
|
|
549
|
-
(0 !== InternalFrontstageManager.nineZoneSize.height ||
|
|
550
|
-
0 !== InternalFrontstageManager.nineZoneSize.width)) {
|
|
551
|
-
state = NineZoneStateReducer(state, {
|
|
552
|
-
type: "RESIZE",
|
|
553
|
-
size: {
|
|
554
|
-
height: InternalFrontstageManager.nineZoneSize.height,
|
|
555
|
-
width: InternalFrontstageManager.nineZoneSize.width,
|
|
556
|
-
},
|
|
557
|
-
});
|
|
558
|
-
}
|
|
559
|
-
state = addMissingWidgets(frontstageDef, state);
|
|
560
|
-
state = hideWidgets(state, frontstageDef);
|
|
561
|
-
state = processPopoutWidgets(state);
|
|
562
|
-
return state;
|
|
563
472
|
}
|
|
564
473
|
/** Prepares NineZoneState to be saved.
|
|
565
474
|
* @note Removes toolSettings tab.
|
|
@@ -567,62 +476,16 @@ export function restoreNineZoneState(frontstageDef, saved) {
|
|
|
567
476
|
* @internal
|
|
568
477
|
*/
|
|
569
478
|
export function packNineZoneState(state) {
|
|
570
|
-
let packed =
|
|
571
|
-
...state,
|
|
572
|
-
tabs: {},
|
|
573
|
-
};
|
|
479
|
+
let packed = state;
|
|
574
480
|
packed = produce(packed, (draft) => {
|
|
575
|
-
for (const [, tab] of Object.entries(
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
preferredFloatingWidgetSize: tab.preferredFloatingWidgetSize,
|
|
579
|
-
userSized: tab.userSized,
|
|
580
|
-
};
|
|
481
|
+
for (const [, tab] of Object.entries(draft.tabs)) {
|
|
482
|
+
tab.label = "";
|
|
483
|
+
delete tab.iconSpec;
|
|
581
484
|
}
|
|
582
485
|
});
|
|
583
486
|
return packed;
|
|
584
487
|
}
|
|
585
488
|
/** @internal */
|
|
586
|
-
export function isPanelCollapsed(panelState) {
|
|
587
|
-
return panelState !== StagePanelState.Open;
|
|
588
|
-
}
|
|
589
|
-
/** @internal */
|
|
590
|
-
export function showWidget(state, id) {
|
|
591
|
-
const location = getTabLocation(state, id);
|
|
592
|
-
if (!location)
|
|
593
|
-
return state;
|
|
594
|
-
state = produce(state, (draft) => {
|
|
595
|
-
const widget = draft.widgets[location.widgetId];
|
|
596
|
-
widget.activeTabId = id;
|
|
597
|
-
widget.minimized = false;
|
|
598
|
-
if (isPanelTabLocation(location)) {
|
|
599
|
-
const panel = draft.panels[location.side];
|
|
600
|
-
panel.collapsed = false;
|
|
601
|
-
}
|
|
602
|
-
});
|
|
603
|
-
if (isFloatingTabLocation(location)) {
|
|
604
|
-
state = floatingWidgetBringToFront(state, location.floatingWidgetId);
|
|
605
|
-
}
|
|
606
|
-
return state;
|
|
607
|
-
}
|
|
608
|
-
/** @internal */
|
|
609
|
-
export function expandWidget(state, id) {
|
|
610
|
-
const location = getTabLocation(state, id);
|
|
611
|
-
if (!location)
|
|
612
|
-
return state;
|
|
613
|
-
return produce(state, (draft) => {
|
|
614
|
-
const widget = draft.widgets[location.widgetId];
|
|
615
|
-
if (isPanelTabLocation(location)) {
|
|
616
|
-
const panel = draft.panels[location.side];
|
|
617
|
-
panel.splitterPercent =
|
|
618
|
-
panel.widgets.findIndex((wId) => wId === location.widgetId) === 0
|
|
619
|
-
? 100
|
|
620
|
-
: 0;
|
|
621
|
-
}
|
|
622
|
-
widget.minimized = false;
|
|
623
|
-
});
|
|
624
|
-
}
|
|
625
|
-
/** @internal */
|
|
626
489
|
export function useSavedFrontstageState(frontstageDef) {
|
|
627
490
|
const uiStateStorage = useUiStateStorageHandler();
|
|
628
491
|
const uiStateStorageRef = React.useRef(uiStateStorage);
|
|
@@ -640,7 +503,7 @@ export function useSavedFrontstageState(frontstageDef) {
|
|
|
640
503
|
async function fetchFrontstageState() {
|
|
641
504
|
// Switching to previously initialized frontstage.
|
|
642
505
|
if (frontstageDef.nineZoneState) {
|
|
643
|
-
|
|
506
|
+
processPopoutWidgets(frontstageDef);
|
|
644
507
|
return;
|
|
645
508
|
}
|
|
646
509
|
const id = frontstageDef.id;
|
|
@@ -652,11 +515,11 @@ export function useSavedFrontstageState(frontstageDef) {
|
|
|
652
515
|
const setting = settingResult.setting;
|
|
653
516
|
if (setting.version === version &&
|
|
654
517
|
setting.stateVersion === stateVersion) {
|
|
655
|
-
|
|
518
|
+
restoreNineZoneState(frontstageDef, setting.nineZone);
|
|
656
519
|
return;
|
|
657
520
|
}
|
|
658
521
|
}
|
|
659
|
-
|
|
522
|
+
initializeNineZoneState(frontstageDef);
|
|
660
523
|
}
|
|
661
524
|
void fetchFrontstageState();
|
|
662
525
|
}, [frontstageDef]);
|
|
@@ -748,12 +611,10 @@ export function useFrontstageManager(frontstageDef, useToolAsToolSettingsLabel)
|
|
|
748
611
|
// TODO: track restoring frontstages to support workflows: i.e. prevent loading frontstage OR saving layout when delete is pending
|
|
749
612
|
void uiSettingsStorage.deleteSetting(FRONTSTAGE_SETTINGS_NAMESPACE, getFrontstageStateSettingName(args.frontstageDef.id));
|
|
750
613
|
if (frontstageDef.id === args.frontstageDef.id) {
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
}
|
|
754
|
-
else {
|
|
755
|
-
args.frontstageDef.nineZoneState = undefined;
|
|
614
|
+
initializeNineZoneState(frontstageDef);
|
|
615
|
+
return;
|
|
756
616
|
}
|
|
617
|
+
args.frontstageDef.nineZoneState = undefined;
|
|
757
618
|
});
|
|
758
619
|
}, [uiSettingsStorage, frontstageDef]);
|
|
759
620
|
const defaultLabel = React.useMemo(() => UiFramework.translate("widget.labels.toolSettings"), []);
|
|
@@ -788,20 +649,20 @@ export function useFrontstageManager(frontstageDef, useToolAsToolSettingsLabel)
|
|
|
788
649
|
};
|
|
789
650
|
}, [frontstageDef, useToolAsToolSettingsLabel, defaultLabel]);
|
|
790
651
|
}
|
|
652
|
+
function refreshNineZoneState(frontstageDef) {
|
|
653
|
+
// Fired for both registered/unregistered. Update definitions and remove/add missing widgets.
|
|
654
|
+
frontstageDef.updateWidgetDefs();
|
|
655
|
+
frontstageDef.batch(() => {
|
|
656
|
+
addFrontstageWidgetDefs(frontstageDef);
|
|
657
|
+
removeMissingWidgets(frontstageDef);
|
|
658
|
+
});
|
|
659
|
+
}
|
|
791
660
|
/** @internal */
|
|
792
|
-
// istanbul ignore next
|
|
793
661
|
export function useItemsManager(frontstageDef) {
|
|
794
|
-
const refreshNineZoneState = (def) => {
|
|
795
|
-
// Fired for both registered/unregistered. Update definitions and remove/add missing widgets.
|
|
796
|
-
def.updateWidgetDefs();
|
|
797
|
-
let state = def.nineZoneState;
|
|
798
|
-
if (!state)
|
|
799
|
-
return;
|
|
800
|
-
state = addMissingWidgets(def, state);
|
|
801
|
-
state = removeMissingWidgets(def, state);
|
|
802
|
-
def.nineZoneState = state;
|
|
803
|
-
};
|
|
804
662
|
React.useEffect(() => {
|
|
663
|
+
// Not initialized yet.
|
|
664
|
+
if (!frontstageDef.nineZoneState)
|
|
665
|
+
return;
|
|
805
666
|
// Need to refresh anytime frontstageDef changes because uiItemsProvider may have added something to
|
|
806
667
|
// another stage before it was possibly unloaded in this stage.
|
|
807
668
|
refreshNineZoneState(frontstageDef);
|
|
@@ -812,8 +673,9 @@ export function useItemsManager(frontstageDef) {
|
|
|
812
673
|
});
|
|
813
674
|
}, [frontstageDef]);
|
|
814
675
|
}
|
|
815
|
-
|
|
816
|
-
|
|
676
|
+
function determineNewWidgets(frontstageDef, defs) {
|
|
677
|
+
const state = frontstageDef.nineZoneState;
|
|
678
|
+
assert(!!state);
|
|
817
679
|
defs = defs || [];
|
|
818
680
|
const uniqueDefs = defs.filter((def, index, array) => {
|
|
819
681
|
return index === array.findIndex((def1) => def.id === def1.id);
|