canvas-editor icon indicating copy to clipboard operation
canvas-editor copied to clipboard

多人协作

Open zhaoxuanHome opened this issue 1 year ago • 5 comments

What problem does this feature solve?

编辑器能够增加多人协作的功能吗?

What does the proposed API look like?

编辑器能够增加多人协作的功能吗?

zhaoxuanHome avatar Oct 17 '23 03:10 zhaoxuanHome

有在尝试,如: CRDT ,可以等后续更新

Hufe921 avatar Oct 17 '23 12:10 Hufe921

Hi, I wanted to make an observation, to make the websocket server work it was necessary to change this: "CRDT": "HOST=localhost PORT=1234 node ./node_modules/y-websocket/bin/server.js npx y-websocket" For this: "CRDT": "npx y-websocket-server" Inside package.json

I don't know if it is in all cases, but for me it worked this way.

douglasmatheus avatar Oct 19 '23 14:10 douglasmatheus

Have you implemented the feature of multi person collaboration in the canvas-editor project? Is this the branch? 【feature/CRDT】

zhaoxuanHome avatar Oct 20 '23 03:10 zhaoxuanHome

Hey @Hufe921 , I did some tests and implemented the multi-cursor functionality, where I would have the cursor that is the editor and it follows the rules that are in place today, being manipulated through keyboard and mouse events, etc.

And the rest are not handled by events but through api. Extra cursors can be registered and removed.

This functionality is interesting because it is possible for anyone who uses the editor to implement data synchronization with websocket or in whatever way they prefer, and work with the API for various cursors in the editor according to the users.

What do you think of this line of thought for this scenario? Would you be interested in a PR to review if you find it interesting?

douglasmatheus avatar Oct 21 '23 13:10 douglasmatheus

Have you implemented the feature of multi person collaboration in the canvas-editor project? Is this the branch? 【feature/CRDT】

Yes, in this branch you can get a multi-collaboration implementation. As I mentioned in the comment above, in my case I needed to change the websocket configuration in package.json to get started.

But it's a simple implementation, it doesn't show who is editing, which parts are being edited, and when someone changes something there is a refresh in the editor, as if they were reloading the page.

But you can now get an idea of how to work with this option.

douglasmatheus avatar Oct 21 '23 13:10 douglasmatheus