config.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. /**
  2. * This configuration was generated using the CKEditor 5 Builder. You can modify it anytime using this link:
  3. * https://ckeditor.com/ckeditor-5/builder/#installation/NoRgLANARATAdAdjgVitEAGMA2AzNgDgE5CQFlcFcZwzcCxkZkQRiRciMbmiWY0UAJYAXNBgigIIabJkYAuugAmAUwIAjTFAVA==
  4. */
  5. import {
  6. Alignment,
  7. Autoformat,
  8. AutoImage,
  9. AutoLink,
  10. Autosave,
  11. BalloonToolbar,
  12. Bold,
  13. Essentials,
  14. FontBackgroundColor,
  15. FontColor,
  16. FontFamily,
  17. FontSize,
  18. GeneralHtmlSupport,
  19. Heading,
  20. ImageEditing,
  21. ImageInline,
  22. ImageInsert,
  23. ImageInsertViaUrl,
  24. ImageResize,
  25. ImageStyle,
  26. ImageTextAlternative,
  27. ImageToolbar,
  28. ImageUpload,
  29. ImageUtils,
  30. Indent,
  31. IndentBlock,
  32. Italic,
  33. Link,
  34. List,
  35. ListProperties,
  36. Paragraph,
  37. PasteFromOffice,
  38. PlainTableOutput,
  39. RemoveFormat,
  40. SimpleUploadAdapter,
  41. Strikethrough,
  42. Style,
  43. Table,
  44. TableCaption,
  45. TableCellProperties,
  46. TableColumnResize,
  47. TableLayout,
  48. TableProperties,
  49. TableToolbar,
  50. TextTransformation,
  51. Underline
  52. } from 'ckeditor5';
  53. import translations from 'ckeditor5/translations/it.js';
  54. /**
  55. * Create a free account with a trial: https://portal.ckeditor.com/checkout?plan=free
  56. */
  57. const LICENSE_KEY = 'GPL'; // or <YOUR_LICENSE_KEY>.
  58. const editorConfig = {
  59. toolbar: {
  60. items: [
  61. 'undo',
  62. 'redo',
  63. '|',
  64. 'heading',
  65. 'style',
  66. '|',
  67. 'fontSize',
  68. 'fontFamily',
  69. 'fontColor',
  70. 'fontBackgroundColor',
  71. '|',
  72. 'bold',
  73. 'italic',
  74. 'underline',
  75. '|',
  76. 'link',
  77. 'insertImage',
  78. 'insertTable',
  79. 'insertTableLayout',
  80. '|',
  81. 'alignment',
  82. '|',
  83. 'bulletedList',
  84. 'numberedList',
  85. 'outdent',
  86. 'indent'
  87. ],
  88. shouldNotGroupWhenFull: false
  89. },
  90. plugins: [
  91. Alignment,
  92. Autoformat,
  93. AutoImage,
  94. AutoLink,
  95. Autosave,
  96. BalloonToolbar,
  97. Bold,
  98. Essentials,
  99. FontBackgroundColor,
  100. FontColor,
  101. FontFamily,
  102. FontSize,
  103. GeneralHtmlSupport,
  104. Heading,
  105. ImageEditing,
  106. ImageInline,
  107. ImageInsert,
  108. ImageInsertViaUrl,
  109. ImageResize,
  110. ImageStyle,
  111. ImageTextAlternative,
  112. ImageToolbar,
  113. ImageUpload,
  114. ImageUtils,
  115. Indent,
  116. IndentBlock,
  117. Italic,
  118. Link,
  119. List,
  120. ListProperties,
  121. Paragraph,
  122. PasteFromOffice,
  123. PlainTableOutput,
  124. RemoveFormat,
  125. SimpleUploadAdapter,
  126. Strikethrough,
  127. Style,
  128. Table,
  129. TableCaption,
  130. TableCellProperties,
  131. TableColumnResize,
  132. TableLayout,
  133. TableProperties,
  134. TableToolbar,
  135. TextTransformation,
  136. Underline
  137. ],
  138. balloonToolbar: ['bold', 'italic', '|', 'link', 'insertImage', '|', 'bulletedList', 'numberedList'],
  139. fontFamily: {
  140. supportAllValues: true
  141. },
  142. fontSize: {
  143. options: [10, 12, 14, 'default', 18, 20, 22],
  144. supportAllValues: true
  145. },
  146. heading: {
  147. options: [
  148. {
  149. model: 'paragraph',
  150. title: 'Paragraph',
  151. class: 'ck-heading_paragraph'
  152. },
  153. {
  154. model: 'heading1',
  155. view: 'h1',
  156. title: 'Heading 1',
  157. class: 'ck-heading_heading1'
  158. },
  159. {
  160. model: 'heading2',
  161. view: 'h2',
  162. title: 'Heading 2',
  163. class: 'ck-heading_heading2'
  164. },
  165. {
  166. model: 'heading3',
  167. view: 'h3',
  168. title: 'Heading 3',
  169. class: 'ck-heading_heading3'
  170. },
  171. {
  172. model: 'heading4',
  173. view: 'h4',
  174. title: 'Heading 4',
  175. class: 'ck-heading_heading4'
  176. },
  177. {
  178. model: 'heading5',
  179. view: 'h5',
  180. title: 'Heading 5',
  181. class: 'ck-heading_heading5'
  182. },
  183. {
  184. model: 'heading6',
  185. view: 'h6',
  186. title: 'Heading 6',
  187. class: 'ck-heading_heading6'
  188. }
  189. ]
  190. },
  191. htmlSupport: {
  192. allow: [
  193. {
  194. name: /^.*$/,
  195. styles: true,
  196. attributes: true,
  197. classes: true
  198. }
  199. ]
  200. },
  201. image: {
  202. toolbar: ['imageTextAlternative', '|', 'imageStyle:inline', 'imageStyle:alignLeft', 'imageStyle:alignRight', '|', 'resizeImage'],
  203. styles: {
  204. options: ['inline', 'alignLeft', 'alignRight']
  205. }
  206. },
  207. language: 'it',
  208. licenseKey: LICENSE_KEY,
  209. link: {
  210. addTargetToExternalLinks: true,
  211. defaultProtocol: 'https://',
  212. decorators: {
  213. toggleDownloadable: {
  214. mode: 'manual',
  215. label: 'Downloadable',
  216. attributes: {
  217. download: 'file'
  218. }
  219. }
  220. }
  221. },
  222. list: {
  223. properties: {
  224. styles: true,
  225. startIndex: true,
  226. reversed: true
  227. }
  228. },
  229. menuBar: {
  230. isVisible: true
  231. },
  232. placeholder: 'Inserisci qui il messaggio',
  233. style: {
  234. definitions: [
  235. {
  236. name: 'Article category',
  237. element: 'h3',
  238. classes: ['category']
  239. },
  240. {
  241. name: 'Title',
  242. element: 'h2',
  243. classes: ['document-title']
  244. },
  245. {
  246. name: 'Subtitle',
  247. element: 'h3',
  248. classes: ['document-subtitle']
  249. },
  250. {
  251. name: 'Info box',
  252. element: 'p',
  253. classes: ['info-box']
  254. },
  255. {
  256. name: 'CTA Link Primary',
  257. element: 'a',
  258. classes: ['button', 'button--green']
  259. },
  260. {
  261. name: 'CTA Link Secondary',
  262. element: 'a',
  263. classes: ['button', 'button--black']
  264. },
  265. {
  266. name: 'Marker',
  267. element: 'span',
  268. classes: ['marker']
  269. },
  270. {
  271. name: 'Spoiler',
  272. element: 'span',
  273. classes: ['spoiler']
  274. }
  275. ]
  276. },
  277. table: {
  278. contentToolbar: ['tableColumn', 'tableRow', 'mergeTableCells', 'tableProperties', 'tableCellProperties']
  279. },
  280. translations: [translations],
  281. };
  282. // ClassicEditor.create(document.querySelector('#editor'), editorConfig);
  283. export {editorConfig};