Skip to content

Commit 11c6ca1

Browse files
committed
improve(pages): improve keyboard shortcuts
1 parent 5eff4ae commit 11c6ca1

6 files changed

Lines changed: 262 additions & 78 deletions

File tree

apps/client/src/boot/tiptap.client/extensions.ts

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,16 @@ import { YoutubeVideoExtension } from 'src/code/tiptap/youtube-video/extension';
2828
import { FindAndReplaceExtension } from './find-and-replace';
2929

3030
export const extensions = once(() => [
31-
StarterKit.extend({
32-
addKeyboardShortcuts() {
33-
return {
34-
['Alt-1']: () => this.editor.commands.toggleHeading({ level: 1 }),
35-
['Alt-2']: () => this.editor.commands.toggleHeading({ level: 2 }),
36-
['Alt-3']: () => this.editor.commands.toggleHeading({ level: 3 }),
37-
};
31+
StarterKit.configure({
32+
history: false,
33+
codeBlock: false,
34+
35+
horizontalRule: false,
36+
37+
heading: {
38+
levels: [1, 2, 3],
3839
},
39-
})
40-
.configure({}) // Needed for some reason to remove duplication warnings
41-
.configure({
42-
history: false,
43-
codeBlock: false,
44-
45-
horizontalRule: false,
46-
47-
heading: {
48-
levels: [1, 2, 3],
49-
},
50-
}),
40+
}),
5141

5242
HorizontalRuleExtension.configure({
5343
HTMLAttributes: {

0 commit comments

Comments
 (0)