@_sh/strapi-plugin-ckeditor 1.0.3 → 1.0.4

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 CHANGED
@@ -1,110 +1,84 @@
1
- # CKEditor 5 for Strapi
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/nshenderov/strapi-plugin-ckeditor/master/assets/ckeditor5.png" alt="CKEditor5-Strapi" width="700" />
3
+ </p>
2
4
 
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
- This plugin works on custom build of CKEditor 5 html editor packed with useful plugins.
10
-
11
- <br/>
5
+ <h1 align="center">CKEditor 5 for Strapi</h1>
12
6
 
13
- ## Included plugins
14
-
15
- <br/>
16
-
17
- - <b>Lots of default plugins:</b>
18
-
19
- For styling text, images, tables and so on.
7
+ <p align="center">Replaces the default Strapi WYSIWYG editor with a customized build of CKEditor 5 html editor packed with useful plugins.</p>
20
8
 
21
- - <b>Font color picker:</b>
22
-
23
- Gives you ability to choose colors for font styling that's not defined in config from the color palette.
24
-
25
- - <b>Upload adapter for Strapi:</b>
26
-
27
- For upload images to your library when you drop an image into the editor.
9
+ ## 👋 Get Started
28
10
 
29
- - <b>Fullscreen mode button</b>
30
-
31
- - <b>Strapi media library button</b>
11
+ * [Features](#features)
12
+ * [Installation](#installation)
13
+ * [Configuration](#configuration)
14
+ * [Theme customization](#themecustomization)
15
+ * [Requirements](#requirements)
16
+ * [Thanks](#thanks)
32
17
 
33
- - <b>Also supports strapi theme swithing</b>
18
+ ## <a id="features"></a>✨ Features
19
+ This plugin works on custom build of CKEditor 5 packed with useful plugins.
20
+ * **Lots of default plugins:** for styling text, images, tables and so on.
21
+ * **Font color picker:** choose colors for font styling that's not defined in config from the color palette.
22
+ * **Upload adapter for Strapi:** for upload images to your library when you drop an image into the editor.
23
+ * **Fullscreen mode button.**
24
+ * **Strapi media library button.**
25
+ * **Supports strapi theme swithing.**
26
+ * **Supports responsive images:** plugin adds srcset attribute to images based on their `formats` if responsive enable in strapi settings.
34
27
 
35
- - <b>Supports responsive images:</b>
36
-
37
- Plugin adds srcset attribute to images based on their "formats" if responsive enable in strapi settings</b>
28
+ ## <a id="installation"></a>🔧 Installation
38
29
 
39
- <br/>
40
- <img src="./assets/ckeditor-toolbar.jpg" width="900"/>
41
- <br/>
42
- <img src="./assets/ckeditor-tables.jpg" width="900"/>
43
-
44
- <img src="./assets/ckeditor-d-2.jpg" width="900"/>
30
+ Inside your Strapi app, add the package:
45
31
 
46
-
47
- <table>
48
- <tr>
49
- <td><img src="./assets/ckeditor-fontcolor1.jpg" width=200></td>
50
- <td><img src="./assets/ckeditor-fontcolor3.jpg" width=200></td>
51
- </tr>
52
- </table>
53
-
54
- ## How to install
55
- Install the dependency via npm
56
- ```
32
+ With `npm`:
33
+ ```bash
57
34
  npm install @_sh/strapi-plugin-ckeditor
58
35
  ```
59
- or yarn
60
- ```
36
+ With `yarn`:
37
+ ```bash
61
38
  yarn add @_sh/strapi-plugin-ckeditor
62
39
  ```
63
- In ./config/plugins.js file add
64
- ```
40
+
41
+ In `config/plugins.js` file add:
42
+ ```js
65
43
  ckeditor: true
66
44
  ```
45
+
67
46
  If you do not yet have this file, then create and add:
68
- ```
69
- module.exports = ({ env }) => {
47
+ ```js
48
+ module.exports = () => {
70
49
  return {
71
50
  ckeditor: true
72
51
  }
73
52
  }
74
53
  ```
75
- Then run build
76
- ```
54
+
55
+ Then run build:
56
+ ```bash
77
57
  npm run build
78
58
  ```
59
+
79
60
  or
80
- ```
61
+ ```bash
81
62
  yarn build
82
63
  ```
83
64
 
84
- ## How to customize
85
-
86
- Via config in plugins.js
87
-
88
- Ckeditor settings should be defined in <b>config.editor</b> field
89
-
90
- Read more about configuration https://ckeditor.com/docs/ckeditor5/latest/installation/getting-started/configuration.html
91
-
65
+ ## <a id="configuration"></a>🔧 Configuration
66
+ CKEditor config should be defined in `config.editor` field.
92
67
 
93
- <details>
94
- <summary><b>Default config</b></summary>
95
-
96
-
97
- ```javascript
68
+ Learn more about configuration from [official documentation](https://ckeditor.com/docs/ckeditor5/latest/installation/getting-started/configuration.html).
98
69
 
99
- ckeditor: {
100
- enabled: true,
101
- config:{
70
+ **Default configuration:**
71
+ ```js
72
+ // plugins.js
73
+ module.exports = () => {
74
+ return {
75
+ ckeditor: {
76
+ enabled: true,
77
+ config:{
102
78
  plugin:{
103
- // styles applies to editor container
104
- styles:``
79
+ styles:` // styles applied to editor container `
105
80
  },
106
- // editor default config
107
- editor:{
81
+ editor:{ // editor default config
108
82
  toolbar: {
109
83
  items: [
110
84
  'paragraph',
@@ -274,74 +248,66 @@ Via config in plugins.js
274
248
  }
275
249
  }
276
250
  }
277
- ```
278
-
279
- </details>
280
- <br/>
251
+ }
252
+ }
253
+ ```
254
+ ## <a id="themecustomization"></a>💅 Theme customization
255
+ If you want to customize editor styles you should define styles in `config.plugin.styles` field it will replace default styles applied to the editor.
256
+
257
+ Since Strapi resets css styles, it needs some styles to revert back, these styles defined below, also check [official documentation](https://ckeditor.com/docs/ckeditor5/latest/installation/advanced/content-styles.html).
258
+
259
+ 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']`
281
260
 
282
- 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
283
-
284
- 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
285
-
286
- 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']
287
-
288
- More info about theming https://ckeditor.com/docs/ckeditor5/latest/framework/guides/deep-dive/ui/theme-customization.html
261
+ [More info about theming](https://ckeditor.com/docs/ckeditor5/latest/framework/guides/deep-dive/ui/theme-customization.html)
289
262
 
290
- <details>
291
- <summary><b>Example of customizing</b></summary>
292
-
293
- ```javascript
294
- # plugins.js
263
+ [**👔 Default styles**](https://github.com/nshenderov/strapi-plugin-ckeditor/blob/master/admin/src/components/CKEditor/styles.js#L3-L517)
295
264
 
265
+ [**🎨 Default colour variables**](https://github.com/nshenderov/strapi-plugin-ckeditor/blob/master/admin/src/components/CKEditor/theme-colors.css#L105-L333)
266
+
267
+ **Example of customization:**
268
+ ```js
269
+ // plugins.js
296
270
  const defStyles = require('./styles.js')
297
271
 
298
- ckeditor: {
299
- enabled: true,
300
- config:{
301
- plugin:{
302
- // styles aplyies to editor container
303
- styles:`
304
- ${defStyles()}
305
- --ck-color-editor-base-text:red;
306
- `
307
- },
308
- // editor default config
309
- editor:{
310
- //...
311
- }
312
-
313
- }
314
- }
272
+ module.exports = () => {
273
+ return {
274
+ ckeditor: {
275
+ enabled: true,
276
+ config:{
277
+ plugin:{
278
+ // styles applied to editor container
279
+ styles:`
280
+ ${defStyles()}
281
+ --ck-color-editor-base-text:red;
282
+ `
283
+ },
284
+ // editor default config
285
+ editor:{
286
+ //...
287
+ }
288
+ }
289
+ }
290
+ }
291
+ }
315
292
 
316
- # styles.js
293
+ // styles.js
294
+ const defStyles = () =>`
317
295
 
318
- const defStyles = () =>`
319
- ### all default styles from link below ###
296
+ ### All default styles ###
320
297
  `
321
- module.exports = defStyles;
298
+ module.exports = defStyles;
299
+ ```
322
300
 
323
- ```
324
-
325
- </details>
326
-
327
- <br/>
301
+ ## <a id="requirements"></a>⚠️ Requirements
302
+ Strapi **v4**
328
303
 
329
- <b>[Default colour variables for the editor](admin/src/components/CKEditor/theme-colors.css)</b>
330
-
331
- <b>[Default styles](admin/src/components/CKEditor/styles.js)</b>
304
+ Tested on **v4.18 - 4.19**
332
305
 
333
-
334
- <br/>
306
+ ## <a id="thanks"></a>👍 This build includes some useful plugins based on these repos so thanks to them:
307
+ https://github.com/Roslovets-Inc/strapi-plugin-ckeditor5
335
308
 
336
- ## Requirements
337
- Strapi v4
338
-
339
- Tested on v4.18 - 4.19
309
+ https://github.com/leknoppix/ckeditor5-fullscreen
340
310
 
311
+ https://github.com/gtomato/ckeditor5-strapi-upload-plugin
341
312
 
342
- ## This build includes some useful plugins based on those repos so thanks to them:
343
- https://github.com/Roslovets-Inc/strapi-plugin-ckeditor5
344
- https://github.com/leknoppix/ckeditor5-fullscreen
345
- https://github.com/gtomato/ckeditor5-strapi-upload-plugin
346
- https://github.com/pshurygin/ckeditor5-font-color
347
-
313
+ https://github.com/pshurygin/ckeditor5-font-color
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@_sh/strapi-plugin-ckeditor",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Replaces the default Strapi WYSIWYG editor with a customized buil of CKEditor 5 packed with useful plugins.",
5
5
  "private": false,
6
6
  "keywords": [
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file