add toggleMark command

This commit is contained in:
Philipp Kühn
2020-04-22 14:06:15 +02:00
parent 0e18e67c93
commit 4e6404a404
7 changed files with 57 additions and 14 deletions

View File

@@ -0,0 +1,15 @@
import { Editor } from '../Editor'
import { selectParentNode } from 'prosemirror-commands'
type SelectParentNode = () => any
declare module '../Editor' {
interface Editor {
selectParentNode: SelectParentNode,
}
}
export default (next: Function, { state, view }: Editor): SelectParentNode => () => {
selectParentNode(state, view.dispatch)
next()
}