2022-07-26 01:20:58 +02:00
/ * *
* @ license Copyright ( c ) 2014 - 2022 , CKSource Holding sp . z o . o . All rights reserved .
* For licensing , see LICENSE . md or https : //ckeditor.com/legal/ckeditor-oss-license
* /
import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor.js' ;
import Alignment from '@ckeditor/ckeditor5-alignment/src/alignment.js' ;
import Autoformat from '@ckeditor/ckeditor5-autoformat/src/autoformat.js' ;
import Base64UploadAdapter from '@ckeditor/ckeditor5-upload/src/adapters/base64uploadadapter.js' ;
import BlockQuote from '@ckeditor/ckeditor5-block-quote/src/blockquote.js' ;
import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold.js' ;
import Code from '@ckeditor/ckeditor5-basic-styles/src/code.js' ;
import CodeBlock from '@ckeditor/ckeditor5-code-block/src/codeblock.js' ;
import Essentials from '@ckeditor/ckeditor5-essentials/src/essentials.js' ;
import FindAndReplace from '@ckeditor/ckeditor5-find-and-replace/src/findandreplace.js' ;
import FontBackgroundColor from '@ckeditor/ckeditor5-font/src/fontbackgroundcolor.js' ;
import FontColor from '@ckeditor/ckeditor5-font/src/fontcolor.js' ;
import FontFamily from '@ckeditor/ckeditor5-font/src/fontfamily.js' ;
import FontSize from '@ckeditor/ckeditor5-font/src/fontsize.js' ;
import GeneralHtmlSupport from '@ckeditor/ckeditor5-html-support/src/generalhtmlsupport.js' ;
import Heading from '@ckeditor/ckeditor5-heading/src/heading.js' ;
import Highlight from '@ckeditor/ckeditor5-highlight/src/highlight.js' ;
import HorizontalLine from '@ckeditor/ckeditor5-horizontal-line/src/horizontalline.js' ;
import HtmlComment from '@ckeditor/ckeditor5-html-support/src/htmlcomment.js' ;
import HtmlEmbed from '@ckeditor/ckeditor5-html-embed/src/htmlembed.js' ;
import Image from '@ckeditor/ckeditor5-image/src/image.js' ;
import ImageResize from '@ckeditor/ckeditor5-image/src/imageresize.js' ;
import ImageStyle from '@ckeditor/ckeditor5-image/src/imagestyle.js' ;
import ImageToolbar from '@ckeditor/ckeditor5-image/src/imagetoolbar.js' ;
import ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload.js' ;
import Indent from '@ckeditor/ckeditor5-indent/src/indent.js' ;
import IndentBlock from '@ckeditor/ckeditor5-indent/src/indentblock.js' ;
import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic.js' ;
import Link from '@ckeditor/ckeditor5-link/src/link.js' ;
import LinkImage from '@ckeditor/ckeditor5-link/src/linkimage.js' ;
import List from '@ckeditor/ckeditor5-list/src/list.js' ;
import ListProperties from '@ckeditor/ckeditor5-list/src/listproperties.js' ;
import Markdown from '@ckeditor/ckeditor5-markdown-gfm/src/markdown.js' ;
import MediaEmbed from '@ckeditor/ckeditor5-media-embed/src/mediaembed.js' ;
import MediaEmbedToolbar from '@ckeditor/ckeditor5-media-embed/src/mediaembedtoolbar.js' ;
import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph.js' ;
import PasteFromOffice from '@ckeditor/ckeditor5-paste-from-office/src/pastefromoffice.js' ;
import RemoveFormat from '@ckeditor/ckeditor5-remove-format/src/removeformat.js' ;
import SourceEditing from '@ckeditor/ckeditor5-source-editing/src/sourceediting.js' ;
import SpecialCharacters from '@ckeditor/ckeditor5-special-characters/src/specialcharacters.js' ;
import SpecialCharactersArrows from '@ckeditor/ckeditor5-special-characters/src/specialcharactersarrows.js' ;
import SpecialCharactersCurrency from '@ckeditor/ckeditor5-special-characters/src/specialcharacterscurrency.js' ;
import SpecialCharactersEssentials from '@ckeditor/ckeditor5-special-characters/src/specialcharactersessentials.js' ;
import SpecialCharactersLatin from '@ckeditor/ckeditor5-special-characters/src/specialcharacterslatin.js' ;
import SpecialCharactersMathematical from '@ckeditor/ckeditor5-special-characters/src/specialcharactersmathematical.js' ;
import SpecialCharactersText from '@ckeditor/ckeditor5-special-characters/src/specialcharacterstext.js' ;
import Strikethrough from '@ckeditor/ckeditor5-basic-styles/src/strikethrough.js' ;
import Subscript from '@ckeditor/ckeditor5-basic-styles/src/subscript.js' ;
import Superscript from '@ckeditor/ckeditor5-basic-styles/src/superscript.js' ;
import Table from '@ckeditor/ckeditor5-table/src/table.js' ;
import TableCaption from '@ckeditor/ckeditor5-table/src/tablecaption.js' ;
import TableCellProperties from '@ckeditor/ckeditor5-table/src/tablecellproperties' ;
import TableColumnResize from '@ckeditor/ckeditor5-table/src/tablecolumnresize.js' ;
import TableProperties from '@ckeditor/ckeditor5-table/src/tableproperties' ;
import TableToolbar from '@ckeditor/ckeditor5-table/src/tabletoolbar.js' ;
import Underline from '@ckeditor/ckeditor5-basic-styles/src/underline.js' ;
import WordCount from '@ckeditor/ckeditor5-word-count/src/wordcount.js' ;
import EditorWatchdog from '@ckeditor/ckeditor5-watchdog/src/editorwatchdog.js' ;
2022-07-29 01:03:17 +02:00
import PartDBLabel from "./plugins/PartDBLabel/PartDBLabel" ;
2022-07-26 01:20:58 +02:00
class Editor extends ClassicEditor { }
// Plugins to include in the build.
Editor . builtinPlugins = [
Alignment ,
Autoformat ,
Base64UploadAdapter ,
BlockQuote ,
Bold ,
Code ,
CodeBlock ,
Essentials ,
FindAndReplace ,
FontBackgroundColor ,
FontColor ,
FontFamily ,
FontSize ,
GeneralHtmlSupport ,
Heading ,
Highlight ,
HorizontalLine ,
HtmlComment ,
HtmlEmbed ,
Image ,
ImageResize ,
ImageStyle ,
ImageToolbar ,
ImageUpload ,
Indent ,
IndentBlock ,
Italic ,
Link ,
LinkImage ,
List ,
ListProperties ,
MediaEmbed ,
MediaEmbedToolbar ,
Paragraph ,
PasteFromOffice ,
RemoveFormat ,
SourceEditing ,
SpecialCharacters ,
SpecialCharactersArrows ,
SpecialCharactersCurrency ,
SpecialCharactersEssentials ,
SpecialCharactersLatin ,
SpecialCharactersMathematical ,
SpecialCharactersText ,
Strikethrough ,
Subscript ,
Superscript ,
Table ,
TableCaption ,
TableCellProperties ,
TableColumnResize ,
TableProperties ,
TableToolbar ,
Underline ,
2022-07-29 01:03:17 +02:00
WordCount ,
PartDBLabel
2022-07-26 01:20:58 +02:00
] ;
// Editor configuration.
Editor . defaultConfig = {
toolbar : {
items : [
'heading' ,
'alignment' ,
'|' ,
'bold' ,
'italic' ,
'underline' ,
'strikethrough' ,
'subscript' ,
'superscript' ,
'removeFormat' ,
'highlight' ,
'|' ,
'fontBackgroundColor' ,
'fontColor' ,
'fontSize' ,
'|' ,
'fontFamily' ,
'link' ,
'bulletedList' ,
'numberedList' ,
'outdent' ,
'indent' ,
'|' ,
'specialCharacters' ,
'horizontalLine' ,
'|' ,
'imageUpload' ,
'blockQuote' ,
'insertTable' ,
'mediaEmbed' ,
'code' ,
'codeBlock' ,
'htmlEmbed' ,
'|' ,
'undo' ,
'redo' ,
'findAndReplace' ,
'sourceEditing' ,
2022-07-29 21:07:54 +02:00
'|' ,
'partdb_label' ,
] ,
shouldNotGroupWhenFull : true
2022-07-26 01:20:58 +02:00
} ,
language : 'en' ,
2022-07-29 21:22:10 +02:00
fontFamily : {
options : [
'default' ,
'DejaVu Sans Mono, monospace' ,
'DejaVu Sans, sans-serif' ,
'DejaVu Serif, serif' ,
'Helvetica, Arial, sans-serif' ,
'Times New Roman, Times, serif' ,
2023-07-02 03:26:56 +02:00
'Courier New, Courier, monospace' ,
'Unifont, monospace' ,
2022-07-29 21:22:10 +02:00
] ,
supportAllValues : true
} ,
'fontSize' : {
options : [
2022-09-21 16:16:59 +02:00
'default' ,
2022-09-21 21:49:09 +02:00
6 ,
7 ,
2022-07-29 21:22:10 +02:00
8 ,
2022-09-21 16:16:59 +02:00
9 ,
10 ,
2022-07-29 21:22:10 +02:00
11 ,
2022-09-21 16:16:59 +02:00
12 ,
2022-07-29 21:22:10 +02:00
13 ,
2022-09-21 16:16:59 +02:00
14 ,
15 ,
16 ,
2022-07-29 21:22:10 +02:00
17 ,
2022-09-21 16:16:59 +02:00
18 ,
2022-07-29 21:22:10 +02:00
19 ,
2022-09-21 16:16:59 +02:00
20 ,
2022-07-29 21:22:10 +02:00
21 ,
] ,
supportAllValues : true
} ,
2022-09-25 00:47:53 +02:00
// Allow all HTML features for our labels
htmlSupport : {
allow : [
{
name : /.*/ ,
attributes : true ,
classes : true ,
styles : true
}
] ,
disallow : [
//Some rudimentary protection against XSS, even if it is not really needed as this is only parsed by DOMHTML which does not support any kind of script execution.
{
name : /^(head|body|html|script)$/i ,
} ,
{
name : /.*/ ,
attributes : /^on.*/i
}
]
} ,
2022-07-26 01:20:58 +02:00
image : {
toolbar : [
'imageTextAlternative' ,
'imageStyle:inline' ,
'imageStyle:block' ,
'imageStyle:side' ,
'linkImage'
]
} ,
table : {
contentToolbar : [
'tableColumn' ,
'tableRow' ,
'mergeTableCells' ,
'tableCellProperties' ,
'tableProperties'
]
2022-09-21 21:49:09 +02:00
} ,
2022-07-26 01:20:58 +02:00
} ;
export default { Editor , EditorWatchdog } ;