Skip to content

Commit

Permalink
✨ [#140] Add 'table' plugin to CKEditor
Browse files Browse the repository at this point in the history
  • Loading branch information
annashamray committed Jan 21, 2022
1 parent 65adab7 commit 60d1f0e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
9 changes: 9 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 @@ -36,6 +36,7 @@
"@ckeditor/ckeditor5-list": "^31.0.0",
"@ckeditor/ckeditor5-markdown-gfm": "^31.0.0",
"@ckeditor/ckeditor5-paragraph": "^31.0.0",
"@ckeditor/ckeditor5-table": "^31.0.0",
"@ckeditor/ckeditor5-theme-lark": "^31.0.0",
"@emotion/react": "^11.5.0",
"@emotion/styled": "^11.3.0",
Expand Down
8 changes: 8 additions & 0 deletions src/open_inwoner/js/components/ckeditor/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload'
import ImageStyle from '@ckeditor/ckeditor5-image/src/imagestyle'
import ImageToolbar from '@ckeditor/ckeditor5-image/src/imagetoolbar'
import ImageCaption from '@ckeditor/ckeditor5-image/src/imagecaption'
import Table from '@ckeditor/ckeditor5-table/src/table';
import TableToolbar from '@ckeditor/ckeditor5-table/src/tabletoolbar'
import FilerImageAdapterPlugin from './plugins/filer/plugin'

export default class ClassicEditor extends ClassicEditorBase {}
Expand All @@ -38,6 +40,8 @@ ClassicEditor.builtinPlugins = [
ImageCaption,
ImageStyle,
FilerImageAdapterPlugin,
Table,
TableToolbar,
]

// Editor configuration.
Expand All @@ -58,6 +62,7 @@ ClassicEditor.defaultConfig = {
'indent',
'|',
'uploadImage',
'insertTable',
'|',
'undo',
'redo',
Expand All @@ -76,6 +81,9 @@ ClassicEditor.defaultConfig = {
types: ['jpeg', 'png', 'gif'],
},
},
table: {
contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells' ]
},
}

export const getEditor = (node) => {
Expand Down

0 comments on commit 60d1f0e

Please sign in to comment.