@_sh/strapi-plugin-ckeditor 2.1.3 → 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 (44) hide show
  1. package/README.md +373 -194
  2. package/admin/src/Input/components/Editor.js +133 -0
  3. package/admin/src/{components/Input/MediaLib/index.js → Input/components/MediaLib.js} +20 -23
  4. package/admin/src/Input/config/index.js +2 -0
  5. package/admin/src/Input/config/language.js +45 -0
  6. package/admin/src/Input/config/plugins.js +24 -0
  7. package/admin/src/Input/config/presets.js +18 -0
  8. package/admin/src/Input/config/styling.js +30 -0
  9. package/admin/src/Input/index.js +67 -0
  10. package/admin/src/{components/Input/CKEditor → Input}/plugins/StrapiMediaLib.js +8 -10
  11. package/admin/src/{components/Input/CKEditor → Input}/plugins/StrapiUploadAdapter.js +16 -34
  12. package/admin/src/{components/Input/CKEditor → Input}/plugins/index.js +1 -1
  13. package/admin/src/Input/presets/colors.js +122 -0
  14. package/admin/src/Input/presets/default.js +378 -0
  15. package/admin/src/Input/presets/index.js +7 -0
  16. package/admin/src/Input/theme/additional.js +189 -0
  17. package/admin/src/{components/Input/CKEditor → Input}/theme/common.js +18 -20
  18. package/admin/src/{components/Input/CKEditor → Input}/theme/dark.js +22 -18
  19. package/admin/src/{components/Input/CKEditor → Input}/theme/light.js +22 -17
  20. package/admin/src/index.js +76 -106
  21. package/admin/src/pluginId.js +7 -0
  22. package/admin/src/utils/exportToGlobal.js +8 -0
  23. package/admin/src/utils/{getEditorConfig.js → getPluginConfig.js} +10 -12
  24. package/admin/src/utils/getPresetsOptions.js +38 -0
  25. package/package.json +6 -83
  26. package/server/controllers/config.js +13 -11
  27. package/server/controllers/index.js +3 -3
  28. package/server/register.js +1 -1
  29. package/server/routes/index.js +7 -12
  30. package/server/services/config.js +16 -11
  31. package/server/services/index.js +3 -3
  32. package/admin/src/components/Input/CKEditor/configs/base.js +0 -639
  33. package/admin/src/components/Input/CKEditor/configs/blockBalloon.js +0 -25
  34. package/admin/src/components/Input/CKEditor/configs/index.js +0 -11
  35. package/admin/src/components/Input/CKEditor/configs/toolbar.js +0 -17
  36. package/admin/src/components/Input/CKEditor/configs/toolbarBalloon.js +0 -17
  37. package/admin/src/components/Input/CKEditor/configuration.js +0 -167
  38. package/admin/src/components/Input/CKEditor/index.js +0 -119
  39. package/admin/src/components/Input/CKEditor/styling.js +0 -24
  40. package/admin/src/components/Input/CKEditor/theme/additional.js +0 -187
  41. package/admin/src/components/Input/index.js +0 -48
  42. package/admin/src/utils/pluginId.js +0 -5
  43. /package/admin/src/{components/CKEditorIcon.js → CKEditorIcon.js} +0 -0
  44. /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.3",
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,46 +25,9 @@
25
25
  "strapi-server.js"
26
26
  ],
