From 8a53e1aa4a427430ee67b45dc7cbcddb07556f8b Mon Sep 17 00:00:00 2001 From: chris <kokosias@yahoo.gr> Date: Sat, 28 Jan 2023 15:36:23 +0200 Subject: [PATCH] comment service --- .../src/YjsService/YjsService.js | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/wax-prosemirror-services/src/YjsService/YjsService.js b/wax-prosemirror-services/src/YjsService/YjsService.js index f4372aa5a..2d7a8df76 100644 --- a/wax-prosemirror-services/src/YjsService/YjsService.js +++ b/wax-prosemirror-services/src/YjsService/YjsService.js @@ -1,40 +1,40 @@ 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 { 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); + // // 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('sync', args => { + // console.log({ sync: args }); + // }); - provider.on('status', args => { - console.log({ status: args }); - }); + // provider.on('status', args => { + // console.log({ status: args }); + // }); - provider.on('connection-close', args => { - console.log({ connectioClose: args }); - }); + // provider.on('connection-close', args => { + // console.log({ connectioClose: args }); + // }); - provider.on('connection-error', args => { - console.log({ connectioError: args }); - }); + // provider.on('connection-error', args => { + // console.log({ connectioError: args }); + // }); - const type = ydoc.getXmlFragment('prosemirror'); + // 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()); - } + // this.app.PmPlugins.add('ySyncPlugin', ySyncPlugin(type)); + // this.app.PmPlugins.add('yCursorPlugin', yCursorPlugin(provider.awareness)); + // this.app.PmPlugins.add('yUndoPlugin', yUndoPlugin()); + // } } export default YjsService; -- GitLab