@atlaskit/editor-plugin-alignment
Version:
Alignment plugin for @atlaskit/editor-core
21 lines (20 loc) • 990 B
JavaScript
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
import { keymap } from '@atlaskit/editor-common/keymap';
import { alignCenter, alignLeft, alignRight, bindKeymapWithCommand } from '@atlaskit/editor-common/keymaps';
import { changeAlignment } from '../editor-commands';
export function keymapPlugin(api) {
var list = {};
// Ignored via go/ees005
bindKeymapWithCommand(
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
alignLeft.common, changeAlignment('start', api, INPUT_METHOD.SHORTCUT), list);
// Ignored via go/ees005
bindKeymapWithCommand(
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
alignCenter.common, changeAlignment('center', api, INPUT_METHOD.SHORTCUT), list);
// Ignored via go/ees005
bindKeymapWithCommand(
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
alignRight.common, changeAlignment('end', api, INPUT_METHOD.SHORTCUT), list);
return keymap(list);
}