From 4943d6a8776cbe5966ca910dd9edfa201f703f5b Mon Sep 17 00:00:00 2001 From: kostaszazim Date: Tue, 19 Nov 2024 21:59:13 +0200 Subject: [PATCH 1/4] fixed labels for strapi 5 --- admin/src/components/CKEditorInput/index.jsx | 6 ++---- admin/src/components/CKEditorProvider/index.jsx | 6 ++++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/admin/src/components/CKEditorInput/index.jsx b/admin/src/components/CKEditorInput/index.jsx index aa5b8d0..98d0d9d 100644 --- a/admin/src/components/CKEditorInput/index.jsx +++ b/admin/src/components/CKEditorInput/index.jsx @@ -30,7 +30,6 @@ const CKEditorInput = ( props ) => { intlLabel } = props; const { onChange, value } = useField( name ); const [ editorInstance, setEditorInstance ] = useState(false); - const { formatMessage } = useIntl(); const { maxLengthCharacters:maxLength , ...options } = attribute.options; const configurator = new Configurator( { options, maxLength } ); const editorConfig = configurator.getEditorConfig(); @@ -64,13 +63,12 @@ const CKEditorInput = ( props ) => { - { intlLabel ? formatMessage( intlLabel ) : name } + { intlLabel ?? name } { const [ importedEditor, setImportedEditor ] = useState( null ); @@ -22,9 +24,9 @@ const CKEditorProvider = ( { disabled={ disabled } labelAction={ labelAction } required={ required } - description={ description } + description={ hint } error={ error } - intlLabel={ intlLabel } + intlLabel={ label } /> ); }; From 2ce1f04fbccf69cd44d09bdd8a2b3da47984d73d Mon Sep 17 00:00:00 2001 From: kostaszazim Date: Wed, 20 Nov 2024 09:40:41 +0200 Subject: [PATCH 2/4] package.json changes --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index e93f8c1..4bf7c18 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { - "name": "@ckeditor/strapi-plugin-ckeditor", + "name": "@kostaszazim/strapi-plugin-ckeditor", "version": "1.0.2", - "description": "CKEditor 5 - Official Integration for Strapi", + "description": "CKEditor 5 - Official Integration for Strapi, including label fixes and source editing", "strapi": { "name": "ckeditor", "description": "The rich text editor for every use case", @@ -30,7 +30,7 @@ "type": "git", "url": "https://github.com/ckeditor/strapi-plugin-ckeditor.git" }, - "author": "CKSource (http://cksource.com/)", + "author": "CKSource (http://cksource.com/), kostas_zazim@yahoo.gr", "homepage": "https://market.strapi.io/plugins/@ckeditor-strapi-plugin-ckeditor", "engines": { "npm": ">=6.0.0" From 0238df857f6195adc8a0d40ff46b789dca23a3a2 Mon Sep 17 00:00:00 2001 From: kostaszazim Date: Wed, 20 Nov 2024 10:19:20 +0200 Subject: [PATCH 3/4] added source editing --- .../components/CKEditorInput/Configurator.js | 26 ++++++++++++++----- .../components/CKEditorInput/styles/common.js | 4 +++ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/admin/src/components/CKEditorInput/Configurator.js b/admin/src/components/CKEditorInput/Configurator.js index 462e652..af472ee 100644 --- a/admin/src/components/CKEditorInput/Configurator.js +++ b/admin/src/components/CKEditorInput/Configurator.js @@ -51,7 +51,9 @@ const { TableColumnResize, TableCaption, WordCount, - Highlight + Highlight, + SourceEditing, + GeneralHtmlSupport } = window.CKEDITOR; const CKEDITOR_BASE_CONFIG_FOR_PRESETS = { @@ -77,7 +79,9 @@ const CKEDITOR_BASE_CONFIG_FOR_PRESETS = { TableColumnResize, TableCaption, WordCount, - StrapiMediaLib + StrapiMediaLib, + SourceEditing, + GeneralHtmlSupport ], toolbar: [ 'undo', 'redo', @@ -88,7 +92,9 @@ const CKEDITOR_BASE_CONFIG_FOR_PRESETS = { '|', 'link', 'strapiMediaLib', 'insertTable', '|', - 'bulletedList', 'numberedList' + 'bulletedList', 'numberedList', + '|', + 'sourceEditing', ], heading: { options: [ @@ -158,7 +164,9 @@ const CKEDITOR_BASE_CONFIG_FOR_PRESETS = { TableColumnResize, TableCaption, WordCount, - StrapiMediaLib + StrapiMediaLib, + SourceEditing, + GeneralHtmlSupport ], toolbar: [ 'undo', 'redo', @@ -169,7 +177,9 @@ const CKEDITOR_BASE_CONFIG_FOR_PRESETS = { '|', 'link', 'strapiMediaLib', 'mediaEmbed', 'blockQuote', 'insertTable', 'codeBlock', '|', - 'bulletedList', 'numberedList', 'outdent', 'indent' + 'bulletedList', 'numberedList', 'outdent', 'indent', + '|', + 'sourceEditing', ], heading: { options: [ @@ -264,7 +274,9 @@ const CKEDITOR_BASE_CONFIG_FOR_PRESETS = { TableCaption, WordCount, Highlight, - StrapiMediaLib + StrapiMediaLib, + SourceEditing, + GeneralHtmlSupport ], toolbar: { items: [ @@ -283,6 +295,8 @@ const CKEDITOR_BASE_CONFIG_FOR_PRESETS = { 'alignment', '|', 'bulletedList', 'numberedList', 'todoList', 'outdent', 'indent', + '|', + 'sourceEditing', ], shouldNotGroupWhenFull: true }, diff --git a/admin/src/components/CKEditorInput/styles/common.js b/admin/src/components/CKEditorInput/styles/common.js index e3f858e..a3e07d8 100644 --- a/admin/src/components/CKEditorInput/styles/common.js +++ b/admin/src/components/CKEditorInput/styles/common.js @@ -119,5 +119,9 @@ export const style = css` transition-duration: 0.2s; } } + .ck-source-editing-area textarea { + font-size: 1.2rem; + overflow: auto; + } } `; From 51f2e77c40e841f719bebe274e3b3c52aabd7f30 Mon Sep 17 00:00:00 2001 From: kostaszazim Date: Wed, 20 Nov 2024 11:52:45 +0200 Subject: [PATCH 4/4] fixed source editing height --- admin/src/components/CKEditorInput/styles/common.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/admin/src/components/CKEditorInput/styles/common.js b/admin/src/components/CKEditorInput/styles/common.js index a3e07d8..752012d 100644 --- a/admin/src/components/CKEditorInput/styles/common.js +++ b/admin/src/components/CKEditorInput/styles/common.js @@ -119,6 +119,9 @@ export const style = css` transition-duration: 0.2s; } } + .ck-source-editing-area { + height: 150px; + } .ck-source-editing-area textarea { font-size: 1.2rem; overflow: auto;