@_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
@@ -0,0 +1,520 @@
1
+ const styles = `
2
+
3
+ .ck-editor__main {
4
+ --ck-font-face:"Source Sans Pro",system-ui,Roboto,"Helvetica Neue","Helvetica",Arial,sans-serif;
5
+ min-height: ${200 / 16}em;
6
+ color:var(--ck-color-editor-base-text);
7
+ font-family:var(--ck-font-face);
8
+ > div {
9
+ min-height: ${200 / 16}em;
10
+ }
11
+ .ck-editor__editable {
12
+ line-height: initial;
13
+ }
14
+
15
+ div, applet, object, iframe,
16
+ h1, h2,h3, h4, h5,h6, p, span,
17
+ pre, a, abbr, acronym,
18
+ address, big, cite, code, del, dfn,
19
+ em, img, ins, kbd, q, s, samp, small,
20
+ strike, strong, sub, sup, tt, var,
21
+ b, u, i, center, dl, dt, dd, ol,
22
+ ul, li, fieldset, form, label, legend,
23
+ table, caption, tbody, tfoot, thead,
24
+ tr, th, td, article, aside, canvas,
25
+ details, embed, figure, figcaption,
26
+ footer, header, hgroup, menu, nav, output,
27
+ ruby, section, summary, time, mark, audio, video {
28
+ font: revert;
29
+ margin:revert;
30
+ font-family:revert;
31
+ }
32
+ h1, .ck-heading_h1_b {
33
+ font-size: 2.36em;
34
+ line-height: 1.33em;
35
+ padding-top: 1em;
36
+ margin-bottom: 1.67em;
37
+ font-weight: 400;
38
+ }
39
+ h2, .ck-heading_h2_b {
40
+ font-size: 1.68em;
41
+ line-height: 1.68em;
42
+ padding-top: 0.8em;
43
+ margin-bottom: 0.4em;
44
+ padding-bottom: 0.2em;
45
+ font-weight: 400;
46
+ }
47
+ h3, .ck-heading_h3_b{
48
+ font-size: 1.36em;
49
+ line-height: 1.5em;
50
+ padding-top: 0.8em;
51
+ margin-bottom: 0.2em;
52
+ font-weight: 400;
53
+ }
54
+ h4 {
55
+ font-size: 1.15em;
56
+ line-height: 1.4em;
57
+ padding-top: 0.7em;
58
+ margin-bottom: 0.1em;
59
+ font-weight: 400;
60
+ }
61
+ p{
62
+ font-size: 1em;
63
+ line-height: 1.6em;
64
+ padding-top: 0.2em;
65
+ margin-bottom: 0.8em;
66
+ }
67
+ .ck-heading_h1_b, h2.ck-heading_h2_b, .ck-heading_h3_b{
68
+ border-bottom: 1px solid #e9e9e9;
69
+ }
70
+ figcaption{
71
+ background-color: var(--ck-color-image-caption-background);
72
+ caption-side: bottom;
73
+ color: var(--ck-color-image-caption-text);
74
+ display: table-caption;
75
+ font-size: .75em;
76
+ outline-offset: -1px;
77
+ padding: 0.6em;
78
+ word-break: break-word;
79
+ }
80
+ blockquote {}
81
+ .table {
82
+ margin: 0;
83
+ }
84
+ ul.todo-list {
85
+ list-style: none;
86
+ margin:revert;
87
+ color:revert;
88
+ font-family:revert;
89
+ margin-left: 32px;
90
+ }
91
+ ul, ol {
92
+ list-style: initial;
93
+ margin-left: 32px;
94
+ }
95
+ sub{
96
+ vertical-align: sub
97
+ }
98
+ sup{
99
+ vertical-align: super
100
+ }
101
+
102
+
103
+ }
104
+
105
+ /*
106
+ * CKEditor 5 (v34.0.0) content styles.
107
+ * Generated on Wed, 27 Apr 2022 06:51:54 GMT.
108
+ * For more information, check out https://ckeditor.com/docs/ckeditor5/latest/installation/advanced/content-styles.html
109
+ */
110
+
111
+ :root {
112
+ --ck-color-image-caption-background: hsl(0, 0%, 97%);
113
+ --ck-color-image-caption-text: hsl(0, 0%, 20%);
114
+ --ck-color-mention-background: hsla(341, 100%, 30%, 0.1);
115
+ --ck-color-mention-text: hsl(341, 100%, 30%);
116
+ --ck-color-table-caption-background: hsl(0, 0%, 97%);
117
+ --ck-color-table-caption-text: hsl(0, 0%, 20%);
118
+ --ck-highlight-marker-blue: hsl(201, 97%, 72%);
119
+ --ck-highlight-marker-green: hsl(120, 93%, 68%);
120
+ --ck-highlight-marker-pink: hsl(345, 96%, 73%);
121
+ --ck-highlight-marker-yellow: hsl(60, 97%, 73%);
122
+ --ck-highlight-pen-green: hsl(112, 100%, 27%);
123
+ --ck-highlight-pen-red: hsl(0, 85%, 49%);
124
+ --ck-image-style-spacing: 1.5em;
125
+ --ck-inline-image-style-spacing: calc(var(--ck-image-style-spacing) / 2);
126
+ --ck-todo-list-checkmark-size: 16px;
127
+ }
128
+
129
+ .ck.ck-sticky-panel .ck-sticky-panel__content_sticky{ top:64px }
130
+
131
+ /* ckeditor5-block-quote/theme/blockquote.css */
132
+ .ck-content blockquote {
133
+ overflow: hidden;
134
+ padding-right: 1.5em;
135
+ padding-left: 1.5em;
136
+ margin-left: 0;
137
+ margin-right: 0;
138
+ font-style: italic;
139
+ border-left: solid 5px hsl(0, 0%, 80%);
140
+ }
141
+ /* ckeditor5-block-quote/theme/blockquote.css */
142
+ .ck-content[dir="rtl"] blockquote {
143
+ border-left: 0;
144
+ border-right: solid 5px hsl(0, 0%, 80%);
145
+ }
146
+ /* ckeditor5-basic-styles/theme/code.css */
147
+ .ck-content code {
148
+ background-color: hsla(0, 0%, 78%, 0.3);
149
+ padding: .15em;
150
+ border-radius: 2px;
151
+ }
152
+ /* ckeditor5-font/theme/fontsize.css */
153
+ .ck-content .text-tiny {
154
+ font-size: .7em;
155
+ }
156
+ /* ckeditor5-font/theme/fontsize.css */
157
+ .ck-content .text-small {
158
+ font-size: .85em;
159
+ }
160
+ /* ckeditor5-font/theme/fontsize.css */
161
+ .ck-content .text-big {
162
+ font-size: 1.4em;
163
+ }
164
+ /* ckeditor5-font/theme/fontsize.css */
165
+ .ck-content .text-huge {
166
+ font-size: 1.8em;
167
+ }
168
+ /* ckeditor5-highlight/theme/highlight.css */
169
+ .ck-content .marker-yellow {
170
+ background-color: var(--ck-highlight-marker-yellow);
171
+ }
172
+ /* ckeditor5-highlight/theme/highlight.css */
173
+ .ck-content .marker-green {
174
+ background-color: var(--ck-highlight-marker-green);
175
+ }
176
+ /* ckeditor5-highlight/theme/highlight.css */
177
+ .ck-content .marker-pink {
178
+ background-color: var(--ck-highlight-marker-pink);
179
+ }
180
+ /* ckeditor5-highlight/theme/highlight.css */
181
+ .ck-content .marker-blue {
182
+ background-color: var(--ck-highlight-marker-blue);
183
+ }
184
+ /* ckeditor5-highlight/theme/highlight.css */
185
+ .ck-content .pen-red {
186
+ color: var(--ck-highlight-pen-red);
187
+ background-color: transparent;
188
+ }
189
+ /* ckeditor5-highlight/theme/highlight.css */
190
+ .ck-content .pen-green {
191
+ color: var(--ck-highlight-pen-green);
192
+ background-color: transparent;
193
+ }
194
+ /* ckeditor5-image/theme/image.css */
195
+ .ck-content .image {
196
+ display: table;
197
+ clear: both;
198
+ text-align: center;
199
+ margin: 0.9em auto;
200
+ min-width: 50px;
201
+ }
202
+ /* ckeditor5-image/theme/image.css */
203
+ .ck-content .image img {
204
+ display: block;
205
+ margin: 0 auto;
206
+ max-width: 100%;
207
+ min-width: 100%;
208
+ }
209
+ /* ckeditor5-image/theme/image.css */
210
+ .ck-content .image-inline {
211
+ /*
212
+ * Normally, the .image-inline would have "display: inline-block" and "img { width: 100% }" (to follow the wrapper while resizing).;
213
+ * Unfortunately, together with "srcset", it gets automatically stretched up to the width of the editing root.
214
+ * This strange behavior does not happen with inline-flex.
215
+ */
216
+ display: inline-flex;
217
+ max-width: 100%;
218
+ align-items: flex-start;
219
+ }
220
+ /* ckeditor5-image/theme/image.css */
221
+ .ck-content .image-inline picture {
222
+ display: flex;
223
+ }
224
+ /* ckeditor5-image/theme/image.css */
225
+ .ck-content .image-inline picture,
226
+ .ck-content .image-inline img {
227
+ flex-grow: 1;
228
+ flex-shrink: 1;
229
+ max-width: 100%;
230
+ }
231
+ /* ckeditor5-image/theme/imageresize.css */
232
+ .ck-content .image.image_resized {
233
+ max-width: 100%;
234
+ display: block;
235
+ box-sizing: border-box;
236
+ }
237
+ /* ckeditor5-image/theme/imageresize.css */
238
+ .ck-content .image.image_resized img {
239
+ width: 100%;
240
+ }
241
+ /* ckeditor5-image/theme/imageresize.css */
242
+ .ck-content .image.image_resized > figcaption {
243
+ display: block;
244
+ }
245
+ /* ckeditor5-image/theme/imagecaption.css */
246
+ .ck-content .image > figcaption {
247
+ display: table-caption;
248
+ caption-side: bottom;
249
+ word-break: break-word;
250
+ color: var(--ck-color-image-caption-text);
251
+ background-color: var(--ck-color-image-caption-background);
252
+ padding: .6em;
253
+ font-size: .75em;
254
+ outline-offset: -1px;
255
+ }
256
+ /* ckeditor5-image/theme/imagestyle.css */
257
+ .ck-content .image-style-block-align-left,
258
+ .ck-content .image-style-block-align-right {
259
+ max-width: calc(100% - var(--ck-image-style-spacing));
260
+ }
261
+ /* ckeditor5-image/theme/imagestyle.css */
262
+ .ck-content .image-style-align-left,
263
+ .ck-content .image-style-align-right {
264
+ clear: none;
265
+ }
266
+ /* ckeditor5-image/theme/imagestyle.css */
267
+ .ck-content .image-style-side {
268
+ float: right;
269
+ margin-left: var(--ck-image-style-spacing);
270
+ max-width: 50%;
271
+ }
272
+ /* ckeditor5-image/theme/imagestyle.css */
273
+ .ck-content .image-style-align-left {
274
+ float: left;
275
+ margin-right: var(--ck-image-style-spacing);
276
+ }
277
+ /* ckeditor5-image/theme/imagestyle.css */
278
+ .ck-content .image-style-align-center {
279
+ margin-left: auto;
280
+ margin-right: auto;
281
+ }
282
+ /* ckeditor5-image/theme/imagestyle.css */
283
+ .ck-content .image-style-align-right {
284
+ float: right;
285
+ margin-left: var(--ck-image-style-spacing);
286
+ }
287
+ /* ckeditor5-image/theme/imagestyle.css */
288
+ .ck-content .image-style-block-align-right {
289
+ margin-right: 0;
290
+ margin-left: auto;
291
+ }
292
+ /* ckeditor5-image/theme/imagestyle.css */
293
+ .ck-content .image-style-block-align-left {
294
+ margin-left: 0;
295
+ margin-right: auto;
296
+ }
297
+ /* ckeditor5-image/theme/imagestyle.css */
298
+ .ck-content p + .image-style-align-left,
299
+ .ck-content p + .image-style-align-right,
300
+ .ck-content p + .image-style-side {
301
+ margin-top: 0;
302
+ }
303
+ /* ckeditor5-image/theme/imagestyle.css */
304
+ .ck-content .image-inline.image-style-align-left,
305
+ .ck-content .image-inline.image-style-align-right {
306
+ margin-top: var(--ck-inline-image-style-spacing);
307
+ margin-bottom: var(--ck-inline-image-style-spacing);
308
+ }
309
+ /* ckeditor5-image/theme/imagestyle.css */
310
+ .ck-content .image-inline.image-style-align-left {
311
+ margin-right: var(--ck-inline-image-style-spacing);
312
+ }
313
+ /* ckeditor5-image/theme/imagestyle.css */
314
+ .ck-content .image-inline.image-style-align-right {
315
+ margin-left: var(--ck-inline-image-style-spacing);
316
+ }
317
+ /* ckeditor5-language/theme/language.css */
318
+ .ck-content span[lang] {
319
+ font-style: italic;
320
+ }
321
+ /* ckeditor5-media-embed/theme/mediaembed.css */
322
+ .ck-content .media {
323
+ clear: both;
324
+ margin: 0.9em 0;
325
+ display: block;
326
+ min-width: 15em;
327
+ }
328
+ /* ckeditor5-list/theme/todolist.css */
329
+ .ck-content .todo-list {
330
+ list-style: none;
331
+ }
332
+ /* ckeditor5-list/theme/todolist.css */
333
+ .ck-content .todo-list li {
334
+ margin-bottom: 5px;
335
+ }
336
+ /* ckeditor5-list/theme/todolist.css */
337
+ .ck-content .todo-list li .todo-list {
338
+ margin-top: 5px;
339
+ }
340
+ /* ckeditor5-list/theme/todolist.css */
341
+ .ck-content .todo-list .todo-list__label > input {
342
+ -webkit-appearance: none;
343
+ display: inline-block;
344
+ position: relative;
345
+ width: var(--ck-todo-list-checkmark-size);
346
+ height: var(--ck-todo-list-checkmark-size);
347
+ vertical-align: middle;
348
+ border: 0;
349
+ left: -25px;
350
+ margin-right: -15px;
351
+ right: 0;
352
+ margin-left: 0;
353
+ }
354
+ /* ckeditor5-list/theme/todolist.css */
355
+ .ck-content .todo-list .todo-list__label > input::before {
356
+ display: block;
357
+ position: absolute;
358
+ box-sizing: border-box;
359
+ content: '';
360
+ width: 100%;
361
+ height: 100%;
362
+ border: 1px solid hsl(0, 0%, 20%);
363
+ border-radius: 2px;
364
+ transition: 250ms ease-in-out box-shadow, 250ms ease-in-out background, 250ms ease-in-out border;
365
+ }
366
+ /* ckeditor5-list/theme/todolist.css */
367
+ .ck-content .todo-list .todo-list__label > input::after {
368
+ display: block;
369
+ position: absolute;
370
+ box-sizing: content-box;
371
+ pointer-events: none;
372
+ content: '';
373
+ left: calc( var(--ck-todo-list-checkmark-size) / 3 );
374
+ top: calc( var(--ck-todo-list-checkmark-size) / 5.3 );
375
+ width: calc( var(--ck-todo-list-checkmark-size) / 5.3 );
376
+ height: calc( var(--ck-todo-list-checkmark-size) / 2.6 );
377
+ border-style: solid;
378
+ border-color: transparent;
379
+ border-width: 0 calc( var(--ck-todo-list-checkmark-size) / 8 ) calc( var(--ck-todo-list-checkmark-size) / 8 ) 0;
380
+ transform: rotate(45deg);
381
+ }
382
+ /* ckeditor5-list/theme/todolist.css */
383
+ .ck-content .todo-list .todo-list__label > input[checked]::before {
384
+ background: hsl(126, 64%, 41%);
385
+ border-color: hsl(126, 64%, 41%);
386
+ }
387
+ /* ckeditor5-list/theme/todolist.css */
388
+ .ck-content .todo-list .todo-list__label > input[checked]::after {
389
+ border-color: hsl(0, 0%, 100%);
390
+ }
391
+ /* ckeditor5-list/theme/todolist.css */
392
+ .ck-content .todo-list .todo-list__label .todo-list__label__description {
393
+ vertical-align: middle;
394
+ }
395
+ /* ckeditor5-page-break/theme/pagebreak.css */
396
+ .ck-content .page-break {
397
+ position: relative;
398
+ clear: both;
399
+ padding: 5px 0;
400
+ display: flex;
401
+ align-items: center;
402
+ justify-content: center;
403
+ }
404
+ /* ckeditor5-page-break/theme/pagebreak.css */
405
+ .ck-content .page-break::after {
406
+ content: '';
407
+ position: absolute;
408
+ border-bottom: 2px dashed hsl(0, 0%, 77%);
409
+ width: 100%;
410
+ }
411
+ /* ckeditor5-page-break/theme/pagebreak.css */
412
+ .ck-content .page-break__label {
413
+ position: relative;
414
+ z-index: 1;
415
+ padding: .3em .6em;
416
+ display: block;
417
+ text-transform: uppercase;
418
+ border: 1px solid hsl(0, 0%, 77%);
419
+ border-radius: 2px;
420
+ font-family: Helvetica, Arial, Tahoma, Verdana, Sans-Serif;
421
+ font-size: 0.75em;
422
+ font-weight: bold;
423
+ color: hsl(0, 0%, 20%);
424
+ background: hsl(0, 0%, 100%);
425
+ box-shadow: 2px 2px 1px hsla(0, 0%, 0%, 0.15);
426
+ -webkit-user-select: none;
427
+ -moz-user-select: none;
428
+ -ms-user-select: none;
429
+ user-select: none;
430
+ }
431
+ /* ckeditor5-table/theme/tablecaption.css */
432
+ .ck-content .table > figcaption {
433
+ display: table-caption;
434
+ caption-side: top;
435
+ word-break: break-word;
436
+ text-align: center;
437
+ color: var(--ck-color-table-caption-text);
438
+ background-color: var(--ck-color-table-caption-background);
439
+ padding: .6em;
440
+ font-size: .75em;
441
+ outline-offset: -1px;
442
+ }
443
+ /* ckeditor5-table/theme/table.css */
444
+ .ck-content .table {
445
+ margin: 0.9em auto;
446
+ display: table;
447
+ }
448
+ /* ckeditor5-table/theme/table.css */
449
+ .ck-content .table table {
450
+ border-collapse: collapse;
451
+ border-spacing: 0;
452
+ width: 100%;
453
+ height: 100%;
454
+ border: 1px double hsl(0, 0%, 70%);
455
+ }
456
+ /* ckeditor5-table/theme/table.css */
457
+ .ck-content .table table td,
458
+ .ck-content .table table th {
459
+ min-width: 2em;
460
+ padding: .4em;
461
+ border: 1px solid hsl(0, 0%, 75%);
462
+ }
463
+ /* ckeditor5-table/theme/table.css */
464
+ .ck-content .table table th {
465
+ font-weight: bold;
466
+ background: hsla(0, 0%, 0%, 5%);
467
+ }
468
+ /* ckeditor5-table/theme/table.css */
469
+ .ck-content[dir="rtl"] .table th {
470
+ text-align: right;
471
+ }
472
+ /* ckeditor5-table/theme/table.css */
473
+ .ck-content[dir="ltr"] .table th {
474
+ text-align: left;
475
+ }
476
+ /* ckeditor5-code-block/theme/codeblock.css */
477
+ .ck-content pre {
478
+ padding: 1em;
479
+ color: hsl(0, 0%, 20.8%);
480
+ background: hsla(0, 0%, 78%, 0.3);
481
+ border: 1px solid hsl(0, 0%, 77%);
482
+ border-radius: 2px;
483
+ text-align: left;
484
+ direction: ltr;
485
+ tab-size: 4;
486
+ white-space: pre-wrap;
487
+ font-style: normal;
488
+ min-width: 200px;
489
+ }
490
+ /* ckeditor5-code-block/theme/codeblock.css */
491
+ .ck-content pre code {
492
+ background: unset;
493
+ padding: 0;
494
+ border-radius: 0;
495
+ }
496
+ /* ckeditor5-horizontal-line/theme/horizontalline.css */
497
+ .ck-content hr {
498
+ margin: 15px 0;
499
+ height: 4px;
500
+ background: hsl(0, 0%, 87%);
501
+ border: 0;
502
+ }
503
+ /* ckeditor5-mention/theme/mention.css */
504
+ .ck-content .mention {
505
+ background: var(--ck-color-mention-background);
506
+ color: var(--ck-color-mention-text);
507
+ }
508
+ @media print {
509
+ /* ckeditor5-page-break/theme/pagebreak.css */
510
+ .ck-content .page-break {
511
+ padding: 0;
512
+ }
513
+ /* ckeditor5-page-break/theme/pagebreak.css */
514
+ .ck-content .page-break::after {
515
+ display: none;
516
+ }
517
+ }
518
+ `
519
+
520
+ export default styles
@@ -0,0 +1,26 @@
1
+ /**
2
+ *
3
+ * Initializer
4
+ *
5
+ */
6
+
7
+ import { useEffect, useRef } from 'react';
8
+ import PropTypes from 'prop-types';
9
+ import pluginId from '../../pluginId';
10
+
11
+ const Initializer = ({ setPlugin }) => {
12
+ const ref = useRef();
13
+ ref.current = setPlugin;
14
+
15
+ useEffect(() => {
16
+ ref.current(pluginId);
17
+ }, []);
18
+
19
+ return null;
20
+ };
21
+
22
+ Initializer.propTypes = {
23
+ setPlugin: PropTypes.func.isRequired,
24
+ };
25
+
26
+ export default Initializer;
@@ -0,0 +1,44 @@
1
+ import React from "react";
2
+ import { prefixFileUrlWithBackendUrl, useLibrary } from "@strapi/helper-plugin";
3
+ import PropTypes from "prop-types";
4
+
5
+ const MediaLib = ({ isOpen, onChange, onToggle }) => {
6
+ const { components } = useLibrary();
7
+ const MediaLibraryDialog = components["media-library"];
8
+
9
+ const handleSelectAssets = (files) => {
10
+ const formattedFiles = files.map((f) => ({
11
+ alt: f.alternativeText || f.name,
12
+ url: prefixFileUrlWithBackendUrl(f.url),
13
+ mime: f.mime,
14
+ formats: f.formats
15
+ }));
16
+
17
+ onChange(formattedFiles);
18
+ };
19
+
20
+ if (!isOpen) {
21
+ return null;
22
+ }
23
+
24
+ return (
25
+ <MediaLibraryDialog
26
+ onClose={onToggle}
27
+ onSelectAssets={handleSelectAssets}
28
+ />
29
+ );
30
+ };
31
+
32
+ MediaLib.defaultProps = {
33
+ isOpen: false,
34
+ onChange: () => {},
35
+ onToggle: () => {},
36
+ };
37
+
38
+ MediaLib.propTypes = {
39
+ isOpen: PropTypes.bool,
40
+ onChange: PropTypes.func,
41
+ onToggle: PropTypes.func,
42
+ };
43
+
44
+ export default MediaLib;
@@ -0,0 +1,77 @@
1
+ import React from "react";
2
+ import PropTypes from "prop-types";
3
+ import { Stack } from "@strapi/design-system/Stack";
4
+ import { Box } from "@strapi/design-system/Box";
5
+ import { Typography } from "@strapi/design-system/Typography";
6
+ import Editor from "../CKEditor";
7
+ import { useIntl } from "react-intl";
8
+
9
+ const Wysiwyg = ({
10
+ name,
11
+ onChange,
12
+ value,
13
+ intlLabel,
14
+ disabled,
15
+ error,
16
+ description,
17
+ required,
18
+ }) => {
19
+ const { formatMessage } = useIntl();
20
+
21
+ return (
22
+ <Stack size={1}>
23
+ <Box>
24
+ <Typography variant="pi" fontWeight="bold">
25
+ {formatMessage(intlLabel)}
26
+ </Typography>
27
+ {required && (
28
+ <Typography variant="pi" fontWeight="bold" textColor="danger600">
29
+ *
30
+ </Typography>
31
+ )}
32
+ </Box>
33
+ <Editor
34
+ disabled={disabled}
35
+ name={name}
36
+ onChange={onChange}
37
+ value={value}
38
+ />
39
+ {error && (
40
+ <Typography variant="pi" textColor="danger600">
41
+ {formatMessage({ id: error, defaultMessage: error })}
42
+ </Typography>
43
+ )}
44
+ {description && (
45
+ <Typography variant="pi">{formatMessage(description)}</Typography>
46
+ )}
47
+ </Stack>
48
+ );
49
+ };
50
+
51
+ Wysiwyg.defaultProps = {
52
+ description: "",
53
+ disabled: false,
54
+ error: undefined,
55
+ intlLabel: "",
56
+ required: false,
57
+ value: "",
58
+ };
59
+
60
+ Wysiwyg.propTypes = {
61
+ description: PropTypes.shape({
62
+ id: PropTypes.string,
63
+ defaultMessage: PropTypes.string,
64
+ }),
65
+ disabled: PropTypes.bool,
66
+ error: PropTypes.string,
67
+ intlLabel: PropTypes.shape({
68
+ id: PropTypes.string,
69
+ defaultMessage: PropTypes.string,
70
+ }),
71
+ name: PropTypes.string.isRequired,
72
+ onChange: PropTypes.func.isRequired,
73
+ required: PropTypes.bool,
74
+ value: PropTypes.string,
75
+ };
76
+
77
+ export default Wysiwyg;
@@ -0,0 +1,19 @@
1
+ import pluginPkg from "../../package.json";
2
+ import Wysiwyg from "./components/Wysiwyg";
3
+ import pluginId from "./pluginId";
4
+
5
+ const name = pluginPkg.strapi.name;
6
+
7
+ export default {
8
+ register(app) {
9
+ app.addFields({ type: "wysiwyg", Component: Wysiwyg });
10
+ console.log(pluginId);
11
+ app.registerPlugin({
12
+ id: pluginId,
13
+ isReady: true,
14
+ name,
15
+ });
16
+ },
17
+ bootstrap(app) {
18
+ },
19
+ };
@@ -0,0 +1,25 @@
1
+ /**
2
+ *
3
+ * This component is the skeleton around the actual pages, and should only
4
+ * contain code that should be seen on all pages. (e.g. navigation bar)
5
+ *
6
+ */
7
+
8
+ import React from 'react';
9
+ import { Switch, Route } from 'react-router-dom';
10
+ import { NotFound } from '@strapi/helper-plugin';
11
+ import pluginId from '../../pluginId';
12
+ import HomePage from '../HomePage';
13
+
14
+ const App = () => {
15
+ return (
16
+ <div>
17
+ <Switch>
18
+ <Route path={`/plugins/${pluginId}`} component={HomePage} exact />
19
+ <Route component={NotFound} />
20
+ </Switch>
21
+ </div>
22
+ );
23
+ };
24
+
25
+ export default App;