docs: make all extension keyboard shortcuts a table

This commit is contained in:
Hans Pagel
2021-10-01 23:13:49 +02:00
parent bf06eef9f6
commit d3aa7903bd
4 changed files with 35 additions and 41 deletions

View File

@@ -33,13 +33,10 @@ yarn add @tiptap/extension-collaboration yjs y-websocket
| redo | — | Redo the last change. | | redo | — | Redo the last change. |
## Keyboard shortcuts ## Keyboard shortcuts
### Undo | Command | Windows/Linux | macOS |
* Windows/Linux: `Control` `Z` | ------- | ----------------------------------------------------- | --------------------------------------------- |
* macOS: `Cmd` `Z` | undo() | `Control` `Z` | `Cmd` `Z` |
| redo() | `Shift`&nbsp;`Control`&nbsp;`Z`<br>`Control`&nbsp;`Y` | `Shift`&nbsp;`Cmd`&nbsp;`Z`<br>`Cmd`&nbsp;`Y` |
### Redo
* Windows/Linux: `Shift`&nbsp;`Control`&nbsp;`Z` or `Control`&nbsp;`Y`
* macOS: `Shift`&nbsp;`Cmd`&nbsp;`Z` or `Cmd`&nbsp;`Y`
## Source code ## Source code
[packages/extension-collaboration/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-collaboration/) [packages/extension-collaboration/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-collaboration/)

View File

@@ -20,25 +20,25 @@ yarn add @tiptap/extension-history
| newGroupDelay | `Number` | `500` | The delay between changes after which a new group should be started (in milliseconds). When changes arent adjacent, a new group is always started. | | newGroupDelay | `Number` | `500` | The delay between changes after which a new group should be started (in milliseconds). When changes arent adjacent, a new group is always started. |
## Commands ## Commands
| Command | Parameters | Description |
| ------- | ---------- | --------------------- | ### undo()
| undo | — | Undo the last change. | Undo the last change.
| redo | — | Redo the last change. |
```js
editor.commands.undo()
```
### redo()
Redo the last change.
```js
editor.commands.redo()
```
## Keyboard shortcuts ## Keyboard shortcuts
### Undo | Command | Windows/Linux | macOS |
* Windows/Linux: `Control`&nbsp;`Z` | ------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
* macOS: `Cmd`&nbsp;`Z` | undo() | `Control`&nbsp;`Z`<br>`Control`&nbsp;`я` | `Cmd`&nbsp;`Z`<br>`Cmd`&nbsp;`я` |
#### Russian keyboard layouts | redo() | `Shift`&nbsp;`Control`&nbsp;`Z`<br>`Control`&nbsp;`Y`<br>`Shift`&nbsp;`Control`&nbsp;`я` | `Shift`&nbsp;`Cmd`&nbsp;`Z`<br>`Cmd`&nbsp;`Y`<br>`Shift`&nbsp;`Cmd`&nbsp;`я` |
* Windows/Linux: `Control`&nbsp;`я`
* macOS: `Cmd`&nbsp;`я`
### Redo
* Windows/Linux: `Shift`&nbsp;`Control`&nbsp;`Z` or `Control`&nbsp;`Y`
* macOS: `Shift`&nbsp;`Cmd`&nbsp;`Z` or `Cmd`&nbsp;`Y`
#### Russian keyboard layouts
* Windows/Linux: `Shift`&nbsp;`Control`&nbsp;`я`
* macOS: `Shift`&nbsp;`Cmd`&nbsp;`я`
## Source code ## Source code
[packages/extension-history/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-history/) [packages/extension-history/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-history/)

View File

@@ -19,7 +19,7 @@ yarn add @tiptap/extension-text-align
## Settings ## Settings
| Option | Type | Default | Description | | Option | Type | Default | Description |
| ---------------- | -------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | | ---------------- | -------- | ---------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| types | `Array` | `[]` | A list of nodes where the text align attribute should be applied to. Usually something like `['heading', 'paragraph']`. | | types | `Array` | `[]` | A list of nodes where the text align attribute should be applied to. Usually something like `['heading', 'paragraph']`. |
| alignments | `Array` | `['left', 'center', 'right', 'justify']` | A list of available options for the text align attribute. | | alignments | `Array` | `['left', 'center', 'right', 'justify']` | A list of available options for the text align attribute. |
| defaultAlignment | `String` | `'left'` | The default text align. | | defaultAlignment | `String` | `'left'` | The default text align. |
@@ -30,17 +30,12 @@ yarn add @tiptap/extension-text-align
| textAlign | alignment | Set the text align to the specified value. | | textAlign | alignment | Set the text align to the specified value. |
## Keyboard shortcuts ## Keyboard shortcuts
### Windows/Linux | Command | Windows/Linux | macOS |
* `Ctrl`&nbsp;`Shift`&nbsp;`L` Left | ----------------------- | ---------------------------- | --------------------------- |
* `Ctrl`&nbsp;`Shift`&nbsp;`E` Center | setTextAlign('left') | `Ctrl`&nbsp;`Shift`&nbsp;`L` | `Cmd`&nbsp;`Shift`&nbsp;`L` |
* `Ctrl`&nbsp;`Shift`&nbsp;`R` Right | setTextAlign('center') | `Ctrl`&nbsp;`Shift`&nbsp;`E` | `Cmd`&nbsp;`Shift`&nbsp;`E` |
* `Ctrl`&nbsp;`Shift`&nbsp;`J` Justify | setTextAlign('right') | `Ctrl`&nbsp;`Shift`&nbsp;`R` | `Cmd`&nbsp;`Shift`&nbsp;`R` |
| setTextAlign('justify') | `Ctrl`&nbsp;`Shift`&nbsp;`J` | `Cmd`&nbsp;`Shift`&nbsp;`J` |
### macOS
* `Cmd`&nbsp;`Shift`&nbsp;`L` Left
* `Cmd`&nbsp;`Shift`&nbsp;`E` Center
* `Cmd`&nbsp;`Shift`&nbsp;`R` Right
* `Cmd`&nbsp;`Shift`&nbsp;`J` Justify
## Source code ## Source code
[packages/extension-text-align/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-text-align/) [packages/extension-text-align/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-text-align/)

View File

@@ -39,7 +39,9 @@ yarn add @tiptap/extension-typography
| superscriptThree | Converts `^3` a superscript three `³`. | | superscriptThree | Converts `^3` a superscript three `³`. |
## Keyboard shortcuts ## Keyboard shortcuts
* `Backspace` reverts the applied input rule | Command | Windows/Linux | macOS |
| --------------- | ------------- | ----------- |
| undoInputRule() | `Backspace` | `Backspace` |
## Source code ## Source code
[packages/extension-typography/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-typography/) [packages/extension-typography/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-typography/)