@_sh/strapi-plugin-ckeditor 2.1.2 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +376 -197
- package/admin/src/Input/components/Editor.js +133 -0
- package/admin/src/{components/Input/MediaLib/index.js → Input/components/MediaLib.js} +20 -23
- package/admin/src/Input/config/index.js +2 -0
- package/admin/src/Input/config/language.js +45 -0
- package/admin/src/Input/config/plugins.js +24 -0
- package/admin/src/Input/config/presets.js +18 -0
- package/admin/src/Input/config/styling.js +30 -0
- package/admin/src/Input/index.js +67 -0
- package/admin/src/{components/Input/CKEditor → Input}/plugins/StrapiMediaLib.js +8 -10
- package/admin/src/{components/Input/CKEditor → Input}/plugins/StrapiUploadAdapter.js +16 -34
- package/admin/src/{components/Input/CKEditor → Input}/plugins/index.js +1 -1
- package/admin/src/Input/presets/colors.js +122 -0
- package/admin/src/Input/presets/default.js +378 -0
- package/admin/src/Input/presets/index.js +7 -0
- package/admin/src/Input/theme/additional.js +189 -0
- package/admin/src/{components/Input/CKEditor → Input}/theme/common.js +18 -20
- package/admin/src/{components/Input/CKEditor → Input}/theme/dark.js +28 -21
- package/admin/src/{components/Input/CKEditor → Input}/theme/light.js +28 -20
- package/admin/src/index.js +76 -106
- package/admin/src/pluginId.js +7 -0
- package/admin/src/utils/exportToGlobal.js +8 -0
- package/admin/src/utils/{getEditorConfig.js → getPluginConfig.js} +10 -12
- package/admin/src/utils/getPresetsOptions.js +38 -0
- package/package.json +12 -44
- package/server/controllers/config.js +13 -11
- package/server/controllers/index.js +3 -3
- package/server/register.js +1 -1
- package/server/routes/index.js +7 -12
- package/server/services/config.js +16 -11
- package/server/services/index.js +3 -3
- package/admin/src/components/Input/CKEditor/configs/base.js +0 -639
- package/admin/src/components/Input/CKEditor/configs/blockBalloon.js +0 -25
- package/admin/src/components/Input/CKEditor/configs/index.js +0 -11
- package/admin/src/components/Input/CKEditor/configs/toolbar.js +0 -17
- package/admin/src/components/Input/CKEditor/configs/toolbarBalloon.js +0 -17
- package/admin/src/components/Input/CKEditor/configuration.js +0 -167
- package/admin/src/components/Input/CKEditor/index.js +0 -119
- package/admin/src/components/Input/CKEditor/styling.js +0 -24
- package/admin/src/components/Input/CKEditor/theme/additional.js +0 -187
- package/admin/src/components/Input/index.js +0 -48
- package/admin/src/utils/pluginId.js +0 -5
- /package/admin/src/{components/CKEditorIcon.js → CKEditorIcon.js} +0 -0
- /package/admin/src/{components/Input/CKEditor → Input}/theme/index.js +0 -0
|
@@ -1,639 +0,0 @@
|
|
|
1
|
-
import ckeditor5Dll from "ckeditor5/build/ckeditor5-dll.js";
|
|
2
|
-
import ckeditor5AlignmentDll from "@ckeditor/ckeditor5-alignment/build/alignment.js";
|
|
3
|
-
import ckeditor5AutoformatDll from "@ckeditor/ckeditor5-autoformat/build/autoformat.js";
|
|
4
|
-
import ckeditor5AutosaveDll from "@ckeditor/ckeditor5-autosave/build/autosave.js";
|
|
5
|
-
import ckeditor5BasicStylesDll from "@ckeditor/ckeditor5-basic-styles/build/basic-styles.js";
|
|
6
|
-
import ckeditor5BlockQuoteDll from "@ckeditor/ckeditor5-block-quote/build/block-quote.js";
|
|
7
|
-
import ckeditor5CodeBlockDll from "@ckeditor/ckeditor5-code-block/build/code-block.js";
|
|
8
|
-
import ckeditor5EssentialsDll from "@ckeditor/ckeditor5-essentials/build/essentials.js";
|
|
9
|
-
import ckeditor5HeadingDll from "@ckeditor/ckeditor5-heading/build/heading.js";
|
|
10
|
-
import ckeditor5HtmlEmbedDll from "@ckeditor/ckeditor5-html-embed/build/html-embed.js";
|
|
11
|
-
import ckeditor5HtmlSupportDll from "@ckeditor/ckeditor5-html-support/build/html-support.js";
|
|
12
|
-
import ckeditor5HorizontalLineDll from "@ckeditor/ckeditor5-horizontal-line/build/horizontal-line.js";
|
|
13
|
-
import ckeditor5MediaEmbedDll from "@ckeditor/ckeditor5-media-embed/build/media-embed.js";
|
|
14
|
-
import ckeditor5ImageDll from "@ckeditor/ckeditor5-image/build/image.js";
|
|
15
|
-
import ckeditor5IndentDll from "@ckeditor/ckeditor5-indent/build/indent.js";
|
|
16
|
-
import ckeditor5LinkDll from "@ckeditor/ckeditor5-link/build/link.js";
|
|
17
|
-
import ckeditor5ListDll from "@ckeditor/ckeditor5-list/build/list.js";
|
|
18
|
-
import ckeditor5PasteFromOfficeDll from "@ckeditor/ckeditor5-paste-from-office/build/paste-from-office.js";
|
|
19
|
-
import ckeditor5RemoveFormatDll from "@ckeditor/ckeditor5-remove-format/build/remove-format.js";
|
|
20
|
-
import ckeditor5TableDll from "@ckeditor/ckeditor5-table/build/table.js";
|
|
21
|
-
import ckeditor5WordCountDll from "@ckeditor/ckeditor5-word-count/build/word-count.js";
|
|
22
|
-
import ckeditor5FindAndReplaceDll from "@ckeditor/ckeditor5-find-and-replace/build/find-and-replace.js";
|
|
23
|
-
import ckeditor5SpecialCharactersDll from "@ckeditor/ckeditor5-special-characters/build/special-characters.js";
|
|
24
|
-
import ckeditor5PageBreakDll from "@ckeditor/ckeditor5-page-break/build/page-break.js";
|
|
25
|
-
import ckeditor5SourceEditingDll from "@ckeditor/ckeditor5-source-editing/build/source-editing.js";
|
|
26
|
-
import ckeditor5LanguageDll from "@ckeditor/ckeditor5-language/build/language.js";
|
|
27
|
-
import ckeditor5HighlightDll from "@ckeditor/ckeditor5-highlight/build/highlight.js";
|
|
28
|
-
import ckeditor5StyleDll from "@ckeditor/ckeditor5-style/build/style.js";
|
|
29
|
-
import ckeditor5MentionDll from "@ckeditor/ckeditor5-mention/build/mention.js";
|
|
30
|
-
import ckeditor5FontDll from "@ckeditor/ckeditor5-font/build/font.js";
|
|
31
|
-
import ckeditor5ShowBlocksDll from "@ckeditor/ckeditor5-show-blocks/build/show-blocks.js";
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
import sanitizeHtml from "sanitize-html";
|
|
35
|
-
|
|
36
|
-
import * as strapiPlugins from '../plugins'
|
|
37
|
-
window.CKEditor5.strapiPlugins = strapiPlugins;
|
|
38
|
-
|
|
39
|
-
const w = {
|
|
40
|
-
Alignment: window.CKEditor5.alignment.Alignment,
|
|
41
|
-
Autoformat: window.CKEditor5.autoformat.Autoformat,
|
|
42
|
-
AutoImage: window.CKEditor5.image.AutoImage,
|
|
43
|
-
AutoLink: window.CKEditor5.link.AutoLink,
|
|
44
|
-
Autosave: window.CKEditor5.autosave.Autosave,
|
|
45
|
-
BalloonToolbar: window.CKEditor5.ui.BalloonToolbar,
|
|
46
|
-
BlockQuote: window.CKEditor5.blockQuote.BlockQuote,
|
|
47
|
-
BlockToolbar: window.CKEditor5.ui.BlockToolbar,
|
|
48
|
-
Bold: window.CKEditor5.basicStyles.Bold,
|
|
49
|
-
Code: window.CKEditor5.basicStyles.Code,
|
|
50
|
-
CodeBlock: window.CKEditor5.codeBlock.CodeBlock,
|
|
51
|
-
DataFilter: window.CKEditor5.htmlSupport.DataFilter,
|
|
52
|
-
DataSchema: window.CKEditor5.htmlSupport.DataSchema,
|
|
53
|
-
Essentials: window.CKEditor5.essentials.Essentials,
|
|
54
|
-
FindAndReplace: window.CKEditor5.findAndReplace.FindAndReplace,
|
|
55
|
-
FontBackgroundColor: window.CKEditor5.font.FontBackgroundColor,
|
|
56
|
-
FontColor: window.CKEditor5.font.FontColor,
|
|
57
|
-
FontFamily: window.CKEditor5.font.FontFamily,
|
|
58
|
-
FontSize: window.CKEditor5.font.FontSize,
|
|
59
|
-
GeneralHtmlSupport: window.CKEditor5.htmlSupport.GeneralHtmlSupport,
|
|
60
|
-
Heading: window.CKEditor5.heading.Heading,
|
|
61
|
-
// HeadingButtonsUI: window.CKEditor5.heading.HeadingButtonsUI,
|
|
62
|
-
Highlight: window.CKEditor5.highlight.Highlight,
|
|
63
|
-
HorizontalLine: window.CKEditor5.horizontalLine.HorizontalLine,
|
|
64
|
-
HtmlComment: window.CKEditor5.htmlSupport.HtmlComment,
|
|
65
|
-
HtmlEmbed: window.CKEditor5.htmlEmbed.HtmlEmbed,
|
|
66
|
-
Image: window.CKEditor5.image.Image,
|
|
67
|
-
ImageCaption: window.CKEditor5.image.ImageCaption,
|
|
68
|
-
ImageInsert: window.CKEditor5.image.ImageInsert,
|
|
69
|
-
ImageResize: window.CKEditor5.image.ImageResize,
|
|
70
|
-
ImageStyle: window.CKEditor5.image.ImageStyle,
|
|
71
|
-
ImageToolbar: window.CKEditor5.image.ImageToolbar,
|
|
72
|
-
ImageUpload: window.CKEditor5.image.ImageUpload,
|
|
73
|
-
Indent: window.CKEditor5.indent.Indent,
|
|
74
|
-
IndentBlock: window.CKEditor5.indent.IndentBlock,
|
|
75
|
-
Italic: window.CKEditor5.basicStyles.Italic,
|
|
76
|
-
Link: window.CKEditor5.link.Link,
|
|
77
|
-
LinkImage: window.CKEditor5.link.LinkImage,
|
|
78
|
-
List: window.CKEditor5.list.List,
|
|
79
|
-
ListProperties: window.CKEditor5.list.ListProperties,
|
|
80
|
-
MediaEmbed: window.CKEditor5.mediaEmbed.MediaEmbed,
|
|
81
|
-
MediaEmbedToolbar: window.CKEditor5.mediaEmbed.MediaEmbedToolbar,
|
|
82
|
-
Mention: window.CKEditor5.mention.Mention,
|
|
83
|
-
PageBreak: window.CKEditor5.pageBreak.PageBreak,
|
|
84
|
-
Paragraph: window.CKEditor5.paragraph.Paragraph,
|
|
85
|
-
// ParagraphButtonUI: window.CKEditor5.paragraph.ParagraphButtonUI,
|
|
86
|
-
PasteFromOffice: window.CKEditor5.pasteFromOffice.PasteFromOffice,
|
|
87
|
-
PictureEditing: window.CKEditor5.image.PictureEditing,
|
|
88
|
-
RemoveFormat: window.CKEditor5.removeFormat.RemoveFormat,
|
|
89
|
-
SourceEditing: window.CKEditor5.sourceEditing.SourceEditing,
|
|
90
|
-
SpecialCharacters: window.CKEditor5.specialCharacters.SpecialCharacters,
|
|
91
|
-
SpecialCharactersArrows: window.CKEditor5.specialCharacters.SpecialCharactersArrows,
|
|
92
|
-
SpecialCharactersCurrency: window.CKEditor5.specialCharacters.SpecialCharactersCurrency,
|
|
93
|
-
// SpecialCharactersEssentials: window.CKEditor5.specialCharacters.SpecialCharactersEssentials,
|
|
94
|
-
SpecialCharactersLatin: window.CKEditor5.specialCharacters.SpecialCharactersLatin,
|
|
95
|
-
SpecialCharactersMathematical: window.CKEditor5.specialCharacters.SpecialCharactersMathematical,
|
|
96
|
-
SpecialCharactersText: window.CKEditor5.specialCharacters.SpecialCharactersText,
|
|
97
|
-
StrapiMediaLib: window.CKEditor5.strapiPlugins.StrapiMediaLib,
|
|
98
|
-
StrapiUploadAdapter: window.CKEditor5.strapiPlugins.StrapiUploadAdapter,
|
|
99
|
-
Strikethrough: window.CKEditor5.basicStyles.Strikethrough,
|
|
100
|
-
Style: window.CKEditor5.style.Style,
|
|
101
|
-
Subscript: window.CKEditor5.basicStyles.Subscript,
|
|
102
|
-
Superscript: window.CKEditor5.basicStyles.Superscript,
|
|
103
|
-
ShowBlocks: window.CKEditor5.showBlocks.ShowBlocks,
|
|
104
|
-
Table: window.CKEditor5.table.Table,
|
|
105
|
-
TableCaption: window.CKEditor5.table.TableCaption,
|
|
106
|
-
TableCellProperties: window.CKEditor5.table.TableCellProperties,
|
|
107
|
-
TableColumnResize: window.CKEditor5.table.TableColumnResize,
|
|
108
|
-
TableProperties: window.CKEditor5.table.TableProperties,
|
|
109
|
-
TableToolbar: window.CKEditor5.table.TableToolbar,
|
|
110
|
-
TextPartLanguage: window.CKEditor5.language.TextPartLanguage,
|
|
111
|
-
TodoList: window.CKEditor5.list.TodoList,
|
|
112
|
-
Underline: window.CKEditor5.basicStyles.Underline,
|
|
113
|
-
WordCount: window.CKEditor5.wordCount.WordCount
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
const REDUCED_MATERIAL_COLORS = [
|
|
117
|
-
{ label: "Red 50", color: "#ffebee" },
|
|
118
|
-
{ label: "Purple 50", color: "#f3e5f5" },
|
|
119
|
-
{ label: "Indigo 50", color: "#e8eaf6" },
|
|
120
|
-
{ label: "Blue 50", color: "#e3f2fd" },
|
|
121
|
-
{ label: "Cyan 50", color: "#e0f7fa" },
|
|
122
|
-
{ label: "Teal 50", color: "#e0f2f1" },
|
|
123
|
-
{ label: "Light green 50", color: "#f1f8e9" },
|
|
124
|
-
{ label: "Lime 50", color: "#f9fbe7" },
|
|
125
|
-
{ label: "Amber 50", color: "#fff8e1" },
|
|
126
|
-
{ label: "Orange 50", color: "#fff3e0" },
|
|
127
|
-
{ label: "Grey 50", color: "#fafafa" },
|
|
128
|
-
{ label: "Blue grey 50", color: "#eceff1" },
|
|
129
|
-
{ label: "Red 100", color: "#ffcdd2" },
|
|
130
|
-
{ label: "Purple 100", color: "#e1bee7" },
|
|
131
|
-
{ label: "Indigo 100", color: "#c5cae9" },
|
|
132
|
-
{ label: "Blue 100", color: "#bbdefb" },
|
|
133
|
-
{ label: "Cyan 100", color: "#b2ebf2" },
|
|
134
|
-
{ label: "Teal 100", color: "#b2dfdb" },
|
|
135
|
-
{ label: "Light green 100", color: "#dcedc8" },
|
|
136
|
-
{ label: "Lime 100", color: "#f0f4c3" },
|
|
137
|
-
{ label: "Amber 100", color: "#ffecb3" },
|
|
138
|
-
{ label: "Orange 100", color: "#ffe0b2" },
|
|
139
|
-
{ label: "Grey 100", color: "#f5f5f5" },
|
|
140
|
-
{ label: "Blue grey 100", color: "#cfd8dc" },
|
|
141
|
-
{ label: "Red 200", color: "#ef9a9a" },
|
|
142
|
-
{ label: "Purple 200", color: "#ce93d8" },
|
|
143
|
-
{ label: "Indigo 200", color: "#9fa8da" },
|
|
144
|
-
{ label: "Blue 200", color: "#90caf9" },
|
|
145
|
-
{ label: "Cyan 200", color: "#80deea" },
|
|
146
|
-
{ label: "Teal 200", color: "#80cbc4" },
|
|
147
|
-
{ label: "Light green 200", color: "#c5e1a5" },
|
|
148
|
-
{ label: "Lime 200", color: "#e6ee9c" },
|
|
149
|
-
{ label: "Amber 200", color: "#ffe082" },
|
|
150
|
-
{ label: "Orange 200", color: "#ffcc80" },
|
|
151
|
-
{ label: "Grey 200", color: "#eeeeee" },
|
|
152
|
-
{ label: "Blue grey 200", color: "#b0bec5" },
|
|
153
|
-
{ label: "Red 300", color: "#e57373" },
|
|
154
|
-
{ label: "Purple 300", color: "#ba68c8" },
|
|
155
|
-
{ label: "Indigo 300", color: "#7986cb" },
|
|
156
|
-
{ label: "Blue 300", color: "#64b5f6" },
|
|
157
|
-
{ label: "Cyan 300", color: "#4dd0e1" },
|
|
158
|
-
{ label: "Teal 300", color: "#4db6ac" },
|
|
159
|
-
{ label: "Light green 300", color: "#aed581" },
|
|
160
|
-
{ label: "Lime 300", color: "#dce775" },
|
|
161
|
-
{ label: "Amber 300", color: "#ffd54f" },
|
|
162
|
-
{ label: "Orange 300", color: "#ffb74d" },
|
|
163
|
-
{ label: "Grey 300", color: "#e0e0e0" },
|
|
164
|
-
{ label: "Blue grey 300", color: "#90a4ae" },
|
|
165
|
-
{ label: "Red 400", color: "#ef5350" },
|
|
166
|
-
{ label: "Purple 400", color: "#ab47bc" },
|
|
167
|
-
{ label: "Indigo 400", color: "#5c6bc0" },
|
|
168
|
-
{ label: "Blue 400", color: "#42a5f5" },
|
|
169
|
-
{ label: "Cyan 400", color: "#26c6da" },
|
|
170
|
-
{ label: "Teal 400", color: "#26a69a" },
|
|
171
|
-
{ label: "Light green 400", color: "#9ccc65" },
|
|
172
|
-
{ label: "Lime 400", color: "#d4e157" },
|
|
173
|
-
{ label: "Amber 400", color: "#ffca28" },
|
|
174
|
-
{ label: "Orange 400", color: "#ffa726" },
|
|
175
|
-
{ label: "Grey 400", color: "#bdbdbd" },
|
|
176
|
-
{ label: "Blue grey 400", color: "#78909c" },
|
|
177
|
-
{ label: "Red 500", color: "#f44336" },
|
|
178
|
-
{ label: "Purple 500", color: "#9c27b0" },
|
|
179
|
-
{ label: "Indigo 500", color: "#3f51b5" },
|
|
180
|
-
{ label: "Blue 500", color: "#2196f3" },
|
|
181
|
-
{ label: "Cyan 500", color: "#00bcd4" },
|
|
182
|
-
{ label: "Teal 500", color: "#009688" },
|
|
183
|
-
{ label: "Light green 500", color: "#8bc34a" },
|
|
184
|
-
{ label: "Lime 500", color: "#cddc39" },
|
|
185
|
-
{ label: "Amber 500", color: "#ffc107" },
|
|
186
|
-
{ label: "Orange 500", color: "#ff9800" },
|
|
187
|
-
{ label: "Grey 500", color: "#9e9e9e" },
|
|
188
|
-
{ label: "Blue grey 500", color: "#607d8b" },
|
|
189
|
-
{ label: "Red 600", color: "#e53935" },
|
|
190
|
-
{ label: "Purple 600", color: "#8e24aa" },
|
|
191
|
-
{ label: "Indigo 600", color: "#3949ab" },
|
|
192
|
-
{ label: "Blue 600", color: "#1e88e5" },
|
|
193
|
-
{ label: "Cyan 600", color: "#00acc1" },
|
|
194
|
-
{ label: "Teal 600", color: "#00897b" },
|
|
195
|
-
{ label: "Light green 600", color: "#7cb342" },
|
|
196
|
-
{ label: "Lime 600", color: "#c0ca33" },
|
|
197
|
-
{ label: "Amber 600", color: "#ffb300" },
|
|
198
|
-
{ label: "Orange 600", color: "#fb8c00" },
|
|
199
|
-
{ label: "Grey 600", color: "#757575" },
|
|
200
|
-
{ label: "Blue grey 600", color: "#546e7a" },
|
|
201
|
-
{ label: "Red 700", color: "#d32f2f" },
|
|
202
|
-
{ label: "Purple 700", color: "#7b1fa2" },
|
|
203
|
-
{ label: "Indigo 700", color: "#303f9f" },
|
|
204
|
-
{ label: "Blue 700", color: "#1976d2" },
|
|
205
|
-
{ label: "Cyan 700", color: "#0097a7" },
|
|
206
|
-
{ label: "Teal 700", color: "#00796b" },
|
|
207
|
-
{ label: "Light green 700", color: "#689f38" },
|
|
208
|
-
{ label: "Lime 700", color: "#afb42b" },
|
|
209
|
-
{ label: "Amber 700", color: "#ffa000" },
|
|
210
|
-
{ label: "Orange 700", color: "#f57c00" },
|
|
211
|
-
{ label: "Grey 700", color: "#616161" },
|
|
212
|
-
{ label: "Blue grey 700", color: "#455a64" },
|
|
213
|
-
{ label: "Red 800", color: "#c62828" },
|
|
214
|
-
{ label: "Purple 800", color: "#6a1b9a" },
|
|
215
|
-
{ label: "Indigo 800", color: "#283593" },
|
|
216
|
-
{ label: "Blue 800", color: "#1565c0" },
|
|
217
|
-
{ label: "Cyan 800", color: "#00838f" },
|
|
218
|
-
{ label: "Teal 800", color: "#00695c" },
|
|
219
|
-
{ label: "Light green 800", color: "#558b2f" },
|
|
220
|
-
{ label: "Lime 800", color: "#9e9d24" },
|
|
221
|
-
{ label: "Amber 800", color: "#ff8f00" },
|
|
222
|
-
{ label: "Orange 800", color: "#ef6c00" },
|
|
223
|
-
{ label: "Grey 800", color: "#424242" },
|
|
224
|
-
{ label: "Blue grey 800", color: "#37474f" },
|
|
225
|
-
{ label: "Red 900", color: "#b71c1c" },
|
|
226
|
-
{ label: "Purple 900", color: "#4a148c" },
|
|
227
|
-
{ label: "Indigo 900", color: "#1a237e" },
|
|
228
|
-
{ label: "Blue 900", color: "#0d47a1" },
|
|
229
|
-
{ label: "Cyan 900", color: "#006064" },
|
|
230
|
-
{ label: "Teal 900", color: "#004d40" },
|
|
231
|
-
{ label: "Light green 900", color: "#33691e" },
|
|
232
|
-
{ label: "Lime 900", color: "#827717" },
|
|
233
|
-
{ label: "Amber 900", color: "#ff6f00" },
|
|
234
|
-
{ label: "Orange 900", color: "#e65100" },
|
|
235
|
-
{ label: "Grey 900", color: "#212121" },
|
|
236
|
-
{ label: "Blue grey 900", color: "#263238" },
|
|
237
|
-
];
|
|
238
|
-
|
|
239
|
-
const base = {
|
|
240
|
-
fontFamily: {
|
|
241
|
-
supportAllValues: true,
|
|
242
|
-
},
|
|
243
|
-
fontSize: {
|
|
244
|
-
options: [10, 12, 14, "default", 18, 20, 22],
|
|
245
|
-
supportAllValues: true,
|
|
246
|
-
},
|
|
247
|
-
fontColor: {
|
|
248
|
-
columns: 12,
|
|
249
|
-
documentColors: 12,
|
|
250
|
-
colors: REDUCED_MATERIAL_COLORS,
|
|
251
|
-
},
|
|
252
|
-
fontBackgroundColor: {
|
|
253
|
-
columns: 12,
|
|
254
|
-
documentColors: 12,
|
|
255
|
-
colors: REDUCED_MATERIAL_COLORS,
|
|
256
|
-
},
|
|
257
|
-
heading: {
|
|
258
|
-
options: [
|
|
259
|
-
{ model: "paragraph", title: "Paragraph", class: "ck-heading_paragraph" },
|
|
260
|
-
{ model: "heading1", view: "h1", title: "Heading 1", class: "ck-heading_heading1" },
|
|
261
|
-
{ model: "heading2", view: "h2", title: "Heading 2", class: "ck-heading_heading2" },
|
|
262
|
-
{ model: "heading3", view: "h3", title: "Heading 3", class: "ck-heading_heading3" },
|
|
263
|
-
{ model: "heading4", view: "h4", title: "Heading 4", class: "ck-heading_heading4" },
|
|
264
|
-
{ model: "heading5", view: "h5", title: "Heading 5", class: "ck-heading_heading5" },
|
|
265
|
-
{ model: "heading6", view: "h6", title: "Heading 6", class: "ck-heading_heading6" },
|
|
266
|
-
],
|
|
267
|
-
},
|
|
268
|
-
htmlSupport: {
|
|
269
|
-
allow: [
|
|
270
|
-
{
|
|
271
|
-
name: /.*/,
|
|
272
|
-
attributes: true,
|
|
273
|
-
classes: true,
|
|
274
|
-
styles: true,
|
|
275
|
-
},
|
|
276
|
-
],
|
|
277
|
-
disallow: [
|
|
278
|
-
{
|
|
279
|
-
attributes: [
|
|
280
|
-
{ key: /^on(.*)/i, value: true },
|
|
281
|
-
{ key: /.*/, value: /(\b)(on\S+)(\s*)=|javascript:|(<\s*)(\/*)script/i },
|
|
282
|
-
{ key: /.*/, value: /data:(?!image\/(png|jpeg|gif|webp))/i },
|
|
283
|
-
],
|
|
284
|
-
},
|
|
285
|
-
{ name: "script" },
|
|
286
|
-
],
|
|
287
|
-
},
|
|
288
|
-
htmlEmbed: {
|
|
289
|
-
showPreviews: true,
|
|
290
|
-
sanitizeHtml: (inputHtml) => {
|
|
291
|
-
const outputHtml = sanitizeHtml(inputHtml);
|
|
292
|
-
return {
|
|
293
|
-
html: outputHtml,
|
|
294
|
-
hasChanged: true,
|
|
295
|
-
};
|
|
296
|
-
},
|
|
297
|
-
},
|
|
298
|
-
list: {
|
|
299
|
-
properties: {
|
|
300
|
-
styles: true,
|
|
301
|
-
startIndex: true,
|
|
302
|
-
reversed: true,
|
|
303
|
-
},
|
|
304
|
-
},
|
|
305
|
-
table: {
|
|
306
|
-
contentToolbar: [
|
|
307
|
-
"tableColumn",
|
|
308
|
-
"tableRow",
|
|
309
|
-
"mergeTableCells",
|
|
310
|
-
"tableProperties",
|
|
311
|
-
"tableCellProperties",
|
|
312
|
-
"toggleTableCaption",
|
|
313
|
-
],
|
|
314
|
-
},
|
|
315
|
-
image: {
|
|
316
|
-
styles: {
|
|
317
|
-
options: [
|
|
318
|
-
'inline', 'alignLeft', 'alignRight',
|
|
319
|
-
'alignCenter', 'alignBlockLeft', 'alignBlockRight',
|
|
320
|
-
'block', 'side'
|
|
321
|
-
]
|
|
322
|
-
},
|
|
323
|
-
resizeOptions: [
|
|
324
|
-
{
|
|
325
|
-
name: "resizeImage:original",
|
|
326
|
-
label: "Default image width",
|
|
327
|
-
value: null,
|
|
328
|
-
},
|
|
329
|
-
{
|
|
330
|
-
name: "resizeImage:50",
|
|
331
|
-
label: "50% page width",
|
|
332
|
-
value: "50",
|
|
333
|
-
},
|
|
334
|
-
{
|
|
335
|
-
name: "resizeImage:75",
|
|
336
|
-
label: "75% page width",
|
|
337
|
-
value: "75",
|
|
338
|
-
},
|
|
339
|
-
],
|
|
340
|
-
toolbar: [
|
|
341
|
-
"imageTextAlternative",
|
|
342
|
-
"toggleImageCaption",
|
|
343
|
-
"linkImage",
|
|
344
|
-
"|",
|
|
345
|
-
"imageStyle:inline",
|
|
346
|
-
"imageStyle:wrapText",
|
|
347
|
-
"imageStyle:breakText",
|
|
348
|
-
"imageStyle:side",
|
|
349
|
-
"|",
|
|
350
|
-
"resizeImage",
|
|
351
|
-
],
|
|
352
|
-
},
|
|
353
|
-
link: {
|
|
354
|
-
decorators: {
|
|
355
|
-
openInNewTab: {
|
|
356
|
-
mode: "manual",
|
|
357
|
-
label: "Open in a new tab",
|
|
358
|
-
defaultValue: true,
|
|
359
|
-
attributes: {
|
|
360
|
-
target: "_blank",
|
|
361
|
-
rel: "noopener noreferrer",
|
|
362
|
-
},
|
|
363
|
-
},
|
|
364
|
-
toggleDownloadable: {
|
|
365
|
-
mode: "manual",
|
|
366
|
-
label: "Downloadable",
|
|
367
|
-
attributes: {
|
|
368
|
-
download: "file",
|
|
369
|
-
},
|
|
370
|
-
},
|
|
371
|
-
},
|
|
372
|
-
addTargetToExternalLinks: true,
|
|
373
|
-
defaultProtocol: "https://",
|
|
374
|
-
},
|
|
375
|
-
style: {
|
|
376
|
-
definitions: [
|
|
377
|
-
{
|
|
378
|
-
name: "Title",
|
|
379
|
-
element: "h1",
|
|
380
|
-
classes: ["document-title"],
|
|
381
|
-
},
|
|
382
|
-
{
|
|
383
|
-
name: "Subtitle",
|
|
384
|
-
element: "h2",
|
|
385
|
-
classes: ["document-subtitle"],
|
|
386
|
-
},
|
|
387
|
-
{
|
|
388
|
-
name: "Callout",
|
|
389
|
-
element: "p",
|
|
390
|
-
classes: ["callout"],
|
|
391
|
-
},
|
|
392
|
-
{
|
|
393
|
-
name: "Side quote",
|
|
394
|
-
element: "blockquote",
|
|
395
|
-
classes: ["side-quote"],
|
|
396
|
-
},
|
|
397
|
-
{
|
|
398
|
-
name: "Needs clarification",
|
|
399
|
-
element: "span",
|
|
400
|
-
classes: ["needs-clarification"],
|
|
401
|
-
},
|
|
402
|
-
{
|
|
403
|
-
name: "Wide spacing",
|
|
404
|
-
element: "span",
|
|
405
|
-
classes: ["wide-spacing"],
|
|
406
|
-
},
|
|
407
|
-
{
|
|
408
|
-
name: "Small caps",
|
|
409
|
-
element: "span",
|
|
410
|
-
classes: ["small-caps"],
|
|
411
|
-
},
|
|
412
|
-
{
|
|
413
|
-
name: "Code (dark)",
|
|
414
|
-
element: "pre",
|
|
415
|
-
classes: ["stylish-code", "stylish-code-dark"],
|
|
416
|
-
},
|
|
417
|
-
{
|
|
418
|
-
name: "Code (bright)",
|
|
419
|
-
element: "pre",
|
|
420
|
-
classes: ["stylish-code", "stylish-code-bright"],
|
|
421
|
-
},
|
|
422
|
-
],
|
|
423
|
-
},
|
|
424
|
-
ui: {
|
|
425
|
-
poweredBy: {
|
|
426
|
-
position: 'inside',
|
|
427
|
-
side: 'right',
|
|
428
|
-
label: ''
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
};
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
const basePlugins = [
|
|
436
|
-
w.Alignment,
|
|
437
|
-
w.Autoformat,
|
|
438
|
-
w.AutoImage,
|
|
439
|
-
w.BlockQuote,
|
|
440
|
-
w.Bold,
|
|
441
|
-
w.Code,
|
|
442
|
-
w.CodeBlock,
|
|
443
|
-
w.Essentials,
|
|
444
|
-
w.FontBackgroundColor,
|
|
445
|
-
w.FontColor,
|
|
446
|
-
w.FontFamily,
|
|
447
|
-
w.FontSize,
|
|
448
|
-
w.GeneralHtmlSupport,
|
|
449
|
-
w.Heading,
|
|
450
|
-
w.HorizontalLine,
|
|
451
|
-
w.HtmlEmbed,
|
|
452
|
-
w.Image,
|
|
453
|
-
w.ImageCaption,
|
|
454
|
-
w.ImageInsert,
|
|
455
|
-
w.ImageResize,
|
|
456
|
-
w.ImageStyle,
|
|
457
|
-
w.ImageToolbar,
|
|
458
|
-
w.ImageUpload,
|
|
459
|
-
w.Indent,
|
|
460
|
-
w.IndentBlock,
|
|
461
|
-
w.Italic,
|
|
462
|
-
w.List,
|
|
463
|
-
w.ListProperties,
|
|
464
|
-
w.Link,
|
|
465
|
-
w.LinkImage,
|
|
466
|
-
w.LinkImage,
|
|
467
|
-
w.MediaEmbed,
|
|
468
|
-
w.PageBreak,
|
|
469
|
-
w.Paragraph,
|
|
470
|
-
w.PasteFromOffice,
|
|
471
|
-
w.PictureEditing,
|
|
472
|
-
w.RemoveFormat,
|
|
473
|
-
w.SourceEditing,
|
|
474
|
-
w.SpecialCharacters,
|
|
475
|
-
w.SpecialCharactersArrows,
|
|
476
|
-
w.SpecialCharactersCurrency,
|
|
477
|
-
w.SpecialCharactersLatin,
|
|
478
|
-
w.SpecialCharactersMathematical,
|
|
479
|
-
w.SpecialCharactersText,
|
|
480
|
-
w.StrapiMediaLib,
|
|
481
|
-
w.StrapiUploadAdapter,
|
|
482
|
-
w.Strikethrough,
|
|
483
|
-
w.Style,
|
|
484
|
-
w.Subscript,
|
|
485
|
-
w.Superscript,
|
|
486
|
-
w.ShowBlocks,
|
|
487
|
-
w.Table,
|
|
488
|
-
w.TableCaption,
|
|
489
|
-
w.TableCellProperties,
|
|
490
|
-
w.TableColumnResize,
|
|
491
|
-
w.TableProperties,
|
|
492
|
-
w.TableToolbar,
|
|
493
|
-
w.Underline,
|
|
494
|
-
w.WordCount,
|
|
495
|
-
];
|
|
496
|
-
|
|
497
|
-
export const toolbarEditorConfig = {
|
|
498
|
-
plugins:basePlugins,
|
|
499
|
-
...base,
|
|
500
|
-
toolbar: [
|
|
501
|
-
{
|
|
502
|
-
label:' ',
|
|
503
|
-
tooltip: null,
|
|
504
|
-
icon:'paragraph',
|
|
505
|
-
items: [ 'heading','style','SourceEditing']
|
|
506
|
-
},
|
|
507
|
-
'|',
|
|
508
|
-
{
|
|
509
|
-
label:' ',
|
|
510
|
-
tooltip: null,
|
|
511
|
-
icon:'text',
|
|
512
|
-
items: [ 'bold', 'italic','fontSize', 'fontFamily', 'fontColor', 'fontBackgroundColor' ]
|
|
513
|
-
},
|
|
514
|
-
{
|
|
515
|
-
label:' ',
|
|
516
|
-
tooltip: null,
|
|
517
|
-
icon:`
|
|
518
|
-
<svg width="800px" height="800px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
519
|
-
<rect x="0" fill="none" width="24" height="24"/>
|
|
520
|
-
<g>
|
|
521
|
-
<path d="M14.348 12H21v2h-4.613c.24.515.368 1.094.368 1.748 0 1.317-.474 2.355-1.423 3.114-.947.76-2.266 1.138-3.956 1.138-1.557 0-2.934-.293-4.132-.878v-2.874c.985.44 1.818.75 2.5.928.682.18 1.306.27 1.872.27.68 0 1.2-.13 1.562-.39.363-.26.545-.644.545-1.158 0-.285-.08-.54-.24-.763-.16-.222-.394-.437-.704-.643-.18-.12-.483-.287-.88-.49H3v-2H14.347zm-3.528-2c-.073-.077-.143-.155-.193-.235-.126-.202-.19-.44-.19-.713 0-.44.157-.795.47-1.068.313-.273.762-.41 1.348-.41.492 0 .993.064 1.502.19.51.127 1.153.35 1.93.67l1-2.405c-.753-.327-1.473-.58-2.16-.76-.69-.18-1.414-.27-2.173-.27-1.544 0-2.753.37-3.628 1.108-.874.738-1.312 1.753-1.312 3.044 0 .302.036.58.088.848h3.318z"/>
|
|
522
|
-
</g>
|
|
523
|
-
</svg>`,
|
|
524
|
-
items: [ 'underline', 'strikethrough', 'superscript', 'subscript' ]
|
|
525
|
-
},
|
|
526
|
-
'removeFormat',
|
|
527
|
-
'|',
|
|
528
|
-
'alignment',
|
|
529
|
-
'outdent',
|
|
530
|
-
'indent',
|
|
531
|
-
'|',
|
|
532
|
-
'bulletedList', 'numberedList',
|
|
533
|
-
'|',
|
|
534
|
-
'insertImage','mediaEmbed','strapiMediaLib','link','blockquote','insertTable','specialCharacters','htmlEmbed','codeBlock',
|
|
535
|
-
'|', 'horizontalLine', 'pageBreak', '|',
|
|
536
|
-
'|', 'showBlocks',
|
|
537
|
-
'|', 'undo', 'redo', '|',
|
|
538
|
-
],
|
|
539
|
-
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
export const toolbarBalloonEditorConfig = {
|
|
543
|
-
plugins:[...basePlugins, w.BalloonToolbar],
|
|
544
|
-
...base,
|
|
545
|
-
toolbar: [
|
|
546
|
-
{
|
|
547
|
-
label:' ',
|
|
548
|
-
tooltip: null,
|
|
549
|
-
icon:'paragraph',
|
|
550
|
-
items: [ 'heading','style']
|
|
551
|
-
},
|
|
552
|
-
'|',
|
|
553
|
-
'alignment',
|
|
554
|
-
'outdent',
|
|
555
|
-
'indent',
|
|
556
|
-
'|',
|
|
557
|
-
'bulletedList', 'numberedList',
|
|
558
|
-
'|',
|
|
559
|
-
'insertImage','mediaEmbed','strapiMediaLib','link','blockquote','insertTable','specialCharacters','htmlEmbed','codeBlock',
|
|
560
|
-
'|', 'horizontalLine', 'pageBreak', '|','SourceEditing',
|
|
561
|
-
'|', 'showBlocks',
|
|
562
|
-
'|', 'undo', 'redo', '|',
|
|
563
|
-
],
|
|
564
|
-
balloonToolbar: [
|
|
565
|
-
'bold', 'italic','fontSize', 'fontFamily', 'fontColor', 'fontBackgroundColor',
|
|
566
|
-
{
|
|
567
|
-
label:' ',
|
|
568
|
-
tooltip: null,
|
|
569
|
-
icon:`
|
|
570
|
-
<svg width="800px" height="800px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
571
|
-
<rect x="0" fill="none" width="24" height="24"/>
|
|
572
|
-
<g>
|
|
573
|
-
<path d="M14.348 12H21v2h-4.613c.24.515.368 1.094.368 1.748 0 1.317-.474 2.355-1.423 3.114-.947.76-2.266 1.138-3.956 1.138-1.557 0-2.934-.293-4.132-.878v-2.874c.985.44 1.818.75 2.5.928.682.18 1.306.27 1.872.27.68 0 1.2-.13 1.562-.39.363-.26.545-.644.545-1.158 0-.285-.08-.54-.24-.763-.16-.222-.394-.437-.704-.643-.18-.12-.483-.287-.88-.49H3v-2H14.347zm-3.528-2c-.073-.077-.143-.155-.193-.235-.126-.202-.19-.44-.19-.713 0-.44.157-.795.47-1.068.313-.273.762-.41 1.348-.41.492 0 .993.064 1.502.19.51.127 1.153.35 1.93.67l1-2.405c-.753-.327-1.473-.58-2.16-.76-.69-.18-1.414-.27-2.173-.27-1.544 0-2.753.37-3.628 1.108-.874.738-1.312 1.753-1.312 3.044 0 .302.036.58.088.848h3.318z"/>
|
|
574
|
-
</g>
|
|
575
|
-
</svg>`,
|
|
576
|
-
items: [ 'underline', 'strikethrough', 'superscript', 'subscript' ]
|
|
577
|
-
},
|
|
578
|
-
'|',
|
|
579
|
-
'removeFormat',
|
|
580
|
-
]
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
export const blockBalloonEditorConfig = {
|
|
584
|
-
plugins:[
|
|
585
|
-
...basePlugins.filter(({pluginName})=>
|
|
586
|
-
pluginName !== "SourceEditing" &&
|
|
587
|
-
pluginName !== "SpecialCharacters" &&
|
|
588
|
-
pluginName !== "SpecialCharactersArrows" &&
|
|
589
|
-
pluginName !== "SpecialCharactersCurrency" &&
|
|
590
|
-
pluginName !== "SpecialCharactersEssentials" &&
|
|
591
|
-
pluginName !== "SpecialCharactersLatin" &&
|
|
592
|
-
pluginName !== "SpecialCharactersMathematical" &&
|
|
593
|
-
pluginName !== "SpecialCharactersText" &&
|
|
594
|
-
pluginName !== "PageBreak" &&
|
|
595
|
-
pluginName !== "HorizontalLine" &&
|
|
596
|
-
pluginName !== "MediaEmbed" &&
|
|
597
|
-
pluginName !== "HtmlEmbed" &&
|
|
598
|
-
pluginName !== "Code" &&
|
|
599
|
-
pluginName !== "CodeBlock"
|
|
600
|
-
),
|
|
601
|
-
w.BlockToolbar, w.BalloonToolbar
|
|
602
|
-
],
|
|
603
|
-
...base,
|
|
604
|
-
blockToolbar: [
|
|
605
|
-
{
|
|
606
|
-
label:' ',
|
|
607
|
-
tooltip: null,
|
|
608
|
-
icon:'paragraph',
|
|
609
|
-
items: [ 'heading','style']
|
|
610
|
-
},
|
|
611
|
-
'|',
|
|
612
|
-
'bulletedList', 'numberedList',
|
|
613
|
-
'|',
|
|
614
|
-
'alignment',
|
|
615
|
-
'outdent',
|
|
616
|
-
'indent',
|
|
617
|
-
'|',
|
|
618
|
-
'insertImage','strapiMediaLib','link','blockquote','insertTable',
|
|
619
|
-
'|', 'showBlocks',
|
|
620
|
-
'|', 'undo', 'redo', '|',
|
|
621
|
-
],
|
|
622
|
-
balloonToolbar: [
|
|
623
|
-
'bold', 'italic','fontSize', 'fontFamily', 'fontColor', 'fontBackgroundColor',
|
|
624
|
-
{
|
|
625
|
-
label:' ',
|
|
626
|
-
tooltip: null,
|
|
627
|
-
icon:`
|
|
628
|
-
<svg width="800px" height="800px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
629
|
-
<rect x="0" fill="none" width="24" height="24"/>
|
|
630
|
-
<g>
|
|
631
|
-
<path d="M14.348 12H21v2h-4.613c.24.515.368 1.094.368 1.748 0 1.317-.474 2.355-1.423 3.114-.947.76-2.266 1.138-3.956 1.138-1.557 0-2.934-.293-4.132-.878v-2.874c.985.44 1.818.75 2.5.928.682.18 1.306.27 1.872.27.68 0 1.2-.13 1.562-.39.363-.26.545-.644.545-1.158 0-.285-.08-.54-.24-.763-.16-.222-.394-.437-.704-.643-.18-.12-.483-.287-.88-.49H3v-2H14.347zm-3.528-2c-.073-.077-.143-.155-.193-.235-.126-.202-.19-.44-.19-.713 0-.44.157-.795.47-1.068.313-.273.762-.41 1.348-.41.492 0 .993.064 1.502.19.51.127 1.153.35 1.93.67l1-2.405c-.753-.327-1.473-.58-2.16-.76-.69-.18-1.414-.27-2.173-.27-1.544 0-2.753.37-3.628 1.108-.874.738-1.312 1.753-1.312 3.044 0 .302.036.58.088.848h3.318z"/>
|
|
632
|
-
</g>
|
|
633
|
-
</svg>`,
|
|
634
|
-
items: [ 'underline', 'strikethrough', 'superscript', 'subscript' ]
|
|
635
|
-
},
|
|
636
|
-
'|',
|
|
637
|
-
'removeFormat',
|
|
638
|
-
]
|
|
639
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { blockBalloonEditorConfig } from "./base";
|
|
2
|
-
|
|
3
|
-
export const blockBalloonEditor = {
|
|
4
|
-
blockBalloon: {
|
|
5
|
-
styles: `
|
|
6
|
-
.ck-content{
|
|
7
|
-
border-radius:4px !important;
|
|
8
|
-
}
|
|
9
|
-
.ck-sticky-panel{
|
|
10
|
-
display:none !important;
|
|
11
|
-
}
|
|
12
|
-
`,
|
|
13
|
-
field: {
|
|
14
|
-
key: "blockBalloon",
|
|
15
|
-
value: "blockBalloon",
|
|
16
|
-
metadatas: {
|
|
17
|
-
intlLabel: {
|
|
18
|
-
id: "ckeditor.preset.blockBalloon.label",
|
|
19
|
-
defaultMessage: "Block balloon version",
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
editorConfig: blockBalloonEditorConfig,
|
|
24
|
-
},
|
|
25
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { toolbarEditor } from './toolbar';
|
|
2
|
-
import { toolbarBalloonEditor } from './toolbarBalloon';
|
|
3
|
-
import { blockBalloonEditor } from './blockBalloon';
|
|
4
|
-
|
|
5
|
-
const baseConfigs = {
|
|
6
|
-
...toolbarEditor,
|
|
7
|
-
...toolbarBalloonEditor,
|
|
8
|
-
...blockBalloonEditor
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export default baseConfigs;
|