Issue #3378890 by Wim Leers, mikesimmons, smustgrave, pmkanse, witeksocha: Add the "Show Blocks" functionality that existed in CKEditor 4 and was added to CKEditor 5 38.1.0

merge-requests/4988/head
Lauri Eskola 2023-10-11 09:47:42 +03:00
parent 8b0a91f602
commit 116c87e47e
No known key found for this signature in database
GPG Key ID: 382FC0F5B0DF53F8
53 changed files with 117 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
!function(i){const n=i.ar=i.ar||{};n.dictionary=Object.assign(n.dictionary||{},{"Show blocks":"عرض الكتل"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(i){const n=i.bg=i.bg||{};n.dictionary=Object.assign(n.dictionary||{},{"Show blocks":"Покажи блокове"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(n){const i=n.bn=n.bn||{};i.dictionary=Object.assign(i.dictionary||{},{"Show blocks":"ব্লকগুলি দেখান"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(o){const c=o.ca=o.ca||{};c.dictionary=Object.assign(c.dictionary||{},{"Show blocks":"Mostra blocs"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(o){const i=o.cs=o.cs||{};i.dictionary=Object.assign(i.dictionary||{},{"Show blocks":"Zobrazit bloky"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(i){const o=i.da=i.da||{};o.dictionary=Object.assign(o.dictionary||{},{"Show blocks":"Vis blokke"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(n){const i=n.de=n.de||{};i.dictionary=Object.assign(i.dictionary||{},{"Show blocks":"Blöcke anzeigen"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(i){const n=i.el=i.el||{};n.dictionary=Object.assign(n.dictionary||{},{"Show blocks":"Εμφάνιση μπλοκ"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(o){const i=o.es=o.es||{};i.dictionary=Object.assign(i.dictionary||{},{"Show blocks":"Mostrar bloques"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(i){const o=i.et=i.et||{};o.dictionary=Object.assign(o.dictionary||{},{"Show blocks":"Kuva plokid"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(i){const n=i.fi=i.fi||{};n.dictionary=Object.assign(n.dictionary||{},{"Show blocks":"Näytä rakenneosat"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(i){const o=i.fr=i.fr||{};o.dictionary=Object.assign(o.dictionary||{},{"Show blocks":"Afficher les blocs"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(o){const i=o.gl=o.gl||{};i.dictionary=Object.assign(i.dictionary||{},{"Show blocks":"Amosar os bloques"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(i){const n=i.he=i.he||{};n.dictionary=Object.assign(n.dictionary||{},{"Show blocks":"הצג גושים"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(i){const n=i.hi=i.hi||{};n.dictionary=Object.assign(n.dictionary||{},{"Show blocks":"ब्लॉक दिखाएं"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(i){const o=i.hr=i.hr||{};o.dictionary=Object.assign(o.dictionary||{},{"Show blocks":"Prikaži blokove"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(o){const n=o.hu=o.hu||{};n.dictionary=Object.assign(n.dictionary||{},{"Show blocks":"Blokkok megjelenítése"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(i){const n=i.id=i.id||{};n.dictionary=Object.assign(n.dictionary||{},{"Show blocks":"Tampilkan blok"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(i){const o=i.it=i.it||{};o.dictionary=Object.assign(o.dictionary||{},{"Show blocks":"Mostra blocchi"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(i){const n=i.ja=i.ja||{};n.dictionary=Object.assign(n.dictionary||{},{"Show blocks":"ブロックを表示します"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(o){const i=o.ko=o.ko||{};i.dictionary=Object.assign(i.dictionary||{},{"Show blocks":"블록 표시"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(o){const i=o.lt=o.lt||{};i.dictionary=Object.assign(i.dictionary||{},{"Show blocks":"Rodyti blokus"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(o){const i=o.lv=o.lv||{};i.dictionary=Object.assign(i.dictionary||{},{"Show blocks":"Rādīt blokus"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(n){const o=n.ms=n.ms||{};o.dictionary=Object.assign(o.dictionary||{},{"Show blocks":"Tunjukkan blok"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(n){const o=n.nl=n.nl||{};o.dictionary=Object.assign(o.dictionary||{},{"Show blocks":"Blokken tonen"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(o){const n=o.no=o.no||{};n.dictionary=Object.assign(n.dictionary||{},{"Show blocks":"Vis blokker"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(i){const o=i.pl=i.pl||{};o.dictionary=Object.assign(o.dictionary||{},{"Show blocks":"Wyświetl bloki"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(o){const i=o["pt-br"]=o["pt-br"]||{};i.dictionary=Object.assign(i.dictionary||{},{"Show blocks":"Mostrar blocos"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(o){const i=o.pt=o.pt||{};i.dictionary=Object.assign(i.dictionary||{},{"Show blocks":"Mostrar blocos"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(o){const i=o.ro=o.ro||{};i.dictionary=Object.assign(i.dictionary||{},{"Show blocks":"Arată casetele"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(i){const n=i.ru=i.ru||{};n.dictionary=Object.assign(n.dictionary||{},{"Show blocks":"Показать блоки"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(o){const i=o.sk=o.sk||{};i.dictionary=Object.assign(i.dictionary||{},{"Show blocks":"Zobraziť bloky"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(o){const i=o.sq=o.sq||{};i.dictionary=Object.assign(i.dictionary||{},{"Show blocks":"Shfaq blloqet"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(i){const o=i.sr=i.sr||{};o.dictionary=Object.assign(o.dictionary||{},{"Show blocks":"Prikaži blokove"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(i){const o=i.sv=i.sv||{};o.dictionary=Object.assign(o.dictionary||{},{"Show blocks":"Visa block"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(i){const n=i.th=i.th||{};n.dictionary=Object.assign(n.dictionary||{},{"Show blocks":"แสดงบล็อก"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(o){const i=o.tr=o.tr||{};i.dictionary=Object.assign(i.dictionary||{},{"Show blocks":"Blokları göster"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(i){const n=i.ug=i.ug||{};n.dictionary=Object.assign(n.dictionary||{},{"Show blocks":"بۆلەكلەرنى كۆرسەت"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(i){const n=i.uk=i.uk||{};n.dictionary=Object.assign(n.dictionary||{},{"Show blocks":"Показати блоки"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(i){const n=i.vi=i.vi||{};n.dictionary=Object.assign(n.dictionary||{},{"Show blocks":"Hiện các khối"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(n){const c=n["zh-cn"]=n["zh-cn"]||{};c.dictionary=Object.assign(c.dictionary||{},{"Show blocks":"显示区块"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -0,0 +1 @@
!function(i){const n=i.zh=i.zh||{};n.dictionary=Object.assign(n.dictionary||{},{"Show blocks":"顯示區塊"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@ -292,6 +292,18 @@ ckeditor5.codeBlock:
- core/ckeditor5
- core/ckeditor5.translations
ckeditor5.showBlocks:
remote: https://github.com/ckeditor/ckeditor5
version: "39.0.1"
license:
name: GNU-GPL-2.0-or-later
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v37.1.0/LICENSE.md
gpl-compatible: true
js:
assets/vendor/ckeditor5/show-blocks/show-blocks.js: { minified: true }
dependencies:
- core/ckeditor5
ckeditor5.style:
remote: https://github.com/ckeditor/ckeditor5
version: "39.0.1"

View File

@ -689,6 +689,18 @@ ckeditor5_language:
elements:
- <span lang dir>
ckeditor5_showBlocks:
ckeditor5:
plugins: [showBlocks.ShowBlocks]
drupal:
label: Show blocks
library: core/ckeditor5.showBlocks
admin_library: ckeditor5/internal.admin.showBlocks
toolbar_items:
showBlocks:
label: Show blocks
elements: false
media_media:
provider: media
ckeditor5:

View File

@ -187,6 +187,11 @@ internal.admin.drupalmedia:
theme:
css/drupalmedia.admin.css: { }
internal.admin.showBlocks:
css:
theme:
css/show-blocks.admin.css: { }
internal.admin.sourceEditing:
css:
theme:

View File

@ -0,0 +1,3 @@
.ckeditor5-toolbar-button-showBlocks {
background-image: url(../icons/show-blocks.svg);
}

View File

@ -0,0 +1 @@
<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m6.395 9.196 2.545-.007V6.498a.598.598 0 0 1 .598-.598h.299a.598.598 0 0 1 .598.598v6.877a.598.598 0 0 1-.598.598h-.299a.598.598 0 0 1-.598-.598v-2.691l-2.545.007v2.691a.598.598 0 0 1-.598.598h-.299a.598.598 0 0 1-.598-.598V6.505a.598.598 0 0 1 .598-.598h.299a.598.598 0 0 1 .598.598v2.691Z"/><path d="M15.094 13.417V6.462a.562.562 0 0 0-.562-.562h-.782a1 1 0 0 0-.39.08l-1.017.43a.562.562 0 0 0-.343.517v.197c0 .4.406.67.775.519l.819-.337v6.111c0 .31.251.562.561.562h.377c.31 0 .562-.251.562-.562Z"/><path d="M0 15.417v1.5h1.5v-1.5H0Z"/><path d="M18.5 15.417v1.5H20v-1.5h-1.5Z"/><path d="M18.5 12.333v1.5H20v-1.5h-1.5Z"/><path d="M18.5 9.25v1.5H20v-1.5h-1.5Z"/><path d="M18.5 6.167v1.5H20v-1.5h-1.5Z"/><path d="M0 18.5v.5a1 1 0 0 0 1 1h.5v-1.5H0Z"/><path d="M3.083 18.5V20h1.5v-1.5h-1.5Z"/><path d="M6.167 18.5V20h1.5v-1.5h-1.5Z"/><path d="M9.25 18.5V20h1.5v-1.5h-1.5Z"/><path d="M12.333 18.5V20h1.5v-1.5h-1.5Z"/><path d="M15.417 18.5V20h1.5v-1.5h-1.5Z"/><path d="M18.5 18.5V20h.5a1 1 0 0 0 1-1v-.5h-1.5Z"/><path clip-rule="evenodd" d="M0 1a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v3.583h-1.5V1.5h-17v12.333H0V1Z"/></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -1672,6 +1672,30 @@
* @typedef {module:select-all/selectallui} module:select-all/selectallui~SelectAllUI
*/
/**
* Declared in file @ckeditor/ckeditor5-show-blocks/src/showblocks.js
*
* @typedef {module:show-blocks/showblocks} module:show-blocks/showblocks~ShowBlocks
*/
/**
* Declared in file @ckeditor/ckeditor5-show-blocks/src/showblockscommand.js
*
* @typedef {module:show-blocks/showblockscommand} module:show-blocks/showblockscommand~ShowBlocksCommand
*/
/**
* Declared in file @ckeditor/ckeditor5-show-blocks/src/showblocksediting.js
*
* @typedef {module:show-blocks/showblocksediting} module:show-blocks/showblocksediting~ShowBlocksEditing
*/
/**
* Declared in file @ckeditor/ckeditor5-show-blocks/src/showblocksui.js
*
* @typedef {module:show-blocks/showblocksui} module:show-blocks/showblocksui~ShowBlocksUI
*/
/**
* Declared in file @ckeditor/ckeditor5-source-editing/src/sourceediting.js
*

View File

@ -153,12 +153,14 @@ class Core extends PluginBase implements CKEditor4To5UpgradePluginInterface {
case 'Paste':
case 'PasteText':
case 'PasteFromWord':
case 'ShowBlocks':
case 'Maximize':
case '-':
// @see https://www.drupal.org/project/ckeditor5/issues/3211049#comment-14167764
return NULL;
case 'ShowBlocks':
return ['showBlocks'];
// @see \Drupal\ckeditor5\Plugin\CKEditor5Plugin\RemoveFormat
case 'RemoveFormat':
return ['removeFormat'];

View File

@ -1280,6 +1280,7 @@ class SmartDefaultSettingsTest extends KernelTestBase {
'heading',
'codeBlock',
'|',
'showBlocks',
'sourceEditing',
],
],

View File

@ -50,6 +50,7 @@
"@ckeditor/ckeditor5-list": "~39.0.1",
"@ckeditor/ckeditor5-paste-from-office": "~39.0.1",
"@ckeditor/ckeditor5-remove-format": "~39.0.1",
"@ckeditor/ckeditor5-show-blocks": "~39.0.1",
"@ckeditor/ckeditor5-source-editing": "~39.0.1",
"@ckeditor/ckeditor5-special-characters": "~39.0.1",
"@ckeditor/ckeditor5-style": "~39.0.1",

View File

@ -218,6 +218,14 @@
"@ckeditor/ckeditor5-ui" "39.0.1"
"@ckeditor/ckeditor5-utils" "39.0.1"
"@ckeditor/ckeditor5-show-blocks@~39.0.1":
version "39.0.1"
resolved "https://registry.yarnpkg.com/@ckeditor/ckeditor5-show-blocks/-/ckeditor5-show-blocks-39.0.1.tgz#3b2b10f2b611516e6d7f2fe0cd9a20b6e54778dc"
integrity sha512-oYCmv557EqDDNPZQ6EUri6ZgiOymjIxoE4m2HV6nvapjKWKyVQOl/z+zwhV5DHCfqLlIyl3ODiHuUqrTVJUEaw==
dependencies:
"@ckeditor/ckeditor5-ui" "39.0.1"
ckeditor5 "39.0.1"
"@ckeditor/ckeditor5-source-editing@~39.0.1":
version "39.0.1"
resolved "https://registry.yarnpkg.com/@ckeditor/ckeditor5-source-editing/-/ckeditor5-source-editing-39.0.1.tgz#c1dd151bdd0bbb564dc017fc758c645ffd299896"