@ckeditor/ckeditor5-core 44.1.0-alpha.5 → 44.2.0-alpha.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 (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,530 +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
- import { Config, type Locale, type LocaleTranslate } from '@ckeditor/ckeditor5-utils';
10
- import { Conversion, DataController, EditingController, Model } from '@ckeditor/ckeditor5-engine';
11
- import type { EditorUI } from '@ckeditor/ckeditor5-ui';
12
- import { ContextWatchdog, EditorWatchdog } from '@ckeditor/ckeditor5-watchdog';
13
- import Context from '../context.js';
14
- import PluginCollection from '../plugincollection.js';
15
- import CommandCollection, { type CommandsMap } from '../commandcollection.js';
16
- import EditingKeystrokeHandler from '../editingkeystrokehandler.js';
17
- import Accessibility from '../accessibility.js';
18
- import type { LoadedPlugins, PluginConstructor } from '../plugin.js';
19
- import type { EditorConfig } from './editorconfig.js';
20
- declare global {
21
- var CKEDITOR_GLOBAL_LICENSE_KEY: string | undefined;
22
- }
23
- declare const Editor_base: {
24
- new (): import("@ckeditor/ckeditor5-utils").Observable;
25
- prototype: import("@ckeditor/ckeditor5-utils").Observable;
26
- };
27
- /**
28
- * The class representing a basic, generic editor.
29
- *
30
- * Check out the list of its subclasses to learn about specific editor implementations.
31
- *
32
- * All editor implementations (like {@link module:editor-classic/classiceditor~ClassicEditor} or
33
- * {@link module:editor-inline/inlineeditor~InlineEditor}) should extend this class. They can add their
34
- * own methods and properties.
35
- *
36
- * When you are implementing a plugin, this editor represents the API
37
- * which your plugin can expect to get when using its {@link module:core/plugin~Plugin#editor} property.
38
- *
39
- * This API should be sufficient in order to implement the "editing" part of your feature
40
- * (schema definition, conversion, commands, keystrokes, etc.).
41
- * It does not define the editor UI, which is available only if
42
- * the specific editor implements also the {@link ~Editor#ui} property
43
- * (as most editor implementations do).
44
- */
45
- export default abstract class Editor extends /* #__PURE__ */ Editor_base {
46
- /**
47
- * A required name of the editor class. The name should reflect the constructor name.
48
- */
49
- static get editorName(): `${string}Editor`;
50
- /**
51
- * A namespace for the accessibility features of the editor.
52
- */
53
- readonly accessibility: Accessibility;
54
- /**
55
- * Commands registered to the editor.
56
- *
57
- * Use the shorthand {@link #execute `editor.execute()`} method to execute commands:
58
- *
59
- * ```ts
60
- * // Execute the bold command:
61
- * editor.execute( 'bold' );
62
- *
63
- * // Check the state of the bold command:
64
- * editor.commands.get( 'bold' ).value;
65
- * ```
66
- */
67
- readonly commands: CommandCollection;
68
- /**
69
- * Stores all configurations specific to this editor instance.
70
- *
71
- * ```ts
72
- * editor.config.get( 'image.toolbar' );
73
- * // -> [ 'imageStyle:block', 'imageStyle:side', '|', 'toggleImageCaption', 'imageTextAlternative' ]
74
- * ```
75
- */
76
- readonly config: Config<EditorConfig>;
77
- /**
78
- * Conversion manager through which you can register model-to-view and view-to-model converters.
79
- *
80
- * See the {@link module:engine/conversion/conversion~Conversion} documentation to learn how to add converters.
81
- */
82
- readonly conversion: Conversion;
83
- /**
84
- * The {@link module:engine/controller/datacontroller~DataController data controller}.
85
- * Used e.g. for setting and retrieving the editor data.
86
- */
87
- readonly data: DataController;
88
- /**
89
- * The {@link module:engine/controller/editingcontroller~EditingController editing controller}.
90
- * Controls user input and rendering the content for editing.
91
- */
92
- readonly editing: EditingController;
93
- /**
94
- * The locale instance.
95
- */
96
- readonly locale: Locale;
97
- /**
98
- * The editor's model.
99
- *
100
- * The central point of the editor's abstract data model.
101
- */
102
- readonly model: Model;
103
- /**
104
- * The plugins loaded and in use by this editor instance.
105
- *
106
- * ```ts
107
- * editor.plugins.get( 'ClipboardPipeline' ); // -> An instance of the clipboard pipeline plugin.
108
- * ```
109
- */
110
- readonly plugins: PluginCollection<Editor>;
111
- /**
112
- * An instance of the {@link module:core/editingkeystrokehandler~EditingKeystrokeHandler}.
113
- *
114
- * It allows setting simple keystrokes:
115
- *
116
- * ```ts
117
- * // Execute the bold command on Ctrl+E:
118
- * editor.keystrokes.set( 'Ctrl+E', 'bold' );
119
- *
120
- * // Execute your own callback:
121
- * editor.keystrokes.set( 'Ctrl+E', ( data, cancel ) => {
122
- * console.log( data.keyCode );
123
- *
124
- * // Prevent the default (native) action and stop the underlying keydown event
125
- * // so no other editor feature will interfere.
126
- * cancel();
127
- * } );
128
- * ```
129
- *
130
- * Note: Certain typing-oriented keystrokes (like <kbd>Backspace</kbd> or <kbd>Enter</kbd>) are handled
131
- * by a low-level mechanism and trying to listen to them via the keystroke handler will not work reliably.
132
- * To handle these specific keystrokes, see the events fired by the
133
- * {@link module:engine/view/document~Document editing view document} (`editor.editing.view.document`).
134
- */
135
- readonly keystrokes: EditingKeystrokeHandler;
136
- /**
137
- * Shorthand for {@link module:utils/locale~Locale#t}.
138
- *
139
- * @see module:utils/locale~Locale#t
140
- */
141
- readonly t: LocaleTranslate;
142
- readonly id: string;
143
- /**
144
- * Indicates the editor life-cycle state.
145
- *
146
- * The editor is in one of the following states:
147
- *
148
- * * `initializing` &ndash; During the editor initialization (before
149
- * {@link module:core/editor/editor~Editor.create `Editor.create()`}) finished its job.
150
- * * `ready` &ndash; After the promise returned by the {@link module:core/editor/editor~Editor.create `Editor.create()`}
151
- * method is resolved.
152
- * * `destroyed` &ndash; Once the {@link #destroy `editor.destroy()`} method was called.
153
- *
154
- * @observable
155
- */
156
- state: 'initializing' | 'ready' | 'destroyed';
157
- /**
158
- * The default configuration which is built into the editor class.
159
- *
160
- * It is used in CKEditor 5 builds to provide the default configuration options which are later used during the editor initialization.
161
- *
162
- * ```ts
163
- * ClassicEditor.defaultConfig = {
164
- * foo: 1,
165
- * bar: 2
166
- * };
167
- *
168
- * ClassicEditor
169
- * .create( sourceElement )
170
- * .then( editor => {
171
- * editor.config.get( 'foo' ); // -> 1
172
- * editor.config.get( 'bar' ); // -> 2
173
- * } );
174
- *
175
- * // The default options can be overridden by the configuration passed to create().
176
- * ClassicEditor
177
- * .create( sourceElement, { bar: 3 } )
178
- * .then( editor => {
179
- * editor.config.get( 'foo' ); // -> 1
180
- * editor.config.get( 'bar' ); // -> 3
181
- * } );
182
- * ```
183
- *
184
- * See also {@link module:core/editor/editor~Editor.builtinPlugins}.
185
- */
186
- static defaultConfig?: EditorConfig;
187
- /**
188
- * An array of plugins built into this editor class.
189
- *
190
- * It is used in CKEditor 5 builds to provide a list of plugins which are later automatically initialized
191
- * during the editor initialization.
192
- *
193
- * They will be automatically initialized by the editor, unless listed in `config.removePlugins` and
194
- * unless `config.plugins` is passed.
195
- *
196
- * ```ts
197
- * // Build some plugins into the editor class first.
198
- * ClassicEditor.builtinPlugins = [ FooPlugin, BarPlugin ];
199
- *
200
- * // Normally, you need to define config.plugins, but since ClassicEditor.builtinPlugins was
201
- * // defined, now you can call create() without any configuration.
202
- * ClassicEditor
203
- * .create( sourceElement )
204
- * .then( editor => {
205
- * editor.plugins.get( FooPlugin ); // -> An instance of the Foo plugin.
206
- * editor.plugins.get( BarPlugin ); // -> An instance of the Bar plugin.
207
- * } );
208
- *
209
- * ClassicEditor
210
- * .create( sourceElement, {
211
- * // Do not initialize these plugins (note: it is defined by a string):
212
- * removePlugins: [ 'Foo' ]
213
- * } )
214
- * .then( editor => {
215
- * editor.plugins.get( FooPlugin ); // -> Undefined.
216
- * editor.config.get( BarPlugin ); // -> An instance of the Bar plugin.
217
- * } );
218
- *
219
- * ClassicEditor
220
- * .create( sourceElement, {
221
- * // Load only this plugin. It can also be defined by a string if
222
- * // this plugin was built into the editor class.
223
- * plugins: [ FooPlugin ]
224
- * } )
225
- * .then( editor => {
226
- * editor.plugins.get( FooPlugin ); // -> An instance of the Foo plugin.
227
- * editor.config.get( BarPlugin ); // -> Undefined.
228
- * } );
229
- * ```
230
- *
231
- * See also {@link module:core/editor/editor~Editor.defaultConfig}.
232
- */
233
- static builtinPlugins?: Array<PluginConstructor<Editor>>;
234
- /**
235
- * The editor UI instance.
236
- */
237
- abstract get ui(): EditorUI;
238
- /**
239
- * The editor context.
240
- * When it is not provided through the configuration, the editor creates it.
241
- */
242
- protected readonly _context: Context;
243
- /**
244
- * A set of lock IDs for the {@link #isReadOnly} getter.
245
- */
246
- protected readonly _readOnlyLocks: Set<symbol | string>;
247
- /**
248
- * Creates a new instance of the editor class.
249
- *
250
- * Usually, not to be used directly. See the static {@link module:core/editor/editor~Editor.create `create()`} method.
251
- *
252
- * @param config The editor configuration.
253
- */
254
- constructor(config?: EditorConfig);
255
- /**
256
- * Defines whether the editor is in the read-only mode.
257
- *
258
- * In read-only mode the editor {@link #commands commands} are disabled so it is not possible
259
- * to modify the document by using them. Also, the editable element(s) become non-editable.
260
- *
261
- * In order to make the editor read-only, you need to call the {@link #enableReadOnlyMode} method:
262
- *
263
- * ```ts
264
- * editor.enableReadOnlyMode( 'feature-id' );
265
- * ```
266
- *
267
- * Later, to turn off the read-only mode, call {@link #disableReadOnlyMode}:
268
- *
269
- * ```ts
270
- * editor.disableReadOnlyMode( 'feature-id' );
271
- * ```
272
- *
273
- * @readonly
274
- * @observable
275
- */
276
- get isReadOnly(): boolean;
277
- set isReadOnly(value: boolean);
278
- /**
279
- * Turns on the read-only mode in the editor.
280
- *
281
- * Editor can be switched to or out of the read-only mode by many features, under various circumstances. The editor supports locking
282
- * mechanism for the read-only mode. It enables easy control over the read-only mode when many features wants to turn it on or off at
283
- * the same time, without conflicting with each other. It guarantees that you will not make the editor editable accidentally (which
284
- * could lead to errors).
285
- *
286
- * Each read-only mode request is identified by a unique id (also called "lock"). If multiple plugins requested to turn on the
287
- * read-only mode, then, the editor will become editable only after all these plugins turn the read-only mode off (using the same ids).
288
- *
289
- * Note, that you cannot force the editor to disable the read-only mode if other plugins set it.
290
- *
291
- * After the first `enableReadOnlyMode()` call, the {@link #isReadOnly `isReadOnly` property} will be set to `true`:
292
- *
293
- * ```ts
294
- * editor.isReadOnly; // `false`.
295
- * editor.enableReadOnlyMode( 'my-feature-id' );
296
- * editor.isReadOnly; // `true`.
297
- * ```
298
- *
299
- * You can turn off the read-only mode ("clear the lock") using the {@link #disableReadOnlyMode `disableReadOnlyMode()`} method:
300
- *
301
- * ```ts
302
- * editor.enableReadOnlyMode( 'my-feature-id' );
303
- * // ...
304
- * editor.disableReadOnlyMode( 'my-feature-id' );
305
- * editor.isReadOnly; // `false`.
306
- * ```
307
- *
308
- * All "locks" need to be removed to enable editing:
309
- *
310
- * ```ts
311
- * editor.enableReadOnlyMode( 'my-feature-id' );
312
- * editor.enableReadOnlyMode( 'my-other-feature-id' );
313
- * // ...
314
- * editor.disableReadOnlyMode( 'my-feature-id' );
315
- * editor.isReadOnly; // `true`.
316
- * editor.disableReadOnlyMode( 'my-other-feature-id' );
317
- * editor.isReadOnly; // `false`.
318
- * ```
319
- *
320
- * @param lockId A unique ID for setting the editor to the read-only state.
321
- */
322
- enableReadOnlyMode(lockId: string | symbol): void;
323
- /**
324
- * Removes the read-only lock from the editor with given lock ID.
325
- *
326
- * When no lock is present on the editor anymore, then the {@link #isReadOnly `isReadOnly` property} will be set to `false`.
327
- *
328
- * @param lockId The lock ID for setting the editor to the read-only state.
329
- */
330
- disableReadOnlyMode(lockId: string | symbol): void;
331
- /**
332
- * Sets the data in the editor.
333
- *
334
- * ```ts
335
- * editor.setData( '<p>This is editor!</p>' );
336
- * ```
337
- *
338
- * If your editor implementation uses multiple roots, you should pass an object with keys corresponding
339
- * to the editor root names and values equal to the data that should be set in each root:
340
- *
341
- * ```ts
342
- * editor.setData( {
343
- * header: '<p>Content for header part.</p>',
344
- * content: '<p>Content for main part.</p>',
345
- * footer: '<p>Content for footer part.</p>'
346
- * } );
347
- * ```
348
- *
349
- * By default the editor accepts HTML. This can be controlled by injecting a different data processor.
350
- * See the {@glink features/markdown Markdown output} guide for more details.
351
- *
352
- * @param data Input data.
353
- */
354
- setData(data: string | Record<string, string>): void;
355
- /**
356
- * Gets the data from the editor.
357
- *
358
- * ```ts
359
- * editor.getData(); // -> '<p>This is editor!</p>'
360
- * ```
361
- *
362
- * If your editor implementation uses multiple roots, you should pass root name as one of the options:
363
- *
364
- * ```ts
365
- * editor.getData( { rootName: 'header' } ); // -> '<p>Content for header part.</p>'
366
- * ```
367
- *
368
- * By default, the editor outputs HTML. This can be controlled by injecting a different data processor.
369
- * See the {@glink features/markdown Markdown output} guide for more details.
370
- *
371
- * A warning is logged when you try to retrieve data for a detached root, as most probably this is a mistake. A detached root should
372
- * be treated like it is removed, and you should not save its data. Note, that the detached root data is always an empty string.
373
- *
374
- * @param options Additional configuration for the retrieved data.
375
- * Editor features may introduce more configuration options that can be set through this parameter.
376
- * @param options.rootName Root name. Defaults to `'main'`.
377
- * @param options.trim Whether returned data should be trimmed. This option is set to `'empty'` by default,
378
- * which means that whenever editor content is considered empty, an empty string is returned. To turn off trimming
379
- * use `'none'`. In such cases exact content will be returned (for example `'<p>&nbsp;</p>'` for an empty editor).
380
- * @returns Output data.
381
- */
382
- getData(options?: {
383
- rootName?: string;
384
- trim?: 'empty' | 'none';
385
- [key: string]: unknown;
386
- }): string;
387
- /**
388
- * Loads and initializes plugins specified in the configuration.
389
- *
390
- * @returns A promise which resolves once the initialization is completed, providing an array of loaded plugins.
391
- */
392
- initPlugins(): Promise<LoadedPlugins>;
393
- /**
394
- * Destroys the editor instance, releasing all resources used by it.
395
- *
396
- * **Note** The editor cannot be destroyed during the initialization phase so if it is called
397
- * while the editor {@link #state is being initialized}, it will wait for the editor initialization before destroying it.
398
- *
399
- * @fires destroy
400
- * @returns A promise that resolves once the editor instance is fully destroyed.
401
- */
402
- destroy(): Promise<unknown>;
403
- /**
404
- * Executes the specified command with given parameters.
405
- *
406
- * Shorthand for:
407
- *
408
- * ```ts
409
- * editor.commands.get( commandName ).execute( ... );
410
- * ```
411
- *
412
- * @param commandName The name of the command to execute.
413
- * @param commandParams Command parameters.
414
- * @returns The value returned by the {@link module:core/commandcollection~CommandCollection#execute `commands.execute()`}.
415
- */
416
- execute<TName extends string>(commandName: TName, ...commandParams: Parameters<CommandsMap[TName]['execute']>): ReturnType<CommandsMap[TName]['execute']>;
417
- /**
418
- * Focuses the editor.
419
- *
420
- * **Note** To explicitly focus the editing area of the editor, use the
421
- * {@link module:engine/view/view~View#focus `editor.editing.view.focus()`} method of the editing view.
422
- *
423
- * Check out the {@glink framework/deep-dive/ui/focus-tracking#focus-in-the-editor-ui Focus in the editor UI} section
424
- * of the {@glink framework/deep-dive/ui/focus-tracking Deep dive into focus tracking} guide to learn more.
425
- */
426
- focus(): void;
427
- /**
428
- * Creates and initializes a new editor instance.
429
- *
430
- * This is an abstract method. Every editor type needs to implement its own initialization logic.
431
- *
432
- * See the `create()` methods of the existing editor types to learn how to use them:
433
- *
434
- * * {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`}
435
- * * {@link module:editor-balloon/ballooneditor~BalloonEditor.create `BalloonEditor.create()`}
436
- * * {@link module:editor-decoupled/decouplededitor~DecoupledEditor.create `DecoupledEditor.create()`}
437
- * * {@link module:editor-inline/inlineeditor~InlineEditor.create `InlineEditor.create()`}
438
- */
439
- static create(...args: Array<unknown>): void;
440
- /**
441
- * The {@link module:core/context~Context} class.
442
- *
443
- * Exposed as static editor field for easier access in editor builds.
444
- */
445
- static Context: typeof Context;
446
- /**
447
- * The {@link module:watchdog/editorwatchdog~EditorWatchdog} class.
448
- *
449
- * Exposed as static editor field for easier access in editor builds.
450
- */
451
- static EditorWatchdog: typeof EditorWatchdog;
452
- /**
453
- * The {@link module:watchdog/contextwatchdog~ContextWatchdog} class.
454
- *
455
- * Exposed as static editor field for easier access in editor builds.
456
- */
457
- static ContextWatchdog: typeof ContextWatchdog;
458
- private _showLicenseError;
459
- /**
460
- * This part of the code is _not_ executed in installations under the GPL license (with `config.licenseKey = 'GPL'`).
461
- *
462
- * It is only executed when a specific license key is provided. If you are uncertain whether
463
- * this applies to your installation, please contact our support team.
464
- */
465
- private _sendUsageRequest;
466
- }
467
- /**
468
- * Fired when the {@link module:engine/controller/datacontroller~DataController#event:ready data} and all additional
469
- * editor components are ready.
470
- *
471
- * Note: This event is most useful for plugin developers. When integrating the editor with your website or
472
- * application, you do not have to listen to `editor#ready` because when the promise returned by the static
473
- * {@link module:core/editor/editor~Editor.create `Editor.create()`} event is resolved, the editor is already ready.
474
- * In fact, since the first moment when the editor instance is available to you is inside `then()`'s callback,
475
- * you cannot even add a listener to the `editor#ready` event.
476
- *
477
- * See also the {@link module:core/editor/editor~Editor#state `editor.state`} property.
478
- *
479
- * @eventName ~Editor#ready
480
- */
481
- export type EditorReadyEvent = {
482
- name: 'ready';
483
- args: [];
484
- };
485
- /**
486
- * Fired when the editor is about to collect usage data.
487
- *
488
- * This event is fired when the editor is about to collect usage data. It allows plugins to provide additional data for
489
- * the usage statistics. The usage data is collected by the editor and sent to the usage tracking server. All plugins are
490
- * expected to be ready at this point.
491
- *
492
- * @eventName ~Editor#collectUsageData
493
- */
494
- export type EditorCollectUsageDataEvent = {
495
- name: 'collectUsageData';
496
- args: [
497
- {
498
- setUsageData(path: string, value: unknown): void;
499
- }
500
- ];
501
- };
502
- /**
503
- * Fired when this editor instance is destroyed. The editor at this point is not usable and this event should be used to
504
- * perform the clean-up in any plugin.
505
- *
506
- * See also the {@link module:core/editor/editor~Editor#state `editor.state`} property.
507
- *
508
- * @eventName ~Editor#destroy
509
- */
510
- export type EditorDestroyEvent = {
511
- name: 'destroy';
512
- args: [];
513
- };
514
- export {};
515
- /**
516
- * This error is thrown when trying to pass a `<textarea>` element to a `create()` function of an editor class.
517
- *
518
- * The only editor type which can be initialized on `<textarea>` elements is
519
- * the {@glink getting-started/setup/editor-types#classic-editor classic editor}.
520
- * This editor hides the passed element and inserts its own UI next to it. Other types of editors reuse the passed element as their root
521
- * editable element and therefore `<textarea>` is not appropriate for them. Use a `<div>` or another text container instead:
522
- *
523
- * ```html
524
- * <div id="editor">
525
- * <p>Initial content.</p>
526
- * </div>
527
- * ```
528
- *
529
- * @error editor-wrong-element
530
- */