UNPKG

@atlaskit/editor-plugin-toolbar

Version:

Toolbar plugin for @atlaskit/editor-core

20 lines (19 loc) 1.05 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isSelectionToolbarSuppressedByUserIntent = exports.isPlainShiftArrowKey = exports.hasSelectionChanged = void 0; var isSelectionToolbarSuppressedByUserIntent = exports.isSelectionToolbarSuppressedByUserIntent = function isSelectionToolbarSuppressedByUserIntent(currentUserIntent, isCellSelection) { return Boolean(currentUserIntent && currentUserIntent !== 'default' && !(currentUserIntent === 'dragHandleSelected' && !isCellSelection)); }; var isPlainShiftArrowKey = exports.isPlainShiftArrowKey = function isPlainShiftArrowKey(_ref) { var shiftKey = _ref.shiftKey, key = _ref.key, metaKey = _ref.metaKey, ctrlKey = _ref.ctrlKey, altKey = _ref.altKey; return shiftKey && !metaKey && !ctrlKey && !altKey && key.includes('Arrow'); }; var hasSelectionChanged = exports.hasSelectionChanged = function hasSelectionChanged(mouseDownSelection, currentSelection) { return Boolean(mouseDownSelection && !mouseDownSelection.eq(currentSelection)); };