@_sh/strapi-plugin-ckeditor 5.0.0 → 5.0.1
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 +10 -8
- package/dist/_chunks/{Field-BKtrDFjh.js → Field-BdtPMWJ1.js} +7 -5
- package/dist/_chunks/{Field-8Nh0dMSc.mjs → Field-wVg5xgbq.mjs} +7 -5
- package/dist/_chunks/{index-DO2vqIdx.js → index-CZRYkPJ8.js} +5 -5
- package/dist/_chunks/{index-CNalXcwy.mjs → index-Clyv4ZPF.mjs} +5 -5
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/config/types.d.ts +3 -3
- package/dist/server/index.js +2 -2
- package/dist/server/index.mjs +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -60,7 +60,7 @@ for setup instructions.
|
|
|
60
60
|
|
|
61
61
|
## <a id="usage"></a>✍️ Usage
|
|
62
62
|
|
|
63
|
-
The field can be
|
|
63
|
+
The field can be found in the Content-Type Builder under the `CUSTOM` tab:
|
|
64
64
|
|
|
65
65
|
<p align="center">
|
|
66
66
|
<img src="https://raw.githubusercontent.com/nshenderov/strapi-plugin-ckeditor/master/assets/v5-usage-guide-2.png" width="700" />
|
|
@@ -68,7 +68,7 @@ The field can be fould in the Content-Type Builder under the `CUSTOM` tab:
|
|
|
68
68
|
|
|
69
69
|
**Presets**
|
|
70
70
|
|
|
71
|
-
A preset is a set of settings that define the editor's features and
|
|
71
|
+
A preset is a set of settings that define the editor's features and appearance. You
|
|
72
72
|
can specify a dedicated preset for each field. The available presets can be customized through the
|
|
73
73
|
[configuration](#configuration).
|
|
74
74
|
|
|
@@ -120,6 +120,8 @@ default to the Strapi admin's preferred language. If no preference is set, Engli
|
|
|
120
120
|
**Content language**: i18n for the editor's content language can be enabled by checking the
|
|
121
121
|
`Enable localization for this field` option in the Advanced Settings tab.
|
|
122
122
|
|
|
123
|
+
> 💡 It is important to use the content styles on the publishing side of your application. Otherwise, the content will look different in the editor and for your end users. [Follow the documentation](https://ckeditor.com/docs/ckeditor5/latest/getting-started/setup/css.html#styling-the-published-content).
|
|
124
|
+
|
|
123
125
|
## <a id="configuration"></a>⚙️ Configuration
|
|
124
126
|
|
|
125
127
|
The plugin configuration must be defined on the front-end. The plugin provides a `setPluginConfig`
|
|
@@ -187,7 +189,7 @@ following properties:
|
|
|
187
189
|
```ts
|
|
188
190
|
/**
|
|
189
191
|
* The `common` styles are applied first, followed by `light` or `dark` styles
|
|
190
|
-
* according to
|
|
192
|
+
* according to user preferences, and finally `additional` styles.
|
|
191
193
|
*/
|
|
192
194
|
type Theme = {
|
|
193
195
|
/**
|
|
@@ -195,11 +197,11 @@ type Theme = {
|
|
|
195
197
|
*/
|
|
196
198
|
common?: EditorStyles;
|
|
197
199
|
/**
|
|
198
|
-
* Styles
|
|
200
|
+
* Styles applied in light mode.
|
|
199
201
|
*/
|
|
200
202
|
light?: EditorStyles;
|
|
201
203
|
/**
|
|
202
|
-
* Styles
|
|
204
|
+
* Styles applied in dark mode.
|
|
203
205
|
*/
|
|
204
206
|
dark?: EditorStyles;
|
|
205
207
|
/**
|
|
@@ -322,11 +324,11 @@ export type Theme = {
|
|
|
322
324
|
*/
|
|
323
325
|
common?: EditorStyles;
|
|
324
326
|
/**
|
|
325
|
-
* Styles
|
|
327
|
+
* Styles applied in light mode.
|
|
326
328
|
*/
|
|
327
329
|
light?: EditorStyles;
|
|
328
330
|
/**
|
|
329
|
-
* Styles
|
|
331
|
+
* Styles applied in dark mode.
|
|
330
332
|
*/
|
|
331
333
|
dark?: EditorStyles;
|
|
332
334
|
/**
|
|
@@ -558,7 +560,7 @@ const defaultHtml: Preset = {
|
|
|
558
560
|
const defaultMarkdown: Preset = {
|
|
559
561
|
...defaultMarkdownPreset,
|
|
560
562
|
description: 'Modified default Markdown editor',
|
|
561
|
-
styles: `
|
|
563
|
+
styles: css`
|
|
562
564
|
.ck {
|
|
563
565
|
--ck-editor-max-width: 1500px;
|
|
564
566
|
--ck-editor-min-height: 700px;
|
|
@@ -30,7 +30,7 @@ const admin = require("@strapi/strapi/admin");
|
|
|
30
30
|
const ckeditor5 = require("ckeditor5");
|
|
31
31
|
const ckeditor5React = require("@ckeditor/ckeditor5-react");
|
|
32
32
|
require("ckeditor5/ckeditor5.css");
|
|
33
|
-
const index = require("./index-
|
|
33
|
+
const index = require("./index-CZRYkPJ8.js");
|
|
34
34
|
const icons = require("@strapi/icons");
|
|
35
35
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
36
36
|
const React__default = /* @__PURE__ */ _interopDefault(React);
|
|
@@ -79,7 +79,7 @@ async function importLang(config, language) {
|
|
|
79
79
|
TRANSLATIONS[language] = translation.default;
|
|
80
80
|
config.translations = translation.default;
|
|
81
81
|
} else {
|
|
82
|
-
console.warn(`CKEditor
|
|
82
|
+
console.warn(`No CKEditor translation found for language: ${language}`);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
function detecti18n() {
|
|
@@ -165,7 +165,9 @@ const translationImports = {
|
|
|
165
165
|
const EditorContext = React.createContext(null);
|
|
166
166
|
function useEditorContext() {
|
|
167
167
|
const context = React.useContext(EditorContext);
|
|
168
|
-
if (!context)
|
|
168
|
+
if (!context) {
|
|
169
|
+
throw new Error("The useEditorContext hook must be used within the EditorProvider.");
|
|
170
|
+
}
|
|
169
171
|
return context;
|
|
170
172
|
}
|
|
171
173
|
function EditorProvider({
|
|
@@ -314,7 +316,7 @@ function CKEReact() {
|
|
|
314
316
|
const handleChangeAssets = React.useCallback(
|
|
315
317
|
(newElems) => {
|
|
316
318
|
if (!editorInstance) {
|
|
317
|
-
throw new Error("
|
|
319
|
+
throw new Error("The editor instance has not been initialized.");
|
|
318
320
|
}
|
|
319
321
|
const viewFragment = editorInstance.data.processor.toView(newElems);
|
|
320
322
|
const modelFragment = editorInstance.data.toModel(viewFragment);
|
|
@@ -360,7 +362,7 @@ function CKEReact() {
|
|
|
360
362
|
try {
|
|
361
363
|
setUpFn(editor);
|
|
362
364
|
} catch (err) {
|
|
363
|
-
console.error(`
|
|
365
|
+
console.error(`Failed to set up the ${pluginName} plugin `, err);
|
|
364
366
|
}
|
|
365
367
|
}
|
|
366
368
|
});
|
|
@@ -6,7 +6,7 @@ import { useStrapiApp, useField } from "@strapi/strapi/admin";
|
|
|
6
6
|
import { ClassicEditor } from "ckeditor5";
|
|
7
7
|
import { CKEditor } from "@ckeditor/ckeditor5-react";
|
|
8
8
|
import "ckeditor5/ckeditor5.css";
|
|
9
|
-
import { g as getPluginConfig, p as prefixFileUrlWithBackendUrl, i as isImageResponsive } from "./index-
|
|
9
|
+
import { g as getPluginConfig, p as prefixFileUrlWithBackendUrl, i as isImageResponsive } from "./index-Clyv4ZPF.mjs";
|
|
10
10
|
import { Collapse, Expand } from "@strapi/icons";
|
|
11
11
|
const STORAGE_KEYS = {
|
|
12
12
|
TOKEN: "jwtToken",
|
|
@@ -53,7 +53,7 @@ async function importLang(config, language) {
|
|
|
53
53
|
TRANSLATIONS[language] = translation.default;
|
|
54
54
|
config.translations = translation.default;
|
|
55
55
|
} else {
|
|
56
|
-
console.warn(`CKEditor
|
|
56
|
+
console.warn(`No CKEditor translation found for language: ${language}`);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
function detecti18n() {
|
|
@@ -139,7 +139,9 @@ const translationImports = {
|
|
|
139
139
|
const EditorContext = createContext(null);
|
|
140
140
|
function useEditorContext() {
|
|
141
141
|
const context = useContext(EditorContext);
|
|
142
|
-
if (!context)
|
|
142
|
+
if (!context) {
|
|
143
|
+
throw new Error("The useEditorContext hook must be used within the EditorProvider.");
|
|
144
|
+
}
|
|
143
145
|
return context;
|
|
144
146
|
}
|
|
145
147
|
function EditorProvider({
|
|
@@ -288,7 +290,7 @@ function CKEReact() {
|
|
|
288
290
|
const handleChangeAssets = useCallback(
|
|
289
291
|
(newElems) => {
|
|
290
292
|
if (!editorInstance) {
|
|
291
|
-
throw new Error("
|
|
293
|
+
throw new Error("The editor instance has not been initialized.");
|
|
292
294
|
}
|
|
293
295
|
const viewFragment = editorInstance.data.processor.toView(newElems);
|
|
294
296
|
const modelFragment = editorInstance.data.toModel(viewFragment);
|
|
@@ -334,7 +336,7 @@ function CKEReact() {
|
|
|
334
336
|
try {
|
|
335
337
|
setUpFn(editor);
|
|
336
338
|
} catch (err) {
|
|
337
|
-
console.error(`
|
|
339
|
+
console.error(`Failed to set up the ${pluginName} plugin `, err);
|
|
338
340
|
}
|
|
339
341
|
}
|
|
340
342
|
});
|
|
@@ -28,7 +28,7 @@ const yup__namespace = /* @__PURE__ */ _interopNamespace(yup);
|
|
|
28
28
|
const sanitizeHtml__namespace = /* @__PURE__ */ _interopNamespace(sanitizeHtml);
|
|
29
29
|
const cloneDeep__default = /* @__PURE__ */ _interopDefault(cloneDeep);
|
|
30
30
|
const name = "@_sh/strapi-plugin-ckeditor";
|
|
31
|
-
const version = "5.0.
|
|
31
|
+
const version = "5.0.1";
|
|
32
32
|
const description = "Integrates CKEditor 5 into your Strapi project as a fully customizable custom field. (Community Edition)";
|
|
33
33
|
const keywords = [
|
|
34
34
|
"strapi",
|
|
@@ -96,7 +96,7 @@ const dependencies = {
|
|
|
96
96
|
"@strapi/design-system": "^2.0.0-rc.13",
|
|
97
97
|
"@strapi/icons": "^2.0.0-rc.13",
|
|
98
98
|
lodash: "^4.17.21",
|
|
99
|
-
ckeditor5: "^44.
|
|
99
|
+
ckeditor5: "^44.1.0",
|
|
100
100
|
"prop-types": "^15.8.1",
|
|
101
101
|
"sanitize-html": "^2.13.1",
|
|
102
102
|
yup: "0.32.9"
|
|
@@ -638,14 +638,14 @@ class StrapiMediaLib extends ckeditor5.Plugin {
|
|
|
638
638
|
}
|
|
639
639
|
connect(strapiToggle) {
|
|
640
640
|
if (typeof strapiToggle !== "function") {
|
|
641
|
-
throw new Error("
|
|
641
|
+
throw new Error("The input parameter for toggle must be a function.");
|
|
642
642
|
}
|
|
643
643
|
this.strapiToggle = strapiToggle;
|
|
644
644
|
}
|
|
645
645
|
toggle() {
|
|
646
646
|
if (typeof this.strapiToggle !== "function") {
|
|
647
647
|
throw new Error(
|
|
648
|
-
"Strapi
|
|
648
|
+
"The Strapi Media Library toggle function is not connected. Use the connect function first."
|
|
649
649
|
);
|
|
650
650
|
}
|
|
651
651
|
this.strapiToggle();
|
|
@@ -1270,7 +1270,7 @@ const index = {
|
|
|
1270
1270
|
defaultMessage: "The advanced rich text editor. (Community Edition)"
|
|
1271
1271
|
},
|
|
1272
1272
|
components: {
|
|
1273
|
-
Input: async () => Promise.resolve().then(() => require("./Field-
|
|
1273
|
+
Input: async () => Promise.resolve().then(() => require("./Field-BdtPMWJ1.js")).then((module2) => ({
|
|
1274
1274
|
default: module2.Field
|
|
1275
1275
|
}))
|
|
1276
1276
|
},
|
|
@@ -6,7 +6,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
6
6
|
import { Flex, lightTheme } from "@strapi/design-system";
|
|
7
7
|
import cloneDeep from "lodash/cloneDeep";
|
|
8
8
|
const name = "@_sh/strapi-plugin-ckeditor";
|
|
9
|
-
const version = "5.0.
|
|
9
|
+
const version = "5.0.1";
|
|
10
10
|
const description = "Integrates CKEditor 5 into your Strapi project as a fully customizable custom field. (Community Edition)";
|
|
11
11
|
const keywords = [
|
|
12
12
|
"strapi",
|
|
@@ -74,7 +74,7 @@ const dependencies = {
|
|
|
74
74
|
"@strapi/design-system": "^2.0.0-rc.13",
|
|
75
75
|
"@strapi/icons": "^2.0.0-rc.13",
|
|
76
76
|
lodash: "^4.17.21",
|
|
77
|
-
ckeditor5: "^44.
|
|
77
|
+
ckeditor5: "^44.1.0",
|
|
78
78
|
"prop-types": "^15.8.1",
|
|
79
79
|
"sanitize-html": "^2.13.1",
|
|
80
80
|
yup: "0.32.9"
|
|
@@ -616,14 +616,14 @@ class StrapiMediaLib extends Plugin {
|
|
|
616
616
|
}
|
|
617
617
|
connect(strapiToggle) {
|
|
618
618
|
if (typeof strapiToggle !== "function") {
|
|
619
|
-
throw new Error("
|
|
619
|
+
throw new Error("The input parameter for toggle must be a function.");
|
|
620
620
|
}
|
|
621
621
|
this.strapiToggle = strapiToggle;
|
|
622
622
|
}
|
|
623
623
|
toggle() {
|
|
624
624
|
if (typeof this.strapiToggle !== "function") {
|
|
625
625
|
throw new Error(
|
|
626
|
-
"Strapi
|
|
626
|
+
"The Strapi Media Library toggle function is not connected. Use the connect function first."
|
|
627
627
|
);
|
|
628
628
|
}
|
|
629
629
|
this.strapiToggle();
|
|
@@ -1248,7 +1248,7 @@ const index = {
|
|
|
1248
1248
|
defaultMessage: "The advanced rich text editor. (Community Edition)"
|
|
1249
1249
|
},
|
|
1250
1250
|
components: {
|
|
1251
|
-
Input: async () => import("./Field-
|
|
1251
|
+
Input: async () => import("./Field-wVg5xgbq.mjs").then((module) => ({
|
|
1252
1252
|
default: module.Field
|
|
1253
1253
|
}))
|
|
1254
1254
|
},
|
package/dist/admin/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
require("yup");
|
|
4
|
-
const index = require("../_chunks/index-
|
|
4
|
+
const index = require("../_chunks/index-CZRYkPJ8.js");
|
|
5
5
|
require("ckeditor5");
|
|
6
6
|
exports.StrapiMediaLib = index.StrapiMediaLib;
|
|
7
7
|
exports.StrapiUploadAdapter = index.StrapiUploadAdapter;
|
package/dist/admin/index.mjs
CHANGED
|
@@ -67,7 +67,7 @@ export type UserPluginConfig = {
|
|
|
67
67
|
* @remarks
|
|
68
68
|
*
|
|
69
69
|
* The `common` styles are applied first, followed by `light` or `dark` styles
|
|
70
|
-
* according to
|
|
70
|
+
* according to user preferences, and finally `additional` styles.
|
|
71
71
|
*/
|
|
72
72
|
export type Theme = {
|
|
73
73
|
/**
|
|
@@ -75,11 +75,11 @@ export type Theme = {
|
|
|
75
75
|
*/
|
|
76
76
|
common?: EditorStyles;
|
|
77
77
|
/**
|
|
78
|
-
* Styles
|
|
78
|
+
* Styles applied in light mode.
|
|
79
79
|
*/
|
|
80
80
|
light?: EditorStyles;
|
|
81
81
|
/**
|
|
82
|
-
* Styles
|
|
82
|
+
* Styles applied in dark mode.
|
|
83
83
|
*/
|
|
84
84
|
dark?: EditorStyles;
|
|
85
85
|
/**
|
package/dist/server/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const name = "@_sh/strapi-plugin-ckeditor";
|
|
3
|
-
const version = "5.0.
|
|
3
|
+
const version = "5.0.1";
|
|
4
4
|
const description = "Integrates CKEditor 5 into your Strapi project as a fully customizable custom field. (Community Edition)";
|
|
5
5
|
const keywords = [
|
|
6
6
|
"strapi",
|
|
@@ -68,7 +68,7 @@ const dependencies = {
|
|
|
68
68
|
"@strapi/design-system": "^2.0.0-rc.13",
|
|
69
69
|
"@strapi/icons": "^2.0.0-rc.13",
|
|
70
70
|
lodash: "^4.17.21",
|
|
71
|
-
ckeditor5: "^44.
|
|
71
|
+
ckeditor5: "^44.1.0",
|
|
72
72
|
"prop-types": "^15.8.1",
|
|
73
73
|
"sanitize-html": "^2.13.1",
|
|
74
74
|
yup: "0.32.9"
|
package/dist/server/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const name = "@_sh/strapi-plugin-ckeditor";
|
|
2
|
-
const version = "5.0.
|
|
2
|
+
const version = "5.0.1";
|
|
3
3
|
const description = "Integrates CKEditor 5 into your Strapi project as a fully customizable custom field. (Community Edition)";
|
|
4
4
|
const keywords = [
|
|
5
5
|
"strapi",
|
|
@@ -67,7 +67,7 @@ const dependencies = {
|
|
|
67
67
|
"@strapi/design-system": "^2.0.0-rc.13",
|
|
68
68
|
"@strapi/icons": "^2.0.0-rc.13",
|
|
69
69
|
lodash: "^4.17.21",
|
|
70
|
-
ckeditor5: "^44.
|
|
70
|
+
ckeditor5: "^44.1.0",
|
|
71
71
|
"prop-types": "^15.8.1",
|
|
72
72
|
"sanitize-html": "^2.13.1",
|
|
73
73
|
yup: "0.32.9"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@_sh/strapi-plugin-ckeditor",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.1",
|
|
4
4
|
"description": "Integrates CKEditor 5 into your Strapi project as a fully customizable custom field. (Community Edition)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"strapi",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"@strapi/design-system": "^2.0.0-rc.13",
|
|
69
69
|
"@strapi/icons": "^2.0.0-rc.13",
|
|
70
70
|
"lodash": "^4.17.21",
|
|
71
|
-
"ckeditor5": "^44.
|
|
71
|
+
"ckeditor5": "^44.1.0",
|
|
72
72
|
"prop-types": "^15.8.1",
|
|
73
73
|
"sanitize-html": "^2.13.1",
|
|
74
74
|
"yup": "0.32.9"
|