import ClassicEditorBase from '@ckeditor/ckeditor5-editor-classic/src/classiceditor'
import BalloonEditor from '@ckeditor/ckeditor5-editor-balloon/src/ballooneditor'
import EssentialsPlugin from '@ckeditor/ckeditor5-essentials/src/essentials'
import BoldPlugin from '@ckeditor/ckeditor5-basic-styles/src/bold'
import ItalicPlugin from '@ckeditor/ckeditor5-basic-styles/src/italic'
import LinkPlugin from '@ckeditor/ckeditor5-link/src/link'
import ListPlugin from '@ckeditor/ckeditor5-list/src/todolist'
import ParagraphPlugin from '@ckeditor/ckeditor5-paragraph/src/paragraph'
import '@ckeditor/ckeditor5-build-classic/build/translations/sk'

class ClassicEditor extends ClassicEditorBase {}

const plugins = [
  EssentialsPlugin,
  BoldPlugin,
  ItalicPlugin,
  LinkPlugin,
  ParagraphPlugin,
  ListPlugin
]

ClassicEditor.builtinPlugins = plugins
BalloonEditor.builtinPlugins = plugins

const config = {
  toolbar: {
    items: ['bold', 'italic', 'link', 'todoList', 'undo', 'redo']
  },
  language: 'sk'
}

ClassicEditor.defaultConfig = config
BalloonEditor.defaultConfig = config

export default { ClassicEditor, BalloonEditor }
