@_sh/strapi-plugin-ckeditor 2.1.2 → 3.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 (45) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +376 -197
  3. package/admin/src/Input/components/Editor.js +133 -0
  4. package/admin/src/{components/Input/MediaLib/index.js → Input/components/MediaLib.js} +20 -23
  5. package/admin/src/Input/config/index.js +2 -0
  6. package/admin/src/Input/config/language.js +45 -0
  7. package/admin/src/Input/config/plugins.js +24 -0
  8. package/admin/src/Input/config/presets.js +18 -0
  9. package/admin/src/Input/config/styling.js +30 -0
  10. package/admin/src/Input/index.js +67 -0
  11. package/admin/src/{components/Input/CKEditor → Input}/plugins/StrapiMediaLib.js +8 -10
  12. package/admin/src/{components/Input/CKEditor → Input}/plugins/StrapiUploadAdapter.js +16 -34
  13. package/admin/src/{components/Input/CKEditor → Input}/plugins/index.js +1 -1
  14. package/admin/src/Input/presets/colors.js +122 -0
  15. package/admin/src/Input/presets/default.js +378 -0
  16. package/admin/src/Input/presets/index.js +7 -0
  17. package/admin/src/Input/theme/additional.js +189 -0
  18. package/admin/src/{components/Input/CKEditor → Input}/theme/common.js +18 -20
  19. package/admin/src/{components/Input/CKEditor → Input}/theme/dark.js +28 -21
  20. package/admin/src/{components/Input/CKEditor → Input}/theme/light.js +28 -20
  21. package/admin/src/index.js +76 -106
  22. package/admin/src/pluginId.js +7 -0
  23. package/admin/src/utils/exportToGlobal.js +8 -0
  24. package/admin/src/utils/{getEditorConfig.js → getPluginConfig.js} +10 -12
  25. package/admin/src/utils/getPresetsOptions.js +38 -0
  26. package/package.json +12 -44
  27. package/server/controllers/config.js +13 -11
  28. package/server/controllers/index.js +3 -3
  29. package/server/register.js +1 -1
  30. package/server/routes/index.js +7 -12
  31. package/server/services/config.js +16 -11
  32. package/server/services/index.js +3 -3
  33. package/admin/src/components/Input/CKEditor/configs/base.js +0 -639
  34. package/admin/src/components/Input/CKEditor/configs/blockBalloon.js +0 -25
  35. package/admin/src/components/Input/CKEditor/configs/index.js +0 -11
  36. package/admin/src/components/Input/CKEditor/configs/toolbar.js +0 -17
  37. package/admin/src/components/Input/CKEditor/configs/toolbarBalloon.js +0 -17
  38. package/admin/src/components/Input/CKEditor/configuration.js +0 -167
  39. package/admin/src/components/Input/CKEditor/index.js +0 -119
  40. package/admin/src/components/Input/CKEditor/styling.js +0 -24
  41. package/admin/src/components/Input/CKEditor/theme/additional.js +0 -187
  42. package/admin/src/components/Input/index.js +0 -48
  43. package/admin/src/utils/pluginId.js +0 -5
  44. /package/admin/src/{components/CKEditorIcon.js → CKEditorIcon.js} +0 -0
  45. /package/admin/src/{components/Input/CKEditor → Input}/theme/index.js +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@_sh/strapi-plugin-ckeditor",
3
- "version": "2.1.2",
3
+ "version": "3.0.0",
4
4
  "description": "Integrates CKEditor 5 into your Strapi project as a fully customizable custom field. (Unofficial integration)",
5
5
  "private": false,
6
6
  "keywords": [
@@ -25,48 +25,11 @@
25
25
  "strapi-server.js"
26
26
  ],
