add basic yjs extension with baked in web rtc support (wip)

This commit is contained in:
Hans Pagel
2020-09-25 23:22:21 +02:00
parent 36f95a700c
commit 4052165498
7 changed files with 221 additions and 8 deletions

View File

@@ -0,0 +1,5 @@
context('/examples/collaboration', () => {
before(() => {
cy.visit('/examples/collaboration')
})
})

View File

@@ -0,0 +1,46 @@
<template>
<editor-content :editor="editor" />
</template>
<script>
import { Editor, EditorContent } from '@tiptap/vue-starter-kit'
import Document from '@tiptap/extension-document'
import Paragraph from '@tiptap/extension-paragraph'
import Text from '@tiptap/extension-text'
import Yjs from '@tiptap/extension-yjs'
export default {
components: {
EditorContent,
},
data() {
return {
editor: null,
}
},
mounted() {
this.editor = new Editor({
content: `
<p>
This is a radically reduced version of tiptap. It has only support for a document, paragraphs and text. Thats it. Its probably too much for real minimalists though.
</p>
<p>
The paragraph extension is not literally required, but you need at least one node. That node can be something different, for example to render a task list and only that task list.
</p>
`,
extensions: [
Document(),
Paragraph(),
Text(),
Yjs(),
],
})
},
beforeDestroy() {
this.editor.destroy()
},
}
</script>