mautic / mautic

Mautic: Open Source Marketing Automation Software.
https://www.mautic.org
Other
7.13k stars 2.57k forks source link

Implement a Rich Text Editor for grapesJS #10289

Closed adiux closed 3 years ago

adiux commented 3 years ago

The refactoring PR (https://github.com/mautic/mautic/pull/10114) removed the legacy Froala editor. Currently, only the default RTE editor from Grapesjs is available.

Once the refactoring is done, and all other UI bugs are fixed, we can then add CKE (or any other RTE).

Related issue: https://github.com/mautic/mautic/issues/10004

adiux commented 3 years ago

I believe we should implement the RTE only in the Mautic Grapesjs plugin. So that there is room for different RTEs to be used in different plugins.

Like this, we don't have the CKE dependency in the preset as well. And Mautic is already loading it.

RCheesley commented 3 years ago

For those not familiar with acronyms: RTE: Rich Text Editor

I agree that it should be possible if someone wanted to, to use a different editor in the GrapesJS builder. I would like if we shipped with CK Editor as standard given that we are using it across the rest of the product.

dennisameling commented 3 years ago

For info: you should be able to run Mautic.ConvertFieldToCkeditor(textarea, {}); (we leveraged that in https://github.com/mautic/grapesjs-preset-mautic/pull/17/files as well) to convert a field into CKEditor. Not sure how it was implemented in the past in the GrapesJS builder.

Unrelated to this issue, but for the future it might be better if we rework that function into something like Mautic.Editors.Ckeditor.ConvertField(textarea, {}) and Mautic.Editors.Default.ConvertField(textarea, {}), to really make those editors more swappable, and allow users to set a default editor they want to use in Mautic.

adiux commented 3 years ago

I just implemented RTE (again), and we still have the same problems as I had last time. Eg. editing the text on a button in MJML mode. image

Looking into it

adiux commented 3 years ago

this fixes the issue to edit buttons: https://github.com/artf/grapesjs/issues/1338

adiux commented 3 years ago

fixes https://github.com/mautic/mautic/issues/10004

github-actions[bot] commented 3 years ago

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If this issue is continuing with the lastest stable version of Mautic, please open a new issue that references this one.