Merge branch 'main' of github.com:ueberdosis/tiptap-next into main
This commit is contained in:
@@ -40,10 +40,10 @@
|
||||
<button @click="editor.chain().focus().heading({ level: 6 }).run()" :class="{ 'is-active': editor.isActive('heading', { level: 6 }) }">
|
||||
h6
|
||||
</button>
|
||||
<button @click="editor.chain().focus().bulletList().run()" :class="{ 'is-active': editor.isActive('bulletList') }">
|
||||
<button @click="editor.chain().focus().toggleBulletList().run()" :class="{ 'is-active': editor.isActive('bulletList') }">
|
||||
bullet list
|
||||
</button>
|
||||
<button @click="editor.chain().focus().orderedList().run()" :class="{ 'is-active': editor.isActive('orderedList') }">
|
||||
<button @click="editor.chain().focus().toggleOrderedList().run()" :class="{ 'is-active': editor.isActive('orderedList') }">
|
||||
ordered list
|
||||
</button>
|
||||
<button @click="editor.chain().focus().codeBlock().run()" :class="{ 'is-active': editor.isActive('codeBlock') }">
|
||||
|
||||
@@ -40,10 +40,10 @@
|
||||
<button @click="editor.chain().focus().heading({ level: 6 }).run()" :class="{ 'is-active': editor.isActive('heading', { level: 6 }) }">
|
||||
h6
|
||||
</button>
|
||||
<button @click="editor.chain().focus().bulletList().run()" :class="{ 'is-active': editor.isActive('bulletList') }">
|
||||
<button @click="editor.chain().focus().toggleBulletList().run()" :class="{ 'is-active': editor.isActive('bulletList') }">
|
||||
bullet list
|
||||
</button>
|
||||
<button @click="editor.chain().focus().orderedList().run()" :class="{ 'is-active': editor.isActive('orderedList') }">
|
||||
<button @click="editor.chain().focus().toggleOrderedList().run()" :class="{ 'is-active': editor.isActive('orderedList') }">
|
||||
ordered list
|
||||
</button>
|
||||
<button @click="editor.chain().focus().codeBlock().run()" :class="{ 'is-active': editor.isActive('codeBlock') }">
|
||||
|
||||
@@ -40,10 +40,10 @@
|
||||
<button @click="editor.chain().focus().heading({ level: 6 }).run()" :class="{ 'is-active': editor.isActive('heading', { level: 6 }) }">
|
||||
h6
|
||||
</button>
|
||||
<button @click="editor.chain().focus().bulletList().run()" :class="{ 'is-active': editor.isActive('bulletList') }">
|
||||
<button @click="editor.chain().focus().toggleBulletList().run()" :class="{ 'is-active': editor.isActive('bulletList') }">
|
||||
bullet list
|
||||
</button>
|
||||
<button @click="editor.chain().focus().orderedList().run()" :class="{ 'is-active': editor.isActive('orderedList') }">
|
||||
<button @click="editor.chain().focus().toggleOrderedList().run()" :class="{ 'is-active': editor.isActive('orderedList') }">
|
||||
ordered list
|
||||
</button>
|
||||
<button @click="editor.chain().focus().codeBlock().run()" :class="{ 'is-active': editor.isActive('codeBlock') }">
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<button @click="addLink" :class="{ 'is-active': editor.isActive('link') }">
|
||||
link
|
||||
</button>
|
||||
<button @click="editor.chain().focus().removeMark('link').run()" v-if="editor.isActive('link')">
|
||||
<button @click="editor.chain().focus().removeLink().run()" v-if="editor.isActive('link')">
|
||||
remove
|
||||
</button>
|
||||
<editor-content :editor="editor" />
|
||||
@@ -55,7 +55,7 @@ export default {
|
||||
addLink() {
|
||||
const url = window.prompt('URL')
|
||||
|
||||
this.editor.chain().focus().link({ href: url }).run()
|
||||
this.editor.chain().focus().addLink({ href: url }).run()
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<button @click="addLink" :class="{ 'is-active': editor.isActive('link') }">
|
||||
link
|
||||
</button>
|
||||
<button @click="editor.chain().focus().removeMark('link').run()" v-if="editor.isActive('link')">
|
||||
<button @click="editor.chain().focus().removeLink().run()" v-if="editor.isActive('link')">
|
||||
remove
|
||||
</button>
|
||||
<editor-content :editor="editor" />
|
||||
@@ -52,7 +52,7 @@ export default {
|
||||
addLink() {
|
||||
const url = window.prompt('URL')
|
||||
|
||||
this.editor.chain().focus().link({ href: url }).run()
|
||||
this.editor.chain().focus().addLink({ href: url }).run()
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div v-if="editor">
|
||||
<button @click="editor.chain().focus().bulletList().run()" :class="{ 'is-active': editor.isActive('bulletList') }">
|
||||
<button @click="editor.chain().focus().toggleBulletList().run()" :class="{ 'is-active': editor.isActive('bulletList') }">
|
||||
bullet list
|
||||
</button>
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<div v-if="editor">
|
||||
<button @click="editor.chain().focus().bulletList().run()" :class="{ 'is-active': editor.isActive('bulletList') }">
|
||||
<button @click="editor.chain().focus().toggleBulletList().run()" :class="{ 'is-active': editor.isActive('bulletList') }">
|
||||
bullet list
|
||||
</button>
|
||||
<button @click="editor.chain().focus().orderedList().run()" :class="{ 'is-active': editor.isActive('orderedList') }">
|
||||
<button @click="editor.chain().focus().toggleOrderedList().run()" :class="{ 'is-active': editor.isActive('orderedList') }">
|
||||
ordered list
|
||||
</button>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div v-if="editor">
|
||||
<button @click="editor.chain().focus().orderedList().run()" :class="{ 'is-active': editor.isActive('orderedList') }">
|
||||
<button @click="editor.chain().focus().toggleOrderedList().run()" :class="{ 'is-active': editor.isActive('orderedList') }">
|
||||
ordered list
|
||||
</button>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div v-if="editor">
|
||||
<button @click="editor.chain().focus().taskList().run()" :class="{ 'is-active': editor.isActive('task_list') }">
|
||||
<button @click="editor.chain().focus().toggleTaskList().run()" :class="{ 'is-active': editor.isActive('task_list') }">
|
||||
task list
|
||||
</button>
|
||||
|
||||
|
||||
@@ -106,6 +106,7 @@ Have a look at all of the core commands listed below. They should give you a goo
|
||||
### Nodes & Marks
|
||||
| Command | Description |
|
||||
| ----------------------- | --------------------------------------------------------- |
|
||||
| .addMark() | Add a mark with new attributes. |
|
||||
| .clearNodes() | Normalize nodes to a simple paragraph. |
|
||||
| .extendMarkRange() | Extends the text selection to the current mark. |
|
||||
| .removeMark() | Remove a mark in the current selection. |
|
||||
@@ -118,7 +119,6 @@ Have a look at all of the core commands listed below. They should give you a goo
|
||||
| .toggleBlockType() | Toggle a node with another node. |
|
||||
| .toggleMark() | Toggle a mark on and off. |
|
||||
| .toggleWrap() | Wraps nodes in another node, or removes an existing wrap. |
|
||||
| .updateMarkAttributes() | Update a mark with new attributes. |
|
||||
| .updateNodeAttributes() | Update attributes of a node. |
|
||||
|
||||
### Lists
|
||||
|
||||
@@ -104,7 +104,7 @@ const CustomBulletList = BulletList.extend({
|
||||
addKeyboardShortcuts() {
|
||||
return {
|
||||
// ↓ your new keyboard shortcut
|
||||
'Mod-l': () => this.editor.commands.bulletList(),
|
||||
'Mod-l': () => this.editor.commands.toggleBulletList(),
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -25,7 +25,7 @@ import BulletList from '@tiptap/extension-bullet-list'
|
||||
const CustomBulletList = BulletList.extend({
|
||||
addKeyboardShortcuts() {
|
||||
return {
|
||||
'Mod-l': () => this.editor.commands.bulletList(),
|
||||
'Mod-l': () => this.editor.commands.toggleBulletList(),
|
||||
}
|
||||
},
|
||||
})
|
||||
@@ -296,7 +296,7 @@ import BulletList from '@tiptap/extension-bullet-list'
|
||||
const CustomBulletList = BulletList.extend({
|
||||
addKeyboardShortcuts() {
|
||||
return {
|
||||
'Mod-l': () => this.editor.commands.bulletList(),
|
||||
'Mod-l': () => this.editor.commands.toggleBulletList(),
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user