@atlaskit/editor-common
Version:
A package that contains common classes and components for editor and renderer
124 lines (123 loc) • 5.69 kB
TypeScript
/** @jsx jsx */
import React from 'react';
import { jsx } from '@emotion/react';
import type { Command } from '../types/command';
import type { EditorCommand } from '../types/editor-command';
export declare const addAltText: Keymap;
export declare const navToEditorToolbar: Keymap;
export declare const navToFloatingToolbar: Keymap;
export declare const toggleBold: Keymap;
export declare const toggleItalic: Keymap;
export declare const toggleUnderline: Keymap;
export declare const toggleStrikethrough: Keymap;
export declare const toggleSubscript: Keymap;
export declare const toggleSuperscript: Keymap;
export declare const toggleCode: Keymap;
export declare const pastePlainText: Keymap;
export declare const clearFormatting: Keymap;
export declare const setNormalText: Keymap;
export declare const toggleHeading1: Keymap;
export declare const toggleHeading2: Keymap;
export declare const toggleHeading3: Keymap;
export declare const toggleHeading4: Keymap;
export declare const toggleHeading5: Keymap;
export declare const toggleHeading6: Keymap;
export declare const toggleOrderedList: Keymap;
export declare const ctrlBackSpace: Keymap;
export declare const toggleBulletList: Keymap;
export declare const toggleBlockQuote: Keymap;
export declare const insertNewLine: Keymap;
export declare const shiftBackspace: Keymap;
export declare const splitCodeBlock: Keymap;
export declare const splitListItem: Keymap;
export declare const insertRule: Keymap;
export declare const undo: Keymap;
export declare const moveUp: Keymap;
export declare const moveDown: Keymap;
export declare const moveLeft: Keymap;
export declare const moveRight: Keymap;
export declare const indentList: Keymap;
export declare const outdentList: Keymap;
export declare const redo: Keymap;
export declare const openHelp: Keymap;
export declare const addLink: Keymap;
export declare const addInlineComment: Keymap;
export declare const submit: Keymap;
export declare const enter: Keymap;
export declare const shiftEnter: Keymap;
export declare const tab: Keymap;
export declare const indent: Keymap;
export declare const outdent: Keymap;
export declare const backspace: Keymap;
export declare const deleteKey: Keymap;
export declare const forwardDelete: Keymap;
export declare const space: Keymap;
export declare const escape: Keymap;
export declare const nextCell: Keymap;
export declare const previousCell: Keymap;
export declare const shiftArrowUp: Keymap;
export declare const shiftTab: Keymap;
export declare const toggleTable: Keymap;
export declare const focusTableResizer: Keymap;
export declare const addRowBefore: Keymap;
export declare const addRowAfter: Keymap;
export declare const addColumnAfter: Keymap;
export declare const addColumnBefore: Keymap;
export declare const moveColumnLeft: Keymap;
export declare const moveColumnRight: Keymap;
export declare const moveRowDown: Keymap;
export declare const moveRowUp: Keymap;
export declare const deleteColumn: Keymap;
export declare const deleteRow: Keymap;
export declare const startColumnResizing: Keymap;
export declare const cut: Keymap;
export declare const copy: Keymap;
export declare const paste: Keymap;
export declare const altPaste: Keymap;
export declare const find: Keymap;
export declare const alignLeft: Keymap;
export declare const alignCenter: Keymap;
export declare const alignRight: Keymap;
export declare const toggleTaskItemCheckbox: Keymap;
export declare const selectRow: Keymap[];
export declare const selectColumn: Keymap[];
export declare const selectTable: Keymap;
export declare const increaseMediaSize: Keymap;
export declare const decreaseMediaSize: Keymap;
export declare function tooltip(keymap?: Keymap, description?: string): string | undefined;
export declare const ToolTipContent: React.MemoExoticComponent<({ description, shortcutOverride, keymap, }: {
description?: string | React.ReactNode;
keymap?: Keymap | undefined;
shortcutOverride?: string | undefined;
}) => jsx.JSX.Element | null>;
export declare function findKeymapByDescription(description: string): Keymap | undefined;
export declare function findShortcutByDescription(description: string): string | undefined;
export declare function findShortcutByKeymap(keymap: Keymap): string | undefined;
export declare function getAriaKeyshortcuts(keymap: Keymap | string | undefined): string | undefined;
export declare function makeKeymap(description: string, windows: string, mac: string, common?: string): Keymap;
export declare function makeKeyMapWithCommon(description: string, common: string): Keymap;
export declare function makeKeyMapArrayWithCommon(description: string, shortcuts: string[]): Keymap[];
export interface Keymap {
description: string;
windows: string;
mac: string;
common?: string;
}
export declare function bindKeymapWithCommand(shortcut: string, cmd: Command, keymap: {
[key: string]: Command;
}): void;
export declare function bindKeymapArrayWithCommand(shortcutsArray: Keymap[], cmd: Command, keymap: {
[key: string]: Command;
}): void;
export declare function bindKeymapWithEditorCommand(shortcut: string, cmd: EditorCommand, keymap: {
[key: string]: Command;
}): void;
export declare function findKeyMapForBrowser(keyMap: Keymap): string | undefined;
/**
* ED-20175: on windows OS if the capsLock is ON then it registers the key with capital case
* which creates a command (Ctrl-B) and all the keymap bindings are in lower case (Ctrl-b).
*
*/
export declare function isCapsLockOnAndModifyKeyboardEvent(event: KeyboardEvent): KeyboardEvent;
export { DOWN, HEADING_KEYS, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, LEFT, RIGHT, UP, } from './consts';
export { keymap } from './keymap';