What is @ckeditor/ckeditor5-editor-balloon?
@ckeditor/ckeditor5-editor-balloon is a package that provides a balloon editor for CKEditor 5. This type of editor is designed to appear in a floating balloon, which can be positioned relative to the content being edited. It is particularly useful for inline editing scenarios where the editor should not take up a lot of space and should be contextually relevant to the content being edited.
What are @ckeditor/ckeditor5-editor-balloon's main functionalities?
Basic Balloon Editor Initialization
This code demonstrates how to initialize a basic balloon editor using the @ckeditor/ckeditor5-editor-balloon package. The editor is created and attached to a DOM element with the id 'editor'.
const BalloonEditor = require('@ckeditor/ckeditor5-editor-balloon/src/ballooneditor');
const ClassicEditor = require('@ckeditor/ckeditor5-build-classic');
BalloonEditor.create(document.querySelector('#editor'))
.then(editor => {
console.log('Editor was initialized', editor);
})
.catch(error => {
console.error(error.stack);
});
Customizing the Balloon Editor
This code sample shows how to customize the balloon editor by adding specific plugins and configuring the toolbar. In this example, the editor is initialized with the Essentials, Bold, and Italic plugins, and the toolbar is configured to include buttons for bold and italic text.
const BalloonEditor = require('@ckeditor/ckeditor5-editor-balloon/src/ballooneditor');
const EssentialsPlugin = require('@ckeditor/ckeditor5-essentials/src/essentials');
const BoldPlugin = require('@ckeditor/ckeditor5-basic-styles/src/bold');
const ItalicPlugin = require('@ckeditor/ckeditor5-basic-styles/src/italic');
BalloonEditor.create(document.querySelector('#editor'), {
plugins: [ EssentialsPlugin, BoldPlugin, ItalicPlugin ],
toolbar: [ 'bold', 'italic' ]
})
.then(editor => {
console.log('Editor was initialized with custom plugins', editor);
})
.catch(error => {
console.error(error.stack);
});
Handling Editor Events
This example demonstrates how to handle events in the balloon editor. Specifically, it listens for changes to the editor's data and logs the new data to the console whenever it changes.
const BalloonEditor = require('@ckeditor/ckeditor5-editor-balloon/src/ballooneditor');
BalloonEditor.create(document.querySelector('#editor'))
.then(editor => {
editor.model.document.on('change:data', () => {
console.log('The data has changed!', editor.getData());
});
})
.catch(error => {
console.error(error.stack);
});
Other packages similar to @ckeditor/ckeditor5-editor-balloon
quill
Quill is a modern WYSIWYG editor built for compatibility and extensibility. It offers a similar inline editing experience with a floating toolbar, making it comparable to the balloon editor provided by @ckeditor/ckeditor5-editor-balloon. Quill is known for its ease of use and flexibility in customization.
tinymce
TinyMCE is another popular WYSIWYG editor that provides a rich text editing experience. It offers a variety of configurations, including inline editing with a floating toolbar, similar to the balloon editor in CKEditor 5. TinyMCE is highly customizable and widely used in various web applications.
froala-editor
Froala Editor is a lightweight WYSIWYG HTML editor that offers inline editing capabilities with a floating toolbar. It is similar to the balloon editor in CKEditor 5 in terms of functionality and is known for its performance and ease of integration.
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.