What is @ckeditor/ckeditor5-editor-inline?
@ckeditor/ckeditor5-editor-inline is a package that provides an inline editor for CKEditor 5. This editor allows users to edit content directly within the context of the page, without the need for a separate editing interface. It is particularly useful for applications where a seamless editing experience is desired.
What are @ckeditor/ckeditor5-editor-inline's main functionalities?
Basic Inline Editor Initialization
This code initializes a basic inline editor on an HTML element with the ID 'editor'. It demonstrates how to create an instance of the inline editor and handle the promise returned by the create method.
const InlineEditor = require('@ckeditor/ckeditor5-editor-inline/src/inlineeditor');
InlineEditor.create(document.querySelector('#editor'))
.then(editor => {
console.log('Editor was initialized', editor);
})
.catch(error => {
console.error(error.stack);
});
Adding Plugins
This code demonstrates how to initialize the inline editor with additional plugins such as Bold and Italic. It also configures the toolbar to include buttons for these plugins.
const InlineEditor = require('@ckeditor/ckeditor5-editor-inline/src/inlineeditor');
const Essentials = require('@ckeditor/ckeditor5-essentials/src/essentials');
const Bold = require('@ckeditor/ckeditor5-basic-styles/src/bold');
const Italic = require('@ckeditor/ckeditor5-basic-styles/src/italic');
InlineEditor.create(document.querySelector('#editor'), {
plugins: [ Essentials, Bold, Italic ],
toolbar: [ 'bold', 'italic' ]
})
.then(editor => {
console.log('Editor with plugins was initialized', editor);
})
.catch(error => {
console.error(error.stack);
});
Custom Configuration
This code shows how to initialize the inline editor with a custom configuration. It sets up a toolbar with specific items, changes the language to Spanish, and adds a placeholder text.
const InlineEditor = require('@ckeditor/ckeditor5-editor-inline/src/inlineeditor');
InlineEditor.create(document.querySelector('#editor'), {
toolbar: {
items: [ 'bold', 'italic', 'link' ]
},
language: 'es',
placeholder: 'Type your text here...'
})
.then(editor => {
console.log('Custom configured editor was initialized', editor);
})
.catch(error => {
console.error(error.stack);
});
Other packages similar to @ckeditor/ckeditor5-editor-inline
quill
Quill is a modern WYSIWYG editor built for compatibility and extensibility. It provides a similar inline editing experience and is highly customizable with a wide range of modules and themes. Compared to @ckeditor/ckeditor5-editor-inline, Quill offers a more lightweight and flexible approach but may lack some of the advanced features and plugins available in CKEditor 5.
tinymce
TinyMCE is another popular WYSIWYG editor that offers both inline and classic editing modes. It is highly configurable and supports a wide range of plugins and integrations. TinyMCE is comparable to @ckeditor/ckeditor5-editor-inline in terms of functionality and extensibility, but it has a different API and plugin architecture.
froala-editor
Froala Editor is a lightweight WYSIWYG HTML editor that offers inline editing capabilities. It is known for its clean design and ease of use. Froala Editor provides a similar user experience to @ckeditor/ckeditor5-editor-inline but focuses more on simplicity and performance.
43.1.0 (September 5, 2024)
We are happy to announce the release of CKEditor 5 v43.1.0.
Release highlights
This release includes important bug fixes and enhancements for the editor:
-
Block merge fields: In contrast to regular, inline merge fields, the block merge fields are designed to represent complex, block-level structures, such as a dynamically generated table, a row of products, or a personalized call-to-action segment. Block merge fields are supposed to be replaced by arbitrary HTML data when the document template is post-processed or exported to a PDF or Word file.
-
Nested dropdown menus: this release introduces a new UI component: nested dropdown menus. They can be used by feature developers to easily provide an advanced user interface where UI elements are organized into a nested menu structure.
-
Customizable accessible label: You can now configure the label for the accessible editable area through the editor settings, ensuring it fits your system’s needs.
-
Improved table and cell border controls: It is now easier to manage both table and cell borders. The table user interface now clearly indicates the default border settings, allowing you to set “no borders” (None
) for tables and cells without any additional configuration.
⚠️ In some cases this update may lead to data changes in the tables’ HTML markup when the editor loads them. However, visually nothing will change, and the experience will be the same.
The full list of enhancements can be found below.