@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
package/dist/command.d.ts DELETED
@@ -1,193 +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/command
11
- */
12
- import { type DecoratedMethodEvent } from '@ckeditor/ckeditor5-utils';
13
- import type Editor from './editor/editor.js';
14
- declare const Command_base: {
15
- new (): import("@ckeditor/ckeditor5-utils").Observable;
16
- prototype: import("@ckeditor/ckeditor5-utils").Observable;
17
- };
18
- /**
19
- * Base class for the CKEditor commands.
20
- *
21
- * Commands are the main way to manipulate the editor contents and state. They are mostly used by UI elements (or by other
22
- * commands) to make changes in the model. Commands are available in every part of the code that has access to
23
- * the {@link module:core/editor/editor~Editor editor} instance.
24
- *
25
- * Instances of registered commands can be retrieved from {@link module:core/editor/editor~Editor#commands `editor.commands`}.
26
- * The easiest way to execute a command is through {@link module:core/editor/editor~Editor#execute `editor.execute()`}.
27
- *
28
- * By default, commands are disabled when the editor is in the {@link module:core/editor/editor~Editor#isReadOnly read-only} mode
29
- * but commands with the {@link module:core/command~Command#affectsData `affectsData`} flag set to `false` will not be disabled.
30
- */
31
- export default class Command extends /* #__PURE__ */ Command_base {
32
- /**
33
- * The editor on which this command will be used.
34
- */
35
- readonly editor: Editor;
36
- /**
37
- * The value of the command. A given command class should define what it represents for it.
38
- *
39
- * For example, the `'bold'` command's value indicates whether the selection starts in a bolded text.
40
- * And the value of the `'link'` command may be an object with link details.
41
- *
42
- * It is possible for a command to have no value (e.g. for stateless actions such as `'uploadImage'`).
43
- *
44
- * A given command class should control this value by overriding the {@link #refresh `refresh()`} method.
45
- *
46
- * @observable
47
- * @readonly
48
- */
49
- value: unknown;
50
- /**
51
- * Flag indicating whether a command is enabled or disabled.
52
- * A disabled command will do nothing when executed.
53
- *
54
- * A given command class should control this value by overriding the {@link #refresh `refresh()`} method.
55
- *
56
- * It is possible to disable a command "from outside" using {@link #forceDisabled} method.
57
- *
58
- * @observable
59
- * @readonly
60
- */
61
- isEnabled: boolean;
62
- /**
63
- * A flag indicating whether a command's `isEnabled` state should be changed depending on where the document
64
- * selection is placed.
65
- *
66
- * By default, it is set to `true`. If the document selection is placed in a
67
- * {@link module:engine/model/model~Model#canEditAt non-editable} place (such as non-editable root), the command becomes disabled.
68
- *
69
- * The flag should be changed to `false` in a concrete command's constructor if the command should not change its `isEnabled`
70
- * accordingly to the document selection.
71
- */
72
- protected _isEnabledBasedOnSelection: boolean;
73
- /**
74
- * A flag indicating whether a command execution changes the editor data or not.
75
- *
76
- * @see #affectsData
77
- */
78
- private _affectsData;
79
- /**
80
- * Holds identifiers for {@link #forceDisabled} mechanism.
81
- */
82
- private readonly _disableStack;
83
- /**
84
- * Creates a new `Command` instance.
85
- *
86
- * @param editor The editor on which this command will be used.
87
- */
88
- constructor(editor: Editor);
89
- /**
90
- * A flag indicating whether a command execution changes the editor data or not.
91
- *
92
- * Commands with `affectsData` set to `false` will not be automatically disabled in
93
- * the {@link module:core/editor/editor~Editor#isReadOnly read-only mode} and
94
- * {@glink features/read-only#related-features other editor modes} with restricted user write permissions.
95
- *
96
- * **Note:** You do not have to set it for your every command. It is `true` by default.
97
- *
98
- * @default true
99
- */
100
- get affectsData(): boolean;
101
- protected set affectsData(affectsData: boolean);
102
- /**
103
- * Refreshes the command. The command should update its {@link #isEnabled} and {@link #value} properties
104
- * in this method.
105
- *
106
- * This method is automatically called when
107
- * {@link module:engine/model/document~Document#event:change any changes are applied to the document}.
108
- */
109
- refresh(): void;
110
- /**
111
- * Disables the command.
112
- *
113
- * Command may be disabled by multiple features or algorithms (at once). When disabling a command, unique id should be passed
114
- * (e.g. the feature name). The same identifier should be used when {@link #clearForceDisabled enabling back} the command.
115
- * The command becomes enabled only after all features {@link #clearForceDisabled enabled it back}.
116
- *
117
- * Disabling and enabling a command:
118
- *
119
- * ```ts
120
- * command.isEnabled; // -> true
121
- * command.forceDisabled( 'MyFeature' );
122
- * command.isEnabled; // -> false
123
- * command.clearForceDisabled( 'MyFeature' );
124
- * command.isEnabled; // -> true
125
- * ```
126
- *
127
- * Command disabled by multiple features:
128
- *
129
- * ```ts
130
- * command.forceDisabled( 'MyFeature' );
131
- * command.forceDisabled( 'OtherFeature' );
132
- * command.clearForceDisabled( 'MyFeature' );
133
- * command.isEnabled; // -> false
134
- * command.clearForceDisabled( 'OtherFeature' );
135
- * command.isEnabled; // -> true
136
- * ```
137
- *
138
- * Multiple disabling with the same identifier is redundant:
139
- *
140
- * ```ts
141
- * command.forceDisabled( 'MyFeature' );
142
- * command.forceDisabled( 'MyFeature' );
143
- * command.clearForceDisabled( 'MyFeature' );
144
- * command.isEnabled; // -> true
145
- * ```
146
- *
147
- * **Note:** some commands or algorithms may have more complex logic when it comes to enabling or disabling certain commands,
148
- * so the command might be still disabled after {@link #clearForceDisabled} was used.
149
- *
150
- * @param id Unique identifier for disabling. Use the same id when {@link #clearForceDisabled enabling back} the command.
151
- */
152
- forceDisabled(id: string): void;
153
- /**
154
- * Clears forced disable previously set through {@link #forceDisabled}. See {@link #forceDisabled}.
155
- *
156
- * @param id Unique identifier, equal to the one passed in {@link #forceDisabled} call.
157
- */
158
- clearForceDisabled(id: string): void;
159
- /**
160
- * Executes the command.
161
- *
162
- * A command may accept parameters. They will be passed from {@link module:core/editor/editor~Editor#execute `editor.execute()`}
163
- * to the command.
164
- *
165
- * The `execute()` method will automatically abort when the command is disabled ({@link #isEnabled} is `false`).
166
- * This behavior is implemented by a high priority listener to the {@link #event:execute} event.
167
- *
168
- * In order to see how to disable a command from "outside" see the {@link #isEnabled} documentation.
169
- *
170
- * This method may return a value, which would be forwarded all the way down to the
171
- * {@link module:core/editor/editor~Editor#execute `editor.execute()`}.
172
- *
173
- * @fires execute
174
- */
175
- execute(...args: Array<unknown>): unknown;
176
- /**
177
- * Destroys the command.
178
- */
179
- destroy(): void;
180
- }
181
- /**
182
- * Event fired by the {@link module:core/command~Command#execute} method. The command action is a listener to this event so it's
183
- * possible to change/cancel the behavior of the command by listening to this event.
184
- *
185
- * See {@link module:utils/observablemixin~Observable#decorate} for more information and samples.
186
- *
187
- * **Note:** This event is fired even if command is disabled. However, it is automatically blocked
188
- * by a high priority listener in order to prevent command execution.
189
- *
190
- * @eventName ~Command#execute
191
- */
192
- export type CommandExecuteEvent = DecoratedMethodEvent<Command, 'execute'>;
193
- export {};
@@ -1,87 +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 type Command from './command.js';
10
- /**
11
- * Collection of commands. Its instance is available in {@link module:core/editor/editor~Editor#commands `editor.commands`}.
12
- */
13
- export default class CommandCollection implements Iterable<[string, Command]> {
14
- /**
15
- * Command map.
16
- */
17
- private _commands;
18
- /**
19
- * Creates collection instance.
20
- */
21
- constructor();
22
- /**
23
- * Registers a new command.
24
- *
25
- * @param commandName The name of the command.
26
- */
27
- add<TName extends string>(commandName: TName, command: CommandsMap[TName]): void;
28
- /**
29
- * Retrieves a command from the collection.
30
- *
31
- * @param commandName The name of the command.
32
- */
33
- get<TName extends string>(commandName: TName): CommandsMap[TName] | undefined;
34
- /**
35
- * Executes a command.
36
- *
37
- * @param commandName The name of the command.
38
- * @param commandParams Command parameters.
39
- * @returns The value returned by the {@link module:core/command~Command#execute `command.execute()`}.
40
- */
41
- execute<TName extends string>(commandName: TName, ...commandParams: Parameters<CommandsMap[TName]['execute']>): ReturnType<CommandsMap[TName]['execute']>;
42
- /**
43
- * Returns iterator of command names.
44
- */
45
- names(): IterableIterator<string>;
46
- /**
47
- * Returns iterator of command instances.
48
- */
49
- commands(): IterableIterator<Command>;
50
- /**
51
- * Iterable interface.
52
- *
53
- * Returns `[ commandName, commandInstance ]` pairs.
54
- */
55
- [Symbol.iterator](): Iterator<[string, Command]>;
56
- /**
57
- * Destroys all collection commands.
58
- */
59
- destroy(): void;
60
- }
61
- /**
62
- * Helper type that maps command names to their types.
63
- * It is meant to be extended with module augmentation.
64
- *
65
- * ```ts
66
- * class MyCommand extends Command {
67
- * public execute( parameter: A ): B {
68
- * // ...
69
- * }
70
- * }
71
- *
72
- * declare module '@ckeditor/ckeditor5-core' {
73
- * interface CommandsMap {
74
- * myCommand: MyCommand;
75
- * }
76
- * }
77
- *
78
- * // Returns `MyCommand | undefined`.
79
- * const myCommand = editor.commands.get( 'myCommand' );
80
- *
81
- * // Expects `A` type as parameter and returns `B`.
82
- * const value = editor.commands.execute( 'myCommand', new A() );
83
- * ```
84
- */
85
- export interface CommandsMap {
86
- [name: string]: Command;
87
- }
package/dist/context.d.ts DELETED
@@ -1,241 +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/context
11
- */
12
- import { Config, Collection, Locale, type LocaleTranslate } from '@ckeditor/ckeditor5-utils';
13
- import PluginCollection from './plugincollection.js';
14
- import type Editor from './editor/editor.js';
15
- import type { LoadedPlugins, PluginConstructor } from './plugin.js';
16
- import type { EditorConfig } from './editor/editorconfig.js';
17
- /**
18
- * Provides a common, higher-level environment for solutions that use multiple {@link module:core/editor/editor~Editor editors}
19
- * or plugins that work outside the editor. Use it instead of {@link module:core/editor/editor~Editor.create `Editor.create()`}
20
- * in advanced application integrations.
21
- *
22
- * All configuration options passed to a context will be used as default options for the editor instances initialized in that context.
23
- *
24
- * {@link module:core/contextplugin~ContextPlugin Context plugins} passed to a context instance will be shared among all
25
- * editor instances initialized in this context. These will be the same plugin instances for all the editors.
26
- *
27
- * **Note:** The context can only be initialized with {@link module:core/contextplugin~ContextPlugin context plugins}
28
- * (e.g. [comments](https://ckeditor.com/collaboration/comments/)). Regular {@link module:core/plugin~Plugin plugins} require an
29
- * editor instance to work and cannot be added to a context.
30
- *
31
- * **Note:** You can add a context plugin to an editor instance, though.
32
- *
33
- * If you are using multiple editor instances on one page and use any context plugins, create a context to share the configuration and
34
- * plugins among these editors. Some plugins will use the information about all existing editors to better integrate between them.
35
- *
36
- * If you are using plugins that do not require an editor to work (e.g. [comments](https://ckeditor.com/collaboration/comments/)),
37
- * enable and configure them using the context.
38
- *
39
- * If you are using only a single editor on each page, use {@link module:core/editor/editor~Editor.create `Editor.create()`} instead.
40
- * In such a case, a context instance will be created by the editor instance in a transparent way.
41
- *
42
- * See {@link ~Context.create `Context.create()`} for usage examples.
43
- */
44
- export default class Context {
45
- /**
46
- * Stores all the configurations specific to this context instance.
47
- */
48
- readonly config: Config<ContextConfig>;
49
- /**
50
- * The plugins loaded and in use by this context instance.
51
- */
52
- readonly plugins: PluginCollection<Context | Editor>;
53
- readonly locale: Locale;
54
- /**
55
- * Shorthand for {@link module:utils/locale~Locale#t}.
56
- */
57
- readonly t: LocaleTranslate;
58
- /**
59
- * A list of editors that this context instance is injected to.
60
- */
61
- readonly editors: Collection<Editor>;
62
- /**
63
- * The default configuration which is built into the `Context` class.
64
- *
65
- * It is used in CKEditor 5 builds featuring `Context` to provide the default configuration options which are later used during the
66
- * context initialization.
67
- *
68
- * ```ts
69
- * Context.defaultConfig = {
70
- * foo: 1,
71
- * bar: 2
72
- * };
73
- *
74
- * Context
75
- * .create()
76
- * .then( context => {
77
- * context.config.get( 'foo' ); // -> 1
78
- * context.config.get( 'bar' ); // -> 2
79
- * } );
80
- *
81
- * // The default options can be overridden by the configuration passed to create().
82
- * Context
83
- * .create( { bar: 3 } )
84
- * .then( context => {
85
- * context.config.get( 'foo' ); // -> 1
86
- * context.config.get( 'bar' ); // -> 3
87
- * } );
88
- * ```
89
- *
90
- * See also {@link module:core/context~Context.builtinPlugins `Context.builtinPlugins`}
91
- * and {@link module:core/editor/editor~Editor.defaultConfig `Editor.defaultConfig`}.
92
- */
93
- static defaultConfig: ContextConfig;
94
- /**
95
- * An array of plugins built into the `Context` class.
96
- *
97
- * It is used in CKEditor 5 builds featuring `Context` to provide a list of context plugins which are later automatically initialized
98
- * during the context initialization.
99
- *
100
- * They will be automatically initialized by `Context` unless `config.plugins` is passed.
101
- *
102
- * ```ts
103
- * // Build some context plugins into the Context class first.
104
- * Context.builtinPlugins = [ FooPlugin, BarPlugin ];
105
- *
106
- * // Normally, you need to define config.plugins, but since Context.builtinPlugins was
107
- * // defined, now you can call create() without any configuration.
108
- * Context
109
- * .create()
110
- * .then( context => {
111
- * context.plugins.get( FooPlugin ); // -> An instance of the Foo plugin.
112
- * context.plugins.get( BarPlugin ); // -> An instance of the Bar plugin.
113
- * } );
114
- * ```
115
- *
116
- * See also {@link module:core/context~Context.defaultConfig `Context.defaultConfig`}
117
- * and {@link module:core/editor/editor~Editor.builtinPlugins `Editor.builtinPlugins`}.
118
- */
119
- static builtinPlugins: Array<PluginConstructor<Context | Editor>>;
120
- /**
121
- * Reference to the editor which created the context.
122
- * Null when the context was created outside of the editor.
123
- *
124
- * It is used to destroy the context when removing the editor that has created the context.
125
- */
126
- private _contextOwner;
127
- /**
128
- * Creates a context instance with a given configuration.
129
- *
130
- * Usually not to be used directly. See the static {@link module:core/context~Context.create `create()`} method.
131
- *
132
- * @param config The context configuration.
133
- */
134
- constructor(config?: ContextConfig);
135
- /**
136
- * Loads and initializes plugins specified in the configuration.
137
- *
138
- * @returns A promise which resolves once the initialization is completed, providing an array of loaded plugins.
139
- */
140
- initPlugins(): Promise<LoadedPlugins>;
141
- /**
142
- * Destroys the context instance and all editors used with the context,
143
- * releasing all resources used by the context.
144
- *
145
- * @returns A promise that resolves once the context instance is fully destroyed.
146
- */
147
- destroy(): Promise<unknown>;
148
- /**
149
- * Adds a reference to the editor which is used with this context.
150
- *
151
- * When the given editor has created the context, the reference to this editor will be stored
152
- * as a {@link ~Context#_contextOwner}.
153
- *
154
- * This method should only be used by the editor.
155
- *
156
- * @internal
157
- * @param isContextOwner Stores the given editor as a context owner.
158
- */
159
- _addEditor(editor: Editor, isContextOwner: boolean): void;
160
- /**
161
- * Removes a reference to the editor which was used with this context.
162
- * When the context was created by the given editor, the context will be destroyed.
163
- *
164
- * This method should only be used by the editor.
165
- *
166
- * @internal
167
- * @return A promise that resolves once the editor is removed from the context or when the context was destroyed.
168
- */
169
- _removeEditor(editor: Editor): Promise<unknown>;
170
- /**
171
- * Returns the context configuration which will be copied to the editors created using this context.
172
- *
173
- * The configuration returned by this method has the plugins configuration removed &ndash; plugins are shared with all editors
174
- * through another mechanism.
175
- *
176
- * This method should only be used by the editor.
177
- *
178
- * @internal
179
- * @returns Configuration as a plain object.
180
- */
181
- _getEditorConfig(): Partial<EditorConfig>;
182
- /**
183
- * Creates and initializes a new context instance.
184
- *
185
- * ```ts
186
- * const commonConfig = { ... }; // Configuration for all the plugins and editors.
187
- * const editorPlugins = [ ... ]; // Regular plugins here.
188
- *
189
- * Context
190
- * .create( {
191
- * // Only context plugins here.
192
- * plugins: [ ... ],
193
- *
194
- * // Configure the language for all the editors (it cannot be overwritten).
195
- * language: { ... },
196
- *
197
- * // Configuration for context plugins.
198
- * comments: { ... },
199
- * ...
200
- *
201
- * // Default configuration for editor plugins.
202
- * toolbar: { ... },
203
- * image: { ... },
204
- * ...
205
- * } )
206
- * .then( context => {
207
- * const promises = [];
208
- *
209
- * promises.push( ClassicEditor.create(
210
- * document.getElementById( 'editor1' ),
211
- * {
212
- * editorPlugins,
213
- * context
214
- * }
215
- * ) );
216
- *
217
- * promises.push( ClassicEditor.create(
218
- * document.getElementById( 'editor2' ),
219
- * {
220
- * editorPlugins,
221
- * context,
222
- * toolbar: { ... } // You can overwrite the configuration of the context.
223
- * }
224
- * ) );
225
- *
226
- * return Promise.all( promises );
227
- * } );
228
- * ```
229
- *
230
- * @param config The context configuration.
231
- * @returns A promise resolved once the context is ready. The promise resolves with the created context instance.
232
- */
233
- static create(config?: ContextConfig): Promise<Context>;
234
- }
235
- /**
236
- * The context configuration.
237
- */
238
- export type ContextConfig = {
239
- plugins?: Array<PluginConstructor<Context | Editor>>;
240
- substitutePlugins?: Array<PluginConstructor<Context | Editor>>;
241
- } & Omit<EditorConfig, 'plugins' | 'substitutePlugins' | 'removePlugins' | 'extraPlugins'>;
@@ -1,73 +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/contextplugin
11
- */
12
- import { type Collection, type Config, type Locale, type LocaleTranslate } from '@ckeditor/ckeditor5-utils';
13
- import type Editor from './editor/editor.js';
14
- import type { EditorConfig } from './editor/editorconfig.js';
15
- import type Context from './context.js';
16
- import type { PluginDependencies, PluginInterface } from './plugin.js';
17
- import type PluginCollection from './plugincollection.js';
18
- declare const ContextPlugin_base: {
19
- new (): import("@ckeditor/ckeditor5-utils").Observable;
20
- prototype: import("@ckeditor/ckeditor5-utils").Observable;
21
- };
22
- /**
23
- * The base class for {@link module:core/context~Context} plugin classes.
24
- *
25
- * A context plugin can either be initialized for an {@link module:core/editor/editor~Editor editor} or for
26
- * a {@link module:core/context~Context context}. In other words, it can either
27
- * work within one editor instance or with one or more editor instances that use a single context.
28
- * It is the context plugin's role to implement handling for both modes.
29
- *
30
- * There are a few rules for interaction between the editor plugins and context plugins:
31
- *
32
- * * A context plugin can require another context plugin.
33
- * * An {@link module:core/plugin~Plugin editor plugin} can require a context plugin.
34
- * * A context plugin MUST NOT require an {@link module:core/plugin~Plugin editor plugin}.
35
- */
36
- export default class ContextPlugin extends /* #__PURE__ */ ContextPlugin_base implements PluginInterface {
37
- /**
38
- * The context or editor instance.
39
- */
40
- readonly context: ContextInterface;
41
- /**
42
- * Creates a new plugin instance.
43
- */
44
- constructor(context: Context | Editor);
45
- /**
46
- * @inheritDoc
47
- */
48
- destroy(): void;
49
- /**
50
- * @inheritDoc
51
- */
52
- static get isContextPlugin(): true;
53
- /**
54
- * @inheritDoc
55
- */
56
- static get isOfficialPlugin(): boolean;
57
- /**
58
- * @inheritDoc
59
- */
60
- static get isPremiumPlugin(): boolean;
61
- }
62
- /**
63
- * The common interface of {@link module:core/context~Context} and {@link module:core/editor/editor~Editor}.
64
- */
65
- export interface ContextInterface {
66
- config: Config<Omit<EditorConfig, 'plugins' | 'substitutePlugins' | 'removePlugins' | 'extraPlugins'>>;
67
- plugins: PluginCollection<Context | Editor>;
68
- locale: Locale;
69
- t: LocaleTranslate;
70
- editors?: Collection<Editor>;
71
- }
72
- export type ContextPluginDependencies = PluginDependencies<Context | Editor>;
73
- export {};
@@ -1,60 +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/editingkeystrokehandler
11
- */
12
- import { KeystrokeHandler, type PriorityString } from '@ckeditor/ckeditor5-utils';
13
- import type Editor from './editor/editor.js';
14
- /**
15
- * A keystroke handler for editor editing. Its instance is available
16
- * in {@link module:core/editor/editor~Editor#keystrokes} so plugins
17
- * can register their keystrokes.
18
- *
19
- * E.g. an undo plugin would do this:
20
- *
21
- * ```ts
22
- * editor.keystrokes.set( 'Ctrl+Z', 'undo' );
23
- * editor.keystrokes.set( 'Ctrl+Shift+Z', 'redo' );
24
- * editor.keystrokes.set( 'Ctrl+Y', 'redo' );
25
- * ```
26
- */
27
- export default class EditingKeystrokeHandler extends KeystrokeHandler {
28
- /**
29
- * The editor instance.
30
- */
31
- readonly editor: Editor;
32
- /**
33
- * Creates an instance of the keystroke handler.
34
- */
35
- constructor(editor: Editor);
36
- /**
37
- * Registers a handler for the specified keystroke.
38
- *
39
- * The handler can be specified as a command name or a callback.
40
- *
41
- * @param keystroke Keystroke defined in a format accepted by
42
- * the {@link module:utils/keyboard~parseKeystroke} function.
43
- * @param callback If a string is passed, then the keystroke will
44
- * {@link module:core/editor/editor~Editor#execute execute a command}.
45
- * If a function, then it will be called with the
46
- * {@link module:engine/view/observer/keyobserver~KeyEventData key event data} object and
47
- * a `cancel()` helper to both `preventDefault()` and `stopPropagation()` of the event.
48
- * @param options Additional options.
49
- * @param options.priority The priority of the keystroke callback. The higher the priority value
50
- * the sooner the callback will be executed. Keystrokes having the same priority
51
- * are called in the order they were added.
52
- */
53
- set(keystroke: string | Array<string | number>, callback: EditingKeystrokeCallback, options?: {
54
- readonly priority?: PriorityString;
55
- }): void;
56
- }
57
- /**
58
- * Command name or a callback to be executed when a given keystroke is pressed.
59
- */
60
- export type EditingKeystrokeCallback = string | ((ev: KeyboardEvent, cancel: () => void) => void);