numaxlab / nova-ckeditor5-classic

A Laravel Nova CKEditor5 Classic Field.
MIT License
39 stars 41 forks source link

Can't add custom plugins/options #7

Open nsrosenqvist opened 5 years ago

nsrosenqvist commented 5 years ago

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?

cannycookie commented 4 years ago

Any update on this? Alignment is an essential plugin for CMS editing.

ablunier commented 4 years ago

No @cannycookie, had no time to close this issue. Sorry.

cannycookie commented 4 years ago

No problem @ablunier we've gone with Froala editor now. It's awesome. Not free but totally worth paying for and easy integration with Nova. :-) .

czim commented 3 years ago

Any update on this? We're very interested in using this package, but if there is not option to install other plugins, its hard to recommend.