@_sh/strapi-plugin-ckeditor 1.1.1 → 1.1.2
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 +528 -6
- 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/af.js +1 -1
- package/admin/src/components/CKEditor/build/translations/ar.js +1 -1
- package/admin/src/components/CKEditor/build/translations/ast.js +1 -1
- package/admin/src/components/CKEditor/build/translations/az.js +1 -1
- package/admin/src/components/CKEditor/build/translations/bg.js +1 -1
- package/admin/src/components/CKEditor/build/translations/bn.js +1 -0
- 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/eo.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/eu.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/gu.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/km.js +1 -1
- package/admin/src/components/CKEditor/build/translations/kn.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/ms.js +1 -0
- 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/oc.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/si.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/tt.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/ur.js +1 -0
- 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 +11 -5
- package/admin/src/components/CKEditor/theme.js +31 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
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](https://github.com/nshenderov/strapi-plugin-ckeditor/tree/master/admin/src/components/CKEditor/build/translations).
|
|
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](https://github.com/nshenderov/strapi-plugin-ckeditor/tree/master/admin/src/components/CKEditor/build/translations). i18 also supported.
|
|
28
28
|
|
|
29
29
|
## <a id="installation"></a>🔧 Installation
|
|
30
30
|
|
|
@@ -68,7 +68,13 @@ yarn build
|
|
|
68
68
|
|
|
69
69
|
|
|
70
70
|
## <a id="configuration"></a>⚙️ Configuration
|
|
71
|
-
CKEditor config should be defined in `config.editor` field.
|
|
71
|
+
CKEditor config should be defined in `config.editor` field in `plugins.js` file.
|
|
72
|
+
|
|
73
|
+
**⚠️ `plugins.js` not `plugin.js` ⚠️**
|
|
74
|
+
|
|
75
|
+
**`plugins.js` file should be placed in `config` folder.**
|
|
76
|
+
|
|
77
|
+
**💡`fullscreen mode` and `source mode` not supported with `balloon` and `block` toolbars.**
|
|
72
78
|
|
|
73
79
|
Learn more about configuration from [official documentation](https://ckeditor.com/docs/ckeditor5/latest/installation/getting-started/configuration.html).
|
|
74
80
|
|
|
@@ -148,7 +154,10 @@ Underline,
|
|
|
148
154
|
WordCount,
|
|
149
155
|
Markdown,
|
|
150
156
|
StrapiMediaLib,
|
|
151
|
-
FullScreen
|
|
157
|
+
FullScreen,
|
|
158
|
+
BlockToolbar,
|
|
159
|
+
BalloonToolbar,
|
|
160
|
+
Style
|
|
152
161
|
]
|
|
153
162
|
|
|
154
163
|
```
|
|
@@ -172,6 +181,9 @@ module.exports = () => {
|
|
|
172
181
|
|
|
173
182
|
// styles applied to editor container (global scope) //
|
|
174
183
|
// styles:`
|
|
184
|
+
// .ck.ck-editor__main .ck-focused{
|
|
185
|
+
// max-height: 700px;
|
|
186
|
+
// }
|
|
175
187
|
// :root{
|
|
176
188
|
// --ck-color-focus-border:red;
|
|
177
189
|
// --ck-color-text:red;
|
|
@@ -183,7 +195,7 @@ module.exports = () => {
|
|
|
183
195
|
// https://ckeditor.com/docs/ckeditor5/latest/features/markdown.html
|
|
184
196
|
// if you need markdown support and output set: removePlugins: [''],
|
|
185
197
|
// default is
|
|
186
|
-
removePlugins: ['Markdown'],
|
|
198
|
+
// removePlugins: ['Markdown'],
|
|
187
199
|
|
|
188
200
|
// https://ckeditor.com/docs/ckeditor5/latest/features/toolbar/toolbar.html
|
|
189
201
|
toolbar: {
|
|
@@ -346,6 +358,514 @@ module.exports = () => {
|
|
|
346
358
|
}
|
|
347
359
|
}
|
|
348
360
|
```
|
|
361
|
+
**Some of configuration:**
|
|
362
|
+
|
|
363
|
+
<h3 align="center">Balloon+Block+Style</h3>
|
|
364
|
+
|
|
365
|
+
<p align="center">
|
|
366
|
+
<img src="https://raw.githubusercontent.com/nshenderov/strapi-plugin-ckeditor/master/assets/balloonblockstyles.gif" alt="CKEditor5-Strapi" width="800" />
|
|
367
|
+
</p>
|
|
368
|
+
|
|
369
|
+
<details>
|
|
370
|
+
<summary><b>Balloon+Block+Style config:</b> </summary>
|
|
371
|
+
|
|
372
|
+
```js
|
|
373
|
+
module.exports = () => {
|
|
374
|
+
return {
|
|
375
|
+
ckeditor: {
|
|
376
|
+
enabled: true,
|
|
377
|
+
config:{
|
|
378
|
+
plugin:{
|
|
379
|
+
styles:`
|
|
380
|
+
.ck-content{
|
|
381
|
+
border-radius:4px !important;
|
|
382
|
+
}
|
|
383
|
+
.ck-sticky-panel{
|
|
384
|
+
display:none !important;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
.ck.ck-content h3.category {
|
|
388
|
+
font-family: 'Bebas Neue';
|
|
389
|
+
font-size: 20px;
|
|
390
|
+
font-weight: bold;
|
|
391
|
+
color: #d1d1d1;
|
|
392
|
+
letter-spacing: 10px;
|
|
393
|
+
margin: 0;
|
|
394
|
+
padding: 0;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
.ck.ck-content h2.document-title {
|
|
398
|
+
font-family: 'Bebas Neue';
|
|
399
|
+
font-size: 50px;
|
|
400
|
+
font-weight: bold;
|
|
401
|
+
margin: 0;
|
|
402
|
+
padding: 0;
|
|
403
|
+
border: 0;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
.ck.ck-content h3.document-subtitle {
|
|
407
|
+
font-size: 20px;
|
|
408
|
+
color: #e91e63;
|
|
409
|
+
margin: 0 0 1em;
|
|
410
|
+
font-weight: normal;
|
|
411
|
+
padding: 0;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
.ck.ck-content p.info-box {
|
|
415
|
+
--background-size: 30px;
|
|
416
|
+
--background-color: #e91e63;
|
|
417
|
+
padding: 1.2em 2em;
|
|
418
|
+
border: 1px solid var(--background-color);
|
|
419
|
+
background: linear-gradient(135deg, var(--background-color) 0%, var(--background-color) var(--background-size), transparent var(--background-size)), linear-gradient(135deg, transparent calc(100% - var(--background-size)), var(--background-color) calc(100% - var(--background-size)), var(--background-color));
|
|
420
|
+
border-radius: 10px;
|
|
421
|
+
margin: 1.5em 2em;
|
|
422
|
+
box-shadow: 5px 5px 0 #ffe6ef;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
.ck.ck-content blockquote.side-quote {
|
|
426
|
+
font-family: 'Bebas Neue';
|
|
427
|
+
font-style: normal;
|
|
428
|
+
float: right;
|
|
429
|
+
width: 35%;
|
|
430
|
+
position: relative;
|
|
431
|
+
border: 0;
|
|
432
|
+
overflow: visible;
|
|
433
|
+
z-index: 1;
|
|
434
|
+
margin-left: 1em;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.ck.ck-content blockquote.side-quote::before {
|
|
438
|
+
content: "“";
|
|
439
|
+
position: absolute;
|
|
440
|
+
top: -37px;
|
|
441
|
+
left: -10px;
|
|
442
|
+
display: block;
|
|
443
|
+
font-size: 200px;
|
|
444
|
+
color: #e7e7e7;
|
|
445
|
+
z-index: -1;
|
|
446
|
+
line-height: 1;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
.ck.ck-content blockquote.side-quote p {
|
|
450
|
+
font-size: 2em;
|
|
451
|
+
line-height: 1;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
.ck.ck-content blockquote.side-quote p:last-child:not(:first-child) {
|
|
455
|
+
font-size: 1.3em;
|
|
456
|
+
text-align: right;
|
|
457
|
+
color: #555;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
.ck.ck-content span.marker {
|
|
461
|
+
background: yellow;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
.ck.ck-content span.spoiler {
|
|
465
|
+
background: #000;
|
|
466
|
+
color: #000;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
.ck.ck-content span.spoiler:hover {
|
|
470
|
+
background: #000;
|
|
471
|
+
color: #fff;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
.ck.ck-content pre.fancy-code {
|
|
475
|
+
border: 0;
|
|
476
|
+
margin-left: 2em;
|
|
477
|
+
margin-right: 2em;
|
|
478
|
+
border-radius: 10px;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
.ck.ck-content pre.fancy-code::before {
|
|
482
|
+
content: "";
|
|
483
|
+
display: block;
|
|
484
|
+
height: 13px;
|
|
485
|
+
background: url(data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1NCAxMyI+CiAgPGNpcmNsZSBjeD0iNi41IiBjeT0iNi41IiByPSI2LjUiIGZpbGw9IiNGMzZCNUMiLz4KICA8Y2lyY2xlIGN4PSIyNi41IiBjeT0iNi41IiByPSI2LjUiIGZpbGw9IiNGOUJFNEQiLz4KICA8Y2lyY2xlIGN4PSI0Ny41IiBjeT0iNi41IiByPSI2LjUiIGZpbGw9IiM1NkM0NTMiLz4KPC9zdmc+Cg==);
|
|
486
|
+
margin-bottom: 8px;
|
|
487
|
+
background-repeat: no-repeat;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
.ck.ck-content pre.fancy-code-dark {
|
|
491
|
+
background: #272822;
|
|
492
|
+
color: #fff;
|
|
493
|
+
box-shadow: 5px 5px 0 #0000001f;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
.ck.ck-content pre.fancy-code-bright {
|
|
497
|
+
background: #dddfe0;
|
|
498
|
+
color: #000;
|
|
499
|
+
box-shadow: 5px 5px 0 #b3b3b3;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
`
|
|
503
|
+
},
|
|
504
|
+
editor:{
|
|
505
|
+
toolbar:[],
|
|
506
|
+
// https://ckeditor.com/docs/ckeditor5/latest/features/toolbar/blocktoolbar.html
|
|
507
|
+
blockToolbar: {
|
|
508
|
+
items: [
|
|
509
|
+
'heading','style',
|
|
510
|
+
'|',
|
|
511
|
+
'outdent',
|
|
512
|
+
'indent',
|
|
513
|
+
'horizontalLine',
|
|
514
|
+
'|',
|
|
515
|
+
'StrapiMediaLib',
|
|
516
|
+
'-',
|
|
517
|
+
'bulletedList', 'numberedList',
|
|
518
|
+
'|',
|
|
519
|
+
'insertTable', 'blockQuote',
|
|
520
|
+
'|',
|
|
521
|
+
'code'
|
|
522
|
+
],
|
|
523
|
+
},
|
|
524
|
+
balloonToolbar: [
|
|
525
|
+
'bold',
|
|
526
|
+
'italic',
|
|
527
|
+
'fontColor',
|
|
528
|
+
'FontBackgroundColor',
|
|
529
|
+
'fontFamily',
|
|
530
|
+
'fontSize',
|
|
531
|
+
'alignment',
|
|
532
|
+
'|',
|
|
533
|
+
'removeFormat',
|
|
534
|
+
'undo',
|
|
535
|
+
'redo'
|
|
536
|
+
],
|
|
537
|
+
// https://ckeditor.com/docs/ckeditor5/latest/features/style.html
|
|
538
|
+
style: {
|
|
539
|
+
definitions: [
|
|
540
|
+
{
|
|
541
|
+
name: 'Article category',
|
|
542
|
+
element: 'h3',
|
|
543
|
+
classes: [ 'category' ]
|
|
544
|
+
},
|
|
545
|
+
{
|
|
546
|
+
name: 'Title',
|
|
547
|
+
element: 'h2',
|
|
548
|
+
classes: [ 'document-title' ]
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
name: 'Subtitle',
|
|
552
|
+
element: 'h3',
|
|
553
|
+
classes: [ 'document-subtitle' ]
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
name: 'Info box',
|
|
557
|
+
element: 'p',
|
|
558
|
+
classes: [ 'info-box' ]
|
|
559
|
+
},
|
|
560
|
+
{
|
|
561
|
+
name: 'Side quote',
|
|
562
|
+
element: 'blockquote',
|
|
563
|
+
classes: [ 'side-quote' ]
|
|
564
|
+
},
|
|
565
|
+
{
|
|
566
|
+
name: 'Marker',
|
|
567
|
+
element: 'span',
|
|
568
|
+
classes: [ 'marker' ]
|
|
569
|
+
},
|
|
570
|
+
{
|
|
571
|
+
name: 'Spoiler',
|
|
572
|
+
element: 'span',
|
|
573
|
+
classes: [ 'spoiler' ]
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
name: 'Code (dark)',
|
|
577
|
+
element: 'pre',
|
|
578
|
+
classes: [ 'fancy-code', 'fancy-code-dark' ]
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
name: 'Code (bright)',
|
|
582
|
+
element: 'pre',
|
|
583
|
+
classes: [ 'fancy-code', 'fancy-code-bright' ]
|
|
584
|
+
}
|
|
585
|
+
]
|
|
586
|
+
},
|
|
587
|
+
fontSize: {
|
|
588
|
+
options: [
|
|
589
|
+
9,
|
|
590
|
+
11,
|
|
591
|
+
13,
|
|
592
|
+
'default',
|
|
593
|
+
17,
|
|
594
|
+
19,
|
|
595
|
+
21,
|
|
596
|
+
27,
|
|
597
|
+
35,
|
|
598
|
+
],
|
|
599
|
+
supportAllValues: false
|
|
600
|
+
},
|
|
601
|
+
fontFamily: {
|
|
602
|
+
options: [
|
|
603
|
+
'default',
|
|
604
|
+
'Arial, Helvetica Neue, Helvetica, Source Sans Pro, sans-serif',
|
|
605
|
+
'Courier New, Courier, monospace',
|
|
606
|
+
'Georgia, serif',
|
|
607
|
+
'Lucida Sans Unicode, Lucida Grande, sans-serif',
|
|
608
|
+
'Tahoma, Geneva, sans-serif',
|
|
609
|
+
'Times New Roman, Times, serif',
|
|
610
|
+
'Trebuchet MS, Helvetica, sans-serif',
|
|
611
|
+
'Verdana, Geneva, sans-serif',
|
|
612
|
+
'Roboto, Roboto Black, Roboto Medium, Roboto Light, sans-serif',
|
|
613
|
+
],
|
|
614
|
+
supportAllValues: true
|
|
615
|
+
},
|
|
616
|
+
fontColor: {
|
|
617
|
+
columns: 5,
|
|
618
|
+
documentColors: 10,
|
|
619
|
+
},
|
|
620
|
+
fontBackgroundColor: {
|
|
621
|
+
columns: 5,
|
|
622
|
+
documentColors: 10,
|
|
623
|
+
},
|
|
624
|
+
image: {
|
|
625
|
+
resizeUnit: "%",
|
|
626
|
+
resizeOptions: [ {
|
|
627
|
+
name: 'resizeImage:original',
|
|
628
|
+
value: null,
|
|
629
|
+
icon: 'original'
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
name: 'resizeImage:25',
|
|
633
|
+
value: '25',
|
|
634
|
+
icon: 'small'
|
|
635
|
+
},
|
|
636
|
+
{
|
|
637
|
+
name: 'resizeImage:50',
|
|
638
|
+
value: '50',
|
|
639
|
+
icon: 'medium'
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
name: 'resizeImage:75',
|
|
643
|
+
value: '75',
|
|
644
|
+
icon: 'large'
|
|
645
|
+
} ],
|
|
646
|
+
toolbar: [
|
|
647
|
+
'toggleImageCaption',
|
|
648
|
+
'imageTextAlternative',
|
|
649
|
+
'imageStyle:inline',
|
|
650
|
+
'imageStyle:block',
|
|
651
|
+
'imageStyle:side',
|
|
652
|
+
'linkImage',
|
|
653
|
+
'resizeImage:25', 'resizeImage:50', 'resizeImage:75', 'resizeImage:original'
|
|
654
|
+
]
|
|
655
|
+
},
|
|
656
|
+
table: {
|
|
657
|
+
contentToolbar: [
|
|
658
|
+
'tableColumn',
|
|
659
|
+
'tableRow',
|
|
660
|
+
'mergeTableCells',
|
|
661
|
+
'tableCellProperties',
|
|
662
|
+
'tableProperties',
|
|
663
|
+
'toggleTableCaption'
|
|
664
|
+
]
|
|
665
|
+
},
|
|
666
|
+
heading: {
|
|
667
|
+
options: [
|
|
668
|
+
{ model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
|
|
669
|
+
{ model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading1' },
|
|
670
|
+
{ model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2' },
|
|
671
|
+
{ model: 'heading3', view: 'h3', title: 'Heading 3', class: 'ck-heading_heading3' },
|
|
672
|
+
{ model: 'heading4', view: 'h4', title: 'Heading 4', class: 'ck-heading_heading4' },
|
|
673
|
+
]
|
|
674
|
+
},
|
|
675
|
+
htmlSupport: {
|
|
676
|
+
allow: [
|
|
677
|
+
{
|
|
678
|
+
name: 'img',
|
|
679
|
+
attributes: {
|
|
680
|
+
sizes:true,
|
|
681
|
+
loading:true,
|
|
682
|
+
}
|
|
683
|
+
},
|
|
684
|
+
]
|
|
685
|
+
},
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
```
|
|
693
|
+
</details>
|
|
694
|
+
|
|
695
|
+
<h3 align="center">Classic+Balloon</h3>
|
|
696
|
+
|
|
697
|
+
<p align="center">
|
|
698
|
+
<img src="https://raw.githubusercontent.com/nshenderov/strapi-plugin-ckeditor/master/assets/230222.jpg" alt="CKEditor5-Strapi" width="800" />
|
|
699
|
+
</p>
|
|
700
|
+
|
|
701
|
+
<details>
|
|
702
|
+
<summary><b>Classic+Balloon config:</b> </summary>
|
|
703
|
+
|
|
704
|
+
```js
|
|
705
|
+
module.exports = () => {
|
|
706
|
+
return {
|
|
707
|
+
ckeditor: {
|
|
708
|
+
enabled: true,
|
|
709
|
+
config:{
|
|
710
|
+
editor:{
|
|
711
|
+
toolbar: {
|
|
712
|
+
items: [
|
|
713
|
+
'paragraph',
|
|
714
|
+
'heading1',
|
|
715
|
+
'heading2',
|
|
716
|
+
'|',
|
|
717
|
+
'bulletedList',
|
|
718
|
+
'todoList',
|
|
719
|
+
'numberedList',
|
|
720
|
+
'|',
|
|
721
|
+
'outdent',
|
|
722
|
+
'indent',
|
|
723
|
+
'horizontalLine',
|
|
724
|
+
'|',
|
|
725
|
+
'StrapiMediaLib',
|
|
726
|
+
'insertTable',
|
|
727
|
+
'blockQuote',
|
|
728
|
+
'mediaEmbed',
|
|
729
|
+
'link',
|
|
730
|
+
'highlight',
|
|
731
|
+
'|',
|
|
732
|
+
'htmlEmbed',
|
|
733
|
+
'sourceEditing',
|
|
734
|
+
'code',
|
|
735
|
+
'codeBlock',
|
|
736
|
+
'|',
|
|
737
|
+
'subscript',
|
|
738
|
+
'superscript',
|
|
739
|
+
'strikethrough',
|
|
740
|
+
'specialCharacters',
|
|
741
|
+
'|',
|
|
742
|
+
'heading',
|
|
743
|
+
"fullScreen",
|
|
744
|
+
'undo',
|
|
745
|
+
'redo'
|
|
746
|
+
]
|
|
747
|
+
},
|
|
748
|
+
balloonToolbar: [
|
|
749
|
+
'bold',
|
|
750
|
+
'italic',
|
|
751
|
+
'fontColor',
|
|
752
|
+
'FontBackgroundColor',
|
|
753
|
+
'fontFamily',
|
|
754
|
+
'fontSize',
|
|
755
|
+
'alignment',
|
|
756
|
+
'|',
|
|
757
|
+
'removeFormat',
|
|
758
|
+
'undo',
|
|
759
|
+
'redo'
|
|
760
|
+
],
|
|
761
|
+
fontSize: {
|
|
762
|
+
options: [
|
|
763
|
+
9,
|
|
764
|
+
11,
|
|
765
|
+
13,
|
|
766
|
+
'default',
|
|
767
|
+
17,
|
|
768
|
+
19,
|
|
769
|
+
21,
|
|
770
|
+
27,
|
|
771
|
+
35,
|
|
772
|
+
],
|
|
773
|
+
supportAllValues: false
|
|
774
|
+
},
|
|
775
|
+
fontFamily: {
|
|
776
|
+
options: [
|
|
777
|
+
'default',
|
|
778
|
+
'Arial, Helvetica Neue, Helvetica, Source Sans Pro, sans-serif',
|
|
779
|
+
'Courier New, Courier, monospace',
|
|
780
|
+
'Georgia, serif',
|
|
781
|
+
'Lucida Sans Unicode, Lucida Grande, sans-serif',
|
|
782
|
+
'Tahoma, Geneva, sans-serif',
|
|
783
|
+
'Times New Roman, Times, serif',
|
|
784
|
+
'Trebuchet MS, Helvetica, sans-serif',
|
|
785
|
+
'Verdana, Geneva, sans-serif',
|
|
786
|
+
'Roboto, Roboto Black, Roboto Medium, Roboto Light, sans-serif',
|
|
787
|
+
],
|
|
788
|
+
supportAllValues: true
|
|
789
|
+
},
|
|
790
|
+
fontColor: {
|
|
791
|
+
columns: 5,
|
|
792
|
+
documentColors: 10,
|
|
793
|
+
},
|
|
794
|
+
fontBackgroundColor: {
|
|
795
|
+
columns: 5,
|
|
796
|
+
documentColors: 10,
|
|
797
|
+
},
|
|
798
|
+
image: {
|
|
799
|
+
resizeUnit: "%",
|
|
800
|
+
resizeOptions: [ {
|
|
801
|
+
name: 'resizeImage:original',
|
|
802
|
+
value: null,
|
|
803
|
+
icon: 'original'
|
|
804
|
+
},
|
|
805
|
+
{
|
|
806
|
+
name: 'resizeImage:25',
|
|
807
|
+
value: '25',
|
|
808
|
+
icon: 'small'
|
|
809
|
+
},
|
|
810
|
+
{
|
|
811
|
+
name: 'resizeImage:50',
|
|
812
|
+
value: '50',
|
|
813
|
+
icon: 'medium'
|
|
814
|
+
},
|
|
815
|
+
{
|
|
816
|
+
name: 'resizeImage:75',
|
|
817
|
+
value: '75',
|
|
818
|
+
icon: 'large'
|
|
819
|
+
} ],
|
|
820
|
+
toolbar: [
|
|
821
|
+
'toggleImageCaption',
|
|
822
|
+
'imageTextAlternative',
|
|
823
|
+
'imageStyle:inline',
|
|
824
|
+
'imageStyle:block',
|
|
825
|
+
'imageStyle:side',
|
|
826
|
+
'linkImage',
|
|
827
|
+
'resizeImage:25', 'resizeImage:50', 'resizeImage:75', 'resizeImage:original'
|
|
828
|
+
]
|
|
829
|
+
},
|
|
830
|
+
table: {
|
|
831
|
+
contentToolbar: [
|
|
832
|
+
'tableColumn',
|
|
833
|
+
'tableRow',
|
|
834
|
+
'mergeTableCells',
|
|
835
|
+
'tableCellProperties',
|
|
836
|
+
'tableProperties',
|
|
837
|
+
'toggleTableCaption'
|
|
838
|
+
]
|
|
839
|
+
},
|
|
840
|
+
heading: {
|
|
841
|
+
options: [
|
|
842
|
+
{ model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
|
|
843
|
+
{ model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading1' },
|
|
844
|
+
{ model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2' },
|
|
845
|
+
{ model: 'heading3', view: 'h3', title: 'Heading 3', class: 'ck-heading_heading3' },
|
|
846
|
+
{ model: 'heading4', view: 'h4', title: 'Heading 4', class: 'ck-heading_heading4' },
|
|
847
|
+
]
|
|
848
|
+
},
|
|
849
|
+
htmlSupport: {
|
|
850
|
+
allow: [
|
|
851
|
+
{
|
|
852
|
+
name: 'img',
|
|
853
|
+
attributes: {
|
|
854
|
+
sizes:true,
|
|
855
|
+
loading:true,
|
|
856
|
+
}
|
|
857
|
+
},
|
|
858
|
+
]
|
|
859
|
+
},
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
```
|
|
867
|
+
</details>
|
|
868
|
+
|
|
349
869
|
## <a id="themecustomization"></a>💅 Theme customization
|
|
350
870
|
If you want to customize editor styles you should define styles in `config.plugin.styles` field.
|
|
351
871
|
|
|
@@ -421,9 +941,11 @@ module.exports = styles;
|
|
|
421
941
|
```
|
|
422
942
|
|
|
423
943
|
## <a id="requirements"></a>⚠️ Requirements
|
|
424
|
-
Strapi **v4
|
|
944
|
+
Strapi **v4.1.8+**
|
|
945
|
+
|
|
946
|
+
Node **14 - 16**
|
|
425
947
|
|
|
426
|
-
Tested on **v4.
|
|
948
|
+
Tested on **v4.1.8 - 4.3.4**
|
|
427
949
|
|
|
428
950
|
## <a id="thanks"></a>👍 This build includes some useful plugins based on these repos so thanks to them:
|
|
429
951
|
https://github.com/Roslovets-Inc/strapi-plugin-ckeditor5
|