@_sh/strapi-plugin-ckeditor 1.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 (108) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +981 -0
  3. package/admin/src/components/CKEditor/build/ckeditor.js +7 -0
  4. package/admin/src/components/CKEditor/build/ckeditor.js.map +1 -0
  5. package/admin/src/components/CKEditor/build/translations/af.js +1 -0
  6. package/admin/src/components/CKEditor/build/translations/ar.js +1 -0
  7. package/admin/src/components/CKEditor/build/translations/ast.js +1 -0
  8. package/admin/src/components/CKEditor/build/translations/az.js +1 -0
  9. package/admin/src/components/CKEditor/build/translations/bg.js +1 -0
  10. package/admin/src/components/CKEditor/build/translations/bs.js +1 -0
  11. package/admin/src/components/CKEditor/build/translations/ca.js +1 -0
  12. package/admin/src/components/CKEditor/build/translations/cs.js +1 -0
  13. package/admin/src/components/CKEditor/build/translations/da.js +1 -0
  14. package/admin/src/components/CKEditor/build/translations/de-ch.js +1 -0
  15. package/admin/src/components/CKEditor/build/translations/de.js +1 -0
  16. package/admin/src/components/CKEditor/build/translations/el.js +1 -0
  17. package/admin/src/components/CKEditor/build/translations/en-au.js +1 -0
  18. package/admin/src/components/CKEditor/build/translations/en-gb.js +1 -0
  19. package/admin/src/components/CKEditor/build/translations/eo.js +1 -0
  20. package/admin/src/components/CKEditor/build/translations/es.js +1 -0
  21. package/admin/src/components/CKEditor/build/translations/et.js +1 -0
  22. package/admin/src/components/CKEditor/build/translations/eu.js +1 -0
  23. package/admin/src/components/CKEditor/build/translations/fa.js +1 -0
  24. package/admin/src/components/CKEditor/build/translations/fi.js +1 -0
  25. package/admin/src/components/CKEditor/build/translations/fr.js +1 -0
  26. package/admin/src/components/CKEditor/build/translations/gl.js +1 -0
  27. package/admin/src/components/CKEditor/build/translations/gu.js +1 -0
  28. package/admin/src/components/CKEditor/build/translations/he.js +1 -0
  29. package/admin/src/components/CKEditor/build/translations/hi.js +1 -0
  30. package/admin/src/components/CKEditor/build/translations/hr.js +1 -0
  31. package/admin/src/components/CKEditor/build/translations/hu.js +1 -0
  32. package/admin/src/components/CKEditor/build/translations/id.js +1 -0
  33. package/admin/src/components/CKEditor/build/translations/it.js +1 -0
  34. package/admin/src/components/CKEditor/build/translations/ja.js +1 -0
  35. package/admin/src/components/CKEditor/build/translations/jv.js +1 -0
  36. package/admin/src/components/CKEditor/build/translations/kk.js +1 -0
  37. package/admin/src/components/CKEditor/build/translations/km.js +1 -0
  38. package/admin/src/components/CKEditor/build/translations/kn.js +1 -0
  39. package/admin/src/components/CKEditor/build/translations/ko.js +1 -0
  40. package/admin/src/components/CKEditor/build/translations/ku.js +1 -0
  41. package/admin/src/components/CKEditor/build/translations/lt.js +1 -0
  42. package/admin/src/components/CKEditor/build/translations/lv.js +1 -0
  43. package/admin/src/components/CKEditor/build/translations/nb.js +1 -0
  44. package/admin/src/components/CKEditor/build/translations/ne.js +1 -0
  45. package/admin/src/components/CKEditor/build/translations/nl.js +1 -0
  46. package/admin/src/components/CKEditor/build/translations/no.js +1 -0
  47. package/admin/src/components/CKEditor/build/translations/oc.js +1 -0
  48. package/admin/src/components/CKEditor/build/translations/pl.js +1 -0
  49. package/admin/src/components/CKEditor/build/translations/pt-br.js +1 -0
  50. package/admin/src/components/CKEditor/build/translations/pt.js +1 -0
  51. package/admin/src/components/CKEditor/build/translations/ro.js +1 -0
  52. package/admin/src/components/CKEditor/build/translations/ru.js +1 -0
  53. package/admin/src/components/CKEditor/build/translations/si.js +1 -0
  54. package/admin/src/components/CKEditor/build/translations/sk.js +1 -0
  55. package/admin/src/components/CKEditor/build/translations/sl.js +1 -0
  56. package/admin/src/components/CKEditor/build/translations/sq.js +1 -0
  57. package/admin/src/components/CKEditor/build/translations/sr-latn.js +1 -0
  58. package/admin/src/components/CKEditor/build/translations/sr.js +1 -0
  59. package/admin/src/components/CKEditor/build/translations/sv.js +1 -0
  60. package/admin/src/components/CKEditor/build/translations/th.js +1 -0
  61. package/admin/src/components/CKEditor/build/translations/tk.js +1 -0
  62. package/admin/src/components/CKEditor/build/translations/tr.js +1 -0
  63. package/admin/src/components/CKEditor/build/translations/tt.js +1 -0
  64. package/admin/src/components/CKEditor/build/translations/ug.js +1 -0
  65. package/admin/src/components/CKEditor/build/translations/uk.js +1 -0
  66. package/admin/src/components/CKEditor/build/translations/uz.js +1 -0
  67. package/admin/src/components/CKEditor/build/translations/vi.js +1 -0
  68. package/admin/src/components/CKEditor/build/translations/zh-cn.js +1 -0
  69. package/admin/src/components/CKEditor/build/translations/zh.js +1 -0
  70. package/admin/src/components/CKEditor/index.js +139 -0
  71. package/admin/src/components/CKEditor/styles.js +520 -0
  72. package/admin/src/components/Initializer/index.js +26 -0
  73. package/admin/src/components/MediaLib/index.js +44 -0
  74. package/admin/src/components/Wysiwyg/index.js +77 -0
  75. package/admin/src/index.js +19 -0
  76. package/admin/src/pages/App/index.js +25 -0
  77. package/admin/src/pages/HomePage/index.js +20 -0
  78. package/admin/src/pluginId.js +6 -0
  79. package/admin/src/translations/en.json +1 -0
  80. package/admin/src/translations/fr.json +1 -0
  81. package/admin/src/utils/axiosInstance.js +40 -0
  82. package/admin/src/utils/getTrad.js +5 -0
  83. package/assets/ckeditor-d-1.jpg +0 -0
  84. package/assets/ckeditor-d-2.jpg +0 -0
  85. package/assets/ckeditor-d-3.jpg +0 -0
  86. package/assets/ckeditor-fontcolor1.jpg +0 -0
  87. package/assets/ckeditor-fontcolor2.jpg +0 -0
  88. package/assets/ckeditor-fontcolor3.jpg +0 -0
  89. package/assets/ckeditor-tables.jpg +0 -0
  90. package/assets/ckeditor-toolbar.jpg +0 -0
  91. package/assets/ckeditor.jpg +0 -0
  92. package/assets/ckeditor1.jpg +0 -0
  93. package/package.json +44 -0
  94. package/server/bootstrap.js +5 -0
  95. package/server/config/index.js +6 -0
  96. package/server/content-types/index.js +3 -0
  97. package/server/controllers/config.js +9 -0
  98. package/server/controllers/index.js +7 -0
  99. package/server/destroy.js +5 -0
  100. package/server/index.js +25 -0
  101. package/server/middlewares/index.js +3 -0
  102. package/server/policies/index.js +3 -0
  103. package/server/register.js +5 -0
  104. package/server/routes/index.js +8 -0
  105. package/server/services/config.js +13 -0
  106. package/server/services/index.js +7 -0
  107. package/strapi-admin.js +3 -0
  108. package/strapi-server.js +3 -0
