@itwin/appui-react 5.3.1 → 5.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +330 -30
- package/lib/appui-react/UiFramework.d.ts +6 -2
- package/lib/appui-react/UiFramework.d.ts.map +1 -1
- package/lib/appui-react/UiFramework.js +30 -3
- package/lib/appui-react/UiFramework.js.map +1 -1
- package/lib/appui-react/accudraw/AccuDrawFieldContainer.d.ts.map +1 -1
- package/lib/appui-react/accudraw/AccuDrawFieldContainer.js +4 -4
- package/lib/appui-react/accudraw/AccuDrawFieldContainer.js.map +1 -1
- package/lib/appui-react/accudraw/AccuDrawPopupManager.d.ts.map +1 -1
- package/lib/appui-react/accudraw/AccuDrawPopupManager.js +10 -6
- package/lib/appui-react/accudraw/AccuDrawPopupManager.js.map +1 -1
- package/lib/appui-react/accudraw/AccuDrawWidget.d.ts.map +1 -1
- package/lib/appui-react/accudraw/AccuDrawWidget.js +1 -0
- package/lib/appui-react/accudraw/AccuDrawWidget.js.map +1 -1
- package/lib/appui-react/accudraw/Calculator.js +2 -2
- package/lib/appui-react/accudraw/Calculator.js.map +1 -1
- package/lib/appui-react/backstage/BackstageItemUtilities.d.ts.map +1 -1
- package/lib/appui-react/backstage/BackstageItemUtilities.js +2 -0
- package/lib/appui-react/backstage/BackstageItemUtilities.js.map +1 -1
- package/lib/appui-react/childwindow/ChildWindowRenderer.d.ts +2 -0
- package/lib/appui-react/childwindow/ChildWindowRenderer.d.ts.map +1 -1
- package/lib/appui-react/childwindow/ChildWindowRenderer.js +15 -10
- package/lib/appui-react/childwindow/ChildWindowRenderer.js.map +1 -1
- package/lib/appui-react/configurableui/ConfigurableUiContent.d.ts +23 -1
- package/lib/appui-react/configurableui/ConfigurableUiContent.d.ts.map +1 -1
- package/lib/appui-react/configurableui/ConfigurableUiContent.js +20 -12
- package/lib/appui-react/configurableui/ConfigurableUiContent.js.map +1 -1
- package/lib/appui-react/content/ContentLayout.d.ts.map +1 -1
- package/lib/appui-react/content/ContentLayout.js +10 -11
- package/lib/appui-react/content/ContentLayout.js.map +1 -1
- package/lib/appui-react/content/ContentOverlay.d.ts +1 -0
- package/lib/appui-react/content/ContentOverlay.d.ts.map +1 -1
- package/lib/appui-react/content/ContentOverlay.js +3 -1
- package/lib/appui-react/content/ContentOverlay.js.map +1 -1
- package/lib/appui-react/content/DefaultViewOverlay.d.ts.map +1 -1
- package/lib/appui-react/content/DefaultViewOverlay.js +6 -2
- package/lib/appui-react/content/DefaultViewOverlay.js.map +1 -1
- package/lib/appui-react/content/FloatingViewportContent.d.ts.map +1 -1
- package/lib/appui-react/content/FloatingViewportContent.js +1 -1
- package/lib/appui-react/content/FloatingViewportContent.js.map +1 -1
- package/lib/appui-react/cursor/CursorInformation.d.ts +4 -1
- package/lib/appui-react/cursor/CursorInformation.d.ts.map +1 -1
- package/lib/appui-react/cursor/CursorInformation.js +6 -1
- package/lib/appui-react/cursor/CursorInformation.js.map +1 -1
- package/lib/appui-react/cursor/cursormenu/CursorMenu.d.ts +1 -24
- package/lib/appui-react/cursor/cursormenu/CursorMenu.d.ts.map +1 -1
- package/lib/appui-react/cursor/cursormenu/CursorMenu.js +37 -58
- package/lib/appui-react/cursor/cursormenu/CursorMenu.js.map +1 -1
- package/lib/appui-react/cursor/cursorpopup/CursorPopup.scss +3 -0
- package/lib/appui-react/cursor/cursorpopup/CursorPopupManager.d.ts +8 -22
- package/lib/appui-react/cursor/cursorpopup/CursorPopupManager.d.ts.map +1 -1
- package/lib/appui-react/cursor/cursorpopup/CursorPopupManager.js +111 -116
- package/lib/appui-react/cursor/cursorpopup/CursorPopupManager.js.map +1 -1
- package/lib/appui-react/cursor/cursorprompt/CursorPrompt.d.ts +12 -15
- package/lib/appui-react/cursor/cursorprompt/CursorPrompt.d.ts.map +1 -1
- package/lib/appui-react/cursor/cursorprompt/CursorPrompt.js +85 -48
- package/lib/appui-react/cursor/cursorprompt/CursorPrompt.js.map +1 -1
- package/lib/appui-react/framework/FrameworkFrontstages.d.ts +47 -0
- package/lib/appui-react/framework/FrameworkFrontstages.d.ts.map +1 -1
- package/lib/appui-react/framework/FrameworkFrontstages.js +136 -0
- package/lib/appui-react/framework/FrameworkFrontstages.js.map +1 -1
- package/lib/appui-react/framework/FrameworkVisibility.d.ts +2 -0
- package/lib/appui-react/framework/FrameworkVisibility.d.ts.map +1 -1
- package/lib/appui-react/framework/FrameworkVisibility.js.map +1 -1
- package/lib/appui-react/frontstage/InternalFrontstageManager.d.ts.map +1 -1
- package/lib/appui-react/frontstage/InternalFrontstageManager.js +121 -115
- package/lib/appui-react/frontstage/InternalFrontstageManager.js.map +1 -1
- package/lib/appui-react/frontstage/StandardFrontstageProvider.d.ts.map +1 -1
- package/lib/appui-react/frontstage/StandardFrontstageProvider.js +1 -0
- package/lib/appui-react/frontstage/StandardFrontstageProvider.js.map +1 -1
- package/lib/appui-react/hooks/useActiveTool.d.ts +9 -0
- package/lib/appui-react/hooks/useActiveTool.d.ts.map +1 -0
- package/lib/appui-react/hooks/useActiveTool.js +23 -0
- package/lib/appui-react/hooks/useActiveTool.js.map +1 -0
- package/lib/appui-react/icons/SvgAngle.d.ts +7 -0
- package/lib/appui-react/icons/SvgAngle.d.ts.map +1 -0
- package/lib/appui-react/icons/SvgAngle.js +15 -0
- package/lib/appui-react/icons/SvgAngle.js.map +1 -0
- package/lib/appui-react/icons/SvgBackspace.d.ts +7 -0
- package/lib/appui-react/icons/SvgBackspace.d.ts.map +1 -0
- package/lib/appui-react/icons/SvgBackspace.js +14 -0
- package/lib/appui-react/icons/SvgBackspace.js.map +1 -0
- package/lib/appui-react/icons/SvgDistance.d.ts +7 -0
- package/lib/appui-react/icons/SvgDistance.d.ts.map +1 -0
- package/lib/appui-react/icons/SvgDistance.js +16 -0
- package/lib/appui-react/icons/SvgDistance.js.map +1 -0
- package/lib/appui-react/icons/SvgHeight.d.ts +7 -0
- package/lib/appui-react/icons/SvgHeight.d.ts.map +1 -0
- package/lib/appui-react/icons/SvgHeight.js +17 -0
- package/lib/appui-react/icons/SvgHeight.js.map +1 -0
- package/lib/appui-react/icons/SvgMouseClickLeftDrag.d.ts +7 -0
- package/lib/appui-react/icons/SvgMouseClickLeftDrag.d.ts.map +1 -0
- package/lib/appui-react/icons/SvgMouseClickLeftDrag.js +15 -0
- package/lib/appui-react/icons/SvgMouseClickLeftDrag.js.map +1 -0
- package/lib/appui-react/icons/SvgMouseClickRightDrag.d.ts +7 -0
- package/lib/appui-react/icons/SvgMouseClickRightDrag.d.ts.map +1 -0
- package/lib/appui-react/icons/SvgMouseClickRightDrag.js +15 -0
- package/lib/appui-react/icons/SvgMouseClickRightDrag.js.map +1 -0
- package/lib/appui-react/icons/SvgMouseClickWheelDrag.d.ts +7 -0
- package/lib/appui-react/icons/SvgMouseClickWheelDrag.d.ts.map +1 -0
- package/lib/appui-react/icons/SvgMouseClickWheelDrag.js +15 -0
- package/lib/appui-react/icons/SvgMouseClickWheelDrag.js.map +1 -0
- package/lib/appui-react/icons/SvgTouchCursorPan.d.ts +7 -0
- package/lib/appui-react/icons/SvgTouchCursorPan.d.ts.map +1 -0
- package/lib/appui-react/icons/SvgTouchCursorPan.js +15 -0
- package/lib/appui-react/icons/SvgTouchCursorPan.js.map +1 -0
- package/lib/appui-react/icons/SvgTouchCursorPoint.d.ts +7 -0
- package/lib/appui-react/icons/SvgTouchCursorPoint.d.ts.map +1 -0
- package/lib/appui-react/icons/SvgTouchCursorPoint.js +16 -0
- package/lib/appui-react/icons/SvgTouchCursorPoint.js.map +1 -0
- package/lib/appui-react/layout/StandardLayout.scss +3 -8
- package/lib/appui-react/layout/base/DragManager.d.ts.map +1 -1
- package/lib/appui-react/layout/base/DragManager.js +10 -15
- package/lib/appui-react/layout/base/DragManager.js.map +1 -1
- package/lib/appui-react/layout/state/NineZoneAction.d.ts +1 -0
- package/lib/appui-react/layout/state/NineZoneAction.d.ts.map +1 -1
- package/lib/appui-react/layout/state/NineZoneAction.js.map +1 -1
- package/lib/appui-react/layout/state/NineZoneStateReducer.d.ts.map +1 -1
- package/lib/appui-react/layout/state/NineZoneStateReducer.js +23 -16
- package/lib/appui-react/layout/state/NineZoneStateReducer.js.map +1 -1
- package/lib/appui-react/messages/Pointer.js +1 -1
- package/lib/appui-react/messages/Pointer.js.map +1 -1
- package/lib/appui-react/navigationaids/CubeNavigationAidControl.d.ts.map +1 -1
- package/lib/appui-react/navigationaids/CubeNavigationAidControl.js +1 -0
- package/lib/appui-react/navigationaids/CubeNavigationAidControl.js.map +1 -1
- package/lib/appui-react/navigationaids/DrawingNavigationAidControl.d.ts.map +1 -1
- package/lib/appui-react/navigationaids/DrawingNavigationAidControl.js +1 -0
- package/lib/appui-react/navigationaids/DrawingNavigationAidControl.js.map +1 -1
- package/lib/appui-react/navigationaids/SheetNavigationAid.d.ts.map +1 -1
- package/lib/appui-react/navigationaids/SheetNavigationAid.js +1 -0
- package/lib/appui-react/navigationaids/SheetNavigationAid.js.map +1 -1
- package/lib/appui-react/navigationaids/StandardRotationNavigationAid.d.ts.map +1 -1
- package/lib/appui-react/navigationaids/StandardRotationNavigationAid.js +1 -0
- package/lib/appui-react/navigationaids/StandardRotationNavigationAid.js.map +1 -1
- package/lib/appui-react/popup/KeyinPalettePanel.js +1 -1
- package/lib/appui-react/popup/KeyinPalettePanel.js.map +1 -1
- package/lib/appui-react/popup/PopupManager.d.ts.map +1 -1
- package/lib/appui-react/popup/PopupManager.js +9 -3
- package/lib/appui-react/popup/PopupManager.js.map +1 -1
- package/lib/appui-react/preview/PreviewFeatures.d.ts +5 -0
- package/lib/appui-react/preview/PreviewFeatures.d.ts.map +1 -1
- package/lib/appui-react/preview/PreviewFeatures.js +1 -0
- package/lib/appui-react/preview/PreviewFeatures.js.map +1 -1
- package/lib/appui-react/preview/horizontal-panel-alignment/PreviewHorizontalPanelAlign.d.ts.map +1 -1
- package/lib/appui-react/preview/horizontal-panel-alignment/PreviewHorizontalPanelAlign.js +8 -2
- package/lib/appui-react/preview/horizontal-panel-alignment/PreviewHorizontalPanelAlign.js.map +1 -1
- package/lib/appui-react/preview/tool-settings-new-editors/useToolsSettingsNewEditors.d.ts +5 -0
- package/lib/appui-react/preview/tool-settings-new-editors/useToolsSettingsNewEditors.d.ts.map +1 -0
- package/lib/appui-react/preview/tool-settings-new-editors/useToolsSettingsNewEditors.js +13 -0
- package/lib/appui-react/preview/tool-settings-new-editors/useToolsSettingsNewEditors.js.map +1 -0
- package/lib/appui-react/shared/MenuItem.d.ts +3 -0
- package/lib/appui-react/shared/MenuItem.d.ts.map +1 -1
- package/lib/appui-react/shared/MenuItem.js +2 -3
- package/lib/appui-react/shared/MenuItem.js.map +1 -1
- package/lib/appui-react/statusbar/StatusBarItemUtilities.d.ts.map +1 -1
- package/lib/appui-react/statusbar/StatusBarItemUtilities.js +2 -0
- package/lib/appui-react/statusbar/StatusBarItemUtilities.js.map +1 -1
- package/lib/appui-react/statusfields/ActivityCenter.js +1 -1
- package/lib/appui-react/statusfields/ActivityCenter.js.map +1 -1
- package/lib/appui-react/statusfields/toolassistance/ToolAssistanceField.d.ts +2 -55
- package/lib/appui-react/statusfields/toolassistance/ToolAssistanceField.d.ts.map +1 -1
- package/lib/appui-react/statusfields/toolassistance/ToolAssistanceField.js +333 -403
- package/lib/appui-react/statusfields/toolassistance/ToolAssistanceField.js.map +1 -1
- package/lib/appui-react/toolbar/Toolbar.d.ts.map +1 -1
- package/lib/appui-react/toolbar/Toolbar.js +4 -3
- package/lib/appui-react/toolbar/Toolbar.js.map +1 -1
- package/lib/appui-react/toolbar/ToolbarItemUtilities.d.ts.map +1 -1
- package/lib/appui-react/toolbar/ToolbarItemUtilities.js +3 -0
- package/lib/appui-react/toolbar/ToolbarItemUtilities.js.map +1 -1
- package/lib/appui-react/toolbar/new-toolbars/ActionItem.d.ts.map +1 -1
- package/lib/appui-react/toolbar/new-toolbars/ActionItem.js +3 -0
- package/lib/appui-react/toolbar/new-toolbars/ActionItem.js.map +1 -1
- package/lib/appui-react/toolbar/new-toolbars/GroupItem.d.ts +1 -1
- package/lib/appui-react/toolbar/new-toolbars/GroupItem.d.ts.map +1 -1
- package/lib/appui-react/toolbar/new-toolbars/GroupItem.js +2 -0
- package/lib/appui-react/toolbar/new-toolbars/GroupItem.js.map +1 -1
- package/lib/appui-react/toolbar/new-toolbars/Item.d.ts +2 -2
- package/lib/appui-react/toolbar/new-toolbars/Toolbar.d.ts +6 -3
- package/lib/appui-react/toolbar/new-toolbars/Toolbar.d.ts.map +1 -1
- package/lib/appui-react/toolbar/new-toolbars/Toolbar.js +4 -3
- package/lib/appui-react/toolbar/new-toolbars/Toolbar.js.map +1 -1
- package/lib/appui-react/toolsettings/DefaultToolSettingsProvider.d.ts.map +1 -1
- package/lib/appui-react/toolsettings/DefaultToolSettingsProvider.js +1 -0
- package/lib/appui-react/toolsettings/DefaultToolSettingsProvider.js.map +1 -1
- package/lib/appui-react/ui-items-provider/AbstractUiItemsManager.d.ts.map +1 -1
- package/lib/appui-react/ui-items-provider/AbstractUiItemsManager.js +9 -2
- package/lib/appui-react/ui-items-provider/AbstractUiItemsManager.js.map +1 -1
- package/lib/appui-react/ui-items-provider/StandardContentToolsProvider.d.ts.map +1 -1
- package/lib/appui-react/ui-items-provider/StandardContentToolsProvider.js +1 -0
- package/lib/appui-react/ui-items-provider/StandardContentToolsProvider.js.map +1 -1
- package/lib/appui-react/ui-items-provider/StandardNavigationToolsProvider.d.ts.map +1 -1
- package/lib/appui-react/ui-items-provider/StandardNavigationToolsProvider.js +1 -0
- package/lib/appui-react/ui-items-provider/StandardNavigationToolsProvider.js.map +1 -1
- package/lib/appui-react/ui-items-provider/StandardStatusbarItemsProvider.d.ts.map +1 -1
- package/lib/appui-react/ui-items-provider/StandardStatusbarItemsProvider.js +1 -0
- package/lib/appui-react/ui-items-provider/StandardStatusbarItemsProvider.js.map +1 -1
- package/lib/appui-react/uiprovider/ComponentGenerator.d.ts.map +1 -1
- package/lib/appui-react/uiprovider/ComponentGenerator.js +4 -2
- package/lib/appui-react/uiprovider/ComponentGenerator.js.map +1 -1
- package/lib/appui-react/utils/InternalUiShowHideManager.d.ts +2 -0
- package/lib/appui-react/utils/InternalUiShowHideManager.d.ts.map +1 -1
- package/lib/appui-react/utils/InternalUiShowHideManager.js +6 -0
- package/lib/appui-react/utils/InternalUiShowHideManager.js.map +1 -1
- package/lib/appui-react/utils/PropsHelper.js +1 -1
- package/lib/appui-react/utils/PropsHelper.js.map +1 -1
- package/lib/appui-react/widget-panels/Frontstage.d.ts +7 -2
- package/lib/appui-react/widget-panels/Frontstage.d.ts.map +1 -1
- package/lib/appui-react/widget-panels/Frontstage.js +29 -12
- package/lib/appui-react/widget-panels/Frontstage.js.map +1 -1
- package/lib/appui-react/widgets/BackstageAppButton.scss +8 -3
- package/lib/appui-react/widgets/BasicToolWidget.d.ts.map +1 -1
- package/lib/appui-react/widgets/BasicToolWidget.js +3 -1
- package/lib/appui-react/widgets/BasicToolWidget.js.map +1 -1
- package/lib/appui-react/widgets/WidgetDef.d.ts.map +1 -1
- package/lib/appui-react/widgets/WidgetDef.js +0 -1
- package/lib/appui-react/widgets/WidgetDef.js.map +1 -1
- package/lib/appui-react.d.ts +1 -1
- package/lib/appui-react.d.ts.map +1 -1
- package/lib/appui-react.js +1 -1
- package/lib/appui-react.js.map +1 -1
- package/lib/cjs/appui-react/cursor/cursorpopup/CursorPopup.scss +3 -0
- package/lib/cjs/appui-react/layout/StandardLayout.scss +3 -8
- package/lib/cjs/appui-react/widgets/BackstageAppButton.scss +8 -3
- package/lib/esm/appui-react/cursor/cursorpopup/CursorPopup.scss +3 -0
- package/lib/esm/appui-react/layout/StandardLayout.scss +3 -8
- package/lib/esm/appui-react/widgets/BackstageAppButton.scss +8 -3
- package/package.json +29 -30
- package/lib/appui-react/accudraw/angle.svg +0 -1
- package/lib/appui-react/accudraw/backspace.svg +0 -9
- package/lib/appui-react/accudraw/constraint-2d.svg +0 -11
- package/lib/appui-react/accudraw/distance.svg +0 -1
- package/lib/appui-react/accudraw/height-2.svg +0 -10
- package/lib/appui-react/accudraw/height.svg +0 -11
- package/lib/appui-react/statusfields/toolassistance/accept-point.svg +0 -1
- package/lib/appui-react/statusfields/toolassistance/cursor-click.svg +0 -1
- package/lib/appui-react/statusfields/toolassistance/gesture-one-finger-drag.svg +0 -1
- package/lib/appui-react/statusfields/toolassistance/gesture-one-finger-tap-double.svg +0 -1
- package/lib/appui-react/statusfields/toolassistance/gesture-one-finger-tap.svg +0 -1
- package/lib/appui-react/statusfields/toolassistance/gesture-pinch.svg +0 -1
- package/lib/appui-react/statusfields/toolassistance/gesture-two-finger-drag.svg +0 -1
- package/lib/appui-react/statusfields/toolassistance/gesture-two-finger-tap.svg +0 -1
- package/lib/appui-react/statusfields/toolassistance/mouse-click-left-drag.svg +0 -1
- package/lib/appui-react/statusfields/toolassistance/mouse-click-left.svg +0 -1
- package/lib/appui-react/statusfields/toolassistance/mouse-click-right-drag.svg +0 -1
- package/lib/appui-react/statusfields/toolassistance/mouse-click-right.svg +0 -1
- package/lib/appui-react/statusfields/toolassistance/mouse-click-wheel-drag.svg +0 -1
- package/lib/appui-react/statusfields/toolassistance/mouse-click-wheel.svg +0 -1
- package/lib/appui-react/statusfields/toolassistance/touch-cursor-pan.svg +0 -1
- package/lib/appui-react/statusfields/toolassistance/touch-cursor-point.svg +0 -1
- package/lib/cjs/appui-react/accudraw/angle.svg +0 -1
- package/lib/cjs/appui-react/accudraw/backspace.svg +0 -9
- package/lib/cjs/appui-react/accudraw/constraint-2d.svg +0 -11
- package/lib/cjs/appui-react/accudraw/distance.svg +0 -1
- package/lib/cjs/appui-react/accudraw/height-2.svg +0 -10
- package/lib/cjs/appui-react/accudraw/height.svg +0 -11
- package/lib/cjs/appui-react/statusfields/toolassistance/accept-point.svg +0 -1
- package/lib/cjs/appui-react/statusfields/toolassistance/cursor-click.svg +0 -1
- package/lib/cjs/appui-react/statusfields/toolassistance/gesture-one-finger-drag.svg +0 -1
- package/lib/cjs/appui-react/statusfields/toolassistance/gesture-one-finger-tap-double.svg +0 -1
- package/lib/cjs/appui-react/statusfields/toolassistance/gesture-one-finger-tap.svg +0 -1
- package/lib/cjs/appui-react/statusfields/toolassistance/gesture-pinch.svg +0 -1
- package/lib/cjs/appui-react/statusfields/toolassistance/gesture-two-finger-drag.svg +0 -1
- package/lib/cjs/appui-react/statusfields/toolassistance/gesture-two-finger-tap.svg +0 -1
- package/lib/cjs/appui-react/statusfields/toolassistance/mouse-click-left-drag.svg +0 -1
- package/lib/cjs/appui-react/statusfields/toolassistance/mouse-click-left.svg +0 -1
- package/lib/cjs/appui-react/statusfields/toolassistance/mouse-click-right-drag.svg +0 -1
- package/lib/cjs/appui-react/statusfields/toolassistance/mouse-click-right.svg +0 -1
- package/lib/cjs/appui-react/statusfields/toolassistance/mouse-click-wheel-drag.svg +0 -1
- package/lib/cjs/appui-react/statusfields/toolassistance/mouse-click-wheel.svg +0 -1
- package/lib/cjs/appui-react/statusfields/toolassistance/touch-cursor-pan.svg +0 -1
- package/lib/cjs/appui-react/statusfields/toolassistance/touch-cursor-point.svg +0 -1
- package/lib/esm/appui-react/accudraw/angle.svg +0 -1
- package/lib/esm/appui-react/accudraw/backspace.svg +0 -9
- package/lib/esm/appui-react/accudraw/constraint-2d.svg +0 -11
- package/lib/esm/appui-react/accudraw/distance.svg +0 -1
- package/lib/esm/appui-react/accudraw/height-2.svg +0 -10
- package/lib/esm/appui-react/accudraw/height.svg +0 -11
- package/lib/esm/appui-react/statusfields/toolassistance/accept-point.svg +0 -1
- package/lib/esm/appui-react/statusfields/toolassistance/cursor-click.svg +0 -1
- package/lib/esm/appui-react/statusfields/toolassistance/gesture-one-finger-drag.svg +0 -1
- package/lib/esm/appui-react/statusfields/toolassistance/gesture-one-finger-tap-double.svg +0 -1
- package/lib/esm/appui-react/statusfields/toolassistance/gesture-one-finger-tap.svg +0 -1
- package/lib/esm/appui-react/statusfields/toolassistance/gesture-pinch.svg +0 -1
- package/lib/esm/appui-react/statusfields/toolassistance/gesture-two-finger-drag.svg +0 -1
- package/lib/esm/appui-react/statusfields/toolassistance/gesture-two-finger-tap.svg +0 -1
- package/lib/esm/appui-react/statusfields/toolassistance/mouse-click-left-drag.svg +0 -1
- package/lib/esm/appui-react/statusfields/toolassistance/mouse-click-left.svg +0 -1
- package/lib/esm/appui-react/statusfields/toolassistance/mouse-click-right-drag.svg +0 -1
- package/lib/esm/appui-react/statusfields/toolassistance/mouse-click-right.svg +0 -1
- package/lib/esm/appui-react/statusfields/toolassistance/mouse-click-wheel-drag.svg +0 -1
- package/lib/esm/appui-react/statusfields/toolassistance/mouse-click-wheel.svg +0 -1
- package/lib/esm/appui-react/statusfields/toolassistance/touch-cursor-pan.svg +0 -1
- package/lib/esm/appui-react/statusfields/toolassistance/touch-cursor-point.svg +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingViewportContent.js","sourceRoot":"","sources":["../../../src/appui-react/content/FloatingViewportContent.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,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAoBrD;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAAmC;IACzE,MAAM,EAAE,eAAe,EAAE,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;IACvD,OAAO,CACL,oBAAC,8BAA8B,QAC5B,eAAe,CACe,CAClC,CAAC;AACJ,CAAC;AAUD;;;GAGG;AACH,MAAM,UAAU,8BAA8B,CAAC,EAC7C,QAAQ,GAC4B;IACpC,OAAO,CACL,6BACE,
|
|
1
|
+
{"version":3,"file":"FloatingViewportContent.js","sourceRoot":"","sources":["../../../src/appui-react/content/FloatingViewportContent.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,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAoBrD;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAAmC;IACzE,MAAM,EAAE,eAAe,EAAE,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;IACvD,OAAO,CACL,oBAAC,8BAA8B,QAC5B,eAAe,CACe,CAClC,CAAC;AACJ,CAAC;AAUD;;;GAGG;AACH,MAAM,UAAU,8BAA8B,CAAC,EAC7C,QAAQ,GAC4B;IACpC,OAAO,CACL,6BACE,SAAS,EAAC,4BAA4B,EACtC,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE;QAE/C,oBAAC,cAAc,IACb,OAAO,EAAE,QAAQ,EACjB,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,EAC/C,YAAY,EAAE,SAAS,GACvB,CACE,CACP,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAkC;IACpE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,aAAa,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;I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GAAG,EAAE;YACV,IAAI,cAAc,CAAC,OAAO,EAAE,CAAC;gBAC3B,4DAA4D;gBAC5D,WAAW,CAAC,OAAO,CAAC,0BAA0B,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;gBACvE,cAAc,CAAC,OAAO,GAAG,SAAS,CAAC;YACrC,CAAC;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhB,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,QAAQ,IAAI,cAAc,CAAC,OAAO,EAAE,CAAC;YACvC,cAAc,CAAC,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;YAC3C,IAAI,IAAI,KAAK,cAAc,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;gBAC9C,cAAc,CAAC,OAAO,CAAC,SAAS,GAAG,eAAe,CAAC;YACrD,CAAC;QACH,CAAC;IACH,CAAC,EAAE,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC,CAAC;IAEhC,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,OAAO,SAAS,CAAC,WAAW,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,EAAE,EAAE,EAAE;YAC1D,IAAI,cAAc,CAAC,OAAO,EAAE,QAAQ,KAAK,EAAE,EAAE,CAAC;gBAC5C,4DAA4D;gBAC5D,WAAW,CAAC,OAAO,CAAC,0BAA0B,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;gBACvE,cAAc,CAAC,OAAO,GAAG,SAAS,CAAC;YACrC,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACL,eAAe;KAChB,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 ContentView\n */\n\nimport * as React from \"react\";\nimport type { ScreenViewport } from \"@itwin/core-frontend\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport type { ViewStateProp } from \"@itwin/imodel-components-react\";\nimport { ViewportComponent } from \"@itwin/imodel-components-react\";\nimport { FloatingViewportContentControl } from \"./ViewportContentControl.js\";\nimport { ContentWrapper } from \"./ContentLayout.js\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport { useRefs } from \"@itwin/core-react/internal\";\nimport type { ContentOverlay } from \"./ContentOverlay.js\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/**\n * @beta\n * @deprecated in 4.16.0. Props of deprecated component {@link FloatingViewportContent}.\n */\nexport interface FloatingViewportContentProps {\n /** callback used to construct context menu when user right-clicks on canvas/viewport */\n onContextMenu?: (e: React.MouseEvent) => boolean;\n /** viewport/content control uniqueId */\n contentId: string;\n /** The initial view state used to create the viewport, or a function that returns it (will refresh when the function changes) */\n initialViewState: ViewStateProp;\n /** Function to get a reference to the ScreenViewport */\n viewportRef?: React.Ref<ScreenViewport>;\n}\n\n/**\n * @beta\n * @deprecated in 4.16.0. Wrap {@link @itwin/imodel-components-react#ViewportComponent} component with a {@link ContentOverlay} instead.\n */\nexport function FloatingViewportContent(props: FloatingViewportContentProps) {\n const { viewportControl } = useFloatingViewport(props);\n return (\n <FloatingViewportContentWrapper>\n {viewportControl}\n </FloatingViewportContentWrapper>\n );\n}\n\n/**\n * @public\n * @deprecated in 4.16.0. Props of deprecated component {@link FloatingViewportContentWrapper}.\n */\nexport interface FloatingViewportContentWrapperProps {\n readonly children?: React.ReactNode;\n}\n\n/**\n * @public\n * @deprecated in 4.16.0. Use {@link ContentOverlay} component to display the active content indicator instead.\n */\nexport function FloatingViewportContentWrapper({\n children,\n}: FloatingViewportContentWrapperProps) {\n return (\n <div\n className=\"uifw-dialog-imodel-content\"\n style={{ height: \"100%\", position: \"relative\" }}\n >\n <ContentWrapper\n content={children}\n style={{ height: \"100%\", position: \"relative\" }}\n contentIndex={undefined}\n />\n </div>\n );\n}\n\n/**\n * @alpha\n * @deprecated in 4.16.0. Use {@link @itwin/imodel-components-react#ViewportComponent} component instead.\n */\nexport function useFloatingViewport(args: FloatingViewportContentProps) {\n const { contentId, initialViewState, onContextMenu, viewportRef } = args;\n const [viewport, setViewport] = React.useState<ScreenViewport | undefined>();\n const contentControl = React.useRef<\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n FloatingViewportContentControl | undefined\n >();\n\n const viewState = React.useMemo(\n () =>\n typeof initialViewState === \"function\"\n ? initialViewState()\n : initialViewState,\n [initialViewState]\n );\n const ref = React.useCallback((v: ScreenViewport) => {\n setViewport(v);\n }, []);\n\n const refs = useRefs(ref, viewportRef);\n const viewportControl = React.useMemo(() => {\n const node = (\n <ViewportComponent\n key={contentId}\n imodel={viewState.iModel}\n viewState={viewState}\n controlId={contentId}\n onContextMenu={onContextMenu}\n viewportRef={refs}\n />\n );\n return node;\n }, [refs, onContextMenu, viewState, contentId]);\n\n React.useEffect(() => {\n if (!contentControl.current) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n contentControl.current = new FloatingViewportContentControl(\n contentId,\n contentId,\n null\n );\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n UiFramework.content.addFloatingContentControl(contentControl.current);\n }\n return () => {\n if (contentControl.current) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n UiFramework.content.dropFloatingContentControl(contentControl.current);\n contentControl.current = undefined;\n }\n };\n }, [contentId]);\n\n React.useEffect(() => {\n if (viewport && contentControl.current) {\n contentControl.current.viewport = viewport;\n if (null === contentControl.current.reactNode) {\n contentControl.current.reactNode = viewportControl;\n }\n }\n }, [viewport, viewportControl]);\n\n React.useEffect(() => {\n return IModelApp.viewManager.onViewClose.addListener((vp) => {\n if (contentControl.current?.viewport === vp) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n UiFramework.content.dropFloatingContentControl(contentControl.current);\n contentControl.current = undefined;\n }\n });\n }, []);\n\n return {\n viewportControl,\n };\n}\n"]}
|
|
@@ -46,6 +46,7 @@ export declare class CursorUpdatedEvent extends UiEvent<CursorUpdatedEventArgs>
|
|
|
46
46
|
*/
|
|
47
47
|
export declare class CursorInformation {
|
|
48
48
|
private static _cursorPosition;
|
|
49
|
+
private static _cursorDocument;
|
|
49
50
|
private static _cursorDirection;
|
|
50
51
|
private static _cursorDirections;
|
|
51
52
|
/** The cursor position. */
|
|
@@ -57,10 +58,12 @@ export declare class CursorInformation {
|
|
|
57
58
|
static get cursorY(): number;
|
|
58
59
|
/** Gets the general cursor movement direction. */
|
|
59
60
|
static get cursorDirection(): CursorDirection;
|
|
61
|
+
/** Gets the cursor document. */
|
|
62
|
+
static get cursorDocument(): Document | undefined;
|
|
60
63
|
/** Gets the [[CursorUpdatedEvent]]. */
|
|
61
64
|
static readonly onCursorUpdatedEvent: CursorUpdatedEvent;
|
|
62
65
|
/** Handles the mouse movement. Sets the cursor position and direction and emits onCursorUpdatedEvent. */
|
|
63
|
-
static handleMouseMove(point: XAndY): void;
|
|
66
|
+
static handleMouseMove(point: XAndY, document?: Document): void;
|
|
64
67
|
private static _determineMostFrequentDirection;
|
|
65
68
|
private static _mostFrequent;
|
|
66
69
|
private static _determineCursorDirection;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CursorInformation.d.ts","sourceRoot":"","sources":["../../../src/appui-react/cursor/CursorInformation.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAGlE;;GAEG;AACH,oBAAY,oBAAoB;IAC9B,GAAG,OAAS;IACZ,IAAI,MAAS;IACb,KAAK,KAAS;IACd,MAAM,IAAS;CAChB;AAED;;GAEG;AACH,oBAAY,eAAe;IACzB,IAAI,IAAI;IACR,GAAG,OAA2B;IAC9B,IAAI,MAA4B;IAChC,KAAK,KAA6B;IAClC,MAAM,IAA8B;IACpC,OAAO,OAAuD;IAC9D,QAAQ,OAAwD;IAChE,UAAU,MAA0D;IACpE,WAAW,KAA2D;CACvE;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,eAAe,CAAC;CAC5B;AAED;;;GAGG;AAEH,qBAAa,kBAAmB,SAAQ,OAAO,CAAC,sBAAsB,CAAC;CAAG;AAE1E;;GAEG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,MAAM,CAAC,eAAe,CAAsB;IACpD,OAAO,CAAC,MAAM,CAAC,gBAAgB,CACD;IAE9B,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAgC;IAEhE,2BAA2B;IAC3B,WAAkB,cAAc,IAAI,KAAK,CAExC;IACD,WAAkB,cAAc,CAAC,EAAE,EAAE,KAAK,EAEzC;IAED,kCAAkC;IAClC,WAAkB,OAAO,IAAI,MAAM,CAElC;IACD,kCAAkC;IAClC,WAAkB,OAAO,IAAI,MAAM,CAElC;IAED,kDAAkD;IAClD,WAAkB,eAAe,IAAI,eAAe,CAEnD;IAED,uCAAuC;IAEvC,gBAAuB,oBAAoB,qBAA4B;IAEvE,0GAA0G;WAC5F,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"CursorInformation.d.ts","sourceRoot":"","sources":["../../../src/appui-react/cursor/CursorInformation.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAGlE;;GAEG;AACH,oBAAY,oBAAoB;IAC9B,GAAG,OAAS;IACZ,IAAI,MAAS;IACb,KAAK,KAAS;IACd,MAAM,IAAS;CAChB;AAED;;GAEG;AACH,oBAAY,eAA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E,eAAe,GAC/B,gBAAgB;IAiCnB,8BAA8B;WAChB,qBAAqB,IAAI,IAAI;CAG5C;AAED;;GAEG;AACH,eAAO,MAAM,yBAAyB;oBACpB,OAAO;uBACJ,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI;GAU5C,CAAC"}
|
|
@@ -64,11 +64,16 @@ export class CursorInformation {
|
|
|
64
64
|
static get cursorDirection() {
|
|
65
65
|
return this._cursorDirection;
|
|
66
66
|
}
|
|
67
|
+
/** Gets the cursor document. */
|
|
68
|
+
static get cursorDocument() {
|
|
69
|
+
return this._cursorDocument;
|
|
70
|
+
}
|
|
67
71
|
/** Handles the mouse movement. Sets the cursor position and direction and emits onCursorUpdatedEvent. */
|
|
68
|
-
static handleMouseMove(point) {
|
|
72
|
+
static handleMouseMove(point, document) {
|
|
69
73
|
const oldPt = CursorInformation.cursorPosition;
|
|
70
74
|
const direction = this._determineMostFrequentDirection(this._cursorDirections, this._cursorPosition, Point.create(point));
|
|
71
75
|
this.cursorPosition = point;
|
|
76
|
+
this._cursorDocument = document;
|
|
72
77
|
this._cursorDirection = direction;
|
|
73
78
|
this.onCursorUpdatedEvent.emit({ oldPt, newPt: point, direction });
|
|
74
79
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CursorInformation.js","sourceRoot":"","sources":["../../../src/appui-react/cursor/CursorInformation.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAEnD;;GAEG;AACH,MAAM,CAAN,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,gEAAY,CAAA;IACZ,iEAAa,CAAA;IACb,kEAAc,CAAA;IAC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Ae,CAAC,UAAU;gBAC7B,gBAAgB,GAAG,gBAAgB,CAAC,UAAU,CAAC;gBAC/C,MAAM;YACR,KAAK,eAAe,CAAC,WAAW;gBAC9B,gBAAgB,GAAG,gBAAgB,CAAC,WAAW,CAAC;gBAChD,MAAM;QACV,CAAC;QAED,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAED,8BAA8B;IACvB,MAAM,CAAC,qBAAqB;QACjC,IAAI,CAAC,iBAAiB,CAAC,MAAM,GAAG,CAAC,CAAC;IACpC,CAAC;;AAzIc,iCAAe,GAAU,IAAI,KAAK,EAAE,CAAC;AACrC,kCAAgB,GAC7B,eAAe,CAAC,WAAW,CAAC;AAEf,mCAAiB,GAAG,IAAI,KAAK,EAAmB,CAAC;AAwBhE,uCAAuC;AACvC,4DAA4D;AACrC,sCAAoB,GAAG,IAAI,kBAAkB,EAAE,CAAC;AA8GzE;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAG5C,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACX,cAAc,EAAE,KAAK;IACrB,iBAAiB,EAAE,CAAC,OAAgB,EAAE,EAAE;QACtC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACZ,OAAO,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE;YACvB,KAAK,CAAC,cAAc,GAAG,OAAO,CAAC;QACjC,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;CACF,CAAC,CAAC,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 Cursor\n */\n\nimport { create } from \"zustand\";\nimport { produce } from \"immer\";\nimport type { XAndY } from \"@itwin/core-geometry\";\nimport { RelativePosition, UiEvent } from \"@itwin/appui-abstract\";\nimport { Point } from \"@itwin/core-react/internal\";\n\n/** Enum for Cursor Direction parts\n * @public\n */\nexport enum CursorDirectionParts {\n Top = 0x1000,\n Left = 0x0100,\n Right = 0x0010,\n Bottom = 0x0001,\n}\n\n/** Enum for Cursor Direction\n * @public\n */\nexport enum CursorDirection {\n None = 0,\n Top = CursorDirectionParts.Top,\n Left = CursorDirectionParts.Left,\n Right = CursorDirectionParts.Right,\n Bottom = CursorDirectionParts.Bottom,\n TopLeft = CursorDirectionParts.Top | CursorDirectionParts.Left,\n TopRight = CursorDirectionParts.Top | CursorDirectionParts.Right,\n BottomLeft = CursorDirectionParts.Bottom | CursorDirectionParts.Left,\n BottomRight = CursorDirectionParts.Bottom | CursorDirectionParts.Right,\n}\n\n/** Cursor Updated Event Args interface.\n * @public\n * @deprecated in 4.13.0. Event args are inferred from a listener. If explicit type is needed use a type helper.\n */\nexport interface CursorUpdatedEventArgs {\n oldPt: XAndY;\n newPt: XAndY;\n direction: CursorDirection;\n}\n\n/** Cursor Updated Event class.\n * @public\n * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport class CursorUpdatedEvent extends UiEvent<CursorUpdatedEventArgs> {}\n\n/** Cursor Information class\n * @public\n */\nexport class CursorInformation {\n private static _cursorPosition: Point = new Point();\n private static _cursorDirection: CursorDirection =\n CursorDirection.BottomRight;\n\n private static _cursorDirections = new Array<CursorDirection>();\n\n /** The cursor position. */\n public static get cursorPosition(): XAndY {\n return this._cursorPosition;\n }\n public static set cursorPosition(pt: XAndY) {\n this._cursorPosition = Point.create(pt);\n }\n\n /** Gets the cursor X position. */\n public static get cursorX(): number {\n return this._cursorPosition.x;\n }\n /** Gets the cursor Y position. */\n public static get cursorY(): number {\n return this._cursorPosition.y;\n }\n\n /** Gets the general cursor movement direction. */\n public static get cursorDirection(): CursorDirection {\n return this._cursorDirection;\n }\n\n /** Gets the [[CursorUpdatedEvent]]. */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public static readonly onCursorUpdatedEvent = new CursorUpdatedEvent();\n\n /** Handles the mouse movement. Sets the cursor position and direction and emits onCursorUpdatedEvent. */\n public static handleMouseMove(point: XAndY): void {\n const oldPt = CursorInformation.cursorPosition;\n const direction = this._determineMostFrequentDirection(\n this._cursorDirections,\n this._cursorPosition,\n Point.create(point)\n );\n\n this.cursorPosition = point;\n this._cursorDirection = direction;\n\n this.onCursorUpdatedEvent.emit({ oldPt, newPt: point, direction });\n }\n\n private static _determineMostFrequentDirection(\n cursorDirections: CursorDirection[],\n oldPt: Point,\n newPt: Point\n ): CursorDirection {\n const cursorDirection = this._determineCursorDirection(oldPt, newPt);\n cursorDirections.push(cursorDirection);\n if (cursorDirections.length > 10) cursorDirections.shift();\n return this._mostFrequent(cursorDirections);\n }\n\n private static _mostFrequent(array: CursorDirection[]): CursorDirection {\n const hashMap = new Map<CursorDirection, number>();\n let maxCount = 0,\n mostFrequent = CursorDirection.None;\n\n array.forEach((value: CursorDirection) => {\n const key = value;\n let frequency = hashMap.get(key);\n\n if (frequency !== undefined) frequency++;\n else frequency = 1;\n\n hashMap.set(key, frequency);\n\n if (frequency > maxCount) {\n mostFrequent = key;\n maxCount = frequency;\n }\n });\n\n return mostFrequent;\n }\n\n private static _determineCursorDirection(\n oldPt: Point,\n newPt: Point\n ): CursorDirection {\n let directionParts: number = 0;\n\n if (newPt.x < oldPt.x) directionParts |= CursorDirectionParts.Left;\n else if (newPt.x > oldPt.x) directionParts |= CursorDirectionParts.Right;\n\n if (newPt.y < oldPt.y) directionParts |= CursorDirectionParts.Top;\n else if (newPt.y > oldPt.y) directionParts |= CursorDirectionParts.Bottom;\n\n const direction = directionParts as CursorDirection;\n\n return direction;\n }\n\n /** Gets the relative position based on the cursor direction. */\n public static getRelativePositionFromCursorDirection(\n cursorDirection: CursorDirection\n ): RelativePosition {\n let relativePosition: RelativePosition = RelativePosition.BottomRight;\n\n switch (cursorDirection) {\n case CursorDirection.Top:\n relativePosition = RelativePosition.Top;\n break;\n case CursorDirection.Left:\n relativePosition = RelativePosition.Left;\n break;\n case CursorDirection.Right:\n relativePosition = RelativePosition.Right;\n break;\n case CursorDirection.Bottom:\n relativePosition = RelativePosition.Bottom;\n break;\n case CursorDirection.TopLeft:\n relativePosition = RelativePosition.TopLeft;\n break;\n case CursorDirection.TopRight:\n relativePosition = RelativePosition.TopRight;\n break;\n case CursorDirection.BottomLeft:\n relativePosition = RelativePosition.BottomLeft;\n break;\n case CursorDirection.BottomRight:\n relativePosition = RelativePosition.BottomRight;\n break;\n }\n\n return relativePosition;\n }\n\n /** @internal - for testing */\n public static clearCursorDirections(): void {\n this._cursorDirections.length = 0;\n }\n}\n\n/** Returns additional information about cursor.\n * @internal\n */\nexport const useCursorInformationStore = create<{\n contentHovered: boolean;\n setContentHovered: (hovered: boolean) => void;\n}>((set) => ({\n contentHovered: false,\n setContentHovered: (hovered: boolean) => {\n set((state) =>\n produce(state, (draft) => {\n draft.contentHovered = hovered;\n })\n );\n },\n}));\n"]}
|
|
1
|
+
{"version":3,"file":"CursorInformation.js","sourceRoot":"","sources":["../../../src/appui-react/cursor/CursorInformation.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAEnD;;GAEG;AACH,MAAM,CAAN,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,gEAAY,CAAA;IACZ,iEAAa,CAAA;IACb,kEAAc,CAAA;IACd,mEAAe,CAAA;AACjB,CAAC,EALW,oBAAoB,KAApB,oBAAoB,QAK/B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,eAUX;AAVD,WAAY,eAAe;IACzB,qDAAQ,CAAA;IACR,sDAA8B,CAAA;IAC9B,uDAAgC,CAAA;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G,gBAAgB,CAAC,UAAU,CAAC;gBAC/C,MAAM;YACR,KAAK,eAAe,CAAC,WAAW;gBAC9B,gBAAgB,GAAG,gBAAgB,CAAC,WAAW,CAAC;gBAChD,MAAM;QACV,CAAC;QAED,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAED,8BAA8B;IACvB,MAAM,CAAC,qBAAqB;QACjC,IAAI,CAAC,iBAAiB,CAAC,MAAM,GAAG,CAAC,CAAC;IACpC,CAAC;;AAhJc,iCAAe,GAAU,IAAI,KAAK,EAAE,CAAC;AAErC,kCAAgB,GAC7B,eAAe,CAAC,WAAW,CAAC;AAEf,mCAAiB,GAAG,IAAI,KAAK,EAAmB,CAAC;AA6BhE,uCAAuC;AACvC,4DAA4D;AACrC,sCAAoB,GAAG,IAAI,kBAAkB,EAAE,CAAC;AA+GzE;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAG5C,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACX,cAAc,EAAE,KAAK;IACrB,iBAAiB,EAAE,CAAC,OAAgB,EAAE,EAAE;QACtC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACZ,OAAO,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE;YACvB,KAAK,CAAC,cAAc,GAAG,OAAO,CAAC;QACjC,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;CACF,CAAC,CAAC,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 Cursor\n */\n\nimport { create } from \"zustand\";\nimport { produce } from \"immer\";\nimport type { XAndY } from \"@itwin/core-geometry\";\nimport { RelativePosition, UiEvent } from \"@itwin/appui-abstract\";\nimport { Point } from \"@itwin/core-react/internal\";\n\n/** Enum for Cursor Direction parts\n * @public\n */\nexport enum CursorDirectionParts {\n Top = 0x1000,\n Left = 0x0100,\n Right = 0x0010,\n Bottom = 0x0001,\n}\n\n/** Enum for Cursor Direction\n * @public\n */\nexport enum CursorDirection {\n None = 0,\n Top = CursorDirectionParts.Top,\n Left = CursorDirectionParts.Left,\n Right = CursorDirectionParts.Right,\n Bottom = CursorDirectionParts.Bottom,\n TopLeft = CursorDirectionParts.Top | CursorDirectionParts.Left,\n TopRight = CursorDirectionParts.Top | CursorDirectionParts.Right,\n BottomLeft = CursorDirectionParts.Bottom | CursorDirectionParts.Left,\n BottomRight = CursorDirectionParts.Bottom | CursorDirectionParts.Right,\n}\n\n/** Cursor Updated Event Args interface.\n * @public\n * @deprecated in 4.13.0. Event args are inferred from a listener. If explicit type is needed use a type helper.\n */\nexport interface CursorUpdatedEventArgs {\n oldPt: XAndY;\n newPt: XAndY;\n direction: CursorDirection;\n}\n\n/** Cursor Updated Event class.\n * @public\n * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport class CursorUpdatedEvent extends UiEvent<CursorUpdatedEventArgs> {}\n\n/** Cursor Information class\n * @public\n */\nexport class CursorInformation {\n private static _cursorPosition: Point = new Point();\n private static _cursorDocument: Document | undefined;\n private static _cursorDirection: CursorDirection =\n CursorDirection.BottomRight;\n\n private static _cursorDirections = new Array<CursorDirection>();\n\n /** The cursor position. */\n public static get cursorPosition(): XAndY {\n return this._cursorPosition;\n }\n public static set cursorPosition(pt: XAndY) {\n this._cursorPosition = Point.create(pt);\n }\n\n /** Gets the cursor X position. */\n public static get cursorX(): number {\n return this._cursorPosition.x;\n }\n /** Gets the cursor Y position. */\n public static get cursorY(): number {\n return this._cursorPosition.y;\n }\n\n /** Gets the general cursor movement direction. */\n public static get cursorDirection(): CursorDirection {\n return this._cursorDirection;\n }\n\n /** Gets the cursor document. */\n public static get cursorDocument(): Document | undefined {\n return this._cursorDocument;\n }\n\n /** Gets the [[CursorUpdatedEvent]]. */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public static readonly onCursorUpdatedEvent = new CursorUpdatedEvent();\n\n /** Handles the mouse movement. Sets the cursor position and direction and emits onCursorUpdatedEvent. */\n public static handleMouseMove(point: XAndY, document?: Document): void {\n const oldPt = CursorInformation.cursorPosition;\n const direction = this._determineMostFrequentDirection(\n this._cursorDirections,\n this._cursorPosition,\n Point.create(point)\n );\n\n this.cursorPosition = point;\n this._cursorDocument = document;\n this._cursorDirection = direction;\n\n this.onCursorUpdatedEvent.emit({ oldPt, newPt: point, direction });\n }\n\n private static _determineMostFrequentDirection(\n cursorDirections: CursorDirection[],\n oldPt: Point,\n newPt: Point\n ): CursorDirection {\n const cursorDirection = this._determineCursorDirection(oldPt, newPt);\n cursorDirections.push(cursorDirection);\n if (cursorDirections.length > 10) cursorDirections.shift();\n return this._mostFrequent(cursorDirections);\n }\n\n private static _mostFrequent(array: CursorDirection[]): CursorDirection {\n const hashMap = new Map<CursorDirection, number>();\n let maxCount = 0,\n mostFrequent = CursorDirection.None;\n\n array.forEach((value: CursorDirection) => {\n const key = value;\n let frequency = hashMap.get(key);\n\n if (frequency !== undefined) frequency++;\n else frequency = 1;\n\n hashMap.set(key, frequency);\n\n if (frequency > maxCount) {\n mostFrequent = key;\n maxCount = frequency;\n }\n });\n\n return mostFrequent;\n }\n\n private static _determineCursorDirection(\n oldPt: Point,\n newPt: Point\n ): CursorDirection {\n let directionParts: number = 0;\n\n if (newPt.x < oldPt.x) directionParts |= CursorDirectionParts.Left;\n else if (newPt.x > oldPt.x) directionParts |= CursorDirectionParts.Right;\n\n if (newPt.y < oldPt.y) directionParts |= CursorDirectionParts.Top;\n else if (newPt.y > oldPt.y) directionParts |= CursorDirectionParts.Bottom;\n\n const direction = directionParts as CursorDirection;\n\n return direction;\n }\n\n /** Gets the relative position based on the cursor direction. */\n public static getRelativePositionFromCursorDirection(\n cursorDirection: CursorDirection\n ): RelativePosition {\n let relativePosition: RelativePosition = RelativePosition.BottomRight;\n\n switch (cursorDirection) {\n case CursorDirection.Top:\n relativePosition = RelativePosition.Top;\n break;\n case CursorDirection.Left:\n relativePosition = RelativePosition.Left;\n break;\n case CursorDirection.Right:\n relativePosition = RelativePosition.Right;\n break;\n case CursorDirection.Bottom:\n relativePosition = RelativePosition.Bottom;\n break;\n case CursorDirection.TopLeft:\n relativePosition = RelativePosition.TopLeft;\n break;\n case CursorDirection.TopRight:\n relativePosition = RelativePosition.TopRight;\n break;\n case CursorDirection.BottomLeft:\n relativePosition = RelativePosition.BottomLeft;\n break;\n case CursorDirection.BottomRight:\n relativePosition = RelativePosition.BottomRight;\n break;\n }\n\n return relativePosition;\n }\n\n /** @internal - for testing */\n public static clearCursorDirections(): void {\n this._cursorDirections.length = 0;\n }\n}\n\n/** Returns additional information about cursor.\n * @internal\n */\nexport const useCursorInformationStore = create<{\n contentHovered: boolean;\n setContentHovered: (hovered: boolean) => void;\n}>((set) => ({\n contentHovered: false,\n setContentHovered: (hovered: boolean) => {\n set((state) =>\n produce(state, (draft) => {\n draft.contentHovered = hovered;\n })\n );\n },\n}));\n"]}
|
|
@@ -3,31 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import type { CommonProps } from "@itwin/core-react";
|
|
6
|
-
import type { CursorMenuItemProps } from "../../shared/MenuItem.js";
|
|
7
|
-
/** State for [[CursorPopupMenu]] component
|
|
8
|
-
* @alpha
|
|
9
|
-
*/
|
|
10
|
-
interface CursorPopupMenuState {
|
|
11
|
-
menuX: number;
|
|
12
|
-
menuY: number;
|
|
13
|
-
menuVisible: boolean;
|
|
14
|
-
items?: CursorMenuItemProps[];
|
|
15
|
-
}
|
|
16
6
|
/** Popup Menu to show at cursor typically used by tools to provide a right-click context menu.
|
|
17
7
|
* @alpha
|
|
18
8
|
*/
|
|
19
|
-
export declare
|
|
20
|
-
CursorPopupMenuState> {
|
|
21
|
-
private _isMounted;
|
|
22
|
-
private _hostChildWindowId?;
|
|
23
|
-
readonly state: CursorPopupMenuState;
|
|
24
|
-
private _handleSyncUiEvent;
|
|
25
|
-
componentDidMount(): void;
|
|
26
|
-
componentWillUnmount(): void;
|
|
27
|
-
private _handleRefSet;
|
|
28
|
-
render(): React.ReactNode;
|
|
29
|
-
private _hideContextMenu;
|
|
30
|
-
private _itemPicked;
|
|
31
|
-
}
|
|
32
|
-
export {};
|
|
9
|
+
export declare function CursorPopupMenu(props: CommonProps): React.JSX.Element;
|
|
33
10
|
//# sourceMappingURL=CursorMenu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CursorMenu.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/cursor/cursormenu/CursorMenu.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"CursorMenu.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/cursor/cursormenu/CursorMenu.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AASrD;;GAEG;AAEH,wBAAgB,eAAe,CAAC,KAAK,EAAE,WAAW,qBA0EjD"}
|
|
@@ -15,66 +15,45 @@ import { Logger } from "@itwin/core-bentley";
|
|
|
15
15
|
/** Popup Menu to show at cursor typically used by tools to provide a right-click context menu.
|
|
16
16
|
* @alpha
|
|
17
17
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
this._handleSyncUiEvent = (args) => {
|
|
29
|
-
if (!this._isMounted)
|
|
30
|
-
return;
|
|
31
|
-
if (SyncUiEventDispatcher.hasEventOfInterest(args.eventIds, [
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
19
|
+
export function CursorPopupMenu(props) {
|
|
20
|
+
const windowIdRef = React.useRef();
|
|
21
|
+
const [opened, setOpened] = React.useState(false);
|
|
22
|
+
const [x, setX] = React.useState(0);
|
|
23
|
+
const [y, setY] = React.useState(0);
|
|
24
|
+
const [items, setItems] = React.useState(undefined);
|
|
25
|
+
React.useEffect(() => {
|
|
26
|
+
return SyncUiEventDispatcher.onSyncUiEvent.addListener((args) => {
|
|
27
|
+
if (!SyncUiEventDispatcher.hasEventOfInterest(args.eventIds, [
|
|
32
28
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
33
29
|
SessionStateActionId.UpdateCursorMenu,
|
|
34
|
-
]))
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
this.setState({ menuVisible: false, items: undefined });
|
|
46
|
-
}
|
|
30
|
+
]))
|
|
31
|
+
return;
|
|
32
|
+
const menuData = UiFramework.getCursorMenuData();
|
|
33
|
+
const windowId = windowIdRef.current;
|
|
34
|
+
if (!menuData || windowId !== menuData.childWindowId) {
|
|
35
|
+
setOpened(false);
|
|
36
|
+
setItems(undefined);
|
|
37
|
+
return;
|
|
47
38
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
this._isMounted = false;
|
|
68
|
-
SyncUiEventDispatcher.onSyncUiEvent.removeListener(this._handleSyncUiEvent);
|
|
69
|
-
}
|
|
70
|
-
render() {
|
|
71
|
-
const { menuX, menuY, items, menuVisible } = this.state;
|
|
72
|
-
const onClose = this._hideContextMenu;
|
|
73
|
-
return (React.createElement("div", { className: "uifw-cursor-menu-container-div", ref: this._handleRefSet }, items && items.length > 0 && menuVisible && (
|
|
74
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
75
|
-
React.createElement(GlobalContextMenu, { className: this.props.className, style: this.props.style, identifier: "cursor-popup-menu", x: menuX, y: menuY, opened: menuVisible, onEsc: onClose, onOutsideClick: onClose, edgeLimit: false, autoflip: true }, MenuItemHelpers.createMenuItemNodes(
|
|
76
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
77
|
-
MenuItemHelpers.createMenuItems(items, this._itemPicked))))));
|
|
78
|
-
}
|
|
39
|
+
setOpened(menuData.items && menuData.items.length > 0);
|
|
40
|
+
setItems(menuData.items);
|
|
41
|
+
setX(menuData.position.x);
|
|
42
|
+
setY(menuData.position.y);
|
|
43
|
+
});
|
|
44
|
+
}, []);
|
|
45
|
+
const onClose = () => {
|
|
46
|
+
setOpened(false);
|
|
47
|
+
};
|
|
48
|
+
return (React.createElement("div", { className: "uifw-cursor-menu-container-div", ref: (el) => {
|
|
49
|
+
const parentWindow = el?.ownerDocument.defaultView ?? undefined;
|
|
50
|
+
const windowId = UiFramework.childWindows.findId(parentWindow);
|
|
51
|
+
windowIdRef.current = windowId;
|
|
52
|
+
Logger.logInfo(UiFramework.loggerCategory("UiFramework"), `Cursor Menu for ${windowId ?? "main"} window`);
|
|
53
|
+
} }, items && items.length > 0 && opened && (
|
|
54
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
55
|
+
React.createElement(GlobalContextMenu, { className: props.className, style: props.style, identifier: "cursor-popup-menu", x: x, y: y, opened: opened, onEsc: onClose, onOutsideClick: onClose, edgeLimit: false, autoflip: true }, MenuItemHelpers.createMenuItemNodes(
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
57
|
+
MenuItemHelpers.createMenuItems(items, onClose))))));
|
|
79
58
|
}
|
|
80
59
|
//# sourceMappingURL=CursorMenu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CursorMenu.js","sourceRoot":"","sources":["../../../../src/appui-react/cursor/cursormenu/CursorMenu.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CursorMenu.js","sourceRoot":"","sources":["../../../../src/appui-react/cursor/cursormenu/CursorMenu.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC,CAAC,kBAAkB;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C;;GAEG;AACH,4DAA4D;AAC5D,MAAM,UAAU,eAAe,CAAC,KAAkB;IAChD,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,EAAsB,CAAC;IACvD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClD,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACpC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACpC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC,QAAQ,CACtC,SAAS,CACV,CAA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GAAG,QAAQ,CAAC;YAC/B,MAAM,CAAC,OAAO,CACZ,WAAW,CAAC,cAAc,CAAC,aAAa,CAAC,EACzC,mBAAmB,QAAQ,IAAI,MAAM,SAAS,CAC/C,CAAC;QACJ,CAAC,IAEA,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,MAAM,IAAI;IACtC,4DAA4D;IAC5D,oBAAC,iBAAiB,IAChB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,UAAU,EAAC,mBAAmB,EAC9B,CAAC,EAAE,CAAC,EACJ,CAAC,EAAE,CAAC,EACJ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,OAAO,EACd,cAAc,EAAE,OAAO,EACvB,SAAS,EAAE,KAAK,EAChB,QAAQ,EAAE,IAAI,IAGb,eAAe,CAAC,mBAAmB;IAClC,4DAA4D;IAC5D,eAAe,CAAC,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC,CAChD,CACiB,CACrB,CACG,CACP,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 Cursor\n */\n\nimport * as React from \"react\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { GlobalContextMenu } from \"@itwin/core-react\"; // ContextSubMenu,\nimport { SessionStateActionId } from \"../../redux/SessionState.js\";\nimport type { CursorMenuItemProps } from \"../../shared/MenuItem.js\";\nimport { MenuItemHelpers } from \"../../shared/MenuItem.js\";\nimport { SyncUiEventDispatcher } from \"../../syncui/SyncUiEventDispatcher.js\";\nimport { UiFramework } from \"../../UiFramework.js\";\nimport { Logger } from \"@itwin/core-bentley\";\n\n/** Popup Menu to show at cursor typically used by tools to provide a right-click context menu.\n * @alpha\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport function CursorPopupMenu(props: CommonProps) {\n const windowIdRef = React.useRef<string | undefined>();\n const [opened, setOpened] = React.useState(false);\n const [x, setX] = React.useState(0);\n const [y, setY] = React.useState(0);\n const [items, setItems] = React.useState<CursorMenuItemProps[] | undefined>(\n undefined\n );\n\n React.useEffect(() => {\n return SyncUiEventDispatcher.onSyncUiEvent.addListener((args) => {\n if (\n !SyncUiEventDispatcher.hasEventOfInterest(args.eventIds, [\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n SessionStateActionId.UpdateCursorMenu,\n ])\n )\n return;\n\n const menuData = UiFramework.getCursorMenuData();\n const windowId = windowIdRef.current;\n if (!menuData || windowId !== menuData.childWindowId) {\n setOpened(false);\n setItems(undefined);\n return;\n }\n\n setOpened(menuData.items && menuData.items.length > 0);\n setItems(menuData.items);\n setX(menuData.position.x);\n setY(menuData.position.y);\n });\n }, []);\n\n const onClose = () => {\n setOpened(false);\n };\n\n return (\n <div\n className=\"uifw-cursor-menu-container-div\"\n ref={(el) => {\n const parentWindow = el?.ownerDocument.defaultView ?? undefined;\n const windowId = UiFramework.childWindows.findId(parentWindow);\n windowIdRef.current = windowId;\n Logger.logInfo(\n UiFramework.loggerCategory(\"UiFramework\"),\n `Cursor Menu for ${windowId ?? \"main\"} window`\n );\n }}\n >\n {items && items.length > 0 && opened && (\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n <GlobalContextMenu\n className={props.className}\n style={props.style}\n identifier=\"cursor-popup-menu\"\n x={x}\n y={y}\n opened={opened}\n onEsc={onClose}\n onOutsideClick={onClose}\n edgeLimit={false}\n autoflip={true}\n >\n {/* eslint-disable-next-line @typescript-eslint/no-deprecated */}\n {MenuItemHelpers.createMenuItemNodes(\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n MenuItemHelpers.createMenuItems(items, onClose)\n )}\n </GlobalContextMenu>\n )}\n </div>\n );\n}\n"]}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
@use "~@itwin/core-react/lib/core-react/z-index" as *;
|
|
5
6
|
@use "../../variables" as *;
|
|
6
7
|
|
|
7
8
|
.uifw-cursorpopup {
|
|
@@ -18,6 +19,8 @@
|
|
|
18
19
|
width: fit-content;
|
|
19
20
|
transition: opacity 500ms;
|
|
20
21
|
|
|
22
|
+
@include uicore-z-index(tooltip);
|
|
23
|
+
|
|
21
24
|
> .uifw-cursorpopup-title {
|
|
22
25
|
min-height: $uifw-popup-title-bar-min-height;
|
|
23
26
|
opacity: $uifw-popup-opacity;
|
|
@@ -21,7 +21,9 @@ export interface CursorPopupOptions {
|
|
|
21
21
|
/** Draw shadow */
|
|
22
22
|
shadow?: boolean;
|
|
23
23
|
}
|
|
24
|
-
/** Information maintained by CursorPopupManager about a CursorPopup.
|
|
24
|
+
/** Information maintained by CursorPopupManager about a CursorPopup.
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
25
27
|
interface CursorPopupInfo {
|
|
26
28
|
id: string;
|
|
27
29
|
content: React.ReactNode;
|
|
@@ -29,6 +31,7 @@ interface CursorPopupInfo {
|
|
|
29
31
|
offset: Point;
|
|
30
32
|
priority: number;
|
|
31
33
|
options?: CursorPopupOptions;
|
|
34
|
+
targetDocument?: Document;
|
|
32
35
|
renderRelativePosition: RelativePosition;
|
|
33
36
|
popupSize?: SizeProps;
|
|
34
37
|
cancelFadeOut?: () => void;
|
|
@@ -53,17 +56,16 @@ export declare class CursorPopupManager {
|
|
|
53
56
|
static clearPopups(): void;
|
|
54
57
|
static get popups(): CursorPopupInfo[];
|
|
55
58
|
static get popupCount(): number;
|
|
56
|
-
private static _emitPopupsChangedEvent;
|
|
57
59
|
private static pushPopup;
|
|
58
60
|
/** Called to open popup with a new set of properties
|
|
59
61
|
*/
|
|
60
|
-
static open(id: string, content: React.ReactNode, pt: XAndY, offset: XAndY, relativePosition: RelativePosition, priority?: number, options?: CursorPopupOptions): void;
|
|
62
|
+
static open(id: string, content: React.ReactNode, pt: XAndY, offset: XAndY, relativePosition: RelativePosition, priority?: number, options?: CursorPopupOptions, targetDocument?: Document): void;
|
|
61
63
|
/** Called to update popup with a new set of properties
|
|
62
64
|
*/
|
|
63
|
-
static update(id: string, content: React.ReactNode, pt: XAndY, offset: XAndY, relativePosition: RelativePosition, priority?: number): void;
|
|
65
|
+
static update(id: string, content: React.ReactNode, pt: XAndY, offset: XAndY, relativePosition: RelativePosition, priority?: number, targetDocument?: Document): void;
|
|
64
66
|
/** Called to move the open popup to new location
|
|
65
67
|
*/
|
|
66
|
-
static updatePosition(pt: XAndY): void;
|
|
68
|
+
static updatePosition(pt: XAndY, targetDocument?: Document): void;
|
|
67
69
|
/** Called when tool wants to close the popup
|
|
68
70
|
*/
|
|
69
71
|
static close(id: string, apply: boolean, fadeOut?: boolean): void;
|
|
@@ -72,25 +74,9 @@ export declare class CursorPopupManager {
|
|
|
72
74
|
private static validateRenderRelativePosition;
|
|
73
75
|
private static autoFlip;
|
|
74
76
|
}
|
|
75
|
-
/** State for the [[CursorPopupRenderer]] React component */
|
|
76
|
-
interface CursorPopupRendererState {
|
|
77
|
-
pt: Point;
|
|
78
|
-
}
|
|
79
77
|
/** CursorPopupRenderer React component.
|
|
80
78
|
* @public
|
|
81
79
|
*/
|
|
82
|
-
export declare
|
|
83
|
-
constructor(props: any);
|
|
84
|
-
render(): React.ReactNode;
|
|
85
|
-
private _handleSizeKnown;
|
|
86
|
-
private renderPositions;
|
|
87
|
-
private renderRelativePosition;
|
|
88
|
-
private getDimension;
|
|
89
|
-
private adjustOffset;
|
|
90
|
-
componentDidMount(): void;
|
|
91
|
-
componentWillUnmount(): void;
|
|
92
|
-
private _handlePopupChangedEvent;
|
|
93
|
-
private _handleCursorPopupUpdatePositionEvent;
|
|
94
|
-
}
|
|
80
|
+
export declare function CursorPopupRenderer(): React.JSX.Element | undefined;
|
|
95
81
|
export {};
|
|
96
82
|
//# sourceMappingURL=CursorPopupManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CursorPopupManager.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/cursor/cursorpopup/CursorPopupManager.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAU,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"CursorPopupManager.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/cursor/cursorpopup/CursorPopupManager.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAU,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAEnD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAI1D;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,yBAAyB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4BAA4B;IAC5B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,gCAAgC;IAChC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,kBAAkB;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,UAAU,eAAe;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAA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