@ckeditor/ckeditor5-core 44.1.0 → 44.2.0-alpha.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.
Files changed (358) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/index-content.css +2 -2
  3. package/dist/index-editor.css +2 -2
  4. package/dist/index.css +2 -2
  5. package/dist/index.js +21 -7
  6. package/dist/index.js.map +1 -1
  7. package/dist/translations/af.d.ts +2 -2
  8. package/dist/translations/af.js +3 -3
  9. package/dist/translations/af.umd.js +3 -3
  10. package/dist/translations/ar.d.ts +2 -2
  11. package/dist/translations/ar.js +3 -3
  12. package/dist/translations/ar.umd.js +3 -3
  13. package/dist/translations/ast.d.ts +2 -2
  14. package/dist/translations/ast.js +3 -3
  15. package/dist/translations/ast.umd.js +3 -3
  16. package/dist/translations/az.d.ts +2 -2
  17. package/dist/translations/az.js +3 -3
  18. package/dist/translations/az.umd.js +3 -3
  19. package/dist/translations/bg.d.ts +2 -2
  20. package/dist/translations/bg.js +3 -3
  21. package/dist/translations/bg.umd.js +3 -3
  22. package/dist/translations/bn.d.ts +2 -2
  23. package/dist/translations/bn.js +3 -3
  24. package/dist/translations/bn.umd.js +3 -3
  25. package/dist/translations/bs.d.ts +2 -2
  26. package/dist/translations/bs.js +3 -3
  27. package/dist/translations/bs.umd.js +3 -3
  28. package/dist/translations/ca.d.ts +2 -2
  29. package/dist/translations/ca.js +3 -3
  30. package/dist/translations/ca.umd.js +3 -3
  31. package/dist/translations/cs.d.ts +2 -2
  32. package/dist/translations/cs.js +3 -3
  33. package/dist/translations/cs.umd.js +3 -3
  34. package/dist/translations/da.d.ts +2 -2
  35. package/dist/translations/da.js +3 -3
  36. package/dist/translations/da.umd.js +3 -3
  37. package/dist/translations/de-ch.d.ts +2 -2
  38. package/dist/translations/de-ch.js +3 -3
  39. package/dist/translations/de-ch.umd.js +3 -3
  40. package/dist/translations/de.d.ts +2 -2
  41. package/dist/translations/de.js +3 -3
  42. package/dist/translations/de.umd.js +3 -3
  43. package/dist/translations/el.d.ts +2 -2
  44. package/dist/translations/el.js +3 -3
  45. package/dist/translations/el.umd.js +3 -3
  46. package/dist/translations/en-au.d.ts +2 -2
  47. package/dist/translations/en-au.js +3 -3
  48. package/dist/translations/en-au.umd.js +3 -3
  49. package/dist/translations/en-gb.d.ts +2 -2
  50. package/dist/translations/en-gb.js +3 -3
  51. package/dist/translations/en-gb.umd.js +3 -3
  52. package/dist/translations/en.d.ts +2 -2
  53. package/dist/translations/en.js +3 -3
  54. package/dist/translations/en.umd.js +3 -3
  55. package/dist/translations/eo.d.ts +2 -2
  56. package/dist/translations/eo.js +3 -3
  57. package/dist/translations/eo.umd.js +3 -3
  58. package/dist/translations/es-co.d.ts +2 -2
  59. package/dist/translations/es-co.js +3 -3
  60. package/dist/translations/es-co.umd.js +3 -3
  61. package/dist/translations/es.d.ts +2 -2
  62. package/dist/translations/es.js +3 -3
  63. package/dist/translations/es.umd.js +3 -3
  64. package/dist/translations/et.d.ts +2 -2
  65. package/dist/translations/et.js +3 -3
  66. package/dist/translations/et.umd.js +3 -3
  67. package/dist/translations/eu.d.ts +2 -2
  68. package/dist/translations/eu.js +3 -3
  69. package/dist/translations/eu.umd.js +3 -3
  70. package/dist/translations/fa.d.ts +2 -2
  71. package/dist/translations/fa.js +3 -3
  72. package/dist/translations/fa.umd.js +3 -3
  73. package/dist/translations/fi.d.ts +2 -2
  74. package/dist/translations/fi.js +3 -3
  75. package/dist/translations/fi.umd.js +3 -3
  76. package/dist/translations/fr.d.ts +2 -2
  77. package/dist/translations/fr.js +3 -3
  78. package/dist/translations/fr.umd.js +3 -3
  79. package/dist/translations/gl.d.ts +2 -2
  80. package/dist/translations/gl.js +3 -3
  81. package/dist/translations/gl.umd.js +3 -3
  82. package/dist/translations/gu.d.ts +2 -2
  83. package/dist/translations/gu.js +3 -3
  84. package/dist/translations/gu.umd.js +3 -3
  85. package/dist/translations/he.d.ts +2 -2
  86. package/dist/translations/he.js +3 -3
  87. package/dist/translations/he.umd.js +3 -3
  88. package/dist/translations/hi.d.ts +2 -2
  89. package/dist/translations/hi.js +3 -3
  90. package/dist/translations/hi.umd.js +3 -3
  91. package/dist/translations/hr.d.ts +2 -2
  92. package/dist/translations/hr.js +3 -3
  93. package/dist/translations/hr.umd.js +3 -3
  94. package/dist/translations/hu.d.ts +2 -2
  95. package/dist/translations/hu.js +3 -3
  96. package/dist/translations/hu.umd.js +3 -3
  97. package/dist/translations/hy.d.ts +2 -2
  98. package/dist/translations/hy.js +3 -3
  99. package/dist/translations/hy.umd.js +3 -3
  100. package/dist/translations/id.d.ts +2 -2
  101. package/dist/translations/id.js +3 -3
  102. package/dist/translations/id.umd.js +3 -3
  103. package/dist/translations/it.d.ts +2 -2
  104. package/dist/translations/it.js +3 -3
  105. package/dist/translations/it.umd.js +3 -3
  106. package/dist/translations/ja.d.ts +2 -2
  107. package/dist/translations/ja.js +3 -3
  108. package/dist/translations/ja.umd.js +3 -3
  109. package/dist/translations/jv.d.ts +2 -2
  110. package/dist/translations/jv.js +3 -3
  111. package/dist/translations/jv.umd.js +3 -3
  112. package/dist/translations/kk.d.ts +2 -2
  113. package/dist/translations/kk.js +3 -3
  114. package/dist/translations/kk.umd.js +3 -3
  115. package/dist/translations/km.d.ts +2 -2
  116. package/dist/translations/km.js +3 -3
  117. package/dist/translations/km.umd.js +3 -3
  118. package/dist/translations/kn.d.ts +2 -2
  119. package/dist/translations/kn.js +3 -3
  120. package/dist/translations/kn.umd.js +3 -3
  121. package/dist/translations/ko.d.ts +2 -2
  122. package/dist/translations/ko.js +3 -3
  123. package/dist/translations/ko.umd.js +3 -3
  124. package/dist/translations/ku.d.ts +2 -2
  125. package/dist/translations/ku.js +3 -3
  126. package/dist/translations/ku.umd.js +3 -3
  127. package/dist/translations/lt.d.ts +2 -2
  128. package/dist/translations/lt.js +3 -3
  129. package/dist/translations/lt.umd.js +3 -3
  130. package/dist/translations/lv.d.ts +2 -2
  131. package/dist/translations/lv.js +3 -3
  132. package/dist/translations/lv.umd.js +3 -3
  133. package/dist/translations/ms.d.ts +2 -2
  134. package/dist/translations/ms.js +3 -3
  135. package/dist/translations/ms.umd.js +3 -3
  136. package/dist/translations/nb.d.ts +2 -2
  137. package/dist/translations/nb.js +3 -3
  138. package/dist/translations/nb.umd.js +3 -3
  139. package/dist/translations/ne.d.ts +2 -2
  140. package/dist/translations/ne.js +3 -3
  141. package/dist/translations/ne.umd.js +3 -3
  142. package/dist/translations/nl.d.ts +2 -2
  143. package/dist/translations/nl.js +3 -3
  144. package/dist/translations/nl.umd.js +3 -3
  145. package/dist/translations/no.d.ts +2 -2
  146. package/dist/translations/no.js +3 -3
  147. package/dist/translations/no.umd.js +3 -3
  148. package/dist/translations/oc.d.ts +2 -2
  149. package/dist/translations/oc.js +3 -3
  150. package/dist/translations/oc.umd.js +3 -3
  151. package/dist/translations/pl.d.ts +2 -2
  152. package/dist/translations/pl.js +3 -3
  153. package/dist/translations/pl.umd.js +3 -3
  154. package/dist/translations/pt-br.d.ts +2 -2
  155. package/dist/translations/pt-br.js +3 -3
  156. package/dist/translations/pt-br.umd.js +3 -3
  157. package/dist/translations/pt.d.ts +2 -2
  158. package/dist/translations/pt.js +3 -3
  159. package/dist/translations/pt.umd.js +3 -3
  160. package/dist/translations/ro.d.ts +2 -2
  161. package/dist/translations/ro.js +3 -3
  162. package/dist/translations/ro.umd.js +3 -3
  163. package/dist/translations/ru.d.ts +2 -2
  164. package/dist/translations/ru.js +3 -3
  165. package/dist/translations/ru.umd.js +3 -3
  166. package/dist/translations/si.d.ts +2 -2
  167. package/dist/translations/si.js +3 -3
  168. package/dist/translations/si.umd.js +3 -3
  169. package/dist/translations/sk.d.ts +2 -2
  170. package/dist/translations/sk.js +3 -3
  171. package/dist/translations/sk.umd.js +3 -3
  172. package/dist/translations/sl.d.ts +2 -2
  173. package/dist/translations/sl.js +3 -3
  174. package/dist/translations/sl.umd.js +3 -3
  175. package/dist/translations/sq.d.ts +2 -2
  176. package/dist/translations/sq.js +3 -3
  177. package/dist/translations/sq.umd.js +3 -3
  178. package/dist/translations/sr-latn.d.ts +2 -2
  179. package/dist/translations/sr-latn.js +3 -3
  180. package/dist/translations/sr-latn.umd.js +3 -3
  181. package/dist/translations/sr.d.ts +2 -2
  182. package/dist/translations/sr.js +3 -3
  183. package/dist/translations/sr.umd.js +3 -3
  184. package/dist/translations/sv.d.ts +2 -2
  185. package/dist/translations/sv.js +3 -3
  186. package/dist/translations/sv.umd.js +3 -3
  187. package/dist/translations/th.d.ts +2 -2
  188. package/dist/translations/th.js +3 -3
  189. package/dist/translations/th.umd.js +3 -3
  190. package/dist/translations/ti.d.ts +2 -2
  191. package/dist/translations/ti.js +3 -3
  192. package/dist/translations/ti.umd.js +3 -3
  193. package/dist/translations/tk.d.ts +2 -2
  194. package/dist/translations/tk.js +3 -3
  195. package/dist/translations/tk.umd.js +3 -3
  196. package/dist/translations/tr.d.ts +2 -2
  197. package/dist/translations/tr.js +3 -3
  198. package/dist/translations/tr.umd.js +3 -3
  199. package/dist/translations/tt.d.ts +2 -2
  200. package/dist/translations/tt.js +3 -3
  201. package/dist/translations/tt.umd.js +3 -3
  202. package/dist/translations/ug.d.ts +2 -2
  203. package/dist/translations/ug.js +3 -3
  204. package/dist/translations/ug.umd.js +3 -3
  205. package/dist/translations/uk.d.ts +2 -2
  206. package/dist/translations/uk.js +3 -3
  207. package/dist/translations/uk.umd.js +3 -3
  208. package/dist/translations/ur.d.ts +2 -2
  209. package/dist/translations/ur.js +3 -3
  210. package/dist/translations/ur.umd.js +3 -3
  211. package/dist/translations/uz.d.ts +2 -2
  212. package/dist/translations/uz.js +3 -3
  213. package/dist/translations/uz.umd.js +3 -3
  214. package/dist/translations/vi.d.ts +2 -2
  215. package/dist/translations/vi.js +3 -3
  216. package/dist/translations/vi.umd.js +3 -3
  217. package/dist/translations/zh-cn.d.ts +2 -2
  218. package/dist/translations/zh-cn.js +3 -3
  219. package/dist/translations/zh-cn.umd.js +3 -3
  220. package/dist/translations/zh.d.ts +2 -2
  221. package/dist/translations/zh.js +3 -3
  222. package/dist/translations/zh.umd.js +3 -3
  223. package/lang/contexts.json +3 -1
  224. package/lang/translations/af.po +9 -1
  225. package/lang/translations/ar.po +9 -1
  226. package/lang/translations/ast.po +9 -1
  227. package/lang/translations/az.po +9 -1
  228. package/lang/translations/bg.po +9 -1
  229. package/lang/translations/bn.po +9 -1
  230. package/lang/translations/bs.po +9 -1
  231. package/lang/translations/ca.po +9 -1
  232. package/lang/translations/cs.po +9 -1
  233. package/lang/translations/da.po +9 -1
  234. package/lang/translations/de-ch.po +9 -1
  235. package/lang/translations/de.po +9 -1
  236. package/lang/translations/el.po +9 -1
  237. package/lang/translations/en-au.po +9 -1
  238. package/lang/translations/en-gb.po +9 -1
  239. package/lang/translations/en.po +9 -1
  240. package/lang/translations/eo.po +9 -1
  241. package/lang/translations/es-co.po +9 -1
  242. package/lang/translations/es.po +9 -1
  243. package/lang/translations/et.po +9 -1
  244. package/lang/translations/eu.po +9 -1
  245. package/lang/translations/fa.po +9 -1
  246. package/lang/translations/fi.po +9 -1
  247. package/lang/translations/fr.po +9 -1
  248. package/lang/translations/gl.po +9 -1
  249. package/lang/translations/gu.po +9 -1
  250. package/lang/translations/he.po +9 -1
  251. package/lang/translations/hi.po +9 -1
  252. package/lang/translations/hr.po +9 -1
  253. package/lang/translations/hu.po +9 -1
  254. package/lang/translations/hy.po +9 -1
  255. package/lang/translations/id.po +9 -1
  256. package/lang/translations/it.po +9 -1
  257. package/lang/translations/ja.po +9 -1
  258. package/lang/translations/jv.po +9 -1
  259. package/lang/translations/kk.po +9 -1
  260. package/lang/translations/km.po +9 -1
  261. package/lang/translations/kn.po +9 -1
  262. package/lang/translations/ko.po +9 -1
  263. package/lang/translations/ku.po +9 -1
  264. package/lang/translations/lt.po +9 -1
  265. package/lang/translations/lv.po +9 -1
  266. package/lang/translations/ms.po +9 -1
  267. package/lang/translations/nb.po +9 -1
  268. package/lang/translations/ne.po +9 -1
  269. package/lang/translations/nl.po +9 -1
  270. package/lang/translations/no.po +9 -1
  271. package/lang/translations/oc.po +9 -1
  272. package/lang/translations/pl.po +9 -1
  273. package/lang/translations/pt-br.po +9 -1
  274. package/lang/translations/pt.po +9 -1
  275. package/lang/translations/ro.po +9 -1
  276. package/lang/translations/ru.po +9 -1
  277. package/lang/translations/si.po +9 -1
  278. package/lang/translations/sk.po +9 -1
  279. package/lang/translations/sl.po +9 -1
  280. package/lang/translations/sq.po +9 -1
  281. package/lang/translations/sr-latn.po +9 -1
  282. package/lang/translations/sr.po +9 -1
  283. package/lang/translations/sv.po +9 -1
  284. package/lang/translations/th.po +9 -1
  285. package/lang/translations/ti.po +9 -1
  286. package/lang/translations/tk.po +9 -1
  287. package/lang/translations/tr.po +9 -1
  288. package/lang/translations/tt.po +9 -1
  289. package/lang/translations/ug.po +9 -1
  290. package/lang/translations/uk.po +9 -1
  291. package/lang/translations/ur.po +9 -1
  292. package/lang/translations/uz.po +9 -1
  293. package/lang/translations/vi.po +9 -1
  294. package/lang/translations/zh-cn.po +9 -1
  295. package/lang/translations/zh.po +9 -1
  296. package/package.json +27 -5
  297. package/src/accessibility.d.ts +1 -1
  298. package/src/accessibility.js +1 -1
  299. package/src/augmentation.d.ts +1 -1
  300. package/src/augmentation.js +1 -1
  301. package/src/command.d.ts +1 -1
  302. package/src/command.js +1 -1
  303. package/src/commandcollection.d.ts +1 -1
  304. package/src/commandcollection.js +1 -1
  305. package/src/context.d.ts +1 -1
  306. package/src/context.js +1 -1
  307. package/src/contextplugin.d.ts +1 -1
  308. package/src/contextplugin.js +1 -1
  309. package/src/editingkeystrokehandler.d.ts +1 -1
  310. package/src/editingkeystrokehandler.js +1 -1
  311. package/src/editor/editor.d.ts +1 -1
  312. package/src/editor/editor.js +10 -4
  313. package/src/editor/editorconfig.d.ts +1 -1
  314. package/src/editor/editorconfig.js +1 -1
  315. package/src/editor/utils/attachtoform.d.ts +1 -1
  316. package/src/editor/utils/attachtoform.js +1 -1
  317. package/src/editor/utils/dataapimixin.d.ts +1 -1
  318. package/src/editor/utils/dataapimixin.js +1 -1
  319. package/src/editor/utils/editorusagedata.d.ts +1 -1
  320. package/src/editor/utils/editorusagedata.js +1 -1
  321. package/src/editor/utils/elementapimixin.d.ts +1 -1
  322. package/src/editor/utils/elementapimixin.js +1 -1
  323. package/src/editor/utils/securesourceelement.d.ts +1 -1
  324. package/src/editor/utils/securesourceelement.js +1 -1
  325. package/src/index.d.ts +3 -1
  326. package/src/index.js +6 -2
  327. package/src/multicommand.d.ts +1 -1
  328. package/src/multicommand.js +1 -1
  329. package/src/pendingactions.d.ts +1 -1
  330. package/src/pendingactions.js +1 -1
  331. package/src/plugin.d.ts +1 -1
  332. package/src/plugin.js +1 -1
  333. package/src/plugincollection.d.ts +1 -1
  334. package/src/plugincollection.js +1 -1
  335. package/src/typings.d.ts +1 -1
  336. package/src/typings.js +1 -1
  337. package/theme/icons/emoji.svg +1 -0
  338. package/theme/icons/source.svg +1 -0
  339. package/dist/accessibility.d.ts +0 -365
  340. package/dist/augmentation.d.ts +0 -14
  341. package/dist/command.d.ts +0 -193
  342. package/dist/commandcollection.d.ts +0 -87
  343. package/dist/context.d.ts +0 -241
  344. package/dist/contextplugin.d.ts +0 -73
  345. package/dist/editingkeystrokehandler.d.ts +0 -60
  346. package/dist/editor/editor.d.ts +0 -530
  347. package/dist/editor/editorconfig.d.ts +0 -994
  348. package/dist/editor/utils/attachtoform.d.ts +0 -19
  349. package/dist/editor/utils/dataapimixin.d.ts +0 -83
  350. package/dist/editor/utils/editorusagedata.d.ts +0 -72
  351. package/dist/editor/utils/elementapimixin.d.ts +0 -39
  352. package/dist/editor/utils/securesourceelement.d.ts +0 -21
  353. package/dist/index.d.ts +0 -97
  354. package/dist/multicommand.d.ts +0 -70
  355. package/dist/pendingactions.d.ts +0 -126
  356. package/dist/plugin.d.ts +0 -300
  357. package/dist/plugincollection.d.ts +0 -121
  358. package/dist/typings.d.ts +0 -16
