File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
packages/core/src/editor/managers/ExtensionManager Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -356,9 +356,7 @@ export class ExtensionManager {
356356 name : "blocknote-input-rules" ,
357357 addProseMirrorPlugins ( ) {
358358 const rules = [ ] as InputRule [ ] ;
359- inputRulesByPriority
360- . keys ( )
361- . toArray ( )
359+ Array . from ( inputRulesByPriority . keys ( ) )
362360 // We sort the rules by their priority (the key)
363361 . sort ( )
364362 . reverse ( )
@@ -393,7 +391,7 @@ export class ExtensionManager {
393391 const inputRules : InputRule [ ] = [ ] ;
394392 if (
395393 ! extension . prosemirrorPlugins ?. length &&
396- ! extension . keyboardShortcuts ? .length &&
394+ ! Object . keys ( extension . keyboardShortcuts || { } ) . length &&
397395 ! extension . inputRules ?. length
398396 ) {
399397 // We can bail out early if the extension has no features to add to the tiptap editor
@@ -433,11 +431,11 @@ export class ExtensionManager {
433431 ) ;
434432 }
435433
436- if ( extension . keyboardShortcuts ? .length ) {
434+ if ( Object . keys ( extension . keyboardShortcuts || { } ) . length ) {
437435 plugins . push (
438436 keymap (
439437 Object . fromEntries (
440- Object . entries ( extension . keyboardShortcuts ) . map ( ( [ key , value ] ) => [
438+ Object . entries ( extension . keyboardShortcuts ! ) . map ( ( [ key , value ] ) => [
441439 key ,
442440 ( ) => value ( { editor : this . editor } ) ,
443441 ] ) ,
You can’t perform that action at this time.
0 commit comments