@kookaat/strapi-plugin-tinymce 2.0.0 → 2.0.2

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 (72) hide show
  1. package/README.md +52 -84
  2. package/dist/_chunks/Settings-DDGJdgMB.js +2606 -0
  3. package/dist/_chunks/Settings-DDGJdgMB.js.map +1 -0
  4. package/dist/_chunks/Settings-omg6NZQb.mjs +2606 -0
  5. package/dist/_chunks/Settings-omg6NZQb.mjs.map +1 -0
  6. package/dist/_chunks/Wysiwyg-B5f8_FHm.js +130 -0
  7. package/dist/_chunks/Wysiwyg-B5f8_FHm.js.map +1 -0
  8. package/dist/_chunks/Wysiwyg-BJxwboVA.mjs +130 -0
  9. package/dist/_chunks/Wysiwyg-BJxwboVA.mjs.map +1 -0
  10. package/dist/_chunks/cs-4ldo0hfI.js +15 -0
  11. package/dist/_chunks/cs-4ldo0hfI.js.map +1 -0
  12. package/dist/_chunks/cs-D-gwbfRH.mjs +15 -0
  13. package/dist/_chunks/cs-D-gwbfRH.mjs.map +1 -0
  14. package/dist/_chunks/en-BILT6xrd.mjs +15 -0
  15. package/dist/_chunks/en-BILT6xrd.mjs.map +1 -0
  16. package/dist/_chunks/en-usAdfkfH.js +15 -0
  17. package/dist/_chunks/en-usAdfkfH.js.map +1 -0
  18. package/dist/_chunks/index-BKKEJ9ZG.js +243 -0
  19. package/dist/_chunks/index-BKKEJ9ZG.js.map +1 -0
  20. package/dist/_chunks/index-C2RU5wAS.mjs +242 -0
  21. package/dist/_chunks/index-C2RU5wAS.mjs.map +1 -0
  22. package/dist/_chunks/sk-BcD0BjAU.js +15 -0
  23. package/dist/_chunks/sk-BcD0BjAU.js.map +1 -0
  24. package/dist/_chunks/sk-D3I3bI3P.mjs +15 -0
  25. package/dist/_chunks/sk-D3I3bI3P.mjs.map +1 -0
  26. package/dist/admin/index.js +4 -0
  27. package/dist/admin/index.js.map +1 -0
  28. package/dist/admin/index.mjs +5 -0
  29. package/dist/admin/index.mjs.map +1 -0
  30. package/dist/server/index.js +293 -0
  31. package/dist/server/index.js.map +1 -0
  32. package/dist/server/index.mjs +294 -0
  33. package/dist/server/index.mjs.map +1 -0
  34. package/package.json +65 -20
  35. package/.github/stale.yml +0 -17
  36. package/admin/src/api/settings.js +0 -14
  37. package/admin/src/components/Editor/index.js +0 -60
  38. package/admin/src/components/Initializer/index.js +0 -26
  39. package/admin/src/components/MediaLib/index.js +0 -43
  40. package/admin/src/components/PluginIcon/index.js +0 -12
  41. package/admin/src/components/Wysiwyg/index.js +0 -122
  42. package/admin/src/index.js +0 -78
  43. package/admin/src/pages/App/index.js +0 -25
  44. package/admin/src/pages/HomePage/index.js +0 -7
  45. package/admin/src/pages/Settings/index.js +0 -134
  46. package/admin/src/permissions.js +0 -11
  47. package/admin/src/pluginId.js +0 -5
  48. package/admin/src/translations/cs.json +0 -10
  49. package/admin/src/translations/en.json +0 -10
  50. package/admin/src/translations/sk.json +0 -10
  51. package/admin/src/utils/axiosInstance.js +0 -40
  52. package/admin/src/utils/get-trad.js +0 -5
  53. package/admin/src/utils/index.js +0 -2
  54. package/server/bootstrap.js +0 -19
  55. package/server/config/index.js +0 -6
  56. package/server/content-types/index.js +0 -3
  57. package/server/controllers/config.js +0 -12
  58. package/server/controllers/index.js +0 -9
  59. package/server/controllers/settings.js +0 -30
  60. package/server/destroy.js +0 -5
  61. package/server/index.js +0 -25
  62. package/server/middlewares/index.js +0 -3
  63. package/server/policies/index.js +0 -3
  64. package/server/register.js +0 -5
  65. package/server/routes/config.js +0 -13
  66. package/server/routes/index.js +0 -7
  67. package/server/routes/settings.js +0 -23
  68. package/server/services/config.js +0 -9
  69. package/server/services/index.js +0 -9
  70. package/server/services/settings.js +0 -36
  71. package/strapi-admin.js +0 -3
  72. package/strapi-server.js +0 -3