@@ -1,994 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
8
- */
9
- /**
10
- * @module core/editor/editorconfig
11
- */
12
- import type { ArrayOrItem, Translations } from '@ckeditor/ckeditor5-utils';
13
- import type Context from '../context.js';
14
- import type { PluginConstructor } from '../plugin.js';
15
- import type Editor from './editor.js';
16
- import type { MenuBarConfig } from '@ckeditor/ckeditor5-ui';
17
- /**
18
- * CKEditor configuration options.
19
- *
20
- * An object defining the editor configuration can be passed when initializing the editor:
21
- *
22
- * ```ts
23
- * EditorClass
24
- * .create( {
25
- * toolbar: [ 'bold', 'italic' ],
26
- * image: {
27
- * styles: [
28
- * ...
29
- * ]
30
- * }
31
- * } )
32
- * .then( ... )
33
- * .catch( ... );
34
- * ```
35
- */
36
- export interface EditorConfig {
37
- context?: Context;
38
- /**
39
- * The list of additional plugins to load along those already available in the
40
- * editor. It extends the {@link #plugins `plugins`} configuration.
41
- *
42
- * ```ts
43
- * function MyPlugin( editor ) {
44
- * // ...
45
- * }
46
- *
47
- * const config = {
48
- * extraPlugins: [ MyPlugin ]
49
- * };
50
- * ```
51
- *
52
- * **Note:** This configuration works only for simple plugins which utilize the
53
- * {@link module:core/plugin~PluginInterface plugin interface} and have no dependencies. To extend a
54
- * build with complex features, try [CKEditr 5 Builder](https://ckeditor.com/ckeditor-5/builder?redirect=docs).
55
- *
56
- * **Note:** Make sure you include the new features in you toolbar configuration. Learn more
57
- * about the {@glink getting-started/setup/toolbar toolbar setup}.
58
- */
59
- extraPlugins?: Array<PluginConstructor<Editor>>;
60
- /**
61
- * The initial editor data to be used instead of the provided element's HTML content.
62
- *
63
- * ```ts
64
- * ClassicEditor
65
- * .create( document.querySelector( '#editor' ), {
66
- * initialData: '<h2>Initial data</h2><p>Foo bar.</p>'
67
- * } )
68
- * .then( ... )
69
- * .catch( ... );
70
- * ```
71
- *
72
- * By default, the editor is initialized with the content of the element on which this editor is initialized.
73
- * This configuration option lets you override this behavior and pass different initial data.
74
- * It is especially useful if it is difficult for your integration to put the data inside the HTML element.
75
- *
76
- * If your editor implementation uses multiple roots, you should pass an object with keys corresponding to the editor
77
- * roots names and values equal to the data that should be set in each root:
78
- *
79
- * ```ts
80
- * MultiRootEditor.create(
81
- * // Roots for the editor:
82
- * {
83
- * header: document.querySelector( '#header' ),
84
- * content: document.querySelector( '#content' ),
85
- * leftSide: document.querySelector( '#left-side' ),
86
- * rightSide: document.querySelector( '#right-side' )
87
- * },
88
- * // Config:
89
- * {
90
- * initialData: {
91
- * header: '<p>Content for header part.</p>',
92
- * content: '<p>Content for main part.</p>',
93
- * leftSide: '<p>Content for left-side box.</p>',
94
- * rightSide: '<p>Content for right-side box.</p>'
95
- * }
96
- * }
97
- * )
98
- * .then( ... )
99
- * .catch( ... );
100
- * ```
101
- *
102
- * See also {@link module:core/editor/editor~Editor.create Editor.create()} documentation for the editor implementation which you use.
103
- *
104
- * **Note:** If initial data is passed to `Editor.create()` in the first parameter (instead of a DOM element), and,
105
- * at the same time, `config.initialData` is set, an error will be thrown as those two options exclude themselves.
106
- *
107
- * If `config.initialData` is not set when the editor is initialized, the data received in `Editor.create()` call
108
- * will be used to set `config.initialData`. As a result, `initialData` is always set in the editor's config and
109
- * plugins can read and/or modify it during initialization.
110
- */
111
- initialData?: string | Record<string, string>;
112
- /**
113
- * The language of the editor UI and its content.
114
- *
115
- * Simple usage (change the language of the UI and the content):
116
- *
117
- * ```ts
118
- * ClassicEditor
119
- * .create( document.querySelector( '#editor' ), {
120
- * // The UI of the editor as well as its content will be in German.
121
- * language: 'de'
122
- * } )
123
- * .then( editor => {
124
- * console.log( editor );
125
- * } )
126
- * .catch( error => {
127
- * console.error( error );
128
- * } );
129
- * ```
130
- *
131
- * Use different languages for the UI and the content using the {@link module:core/editor/editorconfig~LanguageConfig configuration}
132
- * syntax:
133
- *
134
- * ```ts
135
- * ClassicEditor
136
- * .create( document.querySelector( '#editor' ), {
137
- * language: {
138
- * // The UI will be in English.
139
- * ui: 'en',
140
- *
141
- * // But the content will be edited in Arabic.
142
- * content: 'ar'
143
- * }
144
- * } )
145
- * .then( editor => {
146
- * console.log( editor );
147
- * } )
148
- * .catch( error => {
149
- * console.error( error );
150
- * } );
151
- * ```
152
- *
153
- * The language of the content has an impact on the editing experience, for instance it affects screen readers
154
- * and spell checkers. It is also particularly useful for typing in certain languages (e.g. right–to–left ones)
155
- * because it changes the default alignment of the text.
156
- *
157
- * The language codes are defined in the [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) standard.
158
- *
159
- * You need to add the corresponding translation file for the new UI language to work.
160
- * Translation files are available on CDN:
161
- *
162
- * ```html
163
- * <script type="importmap">
164
- * {
165
- * "imports": {
166
- * "ckeditor5": "https://cdn.ckeditor.com/ckeditor5/<VERSION>/ckeditor5.js",
167
- * "ckeditor5/": "https://cdn.ckeditor.com/ckeditor5/<VERSION>/"
168
- * }
169
- * }
170
- * </script>
171
- * <script type="module">
172
- * import { ClassicEditor, Essentials, Paragraph } from 'ckeditor5';
173
- * import translations from 'ckeditor5/dist/translations/pl.js';
174
- *
175
- * await ClassicEditor.create( document.querySelector( '#editor' ), {
176
- * plugins: [
177
- * Essentials,
178
- * Paragraph,
179
- * ],
180
- * toolbar: {
181
- * items: [ 'undo', 'redo' ]
182
- * },
183
- * translations
184
- * } );
185
- * </script>
186
- * ```
187
- *
188
- * You can add translation using NPM as well.
189
- *
190
- * ```html
191
- * import { ClassicEditor, Essentials, Paragraph } from 'ckeditor5';
192
- * import translations from 'ckeditor5/dist/translations/pl.js';
193
- *
194
- * import 'ckeditor5/dist/styles.css';
195
- *
196
- * await ClassicEditor.create( document.querySelector( '#editor' ), {
197
- * plugins: [
198
- * Essentials,
199
- * Paragraph,
200
- * ],
201
- * toolbar: {
202
- * items: [ 'undo', 'redo' ]
203
- * },
204
- * translations
205
- * } );
206
- * ```
207
- *
208
- * Check the {@glink getting-started/setup/ui-language UI language} guide for more information about
209
- * the localization options and translation process.
210
- */
211
- language?: string | LanguageConfig;
212
- /**
213
- * The editor menu bar configuration.
214
- *
215
- * **Note**: The menu bar is not available in all editor types. Currently, only the
216
- * {@link module:editor-classic/classiceditor~ClassicEditor Classic editor} and
217
- * {@link module:editor-decoupled/decouplededitor~DecoupledEditor Decoupled editor}
218
- * support this feature. Setting the `config.menuBar` configuration for other editor types will have no effect.
219
- *
220
- * In Classic editor, the menu bar is hidden by default. Set the `isVisible` configuration flag to `true` in order to show it:
221
- *
222
- * ```ts
223
- * ClassicEditor
224
- * .create( document.querySelector( '#editor' ), {
225
- * menuBar: {
226
- * isVisible: true
227
- * }
228
- * } )
229
- * .then( ... );
230
- * ```
231
- *
232
- * When using the Decoupled editor, you will need to insert the menu bar in a desired place yourself. For example:
233
- *
234
- * ```ts
235
- * DecoupledEditor
236
- * .create( document.querySelector( '#editor' ), {
237
- * toolbar: [ 'undo', 'redo', 'bold', 'italic', 'numberedList', 'bulletedList' ],
238
- * } )
239
- * .then( editor => {
240
- * document.getElementById( '#menuBarContainer' ).appendChild( editor.ui.view.menuBarView.element );
241
- * } );
242
- * ```
243
- *
244
- * **Note**: You do not have to set the `items` property in this configuration in order to use the menu bar.
245
- * By default, a {@link module:ui/menubar/utils#DefaultMenuBarItems default set of items} is used that already includes
246
- * **all core editor features**. For your convenience, there are `config.menuBar.addItems` and
247
- * `config.menuBar.removeItems` options available that will help you adjust the default configuration without setting the
248
- * entire menu bar structure from scratch (see below).
249
- *
250
- * **Removing items from the menu bar**
251
- *
252
- * You can use the `config.menuBar.removeItems` option to remove items from the default menu bar configuration. You can
253
- * remove individual buttons (e.g. "Bold" or "Block quote"), item groups (e.g. the basic styles section that
254
- * includes multiple buttons such as "Bold", "Italic", "Underline", etc.), or whole menus (e.g. the "Insert" menu). Please
255
- * refer to the {@link module:ui/menubar/utils#DefaultMenuBarItems default configuration} to see default buttons/groups/menus
256
- * and their structure.
257
- *
258
- * To remove individual buttons from the menu bar:
259
- *
260
- * ```ts
261
- * ClassicEditor
262
- * .create( document.querySelector( '#editor' ), {
263
- * menuBar: {
264
- * // Removes "Bold" and "Block quote" buttons from their respective menus.
265
- * removeItems: [ 'menuBar:bold', 'menuBar:blockQuote' ]
266
- * }
267
- * } )
268
- * .then( ... );
269
- * ```
270
- *
271
- * To remove a group of buttons from the menu bar:
272
- *
273
- * ```ts
274
- * ClassicEditor
275
- * .create( document.querySelector( '#editor' ), {
276
- * menuBar: {
277
- * // Removes the entire basic styles group ("Bold", "Italic", "Underline", etc.) from the "Format" menu.
278
- * removeItems: [ 'basicStyles' ]
279
- * }
280
- * } )
281
- * .then( ... );
282
- * ```
283
- *
284
- * To remove a menu from the menu bar:
285
- *
286
- * ```ts
287
- * ClassicEditor
288
- * .create( document.querySelector( '#editor' ), {
289
- * menuBar: {
290
- * // Removes the whole top-level "Insert" menu from the menu bar.
291
- * removeItems: [ 'insert' ]
292
- * }
293
- * } )
294
- * .then( ... );
295
- * ```
296
- *
297
- * **Adding items to the menu bar**
298
- *
299
- * Using the `config.menuBar.addItems` option you can add individual buttons, button groups or entire menus to the structure
300
- * of the menu bar. You can add existing components that you removed from their original position, or add your own components.
301
- *
302
- * **Note**: When adding items please make sure that features (editor plugins) that bring specific menu bar items are loaded.
303
- * For instance, the "Bold" button will not show up in the menu bar unless the {@glink features/basic-styles basic styles} feature is
304
- * loaded. {@link module:core/editor/editorconfig~EditorConfig#plugins Learn more} about loading plugins.
305
- *
306
- * Each entry in the `config.menuBar.addItems` is an object with one of the following properties:
307
- *
308
- * * `item` &ndash; A name of the button to be added to a specific button group (e.g. `'menuBar:bold'` or `'myButton'`),
309
- * * `menu` &ndash; A {@link module:ui/menubar/menubarview#MenuBarMenuDefinition definition of a menu} that should be added to
310
- * the menu bar,
311
- * * `group` &ndash; A {@link module:ui/menubar/menubarview#MenuBarMenuGroupDefinition definition of a button group} that should be
312
- * added to a specific menu.
313
- *
314
- * Additionally, each entry must define the `position` property that accepts the following values:
315
- * * `'start'` &ndash; Adds a top-level menu (e.g. "Format", "Insert", etc.) at the beginning of the menu bar,
316
- * * `'start:GROUP_OR_MENU'` &ndash; Adds a button/group at the beginning of the specific group/menu,
317
- * * `'end'` &ndash; Adds a top-level menu (e.g. "Format", "Insert", etc.) at the end of the menu bar,
318
- * * `'end:GROUP_OR_MENU'` &ndash; Adds a button/group at the end of the specific group/menu,
319
- * * `'after:BUTTON_OR_GROUP_OR_MENU'` &ndash; Adds a button/group/menu right after the specific button/group/menu,
320
- * * `'before:BUTTON_OR_GROUP_OR_MENU'` &ndash; Adds a button/group/menu right after the specific button/group/menu.
321
- *
322
- * Please refer to the {@link module:ui/menubar/utils#DefaultMenuBarItems default configuration} to learn about the
323
- * names of buttons and positions they can be added at.
324
- *
325
- * To add a new top-level menu with specific buttons at the end of the menu bar:
326
- *
327
- * ```ts
328
- * ClassicEditor
329
- * .create( document.querySelector( '#editor' ), {
330
- * menuBar: {
331
- * addItems: [
332
- * {
333
- * menu: {
334
- * menuId: 'my-menu',
335
- * label: 'My menu',
336
- * groups: [
337
- * {
338
- * groupId: 'my-buttons',
339
- * items: [
340
- * 'menuBar:bold',
341
- * 'menuBar:italic',
342
- * 'menuBar:underline'
343
- * ]
344
- * }
345
- * ]
346
- * },
347
- * position: 'end'
348
- * }
349
- * ]
350
- * }
351
- * } )
352
- * .then( ... );
353
- * ```
354
- *
355
- * To add a new group of buttons to the "Format" menu after basic styles buttons ("Bold", "Italic", "Underline", etc.):
356
- *
357
- * ```ts
358
- * ClassicEditor
359
- * .create( document.querySelector( '#editor' ), {
360
- * menuBar: {
361
- * addItems: [
362
- * {
363
- * group: {
364
- * groupId: 'my-buttons',
365
- * items: [
366
- * 'myButton1',
367
- * 'myButton2',
368
- * ]
369
- * },
370
- * position: 'after:basicStyles'
371
- * }
372
- * ]
373
- * }
374
- * } )
375
- * .then( ... );
376
- * ```
377
- *
378
- * To add a new button to the basic styles group ("Bold", "Italic", "Underline", etc.) in the "Format" menu:
379
- *
380
- * ```ts
381
- * ClassicEditor
382
- * .create( document.querySelector( '#editor' ), {
383
- * menuBar: {
384
- * addItems: [
385
- * {
386
- * item: 'myButton',
387
- * position: 'end:basicStyles'
388
- * }
389
- * ]
390
- * }
391
- * } )
392
- * .then( ... );
393
- * ```
394
- *
395
- * To add a new sub-menu in the "Format" menu:
396
- *
397
- * ```ts
398
- * ClassicEditor
399
- * .create( document.querySelector( '#editor' ), {
400
- * menuBar: {
401
- * addItems: [
402
- * {
403
- * menu: {
404
- * menuId: 'my-sub-menu',
405
- * label: 'My sub-menu',
406
- * groups: [
407
- * {
408
- * groupId: 'my-buttons',
409
- * items: [
410
- * 'myButton1',
411
- * 'myButton2',
412
- * ]
413
- * }
414
- * ]
415
- * },
416
- * position: 'after:basicStyles'
417
- * }
418
- * ]
419
- * }
420
- * } )
421
- * .then( ... );
422
- * ```
423
- *
424
- * **Defining menu bar from scratch**
425
- *
426
- * If the `config.menuBar.addItems` and `config.menuBar.removeItems` options are not enough to adjust the
427
- * {@link module:ui/menubar/utils#DefaultMenuBarItems default configuration}, you can set the menu bar structure from scratch.
428
- *
429
- * For instance, to create a minimalistic menu bar configuration with just two main categories (menus), use the following code snippet:
430
- *
431
- * ```ts
432
- * ClassicEditor
433
- * .create( document.querySelector( '#editor' ), {
434
- * menuBar: {
435
- * items: [
436
- * {
437
- * menuId: 'formatting',
438
- * label: 'Formatting',
439
- * groups: [
440
- * {
441
- * groupId: 'basicStyles',
442
- * items: [
443
- * 'menuBar:bold',
444
- * 'menuBar:italic',
445
- * ]
446
- * },
447
- * {
448
- * groupId: 'misc',
449
- * items: [
450
- * 'menuBar:heading',
451
- * 'menuBar:bulletedList',
452
- * 'menuBar:numberedList'
453
- * ]
454
- * }
455
- * ]
456
- * },
457
- * {
458
- * menuId: 'myButtons',
459
- * label: 'My actions',
460
- * groups: [
461
- * {
462
- * groupId: 'undo',
463
- * items: [
464
- * 'myButton1',
465
- * 'myButton2'
466
- * ]
467
- * }
468
- * ]
469
- * }
470
- * ]
471
- * }
472
- * } )
473
- * .then( ... );
474
- * ```
475
- */
476
- menuBar?: MenuBarConfig;
477
- /**
478
- * Specifies the text displayed in the editor when there is no content (editor is empty). It is intended to
479
- * help users locate the editor in the application (form) and prompt them to input the content. Work similarly
480
- * as to the native DOM
481
- * [`placeholder` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#The_placeholder_attribute)
482
- * used by inputs.
483
- *
484
- * ```ts
485
- * ClassicEditor
486
- * .create( document.querySelector( '#editor' ), {
487
- * placeholder: 'Type some text...'
488
- * } )
489
- * .then( ... )
490
- * .catch( ... );
491
- * ```
492
- *
493
- * If your editor implementation uses multiple roots, you should pass an object with keys corresponding to the editor
494
- * roots names and values equal to the placeholder that should be set in each root:
495
- *
496
- * ```ts
497
- * MultiRootEditor.create(
498
- * // Roots for the editor:
499
- * {
500
- * header: document.querySelector( '#header' ),
501
- * content: document.querySelector( '#content' ),
502
- * leftSide: document.querySelector( '#left-side' ),
503
- * rightSide: document.querySelector( '#right-side' )
504
- * },
505
- * // Config:
506
- * {
507
- * placeholder: {
508
- * header: 'Type header...',
509
- * content: 'Type content...',
510
- * leftSide: 'Type left-side...',
511
- * rightSide: 'Type right-side...'
512
- * }
513
- * }
514
- * )
515
- * .then( ... )
516
- * .catch( ... );
517
- * ```
518
- *
519
- * The placeholder text is displayed as a pseudo–element of an empty paragraph in the editor content.
520
- * The paragraph has the `.ck-placeholder` CSS class and the `data-placeholder` attribute.
521
- *
522
- * ```html
523
- * <p data-placeholder="Type some text..." class="ck-placeholder">
524
- * ::before
525
- * </p>
526
- * ```
527
- *
528
- * **Note**: Placeholder text can also be set using the `placeholder` attribute if a `<textarea>` is passed to
529
- * the `create()` method, e.g. {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`}.
530
- *
531
- * **Note**: This configuration has precedence over the value of the `placeholder` attribute of a `<textarea>`
532
- * element passed to the `create()` method.
533
- *
534
- * See the {@glink features/editor-placeholder "Editor placeholder"} guide for more information and live examples.
535
- */
536
- placeholder?: string | Record<string, string>;
537
- /**
538
- * The list of plugins to load.
539
- *
540
- * ```ts
541
- * import {
542
- * // A preset of plugins is a plugin as well.
543
- * Essentials,
544
- * // The bold plugin.
545
- * Bold
546
- * } from 'ckeditor5';
547
- *
548
- * const config = {
549
- * plugins: [ Essentials, Bold ]
550
- * };
551
- * ```
552
- *
553
- * **Note:** To load additional plugins, you should use the {@link #extraPlugins `extraPlugins`} configuration.
554
- * To narrow the list of loaded plugins, use the {@link #removePlugins `removePlugins`} configuration.
555
- */
556
- plugins?: Array<PluginConstructor<Editor> | string>;
557
- /**
558
- * The list of plugins which should not be loaded despite being available in
559
- * the editor.
560
- *
561
- * ```ts
562
- * const config = {
563
- * removePlugins: [ 'Bold', 'Italic' ]
564
- * };
565
- * ```
566
- *
567
- * **Note:** Be careful when removing plugins using `config.removePlugins`.
568
- * If removed plugins were providing toolbar buttons, the default toolbar configuration included in a build
569
- * will become invalid. In such case you need to provide the updated
570
- * {@link module:core/editor/editorconfig~EditorConfig#toolbar toolbar configuration}.
571
- */
572
- removePlugins?: Array<PluginConstructor<Editor> | string>;
573
- substitutePlugins?: Array<PluginConstructor<Editor>>;
574
- /**
575
- * The editor toolbar configuration.
576
- *
577
- * Simple format (specifies only toolbar items):
578
- *
579
- * ```ts
580
- * const config = {
581
- * toolbar: [ 'bold', 'italic', '|', 'undo', 'redo' ]
582
- * };
583
- * ```
584
- *
585
- * Extended format:
586
- *
587
- * ```ts
588
- * const config = {
589
- * toolbar: {
590
- * items: [ 'bold', 'italic', '|', 'undo', 'redo', '-', 'numberedList', 'bulletedList' ],
591
- *
592
- * shouldNotGroupWhenFull: true
593
- * }
594
- * };
595
- * ```
596
- *
597
- * Options which can be set using the extended format:
598
- *
599
- * * **`toolbar.items`** &ndash; An array of toolbar item names. The components (buttons, dropdowns, etc.) which can be used
600
- * as toolbar items are defined in `editor.ui.componentFactory` and can be listed using the following snippet:
601
- *
602
- * ```ts
603
- * Array.from( editor.ui.componentFactory.names() );
604
- * ```
605
- *
606
- * You can also use `'|'` to create a separator between groups of items:
607
- *
608
- * ```
609
- * toolbar: [ 'bold', 'italic', '|', 'undo', 'redo' ]
610
- * ```
611
- *
612
- * or `'-'` to make a line break and render items in multiple lines:
613
- *
614
- * ```
615
- * toolbar: [ 'bold', 'italic', '-', 'undo', 'redo' ]
616
- * ```
617
- *
618
- * Line break will work only in the extended format when `shouldNotGroupWhenFull` option is set to `true`.
619
- *
620
- * **Note**: To save space in your toolbar, you can group several items into a dropdown:
621
- *
622
- * ```
623
- * toolbar: [
624
- * {
625
- * label: 'Basic styles',
626
- * icon: 'text',
627
- * items: [ 'bold', 'italic', ... ]
628
- * },
629
- * '|',
630
- * 'undo', 'redo'
631
- * ]
632
- * ```
633
- *
634
- * The code above will create a "Basic styles" dropdown with a "text" icon containing the "bold" and "italic" buttons.
635
- * You can customize the look of the dropdown by setting the `withText`, `icon`, and `tooltip` properties:
636
- *
637
- * * **Displaying a label**
638
- *
639
- * For instance, to hide the icon and to display the label only, you can use the following configuration:
640
- *
641
- * ```ts
642
- * {
643
- * label: 'Basic styles',
644
- * // Show the textual label of the drop-down. Note that the "icon" property is not configured.
645
- * withText: true,
646
- * items: [ 'bold', 'italic', ... ]
647
- * }
648
- * ```
649
- *
650
- * * **Selecting an icon**
651
- *
652
- * You can use one of the common icons provided by the editor (`'bold'`, `'plus'`, `'text'`, `'importExport'`, `'alignLeft'`,
653
- * `'paragraph'`, `'threeVerticalDots'`, `'dragIndicator'`, `'pilcrow'`):
654
- *
655
- * ```ts
656
- * {
657
- * label: '...',
658
- * // A "plus" sign icon works best for content insertion tools.
659
- * icon: 'plus',
660
- * items: [ ... ]
661
- * }
662
- * ```
663
- *
664
- * If no icon is specified, `'threeVerticalDots'` will be used as a default:
665
- *
666
- * ```ts
667
- * // No icon specified, using a default one.
668
- * {
669
- * label: 'Default icon',
670
- * items: [ ... ]
671
- * }
672
- * ```
673
- *
674
- * If `icon: false` is configured, no icon will be displayed at all and the text label will show up instead:
675
- *
676
- * ```ts
677
- * // This drop-down has no icon. The text label will be displayed instead.
678
- * {
679
- * label: 'No icon',
680
- * icon: false,
681
- * items: [ ... ]
682
- * }
683
- * ```
684
- *
685
- * You can also set a custom icon for the drop-down by passing an SVG string:
686
- *
687
- * ```ts
688
- * {
689
- * label: '...',
690
- * // If you want your icon to change the color dynamically (e.g. when the dropdown opens), avoid fill="..."
691
- * // and stroke="..." styling attributes. Use solid shapes and avoid paths with strokes.
692
- * icon: '<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">...</svg>',
693
- * items: [ ... ]
694
- * }
695
- * ```
696
- *
697
- * * **Customizing the tooltip**
698
- *
699
- * By default, the tooltip of the button shares its text with the label. You can customize it to better describe your dropdown
700
- * using the `tooltip` property ({@link module:ui/button/buttonview~ButtonView#tooltip learn more}):
701
- *
702
- * ```ts
703
- * {
704
- * label: 'Drop-down label',
705
- * tooltip: 'Custom tooltip of the drop-down',
706
- * icon: '...',
707
- * items: [ ... ]
708
- * }
709
- * ```
710
- *
711
- * * **`toolbar.viewportTopOffset` (deprecated)** &ndash; The offset (in pixels) from the top of the viewport used when positioning a
712
- * sticky toolbar.
713
- * Useful when a page with which the editor is being integrated has some other sticky or fixed elements
714
- * (e.g. the top menu). Thanks to setting the toolbar offset the toolbar will not be positioned underneath or above the page's UI.
715
- *
716
- * **This property has been deprecated and will be removed in the future versions of CKEditor. Please use
717
- * `{@link module:core/editor/editorconfig~EditorConfig#ui EditorConfig#ui.viewportOffset}` instead.**
718
- *
719
- * * **`toolbar.shouldNotGroupWhenFull`** &ndash; When set to `true`, the toolbar will stop grouping items
720
- * and let them wrap to the next line if there is not enough space to display them in a single row.
721
- */
722
- toolbar?: ToolbarConfig;
723
- /**
724
- * The editor UI configuration.
725
- *
726
- * ```ts
727
- * ClassicEditor
728
- * .create( document.querySelector( '#editor' ), {
729
- * ui: { ... }
730
- * } )
731
- * .then( ... )
732
- * .catch( ... );
733
- * ```
734
- *
735
- * Options which can be set using the UI configuration:
736
- *
737
- * * **`ui.viewportOffset`** &ndash; The offset (in pixels) of the viewport from every direction. It is
738
- * used when positioning a sticky toolbar or other absolutely positioned UI elements.
739
- * Useful when a page with which the editor is being integrated has some other sticky or fixed elements
740
- * (e.g. the top menu). Thanks to setting the UI viewport offset, the toolbar and other contextual balloons will not be positioned
741
- * underneath or above the page's UI.
742
- *
743
- * ```ts
744
- * ui: {
745
- * viewportOffset: { top: 10, right: 10, bottom: 10, left: 10 }
746
- * }
747
- * ```
748
- *
749
- * **Note:** If you want to modify the viewport offset in runtime (after the editor was created), you can do that by overriding
750
- * {@link module:ui/editorui/editorui~EditorUI#viewportOffset `editor.ui.viewportOffset`}.
751
- *
752
- * * **`ui.poweredBy`** &ndash; The configuration of the project logo displayed over the editor's editing area in
753
- * open-source integrations. It allows customizing the position of the logo to minimize the risk of collision with the
754
- * editor content and UI.
755
- *
756
- * The following configuration properties are supported:
757
- *
758
- * * **`position`** &ndash; The position of the project's logo (default: `'border'`).
759
- * * When `'inside'`, the logo will be displayed within the boundaries of the editing area.
760
- * * When `'border'`, the logo will be displayed over the bottom border of the editing area.
761
- *
762
- * * **`side`** (`'left'` or `'right'`, default: `'right'`) &ndash; The side of the editing area where the
763
- * logo will be displayed.
764
- *
765
- * **Note**: If {@link module:core/editor/editorconfig~EditorConfig#language `config.language`} is set to an RTL (right-to-left)
766
- * language, the side switches to `'left'` by default.
767
- *
768
- * * **`label`** (default: `'Powered by'`) &ndash; The label displayed next to the project's logo.
769
- *
770
- * **Note**: Set the value to `null` to display the logo without any text.
771
- *
772
- * * **`verticalOffset`** (default: `5`) &ndash; The vertical distance the logo can be moved away from its default position.
773
- *
774
- * **Note**: If `position` is `'border'`, the offset is measured from the (vertical) center of the logo.
775
- *
776
- * * **`horizontalOffset`** (default: `5`) &ndash; The horizontal distance between the side of the editing root and the
777
- * nearest side of the logo.
778
- *
779
- * ```ts
780
- * ui: {
781
- * poweredBy: {
782
- * position: 'border',
783
- * side: 'left',
784
- * verticalOffset: 2,
785
- * horizontalOffset: 30
786
- * }
787
- * }
788
- */
789
- ui?: UiConfig;
790
- /**
791
- * Enables updating the source element after the editor is destroyed.
792
- *
793
- * Enabling this option might have some security implications, as the editor doesn't have control over all data
794
- * in the output.
795
- *
796
- * Be careful, especially while using the
797
- * {@glink features/markdown Markdown}, {@glink features/html/general-html-support General HTML Support}, or
798
- * {@glink features/html/html-embed HTML embed} features.
799
- */
800
- updateSourceElementOnDestroy?: boolean;
801
- /**
802
- * The CKEditor 5 license key. If you want to obtain a license key, please do one of the following:
803
- *
804
- * * Create a free account, and test the premium features with a [14-day free trial](https://portal.ckeditor.com/checkout?plan=free).
805
- * * [Contact us](https://ckeditor.com/contact/) for a commercial license.
806
- * * If you are using the editor under a GPL license or another license from our Open Source Initiative,
807
- * use the 'GPL' license key instead.
808
- */
809
- licenseKey?: string;
810
- /**
811
- * Translations to be used in the editor.
812
- */
813
- translations?: ArrayOrItem<Translations>;
814
- /**
815
- * Label text for the `aria-label` attribute set on editor editing area. Used by assistive technologies
816
- * to tell apart multiple editor instances (editing areas) on the page. If not set, a default
817
- * "Rich Text Editor. Editing area [name of the area]" is used instead.
818
- *
819
- * ```ts
820
- * ClassicEditor
821
- * .create( document.querySelector( '#editor' ), {
822
- * label: 'My editor'
823
- * } )
824
- * .then( ... )
825
- * .catch( ... );
826
- * ```
827
- *
828
- * If your editor implementation uses multiple roots, you should pass an object with keys corresponding to the editor
829
- * roots names and values equal to the label that should be used for each root:
830
- *
831
- * ```ts
832
- * MultiRootEditor.create(
833
- * // Roots for the editor:
834
- * {
835
- * header: document.querySelector( '#header' ),
836
- * content: document.querySelector( '#content' ),
837
- * leftSide: document.querySelector( '#left-side' ),
838
- * rightSide: document.querySelector( '#right-side' )
839
- * },
840
- * // Config:
841
- * {
842
- * label: {
843
- * header: 'Header label',
844
- * content: 'Content label',
845
- * leftSide: 'Left side label',
846
- * rightSide: 'Right side label'
847
- * }
848
- * }
849
- * )
850
- * .then( ... )
851
- * .catch( ... );
852
- * ```
853
- */
854
- label?: string | Record<string, string>;
855
- }
856
- /**
857
- * The `config.initialData` option cannot be used together with the initial data passed as the first parameter of
858
- * {@link module:core/editor/editor~Editor.create `Editor.create()`}.
859
- *
860
- * @error editor-create-initial-data
861
- */
862
- /**
863
- * The configuration of the editor language.
864
- *
865
- * ```ts
866
- * ClassicEditor
867
- * .create( document.querySelector( '#editor' ), {
868
- * language: ... // The editor language configuration.
869
- * } )
870
- * .then( editor => {
871
- * console.log( editor );
872
- * } )
873
- * .catch( error => {
874
- * console.error( error );
875
- * } );
876
- * ```
877
- *
878
- * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
879
- */
880
- export interface LanguageConfig {
881
- /**
882
- * Allows to use a different language for the editor UI.
883
- *
884
- * The language codes are defined in the [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) standard.
885
- */
886
- ui?: string;
887
- /**
888
- * Allows to use a different language of the editor content.
889
- *
890
- * The language codes are defined in the [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) standard.
891
- */
892
- content?: string;
893
- }
894
- export type ToolbarConfig = Array<ToolbarConfigItem> | {
895
- items?: Array<ToolbarConfigItem>;
896
- removeItems?: Array<string>;
897
- shouldNotGroupWhenFull?: boolean;
898
- icon?: string;
899
- };
900
- export type ToolbarConfigItem = string | {
901
- items: Array<ToolbarConfigItem>;
902
- label: string;
903
- icon?: string | false;
904
- withText?: boolean;
905
- tooltip?: boolean | string | ((label: string, keystroke: string | undefined) => string);
906
- };
907
- /**
908
- * The “Powered by CKEditor” logo configuration options.
909
- **/
910
- export interface PoweredByConfig {
911
- /**
912
- * The position of the project's logo.
913
- *
914
- * * When `'inside'`, the logo will be displayed within the boundaries of the editing area.
915
- * * When `'border'`, the logo will be displayed over the bottom border of the editing area.
916
- *
917
- * @default 'border'
918
- */
919
- position?: 'inside' | 'border';
920
- /**
921
- * Allows choosing the side of the editing area where the logo will be displayed.
922
- *
923
- * **Note:** If {@link module:core/editor/editorconfig~EditorConfig#language `config.language`} is set to an RTL (right-to-left)
924
- * language, the side switches to `'left'` by default.
925
- *
926
- * @default 'right'
927
- */
928
- side?: 'left' | 'right';
929
- /**
930
- * Allows changing the label displayed next to the CKEditor logo.
931
- *
932
- * **Note:** Set the value to `null` to hide the label.
933
- *
934
- * @default 'Powered by'
935
- */
936
- label?: string | null;
937
- /**
938
- * The vertical distance the logo can be moved away from its default position.
939
- *
940
- * **Note:** If `position` is `'border'`, the offset is measured from the (vertical) center of the logo.
941
- *
942
- * @default 5
943
- */
944
- verticalOffset?: number;
945
- /**
946
- * The horizontal distance between the side of the editing root and the nearest side of the logo.
947
- *
948
- * @default 5
949
- */
950
- horizontalOffset?: number;
951
- /**
952
- * Allows to show the logo even if the valid commercial license is configured using
953
- * the {@link module:core/editor/editorconfig~EditorConfig#licenseKey `config.licenseKey`} setting.
954
- *
955
- * @default false
956
- */
957
- forceVisible?: boolean;
958
- }
959
- /**
960
- * The offset (in pixels) of the viewport from every direction used when positioning a sticky toolbar or other
961
- * absolutely positioned UI elements.
962
- */
963
- export interface ViewportOffsetConfig {
964
- /**
965
- * The bottom offset in pixels.
966
- */
967
- bottom?: number;
968
- /**
969
- * The left offset in pixels.
970
- */
971
- left?: number;
972
- /**
973
- * The right offset in pixels.
974
- */
975
- right?: number;
976
- /**
977
- * The top offset in pixels.
978
- */
979
- top?: number;
980
- }
981
- export interface UiConfig {
982
- /**
983
- * The viewport offset used for positioning various absolutely positioned UI elements.
984
- *
985
- * Read more in {@link module:core/editor/editorconfig~ViewportOffsetConfig}.
986
- **/
987
- viewportOffset?: ViewportOffsetConfig;
988
- /**
989
- * The configuration of the “Powered by CKEditor” logo.
990
- *
991
- * Read more in {@link module:core/editor/editorconfig~PoweredByConfig}.
992
- **/
993
- poweredBy?: PoweredByConfig;
994
- }