add comments to all commands

This commit is contained in:
Hans Pagel
2020-11-13 15:08:30 +01:00
parent 48be5d1f16
commit 5b76bf5141
24 changed files with 158 additions and 10 deletions

View File

@@ -95,18 +95,18 @@ Have a look at all of the core commands listed below. They should give you a goo
| .updateNodeAttributes() | Update attributes of a node. |
### Lists
| Command | Description |
| ---------------- | ------------------------------------------------------ |
| .liftListItem() | Lift the list item into a wrapping list. |
| .sinkListItem() | Sink the list item down into an inner list. |
| .splitListItem() | Splits a textblock of a list item into two list items. |
| .toggleList() | Toggle between different list types. |
| .wrapInList() | Wrap a node in a list. |
| Command | Description |
| ---------------- | ------------------------------------------- |
| .liftListItem() | Lift the list item into a wrapping list. |
| .sinkListItem() | Sink the list item down into an inner list. |
| .splitListItem() | Splits one list item into two list items. |
| .toggleList() | Toggle between different list types. |
| .wrapInList() | Wrap a node in a list. |
### Selection
| Command | Description |
| ------------------ | --------------------------------------- |
| .blur() | Blurs the editor. |
| .blur() | Removes focus from the editor. |
| .deleteSelection() | Delete the selection, if there is one. |
| .focus() | Focus the editor at the given position. |
| .scrollIntoView() | Scroll the selection into view. |

View File

@@ -282,6 +282,10 @@ const CustomParagraph = Paragraph.extend({
})
```
:::warning Use the commands parameter inside of addCommands
All commands are also available through ~~this.editor.commands~~, but inside of `addCommands` you must use the `commands` parameter thats passed to it.
:::
### Keyboard shortcuts
Most core extensions come with sensible keyboard shortcut defaults. Depending on what you want to build, youll likely want to change them though. With the `addKeyboardShortcuts()` method you can overwrite the predefined shortcut map: