move commands again

This commit is contained in:
Philipp Kühn
2020-11-04 22:38:52 +01:00
parent ca0c3188f3
commit 6f3db0970f
59 changed files with 761 additions and 1066 deletions

View File

@@ -0,0 +1,68 @@
import { createExtension } from '../Extension'
import blur from '../commands/blur'
import clearContent from '../commands/clearContent'
import clearNodes from '../commands/clearNodes'
import deleteSelection from '../commands/deleteSelection'
import focus from '../commands/focus'
import insertHTML from '../commands/insertHTML'
import insertText from '../commands/insertText'
import liftListItem from '../commands/liftListItem'
import removeMark from '../commands/removeMark'
import removeMarks from '../commands/removeMarks'
import resetNodeAttributes from '../commands/resetNodeAttributes'
import scrollIntoView from '../commands/scrollIntoView'
import selectAll from '../commands/selectAll'
import selectParentNode from '../commands/selectParentNode'
import setBlockType from '../commands/setBlockType'
import setContent from '../commands/setContent'
import setNodeAttributes from '../commands/setNodeAttributes'
import sinkListItem from '../commands/sinkListItem'
import splitBlock from '../commands/splitBlock'
import splitListItem from '../commands/splitListItem'
import toggleBlockType from '../commands/toggleBlockType'
import toggleList from '../commands/toggleList'
import toggleMark from '../commands/toggleMark'
import toggleWrap from '../commands/toggleWrap'
import tryCommand from '../commands/try'
import updateMark from '../commands/updateMark'
import wrapInList from '../commands/wrapInList'
export const Commands = createExtension({
addCommands() {
return {
blur,
clearContent,
clearNodes,
deleteSelection,
focus,
insertHTML,
insertText,
liftListItem,
removeMark,
removeMarks,
resetNodeAttributes,
scrollIntoView,
selectAll,
selectParentNode,
setBlockType,
setContent,
setNodeAttributes,
sinkListItem,
splitBlock,
splitListItem,
toggleBlockType,
toggleList,
toggleMark,
toggleWrap,
try: tryCommand,
updateMark,
wrapInList,
}
},
})
declare module '../Editor' {
interface AllExtensions {
Commands: typeof Commands,
}
}