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

Add ProseMirror example #257

Open
hackerwins opened this issue Oct 26, 2021 · 8 comments
Open

Add ProseMirror example #257

hackerwins opened this issue Oct 26, 2021 · 8 comments
Assignees
Labels
enhancement 🌟 New feature or request hard🧑‍🔬 Difficult to deal with or require research

Comments

@hackerwins
Copy link
Member

Description:

Add ProseMirror example.

Currently, we are providing Quill example for the RichText datatype. And Yjs also provides Prosemirror binding examples.

Why:

@hackerwins hackerwins added the enhancement 🌟 New feature or request label Oct 26, 2021
@hackerwins hackerwins added this to v0.2 Oct 29, 2021
@hackerwins hackerwins moved this to Todo in v0.2 Oct 29, 2021
@hackerwins hackerwins removed this from v0.2 Dec 14, 2021
@hackerwins hackerwins added this to v0.3 Dec 14, 2021
@hackerwins hackerwins moved this to Todo in v0.3 Dec 14, 2021
@blurfx
Copy link
Member

blurfx commented Dec 25, 2021

I'll try on it!

@hackerwins
Copy link
Member Author

hackerwins commented Jan 31, 2022

ProseMirror's document is designed based on the tree structure, and it is necessary to record the position of the cursor in the tree as a simple number, so Resolved Positions was introduced.

ResolvedPositions seems to be a value calculated by adding depth from the root.

https://github.com/ProseMirror/prosemirror-model/blob/eef20c8c6dbf841b1d70859df5d59c21b5108a4f/src/resolvedpos.js#L229-L244

When the following text is entered into the editor, the left and right sides of each text will have the following scalar number.

// 3 paragraphs of 6 chars
AB
CD
EF

Screen Shot 2022-02-01 at 1 13 59 AM

Since ProseMirror's document is a tree structure and RichText is designed based on a list, a simple conversion might cause some kind of impedance mismatch.

@blurfx
Copy link
Member

blurfx commented Feb 4, 2022

I think we should think about our document model. Do we need to change it? If so, how should we change it? Can we support both text and tree structures?

@hackerwins
Copy link
Member Author

@blurfx I haven't thought about it yet. Perhaps it would be better to research the Y.js approach.

@mojosoeun
Copy link
Member

Can I take a look this issue as well?

@hackerwins
Copy link
Member Author

hackerwins commented Jul 19, 2023

@mojosoeun Of course. If you check the progress of development yorkie.Tree, refer to the below link.

https://codepair.yorkie.dev/5jnm2b#%23%23%23%206th%20Release%20v0.4.6%3A%20TBD

@SINHJ1
Copy link

SINHJ1 commented Feb 26, 2024

Hello. Do you have a prosemirror example code?

@krapie
Copy link
Member

krapie commented Feb 26, 2024

@SINHJ1 You can check ProseMirror code in below link built with recently introduced yorkie.Tree structure.

https://github.com/yorkie-team/yorkie-js-sdk/blob/main/public/prosemirror.html

Also, I would be nice if you rewrite your question into English.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🌟 New feature or request hard🧑‍🔬 Difficult to deal with or require research
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants