Cusrsors with multiple prose mirror views in one yjs doc and awearness #19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a optional parameter for the cursor plugin.
First I wanted to make an id of the _item.id to combine the client and the id. But when I checked it on a yXmlFragment on the root of the yDoc it seems that the _item was null. Maybe is missed something to get a unique id for each yXmlFragments.
The first implementation I tried all the cursors would be saved in a different key name in the awareness state. After the first test that was not a great solution. If you have a lot of prose mirror views there will also be a lot of keys in that awareness state. I kept this in when somebody wants to change the cursor state name.
After this I added an id in the cursor info and only rendered the cursor when the id is correct for that prose mirror view. I will also open a pr in the yjs demo's where I changed the prose mirror example to 2 prose mirror views with cursors. That was also the case I used to test this.