RocketChat / RC4Conferences

A set of scalable components for communities to build, manage, and run virtual conferences of any size.
https://conf.rceng.shop/conferences/c/1
24 stars 38 forks source link

[TODO] Create a new rich text editor component #105

Open Dnouv opened 1 year ago

Dnouv commented 1 year ago

Create a new form input component that allows the user to do some formatting such as "Bold", "Italic", "Lists", and "Links". However, please note in the backend, we only store the data in html format, so this component should export the formatted input as simple html. Take care of data sanitization since on the client side we are using dangerouslysetInnerHtml

Preview of the editor component: image

Please feel free to comment and ask questions, if any. Thank you!

Aashray446 commented 1 year ago

@Dnouv This is a component that I need to use for organization information, Should I create it? Or Go with the normal text area component.

Aashray446 commented 1 year ago

Hey @Dnouv, I researched this and thought about going for any of the below two text editors (WYSIWYG):

Each of them has its own advantages and disadvantages,

I am open to your suggestion :-) Thank you

Aashray446 commented 1 year ago

@Dnouv, I have researched a lot about the component. As we later want to display the content of text editor to HTML, There is a package named SLATE, It is the most lightweight yet powerful because of its modular approach. This can be best for our use case.

Here is the current design and a working model screenshot of the text editor component for our app. Screenshot from 2023-02-05 18-51-49

My Approach

I am open to your suggestions and design improvements, I Hope I explained my approach well. Thanks :-)

Dnouv commented 1 year ago

Hey @Aashray446

Thank you so much for researching more about this. I will get back a satisfying answer for you, so I would request you to wait two more days; please feel free to ping me on Open Server if I forgot to reply back (well, the chances of this are slim).

Thank you!

Aashray446 commented 1 year ago

pr-12 Hey @Dnouv, check out this text editor made with the help of the lexical package I made a component called Editor which is plug-and-play and requires just three parameters i.e onChange, value, and placeholder

I will be drafting a PR soon, till then you can suggest any UI changes if you want?

Thank you :-)