@_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 +47 -6
- package/admin/src/components/CKEditor/build/ckeditor.js +6 -6
- package/admin/src/components/CKEditor/index.js +93 -40
- package/admin/src/components/Initializer/index.js +26 -26
- package/admin/src/index.js +17 -17
- package/admin/src/pages/App/index.js +25 -25
- package/admin/src/pages/HomePage/index.js +20 -20
- package/admin/src/pluginId.js +6 -6
- package/admin/src/utils/axiosInstance.js +40 -40
- package/admin/src/utils/getTrad.js +5 -5
- package/package.json +50 -50
- package/server/controllers/config.js +20 -14
- package/server/controllers/index.js +7 -7
- package/server/index.js +13 -25
- package/server/register.js +5 -5
- package/server/routes/index.js +16 -8
- package/server/services/config.js +12 -0
- package/server/services/index.js +7 -7
- package/strapi-admin.js +3 -3
- package/strapi-server.js +3 -3
- package/server/bootstrap.js +0 -5
- package/server/config/index.js +0 -6
- package/server/content-types/index.js +0 -3
- package/server/destroy.js +0 -5
- package/server/middlewares/index.js +0 -3
- package/server/policies/index.js +0 -3
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
|
|
987
|
+
Node **>=14.19.1 <=18.x.x**
|
|
947
988
|
|
|
948
|
-
Tested on **v4.1.8 - 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
|