Skip to content

Commit

Permalink
Add classic toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-darsow committed Nov 22, 2023
1 parent a87ee7f commit 3b4a4c9
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 5 deletions.
25 changes: 25 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"@ckeditor/ckeditor5-dev-translations": "^32.1.2",
"@ckeditor/ckeditor5-dev-utils": "^32.1.2",
"@ckeditor/ckeditor5-editor-balloon": "^37.1.0",
"@ckeditor/ckeditor5-editor-classic": "^37.1.0",
"@ckeditor/ckeditor5-essentials": "^37.1.0",
"@ckeditor/ckeditor5-heading": "^37.1.0",
"@ckeditor/ckeditor5-highlight": "^37.1.0",
Expand Down
18 changes: 13 additions & 5 deletions src/ckeditor.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import BalloonEditor from "@ckeditor/ckeditor5-editor-balloon/src/ballooneditor.js";
import { BalloonEditor as BalloonEditorBase } from "@ckeditor/ckeditor5-editor-balloon";
import { ClassicEditor as ClassicEditorBase } from "@ckeditor/ckeditor5-editor-classic";
import Autoformat from "@ckeditor/ckeditor5-autoformat/src/autoformat";
import BlockQuote from "@ckeditor/ckeditor5-block-quote/src/blockquote.js";
import Bold from "@ckeditor/ckeditor5-basic-styles/src/bold.js";
Expand Down Expand Up @@ -30,9 +31,10 @@ import "./variables.css";
import "./content-styles.css";
import "./custom-content-styles.css";

class Editor extends BalloonEditor {}
class BalloonEditor extends BalloonEditorBase {}
class ClassicEditor extends ClassicEditorBase {}

Editor.builtinPlugins = [
const plugins = [
Autoformat,
BlockQuote,
Bold,
Expand All @@ -57,7 +59,7 @@ Editor.builtinPlugins = [
WordCount,
];

Editor.defaultConfig = {
const config = {
toolbar: {
items: [
"undo",
Expand Down Expand Up @@ -97,9 +99,15 @@ Editor.defaultConfig = {
},
};

BalloonEditor.builtinPlugins = plugins;
ClassicEditor.builtinPlugins = plugins;

BalloonEditor.defaultConfig = config;
ClassicEditor.defaultConfig = config;

addMissingTranslationsDe();
addMissingTranslationsEn();
addMissingTranslationsEs();
addMissingTranslationsUk();

export default Editor;
export default { BalloonEditor, ClassicEditor };

0 comments on commit 3b4a4c9

Please sign in to comment.