27
27
  "dependencies": {
28
- "@ckeditor/ckeditor5-alignment": "^41.0.0",
29
- "@ckeditor/ckeditor5-autoformat": "^41.0.0",
30
- "@ckeditor/ckeditor5-autosave": "^41.0.0",
31
- "@ckeditor/ckeditor5-basic-styles": "^41.0.0",
32
- "@ckeditor/ckeditor5-block-quote": "^41.0.0",
33
- "@ckeditor/ckeditor5-code-block": "^41.0.0",
34
- "@ckeditor/ckeditor5-easy-image": "^41.0.0",
35
- "@ckeditor/ckeditor5-editor-classic": "^41.0.0",
36
- "@ckeditor/ckeditor5-essentials": "^41.0.0",
37
- "@ckeditor/ckeditor5-find-and-replace": "^41.0.0",
38
- "@ckeditor/ckeditor5-heading": "^41.0.0",
39
- "@ckeditor/ckeditor5-highlight": "^41.0.0",
40
- "@ckeditor/ckeditor5-horizontal-line": "^41.0.0",
41
- "@ckeditor/ckeditor5-html-embed": "^41.0.0",
42
- "@ckeditor/ckeditor5-html-support": "^41.0.0",
43
- "@ckeditor/ckeditor5-image": "^41.0.0",
44
- "@ckeditor/ckeditor5-font": "^41.0.0",
45
- "@ckeditor/ckeditor5-indent": "^41.0.0",
46
- "@ckeditor/ckeditor5-language": "^41.0.0",
47
- "@ckeditor/ckeditor5-link": "^41.0.0",
48
- "@ckeditor/ckeditor5-list": "^41.0.0",
49
- "@ckeditor/ckeditor5-media-embed": "^41.0.0",
50
- "@ckeditor/ckeditor5-mention": "^41.0.0",
51
- "@ckeditor/ckeditor5-page-break": "^41.0.0",
52
- "@ckeditor/ckeditor5-paragraph": "^41.0.0",
53
- "@ckeditor/ckeditor5-paste-from-office": "^41.0.0",
54
- "@ckeditor/ckeditor5-remove-format": "^41.0.0",
55
- "@ckeditor/ckeditor5-source-editing": "^41.0.0",
56
- "@ckeditor/ckeditor5-special-characters": "^41.0.0",
57
- "@ckeditor/ckeditor5-style": "^41.0.0",
58
- "@ckeditor/ckeditor5-table": "^41.0.0",
59
- "@ckeditor/ckeditor5-theme-lark": "^41.0.0",
60
- "@ckeditor/ckeditor5-typing": "^41.0.0",
61
- "@ckeditor/ckeditor5-upload": "^41.0.0",
62
- "@ckeditor/ckeditor5-word-count": "^41.0.0",
63
- "@ckeditor/ckeditor5-show-blocks": "^41.0.0",
64
- "ckeditor5": "^41.0.0",
65
- "@ckeditor/ckeditor5-react": "^6.2.0",
66
- "@strapi/design-system": "^1.10.1",
67
- "lodash": "^4.17.21",
28
+ "ckeditor5": "^43.1.0",
29
+ "@ckeditor/ckeditor5-react": "^9.1.0",
30
+ "@strapi/design-system": "^1.19.0",
68
31
  "prop-types": "^15.8.1",
69
- "sanitize-html": "^2.10.0"
32
+ "sanitize-html": "^2.13.0"
70
33
  },
71
34
  "peerDependencies": {
72
35
  "@strapi/strapi": "^4.13.0"
@@ -80,11 +43,16 @@
80
43
  "url": "https://github.com/nshenderov/strapi-plugin-ckeditor.git"
81
44
  },
82
45
  "scripts": {
83
- "test": "echo \"Error: no tests specified\" && exit 1"
46
+ "release": "release-it",
47
+ "release:info": "release-it --changelog"
84
48
  },
85
49
  "engines": {
86
50
  "node": ">=18.0.0 <=20.x.x",
87
51
  "npm": ">=6.0.0"
88
52
  },
89
- "license": "MIT"
53
+ "license": "MIT",
54
+ "devDependencies": {
55
+ "release-it": "^17.6.0",
56
+ "@release-it/conventional-changelog": "^8.0.1"
57
+ }
90
58
  }
