@_sh/strapi-plugin-ckeditor 1.1.2 → 1.1.3

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
@@ -64,19 +64,61 @@ yarn build
64
64
  ```
65
65
 
66
66
  > 💡 `sizes` and `loading` attributes for image can be set in source mode.
67
- > If you use default upload provider and you want prefix img url with api path you need to add `baseURL` in `api.js` file `(config/api.js)`
68
67
 
69
68
 
70
69
  ## <a id="configuration"></a>⚙️ Configuration
71
70
  CKEditor config should be defined in `config.editor` field in `plugins.js` file.
72
71
 
72
+ > ⚠️ Regex patterns and callback functions (/.*/ /^(p|h[2-4])$/' | match => {..} etc) are not allowed in plugins.js config
73
+
74
+ >According to [this PR](https://github.com/nshenderov/strapi-plugin-ckeditor/pull/54), you can create ckeditor.js file in your /config directory and define editor's config in there. This way you can specify all regex patterns, functions, and so on. (plugin's config still should be placed in plugins.js)
75
+
76
+ <details>
77
+ <summary>(spoiler) <b>Example of /config/ckeditor.js:</b> </summary>
78
+
79
+ ```js
80
+ globalThis.ckEditorConfig = {
81
+ toolbar: {
82
+ items: [ ]
83
+ },
84
+ mediaEmbed: {
85
+ previewsInData: true,
86
+
87
+ providers: [
88
+ {
89
+ name: 'youtube',
90
+ url: [
91
+ /^(?:m\.)?youtube\.com\/watch\?v=([\w-]+)(?:&t=(\d+))?/,
92
+ /^(?:m\.)?youtube\.com\/v\/([\w-]+)(?:\?t=(\d+))?/,
93
+ /^youtube\.com\/embed\/([\w-]+)(?:\?start=(\d+))?/,
94
+ /^youtu\.be\/([\w-]+)(?:\?t=(\d+))?/
95
+ ],
96
+ html: match => {
97
+ const id = match[1];
98
+
99
+ return (`<iframe
100
+ src="https://www.youtube-nocookie.com/embed/${id}"
101
+ frameborder="0"
102
+ allow="autoplay; encrypted-media"
103
+ allowfullscreen />
104
+ `);
105
+ }
106
+ },
107
+ ]
108
+ }
109
+ }
110
+ ```
111
+
112
+ </details>
113
+
114
+
73
115
  **⚠️ `plugins.js` not `plugin.js` ⚠️**
74
116
 
75
117
  **`plugins.js` file should be placed in `config` folder.**
76
118
 
77
- **💡`fullscreen mode` and `source mode` not supported with `balloon` and `block` toolbars.**
119
+ **💡`fullscreen mode` and `source mode` are not supported with `balloon` and `block` toolbars.**
78
120
 
79
- Learn more about configuration from [official documentation](https://ckeditor.com/docs/ckeditor5/latest/installation/getting-started/configuration.html).
121
+ Learn more about editor's configuration from [official documentation](https://ckeditor.com/docs/ckeditor5/latest/installation/getting-started/configuration.html).
80
122
 
81
123
  <details>
82
124
  <summary>(spoiler) <b>Built in plugins:</b> </summary>
@@ -340,7 +382,6 @@ module.exports = () => {
340
382
  ]
341
383
  },
342
384
  // https://ckeditor.com/docs/ckeditor5/latest/features/general-html-support.html
343
- // Regular expressions (/.*/ /^(p|h[2-4])$/' etc) for htmlSupport does not allowed in this config
344
385
  htmlSupport: {
345
386
  allow: [
346
387
  {
@@ -943,9 +984,9 @@ module.exports = styles;
943
984
  ## <a id="requirements"></a>⚠️ Requirements
944
985
  Strapi **v4.1.8+**
945
986
 
946
- Node **14 - 16**
987
+ Node **>=14.19.1 <=18.x.x**
947
988
 
948
- Tested on **v4.1.8 - 4.3.4**
989
+ Tested on **v4.1.8 - 4.5.6**
949
990
 
950
991
  ## <a id="thanks"></a>👍 This build includes some useful plugins based on these repos so thanks to them:
951
992
  https://github.com/Roslovets-Inc/strapi-plugin-ckeditor5