@_sh/strapi-plugin-ckeditor 5.0.2 → 6.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.
- package/README.md +133 -10
- package/dist/_chunks/{Field-D_JHCz5O.mjs → Field-g8gLpd2N.mjs} +2 -1
- package/dist/_chunks/{Field-DplOWQLX.js → Field-kyiYSdM-.js} +2 -1
- package/dist/_chunks/{index-CsSYDZ4y.js → index-lgM3BQrm.js} +12 -14
- package/dist/_chunks/{index-D3a4OadF.mjs → index-re_mQliQ.mjs} +14 -16
- package/dist/admin/index.js +4 -1
- package/dist/admin/index.mjs +5 -2
- package/dist/admin/src/config/pluginConfig.d.ts +22 -8
- package/dist/admin/src/config/types.d.ts +2 -1
- package/dist/admin/src/exports.d.ts +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/index.mjs +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -122,10 +122,25 @@ default to the Strapi admin's preferred language. If no preference is set, Engli
|
|
|
122
122
|
|
|
123
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
124
|
|
|
125
|
+
> To display content from external sources, such as images or videos, in your admin panel,
|
|
126
|
+
> you need to configure your `middlewares.js` file.
|
|
127
|
+
> [**Check the documentation for details.**](https://docs.strapi.io/dev-docs/configurations/middlewares#security)
|
|
128
|
+
|
|
125
129
|
## <a id="configuration"></a>⚙️ Configuration
|
|
126
130
|
|
|
127
|
-
The plugin configuration must be defined on the front-end.
|
|
128
|
-
|
|
131
|
+
The plugin configuration must be defined on the front-end.
|
|
132
|
+
|
|
133
|
+
The plugin provides a set of functions that allow you to modify the plugin's configuration:
|
|
134
|
+
|
|
135
|
+
```ts
|
|
136
|
+
setPluginConfig(config);
|
|
137
|
+
getPluginPresets();
|
|
138
|
+
getPluginTheme();
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**setPluginConfig**
|
|
142
|
+
|
|
143
|
+
The function, accepts a plugin configuration (`PluginConfig`) that can include an array of presets
|
|
129
144
|
and a theme object:
|
|
130
145
|
|
|
131
146
|
```ts
|
|
@@ -219,6 +234,28 @@ type Theme = {
|
|
|
219
234
|
export type EditorStyles = string | Interpolation<object>[];
|
|
220
235
|
```
|
|
221
236
|
|
|
237
|
+
**getPluginPresets**
|
|
238
|
+
|
|
239
|
+
```ts
|
|
240
|
+
function getPluginPresets(): {
|
|
241
|
+
[key: string]: Preset;
|
|
242
|
+
};
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
Returns `presets` object.
|
|
246
|
+
|
|
247
|
+
- Each property name must match the corresponding preset's name.
|
|
248
|
+
- To extend or modify the options visible in the admin panel's content manager,
|
|
249
|
+
changes must be made before the admin panel's bootstrap lifecycle function.
|
|
250
|
+
|
|
251
|
+
**getPluginTheme**
|
|
252
|
+
|
|
253
|
+
```ts
|
|
254
|
+
function getPluginTheme(): Theme;
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
Returns `theme` object.
|
|
258
|
+
|
|
222
259
|
**Default presets and theme**
|
|
223
260
|
|
|
224
261
|
To simplify the process of defining a new preset, the plugin exports default presets and
|
|
@@ -351,7 +388,7 @@ export type EditorStyles = string | Interpolation<object>[];
|
|
|
351
388
|
### Configuration examples:
|
|
352
389
|
|
|
353
390
|
<details>
|
|
354
|
-
<summary>
|
|
391
|
+
<summary>Setting a new set of presets [JS]</summary>
|
|
355
392
|
|
|
356
393
|
```js
|
|
357
394
|
// src/admin/app.js
|
|
@@ -429,7 +466,7 @@ export default {
|
|
|
429
466
|
</details>
|
|
430
467
|
|
|
431
468
|
<details>
|
|
432
|
-
<summary>
|
|
469
|
+
<summary>Setting a new set of presets [TS]</summary>
|
|
433
470
|
|
|
434
471
|
```ts
|
|
435
472
|
// src/admin/app.tsx
|
|
@@ -513,7 +550,7 @@ export default {
|
|
|
513
550
|
</details>
|
|
514
551
|
|
|
515
552
|
<details>
|
|
516
|
-
<summary>Default presets modification [TS]</summary>
|
|
553
|
+
<summary>Default presets modification using setPluginConfig [TS]</summary>
|
|
517
554
|
|
|
518
555
|
```ts
|
|
519
556
|
// src/admin/app.tsx
|
|
@@ -587,7 +624,67 @@ export default {
|
|
|
587
624
|
</details>
|
|
588
625
|
|
|
589
626
|
<details>
|
|
590
|
-
<summary>
|
|
627
|
+
<summary>Default presets modification using getPluginPresets [TS]</summary>
|
|
628
|
+
|
|
629
|
+
```ts
|
|
630
|
+
// src/admin/app.tsx
|
|
631
|
+
|
|
632
|
+
import { css } from 'styled-components';
|
|
633
|
+
import { getPluginPresets } from '@_sh/strapi-plugin-ckeditor';
|
|
634
|
+
|
|
635
|
+
export default {
|
|
636
|
+
register() {
|
|
637
|
+
const presets = getPluginPresets();
|
|
638
|
+
|
|
639
|
+
presets.defaultHtml.styles = css`
|
|
640
|
+
.ck {
|
|
641
|
+
color: red;
|
|
642
|
+
}
|
|
643
|
+
`;
|
|
644
|
+
|
|
645
|
+
presets.defaultHtml.editorConfig = {
|
|
646
|
+
...presets.defaultHtml.editorConfig,
|
|
647
|
+
placeholder: 'Modified default HTML editor',
|
|
648
|
+
toolbar: [
|
|
649
|
+
'heading',
|
|
650
|
+
'|',
|
|
651
|
+
'bold',
|
|
652
|
+
'italic',
|
|
653
|
+
'link',
|
|
654
|
+
'bulletedList',
|
|
655
|
+
'numberedList',
|
|
656
|
+
'|',
|
|
657
|
+
'strapiMediaLib',
|
|
658
|
+
'insertTable',
|
|
659
|
+
'|',
|
|
660
|
+
'undo',
|
|
661
|
+
'redo',
|
|
662
|
+
],
|
|
663
|
+
};
|
|
664
|
+
|
|
665
|
+
presets.defaultMarkdown = {
|
|
666
|
+
...presets.defaultMarkdown,
|
|
667
|
+
description: 'Modified default Markdown editor',
|
|
668
|
+
styles: css`
|
|
669
|
+
.ck {
|
|
670
|
+
--ck-editor-max-width: 1500px;
|
|
671
|
+
--ck-editor-min-height: 700px;
|
|
672
|
+
--ck-editor-max-height: 700px;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
.ck.ck-editor__main {
|
|
676
|
+
border: 3px dashed ${({ theme }) => theme.colors.warning500};
|
|
677
|
+
}
|
|
678
|
+
`,
|
|
679
|
+
};
|
|
680
|
+
},
|
|
681
|
+
};
|
|
682
|
+
```
|
|
683
|
+
|
|
684
|
+
</details>
|
|
685
|
+
|
|
686
|
+
<details>
|
|
687
|
+
<summary>Modifying theme using setPluginConfig [TS]</summary>
|
|
591
688
|
|
|
592
689
|
```ts
|
|
593
690
|
// src/admin/app.tsx
|
|
@@ -622,6 +719,36 @@ export default {
|
|
|
622
719
|
|
|
623
720
|
</details>
|
|
624
721
|
|
|
722
|
+
<details>
|
|
723
|
+
<summary>Modifying theme using getPluginTheme [TS]</summary>
|
|
724
|
+
|
|
725
|
+
```ts
|
|
726
|
+
// src/admin/app.tsx
|
|
727
|
+
|
|
728
|
+
import { css } from 'styled-components';
|
|
729
|
+
import { getPluginTheme } from '@_sh/strapi-plugin-ckeditor';
|
|
730
|
+
|
|
731
|
+
export default {
|
|
732
|
+
register() {
|
|
733
|
+
const theme = getPluginTheme();
|
|
734
|
+
|
|
735
|
+
theme.additional = css`
|
|
736
|
+
.ck {
|
|
737
|
+
--ck-editor-max-width: 1500px;
|
|
738
|
+
--ck-editor-min-height: 700px;
|
|
739
|
+
--ck-editor-max-height: 700px;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
.ck.ck-editor__main {
|
|
743
|
+
border: 3px dashed ${({ theme }) => theme.colors.warning500};
|
|
744
|
+
}
|
|
745
|
+
`;
|
|
746
|
+
},
|
|
747
|
+
};
|
|
748
|
+
```
|
|
749
|
+
|
|
750
|
+
</details>
|
|
751
|
+
|
|
625
752
|
<details>
|
|
626
753
|
<summary>Adding Timestamp plugin [JS]</summary>
|
|
627
754
|
|
|
@@ -673,10 +800,6 @@ export default {
|
|
|
673
800
|
|
|
674
801
|
> 📌 It is highly recommended to explore [**the official CKEditor5 documentation**](https://ckeditor.com/docs/ckeditor5/latest/getting-started/setup/configuration.html).
|
|
675
802
|
|
|
676
|
-
> 💡 To display content from external sources, such as images or videos, in your admin panel,
|
|
677
|
-
> you need to configure your `middlewares.js` file.
|
|
678
|
-
> [**Check the documentation for details.**](https://docs.strapi.io/dev-docs/configurations/middlewares#security)
|
|
679
|
-
|
|
680
803
|
## <a id="contributing"></a>🛠 Contributing
|
|
681
804
|
|
|
682
805
|
Feel free to [fork the repository](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo)
|
|
@@ -6,7 +6,8 @@ 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-re_mQliQ.mjs";
|
|
10
|
+
import "sanitize-html";
|
|
10
11
|
import { Collapse, Expand } from "@strapi/icons";
|
|
11
12
|
const STORAGE_KEYS = {
|
|
12
13
|
TOKEN: "jwtToken",
|
|
@@ -30,7 +30,8 @@ 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-lgM3BQrm.js");
|
|
34
|
+
require("sanitize-html");
|
|
34
35
|
const icons = require("@strapi/icons");
|
|
35
36
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
36
37
|
const React__default = /* @__PURE__ */ _interopDefault(React);
|
|
@@ -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 = "
|
|
31
|
+
const version = "6.0.0";
|
|
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",
|
|
@@ -95,7 +95,7 @@ const dependencies = {
|
|
|
95
95
|
"@ckeditor/ckeditor5-react": "~9.5.0",
|
|
96
96
|
"@strapi/design-system": "2.0.0-rc.18",
|
|
97
97
|
"@strapi/icons": "2.0.0-rc.18",
|
|
98
|
-
ckeditor5: "~
|
|
98
|
+
ckeditor5: "~45.0.0",
|
|
99
99
|
lodash: "4.17.21",
|
|
100
100
|
"sanitize-html": "2.13.0",
|
|
101
101
|
yup: "0.32.9"
|
|
@@ -845,7 +845,7 @@ const editorConfig$1 = {
|
|
|
845
845
|
"alignment",
|
|
846
846
|
{
|
|
847
847
|
label: "Indentation",
|
|
848
|
-
icon: ckeditor5.
|
|
848
|
+
icon: ckeditor5.IconIndent,
|
|
849
849
|
items: ["outdent", "indent"]
|
|
850
850
|
},
|
|
851
851
|
"bulletedList",
|
|
@@ -1191,20 +1191,16 @@ function setPluginConfig(userPluginConfig) {
|
|
|
1191
1191
|
if (userTheme) {
|
|
1192
1192
|
PLUGIN_CONFIG.theme = userTheme;
|
|
1193
1193
|
}
|
|
1194
|
-
|
|
1194
|
+
}
|
|
1195
|
+
function getPluginPresets() {
|
|
1196
|
+
return PLUGIN_CONFIG.presets;
|
|
1197
|
+
}
|
|
1198
|
+
function getPluginTheme() {
|
|
1199
|
+
return PLUGIN_CONFIG.presets;
|
|
1195
1200
|
}
|
|
1196
1201
|
function getPluginConfig() {
|
|
1197
|
-
if (!Object.isFrozen(PLUGIN_CONFIG)) deepFreeze(PLUGIN_CONFIG);
|
|
1198
1202
|
return PLUGIN_CONFIG;
|
|
1199
1203
|
}
|
|
1200
|
-
function deepFreeze(obj) {
|
|
1201
|
-
Object.keys(obj).forEach((p) => {
|
|
1202
|
-
if (typeof obj[p] === "object" && obj[p] !== null && !Object.isFrozen(obj[p])) {
|
|
1203
|
-
deepFreeze(obj[p]);
|
|
1204
|
-
}
|
|
1205
|
-
});
|
|
1206
|
-
return Object.freeze(obj);
|
|
1207
|
-
}
|
|
1208
1204
|
function CKEditorIcon() {
|
|
1209
1205
|
return /* @__PURE__ */ jsxRuntime.jsx(IconBox, { justifyContent: "center", alignItems: "center", width: 7, height: 6, hasRadius: true, "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx(SvgIcon, {}) });
|
|
1210
1206
|
}
|
|
@@ -1269,7 +1265,7 @@ const index = {
|
|
|
1269
1265
|
defaultMessage: "The advanced rich text editor. (Community Edition)"
|
|
1270
1266
|
},
|
|
1271
1267
|
components: {
|
|
1272
|
-
Input: async () => Promise.resolve().then(() => require("./Field-
|
|
1268
|
+
Input: async () => Promise.resolve().then(() => require("./Field-kyiYSdM-.js")).then((module2) => ({
|
|
1273
1269
|
default: module2.Field
|
|
1274
1270
|
}))
|
|
1275
1271
|
},
|
|
@@ -1343,6 +1339,8 @@ exports.clonedDefaultHtmlPreset = clonedDefaultHtmlPreset;
|
|
|
1343
1339
|
exports.clonedDefaultMarkdownPreset = clonedDefaultMarkdownPreset;
|
|
1344
1340
|
exports.clonedDefaultTheme = clonedDefaultTheme;
|
|
1345
1341
|
exports.getPluginConfig = getPluginConfig;
|
|
1342
|
+
exports.getPluginPresets = getPluginPresets;
|
|
1343
|
+
exports.getPluginTheme = getPluginTheme;
|
|
1346
1344
|
exports.index = index;
|
|
1347
1345
|
exports.isImageResponsive = isImageResponsive;
|
|
1348
1346
|
exports.prefixFileUrlWithBackendUrl = prefixFileUrlWithBackendUrl;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as yup from "yup";
|
|
2
2
|
import { css, styled } from "styled-components";
|
|
3
|
-
import { Plugin, ButtonView, FileRepository, logWarning, Alignment, Autoformat, AutoImage, BalloonToolbar, BlockQuote, Bold, Code, CodeBlock, Essentials, FontBackgroundColor, FontColor, FontFamily, FontSize, GeneralHtmlSupport, Heading, HorizontalLine, HtmlEmbed, Image, ImageCaption, ImageInsert, ImageResize, ImageStyle, ImageToolbar, ImageUpload, Indent, IndentBlock, Italic, List, ListProperties, Link, LinkImage, MediaEmbed, Paragraph, PageBreak, PasteFromOffice, PictureEditing, RemoveFormat, SourceEditing, SpecialCharacters, SpecialCharactersEssentials, Strikethrough, Style, Subscript, Superscript, ShowBlocks, Table, TableCaption, TableCellProperties, TableColumnResize, TableProperties, TableToolbar, TodoList, Underline, WordCount,
|
|
3
|
+
import { Plugin, ButtonView, FileRepository, logWarning, Alignment, Autoformat, AutoImage, BalloonToolbar, BlockQuote, Bold, Code, CodeBlock, Essentials, FontBackgroundColor, FontColor, FontFamily, FontSize, GeneralHtmlSupport, Heading, HorizontalLine, HtmlEmbed, Image, ImageCaption, ImageInsert, ImageResize, ImageStyle, ImageToolbar, ImageUpload, Indent, IndentBlock, Italic, List, ListProperties, Link, LinkImage, MediaEmbed, Paragraph, PageBreak, PasteFromOffice, PictureEditing, RemoveFormat, SourceEditing, SpecialCharacters, SpecialCharactersEssentials, Strikethrough, Style, Subscript, Superscript, ShowBlocks, Table, TableCaption, TableCellProperties, TableColumnResize, TableProperties, TableToolbar, TodoList, Underline, WordCount, IconIndent, Markdown, TextTransformation } from "ckeditor5";
|
|
4
4
|
import * as sanitizeHtml from "sanitize-html";
|
|
5
5
|
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 = "
|
|
9
|
+
const version = "6.0.0";
|
|
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",
|
|
@@ -73,7 +73,7 @@ const dependencies = {
|
|
|
73
73
|
"@ckeditor/ckeditor5-react": "~9.5.0",
|
|
74
74
|
"@strapi/design-system": "2.0.0-rc.18",
|
|
75
75
|
"@strapi/icons": "2.0.0-rc.18",
|
|
76
|
-
ckeditor5: "~
|
|
76
|
+
ckeditor5: "~45.0.0",
|
|
77
77
|
lodash: "4.17.21",
|
|
78
78
|
"sanitize-html": "2.13.0",
|
|
79
79
|
yup: "0.32.9"
|
|
@@ -823,7 +823,7 @@ const editorConfig$1 = {
|
|
|
823
823
|
"alignment",
|
|
824
824
|
{
|
|
825
825
|
label: "Indentation",
|
|
826
|
-
icon:
|
|
826
|
+
icon: IconIndent,
|
|
827
827
|
items: ["outdent", "indent"]
|
|
828
828
|
},
|
|
829
829
|
"bulletedList",
|
|
@@ -1169,20 +1169,16 @@ function setPluginConfig(userPluginConfig) {
|
|
|
1169
1169
|
if (userTheme) {
|
|
1170
1170
|
PLUGIN_CONFIG.theme = userTheme;
|
|
1171
1171
|
}
|
|
1172
|
-
|
|
1172
|
+
}
|
|
1173
|
+
function getPluginPresets() {
|
|
1174
|
+
return PLUGIN_CONFIG.presets;
|
|
1175
|
+
}
|
|
1176
|
+
function getPluginTheme() {
|
|
1177
|
+
return PLUGIN_CONFIG.presets;
|
|
1173
1178
|
}
|
|
1174
1179
|
function getPluginConfig() {
|
|
1175
|
-
if (!Object.isFrozen(PLUGIN_CONFIG)) deepFreeze(PLUGIN_CONFIG);
|
|
1176
1180
|
return PLUGIN_CONFIG;
|
|
1177
1181
|
}
|
|
1178
|
-
function deepFreeze(obj) {
|
|
1179
|
-
Object.keys(obj).forEach((p) => {
|
|
1180
|
-
if (typeof obj[p] === "object" && obj[p] !== null && !Object.isFrozen(obj[p])) {
|
|
1181
|
-
deepFreeze(obj[p]);
|
|
1182
|
-
}
|
|
1183
|
-
});
|
|
1184
|
-
return Object.freeze(obj);
|
|
1185
|
-
}
|
|
1186
1182
|
function CKEditorIcon() {
|
|
1187
1183
|
return /* @__PURE__ */ jsx(IconBox, { justifyContent: "center", alignItems: "center", width: 7, height: 6, hasRadius: true, "aria-hidden": true, children: /* @__PURE__ */ jsx(SvgIcon, {}) });
|
|
1188
1184
|
}
|
|
@@ -1247,7 +1243,7 @@ const index = {
|
|
|
1247
1243
|
defaultMessage: "The advanced rich text editor. (Community Edition)"
|
|
1248
1244
|
},
|
|
1249
1245
|
components: {
|
|
1250
|
-
Input: async () => import("./Field-
|
|
1246
|
+
Input: async () => import("./Field-g8gLpd2N.mjs").then((module) => ({
|
|
1251
1247
|
default: module.Field
|
|
1252
1248
|
}))
|
|
1253
1249
|
},
|
|
@@ -1321,8 +1317,10 @@ export {
|
|
|
1321
1317
|
clonedDefaultHtmlPreset as b,
|
|
1322
1318
|
clonedDefaultTheme as c,
|
|
1323
1319
|
clonedDefaultMarkdownPreset as d,
|
|
1324
|
-
|
|
1320
|
+
getPluginPresets as e,
|
|
1321
|
+
getPluginTheme as f,
|
|
1325
1322
|
getPluginConfig as g,
|
|
1323
|
+
StrapiUploadAdapter as h,
|
|
1326
1324
|
isImageResponsive as i,
|
|
1327
1325
|
prefixFileUrlWithBackendUrl as p,
|
|
1328
1326
|
setPluginConfig as s
|
package/dist/admin/index.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
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-lgM3BQrm.js");
|
|
5
5
|
require("ckeditor5");
|
|
6
|
+
require("sanitize-html");
|
|
6
7
|
exports.StrapiMediaLib = index.StrapiMediaLib;
|
|
7
8
|
exports.StrapiUploadAdapter = index.StrapiUploadAdapter;
|
|
8
9
|
exports.default = index.index;
|
|
9
10
|
exports.defaultHtmlPreset = index.clonedDefaultHtmlPreset;
|
|
10
11
|
exports.defaultMarkdownPreset = index.clonedDefaultMarkdownPreset;
|
|
11
12
|
exports.defaultTheme = index.clonedDefaultTheme;
|
|
13
|
+
exports.getPluginPresets = index.getPluginPresets;
|
|
14
|
+
exports.getPluginTheme = index.getPluginTheme;
|
|
12
15
|
exports.setPluginConfig = index.setPluginConfig;
|
package/dist/admin/index.mjs
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import "yup";
|
|
2
|
-
import { S,
|
|
2
|
+
import { S, h, a, b, d, c, e, f, s } from "../_chunks/index-re_mQliQ.mjs";
|
|
3
3
|
import "ckeditor5";
|
|
4
|
+
import "sanitize-html";
|
|
4
5
|
export {
|
|
5
6
|
S as StrapiMediaLib,
|
|
6
|
-
|
|
7
|
+
h as StrapiUploadAdapter,
|
|
7
8
|
a as default,
|
|
8
9
|
b as defaultHtmlPreset,
|
|
9
10
|
d as defaultMarkdownPreset,
|
|
10
11
|
c as defaultTheme,
|
|
12
|
+
e as getPluginPresets,
|
|
13
|
+
f as getPluginTheme,
|
|
11
14
|
s as setPluginConfig
|
|
12
15
|
};
|
|
@@ -1,22 +1,36 @@
|
|
|
1
|
-
import type { PluginConfig, UserPluginConfig } from './types';
|
|
1
|
+
import type { PluginConfig, UserPluginConfig, Preset, Theme } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Sets a configuration for the plugin.
|
|
4
4
|
*
|
|
5
5
|
* @remarks
|
|
6
6
|
*
|
|
7
|
-
* -
|
|
8
|
-
* The
|
|
7
|
+
* - Function must be invoked before the admin panel's bootstrap lifecycle function.
|
|
8
|
+
* The recommended way is to invoke it within the admin panel's register lifecycle function.
|
|
9
9
|
*
|
|
10
10
|
* - Provided properties will overwrite the default configuration values.
|
|
11
11
|
*
|
|
12
|
-
* -
|
|
13
|
-
* modifications.
|
|
14
|
-
*
|
|
15
|
-
* @param userConfig - The plugin configuration object.
|
|
12
|
+
* @param userConfig - Plugin configuration object.
|
|
16
13
|
*/
|
|
17
14
|
export declare function setPluginConfig(userPluginConfig: UserPluginConfig): void;
|
|
18
15
|
/**
|
|
19
|
-
*
|
|
16
|
+
* Returns the presets object.
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
*
|
|
20
|
+
* - Each property name must match the corresponding preset's name.
|
|
21
|
+
*
|
|
22
|
+
* - To extend or modify the options visible in the admin panel's content manager,
|
|
23
|
+
* changes must be made before the admin panel's bootstrap lifecycle function.
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
26
|
+
export declare function getPluginPresets(): Record<string, Preset>;
|
|
27
|
+
/**
|
|
28
|
+
* Returns the theme object.
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
export declare function getPluginTheme(): Theme;
|
|
32
|
+
/**
|
|
33
|
+
* Retrieves current plugin configuration.
|
|
20
34
|
*
|
|
21
35
|
* @internal
|
|
22
36
|
*/
|
|
@@ -120,4 +120,5 @@ export type Preset = {
|
|
|
120
120
|
*
|
|
121
121
|
* @see {@link https://ckeditor.com/docs/ckeditor5/latest/getting-started/setup/configuration.html | CKEditor documentation}
|
|
122
122
|
*/
|
|
123
|
-
export
|
|
123
|
+
export interface EditorConfig extends CKE5EditorConfig {
|
|
124
|
+
}
|
|
@@ -5,5 +5,5 @@ export { clonedDefaultTheme as defaultTheme };
|
|
|
5
5
|
export { clonedDefaultHtmlPreset as defaultHtmlPreset };
|
|
6
6
|
export { clonedDefaultMarkdownPreset as defaultMarkdownPreset };
|
|
7
7
|
export type { UserPluginConfig as PluginConfig, EditorConfig, Preset, Theme, EditorStyles, } from './config/types';
|
|
8
|
-
export { setPluginConfig } from './config';
|
|
8
|
+
export { setPluginConfig, getPluginPresets, getPluginTheme } from './config';
|
|
9
9
|
export { StrapiMediaLib, StrapiUploadAdapter } from './plugins';
|
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 = "
|
|
3
|
+
const version = "6.0.0";
|
|
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",
|
|
@@ -67,7 +67,7 @@ const dependencies = {
|
|
|
67
67
|
"@ckeditor/ckeditor5-react": "~9.5.0",
|
|
68
68
|
"@strapi/design-system": "2.0.0-rc.18",
|
|
69
69
|
"@strapi/icons": "2.0.0-rc.18",
|
|
70
|
-
ckeditor5: "~
|
|
70
|
+
ckeditor5: "~45.0.0",
|
|
71
71
|
lodash: "4.17.21",
|
|
72
72
|
"sanitize-html": "2.13.0",
|
|
73
73
|
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 = "
|
|
2
|
+
const version = "6.0.0";
|
|
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",
|
|
@@ -66,7 +66,7 @@ const dependencies = {
|
|
|
66
66
|
"@ckeditor/ckeditor5-react": "~9.5.0",
|
|
67
67
|
"@strapi/design-system": "2.0.0-rc.18",
|
|
68
68
|
"@strapi/icons": "2.0.0-rc.18",
|
|
69
|
-
ckeditor5: "~
|
|
69
|
+
ckeditor5: "~45.0.0",
|
|
70
70
|
lodash: "4.17.21",
|
|
71
71
|
"sanitize-html": "2.13.0",
|
|
72
72
|
yup: "0.32.9"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@_sh/strapi-plugin-ckeditor",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "Integrates CKEditor 5 into your Strapi project as a fully customizable custom field. (Community Edition)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"strapi",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"@ckeditor/ckeditor5-react": "~9.5.0",
|
|
68
68
|
"@strapi/design-system": "2.0.0-rc.18",
|
|
69
69
|
"@strapi/icons": "2.0.0-rc.18",
|
|
70
|
-
"ckeditor5": "~
|
|
70
|
+
"ckeditor5": "~45.0.0",
|
|
71
71
|
"lodash": "4.17.21",
|
|
72
72
|
"sanitize-html": "2.13.0",
|
|
73
73
|
"yup": "0.32.9"
|