@_sh/strapi-plugin-ckeditor 3.0.7 → 3.0.8
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.
|
@@ -20,7 +20,7 @@ export const Editor = ({
|
|
|
20
20
|
disabled = false,
|
|
21
21
|
presetName,
|
|
22
22
|
maxLength,
|
|
23
|
-
placeholder
|
|
23
|
+
placeholder,
|
|
24
24
|
}) => {
|
|
25
25
|
const [editorInstance, setEditorInstance] = useState(false);
|
|
26
26
|
|
|
@@ -39,24 +39,12 @@ export const Editor = ({
|
|
|
39
39
|
|
|
40
40
|
useEffect(() => {
|
|
41
41
|
(async () => {
|
|
42
|
-
const currentPreset = await getConfiguredPreset(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const clonedPreset = {
|
|
49
|
-
...currentPreset,
|
|
50
|
-
editorConfig: {
|
|
51
|
-
...currentPreset.editorConfig,
|
|
52
|
-
placeholder: placeholder.defaultMessage,
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
setPreset(clonedPreset);
|
|
57
|
-
} else {
|
|
58
|
-
setPreset(currentPreset);
|
|
59
|
-
}
|
|
42
|
+
const currentPreset = await getConfiguredPreset(presetName, {
|
|
43
|
+
toggleMediaLib: handleToggleMediaLib,
|
|
44
|
+
strapiFieldPlaceholder: placeholder?.defaultMessage,
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
setPreset(currentPreset);
|
|
60
48
|
})();
|
|
61
49
|
}, []);
|
|
62
50
|
|
|
@@ -2,17 +2,27 @@ import basePresets from '../presets';
|
|
|
2
2
|
import { setPlugins } from './plugins';
|
|
3
3
|
import { setLanguage } from './language';
|
|
4
4
|
|
|
5
|
-
export const getConfiguredPreset = async (
|
|
5
|
+
export const getConfiguredPreset = async (
|
|
6
|
+
presetName,
|
|
7
|
+
{ toggleMediaLib, strapiFieldPlaceholder }
|
|
8
|
+
) => {
|
|
6
9
|
const { presets: userPresets, dontMergePresets } =
|
|
7
10
|
globalThis.SH_CKE_CONFIG || {};
|
|
8
11
|
|
|
9
|
-
const preset =
|
|
10
|
-
? userPresets[presetName]
|
|
11
|
-
: basePresets[presetName];
|
|
12
|
+
const preset =
|
|
13
|
+
dontMergePresets ? userPresets[presetName] : basePresets[presetName];
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
const clonedPreset = {
|
|
16
|
+
...preset,
|
|
17
|
+
editorConfig: {
|
|
18
|
+
...preset.editorConfig,
|
|
19
|
+
placeholder: strapiFieldPlaceholder || preset.editorConfig.placeholder,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
14
22
|
|
|
15
|
-
|
|
23
|
+
setPlugins(clonedPreset.editorConfig, toggleMediaLib);
|
|
16
24
|
|
|
17
|
-
|
|
25
|
+
await setLanguage(clonedPreset.editorConfig);
|
|
26
|
+
|
|
27
|
+
return clonedPreset;
|
|
18
28
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@_sh/strapi-plugin-ckeditor",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.8",
|
|
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,7 +25,7 @@
|
|
|
25
25
|
"strapi-server.js"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"ckeditor5": "^43.
|
|
28
|
+
"ckeditor5": "^43.3.0",
|
|
29
29
|
"@ckeditor/ckeditor5-react": "^9.3.1",
|
|
30
30
|
"@strapi/design-system": "^1.19.0",
|
|
31
31
|
"prop-types": "^15.8.1",
|