feat: add insertContent() command, deprecate insertText(), insertHTML() and insertNode()
This commit is contained in:
@@ -6,7 +6,7 @@ context('/demos/Guide/Content/ReadOnly', () => {
|
||||
it('should be read-only', () => {
|
||||
cy.get('.ProseMirror').then(([{ editor }]) => {
|
||||
editor.setEditable(false)
|
||||
editor.commands.insertText('Edited: ')
|
||||
editor.commands.insertContent('Edited: ')
|
||||
|
||||
cy.get('.ProseMirror p:first').should('not.contain', 'Edited: ')
|
||||
})
|
||||
@@ -15,7 +15,7 @@ context('/demos/Guide/Content/ReadOnly', () => {
|
||||
it('should be editable', () => {
|
||||
cy.get('.ProseMirror').then(([{ editor }]) => {
|
||||
editor.setEditable(true)
|
||||
editor.commands.insertText('Edited: ')
|
||||
editor.commands.insertContent('Edited: ')
|
||||
|
||||
cy.get('.ProseMirror p:first').should('contain', 'Edited: ')
|
||||
})
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
<template>
|
||||
<div v-if="editor">
|
||||
<button @click="editor.chain().focus(). insertText('✨').run()">
|
||||
<button @click="editor.chain().focus().insertContent('✨').run()">
|
||||
✨
|
||||
</button>
|
||||
<button @click="editor.chain().focus(). insertText('😅').run()">
|
||||
<button @click="editor.chain().focus().insertContent('😅').run()">
|
||||
😅
|
||||
</button>
|
||||
<button @click="editor.chain().focus(). insertText('🎉').run()">
|
||||
<button @click="editor.chain().focus().insertContent('🎉').run()">
|
||||
🎉
|
||||
</button>
|
||||
<button @click="editor.chain().focus(). insertText('💖').run()">
|
||||
<button @click="editor.chain().focus().insertContent('💖').run()">
|
||||
💖
|
||||
</button>
|
||||
<button @click="editor.chain().focus(). insertText('👀').run()">
|
||||
<button @click="editor.chain().focus().insertContent('👀').run()">
|
||||
👀
|
||||
</button>
|
||||
<button @click="editor.chain().focus(). insertText('👍️').run()">
|
||||
<button @click="editor.chain().focus().insertContent('👍️').run()">
|
||||
👍️
|
||||
</button>
|
||||
<editor-content :editor="editor" />
|
||||
|
||||
Reference in New Issue
Block a user