CDLUC3 / dmsp_frontend_prototype

Repo to test out new NextJS framework
MIT License
0 stars 0 forks source link

Select a rich text editor #6

Open briri opened 6 months ago

briri commented 6 months ago

We need to review, select and then build a component to support a rich text editor.

The editor should support all of the current functionality offered within the DMPTool:

One of the major new features we want to add is inline commenting. Similar to the functionality in Google docs

Some options might be Draft, Quill or Trix ... there may be others. See this Quill article where it compares itself to others in the space.

andrewebdev commented 1 week ago

Draftail

While draft.js is a good text editor, it’s fairly low level. It mostly provides low-level apis for creating a good text editor.

Draftail is an opinionated editor built on top of the draft editor. Draftail provide many improvements over using draft.js by itself.

A couple of features that Draftail provide above draft.js.

The most important benefit is that draftail provide additional API’s for things like creating plugins, and managing controls on the editor toolbar.

Potential Issues

Definite Issues

References

Trix

Trix is a well established editor that uses modern browser features. a great benefit of Trix is that it uses current web standards (like web components), which means it “behaves” like any other standard HTML tag, with few surprises.

Some Benefits

Potential Issues

Definite Issues

References

Slate

I briefly reviewed Slate as an option. Although it looks promising, the project is still in Beta and the underlying API’s are subject to change.

For this reason I don’t think Slate is a viable option for DMPTool.

Remirror

ReMirror is based on Prosemirror. It wraps ProseMirror inside react components, but also provides a wide range of extra features and plugins.

ProseMirror Benefits

ReMirror Specific Benefits

References

Quill

Benefits

Potential Issues

References

andrewebdev commented 1 week ago

I've narrowd down the potential editors to ReMirror or Quill. My next steps will be to test the 2 editors on the current styleguide to get a better idea of the functionality, developer experience, UX and potential accessibility issues.

briri commented 1 week ago

Thanks for the thorough analysis @andrewebdev. Can you elaborate on the "Support for domain specific content" that ReMirror has? Does that mean for example that it provides a way for the user to quickly reference or type the name of another contributor on the project, or perhaps a research output that they defined at the project level?

andrewebdev commented 1 week ago

Thanks for the thorough analysis @andrewebdev. Can you elaborate on the "Support for domain specific content" that ReMirror has? Does that mean for example that it provides a way for the user to quickly reference or type the name of another contributor on the project, or perhaps a research output that they defined at the project level?

Kind of, yes. It allows us to create custom "entities" that relates to something in DMPTool, like a reference to a contributor etc. From a cursory look at the code for that, it seemed quite simple to add, and also provide an easy way to add a custom look/rendering for this component inside the text editor itself. This is nice since it will show user where such elements are.

Here is an example: https://prosemirror.net/examples/dino/

That example is for Prosemirror, but Remirror uses it under the hood, so those same API's should be valid.

briri commented 1 week ago

That is very cool. I like the dinosaurs 😆 but I think having the ability to provide users with shortcuts to reference info they've already defined in their project might be very useful

andrewebdev commented 1 week ago

This is also related to the custom schema and domain specific elements: https://prosemirror.net/examples/schema/

jupiter007 commented 1 week ago

Thanks @andrewebdev.

Hopefully ReMirror or Quill has the capability to add inline commenting. My understanding is that all the above functionality that Brian listed in the ticket's description is currently free from TinyMCE and working for us. I believe the main reason we started looking for a different editor was to add inline commenting because TinyMCE charges a fortune to use that plugin.

andrewebdev commented 1 week ago

Thanks @andrewebdev.

Hopefully ReMirror or Quill has the capability to add inline commenting. My understanding is that all the above functionality that Brian listed in the ticket's description is currently free from TinyMCE and working for us. I believe the main reason we started looking for a different editor was to add inline commenting because TinyMCE charges a fortune to use that plugin.

I'll be sure to test this. I suspect it neither have that as a feature out-of-the-box, but both Quill and ReMirror are easy enough to extend, and if we cannot find an existing plugin, I'd be happy to create one ;)

briri commented 20 hours ago

Andre will push a side-by-side comparison of ReMirror and TinyMCE so that we can evaluate them. The commenting plugin has only been developed for ReMirror. Adding comments to TinyMCE would be more time-consuming.