@@ -1,17 +1,19 @@
1
- 'use strict';
1
+ "use strict";
2
2
 
3
- const pluginId = require("../../admin/src/utils/pluginId");
3
+ const pluginId = require("../../admin/src/pluginId");
4
4
 
5
5
  module.exports = {
6
+ getConfig: async (ctx) => {
7
+ const { responsiveDimensions = false } = await strapi
8
+ .plugin("upload")
9
+ .service("upload")
10
+ .getSettings();
6
11
 
7
- getUploadConfig: async (ctx) => {
8
- const uploadConfig = await strapi.plugin(pluginId).service('config').getUploadConfig('upload').getSettings();
9
- ctx.send(uploadConfig);
10
- },
12
+ const config =
13
+ (await strapi.plugin(pluginId).service("config").getConfig()) +
14
+ `\nglobalThis.SH_CKE_UPLOAD_ADAPTER_IS_RESPONSIVE = ${responsiveDimensions}`;
11
15
 
12
- getCKEditorConfig: async (ctx) => {
13
- const config = await strapi.plugin(pluginId).service('config').getCKEditorConfig();
14
- ctx.type = 'text/javascript';
16
+ ctx.type = "application/javascript";
15
17
  ctx.send(config);
16
- }
17
- };
18
+ },
19
+ };
@@ -1,7 +1,7 @@
1
- 'use strict';
1
+ "use strict";
2
2
 
3
- const config = require('./config');
3
+ const config = require("./config");
4
4
 
5
5
  module.exports = {
6
- config
6
+ config,
7
7
  };
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const pluginId = require("../admin/src/utils/pluginId");
3
+ const pluginId = require("../admin/src/pluginId");
4
4
 
5
5
  module.exports = ({ strapi }) => {
6
6
  strapi.customFields.register({
@@ -1,15 +1,10 @@
1
1
  module.exports = [
2
- {
3
- method: 'GET',
4
- path: '/config/upload',
5
- handler: 'config.getUploadConfig',
2
+ {
3
+ method: "GET",
4
+ path: "/config/ckeditor",
5
+ handler: "config.getConfig",
6
+ config: {
7
+ auth: false,
6
8
  },
7
- {
8
- method: 'GET',
9
- path: '/ckeditor-config',
10
- handler: 'config.getCKEditorConfig',
11
- config: {
12
- auth: false
13
- },
14
- }
9
+ },
15
10
  ];
@@ -1,20 +1,25 @@
1
- 'use strict';
1
+ "use strict";
2
2
 
3
3
  const fs = require("fs");
4
4
 
5
5
  module.exports = ({ strapi }) => {
6
6
  return {
7
- getUploadConfig(name) {
8
- return strapi.plugin('upload').service(name) ?? {};
9
- },
10
- getCKEditorConfig() {
7
+ getConfig() {
11
8
  const appDir = process.cwd();
12
9
 
13
- const filename = `${appDir}/config/ckeditor.txt`;
14
-
15
- return fs.existsSync(filename)
16
- ? fs.readFileSync(filename)
17
- : 'globalThis.CKEditorConfig = null'
10
+ const fileName = "ckeditor";
11
+
12
+ for (const ext of ["js", "ts"]) {
13
+ const filePath = `${appDir}/config/${fileName}.${ext}`;
14
+ if (fs.existsSync(filePath)) {
15
+ return (
16
+ fs.readFileSync(filePath, "utf8") +
17
+ `\nglobalThis.SH_CKE_CONFIG = CKEConfig()`
18
+ );
19
+ }
20
+ }
21
+
22
+ return `globalThis.SH_CKE_CONFIG = null`;
18
23
  },
19
24
  };
20
- };
25
+ };
@@ -1,7 +1,7 @@
1
- 'use strict';
1
+ "use strict";
2
2
 
3
- const config = require('./config');
3
+ const config = require("./config");
4
4
 
5
5
  module.exports = {
6
- config
6
+ config,
7
7
  };