@@ -0,0 +1,20 @@
1
+ /*
2
+ *
3
+ * HomePage
4
+ *
5
+ */
6
+
7
+ import React, { memo } from 'react';
8
+ // import PropTypes from 'prop-types';
9
+ import pluginId from '../../pluginId';
10
+
11
+ const HomePage = () => {
12
+ return (
13
+ <div>
14
+ <h1>{pluginId}&apos;s HomePage</h1>
15
+ <p>Happy coding</p>
16
+ </div>
17
+ );
18
+ };
19
+
20
+ export default memo(HomePage);
@@ -0,0 +1,6 @@
1
+ const pluginPkg = require('../../package.json');
2
+
3
+ const pluginId = pluginPkg.name.replace(/^(@_sh\/strapi-)plugin-/i, '');
4
+ // const pluginId = pluginPkg.name.replace(/^(@[^-,.][\w,-]+\/|strapi-)plugin-/i, '');
5
+
6
+ module.exports = pluginId;
@@ -0,0 +1 @@
1
+ {}
@@ -0,0 +1 @@
1
+ {}
@@ -0,0 +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;
@@ -0,0 +1,5 @@
1
+ import pluginId from '../pluginId';
2
+
3
+ const getTrad = id => `${pluginId}.${id}`;
4
+
5
+ export default getTrad;
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@_sh/strapi-plugin-ckeditor",
3
+ "version": "1.0.0",
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
+ "dependencies": {
23
+ "@ckeditor/ckeditor5-react": "5.0.0"
24
+ },
25
+ "peerDependencies": {
26
+ "@strapi/strapi": "^4.0.0"
27
+ },
28
+ "author": {
29
+ "name": "nshenderov"
30
+ },
31
+ "homepage": "https://github.com/nshenderov/strapi-plugin-ckeditor",
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "https://github.com/nshenderov/strapi-plugin-ckeditor.git"
35
+ },
36
+ "scripts": {
37
+ "test": "echo \"Error: no tests specified\" && exit 1"
38
+ },
39
+ "engines": {
40
+ "node": ">=12.x.x <=16.x.x",
41
+ "npm": ">=6.0.0"
42
+ },
43
+ "license": "MIT"
44
+ }
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ module.exports = ({ strapi }) => {
4
+ // bootstrap phase
5
+ };
@@ -0,0 +1,6 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ default: {},
5
+ validator() {},
6
+ };
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ module.exports = {};
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ getConfig: async (ctx) => {
5
+ const { configKey } = ctx.params;
6
+ const config = await strapi.plugin('ckeditor').service('config').getConfig(configKey);
7
+ ctx.send(config);
8
+ },
9
+ };
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ const config = require('./config');
4
+
5
+ module.exports = {
6
+ config
7
+ };
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ module.exports = ({ strapi }) => {
4
+ // destroy phase
5
+ };
@@ -0,0 +1,25 @@
1
+ 'use strict';
2
+
3
+ const register = require('./register');
4
+ const bootstrap = require('./bootstrap');
5
+ const destroy = require('./destroy');
6
+ const config = require('./config');
7
+ const contentTypes = require('./content-types');
8
+ const controllers = require('./controllers');
9
+ const routes = require('./routes');
10
+ const middlewares = require('./middlewares');
11
+ const policies = require('./policies');
12
+ const services = require('./services');
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
+ };
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ module.exports = {};
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ module.exports = {};
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ module.exports = ({ strapi }) => {
4
+ // registeration phase
5
+ };
@@ -0,0 +1,8 @@
1
+ module.exports = [
2
+ {
3
+ method: 'GET',
4
+ path: '/config/:configKey',
5
+ handler: 'config.getConfig',
6
+ config: { policies: [] },
7
+ }
8
+ ];
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * config.js configuration service
5
+ */
6
+
7
+ module.exports = ({ strapi }) => {
8
+ return {
9
+ getConfig(key = 'editor') {
10
+ return strapi.plugin('ckeditor').config(key) ?? {};
11
+ },
12
+ };
13
+ };
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ const config = require('./config');
4
+
5
+ module.exports = {
6
+ config
7
+ };
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ module.exports = require('./admin/src').default;
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ module.exports = require('./server');