add core extensions

This commit is contained in:
Philipp Kühn
2020-10-23 10:44:30 +02:00
parent 73285aadce
commit fd298b645b
48 changed files with 577 additions and 501 deletions

View File

@@ -1,18 +0,0 @@
import { toggleMark as originalToggleMark } from 'prosemirror-commands'
import { MarkType } from 'prosemirror-model'
import { Command } from '../Editor'
import getMarkType from '../utils/getMarkType'
type ToggleMarkCommand = (typeOrName: string | MarkType) => Command
declare module '../Editor' {
interface Commands {
toggleMark: ToggleMarkCommand,
}
}
export const toggleMark: ToggleMarkCommand = typeOrName => ({ state, dispatch }) => {
const type = getMarkType(typeOrName, state.schema)
return originalToggleMark(type)(state, dispatch)
}