27
27
  "dependencies": {
28
- "@ckeditor/ckeditor5-alignment": "^43.0.0",
29
- "@ckeditor/ckeditor5-autoformat": "^43.0.0",
30
- "@ckeditor/ckeditor5-autosave": "^43.0.0",
31
- "@ckeditor/ckeditor5-basic-styles": "^43.0.0",
32
- "@ckeditor/ckeditor5-block-quote": "^43.0.0",
33
- "@ckeditor/ckeditor5-code-block": "^43.0.0",
34
- "@ckeditor/ckeditor5-easy-image": "^43.0.0",
35
- "@ckeditor/ckeditor5-editor-classic": "^43.0.0",
36
- "@ckeditor/ckeditor5-essentials": "^43.0.0",
37
- "@ckeditor/ckeditor5-find-and-replace": "^43.0.0",
38
- "@ckeditor/ckeditor5-font": "^43.0.0",
39
- "@ckeditor/ckeditor5-heading": "^43.0.0",
40
- "@ckeditor/ckeditor5-highlight": "^43.0.0",
41
- "@ckeditor/ckeditor5-horizontal-line": "^43.0.0",
42
- "@ckeditor/ckeditor5-html-embed": "^43.0.0",
43
- "@ckeditor/ckeditor5-html-support": "^43.0.0",
44
- "@ckeditor/ckeditor5-image": "^43.0.0",
45
- "@ckeditor/ckeditor5-indent": "^43.0.0",
46
- "@ckeditor/ckeditor5-language": "^43.0.0",
47
- "@ckeditor/ckeditor5-link": "^43.0.0",
48
- "@ckeditor/ckeditor5-list": "^43.0.0",
49
- "@ckeditor/ckeditor5-media-embed": "^43.0.0",
50
- "@ckeditor/ckeditor5-mention": "^43.0.0",
51
- "@ckeditor/ckeditor5-page-break": "^43.0.0",
52
- "@ckeditor/ckeditor5-paragraph": "^43.0.0",
53
- "@ckeditor/ckeditor5-paste-from-office": "^43.0.0",
54
- "@ckeditor/ckeditor5-remove-format": "^43.0.0",
55
- "@ckeditor/ckeditor5-show-blocks": "^43.0.0",
56
- "@ckeditor/ckeditor5-source-editing": "^43.0.0",
57
- "@ckeditor/ckeditor5-special-characters": "^43.0.0",
58
- "@ckeditor/ckeditor5-style": "^43.0.0",
59
- "@ckeditor/ckeditor5-table": "^43.0.0",
60
- "@ckeditor/ckeditor5-theme-lark": "^43.0.0",
61
- "@ckeditor/ckeditor5-typing": "^43.0.0",
62
- "@ckeditor/ckeditor5-upload": "^43.0.0",
63
- "@ckeditor/ckeditor5-word-count": "^43.0.0",
64
- "ckeditor5": "^43.0.0",
65
- "@ckeditor/ckeditor5-react": "^9.0.0",
28
+ "ckeditor5": "^43.1.0",
29
+ "@ckeditor/ckeditor5-react": "^9.1.0",
66
30
  "@strapi/design-system": "^1.19.0",
67
- "lodash": "^4.17.21",
68
31
  "prop-types": "^15.8.1",
69
32
  "sanitize-html": "^2.13.0"
70
33
  },
@@ -80,7 +43,8 @@
80
43
  "url": "https://github.com/nshenderov/strapi-plugin-ckeditor.git"
81
44
  },
82
45
  "scripts": {
83
- "release": "release-it"
46
+ "release": "release-it",
47
+ "release:info": "release-it --changelog"
84
48
  },
85
49
  "engines": {
86
50
  "node": ">=18.0.0 <=20.x.x",
@@ -90,46 +54,5 @@
90
54
  "devDependencies": {
91
55
  "release-it": "^17.6.0",
92
56
  "@release-it/conventional-changelog": "^8.0.1"
93
- },
94
- "release-it": {
95
- "git": {
96
- "commitMesage": "chore: release v${version}"
97
- },
98
- "github": {
99
- "release": true,
100
- "releaseName": "v${version}"
101
- },
102
- "npm": {
103
- "publish": true
104
- },
105
- "plugins": {
106
- "@release-it/conventional-changelog": {
107
- "preset": {
108
- "name": "conventionalcommits",
109
- "types": [
110
- {
111
- "type": "feat",
112
- "section": "🚀 Features"
113
- },
114
- {
115
- "type": "fix",
116
- "section": "🪲 Bug fixes"
117
- },
118
- {
119
- "type": "docs",
120
- "section": "⚙️ Chore"
121
- },
122
- {
123
- "type": "chore",
124
- "section": "⚙️ Chore"
125
- },
126
- {
127
- "type": "style",
128
- "section": "💅 Style"
129
- }
130
- ]
131
- }
132
- }
133
- }
134
- }
57
+ }
135
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
  };