RaythaHQ / raytha

Raytha is a powerful CMS with an easy-to-use interface and fast performance. It offers custom content types, a template engine, and various access controls. It supports multiple storage providers and an automatically generated REST API. Upgrade your development workflow with Raytha.
MIT License
163 stars 31 forks source link

Replace TinyMCE with TipTap #196

Open apexdodge opened 4 months ago

apexdodge commented 4 months ago

TinyMCE editor was MIT for a brief moment, and is not anymore. It is still open source, but I would like every single dependency to be MIT or equivalent.

I found this: https://github.com/ueberdosis/tiptap which is very popular, maintained, and robust. The downside is that there is no UI for it, so we have to design our own. But I think this may be the best for the long term.

apexdodge commented 2 months ago

This task will be the primary objective for milestone 1.4.0.

apexdodge commented 2 months ago

I have evaluated dozens of HTML WYSIWYG editors and its quite something.

Obviously the two best are TinyMCE and CKEditor. Trix is MIT but disappointing because it lacks the true flexibility we need.

TinyMCE went MIT license for a brief period but changed course and is now no longer MIT licensed for future versions. CKEditor is not open source friendly either.

However, this looks fantastic: https://github.com/ueberdosis/tiptap and is MIT licensed. The catch is that it is headless.

The task:

Our current long text field: https://github.com/RaythaHQ/raytha/blob/main/src/Raytha.Web/wwwroot/raytha_admin/js/src/controllers/contentitems/longtext_controller.js Our current wysiwig field: https://github.com/RaythaHQ/raytha/blob/main/src/Raytha.Web/wwwroot/raytha_admin/js/src/controllers/contentitems/wysiwyg_controller.js

1) Build the UI on top of TipTap using bootstrap 5 from our current admin template.

I am fine with v1's UI looking somewhat rudimentary with just buttons like this: https://tiptap.dev/docs/examples/basics/default-text-editor but if able to have more toolbar style similar to this: https://www.tiny.cloud/docs/tinymce/latest/full-featured-premium-demo/ all the better.

2) The toolbar/buttons should be floating / fixed so it doesn't scroll away

3) Most of the extensions are free: https://tiptap.dev/docs/editor/extensions/overview.

Make sure to enable:

Marks

Nodes

Functionality

4) We need 3 custom extensions to be built

Note in the future we may enhance these extensions to allow to pick from a media gallery of already uploaded items.

6) Update long text field.

The long text field should no longer be a formatted field, just a