-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there possibility to add shared cursor? #11
Comments
@tedchou12 , added you to thread on the ProseMirror site discussing this. |
Thank you so much. Actually, after spending some time. I have been able to obtain the The part I am stuck is how to add the decorations and display the actual shared cursor on the client: I tried to read through it, but I tried various examples realizing that licit has changed too much so the examples don't work quite well. If anyone can guide me how to create the widget, decorations and how to attach it to the editor view itself, that will be so helpful. Thank you so much again! Ted. |
Some references in Licit to create widget and decorations. Hope this helps!
https://github.com/PierBover/prosemirror-cookbook#decorations Decorations are always owned by a plugin, and ProseMirror’s state is only updated through transactions, not with imperative methods. |
@ashfaq-shamsudeen In the
The above code successfully sends and gets cursor information from server:
But I am stuck in representing that information onto client's editor, the code below results in plugin errors that I am not sure. And I admit I don't quite understand the structure of the plugin despite reading the manual. This is CursorPlaceholderPlugin2.js
|
I am not very knowledgeable in either nodejs, react or es6, actually, is my second time coming across it, but this project is beautiful and is exactly what I wanted with this single addition that I was hoping to make. |
Ted, Thank you, and your input and support is appreciated!! Did you look at https://atlaskit.atlassian.com/packages/editor/editor-core for examples? It is all React based as well. We are hoping in the future to take some of their plugins and port them to licit (the ones without the Atlassian license clause - only a few modules). |
I guess this is why I am so stuck, because it sounds like gibberish to me... 😂, but I do wish to understand. EDITED: About this part, could I ask, if I wish to add the phantom cursor of another client to the current editor, do I need to use the transaction to change the editor? My understanding is that is best just to change the current display of the editor without changing the editor's content, but my knowledge is limited. If anyone could let me know how to make the actual object appear in the editor, then I think it will be the light at the end of the tunnel. I am not sure what I should put into the plugin @MO-Movia Any suggestion is appreciated, in the mean time, I am still digging through examples as mentioned by @ashfaq-shamsudeen . |
Are you saying Are you getting the response from the collab server correctly? What exactly the issue you are trying to resolve here? |
@ashfaq-shamsudeen The collab server gives this information correctly:
I was able to show the cursor: Here is the clean code for:
BUT, currently the LinkTooltipView.update() function is triggered when I move my own cursor, I wish this to be triggered from Thanks. |
This is a one simple enough to follow, I used the sharedcursor by copying from the tooltip: |
Sorry for continuous spamming.
I had spent some time looking into:
https://github.com/yjs/y-prosemirror
Because there aren't any other opensource shared cursor available online.
Seems like it uses websockets and is quite deeply tied into y-websocket's other packages.
I think only the:
modules should be enough?
Sorry, this part is quite difficult to me, I will continue to try though.
The text was updated successfully, but these errors were encountered: