diff --git a/docs/package.json b/docs/package.json index f6b452d6..d456261e 100644 --- a/docs/package.json +++ b/docs/package.json @@ -28,6 +28,7 @@ "vue-github-button": "^1.1.2", "vue-live": "^1.16.0", "y-indexeddb": "^9.0.6", + "y-prosemirror": "^1.0.5", "y-webrtc": "^10.1.7", "y-websocket": "^1.3.8", "yjs": "^13.4.7" diff --git a/docs/src/demos/Examples/MultipleEditors/index.vue b/docs/src/demos/Examples/MultipleEditors/index.vue index 33c6d230..672a5a35 100644 --- a/docs/src/demos/Examples/MultipleEditors/index.vue +++ b/docs/src/demos/Examples/MultipleEditors/index.vue @@ -18,6 +18,12 @@
{{ json }}
+ No matter what you do, this’ll be a single paragraph.', }) this.tasks = new Editor({ @@ -83,10 +89,17 @@ export default { TaskList, CustomTaskItem, Collaboration.configure({ - document: ydoc, + document: this.ydoc, field: 'tasks', }), ], + content: ` +
+ This can be lengthy text. +
+ `, }) }, + computed: { + json() { + return { + title: yDocToProsemirrorJSON(this.ydoc, 'title'), + tasks: yDocToProsemirrorJSON(this.ydoc, 'tasks'), + description: yDocToProsemirrorJSON(this.ydoc, 'description'), + } + }, + }, + beforeDestroy() { this.title.destroy() this.tasks.destroy() @@ -150,5 +178,23 @@ export default { &--title { font-size: 1.6rem; } + + &--json { + background: #0D0D0D; + color: #FFF; + font-size: 0.8rem; + } +} + +pre { + font-family: 'JetBrainsMono', monospace; + padding: 0.75rem 1rem; + border-radius: 0.5rem; + + code { + color: inherit; + background: none; + font-size: 0.8rem; + } } diff --git a/docs/src/docPages/examples/multiple-editors.md b/docs/src/docPages/examples/multiple-editors.md index ccfe1c6e..da61e913 100644 --- a/docs/src/docPages/examples/multiple-editors.md +++ b/docs/src/docPages/examples/multiple-editors.md @@ -1,9 +1,5 @@ # Multiple editors -The following examples has three different instances of tiptap. The first is configured to have a single paragraph of text, the second to have a task list and the third to have text. All of them are stored in a single Y.js document, which is synced with other users. - -:::warning Shared Document -Be nice! The content of this editor is shared with other users from the Internet. -::: +The following example has three different instances of tiptap. The first is configured to have a single paragraph of text, the second to have a task list and the third to have text. All of them are stored in a single Y.js document, which can be synced with other users.