Problem/Motivation

Don't make JS devs write PHP if they don't have to. YAML is more widespread.

Proposed resolution

Add YamlDiscovery as an additional way to declare plugin definitions.

Issue fork ckeditor5-3195965

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

gabesullice created an issue. See original summary.

zrpnr made their first commit to this issue’s fork.

zrpnr’s picture

Rebased this after adding the image plugins in #3194111: Support inline image upload
Moved some of the code for getDefinitions out of the Editor plugin so that a plugin class can override how those definitions are returned. ImageUpload is split out into its own plugin now and just provides info for that feature.
The toolbar is working, text only still but toolbar items can be selected and sorted here.

Updated the test module to use the yml plugin and the toolbar settings.

tim.plunkett made their first commit to this issue’s fork.

tim.plunkett’s picture

Discussed with Peter and decided to keep annotations, and just allow YAML in addition. This brings it inline with other core plugin systems

zrpnr’s picture

Issue summary: View changes
Status: Active » Needs review

This is a big refactor to add yml as an optional way of defining the ckeditor5 config each Drupal plugin provides.
This should greatly simplify adding a contrib module, since it now needs to just declare the js classes that are needed for the functionality, as well as the available toolbar items and any additional config necessary.

A php class can still be written for a plugin that depends on editor settings, so it may conditionally add additional values or properties that are dynamically set by Drupal.

This MR also adds the beginnings of the toolbar config, currently just a text field but it allows a user to select which toolbar buttons should be shown and in what order.

  • zrpnr committed 109f5c6 on 1.0.x authored by gabesullice
    Issue #3195965: Register CKEditor 5 plugins via YAML definitions instead...
zrpnr’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.