GrapesJS / ckeditor

This plugin replaces the default Rich Text Editor with the one from CKEditor
BSD 3-Clause "New" or "Revised" License
105 stars 103 forks source link

CKEditor error on try editing text #47

Closed ronaldohoch closed 3 years ago

ronaldohoch commented 3 years ago

Hello Artf! ckeditor-gif

Well, when i select a text and try to edit it with ckeditor, it lost the focus and the ckeditor disappear.

Is it related to "sharedspace" plugin? I commented this part of the code because it doesn't work to me:

      // var plgName = 'sharedspace';

      // if (opt.extraPlugins) {
      //   if (typeof opt.extraPlugins === 'string')
      //     opt.extraPlugins += ',' + plgName;
      //   else
      //     opt.extraPlugins.push(plgName);
      // } else {
      //   opt.extraPlugins = plgName;
      // }

Thank you

ronaldohoch commented 3 years ago

Answering my own issue, yes, it's because the sharedspace, i needed to download and use it. https://ckeditor.com/cke4/addon/sharedspace

Also, needed to set the options of the plugin:

'gjs-plugin-ckeditor': {
  position: 'center',
  options: {
    startupFocus: true,
    extraAllowedContent: '*(*);*{*}', // Allows any class and any inline style
    allowedContent: true, // Disable auto-formatting, class removing, etc.
    enterMode: CKEDITOR.ENTER_BR,
    extraPlugins: 'sharedspace,justify,colorbutton,panelbutton,font',
    toolbar: [
      { name: 'styles', items: ['Font', 'FontSize' ] },
      ['Bold', 'Italic', 'Underline', 'Strike'],
      {name: 'paragraph', items : [ 'NumberedList', 'BulletedList']},
      {name: 'links', items: ['Link', 'Unlink']},
      {name: 'colors', items: [ 'TextColor', 'BGColor' ]},
    ],
  }
}