@itwin/appui-react 4.6.3 → 4.7.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 +27 -1
- package/lib/cjs/appui-react/UiFramework.d.ts +29 -14
- package/lib/cjs/appui-react/UiFramework.d.ts.map +1 -1
- package/lib/cjs/appui-react/UiFramework.js +28 -15
- package/lib/cjs/appui-react/UiFramework.js.map +1 -1
- package/lib/cjs/appui-react/accudraw/AccuDrawFieldContainer.d.ts.map +1 -1
- package/lib/cjs/appui-react/accudraw/AccuDrawFieldContainer.js +4 -7
- package/lib/cjs/appui-react/accudraw/AccuDrawFieldContainer.js.map +1 -1
- package/lib/cjs/appui-react/accudraw/AccuDrawInputField.d.ts.map +1 -1
- package/lib/cjs/appui-react/accudraw/AccuDrawInputField.js +3 -3
- package/lib/cjs/appui-react/accudraw/AccuDrawInputField.js.map +1 -1
- package/lib/cjs/appui-react/accudraw/AccuDrawKeyboardShortcuts.d.ts +8 -0
- package/lib/cjs/appui-react/accudraw/AccuDrawKeyboardShortcuts.d.ts.map +1 -1
- package/lib/cjs/appui-react/accudraw/AccuDrawKeyboardShortcuts.js +8 -0
- package/lib/cjs/appui-react/accudraw/AccuDrawKeyboardShortcuts.js.map +1 -1
- package/lib/cjs/appui-react/accudraw/AccuDrawPopupManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/accudraw/AccuDrawPopupManager.js +3 -4
- package/lib/cjs/appui-react/accudraw/AccuDrawPopupManager.js.map +1 -1
- package/lib/cjs/appui-react/accudraw/Calculator.d.ts.map +1 -1
- package/lib/cjs/appui-react/accudraw/Calculator.js +11 -12
- package/lib/cjs/appui-react/accudraw/Calculator.js.map +1 -1
- package/lib/cjs/appui-react/accudraw/FrameworkAccuDraw.d.ts +9 -1
- package/lib/cjs/appui-react/accudraw/FrameworkAccuDraw.d.ts.map +1 -1
- package/lib/cjs/appui-react/accudraw/FrameworkAccuDraw.js +9 -1
- package/lib/cjs/appui-react/accudraw/FrameworkAccuDraw.js.map +1 -1
- package/lib/cjs/appui-react/childwindow/InternalChildWindowManager.d.ts +2 -2
- package/lib/cjs/appui-react/childwindow/InternalChildWindowManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/childwindow/InternalChildWindowManager.js +16 -11
- package/lib/cjs/appui-react/childwindow/InternalChildWindowManager.js.map +1 -1
- package/lib/cjs/appui-react/childwindow/PopoutWidget.d.ts +2 -4
- package/lib/cjs/appui-react/childwindow/PopoutWidget.d.ts.map +1 -1
- package/lib/cjs/appui-react/childwindow/PopoutWidget.js +6 -3
- package/lib/cjs/appui-react/childwindow/PopoutWidget.js.map +1 -1
- package/lib/cjs/appui-react/configurableui/ConfigurableUiContent.d.ts.map +1 -1
- package/lib/cjs/appui-react/configurableui/ConfigurableUiContent.js +3 -1
- package/lib/cjs/appui-react/configurableui/ConfigurableUiContent.js.map +1 -1
- package/lib/cjs/appui-react/configurableui/state.d.ts.map +1 -1
- package/lib/cjs/appui-react/configurableui/state.js +5 -2
- package/lib/cjs/appui-react/configurableui/state.js.map +1 -1
- package/lib/cjs/appui-react/content/FloatingViewportContent.d.ts.map +1 -1
- package/lib/cjs/appui-react/content/FloatingViewportContent.js +1 -2
- package/lib/cjs/appui-react/content/FloatingViewportContent.js.map +1 -1
- package/lib/cjs/appui-react/content/IModelViewport.d.ts.map +1 -1
- package/lib/cjs/appui-react/content/IModelViewport.js +2 -0
- package/lib/cjs/appui-react/content/IModelViewport.js.map +1 -1
- package/lib/cjs/appui-react/feedback/ValidationTextbox.js +3 -3
- package/lib/cjs/appui-react/feedback/ValidationTextbox.js.map +1 -1
- package/lib/cjs/appui-react/framework/FrameworkKeyboardShortcuts.d.ts +2 -2
- package/lib/cjs/appui-react/framework/FrameworkKeyboardShortcuts.d.ts.map +1 -1
- package/lib/cjs/appui-react/framework/FrameworkKeyboardShortcuts.js.map +1 -1
- package/lib/cjs/appui-react/frontstage/FrontstageDef.d.ts +6 -8
- package/lib/cjs/appui-react/frontstage/FrontstageDef.d.ts.map +1 -1
- package/lib/cjs/appui-react/frontstage/FrontstageDef.js +26 -16
- package/lib/cjs/appui-react/frontstage/FrontstageDef.js.map +1 -1
- package/lib/cjs/appui-react/frontstage/ModalSettingsStage.d.ts.map +1 -1
- package/lib/cjs/appui-react/frontstage/ModalSettingsStage.js +1 -1
- package/lib/cjs/appui-react/frontstage/ModalSettingsStage.js.map +1 -1
- package/lib/cjs/appui-react/frontstage/NestedFrontstage.d.ts.map +1 -1
- package/lib/cjs/appui-react/frontstage/NestedFrontstage.js +1 -2
- package/lib/cjs/appui-react/frontstage/NestedFrontstage.js.map +1 -1
- package/lib/cjs/appui-react/hooks/useEscapeSetFocusToHome.js +2 -2
- package/lib/cjs/appui-react/hooks/useEscapeSetFocusToHome.js.map +1 -1
- package/lib/cjs/appui-react/keyboardshortcut/KeyboardShortcut.d.ts.map +1 -1
- package/lib/cjs/appui-react/keyboardshortcut/KeyboardShortcut.js +42 -2
- package/lib/cjs/appui-react/keyboardshortcut/KeyboardShortcut.js.map +1 -1
- package/lib/cjs/appui-react/messages/AppNotificationManager.d.ts +9 -3
- package/lib/cjs/appui-react/messages/AppNotificationManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/messages/AppNotificationManager.js +9 -3
- package/lib/cjs/appui-react/messages/AppNotificationManager.js.map +1 -1
- package/lib/cjs/appui-react/messages/MessageManager.d.ts +10 -0
- package/lib/cjs/appui-react/messages/MessageManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/messages/MessageManager.js +51 -6
- package/lib/cjs/appui-react/messages/MessageManager.js.map +1 -1
- package/lib/cjs/appui-react/navigationaids/SheetNavigationAid.d.ts.map +1 -1
- package/lib/cjs/appui-react/navigationaids/SheetNavigationAid.js +1 -3
- package/lib/cjs/appui-react/navigationaids/SheetNavigationAid.js.map +1 -1
- package/lib/cjs/appui-react/navigationaids/SheetNavigationAid.scss +0 -15
- package/lib/cjs/appui-react/navigationaids/StandardRotationNavigationAid.d.ts.map +1 -1
- package/lib/cjs/appui-react/navigationaids/StandardRotationNavigationAid.js +8 -8
- package/lib/cjs/appui-react/navigationaids/StandardRotationNavigationAid.js.map +1 -1
- package/lib/cjs/appui-react/pickers/ViewSelector.d.ts +1 -1
- package/lib/cjs/appui-react/pickers/ViewSelector.d.ts.map +1 -1
- package/lib/cjs/appui-react/pickers/ViewSelector.js +2 -3
- package/lib/cjs/appui-react/pickers/ViewSelector.js.map +1 -1
- package/lib/cjs/appui-react/popup/CardPopup.d.ts.map +1 -1
- package/lib/cjs/appui-react/popup/CardPopup.js +2 -2
- package/lib/cjs/appui-react/popup/CardPopup.js.map +1 -1
- package/lib/cjs/appui-react/popup/KeyinPalettePanel.d.ts.map +1 -1
- package/lib/cjs/appui-react/popup/KeyinPalettePanel.js +7 -6
- package/lib/cjs/appui-react/popup/KeyinPalettePanel.js.map +1 -1
- package/lib/cjs/appui-react/popup/KeyinPalettePopup.d.ts.map +1 -1
- package/lib/cjs/appui-react/popup/KeyinPalettePopup.js +2 -2
- package/lib/cjs/appui-react/popup/KeyinPalettePopup.js.map +1 -1
- package/lib/cjs/appui-react/popup/ToolSettingsPopup.d.ts.map +1 -1
- package/lib/cjs/appui-react/popup/ToolSettingsPopup.js +2 -2
- package/lib/cjs/appui-react/popup/ToolSettingsPopup.js.map +1 -1
- package/lib/cjs/appui-react/popup/ToolbarPopup.d.ts.map +1 -1
- package/lib/cjs/appui-react/popup/ToolbarPopup.js +2 -2
- package/lib/cjs/appui-react/popup/ToolbarPopup.js.map +1 -1
- package/lib/cjs/appui-react/preview/PreviewFeatures.d.ts +47 -0
- package/lib/cjs/appui-react/preview/PreviewFeatures.d.ts.map +1 -0
- package/lib/cjs/appui-react/preview/PreviewFeatures.js +95 -0
- package/lib/cjs/appui-react/preview/PreviewFeatures.js.map +1 -0
- package/lib/cjs/appui-react/safearea/SafeAreaContext.d.ts +9 -2
- package/lib/cjs/appui-react/safearea/SafeAreaContext.d.ts.map +1 -1
- package/lib/cjs/appui-react/safearea/SafeAreaContext.js +9 -2
- package/lib/cjs/appui-react/safearea/SafeAreaContext.js.map +1 -1
- package/lib/cjs/appui-react/selection/SelectionContextItemDef.d.ts.map +1 -1
- package/lib/cjs/appui-react/selection/SelectionContextItemDef.js +10 -10
- package/lib/cjs/appui-react/selection/SelectionContextItemDef.js.map +1 -1
- package/lib/cjs/appui-react/settings/ui/UiSettingsPage.d.ts +2 -3
- package/lib/cjs/appui-react/settings/ui/UiSettingsPage.d.ts.map +1 -1
- package/lib/cjs/appui-react/settings/ui/UiSettingsPage.js +9 -6
- package/lib/cjs/appui-react/settings/ui/UiSettingsPage.js.map +1 -1
- package/lib/cjs/appui-react/statusbar/StatusBar.d.ts +1 -28
- package/lib/cjs/appui-react/statusbar/StatusBar.d.ts.map +1 -1
- package/lib/cjs/appui-react/statusbar/StatusBar.js +1 -69
- package/lib/cjs/appui-react/statusbar/StatusBar.js.map +1 -1
- package/lib/cjs/appui-react/statusfields/MessageCenter.d.ts.map +1 -1
- package/lib/cjs/appui-react/statusfields/MessageCenter.js +1 -3
- package/lib/cjs/appui-react/statusfields/MessageCenter.js.map +1 -1
- package/lib/cjs/appui-react/statusfields/SectionsField.d.ts.map +1 -1
- package/lib/cjs/appui-react/statusfields/SectionsField.js +1 -3
- package/lib/cjs/appui-react/statusfields/SectionsField.js.map +1 -1
- package/lib/cjs/appui-react/statusfields/SelectionScope.d.ts +4 -7
- package/lib/cjs/appui-react/statusfields/SelectionScope.d.ts.map +1 -1
- package/lib/cjs/appui-react/statusfields/SelectionScope.js +2 -7
- package/lib/cjs/appui-react/statusfields/SelectionScope.js.map +1 -1
- package/lib/cjs/appui-react/statusfields/SnapMode.d.ts.map +1 -1
- package/lib/cjs/appui-react/statusfields/SnapMode.js +8 -10
- package/lib/cjs/appui-react/statusfields/SnapMode.js.map +1 -1
- package/lib/cjs/appui-react/statusfields/toolassistance/ToolAssistanceField.d.ts.map +1 -1
- package/lib/cjs/appui-react/statusfields/toolassistance/ToolAssistanceField.js +8 -4
- package/lib/cjs/appui-react/statusfields/toolassistance/ToolAssistanceField.js.map +1 -1
- package/lib/cjs/appui-react/theme/ThemeManager.d.ts +38 -7
- package/lib/cjs/appui-react/theme/ThemeManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/theme/ThemeManager.js +52 -11
- package/lib/cjs/appui-react/theme/ThemeManager.js.map +1 -1
- package/lib/cjs/appui-react/toolbar/Toolbar.d.ts.map +1 -1
- package/lib/cjs/appui-react/toolbar/Toolbar.js +12 -1
- package/lib/cjs/appui-react/toolbar/Toolbar.js.map +1 -1
- package/lib/cjs/appui-react/toolbar/ToolbarItem.d.ts +21 -0
- package/lib/cjs/appui-react/toolbar/ToolbarItem.d.ts.map +1 -1
- package/lib/cjs/appui-react/toolbar/ToolbarItem.js.map +1 -1
- package/lib/cjs/appui-react/tools/CoreToolDefinitions.d.ts.map +1 -1
- package/lib/cjs/appui-react/tools/CoreToolDefinitions.js +7 -7
- package/lib/cjs/appui-react/tools/CoreToolDefinitions.js.map +1 -1
- package/lib/cjs/appui-react/tools/FrameworkToolAdmin.d.ts +10 -1
- package/lib/cjs/appui-react/tools/FrameworkToolAdmin.d.ts.map +1 -1
- package/lib/cjs/appui-react/tools/FrameworkToolAdmin.js +12 -4
- package/lib/cjs/appui-react/tools/FrameworkToolAdmin.js.map +1 -1
- package/lib/cjs/appui-react/tools/KeyinPaletteTools.d.ts.map +1 -1
- package/lib/cjs/appui-react/tools/KeyinPaletteTools.js +1 -2
- package/lib/cjs/appui-react/tools/KeyinPaletteTools.js.map +1 -1
- package/lib/cjs/appui-react/tools/OpenSettingsTool.d.ts.map +1 -1
- package/lib/cjs/appui-react/tools/OpenSettingsTool.js +1 -2
- package/lib/cjs/appui-react/tools/OpenSettingsTool.js.map +1 -1
- package/lib/cjs/appui-react/tools/RestoreLayoutTool.d.ts.map +1 -1
- package/lib/cjs/appui-react/tools/RestoreLayoutTool.js +2 -3
- package/lib/cjs/appui-react/tools/RestoreLayoutTool.js.map +1 -1
- package/lib/cjs/appui-react/ui-items-provider/AbstractUiItemsManager.d.ts +15 -0
- package/lib/cjs/appui-react/ui-items-provider/AbstractUiItemsManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/ui-items-provider/AbstractUiItemsManager.js +133 -105
- package/lib/cjs/appui-react/ui-items-provider/AbstractUiItemsManager.js.map +1 -1
- package/lib/cjs/appui-react/ui-items-provider/UiItemsManager.d.ts +10 -4
- package/lib/cjs/appui-react/ui-items-provider/UiItemsManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/ui-items-provider/UiItemsManager.js +80 -65
- package/lib/cjs/appui-react/ui-items-provider/UiItemsManager.js.map +1 -1
- package/lib/cjs/appui-react/ui-items-provider/UiItemsProvider.d.ts +30 -4
- package/lib/cjs/appui-react/ui-items-provider/UiItemsProvider.d.ts.map +1 -1
- package/lib/cjs/appui-react/ui-items-provider/UiItemsProvider.js.map +1 -1
- package/lib/cjs/appui-react/uiadmin/FrameworkUiAdmin.d.ts +11 -2
- package/lib/cjs/appui-react/uiadmin/FrameworkUiAdmin.d.ts.map +1 -1
- package/lib/cjs/appui-react/uiadmin/FrameworkUiAdmin.js +9 -1
- package/lib/cjs/appui-react/uiadmin/FrameworkUiAdmin.js.map +1 -1
- package/lib/cjs/appui-react/uistate/AppUiSettings.d.ts +5 -4
- package/lib/cjs/appui-react/uistate/AppUiSettings.d.ts.map +1 -1
- package/lib/cjs/appui-react/uistate/AppUiSettings.js +2 -2
- package/lib/cjs/appui-react/uistate/AppUiSettings.js.map +1 -1
- package/lib/cjs/appui-react/uistate/useUiStateStorage.d.ts +10 -1
- package/lib/cjs/appui-react/uistate/useUiStateStorage.d.ts.map +1 -1
- package/lib/cjs/appui-react/uistate/useUiStateStorage.js +10 -1
- package/lib/cjs/appui-react/uistate/useUiStateStorage.js.map +1 -1
- package/lib/cjs/appui-react/utils/matchesWords.d.ts +22 -0
- package/lib/cjs/appui-react/utils/matchesWords.d.ts.map +1 -0
- package/lib/cjs/appui-react/utils/matchesWords.js +103 -0
- package/lib/cjs/appui-react/utils/matchesWords.js.map +1 -0
- package/lib/cjs/appui-react/widget-panels/Frontstage.d.ts.map +1 -1
- package/lib/cjs/appui-react/widget-panels/Frontstage.js +42 -9
- package/lib/cjs/appui-react/widget-panels/Frontstage.js.map +1 -1
- package/lib/cjs/appui-react/widget-panels/Frontstage.scss +19 -0
- package/lib/cjs/appui-react/widget-panels/ToolSettings.d.ts +4 -1
- package/lib/cjs/appui-react/widget-panels/ToolSettings.d.ts.map +1 -1
- package/lib/cjs/appui-react/widget-panels/ToolSettings.js +34 -12
- package/lib/cjs/appui-react/widget-panels/ToolSettings.js.map +1 -1
- package/lib/cjs/appui-react/widgets/BackstageAppButton.d.ts.map +1 -1
- package/lib/cjs/appui-react/widgets/BackstageAppButton.js +2 -7
- package/lib/cjs/appui-react/widgets/BackstageAppButton.js.map +1 -1
- package/lib/cjs/appui-react/widgets/Widget.d.ts +23 -1
- package/lib/cjs/appui-react/widgets/Widget.d.ts.map +1 -1
- package/lib/cjs/appui-react/widgets/Widget.js.map +1 -1
- package/lib/cjs/appui-react/widgets/WidgetDef.d.ts.map +1 -1
- package/lib/cjs/appui-react/widgets/WidgetDef.js +1 -0
- package/lib/cjs/appui-react/widgets/WidgetDef.js.map +1 -1
- package/lib/cjs/appui-react.d.ts +1 -0
- package/lib/cjs/appui-react.d.ts.map +1 -1
- package/lib/cjs/appui-react.js +3 -0
- package/lib/cjs/appui-react.js.map +1 -1
- package/lib/esm/appui-react/UiFramework.d.ts +29 -14
- package/lib/esm/appui-react/UiFramework.d.ts.map +1 -1
- package/lib/esm/appui-react/UiFramework.js +29 -16
- package/lib/esm/appui-react/UiFramework.js.map +1 -1
- package/lib/esm/appui-react/accudraw/AccuDrawFieldContainer.d.ts.map +1 -1
- package/lib/esm/appui-react/accudraw/AccuDrawFieldContainer.js +4 -7
- package/lib/esm/appui-react/accudraw/AccuDrawFieldContainer.js.map +1 -1
- package/lib/esm/appui-react/accudraw/AccuDrawInputField.d.ts.map +1 -1
- package/lib/esm/appui-react/accudraw/AccuDrawInputField.js +3 -3
- package/lib/esm/appui-react/accudraw/AccuDrawInputField.js.map +1 -1
- package/lib/esm/appui-react/accudraw/AccuDrawKeyboardShortcuts.d.ts +8 -0
- package/lib/esm/appui-react/accudraw/AccuDrawKeyboardShortcuts.d.ts.map +1 -1
- package/lib/esm/appui-react/accudraw/AccuDrawKeyboardShortcuts.js +8 -0
- package/lib/esm/appui-react/accudraw/AccuDrawKeyboardShortcuts.js.map +1 -1
- package/lib/esm/appui-react/accudraw/AccuDrawPopupManager.d.ts.map +1 -1
- package/lib/esm/appui-react/accudraw/AccuDrawPopupManager.js +3 -4
- package/lib/esm/appui-react/accudraw/AccuDrawPopupManager.js.map +1 -1
- package/lib/esm/appui-react/accudraw/Calculator.d.ts.map +1 -1
- package/lib/esm/appui-react/accudraw/Calculator.js +11 -12
- package/lib/esm/appui-react/accudraw/Calculator.js.map +1 -1
- package/lib/esm/appui-react/accudraw/FrameworkAccuDraw.d.ts +9 -1
- package/lib/esm/appui-react/accudraw/FrameworkAccuDraw.d.ts.map +1 -1
- package/lib/esm/appui-react/accudraw/FrameworkAccuDraw.js +9 -1
- package/lib/esm/appui-react/accudraw/FrameworkAccuDraw.js.map +1 -1
- package/lib/esm/appui-react/childwindow/InternalChildWindowManager.d.ts +2 -2
- package/lib/esm/appui-react/childwindow/InternalChildWindowManager.d.ts.map +1 -1
- package/lib/esm/appui-react/childwindow/InternalChildWindowManager.js +16 -11
- package/lib/esm/appui-react/childwindow/InternalChildWindowManager.js.map +1 -1
- package/lib/esm/appui-react/childwindow/PopoutWidget.d.ts +2 -4
- package/lib/esm/appui-react/childwindow/PopoutWidget.d.ts.map +1 -1
- package/lib/esm/appui-react/childwindow/PopoutWidget.js +6 -3
- package/lib/esm/appui-react/childwindow/PopoutWidget.js.map +1 -1
- package/lib/esm/appui-react/configurableui/ConfigurableUiContent.d.ts.map +1 -1
- package/lib/esm/appui-react/configurableui/ConfigurableUiContent.js +3 -1
- package/lib/esm/appui-react/configurableui/ConfigurableUiContent.js.map +1 -1
- package/lib/esm/appui-react/configurableui/state.d.ts.map +1 -1
- package/lib/esm/appui-react/configurableui/state.js +5 -2
- package/lib/esm/appui-react/configurableui/state.js.map +1 -1
- package/lib/esm/appui-react/content/FloatingViewportContent.d.ts.map +1 -1
- package/lib/esm/appui-react/content/FloatingViewportContent.js +1 -2
- package/lib/esm/appui-react/content/FloatingViewportContent.js.map +1 -1
- package/lib/esm/appui-react/content/IModelViewport.d.ts.map +1 -1
- package/lib/esm/appui-react/content/IModelViewport.js +2 -0
- package/lib/esm/appui-react/content/IModelViewport.js.map +1 -1
- package/lib/esm/appui-react/feedback/ValidationTextbox.js +3 -3
- package/lib/esm/appui-react/feedback/ValidationTextbox.js.map +1 -1
- package/lib/esm/appui-react/framework/FrameworkKeyboardShortcuts.d.ts +2 -2
- package/lib/esm/appui-react/framework/FrameworkKeyboardShortcuts.d.ts.map +1 -1
- package/lib/esm/appui-react/framework/FrameworkKeyboardShortcuts.js.map +1 -1
- package/lib/esm/appui-react/frontstage/FrontstageDef.d.ts +6 -8
- package/lib/esm/appui-react/frontstage/FrontstageDef.d.ts.map +1 -1
- package/lib/esm/appui-react/frontstage/FrontstageDef.js +27 -17
- package/lib/esm/appui-react/frontstage/FrontstageDef.js.map +1 -1
- package/lib/esm/appui-react/frontstage/ModalSettingsStage.d.ts.map +1 -1
- package/lib/esm/appui-react/frontstage/ModalSettingsStage.js +2 -2
- package/lib/esm/appui-react/frontstage/ModalSettingsStage.js.map +1 -1
- package/lib/esm/appui-react/frontstage/NestedFrontstage.d.ts.map +1 -1
- package/lib/esm/appui-react/frontstage/NestedFrontstage.js +1 -2
- package/lib/esm/appui-react/frontstage/NestedFrontstage.js.map +1 -1
- package/lib/esm/appui-react/hooks/useEscapeSetFocusToHome.js +2 -2
- package/lib/esm/appui-react/hooks/useEscapeSetFocusToHome.js.map +1 -1
- package/lib/esm/appui-react/keyboardshortcut/KeyboardShortcut.d.ts.map +1 -1
- package/lib/esm/appui-react/keyboardshortcut/KeyboardShortcut.js +41 -1
- package/lib/esm/appui-react/keyboardshortcut/KeyboardShortcut.js.map +1 -1
- package/lib/esm/appui-react/messages/AppNotificationManager.d.ts +9 -3
- package/lib/esm/appui-react/messages/AppNotificationManager.d.ts.map +1 -1
- package/lib/esm/appui-react/messages/AppNotificationManager.js +9 -3
- package/lib/esm/appui-react/messages/AppNotificationManager.js.map +1 -1
- package/lib/esm/appui-react/messages/MessageManager.d.ts +10 -0
- package/lib/esm/appui-react/messages/MessageManager.d.ts.map +1 -1
- package/lib/esm/appui-react/messages/MessageManager.js +52 -7
- package/lib/esm/appui-react/messages/MessageManager.js.map +1 -1
- package/lib/esm/appui-react/navigationaids/SheetNavigationAid.d.ts.map +1 -1
- package/lib/esm/appui-react/navigationaids/SheetNavigationAid.js +1 -3
- package/lib/esm/appui-react/navigationaids/SheetNavigationAid.js.map +1 -1
- package/lib/esm/appui-react/navigationaids/SheetNavigationAid.scss +0 -15
- package/lib/esm/appui-react/navigationaids/StandardRotationNavigationAid.d.ts.map +1 -1
- package/lib/esm/appui-react/navigationaids/StandardRotationNavigationAid.js +9 -9
- package/lib/esm/appui-react/navigationaids/StandardRotationNavigationAid.js.map +1 -1
- package/lib/esm/appui-react/pickers/ViewSelector.d.ts +1 -1
- package/lib/esm/appui-react/pickers/ViewSelector.d.ts.map +1 -1
- package/lib/esm/appui-react/pickers/ViewSelector.js +2 -3
- package/lib/esm/appui-react/pickers/ViewSelector.js.map +1 -1
- package/lib/esm/appui-react/popup/CardPopup.d.ts.map +1 -1
- package/lib/esm/appui-react/popup/CardPopup.js +2 -2
- package/lib/esm/appui-react/popup/CardPopup.js.map +1 -1
- package/lib/esm/appui-react/popup/KeyinPalettePanel.d.ts.map +1 -1
- package/lib/esm/appui-react/popup/KeyinPalettePanel.js +6 -5
- package/lib/esm/appui-react/popup/KeyinPalettePanel.js.map +1 -1
- package/lib/esm/appui-react/popup/KeyinPalettePopup.d.ts.map +1 -1
- package/lib/esm/appui-react/popup/KeyinPalettePopup.js +2 -2
- package/lib/esm/appui-react/popup/KeyinPalettePopup.js.map +1 -1
- package/lib/esm/appui-react/popup/ToolSettingsPopup.d.ts.map +1 -1
- package/lib/esm/appui-react/popup/ToolSettingsPopup.js +2 -2
- package/lib/esm/appui-react/popup/ToolSettingsPopup.js.map +1 -1
- package/lib/esm/appui-react/popup/ToolbarPopup.d.ts.map +1 -1
- package/lib/esm/appui-react/popup/ToolbarPopup.js +2 -2
- package/lib/esm/appui-react/popup/ToolbarPopup.js.map +1 -1
- package/lib/esm/appui-react/preview/PreviewFeatures.d.ts +47 -0
- package/lib/esm/appui-react/preview/PreviewFeatures.d.ts.map +1 -0
- package/lib/esm/appui-react/preview/PreviewFeatures.js +90 -0
- package/lib/esm/appui-react/preview/PreviewFeatures.js.map +1 -0
- package/lib/esm/appui-react/safearea/SafeAreaContext.d.ts +9 -2
- package/lib/esm/appui-react/safearea/SafeAreaContext.d.ts.map +1 -1
- package/lib/esm/appui-react/safearea/SafeAreaContext.js +9 -2
- package/lib/esm/appui-react/safearea/SafeAreaContext.js.map +1 -1
- package/lib/esm/appui-react/selection/SelectionContextItemDef.d.ts.map +1 -1
- package/lib/esm/appui-react/selection/SelectionContextItemDef.js +11 -11
- package/lib/esm/appui-react/selection/SelectionContextItemDef.js.map +1 -1
- package/lib/esm/appui-react/settings/ui/UiSettingsPage.d.ts +2 -3
- package/lib/esm/appui-react/settings/ui/UiSettingsPage.d.ts.map +1 -1
- package/lib/esm/appui-react/settings/ui/UiSettingsPage.js +9 -6
- package/lib/esm/appui-react/settings/ui/UiSettingsPage.js.map +1 -1
- package/lib/esm/appui-react/statusbar/StatusBar.d.ts +1 -28
- package/lib/esm/appui-react/statusbar/StatusBar.d.ts.map +1 -1
- package/lib/esm/appui-react/statusbar/StatusBar.js +1 -69
- package/lib/esm/appui-react/statusbar/StatusBar.js.map +1 -1
- package/lib/esm/appui-react/statusfields/MessageCenter.d.ts.map +1 -1
- package/lib/esm/appui-react/statusfields/MessageCenter.js +2 -4
- package/lib/esm/appui-react/statusfields/MessageCenter.js.map +1 -1
- package/lib/esm/appui-react/statusfields/SectionsField.d.ts.map +1 -1
- package/lib/esm/appui-react/statusfields/SectionsField.js +1 -3
- package/lib/esm/appui-react/statusfields/SectionsField.js.map +1 -1
- package/lib/esm/appui-react/statusfields/SelectionScope.d.ts +4 -7
- package/lib/esm/appui-react/statusfields/SelectionScope.d.ts.map +1 -1
- package/lib/esm/appui-react/statusfields/SelectionScope.js +2 -7
- package/lib/esm/appui-react/statusfields/SelectionScope.js.map +1 -1
- package/lib/esm/appui-react/statusfields/SnapMode.d.ts.map +1 -1
- package/lib/esm/appui-react/statusfields/SnapMode.js +8 -10
- package/lib/esm/appui-react/statusfields/SnapMode.js.map +1 -1
- package/lib/esm/appui-react/statusfields/toolassistance/ToolAssistanceField.d.ts.map +1 -1
- package/lib/esm/appui-react/statusfields/toolassistance/ToolAssistanceField.js +8 -4
- package/lib/esm/appui-react/statusfields/toolassistance/ToolAssistanceField.js.map +1 -1
- package/lib/esm/appui-react/theme/ThemeManager.d.ts +38 -7
- package/lib/esm/appui-react/theme/ThemeManager.d.ts.map +1 -1
- package/lib/esm/appui-react/theme/ThemeManager.js +51 -10
- package/lib/esm/appui-react/theme/ThemeManager.js.map +1 -1
- package/lib/esm/appui-react/toolbar/Toolbar.d.ts.map +1 -1
- package/lib/esm/appui-react/toolbar/Toolbar.js +11 -0
- package/lib/esm/appui-react/toolbar/Toolbar.js.map +1 -1
- package/lib/esm/appui-react/toolbar/ToolbarItem.d.ts +21 -0
- package/lib/esm/appui-react/toolbar/ToolbarItem.d.ts.map +1 -1
- package/lib/esm/appui-react/toolbar/ToolbarItem.js.map +1 -1
- package/lib/esm/appui-react/tools/CoreToolDefinitions.d.ts.map +1 -1
- package/lib/esm/appui-react/tools/CoreToolDefinitions.js +8 -8
- package/lib/esm/appui-react/tools/CoreToolDefinitions.js.map +1 -1
- package/lib/esm/appui-react/tools/FrameworkToolAdmin.d.ts +10 -1
- package/lib/esm/appui-react/tools/FrameworkToolAdmin.d.ts.map +1 -1
- package/lib/esm/appui-react/tools/FrameworkToolAdmin.js +12 -4
- package/lib/esm/appui-react/tools/FrameworkToolAdmin.js.map +1 -1
- package/lib/esm/appui-react/tools/KeyinPaletteTools.d.ts.map +1 -1
- package/lib/esm/appui-react/tools/KeyinPaletteTools.js +1 -2
- package/lib/esm/appui-react/tools/KeyinPaletteTools.js.map +1 -1
- package/lib/esm/appui-react/tools/OpenSettingsTool.d.ts.map +1 -1
- package/lib/esm/appui-react/tools/OpenSettingsTool.js +1 -2
- package/lib/esm/appui-react/tools/OpenSettingsTool.js.map +1 -1
- package/lib/esm/appui-react/tools/RestoreLayoutTool.d.ts.map +1 -1
- package/lib/esm/appui-react/tools/RestoreLayoutTool.js +2 -3
- package/lib/esm/appui-react/tools/RestoreLayoutTool.js.map +1 -1
- package/lib/esm/appui-react/ui-items-provider/AbstractUiItemsManager.d.ts +15 -0
- package/lib/esm/appui-react/ui-items-provider/AbstractUiItemsManager.d.ts.map +1 -1
- package/lib/esm/appui-react/ui-items-provider/AbstractUiItemsManager.js +131 -104
- package/lib/esm/appui-react/ui-items-provider/AbstractUiItemsManager.js.map +1 -1
- package/lib/esm/appui-react/ui-items-provider/UiItemsManager.d.ts +10 -4
- package/lib/esm/appui-react/ui-items-provider/UiItemsManager.d.ts.map +1 -1
- package/lib/esm/appui-react/ui-items-provider/UiItemsManager.js +81 -66
- package/lib/esm/appui-react/ui-items-provider/UiItemsManager.js.map +1 -1
- package/lib/esm/appui-react/ui-items-provider/UiItemsProvider.d.ts +30 -4
- package/lib/esm/appui-react/ui-items-provider/UiItemsProvider.d.ts.map +1 -1
- package/lib/esm/appui-react/ui-items-provider/UiItemsProvider.js.map +1 -1
- package/lib/esm/appui-react/uiadmin/FrameworkUiAdmin.d.ts +11 -2
- package/lib/esm/appui-react/uiadmin/FrameworkUiAdmin.d.ts.map +1 -1
- package/lib/esm/appui-react/uiadmin/FrameworkUiAdmin.js +9 -1
- package/lib/esm/appui-react/uiadmin/FrameworkUiAdmin.js.map +1 -1
- package/lib/esm/appui-react/uistate/AppUiSettings.d.ts +5 -4
- package/lib/esm/appui-react/uistate/AppUiSettings.d.ts.map +1 -1
- package/lib/esm/appui-react/uistate/AppUiSettings.js +2 -2
- package/lib/esm/appui-react/uistate/AppUiSettings.js.map +1 -1
- package/lib/esm/appui-react/uistate/useUiStateStorage.d.ts +10 -1
- package/lib/esm/appui-react/uistate/useUiStateStorage.d.ts.map +1 -1
- package/lib/esm/appui-react/uistate/useUiStateStorage.js +10 -1
- package/lib/esm/appui-react/uistate/useUiStateStorage.js.map +1 -1
- package/lib/esm/appui-react/utils/matchesWords.d.ts +22 -0
- package/lib/esm/appui-react/utils/matchesWords.d.ts.map +1 -0
- package/lib/esm/appui-react/utils/matchesWords.js +99 -0
- package/lib/esm/appui-react/utils/matchesWords.js.map +1 -0
- package/lib/esm/appui-react/widget-panels/Frontstage.d.ts.map +1 -1
- package/lib/esm/appui-react/widget-panels/Frontstage.js +44 -11
- package/lib/esm/appui-react/widget-panels/Frontstage.js.map +1 -1
- package/lib/esm/appui-react/widget-panels/Frontstage.scss +19 -0
- package/lib/esm/appui-react/widget-panels/ToolSettings.d.ts +4 -1
- package/lib/esm/appui-react/widget-panels/ToolSettings.d.ts.map +1 -1
- package/lib/esm/appui-react/widget-panels/ToolSettings.js +32 -11
- package/lib/esm/appui-react/widget-panels/ToolSettings.js.map +1 -1
- package/lib/esm/appui-react/widgets/BackstageAppButton.d.ts.map +1 -1
- package/lib/esm/appui-react/widgets/BackstageAppButton.js +2 -7
- package/lib/esm/appui-react/widgets/BackstageAppButton.js.map +1 -1
- package/lib/esm/appui-react/widgets/Widget.d.ts +23 -1
- package/lib/esm/appui-react/widgets/Widget.d.ts.map +1 -1
- package/lib/esm/appui-react/widgets/Widget.js.map +1 -1
- package/lib/esm/appui-react/widgets/WidgetDef.d.ts.map +1 -1
- package/lib/esm/appui-react/widgets/WidgetDef.js +1 -0
- package/lib/esm/appui-react/widgets/WidgetDef.js.map +1 -1
- package/lib/esm/appui-react.d.ts +1 -0
- package/lib/esm/appui-react.d.ts.map +1 -1
- package/lib/esm/appui-react.js +1 -0
- package/lib/esm/appui-react.js.map +1 -1
- package/lib/public/locales/en/UiFramework.json +6 -4
- package/package.json +13 -11
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.ToolbarPopup = void 0;
|
|
11
11
|
const React = require("react");
|
|
12
|
-
const
|
|
12
|
+
const ts_key_enum_1 = require("ts-key-enum");
|
|
13
13
|
const core_react_1 = require("@itwin/core-react");
|
|
14
14
|
const components_react_1 = require("@itwin/components-react");
|
|
15
15
|
const CursorPopup_1 = require("../cursor/cursorpopup/CursorPopup");
|
|
@@ -33,7 +33,7 @@ class ToolbarPopup extends React.PureComponent {
|
|
|
33
33
|
};
|
|
34
34
|
this._handleKeyDown = (event) => {
|
|
35
35
|
switch (event.key) {
|
|
36
|
-
case
|
|
36
|
+
case ts_key_enum_1.Key.Escape:
|
|
37
37
|
this._cancel();
|
|
38
38
|
break;
|
|
39
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolbarPopup.js","sourceRoot":"","sources":["../../../../src/appui-react/popup/ToolbarPopup.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B;
|
|
1
|
+
{"version":3,"file":"ToolbarPopup.js","sourceRoot":"","sources":["../../../../src/appui-react/popup/ToolbarPopup.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B;AAC/B,6CAAkC;AAOlC,kDAAgF;AAChF,8DAIiC;AACjC,mEAAgE;AAEhE,iDAA8C;AAC9C,mDAAgD;AAEhD,gDAA6C;AAiB7C;;GAEG;AACH,MAAa,YAAa,SAAQ,KA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,6BAAa,IACZ,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,EAClB,SAAS,EAAC,gBAAgB,EAC1B,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,IAAI,CAAC,YAAY;YAE9B,oBAAC,gCAAmB,IAClB,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EACnC,SAAS,EAAE,IAAI,CAAC,cAAc;gBAE9B,oBAAC,sBAAS,IAAC,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,IAAI;oBACpD,oBAAC,iBAAO,IACN,SAAS,EAAE,4BAAS,CAAC,MAAM,EAC3B,cAAc,EAAE,wCAAqB,CAAC,KAAK,EAC3C,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,kBAAkB,EAAE,IAAI,EACxB,qBAAqB,EAAE,wCAAqB,CAAC,QAAQ,EACrD,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,GACzC,CACQ,CACQ,CACR,CACjB,CAAC;IACJ,CAAC;CACF;AAvED,oCAuEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Popup\n */\n\nimport * as React from \"react\";\nimport { Key } from \"ts-key-enum\";\nimport type {\n OnCancelFunc,\n OnItemExecutedFunc,\n RelativePosition,\n} from \"@itwin/appui-abstract\";\nimport type { Orientation, SizeProps } from \"@itwin/core-react\";\nimport { DivWithOutsideClick, FocusTrap, Point, Size } from \"@itwin/core-react\";\nimport {\n Direction,\n ToolbarOpacitySetting,\n ToolbarPanelAlignment,\n} from \"@itwin/components-react\";\nimport { CursorPopup } from \"../cursor/cursorpopup/CursorPopup\";\nimport type { PopupPropsBase } from \"./PopupManager\";\nimport { PopupManager } from \"./PopupManager\";\nimport { PositionPopup } from \"./PositionPopup\";\nimport type { ToolbarItem } from \"../toolbar/ToolbarItem\";\nimport { Toolbar } from \"../toolbar/Toolbar\";\n\n/** Props for a popup toolbar\n * @beta */\nexport interface ToolbarPopupProps extends PopupPropsBase {\n items: ToolbarItem[];\n relativePosition: RelativePosition;\n orientation: Orientation;\n onCancel: OnCancelFunc;\n onItemExecuted: OnItemExecutedFunc;\n}\n\n/** @internal */\ninterface ToolbarPopupState {\n size: Size;\n}\n\n/** Popup component for Toolbar\n * @beta\n */\nexport class ToolbarPopup extends React.PureComponent<\n ToolbarPopupProps,\n ToolbarPopupState\n> {\n /** @internal */\n public override readonly state = {\n size: new Size(-1, -1),\n };\n\n private _onSizeKnown = (newSize: SizeProps) => {\n // istanbul ignore else\n if (!this.state.size.equals(newSize))\n this.setState({ size: Size.create(newSize) });\n };\n\n private _handleKeyDown = (\n event: React.KeyboardEvent<HTMLDivElement>\n ): void => {\n switch (event.key) {\n case Key.Escape:\n this._cancel();\n break;\n }\n };\n\n private _cancel() {\n // istanbul ignore else\n if (this.props.onCancel) {\n this.props.onCancel();\n }\n }\n\n public override render() {\n let point = PopupManager.getPopupPosition(\n this.props.el,\n this.props.pt,\n new Point(),\n this.state.size\n );\n const popupRect = CursorPopup.getPopupRect(\n point,\n this.props.offset,\n this.state.size,\n this.props.relativePosition\n );\n point = new Point(popupRect.left, popupRect.top);\n return (\n <PositionPopup\n key={this.props.id}\n className=\"uifw-no-border\"\n point={point}\n onSizeKnown={this._onSizeKnown}\n >\n <DivWithOutsideClick\n onOutsideClick={this.props.onCancel}\n onKeyDown={this._handleKeyDown}\n >\n <FocusTrap active={true} returnFocusOnDeactivate={true}>\n <Toolbar\n expandsTo={Direction.Bottom}\n panelAlignment={ToolbarPanelAlignment.Start}\n items={this.props.items}\n useDragInteraction={true}\n toolbarOpacitySetting={ToolbarOpacitySetting.Defaults}\n onItemExecuted={this.props.onItemExecuted}\n />\n </FocusTrap>\n </DivWithOutsideClick>\n </PositionPopup>\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Utilities
|
|
3
|
+
*/
|
|
4
|
+
import { type KnownPreviewLayoutFeatures } from "@itwin/appui-layout-react";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
/** List of known preview features. */
|
|
7
|
+
interface KnownPreviewFeatures extends KnownPreviewLayoutFeatures {
|
|
8
|
+
}
|
|
9
|
+
/** List of preview features that can be enabled/disabled.
|
|
10
|
+
* This list is expected to change over time, the interface is made
|
|
11
|
+
* so that new features can be added or removed without breaking existing code.
|
|
12
|
+
* A console warning will simply appear if unknown features are passed.
|
|
13
|
+
* @beta
|
|
14
|
+
*/
|
|
15
|
+
export interface PreviewFeatures extends Partial<KnownPreviewFeatures> {
|
|
16
|
+
[featureName: string]: any;
|
|
17
|
+
}
|
|
18
|
+
/** Hook to access the preview features set.
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export declare function usePreviewFeatures(): PreviewFeatures;
|
|
22
|
+
/** Props for PreviewFeaturesProvider.
|
|
23
|
+
* @beta
|
|
24
|
+
*/
|
|
25
|
+
export interface PreviewFeaturesProviderProps {
|
|
26
|
+
children?: React.ReactNode;
|
|
27
|
+
features?: PreviewFeatures;
|
|
28
|
+
}
|
|
29
|
+
/** Set which preview features are enabled. These features are not yet ready for production use nor have
|
|
30
|
+
* a proper API defined yet.
|
|
31
|
+
* The available set of features are defined in the [[PreviewFeatures]] interface.
|
|
32
|
+
*
|
|
33
|
+
* This component should wrap the Provider component.
|
|
34
|
+
*
|
|
35
|
+
* ```tsx
|
|
36
|
+
* <PreviewFeaturesProvider features={{ enableMaximizedFloatingWidget: true }}>
|
|
37
|
+
* <Provider store={UiFramework.store}>
|
|
38
|
+
* [...]
|
|
39
|
+
* <ConfigurableUIContent />
|
|
40
|
+
* [/...]
|
|
41
|
+
* </Provider>
|
|
42
|
+
* </PreviewFeaturesProvider>
|
|
43
|
+
* @beta
|
|
44
|
+
*/
|
|
45
|
+
export declare function PreviewFeaturesProvider({ children, features, }: PreviewFeaturesProviderProps): JSX.Element;
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=PreviewFeatures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PreviewFeatures.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/preview/PreviewFeatures.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,sCAAsC;AAEtC,UAAU,oBAAqB,SAAQ,0BAA0B;CAEhE;AAWD;;;;;GAKG;AACH,MAAM,WAAW,eAAgB,SAAQ,OAAO,CAAC,oBAAoB,CAAC;IACpE,CAAC,WAAW,EAAE,MAAM,GAAG,GAAG,CAAC;CAC5B;AAwDD;;GAEG;AACH,wBAAgB,kBAAkB,oBAEjC;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,eAAe,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,QAAQ,EACR,QAAQ,GACT,EAAE,4BAA4B,eAgB9B"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
/** @packageDocumentation
|
|
7
|
+
* @module Utilities
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.PreviewFeaturesProvider = exports.usePreviewFeatures = void 0;
|
|
11
|
+
const React = require("react");
|
|
12
|
+
const zustand_1 = require("zustand");
|
|
13
|
+
/** Object used trim to only known features at runtime.
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
const knownFeaturesObject = {
|
|
17
|
+
contentAlwaysMaxSize: undefined,
|
|
18
|
+
enableMaximizedFloatingWidget: undefined,
|
|
19
|
+
...{ newToolbars: undefined }, // Hidden feature used in storybook only (to avoid trimming).
|
|
20
|
+
};
|
|
21
|
+
/** Trim an object to only contain known feature keys.
|
|
22
|
+
* @param previewFeatures object potentially containing unknown features
|
|
23
|
+
* @returns object containing only known features
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
function trimToKnownFeaturesOnly(previewFeatures) {
|
|
27
|
+
const knownFeatureKeys = Object.keys(knownFeaturesObject);
|
|
28
|
+
const [knownFeatures, unknownFeatures] = Object.entries(previewFeatures).reduce(([known, unknown], [key, value]) => {
|
|
29
|
+
if (knownFeatureKeys.includes(key)) {
|
|
30
|
+
known[key] = value;
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
unknown.push(key);
|
|
34
|
+
}
|
|
35
|
+
return [known, unknown];
|
|
36
|
+
}, [{}, []]);
|
|
37
|
+
if (Object.keys(unknownFeatures).length > 0 &&
|
|
38
|
+
process.env.NODE_ENV === "development") {
|
|
39
|
+
// eslint-disable-next-line no-console
|
|
40
|
+
console.warn(`The following features used in "setPreviewFeatures" are unknown or no longer in preview: [${unknownFeatures.toString()}]
|
|
41
|
+
Here is the list of currently known features: [${knownFeatureKeys.toString()}]`);
|
|
42
|
+
}
|
|
43
|
+
return knownFeatures;
|
|
44
|
+
}
|
|
45
|
+
/** Preview features store used by `UiFramework.previewFeatures` and `UiFramework.setPreviewFeatures()` APIs to manage the preview features.
|
|
46
|
+
* Use `usePreviewFeatures` hook to access the preview features set from a react component.
|
|
47
|
+
* Use `usePreviewFeaturesStore.getState().previewFeatures` to access the preview features set from a non-react component.
|
|
48
|
+
* Use `usePreviewFeaturesStore.subscribe()` to subscribe to changes to the preview features set from a non-react component.
|
|
49
|
+
* @internal
|
|
50
|
+
*/
|
|
51
|
+
const usePreviewFeaturesStore = (0, zustand_1.create)((set) => {
|
|
52
|
+
return {
|
|
53
|
+
previewFeatures: {},
|
|
54
|
+
setPreviewFeatures: (newPreviewFeatures) => {
|
|
55
|
+
const previewFeatures = trimToKnownFeaturesOnly(newPreviewFeatures);
|
|
56
|
+
set({ previewFeatures });
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
});
|
|
60
|
+
/** Hook to access the preview features set.
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
63
|
+
function usePreviewFeatures() {
|
|
64
|
+
return usePreviewFeaturesStore((state) => state.previewFeatures);
|
|
65
|
+
}
|
|
66
|
+
exports.usePreviewFeatures = usePreviewFeatures;
|
|
67
|
+
/** Set which preview features are enabled. These features are not yet ready for production use nor have
|
|
68
|
+
* a proper API defined yet.
|
|
69
|
+
* The available set of features are defined in the [[PreviewFeatures]] interface.
|
|
70
|
+
*
|
|
71
|
+
* This component should wrap the Provider component.
|
|
72
|
+
*
|
|
73
|
+
* ```tsx
|
|
74
|
+
* <PreviewFeaturesProvider features={{ enableMaximizedFloatingWidget: true }}>
|
|
75
|
+
* <Provider store={UiFramework.store}>
|
|
76
|
+
* [...]
|
|
77
|
+
* <ConfigurableUIContent />
|
|
78
|
+
* [/...]
|
|
79
|
+
* </Provider>
|
|
80
|
+
* </PreviewFeaturesProvider>
|
|
81
|
+
* @beta
|
|
82
|
+
*/
|
|
83
|
+
function PreviewFeaturesProvider({ children, features, }) {
|
|
84
|
+
const setPreviewFeatures = usePreviewFeaturesStore((state) => state.setPreviewFeatures);
|
|
85
|
+
React.useEffect(() => {
|
|
86
|
+
setPreviewFeatures(features ?? {});
|
|
87
|
+
}, [features, setPreviewFeatures]);
|
|
88
|
+
// Clear preview features when unmounting.
|
|
89
|
+
React.useEffect(() => () => {
|
|
90
|
+
setPreviewFeatures({});
|
|
91
|
+
}, [setPreviewFeatures]);
|
|
92
|
+
return React.createElement(React.Fragment, null, children);
|
|
93
|
+
}
|
|
94
|
+
exports.PreviewFeaturesProvider = PreviewFeaturesProvider;
|
|
95
|
+
//# sourceMappingURL=PreviewFeatures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PreviewFeatures.js","sourceRoot":"","sources":["../../../../src/appui-react/preview/PreviewFeatures.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAGH,+BAA+B;AAC/B,qCAAiC;AAQjC;;GAEG;AACH,MAAM,mBAAmB,GAAkD;IACzE,oBAAoB,EAAE,SAAS;IAC/B,6BAA6B,EAAE,SAAS;IACxC,GAAG,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE,6DAA6D;CAC7F,CAAC;AAYF;;;;GAIG;AACH,SAAS,uBAAuB,CAAC,eAAgC;IAC/D,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAC1D,MAAM,CAAC,aAAa,EAAE,eAAe,CAAC,GAAG,MAAM,CAAC,OAAO,CACrD,eAAe,CAChB,CAAC,MAAM,CACN,CAAC,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACjC,IAAI,gBAAgB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YAClC,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;SACpB;aAAM;YACL,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACnB;QACD,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAC1B,CAAC,EACD,CAAC,EAAE,EAAE,EAAE,CAAgC,CACxC,CAAC;IACF,IACE,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,MAAM,GAAG,CAAC;QACvC,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,EACtC;QACA,sCAAsC;QACtC,OAAO,CAAC,IAAI,CACV,6FAA6F,eAAe,CAAC,QAAQ,EAAE;uDACtE,gBAAgB,CAAC,QAAQ,EAAE,GAAG,CAChF,CAAC;KACH;IACD,OAAO,aAAa,CAAC;AACvB,CAAC;AAOD;;;;;GAKG;AACH,MAAM,uBAAuB,GAAG,IAAA,gBAAM,EAAuB,CAAC,GAAG,EAAE,EAAE;IACnE,OAAO;QACL,eAAe,EAAE,EAAE;QACnB,kBAAkB,EAAE,CAAC,kBAAmC,EAAE,EAAE;YAC1D,MAAM,eAAe,GAAG,uBAAuB,CAAC,kBAAkB,CAAC,CAAC;YACpE,GAAG,CAAC,EAAE,eAAe,EAAE,CAAC,CAAC;QAC3B,CAAC;KACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH;;GAEG;AACH,SAAgB,kBAAkB;IAChC,OAAO,uBAAuB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;AACnE,CAAC;AAFD,gDAEC;AAUD;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,uBAAuB,CAAC,EACtC,QAAQ,EACR,QAAQ,GACqB;IAC7B,MAAM,kBAAkB,GAAG,uBAAuB,CAChD,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,kBAAkB,CACpC,CAAC;IACF,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,kBAAkB,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;IACrC,CAAC,EAAE,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC,CAAC;IAEnC,0CAA0C;IAC1C,KAAK,CAAC,SAAS,CACb,GAAG,EAAE,CAAC,GAAG,EAAE;QACT,kBAAkB,CAAC,EAAE,CAAC,CAAC;IACzB,CAAC,EACD,CAAC,kBAAkB,CAAC,CACrB,CAAC;IACF,OAAO,0CAAG,QAAQ,CAAI,CAAC;AACzB,CAAC;AAnBD,0DAmBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Utilities\n */\n\nimport { type KnownPreviewLayoutFeatures } from \"@itwin/appui-layout-react\";\nimport * as React from \"react\";\nimport { create } from \"zustand\";\n\n/** List of known preview features. */\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\ninterface KnownPreviewFeatures extends KnownPreviewLayoutFeatures {\n // Add preview features not in appui-layout-react here.\n}\n\n/** Object used trim to only known features at runtime.\n * @internal\n */\nconst knownFeaturesObject: Record<keyof KnownPreviewFeatures, undefined> = {\n contentAlwaysMaxSize: undefined,\n enableMaximizedFloatingWidget: undefined,\n ...{ newToolbars: undefined }, // Hidden feature used in storybook only (to avoid trimming).\n};\n\n/** List of preview features that can be enabled/disabled.\n * This list is expected to change over time, the interface is made\n * so that new features can be added or removed without breaking existing code.\n * A console warning will simply appear if unknown features are passed.\n * @beta\n */\nexport interface PreviewFeatures extends Partial<KnownPreviewFeatures> {\n [featureName: string]: any;\n}\n\n/** Trim an object to only contain known feature keys.\n * @param previewFeatures object potentially containing unknown features\n * @returns object containing only known features\n * @internal\n */\nfunction trimToKnownFeaturesOnly(previewFeatures: PreviewFeatures) {\n const knownFeatureKeys = Object.keys(knownFeaturesObject);\n const [knownFeatures, unknownFeatures] = Object.entries(\n previewFeatures\n ).reduce(\n ([known, unknown], [key, value]) => {\n if (knownFeatureKeys.includes(key)) {\n known[key] = value;\n } else {\n unknown.push(key);\n }\n return [known, unknown];\n },\n [{}, []] as [PreviewFeatures, string[]]\n );\n if (\n Object.keys(unknownFeatures).length > 0 &&\n process.env.NODE_ENV === \"development\"\n ) {\n // eslint-disable-next-line no-console\n console.warn(\n `The following features used in \"setPreviewFeatures\" are unknown or no longer in preview: [${unknownFeatures.toString()}]\n Here is the list of currently known features: [${knownFeatureKeys.toString()}]`\n );\n }\n return knownFeatures;\n}\n\ninterface PreviewFeaturesState {\n previewFeatures: PreviewFeatures;\n setPreviewFeatures: (previewFeatures: PreviewFeatures) => void;\n}\n\n/** Preview features store used by `UiFramework.previewFeatures` and `UiFramework.setPreviewFeatures()` APIs to manage the preview features.\n * Use `usePreviewFeatures` hook to access the preview features set from a react component.\n * Use `usePreviewFeaturesStore.getState().previewFeatures` to access the preview features set from a non-react component.\n * Use `usePreviewFeaturesStore.subscribe()` to subscribe to changes to the preview features set from a non-react component.\n * @internal\n */\nconst usePreviewFeaturesStore = create<PreviewFeaturesState>((set) => {\n return {\n previewFeatures: {},\n setPreviewFeatures: (newPreviewFeatures: PreviewFeatures) => {\n const previewFeatures = trimToKnownFeaturesOnly(newPreviewFeatures);\n set({ previewFeatures });\n },\n };\n});\n\n/** Hook to access the preview features set.\n * @internal\n */\nexport function usePreviewFeatures() {\n return usePreviewFeaturesStore((state) => state.previewFeatures);\n}\n\n/** Props for PreviewFeaturesProvider.\n * @beta\n */\nexport interface PreviewFeaturesProviderProps {\n children?: React.ReactNode;\n features?: PreviewFeatures;\n}\n\n/** Set which preview features are enabled. These features are not yet ready for production use nor have\n * a proper API defined yet.\n * The available set of features are defined in the [[PreviewFeatures]] interface.\n *\n * This component should wrap the Provider component.\n *\n * ```tsx\n * <PreviewFeaturesProvider features={{ enableMaximizedFloatingWidget: true }}>\n * <Provider store={UiFramework.store}>\n * [...]\n * <ConfigurableUIContent />\n * [/...]\n * </Provider>\n * </PreviewFeaturesProvider>\n * @beta\n */\nexport function PreviewFeaturesProvider({\n children,\n features,\n}: PreviewFeaturesProviderProps) {\n const setPreviewFeatures = usePreviewFeaturesStore(\n (state) => state.setPreviewFeatures\n );\n React.useEffect(() => {\n setPreviewFeatures(features ?? {});\n }, [features, setPreviewFeatures]);\n\n // Clear preview features when unmounting.\n React.useEffect(\n () => () => {\n setPreviewFeatures({});\n },\n [setPreviewFeatures]\n );\n return <>{children}</>;\n}\n"]}
|
|
@@ -3,8 +3,15 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import type { SafeAreaInsets } from "./SafeAreaInsets";
|
|
6
|
-
/**
|
|
7
|
-
*
|
|
6
|
+
/** Context used to manage safe area (feature used by devices with non-rectangular screens).
|
|
7
|
+
*
|
|
8
|
+
* If used, this is expected to wrap [[ConfigurableUiContent]].
|
|
9
|
+
*
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <SafeAreaContext.Provider value={SafeAreaInsets.All}>
|
|
12
|
+
* <ConfigurableUiContent />
|
|
13
|
+
* </SafeAreaContext.Provider>
|
|
14
|
+
* ```
|
|
8
15
|
* @public
|
|
9
16
|
*/
|
|
10
17
|
export declare const SafeAreaContext: React.Context<SafeAreaInsets | undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SafeAreaContext.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/safearea/SafeAreaContext.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD
|
|
1
|
+
{"version":3,"file":"SafeAreaContext.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/safearea/SafeAreaContext.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,2CAE3B,CAAC"}
|
|
@@ -9,8 +9,15 @@
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.SafeAreaContext = void 0;
|
|
11
11
|
const React = require("react");
|
|
12
|
-
/**
|
|
13
|
-
*
|
|
12
|
+
/** Context used to manage safe area (feature used by devices with non-rectangular screens).
|
|
13
|
+
*
|
|
14
|
+
* If used, this is expected to wrap [[ConfigurableUiContent]].
|
|
15
|
+
*
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <SafeAreaContext.Provider value={SafeAreaInsets.All}>
|
|
18
|
+
* <ConfigurableUiContent />
|
|
19
|
+
* </SafeAreaContext.Provider>
|
|
20
|
+
* ```
|
|
14
21
|
* @public
|
|
15
22
|
*/
|
|
16
23
|
exports.SafeAreaContext = React.createContext(undefined);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SafeAreaContext.js","sourceRoot":"","sources":["../../../../src/appui-react/safearea/SafeAreaContext.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B;AAG/B
|
|
1
|
+
{"version":3,"file":"SafeAreaContext.js","sourceRoot":"","sources":["../../../../src/appui-react/safearea/SafeAreaContext.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B;AAG/B;;;;;;;;;;GAUG;AACU,QAAA,eAAe,GAAG,KAAK,CAAC,aAAa,CAChD,SAAS,CACV,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Utilities\n */\n\nimport * as React from \"react\";\nimport type { SafeAreaInsets } from \"./SafeAreaInsets\";\n\n/** Context used to manage safe area (feature used by devices with non-rectangular screens).\n *\n * If used, this is expected to wrap [[ConfigurableUiContent]].\n *\n * ```tsx\n * <SafeAreaContext.Provider value={SafeAreaInsets.All}>\n * <ConfigurableUiContent />\n * </SafeAreaContext.Provider>\n * ```\n * @public\n */\nexport const SafeAreaContext = React.createContext<SafeAreaInsets | undefined>(\n undefined\n);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectionContextItemDef.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/selection/SelectionContextItemDef.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"SelectionContextItemDef.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/selection/SelectionContextItemDef.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAapD;;GAEG;AACH,wBAAgB,8BAA8B,IAAI,MAAM,EAAE,CAOzD;AAED;;GAEG;AACH,wBAAgB,+BAA+B,IAAI,MAAM,EAAE,CAS1D;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAsB7C;AAED;;GAEG;AACH,wBAAgB,2BAA2B,IAAI,OAAO,CASrD;AAED;;GAEG;AACH,wBAAgB,mCAAmC,IAAI,uBAAuB,CAK7E;AAED;;GAEG;AACH,wBAAgB,+BAA+B,IAAI,uBAAuB,CAKzE;AAED;;GAEG;AAEH,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,QAAQ,CAAC,aAAa,CAAC,GAC7B,aAAa,CAYf;AAED;;GAEG;AAEH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,QAAQ,CAAC,aAAa,CAAC,GAC7B,aAAa,CAkBf;AAED;;GAEG;AAEH,qBAAa,+BAA+B;IAC1C,WAAkB,+BAA+B,mBAQhD;IAED,WAAkB,mCAAmC,mBAQpD;IAED,WAAkB,sBAAsB,mBASvC;IAED,WAAkB,yBAAyB,iBAa1C;IAED,WAAkB,4BAA4B,mBAQ7C;IAED,WAAkB,gCAAgC,mBAQjD;IAED,WAAkB,mBAAmB,mBASpC;IAED,WAAkB,oBAAoB,iBAarC;IAED,WAAkB,wBAAwB,mBASzC;IAED,WAAkB,wCAAwC,mBAYzD;CACF"}
|
|
@@ -140,7 +140,7 @@ class SelectionContextToolDefinitions {
|
|
|
140
140
|
static get isolateModelsInSelectionItemDef() {
|
|
141
141
|
return new CommandItemDef_1.CommandItemDef({
|
|
142
142
|
commandId: "UiFramework.IsolateModel",
|
|
143
|
-
iconSpec:
|
|
143
|
+
iconSpec: model_isolate_svg_1.default,
|
|
144
144
|
labelKey: "UiFramework:tools.isolateModels",
|
|
145
145
|
execute: async () => UiFramework_1.UiFramework.hideIsolateEmphasizeActionHandler.processIsolateSelectedElementsModel(),
|
|
146
146
|
});
|
|
@@ -148,7 +148,7 @@ class SelectionContextToolDefinitions {
|
|
|
148
148
|
static get isolateCategoriesInSelectionItemDef() {
|
|
149
149
|
return new CommandItemDef_1.CommandItemDef({
|
|
150
150
|
commandId: "UiFramework.IsolateCategory",
|
|
151
|
-
iconSpec:
|
|
151
|
+
iconSpec: layers_isolate_svg_1.default,
|
|
152
152
|
labelKey: "UiFramework:tools.isolateCategories",
|
|
153
153
|
execute: async () => UiFramework_1.UiFramework.hideIsolateEmphasizeActionHandler.processIsolateSelectedElementsCategory(),
|
|
154
154
|
});
|
|
@@ -156,7 +156,7 @@ class SelectionContextToolDefinitions {
|
|
|
156
156
|
static get isolateElementsItemDef() {
|
|
157
157
|
return new CommandItemDef_1.CommandItemDef({
|
|
158
158
|
commandId: "UiFramework.IsolateSelected",
|
|
159
|
-
iconSpec:
|
|
159
|
+
iconSpec: asset_isolate_svg_1.default,
|
|
160
160
|
labelKey: "UiFramework:tools.isolateSelected",
|
|
161
161
|
isHidden: getIsHiddenIfSelectionNotActive(),
|
|
162
162
|
execute: async () => UiFramework_1.UiFramework.hideIsolateEmphasizeActionHandler.processIsolateSelected(),
|
|
@@ -166,7 +166,7 @@ class SelectionContextToolDefinitions {
|
|
|
166
166
|
return new GroupItem_1.GroupItemDef({
|
|
167
167
|
groupId: "UiFramework.IsolateSelectionGroup",
|
|
168
168
|
labelKey: "UiFramework:tools.isolate",
|
|
169
|
-
iconSpec:
|
|
169
|
+
iconSpec: isolate_svg_1.default,
|
|
170
170
|
isHidden: getIsHiddenIfSelectionNotActive(),
|
|
171
171
|
items: [
|
|
172
172
|
this.isolateElementsItemDef,
|
|
@@ -179,7 +179,7 @@ class SelectionContextToolDefinitions {
|
|
|
179
179
|
static get hideModelsInSelectionItemDef() {
|
|
180
180
|
return new CommandItemDef_1.CommandItemDef({
|
|
181
181
|
commandId: "UiFramework.HideModel",
|
|
182
|
-
iconSpec:
|
|
182
|
+
iconSpec: model_hide_svg_1.default,
|
|
183
183
|
labelKey: "UiFramework:tools.hideModels",
|
|
184
184
|
execute: async () => UiFramework_1.UiFramework.hideIsolateEmphasizeActionHandler.processHideSelectedElementsModel(),
|
|
185
185
|
});
|
|
@@ -187,7 +187,7 @@ class SelectionContextToolDefinitions {
|
|
|
187
187
|
static get hideCategoriesInSelectionItemDef() {
|
|
188
188
|
return new CommandItemDef_1.CommandItemDef({
|
|
189
189
|
commandId: "UiFramework.HideCategory",
|
|
190
|
-
iconSpec:
|
|
190
|
+
iconSpec: layers_hide_svg_1.default,
|
|
191
191
|
labelKey: "UiFramework:tools.hideCategories",
|
|
192
192
|
execute: async () => UiFramework_1.UiFramework.hideIsolateEmphasizeActionHandler.processHideSelectedElementsCategory(),
|
|
193
193
|
});
|
|
@@ -195,7 +195,7 @@ class SelectionContextToolDefinitions {
|
|
|
195
195
|
static get hideElementsItemDef() {
|
|
196
196
|
return new CommandItemDef_1.CommandItemDef({
|
|
197
197
|
commandId: "UiFramework.HideSelected",
|
|
198
|
-
iconSpec:
|
|
198
|
+
iconSpec: asset_classification_hide_svg_1.default,
|
|
199
199
|
labelKey: "UiFramework:tools.hideSelected",
|
|
200
200
|
isHidden: getIsHiddenIfSelectionNotActive(),
|
|
201
201
|
execute: async () => UiFramework_1.UiFramework.hideIsolateEmphasizeActionHandler.processHideSelected(),
|
|
@@ -205,7 +205,7 @@ class SelectionContextToolDefinitions {
|
|
|
205
205
|
return new GroupItem_1.GroupItemDef({
|
|
206
206
|
groupId: "UiFramework.HideSelectionGroup",
|
|
207
207
|
labelKey: "UiFramework:tools.hide",
|
|
208
|
-
iconSpec:
|
|
208
|
+
iconSpec: visibility_hide_2_svg_1.default,
|
|
209
209
|
isHidden: getIsHiddenIfSelectionNotActive(),
|
|
210
210
|
items: [
|
|
211
211
|
this.hideElementsItemDef,
|
|
@@ -218,7 +218,7 @@ class SelectionContextToolDefinitions {
|
|
|
218
218
|
static get emphasizeElementsItemDef() {
|
|
219
219
|
return new CommandItemDef_1.CommandItemDef({
|
|
220
220
|
commandId: "UiFramework.EmphasizeSelected",
|
|
221
|
-
iconSpec:
|
|
221
|
+
iconSpec: visibility_semi_transparent_svg_1.default,
|
|
222
222
|
labelKey: "UiFramework:tools.emphasizeSelected",
|
|
223
223
|
isHidden: getIsHiddenIfSelectionNotActive(),
|
|
224
224
|
execute: async () => UiFramework_1.UiFramework.hideIsolateEmphasizeActionHandler.processEmphasizeSelected(),
|
|
@@ -227,7 +227,7 @@ class SelectionContextToolDefinitions {
|
|
|
227
227
|
static get clearHideIsolateEmphasizeElementsItemDef() {
|
|
228
228
|
return new CommandItemDef_1.CommandItemDef({
|
|
229
229
|
commandId: "UiFramework.ClearHideIsolateEmphasize",
|
|
230
|
-
iconSpec:
|
|
230
|
+
iconSpec: visibility_svg_1.default,
|
|
231
231
|
labelKey: "UiFramework:tools.clearVisibility",
|
|
232
232
|
isHidden: getIsHiddenIfFeatureOverridesActive(),
|
|
233
233
|
execute: async () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectionContextItemDef.js","sourceRoot":"","sources":["../../../../src/appui-react/selection/SelectionContextItemDef.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,0DAG+B;AAC/B,wDAA6D;AAC7D,6DAA0D;AAE1D,2EAAgE;AAChE,oDAAoD;AACpD,gDAA6C;AAC7C,sFAA6E;AAC7E,wFAA+E;AAC/E,sFAA6E;AAC7E,0EAAkE;AAClE,gFAAuE;AACvE,kFAAyE;AACzE,8GAAoG;AACpG,kHAAwG;AACxG,8FA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C,iCAAiC,CAAC,0BAA0B,EAAE,CAAC;gBACjF,MAAM,yBAAW,CAAC,iCAAiC,CAAC,8BAA8B,EAAE,CAAC;YACvF,CAAC;SACF,CAAC,CAAC;IACL,CAAC;CACF;AAzHD,0EAyHC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tools\n */\n\nimport {\n ConditionalBooleanValue,\n IconSpecUtilities,\n} from \"@itwin/appui-abstract\";\nimport { SessionStateActionId } from \"../redux/SessionState\";\nimport { CommandItemDef } from \"../shared/CommandItemDef\";\nimport type { BaseItemState } from \"../shared/ItemDefBase\";\nimport { SyncUiEventId } from \"../syncui/SyncUiEventDispatcher\";\nimport { GroupItemDef } from \"../toolbar/GroupItem\";\nimport { UiFramework } from \"../UiFramework\";\nimport svgModelIsolate from \"@bentley/icons-generic/icons/model-isolate.svg\";\nimport svgLayersIsolate from \"@bentley/icons-generic/icons/layers-isolate.svg\";\nimport svgAssetIsolate from \"@bentley/icons-generic/icons/asset-isolate.svg\";\nimport svgIsolate from \"@bentley/icons-generic/icons/isolate.svg\";\nimport svgModelHide from \"@bentley/icons-generic/icons/model-hide.svg\";\nimport svgLayersHide from \"@bentley/icons-generic/icons/layers-hide.svg\";\nimport svgAssetClassificationHide from \"@bentley/icons-generic/icons/asset-classification-hide.svg\";\nimport svgVisibilitySemiTransparent from \"@bentley/icons-generic/icons/visibility-semi-transparent.svg\";\nimport svgVisibilityHide from \"@bentley/icons-generic/icons/visibility-hide_2.svg\";\nimport svgVisibility from \"@bentley/icons-generic/icons/visibility.svg\";\n\n/** return SyncEventIds that trigger selection state function refresh.\n * @beta\n */\nexport function getFeatureOverrideSyncEventIds(): string[] {\n return [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.FeatureOverridesChanged,\n SyncUiEventId.ViewedModelsChanged,\n ];\n}\n\n/** return SyncEventIds that trigger selection state function refresh.\n * @beta\n */\nexport function getSelectionContextSyncEventIds(): string[] {\n return [\n SyncUiEventId.SelectionSetChanged,\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SessionStateActionId.SetNumItemsSelected,\n SyncUiEventId.FeatureOverridesChanged,\n SyncUiEventId.ViewedModelsChanged,\n ];\n}\n\n/** return SyncEventIds that trigger selection state function refresh.\n * @beta\n */\nexport function isNoSelectionActive(): boolean {\n const activeContentControl = UiFramework.content.getActiveContentControl();\n let selectionCount = 0;\n // istanbul ignore if\n if (!UiFramework.frameworkStateKey)\n selectionCount =\n UiFramework.store.getState()[UiFramework.frameworkStateKey].frameworkState\n .sessionState.numItemsSelected;\n\n // istanbul ignore if\n if (activeContentControl?.viewport) {\n const hiddenElementsSet = activeContentControl.viewport.neverDrawn;\n const selectedElementsSet =\n activeContentControl.viewport.view.iModel.selectionSet.elements;\n // TODO: add check for categories, subcategories and models\n if (\n selectionCount > 0 ||\n ![...selectedElementsSet].every((value) => hiddenElementsSet?.has(value))\n )\n return false;\n }\n return true;\n}\n\n/** return ConditionalBooleanValue object used to show items if selection set is active.\n * @beta\n */\nexport function areNoFeatureOverridesActive(): boolean {\n const activeContentControl = UiFramework.content.getActiveContentControl();\n // istanbul ignore next\n if (activeContentControl && activeContentControl.viewport)\n return !UiFramework.hideIsolateEmphasizeActionHandler.areFeatureOverridesActive(\n activeContentControl.viewport\n );\n\n return true;\n}\n\n/** return ConditionalBooleanValue object used to show item if feature overrides are active.\n * @beta\n */\nexport function getIsHiddenIfFeatureOverridesActive(): ConditionalBooleanValue {\n return new ConditionalBooleanValue(\n areNoFeatureOverridesActive,\n getFeatureOverrideSyncEventIds()\n );\n}\n\n/** return ConditionalBooleanValue object used to show items if selection set is active.\n * @beta\n */\nexport function getIsHiddenIfSelectionNotActive(): ConditionalBooleanValue {\n return new ConditionalBooleanValue(\n isNoSelectionActive,\n getSelectionContextSyncEventIds()\n );\n}\n\n/** return state with isVisible set to true is SectionSet is active.\n * @beta\n */\n// istanbul ignore next\nexport function featureOverridesActiveStateFunc(\n state: Readonly<BaseItemState>\n): BaseItemState {\n const activeContentControl = UiFramework.content.getActiveContentControl();\n let isVisible = false;\n\n // istanbul ignore next\n if (activeContentControl && activeContentControl.viewport)\n isVisible =\n UiFramework.hideIsolateEmphasizeActionHandler.areFeatureOverridesActive(\n activeContentControl.viewport\n );\n\n return { ...state, isVisible };\n}\n\n/** return state with isVisible set to true is SectionSet is active.\n * @beta\n */\n// istanbul ignore next\nexport function selectionContextStateFunc(\n state: Readonly<BaseItemState>\n): BaseItemState {\n const activeContentControl = UiFramework.content.getActiveContentControl();\n let isVisible = false;\n\n let selectionCount = 0;\n if (!UiFramework.frameworkStateKey)\n selectionCount =\n UiFramework.store.getState()[UiFramework.frameworkStateKey].frameworkState\n .sessionState.numItemsSelected;\n\n if (\n activeContentControl &&\n activeContentControl.viewport &&\n (activeContentControl.viewport.view.iModel.selectionSet.size > 0 ||\n selectionCount > 0)\n )\n isVisible = true;\n return { ...state, isVisible };\n}\n\n/** Utility Class that provides definitions for tools dependent on current selection. These definitions can be used to populate toolbars.\n * @public\n */\n// istanbul ignore next\nexport class SelectionContextToolDefinitions {\n public static get isolateModelsInSelectionItemDef() {\n return new CommandItemDef({\n commandId: \"UiFramework.IsolateModel\",\n iconSpec: IconSpecUtilities.createWebComponentIconSpec(svgModelIsolate),\n labelKey: \"UiFramework:tools.isolateModels\",\n execute: async () =>\n UiFramework.hideIsolateEmphasizeActionHandler.processIsolateSelectedElementsModel(),\n });\n }\n\n public static get isolateCategoriesInSelectionItemDef() {\n return new CommandItemDef({\n commandId: \"UiFramework.IsolateCategory\",\n iconSpec: IconSpecUtilities.createWebComponentIconSpec(svgLayersIsolate),\n labelKey: \"UiFramework:tools.isolateCategories\",\n execute: async () =>\n UiFramework.hideIsolateEmphasizeActionHandler.processIsolateSelectedElementsCategory(),\n });\n }\n\n public static get isolateElementsItemDef() {\n return new CommandItemDef({\n commandId: \"UiFramework.IsolateSelected\",\n iconSpec: IconSpecUtilities.createWebComponentIconSpec(svgAssetIsolate),\n labelKey: \"UiFramework:tools.isolateSelected\",\n isHidden: getIsHiddenIfSelectionNotActive(),\n execute: async () =>\n UiFramework.hideIsolateEmphasizeActionHandler.processIsolateSelected(),\n });\n }\n\n public static get isolateSelectionToolGroup() {\n return new GroupItemDef({\n groupId: \"UiFramework.IsolateSelectionGroup\",\n labelKey: \"UiFramework:tools.isolate\",\n iconSpec: IconSpecUtilities.createWebComponentIconSpec(svgIsolate),\n isHidden: getIsHiddenIfSelectionNotActive(),\n items: [\n this.isolateElementsItemDef,\n this.isolateCategoriesInSelectionItemDef,\n this.isolateModelsInSelectionItemDef,\n ],\n itemsInColumn: 3,\n });\n }\n\n public static get hideModelsInSelectionItemDef() {\n return new CommandItemDef({\n commandId: \"UiFramework.HideModel\",\n iconSpec: IconSpecUtilities.createWebComponentIconSpec(svgModelHide),\n labelKey: \"UiFramework:tools.hideModels\",\n execute: async () =>\n UiFramework.hideIsolateEmphasizeActionHandler.processHideSelectedElementsModel(),\n });\n }\n\n public static get hideCategoriesInSelectionItemDef() {\n return new CommandItemDef({\n commandId: \"UiFramework.HideCategory\",\n iconSpec: IconSpecUtilities.createWebComponentIconSpec(svgLayersHide),\n labelKey: \"UiFramework:tools.hideCategories\",\n execute: async () =>\n UiFramework.hideIsolateEmphasizeActionHandler.processHideSelectedElementsCategory(),\n });\n }\n\n public static get hideElementsItemDef() {\n return new CommandItemDef({\n commandId: \"UiFramework.HideSelected\",\n iconSpec: IconSpecUtilities.createWebComponentIconSpec(\n svgAssetClassificationHide\n ),\n labelKey: \"UiFramework:tools.hideSelected\",\n isHidden: getIsHiddenIfSelectionNotActive(),\n execute: async () =>\n UiFramework.hideIsolateEmphasizeActionHandler.processHideSelected(),\n });\n }\n\n public static get hideSectionToolGroup() {\n return new GroupItemDef({\n groupId: \"UiFramework.HideSelectionGroup\",\n labelKey: \"UiFramework:tools.hide\",\n iconSpec: IconSpecUtilities.createWebComponentIconSpec(svgVisibilityHide),\n isHidden: getIsHiddenIfSelectionNotActive(),\n items: [\n this.hideElementsItemDef,\n this.hideCategoriesInSelectionItemDef,\n this.hideModelsInSelectionItemDef,\n ],\n itemsInColumn: 3,\n });\n }\n\n public static get emphasizeElementsItemDef() {\n return new CommandItemDef({\n commandId: \"UiFramework.EmphasizeSelected\",\n iconSpec: IconSpecUtilities.createWebComponentIconSpec(\n svgVisibilitySemiTransparent\n ),\n labelKey: \"UiFramework:tools.emphasizeSelected\",\n isHidden: getIsHiddenIfSelectionNotActive(),\n execute: async () =>\n UiFramework.hideIsolateEmphasizeActionHandler.processEmphasizeSelected(),\n });\n }\n\n public static get clearHideIsolateEmphasizeElementsItemDef() {\n return new CommandItemDef({\n commandId: \"UiFramework.ClearHideIsolateEmphasize\",\n iconSpec: IconSpecUtilities.createWebComponentIconSpec(svgVisibility),\n labelKey: \"UiFramework:tools.clearVisibility\",\n isHidden: getIsHiddenIfFeatureOverridesActive(),\n execute: async () => {\n await UiFramework.hideIsolateEmphasizeActionHandler.processClearEmphasize();\n await UiFramework.hideIsolateEmphasizeActionHandler.processClearOverrideModels();\n await UiFramework.hideIsolateEmphasizeActionHandler.processClearOverrideCategories();\n },\n });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"SelectionContextItemDef.js","sourceRoot":"","sources":["../../../../src/appui-react/selection/SelectionContextItemDef.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,0DAAgE;AAChE,wDAA6D;AAC7D,6DAA0D;AAE1D,2EAAgE;AAChE,oDAAoD;AACpD,gDAA6C;AAC7C,sFAA6E;AAC7E,wFAA+E;AAC/E,sFAA6E;AAC7E,0EAAkE;AAClE,gFAAuE;AACvE,kFAAyE;AACzE,8GAAoG;AACpG,kHAAwG;AACxG,8FAAmF;AACnF,gFAAwE;AAExE;;GAEG;AACH,SAA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CAAgC;YACzC,QAAQ,EAAE,wBAAwB;YAClC,QAAQ,EAAE,+BAAiB;YAC3B,QAAQ,EAAE,+BAA+B,EAAE;YAC3C,KAAK,EAAE;gBACL,IAAI,CAAC,mBAAmB;gBACxB,IAAI,CAAC,gCAAgC;gBACrC,IAAI,CAAC,4BAA4B;aAClC;YACD,aAAa,EAAE,CAAC;SACjB,CAAC,CAAC;IACL,CAAC;IAEM,MAAM,KAAK,wBAAwB;QACxC,OAAO,IAAI,+BAAc,CAAC;YACxB,SAAS,EAAE,+BAA+B;YAC1C,QAAQ,EAAE,yCAA4B;YACtC,QAAQ,EAAE,qCAAqC;YAC/C,QAAQ,EAAE,+BAA+B,EAAE;YAC3C,OAAO,EAAE,KAAK,IAAI,EAAE,CAClB,yBAAW,CAAC,iCAAiC,CAAC,wBAAwB,EAAE;SAC3E,CAAC,CAAC;IACL,CAAC;IAEM,MAAM,KAAK,wCAAwC;QACxD,OAAO,IAAI,+BAAc,CAAC;YACxB,SAAS,EAAE,uCAAuC;YAClD,QAAQ,EAAE,wBAAa;YACvB,QAAQ,EAAE,mCAAmC;YAC7C,QAAQ,EAAE,mCAAmC,EAAE;YAC/C,OAAO,EAAE,KAAK,IAAI,EAAE;gBAClB,MAAM,yBAAW,CAAC,iCAAiC,CAAC,qBAAqB,EAAE,CAAC;gBAC5E,MAAM,yBAAW,CAAC,iCAAiC,CAAC,0BAA0B,EAAE,CAAC;gBACjF,MAAM,yBAAW,CAAC,iCAAiC,CAAC,8BAA8B,EAAE,CAAC;YACvF,CAAC;SACF,CAAC,CAAC;IACL,CAAC;CACF;AArHD,0EAqHC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tools\n */\n\nimport { ConditionalBooleanValue } from \"@itwin/appui-abstract\";\nimport { SessionStateActionId } from \"../redux/SessionState\";\nimport { CommandItemDef } from \"../shared/CommandItemDef\";\nimport type { BaseItemState } from \"../shared/ItemDefBase\";\nimport { SyncUiEventId } from \"../syncui/SyncUiEventDispatcher\";\nimport { GroupItemDef } from \"../toolbar/GroupItem\";\nimport { UiFramework } from \"../UiFramework\";\nimport svgModelIsolate from \"@bentley/icons-generic/icons/model-isolate.svg\";\nimport svgLayersIsolate from \"@bentley/icons-generic/icons/layers-isolate.svg\";\nimport svgAssetIsolate from \"@bentley/icons-generic/icons/asset-isolate.svg\";\nimport svgIsolate from \"@bentley/icons-generic/icons/isolate.svg\";\nimport svgModelHide from \"@bentley/icons-generic/icons/model-hide.svg\";\nimport svgLayersHide from \"@bentley/icons-generic/icons/layers-hide.svg\";\nimport svgAssetClassificationHide from \"@bentley/icons-generic/icons/asset-classification-hide.svg\";\nimport svgVisibilitySemiTransparent from \"@bentley/icons-generic/icons/visibility-semi-transparent.svg\";\nimport svgVisibilityHide from \"@bentley/icons-generic/icons/visibility-hide_2.svg\";\nimport svgVisibility from \"@bentley/icons-generic/icons/visibility.svg\";\n\n/** return SyncEventIds that trigger selection state function refresh.\n * @beta\n */\nexport function getFeatureOverrideSyncEventIds(): string[] {\n return [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.FeatureOverridesChanged,\n SyncUiEventId.ViewedModelsChanged,\n ];\n}\n\n/** return SyncEventIds that trigger selection state function refresh.\n * @beta\n */\nexport function getSelectionContextSyncEventIds(): string[] {\n return [\n SyncUiEventId.SelectionSetChanged,\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SessionStateActionId.SetNumItemsSelected,\n SyncUiEventId.FeatureOverridesChanged,\n SyncUiEventId.ViewedModelsChanged,\n ];\n}\n\n/** return SyncEventIds that trigger selection state function refresh.\n * @beta\n */\nexport function isNoSelectionActive(): boolean {\n const activeContentControl = UiFramework.content.getActiveContentControl();\n let selectionCount = 0;\n // istanbul ignore if\n if (!UiFramework.frameworkStateKey)\n selectionCount =\n UiFramework.store.getState()[UiFramework.frameworkStateKey].frameworkState\n .sessionState.numItemsSelected;\n\n // istanbul ignore if\n if (activeContentControl?.viewport) {\n const hiddenElementsSet = activeContentControl.viewport.neverDrawn;\n const selectedElementsSet =\n activeContentControl.viewport.view.iModel.selectionSet.elements;\n // TODO: add check for categories, subcategories and models\n if (\n selectionCount > 0 ||\n ![...selectedElementsSet].every((value) => hiddenElementsSet?.has(value))\n )\n return false;\n }\n return true;\n}\n\n/** return ConditionalBooleanValue object used to show items if selection set is active.\n * @beta\n */\nexport function areNoFeatureOverridesActive(): boolean {\n const activeContentControl = UiFramework.content.getActiveContentControl();\n // istanbul ignore next\n if (activeContentControl && activeContentControl.viewport)\n return !UiFramework.hideIsolateEmphasizeActionHandler.areFeatureOverridesActive(\n activeContentControl.viewport\n );\n\n return true;\n}\n\n/** return ConditionalBooleanValue object used to show item if feature overrides are active.\n * @beta\n */\nexport function getIsHiddenIfFeatureOverridesActive(): ConditionalBooleanValue {\n return new ConditionalBooleanValue(\n areNoFeatureOverridesActive,\n getFeatureOverrideSyncEventIds()\n );\n}\n\n/** return ConditionalBooleanValue object used to show items if selection set is active.\n * @beta\n */\nexport function getIsHiddenIfSelectionNotActive(): ConditionalBooleanValue {\n return new ConditionalBooleanValue(\n isNoSelectionActive,\n getSelectionContextSyncEventIds()\n );\n}\n\n/** return state with isVisible set to true is SectionSet is active.\n * @beta\n */\n// istanbul ignore next\nexport function featureOverridesActiveStateFunc(\n state: Readonly<BaseItemState>\n): BaseItemState {\n const activeContentControl = UiFramework.content.getActiveContentControl();\n let isVisible = false;\n\n // istanbul ignore next\n if (activeContentControl && activeContentControl.viewport)\n isVisible =\n UiFramework.hideIsolateEmphasizeActionHandler.areFeatureOverridesActive(\n activeContentControl.viewport\n );\n\n return { ...state, isVisible };\n}\n\n/** return state with isVisible set to true is SectionSet is active.\n * @beta\n */\n// istanbul ignore next\nexport function selectionContextStateFunc(\n state: Readonly<BaseItemState>\n): BaseItemState {\n const activeContentControl = UiFramework.content.getActiveContentControl();\n let isVisible = false;\n\n let selectionCount = 0;\n if (!UiFramework.frameworkStateKey)\n selectionCount =\n UiFramework.store.getState()[UiFramework.frameworkStateKey].frameworkState\n .sessionState.numItemsSelected;\n\n if (\n activeContentControl &&\n activeContentControl.viewport &&\n (activeContentControl.viewport.view.iModel.selectionSet.size > 0 ||\n selectionCount > 0)\n )\n isVisible = true;\n return { ...state, isVisible };\n}\n\n/** Utility Class that provides definitions for tools dependent on current selection. These definitions can be used to populate toolbars.\n * @public\n */\n// istanbul ignore next\nexport class SelectionContextToolDefinitions {\n public static get isolateModelsInSelectionItemDef() {\n return new CommandItemDef({\n commandId: \"UiFramework.IsolateModel\",\n iconSpec: svgModelIsolate,\n labelKey: \"UiFramework:tools.isolateModels\",\n execute: async () =>\n UiFramework.hideIsolateEmphasizeActionHandler.processIsolateSelectedElementsModel(),\n });\n }\n\n public static get isolateCategoriesInSelectionItemDef() {\n return new CommandItemDef({\n commandId: \"UiFramework.IsolateCategory\",\n iconSpec: svgLayersIsolate,\n labelKey: \"UiFramework:tools.isolateCategories\",\n execute: async () =>\n UiFramework.hideIsolateEmphasizeActionHandler.processIsolateSelectedElementsCategory(),\n });\n }\n\n public static get isolateElementsItemDef() {\n return new CommandItemDef({\n commandId: \"UiFramework.IsolateSelected\",\n iconSpec: svgAssetIsolate,\n labelKey: \"UiFramework:tools.isolateSelected\",\n isHidden: getIsHiddenIfSelectionNotActive(),\n execute: async () =>\n UiFramework.hideIsolateEmphasizeActionHandler.processIsolateSelected(),\n });\n }\n\n public static get isolateSelectionToolGroup() {\n return new GroupItemDef({\n groupId: \"UiFramework.IsolateSelectionGroup\",\n labelKey: \"UiFramework:tools.isolate\",\n iconSpec: svgIsolate,\n isHidden: getIsHiddenIfSelectionNotActive(),\n items: [\n this.isolateElementsItemDef,\n this.isolateCategoriesInSelectionItemDef,\n this.isolateModelsInSelectionItemDef,\n ],\n itemsInColumn: 3,\n });\n }\n\n public static get hideModelsInSelectionItemDef() {\n return new CommandItemDef({\n commandId: \"UiFramework.HideModel\",\n iconSpec: svgModelHide,\n labelKey: \"UiFramework:tools.hideModels\",\n execute: async () =>\n UiFramework.hideIsolateEmphasizeActionHandler.processHideSelectedElementsModel(),\n });\n }\n\n public static get hideCategoriesInSelectionItemDef() {\n return new CommandItemDef({\n commandId: \"UiFramework.HideCategory\",\n iconSpec: svgLayersHide,\n labelKey: \"UiFramework:tools.hideCategories\",\n execute: async () =>\n UiFramework.hideIsolateEmphasizeActionHandler.processHideSelectedElementsCategory(),\n });\n }\n\n public static get hideElementsItemDef() {\n return new CommandItemDef({\n commandId: \"UiFramework.HideSelected\",\n iconSpec: svgAssetClassificationHide,\n labelKey: \"UiFramework:tools.hideSelected\",\n isHidden: getIsHiddenIfSelectionNotActive(),\n execute: async () =>\n UiFramework.hideIsolateEmphasizeActionHandler.processHideSelected(),\n });\n }\n\n public static get hideSectionToolGroup() {\n return new GroupItemDef({\n groupId: \"UiFramework.HideSelectionGroup\",\n labelKey: \"UiFramework:tools.hide\",\n iconSpec: svgVisibilityHide,\n isHidden: getIsHiddenIfSelectionNotActive(),\n items: [\n this.hideElementsItemDef,\n this.hideCategoriesInSelectionItemDef,\n this.hideModelsInSelectionItemDef,\n ],\n itemsInColumn: 3,\n });\n }\n\n public static get emphasizeElementsItemDef() {\n return new CommandItemDef({\n commandId: \"UiFramework.EmphasizeSelected\",\n iconSpec: svgVisibilitySemiTransparent,\n labelKey: \"UiFramework:tools.emphasizeSelected\",\n isHidden: getIsHiddenIfSelectionNotActive(),\n execute: async () =>\n UiFramework.hideIsolateEmphasizeActionHandler.processEmphasizeSelected(),\n });\n }\n\n public static get clearHideIsolateEmphasizeElementsItemDef() {\n return new CommandItemDef({\n commandId: \"UiFramework.ClearHideIsolateEmphasize\",\n iconSpec: svgVisibility,\n labelKey: \"UiFramework:tools.clearVisibility\",\n isHidden: getIsHiddenIfFeatureOverridesActive(),\n execute: async () => {\n await UiFramework.hideIsolateEmphasizeActionHandler.processClearEmphasize();\n await UiFramework.hideIsolateEmphasizeActionHandler.processClearOverrideModels();\n await UiFramework.hideIsolateEmphasizeActionHandler.processClearOverrideCategories();\n },\n });\n }\n}\n"]}
|
|
@@ -6,15 +6,14 @@ import "./UiSettingsPage.scss";
|
|
|
6
6
|
import type { SettingsTabEntry } from "@itwin/core-react";
|
|
7
7
|
/** UiSettingsPage displaying the active UI settings. This page lets users set the following settings.
|
|
8
8
|
*
|
|
9
|
-
* - theme - Dark, Light, or based on OS preference.
|
|
9
|
+
* - theme - Dark, Light, with or without High contrast, or based on OS preference.
|
|
10
10
|
* - auto hide - Starts a timer and blanks out ui components that overlay content if there is no mouse movement for a period of time.
|
|
11
11
|
* - drag interaction - If set, toolbar group buttons require a press and drag or a long press to open. In this mode a child action
|
|
12
12
|
* item is shown as the group button and is activated when button is clicked. If a different child item is selected, it becomes the
|
|
13
13
|
* active group button item.
|
|
14
14
|
* - use proximity - Changes the opacity of toolbar from transparent to opaque as the mouse moves closer.
|
|
15
15
|
* - snap widget opacity - triggers an abrupt change from transparent to opaque for tool and navigation widgets, instead of a gradual change based on mouse location.
|
|
16
|
-
* - widget opacity - determines how transparent floating widgets
|
|
17
|
-
* - UI version - if allowed by props, the UI version can be toggled between V1 and V2.
|
|
16
|
+
* - widget opacity - determines how transparent floating widgets become when the mouse in not in them.
|
|
18
17
|
*
|
|
19
18
|
* @beta
|
|
20
19
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiSettingsPage.d.ts","sourceRoot":"","sources":["../../../../../src/appui-react/settings/ui/UiSettingsPage.tsx"],"names":[],"mappings":"AAIA;;GAEG;;AAKH,OAAO,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"UiSettingsPage.d.ts","sourceRoot":"","sources":["../../../../../src/appui-react/settings/ui/UiSettingsPage.tsx"],"names":[],"mappings":"AAIA;;GAEG;;AAKH,OAAO,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAc1D;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,gBA4Y7B;AAsBD;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,MAAM,GACnB,gBAAgB,CAUlB"}
|
|
@@ -15,19 +15,17 @@ const React = require("react");
|
|
|
15
15
|
const UiFramework_1 = require("../../UiFramework");
|
|
16
16
|
const ThemeManager_1 = require("../../theme/ThemeManager");
|
|
17
17
|
const SyncUiEventDispatcher_1 = require("../../syncui/SyncUiEventDispatcher");
|
|
18
|
-
const appui_abstract_1 = require("@itwin/appui-abstract");
|
|
19
18
|
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
20
19
|
/** UiSettingsPage displaying the active UI settings. This page lets users set the following settings.
|
|
21
20
|
*
|
|
22
|
-
* - theme - Dark, Light, or based on OS preference.
|
|
21
|
+
* - theme - Dark, Light, with or without High contrast, or based on OS preference.
|
|
23
22
|
* - auto hide - Starts a timer and blanks out ui components that overlay content if there is no mouse movement for a period of time.
|
|
24
23
|
* - drag interaction - If set, toolbar group buttons require a press and drag or a long press to open. In this mode a child action
|
|
25
24
|
* item is shown as the group button and is activated when button is clicked. If a different child item is selected, it becomes the
|
|
26
25
|
* active group button item.
|
|
27
26
|
* - use proximity - Changes the opacity of toolbar from transparent to opaque as the mouse moves closer.
|
|
28
27
|
* - snap widget opacity - triggers an abrupt change from transparent to opaque for tool and navigation widgets, instead of a gradual change based on mouse location.
|
|
29
|
-
* - widget opacity - determines how transparent floating widgets
|
|
30
|
-
* - UI version - if allowed by props, the UI version can be toggled between V1 and V2.
|
|
28
|
+
* - widget opacity - determines how transparent floating widgets become when the mouse in not in them.
|
|
31
29
|
*
|
|
32
30
|
* @beta
|
|
33
31
|
*/
|
|
@@ -44,6 +42,9 @@ function UiSettingsPage() {
|
|
|
44
42
|
const snapWidgetOpacityDescription = React.useRef(UiFramework_1.UiFramework.translate("settings.uiSettingsPage.snapWidgetOpacityDescription"));
|
|
45
43
|
const darkLabel = React.useRef(UiFramework_1.UiFramework.translate("settings.uiSettingsPage.dark"));
|
|
46
44
|
const lightLabel = React.useRef(UiFramework_1.UiFramework.translate("settings.uiSettingsPage.light"));
|
|
45
|
+
const darkHCLabel = React.useRef(UiFramework_1.UiFramework.translate("settings.uiSettingsPage.darkHighContrast"));
|
|
46
|
+
const lightHCLabel = React.useRef(UiFramework_1.UiFramework.translate("settings.uiSettingsPage.lightHighContrast"));
|
|
47
|
+
const inheritLabel = React.useRef(UiFramework_1.UiFramework.translate("settings.uiSettingsPage.inherit"));
|
|
47
48
|
const systemPreferredLabel = React.useRef(UiFramework_1.UiFramework.translate("settings.uiSettingsPage.systemPreferred"));
|
|
48
49
|
const widgetOpacityTitle = React.useRef(UiFramework_1.UiFramework.translate("settings.uiSettingsPage.widgetOpacityTitle"));
|
|
49
50
|
const widgetOpacityDescription = React.useRef(UiFramework_1.UiFramework.translate("settings.uiSettingsPage.widgetOpacityDescription"));
|
|
@@ -74,7 +75,6 @@ function UiSettingsPage() {
|
|
|
74
75
|
"configurableui:set_widget_opacity",
|
|
75
76
|
"configurableui:set-show-widget-icon",
|
|
76
77
|
"configurableui:set-drag-interaction",
|
|
77
|
-
"configurableui:set-framework-version",
|
|
78
78
|
"configurableui:set-auto-collapse-unpinned-panels",
|
|
79
79
|
"configurableui:set-animate-tool-settings",
|
|
80
80
|
"configurableui:set-use-tool-as-tool-settings-label",
|
|
@@ -132,6 +132,9 @@ function UiSettingsPage() {
|
|
|
132
132
|
defaultThemeOption,
|
|
133
133
|
{ label: lightLabel.current, value: ThemeManager_1.ColorTheme.Light },
|
|
134
134
|
{ label: darkLabel.current, value: ThemeManager_1.ColorTheme.Dark },
|
|
135
|
+
{ label: lightHCLabel.current, value: ThemeManager_1.ColorTheme.HighContrastLight },
|
|
136
|
+
{ label: darkHCLabel.current, value: ThemeManager_1.ColorTheme.HighContrastDark },
|
|
137
|
+
{ label: inheritLabel.current, value: ThemeManager_1.ColorTheme.Inherit },
|
|
135
138
|
];
|
|
136
139
|
const onThemeChange = React.useCallback((newValue) => {
|
|
137
140
|
UiFramework_1.UiFramework.setColorTheme(newValue);
|
|
@@ -206,7 +209,7 @@ function getUiSettingsManagerEntry(itemPriority) {
|
|
|
206
209
|
itemPriority,
|
|
207
210
|
tabId: "uifw:UiStateStorage",
|
|
208
211
|
label: UiFramework_1.UiFramework.translate("settings.uiSettingsPage.label"),
|
|
209
|
-
icon:
|
|
212
|
+
icon: window_settings_svg_1.default,
|
|
210
213
|
page: React.createElement(UiSettingsPage, null),
|
|
211
214
|
isDisabled: false,
|
|
212
215
|
tooltip: UiFramework_1.UiFramework.translate("settings.uiSettingsPage.tooltip"),
|