Version 5 introduces breaking changes, including a new configuration method and the renaming of the default preset to defaultHtml.
Scenario 1: No custom configuration
If you do not use custom configuration, you must update your fields to use the defaultHtml preset to avoid errors.
Option 1 (Recommended): Update your Content-Type schemas manually or via the Content-Type Builder to use defaultHtml instead of default.
Option 2: Apply custom configuration in src/admin/app.[js|tsx] and rename the defaultHtmlPreset.name to default to maintain compatibility with existing schemas.
Scenario 2: Custom configuration
If you use custom configuration, you must migrate from the old object-based presets format to an array-based format.
Key changes for custom config:
presets is now an array of objects (previously an object).- The
field property in a Preset is replaced by name and description. - CKEditor packages are no longer on
globalThis. You must import them directly from ckeditor5. theme and presets are no longer merged with defaults; they overwrite them.- The style plugin and material color palette have been removed from the default preset.
- The plugin theme now uses Strapi's theme variables.
Move your configuration from config/ckeditor.js into src/admin/app.[js|tsx] using setPluginConfig().
// Example of the new v5 configuration pattern in src/admin/app.tsx
import { Autoformat, Bold, Italic, Essentials, Heading } from 'ckeditor5';
import {
setPluginConfig,
defaultHtmlPreset,
StrapiMediaLib,
StrapiUploadAdapter,
} from '@_sh/strapi-plugin-ckeditor';
const CKEConfig = () => ({
presets: [
{
...defaultHtmlPreset,
editorConfig: {
...defaultHtmlPreset.editorConfig,
toolbar: ['heading', '|', 'bold', 'italic', '|', 'strapiMediaLib', '|', 'undo', 'redo'],
},
},
{
name: 'myCustomPreset',
description: 'My custom preset',
editorConfig: {
licenseKey: 'GPL',
plugins: [
Autoformat,
Bold,
Italic,
Essentials,
Heading,
StrapiMediaLib,
StrapiUploadAdapter,
],
toolbar: ['heading', '|', 'bold', 'italic', '|', 'strapiMediaLib', '|', 'undo', 'redo'],
},
},
],
});
export default {
register() {
setPluginConfig(CKEConfig());
},
};