@_sh/strapi-plugin-ckeditor 1.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.
Files changed (108) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +981 -0
  3. package/admin/src/components/CKEditor/build/ckeditor.js +7 -0
  4. package/admin/src/components/CKEditor/build/ckeditor.js.map +1 -0
  5. package/admin/src/components/CKEditor/build/translations/af.js +1 -0
  6. package/admin/src/components/CKEditor/build/translations/ar.js +1 -0
  7. package/admin/src/components/CKEditor/build/translations/ast.js +1 -0
  8. package/admin/src/components/CKEditor/build/translations/az.js +1 -0
  9. package/admin/src/components/CKEditor/build/translations/bg.js +1 -0
  10. package/admin/src/components/CKEditor/build/translations/bs.js +1 -0
  11. package/admin/src/components/CKEditor/build/translations/ca.js +1 -0
  12. package/admin/src/components/CKEditor/build/translations/cs.js +1 -0
  13. package/admin/src/components/CKEditor/build/translations/da.js +1 -0
  14. package/admin/src/components/CKEditor/build/translations/de-ch.js +1 -0
  15. package/admin/src/components/CKEditor/build/translations/de.js +1 -0
  16. package/admin/src/components/CKEditor/build/translations/el.js +1 -0
  17. package/admin/src/components/CKEditor/build/translations/en-au.js +1 -0
  18. package/admin/src/components/CKEditor/build/translations/en-gb.js +1 -0
  19. package/admin/src/components/CKEditor/build/translations/eo.js +1 -0
  20. package/admin/src/components/CKEditor/build/translations/es.js +1 -0
  21. package/admin/src/components/CKEditor/build/translations/et.js +1 -0
  22. package/admin/src/components/CKEditor/build/translations/eu.js +1 -0
  23. package/admin/src/components/CKEditor/build/translations/fa.js +1 -0
  24. package/admin/src/components/CKEditor/build/translations/fi.js +1 -0
  25. package/admin/src/components/CKEditor/build/translations/fr.js +1 -0
  26. package/admin/src/components/CKEditor/build/translations/gl.js +1 -0
  27. package/admin/src/components/CKEditor/build/translations/gu.js +1 -0
  28. package/admin/src/components/CKEditor/build/translations/he.js +1 -0
  29. package/admin/src/components/CKEditor/build/translations/hi.js +1 -0
  30. package/admin/src/components/CKEditor/build/translations/hr.js +1 -0
  31. package/admin/src/components/CKEditor/build/translations/hu.js +1 -0
  32. package/admin/src/components/CKEditor/build/translations/id.js +1 -0
  33. package/admin/src/components/CKEditor/build/translations/it.js +1 -0
  34. package/admin/src/components/CKEditor/build/translations/ja.js +1 -0
  35. package/admin/src/components/CKEditor/build/translations/jv.js +1 -0
  36. package/admin/src/components/CKEditor/build/translations/kk.js +1 -0
  37. package/admin/src/components/CKEditor/build/translations/km.js +1 -0
  38. package/admin/src/components/CKEditor/build/translations/kn.js +1 -0
  39. package/admin/src/components/CKEditor/build/translations/ko.js +1 -0
  40. package/admin/src/components/CKEditor/build/translations/ku.js +1 -0
  41. package/admin/src/components/CKEditor/build/translations/lt.js +1 -0
  42. package/admin/src/components/CKEditor/build/translations/lv.js +1 -0
  43. package/admin/src/components/CKEditor/build/translations/nb.js +1 -0
  44. package/admin/src/components/CKEditor/build/translations/ne.js +1 -0
  45. package/admin/src/components/CKEditor/build/translations/nl.js +1 -0
  46. package/admin/src/components/CKEditor/build/translations/no.js +1 -0
  47. package/admin/src/components/CKEditor/build/translations/oc.js +1 -0
  48. package/admin/src/components/CKEditor/build/translations/pl.js +1 -0
  49. package/admin/src/components/CKEditor/build/translations/pt-br.js +1 -0
  50. package/admin/src/components/CKEditor/build/translations/pt.js +1 -0
  51. package/admin/src/components/CKEditor/build/translations/ro.js +1 -0
  52. package/admin/src/components/CKEditor/build/translations/ru.js +1 -0
  53. package/admin/src/components/CKEditor/build/translations/si.js +1 -0
  54. package/admin/src/components/CKEditor/build/translations/sk.js +1 -0
  55. package/admin/src/components/CKEditor/build/translations/sl.js +1 -0
  56. package/admin/src/components/CKEditor/build/translations/sq.js +1 -0
  57. package/admin/src/components/CKEditor/build/translations/sr-latn.js +1 -0
  58. package/admin/src/components/CKEditor/build/translations/sr.js +1 -0
  59. package/admin/src/components/CKEditor/build/translations/sv.js +1 -0
  60. package/admin/src/components/CKEditor/build/translations/th.js +1 -0
  61. package/admin/src/components/CKEditor/build/translations/tk.js +1 -0
  62. package/admin/src/components/CKEditor/build/translations/tr.js +1 -0
  63. package/admin/src/components/CKEditor/build/translations/tt.js +1 -0
  64. package/admin/src/components/CKEditor/build/translations/ug.js +1 -0
  65. package/admin/src/components/CKEditor/build/translations/uk.js +1 -0
  66. package/admin/src/components/CKEditor/build/translations/uz.js +1 -0
  67. package/admin/src/components/CKEditor/build/translations/vi.js +1 -0
  68. package/admin/src/components/CKEditor/build/translations/zh-cn.js +1 -0
  69. package/admin/src/components/CKEditor/build/translations/zh.js +1 -0
  70. package/admin/src/components/CKEditor/index.js +139 -0
  71. package/admin/src/components/CKEditor/styles.js +520 -0
  72. package/admin/src/components/Initializer/index.js +26 -0
  73. package/admin/src/components/MediaLib/index.js +44 -0
  74. package/admin/src/components/Wysiwyg/index.js +77 -0
  75. package/admin/src/index.js +19 -0
  76. package/admin/src/pages/App/index.js +25 -0
  77. package/admin/src/pages/HomePage/index.js +20 -0
  78. package/admin/src/pluginId.js +6 -0
  79. package/admin/src/translations/en.json +1 -0
  80. package/admin/src/translations/fr.json +1 -0
  81. package/admin/src/utils/axiosInstance.js +40 -0
  82. package/admin/src/utils/getTrad.js +5 -0
  83. package/assets/ckeditor-d-1.jpg +0 -0
  84. package/assets/ckeditor-d-2.jpg +0 -0
  85. package/assets/ckeditor-d-3.jpg +0 -0
  86. package/assets/ckeditor-fontcolor1.jpg +0 -0
  87. package/assets/ckeditor-fontcolor2.jpg +0 -0
  88. package/assets/ckeditor-fontcolor3.jpg +0 -0
  89. package/assets/ckeditor-tables.jpg +0 -0
  90. package/assets/ckeditor-toolbar.jpg +0 -0
  91. package/assets/ckeditor.jpg +0 -0
  92. package/assets/ckeditor1.jpg +0 -0
  93. package/package.json +44 -0
  94. package/server/bootstrap.js +5 -0
  95. package/server/config/index.js +6 -0
  96. package/server/content-types/index.js +3 -0
  97. package/server/controllers/config.js +9 -0
  98. package/server/controllers/index.js +7 -0
  99. package/server/destroy.js +5 -0
  100. package/server/index.js +25 -0
  101. package/server/middlewares/index.js +3 -0
  102. package/server/policies/index.js +3 -0
  103. package/server/register.js +5 -0
  104. package/server/routes/index.js +8 -0
  105. package/server/services/config.js +13 -0
  106. package/server/services/index.js +7 -0
  107. package/strapi-admin.js +3 -0
  108. package/strapi-server.js +3 -0
