Merge branch 'main' into feature/vue-node-views

This commit is contained in:
Philipp Kühn
2020-11-19 09:38:23 +01:00
25 changed files with 211 additions and 83 deletions

View File

@@ -124,15 +124,15 @@ context('/api/marks/highlight', () => {
it('the keyboard shortcut should highlight the selected text', () => { it('the keyboard shortcut should highlight the selected text', () => {
cy.get('.ProseMirror') cy.get('.ProseMirror')
.trigger('keydown', { modKey: true, key: 'e' }) .trigger('keydown', { modKey: true, shiftKey: true, key: 'h' })
.find('mark') .find('mark')
.should('contain', 'Example Text') .should('contain', 'Example Text')
}) })
it('the keyboard shortcut should toggle the selected text highlighted', () => { it('the keyboard shortcut should toggle the selected text highlighted', () => {
cy.get('.ProseMirror') cy.get('.ProseMirror')
.trigger('keydown', { modKey: true, key: 'e' }) .trigger('keydown', { modKey: true, shiftKey: true, key: 'h' })
.trigger('keydown', { modKey: true, key: 'e' }) .trigger('keydown', { modKey: true, shiftKey: true, key: 'h' })
.find('mark') .find('mark')
.should('not.exist') .should('not.exist')
}) })

View File

@@ -64,15 +64,15 @@ context('/api/marks/strike', () => {
it('the keyboard shortcut should strike the selected text', () => { it('the keyboard shortcut should strike the selected text', () => {
cy.get('.ProseMirror') cy.get('.ProseMirror')
.trigger('keydown', { modKey: true, key: 'd' }) .trigger('keydown', { modKey: true, shiftKey: true, key: 'x' })
.find('s') .find('s')
.should('contain', 'Example Text') .should('contain', 'Example Text')
}) })
it('the keyboard shortcut should toggle the selected text striked', () => { it('the keyboard shortcut should toggle the selected text striked', () => {
cy.get('.ProseMirror') cy.get('.ProseMirror')
.trigger('keydown', { modKey: true, key: 'd' }) .trigger('keydown', { modKey: true, shiftKey: true, key: 'x' })
.trigger('keydown', { modKey: true, key: 'd' }) .trigger('keydown', { modKey: true, shiftKey: true, key: 'x' })
.find('s') .find('s')
.should('not.exist') .should('not.exist')
}) })

View File

@@ -73,7 +73,7 @@ context('/api/nodes/blockquote', () => {
it('the keyboard shortcut should make the selected line a blockquote', () => { it('the keyboard shortcut should make the selected line a blockquote', () => {
cy.get('.ProseMirror') cy.get('.ProseMirror')
.trigger('keydown', { shiftKey: true, modKey: true, key: '9' }) .trigger('keydown', { shiftKey: true, modKey: true, key: 'b' })
.find('blockquote') .find('blockquote')
.should('contain', 'Example Text') .should('contain', 'Example Text')
}) })
@@ -83,13 +83,13 @@ context('/api/nodes/blockquote', () => {
.should('not.exist') .should('not.exist')
cy.get('.ProseMirror') cy.get('.ProseMirror')
.trigger('keydown', { shiftKey: true, modKey: true, key: '9' }) .trigger('keydown', { shiftKey: true, modKey: true, key: 'b' })
.find('blockquote') .find('blockquote')
.should('contain', 'Example Text') .should('contain', 'Example Text')
cy.get('.ProseMirror') cy.get('.ProseMirror')
.type('{selectall}') .type('{selectall}')
.trigger('keydown', { shiftKey: true, modKey: true, key: '9' }) .trigger('keydown', { shiftKey: true, modKey: true, key: 'b' })
cy.get('.ProseMirror blockquote') cy.get('.ProseMirror blockquote')
.should('not.exist') .should('not.exist')

View File

@@ -49,3 +49,17 @@ export default {
}, },
} }
</script> </script>
<style lang="scss">
/* Basic editor styles */
.ProseMirror {
> * + * {
margin-top: 0.75em;
}
blockquote {
padding-left: 1rem;
border-left: 2px solid rgba(#0D0D0D, 0.1);
}
}
</style>

View File

@@ -53,20 +53,20 @@ context('/api/nodes/code-block', () => {
it('the keyboard shortcut should make the selected line a code block', () => { it('the keyboard shortcut should make the selected line a code block', () => {
cy.get('.ProseMirror') cy.get('.ProseMirror')
.trigger('keydown', { shiftKey: true, modKey: true, key: 'c' }) .trigger('keydown', { modKey: true, altKey: true, key: 'c' })
.find('pre') .find('pre')
.should('contain', 'Example Text') .should('contain', 'Example Text')
}) })
it('the keyboard shortcut should toggle the code block', () => { it('the keyboard shortcut should toggle the code block', () => {
cy.get('.ProseMirror') cy.get('.ProseMirror')
.trigger('keydown', { shiftKey: true, modKey: true, key: 'c' }) .trigger('keydown', { modKey: true, altKey: true, key: 'c' })
.find('pre') .find('pre')
.should('contain', 'Example Text') .should('contain', 'Example Text')
cy.get('.ProseMirror') cy.get('.ProseMirror')
.type('{selectall}') .type('{selectall}')
.trigger('keydown', { shiftKey: true, modKey: true, key: 'c' }) .trigger('keydown', { modKey: true, altKey: true, key: 'c' })
cy.get('.ProseMirror pre') cy.get('.ProseMirror pre')
.should('not.exist') .should('not.exist')

View File

@@ -23,11 +23,18 @@ 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
* `Ctrl`&nbsp;`Shift`&nbsp;`L` Left * `Ctrl`&nbsp;`Shift`&nbsp;`L` Left
* `Ctrl`&nbsp;`Shift`&nbsp;`E` Center * `Ctrl`&nbsp;`Shift`&nbsp;`E` Center
* `Ctrl`&nbsp;`Shift`&nbsp;`R` Right * `Ctrl`&nbsp;`Shift`&nbsp;`R` Right
* `Ctrl`&nbsp;`Shift`&nbsp;`J` Justify * `Ctrl`&nbsp;`Shift`&nbsp;`J` Justify
### 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-next/blob/main/packages/extension-text-align/) [packages/extension-text-align/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-text-align/)

View File

@@ -10,14 +10,7 @@ Funfact: We built a [keyboard shortcut learning app](https://mouseless.app), to
## Predefined keyboard shortcuts ## Predefined keyboard shortcuts
Most of the core extensions register their own keyboard shortcuts. Depending on what set of extension you use, not all of the below listed keyboard shortcuts work for your editor. Most of the core extensions register their own keyboard shortcuts. Depending on what set of extension you use, not all of the below listed keyboard shortcuts work for your editor.
### Ideas
* Task List ⌥⌘L (iaWriter)
* Mark Task Complete ⌘. (iaWriter)
* Text Highlight ⌘E (Paper)
### Essentials ### Essentials
❌ = untested
| Action | Windows/Linux | macOS | | Action | Windows/Linux | macOS |
| ------------------------ | ------------------------------- | --------------------------- | | ------------------------ | ------------------------------- | --------------------------- |
| Copy | `Control`&nbsp;`C` | `Cmd`&nbsp;`C` | | Copy | `Control`&nbsp;`C` | `Cmd`&nbsp;`C` |
@@ -26,50 +19,39 @@ Most of the core extensions register their own keyboard shortcuts. Depending on
| Paste without formatting | `Control`&nbsp;`Shift`&nbsp;`V` | `Cmd`&nbsp;`Shift`&nbsp;`V` | | Paste without formatting | `Control`&nbsp;`Shift`&nbsp;`V` | `Cmd`&nbsp;`Shift`&nbsp;`V` |
| Undo | `Control`&nbsp;`Z` | `Cmd`&nbsp;`Z` | | Undo | `Control`&nbsp;`Z` | `Cmd`&nbsp;`Z` |
| Redo | `Control`&nbsp;`Shift`&nbsp;`Z` | `Cmd`&nbsp;`Shift`&nbsp;`Z` | | Redo | `Control`&nbsp;`Shift`&nbsp;`Z` | `Cmd`&nbsp;`Shift`&nbsp;`Z` |
| ❌ Insert or edit link | `Control`&nbsp;`K` | `Cmd`&nbsp;`K` |
| ❌ Open link | `Alt`&nbsp;`Enter` | `Alt`&nbsp;`Enter` |
| ❌ Find | `Control`&nbsp;`F` | `Cmd`&nbsp;`F` |
| ❌ Find and replace | `Control`&nbsp;`H` | `Cmd`&nbsp;`Shift`&nbsp;`H` |
| ❌ Find again | `Control`&nbsp;`G` | `Cmd`&nbsp;`G` |
| ❌ Find previous | `Control`&nbsp;`Shift`&nbsp;`G` | `Cmd`&nbsp;`Shift`&nbsp;`G` |
| ❌ Repeat last action | `Control`&nbsp;`Y` | `Cmd`&nbsp;`Y` |
| Add a line break | `Shift`&nbsp;`Enter` | `Shift`&nbsp;`Enter` | | Add a line break | `Shift`&nbsp;`Enter` | `Shift`&nbsp;`Enter` |
### Text Formatting ### Text Formatting
| Action | Windows/Linux | macOS | | Action | Windows/Linux | macOS |
| ----------------------- | -------------------------------------------- | --------------------------- | | ------------- | ------------------------------- | --------------------------- |
| Bold | `Control`&nbsp;`B` | `Cmd`&nbsp;`B` | | Bold | `Control`&nbsp;`B` | `Cmd`&nbsp;`B` |
| Italicize | `Control`&nbsp;`I` | `Cmd`&nbsp;`I` | | Italicize | `Control`&nbsp;`I` | `Cmd`&nbsp;`I` |
| Underline | `Control`&nbsp;`U` | `Cmd`&nbsp;`U` | | Underline | `Control`&nbsp;`U` | `Cmd`&nbsp;`U` |
| Strikethrough | `Alt`&nbsp;`Shift`&nbsp;`5` | `Cmd`&nbsp;`Shift`&nbsp;`X` | | Strikethrough | `Control`&nbsp;`Shift`&nbsp;`X` | `Cmd`&nbsp;`Shift`&nbsp;`X` |
| ❌ Superscript | `Control`&nbsp;`.` | `Cmd`&nbsp;`.` | | Highlight | `Control`&nbsp;`Shift`&nbsp;`H` | `Cmd`&nbsp;`Shift`&nbsp;`H` |
| ❌ Subscript | `Control`&nbsp;`,` | `Cmd`&nbsp;`,` | | Code | `Control`&nbsp;`E` | `Cmd`&nbsp;`E` |
| ❌ Copy text formatting | `Control`&nbsp;`Alt`&nbsp;`C` | `Cmd`&nbsp;`Alt`&nbsp;`C` |
| ❌ Paste text formatting | `Control`&nbsp;`Alt`&nbsp;`V` | `Cmd`&nbsp;`Alt`&nbsp;`V` |
| ❌ Clear text formatting | `Control`&nbsp;`\`<br>`Control`&nbsp;`Space` | `Cmd`&nbsp;`\` |
| ❌ Increase font size | `Control`&nbsp;`Shift`&nbsp;`>` | `Cmd`&nbsp;`Shift`&nbsp;`>` |
| ❌ Decrease font size | `Control`&nbsp;`Shift`&nbsp;`<` | `Cmd`&nbsp;`Shift`&nbsp;`<` |
### Paragraph Formatting ### Paragraph Formatting
| Action | Windows/Linux | macOS | | Action | Windows/Linux | macOS |
| -------------------------------- | ------------------------------- | ------------------------------- | | ----------------------- | ------------------------------- | --------------------------- |
| ❌ Increase paragraph indentation | `Control`&nbsp;`]` | `Cmd`&nbsp;`]` | | Apply normal text style | `Control`&nbsp;`Alt`&nbsp;`0` | `Cmd`&nbsp;`Alt`&nbsp;`0` |
| ❌ Decrease paragraph indentation | `Control`&nbsp;`[` | `Cmd`&nbsp;`[` | | Apply heading style 1 | `Control`&nbsp;`Alt`&nbsp;`1` | `Cmd`&nbsp;`Alt`&nbsp;`1` |
| Apply normal text style | `Control`&nbsp;`Alt`&nbsp;`0` | `Cmd`&nbsp;`Alt`&nbsp;`0` | | Apply heading style 2 | `Control`&nbsp;`Alt`&nbsp;`2` | `Cmd`&nbsp;`Alt`&nbsp;`2` |
| Apply heading style 1 | `Control`&nbsp;`Alt`&nbsp;`1` | `Cmd`&nbsp;`Alt`&nbsp;`1` | | Apply heading style 3 | `Control`&nbsp;`Alt`&nbsp;`3` | `Cmd`&nbsp;`Alt`&nbsp;`3` |
| Apply heading style 2 | `Control`&nbsp;`Alt`&nbsp;`2` | `Cmd`&nbsp;`Alt`&nbsp;`2` | | Apply heading style 4 | `Control`&nbsp;`Alt`&nbsp;`4` | `Cmd`&nbsp;`Alt`&nbsp;`4` |
| Apply heading style 3 | `Control`&nbsp;`Alt`&nbsp;`3` | `Cmd`&nbsp;`Alt`&nbsp;`3` | | Apply heading style 5 | `Control`&nbsp;`Alt`&nbsp;`5` | `Cmd`&nbsp;`Alt`&nbsp;`5` |
| Apply heading style 4 | `Control`&nbsp;`Alt`&nbsp;`4` | `Cmd`&nbsp;`Alt`&nbsp;`4` | | Apply heading style 6 | `Control`&nbsp;`Alt`&nbsp;`6` | `Cmd`&nbsp;`Alt`&nbsp;`6` |
| Apply heading style 5 | `Control`&nbsp;`Alt`&nbsp;`5` | `Cmd`&nbsp;`Alt`&nbsp;`5` | | Ordered list | `Control`&nbsp;`Shift`&nbsp;`7` | `Cmd`&nbsp;`Shift`&nbsp;`7` |
| Apply heading style 6 | `Control`&nbsp;`Alt`&nbsp;`6` | `Cmd`&nbsp;`Alt`&nbsp;`6` | | Bullet list | `Control`&nbsp;`Shift`&nbsp;`8` | `Cmd`&nbsp;`Shift`&nbsp;`8` |
| Left align | `Control`&nbsp;`Shift`&nbsp;`L` | `Cmd`&nbsp;`Shift`&nbsp;`L` | | Blockquote | `Control`&nbsp;`Shift`&nbsp;`B` | `Cmd`&nbsp;`Shift`&nbsp;`B` |
| Center align | `Control`&nbsp;`Shift`&nbsp;`E` | `Cmd`&nbsp;`Shift`&nbsp;`E` | | Left align | `Control`&nbsp;`Shift`&nbsp;`L` | `Cmd`&nbsp;`Shift`&nbsp;`L` |
| Right align | `Control`&nbsp;`Shift`&nbsp;`R` | `Cmd`&nbsp;`Shift`&nbsp;`R` | | Center align | `Control`&nbsp;`Shift`&nbsp;`E` | `Cmd`&nbsp;`Shift`&nbsp;`E` |
| Justify | `Control`&nbsp;`Shift`&nbsp;`J` | `Cmd`&nbsp;`Shift`&nbsp;`J` | | Right align | `Control`&nbsp;`Shift`&nbsp;`R` | `Cmd`&nbsp;`Shift`&nbsp;`R` |
| ❌ Numbered list | `Control`&nbsp;`Shift`&nbsp;`7` | `Cmd`&nbsp;`Shift`&nbsp;`7` | | Justify | `Control`&nbsp;`Shift`&nbsp;`J` | `Cmd`&nbsp;`Shift`&nbsp;`J` |
| ❌ Bulleted list | `Control`&nbsp;`Shift`&nbsp;`8` | `Cmd`&nbsp;`Shift`&nbsp;`8` | | Task list | `Control`&nbsp;`Shift`&nbsp;`L` | `Cmd`&nbsp;`Shift`&nbsp;`L` |
| ❌ Move paragraph up | `Control`&nbsp;`Shift`&nbsp;`` | `Control`&nbsp;`Shift`&nbsp;`` | | Code block | `Control`&nbsp;`Alt`&nbsp;`C` | `Cmd`&nbsp;`Alt`&nbsp;`C` |
| ❌ Move paragraph down | `Control`&nbsp;`Shift`&nbsp;`↓` | `Control`&nbsp;`Shift`&nbsp;`↓` |
<!--| Toggle task| `Control`&nbsp;`Enter` | `Cmd`&nbsp;`Enter` | -->
### Text Selection ### Text Selection
| Action | Windows/Linux | macOS | | Action | Windows/Linux | macOS |
@@ -79,10 +61,8 @@ Most of the core extensions register their own keyboard shortcuts. Depending on
| Extend selection one character to right | `Shift`&nbsp;`→` | `Shift`&nbsp;`→` | | Extend selection one character to right | `Shift`&nbsp;`→` | `Shift`&nbsp;`→` |
| Extend selection one line up | `Shift`&nbsp;`↑` | `Shift`&nbsp;`↑` | | Extend selection one line up | `Shift`&nbsp;`↑` | `Shift`&nbsp;`↑` |
| Extend selection one line down | `Shift`&nbsp;`↓` | `Shift`&nbsp;`↓` | | Extend selection one line down | `Shift`&nbsp;`↓` | `Shift`&nbsp;`↓` |
| ❌ Extend selection one paragraph up | `Alt`&nbsp;`Shift`&nbsp;`↑` | `Alt`&nbsp;`Shift`&nbsp;`↑` |
| ❌ Extend selection one paragraph down | `Alt`&nbsp;`Shift`&nbsp;`↓` | `Alt`&nbsp;`Shift`&nbsp;`↓` |
| Extend selection to the beginning of the document | `Control`&nbsp;`Shift`&nbsp;`↑` | `Cmd`&nbsp;`Shift`&nbsp;`↑` | | Extend selection to the beginning of the document | `Control`&nbsp;`Shift`&nbsp;`↑` | `Cmd`&nbsp;`Shift`&nbsp;`↑` |
| Extend selection to the end of the document | `Control`&nbsp;`Shift`&nbsp;`↓` | `Cmd`&nbsp;`Shift`&nbsp;`↓` | | Extend selection to the end of the document | `Control`&nbsp;`Shift`&nbsp;`↓` | `Cmd`&nbsp;`Shift`&nbsp;`↓` |
## Overwrite keyboard shortcuts ## Overwrite keyboard shortcuts
Keyboard shortcuts may be strings like `'Shift-Control-Enter'`. Keys are based on the strings that can appear in `event.key`, concatenated with a `-`. There is a little tool called [keycode.info](https://keycode.info/), which shows the `event.key` interactively. Keyboard shortcuts may be strings like `'Shift-Control-Enter'`. Keys are based on the strings that can appear in `event.key`, concatenated with a `-`. There is a little tool called [keycode.info](https://keycode.info/), which shows the `event.key` interactively.

View File

@@ -23,7 +23,8 @@ yarn add @tiptap/extension-code
| code | — | Mark text as inline code. | | code | — | Mark text as inline code. |
## Keyboard shortcuts ## Keyboard shortcuts
* `Alt`&nbsp;<code>`</code> * Windows/Linux: `Control`&nbsp;`E`
* macOS: `Cmd`&nbsp;`E`
## Source code ## Source code
[packages/extension-code/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-code/) [packages/extension-code/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-code/)

View File

@@ -23,8 +23,8 @@ yarn add @tiptap/extension-highlight
| highlight | color | Mark text as highlighted, optionally pass a specific color. | | highlight | color | Mark text as highlighted, optionally pass a specific color. |
## Keyboard shortcuts ## Keyboard shortcuts
* Windows/Linux: `Control`&nbsp;`E` * Windows/Linux: `Control`&nbsp;`Shift`&nbsp;`H`
* macOS: `Cmd`&nbsp;`E` * macOS: `Cmd`&nbsp;`Shift`&nbsp;`H`
## Source code ## Source code
[packages/extension-highlight/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-highlight/) [packages/extension-highlight/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-highlight/)

View File

@@ -27,8 +27,8 @@ yarn add @tiptap/extension-strike
| strike | — | Mark text as strikethrough. | | strike | — | Mark text as strikethrough. |
## Keyboard shortcuts ## Keyboard shortcuts
* Windows/Linux: `Control`&nbsp;`D` * Windows/Linux: `Control`&nbsp;`Shift`&nbsp;`X`
* macOS: `Cmd`&nbsp;`D` * macOS: `Cmd`&nbsp;`Shift`&nbsp;`X`
## Source code ## Source code
[packages/extension-strike/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-strike/) [packages/extension-strike/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-strike/)

View File

@@ -24,8 +24,8 @@ yarn add @tiptap/extension-blockquote
| blockquote | — | Wrap content in a blockquote. | | blockquote | — | Wrap content in a blockquote. |
## Keyboard shortcuts ## Keyboard shortcuts
* Windows/Linux: `Control`&nbsp;`Shift`&nbsp;`9` * Windows/Linux: `Control`&nbsp;`Shift`&nbsp;`B`
* macOS: `Cmd`&nbsp;`Shift`&nbsp;`9` * macOS: `Cmd`&nbsp;`Shift`&nbsp;`B`
## Source code ## Source code
[packages/extension-blockquote/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-blockquote/) [packages/extension-blockquote/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-blockquote/)

View File

@@ -27,7 +27,8 @@ yarn add @tiptap/extension-bullet-list @tiptap/extension-list-item
| bulletList | — | Toggle a bullet list. | | bulletList | — | Toggle a bullet list. |
## Keyboard shortcuts ## Keyboard shortcuts
* `Control`&nbsp;`Shift`&nbsp;`8` * Windows/Linux: `Control`&nbsp;`Shift`&nbsp;`8`
* macOS: `Cmd`&nbsp;`Shift`&nbsp;`8`
## Source code ## Source code
[packages/extension-bullet-list/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-bullet-list/) [packages/extension-bullet-list/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-bullet-list/)

View File

@@ -28,8 +28,8 @@ yarn add @tiptap/extension-code-block
| codeBlock | — | Wrap content in a code block. | | codeBlock | — | Wrap content in a code block. |
## Keyboard shortcuts ## Keyboard shortcuts
* Windows/Linux: `Control`&nbsp;`Shift`&nbsp;`C` * Windows/Linux: `Control`&nbsp;`Alt`&nbsp;`C`
* macOS: `Cmd`&nbsp;`Shift`&nbsp;`C` * macOS: `Cmd`&nbsp;`Alt`&nbsp;`C`
## Source code ## Source code
[packages/extension-code-block/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-code-block/) [packages/extension-code-block/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-code-block/)

View File

@@ -27,7 +27,8 @@ yarn add @tiptap/extension-ordered-list @tiptap/extension-list-item
| orderedList | — | Toggle an ordered list. | | orderedList | — | Toggle an ordered list. |
## Keyboard shortcuts ## Keyboard shortcuts
* `Control`&nbsp;`Shift`&nbsp;`9` * Windows/Linux: `Control`&nbsp;`Shift`&nbsp;`7`
* macOS: `Cmd`&nbsp;`Shift`&nbsp;`7`
## Source code ## Source code
[packages/extension-ordered-list/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-ordered-list/) [packages/extension-ordered-list/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-ordered-list/)

View File

@@ -26,6 +26,10 @@ yarn add @tiptap/extension-task-list @tiptap/extension-task-item
| -------- | ---------- | ------------------- | | -------- | ---------- | ------------------- |
| taskList | — | Toggle a task list. | | taskList | — | Toggle a task list. |
## Keyboard shortcuts
* Windows/Linux: `Control`&nbsp;`Shift`&nbsp;`L`
* macOS: `Cmd`&nbsp;`Shift`&nbsp;`L`
## Source code ## Source code
[packages/extension-task-list/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-task-list/) [packages/extension-task-list/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-task-list/)

View File

@@ -57,7 +57,7 @@ const Blockquote = Node.create({
addKeyboardShortcuts() { addKeyboardShortcuts() {
return { return {
'Shift-Mod-9': () => this.editor.commands.toggleBlockquote(), 'Mod-Shift-b': () => this.editor.commands.toggleBlockquote(),
} }
}, },

View File

@@ -43,7 +43,7 @@ const BulletList = Node.create({
addKeyboardShortcuts() { addKeyboardShortcuts() {
return { return {
'Shift-Control-8': () => this.editor.commands.toggleBulletList(), 'Mod-Shift-8': () => this.editor.commands.toggleBulletList(),
} }
}, },

View File

@@ -91,7 +91,7 @@ const CodeBlock = Node.create({
addKeyboardShortcuts() { addKeyboardShortcuts() {
return { return {
'Mod-Shift-c': () => this.editor.commands.toggleCodeBlock(), 'Mod-Alt-c': () => this.editor.commands.toggleCodeBlock(),
} }
}, },

View File

@@ -58,7 +58,7 @@ const Code = Mark.create({
addKeyboardShortcuts() { addKeyboardShortcuts() {
return { return {
'Mod-`': () => this.editor.commands.toggleCode(), 'Mod-e': () => this.editor.commands.toggleCode(),
} }
}, },

View File

@@ -81,7 +81,7 @@ const Highlight = Mark.create({
addKeyboardShortcuts() { addKeyboardShortcuts() {
return { return {
'Mod-e': () => this.editor.commands.toggleHighlight(), 'Mod-Shift-h': () => this.editor.commands.toggleHighlight(),
} }
}, },

View File

@@ -62,7 +62,7 @@ const OrderedList = Node.create({
addKeyboardShortcuts() { addKeyboardShortcuts() {
return { return {
'Shift-Control-9': () => this.editor.commands.toggleOrderedList(), 'Mod-Shift-7': () => this.editor.commands.toggleOrderedList(),
} }
}, },

View File

@@ -67,7 +67,7 @@ const Strike = Mark.create({
addKeyboardShortcuts() { addKeyboardShortcuts() {
return { return {
'Mod-d': () => this.editor.commands.toggleStrike(), 'Mod-Shift-x': () => this.editor.commands.toggleStrike(),
} }
}, },

View File

@@ -40,6 +40,12 @@ const TaskList = Node.create({
}, },
} }
}, },
addKeyboardShortcuts() {
return {
'Mod-Shift-l': () => this.editor.commands.toggleTaskList(),
}
},
}) })
export default TaskList export default TaskList

View File

@@ -61,10 +61,10 @@ const TextAlign = Extension.create({
Enter: () => this.editor.commands.splitBlock({ Enter: () => this.editor.commands.splitBlock({
withAttributes: true, withAttributes: true,
}), }),
'Ctrl-Shift-l': () => this.editor.commands.setTextAlign('left'), 'Mod-Shift-l': () => this.editor.commands.setTextAlign('left'),
'Ctrl-Shift-e': () => this.editor.commands.setTextAlign('center'), 'Mod-Shift-e': () => this.editor.commands.setTextAlign('center'),
'Ctrl-Shift-r': () => this.editor.commands.setTextAlign('right'), 'Mod-Shift-r': () => this.editor.commands.setTextAlign('right'),
'Ctrl-Shift-j': () => this.editor.commands.setTextAlign('justify'), 'Mod-Shift-j': () => this.editor.commands.setTextAlign('justify'),
} }
}, },
}) })

114
yarn.lock
View File

@@ -2144,6 +2144,120 @@
dependencies: dependencies:
defer-to-connect "^1.0.1" defer-to-connect "^1.0.1"
"@tiptap/extension-blockquote@^1.0.0-alpha.2":
version "1.0.0-alpha.2"
resolved "https://registry.yarnpkg.com/@tiptap/extension-blockquote/-/extension-blockquote-1.0.0-alpha.2.tgz#977d278895ffe1d6bdb2ba4e5ffcd29ac13db292"
integrity sha512-baZ3XG9RhClDdAgJMR8eviGFVjkaOYVK65+rJchEfpAyaF4Xh5ZeGFBqjdeLrTVp2R6z47pfIo+j+tV7eN6Clw==
dependencies:
prosemirror-inputrules "^1.1.3"
"@tiptap/extension-bold@^1.0.0-alpha.2":
version "1.0.0-alpha.2"
resolved "https://registry.yarnpkg.com/@tiptap/extension-bold/-/extension-bold-1.0.0-alpha.2.tgz#70f9a399d7d5b2d12a4d059b4c39721b9ef52f15"
integrity sha512-bV84t0No4xbsIbshlJUtmnYoFOvBy+KjTGBvDCNXtMqguRu8+d6VH2Y+Uc7GGQZwOEimtnUvT+k98MoBPWmB4w==
"@tiptap/extension-bullet-list@^1.0.0-alpha.2":
version "1.0.0-alpha.2"
resolved "https://registry.yarnpkg.com/@tiptap/extension-bullet-list/-/extension-bullet-list-1.0.0-alpha.2.tgz#39fc70ac36de408b79285a8693c184595cbc6da1"
integrity sha512-d3pjeVBmMk4ucOqexiMQ3aDaxD7r03/nYydAw60t1tPnkwg+3pz91XL0DU2l1n1ErwGz0XZ366WuSPNp1m2SyQ==
dependencies:
prosemirror-inputrules "^1.1.3"
"@tiptap/extension-code-block@^1.0.0-alpha.2":
version "1.0.0-alpha.2"
resolved "https://registry.yarnpkg.com/@tiptap/extension-code-block/-/extension-code-block-1.0.0-alpha.2.tgz#87d6d5bbbb4c7a874092be209cdc286a62ebd439"
integrity sha512-/Lgmrfvujwehukdvyr7afAqHQO6t8Am74DvXZcLFzfoITZVgmJoo/l9y56znBG9Li07QohMKSHuIl7Vj7K26IQ==
dependencies:
prosemirror-inputrules "^1.1.3"
"@tiptap/extension-code@^1.0.0-alpha.2":
version "1.0.0-alpha.2"
resolved "https://registry.yarnpkg.com/@tiptap/extension-code/-/extension-code-1.0.0-alpha.2.tgz#baee72d703c4a95622b5c283338fb35cbc2f266b"
integrity sha512-3iW2AWgGsb7RWUyYLu3sbK+W8HBIFVOXRaUsLNY7kA4r9pObDJ5yFSu6sDNcJFn6uNUjHAqUcR/puyZRA2nl8g==
"@tiptap/extension-document@^1.0.0-alpha.2":
version "1.0.0-alpha.2"
resolved "https://registry.yarnpkg.com/@tiptap/extension-document/-/extension-document-1.0.0-alpha.2.tgz#c9e959b1a60502fdf8ed0b58a6f65e83bebd1fd1"
integrity sha512-q7jWy3TbnzP/ElNVbndPuHowhbK+bnL7OZ87H8UiqWAMrYcNhlZ17bU/C+twtJG/hjHMBMjWPrDkFIzRFC13Yw==
"@tiptap/extension-dropcursor@^1.0.0-alpha.2":
version "1.0.0-alpha.2"
resolved "https://registry.yarnpkg.com/@tiptap/extension-dropcursor/-/extension-dropcursor-1.0.0-alpha.2.tgz#3f21457bc66568627f3ae39efe5dd045f885144d"
integrity sha512-v9S3Y1oW7gTu8Tpk010BLgijf0GiJ/VtA44SYYq/quVHn4nRhVnuep3WsGlZZG9vj03vhHs6QDo94fqYE7a6Nw==
dependencies:
"@types/prosemirror-dropcursor" "^1.0.0"
prosemirror-dropcursor "^1.1.3"
"@tiptap/extension-gapcursor@^1.0.0-alpha.2":
version "1.0.0-alpha.2"
resolved "https://registry.yarnpkg.com/@tiptap/extension-gapcursor/-/extension-gapcursor-1.0.0-alpha.2.tgz#9f894087ad03d6c564a3f9b95de924d96be26f5d"
integrity sha512-QsZZnbD7y8yVESCQyKiSk4kJhC8NN4Fg3N6U+RQ8VxcESStoYnc63wwHg2QfvRHqlSvAnd4MypSeArk9UAfsKw==
dependencies:
"@types/prosemirror-gapcursor" "^1.0.1"
prosemirror-gapcursor "^1.1.5"
"@tiptap/extension-hard-break@^1.0.0-alpha.2":
version "1.0.0-alpha.2"
resolved "https://registry.yarnpkg.com/@tiptap/extension-hard-break/-/extension-hard-break-1.0.0-alpha.2.tgz#039b1e8fa24c754c0a060479b4feafcd20b077ae"
integrity sha512-ymmTgR/XLI7eFAY89QlAc6tTqPaVZvCCxKSmIFPeYIMu2msEOxR2xEW/aCWG3YWP2+fhJxZG0fxrgHpVKUsRNw==
"@tiptap/extension-heading@^1.0.0-alpha.2":
version "1.0.0-alpha.2"
resolved "https://registry.yarnpkg.com/@tiptap/extension-heading/-/extension-heading-1.0.0-alpha.2.tgz#34f81d0d36d5f66e94c30baaec7388670e0fd412"
integrity sha512-5ZZOowKp+pnL2xxUkaJgphCvif9W4Oj5CaOHccUnrK2jLrzx2Uv2qHHh+jsl1st13ctuIh3tXRRIKWEOaWzggg==
dependencies:
"@types/prosemirror-inputrules" "^1.0.3"
prosemirror-inputrules "^1.1.3"
"@tiptap/extension-history@^1.0.0-alpha.2":
version "1.0.0-alpha.2"
resolved "https://registry.yarnpkg.com/@tiptap/extension-history/-/extension-history-1.0.0-alpha.2.tgz#55b547b7fb6d243b131bddf7b7d14319190aa091"
integrity sha512-+cbwlc2KuDQSuRXGgfeSTUz3QRapVUJQH0U39lrMMgEv5kAOv3rkdZHUrHpbYEwTscril1HJWhvNa5qHB4laYA==
dependencies:
prosemirror-history "^1.1.3"
"@tiptap/extension-horizontal-rule@^1.0.0-alpha.2":
version "1.0.0-alpha.2"
resolved "https://registry.yarnpkg.com/@tiptap/extension-horizontal-rule/-/extension-horizontal-rule-1.0.0-alpha.2.tgz#cca4f04b45587d2d81bb21b4a93ad957f219241a"
integrity sha512-LLCnM4xtF5l1oiW+hBTfZHLu8U8AVua1cxMqC5Pw9wrYGLHLEq/bDBuxkzWfSXDkEnAsWufqfXiLIX86f4XrQw==
"@tiptap/extension-italic@^1.0.0-alpha.2":
version "1.0.0-alpha.2"
resolved "https://registry.yarnpkg.com/@tiptap/extension-italic/-/extension-italic-1.0.0-alpha.2.tgz#3e57ed8311ae5bf01c5b210538affd4641b6f294"
integrity sha512-63zgxJZTuoc4mmp76FspZLNxL/5eA+pA4n2Xflhtm8zkGV7BCbkg0N+unGFUYsQldxKTz6EePQhcLkBRq1kO1Q==
"@tiptap/extension-list-item@^1.0.0-alpha.2":
version "1.0.0-alpha.2"
resolved "https://registry.yarnpkg.com/@tiptap/extension-list-item/-/extension-list-item-1.0.0-alpha.2.tgz#36f50aa70f3ac66c8aeb04b9850db139e2f413e7"
integrity sha512-ta32iPn4zZZxeHlWoZkCmKZ5wNehYmG0SqZD8xmU1VZR58ly2TRL+VRhPGvQnE9rcyj6eh+ycx8oB9D6UCbNBA==
"@tiptap/extension-ordered-list@^1.0.0-alpha.2":
version "1.0.0-alpha.2"
resolved "https://registry.yarnpkg.com/@tiptap/extension-ordered-list/-/extension-ordered-list-1.0.0-alpha.2.tgz#e7826859cdf905f3a974f5331df75afe26302f33"
integrity sha512-kM8PKLEAxVHB4yjpK5+TFc8jiNKUSwEFc/XTSq//vE1eyG8d4rT0opWM7TGS75x+6nsFZXJzI38sGLN6hZYN7A==
dependencies:
prosemirror-inputrules "^1.1.3"
"@tiptap/extension-paragraph@^1.0.0-alpha.2":
version "1.0.0-alpha.2"
resolved "https://registry.yarnpkg.com/@tiptap/extension-paragraph/-/extension-paragraph-1.0.0-alpha.2.tgz#141401cb854ac53e14adc8f5ff0f64d35fa0aa80"
integrity sha512-7wipqmPQLhs/5261rrFggd19j0NBZCgH31ORlg1AZ8sSo9JYSply9iuPuweipf8W19uO+ttz/JALa2FtoMrnrg==
"@tiptap/extension-strike@^1.0.0-alpha.2":
version "1.0.0-alpha.2"
resolved "https://registry.yarnpkg.com/@tiptap/extension-strike/-/extension-strike-1.0.0-alpha.2.tgz#caa91b474335fbcb8eae50494cfa8caf0dad0e09"
integrity sha512-nsQXDag12DHs8DjK+l6+QdSZJlF9cjXrqLWiK0d8lFi9plGBKNMKsAME2mmRHeHiyXzdX8swlIbrK/64UjgGlg==
"@tiptap/extension-text@^1.0.0-alpha.2":
version "1.0.0-alpha.2"
resolved "https://registry.yarnpkg.com/@tiptap/extension-text/-/extension-text-1.0.0-alpha.2.tgz#0f7ea8ef3d938e0c2f5c3be6884ed6275cbc2402"
integrity sha512-sC65YAPp+iVICrdWCVhxwC5EZxms26yUrCOJ8iXAF/lYGO19EheDfaMWmxYLoUvCq6PB/YqMLgrjmmGQCalYHA==
"@tiptap/extension-underline@^1.0.0-alpha.2":
version "1.0.0-alpha.2"
resolved "https://registry.yarnpkg.com/@tiptap/extension-underline/-/extension-underline-1.0.0-alpha.2.tgz#28470bc5b405dd7ee5ff86cc480c0aec62b528bf"
integrity sha512-L8IJET3elmyk8/gNB11IfpQo1y990mF/l/a7VSI00190wspVRHZjjEwmzBRj2G5kyK4nZvF5NWj4b6d8SuwIMQ==
"@types/babel-types@*", "@types/babel-types@^7.0.0": "@types/babel-types@*", "@types/babel-types@^7.0.0":
version "7.0.9" version "7.0.9"
resolved "https://registry.yarnpkg.com/@types/babel-types/-/babel-types-7.0.9.tgz#01d7b86949f455402a94c788883fe4ba574cad41" resolved "https://registry.yarnpkg.com/@types/babel-types/-/babel-types-7.0.9.tgz#01d7b86949f455402a94c788883fe4ba574cad41"