rename unsetMarks to unsetAllMarks
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
<button @click="editor.chain().focus().toggleCode().run()" :class="{ 'is-active': editor.isActive('code') }">
|
<button @click="editor.chain().focus().toggleCode().run()" :class="{ 'is-active': editor.isActive('code') }">
|
||||||
code
|
code
|
||||||
</button>
|
</button>
|
||||||
<button @click="editor.chain().focus().unsetMarks().run()">
|
<button @click="editor.chain().focus().unsetAllMarks().run()">
|
||||||
clear marks
|
clear marks
|
||||||
</button>
|
</button>
|
||||||
<button @click="editor.chain().focus().clearNodes().run()">
|
<button @click="editor.chain().focus().clearNodes().run()">
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<button @click="editor.chain().focus().toggleCode().run()" :class="{ 'is-active': editor.isActive('code') }">
|
<button @click="editor.chain().focus().toggleCode().run()" :class="{ 'is-active': editor.isActive('code') }">
|
||||||
code
|
code
|
||||||
</button>
|
</button>
|
||||||
<button @click="editor.chain().focus().unsetMarks().run()">
|
<button @click="editor.chain().focus().unsetAllMarks().run()">
|
||||||
clear marks
|
clear marks
|
||||||
</button>
|
</button>
|
||||||
<button @click="editor.chain().focus().clearNodes().run()">
|
<button @click="editor.chain().focus().clearNodes().run()">
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<button @click="editor.chain().focus().toggleCode().run()" :class="{ 'is-active': editor.isActive('code') }">
|
<button @click="editor.chain().focus().toggleCode().run()" :class="{ 'is-active': editor.isActive('code') }">
|
||||||
code
|
code
|
||||||
</button>
|
</button>
|
||||||
<button @click="editor.chain().focus().unsetMarks().run()">
|
<button @click="editor.chain().focus().unsetAllMarks().run()">
|
||||||
clear marks
|
clear marks
|
||||||
</button>
|
</button>
|
||||||
<button @click="editor.chain().focus().clearNodes().run()">
|
<button @click="editor.chain().focus().clearNodes().run()">
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div v-if="editor">
|
<div v-if="editor">
|
||||||
<button @click="editor.chain().focus().unsetMarks().run()">
|
<button @click="editor.chain().focus().unsetAllMarks().run()">
|
||||||
clear formatting
|
clear formatting
|
||||||
</button>
|
</button>
|
||||||
<button @click="editor.chain().focus().undo().run()">
|
<button @click="editor.chain().focus().undo().run()">
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const MenuBar = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<button onClick={() => editor.chain().focus().unsetMarks().run()}>
|
<button onClick={() => editor.chain().focus().unsetAllMarks().run()}>
|
||||||
Clear formatting
|
Clear formatting
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
|
|||||||
@@ -116,8 +116,8 @@ Have a look at all of the core commands listed below. They should give you a goo
|
|||||||
| .toggleMark() | Toggle a mark on and off. |
|
| .toggleMark() | Toggle a mark on and off. |
|
||||||
| .toggleNode() | Toggle a node with another node. |
|
| .toggleNode() | Toggle a node with another node. |
|
||||||
| .toggleWrap() | Wraps nodes in another node, or removes an existing wrap. |
|
| .toggleWrap() | Wraps nodes in another node, or removes an existing wrap. |
|
||||||
|
| .unsetAllMarks() | Remove all marks in the current selection. |
|
||||||
| .unsetMark() | Remove a mark in the current selection. |
|
| .unsetMark() | Remove a mark in the current selection. |
|
||||||
| .unsetMarks() | Remove all marks in the current selection. |
|
|
||||||
| .updateNodeAttributes() | Update attributes of a node. |
|
| .updateNodeAttributes() | Update attributes of a node. |
|
||||||
|
|
||||||
### Lists
|
### Lists
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { Command } from '../types'
|
|||||||
/**
|
/**
|
||||||
* Remove all marks in the current selection.
|
* Remove all marks in the current selection.
|
||||||
*/
|
*/
|
||||||
export const unsetMarks = (): Command => ({ tr, state, dispatch }) => {
|
export const unsetAllMarks = (): Command => ({ tr, state, dispatch }) => {
|
||||||
const { selection } = tr
|
const { selection } = tr
|
||||||
const { from, to, empty } = selection
|
const { from, to, empty } = selection
|
||||||
|
|
||||||
@@ -25,8 +25,8 @@ import * as toggleList from '../commands/toggleList'
|
|||||||
import * as toggleMark from '../commands/toggleMark'
|
import * as toggleMark from '../commands/toggleMark'
|
||||||
import * as toggleNode from '../commands/toggleNode'
|
import * as toggleNode from '../commands/toggleNode'
|
||||||
import * as toggleWrap from '../commands/toggleWrap'
|
import * as toggleWrap from '../commands/toggleWrap'
|
||||||
|
import * as unsetAllMarks from '../commands/unsetAllMarks'
|
||||||
import * as unsetMark from '../commands/unsetMark'
|
import * as unsetMark from '../commands/unsetMark'
|
||||||
import * as unsetMarks from '../commands/unsetMarks'
|
|
||||||
import * as updateNodeAttributes from '../commands/updateNodeAttributes'
|
import * as updateNodeAttributes from '../commands/updateNodeAttributes'
|
||||||
import * as wrapIn from '../commands/wrapIn'
|
import * as wrapIn from '../commands/wrapIn'
|
||||||
import * as wrapInList from '../commands/wrapInList'
|
import * as wrapInList from '../commands/wrapInList'
|
||||||
@@ -61,7 +61,7 @@ export const Commands = Extension.create({
|
|||||||
...toggleNode,
|
...toggleNode,
|
||||||
...toggleWrap,
|
...toggleWrap,
|
||||||
...unsetMark,
|
...unsetMark,
|
||||||
...unsetMarks,
|
...unsetAllMarks,
|
||||||
...updateNodeAttributes,
|
...updateNodeAttributes,
|
||||||
...wrapIn,
|
...wrapIn,
|
||||||
...wrapInList,
|
...wrapInList,
|
||||||
|
|||||||
Reference in New Issue
Block a user