@itwin/appui-react 4.2.1 → 4.3.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 +1 -6
- package/lib/cjs/appui-react/UiFramework.d.ts +0 -7
- package/lib/cjs/appui-react/UiFramework.d.ts.map +1 -1
- package/lib/cjs/appui-react/UiFramework.js +4 -29
- package/lib/cjs/appui-react/UiFramework.js.map +1 -1
- package/lib/cjs/appui-react/_variables.scss +3 -3
- package/lib/cjs/appui-react/accudraw/AccuDrawFieldContainer.scss +3 -3
- package/lib/cjs/appui-react/accudraw/AccuDrawInputField.scss +3 -3
- package/lib/cjs/appui-react/backstage/BackstageComposerItem.js +1 -2
- package/lib/cjs/appui-react/backstage/BackstageComposerItem.js.map +1 -1
- package/lib/cjs/appui-react/childwindow/InternalChildWindowManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/childwindow/InternalChildWindowManager.js +2 -3
- package/lib/cjs/appui-react/childwindow/InternalChildWindowManager.js.map +1 -1
- package/lib/cjs/appui-react/childwindow/InternalChildWindowManager.scss +3 -3
- 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 +1 -2
- package/lib/cjs/appui-react/configurableui/TimeTracker.js.map +1 -1
- package/lib/cjs/appui-react/configurableui/configurableui.scss +3 -3
- package/lib/cjs/appui-react/content/ContentLayout.js +9 -12
- package/lib/cjs/appui-react/content/ContentLayout.js.map +1 -1
- package/lib/cjs/appui-react/content/DefaultViewOverlay.js +3 -4
- package/lib/cjs/appui-react/content/DefaultViewOverlay.js.map +1 -1
- package/lib/cjs/appui-react/content/DefaultViewOverlay.scss +3 -3
- package/lib/cjs/appui-react/content/FloatingViewportContent.js +1 -2
- package/lib/cjs/appui-react/content/FloatingViewportContent.js.map +1 -1
- package/lib/cjs/appui-react/content/IModelViewport.js +3 -6
- package/lib/cjs/appui-react/content/IModelViewport.js.map +1 -1
- package/lib/cjs/appui-react/content/InternalContentLayoutManager.js +1 -2
- 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 +10 -12
- package/lib/cjs/appui-react/content/split-pane/SplitPane.js.map +1 -1
- package/lib/cjs/appui-react/cursor/cursormenu/CursorMenu.js +2 -3
- package/lib/cjs/appui-react/cursor/cursormenu/CursorMenu.js.map +1 -1
- package/lib/cjs/appui-react/dialog/ContentDialog.js +3 -6
- package/lib/cjs/appui-react/dialog/ContentDialog.js.map +1 -1
- package/lib/cjs/appui-react/dialog/DialogManagerBase.js +2 -3
- package/lib/cjs/appui-react/dialog/DialogManagerBase.js.map +1 -1
- package/lib/cjs/appui-react/feedback/ValidationTextbox.scss +3 -3
- package/lib/cjs/appui-react/frontstage/FrontstageDef.d.ts.map +1 -1
- package/lib/cjs/appui-react/frontstage/FrontstageDef.js +27 -9
- package/lib/cjs/appui-react/frontstage/FrontstageDef.js.map +1 -1
- package/lib/cjs/appui-react/frontstage/ModalSettingsStage.js +2 -3
- package/lib/cjs/appui-react/frontstage/ModalSettingsStage.js.map +1 -1
- package/lib/cjs/appui-react/frontstage/StandardFrontstageProvider.js +1 -2
- package/lib/cjs/appui-react/frontstage/StandardFrontstageProvider.js.map +1 -1
- package/lib/cjs/appui-react/hooks/useAnalysisAnimationDataProvider.js +7 -11
- package/lib/cjs/appui-react/hooks/useAnalysisAnimationDataProvider.js.map +1 -1
- package/lib/cjs/appui-react/hooks/useScheduleAnimationDataProvider.js +7 -11
- package/lib/cjs/appui-react/hooks/useScheduleAnimationDataProvider.js.map +1 -1
- package/lib/cjs/appui-react/hooks/useSolarDataProvider.js +8 -13
- package/lib/cjs/appui-react/hooks/useSolarDataProvider.js.map +1 -1
- package/lib/cjs/appui-react/messages/ActivityMessage.js +5 -7
- package/lib/cjs/appui-react/messages/ActivityMessage.js.map +1 -1
- package/lib/cjs/appui-react/navigationaids/SheetNavigationAid.scss +3 -3
- package/lib/cjs/appui-react/navigationaids/StandardRotationNavigationAid.scss +3 -3
- package/lib/cjs/appui-react/pickers/ViewSelector.d.ts.map +1 -1
- package/lib/cjs/appui-react/pickers/ViewSelector.js +8 -7
- package/lib/cjs/appui-react/pickers/ViewSelector.js.map +1 -1
- package/lib/cjs/appui-react/popup/CardPopup.scss +3 -3
- package/lib/cjs/appui-react/popup/KeyinPalettePanel.js +1 -2
- package/lib/cjs/appui-react/popup/KeyinPalettePanel.js.map +1 -1
- package/lib/cjs/appui-react/popup/PopupManager.js +1 -2
- package/lib/cjs/appui-react/popup/PopupManager.js.map +1 -1
- package/lib/cjs/appui-react/selection/HideIsolateEmphasizeManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/selection/HideIsolateEmphasizeManager.js +0 -53
- package/lib/cjs/appui-react/selection/HideIsolateEmphasizeManager.js.map +1 -1
- package/lib/cjs/appui-react/settings/quantityformatting/QuantityFormat.js +2 -1
- package/lib/cjs/appui-react/settings/quantityformatting/QuantityFormat.js.map +1 -1
- package/lib/cjs/appui-react/settings/quantityformatting/QuantityFormat.scss +3 -3
- package/lib/cjs/appui-react/settings/ui/UiSettingsPage.scss +3 -3
- package/lib/cjs/appui-react/stagepanels/StagePanelDef.js +5 -7
- package/lib/cjs/appui-react/stagepanels/StagePanelDef.js.map +1 -1
- package/lib/cjs/appui-react/statusbar/Indicator.js +1 -2
- package/lib/cjs/appui-react/statusbar/Indicator.js.map +1 -1
- package/lib/cjs/appui-react/statusbar/Separator.scss +3 -3
- package/lib/cjs/appui-react/statusbar/StatusBar.js +3 -5
- package/lib/cjs/appui-react/statusbar/StatusBar.js.map +1 -1
- package/lib/cjs/appui-react/statusfields/SectionsField.scss +3 -3
- package/lib/cjs/appui-react/statusfields/SelectionCount.scss +3 -3
- package/lib/cjs/appui-react/statusfields/SelectionScope.scss +3 -3
- package/lib/cjs/appui-react/statusfields/ViewAttributes.scss +3 -3
- package/lib/cjs/appui-react/statusfields/tileloading/TileLoadingIndicator.scss +3 -3
- 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/statusfields/toolassistance/ToolAssistanceField.scss +3 -3
- package/lib/cjs/appui-react/tools/CoreToolDefinitions.js +10 -17
- package/lib/cjs/appui-react/tools/CoreToolDefinitions.js.map +1 -1
- package/lib/cjs/appui-react/toolsettings/DefaultToolSettingsProvider.js +3 -2
- package/lib/cjs/appui-react/toolsettings/DefaultToolSettingsProvider.js.map +1 -1
- package/lib/cjs/appui-react/ui-items-provider/AbstractUiItemsManager.js +12 -14
- package/lib/cjs/appui-react/ui-items-provider/AbstractUiItemsManager.js.map +1 -1
- package/lib/cjs/appui-react/ui-items-provider/StandardContentToolsUiItemsProvider.js +9 -10
- package/lib/cjs/appui-react/ui-items-provider/StandardContentToolsUiItemsProvider.js.map +1 -1
- package/lib/cjs/appui-react/ui-items-provider/StandardStatusbarUiItemsProvider.js +1 -2
- package/lib/cjs/appui-react/ui-items-provider/StandardStatusbarUiItemsProvider.js.map +1 -1
- package/lib/cjs/appui-react/ui-items-provider/UiItemsManager.js +8 -14
- 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/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 +8 -9
- package/lib/cjs/appui-react/widget-panels/Content.js.map +1 -1
- package/lib/cjs/appui-react/widget-panels/Frontstage.d.ts +3 -1
- package/lib/cjs/appui-react/widget-panels/Frontstage.d.ts.map +1 -1
- package/lib/cjs/appui-react/widget-panels/Frontstage.js +116 -102
- package/lib/cjs/appui-react/widget-panels/Frontstage.js.map +1 -1
- package/lib/cjs/appui-react/widget-panels/Frontstage.scss +3 -3
- 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/Tab.scss +3 -3
- package/lib/cjs/appui-react/widget-panels/ToolSettings.d.ts +1 -1
- package/lib/cjs/appui-react/widget-panels/ToolSettings.d.ts.map +1 -1
- package/lib/cjs/appui-react/widget-panels/ToolSettings.js +33 -45
- package/lib/cjs/appui-react/widget-panels/ToolSettings.js.map +1 -1
- package/lib/cjs/appui-react/widget-panels/ToolSettings.scss +3 -3
- package/lib/cjs/appui-react/widget-panels/Toolbars.js +2 -3
- package/lib/cjs/appui-react/widget-panels/Toolbars.js.map +1 -1
- package/lib/cjs/appui-react/widget-panels/Toolbars.scss +3 -3
- 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/WidgetDef.d.ts +1 -1
- package/lib/cjs/appui-react/widgets/WidgetDef.d.ts.map +1 -1
- package/lib/cjs/appui-react/widgets/WidgetDef.js +13 -12
- package/lib/cjs/appui-react/widgets/WidgetDef.js.map +1 -1
- package/lib/cjs/appui-react/widgets/WidgetHost.js +2 -3
- package/lib/cjs/appui-react/widgets/WidgetHost.js.map +1 -1
- package/lib/esm/appui-react/UiFramework.d.ts +0 -7
- package/lib/esm/appui-react/UiFramework.d.ts.map +1 -1
- package/lib/esm/appui-react/UiFramework.js +4 -29
- package/lib/esm/appui-react/UiFramework.js.map +1 -1
- package/lib/esm/appui-react/_variables.scss +3 -3
- package/lib/esm/appui-react/accudraw/AccuDrawFieldContainer.scss +3 -3
- package/lib/esm/appui-react/accudraw/AccuDrawInputField.scss +3 -3
- package/lib/esm/appui-react/backstage/BackstageComposerItem.js +1 -2
- package/lib/esm/appui-react/backstage/BackstageComposerItem.js.map +1 -1
- package/lib/esm/appui-react/childwindow/InternalChildWindowManager.d.ts.map +1 -1
- package/lib/esm/appui-react/childwindow/InternalChildWindowManager.js +2 -3
- package/lib/esm/appui-react/childwindow/InternalChildWindowManager.js.map +1 -1
- package/lib/esm/appui-react/childwindow/InternalChildWindowManager.scss +3 -3
- 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 +1 -2
- package/lib/esm/appui-react/configurableui/TimeTracker.js.map +1 -1
- package/lib/esm/appui-react/configurableui/configurableui.scss +3 -3
- package/lib/esm/appui-react/content/ContentLayout.js +9 -12
- package/lib/esm/appui-react/content/ContentLayout.js.map +1 -1
- package/lib/esm/appui-react/content/DefaultViewOverlay.js +3 -4
- package/lib/esm/appui-react/content/DefaultViewOverlay.js.map +1 -1
- package/lib/esm/appui-react/content/DefaultViewOverlay.scss +3 -3
- package/lib/esm/appui-react/content/FloatingViewportContent.js +1 -2
- package/lib/esm/appui-react/content/FloatingViewportContent.js.map +1 -1
- package/lib/esm/appui-react/content/IModelViewport.js +3 -6
- package/lib/esm/appui-react/content/IModelViewport.js.map +1 -1
- package/lib/esm/appui-react/content/InternalContentLayoutManager.js +1 -2
- 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 +10 -12
- package/lib/esm/appui-react/content/split-pane/SplitPane.js.map +1 -1
- package/lib/esm/appui-react/cursor/cursormenu/CursorMenu.js +2 -3
- package/lib/esm/appui-react/cursor/cursormenu/CursorMenu.js.map +1 -1
- package/lib/esm/appui-react/dialog/ContentDialog.js +3 -6
- package/lib/esm/appui-react/dialog/ContentDialog.js.map +1 -1
- package/lib/esm/appui-react/dialog/DialogManagerBase.js +2 -3
- package/lib/esm/appui-react/dialog/DialogManagerBase.js.map +1 -1
- package/lib/esm/appui-react/feedback/ValidationTextbox.scss +3 -3
- package/lib/esm/appui-react/frontstage/FrontstageDef.d.ts.map +1 -1
- package/lib/esm/appui-react/frontstage/FrontstageDef.js +27 -9
- package/lib/esm/appui-react/frontstage/FrontstageDef.js.map +1 -1
- package/lib/esm/appui-react/frontstage/ModalSettingsStage.js +2 -3
- package/lib/esm/appui-react/frontstage/ModalSettingsStage.js.map +1 -1
- package/lib/esm/appui-react/frontstage/StandardFrontstageProvider.js +1 -2
- package/lib/esm/appui-react/frontstage/StandardFrontstageProvider.js.map +1 -1
- package/lib/esm/appui-react/hooks/useAnalysisAnimationDataProvider.js +7 -11
- package/lib/esm/appui-react/hooks/useAnalysisAnimationDataProvider.js.map +1 -1
- package/lib/esm/appui-react/hooks/useScheduleAnimationDataProvider.js +7 -11
- package/lib/esm/appui-react/hooks/useScheduleAnimationDataProvider.js.map +1 -1
- package/lib/esm/appui-react/hooks/useSolarDataProvider.js +8 -13
- package/lib/esm/appui-react/hooks/useSolarDataProvider.js.map +1 -1
- package/lib/esm/appui-react/messages/ActivityMessage.js +5 -7
- package/lib/esm/appui-react/messages/ActivityMessage.js.map +1 -1
- package/lib/esm/appui-react/navigationaids/SheetNavigationAid.scss +3 -3
- package/lib/esm/appui-react/navigationaids/StandardRotationNavigationAid.scss +3 -3
- package/lib/esm/appui-react/pickers/ViewSelector.d.ts.map +1 -1
- package/lib/esm/appui-react/pickers/ViewSelector.js +8 -7
- package/lib/esm/appui-react/pickers/ViewSelector.js.map +1 -1
- package/lib/esm/appui-react/popup/CardPopup.scss +3 -3
- package/lib/esm/appui-react/popup/KeyinPalettePanel.js +1 -2
- package/lib/esm/appui-react/popup/KeyinPalettePanel.js.map +1 -1
- package/lib/esm/appui-react/popup/PopupManager.js +1 -2
- package/lib/esm/appui-react/popup/PopupManager.js.map +1 -1
- package/lib/esm/appui-react/selection/HideIsolateEmphasizeManager.d.ts.map +1 -1
- package/lib/esm/appui-react/selection/HideIsolateEmphasizeManager.js +0 -53
- package/lib/esm/appui-react/selection/HideIsolateEmphasizeManager.js.map +1 -1
- package/lib/esm/appui-react/settings/quantityformatting/QuantityFormat.js +2 -1
- package/lib/esm/appui-react/settings/quantityformatting/QuantityFormat.js.map +1 -1
- package/lib/esm/appui-react/settings/quantityformatting/QuantityFormat.scss +3 -3
- package/lib/esm/appui-react/settings/ui/UiSettingsPage.scss +3 -3
- package/lib/esm/appui-react/stagepanels/StagePanelDef.js +5 -7
- package/lib/esm/appui-react/stagepanels/StagePanelDef.js.map +1 -1
- package/lib/esm/appui-react/statusbar/Indicator.js +1 -2
- package/lib/esm/appui-react/statusbar/Indicator.js.map +1 -1
- package/lib/esm/appui-react/statusbar/Separator.scss +3 -3
- package/lib/esm/appui-react/statusbar/StatusBar.js +3 -5
- package/lib/esm/appui-react/statusbar/StatusBar.js.map +1 -1
- package/lib/esm/appui-react/statusfields/SectionsField.scss +3 -3
- package/lib/esm/appui-react/statusfields/SelectionCount.scss +3 -3
- package/lib/esm/appui-react/statusfields/SelectionScope.scss +3 -3
- package/lib/esm/appui-react/statusfields/ViewAttributes.scss +3 -3
- package/lib/esm/appui-react/statusfields/tileloading/TileLoadingIndicator.scss +3 -3
- 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/statusfields/toolassistance/ToolAssistanceField.scss +3 -3
- package/lib/esm/appui-react/tools/CoreToolDefinitions.js +10 -17
- package/lib/esm/appui-react/tools/CoreToolDefinitions.js.map +1 -1
- package/lib/esm/appui-react/toolsettings/DefaultToolSettingsProvider.js +3 -2
- package/lib/esm/appui-react/toolsettings/DefaultToolSettingsProvider.js.map +1 -1
- package/lib/esm/appui-react/ui-items-provider/AbstractUiItemsManager.js +12 -14
- package/lib/esm/appui-react/ui-items-provider/AbstractUiItemsManager.js.map +1 -1
- package/lib/esm/appui-react/ui-items-provider/StandardContentToolsUiItemsProvider.js +9 -10
- package/lib/esm/appui-react/ui-items-provider/StandardContentToolsUiItemsProvider.js.map +1 -1
- package/lib/esm/appui-react/ui-items-provider/StandardStatusbarUiItemsProvider.js +1 -2
- package/lib/esm/appui-react/ui-items-provider/StandardStatusbarUiItemsProvider.js.map +1 -1
- package/lib/esm/appui-react/ui-items-provider/UiItemsManager.js +8 -14
- 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/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 +8 -9
- package/lib/esm/appui-react/widget-panels/Content.js.map +1 -1
- package/lib/esm/appui-react/widget-panels/Frontstage.d.ts +3 -1
- package/lib/esm/appui-react/widget-panels/Frontstage.d.ts.map +1 -1
- package/lib/esm/appui-react/widget-panels/Frontstage.js +113 -99
- package/lib/esm/appui-react/widget-panels/Frontstage.js.map +1 -1
- package/lib/esm/appui-react/widget-panels/Frontstage.scss +3 -3
- 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/Tab.scss +3 -3
- package/lib/esm/appui-react/widget-panels/ToolSettings.d.ts +1 -1
- package/lib/esm/appui-react/widget-panels/ToolSettings.d.ts.map +1 -1
- package/lib/esm/appui-react/widget-panels/ToolSettings.js +33 -45
- package/lib/esm/appui-react/widget-panels/ToolSettings.js.map +1 -1
- package/lib/esm/appui-react/widget-panels/ToolSettings.scss +3 -3
- package/lib/esm/appui-react/widget-panels/Toolbars.js +2 -3
- package/lib/esm/appui-react/widget-panels/Toolbars.js.map +1 -1
- package/lib/esm/appui-react/widget-panels/Toolbars.scss +3 -3
- 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/WidgetDef.d.ts +1 -1
- package/lib/esm/appui-react/widgets/WidgetDef.d.ts.map +1 -1
- package/lib/esm/appui-react/widgets/WidgetDef.js +13 -12
- package/lib/esm/appui-react/widgets/WidgetDef.js.map +1 -1
- package/lib/esm/appui-react/widgets/WidgetHost.js +2 -3
- package/lib/esm/appui-react/widgets/WidgetHost.js.map +1 -1
- package/lib/public/locales/en/UiFramework.json +3 -1
- package/package.json +12 -12
|
@@ -13,7 +13,7 @@ import { unstable_batchedUpdates } from "react-dom";
|
|
|
13
13
|
import { assert, Logger, ProcessDetector } from "@itwin/core-bentley";
|
|
14
14
|
import { Rectangle, Size, UiStateStorageStatus } from "@itwin/core-react";
|
|
15
15
|
import { ToolbarPopupAutoHideContext } from "@itwin/components-react";
|
|
16
|
-
import { addFloatingWidget, addPanelWidget, addTab, addTabToWidget, convertAllPopupWidgetContainersToFloating, createLayoutStore, createNineZoneState, floatingWidgetBringToFront, FloatingWidgets, getTabLocation, getUniqueId, getWidgetPanelSectionId, insertPanelWidget, insertTabToWidget, isFloatingTabLocation, isHorizontalPanelSide, isPanelTabLocation, isPopoutTabLocation, NineZone, NineZoneStateReducer, panelSides, removeTab, removeTabFromWidget,
|
|
16
|
+
import { addDockedToolSettings, addFloatingWidget, addPanelWidget, addTab, addTabToWidget, addWidgetToolSettings, convertAllPopupWidgetContainersToFloating, createLayoutStore, createNineZoneState, floatingWidgetBringToFront, FloatingWidgets, getTabLocation, getUniqueId, getWidgetPanelSectionId, insertPanelWidget, insertTabToWidget, isFloatingTabLocation, isHorizontalPanelSide, isPanelTabLocation, isPopoutTabLocation, NineZone, NineZoneStateReducer, panelSides, removeTab, removeTabFromWidget, removeToolSettings, WidgetPanels, } from "@itwin/appui-layout-react";
|
|
17
17
|
import { StagePanelState, toPanelSide } from "../stagepanels/StagePanelDef";
|
|
18
18
|
import { UiFramework } from "../UiFramework";
|
|
19
19
|
import { useUiStateStorageHandler } from "../uistate/useUiStateStorage";
|
|
@@ -52,7 +52,7 @@ const widgetPanelsFrontstage = React.createElement(WidgetPanelsFrontstageCompone
|
|
|
52
52
|
/** @internal */
|
|
53
53
|
export function useLayoutStore() {
|
|
54
54
|
const [def, setDef] = React.useState(UiFramework.frontstages.activeFrontstageDef);
|
|
55
|
-
const [layout, setLayout] = React.useState(() => createLayoutStore(def
|
|
55
|
+
const [layout, setLayout] = React.useState(() => createLayoutStore(def?.nineZoneState));
|
|
56
56
|
React.useEffect(() => {
|
|
57
57
|
return UiFramework.frontstages.onFrontstageActivatedEvent.addListener((args) => {
|
|
58
58
|
unstable_batchedUpdates(() => {
|
|
@@ -103,7 +103,7 @@ export function FrameworkStateReducer(state, action, frontstageDef) {
|
|
|
103
103
|
const panel = draft.panels[panelSide];
|
|
104
104
|
const location = toStagePanelLocation(panelSide);
|
|
105
105
|
const panelDef = frontstageDef.getStagePanelDef(location);
|
|
106
|
-
if (panelDef
|
|
106
|
+
if (panelDef?.maxSizeSpec) {
|
|
107
107
|
panel.maxSize = getPanelMaxSize(panelDef.maxSizeSpec, panelSide, action.size);
|
|
108
108
|
if (panel.size) {
|
|
109
109
|
panel.size = Math.min(Math.max(panel.size, panel.minSize), panel.maxSize);
|
|
@@ -120,14 +120,6 @@ export function useNineZoneDispatch(frontstageDef) {
|
|
|
120
120
|
if (action.type === "RESIZE") {
|
|
121
121
|
InternalFrontstageManager.nineZoneSize = Size.create(action.size);
|
|
122
122
|
}
|
|
123
|
-
// istanbul ignore if
|
|
124
|
-
if (action.type === "TOOL_SETTINGS_DRAG_START") {
|
|
125
|
-
void UiFramework.postTelemetry("Tool Settings Undocking", "28B04E07-AE73-4533-A0BA-8E2A8DC99ADF");
|
|
126
|
-
}
|
|
127
|
-
// istanbul ignore if
|
|
128
|
-
if (action.type === "TOOL_SETTINGS_DOCK") {
|
|
129
|
-
void UiFramework.postTelemetry("Tool Settings Docking to Settings Bar", "BEDE684B-B3DB-4637-B3AF-DC3CBA223F94");
|
|
130
|
-
}
|
|
131
123
|
if (action.type === "WIDGET_TAB_POPOUT") {
|
|
132
124
|
const tabId = action.id;
|
|
133
125
|
frontstageDef.popoutWidget(tabId);
|
|
@@ -204,31 +196,33 @@ export function useLabels() {
|
|
|
204
196
|
popoutActiveTab: UiFramework.translate("widget.tooltips.popoutActiveTab"),
|
|
205
197
|
}), []);
|
|
206
198
|
}
|
|
199
|
+
function toTabArgs(widget) {
|
|
200
|
+
const label = getWidgetLabel(widget.label);
|
|
201
|
+
return {
|
|
202
|
+
allowedPanelTargets: widget.allowedPanelTargets?.map((location) => toPanelSide(location)),
|
|
203
|
+
hideWithUiWhenFloating: !!widget.hideWithUiWhenFloating,
|
|
204
|
+
canPopout: widget.canPopout,
|
|
205
|
+
iconSpec: widget.iconSpec,
|
|
206
|
+
isFloatingStateWindowResizable: widget.isFloatingStateWindowResizable,
|
|
207
|
+
label,
|
|
208
|
+
preferredFloatingWidgetSize: widget.defaultFloatingSize,
|
|
209
|
+
preferredPanelWidgetSize: widget.preferredPanelSize,
|
|
210
|
+
};
|
|
211
|
+
}
|
|
207
212
|
/** @internal */
|
|
208
213
|
export function addWidgets(state, widgets, side, widgetId) {
|
|
209
|
-
var _a;
|
|
210
214
|
const visibleWidgets = widgets.filter((w) => w.isVisible && w.defaultState !== WidgetState.Floating);
|
|
211
215
|
if (visibleWidgets.length === 0)
|
|
212
216
|
return state;
|
|
213
217
|
const tabs = new Array();
|
|
214
218
|
for (const widget of visibleWidgets) {
|
|
215
|
-
|
|
216
|
-
state = addTab(state, widget.id, {
|
|
217
|
-
label,
|
|
218
|
-
iconSpec: widget.iconSpec,
|
|
219
|
-
preferredPanelWidgetSize: widget.preferredPanelSize,
|
|
220
|
-
preferredFloatingWidgetSize: widget.defaultFloatingSize,
|
|
221
|
-
canPopout: widget.canPopout,
|
|
222
|
-
isFloatingStateWindowResizable: widget.isFloatingStateWindowResizable,
|
|
223
|
-
hideWithUiWhenFloating: !!widget.hideWithUiWhenFloating,
|
|
224
|
-
allowedPanelTargets: (_a = widget.allowedPanelTargets) === null || _a === void 0 ? void 0 : _a.map((location) => toPanelSide(location)),
|
|
225
|
-
});
|
|
219
|
+
state = addTab(state, widget.id, toTabArgs(widget));
|
|
226
220
|
tabs.push(widget.id);
|
|
227
221
|
}
|
|
228
222
|
const activeWidget = visibleWidgets.find((widget) => widget.isActive);
|
|
229
223
|
const minimized = false;
|
|
230
224
|
// istanbul ignore else
|
|
231
|
-
if (
|
|
225
|
+
if (activeWidget?.defaultState !== WidgetState.Floating) {
|
|
232
226
|
state = addPanelWidget(state, side, widgetId, tabs, {
|
|
233
227
|
activeTabId: activeWidget ? activeWidget.id : tabs[0],
|
|
234
228
|
minimized,
|
|
@@ -239,13 +233,9 @@ export function addWidgets(state, widgets, side, widgetId) {
|
|
|
239
233
|
/** @internal */
|
|
240
234
|
// istanbul ignore next
|
|
241
235
|
export function appendWidgets(state, widgetDefs, location, section) {
|
|
242
|
-
var _a, _b;
|
|
243
|
-
if (widgetDefs.length === 0)
|
|
244
|
-
return state;
|
|
245
236
|
const side = toPanelSide(location);
|
|
246
237
|
// Add missing widget tabs.
|
|
247
238
|
for (const widgetDef of widgetDefs) {
|
|
248
|
-
const label = getWidgetLabel(widgetDef.label);
|
|
249
239
|
const saveTab = state.tabs[widgetDef.id];
|
|
250
240
|
const preferredPanelWidgetSize = saveTab
|
|
251
241
|
? saveTab.preferredPanelWidgetSize
|
|
@@ -260,19 +250,14 @@ export function appendWidgets(state, widgetDefs, location, section) {
|
|
|
260
250
|
!!saveTab.preferredFloatingWidgetSize)
|
|
261
251
|
: !!widgetDef.defaultFloatingSize;
|
|
262
252
|
state = addTab(state, widgetDef.id, {
|
|
263
|
-
|
|
264
|
-
iconSpec: widgetDef.iconSpec,
|
|
265
|
-
canPopout: widgetDef.canPopout,
|
|
266
|
-
preferredPanelWidgetSize,
|
|
253
|
+
...toTabArgs(widgetDef),
|
|
267
254
|
preferredFloatingWidgetSize,
|
|
255
|
+
preferredPanelWidgetSize,
|
|
268
256
|
userSized,
|
|
269
|
-
isFloatingStateWindowResizable: widgetDef.isFloatingStateWindowResizable,
|
|
270
|
-
hideWithUiWhenFloating: !!widgetDef.hideWithUiWhenFloating,
|
|
271
|
-
allowedPanelTargets: (_a = widgetDef.allowedPanelTargets) === null || _a === void 0 ? void 0 : _a.map((l) => toPanelSide(l)),
|
|
272
257
|
});
|
|
273
258
|
if (widgetDef.isFloatingStateSupported &&
|
|
274
259
|
widgetDef.defaultState === WidgetState.Floating) {
|
|
275
|
-
const floatingContainerId =
|
|
260
|
+
const floatingContainerId = widgetDef.floatingContainerId ?? getUniqueId();
|
|
276
261
|
const widgetContainerId = getWidgetId(location, section);
|
|
277
262
|
const home = {
|
|
278
263
|
side,
|
|
@@ -290,7 +275,7 @@ export function appendWidgets(state, widgetDefs, location, section) {
|
|
|
290
275
|
width: 300,
|
|
291
276
|
...tab.preferredFloatingWidgetSize,
|
|
292
277
|
};
|
|
293
|
-
const preferredPoint = preferredPosition
|
|
278
|
+
const preferredPoint = preferredPosition ?? {
|
|
294
279
|
x: (state.size.width - size.width) / 2,
|
|
295
280
|
y: (state.size.height - size.height) / 2,
|
|
296
281
|
};
|
|
@@ -349,16 +334,29 @@ function processPopoutWidgets(initialState, frontstageDef) {
|
|
|
349
334
|
* @internal
|
|
350
335
|
*/
|
|
351
336
|
export function addMissingWidgets(frontstageDef, initialState) {
|
|
352
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
353
337
|
let state = initialState;
|
|
354
|
-
state = appendWidgets(state, determineNewWidgets(
|
|
355
|
-
|
|
356
|
-
state = appendWidgets(state, determineNewWidgets(
|
|
357
|
-
|
|
358
|
-
state = appendWidgets(state, determineNewWidgets(
|
|
359
|
-
|
|
360
|
-
state = appendWidgets(state, determineNewWidgets(
|
|
361
|
-
|
|
338
|
+
state = appendWidgets(state, determineNewWidgets(frontstageDef.leftPanel?.getPanelSectionDef(StagePanelSection.Start)
|
|
339
|
+
.widgetDefs, state), StagePanelLocation.Left, StagePanelSection.Start);
|
|
340
|
+
state = appendWidgets(state, determineNewWidgets(frontstageDef.leftPanel?.getPanelSectionDef(StagePanelSection.End)
|
|
341
|
+
.widgetDefs, state), StagePanelLocation.Left, StagePanelSection.End);
|
|
342
|
+
state = appendWidgets(state, determineNewWidgets(frontstageDef.rightPanel?.getPanelSectionDef(StagePanelSection.Start)
|
|
343
|
+
.widgetDefs, state), StagePanelLocation.Right, StagePanelSection.Start);
|
|
344
|
+
state = appendWidgets(state, determineNewWidgets(frontstageDef.rightPanel?.getPanelSectionDef(StagePanelSection.End)
|
|
345
|
+
.widgetDefs, state), StagePanelLocation.Right, StagePanelSection.End);
|
|
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);
|
|
354
|
+
if (frontstageDef.toolSettings) {
|
|
355
|
+
const newToolSettingsWidgets = determineNewWidgets([frontstageDef.toolSettings], state);
|
|
356
|
+
for (const newToolSettingsWidget of newToolSettingsWidgets) {
|
|
357
|
+
state = addTab(state, newToolSettingsWidget.id, toTabArgs(newToolSettingsWidget));
|
|
358
|
+
}
|
|
359
|
+
}
|
|
362
360
|
return state;
|
|
363
361
|
}
|
|
364
362
|
/** Hide widgets with Hidden defaultState. */
|
|
@@ -377,8 +375,8 @@ function hideWidgets(state, frontstageDef) {
|
|
|
377
375
|
/** Removes NineZoneState widgets that are missing in frontstageDef.
|
|
378
376
|
* @internal
|
|
379
377
|
*/
|
|
380
|
-
export function removeMissingWidgets(frontstageDef,
|
|
381
|
-
|
|
378
|
+
export function removeMissingWidgets(frontstageDef, state) {
|
|
379
|
+
const toolSettingsTabId = state.toolSettings?.tabId;
|
|
382
380
|
for (const [, tab] of Object.entries(state.tabs)) {
|
|
383
381
|
if (tab.id === toolSettingsTabId)
|
|
384
382
|
continue;
|
|
@@ -432,8 +430,8 @@ export function getWidgetId(location, section) {
|
|
|
432
430
|
/** @internal */
|
|
433
431
|
export function getPanelSectionWidgets(frontstageDef, location, section) {
|
|
434
432
|
const stagePanel = frontstageDef.getStagePanelDef(location);
|
|
435
|
-
const panelSection = stagePanel
|
|
436
|
-
return
|
|
433
|
+
const panelSection = stagePanel?.getPanelSectionDef(section);
|
|
434
|
+
return panelSection?.widgetDefs || [];
|
|
437
435
|
}
|
|
438
436
|
/** @internal */
|
|
439
437
|
export function addPanelWidgets(state, frontstageDef, location) {
|
|
@@ -458,15 +456,14 @@ export function initializePanel(state, frontstageDef, location) {
|
|
|
458
456
|
state = addPanelWidgets(state, frontstageDef, location);
|
|
459
457
|
const panelDef = frontstageDef.getStagePanelDef(location);
|
|
460
458
|
state = produce(state, (draft) => {
|
|
461
|
-
var _a, _b, _c;
|
|
462
459
|
const panel = draft.panels[panelSide];
|
|
463
|
-
panel.minSize =
|
|
464
|
-
panel.pinned =
|
|
465
|
-
panel.resizable =
|
|
466
|
-
if (panelDef
|
|
460
|
+
panel.minSize = panelDef?.minSize ?? panel.minSize;
|
|
461
|
+
panel.pinned = panelDef?.pinned ?? panel.pinned;
|
|
462
|
+
panel.resizable = panelDef?.resizable ?? panel.resizable;
|
|
463
|
+
if (panelDef?.maxSizeSpec) {
|
|
467
464
|
panel.maxSize = getPanelMaxSize(panelDef.maxSizeSpec, panelSide, state.size);
|
|
468
465
|
}
|
|
469
|
-
const size = panelDef
|
|
466
|
+
const size = panelDef?.size;
|
|
470
467
|
panel.size =
|
|
471
468
|
size === undefined
|
|
472
469
|
? size
|
|
@@ -483,7 +480,8 @@ function getPanelMaxSize(maxSizeSpec, panel, nineZoneSize) {
|
|
|
483
480
|
: nineZoneSize.width;
|
|
484
481
|
return (maxSizeSpec.percentage / 100) * size;
|
|
485
482
|
}
|
|
486
|
-
|
|
483
|
+
/** @internal */
|
|
484
|
+
export const stateVersion = 14; // this needs to be bumped when NineZoneState is changed (to recreate the layout).
|
|
487
485
|
/** @internal */
|
|
488
486
|
export function initializeNineZoneState(frontstageDef) {
|
|
489
487
|
let nineZone = defaultNineZone;
|
|
@@ -500,30 +498,26 @@ export function initializeNineZoneState(frontstageDef) {
|
|
|
500
498
|
nineZone = initializePanel(nineZone, frontstageDef, StagePanelLocation.Right);
|
|
501
499
|
nineZone = initializePanel(nineZone, frontstageDef, StagePanelLocation.Top);
|
|
502
500
|
nineZone = initializePanel(nineZone, frontstageDef, StagePanelLocation.Bottom);
|
|
503
|
-
nineZone = produce(nineZone, (
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
const
|
|
507
|
-
const firstWidget = panel.widgets.length > 0
|
|
508
|
-
? stateDraft.widgets[panel.widgets[0]]
|
|
509
|
-
: undefined;
|
|
501
|
+
nineZone = produce(nineZone, (draft) => {
|
|
502
|
+
for (const [, panel] of Object.entries(draft.panels)) {
|
|
503
|
+
const expanded = panel.widgets.find((widgetId) => draft.widgets[widgetId].minimized === false);
|
|
504
|
+
const firstWidget = panel.widgets.length > 0 ? draft.widgets[panel.widgets[0]] : undefined;
|
|
510
505
|
// istanbul ignore next
|
|
511
506
|
if (!expanded && firstWidget) {
|
|
512
507
|
firstWidget.minimized = false;
|
|
513
508
|
}
|
|
514
509
|
}
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
const toolSettingsWidgetDef = frontstageDef.toolSettings;
|
|
520
|
-
if (toolSettingsWidgetDef) {
|
|
521
|
-
const toolSettingsTab = stateDraft.tabs[toolSettingsTabId];
|
|
522
|
-
toolSettingsTab.preferredPanelWidgetSize =
|
|
523
|
-
toolSettingsWidgetDef.preferredPanelSize;
|
|
524
|
-
}
|
|
510
|
+
draft.panels.left.collapsed = isPanelCollapsed(frontstageDef.leftPanel?.panelState);
|
|
511
|
+
draft.panels.right.collapsed = isPanelCollapsed(frontstageDef.rightPanel?.panelState);
|
|
512
|
+
draft.panels.top.collapsed = isPanelCollapsed(frontstageDef.topPanel?.panelState);
|
|
513
|
+
draft.panels.bottom.collapsed = isPanelCollapsed(frontstageDef.bottomPanel?.panelState);
|
|
525
514
|
});
|
|
526
515
|
nineZone = addMissingWidgets(frontstageDef, nineZone);
|
|
516
|
+
const toolSettingsWidgetDef = frontstageDef.toolSettings;
|
|
517
|
+
if (toolSettingsWidgetDef) {
|
|
518
|
+
const toolSettingsTabId = toolSettingsWidgetDef.id;
|
|
519
|
+
nineZone = addDockedToolSettings(nineZone, toolSettingsTabId);
|
|
520
|
+
}
|
|
527
521
|
nineZone = hideWidgets(nineZone, frontstageDef);
|
|
528
522
|
nineZone = processPopoutWidgets(nineZone, frontstageDef);
|
|
529
523
|
return nineZone;
|
|
@@ -536,7 +530,7 @@ export function initializeNineZoneState(frontstageDef) {
|
|
|
536
530
|
export function restoreNineZoneState(frontstageDef, saved) {
|
|
537
531
|
let restored = {
|
|
538
532
|
...saved,
|
|
539
|
-
tabs:
|
|
533
|
+
tabs: {},
|
|
540
534
|
};
|
|
541
535
|
for (const [, tab] of Object.entries(saved.tabs)) {
|
|
542
536
|
// Re-add the placeholder tab in order to correctly remove it from the state if WidgetDef is not found.
|
|
@@ -551,15 +545,11 @@ export function restoreNineZoneState(frontstageDef, saved) {
|
|
|
551
545
|
continue;
|
|
552
546
|
}
|
|
553
547
|
restored = produce(restored, (draft) => {
|
|
554
|
-
var _a;
|
|
555
548
|
draft.tabs[tab.id] = {
|
|
556
549
|
...tab,
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
canPopout: widgetDef.canPopout,
|
|
561
|
-
isFloatingStateWindowResizable: widgetDef.isFloatingStateWindowResizable,
|
|
562
|
-
allowedPanelTargets: (_a = widgetDef.allowedPanelTargets) === null || _a === void 0 ? void 0 : _a.map((location) => toPanelSide(location)),
|
|
550
|
+
...toTabArgs(widgetDef),
|
|
551
|
+
preferredFloatingWidgetSize: tab.preferredFloatingWidgetSize,
|
|
552
|
+
preferredPanelWidgetSize: tab.preferredPanelWidgetSize,
|
|
563
553
|
};
|
|
564
554
|
});
|
|
565
555
|
}
|
|
@@ -616,12 +606,9 @@ export function packNineZoneState(state) {
|
|
|
616
606
|
};
|
|
617
607
|
packed = produce(packed, (draft) => {
|
|
618
608
|
for (const [, tab] of Object.entries(state.tabs)) {
|
|
619
|
-
if (tab.id === toolSettingsTabId)
|
|
620
|
-
continue;
|
|
621
609
|
draft.tabs[tab.id] = {
|
|
622
610
|
id: tab.id,
|
|
623
611
|
preferredFloatingWidgetSize: tab.preferredFloatingWidgetSize,
|
|
624
|
-
allowedPanelTargets: tab.allowedPanelTargets,
|
|
625
612
|
userSized: tab.userSized,
|
|
626
613
|
};
|
|
627
614
|
}
|
|
@@ -714,19 +701,27 @@ function addHiddenWidget(state, widgetDef) {
|
|
|
714
701
|
}
|
|
715
702
|
/** @internal */
|
|
716
703
|
export function setWidgetState(state, widgetDef, widgetState) {
|
|
717
|
-
var _a, _b;
|
|
718
704
|
if (widgetState === WidgetState.Hidden) {
|
|
719
705
|
return hideWidget(state, widgetDef);
|
|
720
706
|
}
|
|
721
707
|
else if (widgetState === WidgetState.Open) {
|
|
722
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
|
+
}
|
|
723
716
|
let location = getTabLocation(state, id);
|
|
724
717
|
if (!location) {
|
|
725
718
|
state = addHiddenWidget(state, widgetDef);
|
|
726
719
|
location = getTabLocation(state, id);
|
|
720
|
+
if (widgetDef.isToolSettings) {
|
|
721
|
+
state = addWidgetToolSettings(state, id);
|
|
722
|
+
}
|
|
727
723
|
}
|
|
728
724
|
return produce(state, (draft) => {
|
|
729
|
-
var _a;
|
|
730
725
|
assert(!!location);
|
|
731
726
|
const widget = draft.widgets[location.widgetId];
|
|
732
727
|
widget.minimized = false;
|
|
@@ -741,13 +736,16 @@ export function setWidgetState(state, widgetDef, widgetState) {
|
|
|
741
736
|
panel.collapsed = false;
|
|
742
737
|
if (undefined === panel.size || 0 === panel.size) {
|
|
743
738
|
// istanbul ignore next
|
|
744
|
-
panel.size =
|
|
739
|
+
panel.size = panel.minSize ?? 200;
|
|
745
740
|
}
|
|
746
741
|
}
|
|
747
742
|
});
|
|
748
743
|
}
|
|
749
744
|
else if (widgetState === WidgetState.Closed) {
|
|
750
745
|
const id = widgetDef.id;
|
|
746
|
+
if (widgetDef.isToolSettings && state.toolSettings?.type !== "widget") {
|
|
747
|
+
return state;
|
|
748
|
+
}
|
|
751
749
|
let location = getTabLocation(state, id);
|
|
752
750
|
if (!location) {
|
|
753
751
|
state = addHiddenWidget(state, widgetDef);
|
|
@@ -776,13 +774,30 @@ export function setWidgetState(state, widgetDef, widgetState) {
|
|
|
776
774
|
return state;
|
|
777
775
|
// Widget is not floating.
|
|
778
776
|
state = removeTabFromWidget(state, id);
|
|
779
|
-
const bounds =
|
|
777
|
+
const bounds = widgetDef.tabLocation?.floatingWidget?.bounds;
|
|
780
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
|
+
}
|
|
781
787
|
}
|
|
782
788
|
return state;
|
|
783
789
|
}
|
|
784
790
|
/** Stores widget location and hides it in the UI. */
|
|
785
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
|
+
}
|
|
786
801
|
const location = getTabLocation(state, widgetDef.id);
|
|
787
802
|
if (!location)
|
|
788
803
|
return state;
|
|
@@ -886,8 +901,8 @@ export function useSavedFrontstageState(frontstageDef) {
|
|
|
886
901
|
return;
|
|
887
902
|
if (isFrontstageStateSettingResult(settingResult)) {
|
|
888
903
|
const setting = settingResult.setting;
|
|
889
|
-
if (setting.version
|
|
890
|
-
setting.stateVersion
|
|
904
|
+
if (setting.version === version &&
|
|
905
|
+
setting.stateVersion === stateVersion) {
|
|
891
906
|
const restored = restoreNineZoneState(frontstageDef, setting.nineZone);
|
|
892
907
|
frontstageDef.savedWidgetDefs = setting.widgets;
|
|
893
908
|
restoreSavedWidgets(frontstageDef);
|
|
@@ -974,14 +989,11 @@ const createListener = (frontstageDef, listener) => {
|
|
|
974
989
|
/** @internal */
|
|
975
990
|
export function useFrontstageManager(frontstageDef, useToolAsToolSettingsLabel) {
|
|
976
991
|
React.useEffect(() => {
|
|
977
|
-
|
|
978
|
-
|
|
992
|
+
return UiFramework.frontstages.onWidgetStateChangedEvent.addListener(({ widgetDef, widgetState }) => {
|
|
993
|
+
if (!frontstageDef.nineZoneState)
|
|
994
|
+
return;
|
|
979
995
|
frontstageDef.nineZoneState = setWidgetState(frontstageDef.nineZoneState, widgetDef, widgetState);
|
|
980
996
|
});
|
|
981
|
-
UiFramework.frontstages.onWidgetStateChangedEvent.addListener(listener);
|
|
982
|
-
return () => {
|
|
983
|
-
UiFramework.frontstages.onWidgetStateChangedEvent.removeListener(listener);
|
|
984
|
-
};
|
|
985
997
|
}, [frontstageDef]);
|
|
986
998
|
React.useEffect(() => {
|
|
987
999
|
const listener = createListener(frontstageDef, ({ widgetDef }) => {
|
|
@@ -1039,12 +1051,14 @@ export function useFrontstageManager(frontstageDef, useToolAsToolSettingsLabel)
|
|
|
1039
1051
|
const defaultLabel = React.useMemo(() => UiFramework.translate("widget.labels.toolSettings"), []);
|
|
1040
1052
|
React.useEffect(() => {
|
|
1041
1053
|
const updateLabel = createListener(frontstageDef, () => {
|
|
1042
|
-
var _a;
|
|
1043
1054
|
const toolId = UiFramework.frontstages.activeToolId;
|
|
1044
1055
|
assert(!!frontstageDef.nineZoneState);
|
|
1045
1056
|
const label = useToolAsToolSettingsLabel
|
|
1046
|
-
?
|
|
1057
|
+
? IModelApp.tools.find(toolId)?.flyover || defaultLabel
|
|
1047
1058
|
: defaultLabel;
|
|
1059
|
+
const toolSettingsTabId = frontstageDef.nineZoneState.toolSettings?.tabId;
|
|
1060
|
+
if (!toolSettingsTabId)
|
|
1061
|
+
return;
|
|
1048
1062
|
frontstageDef.nineZoneState = setWidgetLabel(frontstageDef.nineZoneState, toolSettingsTabId, label);
|
|
1049
1063
|
});
|
|
1050
1064
|
// Whenever the frontstageDef or the useTool... changes, keep the label up to date.
|