@itwin/appui-react 4.6.4 → 4.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -3
- 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/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/content/InternalContentViewManager.js +1 -1
- package/lib/cjs/appui-react/content/InternalContentViewManager.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 +25 -13
- 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 +11 -5
- 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.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/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/content/InternalContentViewManager.js +1 -1
- package/lib/esm/appui-react/content/InternalContentViewManager.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 +27 -15
- 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 +9 -4
- 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.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
|
@@ -13,13 +13,39 @@ import type { Widget } from "../widgets/Widget";
|
|
|
13
13
|
export interface UiItemsProvider {
|
|
14
14
|
/** Id of provider. */
|
|
15
15
|
readonly id: string;
|
|
16
|
-
/** Provides toolbar items.
|
|
16
|
+
/** Provides toolbar items.
|
|
17
|
+
* @note Use [[ToolbarItem.layouts]] to map item to location previously specified by `provideToolbarItems` arguments.
|
|
18
|
+
* @alpha
|
|
19
|
+
*/
|
|
20
|
+
readonly getToolbarItems?: () => ReadonlyArray<ToolbarItem>;
|
|
21
|
+
/** Provides status bar items.
|
|
22
|
+
* @alpha
|
|
23
|
+
*/
|
|
24
|
+
readonly getStatusBarItems?: () => ReadonlyArray<StatusBarItem>;
|
|
25
|
+
/** Provides backstage items.
|
|
26
|
+
* @alpha
|
|
27
|
+
*/
|
|
28
|
+
readonly getBackstageItems?: () => ReadonlyArray<BackstageItem>;
|
|
29
|
+
/** Provides widgets.
|
|
30
|
+
* @note Use [[Widget.layouts]] to map item to location previously specified by `provideWidgets` arguments.
|
|
31
|
+
* @alpha
|
|
32
|
+
*/
|
|
33
|
+
readonly getWidgets?: () => ReadonlyArray<Widget>;
|
|
34
|
+
/** Provides toolbar items.
|
|
35
|
+
* @note Use [[UiItemsProvider.getToolbarItems]] instead. To map item to location previously specified by arguments use [[ToolbarItem.layouts]].
|
|
36
|
+
*/
|
|
17
37
|
readonly provideToolbarItems?: (stageId: string, stageUsage: string, toolbarUsage: ToolbarUsage, toolbarOrientation: ToolbarOrientation) => ReadonlyArray<ToolbarItem>;
|
|
18
|
-
/** Provides status bar items.
|
|
38
|
+
/** Provides status bar items.
|
|
39
|
+
* @note Use [[UiItemsProvider.getStatusBarItems]] instead.
|
|
40
|
+
*/
|
|
19
41
|
readonly provideStatusBarItems?: (stageId: string, stageUsage: string) => ReadonlyArray<StatusBarItem>;
|
|
20
|
-
/** Provides backstage items.
|
|
42
|
+
/** Provides backstage items.
|
|
43
|
+
* @note Use [[UiItemsProvider.getBackstageItems]] instead.
|
|
44
|
+
*/
|
|
21
45
|
readonly provideBackstageItems?: () => ReadonlyArray<BackstageItem>;
|
|
22
|
-
/** Provides widgets.
|
|
46
|
+
/** Provides widgets.
|
|
47
|
+
* @note Use [[UiItemsProvider.getWidgets]] instead. To map item to location previously specified by arguments use [[Widget.layouts]].
|
|
48
|
+
*/
|
|
23
49
|
readonly provideWidgets?: (stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection) => ReadonlyArray<Widget>;
|
|
24
50
|
/** Function called when the provider is unregistered. Allows provider to do a cleanup. */
|
|
25
51
|
readonly onUnregister?: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiItemsProvider.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/ui-items-provider/UiItemsProvider.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EAClB,YAAY,EACb,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,sBAAsB;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB,
|
|
1
|
+
{"version":3,"file":"UiItemsProvider.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/ui-items-provider/UiItemsProvider.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,KAAK,EAAE,aAAa,EAAE,M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QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CACpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiItemsProvider.js","sourceRoot":"","sources":["../../../../src/appui-react/ui-items-provider/UiItemsProvider.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG","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 UiProvider\n */\n\nimport type { BackstageItem } from \"../backstage/BackstageItem\";\nimport type { StagePanelLocation } from \"../stagepanels/StagePanelLocation\";\nimport type { StagePanelSection } from \"../stagepanels/StagePanelSection\";\nimport type { StatusBarItem } from \"../statusbar/StatusBarItem\";\nimport type {\n ToolbarItem,\n ToolbarOrientation,\n ToolbarUsage,\n} from \"../toolbar/ToolbarItem\";\nimport type { Widget } from \"../widgets/Widget\";\n\n/** Describes interface of objects that want to provide UI component to the running IModelApp.\n * @public\n */\nexport interface UiItemsProvider {\n /** Id of provider. */\n readonly id: string;\n\n /** Provides toolbar items. */\n readonly provideToolbarItems?: (\n stageId: string,\n stageUsage: string,\n toolbarUsage: ToolbarUsage,\n toolbarOrientation: ToolbarOrientation\n ) => ReadonlyArray<ToolbarItem>;\n /** Provides status bar items. */\n readonly provideStatusBarItems?: (\n stageId: string,\n stageUsage: string\n ) => ReadonlyArray<StatusBarItem>;\n /** Provides backstage items. */\n readonly provideBackstageItems?: () => ReadonlyArray<BackstageItem>;\n /** Provides widgets. */\n readonly provideWidgets?: (\n stageId: string,\n stageUsage: string,\n location: StagePanelLocation,\n section?: StagePanelSection\n ) => ReadonlyArray<Widget>;\n /** Function called when the provider is unregistered. Allows provider to do a cleanup. */\n readonly onUnregister?: () => void;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"UiItemsProvider.js","sourceRoot":"","sources":["../../../../src/appui-react/ui-items-provider/UiItemsProvider.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG","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 UiProvider\n */\n\nimport type { BackstageItem } from \"../backstage/BackstageItem\";\nimport type { StagePanelLocation } from \"../stagepanels/StagePanelLocation\";\nimport type { StagePanelSection } from \"../stagepanels/StagePanelSection\";\nimport type { StatusBarItem } from \"../statusbar/StatusBarItem\";\nimport type {\n ToolbarItem,\n ToolbarOrientation,\n ToolbarUsage,\n} from \"../toolbar/ToolbarItem\";\nimport type { Widget } from \"../widgets/Widget\";\n\n/** Describes interface of objects that want to provide UI component to the running IModelApp.\n * @public\n */\nexport interface UiItemsProvider {\n /** Id of provider. */\n readonly id: string;\n\n /** Provides toolbar items.\n * @note Use [[ToolbarItem.layouts]] to map item to location previously specified by `provideToolbarItems` arguments.\n * @alpha\n */\n readonly getToolbarItems?: () => ReadonlyArray<ToolbarItem>;\n /** Provides status bar items.\n * @alpha\n */\n readonly getStatusBarItems?: () => ReadonlyArray<StatusBarItem>;\n /** Provides backstage items.\n * @alpha\n */\n readonly getBackstageItems?: () => ReadonlyArray<BackstageItem>;\n /** Provides widgets.\n * @note Use [[Widget.layouts]] to map item to location previously specified by `provideWidgets` arguments.\n * @alpha\n */\n readonly getWidgets?: () => ReadonlyArray<Widget>;\n\n /** Provides toolbar items.\n * @note Use [[UiItemsProvider.getToolbarItems]] instead. To map item to location previously specified by arguments use [[ToolbarItem.layouts]].\n */\n readonly provideToolbarItems?: (\n stageId: string,\n stageUsage: string,\n toolbarUsage: ToolbarUsage,\n toolbarOrientation: ToolbarOrientation\n ) => ReadonlyArray<ToolbarItem>;\n /** Provides status bar items.\n * @note Use [[UiItemsProvider.getStatusBarItems]] instead.\n */\n readonly provideStatusBarItems?: (\n stageId: string,\n stageUsage: string\n ) => ReadonlyArray<StatusBarItem>;\n /** Provides backstage items.\n * @note Use [[UiItemsProvider.getBackstageItems]] instead.\n */\n readonly provideBackstageItems?: () => ReadonlyArray<BackstageItem>;\n /** Provides widgets.\n * @note Use [[UiItemsProvider.getWidgets]] instead. To map item to location previously specified by arguments use [[Widget.layouts]].\n */\n readonly provideWidgets?: (\n stageId: string,\n stageUsage: string,\n location: StagePanelLocation,\n section?: StagePanelSection\n ) => ReadonlyArray<Widget>;\n /** Function called when the provider is unregistered. Allows provider to do a cleanup. */\n readonly onUnregister?: () => void;\n}\n"]}
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import type { XAndY } from "@itwin/core-geometry";
|
|
6
|
-
import type { AbstractMenuItemProps, AbstractToolbarProps, DialogLayoutDataProvider, DialogProps,
|
|
6
|
+
import type { AbstractMenuItemProps, AbstractToolbarProps, DialogLayoutDataProvider, DialogProps, OnCancelFunc, OnItemExecutedFunc, OnNumberCommitFunc, OnValueCommitFunc, Primitives, PropertyDescription, PropertyRecord } from "@itwin/appui-abstract";
|
|
7
7
|
import { RelativePosition, UiAdmin } from "@itwin/appui-abstract";
|
|
8
|
+
import type { IMatch } from "../utils/matchesWords";
|
|
8
9
|
/** Controls whether localized and/or non-localized key-in strings appear in a KeyinField's auto-completion list.
|
|
9
10
|
* @public
|
|
10
11
|
*/
|
|
@@ -27,7 +28,15 @@ export interface KeyinEntry {
|
|
|
27
28
|
/** true if entry was loaded from key-in history */
|
|
28
29
|
isHistory?: boolean;
|
|
29
30
|
}
|
|
30
|
-
/**
|
|
31
|
+
/** Subclass of `UiAdmin` in `@itwin/core-frontend` to be used to initialize `IModelApp`.
|
|
32
|
+
*
|
|
33
|
+
* This implementation uses themed react components that blends in AppUI look and feel.
|
|
34
|
+
*
|
|
35
|
+
* ```ts
|
|
36
|
+
* await IModelApp.startup({
|
|
37
|
+
* uiAdmin: new FrameworkUiAdmin()
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
31
40
|
* @public
|
|
32
41
|
*/
|
|
33
42
|
export declare class FrameworkUiAdmin extends UiAdmin {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FrameworkUiAdmin.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/uiadmin/FrameworkUiAdmin.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,KAAK,EACV,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,EACxB,WAAW,EACX,
|
|
1
|
+
{"version":3,"file":"FrameworkUiAdmin.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/uiadmin/FrameworkUiAdmin.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,KAAK,EACV,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,EACxB,WAAW,EACX,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,UAAU,EACV,mBAAmB,EACnB,cAAc,EACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAIlE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAKpD;;GAEG;AACH,oBAAY,sBAAsB;IAChC,iDAAiD;IACjD,YAAY,IAAA;IACZ,6CAA6C;IAC7C,SAAS,IAAA;IACT,mEAAmE;IACnE,IAAI,IAAA;CACL;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,OAAO,CAAC,EAAE,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AwBvD"}
|
|
@@ -25,7 +25,15 @@ export var KeyinFieldLocalization;
|
|
|
25
25
|
/** Include localized and non-localized strings for each key-in. */
|
|
26
26
|
KeyinFieldLocalization[KeyinFieldLocalization["Both"] = 2] = "Both";
|
|
27
27
|
})(KeyinFieldLocalization || (KeyinFieldLocalization = {}));
|
|
28
|
-
/**
|
|
28
|
+
/** Subclass of `UiAdmin` in `@itwin/core-frontend` to be used to initialize `IModelApp`.
|
|
29
|
+
*
|
|
30
|
+
* This implementation uses themed react components that blends in AppUI look and feel.
|
|
31
|
+
*
|
|
32
|
+
* ```ts
|
|
33
|
+
* await IModelApp.startup({
|
|
34
|
+
* uiAdmin: new FrameworkUiAdmin()
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
29
37
|
* @public
|
|
30
38
|
*/
|
|
31
39
|
export class FrameworkUiAdmin extends UiAdmin {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FrameworkUiAdmin.js","sourceRoot":"","sources":["../../../../src/appui-react/uiadmin/FrameworkUiAdmin.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAejD,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAEtE;;GAEG;AACH,MAAM,CAAN,IAAY,sBAOX;AAPD,WAAY,sBAAsB;IAChC,iDAAiD;IACjD,mFAAY,CAAA;IACZ,6CAA6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C;SACb;aAAM;YACL,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAC/B,oBAAC,oBAAoB,IACnB,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,EAAE,EAAE,EAAE,KACF,aAAa,GACjB,EACF,EAAE,CACH,CAAC;YACF,OAAO,IAAI,CAAC;SACb;IACH,CAAC;IAED,yCAAyC;IACzB,WAAW,CAAC,QAAgB;QAC1C,uBAAuB;QACvB,IACE,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAC5C,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,QAAQ,CAC/B,EACD;YACA,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;YAC7C,OAAO,IAAI,CAAC;SACb;QAED,uBAAuB;QACvB,IACE,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CACzC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,QAAQ,CAC/B,EACD;YACA,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YAClC,OAAO,IAAI,CAAC;SACb;QAED,uBAAuB;QACvB,OAAO,KAAK,CAAC;IACf,CAAC;CACF","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 Admin\n */\n\nimport * as React from \"react\";\nimport type { XAndY } from \"@itwin/core-geometry\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport type {\n AbstractMenuItemProps,\n AbstractToolbarProps,\n DialogLayoutDataProvider,\n DialogProps,\n IMatch,\n OnCancelFunc,\n OnItemExecutedFunc,\n OnNumberCommitFunc,\n OnValueCommitFunc,\n Primitives,\n PropertyDescription,\n PropertyRecord,\n} from \"@itwin/appui-abstract\";\nimport { RelativePosition, UiAdmin } from \"@itwin/appui-abstract\";\nimport { AccuDrawPopupManager } from \"../accudraw/AccuDrawPopupManager\";\nimport { CursorInformation } from \"../cursor/CursorInformation\";\nimport { PopupManager } from \"../popup/PopupManager\";\nimport type { CursorMenuData } from \"../redux/SessionState\";\nimport { UiFramework } from \"../UiFramework\";\nimport { UiDataProvidedDialog } from \"../dialog/UiDataProvidedDialog\";\n\n/** Controls whether localized and/or non-localized key-in strings appear in a KeyinField's auto-completion list.\n * @public\n */\nexport enum KeyinFieldLocalization {\n /** Include only non-localized key-in strings. */\n NonLocalized,\n /** Include only localized key-in strings. */\n Localized,\n /** Include localized and non-localized strings for each key-in. */\n Both,\n}\n\n/** Defines a keyin entry to show/filter in UI\n * @public\n */\nexport interface KeyinEntry {\n /** string that matched a filter string */\n value: string;\n /** define array of start and end positions of filter matches. */\n matches?: IMatch[];\n /** true if entry was loaded from key-in history */\n isHistory?: boolean;\n}\n\n/** The UiAdmin controls various UI components and is callable from IModelApp.uiAdmin in the core-frontend package.\n * @public\n */\nexport class FrameworkUiAdmin extends UiAdmin {\n private _localizedKeyinPreference: KeyinFieldLocalization =\n KeyinFieldLocalization.NonLocalized;\n\n public get localizedKeyinPreference(): KeyinFieldLocalization {\n return this._localizedKeyinPreference;\n }\n public set localizedKeyinPreference(preference: KeyinFieldLocalization) {\n this._localizedKeyinPreference = preference;\n }\n\n /** @internal */\n public override onInitialized() {}\n\n /** Gets the cursor X and Y position, which is mouseEvent.pageX and mouseEvent.pageY. */\n public override get cursorPosition(): XAndY {\n return CursorInformation.cursorPosition;\n }\n\n /** Determines if focus is set to Home */\n public override get isFocusOnHome(): boolean {\n return UiFramework.keyboardShortcuts.isFocusOnHome;\n }\n\n /** Sets focus to Home */\n public override setFocusToHome(): void {\n UiFramework.keyboardShortcuts.setFocusToHome();\n }\n\n /** Show a context menu at a particular location.\n * @param items Properties of the menu items to display.\n * @param location Location of the context menu, relative to the origin of htmlElement or the overall window.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the menu was displayed, false if the menu could not be displayed.\n */\n public override showContextMenu(\n items: AbstractMenuItemProps[],\n location: XAndY,\n htmlElement?: HTMLElement\n ): boolean {\n let position = location;\n let childWindowId: string | undefined;\n if (htmlElement) {\n const anchorOffset = htmlElement.getBoundingClientRect();\n position = {\n x: anchorOffset.left + location.x,\n y: anchorOffset.top + location.y,\n };\n childWindowId = UiFramework.childWindows.findId(\n htmlElement.ownerDocument.defaultView\n );\n }\n\n const offset = -8;\n position = { x: position.x + offset, y: position.y + offset };\n\n const cursorMenu: CursorMenuData = { position, items, childWindowId };\n UiFramework.openCursorMenu(cursorMenu);\n\n return true;\n }\n\n /** Resolve location and parent element */\n private resolveHtmlElement(\n location: XAndY,\n htmlElement?: HTMLElement\n ): { position: XAndY; el: HTMLElement } {\n const position = location;\n const el = htmlElement ?? UiFramework.controls.getWrapperElement();\n return { position, el };\n }\n\n public getKeyins(): KeyinEntry[] {\n const toolKeyins: KeyinEntry[] = [];\n const tools = IModelApp.tools.getToolList();\n for (const tool of tools) {\n switch (this.localizedKeyinPreference) {\n case KeyinFieldLocalization.Localized:\n toolKeyins.push({ value: tool.keyin });\n break;\n case KeyinFieldLocalization.Both:\n toolKeyins.push({ value: tool.keyin });\n // istanbul ignore else\n if (tool.keyin === tool.englishKeyin) break;\n // istanbul ignore next\n default: // eslint-disable-line no-fallthrough\n case KeyinFieldLocalization.NonLocalized:\n // istanbul ignore next\n if (\n KeyinFieldLocalization.NonLocalized ===\n this.localizedKeyinPreference ||\n (KeyinFieldLocalization.Both === this.localizedKeyinPreference &&\n tool.englishKeyin !== tool.keyin)\n )\n toolKeyins.push({ value: tool.englishKeyin });\n break;\n }\n }\n\n return toolKeyins;\n }\n\n /** Show the Key-in Palette to display key-in from all registered Tools.\n * @param htmlElement The HTMLElement that anchors the Popup. If undefined, the location is relative to the overall window.\n * @return true if the Command Palette was displayed, false if it could not be displayed.\n */\n public override showKeyinPalette(htmlElement?: HTMLElement): boolean {\n if (!this.featureFlags.allowKeyinPalette) return false;\n\n // istanbul ignore next\n const el = htmlElement\n ? htmlElement\n : UiFramework.controls.getWrapperElement();\n\n // istanbul ignore next\n const hidePopup = () => {\n IModelApp.uiAdmin.hideKeyinPalette();\n };\n\n return PopupManager.showKeyinPalette(\n this.getKeyins(),\n el,\n hidePopup,\n hidePopup\n );\n }\n\n /** Hides the Key-in Palette. */\n public override hideKeyinPalette(): boolean {\n if (!this.featureFlags.allowKeyinPalette) return false;\n\n return PopupManager.hideKeyinPalette();\n }\n\n /** Show a Toolbar at a particular location.\n * @param toolbarProps Properties of the Toolbar to display.\n * @param location Location of the Toolbar, relative to the origin of htmlElement or the overall window.\n * @param offset Offset of the Toolbar from the location.\n * @param onItemExecuted Function invoked after a Toolbar item is executed\n * @param onCancel Function invoked when the Escape key is pressed or a click occurs outside the Toolbar\n * @param relativePosition Position relative to the given location. Defaults to TopRight.\n * @param htmlElement The HTMLElement that anchors the Toolbar. If undefined, the location is relative to the overall window.\n * @return true if the Toolbar was displayed, false if the Toolbar could not be displayed.\n */\n public override showToolbar(\n toolbarProps: AbstractToolbarProps,\n location: XAndY,\n offset: XAndY,\n onItemExecuted: OnItemExecutedFunc,\n onCancel: OnCancelFunc,\n relativePosition?: RelativePosition,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n if (relativePosition === undefined)\n relativePosition = RelativePosition.TopRight;\n\n return PopupManager.showToolbar(\n toolbarProps,\n el,\n position,\n offset,\n onItemExecuted,\n onCancel,\n relativePosition\n );\n }\n\n /** Hides the toolbar. */\n public override hideToolbar(): boolean {\n return PopupManager.hideToolbar();\n }\n\n /** Show a menu button at a particular location. A menu button opens a context menu.\n * @param id Id of the menu button. Multiple menu buttons may be displayed.\n * @param menuItemsProps Properties of the menu items to display.\n * @param location Location of the context menu, relative to the origin of htmlElement or the window.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the menu was displayed, false if the menu could not be displayed.\n */\n public override showMenuButton(\n id: string,\n menuItemsProps: AbstractMenuItemProps[],\n location: XAndY,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n return AccuDrawPopupManager.showMenuButton(\n id,\n el,\n position,\n menuItemsProps\n );\n }\n\n /** Hides a menu button.\n * @param id Id of the menu button. Multiple menu buttons may be displayed.\n * @return true if the menu was hidden, false if the menu could not be hidden.\n */\n public override hideMenuButton(id: string): boolean {\n return AccuDrawPopupManager.hideMenuButton(id);\n }\n\n /** Show a calculator at a particular location.\n * @param initialValue Value initially displayed in the calculator.\n * @param resultIcon Icon displayed to the left of the value.\n * @param location Location of the calculator, relative to the origin of htmlElement or the window.\n * @param onOk Function called when the OK button or the Enter key is pressed.\n * @param onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the menu was displayed, false if the menu could not be displayed.\n */\n public override showCalculator(\n initialValue: number,\n resultIcon: string,\n location: XAndY,\n onOk: OnNumberCommitFunc,\n onCancel: OnCancelFunc,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n return AccuDrawPopupManager.showCalculator(\n el,\n position,\n initialValue,\n resultIcon,\n onOk,\n onCancel\n );\n }\n\n /** Hides the calculator. */\n public override hideCalculator(): boolean {\n return AccuDrawPopupManager.hideCalculator();\n }\n\n /** Show an input editor for an angle value at a particular location.\n * @param initialValue Value initially displayed in the editor.\n * @param location Location of the editor, relative to the origin of htmlElement or the window.\n * @param onCommit Function called when the OK button or the Enter key is pressed.\n * @param onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the editor was displayed, false if the editor could not be displayed.\n */\n public override showAngleEditor(\n initialValue: number,\n location: XAndY,\n onCommit: OnNumberCommitFunc,\n onCancel: OnCancelFunc,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n return AccuDrawPopupManager.showAngleEditor(\n el,\n position,\n initialValue,\n onCommit,\n onCancel\n );\n }\n\n /** Show an input editor for a length value at a particular location.\n * @param initialValue Value initially displayed in the editor.\n * @param location Location of the editor, relative to the origin of htmlElement or the window.\n * @param onCommit Function called when the OK button or the Enter key is pressed.\n * @param onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the editor was displayed, false if the editor could not be displayed.\n */\n public override showLengthEditor(\n initialValue: number,\n location: XAndY,\n onCommit: OnNumberCommitFunc,\n onCancel: OnCancelFunc,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n return AccuDrawPopupManager.showLengthEditor(\n el,\n position,\n initialValue,\n onCommit,\n onCancel\n );\n }\n\n /** Show an input editor for a height value at a particular location.\n * @param initialValue Value initially displayed in the editor.\n * @param location Location of the editor, relative to the origin of htmlElement or the window.\n * @param onCommit Function called when the OK button or the Enter key is pressed.\n * @param onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the editor was displayed, false if the editor could not be displayed.\n */\n public override showHeightEditor(\n initialValue: number,\n location: XAndY,\n onCommit: OnNumberCommitFunc,\n onCancel: OnCancelFunc,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n return AccuDrawPopupManager.showHeightEditor(\n el,\n position,\n initialValue,\n onCommit,\n onCancel\n );\n }\n\n /** Show an input editor for a primitive value at a particular location.\n * @param initialValue Value initially displayed in the editor.\n * @param propertyDescription Description of the primitive value property\n * @param location Location of the editor, relative to the origin of htmlElement or the window.\n * @param onCommit Function called when the OK button or the Enter key is pressed.\n * @param onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the editor was displayed, false if the editor could not be displayed.\n */\n public override showInputEditor(\n initialValue: Primitives.Value,\n propertyDescription: PropertyDescription,\n location: XAndY,\n onCommit: OnValueCommitFunc,\n onCancel: OnCancelFunc,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n return PopupManager.showInputEditor(\n el,\n position,\n initialValue,\n propertyDescription,\n onCommit,\n onCancel\n );\n }\n\n /** Hides the input editor. */\n public override hideInputEditor(): boolean {\n return PopupManager.hideInputEditor();\n }\n\n /** Show an HTML element at a particular location.\n * @param displayElement The HTMLElement to display\n * @param location Location of the display element, relative to the origin of htmlElement or the window\n * @param offset Offset of the display element from the location\n * @param onCancel Function invoked when the Escape key is pressed or a click occurs outside the display element\n * @param relativePosition Position relative to the given location. Defaults to TopRight.\n * @param anchorElement The HTMLElement that anchors the display element. If undefined, the location is relative to the overall window.\n * @return true if the display element was displayed, false if the display element could not be displayed.\n */\n public override showHTMLElement(\n displayElement: HTMLElement,\n location: XAndY,\n offset: XAndY,\n onCancel: OnCancelFunc,\n relativePosition?: RelativePosition,\n anchorElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, anchorElement);\n\n // istanbul ignore if\n if (relativePosition === undefined)\n relativePosition = RelativePosition.TopRight;\n\n return PopupManager.showHTMLElement(\n displayElement,\n el,\n position,\n offset,\n onCancel,\n relativePosition\n );\n }\n\n /** Hides the HTML Element. */\n public override hideHTMLElement(): boolean {\n return PopupManager.hideHTMLElement();\n }\n\n /** Show a Card containing content, a title and a toolbar at a particular location.\n * @param content The HTMLElement of the content to display\n * @param title Title to display at the top of the card.\n * @param toolbarProps Properties of the Toolbar to display.\n * @param location Location of the Card, relative to the origin of htmlElement or the window.\n * @param offset Offset of the Card from the location.\n * @param onItemExecuted Function invoked after a Toolbar item is executed\n * @param onCancel Function invoked when the Escape key is pressed or a click occurs outside the Card\n * @param relativePosition Position relative to the given location. Defaults to TopRight.\n * @param anchorElement The HTMLElement that anchors the Card. If undefined, the location is relative to the overall window.\n * @return true if the Card was displayed, false if the Card could not be displayed.\n */\n public override showCard(\n content: HTMLElement,\n title: string | PropertyRecord | undefined,\n toolbarProps: AbstractToolbarProps | undefined,\n location: XAndY,\n offset: XAndY,\n onItemExecuted: OnItemExecutedFunc,\n onCancel: OnCancelFunc,\n relativePosition?: RelativePosition,\n anchorElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, anchorElement);\n\n // istanbul ignore if\n if (relativePosition === undefined)\n relativePosition = RelativePosition.TopRight;\n\n return PopupManager.showCard(\n content,\n title,\n toolbarProps,\n el,\n position,\n offset,\n onItemExecuted,\n onCancel,\n relativePosition\n );\n }\n\n /** Show a Card containing React-based content, a title and a toolbar at a particular location.\n * @param content The React node of the content to display\n * @param title Title to display at the top of the card.\n * @param toolbarProps Properties of the Toolbar to display.\n * @param location Location of the Card, relative to the origin of htmlElement or the window.\n * @param offset Offset of the Card from the location.\n * @param onItemExecuted Function invoked after a Toolbar item is executed\n * @param onCancel Function invoked when the Escape key is pressed or a click occurs outside the Card\n * @param relativePosition Position relative to the given location. Defaults to TopRight.\n * @param anchorElement The HTMLElement that anchors the Card. If undefined, the location is relative to the overall window.\n * @return true if the Card was displayed, false if the Card could not be displayed.\n */\n public showReactCard(\n content: React.ReactNode,\n title: string | PropertyRecord | undefined,\n toolbarProps: AbstractToolbarProps | undefined,\n location: XAndY,\n offset: XAndY,\n onItemExecuted: OnItemExecutedFunc,\n onCancel: OnCancelFunc,\n relativePosition?: RelativePosition,\n anchorElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, anchorElement);\n const reactContent = { reactNode: content };\n\n // istanbul ignore if\n if (relativePosition === undefined)\n relativePosition = RelativePosition.TopRight;\n\n return PopupManager.showCard(\n reactContent,\n title,\n toolbarProps,\n el,\n position,\n offset,\n onItemExecuted,\n onCancel,\n relativePosition\n );\n }\n\n /** Hides the Card. */\n public override hideCard(): boolean {\n return PopupManager.hideCard();\n }\n\n /** Opens a Tool Settings Ui popup at a particular location.\n * @param dataProvider The DialogLayoutDataProvider for the tool settings popup dialog.\n * @param location Location of the tool settings, relative to the origin of anchorElement or the window\n * @param offset Offset of the tool settings from the location\n * @param onCancel Function invoked when the Escape key is pressed or a click occurs outside the tool settings\n * @param relativePosition Position relative to the given location. Defaults to TopRight.\n * @param anchorElement The HTMLElement that anchors the tool settings. If undefined, the location is relative to the overall window.\n * @return true if the tool settings were displayed, false if the tool settings could not be displayed.\n */\n public override openToolSettingsPopup(\n dataProvider: DialogLayoutDataProvider,\n location: XAndY,\n offset: XAndY,\n onCancel: OnCancelFunc,\n relativePosition?: RelativePosition,\n anchorElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, anchorElement);\n\n if (relativePosition === undefined)\n relativePosition = RelativePosition.TopRight;\n\n return PopupManager.openToolSettings(\n dataProvider,\n el,\n position,\n offset,\n onCancel,\n relativePosition\n );\n }\n\n /** Closes the Tool Settings Ui popup. */\n public override closeToolSettingsPopup(): boolean {\n return PopupManager.closeToolSettings();\n }\n\n /** Opens a Dialog and automatically populates it using the properties defined by the UiDataProvider.\n * @param uiDataProvider The UiDataProvider for the tool settings\n * @param title Specify title for dialog.\n * @param isModal Specify if the dialog is opened as a modal or modeless.\n * @param id Id of the dialog that is used to close it.\n * @param optionalProps Optional props for Dialog construction.\n * @return true if the tool settings were displayed, false if the tool settings could not be displayed.\n */\n public override openDialog(\n uiDataProvider: DialogLayoutDataProvider,\n title: string,\n isModal: boolean,\n id: string,\n optionalProps?: DialogProps\n ): boolean {\n if (isModal) {\n UiFramework.dialogs.modal.open(\n <UiDataProvidedDialog\n uiDataProvider={uiDataProvider}\n title={title}\n isModal={isModal}\n id={id}\n {...optionalProps}\n />,\n id\n );\n return true;\n } else {\n UiFramework.dialogs.modeless.open(\n <UiDataProvidedDialog\n uiDataProvider={uiDataProvider}\n title={title}\n isModal={isModal}\n id={id}\n {...optionalProps}\n />,\n id\n );\n return true;\n }\n }\n\n /** Closes the Tool Settings Ui popup. */\n public override closeDialog(dialogId: string): boolean {\n // istanbul ignore else\n if (\n UiFramework.dialogs.modeless.dialogs.findIndex(\n (info) => info.id === dialogId\n )\n ) {\n UiFramework.dialogs.modeless.close(dialogId);\n return true;\n }\n\n // istanbul ignore else\n if (\n UiFramework.dialogs.modal.dialogs.findIndex(\n (info) => info.id === dialogId\n )\n ) {\n UiFramework.dialogs.modal.close();\n return true;\n }\n\n // istanbul ignore next\n return false;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"FrameworkUiAdmin.js","sourceRoot":"","sources":["../../../../src/appui-react/uiadmin/FrameworkUiAdmin.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAcjD,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGrD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAEtE;;GAEG;AACH,MAAM,CAAN,IAAY,sBAOX;AAPD,WAAY,sBAAsB;IAChC,iDAAiD;IACjD,mFAAY,CAAA;IACZ,6CAA6C;IAC7C,6EAAS,CAAA;IACT,mEAAmE;IACnE,mEAAI,CAAA;AACN,CAAC,EAPW,sBAAsB,KAAtB,sB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oB,IACnB,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,EAAE,EAAE,EAAE,KACF,aAAa,GACjB,EACF,EAAE,CACH,CAAC;YACF,OAAO,IAAI,CAAC;SACb;IACH,CAAC;IAED,yCAAyC;IACzB,WAAW,CAAC,QAAgB;QAC1C,uBAAuB;QACvB,IACE,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAC5C,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,QAAQ,CAC/B,EACD;YACA,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;YAC7C,OAAO,IAAI,CAAC;SACb;QAED,uBAAuB;QACvB,IACE,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CACzC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,QAAQ,CAC/B,EACD;YACA,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YAClC,OAAO,IAAI,CAAC;SACb;QAED,uBAAuB;QACvB,OAAO,KAAK,CAAC;IACf,CAAC;CACF","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 Admin\n */\n\nimport * as React from \"react\";\nimport type { XAndY } from \"@itwin/core-geometry\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport type {\n AbstractMenuItemProps,\n AbstractToolbarProps,\n DialogLayoutDataProvider,\n DialogProps,\n OnCancelFunc,\n OnItemExecutedFunc,\n OnNumberCommitFunc,\n OnValueCommitFunc,\n Primitives,\n PropertyDescription,\n PropertyRecord,\n} from \"@itwin/appui-abstract\";\nimport { RelativePosition, UiAdmin } from \"@itwin/appui-abstract\";\nimport { AccuDrawPopupManager } from \"../accudraw/AccuDrawPopupManager\";\nimport { CursorInformation } from \"../cursor/CursorInformation\";\nimport { PopupManager } from \"../popup/PopupManager\";\nimport type { IMatch } from \"../utils/matchesWords\";\nimport type { CursorMenuData } from \"../redux/SessionState\";\nimport { UiFramework } from \"../UiFramework\";\nimport { UiDataProvidedDialog } from \"../dialog/UiDataProvidedDialog\";\n\n/** Controls whether localized and/or non-localized key-in strings appear in a KeyinField's auto-completion list.\n * @public\n */\nexport enum KeyinFieldLocalization {\n /** Include only non-localized key-in strings. */\n NonLocalized,\n /** Include only localized key-in strings. */\n Localized,\n /** Include localized and non-localized strings for each key-in. */\n Both,\n}\n\n/** Defines a keyin entry to show/filter in UI\n * @public\n */\nexport interface KeyinEntry {\n /** string that matched a filter string */\n value: string;\n /** define array of start and end positions of filter matches. */\n matches?: IMatch[];\n /** true if entry was loaded from key-in history */\n isHistory?: boolean;\n}\n\n/** Subclass of `UiAdmin` in `@itwin/core-frontend` to be used to initialize `IModelApp`.\n *\n * This implementation uses themed react components that blends in AppUI look and feel.\n *\n * ```ts\n * await IModelApp.startup({\n * uiAdmin: new FrameworkUiAdmin()\n * });\n * ```\n * @public\n */\nexport class FrameworkUiAdmin extends UiAdmin {\n private _localizedKeyinPreference: KeyinFieldLocalization =\n KeyinFieldLocalization.NonLocalized;\n\n public get localizedKeyinPreference(): KeyinFieldLocalization {\n return this._localizedKeyinPreference;\n }\n public set localizedKeyinPreference(preference: KeyinFieldLocalization) {\n this._localizedKeyinPreference = preference;\n }\n\n /** @internal */\n public override onInitialized() {}\n\n /** Gets the cursor X and Y position, which is mouseEvent.pageX and mouseEvent.pageY. */\n public override get cursorPosition(): XAndY {\n return CursorInformation.cursorPosition;\n }\n\n /** Determines if focus is set to Home */\n public override get isFocusOnHome(): boolean {\n return UiFramework.keyboardShortcuts.isFocusOnHome;\n }\n\n /** Sets focus to Home */\n public override setFocusToHome(): void {\n UiFramework.keyboardShortcuts.setFocusToHome();\n }\n\n /** Show a context menu at a particular location.\n * @param items Properties of the menu items to display.\n * @param location Location of the context menu, relative to the origin of htmlElement or the overall window.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the menu was displayed, false if the menu could not be displayed.\n */\n public override showContextMenu(\n items: AbstractMenuItemProps[],\n location: XAndY,\n htmlElement?: HTMLElement\n ): boolean {\n let position = location;\n let childWindowId: string | undefined;\n if (htmlElement) {\n const anchorOffset = htmlElement.getBoundingClientRect();\n position = {\n x: anchorOffset.left + location.x,\n y: anchorOffset.top + location.y,\n };\n childWindowId = UiFramework.childWindows.findId(\n htmlElement.ownerDocument.defaultView\n );\n }\n\n const offset = -8;\n position = { x: position.x + offset, y: position.y + offset };\n\n const cursorMenu: CursorMenuData = { position, items, childWindowId };\n UiFramework.openCursorMenu(cursorMenu);\n\n return true;\n }\n\n /** Resolve location and parent element */\n private resolveHtmlElement(\n location: XAndY,\n htmlElement?: HTMLElement\n ): { position: XAndY; el: HTMLElement } {\n const position = location;\n const el = htmlElement ?? UiFramework.controls.getWrapperElement();\n return { position, el };\n }\n\n public getKeyins(): KeyinEntry[] {\n const toolKeyins: KeyinEntry[] = [];\n const tools = IModelApp.tools.getToolList();\n for (const tool of tools) {\n switch (this.localizedKeyinPreference) {\n case KeyinFieldLocalization.Localized:\n toolKeyins.push({ value: tool.keyin });\n break;\n case KeyinFieldLocalization.Both:\n toolKeyins.push({ value: tool.keyin });\n // istanbul ignore else\n if (tool.keyin === tool.englishKeyin) break;\n // istanbul ignore next\n default: // eslint-disable-line no-fallthrough\n case KeyinFieldLocalization.NonLocalized:\n // istanbul ignore next\n if (\n KeyinFieldLocalization.NonLocalized ===\n this.localizedKeyinPreference ||\n (KeyinFieldLocalization.Both === this.localizedKeyinPreference &&\n tool.englishKeyin !== tool.keyin)\n )\n toolKeyins.push({ value: tool.englishKeyin });\n break;\n }\n }\n\n return toolKeyins;\n }\n\n /** Show the Key-in Palette to display key-in from all registered Tools.\n * @param htmlElement The HTMLElement that anchors the Popup. If undefined, the location is relative to the overall window.\n * @return true if the Command Palette was displayed, false if it could not be displayed.\n */\n public override showKeyinPalette(htmlElement?: HTMLElement): boolean {\n if (!this.featureFlags.allowKeyinPalette) return false;\n\n // istanbul ignore next\n const el = htmlElement\n ? htmlElement\n : UiFramework.controls.getWrapperElement();\n\n // istanbul ignore next\n const hidePopup = () => {\n IModelApp.uiAdmin.hideKeyinPalette();\n };\n\n return PopupManager.showKeyinPalette(\n this.getKeyins(),\n el,\n hidePopup,\n hidePopup\n );\n }\n\n /** Hides the Key-in Palette. */\n public override hideKeyinPalette(): boolean {\n if (!this.featureFlags.allowKeyinPalette) return false;\n\n return PopupManager.hideKeyinPalette();\n }\n\n /** Show a Toolbar at a particular location.\n * @param toolbarProps Properties of the Toolbar to display.\n * @param location Location of the Toolbar, relative to the origin of htmlElement or the overall window.\n * @param offset Offset of the Toolbar from the location.\n * @param onItemExecuted Function invoked after a Toolbar item is executed\n * @param onCancel Function invoked when the Escape key is pressed or a click occurs outside the Toolbar\n * @param relativePosition Position relative to the given location. Defaults to TopRight.\n * @param htmlElement The HTMLElement that anchors the Toolbar. If undefined, the location is relative to the overall window.\n * @return true if the Toolbar was displayed, false if the Toolbar could not be displayed.\n */\n public override showToolbar(\n toolbarProps: AbstractToolbarProps,\n location: XAndY,\n offset: XAndY,\n onItemExecuted: OnItemExecutedFunc,\n onCancel: OnCancelFunc,\n relativePosition?: RelativePosition,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n if (relativePosition === undefined)\n relativePosition = RelativePosition.TopRight;\n\n return PopupManager.showToolbar(\n toolbarProps,\n el,\n position,\n offset,\n onItemExecuted,\n onCancel,\n relativePosition\n );\n }\n\n /** Hides the toolbar. */\n public override hideToolbar(): boolean {\n return PopupManager.hideToolbar();\n }\n\n /** Show a menu button at a particular location. A menu button opens a context menu.\n * @param id Id of the menu button. Multiple menu buttons may be displayed.\n * @param menuItemsProps Properties of the menu items to display.\n * @param location Location of the context menu, relative to the origin of htmlElement or the window.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the menu was displayed, false if the menu could not be displayed.\n */\n public override showMenuButton(\n id: string,\n menuItemsProps: AbstractMenuItemProps[],\n location: XAndY,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n return AccuDrawPopupManager.showMenuButton(\n id,\n el,\n position,\n menuItemsProps\n );\n }\n\n /** Hides a menu button.\n * @param id Id of the menu button. Multiple menu buttons may be displayed.\n * @return true if the menu was hidden, false if the menu could not be hidden.\n */\n public override hideMenuButton(id: string): boolean {\n return AccuDrawPopupManager.hideMenuButton(id);\n }\n\n /** Show a calculator at a particular location.\n * @param initialValue Value initially displayed in the calculator.\n * @param resultIcon Icon displayed to the left of the value.\n * @param location Location of the calculator, relative to the origin of htmlElement or the window.\n * @param onOk Function called when the OK button or the Enter key is pressed.\n * @param onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the menu was displayed, false if the menu could not be displayed.\n */\n public override showCalculator(\n initialValue: number,\n resultIcon: string,\n location: XAndY,\n onOk: OnNumberCommitFunc,\n onCancel: OnCancelFunc,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n return AccuDrawPopupManager.showCalculator(\n el,\n position,\n initialValue,\n resultIcon,\n onOk,\n onCancel\n );\n }\n\n /** Hides the calculator. */\n public override hideCalculator(): boolean {\n return AccuDrawPopupManager.hideCalculator();\n }\n\n /** Show an input editor for an angle value at a particular location.\n * @param initialValue Value initially displayed in the editor.\n * @param location Location of the editor, relative to the origin of htmlElement or the window.\n * @param onCommit Function called when the OK button or the Enter key is pressed.\n * @param onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the editor was displayed, false if the editor could not be displayed.\n */\n public override showAngleEditor(\n initialValue: number,\n location: XAndY,\n onCommit: OnNumberCommitFunc,\n onCancel: OnCancelFunc,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n return AccuDrawPopupManager.showAngleEditor(\n el,\n position,\n initialValue,\n onCommit,\n onCancel\n );\n }\n\n /** Show an input editor for a length value at a particular location.\n * @param initialValue Value initially displayed in the editor.\n * @param location Location of the editor, relative to the origin of htmlElement or the window.\n * @param onCommit Function called when the OK button or the Enter key is pressed.\n * @param onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the editor was displayed, false if the editor could not be displayed.\n */\n public override showLengthEditor(\n initialValue: number,\n location: XAndY,\n onCommit: OnNumberCommitFunc,\n onCancel: OnCancelFunc,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n return AccuDrawPopupManager.showLengthEditor(\n el,\n position,\n initialValue,\n onCommit,\n onCancel\n );\n }\n\n /** Show an input editor for a height value at a particular location.\n * @param initialValue Value initially displayed in the editor.\n * @param location Location of the editor, relative to the origin of htmlElement or the window.\n * @param onCommit Function called when the OK button or the Enter key is pressed.\n * @param onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the editor was displayed, false if the editor could not be displayed.\n */\n public override showHeightEditor(\n initialValue: number,\n location: XAndY,\n onCommit: OnNumberCommitFunc,\n onCancel: OnCancelFunc,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n return AccuDrawPopupManager.showHeightEditor(\n el,\n position,\n initialValue,\n onCommit,\n onCancel\n );\n }\n\n /** Show an input editor for a primitive value at a particular location.\n * @param initialValue Value initially displayed in the editor.\n * @param propertyDescription Description of the primitive value property\n * @param location Location of the editor, relative to the origin of htmlElement or the window.\n * @param onCommit Function called when the OK button or the Enter key is pressed.\n * @param onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the editor was displayed, false if the editor could not be displayed.\n */\n public override showInputEditor(\n initialValue: Primitives.Value,\n propertyDescription: PropertyDescription,\n location: XAndY,\n onCommit: OnValueCommitFunc,\n onCancel: OnCancelFunc,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n return PopupManager.showInputEditor(\n el,\n position,\n initialValue,\n propertyDescription,\n onCommit,\n onCancel\n );\n }\n\n /** Hides the input editor. */\n public override hideInputEditor(): boolean {\n return PopupManager.hideInputEditor();\n }\n\n /** Show an HTML element at a particular location.\n * @param displayElement The HTMLElement to display\n * @param location Location of the display element, relative to the origin of htmlElement or the window\n * @param offset Offset of the display element from the location\n * @param onCancel Function invoked when the Escape key is pressed or a click occurs outside the display element\n * @param relativePosition Position relative to the given location. Defaults to TopRight.\n * @param anchorElement The HTMLElement that anchors the display element. If undefined, the location is relative to the overall window.\n * @return true if the display element was displayed, false if the display element could not be displayed.\n */\n public override showHTMLElement(\n displayElement: HTMLElement,\n location: XAndY,\n offset: XAndY,\n onCancel: OnCancelFunc,\n relativePosition?: RelativePosition,\n anchorElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, anchorElement);\n\n // istanbul ignore if\n if (relativePosition === undefined)\n relativePosition = RelativePosition.TopRight;\n\n return PopupManager.showHTMLElement(\n displayElement,\n el,\n position,\n offset,\n onCancel,\n relativePosition\n );\n }\n\n /** Hides the HTML Element. */\n public override hideHTMLElement(): boolean {\n return PopupManager.hideHTMLElement();\n }\n\n /** Show a Card containing content, a title and a toolbar at a particular location.\n * @param content The HTMLElement of the content to display\n * @param title Title to display at the top of the card.\n * @param toolbarProps Properties of the Toolbar to display.\n * @param location Location of the Card, relative to the origin of htmlElement or the window.\n * @param offset Offset of the Card from the location.\n * @param onItemExecuted Function invoked after a Toolbar item is executed\n * @param onCancel Function invoked when the Escape key is pressed or a click occurs outside the Card\n * @param relativePosition Position relative to the given location. Defaults to TopRight.\n * @param anchorElement The HTMLElement that anchors the Card. If undefined, the location is relative to the overall window.\n * @return true if the Card was displayed, false if the Card could not be displayed.\n */\n public override showCard(\n content: HTMLElement,\n title: string | PropertyRecord | undefined,\n toolbarProps: AbstractToolbarProps | undefined,\n location: XAndY,\n offset: XAndY,\n onItemExecuted: OnItemExecutedFunc,\n onCancel: OnCancelFunc,\n relativePosition?: RelativePosition,\n anchorElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, anchorElement);\n\n // istanbul ignore if\n if (relativePosition === undefined)\n relativePosition = RelativePosition.TopRight;\n\n return PopupManager.showCard(\n content,\n title,\n toolbarProps,\n el,\n position,\n offset,\n onItemExecuted,\n onCancel,\n relativePosition\n );\n }\n\n /** Show a Card containing React-based content, a title and a toolbar at a particular location.\n * @param content The React node of the content to display\n * @param title Title to display at the top of the card.\n * @param toolbarProps Properties of the Toolbar to display.\n * @param location Location of the Card, relative to the origin of htmlElement or the window.\n * @param offset Offset of the Card from the location.\n * @param onItemExecuted Function invoked after a Toolbar item is executed\n * @param onCancel Function invoked when the Escape key is pressed or a click occurs outside the Card\n * @param relativePosition Position relative to the given location. Defaults to TopRight.\n * @param anchorElement The HTMLElement that anchors the Card. If undefined, the location is relative to the overall window.\n * @return true if the Card was displayed, false if the Card could not be displayed.\n */\n public showReactCard(\n content: React.ReactNode,\n title: string | PropertyRecord | undefined,\n toolbarProps: AbstractToolbarProps | undefined,\n location: XAndY,\n offset: XAndY,\n onItemExecuted: OnItemExecutedFunc,\n onCancel: OnCancelFunc,\n relativePosition?: RelativePosition,\n anchorElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, anchorElement);\n const reactContent = { reactNode: content };\n\n // istanbul ignore if\n if (relativePosition === undefined)\n relativePosition = RelativePosition.TopRight;\n\n return PopupManager.showCard(\n reactContent,\n title,\n toolbarProps,\n el,\n position,\n offset,\n onItemExecuted,\n onCancel,\n relativePosition\n );\n }\n\n /** Hides the Card. */\n public override hideCard(): boolean {\n return PopupManager.hideCard();\n }\n\n /** Opens a Tool Settings Ui popup at a particular location.\n * @param dataProvider The DialogLayoutDataProvider for the tool settings popup dialog.\n * @param location Location of the tool settings, relative to the origin of anchorElement or the window\n * @param offset Offset of the tool settings from the location\n * @param onCancel Function invoked when the Escape key is pressed or a click occurs outside the tool settings\n * @param relativePosition Position relative to the given location. Defaults to TopRight.\n * @param anchorElement The HTMLElement that anchors the tool settings. If undefined, the location is relative to the overall window.\n * @return true if the tool settings were displayed, false if the tool settings could not be displayed.\n */\n public override openToolSettingsPopup(\n dataProvider: DialogLayoutDataProvider,\n location: XAndY,\n offset: XAndY,\n onCancel: OnCancelFunc,\n relativePosition?: RelativePosition,\n anchorElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, anchorElement);\n\n if (relativePosition === undefined)\n relativePosition = RelativePosition.TopRight;\n\n return PopupManager.openToolSettings(\n dataProvider,\n el,\n position,\n offset,\n onCancel,\n relativePosition\n );\n }\n\n /** Closes the Tool Settings Ui popup. */\n public override closeToolSettingsPopup(): boolean {\n return PopupManager.closeToolSettings();\n }\n\n /** Opens a Dialog and automatically populates it using the properties defined by the UiDataProvider.\n * @param uiDataProvider The UiDataProvider for the tool settings\n * @param title Specify title for dialog.\n * @param isModal Specify if the dialog is opened as a modal or modeless.\n * @param id Id of the dialog that is used to close it.\n * @param optionalProps Optional props for Dialog construction.\n * @return true if the tool settings were displayed, false if the tool settings could not be displayed.\n */\n public override openDialog(\n uiDataProvider: DialogLayoutDataProvider,\n title: string,\n isModal: boolean,\n id: string,\n optionalProps?: DialogProps\n ): boolean {\n if (isModal) {\n UiFramework.dialogs.modal.open(\n <UiDataProvidedDialog\n uiDataProvider={uiDataProvider}\n title={title}\n isModal={isModal}\n id={id}\n {...optionalProps}\n />,\n id\n );\n return true;\n } else {\n UiFramework.dialogs.modeless.open(\n <UiDataProvidedDialog\n uiDataProvider={uiDataProvider}\n title={title}\n isModal={isModal}\n id={id}\n {...optionalProps}\n />,\n id\n );\n return true;\n }\n }\n\n /** Closes the Tool Settings Ui popup. */\n public override closeDialog(dialogId: string): boolean {\n // istanbul ignore else\n if (\n UiFramework.dialogs.modeless.dialogs.findIndex(\n (info) => info.id === dialogId\n )\n ) {\n UiFramework.dialogs.modeless.close(dialogId);\n return true;\n }\n\n // istanbul ignore else\n if (\n UiFramework.dialogs.modal.dialogs.findIndex(\n (info) => info.id === dialogId\n )\n ) {\n UiFramework.dialogs.modal.close();\n return true;\n }\n\n // istanbul ignore next\n return false;\n }\n}\n"]}
|
|
@@ -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"}
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
import { UiStateEntry } from "@itwin/core-react";
|
|
9
9
|
import { SyncUiEventDispatcher } from "../syncui/SyncUiEventDispatcher";
|
|
10
10
|
import { UiFramework } from "../UiFramework";
|
|
11
|
-
/** These are the UI settings that are stored in the Redux store. They control the color theme,
|
|
12
|
-
* how toolbar group buttons work, and the opacity of
|
|
11
|
+
/** These are the UI settings that are stored in the Redux store. They control the color theme,
|
|
12
|
+
* how toolbar group buttons work, and the opacity of floating widget when the cursor
|
|
13
13
|
* is not inside them. It is expect that an IModelApp using App UI components will create and register AppUiSettings with
|
|
14
14
|
* defaults specific to their application. This would be done by calling the following.
|
|
15
15
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppUiSettings.js","sourceRoot":"","sources":["../../../../src/appui-react/uistate/AppUiSettings.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAoB7C;;;;;;;;;;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,KAAa,EAAE,EAAE;YACxC,WAAW,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,WAAW,CAAC,iBAAiB,EAAE,CAAC,CAAC;gBACnE,8GAA8G;gBAC9G,MAAM,CAAC,YAAY,CAAC,OAAO,CACzB,mBAAmB,EACnB,WAAW,CAAC,aAAa,EAAE,CAC5B,CA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C;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;SAHxC,aAAa","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,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;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,WAAW,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YACjC,6FAA6F;YAC7F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,CAAC,IAAI,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;QAErD,IAAI,CAAC,cAAc,GAAG,IAAI,YAAY,CACpC,aAAa,CAAC,iBAAiB,EAC/B,aAAa,EACb,GAAG,EAAE,CAAC,WAAW,CAAC,iBAAiB,EAAE,EACrC,CAAC,KAAa,EAAE,EAAE,CAAC,WAAW,CAAC,iBAAiB,CAAC,KAAK,CAAC,EACvD,QAAQ,CAAC,cAAc,CACxB,CAAC;QACF,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAEzC,qBAAqB,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;SAHxC,aAAa","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"}
|
|
@@ -16,7 +16,16 @@ export function useUiStateStorageHandler() {
|
|
|
16
16
|
/** @internal */
|
|
17
17
|
export const UiStateStorageContext = React.createContext(new LocalStateStorage());
|
|
18
18
|
UiStateStorageContext.displayName = "uifw:UiStateStorageContext";
|
|
19
|
-
/** Allows to provide a custom [[UiStateStorage]] implementation to persist UI settings
|
|
19
|
+
/** Allows to provide a custom [[UiStateStorage]] implementation to persist UI settings
|
|
20
|
+
* through [[UiFramework.setUiStateStorage]].
|
|
21
|
+
*
|
|
22
|
+
* This component should wrap the [[ConfigurableUiContent]].
|
|
23
|
+
*
|
|
24
|
+
* ```tsx
|
|
25
|
+
* <UiStateStorageHandler>
|
|
26
|
+
* <ConfigurableUiContent />
|
|
27
|
+
* </UiStateStorageHandler>
|
|
28
|
+
* ```
|
|
20
29
|
* @public
|
|
21
30
|
*/
|
|
22
31
|
export 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,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EACL,qBAAqB,EACrB,aAAa,GACd,MAAM,iCAAiC,CAAC;AAGzC,cAAc;AACd,MAAM,UAAU,wBAAwB;IACtC,OAAO,KAAK,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC;AACjD,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAC,aAAa,CACtD,IAAI,iBAAiB,EAAE,CACxB,CAAC;AACF,qBAAqB,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,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EACL,qBAAqB,EACrB,aAAa,GACd,MAAM,iCAAiC,CAAC;AAGzC,cAAc;AACd,MAAM,UAAU,wBAAwB;IACtC,OAAO,KAAK,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC;AACjD,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAC,aAAa,CACtD,IAAI,iBAAiB,EAAE,CACxB,CAAC;AACF,qBAAqB,CAAC,WAAW,GAAG,4BAA4B,CAAC;AASjE;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,qBAAqB,CAAC,KAA8B;IAClE,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,KAAK,CAAC,QAAQ,CACpD,WAAW,CAAC,iBAAiB,EAAE,CAChC,CAAC;IAEF,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,uBAAuB;QACvB,MAAM,iBAAiB,GAAG,CAAC,IAAqB,EAAQ,EAAE;YACxD,IACE,qBAAqB,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,EAAE;gBACtD,aAAa,CAAC,qBAAqB;aACpC,CAAC;gBAEF,eAAe,CAAC,WAAW,CAAC,iBAAiB,EAAE,CAAC,CAAC;QACrD,CAAC,CAAC;QAEF,OAAO,qBAAqB,CAAC,aAAa,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC;IAEH,OAAO,CACL,oBAAC,qBAAqB,CAAC,QAAQ,IAC7B,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,KAAK,EAAE,YAAY,GACnB,CACH,CAAC;AACJ,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 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,99 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module Utilities
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Matches beginning of words supporting non-ASCII languages.
|
|
10
|
+
* @param word Filter string
|
|
11
|
+
* @param target String being searched
|
|
12
|
+
* @param contiguous - If true the filter string must be found "contiguous" in the searched string (E.g. "pul" will match "Git: Pull").
|
|
13
|
+
* 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").
|
|
14
|
+
* Useful in cases where the target is words (e.g. command labels)
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export function matchesWords(word, target, contiguous = false) {
|
|
18
|
+
if (!target || target.length === 0) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
let result = null;
|
|
22
|
+
let i = 0;
|
|
23
|
+
word = word.toLowerCase();
|
|
24
|
+
target = target.toLowerCase();
|
|
25
|
+
while (i < target.length &&
|
|
26
|
+
(result = matchesWordsInternal(word, target, 0, i, contiguous)) === null) {
|
|
27
|
+
i = nextWord(target, i + 1);
|
|
28
|
+
}
|
|
29
|
+
return result;
|
|
30
|
+
}
|
|
31
|
+
function matchesWordsInternal(word, target, i, j, contiguous) {
|
|
32
|
+
if (i === word.length) {
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
else if (j === target.length) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
else if (!charactersMatch(word.charCodeAt(i), target.charCodeAt(j))) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
let result = null;
|
|
43
|
+
let nextWordIndex = j + 1;
|
|
44
|
+
result = matchesWordsInternal(word, target, i + 1, j + 1, contiguous);
|
|
45
|
+
if (!contiguous) {
|
|
46
|
+
while (!result &&
|
|
47
|
+
(nextWordIndex = nextWord(target, nextWordIndex)) < target.length) {
|
|
48
|
+
result = matchesWordsInternal(word, target, i + 1, nextWordIndex, contiguous);
|
|
49
|
+
nextWordIndex++;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return result === null ? null : join({ start: j, end: j + 1 }, result);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function nextWord(word, start) {
|
|
56
|
+
for (let i = start; i < word.length; i++) {
|
|
57
|
+
if (isWordSeparator(word.charCodeAt(i)) ||
|
|
58
|
+
(i > 0 && isWordSeparator(word.charCodeAt(i - 1)))) {
|
|
59
|
+
return i;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return word.length;
|
|
63
|
+
}
|
|
64
|
+
var CharCode;
|
|
65
|
+
(function (CharCode) {
|
|
66
|
+
CharCode[CharCode["Space"] = 32] = "Space";
|
|
67
|
+
CharCode[CharCode["Tab"] = 9] = "Tab";
|
|
68
|
+
CharCode[CharCode["LineFeed"] = 10] = "LineFeed";
|
|
69
|
+
CharCode[CharCode["CarriageReturn"] = 13] = "CarriageReturn";
|
|
70
|
+
})(CharCode || (CharCode = {}));
|
|
71
|
+
function isWhitespace(code) {
|
|
72
|
+
return (code === CharCode.Space ||
|
|
73
|
+
code === CharCode.Tab ||
|
|
74
|
+
code === CharCode.LineFeed ||
|
|
75
|
+
code === CharCode.CarriageReturn);
|
|
76
|
+
}
|
|
77
|
+
const wordSeparators = new Set();
|
|
78
|
+
"`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?"
|
|
79
|
+
.split("")
|
|
80
|
+
.forEach((s) => wordSeparators.add(s.charCodeAt(0)));
|
|
81
|
+
function isWordSeparator(code) {
|
|
82
|
+
return isWhitespace(code) || wordSeparators.has(code);
|
|
83
|
+
}
|
|
84
|
+
function charactersMatch(codeA, codeB) {
|
|
85
|
+
return codeA === codeB || (isWordSeparator(codeA) && isWordSeparator(codeB));
|
|
86
|
+
}
|
|
87
|
+
function join(head, tail) {
|
|
88
|
+
if (tail.length === 0) {
|
|
89
|
+
tail = [head];
|
|
90
|
+
}
|
|
91
|
+
else if (head.end === tail[0].start) {
|
|
92
|
+
tail[0].start = head.start;
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
tail.unshift(head);
|
|
96
|
+
}
|
|
97
|
+
return tail;
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=matchesWords.js.map
|