@_sh/strapi-plugin-ckeditor 1.1.1 → 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 +572 -9
- package/admin/src/components/CKEditor/build/ckeditor.js +6 -6
- package/admin/src/components/CKEditor/build/ckeditor.js.map +1 -1
- package/admin/src/components/CKEditor/build/translations/af.js +1 -1
- package/admin/src/components/CKEditor/build/translations/ar.js +1 -1
- package/admin/src/components/CKEditor/build/translations/ast.js +1 -1
- package/admin/src/components/CKEditor/build/translations/az.js +1 -1
- package/admin/src/components/CKEditor/build/translations/bg.js +1 -1
- package/admin/src/components/CKEditor/build/translations/bn.js +1 -0
- package/admin/src/components/CKEditor/build/translations/bs.js +1 -1
- package/admin/src/components/CKEditor/build/translations/ca.js +1 -1
- package/admin/src/components/CKEditor/build/translations/cs.js +1 -1
- package/admin/src/components/CKEditor/build/translations/da.js +1 -1
- package/admin/src/components/CKEditor/build/translations/de-ch.js +1 -1
- package/admin/src/components/CKEditor/build/translations/de.js +1 -1
- package/admin/src/components/CKEditor/build/translations/el.js +1 -1
- package/admin/src/components/CKEditor/build/translations/en-au.js +1 -1
- package/admin/src/components/CKEditor/build/translations/en-gb.js +1 -1
- package/admin/src/components/CKEditor/build/translations/eo.js +1 -1
- package/admin/src/components/CKEditor/build/translations/es.js +1 -1
- package/admin/src/components/CKEditor/build/translations/et.js +1 -1
- package/admin/src/components/CKEditor/build/translations/eu.js +1 -1
- package/admin/src/components/CKEditor/build/translations/fa.js +1 -1
- package/admin/src/components/CKEditor/build/translations/fi.js +1 -1
- package/admin/src/components/CKEditor/build/translations/fr.js +1 -1
- package/admin/src/components/CKEditor/build/translations/gl.js +1 -1
- package/admin/src/components/CKEditor/build/translations/gu.js +1 -1
- package/admin/src/components/CKEditor/build/translations/he.js +1 -1
- package/admin/src/components/CKEditor/build/translations/hi.js +1 -1
- package/admin/src/components/CKEditor/build/translations/hr.js +1 -1
- package/admin/src/components/CKEditor/build/translations/hu.js +1 -1
- package/admin/src/components/CKEditor/build/translations/id.js +1 -1
- package/admin/src/components/CKEditor/build/translations/it.js +1 -1
- package/admin/src/components/CKEditor/build/translations/ja.js +1 -1
- package/admin/src/components/CKEditor/build/translations/jv.js +1 -1
- package/admin/src/components/CKEditor/build/translations/km.js +1 -1
- package/admin/src/components/CKEditor/build/translations/kn.js +1 -1
- package/admin/src/components/CKEditor/build/translations/ko.js +1 -1
- package/admin/src/components/CKEditor/build/translations/ku.js +1 -1
- package/admin/src/components/CKEditor/build/translations/lt.js +1 -1
- package/admin/src/components/CKEditor/build/translations/lv.js +1 -1
- package/admin/src/components/CKEditor/build/translations/ms.js +1 -0
- package/admin/src/components/CKEditor/build/translations/nb.js +1 -1
- package/admin/src/components/CKEditor/build/translations/ne.js +1 -1
- package/admin/src/components/CKEditor/build/translations/nl.js +1 -1
- package/admin/src/components/CKEditor/build/translations/no.js +1 -1
- package/admin/src/components/CKEditor/build/translations/oc.js +1 -1
- package/admin/src/components/CKEditor/build/translations/pl.js +1 -1
- package/admin/src/components/CKEditor/build/translations/pt-br.js +1 -1
- package/admin/src/components/CKEditor/build/translations/pt.js +1 -1
- package/admin/src/components/CKEditor/build/translations/ro.js +1 -1
- package/admin/src/components/CKEditor/build/translations/ru.js +1 -1
- package/admin/src/components/CKEditor/build/translations/si.js +1 -1
- package/admin/src/components/CKEditor/build/translations/sk.js +1 -1
- package/admin/src/components/CKEditor/build/translations/sl.js +1 -1
- package/admin/src/components/CKEditor/build/translations/sq.js +1 -1
- package/admin/src/components/CKEditor/build/translations/sr-latn.js +1 -1
- package/admin/src/components/CKEditor/build/translations/sr.js +1 -1
- package/admin/src/components/CKEditor/build/translations/sv.js +1 -1
- package/admin/src/components/CKEditor/build/translations/th.js +1 -1
- package/admin/src/components/CKEditor/build/translations/tk.js +1 -1
- package/admin/src/components/CKEditor/build/translations/tr.js +1 -1
- package/admin/src/components/CKEditor/build/translations/tt.js +1 -1
- package/admin/src/components/CKEditor/build/translations/ug.js +1 -1
- package/admin/src/components/CKEditor/build/translations/uk.js +1 -1
- package/admin/src/components/CKEditor/build/translations/ur.js +1 -0
- package/admin/src/components/CKEditor/build/translations/uz.js +1 -1
- package/admin/src/components/CKEditor/build/translations/vi.js +1 -1
- package/admin/src/components/CKEditor/build/translations/zh-cn.js +1 -1
- package/admin/src/components/CKEditor/build/translations/zh.js +1 -1
- package/admin/src/components/CKEditor/index.js +103 -44
- package/admin/src/components/CKEditor/theme.js +31 -0
- 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
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* axios with a custom config.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import axios from 'axios';
|
|
6
|
-
import { auth } from '@strapi/helper-plugin';
|
|
7
|
-
|
|
8
|
-
const instance = axios.create({
|
|
9
|
-
baseURL: process.env.STRAPI_ADMIN_BACKEND_URL,
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
instance.interceptors.request.use(
|
|
13
|
-
async config => {
|
|
14
|
-
config.headers = {
|
|
15
|
-
Authorization: `Bearer ${auth.getToken()}`,
|
|
16
|
-
Accept: 'application/json',
|
|
17
|
-
'Content-Type': 'application/json',
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
return config;
|
|
21
|
-
},
|
|
22
|
-
error => {
|
|
23
|
-
Promise.reject(error);
|
|
24
|
-
}
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
instance.interceptors.response.use(
|
|
28
|
-
response => response,
|
|
29
|
-
error => {
|
|
30
|
-
// whatever you want to do with the error
|
|
31
|
-
if (error.response?.status === 401) {
|
|
32
|
-
auth.clearAppStorage();
|
|
33
|
-
window.location.reload();
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
throw error;
|
|
37
|
-
}
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
export default instance;
|
|
1
|
+
/**
|
|
2
|
+
* axios with a custom config.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import axios from 'axios';
|
|
6
|
+
import { auth } from '@strapi/helper-plugin';
|
|
7
|
+
|
|
8
|
+
const instance = axios.create({
|
|
9
|
+
baseURL: process.env.STRAPI_ADMIN_BACKEND_URL,
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
instance.interceptors.request.use(
|
|
13
|
+
async config => {
|
|
14
|
+
config.headers = {
|
|
15
|
+
Authorization: `Bearer ${auth.getToken()}`,
|
|
16
|
+
Accept: 'application/json',
|
|
17
|
+
'Content-Type': 'application/json',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return config;
|
|
21
|
+
},
|
|
22
|
+
error => {
|
|
23
|
+
Promise.reject(error);
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
instance.interceptors.response.use(
|
|
28
|
+
response => response,
|
|
29
|
+
error => {
|
|
30
|
+
// whatever you want to do with the error
|
|
31
|
+
if (error.response?.status === 401) {
|
|
32
|
+
auth.clearAppStorage();
|
|
33
|
+
window.location.reload();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
throw error;
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
export default instance;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import pluginId from '../pluginId';
|
|
2
|
-
|
|
3
|
-
const getTrad = id => `${pluginId}.${id}`;
|
|
4
|
-
|
|
5
|
-
export default getTrad;
|
|
1
|
+
import pluginId from '../pluginId';
|
|
2
|
+
|
|
3
|
+
const getTrad = id => `${pluginId}.${id}`;
|
|
4
|
+
|
|
5
|
+
export default getTrad;
|
package/package.json
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@_sh/strapi-plugin-ckeditor",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"description": "Replaces the default Strapi WYSIWYG editor with a customized buil of CKEditor 5 packed with useful plugins.",
|
|
5
|
-
"private": false,
|
|
6
|
-
"keywords": [
|
|
7
|
-
"strapi",
|
|
8
|
-
"ckeditor",
|
|
9
|
-
"ckeditor5",
|
|
10
|
-
"ckeditor 5",
|
|
11
|
-
"wysiwyg",
|
|
12
|
-
"rich text",
|
|
13
|
-
"editor"
|
|
14
|
-
],
|
|
15
|
-
"strapi": {
|
|
16
|
-
"icon": "edit",
|
|
17
|
-
"name": "ckeditor",
|
|
18
|
-
"displayName": "CKEditor 5",
|
|
19
|
-
"description": "Replaces the default Strapi WYSIWYG editor with a customized buil of CKEditor 5 packed with useful plugins.",
|
|
20
|
-
"kind": "plugin"
|
|
21
|
-
},
|
|
22
|
-
"files": [
|
|
23
|
-
"admin",
|
|
24
|
-
"server",
|
|
25
|
-
"strapi-admin.js",
|
|
26
|
-
"strapi-server.js"
|
|
27
|
-
],
|
|
28
|
-
"dependencies": {
|
|
29
|
-
"@ckeditor/ckeditor5-react": "5.0.
|
|
30
|
-
},
|
|
31
|
-
"peerDependencies": {
|
|
32
|
-
"@strapi/strapi": "^4.0.0"
|
|
33
|
-
},
|
|
34
|
-
"author": {
|
|
35
|
-
"name": "nshenderov"
|
|
36
|
-
},
|
|
37
|
-
"homepage": "https://market.strapi.io/plugins/@_sh-strapi-plugin-ckeditor",
|
|
38
|
-
"repository": {
|
|
39
|
-
"type": "git",
|
|
40
|
-
"url": "https://github.com/nshenderov/strapi-plugin-ckeditor.git"
|
|
41
|
-
},
|
|
42
|
-
"scripts": {
|
|
43
|
-
"test": "echo \"Error: no tests specified\" && exit 1"
|
|
44
|
-
},
|
|
45
|
-
"engines": {
|
|
46
|
-
"node": ">=
|
|
47
|
-
"npm": ">=6.0.0"
|
|
48
|
-
},
|
|
49
|
-
"license": "MIT"
|
|
50
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@_sh/strapi-plugin-ckeditor",
|
|
3
|
+
"version": "1.1.3",
|
|
4
|
+
"description": "Replaces the default Strapi WYSIWYG editor with a customized buil of CKEditor 5 packed with useful plugins.",
|
|
5
|
+
"private": false,
|
|
6
|
+
"keywords": [
|
|
7
|
+
"strapi",
|
|
8
|
+
"ckeditor",
|
|
9
|
+
"ckeditor5",
|
|
10
|
+
"ckeditor 5",
|
|
11
|
+
"wysiwyg",
|
|
12
|
+
"rich text",
|
|
13
|
+
"editor"
|
|
14
|
+
],
|
|
15
|
+
"strapi": {
|
|
16
|
+
"icon": "edit",
|
|
17
|
+
"name": "ckeditor",
|
|
18
|
+
"displayName": "CKEditor 5",
|
|
19
|
+
"description": "Replaces the default Strapi WYSIWYG editor with a customized buil of CKEditor 5 packed with useful plugins.",
|
|
20
|
+
"kind": "plugin"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"admin",
|
|
24
|
+
"server",
|
|
25
|
+
"strapi-admin.js",
|
|
26
|
+
"strapi-server.js"
|
|
27
|
+
],
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@ckeditor/ckeditor5-react": "^5.0.2"
|
|
30
|
+
},
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"@strapi/strapi": "^4.0.0"
|
|
33
|
+
},
|
|
34
|
+
"author": {
|
|
35
|
+
"name": "nshenderov"
|
|
36
|
+
},
|
|
37
|
+
"homepage": "https://market.strapi.io/plugins/@_sh-strapi-plugin-ckeditor",
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "https://github.com/nshenderov/strapi-plugin-ckeditor.git"
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"test": "echo \"Error: no tests specified\" && exit 1"
|
|
44
|
+
},
|
|
45
|
+
"engines": {
|
|
46
|
+
"node": ">=14.19.1 <=18.x.x",
|
|
47
|
+
"npm": ">=6.0.0"
|
|
48
|
+
},
|
|
49
|
+
"license": "MIT"
|
|
50
|
+
}
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
getConfig: async (ctx) => {
|
|
5
|
-
const { configKey } = ctx.params;
|
|
6
|
-
if(configKey === 'uploadcfg'){
|
|
7
|
-
const uploadConfig = await strapi.plugin('ckeditor').service('config').getUploadConfig('upload').getSettings();
|
|
8
|
-
ctx.send(uploadConfig);
|
|
9
|
-
}else{
|
|
10
|
-
const config = await strapi.plugin('ckeditor').service('config').getConfig(configKey);
|
|
11
|
-
ctx.send(config);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
},
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
getConfig: async (ctx) => {
|
|
5
|
+
const { configKey } = ctx.params;
|
|
6
|
+
if(configKey === 'uploadcfg'){
|
|
7
|
+
const uploadConfig = await strapi.plugin('ckeditor').service('config').getUploadConfig('upload').getSettings();
|
|
8
|
+
ctx.send(uploadConfig);
|
|
9
|
+
}else{
|
|
10
|
+
const config = await strapi.plugin('ckeditor').service('config').getConfig(configKey);
|
|
11
|
+
ctx.send(config);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
getEditorConfigScript: async (ctx) => {
|
|
17
|
+
const config = await strapi.plugin('ckeditor').service('config').getEditorConfigScript();
|
|
18
|
+
ctx.type = 'application/javascript';
|
|
19
|
+
ctx.send(config);
|
|
20
|
+
}
|
|
15
21
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const config = require('./config');
|
|
4
|
-
|
|
5
|
-
module.exports = {
|
|
6
|
-
config
|
|
7
|
-
};
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const config = require('./config');
|
|
4
|
+
|
|
5
|
+
module.exports = {
|
|
6
|
+
config
|
|
7
|
+
};
|
package/server/index.js
CHANGED
|
@@ -1,25 +1,13 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const register = require('./register');
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
module.exports = {
|
|
15
|
-
register,
|
|
16
|
-
bootstrap,
|
|
17
|
-
destroy,
|
|
18
|
-
config,
|
|
19
|
-
controllers,
|
|
20
|
-
routes,
|
|
21
|
-
services,
|
|
22
|
-
contentTypes,
|
|
23
|
-
policies,
|
|
24
|
-
middlewares,
|
|
25
|
-
};
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const register = require('./register');
|
|
4
|
+
const controllers = require('./controllers');
|
|
5
|
+
const routes = require('./routes');
|
|
6
|
+
const services = require('./services');
|
|
7
|
+
|
|
8
|
+
module.exports = {
|
|
9
|
+
register,
|
|
10
|
+
controllers,
|
|
11
|
+
routes,
|
|
12
|
+
services,
|
|
13
|
+
};
|
package/server/register.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
module.exports = ({ strapi }) => {
|
|
4
|
-
// registeration phase
|
|
5
|
-
};
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = ({ strapi }) => {
|
|
4
|
+
// registeration phase
|
|
5
|
+
};
|
package/server/routes/index.js
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
module.exports = [
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
module.exports = [
|
|
2
|
+
{
|
|
3
|
+
method: 'GET',
|
|
4
|
+
path: '/config/:configKey',
|
|
5
|
+
handler: 'config.getConfig',
|
|
6
|
+
config: {policies: []},
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
method: 'GET',
|
|
10
|
+
path: '/editor-config-script.js',
|
|
11
|
+
handler: 'config.getEditorConfigScript',
|
|
12
|
+
config: {
|
|
13
|
+
auth: false // Assume CKEditor config is not sensitive. We can't send a JWT token in a static script tag.
|
|
14
|
+
},
|
|
15
|
+
}
|
|
16
|
+
];
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const fs = require("fs");
|
|
4
|
+
|
|
3
5
|
/**
|
|
4
6
|
* config.js configuration service
|
|
5
7
|
*/
|
|
@@ -9,6 +11,16 @@ module.exports = ({ strapi }) => {
|
|
|
9
11
|
getConfig(key = 'editor') {
|
|
10
12
|
return strapi.plugin('ckeditor').config(key) ?? {};
|
|
11
13
|
},
|
|
14
|
+
getEditorConfigScript() {
|
|
15
|
+
const appDir = process.cwd();
|
|
16
|
+
const isTSProject = fs.existsSync(`${appDir}/dist`);
|
|
17
|
+
const jsDir = isTSProject ? `${appDir}/dist` : appDir;
|
|
18
|
+
|
|
19
|
+
const filename = `${jsDir}/config/ckeditor.js`;
|
|
20
|
+
return fs.existsSync(filename)
|
|
21
|
+
? fs.readFileSync(filename)
|
|
22
|
+
: 'globalThis.ckEditorConfig = null' // empty script tag causes no problems
|
|
23
|
+
},
|
|
12
24
|
getUploadConfig(name) {
|
|
13
25
|
return strapi.plugin('upload').service(name) ?? {};
|
|
14
26
|
},
|
package/server/services/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const config = require('./config');
|
|
4
|
-
|
|
5
|
-
module.exports = {
|
|
6
|
-
config
|
|
7
|
-
};
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const config = require('./config');
|
|
4
|
+
|
|
5
|
+
module.exports = {
|
|
6
|
+
config
|
|
7
|
+
};
|
package/strapi-admin.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
module.exports = require('./admin/src').default;
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = require('./admin/src').default;
|
package/strapi-server.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
module.exports = require('./server');
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = require('./server');
|
package/server/bootstrap.js
DELETED
package/server/config/index.js
DELETED
package/server/destroy.js
DELETED
package/server/policies/index.js
DELETED