CKEditor 5 integration

Created on 6 April 2022, over 2 years ago
Updated 28 February 2023, almost 2 years ago

Problem/Motivation

Provide a CKEditor 5 button to apply styles in CKEditor.

So no need to redeclare your styles in CKEditor.

Feature request
Status

Fixed

Version

1.0

Component

User interface

Created by

🇫🇷France Grimreaper France 🇫🇷

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇫🇷France Grimreaper France 🇫🇷

    Provide screenshot of current development status.

  • Assigned to pdureau
  • Status changed to Needs review almost 2 years ago
  • 🇫🇷France Grimreaper France 🇫🇷
  • 🇫🇷France pdureau Paris

    Tested with Drupal Core 10.1-dev & ui_suite_bootstrap 4.0.0-alpha3

    1. Add text format /admin/config/content/formats/add with:

    • Text editor: Ckeditor5
    • Headings, Bold, Italic, Source & "UI Styles" as the only editors plugins enabled

    Styles enabled:

    • Border additive
    • Border color
    • Border radius
    • Color
    • Typography

    Feedbacks:

    • Groups are not displayed in the checkboxes list. Is it something nice to add?
    • ⚠️ It would be better to have 2 distinct "UI styles" buttons: one for blocks, one for inlines, because:
      • The contributor experience will be better with shorter and less confusing select lists
      • Site builders will be able to decide which styles can be applied to blocks, and which ones to inlines

    2. Add content: /node/add/album

    It works well, congratulations :)

    Feedbacks:

    • I know there is some issues when inline styles are applied to existing inline element (strong, em..): a span wrapper is added instead. But it is not a big deal IMHO.
    • Preview are working if the themer is adding ckeditor5-stylesheets to info.yml file but side effects in admin pages can be an issue. Is it possible to expose an HTTP GET route which is building a CSS file like that:
      • get the active styles from the CKeditor plugin(s) and get the all the options of those styles
      • parse the active theme CSS files to get every selector starting with options machine name prepended by "." (because they are CSS classes)
      • add the selectors to the response, scoped by .ck-content to avoid side effects
    • ⚠️ Options are mutually exclusive, but this behaviour is not managed here. Example: border-warning is not removed when border-danger is selected.

    The 2 main feedbacks are the one with ⚠️ icon.

  • 🇫🇷France Grimreaper France 🇫🇷

    Hi,

    I think it is possible to address feedbacks from point 1.

    For point 2:
    2.1: not possible with my knowledge of CKE5.
    2.2: I am not sure to understand the route to build the CSS and I think it is out of the scope because too complicated and side effects prone
    2.3: same as 2.1, hum maybe I have an idea but it will require too much refactor.

  • Assigned to Grimreaper
  • 🇫🇷France Grimreaper France 🇫🇷
  • 🇫🇷France Grimreaper France 🇫🇷

    Feedback from point 1 adressed.

    I will try to adress point 2.3, style options mutually exclusive.

  • Assigned to pdureau
  • 🇫🇷France Grimreaper France 🇫🇷
  • 🇫🇷France Grimreaper France 🇫🇷

    Point 2.3 done yesterday.

  • Assigned to Grimreaper
  • 🇫🇷France Grimreaper France 🇫🇷
  • 🇫🇷France Grimreaper France 🇫🇷

    Todo:
    Do not add new method to the interface, convert into trait.

  • 🇫🇷France Grimreaper France 🇫🇷
  • Issue was unassigned.
  • Status changed to Fixed almost 2 years ago
    • Grimreaper committed 1980b6b9 on 8.x-1.x
      Issue #3273646 by Grimreaper, pdureau, Sharique: CKEditor 5 integration
      
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024