Skip to content

yjs/y-prosemirror

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

y-prosemirror

ProseMirror Binding for Yjs - Demo

This binding maps a YXmlFragment to a ProseMirror model.

Features

  • Shared Cursors
  • Successfully recovers when concurrents edit result in an invalid document schema

Example

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.