Fix hotkeys

This commit is contained in:
ajbura 2023-03-05 20:31:10 +05:30
parent 0119811a67
commit dc848b1f04

View file

@ -5,27 +5,18 @@ import { isBlockActive, toggleBlock, toggleMark } from './common';
import { BlockType, MarkType } from './Elements';
export const INLINE_HOTKEYS: Record<string, MarkType> = {
'ctrl+b': MarkType.Bold,
'mod+b': MarkType.Bold,
'ctrl+i': MarkType.Italic,
'mod+i': MarkType.Italic,
'ctrl+u': MarkType.Underline,
'mod+u': MarkType.Underline,
'ctrl+shift+u': MarkType.StrikeThrough,
'mod+shift+u': MarkType.StrikeThrough,
'ctrl+[': MarkType.Code,
'mod+[': MarkType.Code,
};
const INLINE_KEYS = Object.keys(INLINE_HOTKEYS);
export const BLOCK_HOTKEYS: Record<string, BlockType> = {
'ctrl+shift+0': BlockType.OrderedList,
'mod+shift+0': BlockType.OrderedList,
'ctrl+shift+8': BlockType.UnorderedList,
'mod+shift+8': BlockType.UnorderedList,
'ctrl+shift+.': BlockType.BlockQuote,
'mod+shift+.': BlockType.BlockQuote,
'ctrl+shift+m': BlockType.CodeBlock,
'mod+shift+m': BlockType.CodeBlock,
};
const BLOCK_KEYS = Object.keys(BLOCK_HOTKEYS);