@_sh/strapi-plugin-ckeditor 2.1.3 → 3.0.1
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 +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 +22 -18
- package/admin/src/{components/Input/CKEditor → Input}/theme/light.js +22 -17
- 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 +6 -83
- 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
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
export const materialColors = [
|
|
2
|
+
{ label: 'Red 50', color: '#ffebee' },
|
|
3
|
+
{ label: 'Purple 50', color: '#f3e5f5' },
|
|
4
|
+
{ label: 'Indigo 50', color: '#e8eaf6' },
|
|
5
|
+
{ label: 'Blue 50', color: '#e3f2fd' },
|
|
6
|
+
{ label: 'Cyan 50', color: '#e0f7fa' },
|
|
7
|
+
{ label: 'Teal 50', color: '#e0f2f1' },
|
|
8
|
+
{ label: 'Light green 50', color: '#f1f8e9' },
|
|
9
|
+
{ label: 'Lime 50', color: '#f9fbe7' },
|
|
10
|
+
{ label: 'Amber 50', color: '#fff8e1' },
|
|
11
|
+
{ label: 'Orange 50', color: '#fff3e0' },
|
|
12
|
+
{ label: 'Grey 50', color: '#fafafa' },
|
|
13
|
+
{ label: 'Blue grey 50', color: '#eceff1' },
|
|
14
|
+
{ label: 'Red 100', color: '#ffcdd2' },
|
|
15
|
+
{ label: 'Purple 100', color: '#e1bee7' },
|
|
16
|
+
{ label: 'Indigo 100', color: '#c5cae9' },
|
|
17
|
+
{ label: 'Blue 100', color: '#bbdefb' },
|
|
18
|
+
{ label: 'Cyan 100', color: '#b2ebf2' },
|
|
19
|
+
{ label: 'Teal 100', color: '#b2dfdb' },
|
|
20
|
+
{ label: 'Light green 100', color: '#dcedc8' },
|
|
21
|
+
{ label: 'Lime 100', color: '#f0f4c3' },
|
|
22
|
+
{ label: 'Amber 100', color: '#ffecb3' },
|
|
23
|
+
{ label: 'Orange 100', color: '#ffe0b2' },
|
|
24
|
+
{ label: 'Grey 100', color: '#f5f5f5' },
|
|
25
|
+
{ label: 'Blue grey 100', color: '#cfd8dc' },
|
|
26
|
+
{ label: 'Red 200', color: '#ef9a9a' },
|
|
27
|
+
{ label: 'Purple 200', color: '#ce93d8' },
|
|
28
|
+
{ label: 'Indigo 200', color: '#9fa8da' },
|
|
29
|
+
{ label: 'Blue 200', color: '#90caf9' },
|
|
30
|
+
{ label: 'Cyan 200', color: '#80deea' },
|
|
31
|
+
{ label: 'Teal 200', color: '#80cbc4' },
|
|
32
|
+
{ label: 'Light green 200', color: '#c5e1a5' },
|
|
33
|
+
{ label: 'Lime 200', color: '#e6ee9c' },
|
|
34
|
+
{ label: 'Amber 200', color: '#ffe082' },
|
|
35
|
+
{ label: 'Orange 200', color: '#ffcc80' },
|
|
36
|
+
{ label: 'Grey 200', color: '#eeeeee' },
|
|
37
|
+
{ label: 'Blue grey 200', color: '#b0bec5' },
|
|
38
|
+
{ label: 'Red 300', color: '#e57373' },
|
|
39
|
+
{ label: 'Purple 300', color: '#ba68c8' },
|
|
40
|
+
{ label: 'Indigo 300', color: '#7986cb' },
|
|
41
|
+
{ label: 'Blue 300', color: '#64b5f6' },
|
|
42
|
+
{ label: 'Cyan 300', color: '#4dd0e1' },
|
|
43
|
+
{ label: 'Teal 300', color: '#4db6ac' },
|
|
44
|
+
{ label: 'Light green 300', color: '#aed581' },
|
|
45
|
+
{ label: 'Lime 300', color: '#dce775' },
|
|
46
|
+
{ label: 'Amber 300', color: '#ffd54f' },
|
|
47
|
+
{ label: 'Orange 300', color: '#ffb74d' },
|
|
48
|
+
{ label: 'Grey 300', color: '#e0e0e0' },
|
|
49
|
+
{ label: 'Blue grey 300', color: '#90a4ae' },
|
|
50
|
+
{ label: 'Red 400', color: '#ef5350' },
|
|
51
|
+
{ label: 'Purple 400', color: '#ab47bc' },
|
|
52
|
+
{ label: 'Indigo 400', color: '#5c6bc0' },
|
|
53
|
+
{ label: 'Blue 400', color: '#42a5f5' },
|
|
54
|
+
{ label: 'Cyan 400', color: '#26c6da' },
|
|
55
|
+
{ label: 'Teal 400', color: '#26a69a' },
|
|
56
|
+
{ label: 'Light green 400', color: '#9ccc65' },
|
|
57
|
+
{ label: 'Lime 400', color: '#d4e157' },
|
|
58
|
+
{ label: 'Amber 400', color: '#ffca28' },
|
|
59
|
+
{ label: 'Orange 400', color: '#ffa726' },
|
|
60
|
+
{ label: 'Grey 400', color: '#bdbdbd' },
|
|
61
|
+
{ label: 'Blue grey 400', color: '#78909c' },
|
|
62
|
+
{ label: 'Red 500', color: '#f44336' },
|
|
63
|
+
{ label: 'Purple 500', color: '#9c27b0' },
|
|
64
|
+
{ label: 'Indigo 500', color: '#3f51b5' },
|
|
65
|
+
{ label: 'Blue 500', color: '#2196f3' },
|
|
66
|
+
{ label: 'Cyan 500', color: '#00bcd4' },
|
|
67
|
+
{ label: 'Teal 500', color: '#009688' },
|
|
68
|
+
{ label: 'Light green 500', color: '#8bc34a' },
|
|
69
|
+
{ label: 'Lime 500', color: '#cddc39' },
|
|
70
|
+
{ label: 'Amber 500', color: '#ffc107' },
|
|
71
|
+
{ label: 'Orange 500', color: '#ff9800' },
|
|
72
|
+
{ label: 'Grey 500', color: '#9e9e9e' },
|
|
73
|
+
{ label: 'Blue grey 500', color: '#607d8b' },
|
|
74
|
+
{ label: 'Red 600', color: '#e53935' },
|
|
75
|
+
{ label: 'Purple 600', color: '#8e24aa' },
|
|
76
|
+
{ label: 'Indigo 600', color: '#3949ab' },
|
|
77
|
+
{ label: 'Blue 600', color: '#1e88e5' },
|
|
78
|
+
{ label: 'Cyan 600', color: '#00acc1' },
|
|
79
|
+
{ label: 'Teal 600', color: '#00897b' },
|
|
80
|
+
{ label: 'Light green 600', color: '#7cb342' },
|
|
81
|
+
{ label: 'Lime 600', color: '#c0ca33' },
|
|
82
|
+
{ label: 'Amber 600', color: '#ffb300' },
|
|
83
|
+
{ label: 'Orange 600', color: '#fb8c00' },
|
|
84
|
+
{ label: 'Grey 600', color: '#757575' },
|
|
85
|
+
{ label: 'Blue grey 600', color: '#546e7a' },
|
|
86
|
+
{ label: 'Red 700', color: '#d32f2f' },
|
|
87
|
+
{ label: 'Purple 700', color: '#7b1fa2' },
|
|
88
|
+
{ label: 'Indigo 700', color: '#303f9f' },
|
|
89
|
+
{ label: 'Blue 700', color: '#1976d2' },
|
|
90
|
+
{ label: 'Cyan 700', color: '#0097a7' },
|
|
91
|
+
{ label: 'Teal 700', color: '#00796b' },
|
|
92
|
+
{ label: 'Light green 700', color: '#689f38' },
|
|
93
|
+
{ label: 'Lime 700', color: '#afb42b' },
|
|
94
|
+
{ label: 'Amber 700', color: '#ffa000' },
|
|
95
|
+
{ label: 'Orange 700', color: '#f57c00' },
|
|
96
|
+
{ label: 'Grey 700', color: '#616161' },
|
|
97
|
+
{ label: 'Blue grey 700', color: '#455a64' },
|
|
98
|
+
{ label: 'Red 800', color: '#c62828' },
|
|
99
|
+
{ label: 'Purple 800', color: '#6a1b9a' },
|
|
100
|
+
{ label: 'Indigo 800', color: '#283593' },
|
|
101
|
+
{ label: 'Blue 800', color: '#1565c0' },
|
|
102
|
+
{ label: 'Cyan 800', color: '#00838f' },
|
|
103
|
+
{ label: 'Teal 800', color: '#00695c' },
|
|
104
|
+
{ label: 'Light green 800', color: '#558b2f' },
|
|
105
|
+
{ label: 'Lime 800', color: '#9e9d24' },
|
|
106
|
+
{ label: 'Amber 800', color: '#ff8f00' },
|
|
107
|
+
{ label: 'Orange 800', color: '#ef6c00' },
|
|
108
|
+
{ label: 'Grey 800', color: '#424242' },
|
|
109
|
+
{ label: 'Blue grey 800', color: '#37474f' },
|
|
110
|
+
{ label: 'Red 900', color: '#b71c1c' },
|
|
111
|
+
{ label: 'Purple 900', color: '#4a148c' },
|
|
112
|
+
{ label: 'Indigo 900', color: '#1a237e' },
|
|
113
|
+
{ label: 'Blue 900', color: '#0d47a1' },
|
|
114
|
+
{ label: 'Cyan 900', color: '#006064' },
|
|
115
|
+
{ label: 'Teal 900', color: '#004d40' },
|
|
116
|
+
{ label: 'Light green 900', color: '#33691e' },
|
|
117
|
+
{ label: 'Lime 900', color: '#827717' },
|
|
118
|
+
{ label: 'Amber 900', color: '#ff6f00' },
|
|
119
|
+
{ label: 'Orange 900', color: '#e65100' },
|
|
120
|
+
{ label: 'Grey 900', color: '#212121' },
|
|
121
|
+
{ label: 'Blue grey 900', color: '#263238' },
|
|
122
|
+
];
|
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
import sanitizeHtml from 'sanitize-html';
|
|
2
|
+
import { materialColors } from './colors';
|
|
3
|
+
|
|
4
|
+
const defaultEditorConfig = {
|
|
5
|
+
plugins: [
|
|
6
|
+
SH_CKE.Alignment,
|
|
7
|
+
SH_CKE.Autoformat,
|
|
8
|
+
SH_CKE.AutoImage,
|
|
9
|
+
SH_CKE.BalloonToolbar,
|
|
10
|
+
SH_CKE.BlockQuote,
|
|
11
|
+
SH_CKE.Bold,
|
|
12
|
+
SH_CKE.Code,
|
|
13
|
+
SH_CKE.CodeBlock,
|
|
14
|
+
SH_CKE.Essentials,
|
|
15
|
+
SH_CKE.FontBackgroundColor,
|
|
16
|
+
SH_CKE.FontColor,
|
|
17
|
+
SH_CKE.FontFamily,
|
|
18
|
+
SH_CKE.FontSize,
|
|
19
|
+
SH_CKE.GeneralHtmlSupport,
|
|
20
|
+
SH_CKE.Heading,
|
|
21
|
+
SH_CKE.HorizontalLine,
|
|
22
|
+
SH_CKE.HtmlEmbed,
|
|
23
|
+
SH_CKE.Image,
|
|
24
|
+
SH_CKE.ImageCaption,
|
|
25
|
+
SH_CKE.ImageInsert,
|
|
26
|
+
SH_CKE.ImageResize,
|
|
27
|
+
SH_CKE.ImageStyle,
|
|
28
|
+
SH_CKE.ImageToolbar,
|
|
29
|
+
SH_CKE.ImageUpload,
|
|
30
|
+
SH_CKE.Indent,
|
|
31
|
+
SH_CKE.IndentBlock,
|
|
32
|
+
SH_CKE.Italic,
|
|
33
|
+
SH_CKE.List,
|
|
34
|
+
SH_CKE.ListProperties,
|
|
35
|
+
SH_CKE.Link,
|
|
36
|
+
SH_CKE.LinkImage,
|
|
37
|
+
SH_CKE.LinkImage,
|
|
38
|
+
SH_CKE.MediaEmbed,
|
|
39
|
+
SH_CKE.PageBreak,
|
|
40
|
+
SH_CKE.Paragraph,
|
|
41
|
+
SH_CKE.PasteFromOffice,
|
|
42
|
+
SH_CKE.PictureEditing,
|
|
43
|
+
SH_CKE.RemoveFormat,
|
|
44
|
+
SH_CKE.SourceEditing,
|
|
45
|
+
SH_CKE.SpecialCharacters,
|
|
46
|
+
SH_CKE.SpecialCharactersArrows,
|
|
47
|
+
SH_CKE.SpecialCharactersCurrency,
|
|
48
|
+
SH_CKE.SpecialCharactersLatin,
|
|
49
|
+
SH_CKE.SpecialCharactersMathematical,
|
|
50
|
+
SH_CKE.SpecialCharactersText,
|
|
51
|
+
SH_CKE.StrapiMediaLib,
|
|
52
|
+
SH_CKE.StrapiUploadAdapter,
|
|
53
|
+
SH_CKE.Strikethrough,
|
|
54
|
+
SH_CKE.Style,
|
|
55
|
+
SH_CKE.Subscript,
|
|
56
|
+
SH_CKE.Superscript,
|
|
57
|
+
SH_CKE.ShowBlocks,
|
|
58
|
+
SH_CKE.Table,
|
|
59
|
+
SH_CKE.TableCaption,
|
|
60
|
+
SH_CKE.TableCellProperties,
|
|
61
|
+
SH_CKE.TableColumnResize,
|
|
62
|
+
SH_CKE.TableProperties,
|
|
63
|
+
SH_CKE.TableToolbar,
|
|
64
|
+
SH_CKE.Underline,
|
|
65
|
+
SH_CKE.WordCount,
|
|
66
|
+
],
|
|
67
|
+
toolbar: [
|
|
68
|
+
{
|
|
69
|
+
label: ' ',
|
|
70
|
+
tooltip: null,
|
|
71
|
+
icon: 'paragraph',
|
|
72
|
+
items: ['heading', 'style'],
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
label: ' ',
|
|
76
|
+
tooltip: null,
|
|
77
|
+
icon: 'text',
|
|
78
|
+
items: ['fontSize', 'fontFamily'],
|
|
79
|
+
},
|
|
80
|
+
'|',
|
|
81
|
+
'alignment',
|
|
82
|
+
{
|
|
83
|
+
label: ' ',
|
|
84
|
+
tooltip: null,
|
|
85
|
+
icon: SH_CKE.icons.indent,
|
|
86
|
+
items: ['outdent', 'indent'],
|
|
87
|
+
},
|
|
88
|
+
'|',
|
|
89
|
+
'bulletedList',
|
|
90
|
+
'numberedList',
|
|
91
|
+
'|',
|
|
92
|
+
'insertImage',
|
|
93
|
+
'mediaEmbed',
|
|
94
|
+
'strapiMediaLib',
|
|
95
|
+
'link',
|
|
96
|
+
'blockquote',
|
|
97
|
+
'insertTable',
|
|
98
|
+
'specialCharacters',
|
|
99
|
+
'htmlEmbed',
|
|
100
|
+
'codeBlock',
|
|
101
|
+
'|',
|
|
102
|
+
'horizontalLine',
|
|
103
|
+
'pageBreak',
|
|
104
|
+
'|',
|
|
105
|
+
'SourceEditing',
|
|
106
|
+
'|',
|
|
107
|
+
'showBlocks',
|
|
108
|
+
'|',
|
|
109
|
+
'undo',
|
|
110
|
+
'redo',
|
|
111
|
+
'|',
|
|
112
|
+
],
|
|
113
|
+
balloonToolbar: [
|
|
114
|
+
'bold',
|
|
115
|
+
'italic',
|
|
116
|
+
'fontColor',
|
|
117
|
+
'fontBackgroundColor',
|
|
118
|
+
{
|
|
119
|
+
label: ' ',
|
|
120
|
+
tooltip: null,
|
|
121
|
+
icon: `
|
|
122
|
+
<svg width="800px" height="800px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
123
|
+
<rect x="0" fill="none" width="24" height="24"/>
|
|
124
|
+
<g>
|
|
125
|
+
<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"/>
|
|
126
|
+
</g>
|
|
127
|
+
</svg>`,
|
|
128
|
+
items: ['underline', 'strikethrough', 'superscript', 'subscript'],
|
|
129
|
+
},
|
|
130
|
+
'|',
|
|
131
|
+
'removeFormat',
|
|
132
|
+
],
|
|
133
|
+
fontFamily: {
|
|
134
|
+
supportAllValues: true,
|
|
135
|
+
},
|
|
136
|
+
fontSize: {
|
|
137
|
+
options: [10, 12, 14, 'default', 18, 20, 22],
|
|
138
|
+
supportAllValues: true,
|
|
139
|
+
},
|
|
140
|
+
fontColor: {
|
|
141
|
+
columns: 12,
|
|
142
|
+
documentColors: 12,
|
|
143
|
+
colors: materialColors,
|
|
144
|
+
},
|
|
145
|
+
fontBackgroundColor: {
|
|
146
|
+
columns: 12,
|
|
147
|
+
documentColors: 12,
|
|
148
|
+
colors: materialColors,
|
|
149
|
+
},
|
|
150
|
+
heading: {
|
|
151
|
+
options: [
|
|
152
|
+
{ model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
|
|
153
|
+
{
|
|
154
|
+
model: 'heading1',
|
|
155
|
+
view: 'h1',
|
|
156
|
+
title: 'Heading 1',
|
|
157
|
+
class: 'ck-heading_heading1',
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
model: 'heading2',
|
|
161
|
+
view: 'h2',
|
|
162
|
+
title: 'Heading 2',
|
|
163
|
+
class: 'ck-heading_heading2',
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
model: 'heading3',
|
|
167
|
+
view: 'h3',
|
|
168
|
+
title: 'Heading 3',
|
|
169
|
+
class: 'ck-heading_heading3',
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
model: 'heading4',
|
|
173
|
+
view: 'h4',
|
|
174
|
+
title: 'Heading 4',
|
|
175
|
+
class: 'ck-heading_heading4',
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
model: 'heading5',
|
|
179
|
+
view: 'h5',
|
|
180
|
+
title: 'Heading 5',
|
|
181
|
+
class: 'ck-heading_heading5',
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
model: 'heading6',
|
|
185
|
+
view: 'h6',
|
|
186
|
+
title: 'Heading 6',
|
|
187
|
+
class: 'ck-heading_heading6',
|
|
188
|
+
},
|
|
189
|
+
],
|
|
190
|
+
},
|
|
191
|
+
htmlSupport: {
|
|
192
|
+
allow: [
|
|
193
|
+
{
|
|
194
|
+
name: /.*/,
|
|
195
|
+
attributes: true,
|
|
196
|
+
classes: true,
|
|
197
|
+
styles: true,
|
|
198
|
+
},
|
|
199
|
+
],
|
|
200
|
+
disallow: [
|
|
201
|
+
{
|
|
202
|
+
attributes: [
|
|
203
|
+
{ key: /^on(.*)/i, value: true },
|
|
204
|
+
{
|
|
205
|
+
key: /.*/,
|
|
206
|
+
value: /(\b)(on\S+)(\s*)=|javascript:|(<\s*)(\/*)script/i,
|
|
207
|
+
},
|
|
208
|
+
{ key: /.*/, value: /data:(?!image\/(png|jpeg|gif|webp))/i },
|
|
209
|
+
],
|
|
210
|
+
},
|
|
211
|
+
{ name: 'script' },
|
|
212
|
+
],
|
|
213
|
+
},
|
|
214
|
+
htmlEmbed: {
|
|
215
|
+
showPreviews: true,
|
|
216
|
+
sanitizeHtml: (inputHtml) => {
|
|
217
|
+
const outputHtml = sanitizeHtml(inputHtml);
|
|
218
|
+
return {
|
|
219
|
+
html: outputHtml,
|
|
220
|
+
hasChanged: true,
|
|
221
|
+
};
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
list: {
|
|
225
|
+
properties: {
|
|
226
|
+
styles: true,
|
|
227
|
+
startIndex: true,
|
|
228
|
+
reversed: true,
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
table: {
|
|
232
|
+
contentToolbar: [
|
|
233
|
+
'tableColumn',
|
|
234
|
+
'tableRow',
|
|
235
|
+
'mergeTableCells',
|
|
236
|
+
'tableProperties',
|
|
237
|
+
'tableCellProperties',
|
|
238
|
+
'toggleTableCaption',
|
|
239
|
+
],
|
|
240
|
+
},
|
|
241
|
+
image: {
|
|
242
|
+
styles: {
|
|
243
|
+
options: [
|
|
244
|
+
'inline',
|
|
245
|
+
'alignLeft',
|
|
246
|
+
'alignRight',
|
|
247
|
+
'alignCenter',
|
|
248
|
+
'alignBlockLeft',
|
|
249
|
+
'alignBlockRight',
|
|
250
|
+
'block',
|
|
251
|
+
'side',
|
|
252
|
+
],
|
|
253
|
+
},
|
|
254
|
+
resizeOptions: [
|
|
255
|
+
{
|
|
256
|
+
name: 'resizeImage:original',
|
|
257
|
+
label: 'Default image width',
|
|
258
|
+
value: null,
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
name: 'resizeImage:50',
|
|
262
|
+
label: '50% page width',
|
|
263
|
+
value: '50',
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
name: 'resizeImage:75',
|
|
267
|
+
label: '75% page width',
|
|
268
|
+
value: '75',
|
|
269
|
+
},
|
|
270
|
+
],
|
|
271
|
+
toolbar: [
|
|
272
|
+
'imageTextAlternative',
|
|
273
|
+
'toggleImageCaption',
|
|
274
|
+
'linkImage',
|
|
275
|
+
'|',
|
|
276
|
+
'imageStyle:inline',
|
|
277
|
+
'imageStyle:wrapText',
|
|
278
|
+
'imageStyle:breakText',
|
|
279
|
+
'imageStyle:side',
|
|
280
|
+
'|',
|
|
281
|
+
'resizeImage',
|
|
282
|
+
],
|
|
283
|
+
},
|
|
284
|
+
link: {
|
|
285
|
+
decorators: {
|
|
286
|
+
openInNewTab: {
|
|
287
|
+
mode: 'manual',
|
|
288
|
+
label: 'Open in a new tab',
|
|
289
|
+
defaultValue: true,
|
|
290
|
+
attributes: {
|
|
291
|
+
target: '_blank',
|
|
292
|
+
rel: 'noopener noreferrer',
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
toggleDownloadable: {
|
|
296
|
+
mode: 'manual',
|
|
297
|
+
label: 'Downloadable',
|
|
298
|
+
attributes: {
|
|
299
|
+
download: 'file',
|
|
300
|
+
},
|
|
301
|
+
},
|
|
302
|
+
},
|
|
303
|
+
addTargetToExternalLinks: true,
|
|
304
|
+
defaultProtocol: 'https://',
|
|
305
|
+
},
|
|
306
|
+
style: {
|
|
307
|
+
definitions: [
|
|
308
|
+
{
|
|
309
|
+
name: 'Title',
|
|
310
|
+
element: 'h1',
|
|
311
|
+
classes: ['document-title'],
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
name: 'Subtitle',
|
|
315
|
+
element: 'h2',
|
|
316
|
+
classes: ['document-subtitle'],
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
name: 'Callout',
|
|
320
|
+
element: 'p',
|
|
321
|
+
classes: ['callout'],
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
name: 'Side quote',
|
|
325
|
+
element: 'blockquote',
|
|
326
|
+
classes: ['side-quote'],
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
name: 'Needs clarification',
|
|
330
|
+
element: 'span',
|
|
331
|
+
classes: ['needs-clarification'],
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
name: 'Wide spacing',
|
|
335
|
+
element: 'span',
|
|
336
|
+
classes: ['wide-spacing'],
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
name: 'Small caps',
|
|
340
|
+
element: 'span',
|
|
341
|
+
classes: ['small-caps'],
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
name: 'Code (dark)',
|
|
345
|
+
element: 'pre',
|
|
346
|
+
classes: ['stylish-code', 'stylish-code-dark'],
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
name: 'Code (bright)',
|
|
350
|
+
element: 'pre',
|
|
351
|
+
classes: ['stylish-code', 'stylish-code-bright'],
|
|
352
|
+
},
|
|
353
|
+
],
|
|
354
|
+
},
|
|
355
|
+
ui: {
|
|
356
|
+
poweredBy: {
|
|
357
|
+
position: 'inside',
|
|
358
|
+
side: 'right',
|
|
359
|
+
label: '',
|
|
360
|
+
},
|
|
361
|
+
},
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
export const defaultEditor = {
|
|
365
|
+
default: {
|
|
366
|
+
field: {
|
|
367
|
+
key: 'default',
|
|
368
|
+
value: 'default',
|
|
369
|
+
metadatas: {
|
|
370
|
+
intlLabel: {
|
|
371
|
+
id: 'ckeditor.preset.default.label',
|
|
372
|
+
defaultMessage: 'default',
|
|
373
|
+
},
|
|
374
|
+
},
|
|
375
|
+
},
|
|
376
|
+
editorConfig: defaultEditorConfig,
|
|
377
|
+
},
|
|
378
|
+
};
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { css } from 'styled-components';
|
|
2
|
+
|
|
3
|
+
export const additional = css`
|
|
4
|
+
/* --- expanding --- */
|
|
5
|
+
|
|
6
|
+
.ck.ck-editor__main .ck-blurred {
|
|
7
|
+
max-height: 200px;
|
|
8
|
+
}
|
|
9
|
+
.ck.ck-editor__main .ck-focused {
|
|
10
|
+
max-height: 700px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* --- color-grid --- */
|
|
14
|
+
|
|
15
|
+
.ck.ck-color-ui-dropdown {
|
|
16
|
+
--ck-color-grid-tile-size: 22px !important;
|
|
17
|
+
}
|
|
18
|
+
.ck.ck-color-grid__tile {
|
|
19
|
+
width: auto;
|
|
20
|
+
}
|
|
21
|
+
.ck.ck-color-ui-dropdown .ck-color-grid {
|
|
22
|
+
grid-gap: 2px;
|
|
23
|
+
}
|
|
24
|
+
.ck.ck-color-ui-dropdown .ck-color-grid .ck-button {
|
|
25
|
+
border-radius: 2px;
|
|
26
|
+
}
|
|
27
|
+
.ck.ck-color-ui-dropdown
|
|
28
|
+
.ck.ck-color-grid
|
|
29
|
+
.ck-color-grid__tile:hover:not(.ck-disabled),
|
|
30
|
+
.ck.ck-color-ui-dropdown
|
|
31
|
+
.ck.ck-color-grid
|
|
32
|
+
.ck-color-grid__tile:focus:not(.ck-disabled) {
|
|
33
|
+
z-index: 1;
|
|
34
|
+
transform: scale(1.1);
|
|
35
|
+
border-radius: 2px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* ---- Styles feature ------------------------------------------------------ */
|
|
39
|
+
|
|
40
|
+
:root {
|
|
41
|
+
--ck-georgia-serif-font-stack: Georgia, Times, Times New Roman, serif;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.ck-content h1.document-title {
|
|
45
|
+
font-family: var(--ck-georgia-serif-font-stack);
|
|
46
|
+
font-size: 50px;
|
|
47
|
+
font-weight: bold;
|
|
48
|
+
border: 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.ck-content h2.document-subtitle {
|
|
52
|
+
font-family: var(--ck-georgia-serif-font-stack);
|
|
53
|
+
font-size: 20px;
|
|
54
|
+
font-weight: bold;
|
|
55
|
+
color: #d1d1d1;
|
|
56
|
+
letter-spacing: 10px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.ck-content p.callout {
|
|
60
|
+
--border-color: #e91e1e;
|
|
61
|
+
padding: 1.2em 2em;
|
|
62
|
+
border: 1px solid var(--border-color);
|
|
63
|
+
border-left: 10px solid var(--border-color);
|
|
64
|
+
background: #fff9fb;
|
|
65
|
+
border-radius: 5px;
|
|
66
|
+
margin: 1.5em 2em;
|
|
67
|
+
box-shadow: 5px 5px 0 #ffe6ef;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.ck-content blockquote.side-quote {
|
|
71
|
+
font-family: var(--ck-georgia-serif-font-stack);
|
|
72
|
+
font-style: normal;
|
|
73
|
+
float: right;
|
|
74
|
+
width: 35%;
|
|
75
|
+
position: relative;
|
|
76
|
+
border: 0;
|
|
77
|
+
overflow: visible;
|
|
78
|
+
z-index: 1;
|
|
79
|
+
margin-left: 1em;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.ck-content blockquote.side-quote::before {
|
|
83
|
+
content: '“';
|
|
84
|
+
position: absolute;
|
|
85
|
+
top: -37px;
|
|
86
|
+
left: -10px;
|
|
87
|
+
display: block;
|
|
88
|
+
font-size: 200px;
|
|
89
|
+
color: #e7e7e7;
|
|
90
|
+
z-index: -1;
|
|
91
|
+
line-height: 1;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.ck-content blockquote.side-quote p {
|
|
95
|
+
font-size: 2em;
|
|
96
|
+
line-height: 1;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.ck-content blockquote.side-quote p:last-child:not(:first-child) {
|
|
100
|
+
font-size: 1.3em;
|
|
101
|
+
text-align: right;
|
|
102
|
+
color: #555;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.ck-content span.needs-clarification {
|
|
106
|
+
outline: 1px dashed #c8a24b;
|
|
107
|
+
background: #ffe19c;
|
|
108
|
+
border-radius: 2px;
|
|
109
|
+
position: relative;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.ck-content span.needs-clarification::after {
|
|
113
|
+
content: '?';
|
|
114
|
+
display: inline-block;
|
|
115
|
+
color: #fff;
|
|
116
|
+
background: #3b3b3b;
|
|
117
|
+
font-size: 12px;
|
|
118
|
+
vertical-align: super;
|
|
119
|
+
width: 12px;
|
|
120
|
+
height: 12px;
|
|
121
|
+
line-height: 12px;
|
|
122
|
+
border-radius: 10px;
|
|
123
|
+
text-align: center;
|
|
124
|
+
position: absolute;
|
|
125
|
+
right: -6px;
|
|
126
|
+
top: -6px;
|
|
127
|
+
font-weight: bold;
|
|
128
|
+
letter-spacing: initial;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.ck-content span.wide-spacing {
|
|
132
|
+
letter-spacing: 0.3em;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.ck-content span.small-caps {
|
|
136
|
+
font-variant: small-caps;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.ck-content span.spoiler {
|
|
140
|
+
background: #000;
|
|
141
|
+
color: #000;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.ck-content span.spoiler:hover {
|
|
145
|
+
background: #000;
|
|
146
|
+
color: #fff;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.ck-content pre.stylish-code {
|
|
150
|
+
border-color: transparent;
|
|
151
|
+
margin-left: 2em;
|
|
152
|
+
margin-right: 2em;
|
|
153
|
+
border-radius: 10px;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.ck-content pre.stylish-code::before {
|
|
157
|
+
content: '';
|
|
158
|
+
display: block;
|
|
159
|
+
height: 13px;
|
|
160
|
+
background: url(data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1NCAxMyI+CiAgPGNpcmNsZSBjeD0iNi41IiBjeT0iNi41IiByPSI2LjUiIGZpbGw9IiNGMzZCNUMiLz4KICA8Y2lyY2xlIGN4PSIyNi41IiBjeT0iNi41IiByPSI2LjUiIGZpbGw9IiNGOUJFNEQiLz4KICA8Y2lyY2xlIGN4PSI0Ny41IiBjeT0iNi41IiByPSI2LjUiIGZpbGw9IiM1NkM0NTMiLz4KPC9zdmc+Cg==);
|
|
161
|
+
margin-bottom: 8px;
|
|
162
|
+
background-repeat: no-repeat;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.ck-content pre.stylish-code-dark,
|
|
166
|
+
.ck-content pre.stylish-code-bright {
|
|
167
|
+
padding: 1em;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.ck-content pre.stylish-code-dark {
|
|
171
|
+
background: #272822;
|
|
172
|
+
box-shadow: 5px 5px 0 #0000001f;
|
|
173
|
+
color: white;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.ck-content pre.stylish-code-dark code {
|
|
177
|
+
color: white;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.ck-content pre.stylish-code-bright {
|
|
181
|
+
background: #dddfe0;
|
|
182
|
+
color: #000;
|
|
183
|
+
box-shadow: 5px 5px 0 #b3b3b3;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.ck-content pre.stylish-code-bright code {
|
|
187
|
+
color: #222;
|
|
188
|
+
}
|
|
189
|
+
`;
|