@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
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
import type { UiStateStorage } from "@itwin/core-react";
|
|
5
5
|
import { UiStateEntry } from "@itwin/core-react";
|
|
6
6
|
import type { UserSettingsProvider } from "../UiFramework";
|
|
7
|
+
import type { ThemeId } from "../theme/ThemeManager";
|
|
7
8
|
/** Default values that may be specified for [[AppUiSettings]].
|
|
8
9
|
* @public
|
|
9
10
|
*/
|
|
10
11
|
export interface InitialAppUiSettings {
|
|
11
|
-
colorTheme:
|
|
12
|
+
colorTheme: ThemeId;
|
|
12
13
|
dragInteraction: boolean;
|
|
13
14
|
widgetOpacity: number;
|
|
14
15
|
showWidgetIcon?: boolean;
|
|
@@ -18,8 +19,8 @@ export interface InitialAppUiSettings {
|
|
|
18
19
|
useToolAsToolSettingsLabel?: boolean;
|
|
19
20
|
toolbarOpacity: number;
|
|
20
21
|
}
|
|
21
|
-
/** These are the UI settings that are stored in the Redux store. They control the color theme,
|
|
22
|
-
* how toolbar group buttons work, and the opacity of
|
|
22
|
+
/** These are the UI settings that are stored in the Redux store. They control the color theme,
|
|
23
|
+
* how toolbar group buttons work, and the opacity of floating widget when the cursor
|
|
23
24
|
* is not inside them. It is expect that an IModelApp using App UI components will create and register AppUiSettings with
|
|
24
25
|
* defaults specific to their application. This would be done by calling the following.
|
|
25
26
|
*
|
|
@@ -34,7 +35,7 @@ export declare class AppUiSettings implements UserSettingsProvider {
|
|
|
34
35
|
private static _settingNamespace;
|
|
35
36
|
private _settings;
|
|
36
37
|
private _applyingLocalSettings;
|
|
37
|
-
colorTheme: UiStateEntry<
|
|
38
|
+
colorTheme: UiStateEntry<ThemeId>;
|
|
38
39
|
dragInteraction: UiStateEntry<boolean>;
|
|
39
40
|
widgetOpacity: UiStateEntry<number>;
|
|
40
41
|
showWidgetIcon: UiStateEntry<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppUiSettings.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/uistate/AppUiSettings.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"AppUiSettings.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/uistate/AppUiSettings.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAG3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAIrD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,EAAE,OAAO,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa;IACb,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;GAUG;AACH,qBAAa,aAAc,YAAW,oBAAoB;IACxD,SAAgB,UAAU,2BAA2B;IAErD,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAmB;IACnD,OAAO,CAAC,SAAS,CAAgC;IACjD,OAAO,CAAC,sBAAsB,CAAS;IAEhC,UAAU,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IAClC,eAAe,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IACvC,aAAa,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,cAAc,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IACtC,0BAA0B,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IAClD,mBAAmB,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IAC3C,0BAA0B,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IAClD,cAAc,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAE5C,OAAO,CAAC,aAAa,CAInB;gBAEU,QAAQ,EAAE,OAAO,CAAC,oBAAoB,CAAC;IA8EnD,OAAO,CAAC,iBAAiB,CAsCvB;IAEW,KAAK,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ7C,gBAAgB,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAGtE"}
|
|
@@ -11,8 +11,8 @@ exports.AppUiSettings = void 0;
|
|
|
11
11
|
const core_react_1 = require("@itwin/core-react");
|
|
12
12
|
const SyncUiEventDispatcher_1 = require("../syncui/SyncUiEventDispatcher");
|
|
13
13
|
const UiFramework_1 = require("../UiFramework");
|
|
14
|
-
/** These are the UI settings that are stored in the Redux store. They control the color theme,
|
|
15
|
-
* how toolbar group buttons work, and the opacity of
|
|
14
|
+
/** These are the UI settings that are stored in the Redux store. They control the color theme,
|
|
15
|
+
* how toolbar group buttons work, and the opacity of floating widget when the cursor
|
|
16
16
|
* is not inside them. It is expect that an IModelApp using App UI components will create and register AppUiSettings with
|
|
17
17
|
* defaults specific to their application. This would be done by calling the following.
|
|
18
18
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":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ACnD,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC5B,CAAC;;AAnJc,+BAAiB,GAAG,eAAe,AAAlB,CAAmB;AAHxC,sCAAa","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 Settings\n */\n\nimport type { UiStateStorage } from \"@itwin/core-react\";\nimport { UiStateEntry } from \"@itwin/core-react\";\nimport { SyncUiEventDispatcher } from \"../syncui/SyncUiEventDispatcher\";\nimport type { UserSettingsProvider } from \"../UiFramework\";\nimport { UiFramework } from \"../UiFramework\";\nimport type { UiSyncEventArgs } from \"../syncui/UiSyncEvent\";\n\n// cSpell:ignore configurableui\n\n/** Default values that may be specified for [[AppUiSettings]].\n * @public\n */\nexport interface InitialAppUiSettings {\n colorTheme: string;\n dragInteraction: boolean;\n widgetOpacity: number;\n showWidgetIcon?: boolean;\n /** @alpha */\n autoCollapseUnpinnedPanels?: boolean;\n animateToolSettings?: boolean;\n useToolAsToolSettingsLabel?: boolean;\n toolbarOpacity: number;\n}\n\n/** These are the UI settings that are stored in the Redux store. They control the color theme, the UI version,\n * how toolbar group buttons work, and the opacity of widgets in 1.0 and floating widget in 2.0 when the cursor\n * is not inside them. It is expect that an IModelApp using App UI components will create and register AppUiSettings with\n * defaults specific to their application. This would be done by calling the following.\n *\n * ```ts\n * UiFramework.registerUserSettingsProvider(new AppUiSettings(defaults));\n * ```\n *\n * @public\n */\nexport class AppUiSettings implements UserSettingsProvider {\n public readonly providerId = \"AppUiSettingsProvider\";\n\n private static _settingNamespace = \"AppUiSettings\";\n private _settings: Array<UiStateEntry<any>> = [];\n private _applyingLocalSettings = false;\n\n public colorTheme: UiStateEntry<string>;\n public dragInteraction: UiStateEntry<boolean>;\n public widgetOpacity: UiStateEntry<number>;\n public showWidgetIcon: UiStateEntry<boolean>;\n public autoCollapseUnpinnedPanels: UiStateEntry<boolean>;\n public animateToolSettings: UiStateEntry<boolean>;\n public useToolAsToolSettingsLabel: UiStateEntry<boolean>;\n public toolbarOpacity: UiStateEntry<number>;\n\n private setColorTheme = (theme: string) => {\n UiFramework.setColorTheme(theme);\n // always store to local storage to avoid flicker during startup if user is not yet logged-in\n window.localStorage.setItem(\"uifw:defaultTheme\", theme);\n };\n\n constructor(defaults: Partial<InitialAppUiSettings>) {\n this._settings = [];\n\n this.colorTheme = new UiStateEntry<string>(\n AppUiSettings._settingNamespace,\n \"ColorTheme\",\n UiFramework.getColorTheme,\n this.setColorTheme,\n defaults.colorTheme\n );\n this._settings.push(this.colorTheme);\n\n this.dragInteraction = new UiStateEntry<boolean>(\n AppUiSettings._settingNamespace,\n \"DragInteraction\",\n () => UiFramework.useDragInteraction,\n (value: boolean) => UiFramework.setUseDragInteraction(value),\n defaults.dragInteraction\n );\n this._settings.push(this.dragInteraction);\n\n this.showWidgetIcon = new UiStateEntry<boolean>(\n AppUiSettings._settingNamespace,\n \"ShowWidgetIcon\",\n () => UiFramework.showWidgetIcon,\n (value: boolean) => UiFramework.setShowWidgetIcon(value),\n defaults.showWidgetIcon\n );\n this._settings.push(this.showWidgetIcon);\n\n this.autoCollapseUnpinnedPanels = new UiStateEntry<boolean>(\n AppUiSettings._settingNamespace,\n \"AutoCollapseUnpinnedPanels\",\n () => UiFramework.autoCollapseUnpinnedPanels,\n (value: boolean) => UiFramework.setAutoCollapseUnpinnedPanels(value),\n defaults.autoCollapseUnpinnedPanels\n );\n this._settings.push(this.autoCollapseUnpinnedPanels);\n\n this.widgetOpacity = new UiStateEntry<number>(\n AppUiSettings._settingNamespace,\n \"WidgetOpacity\",\n () => UiFramework.getWidgetOpacity(),\n (value: number) => UiFramework.setWidgetOpacity(value),\n defaults.widgetOpacity\n );\n this._settings.push(this.widgetOpacity);\n\n this.animateToolSettings = new UiStateEntry<boolean>(\n AppUiSettings._settingNamespace,\n \"AnimateToolSettings\",\n () => UiFramework.animateToolSettings,\n (value: boolean) => UiFramework.setAnimateToolSettings(value),\n defaults.animateToolSettings\n );\n this._settings.push(this.animateToolSettings);\n\n this.useToolAsToolSettingsLabel = new UiStateEntry<boolean>(\n AppUiSettings._settingNamespace,\n \"UseToolAsToolSettingsLabel\",\n () => UiFramework.useToolAsToolSettingsLabel,\n (value: boolean) => UiFramework.setUseToolAsToolSettingsLabel(value),\n defaults.useToolAsToolSettingsLabel\n );\n this._settings.push(this.useToolAsToolSettingsLabel);\n\n this.toolbarOpacity = new UiStateEntry<number>(\n AppUiSettings._settingNamespace,\n \"ToolOpacity\",\n () => UiFramework.getToolbarOpacity(),\n (value: number) => UiFramework.setToolbarOpacity(value),\n defaults.toolbarOpacity\n );\n this._settings.push(this.toolbarOpacity);\n\n SyncUiEventDispatcher.onSyncUiEvent.addListener(this.handleSyncUiEvent);\n }\n\n private handleSyncUiEvent = async (args: UiSyncEventArgs) => {\n if (this._applyingLocalSettings) return;\n\n if (args.eventIds.has(\"configurableui:set_theme\")) {\n await this.colorTheme.saveSetting(UiFramework.getUiStateStorage());\n // always store as default theme in local storage to avoid flicker during startup if user is not yet logged-in\n window.localStorage.setItem(\n \"uifw:defaultTheme\",\n UiFramework.getColorTheme()\n );\n }\n\n if (args.eventIds.has(\"configurableui:set-drag-interaction\"))\n await this.dragInteraction.saveSetting(UiFramework.getUiStateStorage());\n\n if (args.eventIds.has(\"configurableui:set-show-widget-icon\"))\n await this.showWidgetIcon.saveSetting(UiFramework.getUiStateStorage());\n\n if (args.eventIds.has(\"configurableui:set-auto-collapse-unpinned-panels\"))\n await this.autoCollapseUnpinnedPanels.saveSetting(\n UiFramework.getUiStateStorage()\n );\n\n if (args.eventIds.has(\"configurableui:set_widget_opacity\"))\n await this.widgetOpacity.saveSetting(UiFramework.getUiStateStorage());\n\n if (args.eventIds.has(\"configurableui:set-animate-tool-settings\"))\n await this.animateToolSettings.saveSetting(\n UiFramework.getUiStateStorage()\n );\n\n if (args.eventIds.has(\"configurableui:set-use-tool-as-tool-settings-label\"))\n await this.useToolAsToolSettingsLabel.saveSetting(\n UiFramework.getUiStateStorage()\n );\n\n if (args.eventIds.has(\"configurableui:set-toolbar-opacity\"))\n await this.toolbarOpacity.saveSetting(UiFramework.getUiStateStorage());\n };\n\n public async apply(storage: UiStateStorage): Promise<void> {\n this._applyingLocalSettings = true;\n for await (const setting of this._settings) {\n await setting.getSettingAndApplyValue(storage);\n }\n this._applyingLocalSettings = false;\n }\n\n public async loadUserSettings(storage: UiStateStorage): Promise<void> {\n await this.apply(storage);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"AppUiSettings.js","sourceRoot":"","sources":["../../../../src/appui-react/uistate/AppUiSettings.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAGH,kDAAiD;AACjD,2EAAwE;AAExE,gDAA6C;AAqB7C;;;;;;;;;;GAUG;AACH,MAAa,aAAa;IAsBxB,YAAY,QAAuC;QArBnC,eAAU,GAAG,uBAAuB,CAAC;QAG7C,cAAS,GAA6B,EAAE,CAAC;QACzC,2BAAsB,GAAG,KAAK,CAAC;QAW/B,kBAAa,GAAG,CAAC,KAAc,EAAE,EAAE;YACzC,yBAAW,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YACjC,6FAA6F;YAC7F,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,mBAAmB,EAAE,KAAK,CAAC,CAAC;QAC1D,CAAC,CAAC;QAgFM,sBAAiB,GAAG,KAAK,EAAE,IAAqB,EAAE,EAAE;YAC1D,IAAI,IAAI,CAAC,sBAAsB;gBAAE,OAAO;YAExC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,0BAA0B,CAAC,EAAE;gBACjD,MAAM,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,yBAAW,CAAC,iBAAiB,EAAE,CAAC,CAAC;gBACnE,8GAA8G;gBAC9G,MAAM,CAAC,YAAY,CAAC,OAAO,CACzB,mBAAmB,E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B,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IAC1E,CAAC;IA0CM,KAAK,CAAC,KAAK,CAAC,OAAuB;QACxC,IAAI,CAAC,sBAAsB,GAAG,IAAI,CAAC;QACnC,IAAI,KAAK,EAAE,MAAM,OAAO,IAAI,IAAI,CAAC,SAAS,EAAE;YAC1C,MAAM,OAAO,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;SAChD;QACD,IAAI,CAAC,sBAAsB,GAAG,KAAK,CAAC;IACtC,CAAC;IAEM,KAAK,CAAC,gBAAgB,CAAC,OAAuB;QACnD,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC5B,CAAC;;AAnJc,+BAAiB,GAAG,eAAe,AAAlB,CAAmB;AAHxC,sCAAa","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 Settings\n */\n\nimport type { UiStateStorage } from \"@itwin/core-react\";\nimport { UiStateEntry } from \"@itwin/core-react\";\nimport { SyncUiEventDispatcher } from \"../syncui/SyncUiEventDispatcher\";\nimport type { UserSettingsProvider } from \"../UiFramework\";\nimport { UiFramework } from \"../UiFramework\";\nimport type { UiSyncEventArgs } from \"../syncui/UiSyncEvent\";\nimport type { ThemeId } from \"../theme/ThemeManager\";\n\n// cSpell:ignore configurableui\n\n/** Default values that may be specified for [[AppUiSettings]].\n * @public\n */\nexport interface InitialAppUiSettings {\n colorTheme: ThemeId;\n dragInteraction: boolean;\n widgetOpacity: number;\n showWidgetIcon?: boolean;\n /** @alpha */\n autoCollapseUnpinnedPanels?: boolean;\n animateToolSettings?: boolean;\n useToolAsToolSettingsLabel?: boolean;\n toolbarOpacity: number;\n}\n\n/** These are the UI settings that are stored in the Redux store. They control the color theme,\n * how toolbar group buttons work, and the opacity of floating widget when the cursor\n * is not inside them. It is expect that an IModelApp using App UI components will create and register AppUiSettings with\n * defaults specific to their application. This would be done by calling the following.\n *\n * ```ts\n * UiFramework.registerUserSettingsProvider(new AppUiSettings(defaults));\n * ```\n *\n * @public\n */\nexport class AppUiSettings implements UserSettingsProvider {\n public readonly providerId = \"AppUiSettingsProvider\";\n\n private static _settingNamespace = \"AppUiSettings\";\n private _settings: Array<UiStateEntry<any>> = [];\n private _applyingLocalSettings = false;\n\n public colorTheme: UiStateEntry<ThemeId>;\n public dragInteraction: UiStateEntry<boolean>;\n public widgetOpacity: UiStateEntry<number>;\n public showWidgetIcon: UiStateEntry<boolean>;\n public autoCollapseUnpinnedPanels: UiStateEntry<boolean>;\n public animateToolSettings: UiStateEntry<boolean>;\n public useToolAsToolSettingsLabel: UiStateEntry<boolean>;\n public toolbarOpacity: UiStateEntry<number>;\n\n private setColorTheme = (theme: ThemeId) => {\n UiFramework.setColorTheme(theme);\n // always store to local storage to avoid flicker during startup if user is not yet logged-in\n window.localStorage.setItem(\"uifw:defaultTheme\", theme);\n };\n\n constructor(defaults: Partial<InitialAppUiSettings>) {\n this._settings = [];\n\n this.colorTheme = new UiStateEntry<ThemeId>(\n AppUiSettings._settingNamespace,\n \"ColorTheme\",\n UiFramework.getColorTheme,\n this.setColorTheme,\n defaults.colorTheme\n );\n this._settings.push(this.colorTheme);\n\n this.dragInteraction = new UiStateEntry<boolean>(\n AppUiSettings._settingNamespace,\n \"DragInteraction\",\n () => UiFramework.useDragInteraction,\n (value: boolean) => UiFramework.setUseDragInteraction(value),\n defaults.dragInteraction\n );\n this._settings.push(this.dragInteraction);\n\n this.showWidgetIcon = new UiStateEntry<boolean>(\n AppUiSettings._settingNamespace,\n \"ShowWidgetIcon\",\n () => UiFramework.showWidgetIcon,\n (value: boolean) => UiFramework.setShowWidgetIcon(value),\n defaults.showWidgetIcon\n );\n this._settings.push(this.showWidgetIcon);\n\n this.autoCollapseUnpinnedPanels = new UiStateEntry<boolean>(\n AppUiSettings._settingNamespace,\n \"AutoCollapseUnpinnedPanels\",\n () => UiFramework.autoCollapseUnpinnedPanels,\n (value: boolean) => UiFramework.setAutoCollapseUnpinnedPanels(value),\n defaults.autoCollapseUnpinnedPanels\n );\n this._settings.push(this.autoCollapseUnpinnedPanels);\n\n this.widgetOpacity = new UiStateEntry<number>(\n AppUiSettings._settingNamespace,\n \"WidgetOpacity\",\n () => UiFramework.getWidgetOpacity(),\n (value: number) => UiFramework.setWidgetOpacity(value),\n defaults.widgetOpacity\n );\n this._settings.push(this.widgetOpacity);\n\n this.animateToolSettings = new UiStateEntry<boolean>(\n AppUiSettings._settingNamespace,\n \"AnimateToolSettings\",\n () => UiFramework.animateToolSettings,\n (value: boolean) => UiFramework.setAnimateToolSettings(value),\n defaults.animateToolSettings\n );\n this._settings.push(this.animateToolSettings);\n\n this.useToolAsToolSettingsLabel = new UiStateEntry<boolean>(\n AppUiSettings._settingNamespace,\n \"UseToolAsToolSettingsLabel\",\n () => UiFramework.useToolAsToolSettingsLabel,\n (value: boolean) => UiFramework.setUseToolAsToolSettingsLabel(value),\n defaults.useToolAsToolSettingsLabel\n );\n this._settings.push(this.useToolAsToolSettingsLabel);\n\n this.toolbarOpacity = new UiStateEntry<number>(\n AppUiSettings._settingNamespace,\n \"ToolOpacity\",\n () => UiFramework.getToolbarOpacity(),\n (value: number) => UiFramework.setToolbarOpacity(value),\n defaults.toolbarOpacity\n );\n this._settings.push(this.toolbarOpacity);\n\n SyncUiEventDispatcher.onSyncUiEvent.addListener(this.handleSyncUiEvent);\n }\n\n private handleSyncUiEvent = async (args: UiSyncEventArgs) => {\n if (this._applyingLocalSettings) return;\n\n if (args.eventIds.has(\"configurableui:set_theme\")) {\n await this.colorTheme.saveSetting(UiFramework.getUiStateStorage());\n // always store as default theme in local storage to avoid flicker during startup if user is not yet logged-in\n window.localStorage.setItem(\n \"uifw:defaultTheme\",\n UiFramework.getColorTheme()\n );\n }\n\n if (args.eventIds.has(\"configurableui:set-drag-interaction\"))\n await this.dragInteraction.saveSetting(UiFramework.getUiStateStorage());\n\n if (args.eventIds.has(\"configurableui:set-show-widget-icon\"))\n await this.showWidgetIcon.saveSetting(UiFramework.getUiStateStorage());\n\n if (args.eventIds.has(\"configurableui:set-auto-collapse-unpinned-panels\"))\n await this.autoCollapseUnpinnedPanels.saveSetting(\n UiFramework.getUiStateStorage()\n );\n\n if (args.eventIds.has(\"configurableui:set_widget_opacity\"))\n await this.widgetOpacity.saveSetting(UiFramework.getUiStateStorage());\n\n if (args.eventIds.has(\"configurableui:set-animate-tool-settings\"))\n await this.animateToolSettings.saveSetting(\n UiFramework.getUiStateStorage()\n );\n\n if (args.eventIds.has(\"configurableui:set-use-tool-as-tool-settings-label\"))\n await this.useToolAsToolSettingsLabel.saveSetting(\n UiFramework.getUiStateStorage()\n );\n\n if (args.eventIds.has(\"configurableui:set-toolbar-opacity\"))\n await this.toolbarOpacity.saveSetting(UiFramework.getUiStateStorage());\n };\n\n public async apply(storage: UiStateStorage): Promise<void> {\n this._applyingLocalSettings = true;\n for await (const setting of this._settings) {\n await setting.getSettingAndApplyValue(storage);\n }\n this._applyingLocalSettings = false;\n }\n\n public async loadUserSettings(storage: UiStateStorage): Promise<void> {\n await this.apply(storage);\n }\n}\n"]}
|
|
@@ -13,7 +13,16 @@ export declare const UiStateStorageContext: React.Context<UiStateStorage>;
|
|
|
13
13
|
export interface UiSettingsProviderProps {
|
|
14
14
|
children?: React.ReactNode;
|
|
15
15
|
}
|
|
16
|
-
/** Allows to provide a custom [[UiStateStorage]] implementation to persist UI settings
|
|
16
|
+
/** Allows to provide a custom [[UiStateStorage]] implementation to persist UI settings
|
|
17
|
+
* through [[UiFramework.setUiStateStorage]].
|
|
18
|
+
*
|
|
19
|
+
* This component should wrap the [[ConfigurableUiContent]].
|
|
20
|
+
*
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <UiStateStorageHandler>
|
|
23
|
+
* <ConfigurableUiContent />
|
|
24
|
+
* </UiStateStorageHandler>
|
|
25
|
+
* ```
|
|
17
26
|
* @public
|
|
18
27
|
*/
|
|
19
28
|
export declare function UiStateStorageHandler(props: UiSettingsProviderProps): JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUiStateStorage.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/uistate/useUiStateStorage.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AASxD,cAAc;AACd,wBAAgB,wBAAwB,IAAI,cAAc,CAEzD;AAED,gBAAgB;AAChB,eAAO,MAAM,qBAAqB,+BAEjC,CAAC;AAGF;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED
|
|
1
|
+
{"version":3,"file":"useUiStateStorage.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/uistate/useUiStateStorage.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AASxD,cAAc;AACd,wBAAgB,wBAAwB,IAAI,cAAc,CAEzD;AAED,gBAAgB;AAChB,eAAO,MAAM,qBAAqB,+BAEjC,CAAC;AAGF;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,uBAAuB,eAyBnE"}
|
|
@@ -20,7 +20,16 @@ exports.useUiStateStorageHandler = useUiStateStorageHandler;
|
|
|
20
20
|
/** @internal */
|
|
21
21
|
exports.UiStateStorageContext = React.createContext(new core_react_1.LocalStateStorage());
|
|
22
22
|
exports.UiStateStorageContext.displayName = "uifw:UiStateStorageContext";
|
|
23
|
-
/** Allows to provide a custom [[UiStateStorage]] implementation to persist UI settings
|
|
23
|
+
/** Allows to provide a custom [[UiStateStorage]] implementation to persist UI settings
|
|
24
|
+
* through [[UiFramework.setUiStateStorage]].
|
|
25
|
+
*
|
|
26
|
+
* This component should wrap the [[ConfigurableUiContent]].
|
|
27
|
+
*
|
|
28
|
+
* ```tsx
|
|
29
|
+
* <UiStateStorageHandler>
|
|
30
|
+
* <ConfigurableUiContent />
|
|
31
|
+
* </UiStateStorageHandler>
|
|
32
|
+
* ```
|
|
24
33
|
* @public
|
|
25
34
|
*/
|
|
26
35
|
function UiStateStorageHandler(props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUiStateStorage.js","sourceRoot":"","sources":["../../../../src/appui-react/uistate/useUiStateStorage.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B;AAE/B,kDAAsD;AACtD,gDAA6C;AAC7C,2EAGyC;AAGzC,cAAc;AACd,SAAgB,wBAAwB;IACtC,OAAO,KAAK,CAAC,UAAU,CAAC,6BAAqB,CAAC,CAAC;AACjD,CAAC;AAFD,4DAEC;AAED,gBAAgB;AACH,QAAA,qBAAqB,GAAG,KAAK,CAAC,aAAa,CACtD,IAAI,8BAAiB,EAAE,CACxB,CAAC;AACF,6BAAqB,CAAC,WAAW,GAAG,4BAA4B,CAAC;AASjE
|
|
1
|
+
{"version":3,"file":"useUiStateStorage.js","sourceRoot":"","sources":["../../../../src/appui-react/uistate/useUiStateStorage.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B;AAE/B,kDAAsD;AACtD,gDAA6C;AAC7C,2EAGyC;AAGzC,cAAc;AACd,SAAgB,wBAAwB;IACtC,OAAO,KAAK,CAAC,UAAU,CAAC,6BAAqB,CAAC,CAAC;AACjD,CAAC;AAFD,4DAEC;AAED,gBAAgB;AACH,QAAA,qBAAqB,GAAG,KAAK,CAAC,aAAa,CACtD,IAAI,8BAAiB,EAAE,CACxB,CAAC;AACF,6BAAqB,CAAC,WAAW,GAAG,4BAA4B,CAAC;AASjE;;;;;;;;;;;GAWG;AACH,SAAgB,qBAAqB,CAAC,KAA8B;IAClE,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,KAAK,CAAC,QAAQ,CACpD,yBAAW,CAAC,iBAAiB,EAAE,CAChC,CAAC;IAEF,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,uBAAuB;QACvB,MAAM,iBAAiB,GAAG,CAAC,IAAqB,EAAQ,EAAE;YACxD,IACE,6CAAqB,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,EAAE;gBACtD,qCAAa,CAAC,qBAAqB;aACpC,CAAC;gBAEF,eAAe,CAAC,yBAAW,CAAC,iBAAiB,EAAE,CAAC,CAAC;QACrD,CAAC,CAAC;QAEF,OAAO,6CAAqB,CAAC,aAAa,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC;IAEH,OAAO,CACL,oBAAC,6BAAqB,CAAC,QAAQ,IAC7B,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,KAAK,EAAE,YAAY,GACnB,CACH,CAAC;AACJ,CAAC;AAzBD,sDAyBC","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 UiStateStorage\n */\n\nimport * as React from \"react\";\nimport type { UiStateStorage } from \"@itwin/core-react\";\nimport { LocalStateStorage } from \"@itwin/core-react\";\nimport { UiFramework } from \"../UiFramework\";\nimport {\n SyncUiEventDispatcher,\n SyncUiEventId,\n} from \"../syncui/SyncUiEventDispatcher\";\nimport type { UiSyncEventArgs } from \"../syncui/UiSyncEvent\";\n\n/** @public */\nexport function useUiStateStorageHandler(): UiStateStorage {\n return React.useContext(UiStateStorageContext);\n}\n\n/** @internal */\nexport const UiStateStorageContext = React.createContext<UiStateStorage>(\n new LocalStateStorage()\n);\nUiStateStorageContext.displayName = \"uifw:UiStateStorageContext\";\n\n/** Properties for the [[UiStateStorageHandler]] component.\n * @public\n */\nexport interface UiSettingsProviderProps {\n children?: React.ReactNode;\n}\n\n/** Allows to provide a custom [[UiStateStorage]] implementation to persist UI settings\n * through [[UiFramework.setUiStateStorage]].\n *\n * This component should wrap the [[ConfigurableUiContent]].\n *\n * ```tsx\n * <UiStateStorageHandler>\n * <ConfigurableUiContent />\n * </UiStateStorageHandler>\n * ```\n * @public\n */\nexport function UiStateStorageHandler(props: UiSettingsProviderProps) {\n const [stateStorage, setStateStorage] = React.useState(\n UiFramework.getUiStateStorage()\n );\n\n React.useEffect(() => {\n // istanbul ignore next\n const handleSyncUiEvent = (args: UiSyncEventArgs): void => {\n if (\n SyncUiEventDispatcher.hasEventOfInterest(args.eventIds, [\n SyncUiEventId.UiStateStorageChanged,\n ])\n )\n setStateStorage(UiFramework.getUiStateStorage());\n };\n\n return SyncUiEventDispatcher.onSyncUiEvent.addListener(handleSyncUiEvent);\n });\n\n return (\n <UiStateStorageContext.Provider\n children={props.children} // eslint-disable-line react/no-children-prop\n value={stateStorage}\n />\n );\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Utilities
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Interface that returns indices of matches
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export interface IMatch {
|
|
9
|
+
start: number;
|
|
10
|
+
end: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Matches beginning of words supporting non-ASCII languages.
|
|
14
|
+
* @param word Filter string
|
|
15
|
+
* @param target String being searched
|
|
16
|
+
* @param contiguous - If true the filter string must be found "contiguous" in the searched string (E.g. "pul" will match "Git: Pull").
|
|
17
|
+
* Otherwise also matches sub string of the word with beginnings of the words in the target (e.g. "gp" or "g p" will match "Git: Pull").
|
|
18
|
+
* Useful in cases where the target is words (e.g. command labels)
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export declare function matchesWords(word: string, target: string, contiguous?: boolean): IMatch[] | null;
|
|
22
|
+
//# sourceMappingURL=matchesWords.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matchesWords.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/utils/matchesWords.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;;GAGG;AACH,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,GAAE,OAAe,GAC1B,MAAM,EAAE,GAAG,IAAI,CAkBjB"}
|
|
@@ -0,0 +1,103 @@
|
|
|
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.matchesWords = void 0;
|
|
11
|
+
/**
|
|
12
|
+
* Matches beginning of words supporting non-ASCII languages.
|
|
13
|
+
* @param word Filter string
|
|
14
|
+
* @param target String being searched
|
|
15
|
+
* @param contiguous - If true the filter string must be found "contiguous" in the searched string (E.g. "pul" will match "Git: Pull").
|
|
16
|
+
* Otherwise also matches sub string of the word with beginnings of the words in the target (e.g. "gp" or "g p" will match "Git: Pull").
|
|
17
|
+
* Useful in cases where the target is words (e.g. command labels)
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
function matchesWords(word, target, contiguous = false) {
|
|
21
|
+
if (!target || target.length === 0) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
let result = null;
|
|
25
|
+
let i = 0;
|
|
26
|
+
word = word.toLowerCase();
|
|
27
|
+
target = target.toLowerCase();
|
|
28
|
+
while (i < target.length &&
|
|
29
|
+
(result = matchesWordsInternal(word, target, 0, i, contiguous)) === null) {
|
|
30
|
+
i = nextWord(target, i + 1);
|
|
31
|
+
}
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
exports.matchesWords = matchesWords;
|
|
35
|
+
function matchesWordsInternal(word, target, i, j, contiguous) {
|
|
36
|
+
if (i === word.length) {
|
|
37
|
+
return [];
|
|
38
|
+
}
|
|
39
|
+
else if (j === target.length) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
else if (!charactersMatch(word.charCodeAt(i), target.charCodeAt(j))) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
let result = null;
|
|
47
|
+
let nextWordIndex = j + 1;
|
|
48
|
+
result = matchesWordsInternal(word, target, i + 1, j + 1, contiguous);
|
|
49
|
+
if (!contiguous) {
|
|
50
|
+
while (!result &&
|
|
51
|
+
(nextWordIndex = nextWord(target, nextWordIndex)) < target.length) {
|
|
52
|
+
result = matchesWordsInternal(word, target, i + 1, nextWordIndex, contiguous);
|
|
53
|
+
nextWordIndex++;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return result === null ? null : join({ start: j, end: j + 1 }, result);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function nextWord(word, start) {
|
|
60
|
+
for (let i = start; i < word.length; i++) {
|
|
61
|
+
if (isWordSeparator(word.charCodeAt(i)) ||
|
|
62
|
+
(i > 0 && isWordSeparator(word.charCodeAt(i - 1)))) {
|
|
63
|
+
return i;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return word.length;
|
|
67
|
+
}
|
|
68
|
+
var CharCode;
|
|
69
|
+
(function (CharCode) {
|
|
70
|
+
CharCode[CharCode["Space"] = 32] = "Space";
|
|
71
|
+
CharCode[CharCode["Tab"] = 9] = "Tab";
|
|
72
|
+
CharCode[CharCode["LineFeed"] = 10] = "LineFeed";
|
|
73
|
+
CharCode[CharCode["CarriageReturn"] = 13] = "CarriageReturn";
|
|
74
|
+
})(CharCode || (CharCode = {}));
|
|
75
|
+
function isWhitespace(code) {
|
|
76
|
+
return (code === CharCode.Space ||
|
|
77
|
+
code === CharCode.Tab ||
|
|
78
|
+
code === CharCode.LineFeed ||
|
|
79
|
+
code === CharCode.CarriageReturn);
|
|
80
|
+
}
|
|
81
|
+
const wordSeparators = new Set();
|
|
82
|
+
"`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?"
|
|
83
|
+
.split("")
|
|
84
|
+
.forEach((s) => wordSeparators.add(s.charCodeAt(0)));
|
|
85
|
+
function isWordSeparator(code) {
|
|
86
|
+
return isWhitespace(code) || wordSeparators.has(code);
|
|
87
|
+
}
|
|
88
|
+
function charactersMatch(codeA, codeB) {
|
|
89
|
+
return codeA === codeB || (isWordSeparator(codeA) && isWordSeparator(codeB));
|
|
90
|
+
}
|
|
91
|
+
function join(head, tail) {
|
|
92
|
+
if (tail.length === 0) {
|
|
93
|
+
tail = [head];
|
|
94
|
+
}
|
|
95
|
+
else if (head.end === tail[0].start) {
|
|
96
|
+
tail[0].start = head.start;
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
tail.unshift(head);
|
|
100
|
+
}
|
|
101
|
+
return tail;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=matchesWords.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matchesWords.js","sourceRoot":"","sources":["../../../../src/appui-react/utils/matchesWords.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;A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CACjC,CAAC;AACJ,CAAC;AACD,MAAM,cAAc,GAAG,IAAI,GAAG,EAAU,CAAC;AACzC,mCAAmC;KAChC,KAAK,CAAC,EAAE,CAAC;KACT,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAEvD,SAAS,eAAe,CAAC,IAAY;IACnC,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACxD,CAAC;AAED,SAAS,eAAe,CAAC,KAAa,EAAE,KAAa;IACnD,OAAO,KAAK,KAAK,KAAK,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;AAC/E,CAAC;AAED,SAAS,IAAI,CAAC,IAAY,EAAE,IAAc;IACxC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;QACrB,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC;KACf;SAAM,IAAI,IAAI,CAAC,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE;QACrC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;KAC5B;SAAM;QACL,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KACpB;IACD,OAAO,IAAI,CAAC;AACd,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\n/**\n * Interface that returns indices of matches\n * @internal\n */\nexport interface IMatch {\n start: number;\n end: number;\n}\n\n/**\n * Matches beginning of words supporting non-ASCII languages.\n * @param word Filter string\n * @param target String being searched\n * @param contiguous - If true the filter string must be found \"contiguous\" in the searched string (E.g. \"pul\" will match \"Git: Pull\").\n * Otherwise also matches sub string of the word with beginnings of the words in the target (e.g. \"gp\" or \"g p\" will match \"Git: Pull\").\n * Useful in cases where the target is words (e.g. command labels)\n * @internal\n */\nexport function matchesWords(\n word: string,\n target: string,\n contiguous: boolean = false\n): IMatch[] | null {\n if (!target || target.length === 0) {\n return null;\n }\n\n let result: IMatch[] | null = null;\n let i = 0;\n\n word = word.toLowerCase();\n target = target.toLowerCase();\n while (\n i < target.length &&\n (result = matchesWordsInternal(word, target, 0, i, contiguous)) === null\n ) {\n i = nextWord(target, i + 1);\n }\n\n return result;\n}\n\nfunction matchesWordsInternal(\n word: string,\n target: string,\n i: number,\n j: number,\n contiguous: boolean\n): IMatch[] | null {\n if (i === word.length) {\n return [];\n } else if (j === target.length) {\n return null;\n } else if (!charactersMatch(word.charCodeAt(i), target.charCodeAt(j))) {\n return null;\n } else {\n let result: IMatch[] | null = null;\n let nextWordIndex = j + 1;\n result = matchesWordsInternal(word, target, i + 1, j + 1, contiguous);\n if (!contiguous) {\n while (\n !result &&\n (nextWordIndex = nextWord(target, nextWordIndex)) < target.length\n ) {\n result = matchesWordsInternal(\n word,\n target,\n i + 1,\n nextWordIndex,\n contiguous\n );\n nextWordIndex++;\n }\n }\n return result === null ? null : join({ start: j, end: j + 1 }, result);\n }\n}\n\nfunction nextWord(word: string, start: number): number {\n for (let i = start; i < word.length; i++) {\n if (\n isWordSeparator(word.charCodeAt(i)) ||\n (i > 0 && isWordSeparator(word.charCodeAt(i - 1)))\n ) {\n return i;\n }\n }\n return word.length;\n}\n\nenum CharCode {\n Space = 32,\n Tab = 9,\n LineFeed = 10,\n CarriageReturn = 13,\n}\n\nfunction isWhitespace(code: number): boolean {\n return (\n code === CharCode.Space ||\n code === CharCode.Tab ||\n code === CharCode.LineFeed ||\n code === CharCode.CarriageReturn\n );\n}\nconst wordSeparators = new Set<number>();\n\"`~!@#$%^&*()-=+[{]}\\\\|;:'\\\",.<>/?\"\n .split(\"\")\n .forEach((s) => wordSeparators.add(s.charCodeAt(0)));\n\nfunction isWordSeparator(code: number): boolean {\n return isWhitespace(code) || wordSeparators.has(code);\n}\n\nfunction charactersMatch(codeA: number, codeB: number): boolean {\n return codeA === codeB || (isWordSeparator(codeA) && isWordSeparator(codeB));\n}\n\nfunction join(head: IMatch, tail: IMatch[]): IMatch[] {\n if (tail.length === 0) {\n tail = [head];\n } else if (head.end === tail[0].start) {\n tail[0].start = head.start;\n } else {\n tail.unshift(head);\n }\n return tail;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Frontstage.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/widget-panels/Frontstage.tsx"],"names":[],"mappings":"AAIA;;GAEG;;AAIH,OAAO,mBAAmB,CAAC;AAK3B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAa,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEpE,OAAO,KAAK,EAEV,WAAW,EACX,cAAc,EACd,aAAa,EACb,SAAS,EACT,QAAQ,EACT,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"Frontstage.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/widget-panels/Frontstage.tsx"],"names":[],"mappings":"AAIA;;GAEG;;AAIH,OAAO,mBAAmB,CAAC;AAK3B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAa,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEpE,OAAO,KAAK,EAEV,WAAW,EACX,cAAc,EACd,aAAa,EACb,SAAS,EACT,QAAQ,EACT,MAAM,2BAA2B,CAAC;AAyBnC,OAAO,EACL,KAAK,aAAa,EAEnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,eAAe,EAAe,MAAM,8BAA8B,CAAC;AAG5E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AA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;CACtB;AAGD,KAAK,aAAa,GAAG,IAAI,CACvB,QAAQ,EACR,OAAO,GAAG,WAAW,GAAG,gCAAgC,GAAG,UAAU,CACtE,CAAC;AAEF,UAAU,cAAc;IACtB,QAAQ,EAAE,EAAE,EAAE,MAAM,GAAG,aAAa,CAAC;CACtC;AAED,UAAU,kBAAmB,SAAQ,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC;IAC9D,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;CAC/B;AAED,gBAAgB;AAChB,wBAAgB,UAAU,CAAC,KAAK,EAAE,aAAa,EAAE,EAAE,EAAE,QAAQ,CAAC,IAAI,CAAC,iBAgBlE;AAED,gBAAgB;AAChB,wBAAgB,YAAY,CAAC,KAAK,EAAE,aAAa,EAAE,EAAE,EAAE,QAAQ,CAAC,IAAI,CAAC,iBAepE;AAED,gBAAgB;AAChB,wBAAgB,uBAAuB,CAAC,aAAa,EAAE,aAAa,QA+CnE;AAED,gBAAgB;AAChB,wBAAgB,yBAAyB,CACvC,aAAa,EAAE,aAAa,EAC5B,KAAK,EAAE,WAAW,QAkDnB;AAED,gBAAgB;AAChB,eAAO,MAAM,6BAA6B,4BAA4B,CAAC;AAEvE,gBAAgB;AAChB,wBAAgB,6BAA6B,CAC3C,YAAY,EAAE,2BAA2B,CAAC,IAAI,CAAC,UAGhD;AAmCD,gBAAgB;AAChB,wBAAgB,oBAAoB,CAClC,aAAa,EAAE,aAAa,EAC5B,0BAA0B,CAAC,EAAE,OAAO,QA8DrC;AAED,gBAAgB;AAEhB,wBAAgB,eAAe,CAAC,aAAa,EAAE,aAAa,QAqB3D"}
|
|
@@ -38,17 +38,29 @@ const WidgetState_1 = require("../widgets/WidgetState");
|
|
|
38
38
|
const StagePanelSection_1 = require("../stagepanels/StagePanelSection");
|
|
39
39
|
const StagePanelLocation_1 = require("../stagepanels/StagePanelLocation");
|
|
40
40
|
const UiItemsManager_1 = require("../ui-items-provider/UiItemsManager");
|
|
41
|
+
const PreviewFeatures_1 = require("../preview/PreviewFeatures");
|
|
42
|
+
const classnames_1 = require("classnames");
|
|
41
43
|
function WidgetPanelsFrontstageComponent() {
|
|
42
44
|
const activeModalFrontstageInfo = (0, ModalFrontstageComposer_1.useActiveModalFrontstageInfo)();
|
|
43
45
|
const uiIsVisible = (0, useUiVisibility_1.useUiVisibility)();
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
const previewFeatures = (0, PreviewFeatures_1.usePreviewFeatures)();
|
|
47
|
+
const previewContentAlwaysMaxSizeDockedClass = (0, ToolSettings_1.useShouldRenderDockedToolSettings)() &&
|
|
48
|
+
previewFeatures.contentAlwaysMaxSize &&
|
|
49
|
+
"preview-contentAlwaysMaxSize-toolSettingsDocked";
|
|
50
|
+
const previewContentAlwaysMaxSizeTopPanelClass = (0, appui_layout_react_1.useLayout)((state) => {
|
|
51
|
+
return state.panels.top.widgets.length > 0;
|
|
52
|
+
}) &&
|
|
53
|
+
previewFeatures.contentAlwaysMaxSize &&
|
|
54
|
+
"preview-contentAlwaysMaxSize-topPanelActive";
|
|
55
|
+
return (React.createElement(appui_layout_react_1.PreviewLayoutFeaturesProvider, { ...previewFeatures },
|
|
56
|
+
React.createElement(appui_layout_react_1.PreviewMaximizedWidgetFeatureProvider, { enabled: previewFeatures.enableMaximizedFloatingWidget },
|
|
57
|
+
React.createElement(ToolSettings_1.WidgetPanelsToolSettings, null),
|
|
58
|
+
React.createElement(components_react_1.ToolbarPopupAutoHideContext.Provider, { value: !uiIsVisible },
|
|
59
|
+
React.createElement(ModalFrontstageComposer_1.ModalFrontstageComposer, { stageInfo: activeModalFrontstageInfo }),
|
|
60
|
+
React.createElement(appui_layout_react_1.WidgetPanels, { className: (0, classnames_1.default)("uifw-widgetPanels", previewContentAlwaysMaxSizeDockedClass, previewContentAlwaysMaxSizeTopPanelClass), centerContent: React.createElement(Toolbars_1.WidgetPanelsToolbars, null) },
|
|
61
|
+
React.createElement(FrontstageContent_1.WidgetPanelsFrontstageContent, null)),
|
|
62
|
+
React.createElement(StatusBar_1.WidgetPanelsStatusBar, null),
|
|
63
|
+
React.createElement(appui_layout_react_1.FloatingWidgets, null)))));
|
|
52
64
|
}
|
|
53
65
|
const widgetContent = React.createElement(Content_1.WidgetContent, null);
|
|
54
66
|
const toolSettingsContent = React.createElement(ToolSettings_1.ToolSettingsContent, null);
|
|
@@ -674,6 +686,7 @@ exports.useSavedFrontstageState = useSavedFrontstageState;
|
|
|
674
686
|
/** @internal */
|
|
675
687
|
function useSaveFrontstageSettings(frontstageDef, store) {
|
|
676
688
|
const uiSettingsStorage = (0, useUiStateStorage_1.useUiStateStorageHandler)();
|
|
689
|
+
const pendingSave = React.useRef(() => { });
|
|
677
690
|
const saveSetting = React.useMemo(() => {
|
|
678
691
|
const debounced = debounce(async (frontstage, state) => {
|
|
679
692
|
const id = frontstage.id;
|
|
@@ -691,8 +704,14 @@ function useSaveFrontstageSettings(frontstageDef, store) {
|
|
|
691
704
|
debounced(frontstage, state);
|
|
692
705
|
};
|
|
693
706
|
save.cancel = debounced.cancel;
|
|
707
|
+
pendingSave.current = debounced.immediate;
|
|
694
708
|
return save;
|
|
695
709
|
}, [uiSettingsStorage]);
|
|
710
|
+
React.useEffect(() => {
|
|
711
|
+
return () => {
|
|
712
|
+
pendingSave.current();
|
|
713
|
+
};
|
|
714
|
+
}, [frontstageDef]);
|
|
696
715
|
React.useEffect(() => {
|
|
697
716
|
return () => {
|
|
698
717
|
saveSetting.cancel();
|
|
@@ -718,16 +737,30 @@ exports.getFrontstageStateSettingName = getFrontstageStateSettingName;
|
|
|
718
737
|
// istanbul ignore next
|
|
719
738
|
function debounce(func, duration) {
|
|
720
739
|
let timeout;
|
|
740
|
+
let handler;
|
|
721
741
|
const debounced = (...args) => {
|
|
722
|
-
|
|
742
|
+
handler = () => {
|
|
723
743
|
timeout = undefined;
|
|
724
744
|
return func(...args);
|
|
725
745
|
};
|
|
726
746
|
window.clearTimeout(timeout);
|
|
727
747
|
timeout = window.setTimeout(handler, duration);
|
|
728
748
|
};
|
|
749
|
+
/**
|
|
750
|
+
* Will cancel the timeout without running the function.
|
|
751
|
+
*/
|
|
729
752
|
debounced.cancel = () => {
|
|
730
753
|
window.clearTimeout(timeout);
|
|
754
|
+
timeout = undefined;
|
|
755
|
+
};
|
|
756
|
+
/**
|
|
757
|
+
* If not already ran, will run the function immediately and remove the timeout.
|
|
758
|
+
*/
|
|
759
|
+
debounced.immediate = () => {
|
|
760
|
+
if (timeout === undefined)
|
|
761
|
+
return;
|
|
762
|
+
debounced.cancel();
|
|
763
|
+
handler?.();
|
|
731
764
|
};
|
|
732
765
|
return debounced;
|
|
733
766
|
}
|