demos: remove old emoji demo
This commit is contained in:
@@ -1,15 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8"/>
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="app"></div>
|
|
||||||
<script type="module">
|
|
||||||
import setup from '../../../../setup/vue.ts'
|
|
||||||
import source from '@source'
|
|
||||||
setup('Nodes/Emoji', source)
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
context('/src/Nodes/Paragraph/Vue/', () => {
|
|
||||||
before(() => {
|
|
||||||
cy.visit('/src/Nodes/Paragraph/Vue/')
|
|
||||||
})
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
cy.get('.ProseMirror').then(([{ editor }]) => {
|
|
||||||
editor.commands.clearContent()
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
it('should parse paragraphs correctly', () => {
|
|
||||||
cy.get('.ProseMirror').then(([{ editor }]) => {
|
|
||||||
editor.commands.setContent('<p>Example Text</p>')
|
|
||||||
expect(editor.getHTML()).to.eq('<p>Example Text</p>')
|
|
||||||
|
|
||||||
editor.commands.setContent('<p><x-unknown>Example Text</x-unknown></p>')
|
|
||||||
expect(editor.getHTML()).to.eq('<p>Example Text</p>')
|
|
||||||
|
|
||||||
editor.commands.setContent('<p style="display: block;">Example Text</p>')
|
|
||||||
expect(editor.getHTML()).to.eq('<p>Example Text</p>')
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
it('text should be wrapped in a paragraph by default', () => {
|
|
||||||
cy.get('.ProseMirror')
|
|
||||||
.type('Example Text')
|
|
||||||
.find('p')
|
|
||||||
.should('contain', 'Example Text')
|
|
||||||
})
|
|
||||||
|
|
||||||
it('enter should make a new paragraph', () => {
|
|
||||||
cy.get('.ProseMirror')
|
|
||||||
.type('First Paragraph{enter}Second Paragraph')
|
|
||||||
.find('p')
|
|
||||||
.should('have.length', 2)
|
|
||||||
|
|
||||||
cy.get('.ProseMirror')
|
|
||||||
.find('p:first')
|
|
||||||
.should('contain', 'First Paragraph')
|
|
||||||
|
|
||||||
cy.get('.ProseMirror')
|
|
||||||
.find('p:nth-child(2)')
|
|
||||||
.should('contain', 'Second Paragraph')
|
|
||||||
})
|
|
||||||
|
|
||||||
it('backspace should remove the second paragraph', () => {
|
|
||||||
cy.get('.ProseMirror')
|
|
||||||
.type('{enter}')
|
|
||||||
.find('p')
|
|
||||||
.should('have.length', 2)
|
|
||||||
|
|
||||||
cy.get('.ProseMirror')
|
|
||||||
.type('{backspace}')
|
|
||||||
.find('p')
|
|
||||||
.should('have.length', 1)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div v-if="editor">
|
|
||||||
<button @click="editor.chain().focus().insertContent('✨').run()">
|
|
||||||
✨
|
|
||||||
</button>
|
|
||||||
<button @click="editor.chain().focus().insertContent('😅').run()">
|
|
||||||
😅
|
|
||||||
</button>
|
|
||||||
<button @click="editor.chain().focus().insertContent('🎉').run()">
|
|
||||||
🎉
|
|
||||||
</button>
|
|
||||||
<button @click="editor.chain().focus().insertContent('💖').run()">
|
|
||||||
💖
|
|
||||||
</button>
|
|
||||||
<button @click="editor.chain().focus().insertContent('👀').run()">
|
|
||||||
👀
|
|
||||||
</button>
|
|
||||||
<button @click="editor.chain().focus().insertContent('👍️').run()">
|
|
||||||
👍️
|
|
||||||
</button>
|
|
||||||
<editor-content :editor="editor" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { Editor, EditorContent } from '@tiptap/vue-3'
|
|
||||||
import Document from '@tiptap/extension-document'
|
|
||||||
import Paragraph from '@tiptap/extension-paragraph'
|
|
||||||
import Text from '@tiptap/extension-text'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
EditorContent,
|
|
||||||
},
|
|
||||||
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
editor: null,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
mounted() {
|
|
||||||
this.editor = new Editor({
|
|
||||||
extensions: [
|
|
||||||
Document,
|
|
||||||
Paragraph,
|
|
||||||
Text,
|
|
||||||
],
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
beforeUnmount() {
|
|
||||||
this.editor.destroy()
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
/* Basic editor styles */
|
|
||||||
.ProseMirror {
|
|
||||||
> * + * {
|
|
||||||
margin-top: 0.75em;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
Reference in New Issue
Block a user