@_sh/strapi-plugin-ckeditor 1.0.6 → 1.0.9
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/README.md +168 -20
- package/admin/src/components/CKEditor/build/ckeditor.js +2 -2
- package/admin/src/components/CKEditor/build/ckeditor.js.map +1 -1
- package/admin/src/components/CKEditor/build/translations/ar.js +1 -1
- package/admin/src/components/CKEditor/build/translations/az.js +1 -1
- package/admin/src/components/CKEditor/build/translations/bs.js +1 -1
- package/admin/src/components/CKEditor/build/translations/ca.js +1 -1
- package/admin/src/components/CKEditor/build/translations/cs.js +1 -1
- package/admin/src/components/CKEditor/build/translations/da.js +1 -1
- package/admin/src/components/CKEditor/build/translations/de-ch.js +1 -1
- package/admin/src/components/CKEditor/build/translations/de.js +1 -1
- package/admin/src/components/CKEditor/build/translations/el.js +1 -1
- package/admin/src/components/CKEditor/build/translations/en-au.js +1 -1
- package/admin/src/components/CKEditor/build/translations/en-gb.js +1 -1
- package/admin/src/components/CKEditor/build/translations/es.js +1 -1
- package/admin/src/components/CKEditor/build/translations/et.js +1 -1
- package/admin/src/components/CKEditor/build/translations/fa.js +1 -1
- package/admin/src/components/CKEditor/build/translations/fi.js +1 -1
- package/admin/src/components/CKEditor/build/translations/fr.js +1 -1
- package/admin/src/components/CKEditor/build/translations/gl.js +1 -1
- package/admin/src/components/CKEditor/build/translations/he.js +1 -1
- package/admin/src/components/CKEditor/build/translations/hi.js +1 -1
- package/admin/src/components/CKEditor/build/translations/hr.js +1 -1
- package/admin/src/components/CKEditor/build/translations/hu.js +1 -1
- package/admin/src/components/CKEditor/build/translations/id.js +1 -1
- package/admin/src/components/CKEditor/build/translations/it.js +1 -1
- package/admin/src/components/CKEditor/build/translations/ja.js +1 -1
- package/admin/src/components/CKEditor/build/translations/jv.js +1 -1
- package/admin/src/components/CKEditor/build/translations/ko.js +1 -1
- package/admin/src/components/CKEditor/build/translations/ku.js +1 -1
- package/admin/src/components/CKEditor/build/translations/lt.js +1 -1
- package/admin/src/components/CKEditor/build/translations/lv.js +1 -1
- package/admin/src/components/CKEditor/build/translations/nb.js +1 -1
- package/admin/src/components/CKEditor/build/translations/ne.js +1 -1
- package/admin/src/components/CKEditor/build/translations/nl.js +1 -1
- package/admin/src/components/CKEditor/build/translations/no.js +1 -1
- package/admin/src/components/CKEditor/build/translations/pl.js +1 -1
- package/admin/src/components/CKEditor/build/translations/pt-br.js +1 -1
- package/admin/src/components/CKEditor/build/translations/pt.js +1 -1
- package/admin/src/components/CKEditor/build/translations/ro.js +1 -1
- package/admin/src/components/CKEditor/build/translations/ru.js +1 -1
- package/admin/src/components/CKEditor/build/translations/sk.js +1 -1
- package/admin/src/components/CKEditor/build/translations/sl.js +1 -1
- package/admin/src/components/CKEditor/build/translations/sq.js +1 -1
- package/admin/src/components/CKEditor/build/translations/sr-latn.js +1 -1
- package/admin/src/components/CKEditor/build/translations/sr.js +1 -1
- package/admin/src/components/CKEditor/build/translations/sv.js +1 -1
- package/admin/src/components/CKEditor/build/translations/th.js +1 -1
- package/admin/src/components/CKEditor/build/translations/tk.js +1 -1
- package/admin/src/components/CKEditor/build/translations/tr.js +1 -1
- package/admin/src/components/CKEditor/build/translations/ug.js +1 -1
- package/admin/src/components/CKEditor/build/translations/uk.js +1 -1
- package/admin/src/components/CKEditor/build/translations/uz.js +1 -1
- package/admin/src/components/CKEditor/build/translations/vi.js +1 -1
- package/admin/src/components/CKEditor/build/translations/zh-cn.js +1 -1
- package/admin/src/components/CKEditor/build/translations/zh.js +1 -1
- package/admin/src/components/CKEditor/index.js +19 -2
- package/admin/src/components/CKEditor/styles.js +43 -0
- package/package.json +8 -2
- package/admin/src/components/CKEditor/theme-colors.css +0 -333
- package/assets/ckeditor5.png +0 -0
package/README.md
CHANGED
|
@@ -18,12 +18,13 @@
|
|
|
18
18
|
## <a id="features"></a>✨ Features
|
|
19
19
|
|
|
20
20
|
* **Lots of default plugins:** for styling text, images, tables and so on.
|
|
21
|
-
* **Font color picker:** choose
|
|
21
|
+
* **Font color picker:** choose color for font styling that's not defined in default palette.
|
|
22
22
|
* **Upload adapter for Strapi:** for upload images to your library when you drop an image into the editor.
|
|
23
23
|
* **Fullscreen mode button.**
|
|
24
24
|
* **Strapi media library button.**
|
|
25
25
|
* **Supports strapi theme swithing.**
|
|
26
26
|
* **Supports responsive images:** plugin adds srcset attribute to images based on their `formats` if responsive enable in strapi settings.
|
|
27
|
+
* **Language support:** you can set the preferred language for the UI or the content in the configuration, by default it will use the language defined in the user profile if that language is supported.
|
|
27
28
|
|
|
28
29
|
## <a id="installation"></a>🔧 Installation
|
|
29
30
|
|
|
@@ -67,6 +68,90 @@ CKEditor config should be defined in `config.editor` field.
|
|
|
67
68
|
|
|
68
69
|
Learn more about configuration from [official documentation](https://ckeditor.com/docs/ckeditor5/latest/installation/getting-started/configuration.html).
|
|
69
70
|
|
|
71
|
+
<details>
|
|
72
|
+
<summary>(spoiler) <b>Built in plugins:</b> </summary>
|
|
73
|
+
|
|
74
|
+
```js
|
|
75
|
+
plugins: [
|
|
76
|
+
StrapiUploadAdapter,
|
|
77
|
+
Alignment,
|
|
78
|
+
Autoformat,
|
|
79
|
+
AutoImage,
|
|
80
|
+
AutoLink,
|
|
81
|
+
Autosave,
|
|
82
|
+
BlockQuote,
|
|
83
|
+
Bold,
|
|
84
|
+
CloudServices,
|
|
85
|
+
Code,
|
|
86
|
+
CodeBlock,
|
|
87
|
+
DataFilter,
|
|
88
|
+
DataSchema,
|
|
89
|
+
Essentials,
|
|
90
|
+
FindAndReplace,
|
|
91
|
+
FontBackgroundColor,
|
|
92
|
+
FontColor,
|
|
93
|
+
FontFamily,
|
|
94
|
+
FontSize,
|
|
95
|
+
GeneralHtmlSupport,
|
|
96
|
+
Heading,
|
|
97
|
+
HeadingButtonsUI,
|
|
98
|
+
ParagraphButtonUI,
|
|
99
|
+
Highlight,
|
|
100
|
+
HorizontalLine,
|
|
101
|
+
HtmlComment,
|
|
102
|
+
HtmlEmbed,
|
|
103
|
+
Image,
|
|
104
|
+
ImageCaption,
|
|
105
|
+
ImageInsert,
|
|
106
|
+
ImageResize,
|
|
107
|
+
ImageStyle,
|
|
108
|
+
ImageToolbar,
|
|
109
|
+
ImageUpload,
|
|
110
|
+
Indent,
|
|
111
|
+
IndentBlock,
|
|
112
|
+
Italic,
|
|
113
|
+
Link,
|
|
114
|
+
LinkImage,
|
|
115
|
+
List,
|
|
116
|
+
ListProperties,
|
|
117
|
+
MediaEmbed,
|
|
118
|
+
MediaEmbedToolbar,
|
|
119
|
+
Mention,
|
|
120
|
+
PageBreak,
|
|
121
|
+
Paragraph,
|
|
122
|
+
PasteFromOffice,
|
|
123
|
+
RemoveFormat,
|
|
124
|
+
SourceEditing,
|
|
125
|
+
SpecialCharacters,
|
|
126
|
+
SpecialCharactersArrows,
|
|
127
|
+
SpecialCharactersCurrency,
|
|
128
|
+
SpecialCharactersEssentials,
|
|
129
|
+
SpecialCharactersLatin,
|
|
130
|
+
SpecialCharactersMathematical,
|
|
131
|
+
SpecialCharactersText,
|
|
132
|
+
StandardEditingMode,
|
|
133
|
+
Strikethrough,
|
|
134
|
+
Subscript,
|
|
135
|
+
Superscript,
|
|
136
|
+
Table,
|
|
137
|
+
TableCaption,
|
|
138
|
+
TableCellProperties,
|
|
139
|
+
TableProperties,
|
|
140
|
+
TableToolbar,
|
|
141
|
+
TextPartLanguage,
|
|
142
|
+
TextTransformation,
|
|
143
|
+
TodoList,
|
|
144
|
+
Underline,
|
|
145
|
+
WordCount,
|
|
146
|
+
Markdown,
|
|
147
|
+
StrapiMediaLib,
|
|
148
|
+
FullScreen
|
|
149
|
+
]
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
</details>
|
|
154
|
+
|
|
70
155
|
**Default configuration:**
|
|
71
156
|
```js
|
|
72
157
|
// plugins.js
|
|
@@ -79,6 +164,10 @@ module.exports = () => {
|
|
|
79
164
|
styles:` // styles applied to editor container `
|
|
80
165
|
},
|
|
81
166
|
editor:{ // editor default config
|
|
167
|
+
// https://ckeditor.com/docs/ckeditor5/latest/features/markdown.html
|
|
168
|
+
// if you need markdown support and output set it to removePlugins: [''],
|
|
169
|
+
// default is removePlugins: ['Markdown'],
|
|
170
|
+
// https://ckeditor.com/docs/ckeditor5/latest/features/toolbar/toolbar.html
|
|
82
171
|
toolbar: {
|
|
83
172
|
items: [
|
|
84
173
|
'paragraph',
|
|
@@ -126,6 +215,7 @@ module.exports = () => {
|
|
|
126
215
|
'redo'
|
|
127
216
|
]
|
|
128
217
|
},
|
|
218
|
+
// https://ckeditor.com/docs/ckeditor5/latest/features/font.html
|
|
129
219
|
fontSize: {
|
|
130
220
|
options: [
|
|
131
221
|
9,
|
|
@@ -167,7 +257,9 @@ module.exports = () => {
|
|
|
167
257
|
columns: 5,
|
|
168
258
|
documentColors: 10,
|
|
169
259
|
},
|
|
170
|
-
language
|
|
260
|
+
// https://ckeditor.com/docs/ckeditor5/latest/features/ui-language.html
|
|
261
|
+
// default language: 'en',
|
|
262
|
+
// https://ckeditor.com/docs/ckeditor5/latest/features/images/images-overview.html
|
|
171
263
|
image: {
|
|
172
264
|
resizeUnit: "%",
|
|
173
265
|
resizeOptions: [ {
|
|
@@ -200,6 +292,7 @@ module.exports = () => {
|
|
|
200
292
|
'resizeImage:25', 'resizeImage:50', 'resizeImage:75', 'resizeImage:original'
|
|
201
293
|
]
|
|
202
294
|
},
|
|
295
|
+
// https://ckeditor.com/docs/ckeditor5/latest/features/table.html
|
|
203
296
|
table: {
|
|
204
297
|
contentToolbar: [
|
|
205
298
|
'tableColumn',
|
|
@@ -210,6 +303,7 @@ module.exports = () => {
|
|
|
210
303
|
'toggleTableCaption'
|
|
211
304
|
]
|
|
212
305
|
},
|
|
306
|
+
// https://ckeditor.com/docs/ckeditor5/latest/features/headings.html
|
|
213
307
|
heading: {
|
|
214
308
|
options: [
|
|
215
309
|
{ model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
|
|
@@ -220,31 +314,85 @@ module.exports = () => {
|
|
|
220
314
|
{ model: 'heading5', view: 'h5', title: 'Heading 5', class: 'ck-heading_heading5' },
|
|
221
315
|
{ model: 'heading6', view: 'h6', title: 'Heading 6', class: 'ck-heading_heading6' },
|
|
222
316
|
{
|
|
223
|
-
|
|
224
|
-
|
|
317
|
+
model: 'h1b',
|
|
318
|
+
view: {name: 'h1', classes: 'ck-heading_h1_b'},
|
|
319
|
+
title: 'H1 (border)',
|
|
320
|
+
class: 'ck-heading_heading1',
|
|
321
|
+
converterPriority: 'high'
|
|
225
322
|
},
|
|
226
323
|
{
|
|
227
|
-
|
|
228
|
-
|
|
324
|
+
model: 'h2b',
|
|
325
|
+
view: {name: 'h2', classes: 'ck-heading_h2_b'},
|
|
326
|
+
title: 'H2 (border)',
|
|
327
|
+
class: 'ck-heading_heading2',
|
|
328
|
+
converterPriority: 'high'
|
|
229
329
|
},
|
|
230
330
|
{
|
|
231
331
|
model: 'h3b',
|
|
232
|
-
view: {name: 'h3', classes: 'ck-heading_h3_b'},
|
|
332
|
+
view: {name: 'h3', classes: 'ck-heading_h3_b'},
|
|
333
|
+
title: 'H3 (border)',
|
|
334
|
+
class: 'ck-heading_heading3',
|
|
335
|
+
converterPriority: 'high'
|
|
233
336
|
},
|
|
234
|
-
{
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
model: 'h5b',
|
|
240
|
-
view: {name: 'h5', classes: 'ck-heading_h5_b'}, title: 'H5 (border)', class: 'ck-heading_heading5', converterPriority: 'high'
|
|
241
|
-
},
|
|
242
|
-
{
|
|
243
|
-
model: 'h6b',
|
|
244
|
-
view: {name: 'h6', classes: 'ck-heading_h6_b'}, title: 'H6 (border)', class: 'ck-heading_heading6', converterPriority: 'high'
|
|
337
|
+
{ model: 'custom',
|
|
338
|
+
view: {name: 'custom', classes: 'Heading 1'},
|
|
339
|
+
title: 'custom',
|
|
340
|
+
class: 'ck-heading_heading3',
|
|
341
|
+
converterPriority: 'high'
|
|
245
342
|
}
|
|
246
343
|
]
|
|
247
|
-
}
|
|
344
|
+
},
|
|
345
|
+
// https://ckeditor.com/docs/ckeditor5/latest/features/general-html-support.html
|
|
346
|
+
// if you need more tags
|
|
347
|
+
// htmlSupport: {
|
|
348
|
+
// allow: [
|
|
349
|
+
// // Enables plain <div> elements.
|
|
350
|
+
// {
|
|
351
|
+
// name: 'div'
|
|
352
|
+
// },
|
|
353
|
+
|
|
354
|
+
// // Enables plain <div>, <section> and <article> elements.
|
|
355
|
+
// {
|
|
356
|
+
// name: /^(div|section|article)$/
|
|
357
|
+
// },
|
|
358
|
+
|
|
359
|
+
// // Enables <div>s with all inline styles (but no other attributes).
|
|
360
|
+
// {
|
|
361
|
+
// name: 'div',
|
|
362
|
+
// styles: true
|
|
363
|
+
// },
|
|
364
|
+
|
|
365
|
+
// // Enables <div>s with foo and bar classes.
|
|
366
|
+
// {
|
|
367
|
+
// name: 'div',
|
|
368
|
+
// classes: [ 'foo', 'bar' ]
|
|
369
|
+
// },
|
|
370
|
+
|
|
371
|
+
// // Adds support for `foo` and `bar` classes to the already supported
|
|
372
|
+
// // <p> elements (those are enabled by the dedicated paragraph feature).
|
|
373
|
+
// {
|
|
374
|
+
// name: 'p',
|
|
375
|
+
// classes: [ 'foo', 'bar' ]
|
|
376
|
+
// },
|
|
377
|
+
|
|
378
|
+
// // Enables <div>s with foo="true" attribute and bar attribute that
|
|
379
|
+
// // can accept any value (boolean `true` value works as an asterisk).
|
|
380
|
+
// {
|
|
381
|
+
// name: 'div',
|
|
382
|
+
// attributes: {
|
|
383
|
+
// foo: 'true',
|
|
384
|
+
// bar: true
|
|
385
|
+
// }
|
|
386
|
+
// },
|
|
387
|
+
|
|
388
|
+
// // Adds support for style="color: *" to the already supported
|
|
389
|
+
// // <p> and <h2-h4> elements.
|
|
390
|
+
// {
|
|
391
|
+
// name: `/^(p|h[2-4])$/'`,
|
|
392
|
+
// styles: { 'color': true }
|
|
393
|
+
// },
|
|
394
|
+
// ]
|
|
395
|
+
// },
|
|
248
396
|
}
|
|
249
397
|
}
|
|
250
398
|
}
|
|
@@ -262,7 +410,7 @@ For theme colors switching this plugin uses css variables depending on html data
|
|
|
262
410
|
|
|
263
411
|
[**👔 Default styles**](https://github.com/nshenderov/strapi-plugin-ckeditor/blob/master/admin/src/components/CKEditor/styles.js#L3-L517)
|
|
264
412
|
|
|
265
|
-
[**🎨 Default colour variables**](https://github.com/nshenderov/strapi-plugin-ckeditor/blob/master/
|
|
413
|
+
[**🎨 Default colour variables**](https://github.com/nshenderov/strapi-plugin-ckeditor/blob/master/assets/theme-colors.css#L105-L333)
|
|
266
414
|
|
|
267
415
|
**Example of customization:**
|
|
268
416
|
```js
|