From 14053d92d84edc6a1ebe47f78bcbffa01dd1e4f6 Mon Sep 17 00:00:00 2001 From: chris <kokosias@yahoo.gr> Date: Sun, 29 Jan 2023 02:39:43 +0200 Subject: [PATCH] rename to ketida --- editors/demo/src/Editors.js | 2 +- .../src/YjsService/YjsService.js | 48 +++++++++---------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/editors/demo/src/Editors.js b/editors/demo/src/Editors.js index 9e14f6ac6..2786bc7d4 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 fcad9746d..b15284f48 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()); } } -- GitLab