@_sh/strapi-plugin-ckeditor 1.1.2 → 2.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 (122) hide show
  1. package/README.md +360 -863
  2. package/admin/src/components/CKEditorIcon.js +46 -0
  3. package/admin/src/components/Input/CKEditor/configs/base.js +628 -0
  4. package/admin/src/components/Input/CKEditor/configs/blockBaloon.js +25 -0
  5. package/admin/src/components/Input/CKEditor/configs/index.js +11 -0
  6. package/admin/src/components/Input/CKEditor/configs/toolbar.js +17 -0
  7. package/admin/src/components/Input/CKEditor/configs/toolbarBaloon.js +17 -0
  8. package/admin/src/components/Input/CKEditor/configuration.js +166 -0
  9. package/admin/src/components/Input/CKEditor/index.js +120 -0
  10. package/admin/src/components/Input/CKEditor/plugins/StrapiMediaLib.js +43 -0
  11. package/admin/src/components/Input/CKEditor/plugins/StrapiUploadAdapter.js +203 -0
  12. package/admin/src/components/Input/CKEditor/plugins/index.js +2 -0
  13. package/admin/src/components/Input/CKEditor/styling.js +16 -0
  14. package/admin/src/components/Input/CKEditor/theme/additional.js +167 -0
  15. package/admin/src/components/Input/CKEditor/theme/common.js +277 -0
  16. package/admin/src/components/Input/CKEditor/theme/dark.js +144 -0
  17. package/admin/src/components/Input/CKEditor/theme/index.js +13 -0
  18. package/admin/src/components/Input/CKEditor/theme/light.js +135 -0
  19. package/admin/src/components/Input/MediaLib/index.js +79 -0
  20. package/admin/src/components/Input/index.js +48 -0
  21. package/admin/src/index.js +110 -18
  22. package/admin/src/utils/getEditorConfig.js +37 -0
  23. package/admin/src/utils/pluginId.js +5 -0
  24. package/package.json +86 -50
  25. package/server/controllers/config.js +16 -14
  26. package/server/controllers/index.js +7 -7
  27. package/server/index.js +13 -25
  28. package/server/register.js +11 -5
  29. package/server/routes/index.js +15 -8
  30. package/server/services/config.js +11 -6
  31. package/server/services/index.js +7 -7
  32. package/strapi-admin.js +3 -3
  33. package/strapi-server.js +3 -3
  34. package/admin/src/components/CKEditor/build/ckeditor.js +0 -7
  35. package/admin/src/components/CKEditor/build/ckeditor.js.map +0 -1
  36. package/admin/src/components/CKEditor/build/translations/af.js +0 -1
  37. package/admin/src/components/CKEditor/build/translations/ar.js +0 -1
  38. package/admin/src/components/CKEditor/build/translations/ast.js +0 -1
  39. package/admin/src/components/CKEditor/build/translations/az.js +0 -1
  40. package/admin/src/components/CKEditor/build/translations/bg.js +0 -1
  41. package/admin/src/components/CKEditor/build/translations/bn.js +0 -1
  42. package/admin/src/components/CKEditor/build/translations/bs.js +0 -1
  43. package/admin/src/components/CKEditor/build/translations/ca.js +0 -1
  44. package/admin/src/components/CKEditor/build/translations/cs.js +0 -1
  45. package/admin/src/components/CKEditor/build/translations/da.js +0 -1
  46. package/admin/src/components/CKEditor/build/translations/de-ch.js +0 -1
  47. package/admin/src/components/CKEditor/build/translations/de.js +0 -1
  48. package/admin/src/components/CKEditor/build/translations/el.js +0 -1
  49. package/admin/src/components/CKEditor/build/translations/en-au.js +0 -1
  50. package/admin/src/components/CKEditor/build/translations/en-gb.js +0 -1
  51. package/admin/src/components/CKEditor/build/translations/eo.js +0 -1
  52. package/admin/src/components/CKEditor/build/translations/es.js +0 -1
  53. package/admin/src/components/CKEditor/build/translations/et.js +0 -1
  54. package/admin/src/components/CKEditor/build/translations/eu.js +0 -1
  55. package/admin/src/components/CKEditor/build/translations/fa.js +0 -1
  56. package/admin/src/components/CKEditor/build/translations/fi.js +0 -1
  57. package/admin/src/components/CKEditor/build/translations/fr.js +0 -1
  58. package/admin/src/components/CKEditor/build/translations/gl.js +0 -1
  59. package/admin/src/components/CKEditor/build/translations/gu.js +0 -1
  60. package/admin/src/components/CKEditor/build/translations/he.js +0 -1
  61. package/admin/src/components/CKEditor/build/translations/hi.js +0 -1
  62. package/admin/src/components/CKEditor/build/translations/hr.js +0 -1
  63. package/admin/src/components/CKEditor/build/translations/hu.js +0 -1
  64. package/admin/src/components/CKEditor/build/translations/id.js +0 -1
  65. package/admin/src/components/CKEditor/build/translations/it.js +0 -1
  66. package/admin/src/components/CKEditor/build/translations/ja.js +0 -1
  67. package/admin/src/components/CKEditor/build/translations/jv.js +0 -1
  68. package/admin/src/components/CKEditor/build/translations/kk.js +0 -1
  69. package/admin/src/components/CKEditor/build/translations/km.js +0 -1
  70. package/admin/src/components/CKEditor/build/translations/kn.js +0 -1
  71. package/admin/src/components/CKEditor/build/translations/ko.js +0 -1
  72. package/admin/src/components/CKEditor/build/translations/ku.js +0 -1
  73. package/admin/src/components/CKEditor/build/translations/lt.js +0 -1
  74. package/admin/src/components/CKEditor/build/translations/lv.js +0 -1
  75. package/admin/src/components/CKEditor/build/translations/ms.js +0 -1
  76. package/admin/src/components/CKEditor/build/translations/nb.js +0 -1
  77. package/admin/src/components/CKEditor/build/translations/ne.js +0 -1
  78. package/admin/src/components/CKEditor/build/translations/nl.js +0 -1
  79. package/admin/src/components/CKEditor/build/translations/no.js +0 -1
  80. package/admin/src/components/CKEditor/build/translations/oc.js +0 -1
  81. package/admin/src/components/CKEditor/build/translations/pl.js +0 -1
  82. package/admin/src/components/CKEditor/build/translations/pt-br.js +0 -1
  83. package/admin/src/components/CKEditor/build/translations/pt.js +0 -1
  84. package/admin/src/components/CKEditor/build/translations/ro.js +0 -1
  85. package/admin/src/components/CKEditor/build/translations/ru.js +0 -1
  86. package/admin/src/components/CKEditor/build/translations/si.js +0 -1
  87. package/admin/src/components/CKEditor/build/translations/sk.js +0 -1
  88. package/admin/src/components/CKEditor/build/translations/sl.js +0 -1
  89. package/admin/src/components/CKEditor/build/translations/sq.js +0 -1
  90. package/admin/src/components/CKEditor/build/translations/sr-latn.js +0 -1
  91. package/admin/src/components/CKEditor/build/translations/sr.js +0 -1
  92. package/admin/src/components/CKEditor/build/translations/sv.js +0 -1
  93. package/admin/src/components/CKEditor/build/translations/th.js +0 -1
  94. package/admin/src/components/CKEditor/build/translations/tk.js +0 -1
  95. package/admin/src/components/CKEditor/build/translations/tr.js +0 -1
  96. package/admin/src/components/CKEditor/build/translations/tt.js +0 -1
  97. package/admin/src/components/CKEditor/build/translations/ug.js +0 -1
  98. package/admin/src/components/CKEditor/build/translations/uk.js +0 -1
  99. package/admin/src/components/CKEditor/build/translations/ur.js +0 -1
  100. package/admin/src/components/CKEditor/build/translations/uz.js +0 -1
  101. package/admin/src/components/CKEditor/build/translations/vi.js +0 -1
  102. package/admin/src/components/CKEditor/build/translations/zh-cn.js +0 -1
  103. package/admin/src/components/CKEditor/build/translations/zh.js +0 -1
  104. package/admin/src/components/CKEditor/index.js +0 -194
  105. package/admin/src/components/CKEditor/styles.js +0 -511
  106. package/admin/src/components/CKEditor/theme.js +0 -313
  107. package/admin/src/components/Initializer/index.js +0 -26
  108. package/admin/src/components/MediaLib/index.js +0 -44
  109. package/admin/src/components/Wysiwyg/index.js +0 -77
  110. package/admin/src/pages/App/index.js +0 -25
  111. package/admin/src/pages/HomePage/index.js +0 -20
  112. package/admin/src/pluginId.js +0 -6
  113. package/admin/src/translations/en.json +0 -1
  114. package/admin/src/translations/fr.json +0 -1
  115. package/admin/src/utils/axiosInstance.js +0 -40
  116. package/admin/src/utils/getTrad.js +0 -5
  117. package/server/bootstrap.js +0 -5
  118. package/server/config/index.js +0 -6
  119. package/server/content-types/index.js +0 -3
  120. package/server/destroy.js +0 -5
  121. package/server/middlewares/index.js +0 -3
  122. package/server/policies/index.js +0 -3
