Skip to content
This repository was archived by the owner on Nov 21, 2024. It is now read-only.
This repository was archived by the owner on Nov 21, 2024. It is now read-only.

Can't add custom plugins/options #7

@nsrosenqvist

Description

@nsrosenqvist

If I read the code correctly, only select keys are extracted from the field's config (e.g. "toolbar", "heading"):

FormField.vue

    data () {
        return {
            editor: ClassicEditor,
            defaultEditorConfig: {
                nova: {
                    resourceName: this.resourceName,
                    field: this.field,
                    draftId: uuidv4()
                },
                language: 'en',
                toolbar: this.field.options.toolbar,
                heading: this.field.options.heading,
                image: this.field.options.image,
                fontFamily: this.field.options.fontFamily,
                extraPlugins: [
                    this.createUploadAdapterPlugin
                ]
            }
        }
    },

So I can't include a script that attaches extra plugins to window in order to be loaded by the editor. Something like this wouldn't work:

js

import Alignment from '@ckeditor/ckeditor5-alignment/src/alignment';

window.CKPlugins = {
    Alignment,
};

php

                    CKEditor5Classic::make('Body')->withFiles('public')->options([
                        "plugins" => [
                            'CKPlugins.Alignment',
                        ],
                        "toolbar" => [
                            'heading', '|', 'alignment',
                        ],
                        "alignment" => [
                            'left', 'center', 'right', 'justify'
                        ],
                    ]),

In the above case neither the key "plugins" nor "alignment" would be included. Can't simply all options specified be passed on to CK rather than select keys?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions