Несколько CKEditor5 (разной сборки) в ReactJs - окончание в 'CKEditorError: ckeditor-duplicated-modules'

Я создал основной компонент и два подкомпонента для загрузки двух разных сборок CKeditor5 (классической и воздушной); но он дает ошибку ниже:

CKEditorError: ckeditor-duplicated-modules: Некоторые модули CKEditor 5 дублируются. Подробнее: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-ckeditor-duplicated-modules

Первый компонент:

import React from "react";
import CKEditor from "@ckeditor/ckeditor5-react";
import BalloonEditor from "@ckeditor/ckeditor5-build-balloon";

..

return (
<CKEditor
  editor={BalloonEditor}
  //data="<p>Hello from CKEditor 5!</p>" //using placeholder instead
  config={editorConfiguration}
  onInit={editor => {
    // You can store the "editor" and use when it is needed.
    console.log("Editor is ready to use!", editor);
  }}
  onChange={(event, editor) => {
    const data = editor.getData();
    //console.log({ event, editor, data });
  }}
/>);

Второй компонент:

import React from "react";
import CKEditor from "@ckeditor/ckeditor5-react";
import ClassicEditor from "@ckeditor/ckeditor5-build-classic";

 ..

return (
    <CKEditor
      editor={BalloonEditor}
      //data="<p>Hello from CKEditor 5!</p>" //using placeholder instead
      config={editorConfiguration}
      onInit={editor => {
        // You can store the "editor" and use when it is needed.
        console.log("Editor is ready to use!", editor);
      }}
      onChange={(event, editor) => {
        const data = editor.getData();
        //console.log({ event, editor, data });
      }}
    />);

Главный компонент:

return (
  <CardFront />
  <CardBack />
)

Есть идеи, как с этим справиться? Или это ограничение?


person Penguin    schedule 26.10.2019    source источник


Ответы (1)


Это может помочь:

Создание «супер-сборок»

Нет ограничений на количество классов редакторов, которые может экспортировать одна сборка. По умолчанию официальные сборки экспортируют только один класс редактора. Однако они легко могут импортировать больше.

Вы можете начать с разветвления (или копирования) существующей сборки, как в руководстве «Создание пользовательских сборок». Допустим, вы разделили и клонировали репозиторий ckeditor5 и хотите добавить InlineEditor в классическую сборку:

https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/advanced-setup.html#scenario-3-using-two-different-editors

person rduddek    schedule 18.09.2020