package/README.md CHANGED
@@ -33,14 +33,13 @@ module.exports = () => ({
33
33
 
34
34
  ## <a id="features"></a>✨ Key features
35
35
 
36
- * **Anchor:** Add an anchor/bookmark button to the toolbar that inserts an anchor at the editor’s cursor insertion
37
- point.
36
+ * **Anchor:** Add an anchor/bookmark button to the toolbar that inserts an anchor at the editor’s cursor insertion point.
38
37
  * **Autolink:** Create hyperlinks automatically when a user inputs a valid and complete URL.
39
- * **Autoresize:** Resize the editor automatically to the content inside it, and prevent the editor from expanding
40
- infinitely.
38
+ * **Autoresize:** Resize the editor automatically to the content inside it, and prevent the editor from expanding infinitely.
41
39
  * **Code:** Add a toolbar button that allows a user to edit the HTML code hidden by the WYSIWYG view.
42
40
  * **Code sample:** Insert and embed syntax color highlighted code snippets into the editable area.
43
41
 
42
+
44
43
  And much more ! [List of all features](https://www.tiny.cloud/tinymce/features/).
45
44
 
46
45
  ## <a id="installation"></a>🔧 Installation
@@ -48,132 +47,102 @@ And much more ! [List of all features](https://www.tiny.cloud/tinymce/features/)
48
47
  Inside your Strapi app, add the package:
49
48
 
50
49
  With `npm`:
51
-
52
50
  ```bash
53
51
  npm install @kookaat/strapi-plugin-tinymce
54
52
  ```
55
-
56
53
  With `yarn`:
57
-
58
54
  ```bash
59
55
  yarn add @kookaat/strapi-plugin-tinymce
60
56
  ```
61
57
 
62
58
  In `config/plugins.js` file add:
63
-
64
59
  ```js
65
60
  tinymce:{
66
61
  enabled:true
67
- }
68
- ;
62
+ };
69
63
  ```
70
64
 
71
65
  If you do not yet have this file, then create and add:
72
-
73
66
  ```js
74
67
  module.exports = () => ({
75
- tinymce: {
76
- enabled: true
68
+ tinymce:{
69
+ enabled:true
77
70
  };
78
71
  })
79
72
  ```
80
73
 
81
74
  You will also have to update strapi::security middleware in your middlewares.js file in config folder.
82
75
  If you didn't update this file yet, then replace "strapi::security" with following code (object)
83
-
84
76
  ```js
85
77
  //middlewares.js
86
78
 
87
- {
79
+ {
88
80
  name: "strapi::security",
89
- config
90
- :
91
- {
92
- contentSecurityPolicy: {
93
- useDefaults: true,
94
- directives
95
- :
96
- {
97
- "script-src"
98
- :
99
- ["'self'", "*.tinymce.com", "*.tiny.cloud", "https:"],
100
- "connect-src"
101
- :
102
- ["'self'", "*.tinymce.com", "*.tiny.cloud", "blob:", "*.strapi.io"],
103
- "img-src"
104
- :
105
- [
106
- "'self'",
107
- "*.tinymce.com",
108
- "*.tiny.cloud",
109
- "data:",
110
- "blob:",
111
- "dl.airtable.com",
112
- "strapi.io",
113
- "s3.amazonaws.com",
114
- "cdn.jsdelivr.net",
115
- ],
116
- "style-src"
117
- :
118
- [
119
- "'self'",
120
- "'unsafe-inline'",
121
- "*.tinymce.com",
122
- "*.tiny.cloud",
123
- ],
124
- "font-src"
125
- :
126
- ["'self'", "*.tinymce.com", "*.tiny.cloud"],
127
- }
128
- ,
129
- upgradeInsecureRequests: null,
130
- }
131
- ,
132
- }
133
- ,
134
- }
135
- ,
81
+ config: {
82
+ contentSecurityPolicy: {
83
+ useDefaults: true,
84
+ directives: {
85
+ "script-src": ["'self'", "*.tinymce.com", "*.tiny.cloud", "https:"],
86
+ "connect-src": ["'self'", "*.tinymce.com", "*.tiny.cloud", "blob:", "*.strapi.io"],
87
+ "img-src": [
88
+ "'self'",
89
+ "*.tinymce.com",
90
+ "*.tiny.cloud",
91
+ "data:",
92
+ "blob:",
93
+ "dl.airtable.com",
94
+ "strapi.io",
95
+ "s3.amazonaws.com",
96
+ "cdn.jsdelivr.net",
97
+ ],
98
+ "style-src": [
99
+ "'self'",
100
+ "'unsafe-inline'",
101
+ "*.tinymce.com",
102
+ "*.tiny.cloud",
103
+ ],
104
+ "font-src": ["'self'", "*.tinymce.com", "*.tiny.cloud"],
105
+ },
106
+ upgradeInsecureRequests: null,
107
+ },
108
+ },
109
+ },
136
110
  ```
137
111
 
138
112
  Then run build:
139
-
140
113
  ```bash
141
114
  npm run build
142
115
  ```
143
116
 
144
117
  or
145
-
146
118
  ```bash
147
119
  yarn build
148
120
  ```
149
121
 
150
- **After starting your project please add API key for your TinyMCE editor in admin panel in
151
- settings/tinymce/configuration**
122
+ **After starting your project please add API key for your TinyMCE editor in admin panel in settings/tinymce/configuration**
152
123
 
153
- If TinyMCE editor doesn't appear in your richtext field, please check your console for any hints, you might have
154
- incorrectly set your middlewares.
124
+ If TinyMCE editor doesn't appear in your richtext field, please check your console for any hints, you might have incorrectly set your middlewares.
155
125
 
156
126
  ## <a id="configuration"></a>⚙️ Configuration
157
-
158
- TinyMCE outputFormat should be defined in `config.editor`, and init object should be defined
159
- in `config.editor.editorConfig` field in `plugins.js` file.
127
+ TinyMCE outputFormat should be defined in `config.editor`, and init object should be defined in `config.editor.editorConfig` field in `plugins.js` file.
160
128
 
161
129
  **⚠️ `plugins.js` not `plugin.js` ⚠️**
162
130
 
163
131
  **`plugins.js` file should be placed in `config` folder.**
164
132
 
133
+
165
134
  Learn more about configuration from [official documentation](https://www.tiny.cloud/docs/tinymce/6/).
166
135
 
167
136
  **Default configuration:**
168
-
169
137
  ```js
170
138
  // plugins.js
171
- module.exports = ({env}) => ({
139
+ module.exports = ({ env }) => ({
172
140
  tinymce: {
173
141
  enabled: true,
174
142
  config: {
175
143
  editor: {
176
144
  outputFormat: "html",
145
+ tinymceSrc: "/tinymce/tinymce.min.js", // USE WITH YOUR PUBLIC PATH TO TINYMCE LIBRARY FOR USING SELF HOSTED TINYMCE
177
146
  editorConfig: {
178
147
  language: "sk",
179
148
  height: 500,
@@ -195,19 +164,19 @@ module.exports = ({env}) => ({
195
164
  {
196
165
  title: "Headings",
197
166
  items: [
198
- {title: "h1", block: "h1"},
199
- {title: "h2", block: "h2"},
200
- {title: "h3", block: "h3"},
201
- {title: "h4", block: "h4"},
202
- {title: "h5", block: "h5"},
203
- {title: "h6", block: "h6"},
167
+ { title: "h1", block: "h1" },
168
+ { title: "h2", block: "h2" },
169
+ { title: "h3", block: "h3" },
170
+ { title: "h4", block: "h4" },
171
+ { title: "h5", block: "h5" },
172
+ { title: "h6", block: "h6" },
204
173
  ],
205
174
  },
206
175
 
207
176
  {
208
177
  title: "Text",
209
178
  items: [
210
- {title: "Paragraph", block: "p"},
179
+ { title: "Paragraph", block: "p" },
211
180
  {
212
181
  title: "Paragraph with small letters",
213
182
  block: "small",
@@ -224,9 +193,8 @@ module.exports = ({env}) => ({
224
193
  ```
225
194
 
226
195
  ## <a id="requirements"></a>⚠️ Requirements
196
+ Strapi **v5.x.x+**
227
197
 
228
- Strapi **v4.x.x+**
229
-
230
- Node **14 - 20**
198
+ Node **>= 20.x.x**
231
199
 
232
- Tested on **v4.3.4**
200
+ Tested on **v5.1.1**