What is @ckeditor/ckeditor5-upload?
@ckeditor/ckeditor5-upload is a plugin for CKEditor 5 that provides file upload capabilities. It allows users to upload images and other files directly within the editor, enhancing the content creation experience.
What are @ckeditor/ckeditor5-upload's main functionalities?
Simple Upload Adapter
This feature allows you to configure a simple upload adapter that sends files to a specified server endpoint. The server should handle the file storage and return the URL of the uploaded file.
ClassicEditor.create(document.querySelector('#editor'), { extraPlugins: [SimpleUploadAdapter], simpleUpload: { uploadUrl: 'https://your-upload-endpoint.com/upload' } })
Base64 Upload Adapter
This feature enables the Base64 upload adapter, which converts files to Base64 strings and embeds them directly into the content. This is useful for quick prototyping or when you don't have a server-side upload handler.
ClassicEditor.create(document.querySelector('#editor'), { extraPlugins: [Base64UploadAdapter] })
Custom Upload Adapter
This feature allows you to create a custom upload adapter by defining your own upload logic. This is useful when you need more control over the upload process or need to integrate with a specific backend service.
class MyUploadAdapter { constructor(loader) { this.loader = loader; } upload() { return this.loader.file.then(file => new Promise((resolve, reject) => { const data = new FormData(); data.append('file', file); fetch('https://your-upload-endpoint.com/upload', { method: 'POST', body: data }) .then(response => response.json()) .then(result => resolve({ default: result.url })) .catch(reject); })); } } ClassicEditor.create(document.querySelector('#editor'), { extraPlugins: [function(editor) { editor.plugins.get('FileRepository').createUploadAdapter = loader => new MyUploadAdapter(loader); }] })
Other packages similar to @ckeditor/ckeditor5-upload
quill-image-uploader
quill-image-uploader is a module for the Quill rich text editor that provides image upload capabilities. It allows users to upload images directly within the editor. Compared to @ckeditor/ckeditor5-upload, it is specific to the Quill editor and offers similar functionality for image uploads.
react-dropzone
react-dropzone is a React component for handling file uploads via drag and drop. While it is not specific to any rich text editor, it can be integrated with various editors to provide file upload capabilities. It offers more flexibility in terms of how files are uploaded and handled compared to @ckeditor/ckeditor5-upload.
44.1.0 (December 16, 2024)
We are pleased to announce the latest CKEditor 5 release, focusing on performance enhancements and key bug fixes to improve your editing and collaboration experience.
Release Highlights
⚡ Performance enhancements: Part 3
This release introduces another set of performance related improvements, focused on faster editor initialization for huge documents. The initialization time was lowered by further 15% to 45%, depending on the tested sample.
The combined improvements introduced in recent releases amount to around 65%-80% lower loading time in total, which means the editor will load 3-5x faster. As the gain is not linear, bigger documents see even better improvement (more than 10x faster).
Moreover, all these improvements positively impact document save time (editor.getData()
), which should help with autosave issues, among others.
We still actively work in this area, so you may expect even more editor load and save efficiency improvements in the upcoming releases.
🔨 Bug Fixes and improvements
- Comments enhancements:
- Data export options: We introduced the
showCommentHighlights
option in editor.getData()
, that changes the comment marker conversion, allowing for styling comments in the output. Perfect for showing what was commented in Export to PDF, for example. - Inline mode improvements: We addressed a problem where comment annotations in inline mode did not close properly when clicking elsewhere in the content.
- Thread management: We resolved an issue where creating a new thread was not interrupted when the corresponding marker was removed from the content, ensuring better stability during collaborative editing.
- Revision History update:
- Restore functionality: We disabled the ability to restore the current (edited, not saved) revision, as it represents current content, so there is nothing to restore. At the same time, using it led to some non-obvious behaviors.
- Image handling: We resolved an issue where images in the uploading state could be deleted when dragged and dropped within the editor. Keep dragging, even when it is not there 🙈.
🎄 Happy holidays!
As the holiday season approaches, we extend our warmest wishes to our community and users. Thank you for your continued support, and we look forward to bringing you further enhancements and exciting features in the coming year.