How to use @ckeditor/ckeditor5-editor-decoupled - 2 common examples

To help you get started, we’ve selected a few @ckeditor/ckeditor5-editor-decoupled examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github neos / neos-ui / packages / neos-ui-ckeditor5-bindings / src / ckEditorApi.js View on Github external
export const createEditor = options => {
    const {propertyDomNode, propertyName, editorOptions, globalRegistry, userPreferences, onChange} = options;
    const ckEditorConfig = editorConfig.configRegistry.getCkeditorConfig({
        editorOptions,
        userPreferences,
        globalRegistry,
        propertyDomNode
    });

    DecoupledEditor
        .create(propertyDomNode, ckEditorConfig)
        .then(editor => {
            editor.ui.focusTracker.on('change:isFocused', event => {
                if (event.source.isFocused) {
                    currentEditor = editor;
                    editorConfig.setCurrentlyEditedPropertyName(propertyName);
                }
            });

            // We attach all options for this editor to the editor DOM node, so it would be easier to access them from CKE plugins
            editor.neos = options;

            editor.model.document.on('change', () => handleUserInteractionCallback());
            editor.model.document.on('change:data', debounce(() => onChange(cleanupContentBeforeCommit(editor.getData())), 500, {maxWait: 5000}));
        }).catch(e => console.error(e));
};
github ImaginarySense / Teleprompter-Core / app / ckeditor-implementation.js View on Github external
constructor(settings) {
    console.log("CKEditorImplementation");

    super(settings);

    // Initialize CKEditor 5 class
    DecoupledEditor.create( this.domObject.firstElementChild, {
      plugins: [
        Alignment,
        // Autosave,
        Bold,
        Essentials,
        Font,
        Heading,
        Highlight,
        // Image,
        // ImageUpload,
        Italic,
        Link,
        List,
        Paragraph,
        PasteFromOffice,
        RemoveFormat,

@ckeditor/ckeditor5-editor-decoupled

Decoupled editor implementation for CKEditor 5.

GPL-2.0-or-later
Latest version published 2 days ago

Package Health Score

91 / 100
Full package analysis

Popular @ckeditor/ckeditor5-editor-decoupled functions