@itwin/appui-react 3.5.0-dev.7 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +90 -1
- package/lib/cjs/appui-react/UiFramework.d.ts +11 -1
- package/lib/cjs/appui-react/UiFramework.d.ts.map +1 -1
- package/lib/cjs/appui-react/UiFramework.js +18 -3
- package/lib/cjs/appui-react/UiFramework.js.map +1 -1
- package/lib/cjs/appui-react/accudraw/FrameworkAccuDraw.js +2 -2
- package/lib/cjs/appui-react/accudraw/FrameworkAccuDraw.js.map +1 -1
- package/lib/cjs/appui-react/backstage/Backstage.d.ts +3 -0
- package/lib/cjs/appui-react/backstage/Backstage.d.ts.map +1 -1
- package/lib/cjs/appui-react/backstage/Backstage.js +3 -1
- package/lib/cjs/appui-react/backstage/Backstage.js.map +1 -1
- package/lib/cjs/appui-react/backstage/CommandLaunch.js +1 -1
- package/lib/cjs/appui-react/backstage/CommandLaunch.js.map +1 -1
- package/lib/cjs/appui-react/childwindow/ChildWindowManager.js +1 -0
- package/lib/cjs/appui-react/childwindow/ChildWindowManager.js.map +1 -1
- package/lib/cjs/appui-react/configurableui/ConfigurableUiContent.js +1 -1
- package/lib/cjs/appui-react/configurableui/ConfigurableUiContent.js.map +1 -1
- package/lib/cjs/appui-react/configurableui/state.d.ts +4 -1
- package/lib/cjs/appui-react/configurableui/state.d.ts.map +1 -1
- package/lib/cjs/appui-react/configurableui/state.js +6 -0
- package/lib/cjs/appui-react/configurableui/state.js.map +1 -1
- package/lib/cjs/appui-react/content/ContentGroup.d.ts +8 -0
- package/lib/cjs/appui-react/content/ContentGroup.d.ts.map +1 -1
- package/lib/cjs/appui-react/content/ContentGroup.js.map +1 -1
- package/lib/cjs/appui-react/cursor/cursorpopup/CursorPopup.js +2 -2
- package/lib/cjs/appui-react/cursor/cursorpopup/CursorPopup.js.map +1 -1
- package/lib/cjs/appui-react/frontstage/Frontstage.d.ts +5 -1
- package/lib/cjs/appui-react/frontstage/Frontstage.d.ts.map +1 -1
- package/lib/cjs/appui-react/frontstage/Frontstage.js +1 -0
- package/lib/cjs/appui-react/frontstage/Frontstage.js.map +1 -1
- package/lib/cjs/appui-react/frontstage/FrontstageComposer.d.ts +3 -0
- package/lib/cjs/appui-react/frontstage/FrontstageComposer.d.ts.map +1 -1
- package/lib/cjs/appui-react/frontstage/FrontstageComposer.js +5 -2
- package/lib/cjs/appui-react/frontstage/FrontstageComposer.js.map +1 -1
- package/lib/cjs/appui-react/frontstage/FrontstageConfig.d.ts +40 -0
- package/lib/cjs/appui-react/frontstage/FrontstageConfig.d.ts.map +1 -0
- package/lib/cjs/appui-react/frontstage/FrontstageConfig.js +10 -0
- package/lib/cjs/appui-react/frontstage/FrontstageConfig.js.map +1 -0
- package/lib/cjs/appui-react/frontstage/FrontstageDef.d.ts +8 -0
- package/lib/cjs/appui-react/frontstage/FrontstageDef.d.ts.map +1 -1
- package/lib/cjs/appui-react/frontstage/FrontstageDef.js +114 -7
- package/lib/cjs/appui-react/frontstage/FrontstageDef.js.map +1 -1
- package/lib/cjs/appui-react/frontstage/FrontstageManager.d.ts +2 -4
- package/lib/cjs/appui-react/frontstage/FrontstageManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/frontstage/FrontstageManager.js +5 -8
- package/lib/cjs/appui-react/frontstage/FrontstageManager.js.map +1 -1
- package/lib/cjs/appui-react/frontstage/FrontstageProvider.d.ts +9 -1
- package/lib/cjs/appui-react/frontstage/FrontstageProvider.d.ts.map +1 -1
- package/lib/cjs/appui-react/frontstage/FrontstageProvider.js +1 -1
- package/lib/cjs/appui-react/frontstage/FrontstageProvider.js.map +1 -1
- package/lib/cjs/appui-react/frontstage/StandardFrontstageProvider.js +14 -5
- package/lib/cjs/appui-react/frontstage/StandardFrontstageProvider.js.map +1 -1
- package/lib/cjs/appui-react/hooks/useFrameworkVersion.d.ts +13 -3
- package/lib/cjs/appui-react/hooks/useFrameworkVersion.d.ts.map +1 -1
- package/lib/cjs/appui-react/hooks/useFrameworkVersion.js +15 -7
- package/lib/cjs/appui-react/hooks/useFrameworkVersion.js.map +1 -1
- package/lib/cjs/appui-react/messages/ActivityMessage.d.ts +1 -0
- package/lib/cjs/appui-react/messages/ActivityMessage.d.ts.map +1 -1
- package/lib/cjs/appui-react/messages/ActivityMessage.js.map +1 -1
- package/lib/cjs/appui-react/messages/ActivityMessagePopup.d.ts +2 -0
- package/lib/cjs/appui-react/messages/ActivityMessagePopup.d.ts.map +1 -1
- package/lib/cjs/appui-react/messages/ActivityMessagePopup.js +1 -0
- package/lib/cjs/appui-react/messages/ActivityMessagePopup.js.map +1 -1
- package/lib/cjs/appui-react/messages/StatusMessageRenderer.d.ts +1 -0
- package/lib/cjs/appui-react/messages/StatusMessageRenderer.d.ts.map +1 -1
- package/lib/cjs/appui-react/messages/StatusMessageRenderer.js.map +1 -1
- package/lib/cjs/appui-react/messages/StickyMessage.d.ts +1 -0
- package/lib/cjs/appui-react/messages/StickyMessage.d.ts.map +1 -1
- package/lib/cjs/appui-react/messages/StickyMessage.js.map +1 -1
- package/lib/cjs/appui-react/messages/ToastMessage.d.ts +1 -0
- package/lib/cjs/appui-react/messages/ToastMessage.d.ts.map +1 -1
- package/lib/cjs/appui-react/messages/ToastMessage.js.map +1 -1
- package/lib/cjs/appui-react/pickers/ListPicker.d.ts +1 -0
- package/lib/cjs/appui-react/pickers/ListPicker.d.ts.map +1 -1
- package/lib/cjs/appui-react/pickers/ListPicker.js +4 -2
- package/lib/cjs/appui-react/pickers/ListPicker.js.map +1 -1
- package/lib/cjs/appui-react/pickers/ListPicker.scss +2 -1
- package/lib/cjs/appui-react/redux/FrameworkState.d.ts +1 -1
- package/lib/cjs/appui-react/safearea/SafeAreaContext.d.ts +1 -0
- package/lib/cjs/appui-react/safearea/SafeAreaContext.d.ts.map +1 -1
- package/lib/cjs/appui-react/safearea/SafeAreaContext.js +2 -1
- package/lib/cjs/appui-react/safearea/SafeAreaContext.js.map +1 -1
- package/lib/cjs/appui-react/safearea/SafeAreaInsets.d.ts +13 -0
- package/lib/cjs/appui-react/safearea/SafeAreaInsets.d.ts.map +1 -0
- package/lib/cjs/appui-react/safearea/SafeAreaInsets.js +16 -0
- package/lib/cjs/appui-react/safearea/SafeAreaInsets.js.map +1 -0
- package/lib/cjs/appui-react/selection/ClearEmphasisStatusField.js +2 -1
- package/lib/cjs/appui-react/selection/ClearEmphasisStatusField.js.map +1 -1
- package/lib/cjs/appui-react/settings/ui/UiSettingsPage.d.ts.map +1 -1
- package/lib/cjs/appui-react/settings/ui/UiSettingsPage.js +16 -3
- package/lib/cjs/appui-react/settings/ui/UiSettingsPage.js.map +1 -1
- package/lib/cjs/appui-react/shared/ActionButtonItemDef.d.ts.map +1 -1
- package/lib/cjs/appui-react/shared/ActionButtonItemDef.js +3 -2
- package/lib/cjs/appui-react/shared/ActionButtonItemDef.js.map +1 -1
- package/lib/cjs/appui-react/stagepanels/StagePanel.d.ts +3 -0
- package/lib/cjs/appui-react/stagepanels/StagePanel.d.ts.map +1 -1
- package/lib/cjs/appui-react/stagepanels/StagePanel.js +1 -0
- package/lib/cjs/appui-react/stagepanels/StagePanel.js.map +1 -1
- package/lib/cjs/appui-react/stagepanels/StagePanelConfig.d.ts +39 -0
- package/lib/cjs/appui-react/stagepanels/StagePanelConfig.d.ts.map +1 -0
- package/lib/cjs/appui-react/stagepanels/StagePanelConfig.js +11 -0
- package/lib/cjs/appui-react/stagepanels/StagePanelConfig.js.map +1 -0
- package/lib/cjs/appui-react/stagepanels/StagePanelDef.d.ts +6 -6
- package/lib/cjs/appui-react/stagepanels/StagePanelDef.d.ts.map +1 -1
- package/lib/cjs/appui-react/stagepanels/StagePanelDef.js +4 -7
- package/lib/cjs/appui-react/stagepanels/StagePanelDef.js.map +1 -1
- package/lib/cjs/appui-react/statusbar/Indicator.d.ts +26 -0
- package/lib/cjs/appui-react/statusbar/Indicator.d.ts.map +1 -0
- package/lib/cjs/appui-react/statusbar/Indicator.js +38 -0
- package/lib/cjs/appui-react/statusbar/Indicator.js.map +1 -0
- package/lib/cjs/appui-react/statusbar/Indicator.scss +110 -0
- package/lib/cjs/appui-react/statusbar/LabelIndicator.d.ts +24 -0
- package/lib/cjs/appui-react/statusbar/LabelIndicator.d.ts.map +1 -0
- package/lib/cjs/appui-react/statusbar/LabelIndicator.js +29 -0
- package/lib/cjs/appui-react/statusbar/LabelIndicator.js.map +1 -0
- package/lib/cjs/appui-react/statusbar/LabelIndicator.scss +43 -0
- package/lib/cjs/appui-react/statusbar/Separator.d.ts +10 -0
- package/lib/cjs/appui-react/statusbar/Separator.d.ts.map +1 -0
- package/lib/cjs/appui-react/statusbar/Separator.js +21 -0
- package/lib/cjs/appui-react/statusbar/Separator.js.map +1 -0
- package/lib/cjs/appui-react/statusbar/StatusBarComposer.js +2 -1
- package/lib/cjs/appui-react/statusbar/StatusBarComposer.js.map +1 -1
- package/lib/cjs/appui-react/statusbar/dialog/Button.d.ts +21 -0
- package/lib/cjs/appui-react/statusbar/dialog/Button.d.ts.map +1 -0
- package/lib/cjs/appui-react/statusbar/dialog/Button.js +20 -0
- package/lib/cjs/appui-react/statusbar/dialog/Button.js.map +1 -0
- package/lib/cjs/appui-react/statusbar/dialog/Dialog.d.ts +30 -0
- package/lib/cjs/appui-react/statusbar/dialog/Dialog.d.ts.map +1 -0
- package/lib/cjs/appui-react/statusbar/dialog/Dialog.js +31 -0
- package/lib/cjs/appui-react/statusbar/dialog/Dialog.js.map +1 -0
- package/lib/cjs/appui-react/statusbar/dialog/TitleBar.d.ts +19 -0
- package/lib/cjs/appui-react/statusbar/dialog/TitleBar.d.ts.map +1 -0
- package/lib/cjs/appui-react/statusbar/dialog/TitleBar.js +20 -0
- package/lib/cjs/appui-react/statusbar/dialog/TitleBar.js.map +1 -0
- package/lib/cjs/appui-react/statusfields/Indicator.d.ts +1 -0
- package/lib/cjs/appui-react/statusfields/Indicator.d.ts.map +1 -1
- package/lib/cjs/appui-react/statusfields/Indicator.js +1 -0
- package/lib/cjs/appui-react/statusfields/Indicator.js.map +1 -1
- package/lib/cjs/appui-react/statusfields/MessageCenter.d.ts.map +1 -1
- package/lib/cjs/appui-react/statusfields/MessageCenter.js +2 -5
- package/lib/cjs/appui-react/statusfields/MessageCenter.js.map +1 -1
- package/lib/cjs/appui-react/statusfields/PromptField.js +2 -1
- package/lib/cjs/appui-react/statusfields/PromptField.js.map +1 -1
- package/lib/cjs/appui-react/statusfields/SectionsField.d.ts.map +1 -1
- package/lib/cjs/appui-react/statusfields/SectionsField.js +4 -2
- package/lib/cjs/appui-react/statusfields/SectionsField.js.map +1 -1
- package/lib/cjs/appui-react/statusfields/SelectionInfo.js +2 -1
- package/lib/cjs/appui-react/statusfields/SelectionInfo.js.map +1 -1
- package/lib/cjs/appui-react/statusfields/SelectionScope.js +2 -1
- package/lib/cjs/appui-react/statusfields/SelectionScope.js.map +1 -1
- package/lib/cjs/appui-react/statusfields/SnapMode.js +2 -1
- package/lib/cjs/appui-react/statusfields/SnapMode.js.map +1 -1
- package/lib/cjs/appui-react/statusfields/ViewAttributes.d.ts.map +1 -1
- package/lib/cjs/appui-react/statusfields/ViewAttributes.js +3 -2
- package/lib/cjs/appui-react/statusfields/ViewAttributes.js.map +1 -1
- package/lib/cjs/appui-react/statusfields/toolassistance/ToolAssistanceField.d.ts +0 -1
- package/lib/cjs/appui-react/statusfields/toolassistance/ToolAssistanceField.d.ts.map +1 -1
- package/lib/cjs/appui-react/statusfields/toolassistance/ToolAssistanceField.js +13 -11
- package/lib/cjs/appui-react/statusfields/toolassistance/ToolAssistanceField.js.map +1 -1
- package/lib/cjs/appui-react/syncui/SyncUiEventDispatcher.d.ts +6 -1
- package/lib/cjs/appui-react/syncui/SyncUiEventDispatcher.d.ts.map +1 -1
- package/lib/cjs/appui-react/syncui/SyncUiEventDispatcher.js +14 -0
- package/lib/cjs/appui-react/syncui/SyncUiEventDispatcher.js.map +1 -1
- package/lib/cjs/appui-react/theme/ThemeManager.d.ts +7 -1
- package/lib/cjs/appui-react/theme/ThemeManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/theme/ThemeManager.js +14 -3
- package/lib/cjs/appui-react/theme/ThemeManager.js.map +1 -1
- package/lib/cjs/appui-react/toolbar/ActionItemButton.d.ts +2 -0
- package/lib/cjs/appui-react/toolbar/ActionItemButton.d.ts.map +1 -1
- package/lib/cjs/appui-react/toolbar/ActionItemButton.js +1 -0
- package/lib/cjs/appui-react/toolbar/ActionItemButton.js.map +1 -1
- package/lib/cjs/appui-react/toolbar/GroupItem.d.ts +2 -0
- package/lib/cjs/appui-react/toolbar/GroupItem.d.ts.map +1 -1
- package/lib/cjs/appui-react/toolbar/GroupItem.js +1 -0
- package/lib/cjs/appui-react/toolbar/GroupItem.js.map +1 -1
- package/lib/cjs/appui-react/toolbar/ToolButton.d.ts +2 -0
- package/lib/cjs/appui-react/toolbar/ToolButton.d.ts.map +1 -1
- package/lib/cjs/appui-react/toolbar/ToolButton.js +1 -0
- package/lib/cjs/appui-react/toolbar/ToolButton.js.map +1 -1
- package/lib/cjs/appui-react/toolbar/ToolbarComposer.js +1 -1
- package/lib/cjs/appui-react/toolbar/ToolbarComposer.js.map +1 -1
- package/lib/cjs/appui-react/tools/RestoreLayoutTool.d.ts +9 -0
- package/lib/cjs/appui-react/tools/RestoreLayoutTool.d.ts.map +1 -1
- package/lib/cjs/appui-react/tools/RestoreLayoutTool.js +17 -1
- package/lib/cjs/appui-react/tools/RestoreLayoutTool.js.map +1 -1
- package/lib/cjs/appui-react/ui-items-provider/StandardStatusbarItemsProvider.d.ts.map +1 -1
- package/lib/cjs/appui-react/ui-items-provider/StandardStatusbarItemsProvider.js +3 -3
- package/lib/cjs/appui-react/ui-items-provider/StandardStatusbarItemsProvider.js.map +1 -1
- package/lib/cjs/appui-react/ui-items-provider/StandardStatusbarUiItemsProvider.js +3 -3
- package/lib/cjs/appui-react/ui-items-provider/StandardStatusbarUiItemsProvider.js.map +1 -1
- package/lib/cjs/appui-react/uiprovider/DefaultDialogGridContainer.js +1 -1
- package/lib/cjs/appui-react/uiprovider/DefaultDialogGridContainer.js.map +1 -1
- package/lib/cjs/appui-react/uistate/AppUiSettings.d.ts +2 -0
- package/lib/cjs/appui-react/uistate/AppUiSettings.d.ts.map +1 -1
- package/lib/cjs/appui-react/uistate/AppUiSettings.js +6 -1
- package/lib/cjs/appui-react/uistate/AppUiSettings.js.map +1 -1
- package/lib/cjs/appui-react/utils/UiShowHideManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/utils/UiShowHideManager.js +8 -0
- package/lib/cjs/appui-react/utils/UiShowHideManager.js.map +1 -1
- package/lib/cjs/appui-react/widget-panels/Frontstage.d.ts.map +1 -1
- package/lib/cjs/appui-react/widget-panels/Frontstage.js +28 -19
- package/lib/cjs/appui-react/widget-panels/Frontstage.js.map +1 -1
- package/lib/cjs/appui-react/widget-panels/StatusBar.d.ts.map +1 -1
- package/lib/cjs/appui-react/widget-panels/StatusBar.js +5 -2
- package/lib/cjs/appui-react/widget-panels/StatusBar.js.map +1 -1
- package/lib/cjs/appui-react/widget-panels/Toolbars.d.ts.map +1 -1
- package/lib/cjs/appui-react/widget-panels/Toolbars.js +10 -3
- package/lib/cjs/appui-react/widget-panels/Toolbars.js.map +1 -1
- package/lib/cjs/appui-react/widget-panels/useWidgetDirection.js +1 -1
- package/lib/cjs/appui-react/widget-panels/useWidgetDirection.js.map +1 -1
- package/lib/cjs/appui-react/widgets/BackstageAppButton.js +2 -2
- package/lib/cjs/appui-react/widgets/BackstageAppButton.js.map +1 -1
- package/lib/cjs/appui-react/widgets/NavigationWidget.js.map +1 -1
- package/lib/cjs/appui-react/widgets/NavigationWidgetComposer.js +1 -1
- package/lib/cjs/appui-react/widgets/NavigationWidgetComposer.js.map +1 -1
- package/lib/cjs/appui-react/widgets/ToolWidget.js.map +1 -1
- package/lib/cjs/appui-react/widgets/ToolbarWidgetBase.js.map +1 -1
- package/lib/cjs/appui-react/widgets/Widget.d.ts +1 -0
- package/lib/cjs/appui-react/widgets/Widget.d.ts.map +1 -1
- package/lib/cjs/appui-react/widgets/Widget.js +1 -0
- package/lib/cjs/appui-react/widgets/Widget.js.map +1 -1
- package/lib/cjs/appui-react/widgets/WidgetConfig.d.ts +11 -0
- package/lib/cjs/appui-react/widgets/WidgetConfig.d.ts.map +1 -0
- package/lib/cjs/appui-react/widgets/WidgetConfig.js +10 -0
- package/lib/cjs/appui-react/widgets/WidgetConfig.js.map +1 -0
- package/lib/cjs/appui-react/widgets/WidgetDef.d.ts +14 -1
- package/lib/cjs/appui-react/widgets/WidgetDef.d.ts.map +1 -1
- package/lib/cjs/appui-react/widgets/WidgetDef.js +21 -11
- package/lib/cjs/appui-react/widgets/WidgetDef.js.map +1 -1
- package/lib/cjs/appui-react/widgets/WidgetProps.d.ts +1 -0
- package/lib/cjs/appui-react/widgets/WidgetProps.d.ts.map +1 -1
- package/lib/cjs/appui-react/widgets/WidgetProps.js.map +1 -1
- package/lib/cjs/appui-react/zones/Zone.d.ts +5 -1
- package/lib/cjs/appui-react/zones/Zone.d.ts.map +1 -1
- package/lib/cjs/appui-react/zones/Zone.js +1 -0
- package/lib/cjs/appui-react/zones/Zone.js.map +1 -1
- package/lib/cjs/appui-react/zones/ZoneDef.d.ts +1 -0
- package/lib/cjs/appui-react/zones/ZoneDef.d.ts.map +1 -1
- package/lib/cjs/appui-react/zones/ZoneDef.js +2 -2
- package/lib/cjs/appui-react/zones/ZoneDef.js.map +1 -1
- package/lib/cjs/appui-react.d.ts +8 -0
- package/lib/cjs/appui-react.d.ts.map +1 -1
- package/lib/cjs/appui-react.js +8 -0
- package/lib/cjs/appui-react.js.map +1 -1
- package/lib/esm/appui-react/UiFramework.d.ts +11 -1
- package/lib/esm/appui-react/UiFramework.d.ts.map +1 -1
- package/lib/esm/appui-react/UiFramework.js +19 -4
- package/lib/esm/appui-react/UiFramework.js.map +1 -1
- package/lib/esm/appui-react/accudraw/FrameworkAccuDraw.js +2 -2
- package/lib/esm/appui-react/accudraw/FrameworkAccuDraw.js.map +1 -1
- package/lib/esm/appui-react/backstage/Backstage.d.ts +3 -0
- package/lib/esm/appui-react/backstage/Backstage.d.ts.map +1 -1
- package/lib/esm/appui-react/backstage/Backstage.js +3 -1
- package/lib/esm/appui-react/backstage/Backstage.js.map +1 -1
- package/lib/esm/appui-react/backstage/CommandLaunch.js +1 -1
- package/lib/esm/appui-react/backstage/CommandLaunch.js.map +1 -1
- package/lib/esm/appui-react/childwindow/ChildWindowManager.js +1 -0
- package/lib/esm/appui-react/childwindow/ChildWindowManager.js.map +1 -1
- package/lib/esm/appui-react/configurableui/ConfigurableUiContent.js +1 -1
- package/lib/esm/appui-react/configurableui/ConfigurableUiContent.js.map +1 -1
- package/lib/esm/appui-react/configurableui/state.d.ts +4 -1
- package/lib/esm/appui-react/configurableui/state.d.ts.map +1 -1
- package/lib/esm/appui-react/configurableui/state.js +7 -1
- package/lib/esm/appui-react/configurableui/state.js.map +1 -1
- package/lib/esm/appui-react/content/ContentGroup.d.ts +8 -0
- package/lib/esm/appui-react/content/ContentGroup.d.ts.map +1 -1
- package/lib/esm/appui-react/content/ContentGroup.js.map +1 -1
- package/lib/esm/appui-react/cursor/cursorpopup/CursorPopup.js +2 -2
- package/lib/esm/appui-react/cursor/cursorpopup/CursorPopup.js.map +1 -1
- package/lib/esm/appui-react/frontstage/Frontstage.d.ts +5 -1
- package/lib/esm/appui-react/frontstage/Frontstage.d.ts.map +1 -1
- package/lib/esm/appui-react/frontstage/Frontstage.js +1 -0
- package/lib/esm/appui-react/frontstage/Frontstage.js.map +1 -1
- package/lib/esm/appui-react/frontstage/FrontstageComposer.d.ts +3 -0
- package/lib/esm/appui-react/frontstage/FrontstageComposer.d.ts.map +1 -1
- package/lib/esm/appui-react/frontstage/FrontstageComposer.js +6 -3
- package/lib/esm/appui-react/frontstage/FrontstageComposer.js.map +1 -1
- package/lib/esm/appui-react/frontstage/FrontstageConfig.d.ts +40 -0
- package/lib/esm/appui-react/frontstage/FrontstageConfig.d.ts.map +1 -0
- package/lib/esm/appui-react/frontstage/FrontstageConfig.js +9 -0
- package/lib/esm/appui-react/frontstage/FrontstageConfig.js.map +1 -0
- package/lib/esm/appui-react/frontstage/FrontstageDef.d.ts +8 -0
- package/lib/esm/appui-react/frontstage/FrontstageDef.d.ts.map +1 -1
- package/lib/esm/appui-react/frontstage/FrontstageDef.js +115 -8
- package/lib/esm/appui-react/frontstage/FrontstageDef.js.map +1 -1
- package/lib/esm/appui-react/frontstage/FrontstageManager.d.ts +2 -4
- package/lib/esm/appui-react/frontstage/FrontstageManager.d.ts.map +1 -1
- package/lib/esm/appui-react/frontstage/FrontstageManager.js +5 -8
- package/lib/esm/appui-react/frontstage/FrontstageManager.js.map +1 -1
- package/lib/esm/appui-react/frontstage/FrontstageProvider.d.ts +9 -1
- package/lib/esm/appui-react/frontstage/FrontstageProvider.d.ts.map +1 -1
- package/lib/esm/appui-react/frontstage/FrontstageProvider.js +1 -1
- package/lib/esm/appui-react/frontstage/FrontstageProvider.js.map +1 -1
- package/lib/esm/appui-react/frontstage/StandardFrontstageProvider.js +14 -5
- package/lib/esm/appui-react/frontstage/StandardFrontstageProvider.js.map +1 -1
- package/lib/esm/appui-react/hooks/useFrameworkVersion.d.ts +13 -3
- package/lib/esm/appui-react/hooks/useFrameworkVersion.d.ts.map +1 -1
- package/lib/esm/appui-react/hooks/useFrameworkVersion.js +15 -7
- package/lib/esm/appui-react/hooks/useFrameworkVersion.js.map +1 -1
- package/lib/esm/appui-react/messages/ActivityMessage.d.ts +1 -0
- package/lib/esm/appui-react/messages/ActivityMessage.d.ts.map +1 -1
- package/lib/esm/appui-react/messages/ActivityMessage.js.map +1 -1
- package/lib/esm/appui-react/messages/ActivityMessagePopup.d.ts +2 -0
- package/lib/esm/appui-react/messages/ActivityMessagePopup.d.ts.map +1 -1
- package/lib/esm/appui-react/messages/ActivityMessagePopup.js +1 -0
- package/lib/esm/appui-react/messages/ActivityMessagePopup.js.map +1 -1
- package/lib/esm/appui-react/messages/StatusMessageRenderer.d.ts +1 -0
- package/lib/esm/appui-react/messages/StatusMessageRenderer.d.ts.map +1 -1
- package/lib/esm/appui-react/messages/StatusMessageRenderer.js.map +1 -1
- package/lib/esm/appui-react/messages/StickyMessage.d.ts +1 -0
- package/lib/esm/appui-react/messages/StickyMessage.d.ts.map +1 -1
- package/lib/esm/appui-react/messages/StickyMessage.js.map +1 -1
- package/lib/esm/appui-react/messages/ToastMessage.d.ts +1 -0
- package/lib/esm/appui-react/messages/ToastMessage.d.ts.map +1 -1
- package/lib/esm/appui-react/messages/ToastMessage.js.map +1 -1
- package/lib/esm/appui-react/pickers/ListPicker.d.ts +1 -0
- package/lib/esm/appui-react/pickers/ListPicker.d.ts.map +1 -1
- package/lib/esm/appui-react/pickers/ListPicker.js +4 -2
- package/lib/esm/appui-react/pickers/ListPicker.js.map +1 -1
- package/lib/esm/appui-react/pickers/ListPicker.scss +2 -1
- package/lib/esm/appui-react/redux/FrameworkState.d.ts +1 -1
- package/lib/esm/appui-react/safearea/SafeAreaContext.d.ts +1 -0
- package/lib/esm/appui-react/safearea/SafeAreaContext.d.ts.map +1 -1
- package/lib/esm/appui-react/safearea/SafeAreaContext.js +2 -1
- package/lib/esm/appui-react/safearea/SafeAreaContext.js.map +1 -1
- package/lib/esm/appui-react/safearea/SafeAreaInsets.d.ts +13 -0
- package/lib/esm/appui-react/safearea/SafeAreaInsets.d.ts.map +1 -0
- package/lib/esm/appui-react/safearea/SafeAreaInsets.js +13 -0
- package/lib/esm/appui-react/safearea/SafeAreaInsets.js.map +1 -0
- package/lib/esm/appui-react/selection/ClearEmphasisStatusField.js +2 -1
- package/lib/esm/appui-react/selection/ClearEmphasisStatusField.js.map +1 -1
- package/lib/esm/appui-react/settings/ui/UiSettingsPage.d.ts.map +1 -1
- package/lib/esm/appui-react/settings/ui/UiSettingsPage.js +16 -3
- package/lib/esm/appui-react/settings/ui/UiSettingsPage.js.map +1 -1
- package/lib/esm/appui-react/shared/ActionButtonItemDef.d.ts.map +1 -1
- package/lib/esm/appui-react/shared/ActionButtonItemDef.js +3 -2
- package/lib/esm/appui-react/shared/ActionButtonItemDef.js.map +1 -1
- package/lib/esm/appui-react/stagepanels/StagePanel.d.ts +3 -0
- package/lib/esm/appui-react/stagepanels/StagePanel.d.ts.map +1 -1
- package/lib/esm/appui-react/stagepanels/StagePanel.js +1 -0
- package/lib/esm/appui-react/stagepanels/StagePanel.js.map +1 -1
- package/lib/esm/appui-react/stagepanels/StagePanelConfig.d.ts +39 -0
- package/lib/esm/appui-react/stagepanels/StagePanelConfig.d.ts.map +1 -0
- package/lib/esm/appui-react/stagepanels/StagePanelConfig.js +10 -0
- package/lib/esm/appui-react/stagepanels/StagePanelConfig.js.map +1 -0
- package/lib/esm/appui-react/stagepanels/StagePanelDef.d.ts +6 -6
- package/lib/esm/appui-react/stagepanels/StagePanelDef.d.ts.map +1 -1
- package/lib/esm/appui-react/stagepanels/StagePanelDef.js +4 -7
- package/lib/esm/appui-react/stagepanels/StagePanelDef.js.map +1 -1
- package/lib/esm/appui-react/statusbar/Indicator.d.ts +26 -0
- package/lib/esm/appui-react/statusbar/Indicator.d.ts.map +1 -0
- package/lib/esm/appui-react/statusbar/Indicator.js +34 -0
- package/lib/esm/appui-react/statusbar/Indicator.js.map +1 -0
- package/lib/esm/appui-react/statusbar/Indicator.scss +110 -0
- package/lib/esm/appui-react/statusbar/LabelIndicator.d.ts +24 -0
- package/lib/esm/appui-react/statusbar/LabelIndicator.d.ts.map +1 -0
- package/lib/esm/appui-react/statusbar/LabelIndicator.js +25 -0
- package/lib/esm/appui-react/statusbar/LabelIndicator.js.map +1 -0
- package/lib/esm/appui-react/statusbar/LabelIndicator.scss +43 -0
- package/lib/esm/appui-react/statusbar/Separator.d.ts +10 -0
- package/lib/esm/appui-react/statusbar/Separator.d.ts.map +1 -0
- package/lib/esm/appui-react/statusbar/Separator.js +17 -0
- package/lib/esm/appui-react/statusbar/Separator.js.map +1 -0
- package/lib/esm/appui-react/statusbar/StatusBarComposer.js +2 -1
- package/lib/esm/appui-react/statusbar/StatusBarComposer.js.map +1 -1
- package/lib/esm/appui-react/statusbar/dialog/Button.d.ts +21 -0
- package/lib/esm/appui-react/statusbar/dialog/Button.d.ts.map +1 -0
- package/lib/esm/appui-react/statusbar/dialog/Button.js +16 -0
- package/lib/esm/appui-react/statusbar/dialog/Button.js.map +1 -0
- package/lib/esm/appui-react/statusbar/dialog/Dialog.d.ts +30 -0
- package/lib/esm/appui-react/statusbar/dialog/Dialog.d.ts.map +1 -0
- package/lib/esm/appui-react/statusbar/dialog/Dialog.js +27 -0
- package/lib/esm/appui-react/statusbar/dialog/Dialog.js.map +1 -0
- package/lib/esm/appui-react/statusbar/dialog/TitleBar.d.ts +19 -0
- package/lib/esm/appui-react/statusbar/dialog/TitleBar.d.ts.map +1 -0
- package/lib/esm/appui-react/statusbar/dialog/TitleBar.js +16 -0
- package/lib/esm/appui-react/statusbar/dialog/TitleBar.js.map +1 -0
- package/lib/esm/appui-react/statusfields/Indicator.d.ts +1 -0
- package/lib/esm/appui-react/statusfields/Indicator.d.ts.map +1 -1
- package/lib/esm/appui-react/statusfields/Indicator.js +1 -0
- package/lib/esm/appui-react/statusfields/Indicator.js.map +1 -1
- package/lib/esm/appui-react/statusfields/MessageCenter.d.ts.map +1 -1
- package/lib/esm/appui-react/statusfields/MessageCenter.js +2 -5
- package/lib/esm/appui-react/statusfields/MessageCenter.js.map +1 -1
- package/lib/esm/appui-react/statusfields/PromptField.js +2 -1
- package/lib/esm/appui-react/statusfields/PromptField.js.map +1 -1
- package/lib/esm/appui-react/statusfields/SectionsField.d.ts.map +1 -1
- package/lib/esm/appui-react/statusfields/SectionsField.js +5 -3
- package/lib/esm/appui-react/statusfields/SectionsField.js.map +1 -1
- package/lib/esm/appui-react/statusfields/SelectionInfo.js +2 -1
- package/lib/esm/appui-react/statusfields/SelectionInfo.js.map +1 -1
- package/lib/esm/appui-react/statusfields/SelectionScope.js +2 -1
- package/lib/esm/appui-react/statusfields/SelectionScope.js.map +1 -1
- package/lib/esm/appui-react/statusfields/SnapMode.js +2 -1
- package/lib/esm/appui-react/statusfields/SnapMode.js.map +1 -1
- package/lib/esm/appui-react/statusfields/ViewAttributes.d.ts.map +1 -1
- package/lib/esm/appui-react/statusfields/ViewAttributes.js +3 -2
- package/lib/esm/appui-react/statusfields/ViewAttributes.js.map +1 -1
- package/lib/esm/appui-react/statusfields/toolassistance/ToolAssistanceField.d.ts +0 -1
- package/lib/esm/appui-react/statusfields/toolassistance/ToolAssistanceField.d.ts.map +1 -1
- package/lib/esm/appui-react/statusfields/toolassistance/ToolAssistanceField.js +15 -13
- package/lib/esm/appui-react/statusfields/toolassistance/ToolAssistanceField.js.map +1 -1
- package/lib/esm/appui-react/syncui/SyncUiEventDispatcher.d.ts +6 -1
- package/lib/esm/appui-react/syncui/SyncUiEventDispatcher.d.ts.map +1 -1
- package/lib/esm/appui-react/syncui/SyncUiEventDispatcher.js +14 -0
- package/lib/esm/appui-react/syncui/SyncUiEventDispatcher.js.map +1 -1
- package/lib/esm/appui-react/theme/ThemeManager.d.ts +7 -1
- package/lib/esm/appui-react/theme/ThemeManager.d.ts.map +1 -1
- package/lib/esm/appui-react/theme/ThemeManager.js +13 -2
- package/lib/esm/appui-react/theme/ThemeManager.js.map +1 -1
- package/lib/esm/appui-react/toolbar/ActionItemButton.d.ts +2 -0
- package/lib/esm/appui-react/toolbar/ActionItemButton.d.ts.map +1 -1
- package/lib/esm/appui-react/toolbar/ActionItemButton.js +1 -0
- package/lib/esm/appui-react/toolbar/ActionItemButton.js.map +1 -1
- package/lib/esm/appui-react/toolbar/GroupItem.d.ts +2 -0
- package/lib/esm/appui-react/toolbar/GroupItem.d.ts.map +1 -1
- package/lib/esm/appui-react/toolbar/GroupItem.js +1 -0
- package/lib/esm/appui-react/toolbar/GroupItem.js.map +1 -1
- package/lib/esm/appui-react/toolbar/ToolButton.d.ts +2 -0
- package/lib/esm/appui-react/toolbar/ToolButton.d.ts.map +1 -1
- package/lib/esm/appui-react/toolbar/ToolButton.js +1 -0
- package/lib/esm/appui-react/toolbar/ToolButton.js.map +1 -1
- package/lib/esm/appui-react/toolbar/ToolbarComposer.js +1 -1
- package/lib/esm/appui-react/toolbar/ToolbarComposer.js.map +1 -1
- package/lib/esm/appui-react/tools/RestoreLayoutTool.d.ts +9 -0
- package/lib/esm/appui-react/tools/RestoreLayoutTool.d.ts.map +1 -1
- package/lib/esm/appui-react/tools/RestoreLayoutTool.js +15 -0
- package/lib/esm/appui-react/tools/RestoreLayoutTool.js.map +1 -1
- package/lib/esm/appui-react/ui-items-provider/StandardStatusbarItemsProvider.d.ts.map +1 -1
- package/lib/esm/appui-react/ui-items-provider/StandardStatusbarItemsProvider.js +3 -3
- package/lib/esm/appui-react/ui-items-provider/StandardStatusbarItemsProvider.js.map +1 -1
- package/lib/esm/appui-react/ui-items-provider/StandardStatusbarUiItemsProvider.js +3 -3
- package/lib/esm/appui-react/ui-items-provider/StandardStatusbarUiItemsProvider.js.map +1 -1
- package/lib/esm/appui-react/uiprovider/DefaultDialogGridContainer.js +1 -1
- package/lib/esm/appui-react/uiprovider/DefaultDialogGridContainer.js.map +1 -1
- package/lib/esm/appui-react/uistate/AppUiSettings.d.ts +2 -0
- package/lib/esm/appui-react/uistate/AppUiSettings.d.ts.map +1 -1
- package/lib/esm/appui-react/uistate/AppUiSettings.js +6 -1
- package/lib/esm/appui-react/uistate/AppUiSettings.js.map +1 -1
- package/lib/esm/appui-react/utils/UiShowHideManager.d.ts.map +1 -1
- package/lib/esm/appui-react/utils/UiShowHideManager.js +8 -0
- package/lib/esm/appui-react/utils/UiShowHideManager.js.map +1 -1
- package/lib/esm/appui-react/widget-panels/Frontstage.d.ts.map +1 -1
- package/lib/esm/appui-react/widget-panels/Frontstage.js +28 -19
- package/lib/esm/appui-react/widget-panels/Frontstage.js.map +1 -1
- package/lib/esm/appui-react/widget-panels/StatusBar.d.ts.map +1 -1
- package/lib/esm/appui-react/widget-panels/StatusBar.js +5 -2
- package/lib/esm/appui-react/widget-panels/StatusBar.js.map +1 -1
- package/lib/esm/appui-react/widget-panels/Toolbars.d.ts.map +1 -1
- package/lib/esm/appui-react/widget-panels/Toolbars.js +10 -3
- package/lib/esm/appui-react/widget-panels/Toolbars.js.map +1 -1
- package/lib/esm/appui-react/widget-panels/useWidgetDirection.js +1 -1
- package/lib/esm/appui-react/widget-panels/useWidgetDirection.js.map +1 -1
- package/lib/esm/appui-react/widgets/BackstageAppButton.js +2 -2
- package/lib/esm/appui-react/widgets/BackstageAppButton.js.map +1 -1
- package/lib/esm/appui-react/widgets/NavigationWidget.js.map +1 -1
- package/lib/esm/appui-react/widgets/NavigationWidgetComposer.js +1 -1
- package/lib/esm/appui-react/widgets/NavigationWidgetComposer.js.map +1 -1
- package/lib/esm/appui-react/widgets/ToolWidget.js.map +1 -1
- package/lib/esm/appui-react/widgets/ToolbarWidgetBase.js.map +1 -1
- package/lib/esm/appui-react/widgets/Widget.d.ts +1 -0
- package/lib/esm/appui-react/widgets/Widget.d.ts.map +1 -1
- package/lib/esm/appui-react/widgets/Widget.js +1 -0
- package/lib/esm/appui-react/widgets/Widget.js.map +1 -1
- package/lib/esm/appui-react/widgets/WidgetConfig.d.ts +11 -0
- package/lib/esm/appui-react/widgets/WidgetConfig.d.ts.map +1 -0
- package/lib/esm/appui-react/widgets/WidgetConfig.js +9 -0
- package/lib/esm/appui-react/widgets/WidgetConfig.js.map +1 -0
- package/lib/esm/appui-react/widgets/WidgetDef.d.ts +14 -1
- package/lib/esm/appui-react/widgets/WidgetDef.d.ts.map +1 -1
- package/lib/esm/appui-react/widgets/WidgetDef.js +21 -11
- package/lib/esm/appui-react/widgets/WidgetDef.js.map +1 -1
- package/lib/esm/appui-react/widgets/WidgetProps.d.ts +1 -0
- package/lib/esm/appui-react/widgets/WidgetProps.d.ts.map +1 -1
- package/lib/esm/appui-react/widgets/WidgetProps.js.map +1 -1
- package/lib/esm/appui-react/zones/Zone.d.ts +5 -1
- package/lib/esm/appui-react/zones/Zone.d.ts.map +1 -1
- package/lib/esm/appui-react/zones/Zone.js +1 -0
- package/lib/esm/appui-react/zones/Zone.js.map +1 -1
- package/lib/esm/appui-react/zones/ZoneDef.d.ts +1 -0
- package/lib/esm/appui-react/zones/ZoneDef.d.ts.map +1 -1
- package/lib/esm/appui-react/zones/ZoneDef.js +2 -2
- package/lib/esm/appui-react/zones/ZoneDef.js.map +1 -1
- package/lib/esm/appui-react.d.ts +8 -0
- package/lib/esm/appui-react.d.ts.map +1 -1
- package/lib/esm/appui-react.js +8 -0
- package/lib/esm/appui-react.js.map +1 -1
- package/lib/public/locales/en/UiFramework.json +11 -4
- package/package.json +34 -34
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Backstage.js","sourceRoot":"","sources":["../../../../src/appui-react/backstage/Backstage.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,+BAA+B;AAC/B,kDAAmE;AACnE,kEAAsE;AACtE,iEAA8D;AAC9D,gDAA6C;AAC7C,yDAAsD;AAYtD
|
|
1
|
+
{"version":3,"file":"Backstage.js","sourceRoot":"","sources":["../../../../src/appui-react/backstage/Backstage.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,+BAA+B;AAC/B,kDAAmE;AACnE,kEAAsE;AACtE,iEAA8D;AAC9D,gDAA6C;AAC7C,yDAAsD;AAYtD;;;GAGG;AACH,MAAa,cAAe,SAAQ,oBAA2B;CAAI,CAAC,8CAA8C;AAAlH,wCAAmE;AAoBnE;;;GAGG;AACH,MAAa,SAAU,SAAQ,KAAK,CAAC,SAAyC;IA4B5E,YAAY,KAAqB;QAC/B,KAAK,CAAC,KAAK,CAAC,CAAC;QAgBP,0BAAqB,GAAG,CAAC,IAAwB,EAAE,EAAE;YAC3D,IAAI,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;QAC/C,CAAC,CAAC;QAe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AC,CAAC;IAC3C,CAAC;IAEO,SAAS,CAAC,MAAe;QAC/B,IAAI,MAAM,EAAE;YACV,yBAAW,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC;SACrC;aAAM;YACL,yBAAW,CAAC,gBAAgB,CAAC,KAAK,EAAE,CAAC;SACtC;IACH,CAAC;IAUe,MAAM;QACpB,SAAS,CAAC,kBAAkB,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,8CAA8C;QAEnG,IAAI,MAAM,GAAoB,IAAI,CAAC;QAEnC,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM;YACnB,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;QAE7B,OAAO,CACL,oBAAC,iCAAe,CAAC,QAAQ,QACtB,CAAC,cAAc,EAAE,EAAE,CAAC,CACnB,oBAAC,8BAAY,IACX,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAC/B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAC5B,OAAO,EAAE,IAAI,CAAC,QAAQ,EACtB,cAAc,EAAE,cAAc,EAC9B,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EACnC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,IAEtB,IAAI,CAAC,KAAK,CAAC,QAAQ,CACP,CAChB,CACwB,CAC5B,CAAC;IACJ,CAAC;;AA/FH,8BAgGC;AA9FwB,0BAAgB,GAAG,IAAI,cAAc,EAAE,CAAC,CAAC,8CAA8C","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Backstage\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { CommonProps, IconSpec, UiEvent } from \"@itwin/core-react\";\r\nimport { Backstage as NZ_Backstage } from \"@itwin/appui-layout-react\";\r\nimport { SafeAreaContext } from \"../safearea/SafeAreaContext\";\r\nimport { UiFramework } from \"../UiFramework\";\r\nimport { BackstageManager } from \"./BackstageManager\";\r\n\r\n// cSpell:ignore safearea\r\n\r\n/** [[BackstageEvent]] arguments.\r\n * @public\r\n * @deprecated use [BackstageComposer]($appui-react) instead.\r\n */\r\nexport interface BackstageEventArgs {\r\n isVisible: boolean;\r\n}\r\n\r\n/** Backstage Event class.\r\n * @deprecated Use [BackstageManager.onToggled]($appui-react) instead.\r\n * @public\r\n */\r\nexport class BackstageEvent extends UiEvent<BackstageEventArgs> { } // eslint-disable-line deprecation/deprecation\r\n\r\n/** Properties for the [[Backstage]] React component.\r\n * @deprecated Props of a deprecated component.\r\n * @public\r\n */\r\nexport interface BackstageProps extends CommonProps {\r\n isVisible?: boolean;\r\n showOverlay?: boolean;\r\n onClose?: () => void;\r\n header?: React.ReactNode;\r\n}\r\n\r\n/** State for the [[Backstage]] React component.\r\n * @internal\r\n */\r\ninterface BackstageState {\r\n isVisible: boolean;\r\n}\r\n\r\n/** Backstage React component.\r\n * @deprecated Use [BackstageComposer]($appui-react) instead.\r\n * @public\r\n */\r\nexport class Backstage extends React.Component<BackstageProps, BackstageState> { // eslint-disable-line deprecation/deprecation\r\n\r\n public static readonly onBackstageEvent = new BackstageEvent(); // eslint-disable-line deprecation/deprecation\r\n public static isBackstageVisible: boolean;\r\n\r\n /** Shows the Backstage */\r\n public static show(): void {\r\n UiFramework.backstageManager.open();\r\n }\r\n\r\n /** Hides the Backstage */\r\n public static hide(): void {\r\n UiFramework.backstageManager.close();\r\n }\r\n\r\n /** Get CommandItemDef that will toggle display of Backstage and allow iconSpec to be overridden */\r\n public static getBackstageToggleCommand(overrideIconSpec?: IconSpec) {\r\n return BackstageManager.getBackstageToggleCommand(overrideIconSpec);\r\n }\r\n\r\n /** Command that toggles the Backstage */\r\n public static get backstageToggleCommand() {\r\n return this.getBackstageToggleCommand();\r\n }\r\n\r\n /** @internal */\r\n public override readonly state: BackstageState;\r\n\r\n constructor(props: BackstageProps) { // eslint-disable-line deprecation/deprecation\r\n super(props);\r\n\r\n this.setIsOpen(!!this.props.isVisible);\r\n this.state = {\r\n isVisible: UiFramework.backstageManager.isOpen,\r\n };\r\n }\r\n\r\n public override componentDidMount() {\r\n Backstage.onBackstageEvent.addListener(this._handleBackstageEvent); // eslint-disable-line deprecation/deprecation\r\n }\r\n\r\n public override componentWillUnmount() {\r\n Backstage.onBackstageEvent.removeListener(this._handleBackstageEvent); // eslint-disable-line deprecation/deprecation\r\n }\r\n\r\n private _handleBackstageEvent = (args: BackstageEventArgs) => { // eslint-disable-line deprecation/deprecation\r\n this.setState({ isVisible: args.isVisible });\r\n };\r\n\r\n public override componentDidUpdate(prevProps: BackstageProps) { // eslint-disable-line deprecation/deprecation\r\n if (this.props.isVisible !== prevProps.isVisible)\r\n this.setIsOpen(!!this.props.isVisible);\r\n }\r\n\r\n private setIsOpen(isOpen: boolean) {\r\n if (isOpen) {\r\n UiFramework.backstageManager.open();\r\n } else {\r\n UiFramework.backstageManager.close();\r\n }\r\n }\r\n\r\n private _onClose = () => {\r\n Backstage.hide(); // eslint-disable-line deprecation/deprecation\r\n\r\n /* istanbul ignore else */\r\n if (this.props.onClose)\r\n this.props.onClose();\r\n };\r\n\r\n public override render(): React.ReactNode {\r\n Backstage.isBackstageVisible = this.state.isVisible; // eslint-disable-line deprecation/deprecation\r\n\r\n let header: React.ReactNode = null;\r\n\r\n if (this.props.header)\r\n header = this.props.header;\r\n\r\n return (\r\n <SafeAreaContext.Consumer>\r\n {(safeAreaInsets) => (\r\n <NZ_Backstage\r\n className={this.props.className}\r\n header={header}\r\n isOpen={this.state.isVisible}\r\n onClose={this._onClose}\r\n safeAreaInsets={safeAreaInsets}\r\n showOverlay={this.props.showOverlay}\r\n style={this.props.style}\r\n >\r\n {this.props.children}\r\n </NZ_Backstage>\r\n )}\r\n </SafeAreaContext.Consumer>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -19,7 +19,7 @@ const Backstage_1 = require("./Backstage");
|
|
|
19
19
|
const BackstageItemUtilities_1 = require("./BackstageItemUtilities");
|
|
20
20
|
// cspell:ignore safearea
|
|
21
21
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
22
|
-
const BackstageItem = (0, SafeAreaContext_1.withSafeArea)(appui_layout_react_1.BackstageItem);
|
|
22
|
+
const BackstageItem = (0, SafeAreaContext_1.withSafeArea)(appui_layout_react_1.BackstageItem); // eslint-disable-line deprecation/deprecation
|
|
23
23
|
/** Backstage item that launches a Command
|
|
24
24
|
* @public
|
|
25
25
|
* @deprecated Use [BackstageActionItem]($appui-abstract) instead.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandLaunch.js","sourceRoot":"","sources":["../../../../src/appui-react/backstage/CommandLaunch.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,+BAA+B;AAC/B,sDAA6C;AAE7C,kEAA8E;AAC9E,iEAA2D;AAC3D,2EAAwE;AACxE,gDAA6C;AAC7C,sDAAmD;AACnD,2CAAwC;AAExC,qEAAkE;AAElE,yBAAyB;AAEzB,gEAAgE;AAChE,MAAM,aAAa,GAAG,IAAA,8BAAY,EAAC,kCAAgB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"CommandLaunch.js","sourceRoot":"","sources":["../../../../src/appui-react/backstage/CommandLaunch.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,+BAA+B;AAC/B,sDAA6C;AAE7C,kEAA8E;AAC9E,iEAA2D;AAC3D,2EAAwE;AACxE,gDAA6C;AAC7C,sDAAmD;AACnD,2CAAwC;AAExC,qEAAkE;AAElE,yBAAyB;AAEzB,gEAAgE;AAChE,MAAM,aAAa,GAAG,IAAA,8BAAY,EAAC,kCAAgB,CAAC,CAAC,CAAC,8CAA8C;AAWpG;;;GAGG;AACH,MAAa,0BAA2B,SAAQ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EAC9C,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAC7B,UAAU,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,EACjC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EACzB,OAAO,EAAE,IAAI,CAAC,OAAO,IAEpB,IAAI,CAAC,KAAK,CAAC,KAAK,CACH,CACjB,CAAC;IACJ,CAAC;CACF;AAjFD,gEAiFC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Backstage\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { Logger } from \"@itwin/core-bentley\";\r\nimport { CommandHandler, UiSyncEventArgs } from \"@itwin/appui-abstract\";\r\nimport { BackstageItem as NZ_BackstageItem } from \"@itwin/appui-layout-react\";\r\nimport { withSafeArea } from \"../safearea/SafeAreaContext\";\r\nimport { SyncUiEventDispatcher } from \"../syncui/SyncUiEventDispatcher\";\r\nimport { UiFramework } from \"../UiFramework\";\r\nimport { PropsHelper } from \"../utils/PropsHelper\";\r\nimport { Backstage } from \"./Backstage\";\r\nimport { BackstageItemProps, BackstageItemState } from \"./BackstageItemProps\";\r\nimport { BackstageItemUtilities } from \"./BackstageItemUtilities\";\r\n\r\n// cspell:ignore safearea\r\n\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nconst BackstageItem = withSafeArea(NZ_BackstageItem); // eslint-disable-line deprecation/deprecation\r\n\r\n/** Properties for a [[CommandLaunchBackstageItem]] component\r\n * @public\r\n * @deprecated Use [BackstageActionItem]($appui-abstract) instead.\r\n */\r\nexport interface CommandLaunchBackstageItemProps extends BackstageItemProps, CommandHandler { // eslint-disable-line deprecation/deprecation\r\n /** Unique Id for this backstage item. */\r\n commandId: string;\r\n}\r\n\r\n/** Backstage item that launches a Command\r\n * @public\r\n * @deprecated Use [BackstageActionItem]($appui-abstract) instead.\r\n */\r\nexport class CommandLaunchBackstageItem extends React.PureComponent<CommandLaunchBackstageItemProps, BackstageItemState> { // eslint-disable-line deprecation/deprecation\r\n\r\n /** @internal */\r\n public override readonly state: Readonly<BackstageItemState>; // eslint-disable-line deprecation/deprecation\r\n private _componentUnmounting = false; // used to ensure _handleSyncUiEvent callback is not processed after componentWillUnmount is called\r\n private _stateSyncIds: string[] = []; // local version of syncId that are lower cased\r\n\r\n constructor(props: CommandLaunchBackstageItemProps) { // eslint-disable-line deprecation/deprecation\r\n super(props);\r\n\r\n if (props.stateSyncIds)\r\n this._stateSyncIds = props.stateSyncIds.map((value) => value.toLowerCase());\r\n\r\n // eslint-disable-next-line deprecation/deprecation\r\n this.state = BackstageItemUtilities.getBackstageItemStateFromProps(props);\r\n }\r\n\r\n public override componentDidMount() {\r\n if (this.props.stateFunc && this._stateSyncIds.length > 0)\r\n SyncUiEventDispatcher.onSyncUiEvent.addListener(this._handleSyncUiEvent);\r\n }\r\n\r\n public override componentWillUnmount() {\r\n this._componentUnmounting = true;\r\n /* istanbul ignore else */\r\n if (this.props.stateFunc && this._stateSyncIds.length > 0)\r\n SyncUiEventDispatcher.onSyncUiEvent.removeListener(this._handleSyncUiEvent);\r\n }\r\n\r\n private _handleSyncUiEvent = (args: UiSyncEventArgs): void => {\r\n /* istanbul ignore next */\r\n if (this._componentUnmounting)\r\n return;\r\n\r\n /* istanbul ignore else */\r\n if (SyncUiEventDispatcher.hasEventOfInterest(args.eventIds, this._stateSyncIds)) {\r\n /* istanbul ignore else */\r\n if (this.props.stateFunc) {\r\n const newState = this.props.stateFunc(this.state);\r\n /* istanbul ignore next */\r\n if (!PropsHelper.isShallowEqual(newState, this.state))\r\n this.setState((_prevState) => newState);\r\n }\r\n }\r\n };\r\n\r\n public execute = (): void => {\r\n Backstage.hide(); // eslint-disable-line deprecation/deprecation\r\n\r\n if (this.props.execute) {\r\n if (this.props.getCommandArgs)\r\n this.props.execute(this.props.getCommandArgs());\r\n else\r\n this.props.execute(this.props.parameters);\r\n } else\r\n Logger.logError(UiFramework.loggerCategory(this), `'${this.props.commandId}' has no execute() function`);\r\n };\r\n\r\n // deprecated class\r\n // istanbul ignore next\r\n public override componentDidUpdate(_prevProps: CommandLaunchBackstageItemProps) { // eslint-disable-line deprecation/deprecation\r\n // eslint-disable-next-line deprecation/deprecation\r\n const updatedState = BackstageItemUtilities.getBackstageItemStateFromProps(this.props);\r\n if (!PropsHelper.isShallowEqual(updatedState, this.state))\r\n this.setState((_prevState) => updatedState);\r\n }\r\n\r\n // TODO: add tooltip, subtitle, aria-label? to NZ_BackstageItem\r\n public override render(): React.ReactNode {\r\n return (\r\n <BackstageItem\r\n icon={PropsHelper.getIcon(this.state.iconSpec)}\r\n isActive={this.state.isActive}\r\n isDisabled={!this.state.isEnabled}\r\n key={this.props.commandId}\r\n onClick={this.execute}\r\n >\r\n {this.state.label}\r\n </BackstageItem>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -99,6 +99,7 @@ class ChildWindowManager {
|
|
|
99
99
|
React.createElement(useUiStateStorage_1.UiStateStorageHandler, null,
|
|
100
100
|
React.createElement(ThemeManager_1.ThemeManager, null,
|
|
101
101
|
React.createElement(useFrameworkVersion_1.FrameworkVersion, null,
|
|
102
|
+
" ",
|
|
102
103
|
React.createElement("div", { className: "uifw-child-window-container-host" },
|
|
103
104
|
React.createElement(PopupManager_1.PopupRenderer, null),
|
|
104
105
|
React.createElement(ModalDialogManager_1.ModalDialogRenderer, null),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChildWindowManager.js","sourceRoot":"","sources":["../../../../src/appui-react/childwindow/ChildWindowManager.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,qCAAmC;AACnC,+BAA+B;AAC/B,sCAAsC;AACtC,6CAA0C;AAC1C,6CAAuC;AACvC,wDAAqD;AACrD,oEAAqE;AACrE,wDAAsD;A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X;QAED,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,GAAG,EAAE;YACrC,MAAM,aAAa,GAAG,qCAAiB,CAAC,mBAAmB,CAAC;YAC5D,IAAI,aAAa,EAAE;gBACjB,IAAI,CAAC,gBAAgB,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;aAC5C;QACH,CAAC,EAAE,KAAK,CAAC,CAAC;QAEV,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAlJD,gDAkJC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module ChildWindowManager\r\n */\r\n\r\nimport \"./ChildWindowManager.scss\";\r\nimport * as React from \"react\";\r\nimport * as ReactDOM from \"react-dom\";\r\nimport { copyStyles } from \"./CopyStyles\";\r\nimport { Provider } from \"react-redux\";\r\nimport { StateManager } from \"../redux/StateManager\";\r\nimport { UiStateStorageHandler } from \"../uistate/useUiStateStorage\";\r\nimport { PopupRenderer } from \"../popup/PopupManager\";\r\nimport { ModelessDialogRenderer } from \"../dialog/ModelessDialogManager\";\r\nimport { ModalDialogRenderer } from \"../dialog/ModalDialogManager\";\r\nimport { CursorPopupMenu } from \"../cursor/cursormenu/CursorMenu\";\r\nimport { FrameworkVersion } from \"../hooks/useFrameworkVersion\";\r\nimport { FrontstageManager } from \"../frontstage/FrontstageManager\";\r\nimport { ThemeManager } from \"../theme/ThemeManager\";\r\n\r\nconst childHtml = `<!DOCTYPE html>\r\n<html>\r\n<head>\r\n <meta charset=\"utf-8\" />\r\n <style>\r\n html,\r\n body {\r\n height: 100%;\r\n width: 100%;\r\n margin: 0;\r\n overflow: hidden;\r\n }\r\n #root {\r\n height: 100%;\r\n }\r\n </style>\r\n</head>\r\n<body>\r\n <noscript>You need to enable JavaScript to run this app.</noscript>\r\n <div id=\"root\"></div>\r\n</body>\r\n</html>`;\r\n\r\n/** @public */\r\nexport interface OpenChildWindowInfo {\r\n childWindowId: string;\r\n window: Window;\r\n parentWindow: Window;\r\n}\r\n\r\n/** @public */\r\nexport interface ChildWindowLocationProps {\r\n width: number;\r\n height: number;\r\n left: number;\r\n top: number;\r\n}\r\n\r\n/** Supports opening a child browser window from the main application window. The child window is managed by the main application\r\n * and is running in the same security context. The application must deliver the html file iTwinPopup.html along side its index.html.\r\n * See also: [Child Window Manager]($docs/learning/ui/appui-react/ChildWindows.md)\r\n * @public */\r\nexport class ChildWindowManager {\r\n private _openChildWindows: OpenChildWindowInfo[] = [];\r\n\r\n public get openChildWindows() {\r\n return this._openChildWindows;\r\n }\r\n\r\n public findChildWindow(childWindowId: string | undefined): OpenChildWindowInfo | undefined {\r\n if (undefined === childWindowId)\r\n return undefined;\r\n\r\n return this.openChildWindows.find((openWindow) => openWindow.childWindowId === childWindowId);\r\n }\r\n\r\n public findChildWindowId(contentWindow: Window | undefined | null): string | undefined {\r\n if (!contentWindow)\r\n return undefined;\r\n\r\n const childWindow = this.openChildWindows.find((openWindow) => openWindow.window === contentWindow);\r\n return childWindow?.childWindowId;\r\n }\r\n\r\n // istanbul ignore next\r\n private renderChildWindowContents(childWindow: Window, childWindowId: string, content: React.ReactNode) {\r\n const reactConnectionDiv = childWindow.document.getElementById(\"root\");\r\n if (reactConnectionDiv) {\r\n // set openChildWindows now so components can use it when they mount\r\n this._openChildWindows.push({\r\n childWindowId,\r\n window: childWindow,\r\n parentWindow: window,\r\n });\r\n\r\n setTimeout(() => {\r\n copyStyles(childWindow.document);\r\n setTimeout(() => {\r\n ReactDOM.render(\r\n <Provider store={StateManager.store} >\r\n <UiStateStorageHandler>\r\n <ThemeManager>\r\n <FrameworkVersion>\r\n <div className=\"uifw-child-window-container-host\">\r\n <PopupRenderer />\r\n <ModalDialogRenderer />\r\n <ModelessDialogRenderer />\r\n <CursorPopupMenu />\r\n <div className=\"uifw-child-window-container nz-widget-widget\">\r\n {content}\r\n </div>\r\n </div>\r\n </FrameworkVersion>\r\n </ThemeManager>\r\n </UiStateStorageHandler>\r\n </Provider>,\r\n reactConnectionDiv\r\n );\r\n });\r\n });\r\n\r\n childWindow.onbeforeunload = () => {\r\n const frontStageDef = FrontstageManager.activeFrontstageDef;\r\n if (!frontStageDef)\r\n return;\r\n frontStageDef.saveChildWindowSizeAndPosition(childWindowId, childWindow);\r\n this.closeChildWindow(childWindowId, false);\r\n };\r\n }\r\n }\r\n\r\n /** Close all child/pop-out windows. This typically is called when the frontstage is changed. */\r\n public closeAllChildWindows() {\r\n // istanbul ignore next\r\n this.openChildWindows.forEach((openChildWindow) => openChildWindow.window.close());\r\n this._openChildWindows = [];\r\n }\r\n\r\n public closeChildWindow = (childWindowId: string, processWindowClose = true) => {\r\n const windowIndex = this.openChildWindows.findIndex((openWindow) => openWindow.childWindowId === childWindowId);\r\n if (-1 === windowIndex)\r\n return false;\r\n const childWindow = this.openChildWindows[windowIndex];\r\n this.openChildWindows.splice(windowIndex, 1);\r\n if (processWindowClose) {\r\n childWindow.window.close();\r\n } else {\r\n // call the following to convert popout to docked widget\r\n const frontStageDef = FrontstageManager.activeFrontstageDef;\r\n frontStageDef && frontStageDef.dockPopoutWidgetContainer(childWindowId);\r\n }\r\n return true;\r\n };\r\n\r\n // istanbul ignore next\r\n private adjustWidowLocation(location: ChildWindowLocationProps, center?: boolean): ChildWindowLocationProps {\r\n const outLocation = { ...location };\r\n if (0 === location.top && 0 === location.left) {\r\n center = center ?? true;\r\n const windowTop = window.top ?? window;\r\n\r\n // Prepare position of the new window to be centered against the 'parent' window.\r\n if (center) {\r\n outLocation.left =\r\n windowTop.outerWidth / 2 + windowTop.screenX - location.width / 2;\r\n outLocation.top =\r\n windowTop.outerHeight / 2 + windowTop.screenY - location.height / 2;\r\n } else {\r\n if (undefined !== window.screenLeft && undefined !== window.screenTop) {\r\n outLocation.top = window.screenTop + location.top;\r\n outLocation.left = window.screenLeft + location.left;\r\n }\r\n }\r\n }\r\n return outLocation;\r\n }\r\n\r\n // istanbul ignore next\r\n public openChildWindow(childWindowId: string, title: string, content: React.ReactNode, location: ChildWindowLocationProps, useDefaultPopoutUrl?: boolean) {\r\n // first check to see if content is already open in child window\r\n if (this.openChildWindows.findIndex((openWindow) => openWindow.childWindowId === childWindowId) >= 0) {\r\n return false;\r\n }\r\n\r\n location = this.adjustWidowLocation(location);\r\n const url = useDefaultPopoutUrl ? \"/iTwinPopup.html\" : \"\";\r\n const childWindow = window.open(url, \"\", `width=${location.width},height=${location.height},left=${location.left},top=${location.top},menubar=no,resizable=yes,scrollbars=no,status=no,location=no`);\r\n if (!childWindow)\r\n return false;\r\n if (0 === url.length) {\r\n childWindow.document.write(childHtml);\r\n this.renderChildWindowContents(childWindow, childWindowId, content);\r\n } else {\r\n childWindow.addEventListener(\"load\", () => {\r\n childWindow.document.title = title;\r\n this.renderChildWindowContents(childWindow, childWindowId, content);\r\n }, false);\r\n }\r\n\r\n window.addEventListener(\"unload\", () => {\r\n const frontStageDef = FrontstageManager.activeFrontstageDef;\r\n if (frontStageDef) {\r\n this.closeChildWindow(childWindowId, true);\r\n }\r\n }, false);\r\n\r\n return true;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ChildWindowManager.js","sourceRoot":"","sources":["../../../../src/appui-react/childwindow/ChildWindowManager.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,qCAAmC;AACnC,+BAA+B;AAC/B,sCAAsC;AACtC,6CAA0C;AAC1C,6CAAuC;AACvC,wDAAqD;AACrD,oEAAqE;AACrE,wDAAsD;AACtD,2EAAyE;AACzE,qEAAmE;AACnE,gEAAkE;AAClE,sEAAgE;AAChE,uEAAoE;AACpE,wDAAqD;AAErD,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;QAqBV,CAAC;AAiBT;;;aAGa;AACb,MAAa,kBAAkB;IAA/B;QACU,sBAAiB,GAA0B,EAAE,CAAC;QA2E/C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AK,CAAC,CAAC;QAEV,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAlJD,gDAkJC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module ChildWindowManager\r\n */\r\n\r\nimport \"./ChildWindowManager.scss\";\r\nimport * as React from \"react\";\r\nimport * as ReactDOM from \"react-dom\";\r\nimport { copyStyles } from \"./CopyStyles\";\r\nimport { Provider } from \"react-redux\";\r\nimport { StateManager } from \"../redux/StateManager\";\r\nimport { UiStateStorageHandler } from \"../uistate/useUiStateStorage\";\r\nimport { PopupRenderer } from \"../popup/PopupManager\";\r\nimport { ModelessDialogRenderer } from \"../dialog/ModelessDialogManager\";\r\nimport { ModalDialogRenderer } from \"../dialog/ModalDialogManager\";\r\nimport { CursorPopupMenu } from \"../cursor/cursormenu/CursorMenu\";\r\nimport { FrameworkVersion } from \"../hooks/useFrameworkVersion\";\r\nimport { FrontstageManager } from \"../frontstage/FrontstageManager\";\r\nimport { ThemeManager } from \"../theme/ThemeManager\";\r\n\r\nconst childHtml = `<!DOCTYPE html>\r\n<html>\r\n<head>\r\n <meta charset=\"utf-8\" />\r\n <style>\r\n html,\r\n body {\r\n height: 100%;\r\n width: 100%;\r\n margin: 0;\r\n overflow: hidden;\r\n }\r\n #root {\r\n height: 100%;\r\n }\r\n </style>\r\n</head>\r\n<body>\r\n <noscript>You need to enable JavaScript to run this app.</noscript>\r\n <div id=\"root\"></div>\r\n</body>\r\n</html>`;\r\n\r\n/** @public */\r\nexport interface OpenChildWindowInfo {\r\n childWindowId: string;\r\n window: Window;\r\n parentWindow: Window;\r\n}\r\n\r\n/** @public */\r\nexport interface ChildWindowLocationProps {\r\n width: number;\r\n height: number;\r\n left: number;\r\n top: number;\r\n}\r\n\r\n/** Supports opening a child browser window from the main application window. The child window is managed by the main application\r\n * and is running in the same security context. The application must deliver the html file iTwinPopup.html along side its index.html.\r\n * See also: [Child Window Manager]($docs/learning/ui/appui-react/ChildWindows.md)\r\n * @public */\r\nexport class ChildWindowManager {\r\n private _openChildWindows: OpenChildWindowInfo[] = [];\r\n\r\n public get openChildWindows() {\r\n return this._openChildWindows;\r\n }\r\n\r\n public findChildWindow(childWindowId: string | undefined): OpenChildWindowInfo | undefined {\r\n if (undefined === childWindowId)\r\n return undefined;\r\n\r\n return this.openChildWindows.find((openWindow) => openWindow.childWindowId === childWindowId);\r\n }\r\n\r\n public findChildWindowId(contentWindow: Window | undefined | null): string | undefined {\r\n if (!contentWindow)\r\n return undefined;\r\n\r\n const childWindow = this.openChildWindows.find((openWindow) => openWindow.window === contentWindow);\r\n return childWindow?.childWindowId;\r\n }\r\n\r\n // istanbul ignore next\r\n private renderChildWindowContents(childWindow: Window, childWindowId: string, content: React.ReactNode) {\r\n const reactConnectionDiv = childWindow.document.getElementById(\"root\");\r\n if (reactConnectionDiv) {\r\n // set openChildWindows now so components can use it when they mount\r\n this._openChildWindows.push({\r\n childWindowId,\r\n window: childWindow,\r\n parentWindow: window,\r\n });\r\n\r\n setTimeout(() => {\r\n copyStyles(childWindow.document);\r\n setTimeout(() => {\r\n ReactDOM.render(\r\n <Provider store={StateManager.store} >\r\n <UiStateStorageHandler>\r\n <ThemeManager>\r\n <FrameworkVersion> {/* eslint-disable-line deprecation/deprecation */}\r\n <div className=\"uifw-child-window-container-host\">\r\n <PopupRenderer />\r\n <ModalDialogRenderer />\r\n <ModelessDialogRenderer />\r\n <CursorPopupMenu />\r\n <div className=\"uifw-child-window-container nz-widget-widget\">\r\n {content}\r\n </div>\r\n </div>\r\n </FrameworkVersion>\r\n </ThemeManager>\r\n </UiStateStorageHandler>\r\n </Provider>,\r\n reactConnectionDiv\r\n );\r\n });\r\n });\r\n\r\n childWindow.onbeforeunload = () => {\r\n const frontStageDef = FrontstageManager.activeFrontstageDef;\r\n if (!frontStageDef)\r\n return;\r\n frontStageDef.saveChildWindowSizeAndPosition(childWindowId, childWindow);\r\n this.closeChildWindow(childWindowId, false);\r\n };\r\n }\r\n }\r\n\r\n /** Close all child/pop-out windows. This typically is called when the frontstage is changed. */\r\n public closeAllChildWindows() {\r\n // istanbul ignore next\r\n this.openChildWindows.forEach((openChildWindow) => openChildWindow.window.close());\r\n this._openChildWindows = [];\r\n }\r\n\r\n public closeChildWindow = (childWindowId: string, processWindowClose = true) => {\r\n const windowIndex = this.openChildWindows.findIndex((openWindow) => openWindow.childWindowId === childWindowId);\r\n if (-1 === windowIndex)\r\n return false;\r\n const childWindow = this.openChildWindows[windowIndex];\r\n this.openChildWindows.splice(windowIndex, 1);\r\n if (processWindowClose) {\r\n childWindow.window.close();\r\n } else {\r\n // call the following to convert popout to docked widget\r\n const frontStageDef = FrontstageManager.activeFrontstageDef;\r\n frontStageDef && frontStageDef.dockPopoutWidgetContainer(childWindowId);\r\n }\r\n return true;\r\n };\r\n\r\n // istanbul ignore next\r\n private adjustWidowLocation(location: ChildWindowLocationProps, center?: boolean): ChildWindowLocationProps {\r\n const outLocation = { ...location };\r\n if (0 === location.top && 0 === location.left) {\r\n center = center ?? true;\r\n const windowTop = window.top ?? window;\r\n\r\n // Prepare position of the new window to be centered against the 'parent' window.\r\n if (center) {\r\n outLocation.left =\r\n windowTop.outerWidth / 2 + windowTop.screenX - location.width / 2;\r\n outLocation.top =\r\n windowTop.outerHeight / 2 + windowTop.screenY - location.height / 2;\r\n } else {\r\n if (undefined !== window.screenLeft && undefined !== window.screenTop) {\r\n outLocation.top = window.screenTop + location.top;\r\n outLocation.left = window.screenLeft + location.left;\r\n }\r\n }\r\n }\r\n return outLocation;\r\n }\r\n\r\n // istanbul ignore next\r\n public openChildWindow(childWindowId: string, title: string, content: React.ReactNode, location: ChildWindowLocationProps, useDefaultPopoutUrl?: boolean) {\r\n // first check to see if content is already open in child window\r\n if (this.openChildWindows.findIndex((openWindow) => openWindow.childWindowId === childWindowId) >= 0) {\r\n return false;\r\n }\r\n\r\n location = this.adjustWidowLocation(location);\r\n const url = useDefaultPopoutUrl ? \"/iTwinPopup.html\" : \"\";\r\n const childWindow = window.open(url, \"\", `width=${location.width},height=${location.height},left=${location.left},top=${location.top},menubar=no,resizable=yes,scrollbars=no,status=no,location=no`);\r\n if (!childWindow)\r\n return false;\r\n if (0 === url.length) {\r\n childWindow.document.write(childHtml);\r\n this.renderChildWindowContents(childWindow, childWindowId, content);\r\n } else {\r\n childWindow.addEventListener(\"load\", () => {\r\n childWindow.document.title = title;\r\n this.renderChildWindowContents(childWindow, childWindowId, content);\r\n }, false);\r\n }\r\n\r\n window.addEventListener(\"unload\", () => {\r\n const frontStageDef = FrontstageManager.activeFrontstageDef;\r\n if (frontStageDef) {\r\n this.closeChildWindow(childWindowId, true);\r\n }\r\n }, false);\r\n\r\n return true;\r\n }\r\n}\r\n"]}
|
|
@@ -31,7 +31,7 @@ const ContentDialogManager_1 = require("../dialog/ContentDialogManager");
|
|
|
31
31
|
* @public
|
|
32
32
|
*/
|
|
33
33
|
function ConfigurableUiContent(props) {
|
|
34
|
-
const version = (0, useFrameworkVersion_1.useFrameworkVersion)();
|
|
34
|
+
const version = (0, useFrameworkVersion_1.useFrameworkVersion)(); // eslint-disable-line deprecation/deprecation
|
|
35
35
|
React.useEffect(() => {
|
|
36
36
|
KeyboardShortcut_1.KeyboardShortcutManager.setFocusToHome();
|
|
37
37
|
}, []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigurableUiContent.js","sourceRoot":"","sources":["../../../../src/appui-react/configurableui/ConfigurableUiContent.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,iCAA+B;AAC/B,+BAA+B;AAC/B,kDAAuD;AACvD,mEAAgE;AAChE,gEAAkE;AAClE,iFAA+E;AAC/E,qEAAmE;AACnE,2EAAyE;AACzE,+DAA4D;AAC5D,yEAAsE;AACtE,sEAAmE;AACnE,2EAA+E;AAC/E,mFAAgF;AAChF,uDAA2D;AAC3D,iDAAqD;AACrD,wDAAsD;AACtD,4DAAqE;AACrE,mEAAgE;AAChE,yEAAuE;AAiBvE;;GAEG;AACH,SAAgB,qBAAqB,CAAC,KAAiC;IACrE,MAAM,OAAO,GAAG,IAAA,yCAAmB,GAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"ConfigurableUiContent.js","sourceRoot":"","sources":["../../../../src/appui-react/configurableui/ConfigurableUiContent.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,iCAA+B;AAC/B,+BAA+B;AAC/B,kDAAuD;AACvD,mEAAgE;AAChE,gEAAkE;AAClE,iFAA+E;AAC/E,qEAAmE;AACnE,2EAAyE;AACzE,+DAA4D;AAC5D,yEAAsE;AACtE,sEAAmE;AACnE,2EAA+E;AAC/E,mFAAgF;AAChF,uDAA2D;AAC3D,iDAAqD;AACrD,wDAAsD;AACtD,4DAAqE;AACrE,mEAAgE;AAChE,yEAAuE;AAiBvE;;GAEG;AACH,SAAgB,qBAAqB,CAAC,KAAiC;IACrE,MAAM,OAAO,GAAG,IAAA,yCAAmB,GAAE,CAAC,CAAC,8CAA8C;IACrF,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,0CAAuB,CAAC,cAAc,EAAE,CAAC;IAC3C,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,6CAAqB,CAAC,eAAe,CAAC,UAAU,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE,eAAe,EAAE,KAAK,CAAC,eAAe,EAAE,CAAC,CAAC;QAC7H,OAAO,GAAG,EAAE;YACV,6CAAqB,CAAC,eAAe,CAAC,SAAS,EAAE,CAAC;QACpD,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC;IAE/C,MAAM,eAAe,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,CAAmB,EAAE,EAAE;QAChE,MAAM,KAAK,GAAG,IAAI,kBAAK,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;QAC1C,qCAAiB,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,8BAAM,IAAI,EAAC,MAAM,EACf,EAAE,EAAC,6BAA6B,EAChC,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,WAAW,EAAE,eAAe;QAE3B,KAAK,CAAC,YAAY;QAElB,OAAO,KAAK,GAAG,CAAC,CAAC,CAAE,0BAA0B,CAAC,oBAAC,uCAAkB,IAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,GAAI,CAAC,CAAC,CAAC,0BAA0B,CAAC,oBAAC,mCAAsB,OAAG;QAC9K,oBAAC,4CAAqB,OAAG;QACzB,oBAAC,8CAAsB,OAAG;QAC1B,oBAAC,wCAAmB,OAAG;QACvB,oBAAC,+BAAc,OAAG;QAClB,oBAAC,wBAAc,OAAG;QAClB,oBAAC,2CAAoB,OAAG;QACxB,oBAAC,8BAAiB,OAAG;QACrB,oBAAC,4BAAe,OAAG;QACnB,oBAAC,wCAAmB,OAAG;QACvB,oBAAC,4BAAa,OAAG,CACZ,CACR,CAAC;AACJ,CAAC;AAvCD,sDAuCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ConfigurableUi\r\n */\r\n\r\nimport \"./configurableui.scss\";\r\nimport * as React from \"react\";\r\nimport { CommonProps, Point } from \"@itwin/core-react\";\r\nimport { CursorInformation } from \"../cursor/CursorInformation\";\r\nimport { CursorPopupMenu } from \"../cursor/cursormenu/CursorMenu\";\r\nimport { CursorPopupRenderer } from \"../cursor/cursorpopup/CursorPopupManager\";\r\nimport { ModalDialogRenderer } from \"../dialog/ModalDialogManager\";\r\nimport { ModelessDialogRenderer } from \"../dialog/ModelessDialogManager\";\r\nimport { ElementTooltip } from \"../feedback/ElementTooltip\";\r\nimport { FrontstageComposer } from \"../frontstage/FrontstageComposer\";\r\nimport { useFrameworkVersion } from \"../hooks/useFrameworkVersion\";\r\nimport { KeyboardShortcutManager } from \"../keyboardshortcut/KeyboardShortcut\";\r\nimport { KeyboardShortcutMenu } from \"../keyboardshortcut/KeyboardShortcutMenu\";\r\nimport { InputFieldMessage } from \"../messages/InputField\";\r\nimport { PointerMessage } from \"../messages/Pointer\";\r\nimport { PopupRenderer } from \"../popup/PopupManager\";\r\nimport { WidgetPanelsFrontstage } from \"../widget-panels/Frontstage\";\r\nimport { ConfigurableUiManager } from \"./ConfigurableUiManager\";\r\nimport { ContentDialogRenderer } from \"../dialog/ContentDialogManager\";\r\n\r\n// cSpell:ignore cursormenu cursorpopup\r\n\r\n/** Properties for [[ConfigurableUiContent]]\r\n * @public\r\n */\r\nexport interface ConfigurableUiContentProps extends CommonProps {\r\n /** React node of the Backstage */\r\n appBackstage?: React.ReactNode;\r\n\r\n /** @internal */\r\n idleTimeout?: number;\r\n /** @internal */\r\n intervalTimeout?: number;\r\n}\r\n\r\n/** The ConfigurableUiContent component is the component the pages specified using ConfigurableUi\r\n * @public\r\n */\r\nexport function ConfigurableUiContent(props: ConfigurableUiContentProps) {\r\n const version = useFrameworkVersion(); // eslint-disable-line deprecation/deprecation\r\n React.useEffect(() => {\r\n KeyboardShortcutManager.setFocusToHome();\r\n }, []);\r\n React.useEffect(() => {\r\n ConfigurableUiManager.activityTracker.initialize({ idleTimeout: props.idleTimeout, intervalTimeout: props.intervalTimeout });\r\n return () => {\r\n ConfigurableUiManager.activityTracker.terminate();\r\n };\r\n }, [props.idleTimeout, props.intervalTimeout]);\r\n\r\n const handleMouseMove = React.useCallback((e: React.MouseEvent) => {\r\n const point = new Point(e.pageX, e.pageY);\r\n CursorInformation.handleMouseMove(point);\r\n }, []);\r\n\r\n return (\r\n <main role=\"main\"\r\n id=\"uifw-configurableui-wrapper\"\r\n className={props.className}\r\n style={props.style}\r\n onMouseMove={handleMouseMove}\r\n >\r\n {props.appBackstage}\r\n {/* eslint-disable-next-line deprecation/deprecation */}\r\n {version === \"1\" ? /* istanbul ignore next */ <FrontstageComposer style={{ position: \"relative\", height: \"100%\" }} /> : /* istanbul ignore next */ <WidgetPanelsFrontstage />}\r\n <ContentDialogRenderer />\r\n <ModelessDialogRenderer />\r\n <ModalDialogRenderer />\r\n <ElementTooltip />\r\n <PointerMessage />\r\n <KeyboardShortcutMenu />\r\n <InputFieldMessage />\r\n <CursorPopupMenu />\r\n <CursorPopupRenderer />\r\n <PopupRenderer />\r\n </main>\r\n );\r\n}\r\n"]}
|
|
@@ -18,7 +18,8 @@ export declare enum ConfigurableUiActionId {
|
|
|
18
18
|
AutoCollapseUnpinnedPanels = "configurableui:set-auto-collapse-unpinned-panels",
|
|
19
19
|
SetViewOverlayDisplay = "configurableui:set-view-overlay-display",
|
|
20
20
|
AnimateToolSettings = "configurableui:set-animate-tool-settings",
|
|
21
|
-
UseToolAsToolSettingsLabel = "configurableui:set-use-tool-as-tool-settings-label"
|
|
21
|
+
UseToolAsToolSettingsLabel = "configurableui:set-use-tool-as-tool-settings-label",
|
|
22
|
+
SetToolbarOpacity = "configurableui:set-toolbar-opacity"
|
|
22
23
|
}
|
|
23
24
|
/** The portion of state managed by the ConfigurableUiReducer.
|
|
24
25
|
* @public
|
|
@@ -35,6 +36,7 @@ export interface ConfigurableUiState {
|
|
|
35
36
|
viewOverlayDisplay: boolean;
|
|
36
37
|
animateToolSettings: boolean;
|
|
37
38
|
useToolAsToolSettingsLabel: boolean;
|
|
39
|
+
toolbarOpacity: number;
|
|
38
40
|
}
|
|
39
41
|
/** An object with a function that creates each ConfigurableUiReducer that can be handled by our reducer.
|
|
40
42
|
* @public
|
|
@@ -51,6 +53,7 @@ export declare const ConfigurableUiActions: {
|
|
|
51
53
|
setViewOverlayDisplay: (displayViewOverlay: boolean) => import("../redux/redux-ts").ActionWithPayload<ConfigurableUiActionId.SetViewOverlayDisplay, boolean>;
|
|
52
54
|
setAnimateToolSettings: (animateToolSettings: boolean) => import("../redux/redux-ts").ActionWithPayload<ConfigurableUiActionId.AnimateToolSettings, boolean>;
|
|
53
55
|
setUseToolAsToolSettingsLabel: (useToolAsToolSettingsLabel: boolean) => import("../redux/redux-ts").ActionWithPayload<ConfigurableUiActionId.UseToolAsToolSettingsLabel, boolean>;
|
|
56
|
+
setToolbarOpacity: (opacity: number) => import("../redux/redux-ts").ActionWithPayload<ConfigurableUiActionId.SetToolbarOpacity, number>;
|
|
54
57
|
};
|
|
55
58
|
/** Union of ConfigurableUi Redux actions
|
|
56
59
|
* @public
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/configurableui/state.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,YAAY,EAAgB,MAAM,mBAAmB,CAAC;AAE/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAIpD;;;GAGG;AACH,oBAAY,sBAAsB;IAChC,WAAW,gCAAgC;IAC3C,QAAQ,6BAA6B;IACrC,aAAa,kCAAkC;IAC/C,gBAAgB,sCAAsC;IACtD,kBAAkB,wCAAwC;IAC1D,mBAAmB,yCAAyC;IAC5D,iBAAiB,wCAAwC;IACzD,0BAA0B,qDAAqD;IAC/E,qBAAqB,4CAA4C;IACjE,mBAAmB,6CAA6C;IAChE,0BAA0B,uDAAuD;
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/configurableui/state.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,E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@@ -29,6 +29,7 @@ var ConfigurableUiActionId;
|
|
|
29
29
|
ConfigurableUiActionId["SetViewOverlayDisplay"] = "configurableui:set-view-overlay-display";
|
|
30
30
|
ConfigurableUiActionId["AnimateToolSettings"] = "configurableui:set-animate-tool-settings";
|
|
31
31
|
ConfigurableUiActionId["UseToolAsToolSettingsLabel"] = "configurableui:set-use-tool-as-tool-settings-label";
|
|
32
|
+
ConfigurableUiActionId["SetToolbarOpacity"] = "configurableui:set-toolbar-opacity";
|
|
32
33
|
})(ConfigurableUiActionId = exports.ConfigurableUiActionId || (exports.ConfigurableUiActionId = {}));
|
|
33
34
|
/** used on first call of ConfigurableUiReducer */
|
|
34
35
|
const initialState = {
|
|
@@ -43,6 +44,7 @@ const initialState = {
|
|
|
43
44
|
viewOverlayDisplay: true,
|
|
44
45
|
animateToolSettings: false,
|
|
45
46
|
useToolAsToolSettingsLabel: false,
|
|
47
|
+
toolbarOpacity: ThemeManager_1.TOOLBAR_OPACITY_DEFAULT,
|
|
46
48
|
};
|
|
47
49
|
/** An object with a function that creates each ConfigurableUiReducer that can be handled by our reducer.
|
|
48
50
|
* @public
|
|
@@ -65,6 +67,7 @@ exports.ConfigurableUiActions = {
|
|
|
65
67
|
setViewOverlayDisplay: (displayViewOverlay) => (0, redux_ts_1.createAction)(ConfigurableUiActionId.SetViewOverlayDisplay, displayViewOverlay),
|
|
66
68
|
setAnimateToolSettings: (animateToolSettings) => (0, redux_ts_1.createAction)(ConfigurableUiActionId.AnimateToolSettings, animateToolSettings),
|
|
67
69
|
setUseToolAsToolSettingsLabel: (useToolAsToolSettingsLabel) => (0, redux_ts_1.createAction)(ConfigurableUiActionId.UseToolAsToolSettingsLabel, useToolAsToolSettingsLabel),
|
|
70
|
+
setToolbarOpacity: (opacity) => (0, redux_ts_1.createAction)(ConfigurableUiActionId.SetToolbarOpacity, opacity),
|
|
68
71
|
};
|
|
69
72
|
/** Handles actions to update ConfigurableUiState.
|
|
70
73
|
* @public
|
|
@@ -106,6 +109,9 @@ function ConfigurableUiReducer(state = initialState, action) {
|
|
|
106
109
|
case ConfigurableUiActionId.UseToolAsToolSettingsLabel: {
|
|
107
110
|
return { ...state, useToolAsToolSettingsLabel: action.payload };
|
|
108
111
|
}
|
|
112
|
+
case ConfigurableUiActionId.SetToolbarOpacity: {
|
|
113
|
+
return { ...state, toolbarOpacity: action.payload };
|
|
114
|
+
}
|
|
109
115
|
}
|
|
110
116
|
return outState;
|
|
111
117
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../src/appui-react/configurableui/state.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,wDAAgD;AAChD,gDAA+D;AAC/D,wDAA6F;AAG7F,mDAAmD;AAEnD;;;GAGG;AACH,IAAY,sBAYX;AAZD,WAAY,sBAAsB;IAChC,qEAA2C,CAAA;IAC3C,+DAAqC,CAAA;IACrC,yEAA+C,CAAA;IAC/C,gFAAsD,CAAA;IACtD,oFAA0D,CAAA;IAC1D,sFAA4D,CAAA;IAC5D,mFAAyD,CAAA;IACzD,yGAA+E,CAAA;IAC/E,2FAAiE,CAAA;IACjE,0FAAgE,CAAA;IAChE,2GAAiF,CAAA;AACnF,CAAC,EAZW,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QAYjC;AAmBD,kDAAkD;AAClD,MAAM,YAAY,GAAwB;IACxC,QAAQ,EAAE,wBAAQ,CAAC,eAAyB;IAC5C,UAAU,EAAE,EAAE;IACd,KAAK,EAAE,2CAA4B;IACnC,aAAa,EAAE,qCAAsB;IACrC,kBAAkB,EAAE,KAAK;IACzB,gBAAgB,EAAE,GAAG;IACrB,cAAc,EAAE,IAAI;IACpB,0BAA0B,EAAE,KAAK;IACjC,kBAAkB,EAAE,IAAI;IACxB,mBAAmB,EAAE,KAAK;IAC1B,0BAA0B,EAAE,KAAK;CAClC,CAAC;AAEF;;GAEG;AACU,QAAA,qBAAqB,GAA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EAAE,0BAA0B,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;SACjE;QACD,KAAK,sBAAsB,CAAC,qBAAqB,CAAC,CAAC;YACjD,OAAO,EAAE,GAAG,KAAK,EAAE,kBAAkB,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;SACzD;QACD,KAAK,sBAAsB,CAAC,mBAAmB,CAAC,CAAC;YAC/C,OAAO,EAAE,GAAG,KAAK,EAAE,mBAAmB,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;SAC1D;QACD,KAAK,sBAAsB,CAAC,0BAA0B,CAAC,CAAC;YACtD,OAAO,EAAE,GAAG,KAAK,EAAE,0BAA0B,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;SACjE;KACF;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAxCD,sDAwCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module State\r\n */\r\n\r\nimport { SnapMode } from \"@itwin/core-frontend\";\r\nimport { ActionsUnion, createAction } from \"../redux/redux-ts\";\r\nimport { SYSTEM_PREFERRED_COLOR_THEME, WIDGET_OPACITY_DEFAULT } from \"../theme/ThemeManager\";\r\nimport { FrameworkVersionId } from \"../UiFramework\";\r\n\r\n// cSpell:ignore configurableui snapmode toolprompt\r\n\r\n/** Action Ids used by Redux and to send sync UI components. Typically used to refresh visibility or enable state of control.\r\n * Since these are also used as sync ids they should be in lowercase.\r\n * @public\r\n */\r\nexport enum ConfigurableUiActionId {\r\n SetSnapMode = \"configurableui:set_snapmode\",\r\n SetTheme = \"configurableui:set_theme\",\r\n SetToolPrompt = \"configurableui:set_toolprompt\",\r\n SetWidgetOpacity = \"configurableui:set_widget_opacity\",\r\n SetDragInteraction = \"configurableui:set-drag-interaction\",\r\n SetFrameworkVersion = \"configurableui:set-framework-version\",\r\n SetShowWidgetIcon = \"configurableui:set-show-widget-icon\",\r\n AutoCollapseUnpinnedPanels = \"configurableui:set-auto-collapse-unpinned-panels\",\r\n SetViewOverlayDisplay = \"configurableui:set-view-overlay-display\",\r\n AnimateToolSettings = \"configurableui:set-animate-tool-settings\",\r\n UseToolAsToolSettingsLabel = \"configurableui:set-use-tool-as-tool-settings-label\",\r\n}\r\n\r\n/** The portion of state managed by the ConfigurableUiReducer.\r\n * @public\r\n */\r\nexport interface ConfigurableUiState {\r\n snapMode: number;\r\n toolPrompt: string;\r\n theme: string;\r\n widgetOpacity: number;\r\n useDragInteraction: boolean;\r\n frameworkVersion: FrameworkVersionId;\r\n showWidgetIcon: boolean;\r\n autoCollapseUnpinnedPanels: boolean;\r\n viewOverlayDisplay: boolean;\r\n animateToolSettings: boolean;\r\n useToolAsToolSettingsLabel: boolean;\r\n}\r\n\r\n/** used on first call of ConfigurableUiReducer */\r\nconst initialState: ConfigurableUiState = {\r\n snapMode: SnapMode.NearestKeypoint as number,\r\n toolPrompt: \"\",\r\n theme: SYSTEM_PREFERRED_COLOR_THEME,\r\n widgetOpacity: WIDGET_OPACITY_DEFAULT,\r\n useDragInteraction: false,\r\n frameworkVersion: \"2\",\r\n showWidgetIcon: true,\r\n autoCollapseUnpinnedPanels: false,\r\n viewOverlayDisplay: true,\r\n animateToolSettings: false,\r\n useToolAsToolSettingsLabel: false,\r\n};\r\n\r\n/** An object with a function that creates each ConfigurableUiReducer that can be handled by our reducer.\r\n * @public\r\n */\r\nexport const ConfigurableUiActions = { // eslint-disable-line @typescript-eslint/naming-convention\r\n setSnapMode: (snapMode: number) => createAction(ConfigurableUiActionId.SetSnapMode, snapMode),\r\n setTheme:\r\n // istanbul ignore next\r\n (theme: string) => createAction(ConfigurableUiActionId.SetTheme, theme),\r\n setToolPrompt:\r\n // istanbul ignore next\r\n (toolPrompt: string) => createAction(ConfigurableUiActionId.SetToolPrompt, toolPrompt),\r\n setWidgetOpacity:\r\n // istanbul ignore next\r\n (opacity: number) => createAction(ConfigurableUiActionId.SetWidgetOpacity, opacity),\r\n setDragInteraction: (dragInteraction: boolean) => createAction(ConfigurableUiActionId.SetDragInteraction, dragInteraction),\r\n setFrameworkVersion: (frameworkVersion: FrameworkVersionId) => createAction(ConfigurableUiActionId.SetFrameworkVersion, frameworkVersion),\r\n setShowWidgetIcon: (showWidgetIcon: boolean) => createAction(ConfigurableUiActionId.SetShowWidgetIcon, showWidgetIcon),\r\n setAutoCollapseUnpinnedPanels: (autoCollapse: boolean) => createAction(ConfigurableUiActionId.AutoCollapseUnpinnedPanels, autoCollapse),\r\n setViewOverlayDisplay: (displayViewOverlay: boolean) => createAction(ConfigurableUiActionId.SetViewOverlayDisplay, displayViewOverlay),\r\n setAnimateToolSettings: (animateToolSettings: boolean) => createAction(ConfigurableUiActionId.AnimateToolSettings, animateToolSettings),\r\n setUseToolAsToolSettingsLabel: (useToolAsToolSettingsLabel: boolean) => createAction(ConfigurableUiActionId.UseToolAsToolSettingsLabel, useToolAsToolSettingsLabel),\r\n};\r\n\r\n/** Union of ConfigurableUi Redux actions\r\n * @public\r\n */\r\nexport type ConfigurableUiActionsUnion = ActionsUnion<typeof ConfigurableUiActions>;\r\n\r\n/** Handles actions to update ConfigurableUiState.\r\n * @public\r\n */\r\nexport function ConfigurableUiReducer(state: ConfigurableUiState = initialState, action: ConfigurableUiActionsUnion): ConfigurableUiState {\r\n const outState = state;\r\n\r\n switch (action.type) {\r\n case ConfigurableUiActionId.SetSnapMode: {\r\n return { ...state, snapMode: action.payload };\r\n }\r\n case ConfigurableUiActionId.SetToolPrompt: {\r\n return { ...state, toolPrompt: action.payload };\r\n }\r\n case ConfigurableUiActionId.SetTheme: {\r\n return { ...state, theme: action.payload };\r\n }\r\n case ConfigurableUiActionId.SetWidgetOpacity: {\r\n return { ...state, widgetOpacity: action.payload };\r\n }\r\n case ConfigurableUiActionId.SetDragInteraction: {\r\n return { ...state, useDragInteraction: action.payload };\r\n }\r\n case ConfigurableUiActionId.SetFrameworkVersion: {\r\n const frameworkVersion = (action.payload);\r\n return { ...state, frameworkVersion };\r\n }\r\n case ConfigurableUiActionId.SetShowWidgetIcon: {\r\n return { ...state, showWidgetIcon: action.payload };\r\n }\r\n case ConfigurableUiActionId.AutoCollapseUnpinnedPanels: {\r\n return { ...state, autoCollapseUnpinnedPanels: action.payload };\r\n }\r\n case ConfigurableUiActionId.SetViewOverlayDisplay: {\r\n return { ...state, viewOverlayDisplay: action.payload };\r\n }\r\n case ConfigurableUiActionId.AnimateToolSettings: {\r\n return { ...state, animateToolSettings: action.payload };\r\n }\r\n case ConfigurableUiActionId.UseToolAsToolSettingsLabel: {\r\n return { ...state, useToolAsToolSettingsLabel: action.payload };\r\n }\r\n }\r\n return outState;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../src/appui-react/configurableui/state.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,wDAAgD;AAChD,gDAA+D;AAC/D,wDAAsH;AAGtH,mDAAmD;AAEnD;;;GAGG;AACH,IAAY,sBAaX;AAbD,WAAY,sBAAsB;IAChC,qEAA2C,CAAA;IAC3C,+DAAqC,CAAA;IACrC,yEAA+C,CAAA;IAC/C,gFAAsD,CAAA;IACtD,oFAA0D,CAAA;IAC1D,sFAA4D,CAAA;IAC5D,mFAAyD,CAAA;IACzD,yGAA+E,CAAA;IAC/E,2FAAiE,CAAA;IACjE,0FAAgE,CAAA;IAChE,2GAAiF,CAAA;IACjF,kFAAwD,CAAA;AAC1D,CAAC,EAbW,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QAajC;AAoBD,kDAAkD;AAClD,MAAM,YAAY,GAAwB;IACxC,QAAQ,EAAE,wBAAQ,CAAC,eAAyB;IAC5C,UAAU,EAAE,EAAE;IACd,KAAK,EAAE,2CAA4B;IACnC,aAAa,EAAE,qCAAsB;IACrC,kBAAkB,EAAE,KAAK;IACzB,gBAAgB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C,MAAM,gBAAgB,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAC1C,OAAO,EAAE,GAAG,KAAK,EAAE,gBAAgB,EAAE,CAAC;SACvC;QACD,KAAK,sBAAsB,CAAC,iBAAiB,CAAC,CAAC;YAC7C,OAAO,EAAE,GAAG,KAAK,EAAE,cAAc,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;SACrD;QACD,KAAK,sBAAsB,CAAC,0BAA0B,CAAC,CAAC;YACtD,OAAO,EAAE,GAAG,KAAK,EAAE,0BAA0B,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;SACjE;QACD,KAAK,sBAAsB,CAAC,qBAAqB,CAAC,CAAC;YACjD,OAAO,EAAE,GAAG,KAAK,EAAE,kBAAkB,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;SACzD;QACD,KAAK,sBAAsB,CAAC,mBAAmB,CAAC,CAAC;YAC/C,OAAO,EAAE,GAAG,KAAK,EAAE,mBAAmB,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;SAC1D;QACD,KAAK,sBAAsB,CAAC,0BAA0B,CAAC,CAAC;YACtD,OAAO,EAAE,GAAG,KAAK,EAAE,0BAA0B,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;SACjE;QACD,KAAK,sBAAsB,CAAC,iBAAiB,CAAC,CAAC;YAC7C,OAAO,EAAE,GAAG,KAAK,EAAE,cAAc,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;SACrD;KACF;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AA3CD,sDA2CC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module State\r\n */\r\n\r\nimport { SnapMode } from \"@itwin/core-frontend\";\r\nimport { ActionsUnion, createAction } from \"../redux/redux-ts\";\r\nimport { SYSTEM_PREFERRED_COLOR_THEME, TOOLBAR_OPACITY_DEFAULT, WIDGET_OPACITY_DEFAULT } from \"../theme/ThemeManager\";\r\nimport { FrameworkVersionId } from \"../UiFramework\";\r\n\r\n// cSpell:ignore configurableui snapmode toolprompt\r\n\r\n/** Action Ids used by Redux and to send sync UI components. Typically used to refresh visibility or enable state of control.\r\n * Since these are also used as sync ids they should be in lowercase.\r\n * @public\r\n */\r\nexport enum ConfigurableUiActionId {\r\n SetSnapMode = \"configurableui:set_snapmode\",\r\n SetTheme = \"configurableui:set_theme\",\r\n SetToolPrompt = \"configurableui:set_toolprompt\",\r\n SetWidgetOpacity = \"configurableui:set_widget_opacity\",\r\n SetDragInteraction = \"configurableui:set-drag-interaction\",\r\n SetFrameworkVersion = \"configurableui:set-framework-version\",\r\n SetShowWidgetIcon = \"configurableui:set-show-widget-icon\",\r\n AutoCollapseUnpinnedPanels = \"configurableui:set-auto-collapse-unpinned-panels\",\r\n SetViewOverlayDisplay = \"configurableui:set-view-overlay-display\",\r\n AnimateToolSettings = \"configurableui:set-animate-tool-settings\",\r\n UseToolAsToolSettingsLabel = \"configurableui:set-use-tool-as-tool-settings-label\",\r\n SetToolbarOpacity = \"configurableui:set-toolbar-opacity\",\r\n}\r\n\r\n/** The portion of state managed by the ConfigurableUiReducer.\r\n * @public\r\n */\r\nexport interface ConfigurableUiState {\r\n snapMode: number;\r\n toolPrompt: string;\r\n theme: string;\r\n widgetOpacity: number;\r\n useDragInteraction: boolean;\r\n frameworkVersion: FrameworkVersionId; // eslint-disable-line deprecation/deprecation\r\n showWidgetIcon: boolean;\r\n autoCollapseUnpinnedPanels: boolean;\r\n viewOverlayDisplay: boolean;\r\n animateToolSettings: boolean;\r\n useToolAsToolSettingsLabel: boolean;\r\n toolbarOpacity: number;\r\n}\r\n\r\n/** used on first call of ConfigurableUiReducer */\r\nconst initialState: ConfigurableUiState = {\r\n snapMode: SnapMode.NearestKeypoint as number,\r\n toolPrompt: \"\",\r\n theme: SYSTEM_PREFERRED_COLOR_THEME,\r\n widgetOpacity: WIDGET_OPACITY_DEFAULT,\r\n useDragInteraction: false,\r\n frameworkVersion: \"2\",\r\n showWidgetIcon: true,\r\n autoCollapseUnpinnedPanels: false,\r\n viewOverlayDisplay: true,\r\n animateToolSettings: false,\r\n useToolAsToolSettingsLabel: false,\r\n toolbarOpacity: TOOLBAR_OPACITY_DEFAULT,\r\n};\r\n\r\n/** An object with a function that creates each ConfigurableUiReducer that can be handled by our reducer.\r\n * @public\r\n */\r\nexport const ConfigurableUiActions = { // eslint-disable-line @typescript-eslint/naming-convention\r\n setSnapMode: (snapMode: number) => createAction(ConfigurableUiActionId.SetSnapMode, snapMode),\r\n setTheme:\r\n // istanbul ignore next\r\n (theme: string) => createAction(ConfigurableUiActionId.SetTheme, theme),\r\n setToolPrompt:\r\n // istanbul ignore next\r\n (toolPrompt: string) => createAction(ConfigurableUiActionId.SetToolPrompt, toolPrompt),\r\n setWidgetOpacity:\r\n // istanbul ignore next\r\n (opacity: number) => createAction(ConfigurableUiActionId.SetWidgetOpacity, opacity),\r\n setDragInteraction: (dragInteraction: boolean) => createAction(ConfigurableUiActionId.SetDragInteraction, dragInteraction),\r\n setFrameworkVersion: (frameworkVersion: FrameworkVersionId) => createAction(ConfigurableUiActionId.SetFrameworkVersion, frameworkVersion), // eslint-disable-line deprecation/deprecation\r\n setShowWidgetIcon: (showWidgetIcon: boolean) => createAction(ConfigurableUiActionId.SetShowWidgetIcon, showWidgetIcon),\r\n setAutoCollapseUnpinnedPanels: (autoCollapse: boolean) => createAction(ConfigurableUiActionId.AutoCollapseUnpinnedPanels, autoCollapse),\r\n setViewOverlayDisplay: (displayViewOverlay: boolean) => createAction(ConfigurableUiActionId.SetViewOverlayDisplay, displayViewOverlay),\r\n setAnimateToolSettings: (animateToolSettings: boolean) => createAction(ConfigurableUiActionId.AnimateToolSettings, animateToolSettings),\r\n setUseToolAsToolSettingsLabel: (useToolAsToolSettingsLabel: boolean) => createAction(ConfigurableUiActionId.UseToolAsToolSettingsLabel, useToolAsToolSettingsLabel),\r\n setToolbarOpacity: (opacity: number) => createAction(ConfigurableUiActionId.SetToolbarOpacity, opacity),\r\n};\r\n\r\n/** Union of ConfigurableUi Redux actions\r\n * @public\r\n */\r\nexport type ConfigurableUiActionsUnion = ActionsUnion<typeof ConfigurableUiActions>;\r\n\r\n/** Handles actions to update ConfigurableUiState.\r\n * @public\r\n */\r\nexport function ConfigurableUiReducer(state: ConfigurableUiState = initialState, action: ConfigurableUiActionsUnion): ConfigurableUiState {\r\n const outState = state;\r\n\r\n switch (action.type) {\r\n case ConfigurableUiActionId.SetSnapMode: {\r\n return { ...state, snapMode: action.payload };\r\n }\r\n case ConfigurableUiActionId.SetToolPrompt: {\r\n return { ...state, toolPrompt: action.payload };\r\n }\r\n case ConfigurableUiActionId.SetTheme: {\r\n return { ...state, theme: action.payload };\r\n }\r\n case ConfigurableUiActionId.SetWidgetOpacity: {\r\n return { ...state, widgetOpacity: action.payload };\r\n }\r\n case ConfigurableUiActionId.SetDragInteraction: {\r\n return { ...state, useDragInteraction: action.payload };\r\n }\r\n case ConfigurableUiActionId.SetFrameworkVersion: {\r\n const frameworkVersion = (action.payload);\r\n return { ...state, frameworkVersion };\r\n }\r\n case ConfigurableUiActionId.SetShowWidgetIcon: {\r\n return { ...state, showWidgetIcon: action.payload };\r\n }\r\n case ConfigurableUiActionId.AutoCollapseUnpinnedPanels: {\r\n return { ...state, autoCollapseUnpinnedPanels: action.payload };\r\n }\r\n case ConfigurableUiActionId.SetViewOverlayDisplay: {\r\n return { ...state, viewOverlayDisplay: action.payload };\r\n }\r\n case ConfigurableUiActionId.AnimateToolSettings: {\r\n return { ...state, animateToolSettings: action.payload };\r\n }\r\n case ConfigurableUiActionId.UseToolAsToolSettingsLabel: {\r\n return { ...state, useToolAsToolSettingsLabel: action.payload };\r\n }\r\n case ConfigurableUiActionId.SetToolbarOpacity: {\r\n return { ...state, toolbarOpacity: action.payload };\r\n }\r\n }\r\n return outState;\r\n}\r\n"]}
|
|
@@ -7,6 +7,7 @@ import { ContentLayoutProps } from "@itwin/appui-abstract";
|
|
|
7
7
|
import { ConfigurableUiControlConstructor } from "../configurableui/ConfigurableUiControl";
|
|
8
8
|
import { ContentControl } from "./ContentControl";
|
|
9
9
|
import { FrontstageProps } from "../frontstage/Frontstage";
|
|
10
|
+
import { FrontstageConfig } from "../frontstage/FrontstageConfig";
|
|
10
11
|
/** Properties for content displayed in a content view
|
|
11
12
|
* @public
|
|
12
13
|
*/
|
|
@@ -34,7 +35,14 @@ export interface ContentGroupProps {
|
|
|
34
35
|
* @public
|
|
35
36
|
*/
|
|
36
37
|
export declare abstract class ContentGroupProvider {
|
|
38
|
+
/** Return the contentGroup based on the `FrontstageProps`.
|
|
39
|
+
* @deprecated Implement using `contentGroup` instead.
|
|
40
|
+
*/
|
|
37
41
|
abstract provideContentGroup(props: FrontstageProps): Promise<ContentGroup>;
|
|
42
|
+
/** Return the contentGroup based on the `FrontstageConfig`.
|
|
43
|
+
* @beta This method will be required in upcoming version, this method will be prioritized if it exists over `provideContentGroup`.
|
|
44
|
+
*/
|
|
45
|
+
contentGroup?(config: FrontstageConfig): Promise<ContentGroup>;
|
|
38
46
|
/** Allow provider to update any data stored in ContentGroupProps. Typically this may
|
|
39
47
|
* be to remove applicationData entries.
|
|
40
48
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentGroup.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/content/ContentGroup.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAW,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAA0B,gCAAgC,EAA6B,MAAM,yCAAyC,CAAC;AAG9I,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE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AAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAClD,MAAM,SAAS,GAAG,IAAI,KAAK,EAA8B,CAAC;QAE1D,eAAe,CAAC,OAAO,CAAC,CAAC,OAAuB,EAAE,EAAE;YAClD,IAAI,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,QAAQ,EAAE;gBAC1C,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;aAClC;iBAAM;gBACL,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;aAC3B;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,SAAS,CAAC;IACnB,CAAC;;AApKH,oCAqKC;AApKgB,iBAAI,GAAG,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ContentView\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { ScreenViewport } from \"@itwin/core-frontend\";\r\nimport { ContentLayoutProps, UiError } from \"@itwin/appui-abstract\";\r\nimport { ConfigurableCreateInfo, ConfigurableUiControlConstructor, ConfigurableUiControlType } from \"../configurableui/ConfigurableUiControl\";\r\nimport { ConfigurableUiManager } from \"../configurableui/ConfigurableUiManager\";\r\nimport { UiFramework } from \"../UiFramework\";\r\nimport { ContentControl } from \"./ContentControl\";\r\nimport { FrontstageProps } from \"../frontstage/Frontstage\";\r\n\r\n/** Properties for content displayed in a content view\r\n * @public\r\n */\r\nexport interface ContentProps {\r\n /** A unique id for the Content View within the group */\r\n id: string;\r\n /** The class name or [[ConfigurableUiControlConstructor]] of the content control */\r\n classId: string | ConfigurableUiControlConstructor;\r\n /** Optional application data passed down to the Content View */\r\n applicationData?: any;\r\n}\r\n\r\n/** Properties for a [[ContentGroup]]\r\n * @public\r\n */\r\nexport interface ContentGroupProps {\r\n /** An id for the [[ContentGroup]]. This id is used to locate a ContentGroup and it also can be used by an ContentGroupProvider to save/restore content settings */\r\n id: string;\r\n /** Content Layout Id or complete set of [[ContentLayoutProps]] */\r\n layout: ContentLayoutProps;\r\n /** A collection of [[ContentProps]], one for each content view */\r\n contents: ContentProps[];\r\n}\r\n\r\n/** Abstract class that can be implemented and specified by frontstage to dynamically construct\r\n * content group just prior to activating the frontstage.\r\n * @public\r\n */\r\nexport abstract class ContentGroupProvider {\r\n abstract provideContentGroup(props: FrontstageProps): Promise<ContentGroup>;\r\n\r\n /** Allow provider to update any data stored in ContentGroupProps. Typically this may\r\n * be to remove applicationData entries.\r\n */\r\n public prepareToSaveProps(contentGroupProps: ContentGroupProps) {\r\n return contentGroupProps;\r\n }\r\n\r\n /** Allow provider to update any stored ContentGroupProps be it is to be used to create ContentGroup and layouts.\r\n * Typically this may be to add applicationData to content entries.\r\n */\r\n public applyUpdatesToSavedProps(contentGroupProps: ContentGroupProps) {\r\n return contentGroupProps;\r\n }\r\n\r\n /** Allow provider to save any content group data before the stage deactivated. */\r\n public async onFrontstageDeactivated() { }\r\n}\r\n\r\n/** Callback to process content properties during toJSON method\r\n * @public\r\n */\r\nexport type ContentCallback = (content: ContentProps) => void;\r\n\r\n/** ContentGroup class. Content Groups define content displayed in content views that are laid out using a [[ContentLayout]].\r\n * @public\r\n */\r\nexport class ContentGroup {\r\n private static _sId = 0;\r\n public groupId: string;\r\n public propsId: string;\r\n public layout: ContentLayoutProps;\r\n public contentPropsList: ContentProps[];\r\n private _contentControls = new Map<string, ContentControl>();\r\n private _contentSetMap = new Map<string, ContentControl>();\r\n\r\n public get id() {\r\n return this.groupId;\r\n }\r\n\r\n constructor(contentGroupProps: ContentGroupProps) {\r\n this.layout = { ...contentGroupProps.layout };\r\n this.propsId = contentGroupProps.id;\r\n // ensure we have a unique groupId for each instance of a content group - this will be used to generate a key in the React controls\r\n this.groupId = `[${contentGroupProps.id}-${ContentGroup._sId++}]`;\r\n this.contentPropsList = contentGroupProps.contents;\r\n }\r\n\r\n /** Gets a [[ContentControl]] from the Content Group based on its [[ContentProps]]. */\r\n public getContentControl(contentProps: ContentProps, _index: number): ContentControl | undefined {\r\n // ensure we have a unique control Id for each instance of a content control - this will be used as a key for the React control - see `ContentControl.getKeyedReactNode`\r\n const id = `${contentProps.id}::${this.groupId}`;\r\n let contentControl: ContentControl | undefined;\r\n\r\n if (!this._contentControls.get(contentProps.id)) {\r\n let usedClassId: string = \"\";\r\n\r\n if (typeof contentProps.classId === \"string\") {\r\n if (!this._contentControls.get(contentProps.id) && ConfigurableUiManager.isControlRegistered(contentProps.classId)) {\r\n contentControl = ConfigurableUiManager.createControl(contentProps.classId, id, contentProps.applicationData, contentProps.id) as ContentControl;\r\n usedClassId = contentProps.classId;\r\n }\r\n } else {\r\n const info = new ConfigurableCreateInfo(contentProps.classId.name, id, contentProps.id);\r\n contentControl = new contentProps.classId(info, contentProps.applicationData) as ContentControl;\r\n usedClassId = contentProps.classId.name;\r\n }\r\n\r\n if (contentControl) {\r\n if (contentControl.getType() !== ConfigurableUiControlType.Content && contentControl.getType() !== ConfigurableUiControlType.Viewport) {\r\n throw new UiError(UiFramework.loggerCategory(this), `getContentControl error: '${usedClassId}' is NOT a ContentControl or ViewportContentControl`);\r\n }\r\n contentControl.initialize();\r\n this._contentControls.set(contentProps.id, contentControl);\r\n }\r\n }\r\n\r\n return this._contentControls.get(contentProps.id);\r\n }\r\n\r\n /** Gets a [[ContentControl]] from the Content Group with a given ID. */\r\n public getContentControlById(id: string): ContentControl | undefined {\r\n return this._contentControls.get(id);\r\n }\r\n\r\n /** Gets the React nodes representing the Content Views in this Content Group. */\r\n public getContentNodes(): React.ReactNode[] {\r\n const contentNodes: React.ReactNode[] = new Array<React.ReactNode>();\r\n\r\n this._contentSetMap.clear();\r\n\r\n this.contentPropsList.forEach((contentProps: ContentProps, index: number) => {\r\n const control = this.getContentControl(contentProps, index);\r\n if (control) {\r\n contentNodes.push(control.reactNode);\r\n this._contentSetMap.set(control.controlId, control);\r\n }\r\n });\r\n\r\n return contentNodes;\r\n }\r\n\r\n /** Gets the [[ContentControl]] associated with a given React node representing a Content View. */\r\n public getControlFromElement(node: React.ReactNode): ContentControl | undefined {\r\n if (this._contentSetMap.size === 0)\r\n this.getContentNodes();\r\n\r\n if (node && (node as React.ReactElement<any>).key) {\r\n const key = ((node as React.ReactElement<any>).key as string);\r\n // key has format `${contentProps.id}::${this.groupId}` which is stored as unique id\r\n const controlId = key.split(\"::\", 1)[0];\r\n return this._contentSetMap.get(controlId);\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /** Refreshes the React nodes representing the Content Views in this Content Group.. */\r\n public refreshContentNodes() {\r\n this._contentSetMap.clear();\r\n }\r\n\r\n /** Gets an array of the content controls representing the Content Views. */\r\n public getContentControls(): ContentControl[] {\r\n const contentControls: ContentControl[] = new Array<ContentControl>();\r\n\r\n this.contentPropsList.forEach((contentProps: ContentProps, index: number) => {\r\n const control = this.getContentControl(contentProps, index);\r\n if (control) {\r\n contentControls.push(control);\r\n }\r\n });\r\n\r\n return contentControls;\r\n }\r\n\r\n /** Called when Frontstage is deactivated. */\r\n public onFrontstageDeactivated(): void {\r\n this.clearContentControls();\r\n }\r\n\r\n /** Called when Frontstage is ready. */\r\n public onFrontstageReady(): void { }\r\n\r\n /** Clears the map of content controls. */\r\n public clearContentControls(): void {\r\n this._contentControls.clear();\r\n }\r\n\r\n /** Creates [[ContentGroupProps]] for JSON purposes\r\n * @public\r\n */\r\n public toJSON(contentCallback?: ContentCallback): ContentGroupProps {\r\n const contentGroupProps: ContentGroupProps = {\r\n id: this.propsId,\r\n layout: this.layout,\r\n contents: this.contentPropsList,\r\n };\r\n\r\n contentGroupProps.contents.forEach((content: ContentProps, index: number) => {\r\n if (typeof content.classId !== \"string\") {\r\n const classId = ConfigurableUiManager.getConstructorClassId(content.classId);\r\n if (classId !== undefined)\r\n content.classId = classId;\r\n else\r\n throw new UiError(UiFramework.loggerCategory(this), `toJSON: ContentControl at index ${index} is NOT registered with a string id`);\r\n\r\n if (contentCallback)\r\n contentCallback(content);\r\n }\r\n });\r\n\r\n return contentGroupProps;\r\n }\r\n\r\n /** Gets Viewports from Viewport Content Controls\r\n * @internal\r\n */\r\n public getViewports(): Array<ScreenViewport | undefined> {\r\n const contentControls = this.getContentControls();\r\n const viewports = new Array<ScreenViewport | undefined>();\r\n\r\n contentControls.forEach((control: ContentControl) => {\r\n if (control.isViewport && control.viewport) {\r\n viewports.push(control.viewport);\r\n } else {\r\n viewports.push(undefined);\r\n }\r\n });\r\n\r\n return viewports;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ContentGroup.js","sourceRoot":"","sources":["../../../../src/appui-react/content/ContentGroup.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAIH,0DAAoE;AACpE,mFAA8I;AAC9I,mFAAgF;AAChF,gDAA6C;AA6B7C;;;GAGG;AACH,MAAsB,oBAAoB;IAWxC;;OAEG;IACI,kBAAkB,CAAC,iBAAoC;QAC5D,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAED;;OAEG;IACI,wBAAwB,CAAC,iBAAoC;QAClE,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAED,kFAAkF;IAC3E,KAAK,CAAC,uBAAuB,KAAK,CAAC;CAC3C;AA3BD,oDA2BC;AAOD;;GAEG;AACH,MAAa,YAAY;IAavB,YAAY,iBAAoC;QAPxC,qBAAgB,GAAG,IAAI,GAAG,EAA0B,CAAC;QACrD,mBAAc,GAAG,IAAI,GAAG,EAA0B,CAAC;QAOzD,IAAI,CAAC,MAAM,GAAG,EAAE,GAAG,iBAAiB,CAAC,MAAM,EAAE,CAAC;QAC9C,IAAI,CAAC,OAAO,GAAG,iBAAiB,CAAC,EAAE,CAAC;QACpC,mIAAmI;QACnI,IAAI,CAAC,OAAO,GAAG,IAAI,iBAAiB,CAAC,EAAE,IAAI,YAAY,CAAC,IAAI,EAAE,GAAG,CAAC;QAClE,IAAI,C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OAAO,KAAK,QAAQ,EAAE;gBACvC,MAAM,OAAO,GAAG,6CAAqB,CAAC,qBAAqB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;gBAC7E,IAAI,OAAO,KAAK,SAAS;oBACvB,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC;;oBAE1B,MAAM,IAAI,wBAAO,CAAC,yBAAW,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,mCAAmC,KAAK,qCAAqC,CAAC,CAAC;gBAErI,IAAI,eAAe;oBACjB,eAAe,CAAC,OAAO,CAAC,CAAC;aAC5B;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAED;;OAEG;IACI,YAAY;QACjB,MAAM,eAAe,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAClD,MAAM,SAAS,GAAG,IAAI,KAAK,EAA8B,CAAC;QAE1D,eAAe,CAAC,OAAO,CAAC,CAAC,OAAuB,EAAE,EAAE;YAClD,IAAI,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,QAAQ,EAAE;gBAC1C,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;aAClC;iBAAM;gBACL,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;aAC3B;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,SAAS,CAAC;IACnB,CAAC;;AApKH,oCAqKC;AApKgB,iBAAI,GAAG,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ContentView\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { ScreenViewport } from \"@itwin/core-frontend\";\r\nimport { ContentLayoutProps, UiError } from \"@itwin/appui-abstract\";\r\nimport { ConfigurableCreateInfo, ConfigurableUiControlConstructor, ConfigurableUiControlType } from \"../configurableui/ConfigurableUiControl\";\r\nimport { ConfigurableUiManager } from \"../configurableui/ConfigurableUiManager\";\r\nimport { UiFramework } from \"../UiFramework\";\r\nimport { ContentControl } from \"./ContentControl\";\r\nimport { FrontstageProps } from \"../frontstage/Frontstage\";\r\nimport { FrontstageConfig } from \"../frontstage/FrontstageConfig\";\r\n\r\n/** Properties for content displayed in a content view\r\n * @public\r\n */\r\nexport interface ContentProps {\r\n /** A unique id for the Content View within the group */\r\n id: string;\r\n /** The class name or [[ConfigurableUiControlConstructor]] of the content control */\r\n classId: string | ConfigurableUiControlConstructor;\r\n /** Optional application data passed down to the Content View */\r\n applicationData?: any;\r\n}\r\n\r\n/** Properties for a [[ContentGroup]]\r\n * @public\r\n */\r\nexport interface ContentGroupProps {\r\n /** An id for the [[ContentGroup]]. This id is used to locate a ContentGroup and it also can be used by an ContentGroupProvider to save/restore content settings */\r\n id: string;\r\n /** Content Layout Id or complete set of [[ContentLayoutProps]] */\r\n layout: ContentLayoutProps;\r\n /** A collection of [[ContentProps]], one for each content view */\r\n contents: ContentProps[];\r\n}\r\n\r\n/** Abstract class that can be implemented and specified by frontstage to dynamically construct\r\n * content group just prior to activating the frontstage.\r\n * @public\r\n */\r\nexport abstract class ContentGroupProvider {\r\n /** Return the contentGroup based on the `FrontstageProps`.\r\n * @deprecated Implement using `contentGroup` instead.\r\n */\r\n abstract provideContentGroup(props: FrontstageProps): Promise<ContentGroup>; // eslint-disable-line deprecation/deprecation\r\n\r\n /** Return the contentGroup based on the `FrontstageConfig`.\r\n * @beta This method will be required in upcoming version, this method will be prioritized if it exists over `provideContentGroup`.\r\n */\r\n public contentGroup?(config: FrontstageConfig): Promise<ContentGroup>;\r\n\r\n /** Allow provider to update any data stored in ContentGroupProps. Typically this may\r\n * be to remove applicationData entries.\r\n */\r\n public prepareToSaveProps(contentGroupProps: ContentGroupProps) {\r\n return contentGroupProps;\r\n }\r\n\r\n /** Allow provider to update any stored ContentGroupProps be it is to be used to create ContentGroup and layouts.\r\n * Typically this may be to add applicationData to content entries.\r\n */\r\n public applyUpdatesToSavedProps(contentGroupProps: ContentGroupProps) {\r\n return contentGroupProps;\r\n }\r\n\r\n /** Allow provider to save any content group data before the stage deactivated. */\r\n public async onFrontstageDeactivated() { }\r\n}\r\n\r\n/** Callback to process content properties during toJSON method\r\n * @public\r\n */\r\nexport type ContentCallback = (content: ContentProps) => void;\r\n\r\n/** ContentGroup class. Content Groups define content displayed in content views that are laid out using a [[ContentLayout]].\r\n * @public\r\n */\r\nexport class ContentGroup {\r\n private static _sId = 0;\r\n public groupId: string;\r\n public propsId: string;\r\n public layout: ContentLayoutProps;\r\n public contentPropsList: ContentProps[];\r\n private _contentControls = new Map<string, ContentControl>();\r\n private _contentSetMap = new Map<string, ContentControl>();\r\n\r\n public get id() {\r\n return this.groupId;\r\n }\r\n\r\n constructor(contentGroupProps: ContentGroupProps) {\r\n this.layout = { ...contentGroupProps.layout };\r\n this.propsId = contentGroupProps.id;\r\n // ensure we have a unique groupId for each instance of a content group - this will be used to generate a key in the React controls\r\n this.groupId = `[${contentGroupProps.id}-${ContentGroup._sId++}]`;\r\n this.contentPropsList = contentGroupProps.contents;\r\n }\r\n\r\n /** Gets a [[ContentControl]] from the Content Group based on its [[ContentProps]]. */\r\n public getContentControl(contentProps: ContentProps, _index: number): ContentControl | undefined {\r\n // ensure we have a unique control Id for each instance of a content control - this will be used as a key for the React control - see `ContentControl.getKeyedReactNode`\r\n const id = `${contentProps.id}::${this.groupId}`;\r\n let contentControl: ContentControl | undefined;\r\n\r\n if (!this._contentControls.get(contentProps.id)) {\r\n let usedClassId: string = \"\";\r\n\r\n if (typeof contentProps.classId === \"string\") {\r\n if (!this._contentControls.get(contentProps.id) && ConfigurableUiManager.isControlRegistered(contentProps.classId)) {\r\n contentControl = ConfigurableUiManager.createControl(contentProps.classId, id, contentProps.applicationData, contentProps.id) as ContentControl;\r\n usedClassId = contentProps.classId;\r\n }\r\n } else {\r\n const info = new ConfigurableCreateInfo(contentProps.classId.name, id, contentProps.id);\r\n contentControl = new contentProps.classId(info, contentProps.applicationData) as ContentControl;\r\n usedClassId = contentProps.classId.name;\r\n }\r\n\r\n if (contentControl) {\r\n if (contentControl.getType() !== ConfigurableUiControlType.Content && contentControl.getType() !== ConfigurableUiControlType.Viewport) {\r\n throw new UiError(UiFramework.loggerCategory(this), `getContentControl error: '${usedClassId}' is NOT a ContentControl or ViewportContentControl`);\r\n }\r\n contentControl.initialize();\r\n this._contentControls.set(contentProps.id, contentControl);\r\n }\r\n }\r\n\r\n return this._contentControls.get(contentProps.id);\r\n }\r\n\r\n /** Gets a [[ContentControl]] from the Content Group with a given ID. */\r\n public getContentControlById(id: string): ContentControl | undefined {\r\n return this._contentControls.get(id);\r\n }\r\n\r\n /** Gets the React nodes representing the Content Views in this Content Group. */\r\n public getContentNodes(): React.ReactNode[] {\r\n const contentNodes: React.ReactNode[] = new Array<React.ReactNode>();\r\n\r\n this._contentSetMap.clear();\r\n\r\n this.contentPropsList.forEach((contentProps: ContentProps, index: number) => {\r\n const control = this.getContentControl(contentProps, index);\r\n if (control) {\r\n contentNodes.push(control.reactNode);\r\n this._contentSetMap.set(control.controlId, control);\r\n }\r\n });\r\n\r\n return contentNodes;\r\n }\r\n\r\n /** Gets the [[ContentControl]] associated with a given React node representing a Content View. */\r\n public getControlFromElement(node: React.ReactNode): ContentControl | undefined {\r\n if (this._contentSetMap.size === 0)\r\n this.getContentNodes();\r\n\r\n if (node && (node as React.ReactElement<any>).key) {\r\n const key = ((node as React.ReactElement<any>).key as string);\r\n // key has format `${contentProps.id}::${this.groupId}` which is stored as unique id\r\n const controlId = key.split(\"::\", 1)[0];\r\n return this._contentSetMap.get(controlId);\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /** Refreshes the React nodes representing the Content Views in this Content Group.. */\r\n public refreshContentNodes() {\r\n this._contentSetMap.clear();\r\n }\r\n\r\n /** Gets an array of the content controls representing the Content Views. */\r\n public getContentControls(): ContentControl[] {\r\n const contentControls: ContentControl[] = new Array<ContentControl>();\r\n\r\n this.contentPropsList.forEach((contentProps: ContentProps, index: number) => {\r\n const control = this.getContentControl(contentProps, index);\r\n if (control) {\r\n contentControls.push(control);\r\n }\r\n });\r\n\r\n return contentControls;\r\n }\r\n\r\n /** Called when Frontstage is deactivated. */\r\n public onFrontstageDeactivated(): void {\r\n this.clearContentControls();\r\n }\r\n\r\n /** Called when Frontstage is ready. */\r\n public onFrontstageReady(): void { }\r\n\r\n /** Clears the map of content controls. */\r\n public clearContentControls(): void {\r\n this._contentControls.clear();\r\n }\r\n\r\n /** Creates [[ContentGroupProps]] for JSON purposes\r\n * @public\r\n */\r\n public toJSON(contentCallback?: ContentCallback): ContentGroupProps {\r\n const contentGroupProps: ContentGroupProps = {\r\n id: this.propsId,\r\n layout: this.layout,\r\n contents: this.contentPropsList,\r\n };\r\n\r\n contentGroupProps.contents.forEach((content: ContentProps, index: number) => {\r\n if (typeof content.classId !== \"string\") {\r\n const classId = ConfigurableUiManager.getConstructorClassId(content.classId);\r\n if (classId !== undefined)\r\n content.classId = classId;\r\n else\r\n throw new UiError(UiFramework.loggerCategory(this), `toJSON: ContentControl at index ${index} is NOT registered with a string id`);\r\n\r\n if (contentCallback)\r\n contentCallback(content);\r\n }\r\n });\r\n\r\n return contentGroupProps;\r\n }\r\n\r\n /** Gets Viewports from Viewport Content Controls\r\n * @internal\r\n */\r\n public getViewports(): Array<ScreenViewport | undefined> {\r\n const contentControls = this.getContentControls();\r\n const viewports = new Array<ScreenViewport | undefined>();\r\n\r\n contentControls.forEach((control: ContentControl) => {\r\n if (control.isViewport && control.viewport) {\r\n viewports.push(control.viewport);\r\n } else {\r\n viewports.push(undefined);\r\n }\r\n });\r\n\r\n return viewports;\r\n }\r\n}\r\n"]}
|
|
@@ -13,8 +13,8 @@ const React = require("react");
|
|
|
13
13
|
const classnames_1 = require("classnames");
|
|
14
14
|
const appui_abstract_1 = require("@itwin/appui-abstract");
|
|
15
15
|
const core_react_1 = require("@itwin/core-react");
|
|
16
|
-
const appui_layout_react_1 = require("@itwin/appui-layout-react");
|
|
17
16
|
const CursorPopupManager_1 = require("./CursorPopupManager");
|
|
17
|
+
const Dialog_1 = require("../../statusbar/dialog/Dialog");
|
|
18
18
|
/** Enum for showing CursorPopup
|
|
19
19
|
* @internal - unit testing
|
|
20
20
|
*/
|
|
@@ -134,7 +134,7 @@ class CursorPopup extends React.Component {
|
|
|
134
134
|
const classNames = (0, classnames_1.default)("uifw-cursorpopup", this.props.shadow && "core-popup-shadow", this.state.showPopup === CursorPopupShow.FadeOut && "uifw-cursorpopup-fadeOut");
|
|
135
135
|
return (React.createElement("div", { className: classNames, ref: (e) => this.setDivRef(e), style: positioningStyle },
|
|
136
136
|
this.props.title &&
|
|
137
|
-
React.createElement(
|
|
137
|
+
React.createElement(Dialog_1.StatusBarDialog.TitleBar, { title: this.props.title, className: "uifw-cursorpopup-title" }),
|
|
138
138
|
this.props.content));
|
|
139
139
|
}
|
|
140
140
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CursorPopup.js","sourceRoot":"","sources":["../../../../../src/appui-react/cursor/cursorpopup/CursorPopup.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,8BAA4B;AAC5B,+BAA+B;AAC/B,2CAAoC;AACpC,0DAAqE;AACrE,kDAAsG;AACtG,kEAAqD;AACrD,6DAAuF;AAiBvF;;GAEG;AACH,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,qDAAI,CAAA;IACJ,2DAAO,CAAA;AACT,CAAC,EAHW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAG1B;AAUD;;GAEG;AACH,MAAa,WAAY,SAAQ,KAAK,CAAC,SAA6C;IAOlF,gBAAgB;IAChB,YAAY,KAAuB;QACjC,KAAK,CAAC,KAAK,CAAC,CAAC;QAPP,eAAU,GAAY,KAAK,CAAC;QAyB5B,mCAA8B,GAAG,CAAC,IAAiC,EAAE,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,GAAG,EAAE,SAAS,CAAC,GAAG;SACnB,CAAC;QAEF,MAAM,UAAU,GAAG,IAAA,oBAAU,EAC3B,kBAAkB,EAClB,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,mBAAmB,EACxC,IAAI,CAAC,KAAK,CAAC,SAAS,KAAK,eAAe,CAAC,OAAO,IAAI,0BAA0B,CAC/E,CAAC;QAEF,OAAO,CACL,6BAAK,SAAS,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,gBAAgB;YAC/E,IAAI,CAAC,KAAK,CAAC,KAAK;gBACf,oBAAC,6BAAQ,IACP,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,SAAS,EAAC,wBAAwB,GAAG;YAExC,IAAI,CAAC,KAAK,CAAC,OAAO,CACf,CACP,CAAC;IACJ,CAAC;;AA5IH,kCA6IC;AAzIC,gBAAgB;AACF,uBAAW,GAAG,GAAG,CAAC;AA0IlC;;GAEG;AACH,SAAgB,kBAAkB,CAAC,KAAqB;IACtD,OAAO,oBAAC,gBAAG,OAAK,KAAK,EAAE,aAAa,EAAC,0BAA0B,GAAG,CAAC;AACrE,CAAC;AAFD,gDAEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Cursor\r\n */\r\n\r\nimport \"./CursorPopup.scss\";\r\nimport * as React from \"react\";\r\nimport classnames from \"classnames\";\r\nimport { PointProps, RelativePosition } from \"@itwin/appui-abstract\";\r\nimport { CommonDivProps, CommonProps, Div, RectangleProps, Size, SizeProps } from \"@itwin/core-react\";\r\nimport { TitleBar } from \"@itwin/appui-layout-react\";\r\nimport { CursorPopupFadeOutEventArgs, CursorPopupManager } from \"./CursorPopupManager\";\r\n\r\n/** Properties for the [[CursorPopup]] React component\r\n * @public\r\n */\r\nexport interface CursorPopupProps extends CommonProps {\r\n id: string;\r\n content: React.ReactNode;\r\n pt: PointProps;\r\n offset: PointProps;\r\n relativePosition: RelativePosition;\r\n title?: string;\r\n shadow?: boolean;\r\n /** Function called when size is known. */\r\n onSizeKnown?: (size: SizeProps) => void;\r\n}\r\n\r\n/** Enum for showing CursorPopup\r\n * @internal - unit testing\r\n */\r\nexport enum CursorPopupShow {\r\n Open,\r\n FadeOut,\r\n}\r\n\r\n/** State for the [[CursorPopup]] React component\r\n * @internal\r\n */\r\ninterface CursorPopupState {\r\n showPopup: CursorPopupShow;\r\n size: Size;\r\n}\r\n\r\n/** CursorPopup React component\r\n * @public\r\n */\r\nexport class CursorPopup extends React.Component<CursorPopupProps, CursorPopupState> {\r\n\r\n private _isMounted: boolean = false;\r\n\r\n /** @internal */\r\n public static fadeOutTime = 500;\r\n\r\n /** @internal */\r\n constructor(props: CursorPopupProps) {\r\n super(props);\r\n\r\n this.state = {\r\n showPopup: CursorPopupShow.Open,\r\n size: new Size(-1, -1),\r\n };\r\n }\r\n\r\n public override componentDidMount() {\r\n this._isMounted = true;\r\n CursorPopupManager.onCursorPopupFadeOutEvent.addListener(this._handleCursorPopupFadeOutEvent);\r\n }\r\n\r\n public override componentWillUnmount() {\r\n this._isMounted = false;\r\n CursorPopupManager.onCursorPopupFadeOutEvent.removeListener(this._handleCursorPopupFadeOutEvent);\r\n }\r\n\r\n private _handleCursorPopupFadeOutEvent = (args: CursorPopupFadeOutEventArgs) => {\r\n if (this.props.id === args.id) {\r\n // istanbul ignore else\r\n if (this._isMounted)\r\n this.setState({ showPopup: CursorPopupShow.FadeOut });\r\n }\r\n };\r\n\r\n /** @internal */\r\n public static getPopupRect(pt: PointProps, offset: PointProps, popupSize: SizeProps | undefined, relativePosition: RelativePosition): RectangleProps {\r\n const popupRect = { top: 0, left: 0, right: 0, bottom: 0 };\r\n\r\n if (popupSize === undefined)\r\n return popupRect;\r\n\r\n switch (relativePosition) {\r\n case RelativePosition.Top:\r\n popupRect.bottom = pt.y - offset.y;\r\n popupRect.left = pt.x - (popupSize.width / 2);\r\n popupRect.top = popupRect.bottom - popupSize.height;\r\n popupRect.right = popupRect.left + popupSize.width;\r\n break;\r\n case RelativePosition.Left:\r\n popupRect.right = pt.x - offset.x;\r\n popupRect.top = pt.y - (popupSize.height / 2);\r\n popupRect.left = popupRect.right - popupSize.width;\r\n popupRect.bottom = popupRect.top + popupSize.height;\r\n break;\r\n case RelativePosition.Right:\r\n popupRect.left = pt.x + offset.x;\r\n popupRect.top = pt.y - (popupSize.height / 2);\r\n popupRect.right = popupRect.left + popupSize.width;\r\n popupRect.bottom = popupRect.top + popupSize.height;\r\n break;\r\n case RelativePosition.Bottom:\r\n popupRect.top = pt.y + offset.y;\r\n popupRect.left = pt.x - (popupSize.width / 2);\r\n popupRect.bottom = popupRect.top + popupSize.height;\r\n popupRect.right = popupRect.left + popupSize.width;\r\n break;\r\n case RelativePosition.TopLeft:\r\n popupRect.bottom = pt.y - offset.y;\r\n popupRect.right = pt.x - offset.x;\r\n popupRect.top = popupRect.bottom - popupSize.height;\r\n popupRect.left = popupRect.right - popupSize.width;\r\n break;\r\n case RelativePosition.TopRight:\r\n popupRect.bottom = pt.y - offset.y;\r\n popupRect.left = pt.x + offset.x;\r\n popupRect.top = popupRect.bottom - popupSize.height;\r\n popupRect.right = popupRect.left + popupSize.width;\r\n break;\r\n case RelativePosition.BottomLeft:\r\n popupRect.top = pt.y + offset.y;\r\n popupRect.right = pt.x - offset.x;\r\n popupRect.bottom = popupRect.top + popupSize.height;\r\n popupRect.left = popupRect.right - popupSize.width;\r\n break;\r\n case RelativePosition.BottomRight:\r\n popupRect.top = pt.y + offset.y;\r\n popupRect.left = pt.x + offset.x;\r\n popupRect.bottom = popupRect.top + popupSize.height;\r\n popupRect.right = popupRect.left + popupSize.width;\r\n break;\r\n }\r\n\r\n return popupRect;\r\n }\r\n\r\n private setDivRef(div: HTMLDivElement | null) {\r\n // istanbul ignore else\r\n if (div) {\r\n const rect = div.getBoundingClientRect();\r\n const newSize = new Size(rect.width, rect.height);\r\n\r\n // istanbul ignore else\r\n if (!this.state.size.equals(newSize)) {\r\n // istanbul ignore else\r\n if (this.props.onSizeKnown)\r\n this.props.onSizeKnown(newSize);\r\n\r\n // istanbul ignore else\r\n if (this._isMounted)\r\n this.setState({ size: newSize });\r\n }\r\n }\r\n }\r\n\r\n /** @internal */\r\n public override render() {\r\n const popupRect = CursorPopup.getPopupRect(this.props.pt, this.props.offset, this.state.size, this.props.relativePosition);\r\n\r\n const positioningStyle: React.CSSProperties = {\r\n left: popupRect.left,\r\n top: popupRect.top,\r\n };\r\n\r\n const classNames = classnames(\r\n \"uifw-cursorpopup\",\r\n this.props.shadow && \"core-popup-shadow\",\r\n this.state.showPopup === CursorPopupShow.FadeOut && \"uifw-cursorpopup-fadeOut\",\r\n );\r\n\r\n return (\r\n <div className={classNames} ref={(e) => this.setDivRef(e)} style={positioningStyle}>\r\n {this.props.title &&\r\n <TitleBar\r\n title={this.props.title}\r\n className=\"uifw-cursorpopup-title\" />\r\n }\r\n {this.props.content}\r\n </div>\r\n );\r\n }\r\n}\r\n\r\n/** CursorPopup content with padding\r\n * @public\r\n */\r\nexport function CursorPopupContent(props: CommonDivProps) {\r\n return <Div {...props} mainClassName=\"uifw-cursorpopup-content\" />;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"CursorPopup.js","sourceRoot":"","sources":["../../../../../src/appui-react/cursor/cursorpopup/CursorPopup.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,8BAA4B;AAC5B,+BAA+B;AAC/B,2CAAoC;AACpC,0DAAqE;AACrE,kDAAsG;AACtG,6DAAuF;AACvF,0DAAgE;AAiBhE;;GAEG;AACH,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,qDAAI,CAAA;IACJ,2DAAO,CAAA;AACT,CAAC,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AW,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;QAE3H,MAAM,gBAAgB,GAAwB;YAC5C,IAAI,EAAE,SAAS,CAAC,IAAI;YACpB,GAAG,EAAE,SAAS,CAAC,GAAG;SACnB,CAAC;QAEF,MAAM,UAAU,GAAG,IAAA,oBAAU,EAC3B,kBAAkB,EAClB,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,mBAAmB,EACxC,IAAI,CAAC,KAAK,CAAC,SAAS,KAAK,eAAe,CAAC,OAAO,IAAI,0BAA0B,CAC/E,CAAC;QAEF,OAAO,CACL,6BAAK,SAAS,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,gBAAgB;YAC/E,IAAI,CAAC,KAAK,CAAC,KAAK;gBACf,oBAAC,wBAAe,CAAC,QAAQ,IACvB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,SAAS,EAAC,wBAAwB,GAAG;YAExC,IAAI,CAAC,KAAK,CAAC,OAAO,CACf,CACP,CAAC;IACJ,CAAC;;AA5IH,kCA6IC;AAzIC,gBAAgB;AACF,uBAAW,GAAG,GAAG,CAAC;AA0IlC;;GAEG;AACH,SAAgB,kBAAkB,CAAC,KAAqB;IACtD,OAAO,oBAAC,gBAAG,OAAK,KAAK,EAAE,aAAa,EAAC,0BAA0B,GAAG,CAAC;AACrE,CAAC;AAFD,gDAEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Cursor\r\n */\r\n\r\nimport \"./CursorPopup.scss\";\r\nimport * as React from \"react\";\r\nimport classnames from \"classnames\";\r\nimport { PointProps, RelativePosition } from \"@itwin/appui-abstract\";\r\nimport { CommonDivProps, CommonProps, Div, RectangleProps, Size, SizeProps } from \"@itwin/core-react\";\r\nimport { CursorPopupFadeOutEventArgs, CursorPopupManager } from \"./CursorPopupManager\";\r\nimport { StatusBarDialog } from \"../../statusbar/dialog/Dialog\";\r\n\r\n/** Properties for the [[CursorPopup]] React component\r\n * @public\r\n */\r\nexport interface CursorPopupProps extends CommonProps {\r\n id: string;\r\n content: React.ReactNode;\r\n pt: PointProps;\r\n offset: PointProps;\r\n relativePosition: RelativePosition;\r\n title?: string;\r\n shadow?: boolean;\r\n /** Function called when size is known. */\r\n onSizeKnown?: (size: SizeProps) => void;\r\n}\r\n\r\n/** Enum for showing CursorPopup\r\n * @internal - unit testing\r\n */\r\nexport enum CursorPopupShow {\r\n Open,\r\n FadeOut,\r\n}\r\n\r\n/** State for the [[CursorPopup]] React component\r\n * @internal\r\n */\r\ninterface CursorPopupState {\r\n showPopup: CursorPopupShow;\r\n size: Size;\r\n}\r\n\r\n/** CursorPopup React component\r\n * @public\r\n */\r\nexport class CursorPopup extends React.Component<CursorPopupProps, CursorPopupState> {\r\n\r\n private _isMounted: boolean = false;\r\n\r\n /** @internal */\r\n public static fadeOutTime = 500;\r\n\r\n /** @internal */\r\n constructor(props: CursorPopupProps) {\r\n super(props);\r\n\r\n this.state = {\r\n showPopup: CursorPopupShow.Open,\r\n size: new Size(-1, -1),\r\n };\r\n }\r\n\r\n public override componentDidMount() {\r\n this._isMounted = true;\r\n CursorPopupManager.onCursorPopupFadeOutEvent.addListener(this._handleCursorPopupFadeOutEvent);\r\n }\r\n\r\n public override componentWillUnmount() {\r\n this._isMounted = false;\r\n CursorPopupManager.onCursorPopupFadeOutEvent.removeListener(this._handleCursorPopupFadeOutEvent);\r\n }\r\n\r\n private _handleCursorPopupFadeOutEvent = (args: CursorPopupFadeOutEventArgs) => {\r\n if (this.props.id === args.id) {\r\n // istanbul ignore else\r\n if (this._isMounted)\r\n this.setState({ showPopup: CursorPopupShow.FadeOut });\r\n }\r\n };\r\n\r\n /** @internal */\r\n public static getPopupRect(pt: PointProps, offset: PointProps, popupSize: SizeProps | undefined, relativePosition: RelativePosition): RectangleProps {\r\n const popupRect = { top: 0, left: 0, right: 0, bottom: 0 };\r\n\r\n if (popupSize === undefined)\r\n return popupRect;\r\n\r\n switch (relativePosition) {\r\n case RelativePosition.Top:\r\n popupRect.bottom = pt.y - offset.y;\r\n popupRect.left = pt.x - (popupSize.width / 2);\r\n popupRect.top = popupRect.bottom - popupSize.height;\r\n popupRect.right = popupRect.left + popupSize.width;\r\n break;\r\n case RelativePosition.Left:\r\n popupRect.right = pt.x - offset.x;\r\n popupRect.top = pt.y - (popupSize.height / 2);\r\n popupRect.left = popupRect.right - popupSize.width;\r\n popupRect.bottom = popupRect.top + popupSize.height;\r\n break;\r\n case RelativePosition.Right:\r\n popupRect.left = pt.x + offset.x;\r\n popupRect.top = pt.y - (popupSize.height / 2);\r\n popupRect.right = popupRect.left + popupSize.width;\r\n popupRect.bottom = popupRect.top + popupSize.height;\r\n break;\r\n case RelativePosition.Bottom:\r\n popupRect.top = pt.y + offset.y;\r\n popupRect.left = pt.x - (popupSize.width / 2);\r\n popupRect.bottom = popupRect.top + popupSize.height;\r\n popupRect.right = popupRect.left + popupSize.width;\r\n break;\r\n case RelativePosition.TopLeft:\r\n popupRect.bottom = pt.y - offset.y;\r\n popupRect.right = pt.x - offset.x;\r\n popupRect.top = popupRect.bottom - popupSize.height;\r\n popupRect.left = popupRect.right - popupSize.width;\r\n break;\r\n case RelativePosition.TopRight:\r\n popupRect.bottom = pt.y - offset.y;\r\n popupRect.left = pt.x + offset.x;\r\n popupRect.top = popupRect.bottom - popupSize.height;\r\n popupRect.right = popupRect.left + popupSize.width;\r\n break;\r\n case RelativePosition.BottomLeft:\r\n popupRect.top = pt.y + offset.y;\r\n popupRect.right = pt.x - offset.x;\r\n popupRect.bottom = popupRect.top + popupSize.height;\r\n popupRect.left = popupRect.right - popupSize.width;\r\n break;\r\n case RelativePosition.BottomRight:\r\n popupRect.top = pt.y + offset.y;\r\n popupRect.left = pt.x + offset.x;\r\n popupRect.bottom = popupRect.top + popupSize.height;\r\n popupRect.right = popupRect.left + popupSize.width;\r\n break;\r\n }\r\n\r\n return popupRect;\r\n }\r\n\r\n private setDivRef(div: HTMLDivElement | null) {\r\n // istanbul ignore else\r\n if (div) {\r\n const rect = div.getBoundingClientRect();\r\n const newSize = new Size(rect.width, rect.height);\r\n\r\n // istanbul ignore else\r\n if (!this.state.size.equals(newSize)) {\r\n // istanbul ignore else\r\n if (this.props.onSizeKnown)\r\n this.props.onSizeKnown(newSize);\r\n\r\n // istanbul ignore else\r\n if (this._isMounted)\r\n this.setState({ size: newSize });\r\n }\r\n }\r\n }\r\n\r\n /** @internal */\r\n public override render() {\r\n const popupRect = CursorPopup.getPopupRect(this.props.pt, this.props.offset, this.state.size, this.props.relativePosition);\r\n\r\n const positioningStyle: React.CSSProperties = {\r\n left: popupRect.left,\r\n top: popupRect.top,\r\n };\r\n\r\n const classNames = classnames(\r\n \"uifw-cursorpopup\",\r\n this.props.shadow && \"core-popup-shadow\",\r\n this.state.showPopup === CursorPopupShow.FadeOut && \"uifw-cursorpopup-fadeOut\",\r\n );\r\n\r\n return (\r\n <div className={classNames} ref={(e) => this.setDivRef(e)} style={positioningStyle}>\r\n {this.props.title &&\r\n <StatusBarDialog.TitleBar\r\n title={this.props.title}\r\n className=\"uifw-cursorpopup-title\" />\r\n }\r\n {this.props.content}\r\n </div>\r\n );\r\n }\r\n}\r\n\r\n/** CursorPopup content with padding\r\n * @public\r\n */\r\nexport function CursorPopupContent(props: CommonDivProps) {\r\n return <Div {...props} mainClassName=\"uifw-cursorpopup-content\" />;\r\n}\r\n"]}
|
|
@@ -14,12 +14,15 @@ import { ZoneLocation, ZoneProps } from "../zones/Zone";
|
|
|
14
14
|
import { ZoneDef } from "../zones/ZoneDef";
|
|
15
15
|
import { FrontstageRuntimeProps, ZoneDefProvider } from "./FrontstageComposer";
|
|
16
16
|
/** Properties for a [[Frontstage]] component.
|
|
17
|
+
* @deprecated Props of a deprecated component.
|
|
17
18
|
* @public
|
|
18
19
|
*/
|
|
19
20
|
export interface FrontstageProps extends CommonProps {
|
|
20
21
|
/** Id for the Frontstage */
|
|
21
22
|
id: string;
|
|
22
|
-
/** Tool that is started once the Frontstage is activated
|
|
23
|
+
/** Tool that is started once the Frontstage is activated.
|
|
24
|
+
* Use [FrontstageManager.onFrontstageReadyEvent] instead.
|
|
25
|
+
*/
|
|
23
26
|
defaultTool: ToolItemDef;
|
|
24
27
|
/** The Content Group providing the Content Views */
|
|
25
28
|
contentGroup: ContentGroup | ContentGroupProvider;
|
|
@@ -98,6 +101,7 @@ interface FrontstageState {
|
|
|
98
101
|
}
|
|
99
102
|
/** Frontstage React component.
|
|
100
103
|
* A Frontstage is a full-screen configuration designed to enable the user to accomplish a task.
|
|
104
|
+
* @deprecated Use [FrontstageConfig] instead.
|
|
101
105
|
* @public
|
|
102
106
|
*/
|
|
103
107
|
export declare class Frontstage extends React.Component<FrontstageProps, FrontstageState> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Frontstage.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/frontstage/Frontstage.tsx"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,kBAAkB,EAAkE,MAAM,uBAAuB,CAAC;AAC3H,OAAO,EAAE,WAAW,EAAa,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EACyF,YAAY,EAAiB,gBAAgB,EAC3I,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAE7E,OAAO,EAAE,WAAW,EAAE,MAAM,uBAA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EAAE,eAAe;IASlC;;OAEG;IACmB,iBAAiB;IAOvB,kBAAkB;IAWlC;;OAEG;IACa,oBAAoB;IAMpC,OAAO,CAAC,oBAAoB,CAI1B;IAEF,OAAO,CAAC,qBAAqB,CAE3B;IAEF,OAAO,CAAC,gCAAgC,CAEtC;IAEF,OAAO,CAAC,gBAAgB;IAexB,gBAAgB;WACF,aAAa,CAAC,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,GAAG,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe,GAAG,OAAO,GAAG,SAAS;IAiBzJ,OAAO,CAAC,MAAM,CAAC,cAAc;IAyB7B,gBAAgB;WACF,mBAAmB,CAAC,aAAa,EAAE,kBAAkB,EAAE,KAAK,EAAE,eAAe,GAAG,aAAa,GAAG,SAAS;IASvH,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAgCnC,OAAO,CAAC,cAAc,CAgBpB;IAGF,OAAO,CAAC,qBAAqB;IAsB7B,OAAO,CAAC,sBAAsB;IAsC9B,OAAO,CAAC,iBAAiB;IAsDzB,OAAO,CAAC,0BAA0B;IAwClC;;OAEG;IACa,MAAM,IAAI,KAAK,CAAC,SAAS;CAuD1C;AAsGD,gBAAgB;AAEhB,eAAO,MAAM,eAAe,WAAY,YAAY,SAAS,iBAAiB,eAAe,eAAe,KAAG,gBA2B9G,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,cAIjC,CAAC;AAEF,gBAAgB;AAChB,wBAAgB,sBAAsB,wDAarC;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,yBAGpD"}
|
|
@@ -26,6 +26,7 @@ const ZoneDef_1 = require("../zones/ZoneDef");
|
|
|
26
26
|
const FrontstageManager_1 = require("./FrontstageManager");
|
|
27
27
|
/** Frontstage React component.
|
|
28
28
|
* A Frontstage is a full-screen configuration designed to enable the user to accomplish a task.
|
|
29
|
+
* @deprecated Use [FrontstageConfig] instead.
|
|
29
30
|
* @public
|
|
30
31
|
*/
|
|
31
32
|
class Frontstage extends React.Component {
|