ProseMirror Binding for Yjs - Demo
This binding maps a YXmlFragment to a ProseMirror model.
- Shared Cursors
- Successfully recovers when concurrents edit result in an invalid document schema
import { prosemirrorPlugin, cursorPlugin } from 'y-prosemirror'
..
const type = ydocument.get('prosemirror', Y.XmlFragment)
const prosemirrorView = new EditorView(document.querySelector('#editor'), {
state: EditorState.create({
schema,
plugins: exampleSetup({ schema }).concat([prosemirrorPlugin(type), cursorPlugin])
})
})
Also look here for a working example.