Skip to content
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

feat: Adds ability to use ContainerID to persist prosemirror document to. #20

Merged
merged 5 commits into from
Oct 31, 2024

Conversation

raymonddaikon
Copy link
Contributor

@raymonddaikon raymonddaikon commented Oct 31, 2024

This adds an additional prop to the SyncPlugin so that users can specify a ContainerID to write the prosemirror document to instead of doc.getMap(ROOT_DOC_KEY). This way users can initialize their LoroDoc and write to a nested container. Also updated the storybook example to use the new export and added a Broadcast Channel example so if you have two tabs side by side, contents will sync.

@zxch3n
Copy link
Member

zxch3n commented Oct 31, 2024

Thanks! I made a few fixes on this branch. Please allow me to push to your branch (the use of commit's origin should not be changed).

(I should set up a prettier/eslint config for this. It's too hard to find the difference.)

@raymonddaikon
Copy link
Contributor Author

Sure thing! Forgot to mention I also added the ability to provide a user object that renders the awareness cursor with a custom name and color. And my bad for the formatting changes, I originally wrote this in my own project and copied it over to this fork.

@zxch3n
Copy link
Member

zxch3n commented Oct 31, 2024

I saw that! Thanks. If it's too troublesome to set the permission, you can merge the branch called fix-pr-20 of this repo directly

@zxch3n zxch3n merged commit 224510f into loro-dev:main Oct 31, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants