This document outlines the updates made to Olive.MvcJs to support the latest CKEditor versions (both v4 and v5).
The package now automatically detects and supports both CKEditor 4 and CKEditor 5:
- Auto-detection: Automatically determines which version is available
- Fallback support: Falls back to CKEditor 4 if CKEditor 5 is not available
- Backward compatibility: Existing CKEditor 4 implementations continue to work
- Smart detection: Automatically detects CKEditor 5 vs CKEditor 4
- Modern API support: Uses CKEditor 5's
ClassicEditor.create()method - Enhanced toolbar configuration: Maps toolbar modes to CKEditor 5 toolbar configurations
- Better error handling: Graceful fallback to CKEditor 4 on errors
- Dual file selection handling: Supports both CKEditor 4 and 5 file selection APIs
- Modern communication: Uses postMessage for CKEditor 5 file selection
- Robust error handling: Falls back to CKEditor 4 methods if needed
- Version control: New
CK_EDITOR_VERSIONsetting for manual version control - Bundle selection:
CK_EDITOR_5_BUNDLEsetting for different CKEditor 5 bundles - CKEditor 5 specific config: Dedicated configuration object for CKEditor 5 settings
Updated typings-lib/missingDefinitions.d.ts with proper declarations for:
- CKEditor 4:
CKEDITOR - CKEditor 5:
ClassicEditor,DecoupledEditor,InlineEditor,BalloonEditor,BalloonBlockEditor
// Version control
Config.CK_EDITOR_VERSION = 'auto'; // 'auto', '4', or '5'
// CKEditor 5 bundle selection
Config.CK_EDITOR_5_BUNDLE = 'classic'; // 'classic', 'decoupled', 'inline', 'balloon', 'balloon-block'
// CKEditor 5 specific settings
Config.CK_EDITOR_5_CONFIG = {
language: 'en',
placeholder: 'Enter your content...',
// Add more CKEditor 5 specific configurations here
};The following toolbar modes are supported for both CKEditor versions:
- Compact: Basic formatting (bold, italic, link)
- Medium: Standard editing tools with lists and tables
- Advance: Advanced tools including image upload and media embed
- Full: Complete feature set including code blocks
- No immediate changes required: Existing CKEditor 4 implementations will continue to work
- Update CKEditor files: Replace your CKEditor files with the latest version
- Test thoroughly: Verify all functionality works with your specific CKEditor version
-
Choose your CKEditor version:
- Set
Config.CK_EDITOR_VERSION = '5'for CKEditor 5 - Set
Config.CK_EDITOR_VERSION = '4'for CKEditor 4 - Leave as
'auto'for automatic detection
- Set
-
Select CKEditor 5 bundle (if using CKEditor 5):
'classic': Traditional editor with toolbar'decoupled': Toolbar separate from content area'inline': Inline editing'balloon': Floating toolbar'balloon-block': Block-level floating toolbar
-
Customize configuration: Update
Config.CK_EDITOR_5_CONFIGfor your needs
/lib/ckeditor/
├── ckeditor.js
├── contents.css
└── ... (other CKEditor 4 files)
/lib/ckeditor/
├── ckeditor.js (CKEditor 5 bundle)
└── ... (other CKEditor 5 files)
- CKEditor 4: Supports all modern browsers
- CKEditor 5: Requires modern browsers with ES6+ support
- Automatic fallback: Falls back to CKEditor 4 if CKEditor 5 is not supported
- CKEditor 5 not loading: Check that the correct bundle is loaded
- File manager not working: Ensure proper postMessage handling for CKEditor 5
- Toolbar not displaying: Verify toolbar configuration matches your CKEditor version
Enable console logging to see which CKEditor version is being used:
// The component will log which version it detects and uses
console.log("CKEditor version detected:", version);For issues or questions regarding CKEditor integration:
- Check the browser console for error messages
- Verify your CKEditor files are properly loaded
- Ensure configuration settings match your CKEditor version
- Test with both CKEditor 4 and 5 to isolate version-specific issues