Skip to content

Commit 03987d6

Browse files
committed
refactor(list handling): use list key handler
1 parent 6eed44a commit 03987d6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/components/text-editor/prosemirror-adapter/menu/menu-commands.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,6 @@ export const createListCommand = (
345345
return isActive;
346346
};
347347

348-
command.allowed = (state) => {};
349-
350348
return command;
351349
};
352350

@@ -410,6 +408,8 @@ export class MenuCommandFactory {
410408
'Mod-Shift-1': this.getCommand(EditorMenuTypes.HeaderLevel1),
411409
'Mod-Shift-2': this.getCommand(EditorMenuTypes.HeaderLevel2),
412410
'Mod-Shift-3': this.getCommand(EditorMenuTypes.HeaderLevel3),
411+
'Mod-Shift-8': this.getCommand(EditorMenuTypes.BulletList),
412+
'Mod-Shift-9': this.getCommand(EditorMenuTypes.OrderedList),
413413
'Mod-Shift-X': this.getCommand(EditorMenuTypes.Strikethrough),
414414
'Mod-`': this.getCommand(EditorMenuTypes.Code),
415415
'Mod-Shift-C': this.getCommand(EditorMenuTypes.CodeBlock),

src/components/text-editor/prosemirror-adapter/prosemirror-adapter.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ import {
5252
} from '../text-editor.types';
5353
import { getTableNodes, getTableEditingPlugins } from './plugins/table-plugin';
5454
import { getImageNode, imageCache } from './plugins/image/node';
55+
import { createListKeyHandlerPlugin } from './plugins/list-key-handler';
5556

5657
const DEBOUNCE_TIMEOUT = 300;
5758

@@ -398,6 +399,7 @@ export class ProsemirrorAdapter {
398399
this.updateActiveActionBarItems,
399400
),
400401
createActionBarInteractionPlugin(this.menuCommandFactory),
402+
createListKeyHandlerPlugin(this.schema),
401403
...getTableEditingPlugins(this.contentType === 'html'),
402404
],
403405
});

0 commit comments

Comments
 (0)