Initial example of Ace Editor binding for Yjs v13.4+
Huge thanks to Federico Lorenzi of room.sh for insight on binding Ace with an early 13.0 version of Yjs and Kevin Jahns for the powerful Yjs project!
This binding maps a Y.Text to an Ace instance. It supports syncing of cursors and selection.
Built upon y-quill, with tests currently disabled.
import * as Y from 'yjs'
import { WebrtcProvider } from 'y-webrtc'
import { AceBinding } from 'y-ace'
import Ace from 'ace-builds/src-noconflict/ace'
window.addEventListener('load', () => {
const ydoc = new Y.Doc()
const provider = new WebrtcProvider('yjs-ace', ydoc)
const type = ydoc.getText('ace')
// init Ace
var editor = Ace.edit('editor')
// init binding
const binding = new AceBinding(type, editor, provider.awareness)
Clone/download this repo and run npm install
followed by npm run demo
for working demo.
The MIT License © Kevin Jahns