Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ckeditor/ckeditor5-editor-balloon

Package Overview
Dependencies
Maintainers
1
Versions
701
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ckeditor/ckeditor5-editor-balloon

Balloon editor implementation for CKEditor 5.

  • 43.1.0-alpha.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
225K
decreased by-4.1%
Maintainers
1
Weekly downloads
 
Created

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

Keywords

FAQs

Package last updated on 28 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc