Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed labels for strapi 5 #136

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions admin/src/components/CKEditorInput/Configurator.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ const {
TableColumnResize,
TableCaption,
WordCount,
Highlight
Highlight,
SourceEditing,
GeneralHtmlSupport
} = window.CKEDITOR;

const CKEDITOR_BASE_CONFIG_FOR_PRESETS = {
Expand All @@ -77,7 +79,9 @@ const CKEDITOR_BASE_CONFIG_FOR_PRESETS = {
TableColumnResize,
TableCaption,
WordCount,
StrapiMediaLib
StrapiMediaLib,
SourceEditing,
GeneralHtmlSupport
],
toolbar: [
'undo', 'redo',
Expand All @@ -88,7 +92,9 @@ const CKEDITOR_BASE_CONFIG_FOR_PRESETS = {
'|',
'link', 'strapiMediaLib', 'insertTable',
'|',
'bulletedList', 'numberedList'
'bulletedList', 'numberedList',
'|',
'sourceEditing',
],
heading: {
options: [
Expand Down Expand Up @@ -158,7 +164,9 @@ const CKEDITOR_BASE_CONFIG_FOR_PRESETS = {
TableColumnResize,
TableCaption,
WordCount,
StrapiMediaLib
StrapiMediaLib,
SourceEditing,
GeneralHtmlSupport
],
toolbar: [
'undo', 'redo',
Expand All @@ -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: [
Expand Down Expand Up @@ -264,7 +274,9 @@ const CKEDITOR_BASE_CONFIG_FOR_PRESETS = {
TableCaption,
WordCount,
Highlight,
StrapiMediaLib
StrapiMediaLib,
SourceEditing,
GeneralHtmlSupport
],
toolbar: {
items: [
Expand All @@ -283,6 +295,8 @@ const CKEDITOR_BASE_CONFIG_FOR_PRESETS = {
'alignment',
'|',
'bulletedList', 'numberedList', 'todoList', 'outdent', 'indent',
'|',
'sourceEditing',
],
shouldNotGroupWhenFull: true
},
Expand Down
6 changes: 2 additions & 4 deletions admin/src/components/CKEditorInput/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -64,13 +63,12 @@ const CKEditorInput = ( props ) => {
<Field.Root
name= {name }
id={ name }
// GenericInput calls formatMessage and returns a string for the error
error={ error }
hint={ description && formatMessage( description ) }
hint={ description }
>
<Flex spacing={ 1 } alignItems="normal" style={ { 'flexDirection': 'column' } }>
<Field.Label action={ labelAction } required={ required }>
{ intlLabel ? formatMessage( intlLabel ) : name }
{ intlLabel ?? name }
</Field.Label>
<GlobalStyling />
<CKEditor
Expand Down
7 changes: 7 additions & 0 deletions admin/src/components/CKEditorInput/styles/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,12 @@ 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;
}
}
`;
6 changes: 4 additions & 2 deletions admin/src/components/CKEditorProvider/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ const CKEditorProvider = ( {
labelAction = null,
required = false,
description = null,
hint = null,
label = null,
error = null,
intlLabel } ) => {
const [ importedEditor, setImportedEditor ] = useState( null );
Expand All @@ -22,9 +24,9 @@ const CKEditorProvider = ( {
disabled={ disabled }
labelAction={ labelAction }
required={ required }
description={ description }
description={ hint }
error={ error }
intlLabel={ intlLabel }
intlLabel={ label }
/> );
};

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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/), [email protected]",
"homepage": "https://market.strapi.io/plugins/@ckeditor-strapi-plugin-ckeditor",
"engines": {
"npm": ">=6.0.0"
Expand Down