@@ -105,13 +105,14 @@ const createMarkdownShortcutsPlugin = (config = { insertEmptyBlockOnReturnWithMo
105105 return null ;
106106 } ,
107107
108- blockRendererFn ( block , { setEditorState , getEditorState } ) {
108+ blockRendererFn ( block ) {
109109 switch ( block . getType ( ) ) {
110110 case CHECKABLE_LIST_ITEM : {
111111 return {
112112 component : CheckableListItem ,
113113 props : {
114- onChangeChecked : ( ) => setEditorState ( CheckableListItemUtils . toggleChecked ( getEditorState ( ) , block ) ) ,
114+ onChangeChecked : ( ) =>
115+ store . setEditorState ( CheckableListItemUtils . toggleChecked ( getEditorState ( ) , block ) ) ,
115116 checked : ! ! block . getData ( ) . get ( 'checked' ) ,
116117 } ,
117118 } ;
@@ -120,35 +121,35 @@ const createMarkdownShortcutsPlugin = (config = { insertEmptyBlockOnReturnWithMo
120121 return null ;
121122 }
122123 } ,
123- onTab ( ev , { getEditorState , setEditorState } ) {
124- const editorState = getEditorState ( ) ;
124+ onTab ( ev ) {
125+ const editorState = store . getEditorState ( ) ;
125126 const newEditorState = adjustBlockDepth ( editorState , ev ) ;
126127 if ( newEditorState !== editorState ) {
127- setEditorState ( newEditorState ) ;
128+ store . setEditorState ( newEditorState ) ;
128129 return 'handled' ;
129130 }
130131 return 'not-handled' ;
131132 } ,
132- handleReturn ( ev , editorState , { setEditorState } ) {
133+ handleReturn ( ev , editorState ) {
133134 const newEditorState = checkReturnForState ( editorState , ev , config ) ;
134135 if ( editorState !== newEditorState ) {
135- setEditorState ( newEditorState ) ;
136+ store . setEditorState ( newEditorState ) ;
136137 return 'handled' ;
137138 }
138139 return 'not-handled' ;
139140 } ,
140- handleBeforeInput ( character , editorState , eventTimeStamp , { setEditorState } ) {
141+ handleBeforeInput ( character , editorState ) {
141142 if ( character . match ( / [ A - z 0 - 9 _ * ~ ` ] / ) ) {
142143 return 'not-handled' ;
143144 }
144145 const newEditorState = checkCharacterForState ( editorState , character ) ;
145146 if ( editorState !== newEditorState ) {
146- setEditorState ( newEditorState ) ;
147+ store . setEditorState ( newEditorState ) ;
147148 return 'handled' ;
148149 }
149150 return 'not-handled' ;
150151 } ,
151- handlePastedText ( text , html , editorState , { setEditorState } ) {
152+ handlePastedText ( text , html , editorState ) {
152153 if ( html ) {
153154 return 'not-handled' ;
154155 }
@@ -183,7 +184,7 @@ const createMarkdownShortcutsPlugin = (config = { insertEmptyBlockOnReturnWithMo
183184 }
184185
185186 if ( editorState !== newEditorState ) {
186- setEditorState ( newEditorState ) ;
187+ store . setEditorState ( newEditorState ) ;
187188 return 'handled' ;
188189 }
189190 return 'not-handled' ;
0 commit comments