package/README.md ADDED
@@ -0,0 +1,981 @@
1
+ # CKEditor 5 for Strapi
2
+
3
+ <img src="./assets/ckeditor1.jpg"/>
4
+
5
+ <br/>
6
+
7
+ Replaces the default Strapi WYSIWYG editor with a customized build of CKEditor 5 html editor packed with useful plugins.
8
+
9
+ The plugin works on custom build of ckeditor based on classic editor build.
10
+
11
+ Also, this plugin includes some useful plugins based on those repos so thanks to those guys:
12
+ https://github.com/Roslovets-Inc/strapi-plugin-ckeditor5
13
+ https://github.com/leknoppix/ckeditor5-fullscreen
14
+ https://github.com/gtomato/ckeditor5-strapi-upload-plugin
15
+ https://github.com/pshurygin/ckeditor5-font-color
16
+
17
+
18
+
19
+ ## Plugins
20
+
21
+ <br/>
22
+ <img src="./assets/ckeditor-toolbar.jpg" width="900"/>
23
+ <br/>
24
+
25
+ - <b>Lots of default plugins:</b>
26
+
27
+ For styling text, images, tables and so on.
28
+ <br/>
29
+ <br/>
30
+
31
+ <img src="./assets/ckeditor-tables.jpg" width="900"/>
32
+
33
+ <img src="./assets/ckeditor-d-2.jpg" width="900"/>
34
+
35
+ <br/>
36
+
37
+ - <b>Fullscreen mode</b>
38
+
39
+
40
+ - <b>Font color picker:</b>
41
+
42
+ Gives you ability to choose colors for font styling that's not defined in config from the color palette.
43
+
44
+ <br/>
45
+
46
+
47
+ <img src="./assets/ckeditor-fontcolor1.jpg" width="200"/>
48
+ <img src="./assets/ckeditor-fontcolor3.jpg" width="200"/>
49
+
50
+
51
+ - <b>Upload udapter:</b>
52
+
53
+ For upload images to your library when you drop an image into the editor.
54
+
55
+
56
+ - <b>Strapi media library button</b>
57
+
58
+
59
+ - <b>Also supports strapi theme swithing</b>
60
+
61
+ - <b>Supports responsive images - plugin adds srcset attribute to images based on their "formats"</b>
62
+
63
+
64
+ ## How to install
65
+ Install the dependency via npm
66
+ ```
67
+ npm install @_sh/strapi-plugin-ckeditor
68
+ ```
69
+ or yarn
70
+ ```
71
+ yarn add @_sh/strapi-plugin-ckeditor
72
+ ```
73
+ In ./config/plugins.js file add
74
+ ```
75
+ ckeditor: true
76
+ ```
77
+ Then run build
78
+ ```
79
+ npm run build
80
+ ```
81
+ or
82
+ ```
83
+ yarn build
84
+ ```
85
+
86
+ ## How to customize
87
+
88
+ Via config in plugins.js
89
+
90
+ Ckeditor settings should be defined in <b>config.editor</b> field
91
+
92
+ Read more about configuration https://ckeditor.com/docs/ckeditor5/latest/installation/getting-started/configuration.html
93
+
94
+
95
+ <details>
96
+ <summary><b>Default config</b></summary>
97
+
98
+
99
+ ```javascript
100
+
101
+ ckeditor: {
102
+ enabled: true,
103
+ config:{
104
+ plugin:{
105
+ // styles applies to editor container
106
+ styles:``
107
+ },
108
+ // editor default config
109
+ editor:{
110
+ toolbar: {
111
+ items: [
112
+ 'paragraph',
113
+ 'heading1',
114
+ 'heading2',
115
+ '|',
116
+ 'bold',
117
+ 'italic',
118
+ 'fontColor',
119
+ 'fontBackgroundColor',
120
+ 'fontFamily',
121
+ 'underline',
122
+ 'fontSize',
123
+ 'removeFormat',
124
+ '|',
125
+ 'bulletedList',
126
+ 'todoList',
127
+ 'numberedList',
128
+ '|',
129
+ 'alignment',
130
+ 'outdent',
131
+ 'indent',
132
+ 'horizontalLine',
133
+ '|',
134
+ 'StrapiMediaLib',
135
+ 'insertTable',
136
+ 'blockQuote',
137
+ 'mediaEmbed',
138
+ 'link',
139
+ 'highlight',
140
+ '|',
141
+ 'htmlEmbed',
142
+ 'sourceEditing',
143
+ 'code',
144
+ 'codeBlock',
145
+ '|',
146
+ 'subscript',
147
+ 'superscript',
148
+ 'strikethrough',
149
+ 'specialCharacters',
150
+ '|',
151
+ 'heading',
152
+ "fullScreen",
153
+ 'undo',
154
+ 'redo'
155
+ ]
156
+ },
157
+ fontSize: {
158
+ options: [
159
+ 9,
160
+ 11,
161
+ 13,
162
+ 'default',
163
+ 17,
164
+ 19,
165
+ 21,
166
+ 27,
167
+ 35,
168
+ "tiny",
169
+ "small",
170
+ "big",
171
+ "huge"
172
+ ],
173
+ supportAllValues: false
174
+ },
175
+ fontFamily: {
176
+ options: [
177
+ 'default',
178
+ 'Arial, Helvetica Neue, Helvetica, Source Sans Pro, sans-serif',
179
+ 'Courier New, Courier, monospace',
180
+ 'Georgia, serif',
181
+ 'Lucida Sans Unicode, Lucida Grande, sans-serif',
182
+ 'Tahoma, Geneva, sans-serif',
183
+ 'Times New Roman, Times, serif',
184
+ 'Trebuchet MS, Helvetica, sans-serif',
185
+ 'Verdana, Geneva, sans-serif',
186
+ 'Roboto, Roboto Black, Roboto Medium, Roboto Light, sans-serif',
187
+ ],
188
+ supportAllValues: true
189
+ },
190
+ fontColor: {
191
+ columns: 5,
192
+ documentColors: 10,
193
+ },
194
+ fontBackgroundColor: {
195
+ columns: 5,
196
+ documentColors: 10,
197
+ },
198
+ language: 'en',
199
+ image: {
200
+ resizeUnit: "%",
201
+ resizeOptions: [ {
202
+ name: 'resizeImage:original',
203
+ value: null,
204
+ icon: 'original'
205
+ },
206
+ {
207
+ name: 'resizeImage:25',
208
+ value: '25',
209
+ icon: 'small'
210
+ },
211
+ {
212
+ name: 'resizeImage:50',
213
+ value: '50',
214
+ icon: 'medium'
215
+ },
216
+ {
217
+ name: 'resizeImage:75',
218
+ value: '75',
219
+ icon: 'large'
220
+ } ],
221
+ toolbar: [
222
+ 'toggleImageCaption',
223
+ 'imageTextAlternative',
224
+ 'imageStyle:inline',
225
+ 'imageStyle:block',
226
+ 'imageStyle:side',
227
+ 'linkImage',
228
+ 'resizeImage:25', 'resizeImage:50', 'resizeImage:75', 'resizeImage:original'
229
+ ]
230
+ },
231
+ table: {
232
+ contentToolbar: [
233
+ 'tableColumn',
234
+ 'tableRow',
235
+ 'mergeTableCells',
236
+ 'tableCellProperties',
237
+ 'tableProperties',
238
+ 'toggleTableCaption'
239
+ ]
240
+ },
241
+ heading: {
242
+ options: [
243
+ { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
244
+ { model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading1' },
245
+ { model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2' },
246
+ { model: 'heading3', view: 'h3', title: 'Heading 3', class: 'ck-heading_heading3' },
247
+ { model: 'heading4', view: 'h4', title: 'Heading 4', class: 'ck-heading_heading4' },
248
+ { model: 'heading5', view: 'h5', title: 'Heading 5', class: 'ck-heading_heading5' },
249
+ { model: 'heading6', view: 'h6', title: 'Heading 6', class: 'ck-heading_heading6' },
250
+ {
251
+ model: 'h1b',
252
+ view: {name: 'h1', classes: 'ck-heading_h1_b'}, title: 'H1 (border)', class: 'ck-heading_heading1', converterPriority: 'high'
253
+ },
254
+ {
255
+ model: 'h2b',
256
+ view: {name: 'h2', classes: 'ck-heading_h2_b'}, title: 'H2 (border)', class: 'ck-heading_heading2', converterPriority: 'high'
257
+ },
258
+ {
259
+ model: 'h3b',
260
+ view: {name: 'h3', classes: 'ck-heading_h3_b'}, title: 'H3 (border)', class: 'ck-heading_heading3', converterPriority: 'high'
261
+ },
262
+ {
263
+ model: 'h4b',
264
+ view: {name: 'h4', classes: 'ck-heading_h4_b'}, title: 'H4 (border)', class: 'ck-heading_heading4', converterPriority: 'high'
265
+ },
266
+ {
267
+ model: 'h5b',
268
+ view: {name: 'h5', classes: 'ck-heading_h5_b'}, title: 'H5 (border)', class: 'ck-heading_heading5', converterPriority: 'high'
269
+ },
270
+ {
271
+ model: 'h6b',
272
+ view: {name: 'h6', classes: 'ck-heading_h6_b'}, title: 'H6 (border)', class: 'ck-heading_heading6', converterPriority: 'high'
273
+ }
274
+ ]
275
+ }
276
+ }
277
+ }
278
+ }
279
+ ```
280
+
281
+ </details>
282
+ <br/>
283
+
284
+ If you want to customize editor styles you should define styles in <b>config.plugin.styles</b> field it will replace default styles applied to the editor
285
+
286
+ Since Strapi resets css styles, it needs some styles to revert back, those styles defined below also check https://ckeditor.com/docs/ckeditor5/latest/installation/advanced/content-styles.html
287
+
288
+ Also for theme colors switching this plugin uses css variables depending on html data-theme attribute, e.g. html[data-theme='light'] or html[data-theme='dark']
289
+
290
+ More info about theming https://ckeditor.com/docs/ckeditor5/latest/framework/guides/deep-dive/ui/theme-customization.html
291
+
292
+
293
+ <details>
294
+ <summary><b>Example of default colour variables for the light theme</b></summary>
295
+
296
+ ```css
297
+ html[data-theme='light'] {
298
+ --ck-color-editor-base-text:#1A1A1A;
299
+ /* Overrides the border radius setting in the theme. */
300
+ --ck-border-radius: 4px;
301
+
302
+ /* Helper variables to avoid duplication in the colors. */
303
+ --ck-color-base-border: #EAEAEF;
304
+ --ck-color-base-background:#ffffff;
305
+ --ck-custom-background: #ffffff;
306
+ --ck-custom-foreground: #dedede;
307
+ --ck-custom-border: #EAEAEF;
308
+ --ck-custom-white: hsl(0, 0%, 100%);
309
+
310
+ --ck-color-focus-outer-shadow:#F0F0FF;
311
+
312
+ --ck-color-base-focus: #bbbaf1;
313
+ --ck-color-base-active: #F0F0FF;
314
+ --ck-color-base-active-focus: #e2e2fd;
315
+ /* -- Overrides generic colors. ------------------------------------------------------------- */
316
+
317
+ --ck-color-base-foreground: var(--ck-custom-background);
318
+ --ck-color-focus-border: #4945FF;
319
+ --ck-color-text: #32324D;
320
+ --ck-color-shadow-drop: hsla(250, 31%, 80%, 0.1);
321
+ --ck-color-shadow-inner: hsla(250, 31%, 80%, 0.1);
322
+
323
+ /* -- Overrides the default .ck-button class colors. ---------------------------------------- */
324
+
325
+ --ck-color-button-default-background: var(--ck-custom-background);
326
+ --ck-color-button-default-hover-background: #F0F0FF;
327
+ --ck-color-button-default-active-background: #dedefb;
328
+ --ck-color-button-default-active-shadow: #dedefb;
329
+ --ck-color-button-default-disabled-background: var(--ck-custom-background);
330
+
331
+ --ck-color-button-on-background: #F0F0FF;
332
+ --ck-color-button-on-hover-background: #dbdbff;
333
+ --ck-color-button-on-active-background: #cdcdf8;
334
+ --ck-color-button-on-active-shadow: #cdcdf8;
335
+ --ck-color-button-on-disabled-background: var(--ck-custom-foreground);
336
+
337
+ --ck-color-button-action-background: hsl(168, 76%, 42%);
338
+ --ck-color-button-action-hover-background: hsl(168, 76%, 38%);
339
+ --ck-color-button-action-active-background: hsl(168, 76%, 36%);
340
+ --ck-color-button-action-active-shadow: hsl(168, 75%, 34%);
341
+ --ck-color-button-action-disabled-background: hsl(168, 76%, 42%);
342
+ --ck-color-button-action-text: var(--ck-custom-white);
343
+
344
+ --ck-color-button-save: hsl(120, 100%, 46%);
345
+ --ck-color-button-cancel: hsl(15, 100%, 56%);
346
+
347
+ /* -- Overrides the default .ck-dropdown class colors. -------------------------------------- */
348
+
349
+ --ck-color-dropdown-panel-background: var(--ck-custom-background);
350
+ --ck-color-dropdown-panel-border: var(--ck-custom-foreground);
351
+
352
+ /* -- Overrides the default .ck-splitbutton class colors. ----------------------------------- */
353
+
354
+ --ck-color-split-button-hover-background: var(--ck-color-button-default-hover-background);
355
+ --ck-color-split-button-hover-border: var(--ck-custom-foreground);
356
+
357
+ /* -- Overrides the default .ck-input class colors. ----------------------------------------- */
358
+
359
+ --ck-color-input-background: var(--ck-custom-background);
360
+ --ck-color-input-border: hsl(257, 3%, 43%);
361
+ --ck-color-input-text: hsl(0, 0%, 98%);
362
+ --ck-color-input-disabled-background: hsl(0, 0%, 97%);
363
+ --ck-color-input-disabled-border: rgb(214, 214, 214);
364
+ --ck-color-input-disabled-text: hsl(0, 0%, 78%);
365
+
366
+ /* -- Overrides the default .ck-labeled-field-view class colors. ---------------------------- */
367
+
368
+ --ck-color-labeled-field-label-background: var(--ck-custom-background);
369
+
370
+ /* -- Overrides the default .ck-list class colors. ------------------------------------------ */
371
+
372
+ --ck-color-list-background: var(--ck-custom-background);
373
+ --ck-color-list-button-hover-background: #f4f4fb;
374
+ --ck-color-list-button-on-background: var(--ck-color-base-active);
375
+ --ck-color-list-button-on-background-focus: var(--ck-color-base-active-focus);
376
+ --ck-color-list-button-on-text: #271FE2;
377
+
378
+ /* -- Overrides the default .ck-balloon-panel class colors. --------------------------------- */
379
+
380
+ --ck-color-panel-background: var(--ck-custom-background);
381
+ --ck-color-panel-border: var(--ck-custom-border);
382
+
383
+ /* -- Overrides the default .ck-toolbar class colors. --------------------------------------- */
384
+
385
+ --ck-color-toolbar-background: var(--ck-custom-background);
386
+ --ck-color-toolbar-border: var(--ck-custom-border);
387
+
388
+ /* -- Overrides the default .ck-tooltip class colors. --------------------------------------- */
389
+
390
+ --ck-color-tooltip-background: #3a3955;
391
+ --ck-color-tooltip-text: hsl(0, 0%, 93%);
392
+
393
+ /* -- Overrides the default colors used by the ckeditor5-image package. --------------------- */
394
+
395
+ --ck-color-image-caption-background: hsl(0, 0%, 97%);
396
+ --ck-color-image-caption-text: hsl(0, 0%, 20%);
397
+
398
+ /* -- Overrides the default colors used by the ckeditor5-widget package. -------------------- */
399
+
400
+ --ck-color-widget-blurred-border: #cfcffa;
401
+ --ck-color-widget-hover-border: #c9c9e4;
402
+ --ck-color-widget-editable-focus-background: var(--ck-custom-white);
403
+
404
+ /* -- Overrides the default colors used by the ckeditor5-link package. ---------------------- */
405
+
406
+ --ck-color-link-default: hsl(209, 89%, 33%);
407
+
408
+ }
409
+ ```
410
+
411
+ </details>
412
+
413
+ <details>
414
+ <summary><b>Example of customizing</b></summary>
415
+
416
+
417
+
418
+ ```javascript
419
+ # plugins.js
420
+
421
+ const defStyles = require('./styles.js')
422
+
423
+ ckeditor: {
424
+ enabled: true,
425
+ config:{
426
+ plugin:{
427
+ // styles aplyies to editor container
428
+ styles:`
429
+ ${defStyles()}
430
+ --ck-color-editor-base-text:red;
431
+ `
432
+ },
433
+ // editor default config
434
+ editor:{
435
+ //...
436
+ }
437
+
438
+ }
439
+ }
440
+
441
+ # styles.js
442
+
443
+ const defStyles = () =>`
444
+ ### all default styles from spoiler below ###
445
+ `
446
+ module.exports = defStyles;
447
+
448
+ ```
449
+
450
+ </details>
451
+ <details>
452
+ <summary><b>Default styles</b></summary>
453
+
454
+
455
+
456
+ ```css
457
+ .ck-editor__main {
458
+ --ck-font-face:"Source Sans Pro",system-ui,Roboto,"Helvetica Neue","Helvetica",Arial,sans-serif;
459
+ min-height: ${200 / 16}em;
460
+ color:var(--ck-color-editor-base-text);
461
+ font-family:var(--ck-font-face);
462
+ > div {
463
+ min-height: ${200 / 16}em;
464
+ }
465
+ .ck-editor__editable {
466
+ line-height: initial;
467
+ }
468
+
469
+ div, applet, object, iframe,
470
+ h1, h2,h3, h4, h5,h6, p, span,
471
+ pre, a, abbr, acronym,
472
+ address, big, cite, code, del, dfn,
473
+ em, img, ins, kbd, q, s, samp, small,
474
+ strike, strong, sub, sup, tt, var,
475
+ b, u, i, center, dl, dt, dd, ol,
476
+ ul, li, fieldset, form, label, legend,
477
+ table, caption, tbody, tfoot, thead,
478
+ tr, th, td, article, aside, canvas,
479
+ details, embed, figure, figcaption,
480
+ footer, header, hgroup, menu, nav, output,
481
+ ruby, section, summary, time, mark, audio, video {
482
+ font: revert;
483
+ margin:revert;
484
+ font-family:revert;
485
+ }
486
+ h1, .ck-heading_h1_b {
487
+ font-size: 2.36em;
488
+ line-height: 1.33em;
489
+ padding-top: 1em;
490
+ margin-bottom: 1.67em;
491
+ font-weight: 400;
492
+ }
493
+ h2, .ck-heading_h2_b {
494
+ font-size: 1.68em;
495
+ line-height: 1.68em;
496
+ padding-top: 0.8em;
497
+ margin-bottom: 0.4em;
498
+ padding-bottom: 0.2em;
499
+ font-weight: 400;
500
+ }
501
+ h3, .ck-heading_h3_b{
502
+ font-size: 1.36em;
503
+ line-height: 1.5em;
504
+ padding-top: 0.8em;
505
+ margin-bottom: 0.2em;
506
+ font-weight: 400;
507
+ }
508
+ h4 {
509
+ font-size: 1.15em;
510
+ line-height: 1.4em;
511
+ padding-top: 0.7em;
512
+ margin-bottom: 0.1em;
513
+ font-weight: 400;
514
+ }
515
+ p{
516
+ font-size: 1em;
517
+ line-height: 1.6em;
518
+ padding-top: 0.2em;
519
+ margin-bottom: 0.8em;
520
+ }
521
+ .ck-heading_h1_b, h2.ck-heading_h2_b, .ck-heading_h3_b{
522
+ border-bottom: 1px solid #e9e9e9;
523
+ }
524
+ figcaption{
525
+ background-color: var(--ck-color-image-caption-background);
526
+ caption-side: bottom;
527
+ color: var(--ck-color-image-caption-text);
528
+ display: table-caption;
529
+ font-size: .75em;
530
+ outline-offset: -1px;
531
+ padding: 0.6em;
532
+ word-break: break-word;
533
+ }
534
+ blockquote {}
535
+ .table {
536
+ margin: 0;
537
+ }
538
+ ul.todo-list {
539
+ list-style: none;
540
+ margin:revert;
541
+ color:revert;
542
+ font-family:revert;
543
+ margin-left: 32px;
544
+ }
545
+ ul, ol {
546
+ list-style: initial;
547
+ margin-left: 32px;
548
+ }
549
+ sub{
550
+ vertical-align: sub
551
+ }
552
+ sup{
553
+ vertical-align: super
554
+ }
555
+
556
+
557
+ }
558
+
559
+ /*
560
+ * CKEditor 5 (v34.0.0) content styles.
561
+ * Generated on Wed, 27 Apr 2022 06:51:54 GMT.
562
+ * For more information, check out https://ckeditor.com/docs/ckeditor5/latest/installation/advanced/content-styles.html
563
+ */
564
+
565
+ :root {
566
+ --ck-color-image-caption-background: hsl(0, 0%, 97%);
567
+ --ck-color-image-caption-text: hsl(0, 0%, 20%);
568
+ --ck-color-mention-background: hsla(341, 100%, 30%, 0.1);
569
+ --ck-color-mention-text: hsl(341, 100%, 30%);
570
+ --ck-color-table-caption-background: hsl(0, 0%, 97%);
571
+ --ck-color-table-caption-text: hsl(0, 0%, 20%);
572
+ --ck-highlight-marker-blue: hsl(201, 97%, 72%);
573
+ --ck-highlight-marker-green: hsl(120, 93%, 68%);
574
+ --ck-highlight-marker-pink: hsl(345, 96%, 73%);
575
+ --ck-highlight-marker-yellow: hsl(60, 97%, 73%);
576
+ --ck-highlight-pen-green: hsl(112, 100%, 27%);
577
+ --ck-highlight-pen-red: hsl(0, 85%, 49%);
578
+ --ck-image-style-spacing: 1.5em;
579
+ --ck-inline-image-style-spacing: calc(var(--ck-image-style-spacing) / 2);
580
+ --ck-todo-list-checkmark-size: 16px;
581
+ }
582
+
583
+ .ck.ck-sticky-panel .ck-sticky-panel__content_sticky{ top:64px }
584
+
585
+ /* ckeditor5-block-quote/theme/blockquote.css */
586
+ .ck-content blockquote {
587
+ overflow: hidden;
588
+ padding-right: 1.5em;
589
+ padding-left: 1.5em;
590
+ margin-left: 0;
591
+ margin-right: 0;
592
+ font-style: italic;
593
+ border-left: solid 5px hsl(0, 0%, 80%);
594
+ }
595
+ /* ckeditor5-block-quote/theme/blockquote.css */
596
+ .ck-content[dir="rtl"] blockquote {
597
+ border-left: 0;
598
+ border-right: solid 5px hsl(0, 0%, 80%);
599
+ }
600
+ /* ckeditor5-basic-styles/theme/code.css */
601
+ .ck-content code {
602
+ background-color: hsla(0, 0%, 78%, 0.3);
603
+ padding: .15em;
604
+ border-radius: 2px;
605
+ }
606
+ /* ckeditor5-font/theme/fontsize.css */
607
+ .ck-content .text-tiny {
608
+ font-size: .7em;
609
+ }
610
+ /* ckeditor5-font/theme/fontsize.css */
611
+ .ck-content .text-small {
612
+ font-size: .85em;
613
+ }
614
+ /* ckeditor5-font/theme/fontsize.css */
615
+ .ck-content .text-big {
616
+ font-size: 1.4em;
617
+ }
618
+ /* ckeditor5-font/theme/fontsize.css */
619
+ .ck-content .text-huge {
620
+ font-size: 1.8em;
621
+ }
622
+ /* ckeditor5-highlight/theme/highlight.css */
623
+ .ck-content .marker-yellow {
624
+ background-color: var(--ck-highlight-marker-yellow);
625
+ }
626
+ /* ckeditor5-highlight/theme/highlight.css */
627
+ .ck-content .marker-green {
628
+ background-color: var(--ck-highlight-marker-green);
629
+ }
630
+ /* ckeditor5-highlight/theme/highlight.css */
631
+ .ck-content .marker-pink {
632
+ background-color: var(--ck-highlight-marker-pink);
633
+ }
634
+ /* ckeditor5-highlight/theme/highlight.css */
635
+ .ck-content .marker-blue {
636
+ background-color: var(--ck-highlight-marker-blue);
637
+ }
638
+ /* ckeditor5-highlight/theme/highlight.css */
639
+ .ck-content .pen-red {
640
+ color: var(--ck-highlight-pen-red);
641
+ background-color: transparent;
642
+ }
643
+ /* ckeditor5-highlight/theme/highlight.css */
644
+ .ck-content .pen-green {
645
+ color: var(--ck-highlight-pen-green);
646
+ background-color: transparent;
647
+ }
648
+ /* ckeditor5-image/theme/image.css */
649
+ .ck-content .image {
650
+ display: table;
651
+ clear: both;
652
+ text-align: center;
653
+ margin: 0.9em auto;
654
+ min-width: 50px;
655
+ }
656
+ /* ckeditor5-image/theme/image.css */
657
+ .ck-content .image img {
658
+ display: block;
659
+ margin: 0 auto;
660
+ max-width: 100%;
661
+ min-width: 100%;
662
+ }
663
+ /* ckeditor5-image/theme/image.css */
664
+ .ck-content .image-inline {
665
+ /*
666
+ * Normally, the .image-inline would have "display: inline-block" and "img { width: 100% }" (to follow the wrapper while resizing).;
667
+ * Unfortunately, together with "srcset", it gets automatically stretched up to the width of the editing root.
668
+ * This strange behavior does not happen with inline-flex.
669
+ */
670
+ display: inline-flex;
671
+ max-width: 100%;
672
+ align-items: flex-start;
673
+ }
674
+ /* ckeditor5-image/theme/image.css */
675
+ .ck-content .image-inline picture {
676
+ display: flex;
677
+ }
678
+ /* ckeditor5-image/theme/image.css */
679
+ .ck-content .image-inline picture,
680
+ .ck-content .image-inline img {
681
+ flex-grow: 1;
682
+ flex-shrink: 1;
683
+ max-width: 100%;
684
+ }
685
+ /* ckeditor5-image/theme/imageresize.css */
686
+ .ck-content .image.image_resized {
687
+ max-width: 100%;
688
+ display: block;
689
+ box-sizing: border-box;
690
+ }
691
+ /* ckeditor5-image/theme/imageresize.css */
692
+ .ck-content .image.image_resized img {
693
+ width: 100%;
694
+ }
695
+ /* ckeditor5-image/theme/imageresize.css */
696
+ .ck-content .image.image_resized > figcaption {
697
+ display: block;
698
+ }
699
+ /* ckeditor5-image/theme/imagecaption.css */
700
+ .ck-content .image > figcaption {
701
+ display: table-caption;
702
+ caption-side: bottom;
703
+ word-break: break-word;
704
+ color: var(--ck-color-image-caption-text);
705
+ background-color: var(--ck-color-image-caption-background);
706
+ padding: .6em;
707
+ font-size: .75em;
708
+ outline-offset: -1px;
709
+ }
710
+ /* ckeditor5-image/theme/imagestyle.css */
711
+ .ck-content .image-style-block-align-left,
712
+ .ck-content .image-style-block-align-right {
713
+ max-width: calc(100% - var(--ck-image-style-spacing));
714
+ }
715
+ /* ckeditor5-image/theme/imagestyle.css */
716
+ .ck-content .image-style-align-left,
717
+ .ck-content .image-style-align-right {
718
+ clear: none;
719
+ }
720
+ /* ckeditor5-image/theme/imagestyle.css */
721
+ .ck-content .image-style-side {
722
+ float: right;
723
+ margin-left: var(--ck-image-style-spacing);
724
+ max-width: 50%;
725
+ }
726
+ /* ckeditor5-image/theme/imagestyle.css */
727
+ .ck-content .image-style-align-left {
728
+ float: left;
729
+ margin-right: var(--ck-image-style-spacing);
730
+ }
731
+ /* ckeditor5-image/theme/imagestyle.css */
732
+ .ck-content .image-style-align-center {
733
+ margin-left: auto;
734
+ margin-right: auto;
735
+ }
736
+ /* ckeditor5-image/theme/imagestyle.css */
737
+ .ck-content .image-style-align-right {
738
+ float: right;
739
+ margin-left: var(--ck-image-style-spacing);
740
+ }
741
+ /* ckeditor5-image/theme/imagestyle.css */
742
+ .ck-content .image-style-block-align-right {
743
+ margin-right: 0;
744
+ margin-left: auto;
745
+ }
746
+ /* ckeditor5-image/theme/imagestyle.css */
747
+ .ck-content .image-style-block-align-left {
748
+ margin-left: 0;
749
+ margin-right: auto;
750
+ }
751
+ /* ckeditor5-image/theme/imagestyle.css */
752
+ .ck-content p + .image-style-align-left,
753
+ .ck-content p + .image-style-align-right,
754
+ .ck-content p + .image-style-side {
755
+ margin-top: 0;
756
+ }
757
+ /* ckeditor5-image/theme/imagestyle.css */
758
+ .ck-content .image-inline.image-style-align-left,
759
+ .ck-content .image-inline.image-style-align-right {
760
+ margin-top: var(--ck-inline-image-style-spacing);
761
+ margin-bottom: var(--ck-inline-image-style-spacing);
762
+ }
763
+ /* ckeditor5-image/theme/imagestyle.css */
764
+ .ck-content .image-inline.image-style-align-left {
765
+ margin-right: var(--ck-inline-image-style-spacing);
766
+ }
767
+ /* ckeditor5-image/theme/imagestyle.css */
768
+ .ck-content .image-inline.image-style-align-right {
769
+ margin-left: var(--ck-inline-image-style-spacing);
770
+ }
771
+ /* ckeditor5-language/theme/language.css */
772
+ .ck-content span[lang] {
773
+ font-style: italic;
774
+ }
775
+ /* ckeditor5-media-embed/theme/mediaembed.css */
776
+ .ck-content .media {
777
+ clear: both;
778
+ margin: 0.9em 0;
779
+ display: block;
780
+ min-width: 15em;
781
+ }
782
+ /* ckeditor5-list/theme/todolist.css */
783
+ .ck-content .todo-list {
784
+ list-style: none;
785
+ }
786
+ /* ckeditor5-list/theme/todolist.css */
787
+ .ck-content .todo-list li {
788
+ margin-bottom: 5px;
789
+ }
790
+ /* ckeditor5-list/theme/todolist.css */
791
+ .ck-content .todo-list li .todo-list {
792
+ margin-top: 5px;
793
+ }
794
+ /* ckeditor5-list/theme/todolist.css */
795
+ .ck-content .todo-list .todo-list__label > input {
796
+ -webkit-appearance: none;
797
+ display: inline-block;
798
+ position: relative;
799
+ width: var(--ck-todo-list-checkmark-size);
800
+ height: var(--ck-todo-list-checkmark-size);
801
+ vertical-align: middle;
802
+ border: 0;
803
+ left: -25px;
804
+ margin-right: -15px;
805
+ right: 0;
806
+ margin-left: 0;
807
+ }
808
+ /* ckeditor5-list/theme/todolist.css */
809
+ .ck-content .todo-list .todo-list__label > input::before {
810
+ display: block;
811
+ position: absolute;
812
+ box-sizing: border-box;
813
+ content: '';
814
+ width: 100%;
815
+ height: 100%;
816
+ border: 1px solid hsl(0, 0%, 20%);
817
+ border-radius: 2px;
818
+ transition: 250ms ease-in-out box-shadow, 250ms ease-in-out background, 250ms ease-in-out border;
819
+ }
820
+ /* ckeditor5-list/theme/todolist.css */
821
+ .ck-content .todo-list .todo-list__label > input::after {
822
+ display: block;
823
+ position: absolute;
824
+ box-sizing: content-box;
825
+ pointer-events: none;
826
+ content: '';
827
+ left: calc( var(--ck-todo-list-checkmark-size) / 3 );
828
+ top: calc( var(--ck-todo-list-checkmark-size) / 5.3 );
829
+ width: calc( var(--ck-todo-list-checkmark-size) / 5.3 );
830
+ height: calc( var(--ck-todo-list-checkmark-size) / 2.6 );
831
+ border-style: solid;
832
+ border-color: transparent;
833
+ border-width: 0 calc( var(--ck-todo-list-checkmark-size) / 8 ) calc( var(--ck-todo-list-checkmark-size) / 8 ) 0;
834
+ transform: rotate(45deg);
835
+ }
836
+ /* ckeditor5-list/theme/todolist.css */
837
+ .ck-content .todo-list .todo-list__label > input[checked]::before {
838
+ background: hsl(126, 64%, 41%);
839
+ border-color: hsl(126, 64%, 41%);
840
+ }
841
+ /* ckeditor5-list/theme/todolist.css */
842
+ .ck-content .todo-list .todo-list__label > input[checked]::after {
843
+ border-color: hsl(0, 0%, 100%);
844
+ }
845
+ /* ckeditor5-list/theme/todolist.css */
846
+ .ck-content .todo-list .todo-list__label .todo-list__label__description {
847
+ vertical-align: middle;
848
+ }
849
+ /* ckeditor5-page-break/theme/pagebreak.css */
850
+ .ck-content .page-break {
851
+ position: relative;
852
+ clear: both;
853
+ padding: 5px 0;
854
+ display: flex;
855
+ align-items: center;
856
+ justify-content: center;
857
+ }
858
+ /* ckeditor5-page-break/theme/pagebreak.css */
859
+ .ck-content .page-break::after {
860
+ content: '';
861
+ position: absolute;
862
+ border-bottom: 2px dashed hsl(0, 0%, 77%);
863
+ width: 100%;
864
+ }
865
+ /* ckeditor5-page-break/theme/pagebreak.css */
866
+ .ck-content .page-break__label {
867
+ position: relative;
868
+ z-index: 1;
869
+ padding: .3em .6em;
870
+ display: block;
871
+ text-transform: uppercase;
872
+ border: 1px solid hsl(0, 0%, 77%);
873
+ border-radius: 2px;
874
+ font-family: Helvetica, Arial, Tahoma, Verdana, Sans-Serif;
875
+ font-size: 0.75em;
876
+ font-weight: bold;
877
+ color: hsl(0, 0%, 20%);
878
+ background: hsl(0, 0%, 100%);
879
+ box-shadow: 2px 2px 1px hsla(0, 0%, 0%, 0.15);
880
+ -webkit-user-select: none;
881
+ -moz-user-select: none;
882
+ -ms-user-select: none;
883
+ user-select: none;
884
+ }
885
+ /* ckeditor5-table/theme/tablecaption.css */
886
+ .ck-content .table > figcaption {
887
+ display: table-caption;
888
+ caption-side: top;
889
+ word-break: break-word;
890
+ text-align: center;
891
+ color: var(--ck-color-table-caption-text);
892
+ background-color: var(--ck-color-table-caption-background);
893
+ padding: .6em;
894
+ font-size: .75em;
895
+ outline-offset: -1px;
896
+ }
897
+ /* ckeditor5-table/theme/table.css */
898
+ .ck-content .table {
899
+ margin: 0.9em auto;
900
+ display: table;
901
+ }
902
+ /* ckeditor5-table/theme/table.css */
903
+ .ck-content .table table {
904
+ border-collapse: collapse;
905
+ border-spacing: 0;
906
+ width: 100%;
907
+ height: 100%;
908
+ border: 1px double hsl(0, 0%, 70%);
909
+ }
910
+ /* ckeditor5-table/theme/table.css */
911
+ .ck-content .table table td,
912
+ .ck-content .table table th {
913
+ min-width: 2em;
914
+ padding: .4em;
915
+ border: 1px solid hsl(0, 0%, 75%);
916
+ }
917
+ /* ckeditor5-table/theme/table.css */
918
+ .ck-content .table table th {
919
+ font-weight: bold;
920
+ background: hsla(0, 0%, 0%, 5%);
921
+ }
922
+ /* ckeditor5-table/theme/table.css */
923
+ .ck-content[dir="rtl"] .table th {
924
+ text-align: right;
925
+ }
926
+ /* ckeditor5-table/theme/table.css */
927
+ .ck-content[dir="ltr"] .table th {
928
+ text-align: left;
929
+ }
930
+ /* ckeditor5-code-block/theme/codeblock.css */
931
+ .ck-content pre {
932
+ padding: 1em;
933
+ color: hsl(0, 0%, 20.8%);
934
+ background: hsla(0, 0%, 78%, 0.3);
935
+ border: 1px solid hsl(0, 0%, 77%);
936
+ border-radius: 2px;
937
+ text-align: left;
938
+ direction: ltr;
939
+ tab-size: 4;
940
+ white-space: pre-wrap;
941
+ font-style: normal;
942
+ min-width: 200px;
943
+ }
944
+ /* ckeditor5-code-block/theme/codeblock.css */
945
+ .ck-content pre code {
946
+ background: unset;
947
+ padding: 0;
948
+ border-radius: 0;
949
+ }
950
+ /* ckeditor5-horizontal-line/theme/horizontalline.css */
951
+ .ck-content hr {
952
+ margin: 15px 0;
953
+ height: 4px;
954
+ background: hsl(0, 0%, 87%);
955
+ border: 0;
956
+ }
957
+ /* ckeditor5-mention/theme/mention.css */
958
+ .ck-content .mention {
959
+ background: var(--ck-color-mention-background);
960
+ color: var(--ck-color-mention-text);
961
+ }
962
+ @media print {
963
+ /* ckeditor5-page-break/theme/pagebreak.css */
964
+ .ck-content .page-break {
965
+ padding: 0;
966
+ }
967
+ /* ckeditor5-page-break/theme/pagebreak.css */
968
+ .ck-content .page-break::after {
969
+ display: none;
970
+ }
971
+ }
972
+ ```
973
+
974
+ </details>
975
+
976
+ <br/>
977
+
978
+ ## Requirements
979
+ Strapi v4
980
+
981
+ Tested on v4.18