What is @ckeditor/ckeditor5-clipboard?
@ckeditor/ckeditor5-clipboard is a plugin for CKEditor 5 that provides clipboard support, enabling users to cut, copy, and paste content within the editor. It handles various clipboard operations, including pasting plain text, HTML, and rich text content, and integrates seamlessly with other CKEditor 5 plugins.
What are @ckeditor/ckeditor5-clipboard's main functionalities?
Basic Clipboard Operations
This code initializes a CKEditor 5 instance with the clipboard plugin enabled, allowing basic cut, copy, and paste operations.
ClassicEditor.create(document.querySelector('#editor'), { plugins: [ Clipboard ] })
Pasting Plain Text
This configuration ensures that only plain text is pasted into the editor, stripping out any HTML or rich text formatting.
ClassicEditor.create(document.querySelector('#editor'), { plugins: [ Clipboard ], clipboard: { plainText: true } })
Handling Custom Paste Events
This example demonstrates how to handle custom paste events by listening to the 'inputTransformation' event, allowing developers to manipulate the pasted content before it is inserted into the editor.
ClassicEditor.create(document.querySelector('#editor'), { plugins: [ Clipboard ] }).then(editor => { editor.plugins.get('Clipboard').on('inputTransformation', (evt, data) => { console.log('Custom paste event:', data); }); });
Other packages similar to @ckeditor/ckeditor5-clipboard
quill
Quill is a modern WYSIWYG editor built for compatibility and extensibility. It provides clipboard support similar to @ckeditor/ckeditor5-clipboard, allowing users to cut, copy, and paste content. Quill's clipboard module can be customized to handle different types of content and transformations.
tinymce
TinyMCE is a popular rich text editor that includes comprehensive clipboard support. It allows users to paste content from various sources, including Word and Excel, and provides options to clean up and transform pasted content. TinyMCE's clipboard functionality is comparable to @ckeditor/ckeditor5-clipboard in terms of flexibility and customization.
draft-js
Draft.js is a JavaScript framework for building rich text editors, developed by Facebook. It includes clipboard support for handling cut, copy, and paste operations. Draft.js allows developers to customize the clipboard behavior and integrate it with other editor features, similar to @ckeditor/ckeditor5-clipboard.
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.