diff --git a/editors/demo/src/Editors.js b/editors/demo/src/Editors.js index 9e14f6ac6c5dfb292ff737394c05d66b8ce35c76..2786bc7d4b357607b9f52ef6876cfcc3afbe3db2 100644 --- a/editors/demo/src/Editors.js +++ b/editors/demo/src/Editors.js @@ -93,7 +93,7 @@ const Editors = () => { isActive={project === 'editoria'} onClick={() => setProject('editoria')} > - Editoria + Ketida </ProjectButton> <ProjectButton isActive={project === 'oen'} diff --git a/wax-prosemirror-services/src/YjsService/YjsService.js b/wax-prosemirror-services/src/YjsService/YjsService.js index fcad9746d8380ee5defca1f88686aa6daf1455ce..b15284f4815d5ab1684036d0cc67ab3efa1de408 100644 --- a/wax-prosemirror-services/src/YjsService/YjsService.js +++ b/wax-prosemirror-services/src/YjsService/YjsService.js @@ -1,32 +1,32 @@ import { Service } from 'wax-prosemirror-core'; -// import { yCursorPlugin, ySyncPlugin, yUndoPlugin } from 'y-prosemirror'; -// import { WebsocketProvider } from 'y-websocket'; -// import * as Y from 'yjs'; -// import './yjs.css'; +import { yCursorPlugin, ySyncPlugin, yUndoPlugin } from 'y-prosemirror'; +import { WebsocketProvider } from 'y-websocket'; +import * as Y from 'yjs'; +import './yjs.css'; class YjsService extends Service { name = 'YjsService'; boot() { - // const { connectionUrl, docIdentifier } = this.config; - // const ydoc = new Y.Doc(); - // // const provider = new WebsocketProvider('wss://demos.yjs.dev', 'prosemirror-demo', ydoc) - // const provider = new WebsocketProvider(connectionUrl, docIdentifier, ydoc); - // provider.on('sync', args => { - // console.log({ sync: args }); - // }); - // provider.on('status', args => { - // console.log({ status: args }); - // }); - // provider.on('connection-close', args => { - // console.log({ connectioClose: args }); - // }); - // provider.on('connection-error', args => { - // console.log({ connectioError: args }); - // }); - // const type = ydoc.getXmlFragment('prosemirror'); - // this.app.PmPlugins.add('ySyncPlugin', ySyncPlugin(type)); - // this.app.PmPlugins.add('yCursorPlugin', yCursorPlugin(provider.awareness)); - // this.app.PmPlugins.add('yUndoPlugin', yUndoPlugin()); + const { connectionUrl, docIdentifier } = this.config; + const ydoc = new Y.Doc(); + // const provider = new WebsocketProvider('wss://demos.yjs.dev', 'prosemirror-demo', ydoc) + const provider = new WebsocketProvider(connectionUrl, docIdentifier, ydoc); + provider.on('sync', args => { + console.log({ sync: args }); + }); + provider.on('status', args => { + console.log({ status: args }); + }); + provider.on('connection-close', args => { + console.log({ connectioClose: args }); + }); + provider.on('connection-error', args => { + console.log({ connectioError: args }); + }); + const type = ydoc.getXmlFragment('prosemirror'); + this.app.PmPlugins.add('ySyncPlugin', ySyncPlugin(type)); + this.app.PmPlugins.add('yCursorPlugin', yCursorPlugin(provider.awareness)); + this.app.PmPlugins.add('yUndoPlugin', yUndoPlugin()); } }