Problem/Motivation

Plugin link : https://ckeditor.com/docs/ckeditor5/latest/features/show-blocks.html

New in CKEditor 5 38.1.0 — see https://github.com/ckeditor/ckeditor5/releases/tag/v38.1.0

CKEditor 4
Show block
CKEditor 5's equivalent since 38.1.0

Steps to reproduce

N/A

Proposed resolution

  1. Add ckeditor5-show-blocks
  2. Update the upgrade path at \Drupal\ckeditor5\Plugin\CKEditor4To5Upgrade\Core

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CKEditor 5 now has an optional "Show Blocks" toolbar item.

Issue fork drupal-3378890

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

pmkanse created an issue. See original summary.

cilefen’s picture

Title: CKEditor 5 dont have @ckeditor/ckeditor5-show-blocks plugin » Add the @ckeditor/ckeditor5-show-blocks plugin
Version: 10.1.x-dev » 11.x-dev
Issue tags: -ckeditor5
vipul tulse’s picture

Currently created contrib module to support
https://www.drupal.org/project/ckeditor5_show_block

wim leers’s picture

Issue summary: View changes
Related issues: +#3370989: Update CKEditor 5 to 38.1.0

wim leers’s picture

Issue summary: View changes
StatusFileSize
new445.43 KB
wim leers’s picture

I’ve been trying for 30 mins now and am failing HARD at getting it to be installed into Drupal 😳

git clone https://git.drupalcode.org/project/drupal.git
cd drupal/core
yarn add @ckeditor/ckeditor5-show-blocks@38.1.0
yarn build

If you then do a git diff you’ll see that nothing was added to core/assets/vendor 🤯😱

wim leers’s picture

Title: Add the @ckeditor/ckeditor5-show-blocks plugin » [upstream] Add the @ckeditor/ckeditor5-show-blocks plugin
Status: Active » Postponed
Issue tags: +Needs upstream bugfix

Escalated to CKEditor 5 team, and:

Witek Socha
2 hours ago
:open_mouth:

Witek Socha
2 hours ago
shoot, there’s no DLL build there :exploding_head: https://www.npmjs.com/package/@ckeditor/ckeditor5-show-blocks?activeTab=...

Witek Socha
2 hours ago
escalating…

So this is blocked on an upstream fix 😇

wim leers’s picture

A patch release for version 39 of CKEditor 5 will ship later this week, and it'll provide the required DLL build 👍

wim leers’s picture

Status: Postponed » Active
Related issues: +#3380637: Update CKEditor 5 to 39.0.1

Fixed in 39.0.1, which is in core since #3380637: Update CKEditor 5 to 39.0.1! 👍

wim leers’s picture

Title: [upstream] Add the @ckeditor/ckeditor5-show-blocks plugin » Add the @ckeditor/ckeditor5-show-blocks plugin that was added in CKEditor 5 38
Status: Active » Needs review
Issue tags: -Needs upstream bugfix

This is ready for review!

wim leers’s picture

Issue summary: View changes
wim leers’s picture

Issue tags: +Needs manual testing

Green! 😊

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs change record

Tested this on 11.x

It seems to pick up all the regular tags, ul, ol, p, a, etc. But if I use a media embed or anything nothing appears. Know that probably wasn't on the list upstream but could the plugin we expanded for drupal?

If not don't think it's the end of the world.

Tagging for CR for the new plugin option though.

wim leers’s picture

Very interesting 🧐

Per https://ckeditor.com/docs/ckeditor5/latest/features/show-blocks.html#kno...

The show blocks feature does not support widgets, yet. It means it will currently not show block outlines e.g. for images or tables.

— Drupal Media is an example of that.

Asked the CKEditor 5 team about this 🤓

Could you perhaps post a screenshot of what it looks like when using Drupal Media as well as a custom HTML tag such as foobar, as well as a non-custom HTML tag that is not natively supported such as <hr>? 🙏

smustgrave’s picture

StatusFileSize
new1.8 MB

Sure

screenshot

qusai taha’s picture

StatusFileSize
new67.55 KB

Re-roll for drupal 9.5.x

qusai taha’s picture

StatusFileSize
new5.77 KB

Re-roll patch for Drupal 9.5.x to be working with https://www.drupal.org/project/drupal/issues/3362414

qusai taha’s picture

StatusFileSize
new67.55 KB
mikesimmons’s picture

#20 fails to apply to Drupal 10.1.3.

wim leers’s picture

Assigned: Unassigned » wim leers
Status: Needs work » Postponed

@mikesimmons: The MR still applies cleanly to Drupal 11.x.

The patches in #18, #19 and #20 are only provided to get this on earlier Drupal versions.


Still awaiting response to #16.

mikesimmons’s picture

StatusFileSize
new76.81 KB

Thanks for pointing out the MR, @wim-leers.
Here a patch for Drupal 10.1.3.

wim leers’s picture

Title: Add the @ckeditor/ckeditor5-show-blocks plugin that was added in CKEditor 5 38 » Add the "Show Blocks" functionality that existed in CKEditor 4 and was added to CKEditor 5 38.1.0
Assigned: wim leers » Unassigned
Status: Postponed » Needs review
Issue tags: -Needs manual testing, -Needs change record

I wrote in #16:

Asked the CKEditor 5 team about this 🤓

They just created an issue for this to measure community interest in this: https://github.com/ckeditor/ckeditor5/issues/14869

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

Retested and still seeing the outline around ul, ol, p, a, etc. Assuming if the media fix happens it will be upstream so nothing to do here.

wim leers’s picture

Correct — there shouldn't be anything needed on our end to support widgets like DrupalMedia's 👍

  • lauriii committed 116c87e4 on 11.x
    Issue #3378890 by Wim Leers, mikesimmons, smustgrave, pmkanse,...
lauriii’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +10.2.0 release highlights

Committed 116c87e and pushed to 11.x. Also cherry-picked to 10.2.x. Thanks!

  • lauriii committed b6a975f1 on 10.2.x
    Issue #3378890 by Wim Leers, mikesimmons, smustgrave, pmkanse,...

Status: Fixed » Closed (fixed)

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