add comments to all commands
This commit is contained in:
@@ -31,33 +31,117 @@ import wrapInList from '../commands/wrapInList'
|
||||
export const Commands = createExtension({
|
||||
addCommands() {
|
||||
return {
|
||||
/**
|
||||
* Removes focus from the editor.
|
||||
*/
|
||||
blur,
|
||||
/**
|
||||
* Clear the whole document.
|
||||
*/
|
||||
clearContent,
|
||||
/**
|
||||
* Normalize nodes to a simple paragraph.
|
||||
*/
|
||||
clearNodes,
|
||||
/**
|
||||
* Delete the selection, if there is one.
|
||||
*/
|
||||
deleteSelection,
|
||||
/**
|
||||
* Extends the text selection to the current mark.
|
||||
*/
|
||||
extendMarkRange,
|
||||
/**
|
||||
* Focus the editor at the given position.
|
||||
*/
|
||||
focus,
|
||||
/**
|
||||
* Insert a string of HTML at the current position.
|
||||
*/
|
||||
insertHTML,
|
||||
/**
|
||||
* Insert a string of text at the current position.
|
||||
*/
|
||||
insertText,
|
||||
/**
|
||||
* Lift the list item into a wrapping list.
|
||||
*/
|
||||
liftListItem,
|
||||
/**
|
||||
* Remove all marks in the current selection.
|
||||
*/
|
||||
removeMark,
|
||||
/**
|
||||
* Remove all marks in the current selection.
|
||||
*/
|
||||
removeMarks,
|
||||
/**
|
||||
* Resets all node attributes to the default value.
|
||||
*/
|
||||
resetNodeAttributes,
|
||||
/**
|
||||
* Scroll the selection into view.
|
||||
*/
|
||||
scrollIntoView,
|
||||
/**
|
||||
* Select the whole document.
|
||||
*/
|
||||
selectAll,
|
||||
/**
|
||||
* Select the parent node.
|
||||
*/
|
||||
selectParentNode,
|
||||
/**
|
||||
* Replace a given range with a node.
|
||||
*/
|
||||
setBlockType,
|
||||
/**
|
||||
* Replace the whole document with new content.
|
||||
*/
|
||||
setContent,
|
||||
/**
|
||||
* Sink the list item down into an inner list.
|
||||
*/
|
||||
sinkListItem,
|
||||
/**
|
||||
* Forks a new node from an existing node.
|
||||
*/
|
||||
splitBlock,
|
||||
/**
|
||||
* Splits one list item into two list items.
|
||||
*/
|
||||
splitListItem,
|
||||
/**
|
||||
* Toggle a node with another node.
|
||||
*/
|
||||
toggleBlockType,
|
||||
/**
|
||||
* Toggle between different list types.
|
||||
*/
|
||||
toggleList,
|
||||
/**
|
||||
* Toggle a mark on and off.
|
||||
*/
|
||||
toggleMark,
|
||||
/**
|
||||
* Wraps nodes in another node, or removes an existing wrap.
|
||||
*/
|
||||
toggleWrap,
|
||||
/**
|
||||
* Runs one command after the other and stops at the first which returns true.
|
||||
*/
|
||||
try: tryCommand,
|
||||
/**
|
||||
* Update a mark with new attributes.
|
||||
*/
|
||||
updateMarkAttributes,
|
||||
/**
|
||||
* Update attributes of a node.
|
||||
*/
|
||||
updateNodeAttributes,
|
||||
/**
|
||||
* Wrap a node in a list.
|
||||
*/
|
||||
wrapInList,
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user