File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
blocks/ParagraphBlockContent Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 4
4
} from "../../schema" ;
5
5
import { createDefaultBlockDOMOutputSpec } from "../defaultBlockHelpers" ;
6
6
import { defaultProps } from "../defaultProps" ;
7
+ import { handleEnter } from "../ListItemBlockContent/ListItemKeyboardShortcuts" ;
7
8
8
9
export const paragraphPropSchema = {
9
10
...defaultProps ,
@@ -13,6 +14,18 @@ export const ParagraphBlockContent = createStronglyTypedTiptapNode({
13
14
name : "paragraph" ,
14
15
content : "inline*" ,
15
16
group : "blockContent" ,
17
+
18
+ addKeyboardShortcuts ( ) {
19
+ return {
20
+ Enter : ( ) => handleEnter ( this . editor ) ,
21
+ "Mod-Alt-0" : ( ) =>
22
+ this . editor . commands . BNUpdateBlock ( this . editor . state . selection . anchor , {
23
+ type : "paragraph" ,
24
+ props : { } ,
25
+ } ) ,
26
+ } ;
27
+ } ,
28
+
16
29
parseHTML ( ) {
17
30
return [
18
31
{ tag : "div[data-content-type=" + this . name + "]" } ,
Original file line number Diff line number Diff line change @@ -693,10 +693,6 @@ export const BlockContainer = Node.create<{
693
693
this . editor . commands . liftListItem ( "blockContainer" ) ;
694
694
return true ;
695
695
} ,
696
- "Mod-Alt-0" : ( ) =>
697
- this . editor . commands . BNCreateBlock (
698
- this . editor . state . selection . anchor + 2
699
- ) ,
700
696
} ;
701
697
} ,
702
698
} ) ;
You can’t perform that action at this time.
0 commit comments