@@ -0,0 +1,46 @@
1
+ import * as React from "react";
2
+ import styled from "styled-components";
3
+ import { Icon } from "@strapi/design-system/Icon";
4
+ import { Flex } from "@strapi/design-system/Flex";
5
+
6
+ const IconBox = styled(Flex)`
7
+ background-color: #f0f0ff; /* primary100 */
8
+ border: 1px solid #d9d8ff; /* primary200 */
9
+ svg > path {
10
+ fill: #4945ff; /* primary600 */
11
+ }
12
+ `;
13
+
14
+ const SvgIcon = () => (
15
+ <svg
16
+ width="68"
17
+ height="64"
18
+ viewBox="-20 -14 98 94"
19
+ xmlns="http://www.w3.org/2000/svg"
20
+ >
21
+ <g fill="none" fill-rule="evenodd">
22
+ <path
23
+ d="M43.71 11.025a11.508 11.508 0 0 0-1.213 5.159c0 6.42 5.244 11.625 11.713 11.625.083 0 .167 0 .25-.002v16.282a5.464 5.464 0 0 1-2.756 4.739L30.986 60.7a5.548 5.548 0 0 1-5.512 0L4.756 48.828A5.464 5.464 0 0 1 2 44.089V20.344c0-1.955 1.05-3.76 2.756-4.738L25.474 3.733a5.548 5.548 0 0 1 5.512 0l12.724 7.292z"
24
+ fill="#FFF"
25
+ />
26
+ <path
27
+ d="M45.684 8.79a12.604 12.604 0 0 0-1.329 5.65c0 7.032 5.744 12.733 12.829 12.733.091 0 .183-.001.274-.003v17.834a5.987 5.987 0 0 1-3.019 5.19L31.747 63.196a6.076 6.076 0 0 1-6.037 0L3.02 50.193A5.984 5.984 0 0 1 0 45.003V18.997c0-2.14 1.15-4.119 3.019-5.19L25.71.804a6.076 6.076 0 0 1 6.037 0L45.684 8.79zm-29.44 11.89c-.834 0-1.51.671-1.51 1.498v.715c0 .828.676 1.498 1.51 1.498h25.489c.833 0 1.51-.67 1.51-1.498v-.715c0-.827-.677-1.498-1.51-1.498h-25.49.001zm0 9.227c-.834 0-1.51.671-1.51 1.498v.715c0 .828.676 1.498 1.51 1.498h18.479c.833 0 1.509-.67 1.509-1.498v-.715c0-.827-.676-1.498-1.51-1.498H16.244zm0 9.227c-.834 0-1.51.671-1.51 1.498v.715c0 .828.676 1.498 1.51 1.498h25.489c.833 0 1.51-.67 1.51-1.498v-.715c0-.827-.677-1.498-1.51-1.498h-25.49.001zm41.191-14.459c-5.835 0-10.565-4.695-10.565-10.486 0-5.792 4.73-10.487 10.565-10.487C63.27 3.703 68 8.398 68 14.19c0 5.791-4.73 10.486-10.565 10.486v-.001z"
28
+ fill="#1EBC61"
29
+ fill-rule="nonzero"
30
+ />
31
+ <path
32
+ d="M60.857 15.995c0-.467-.084-.875-.251-1.225a2.547 2.547 0 0 0-.686-.88 2.888 2.888 0 0 0-1.026-.531 4.418 4.418 0 0 0-1.259-.175c-.134 0-.283.006-.447.018-.15.01-.3.034-.446.07l.075-1.4h3.587v-1.8h-5.462l-.214 5.06c.319-.116.682-.21 1.089-.28.406-.071.77-.107 1.088-.107.218 0 .437.021.655.063.218.041.413.114.585.218s.313.244.422.419c.109.175.163.391.163.65 0 .424-.132.745-.396.961a1.434 1.434 0 0 1-.938.325c-.352 0-.656-.1-.912-.3-.256-.2-.43-.453-.523-.762l-1.925.588c.1.35.258.664.472.943.214.279.47.514.767.706.298.191.63.339.995.443.365.104.749.156 1.151.156.437 0 .86-.064 1.272-.193.41-.13.778-.323 1.1-.581a2.8 2.8 0 0 0 .775-.981c.193-.396.29-.864.29-1.405h-.001z"
33
+ fill="#FFF"
34
+ fill-rule="nonzero"
35
+ />
36
+ </g>
37
+ </svg>
38
+ );
39
+
40
+ const CKEditorIcon = () => (
41
+ <IconBox justifyContent="center" alignItems="center" width={7} height={6} hasRadius aria-hidden>
42
+ <Icon as={SvgIcon} />
43
+ </IconBox>
44
+ )
45
+
46
+ export default CKEditorIcon;
@@ -0,0 +1,628 @@
1
+ import ckeditor5Dll from "ckeditor5/build/ckeditor5-dll.js";
2
+ import ckeditor5AlignmentDll from "@ckeditor/ckeditor5-alignment/build/alignment.js";
3
+ import ckeditor5AutoformatDll from "@ckeditor/ckeditor5-autoformat/build/autoformat.js";
4
+ import ckeditor5AutosaveDll from "@ckeditor/ckeditor5-autosave/build/autosave.js";
5
+ import ckeditor5BasicStylesDll from "@ckeditor/ckeditor5-basic-styles/build/basic-styles.js";
6
+ import ckeditor5BlockQuoteDll from "@ckeditor/ckeditor5-block-quote/build/block-quote.js";
7
+ import ckeditor5CodeBlockDll from "@ckeditor/ckeditor5-code-block/build/code-block.js";
8
+ import ckeditor5EssentialsDll from "@ckeditor/ckeditor5-essentials/build/essentials.js";
9
+ import ckeditor5HeadingDll from "@ckeditor/ckeditor5-heading/build/heading.js";
10
+ import ckeditor5HtmlEmbedDll from "@ckeditor/ckeditor5-html-embed/build/html-embed.js";
11
+ import ckeditor5HtmlSupportDll from "@ckeditor/ckeditor5-html-support/build/html-support.js";
12
+ import ckeditor5HorizontalLineDll from "@ckeditor/ckeditor5-horizontal-line/build/horizontal-line.js";
13
+ import ckeditor5MediaEmbedDll from "@ckeditor/ckeditor5-media-embed/build/media-embed.js";
14
+ import ckeditor5ImageDll from "@ckeditor/ckeditor5-image/build/image.js";
15
+ import ckeditor5IndentDll from "@ckeditor/ckeditor5-indent/build/indent.js";
16
+ import ckeditor5LinkDll from "@ckeditor/ckeditor5-link/build/link.js";
17
+ import ckeditor5ListDll from "@ckeditor/ckeditor5-list/build/list.js";
18
+ import ckeditor5PasteFromOfficeDll from "@ckeditor/ckeditor5-paste-from-office/build/paste-from-office.js";
19
+ import ckeditor5RemoveFormatDll from "@ckeditor/ckeditor5-remove-format/build/remove-format.js";
20
+ import ckeditor5TableDll from "@ckeditor/ckeditor5-table/build/table.js";
21
+ import ckeditor5WordCountDll from "@ckeditor/ckeditor5-word-count/build/word-count.js";
22
+ import ckeditor5FindAndReplaceDll from "@ckeditor/ckeditor5-find-and-replace/build/find-and-replace.js";
23
+ import ckeditor5SpecialCharactersDll from "@ckeditor/ckeditor5-special-characters/build/special-characters.js";
24
+ import ckeditor5PageBreakDll from "@ckeditor/ckeditor5-page-break/build/page-break.js";
25
+ import ckeditor5SourceEditingDll from "@ckeditor/ckeditor5-source-editing/build/source-editing.js";
26
+ import ckeditor5LanguageDll from "@ckeditor/ckeditor5-language/build/language.js";
27
+ import ckeditor5HighlightDll from "@ckeditor/ckeditor5-highlight/build/highlight.js";
28
+ import ckeditor5StyleDll from "@ckeditor/ckeditor5-style/build/style.js";
29
+ import ckeditor5MentionDll from "@ckeditor/ckeditor5-mention/build/mention.js";
30
+ import ckeditor5FontWithPickerDll from "@_sh/ckeditor5-font-with-picker/build/font-with-picker.js";
31
+
32
+ import sanitizeHtml from "sanitize-html";
33
+
34
+ import * as strapiPlugins from '../plugins'
35
+ window.CKEditor5.strapiPlugins = strapiPlugins;
36
+
37
+ const w = {
38
+ Alignment: window.CKEditor5.alignment.Alignment,
39
+ Autoformat: window.CKEditor5.autoformat.Autoformat,
40
+ AutoImage: window.CKEditor5.image.AutoImage,
41
+ AutoLink: window.CKEditor5.link.AutoLink,
42
+ Autosave: window.CKEditor5.autosave.Autosave,
43
+ BalloonToolbar: window.CKEditor5.ui.BalloonToolbar,
44
+ BlockQuote: window.CKEditor5.blockQuote.BlockQuote,
45
+ BlockToolbar: window.CKEditor5.ui.BlockToolbar,
46
+ Bold: window.CKEditor5.basicStyles.Bold,
47
+ Code: window.CKEditor5.basicStyles.Code,
48
+ CodeBlock: window.CKEditor5.codeBlock.CodeBlock,
49
+ DataFilter: window.CKEditor5.htmlSupport.DataFilter,
50
+ DataSchema: window.CKEditor5.htmlSupport.DataSchema,
51
+ DocumentList: window.CKEditor5.list.DocumentList,
52
+ DocumentListProperties: window.CKEditor5.list.DocumentListProperties,
53
+ Essentials: window.CKEditor5.essentials.Essentials,
54
+ FindAndReplace: window.CKEditor5.findAndReplace.FindAndReplace,
55
+ FontBackgroundColor: window.CKEditor5.fontWithPicker.FontBackgroundColor,
56
+ FontColor: window.CKEditor5.fontWithPicker.FontColor,
57
+ FontFamily: window.CKEditor5.fontWithPicker.FontFamily,
58
+ FontSize: window.CKEditor5.fontWithPicker.FontSize,
59
+ GeneralHtmlSupport: window.CKEditor5.htmlSupport.GeneralHtmlSupport,
60
+ Heading: window.CKEditor5.heading.Heading,
61
+ // HeadingButtonsUI: window.CKEditor5.heading.HeadingButtonsUI,
62
+ Highlight: window.CKEditor5.highlight.Highlight,
63
+ HorizontalLine: window.CKEditor5.horizontalLine.HorizontalLine,
64
+ HtmlComment: window.CKEditor5.htmlSupport.HtmlComment,
65
+ HtmlEmbed: window.CKEditor5.htmlEmbed.HtmlEmbed,
66
+ Image: window.CKEditor5.image.Image,
67
+ ImageCaption: window.CKEditor5.image.ImageCaption,
68
+ ImageInsert: window.CKEditor5.image.ImageInsert,
69
+ ImageResize: window.CKEditor5.image.ImageResize,
70
+ ImageStyle: window.CKEditor5.image.ImageStyle,
71
+ ImageToolbar: window.CKEditor5.image.ImageToolbar,
72
+ ImageUpload: window.CKEditor5.image.ImageUpload,
73
+ Indent: window.CKEditor5.indent.Indent,
74
+ IndentBlock: window.CKEditor5.indent.IndentBlock,
75
+ Italic: window.CKEditor5.basicStyles.Italic,
76
+ Link: window.CKEditor5.link.Link,
77
+ LinkImage: window.CKEditor5.link.LinkImage,
78
+ List: window.CKEditor5.list.List,
79
+ ListProperties: window.CKEditor5.list.ListProperties,
80
+ MediaEmbed: window.CKEditor5.mediaEmbed.MediaEmbed,
81
+ MediaEmbedToolbar: window.CKEditor5.mediaEmbed.MediaEmbedToolbar,
82
+ Mention: window.CKEditor5.mention.Mention,
83
+ PageBreak: window.CKEditor5.pageBreak.PageBreak,
84
+ Paragraph: window.CKEditor5.paragraph.Paragraph,
85
+ // ParagraphButtonUI: window.CKEditor5.paragraph.ParagraphButtonUI,
86
+ PasteFromOffice: window.CKEditor5.pasteFromOffice.PasteFromOffice,
87
+ RemoveFormat: window.CKEditor5.removeFormat.RemoveFormat,
88
+ SourceEditing: window.CKEditor5.sourceEditing.SourceEditing,
89
+ SpecialCharacters: window.CKEditor5.specialCharacters.SpecialCharacters,
90
+ SpecialCharactersArrows: window.CKEditor5.specialCharacters.SpecialCharactersArrows,
91
+ SpecialCharactersCurrency: window.CKEditor5.specialCharacters.SpecialCharactersCurrency,
92
+ // SpecialCharactersEssentials: window.CKEditor5.specialCharacters.SpecialCharactersEssentials,
93
+ SpecialCharactersLatin: window.CKEditor5.specialCharacters.SpecialCharactersLatin,
94
+ SpecialCharactersMathematical: window.CKEditor5.specialCharacters.SpecialCharactersMathematical,
95
+ SpecialCharactersText: window.CKEditor5.specialCharacters.SpecialCharactersText,
96
+ StrapiMediaLib: window.CKEditor5.strapiPlugins.StrapiMediaLib,
97
+ StrapiUploadAdapter: window.CKEditor5.strapiPlugins.StrapiUploadAdapter,
98
+ Strikethrough: window.CKEditor5.basicStyles.Strikethrough,
99
+ Style: window.CKEditor5.style.Style,
100
+ Subscript: window.CKEditor5.basicStyles.Subscript,
101
+ Superscript: window.CKEditor5.basicStyles.Superscript,
102
+ Table: window.CKEditor5.table.Table,
103
+ TableCaption: window.CKEditor5.table.TableCaption,
104
+ TableCellProperties: window.CKEditor5.table.TableCellProperties,
105
+ TableColumnResize: window.CKEditor5.table.TableColumnResize,
106
+ TableProperties: window.CKEditor5.table.TableProperties,
107
+ TableToolbar: window.CKEditor5.table.TableToolbar,
108
+ TextPartLanguage: window.CKEditor5.language.TextPartLanguage,
109
+ TodoList: window.CKEditor5.list.TodoList,
110
+ Underline: window.CKEditor5.basicStyles.Underline,
111
+ WordCount: window.CKEditor5.wordCount.WordCount
112
+ }
113
+
114
+ const REDUCED_MATERIAL_COLORS = [
115
+ { label: "Red 50", color: "#ffebee" },
116
+ { label: "Purple 50", color: "#f3e5f5" },
117
+ { label: "Indigo 50", color: "#e8eaf6" },
118
+ { label: "Blue 50", color: "#e3f2fd" },
119
+ { label: "Cyan 50", color: "#e0f7fa" },
120
+ { label: "Teal 50", color: "#e0f2f1" },
121
+ { label: "Light green 50", color: "#f1f8e9" },
122
+ { label: "Lime 50", color: "#f9fbe7" },
123
+ { label: "Amber 50", color: "#fff8e1" },
124
+ { label: "Orange 50", color: "#fff3e0" },
125
+ { label: "Grey 50", color: "#fafafa" },
126
+ { label: "Blue grey 50", color: "#eceff1" },
127
+ { label: "Red 100", color: "#ffcdd2" },
128
+ { label: "Purple 100", color: "#e1bee7" },
129
+ { label: "Indigo 100", color: "#c5cae9" },
130
+ { label: "Blue 100", color: "#bbdefb" },
131
+ { label: "Cyan 100", color: "#b2ebf2" },
132
+ { label: "Teal 100", color: "#b2dfdb" },
133
+ { label: "Light green 100", color: "#dcedc8" },
134
+ { label: "Lime 100", color: "#f0f4c3" },
135
+ { label: "Amber 100", color: "#ffecb3" },
136
+ { label: "Orange 100", color: "#ffe0b2" },
137
+ { label: "Grey 100", color: "#f5f5f5" },
138
+ { label: "Blue grey 100", color: "#cfd8dc" },
139
+ { label: "Red 200", color: "#ef9a9a" },
140
+ { label: "Purple 200", color: "#ce93d8" },
141
+ { label: "Indigo 200", color: "#9fa8da" },
142
+ { label: "Blue 200", color: "#90caf9" },
143
+ { label: "Cyan 200", color: "#80deea" },
144
+ { label: "Teal 200", color: "#80cbc4" },
145
+ { label: "Light green 200", color: "#c5e1a5" },
146
+ { label: "Lime 200", color: "#e6ee9c" },
147
+ { label: "Amber 200", color: "#ffe082" },
148
+ { label: "Orange 200", color: "#ffcc80" },
149
+ { label: "Grey 200", color: "#eeeeee" },
150
+ { label: "Blue grey 200", color: "#b0bec5" },
151
+ { label: "Red 300", color: "#e57373" },
152
+ { label: "Purple 300", color: "#ba68c8" },
153
+ { label: "Indigo 300", color: "#7986cb" },
154
+ { label: "Blue 300", color: "#64b5f6" },
155
+ { label: "Cyan 300", color: "#4dd0e1" },
156
+ { label: "Teal 300", color: "#4db6ac" },
157
+ { label: "Light green 300", color: "#aed581" },
158
+ { label: "Lime 300", color: "#dce775" },
159
+ { label: "Amber 300", color: "#ffd54f" },
160
+ { label: "Orange 300", color: "#ffb74d" },
161
+ { label: "Grey 300", color: "#e0e0e0" },
162
+ { label: "Blue grey 300", color: "#90a4ae" },
163
+ { label: "Red 400", color: "#ef5350" },
164
+ { label: "Purple 400", color: "#ab47bc" },
165
+ { label: "Indigo 400", color: "#5c6bc0" },
166
+ { label: "Blue 400", color: "#42a5f5" },
167
+ { label: "Cyan 400", color: "#26c6da" },
168
+ { label: "Teal 400", color: "#26a69a" },
169
+ { label: "Light green 400", color: "#9ccc65" },
170
+ { label: "Lime 400", color: "#d4e157" },
171
+ { label: "Amber 400", color: "#ffca28" },
172
+ { label: "Orange 400", color: "#ffa726" },
173
+ { label: "Grey 400", color: "#bdbdbd" },
174
+ { label: "Blue grey 400", color: "#78909c" },
175
+ { label: "Red 500", color: "#f44336" },
176
+ { label: "Purple 500", color: "#9c27b0" },
177
+ { label: "Indigo 500", color: "#3f51b5" },
178
+ { label: "Blue 500", color: "#2196f3" },
179
+ { label: "Cyan 500", color: "#00bcd4" },
180
+ { label: "Teal 500", color: "#009688" },
181
+ { label: "Light green 500", color: "#8bc34a" },
182
+ { label: "Lime 500", color: "#cddc39" },
183
+ { label: "Amber 500", color: "#ffc107" },
184
+ { label: "Orange 500", color: "#ff9800" },
185
+ { label: "Grey 500", color: "#9e9e9e" },
186
+ { label: "Blue grey 500", color: "#607d8b" },
187
+ { label: "Red 600", color: "#e53935" },
188
+ { label: "Purple 600", color: "#8e24aa" },
189
+ { label: "Indigo 600", color: "#3949ab" },
190
+ { label: "Blue 600", color: "#1e88e5" },
191
+ { label: "Cyan 600", color: "#00acc1" },
192
+ { label: "Teal 600", color: "#00897b" },
193
+ { label: "Light green 600", color: "#7cb342" },
194
+ { label: "Lime 600", color: "#c0ca33" },
195
+ { label: "Amber 600", color: "#ffb300" },
196
+ { label: "Orange 600", color: "#fb8c00" },
197
+ { label: "Grey 600", color: "#757575" },
198
+ { label: "Blue grey 600", color: "#546e7a" },
199
+ { label: "Red 700", color: "#d32f2f" },
200
+ { label: "Purple 700", color: "#7b1fa2" },
201
+ { label: "Indigo 700", color: "#303f9f" },
202
+ { label: "Blue 700", color: "#1976d2" },
203
+ { label: "Cyan 700", color: "#0097a7" },
204
+ { label: "Teal 700", color: "#00796b" },
205
+ { label: "Light green 700", color: "#689f38" },
206
+ { label: "Lime 700", color: "#afb42b" },
207
+ { label: "Amber 700", color: "#ffa000" },
208
+ { label: "Orange 700", color: "#f57c00" },
209
+ { label: "Grey 700", color: "#616161" },
210
+ { label: "Blue grey 700", color: "#455a64" },
211
+ { label: "Red 800", color: "#c62828" },
212
+ { label: "Purple 800", color: "#6a1b9a" },
213
+ { label: "Indigo 800", color: "#283593" },
214
+ { label: "Blue 800", color: "#1565c0" },
215
+ { label: "Cyan 800", color: "#00838f" },
216
+ { label: "Teal 800", color: "#00695c" },
217
+ { label: "Light green 800", color: "#558b2f" },
218
+ { label: "Lime 800", color: "#9e9d24" },
219
+ { label: "Amber 800", color: "#ff8f00" },
220
+ { label: "Orange 800", color: "#ef6c00" },
221
+ { label: "Grey 800", color: "#424242" },
222
+ { label: "Blue grey 800", color: "#37474f" },
223
+ { label: "Red 900", color: "#b71c1c" },
224
+ { label: "Purple 900", color: "#4a148c" },
225
+ { label: "Indigo 900", color: "#1a237e" },
226
+ { label: "Blue 900", color: "#0d47a1" },
227
+ { label: "Cyan 900", color: "#006064" },
228
+ { label: "Teal 900", color: "#004d40" },
229
+ { label: "Light green 900", color: "#33691e" },
230
+ { label: "Lime 900", color: "#827717" },
231
+ { label: "Amber 900", color: "#ff6f00" },
232
+ { label: "Orange 900", color: "#e65100" },
233
+ { label: "Grey 900", color: "#212121" },
234
+ { label: "Blue grey 900", color: "#263238" },
235
+ ];
236
+
237
+ const base = {
238
+ fontFamily: {
239
+ supportAllValues: true,
240
+ },
241
+ fontSize: {
242
+ options: [10, 12, 14, "default", 18, 20, 22],
243
+ supportAllValues: true,
244
+ },
245
+ fontColor: {
246
+ columns: 12,
247
+ documentColors: 12,
248
+ colors: REDUCED_MATERIAL_COLORS,
249
+ },
250
+ fontBackgroundColor: {
251
+ columns: 12,
252
+ documentColors: 12,
253
+ colors: REDUCED_MATERIAL_COLORS,
254
+ },
255
+ heading: {
256
+ options: [
257
+ { model: "paragraph", title: "Paragraph", class: "ck-heading_paragraph" },
258
+ { model: "heading1", view: "h1", title: "Heading 1", class: "ck-heading_heading1" },
259
+ { model: "heading2", view: "h2", title: "Heading 2", class: "ck-heading_heading2" },
260
+ { model: "heading3", view: "h3", title: "Heading 3", class: "ck-heading_heading3" },
261
+ { model: "heading4", view: "h4", title: "Heading 4", class: "ck-heading_heading4" },
262
+ { model: "heading5", view: "h5", title: "Heading 5", class: "ck-heading_heading5" },
263
+ { model: "heading6", view: "h6", title: "Heading 6", class: "ck-heading_heading6" },
264
+ ],
265
+ },
266
+ htmlSupport: {
267
+ allow: [
268
+ {
269
+ name: /.*/,
270
+ attributes: true,
271
+ classes: true,
272
+ styles: true,
273
+ },
274
+ ],
275
+ disallow: [
276
+ {
277
+ attributes: [
278
+ { key: /^on(.*)/i, value: true },
279
+ { key: /.*/, value: /(\b)(on\S+)(\s*)=|javascript:|(<\s*)(\/*)script/i },
280
+ { key: /.*/, value: /data:(?!image\/(png|jpeg|gif|webp))/i },
281
+ ],
282
+ },
283
+ { name: "script" },
284
+ ],
285
+ },
286
+ htmlEmbed: {
287
+ showPreviews: true,
288
+ sanitizeHtml: (inputHtml) => {
289
+ const outputHtml = sanitizeHtml(inputHtml);
290
+ return {
291
+ html: outputHtml,
292
+ hasChanged: true,
293
+ };
294
+ },
295
+ },
296
+ list: {
297
+ properties: {
298
+ styles: true,
299
+ startIndex: true,
300
+ reversed: true,
301
+ },
302
+ },
303
+ table: {
304
+ contentToolbar: [
305
+ "tableColumn",
306
+ "tableRow",
307
+ "mergeTableCells",
308
+ "tableProperties",
309
+ "tableCellProperties",
310
+ "toggleTableCaption",
311
+ ],
312
+ },
313
+ image: {
314
+ styles: {
315
+ options: [
316
+ 'inline', 'alignLeft', 'alignRight',
317
+ 'alignCenter', 'alignBlockLeft', 'alignBlockRight',
318
+ 'block', 'side'
319
+ ]
320
+ },
321
+ resizeOptions: [
322
+ {
323
+ name: "resizeImage:original",
324
+ label: "Default image width",
325
+ value: null,
326
+ },
327
+ {
328
+ name: "resizeImage:50",
329
+ label: "50% page width",
330
+ value: "50",
331
+ },
332
+ {
333
+ name: "resizeImage:75",
334
+ label: "75% page width",
335
+ value: "75",
336
+ },
337
+ ],
338
+ toolbar: [
339
+ "imageTextAlternative",
340
+ "toggleImageCaption",
341
+ "linkImage",
342
+ "|",
343
+ "imageStyle:inline",
344
+ "imageStyle:wrapText",
345
+ "imageStyle:breakText",
346
+ "imageStyle:side",
347
+ "|",
348
+ "resizeImage",
349
+ ],
350
+ insert: {
351
+ integrations: ["insertImageViaUrl"],
352
+ },
353
+ },
354
+ link: {
355
+ decorators: {
356
+ openInNewTab: {
357
+ mode: "manual",
358
+ label: "Open in a new tab",
359
+ defaultValue: true,
360
+ attributes: {
361
+ target: "_blank",
362
+ rel: "noopener noreferrer",
363
+ },
364
+ },
365
+ toggleDownloadable: {
366
+ mode: "manual",
367
+ label: "Downloadable",
368
+ attributes: {
369
+ download: "file",
370
+ },
371
+ },
372
+ },
373
+ addTargetToExternalLinks: true,
374
+ defaultProtocol: "https://",
375
+ },
376
+ style: {
377
+ definitions: [
378
+ {
379
+ name: "Title",
380
+ element: "h1",
381
+ classes: ["document-title"],
382
+ },
383
+ {
384
+ name: "Subtitle",
385
+ element: "h2",
386
+ classes: ["document-subtitle"],
387
+ },
388
+ {
389
+ name: "Callout",
390
+ element: "p",
391
+ classes: ["callout"],
392
+ },
393
+ {
394
+ name: "Side quote",
395
+ element: "blockquote",
396
+ classes: ["side-quote"],
397
+ },
398
+ {
399
+ name: "Needs clarification",
400
+ element: "span",
401
+ classes: ["needs-clarification"],
402
+ },
403
+ {
404
+ name: "Wide spacing",
405
+ element: "span",
406
+ classes: ["wide-spacing"],
407
+ },
408
+ {
409
+ name: "Small caps",
410
+ element: "span",
411
+ classes: ["small-caps"],
412
+ },
413
+ {
414
+ name: "Code (dark)",
415
+ element: "pre",
416
+ classes: ["stylish-code", "stylish-code-dark"],
417
+ },
418
+ {
419
+ name: "Code (bright)",
420
+ element: "pre",
421
+ classes: ["stylish-code", "stylish-code-bright"],
422
+ },
423
+ ],
424
+ },
425
+ };
426
+
427
+
428
+
429
+ const basePlugins = [
430
+ w.Alignment,
431
+ w.Autoformat,
432
+ w.AutoImage,
433
+ w.BlockQuote,
434
+ w.Bold,
435
+ w.Code,
436
+ w.CodeBlock,
437
+ w.DocumentList,
438
+ w.DocumentListProperties,
439
+ w.Essentials,
440
+ w.FontBackgroundColor,
441
+ w.FontColor,
442
+ w.FontFamily,
443
+ w.FontSize,
444
+ w.GeneralHtmlSupport,
445
+ w.Heading,
446
+ w.HorizontalLine,
447
+ w.HtmlEmbed,
448
+ w.Image,
449
+ w.ImageCaption,
450
+ w.ImageInsert,
451
+ w.ImageResize,
452
+ w.ImageStyle,
453
+ w.ImageToolbar,
454
+ w.ImageUpload,
455
+ w.Indent,
456
+ w.IndentBlock,
457
+ w.Italic,
458
+ w.Link,
459
+ w.LinkImage,
460
+ w.LinkImage,
461
+ w.MediaEmbed,
462
+ w.PageBreak,
463
+ w.Paragraph,
464
+ w.PasteFromOffice,
465
+ w.RemoveFormat,
466
+ w.SourceEditing,
467
+ w.SpecialCharacters,
468
+ w.SpecialCharactersArrows,
469
+ w.SpecialCharactersCurrency,
470
+ w.SpecialCharactersLatin,
471
+ w.SpecialCharactersMathematical,
472
+ w.SpecialCharactersText,
473
+ w.StrapiMediaLib,
474
+ w.StrapiUploadAdapter,
475
+ w.Strikethrough,
476
+ w.Style,
477
+ w.Subscript,
478
+ w.Superscript,
479
+ w.Table,
480
+ w.TableCaption,
481
+ w.TableCellProperties,
482
+ w.TableColumnResize,
483
+ w.TableProperties,
484
+ w.TableToolbar,
485
+ w.Underline,
486
+ w.WordCount,
487
+ ];
488
+
489
+ export const toolbarEditorConfig = {
490
+ plugins:basePlugins,
491
+ ...base,
492
+ toolbar: [
493
+ {
494
+ label:' ',
495
+ tooltip: null,
496
+ icon:'paragraph',
497
+ items: [ 'heading','style','SourceEditing']
498
+ },
499
+ '|',
500
+ {
501
+ label:' ',
502
+ tooltip: null,
503
+ icon:'text',
504
+ items: [ 'bold', 'italic','fontSize', 'fontFamily', 'fontColor', 'fontBackgroundColor' ]
505
+ },
506
+ {
507
+ label:' ',
508
+ tooltip: null,
509
+ icon:`
510
+ <svg width="800px" height="800px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
511
+ <rect x="0" fill="none" width="24" height="24"/>
512
+ <g>
513
+ <path d="M14.348 12H21v2h-4.613c.24.515.368 1.094.368 1.748 0 1.317-.474 2.355-1.423 3.114-.947.76-2.266 1.138-3.956 1.138-1.557 0-2.934-.293-4.132-.878v-2.874c.985.44 1.818.75 2.5.928.682.18 1.306.27 1.872.27.68 0 1.2-.13 1.562-.39.363-.26.545-.644.545-1.158 0-.285-.08-.54-.24-.763-.16-.222-.394-.437-.704-.643-.18-.12-.483-.287-.88-.49H3v-2H14.347zm-3.528-2c-.073-.077-.143-.155-.193-.235-.126-.202-.19-.44-.19-.713 0-.44.157-.795.47-1.068.313-.273.762-.41 1.348-.41.492 0 .993.064 1.502.19.51.127 1.153.35 1.93.67l1-2.405c-.753-.327-1.473-.58-2.16-.76-.69-.18-1.414-.27-2.173-.27-1.544 0-2.753.37-3.628 1.108-.874.738-1.312 1.753-1.312 3.044 0 .302.036.58.088.848h3.318z"/>
514
+ </g>
515
+ </svg>`,
516
+ items: [ 'underline', 'strikethrough', 'superscript', 'subscript' ]
517
+ },
518
+ 'removeFormat',
519
+ '|',
520
+ 'alignment',
521
+ 'outdent',
522
+ 'indent',
523
+ '|',
524
+ 'bulletedList', 'numberedList',
525
+ '|',
526
+ 'insertImage','mediaEmbed','strapiMediaLib','link','blockquote','insertTable','specialCharacters','htmlEmbed','codeBlock',
527
+ '|', 'horizontalLine', 'pageBreak', '|',
528
+ '|', 'undo', 'redo', '|',
529
+ ],
530
+
531
+ }
532
+
533
+ export const toolbarBaloonEditorConfig = {
534
+ plugins:[...basePlugins, w.BalloonToolbar],
535
+ ...base,
536
+ toolbar: [
537
+ {
538
+ label:' ',
539
+ tooltip: null,
540
+ icon:'paragraph',
541
+ items: [ 'heading','style']
542
+ },
543
+ '|',
544
+ 'alignment',
545
+ 'outdent',
546
+ 'indent',
547
+ '|',
548
+ 'bulletedList', 'numberedList',
549
+ '|',
550
+ 'insertImage','mediaEmbed','strapiMediaLib','link','blockquote','insertTable','specialCharacters','htmlEmbed','codeBlock',
551
+ '|', 'horizontalLine', 'pageBreak', '|','SourceEditing',
552
+ '|', 'undo', 'redo', '|',
553
+ ],
554
+ balloonToolbar: [
555
+ 'bold', 'italic','fontSize', 'fontFamily', 'fontColor', 'fontBackgroundColor',
556
+ {
557
+ label:' ',
558
+ tooltip: null,
559
+ icon:`
560
+ <svg width="800px" height="800px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
561
+ <rect x="0" fill="none" width="24" height="24"/>
562
+ <g>
563
+ <path d="M14.348 12H21v2h-4.613c.24.515.368 1.094.368 1.748 0 1.317-.474 2.355-1.423 3.114-.947.76-2.266 1.138-3.956 1.138-1.557 0-2.934-.293-4.132-.878v-2.874c.985.44 1.818.75 2.5.928.682.18 1.306.27 1.872.27.68 0 1.2-.13 1.562-.39.363-.26.545-.644.545-1.158 0-.285-.08-.54-.24-.763-.16-.222-.394-.437-.704-.643-.18-.12-.483-.287-.88-.49H3v-2H14.347zm-3.528-2c-.073-.077-.143-.155-.193-.235-.126-.202-.19-.44-.19-.713 0-.44.157-.795.47-1.068.313-.273.762-.41 1.348-.41.492 0 .993.064 1.502.19.51.127 1.153.35 1.93.67l1-2.405c-.753-.327-1.473-.58-2.16-.76-.69-.18-1.414-.27-2.173-.27-1.544 0-2.753.37-3.628 1.108-.874.738-1.312 1.753-1.312 3.044 0 .302.036.58.088.848h3.318z"/>
564
+ </g>
565
+ </svg>`,
566
+ items: [ 'underline', 'strikethrough', 'superscript', 'subscript' ]
567
+ },
568
+ '|',
569
+ 'removeFormat',
570
+ ]
571
+ }
572
+
573
+ export const blockBaloonEditorConfig = {
574
+ plugins:[
575
+ ...basePlugins.filter(({pluginName})=>
576
+ pluginName !== "SourceEditing" &&
577
+ pluginName !== "SpecialCharacters" &&
578
+ pluginName !== "SpecialCharactersArrows" &&
579
+ pluginName !== "SpecialCharactersCurrency" &&
580
+ pluginName !== "SpecialCharactersEssentials" &&
581
+ pluginName !== "SpecialCharactersLatin" &&
582
+ pluginName !== "SpecialCharactersMathematical" &&
583
+ pluginName !== "SpecialCharactersText" &&
584
+ pluginName !== "PageBreak" &&
585
+ pluginName !== "HorizontalLine" &&
586
+ pluginName !== "MediaEmbed" &&
587
+ pluginName !== "HtmlEmbed" &&
588
+ pluginName !== "Code" &&
589
+ pluginName !== "CodeBlock"
590
+ ),
591
+ w.BlockToolbar, w.BalloonToolbar
592
+ ],
593
+ ...base,
594
+ blockToolbar: [
595
+ {
596
+ label:' ',
597
+ tooltip: null,
598
+ icon:'paragraph',
599
+ items: [ 'heading','style']
600
+ },
601
+ '|',
602
+ 'bulletedList', 'numberedList',
603
+ '|',
604
+ 'alignment',
605
+ 'outdent',
606
+ 'indent',
607
+ '|',
608
+ 'insertImage','strapiMediaLib','link','blockquote','insertTable',
609
+ '|', 'undo', 'redo', '|',
610
+ ],
611
+ balloonToolbar: [
612
+ 'bold', 'italic','fontSize', 'fontFamily', 'fontColor', 'fontBackgroundColor',
613
+ {
614
+ label:' ',
615
+ tooltip: null,
616
+ icon:`
617
+ <svg width="800px" height="800px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
618
+ <rect x="0" fill="none" width="24" height="24"/>
619
+ <g>
620
+ <path d="M14.348 12H21v2h-4.613c.24.515.368 1.094.368 1.748 0 1.317-.474 2.355-1.423 3.114-.947.76-2.266 1.138-3.956 1.138-1.557 0-2.934-.293-4.132-.878v-2.874c.985.44 1.818.75 2.5.928.682.18 1.306.27 1.872.27.68 0 1.2-.13 1.562-.39.363-.26.545-.644.545-1.158 0-.285-.08-.54-.24-.763-.16-.222-.394-.437-.704-.643-.18-.12-.483-.287-.88-.49H3v-2H14.347zm-3.528-2c-.073-.077-.143-.155-.193-.235-.126-.202-.19-.44-.19-.713 0-.44.157-.795.47-1.068.313-.273.762-.41 1.348-.41.492 0 .993.064 1.502.19.51.127 1.153.35 1.93.67l1-2.405c-.753-.327-1.473-.58-2.16-.76-.69-.18-1.414-.27-2.173-.27-1.544 0-2.753.37-3.628 1.108-.874.738-1.312 1.753-1.312 3.044 0 .302.036.58.088.848h3.318z"/>
621
+ </g>
622
+ </svg>`,
623
+ items: [ 'underline', 'strikethrough', 'superscript', 'subscript' ]
624
+ },
625
+ '|',
626
+ 'removeFormat',
627
+ ]
628
+ }